Char chunking doesn't quote column name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Daniel Nichter | ||
2.0 |
Fix Released
|
Medium
|
Daniel Nichter | ||
2.1 |
Fix Released
|
Medium
|
Daniel Nichter |
Bug Description
received this error from pt-table-sync:
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 'key)) FROM `<database>
the paramater to the 'LENGTH' function needs quoting.
here is a patch:
*** modified/
--- original/
*************** sub _chunk_char {
*** 3309,3315 ****
PTDEBUG && _d("Base", $base, "chars:", @chars);
! $sql = "SELECT MAX(LENGTH(
. ($args{where} ? "WHERE $args{where} " : "")
. "ORDER BY `$chunk_col`";
PTDEBUG && _d($dbh, $sql);
--- 3309,3315 ----
PTDEBUG && _d("Base", $base, "chars:", @chars);
! $sql = "SELECT MAX(LENGTH(
. ($args{where} ? "WHERE $args{where} " : "")
. "ORDER BY `$chunk_col`";
PTDEBUG && _d($dbh, $sql);
Related branches
- Daniel Nichter: Approve
- Diff: 0 lines
- Daniel Nichter: Approve
summary: |
- quotes missing from sql statement + Char chunking doesn't quote column name |
Thanks for the bug report. This is a problem in all of the tools that use TableChunker.