Skip to content

Commit 4a24dba

Browse files
committed
And of course the test pragma is not supported everywhere
Similar issue but no solution: http://osdir.com/ml/sqlite-users/2010-01/msg00220.html Experimentally determined cutoff at 3.7.9
1 parent 725e1ef commit 4a24dba

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

t/53lean_startup.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ BEGIN {
151151

152152
# and do full populate() as well, just in case - shouldn't add new stuff
153153
{
154+
local $ENV{DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER};
154155
require DBICTest;
155156
my $s = DBICTest->init_schema;
156157
is ($s->resultset('Artist')->find(1)->name, 'Caterwauler McCrae');

t/lib/DBICTest.pm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,14 @@ sub _database {
187187
# no fsync on commit
188188
$dbh->do ('PRAGMA synchronous = OFF');
189189

190-
$dbh->do ('PRAGMA reverse_unordered_selects = ON')
191-
if $ENV{DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER};
190+
if ($ENV{DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER}) {
191+
192+
$storage->throw_exception(
193+
'PRAGMA reverse_unordered_selects does not work correctly before libsqlite 3.7.9'
194+
) if $storage->_server_info->{normalized_dbms_version} < 3.007009;
195+
196+
$dbh->do ('PRAGMA reverse_unordered_selects = ON');
197+
}
192198

193199
# set a *DBI* disconnect callback, to make sure the physical SQLite
194200
# file is still there (i.e. the test does not attempt to delete

0 commit comments

Comments
 (0)