diff --git a/Changes b/Changes index 9bed67e..c2e1e93 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,8 @@ Changes for Perl extension DBD-SQLite 1.30_02 to be released - Implemented sqlite_use_immediate_transaction database handle attribute to avoid deadlocks easily (ISHIGAKI) + - Resolved #55466: Problem with names in DB that using square + bracers (ISHIGAKI) 1.30_01 Wed 10 Mar 2010 *** CHANGES THAT MAY POSSIBLY BREAK YOUR OLD APPLICATIONS *** diff --git a/lib/DBD/SQLite.pm b/lib/DBD/SQLite.pm index 9236bcf..0ef63ab 100644 --- a/lib/DBD/SQLite.pm +++ b/lib/DBD/SQLite.pm @@ -368,6 +368,7 @@ sub primary_key_info { my $key_seq = 0; foreach my $pk_field (@pk) { $pk_field =~ s/(["'`])(.+)\1/$2/; # dequote + $pk_field =~ s/\[(.+)\]/$1/; # dequote push @pk_info, { TABLE_SCHEM => $row->{TABLE_SCHEM}, TABLE_NAME => $row->{TABLE_NAME}, diff --git a/t/42_primary_key_info.t b/t/42_primary_key_info.t index 6e00765..5d7108f 100644 --- a/t/42_primary_key_info.t +++ b/t/42_primary_key_info.t @@ -10,12 +10,13 @@ use t::lib::Test qw/connect_ok/; use Test::More; use Test::NoWarnings; -plan tests => 4 * 5 + 1; +plan tests => 5 * 5 + 1; -for my $quote ('', qw/' " `/) { +for my $quote ('', qw/' " ` []/) { + my ($begin_quote, $end_quote) = (substr($quote, 0, 1), substr($quote, -1, 1)); my $dbh = connect_ok( RaiseError => 1 ); ok $dbh->do( - "create table ${quote}foo${quote} (${quote}id${quote} integer primary key)" + "create table ${begin_quote}foo${end_quote} (${begin_quote}id${end_quote} integer primary key)" ); my $sth = $dbh->primary_key_info(undef, undef, 'foo'); my $pk = $sth->fetchrow_hashref;