Not the answer you need?
Register and ask your own question!

pt-online-schema-change stops with EXPLAIN statement error in Percona Toolkit 2.2.17

sps0511sps0511 EntrantCurrent User Role Beginner
I want to alter the Primary key of a table using pt-online-schema change tool on MySQL 5.5 Master DB. I tested out two different versions of Percona. Version 2.1.0 worked correctly and changed the schema of the table. However, 2.2.17 does not work, and gives me this error:

2016-12-22T20:06:33 Error copying rows from `management`.`table1` to `management`.`_table1_new`: Error executing EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `column1`, `column1`, `column2`, `column1`, `column2`, `column3` FROM `management`.`table1` FORCE INDEX(`PRIMARY`) WHERE ((`column1` > ?) OR (`column1` = ? AND `column2` > ?) OR (`column1` = ? AND `column2` = ? AND `column3` >= ?)) ORDER BY `column1`, `column2`, `column3` LIMIT ?, 2 /*next chunk boundary*/: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''999', 2 /*next chunk boundary*/' at line 1 [for Statement "EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `column1`, `column1`, `column2`, `column1`, `column2`, `column3` FROM `management`.`table1` FORCE INDEX(`PRIMARY`) WHERE ((`column1` > ?) OR (`column1` = ? AND `column2` > ?) OR (`column1` = ? AND `column2` = ? AND `column3` >= ?)) ORDER BY `column1`, `column2`, `column3` LIMIT ?, 2 /*next chunk boundary*/"] at PerconaToolkit2.2.17/bin/pt-online-schema-change line 10883, <STDIN> line 1.

The command I am using to test is:

PerconaToolkit2.2.17/bin/pt-online-schema-change --ask-pass --host=localhost --port=8895 --socket=/Database1/mysql/state/mysql.sock --user=root --print --progress=percentage,1 --execute --nocheck-alter --alter "DROP PRIMARY KEY, ADD PRIMARY KEY (column1, column2, column3, column4)" D=management,t=table1

Can you help me out to check whats the issue here ?

Comments

  • sps0511sps0511 Entrant Current User Role Beginner
    What I think is happening here is that its not able to get the values in the placeholders '?', due to which the statements contain '?' which gives a syntax error. What could be the reason for the tool not taking the values into the queries ? Is any configuration missing ?
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.