pt-upgrade failed on SELECT..INTO statements

This commit is contained in:
Frank Cizmich
2015-03-30 16:20:18 -03:00
parent 16a7ffa6f9
commit 162350a804
4 changed files with 82 additions and 4 deletions

View File

@@ -128,9 +128,11 @@ sub save {
}
else {
# Save rows, if any (i.e. if it's a SELECT statement).
# *except* if it's a SELECT...INTO (issue lp:1421781)
my $rows;
if ( my $sth = $results->{sth} ) {
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i ) {
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i
&& $event->{arg} !~ /INTO\s*(?:OUTFILE|DUMPFILE|@)/ ) {
$rows = $sth->fetchall_arrayref();
}
eval {