+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
use strict;
use warnings;
-use lib qw(t/lib);
use Test::More;
use Test::Exception;
# and that's a whole another bag of dicks
BEGIN { $ENV{DBIC_SHUFFLE_UNORDERED_RESULTSETS} = 0 }
+use DBIx::Class::_Util 'scope_guard';
+
use DBICTest::Schema::CD;
BEGIN {
# the default scalarref table name will not work well for this test
# try the same sql with forced multicolumn in
$schema->is_executed_sql_bind( sub {
- local $schema->storage->{_use_multicolumn_in} = 1;
+
+ my $orig_umi = $schema->storage->_use_multicolumn_in;
+ my $sg = scope_guard {
+ $schema->storage->_use_multicolumn_in($orig_umi);
+ };
+
+ $schema->storage->_use_multicolumn_in(1);
# this can't actually execute on sqlite
eval { $fks_multi->update ({ read_count => \ 'read_count + 1' }) };
$tkfks->search ({}, { rows => 1 })->delete;
is ($tkfks->count, $tkfk_cnt -= 1, 'Only one row deleted');
+throws_ok {
+ $tkfks->search ({}, { rows => 0 })->delete
+} qr/rows attribute must be a positive integer/;
+is ($tkfks->count, $tkfk_cnt, 'Nothing deleted');
# check with sql-equality, as sqlite will accept most bad sql just fine
{