Subject: | bug when inserting escaped single quotes |
Hi Matt. Found something interesting in SQLite.
I _think_ it is a bug (version 0.10)...
##########################################################
use strict;
use DBI;
use Data::Dumper;
unlink 'new.dbm' if -e 'new.dbm';
my $dbh = DBI->connect(
("DBI:SQLite:dbname=new.dbm"),
{RaiseError=>1}
);
# ok
$dbh->do('create table foo (bar varchar(32))');
# ok
$dbh->do("insert into foo(bar) values('baz')");
# bad
$dbh->do(q|insert into foo(bar) values('baz\'ed')|;
print Dumper $dbh->selectall_arrayref('select * from foo');
###########################################################
I also tried this using placeholders and had no troubles,
but since i am shoving the output of mysqldump into DBI::do(),
placeholders won't cut the mustard.
Thanks,
jeffa