pt-table-checksum error when column name has two spaces

Bug #932442 reported by Mrten
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Daniel Nichter

Bug Description

This is my table:

CREATE TABLE `bedrijven2011_20110329` (
 `BEDRIJF-ID` int(10) DEFAULT NULL,
 `AJB Vermelding-ID` int(10) NOT NULL AUTO_INCREMENT,
 `Afval Jaarboek` varchar(20) DEFAULT NULL,
 `Vet` tinyint(1) NOT NULL,
[trimmed for brevity]
 PRIMARY KEY (`AJB Vermelding-ID`)
) ENGINE=MyISAM AUTO_INCREMENT=1419 DEFAULT CHARSET=latin1

This is the error:

Error checksumming table afval.bedrijven_import: Error executing checksum query: DBD::mysql::st execute failed: Unknown column 'afval jaarboek' in 'field list' [for Statement "REPLACE INTO `maatkit`.`pt_checksum` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(MURMUR_HASH(CONCAT_WS('#', `bedrijf-id`, `ajb vermelding-id`, `afval jaarboek`, `vet`, `logo`, `logo_yes_no`, `ajb bedrijf`, `ajb postadres`, `ajb pc en plaats`, `ajb land`, `ajb telefoon`, `ajb telefax`, `ajb e-mail`, `ajb internet`, `certificaten`, `merken`, `informatie`, `foto`, `gem provincie`, `huishoudens`, `inzameldienst`, `diftar`, `actief`, `status`, `modifier`, `modification`, `creator`, `creation`, CONCAT(ISNULL(`bedrijf-id`), ISNULL(`afval jaarboek`), ISNULL(`logo`), ISNULL(`ajb bedrijf`), ISNULL(`ajb postadres`), ISNULL(`ajb pc en plaats`), ISNULL(`ajb land`), ISNULL(`ajb telefoon`), ISNULL(`ajb telefax`), ISNULL(`ajb e-mail`), ISNULL(`ajb internet`), ISNULL(`certificaten`), ISNULL(`merken`), ISNULL(`informatie`), ISNULL(`foto`), ISNULL(`gem provincie`), ISNULL(`huishoudens`), ISNULL(`inzameldienst`), ISNULL(`diftar`), ISNULL(`actief`), ISNULL(`modifier`), ISNULL(`modification`), ISNULL(`creator`), ISNULL(`creation`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `afval`.`bedrijven_import` /*checksum table*/" with ParamValues: 0='afval', 1='bedrijven_import', 2=1, 3=undef, 4=undef, 5=undef] at /usr/bin/pt-table-checksum line 6865.

There are two spaces in the column definition of 'Afval Jaarboek', but there is only one in the resulting REPLACE INTO query.

tags: added: pt-table-checksum whitespace
Changed in percona-toolkit:
assignee: nobody → Daniel Nichter (daniel-nichter)
summary: - pt-table-checksum has error when columnname has two spaces
+ pt-table-checksum error when column name has two spaces
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

The problem is caused by this line in TableParser::get_create_table(): $href->{$key} =~ s/\b[ ]{2,}/ /g; That was introduced in r121 when pt-table-checksum 2.0 was merged. MySQLDump.pm was removed and TableParser.pm took over functions like get_create_table(). I probably flattened spaces to make testing consistent, but this shouldn't be done; the original MySQLDump::get_create_table() didn't alter the table def. So I'll fix this.

Changed in percona-toolkit:
milestone: none → 2.0.4
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Tested for TableParser.pm and pt-table-checksum and fixed. This will be in the next release, 2.0.4.

Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
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-474

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.