From e75314771aab8f8e719383ae0b3ab329f5d1bacf Mon Sep 17 00:00:00 2001 From: Adam Kennedy Date: Sat, 4 Apr 2009 03:42:49 +0000 Subject: [PATCH] Flagging a bunch more tickets as resolved. Some with actual fixes, some were resolved due to patches being applied previously. --- Changes | 41 ++++++++++++++++++++++++++++++-------- Makefile.PL | 4 ++-- dbdimp.c | 6 +++--- lib/DBD/SQLite.pm | 2 +- t/rt_21406_auto_finish.t | 9 +-------- t/rt_31324_full_names.t | 43 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 83 insertions(+), 22 deletions(-) create mode 100644 t/rt_31324_full_names.t diff --git a/Changes b/Changes index 2aa40a0..579c42e 100644 --- a/Changes +++ b/Changes @@ -1,17 +1,39 @@ Changes for Perl extension DBD-SQLite. 1.19_08 to be released - - Resolved #30558: INSERT After PK Failure Also Fails Using Prepared (ADAMK) - - Resolved #42567: Core dump in t/07busy.t after test 4 (mutex and/or memory corruption) (ADAMK) + - Bumped minimum DBI dependency to 1.43 so last_insert_id is supported + in DBI (ADAMK) + - Resolved #30558: INSERT After PK Failure Also Fails Using + Prepared (ADAMK) + - Resolved #42567: Core dump in t/07busy.t after test 4 (mutex and/or + memory corruption) (ADAMK) + - Resolved #32100: t/06error.t fails using SQLite 3.5.4 (ADAMK) + - Resolved #35904: Test failure: Bus error t/08create_function + test (ADAMK) + - Resolved #9792: Crashes upon re-executing a statement (ADAMK) + - Resolved #21472: Spurious "not an error" and "bind or column index + out of range" errirs (MSERGEANT) + - Resolved #32723: last_insert_rowid should handle sqlite_int64, + not int (ADAMK) + - Resolved #37215: memory leaks in sqlite_db_disconnect (ADAMK) + - Resolved #33441: unlimited memory accumulation (ADAMK) + - Resolved #31324: Incorrect Implementation of column names within + sqlite_st_FETCH_attrib (ADAMK) + - 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) 1.19_07 Sat 4 Apr 2009 - Starting to work the RT queue now the basics are settled. - 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) + - Added a canary test to probe for RT #36863 + (segfault on OSX 10.5.2) (CORION) - Added resources links to META.yml (ADAMK) - Resolved #30502: t\70schemachange.t fails on Windows (ADAMK) - - Resolved #30167: Specify configuration depenencies with "configure_requires" (ADAMK) - - Resolved #17623: make test fails when DBI_DSN is not DBD::SQLite (ADAMK) + - Resolved #30167: Specify configuration depenencies with + "configure_requires" (ADAMK) + - Resolved #17623: make test fails when DBI_DSN is not + DBD::SQLite (ADAMK) - Resolved #13631: wish: column_info support() (CORION) - Resolved #39938: Read-access to development repository (ADAMK) - Resolved #18617: Build error under win32 (ADAMK) @@ -22,9 +44,12 @@ Changes for Perl extension DBD-SQLite. - Resolved #29519: t/70schemachange.t failure (ADAMK) - Resolved #20286: DBD::SQLite leaks file descriptors (ADAMK) - Resolved #21406: DBD-SQLite 1.13 broke Class-DBI (ADAMK) - - Resolved #4591: Test suite (t/t50*.t) is order dependent / bug in t/lib.pl? (ADAMK) - - Resolved #36467: Name "DBD::SQLite::sqlite_version" used only once (ADAMK) - - Resolved #7753: DBD::SQLite error shouldn't include extraneous info (ADAMK) + - Resolved #4591: Test suite (t/t50*.t) is order dependent / bug in + t/lib.pl? (ADAMK) + - Resolved #36467: Name "DBD::SQLite::sqlite_version" used + only once (ADAMK) + - Resolved #7753: DBD::SQLite error shouldn't include extraneous + info (ADAMK) 1.19_06 Sat 4 Apr 2009 - Fixed a segv with an error function under x86 linux diff --git a/Makefile.PL b/Makefile.PL index a954404..46fb2d4 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -194,7 +194,7 @@ WriteMakefile( ABSTRACT => 'Self Contained SQLite RDBMS in a DBI Driver', VERSION_FROM => 'lib/DBD/SQLite.pm', PREREQ_PM => { - 'DBI' => '1.21', + 'DBI' => '1.43', 'Test::More' => '0.42', }, OPTIONAL( '6.48', @@ -211,7 +211,7 @@ WriteMakefile( configure_requires => { 'ExtUtils::MakeMaker' => '6.48', 'File::Spec' => (WINLIKE ? '3.27' : '0.82'), - 'DBI' => '1.21', + 'DBI' => '1.43', }, resources => { license => 'http://dev.perl.org/licenses/', diff --git a/dbdimp.c b/dbdimp.c index 8f7e698..cc350cd 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/lib/DBD/SQLite.pm b/lib/DBD/SQLite.pm index 24cba71..12b1707 100644 --- a/lib/DBD/SQLite.pm +++ b/lib/DBD/SQLite.pm @@ -2,7 +2,7 @@ package DBD::SQLite; use 5.00503; use strict; -use DBI (); +use DBI 1.43 (); use DynaLoader (); use vars qw($VERSION @ISA); diff --git a/t/rt_21406_auto_finish.t b/t/rt_21406_auto_finish.t index 9c28060..fd9ca37 100644 --- a/t/rt_21406_auto_finish.t +++ b/t/rt_21406_auto_finish.t @@ -6,15 +6,8 @@ BEGIN { $^W = 1; } -use Test::More; +use Test::More tests => 10; use t::lib::Test; -BEGIN { - if ( $DBI::VERSION >= 1.40 ) { - plan( tests => 10 ); - } else { - plan( skip_all => 'DBI 1.40+ only' ); - } -} my $dbh = connect_ok( RaiseError => 1 ); $dbh->do("CREATE TABLE f (f1, f2, f3)"); diff --git a/t/rt_31324_full_names.t b/t/rt_31324_full_names.t new file mode 100644 index 0000000..97ff988 --- /dev/null +++ b/t/rt_31324_full_names.t @@ -0,0 +1,43 @@ +#!/usr/bin/perl + +use strict; +BEGIN { + $| = 1; + $^W = 1; +} + +use Test::More tests => 7; +use t::lib::Test; + +my $dbh = connect_ok( RaiseError => 1 ); +$dbh->do("CREATE TABLE f (f1, f2, f3)"); +$dbh->do("INSERT INTO f VALUES (?, ?, ?)", {}, 'foo', 'bar', 1); + +SCOPE: { + my $sth = $dbh->prepare('SELECT f1 as "a.a", * FROM f', {}); + isa_ok( $sth, 'DBI::st' ); + ok( $sth->execute, '->execute ok' ); + my $row = $sth->fetchrow_hashref; + is_deeply( $row, { + 'a.a' => 'foo', + 'f1' => 'foo', + 'f2' => 'bar', + 'f3' => 1, + }, 'Shortname row ok' ); +} + +$dbh->do("PRAGMA full_column_names = 1"); +$dbh->do("PRAGMA short_column_names = 0"); + +SCOPE: { + my $sth = $dbh->prepare('SELECT f1 as "a.a", * FROM f', {}); + isa_ok( $sth, 'DBI::st' ); + ok( $sth->execute, '->execute ok' ); + my $row = $sth->fetchrow_hashref; + is_deeply( $row, { + 'a.a' => 'foo', + 'f.f1' => 'foo', + 'f.f2' => 'bar', + 'f.f3' => 1, + }, 'Shortname row ok' ); +}