Fix for 1037211: QueryParser fails to distill LOCK TABLES in lowercase

This commit is contained in:
Brian Fraser
2012-08-16 19:18:14 -03:00
parent 1481494ef1
commit c3fe755615
8 changed files with 21 additions and 23 deletions

View File

@@ -1097,10 +1097,9 @@ sub get_tables {
$query =~ s/ (?:LOW_PRIORITY|IGNORE|STRAIGHT_JOIN)//ig;
if ( $query =~ /^\s*LOCK TABLES/i ) {
if ( $query =~ s/^\s*LOCK TABLES\s+//i ) {
PTDEBUG && _d('Special table type: LOCK TABLES');
$query =~ s/^(\s*LOCK TABLES\s+)//;
$query =~ s/\s+(?:READ|WRITE|LOCAL)+\s*//g;
$query =~ s/\s+(?:READ(?:\s+LOCAL)?|WRITE)\s*//gi;
PTDEBUG && _d('Locked tables:', $query);
$query = "FROM $query";
}