Sunday, August 2, 2009

Why Mysql

Description:
Linux: RedHat9; mysql 4.0; mysqlhotcopy 1.18; latest DBI and DBD; mysql installed from
binaries (not RPM); PERL,DBI and DBD compiled from cpan.

get_list_of_tables is returning quoted table names and looks like it is right according to
CPAN

>If $dbh->get_info(29) returns true (29 is >SQL_IDENTIFIER_QUOTE_CHAR) then the table
names are >constructed and quoted by /quote_identifier to ensure they >are usable even if
they contain whitespace or reserved >words etc.

after call to quote_names, table name looks like "`dbname`.``tblname``" and mysqlhotcopy
terminates with
DBD::mysql::db do failed: You have an error in your SQL syntax.

I had to change last line in quote_names from

return "`$db`.'$table'";
#to
return "`$db`.$table";

after this mysqlhotcopy was able to run

How to repeat:
Dual P3 933; RedHat 9 with minimal config; MYSQL 4.0 from mysql.com (binary install)
[mysqlhotcopy 1.18]

Compiled PERL from CPAN (LANG=C [not UTF])
Compiled DBI and DBD from CPAN

Suggested fix:
The described fix is good for my particular case, however on Solaris, you will need to
have
return "`$db`.'$table'";
for proper tablename quotation, I guess I will leave fix up to you.

No comments:

Post a Comment