From: Dagfinn Ilmari Mannsåker Date: Fri, 6 Dec 2013 17:24:22 +0000 (+0000) Subject: Port fce4b7a9 from the DQ branch (with warning expectation ammendments) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3f3851586e6d4b086bcf941c7a55e73d6df2df3;p=scpubgit%2FQ-Branch.git Port fce4b7a9 from the DQ branch (with warning expectation ammendments) --- diff --git a/t/01generate.t b/t/01generate.t index 833b2e3..7304235 100644 --- a/t/01generate.t +++ b/t/01generate.t @@ -581,6 +581,38 @@ my @tests = ( args => ['test', '*', { a => { -in => undef } }], throws => qr/Argument passed to the 'IN' operator can not be undefined/, }, + { + func => 'select', + args => ['test', '*', { a => { '=' => undef }, b => { -is => undef }, c => { -like => undef } }], + stmt => 'SELECT * FROM test WHERE ( a IS NULL AND b IS NULL AND c IS NULL )', + stmt_q => 'SELECT * FROM `test` WHERE ( `a` IS NULL AND `b` IS NULL AND `c` IS NULL )', + bind => [], + warns => qr/\QSupplying an undefined argument to 'LIKE' is deprecated/, + }, + { + func => 'select', + args => ['test', '*', { a => { '!=' => undef }, b => { -is_not => undef }, c => { -not_like => undef } }], + stmt => 'SELECT * FROM test WHERE ( a IS NOT NULL AND b IS NOT NULL AND c IS NOT NULL )', + stmt_q => 'SELECT * FROM `test` WHERE ( `a` IS NOT NULL AND `b` IS NOT NULL AND `c` IS NOT NULL )', + bind => [], + warns => qr/\QSupplying an undefined argument to 'NOT LIKE' is deprecated/, + }, + { + func => 'select', + args => ['test', '*', { a => { IS => undef }, b => { LIKE => undef } }], + stmt => 'SELECT * FROM test WHERE ( a IS NULL AND b IS NULL )', + stmt_q => 'SELECT * FROM `test` WHERE ( `a` IS NULL AND `b` IS NULL )', + bind => [], + warns => qr/\QSupplying an undefined argument to 'LIKE' is deprecated/, + }, + { + func => 'select', + args => ['test', '*', { a => { 'IS NOT' => undef }, b => { 'NOT LIKE' => undef } }], + stmt => 'SELECT * FROM test WHERE ( a IS NOT NULL AND b IS NOT NULL )', + stmt_q => 'SELECT * FROM `test` WHERE ( `a` IS NOT NULL AND `b` IS NOT NULL )', + bind => [], + warns => qr/\QSupplying an undefined argument to 'NOT LIKE' is deprecated/, + }, ); # check is( not) => undef