Hi,
On 19 Agu 2011, at 13:57, Thilanka Kaushalya lgtkaushalya@gmail.com wrote:
Hi Marc,
I found the place where this issue generates. When we try click on Table->Structure->Column->Change link it goes to the tbl_alter.php file and within that the "append_fields_form" is process by using tbl_properties.inc.php file. At line number 325 in tbl_properties.inc.php "PMA_getSupportedDatatypes(true, $type_upper);" function is call to get the table type select options.
You can find at line 3118 in "PMA_getSupportedDatatypes(true, $type_upper);" the option selection is set as if ($selected == $value) { $retval .= "<option selected='selected'>$value</option>"; } else { $retval .= "<option>$value</option>"; } But if you use an echo you can see that $selected contains VARCHAR(45)as the value and $value contains VARCHAR as the value. So when we try to edit the tables which are having VARCHAR type columns it does not select the value at the options.
I can modify the logic by splitting the $selected by "(" and solve the issue. Is there any better solution you can suggest. If there any please let me know. Thank you.
I did a bisecting in the official branch (using "git bisect" command) and found that 48149c261c633baf517455079a2524a9a9aac6a0 (message: "Use already calculated values", by Michal) is the first bad commit. Hope this helps.
-- Aris Feryanto
Le 2011-08-19 03:46, Aris Feryanto a écrit :
I did a bisecting in the official branch (using "git bisect" command) and found that 48149c261c633baf517455079a2524a9a9aac6a0 (message: "Use already calculated values", by Michal) is the first bad commit. Hope this helps.
Yes this helps.
Michal, did you commit this to fix a bug or for optimization?
Hi Marc and Aris,
Thank Aris for helping me on this and it was very useful for me.
I went through the commit and found it has replaces some code segments in tbl_properties.inc.php file and also introduced some new lines to file. Out of those newly introduce lines we get " $type = $extracted_fieldspec['print_type'];" in line number 301 which overrides the $type variable value from "*varchar*" to "*varchar(45)*". I have commented that line and tested the feature and it worked correctly for loading the "VARCHAR" type in change table. But I cannot understand why it uses "*$type = $extracted_fieldspec['print_type']*" instead of "$type = $extracted_fieldspec['type'];". Thank you.
Regards, Thilanka.
Hi
Dne Sat, 20 Aug 2011 22:32:40 +0530 Thilanka Kaushalya lgtkaushalya@gmail.com napsal(a):
Thank Aris for helping me on this and it was very useful for me.
I went through the commit and found it has replaces some code segments in tbl_properties.inc.php file and also introduced some new lines to file. Out of those newly introduce lines we get " $type = $extracted_fieldspec['print_type'];" in line number 301 which overrides the $type variable value from "*varchar*" to "*varchar(45)*". I have commented that line and tested the feature and it worked correctly for loading the "VARCHAR" type in change table. But I cannot understand why it uses "*$type = $extracted_fieldspec['print_type']*" instead of "$type = $extracted_fieldspec['type'];". Thank you.
Probably bug introduced by myself, by not reading rest of the code. Feel free to change that.
Hi
Dne Sat, 20 Aug 2011 07:17:48 -0400 Marc Delisle marc@infomarc.info napsal(a):
Le 2011-08-19 03:46, Aris Feryanto a écrit :
I did a bisecting in the official branch (using "git bisect" command) and found that 48149c261c633baf517455079a2524a9a9aac6a0 (message: "Use already calculated values", by Michal) is the first bad commit. Hope this helps.
Yes this helps.
Michal, did you commit this to fix a bug or for optimization?
It was cleanup (the field specs were parsed on dozen places and I've implemented generic function to do that and use results in all places). It looks like I wrongly understood original code, but it should be fixed now. Please let me know if there is anything broken with handling field types.