SQLParser is broken . fails to parse query with == into it
Bug #1272069 reported by
Vishal Kumar
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-
I fixed this by using
use Text::ParseWords;
use String::Util 'trim';
and replacing :
my $vals = $self->
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) |
To post a comment you must log in.
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PT-1203