Removed a useless part of the regex that looked for something function-like, and made the NULL check case-insensitive

This commit is contained in:
Brian Fraser
2012-11-16 12:04:14 -03:00
parent c711c57859
commit 270a4710fb
3 changed files with 5 additions and 5 deletions

View File

@@ -4056,8 +4056,8 @@ sub determine_table_for_column {
sub _looks_like_column { sub _looks_like_column {
my $col = shift; my $col = shift;
return if $col eq '*' || $col eq 'NULL'; return if $col eq '*' || uc($col) eq 'NULL';
return if $col =~ /\A(?:\b[0-9]+\b|[^(]+\(|\@{1,2}.+)/; return if $col =~ /\A(?:\b[0-9]+\b|\@{1,2}.+)/;
return $col; return $col;
} }

View File

@@ -667,8 +667,8 @@ sub determine_table_for_column {
sub _looks_like_column { sub _looks_like_column {
my $col = shift; my $col = shift;
# NULL, numbers, variables and functions are definitely not columns # NULL, numbers, variables and functions are definitely not columns
return if $col eq '*' || $col eq 'NULL'; return if $col eq '*' || uc($col) eq 'NULL';
return if $col =~ /\A(?:\b[0-9]+\b|[^(]+\(|\@{1,2}.+)/; return if $col =~ /\A(?:\b[0-9]+\b|\@{1,2}.+)/;
return $col; return $col;
} }

View File

@@ -468,7 +468,7 @@ my @cases = (
}, },
{ {
name => 'Bug 937234: wrong RES.001', name => 'Bug 937234: wrong RES.001',
query => q{select NULL, 1, COUNT(*), @@time_zone, foo as field2 from t1 group by field2}, query => q{select NULL, null, 1, COUNT(*), @@time_zone, foo as field2 from t1 group by field2},
advice => [qw(CLA.001)], advice => [qw(CLA.001)],
}, },
{ {