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

pt-table-sync bad SQL query

techiegurltechiegurl EntrantInactive User Role Beginner
Hi,
I was just testing out pt-table-sync and was using this argument list

PTDEBUG=1 pt-table-sync --print --no-check-slave --replicate --tables=<table_name> h=<IP> h=<IP> h=<IP> > TS_db1_master

items in <> are placeholders :)

This errored out and I got the following in the debug output

# TableChecksum:4252 23295 SELECT db, tbl, CONCAT(db, '.', tbl) AS `table`, chunk, chunk_index, lower_boundary, upper_boundary, COALESCE(this_cnt-master_cnt, 0) AS cnt_diff, COALESCE(this_crc <> master_crc OR ISNULL(master_crc) <> ISNULL(this_crc), 0) AS crc_diff, this_cnt, master_cnt, this_crc, master_crc FROM --tables=category_stats WHERE master_cnt <> this_cnt OR master_crc <> this_crc OR ISNULL(master_crc) <> ISNULL(this_crc)
DBD::mysql::db selectall_arrayref 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 '--tables=category_stats WHERE master_cnt <> this_cnt OR master_crc <> this_crc O' at line 1 [for Statement "SELECT db, tbl, CONCAT(db, '.', tbl) AS `table`, chunk, chunk_index, lower_boundary, upper_boundary, COALESCE(this_cnt-master_cnt, 0) AS cnt_diff, COALESCE(this_crc <> master_crc OR ISNULL(master_crc) <> ISNULL(this_crc), 0) AS crc_diff, this_cnt, master_cnt, this_crc, master_crc FROM --tables=category_stats WHERE master_cnt <> this_cnt OR master_crc <> this_crc OR ISNULL(master_crc) <> ISNULL(this_crc)"] at /usr/bin/pt-table-sync line 4253.

Seems like it is passing --tables=table_name as a whole and not just the arg?

This is the latest version of the toolkit...I don't believe there is a bug for this already and I wanted confirmation of it being a bug first :)

Comments

  • techiegurltechiegurl Entrant Inactive User Role Beginner
    Running this without the equal sign "--tables <table_name> made matters worse....now the tool thinks the table name is a host so it stops at that error...could this be an argument order issue?
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.