1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00

DBD-SQLite: added a setup code to insert/select tests, which depended on the result of the previous tests.

This commit is contained in:
Kenichi Ishigaki 2009-04-02 11:29:23 +00:00
parent b8d35dddbd
commit a8f37fa973
2 changed files with 7 additions and 2 deletions

View file

@ -2,8 +2,9 @@ use strict;
use Test;
use DBI;
BEGIN { plan tests => 11 }
my $dbh = DBI->connect("dbi:SQLite:dbname=foo", "", "");
my $dbh = DBI->connect("dbi:SQLite:dbname=foo", "", "", {AutoCommit => 1});
ok($dbh);
$dbh->do("CREATE TABLE f (f1, f2, f3)");
ok($dbh->do("delete from f"));
my $sth = $dbh->prepare("INSERT INTO f VALUES (?, ?, ?)", { go_last_insert_id_args => [undef, undef, undef, undef] });
ok($sth);

View file

@ -2,8 +2,12 @@ use strict;
use Test;
BEGIN { plan tests => 21 }
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=foo", "", "", { RaiseError => 1 });
my $dbh = DBI->connect("dbi:SQLite:dbname=foo", "", "", { RaiseError => 1, AutoCommit => 1 });
ok($dbh);
$dbh->do("CREATE TABLE f (f1, f2, f3)");
my $sth = $dbh->prepare("INSERT INTO f VALUES (?, ?, ?)", { go_last_insert_id_args => [undef, undef, undef, undef] });
$sth->execute("Fred", "Bloggs", "fred\@bloggs.com");
# $dbh->trace(4);
my $sth = $dbh->prepare("SELECT * FROM f");
ok($sth);