mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 22:28:47 -04:00
Commit a bunch of RT fixes
This commit is contained in:
parent
fdd27a3fb4
commit
90c018c655
7 changed files with 85 additions and 13 deletions
22
Changes
22
Changes
|
@ -1,8 +1,26 @@
|
||||||
Revision history for Perl extension DBD-SQLite.
|
Revision history for Perl extension DBD-SQLite.
|
||||||
|
|
||||||
1.19_07 not released yet
|
1.19_07 not released yet
|
||||||
- re-enable and fix t/70schemachange.t, as per RT #43448 (CORION)
|
- Starting to work the RT queue now the basics are settled.
|
||||||
- added a canary test to probe for RT #36863 (segfault on OSX 10.5.2)
|
- 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 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 #13631: wish: column_info support() (CORION)
|
||||||
|
- Resolved #39938: Read-access to development repository (ADAMK)
|
||||||
|
- Resolved #18617: Build error under win32 (ADAMK)
|
||||||
|
- Resolved #35838: support for DBI::column_info call (CORION)
|
||||||
|
- Resolved #29497: POD content bug (ADAMK)
|
||||||
|
- Resolved #29520: 1.14 fails in test 6 (ADAMK)
|
||||||
|
- Resolved #44647: Makefile.PL syntax error (ADAMK)
|
||||||
|
- 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)
|
||||||
|
|
||||||
1.19_06 Sat 4 Apr 2009
|
1.19_06 Sat 4 Apr 2009
|
||||||
- Fixed a segv with an error function under x86 linux
|
- Fixed a segv with an error function under x86 linux
|
||||||
|
|
|
@ -203,6 +203,9 @@ WriteMakefile(
|
||||||
OPTIONAL( '6.31',
|
OPTIONAL( '6.31',
|
||||||
LICENSE => 'perl',
|
LICENSE => 'perl',
|
||||||
),
|
),
|
||||||
|
OPTIONAL( '6.11',
|
||||||
|
AUTHOR => 'Adam Kennedy <adamk@cpan.org>', # Maintainer
|
||||||
|
),
|
||||||
OPTIONAL( '6.46',
|
OPTIONAL( '6.46',
|
||||||
META_MERGE => {
|
META_MERGE => {
|
||||||
configure_requires => {
|
configure_requires => {
|
||||||
|
@ -210,6 +213,11 @@ WriteMakefile(
|
||||||
'File::Spec' => (WINLIKE ? '3.27' : '0.82'),
|
'File::Spec' => (WINLIKE ? '3.27' : '0.82'),
|
||||||
'DBI' => '1.21',
|
'DBI' => '1.21',
|
||||||
},
|
},
|
||||||
|
resources => {
|
||||||
|
license => 'http://dev.perl.org/licenses/',
|
||||||
|
bugtracker => 'http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBD-SQLite',
|
||||||
|
repository => 'http://svn.ali.as/cpan/trunk/DBD-SQLite',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
OBJECT => ( $force_local ? '$(O_FILES)' : 'SQLite.o dbdimp.o' ),
|
OBJECT => ( $force_local ? '$(O_FILES)' : 'SQLite.o dbdimp.o' ),
|
||||||
|
|
3
dbdimp.c
3
dbdimp.c
|
@ -40,7 +40,8 @@ _sqlite_error(char *file, int line, SV *h, imp_xxh_t *imp_xxh, int rc, char *wha
|
||||||
SV *errstr = DBIc_ERRSTR(imp_xxh);
|
SV *errstr = DBIc_ERRSTR(imp_xxh);
|
||||||
sv_setiv(DBIc_ERR(imp_xxh), (IV)rc);
|
sv_setiv(DBIc_ERR(imp_xxh), (IV)rc);
|
||||||
sv_setpv(errstr, what);
|
sv_setpv(errstr, what);
|
||||||
sv_catpvf(errstr, "(%d) at %s line %d", rc, file, line);
|
/* #7753: DBD::SQLite error shouldn't include extraneous info */
|
||||||
|
/* sv_catpvf(errstr, "(%d) at %s line %d", rc, file, line); */
|
||||||
|
|
||||||
if ( DBIS->debug >= 3 ) {
|
if ( DBIS->debug >= 3 ) {
|
||||||
PerlIO_printf(DBILOGFP, "sqlite error %d recorded: %s at %s line %d\n",
|
PerlIO_printf(DBILOGFP, "sqlite error %d recorded: %s at %s line %d\n",
|
||||||
|
|
|
@ -601,7 +601,7 @@ rather than the size of the blob in bytes. In order to store natively as a
|
||||||
BLOB use the following code:
|
BLOB use the following code:
|
||||||
|
|
||||||
use DBI qw(:sql_types);
|
use DBI qw(:sql_types);
|
||||||
my $dbh = DBI->connect("dbi:sqlite:/path/to/db","","");
|
my $dbh = DBI->connect("dbi:SQLite:dbfile","","");
|
||||||
|
|
||||||
my $blob = `cat foo.jpg`;
|
my $blob = `cat foo.jpg`;
|
||||||
my $sth = $dbh->prepare("INSERT INTO mytable VALUES (1, ?)");
|
my $sth = $dbh->prepare("INSERT INTO mytable VALUES (1, ?)");
|
||||||
|
|
10
t/07_error.t
10
t/07_error.t
|
@ -6,14 +6,16 @@ BEGIN {
|
||||||
$^W = 1;
|
$^W = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
use Test::More tests => 3;
|
use Test::More tests => 7;
|
||||||
use t::lib::Test;
|
use t::lib::Test;
|
||||||
|
|
||||||
my $dbh = connect_ok( RaiseError => 1, PrintError => 0 );
|
my $dbh = connect_ok( RaiseError => 1, PrintError => 0 );
|
||||||
eval {
|
eval {
|
||||||
$dbh->do('ssdfsdf sdf sd sdfsdfdsf sdfsdf');
|
$dbh->do('ssdfsdf sdf sd sdfsdfdsf sdfsdf');
|
||||||
};
|
};
|
||||||
ok($@);
|
ok($@, 'Statement 1 generated an error');
|
||||||
|
is( $DBI::err, 1, '$DBI::err ok' );
|
||||||
|
is( $DBI::errstr, 'near "ssdfsdf": syntax error', '$DBI::errstr ok' );
|
||||||
|
|
||||||
$dbh->do('create table testerror (a, b)');
|
$dbh->do('create table testerror (a, b)');
|
||||||
$dbh->do('insert into testerror values (1, 2)');
|
$dbh->do('insert into testerror values (1, 2)');
|
||||||
|
@ -23,4 +25,6 @@ $dbh->do('create unique index testerror_idx on testerror (a)');
|
||||||
eval {
|
eval {
|
||||||
$dbh->do('insert into testerror values (1, 5)');
|
$dbh->do('insert into testerror values (1, 5)');
|
||||||
};
|
};
|
||||||
ok($@);
|
ok($@, 'Statement 2 generated an error');
|
||||||
|
is( $DBI::err, 19, '$DBI::err ok' );
|
||||||
|
is( $DBI::errstr, 'column a is not unique', '$DBI::errstr ok' );
|
||||||
|
|
|
@ -60,7 +60,7 @@ while (Testing()) {
|
||||||
or DbiError($dbh->err, $dbh->errstr);
|
or DbiError($dbh->err, $dbh->errstr);
|
||||||
|
|
||||||
my $pid;
|
my $pid;
|
||||||
if (!defined($pid = fork())) {
|
if ( not defined($pid = fork()) ) {
|
||||||
die("fork: $!");
|
die("fork: $!");
|
||||||
} elsif ( $pid == 0 ) {
|
} elsif ( $pid == 0 ) {
|
||||||
# Child: drop the second table
|
# Child: drop the second table
|
||||||
|
@ -68,7 +68,7 @@ while (Testing()) {
|
||||||
# sqlite prohibits thread sharing parent connection
|
# sqlite prohibits thread sharing parent connection
|
||||||
$dbh = DBI->connect("DBI:SQLite:dbname=foo", '', '');
|
$dbh = DBI->connect("DBI:SQLite:dbname=foo", '', '');
|
||||||
}
|
}
|
||||||
if (!$state) {
|
if ( not $state ) {
|
||||||
$dbh->do("DROP TABLE $table2")
|
$dbh->do("DROP TABLE $table2")
|
||||||
or DbiError($dbh->err, $dbh->errstr);
|
or DbiError($dbh->err, $dbh->errstr);
|
||||||
$dbh->disconnect()
|
$dbh->disconnect()
|
||||||
|
|
41
t/rt_21406_auto_finish.t
Normal file
41
t/rt_21406_auto_finish.t
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
BEGIN {
|
||||||
|
$| = 1;
|
||||||
|
$^W = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
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)");
|
||||||
|
$dbh->do("INSERT INTO f VALUES (?, ?, ?)", {}, 'foo', 'bar', 1);
|
||||||
|
$dbh->do("INSERT INTO f VALUES (?, ?, ?)", {}, 'foo', 'bar', 2);
|
||||||
|
$dbh->do("INSERT INTO f VALUES (?, ?, ?)", {}, 'foo', 'bar', 3);
|
||||||
|
$dbh->do("INSERT INTO f VALUES (?, ?, ?)", {}, 'foo', 'bar', 4);
|
||||||
|
$dbh->do("INSERT INTO f VALUES (?, ?, ?)", {}, 'foo', 'bar', 5);
|
||||||
|
|
||||||
|
SCOPE: {
|
||||||
|
my $sth1 = $dbh->prepare_cached('SELECT * FROM f ORDER BY f3', {});
|
||||||
|
isa_ok( $sth1, 'DBI::st' );
|
||||||
|
ok( $sth1->execute, '->execute ok' );
|
||||||
|
is_deeply( $sth1->fetchrow_arrayref, [ 'foo', 'bar', 1 ], 'Row 1 ok' );
|
||||||
|
is_deeply( $sth1->fetchrow_arrayref, [ 'foo', 'bar', 2 ], 'Row 2 ok' );
|
||||||
|
my $sth2 = $dbh->prepare_cached('SELECT * FROM f ORDER BY f3', {}, 3);
|
||||||
|
isa_ok( $sth2, 'DBI::st' );
|
||||||
|
ok( $sth2->execute, '->execute ok' );
|
||||||
|
is_deeply( $sth2->fetchrow_arrayref, [ 'foo', 'bar', 1 ], 'Row 1 ok' );
|
||||||
|
is_deeply( $sth2->fetchrow_arrayref, [ 'foo', 'bar', 2 ], 'Row 2 ok' );
|
||||||
|
ok( $sth2->finish, '->finish ok' );
|
||||||
|
}
|
||||||
|
|
||||||
|
$dbh->disconnect;
|
Loading…
Add table
Reference in a new issue