From de5dc8a45b49789151da1010e67f67d192a434f3 Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Wed, 25 Jan 2023 15:29:32 +0100 Subject: [PATCH 1/3] cleanup: remove useless trailing spaces --- lib/SQL/Parser.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SQL/Parser.pm b/lib/SQL/Parser.pm index 298bba3..ba86220 100644 --- a/lib/SQL/Parser.pm +++ b/lib/SQL/Parser.pm @@ -1181,7 +1181,7 @@ sub CREATE sub SET_CLAUSE_LIST { my ( $self, $set_string ) = @_; - my @sets = extract_multiple($set_string, [ + my @sets = extract_multiple($set_string, [ sub { my ($m, $r, $p) = extract_bracketed($_[0], "()", qr/[^,(]*/); (($p||'').($m||''), $r, ''); }, qr/([^,(]+)/, ], undef, 1); @@ -1881,7 +1881,7 @@ sub nongroup_numeric sub LITERAL_LIST { my ( $self, $str ) = @_; - my @tokens = extract_multiple($str, [ + my @tokens = extract_multiple($str, [ sub { my ($m, $r, $p) = extract_bracketed($_[0], "()", qr/[^,(]*/); (($p||'').($m||''), $r, ''); }, qr/([^,(]+)/, ], undef, 1); From 93b6a1c1e7628071d10420e57fb136f431f8586b Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Wed, 25 Jan 2023 15:32:15 +0100 Subject: [PATCH 2/3] match NATURAL keyword case-insensitive --- lib/SQL/Parser.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SQL/Parser.pm b/lib/SQL/Parser.pm index ba86220..d3be8a2 100644 --- a/lib/SQL/Parser.pm +++ b/lib/SQL/Parser.pm @@ -580,7 +580,7 @@ sub EXPLICIT_JOIN { ( $tableA, $remainder ) = $remainder =~ m/^(\S+) (.*)/i; } - if ( $remainder =~ m/^NATURAL (.+)/ ) + if ( $remainder =~ m/^NATURAL (.+)/i ) { $self->{struct}->{join}->{clause} = 'NATURAL'; $natural++; From 94ed1de87819afde6850d04522ce1e8a38692907 Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Wed, 25 Jan 2023 15:34:15 +0100 Subject: [PATCH 3/3] match IN and BETWEEN keywords case-insensitive --- lib/SQL/Parser.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SQL/Parser.pm b/lib/SQL/Parser.pm index d3be8a2..02e65b7 100644 --- a/lib/SQL/Parser.pm +++ b/lib/SQL/Parser.pm @@ -1568,7 +1568,7 @@ sub repl_btwin my @lids; my $i = -1; - while ( $str =~ m/\G.*(?:IN|BETWEEN)\s+\(/g ) + while ( $str =~ m/\G.*(?:IN|BETWEEN)\s+\(/gi ) { my $start = pos($str) - 1; my $lparens = 1;