diff --git a/Changes b/Changes index 579c42e..2123baf 100644 --- a/Changes +++ b/Changes @@ -22,9 +22,24 @@ Changes for Perl extension DBD-SQLite. - Resolved #32570: segmentation fault during tests 07 & 08 (ADAMK) - Resolved #41631: Dot doesn't work in quoted column aliases (ADAMK) - Resolved #403: test failure on "Testing select speed (large table) (ADAMK) + - Resolved #35769: dbimp.c uses uninitialized variables. (ADAMK) + - Resolved #27701 and #27702: (unnamed) (ADAMK) + - Resolved #31239: prepare_cached...statement handle + DBIx::ContextualFetch::st=HASH still Active (ADAMK) + - Resolved #41047: Re: Bug#506157: libdbd-sqlite3-perl: unsufficient + error message while opening database for writing (ADAMK) + - Resolved #25196 (bug in prepare?) (ADAMK)\ + - Resolved #36651: Bug involving "closing dbh with active + statement handles" (ADAMK) + - Resolved #34408: Primary key name wrong with newline in + CREATE TABLE (ADAMK) + - Resolved #34600: t/06_error.t stalling (ADAMK) + - Resolved #22688: DBD::SQLITE Error Report (ADAMK) 1.19_07 Sat 4 Apr 2009 - Starting to work the RT queue now the basics are settled. + Many of the items marked as resolved by my just indicate that I have + confirmed someone else applied the fix. (ADAMK) - Re-enable and fix t/70schemachange.t, as per RT #43448 (CORION) - Added a canary test to probe for RT #36863 (segfault on OSX 10.5.2) (CORION) diff --git a/dbdimp.c b/dbdimp.c index cc350cd..6d981a3 100644 --- a/dbdimp.c +++ b/dbdimp.c @@ -732,9 +732,9 @@ sqlite_st_FETCH_attrib (SV *sth, imp_sth_t *imp_sth, SV *keysv) const char *fieldname = sqlite3_column_name(imp_sth->stmt, n); if (fieldname) { /* warn("Name [%d]: %s\n", n, fieldname); */ - // char *dot = instr(fieldname, "."); - // if (dot) /* drop table name from field name */ - // fieldname = ++dot; + /* char *dot = instr(fieldname, "."); */ + /* if (dot) drop table name from field name */ + /* fieldname = ++dot; */ av_store(av, n, newSVpv(fieldname, 0)); } } diff --git a/t/03_create_table.t b/t/03_create_table.t index e57bfc1..ae70535 100644 --- a/t/03_create_table.t +++ b/t/03_create_table.t @@ -8,11 +8,23 @@ BEGIN { $^W = 1; } -use Test::More tests => 5; +use Test::More tests => 6; use t::lib::Test; my $dbh = connect_ok(); -$dbh->do("CREATE TABLE f (f1, f2, f3)"); +$dbh->do(<<'END_SQL'); +CREATE TABLE f +( +f1 integer NOT NULL PRIMARY KEY, +f2 integer, +f3 text +) +END_SQL + +# Confirm fix for #34408: Primary key name wrong with newline in CREATE TABLE +my $pkh = $dbh->primary_key_info( undef, undef, 'f' ); +my @pk = $pkh->fetchall_arrayref(); +is_deeply( \@pk, [ [ [ undef, undef, 'f', 'f1', 1, 'PRIMARY KEY' ] ] ], '->primary_key_info ok' ); my $sth = $dbh->prepare("SELECT f.f1, f.* FROM f"); isa_ok( $sth, 'DBI::st' ); @@ -20,3 +32,4 @@ ok( $sth->execute, '->execute ok' ); my $names = $sth->{NAME}; is( scalar(@$names), 4, 'Got 4 columns' ); is_deeply( $names, [ 'f1', 'f1', 'f2', 'f3' ], 'Table prepending is disabled by default' ); + diff --git a/t/06_tran.t b/t/06_tran.t index 94ef2ce..080e946 100644 --- a/t/06_tran.t +++ b/t/06_tran.t @@ -17,7 +17,7 @@ my $dbh = connect_ok( $dbh->do("CREATE TABLE MST (id, lbl)"); $dbh->do("CREATE TABLE TRN (no, id, qty)"); -$dbh->commit; #not work? +$dbh->commit; $dbh->do("INSERT INTO MST VALUES(1, 'ITEM1')"); $dbh->do("INSERT INTO MST VALUES(2, 'ITEM2')"); $dbh->do("INSERT INTO MST VALUES(3, 'ITEM3')"); @@ -25,7 +25,7 @@ $dbh->do("INSERT INTO TRN VALUES('A', 1, 5)"); $dbh->do("INSERT INTO TRN VALUES('B', 2, 2)"); $dbh->do("INSERT INTO TRN VALUES('C', 1, 4)"); $dbh->do("INSERT INTO TRN VALUES('D', 3, 3)"); -$dbh->rollback; #not work? +$dbh->rollback; my $sth = $dbh->prepare( "SELECT TRN.id AS ID, MST.LBL AS TITLE, @@ -39,3 +39,5 @@ print(join(', ', @$names), "\n"); while(my $raD = $sth->fetchrow_arrayref()) { print join(":", @$raD), "\n"; } + +$dbh->rollback;