Some tools use VALUE instead of VALUES

Bug #918247 reported by David A Sinck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Wishlist
Daniel Nichter
1.0
Won't Fix
Wishlist
Daniel Nichter
2.0
Fix Released
Wishlist
Daniel Nichter

Bug Description

In version 1.0.2, pt-table-checksum seems to need an 'S' in a sql statement. In the bin/pt-table-checksum file, at or near line 2924:

original:
$sql = "INSERT INTO $tmp_db_tbl VALUE (CHAR(?))";

new:
$sql = "INSERT INTO $tmp_db_tbl VALUES (CHAR(?))";

This was against stock mysql 4.0.x/5.1.x checksum.

Given what I understand about the build process, it may be easier to find it in the else branch in sub _chunk_char.

I have not checked the 2.x version for similar mayhem.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

VALUE and VALUES are both valid. Is an error occurring?

tags: added: pt-table-sync wrong-sql
Revision history for this message
David A Sinck (bugs+ubuntu) wrote :

yes. mysql 4.0.27:

original version (database and table names substituted):

pt-table-checksum --chunk-size=10000 --chunk-size-limit=10 --databases-regex 'DB' --tables-regex '^TBL$' h=localhost --ask-pass
Enter password for localhost:
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 'VALUE (CHAR('48'))' at line 1 [for Statement "INSERT INTO `DB`.`__maatkit_char_chunking_map` VALUE (CHAR(?))" with ParamValues: 0=48] at line 2929 while doing DB.TBL

new version (per fix) runs without issue

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

We don't support MySQL 4.0 or 4.1, but it's easy enough to add an S, so I'll fix this and check the other tools, too. Thanks for reporting this.

tags: added: pt-table-checksum
removed: pt-table-sync
Changed in percona-toolkit:
status: New → Confirmed
assignee: nobody → Daniel Nichter (daniel-nichter)
Revision history for this message
David A Sinck (bugs+ubuntu) wrote :

I figured that'd be the case really. I don't want 4.0.x either but it's still in my lap ... for now.

Thanks!

Changed in percona-toolkit:
importance: Undecided → Wishlist
milestone: none → 2.0.3
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

There was only one case of VALUE: in TableChunker.pm.

Changed in percona-toolkit:
status: Confirmed → Fix Committed
summary: - pt-table-checksum sql error
+ Some tools us VALUE instead of VALUES
tags: added: pt-online-schema-change pt-table-sync pt-upgrade
summary: - Some tools us VALUE instead of VALUES
+ Some tools use VALUE instead of VALUES
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

TableChunker.pm is different in 1.0 and 2.0. This fixed will be released in 2.0.3 but there's no plan yet for another 1.0 release. Nonetheless, the latest 1.0 code can be downloaded directly from Launchpad.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-843

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.