Comment 2 for bug 1060774

Revision history for this message
Daniel Nichter (daniel-nichter) wrote : Re: pt-upgrade fails on a select query

Which versions of MySQL are you using? I'm getting a similar error with two 5.1 instances:

Failed to execute query: DBD::mysql::db do failed: Incorrect column name '(UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP('2012-09-16 10:16:36')) / 60' [for Statement "CREATE TEMPORARY TABLE `foo`.`mk_upgrade` AS SELECT (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP('2012-09-16 10:16:36')) / 60"] at /Users/daniel/Downloads/percona-toolkit-2.1.3/bin/pt-upgrade line 8766, <$fh> line 1.

Your error and that one probably have the same root cause: the tool is trying to create a temp table with a bad column (ident) name because it doesn't know that that expression isn't an ident and it's not escaping it. Parsing the SQL would help, but that's slow, so I'll have to think more about how to handle such cases.