Skip to content

Commit

Permalink
Remove trailing ; in statements before parsing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
H.Merijn Brand - Tux committed Apr 23, 2016
1 parent df9b142 commit 7af2dd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -21,6 +21,7 @@ DBI::Changes - List of significant changes to the DBI
Ceased to ignore DESTROY of outer handle in DBI::PurePerl
Treat undef in DBI::Profile Path as string "undef"
thanks to fREW Schmidt RT#113298
Remove trailing semicolon in SQL::Nano parser

Added @ary = $dbh->selectall_array(...) method
thanks to Ed Avis RT#106411
Expand Down
1 change: 1 addition & 0 deletions lib/DBI/SQL/Nano.pm
Expand Up @@ -76,6 +76,7 @@ sub prepare
{
my ( $self, $sql ) = @_;
$sql =~ s/\s+$//;
$sql =~ s/\s*;$//;
for ($sql)
{
/^\s*CREATE\s+TABLE\s+(.*?)\s*\((.+)\)\s*$/is
Expand Down

0 comments on commit 7af2dd7

Please sign in to comment.