Skip to content

Commit a503418

Browse files
author
H.Merijn Brand - Tux
committed
Remove trailing ; in statements before parsing
perl5-dbi/DBD-CSV#2 https://metacpan.org/pod/DBI#prepare Some command-line SQL tools use statement terminators, like a semicolon, to indicate the end of a statement. Such terminators should not normally be used with the DBI.
1 parent db278fb commit a503418

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/SQL/Parser.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ sub parse
6060
$self->dialect( $self->{dialect} ) unless ( $self->{dialect_set} );
6161
$sql =~ s/^\s+//;
6262
$sql =~ s/\s+$//;
63+
$sql =~ s/\s*;$//;
6364
$self->{struct} = { dialect => $self->{dialect} };
6465
$self->{tmp} = {};
6566
$self->{original_string} = $sql;

0 commit comments

Comments
 (0)