pt-duplicate-key-checker doesn't support triple quote in column name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Daniel Nichter |
Bug Description
mysql> CREATE TABLE order_new (
-> `id` int(20) DEFAULT NULL,
-> `code` varchar(20) DEFAULT NULL,
-> `date` datetime DEFAULT NULL,
-> ```Size_Change``` double(6,4) NOT NULL DEFAULT '0.0000',
-> `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
-> KEY `indx_updated` (`updated`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
nilnandan@
Can't determine column type for ```size_change``` double(6,4) not null default '0.0000' at /usr/bin/
nilnandan@
Workaround can be,
nilnandan@
# #######
# Summary of indexes
# #######
# Total Indexes 55
nilnandan@
description: | updated |
tags: | added: i55250 |
Changed in percona-toolkit: | |
status: | New → Confirmed |
Changed in percona-toolkit: | |
milestone: | none → 2.2.15 |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
I can suggested some stupid straightforward patch:
[openxs@chief percona- toolkit- 2.2]$ bzr diff duplicate- key-checker' duplicate- key-checker 2015-01-23 10:19:56 +0000 duplicate- key-checker 2015-06-08 08:54:54 +0000 +`\s([a- z]+)/; +`\s([a- z]+)/; `]+```\ s([a-z] +)/; +`\s([a- z]+)/;
$type_for{ $col} = $type; :tiny|big| medium| small)? int|float| double| decimal| year)/ ) {
=== modified file 'bin/pt-
--- bin/pt-
+++ bin/pt-
@@ -356,7 +356,12 @@
my (%type_for, %is_nullable, %is_numeric, %is_autoinc);
foreach my $col ( @cols ) {
my $def = $def_for{$col};
- my ( $type ) = $def =~ m/`[^`]
+ my ( $type );
+ ($type) = $def =~ m/`[^`]
+ unless ($type) {
+ ($type) = $def =~ m/```[^
+ }
+# my ( $type ) = $def =~ m/`[^`]
die "Can't determine column type for $def" unless $type;
if ( $type =~ m/(?:(?