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

How could I preserve char "%" in pt-find's exec option?

leafonswordleafonsword ContributorInactive User Role Beginner
I want to change a table to be a partition table,and I use char '%' to mod the primary key id:
pt-find --exec "ALTER TABLE %D.%N engine=spider PARTITION BY LIST ([B]crc32(id)%2[/B]) (PARTITION pt0 VALUES IN (0) COMMENT = 'database "%D", table "%N", server "test_1"' ENGINE = SPIDER, PARTITION pt2 VALUES IN (1) COMMENT = 'database "%D", table "%N", server "test_2"' ENGINE = SPIDER);"
but I got below error,from the error,char '%' was just been ignored:
DBD::mysql::db do 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 '2) (PARTITION pt0 VALUES IN (0) COMMENT = 'database `XXXXXX`, ta' at line 1 [for Statement "ALTER TABLE `XXXX`.`XXXX` engine=spider PARTITION BY LIST ([B]crc32(id)2[/B]) (PARTITION pt0 VALUES IN (0) COMMENT = 'database `XXXX`, table `XXXX`, server test_1' ENGINE = SPIDER, PARTITION pt2 VALUES IN (1) COMMENT = 'database `XXXX`, table `XXXX`, server test_2' ENGINE = SPIDER);"] at ./pt-find line 3820.
So how could I preserve char "%"?
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.