the unsafe_subselect_ok attribute, due to optimized queries
- Fix as_subselect_rs to not inject resultset class-wide where
conditions outside of the resulting subquery
+ - Fix nasty potentially data-eating bug when deleting/updating
+ a limited resultset
- Depend on optimized SQL::Abstract (faster SQL generation)
- - update on row not in database now OK if no changes -
- fixes problems with cascaded unnecessary updates
-
+ - update() on row not in_storage no longer throws an exception
+ if there are no dirty columns to update (fixes cascaded update
+ annoyances)
0.08121 2010-04-11 18:43:00 (UTC)
- Support for Firebird RDBMS with DBD::InterBase and ODBC
my $cond = $rsrc->schema->storage->_strip_cond_qualifiers ($self->{cond});
my $needs_group_by_subq = $self->_has_resolved_attr (qw/collapse group_by -join/);
- my $needs_subq = $needs_group_by_subq || (not defined $cond) || $self->_has_resolved_attr(qw/row offset/);
+ my $needs_subq = $needs_group_by_subq || (not defined $cond) || $self->_has_resolved_attr(qw/rows offset/);
if ($needs_group_by_subq or $needs_subq) {
use Test::Exception;
use DBICTest;
-#plan tests => 5;
-plan 'no_plan';
-
my $schema = DBICTest->init_schema();
my $tkfks = $schema->resultset('FourKeys_to_TwoKeys');
$sub_rs->delete;
is ($tkfks->count, $tkfk_cnt -= 2, 'Only two rows deleted');
+
+# make sure limit-only deletion works
+cmp_ok ($tkfk_cnt, '>', 1, 'More than 1 row left');
+$tkfks->search ({}, { rows => 1 })->delete;
+is ($tkfks->count, $tkfk_cnt -= 1, 'Only one row deleted');
+
+done_testing;