Gossamer Forum
Home : Products : Others : MySQLMan :

V. 1.07 has problems with brackets - How to fix it?

Quote Reply
V. 1.07 has problems with brackets - How to fix it?
I'm using MySQLMan v. 1.07. I did now notice, that this version has some problems with brackets in CREATE statements. When I create a Dumpfile including the CREATE statements, I get stuff like this:

...
category_id int(2)) NOT NULL auto_increment,
...

Notice the one opening bracket but the *two* closing brackets. If I want to import this dumpfile, I get errors from mysql, of course.

Somebody knows how (=where in the code) I can fix this? I'm too lazy to look for it myself. :-)

Also, I've noticed, that there is the same problem some times, when I click on the 'Change' link of a column in the 'Properties' dialog. In the field 'length' I get something like '4)'.

Thanks in advance. :-)
Christoph
Quote Reply
Re: [cseiler] V. 1.07 has problems with brackets - How to fix it? In reply to
Did you ever come up with a fix for this problem? I get the same problem when the type (int, etc.) preceeds "zerofill". I poked through the code but I can't figure out where the extra ')' is being added.

Regards,
Charlie
Quote Reply
Re: [piper] V. 1.07 has problems with brackets - How to fix it? In reply to
I found a workaround till it gets fixed. Around line 1918 in mysql.cgi you will see this code:
Code:
for (my $i=0; $i < $#tmp; $i++) {
if ($flag) { $length_set .= $tmp[$i]; }
if ($tmp[$i] eq '(') { $flag = 1;}
}



add this bit of code, unless $tmp[$i] eq ')', to the end of the first if statement so it looks like this:
Code:
for (my $i=0; $i < $#tmp; $i++) {
if ($flag) { $length_set .= $tmp[$i] unless $tmp[$i] eq ')'; }
if ($tmp[$i] eq '(') { $flag = 1;}
}



You can also use something like $new_lenght_set =~ s/\)//g; in that same sub just before it returns $new_lenght_set. I'm not sure which is faster. This is just a band-aid till someone can post a real solution.

Regards,
Charlie