SQLParser is broken . fails to parse query with == into it

Bug #1272069 reported by Vishal Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
New
Undecided
Muhammad Irfan

Bug Description

How to replicate :

use SQLParser;
my $query = "UPDATE `xyx_db`.`xyz_tab` SET `col1`='bla, bla. / bla & bla. bla. <==> bla', `col2`='Same bla, Inc. /bla & Co. bla Ltd. <==> bla', `col3`='XYXABC', `col4`='JLK', `col5`='MM', `col6`=' ', `col7`='' WHERE `col4`='JLK' LIMIT 1 /*percona-toolkit src_db:src_db: removing password, host, table and other misc info*/;";
my $sql_parser = new SQLParser();
my $struct = $sql_parser->parse($query);

I fixed this by using
use Text::ParseWords;
use String::Util 'trim';

and replacing :
my $vals = $self->_parse_csv($set, ( quoted_values => 1, ));
by :
my $vals = [ map { trim($_) } parse_line(',', 1, $set) ];
in sub_parse_set .

Hope that helps.

Thanks,
Vishal

Changed in percona-toolkit:
assignee: nobody → Muhammad Irfan (muhammad-irfan)
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-1203

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.