mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 14:19:10 -04:00
DBD::SQLite: sqlite administrator uses square blackets to quote
This commit is contained in:
parent
80b0265961
commit
4a759c5bcc
3 changed files with 7 additions and 3 deletions
2
Changes
2
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 ***
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue