mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 14:19:10 -04:00
fixed invalid assumptions about the result order
This commit is contained in:
parent
89f70e54e7
commit
93cce3a376
2 changed files with 10 additions and 10 deletions
|
@ -24,7 +24,7 @@ plan tests => 21;
|
|||
/)};
|
||||
ok !$@, "do succeeds anyway";
|
||||
diag $@ if $@;
|
||||
my $got = $dbh->selectall_arrayref('select id from foo');
|
||||
my $got = $dbh->selectall_arrayref('select id from foo order by id');
|
||||
ok !@$got, "but got nothing as the inserts were discarded";
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ plan tests => 21;
|
|||
ok !$@, "do succeeds anyway";
|
||||
diag $@ if $@;
|
||||
|
||||
my $got = $dbh->selectall_arrayref('select id from foo');
|
||||
my $got = $dbh->selectall_arrayref('select id from foo order by id');
|
||||
ok $got->[0][0] == 1
|
||||
&& $got->[1][0] == 2, "and got the inserted values";
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ plan tests => 21;
|
|||
diag $@ if $@;
|
||||
$@ ? $dbh->rollback : $dbh->commit;
|
||||
|
||||
my $got = $dbh->selectall_arrayref('select id from foo');
|
||||
my $got = $dbh->selectall_arrayref('select id from foo order by id');
|
||||
ok $got->[0][0] == 1
|
||||
&& $got->[1][0] == 2, "and got the inserted values";
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ plan tests => 21;
|
|||
ok !$@, "do succeeds anyway";
|
||||
diag $@ if $@;
|
||||
|
||||
my $got = $dbh->selectall_arrayref('select id from foo');
|
||||
my $got = $dbh->selectall_arrayref('select id from foo order by id');
|
||||
ok $got->[0][0] == 1
|
||||
&& $got->[1][0] == 2, "and got the inserted values";
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ plan tests => 21;
|
|||
ok !$@, "executed multiple statements successfully";
|
||||
diag $@ if $@;
|
||||
|
||||
my $got = $dbh->selectall_arrayref('select id from foo');
|
||||
my $got = $dbh->selectall_arrayref('select id from foo order by id');
|
||||
ok $got->[0][0] == 1
|
||||
&& $got->[1][0] == 2, "and got the inserted values";
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ use Test::NoWarnings;
|
|||
use DBI qw/:sql_types/;
|
||||
|
||||
my $dbh = connect_ok(sqlite_unicode => 1);
|
||||
$dbh->do('create table test1 (a integer, b blob)');
|
||||
$dbh->do('create table test1 (id integer, b blob)');
|
||||
|
||||
my $blob = "\x{82}\x{A0}";
|
||||
my $str = "\x{20ac}";
|
||||
|
@ -52,7 +52,7 @@ my $str = "\x{20ac}";
|
|||
}
|
||||
|
||||
{
|
||||
my $sth = $dbh->prepare('select * from test1');
|
||||
my $sth = $dbh->prepare('select * from test1 order by id');
|
||||
$sth->execute;
|
||||
|
||||
my $expected = [undef, 1, 0, 0, 1, 1, 1];
|
||||
|
@ -67,7 +67,7 @@ my $str = "\x{20ac}";
|
|||
}
|
||||
|
||||
{
|
||||
my $sth = $dbh->prepare('select * from test1');
|
||||
my $sth = $dbh->prepare('select * from test1 order by id');
|
||||
$sth->bind_col(1, \my $col1);
|
||||
$sth->bind_col(2, \my $col2);
|
||||
$sth->execute;
|
||||
|
@ -84,7 +84,7 @@ my $str = "\x{20ac}";
|
|||
}
|
||||
|
||||
{
|
||||
my $sth = $dbh->prepare('select * from test1');
|
||||
my $sth = $dbh->prepare('select * from test1 order by id');
|
||||
$sth->bind_col(1, \my $col1);
|
||||
$sth->bind_col(2, \my $col2, SQL_BLOB);
|
||||
$sth->execute;
|
||||
|
@ -101,7 +101,7 @@ my $str = "\x{20ac}";
|
|||
}
|
||||
|
||||
{
|
||||
my $sth = $dbh->prepare('select * from test1');
|
||||
my $sth = $dbh->prepare('select * from test1 order by id');
|
||||
$sth->bind_col(1, \my $col1);
|
||||
$sth->bind_col(2, \my $col2, {TYPE => SQL_BLOB});
|
||||
$sth->execute;
|
||||
|
|
Loading…
Add table
Reference in a new issue