X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresultset%2Fupdate_delete.t;h=c3e8c2f58477a695986c4d51c5bd0d139adc8479;hb=31160673f390e178ee347e7ebee1f56b3f54ba7a;hp=ee32717dd3ee0b020bdac1b31f1f5d215327fe5c;hpb=cfa1ab03f5bdd0f14f4eaca99cd002be0020d001;p=dbsrgits%2FDBIx-Class.git diff --git a/t/resultset/update_delete.t b/t/resultset/update_delete.t index ee32717..c3e8c2f 100644 --- a/t/resultset/update_delete.t +++ b/t/resultset/update_delete.t @@ -105,6 +105,29 @@ is ($fa->discard_changes->read_count, 12, 'Update ran only once on joined result is ($fb->discard_changes->read_count, 22, 'Update ran only once on joined resultset'); is ($fc->discard_changes->read_count, 30, 'Update did not touch outlier'); +$schema->is_executed_sql_bind( sub { + my $res = $fks_multi->search (\' "blah" = "bleh" ')->delete; + ok ($res, 'operation is true'); + cmp_ok ($res, '==', 0, 'zero rows affected'); +}, [ + [ 'BEGIN' ], + [ + 'SELECT me.foo, me.bar, me.hello, me.goodbye + FROM fourkeys me + LEFT JOIN fourkeys_to_twokeys fourkeys_to_twokeys + ON fourkeys_to_twokeys.f_bar = me.bar AND fourkeys_to_twokeys.f_foo = me.foo AND fourkeys_to_twokeys.f_goodbye = me.goodbye AND fourkeys_to_twokeys.f_hello = me.hello + WHERE "blah" = "bleh" AND ( bar = ? OR bar = ? ) AND ( foo = ? OR foo = ? ) AND fourkeys_to_twokeys.pilot_sequence != ? AND ( goodbye = ? OR goodbye = ? ) AND ( hello = ? OR hello = ? ) AND sensors != ? + GROUP BY me.foo, me.bar, me.hello, me.goodbye + ', + (1, 2) x 2, + 666, + (1, 2) x 2, + 'c', + ], + [ 'COMMIT' ], +], 'Correct null-delete-SQL with multijoin without pruning' ); + + # try the same sql with forced multicolumn in $schema->is_executed_sql_bind( sub { local $schema->storage->{_use_multicolumn_in} = 1;