mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-08 14:48:32 -04:00
Adding a test case reported on RT
This commit is contained in:
parent
ec81ab8513
commit
b5a6806d85
1 changed files with 41 additions and 0 deletions
41
tmp.pl
Normal file
41
tmp.pl
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/use/bin/perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use DBI;
|
||||||
|
|
||||||
|
$ENV{PATH} = "/bin:/usr/sbin";
|
||||||
|
|
||||||
|
my $dbh = DBI->connect("DBI:SQLite:blah", "", "");
|
||||||
|
SCOPE: {
|
||||||
|
my $sth = $dbh->do(q{DROP TABLE IF EXISTS t1});
|
||||||
|
my $sth2 = $dbh->do(q{CREATE TABLE t1 (c1 text)});
|
||||||
|
my $sth3 = $dbh->prepare(q{INSERT INTO t1 VALUES (?)});
|
||||||
|
for my $i (1 .. 5) {
|
||||||
|
$sth3->execute($i);
|
||||||
|
}
|
||||||
|
$sth3->finish();
|
||||||
|
}
|
||||||
|
$dbh->disconnect();
|
||||||
|
|
||||||
|
my @dbh;
|
||||||
|
for my $i (1 .. 2) {
|
||||||
|
print "$i: before connect\n";
|
||||||
|
print `lsof -p $$|grep test`;
|
||||||
|
$dbh[$i] = DBI->connect("DBI:SQLite:blah", "", "");
|
||||||
|
print "$i: after connect\n";
|
||||||
|
print `lsof -p $$|grep test`;
|
||||||
|
# {
|
||||||
|
|
||||||
|
my $sth = $dbh[$i]->prepare(q{SELECT count(1) from t1});
|
||||||
|
$sth->execute();
|
||||||
|
my ($count) = $sth->fetchrow_array;
|
||||||
|
print "count: $count\n";
|
||||||
|
$sth->finish();
|
||||||
|
|
||||||
|
# }
|
||||||
|
$dbh[$i]->disconnect();
|
||||||
|
print "$i: after disconnect\n";
|
||||||
|
print `lsof -p $$|grep test`, "\n";
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue