From: Norbert Buchmuller Date: Tue, 17 Feb 2009 19:57:28 +0000 (+0000) Subject: Added test cases for "col => {-in => \[$sql, @bind]}" with bindtype => 'columns'. X-Git-Tag: v1.70~231 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=044e8ff468f624da14027317d9fb9025faaec127;p=dbsrgits%2FSQL-Abstract.git Added test cases for "col => {-in => \[$sql, @bind]}" with bindtype => 'columns'. --- diff --git a/t/01generate.t b/t/01generate.t index 66f9ed0..30d034b 100644 --- a/t/01generate.t +++ b/t/01generate.t @@ -467,6 +467,22 @@ my @tests = ( args => ['test', '*', { a => {'<' => \["to_date(?, 'MM/DD/YY')", '02/02/02']}, b => 8 }], exception_like => qr/bindtype 'columns' selected, you need to pass: \[column_name => bind_value\]/, }, + #51 + { + func => 'select', + new => {bindtype => 'columns'}, + args => ['test', '*', { a => {-in => \["(SELECT d FROM to_date(?, 'MM/DD/YY') AS d)", [dummy => '02/02/02']]}, b => 8 }], + stmt => 'SELECT * FROM test WHERE ( a IN (SELECT d FROM to_date(?, \'MM/DD/YY\') AS d) AND b = ? )', + stmt_q => 'SELECT * FROM `test` WHERE ( `a` IN (SELECT d FROM to_date(?, \'MM/DD/YY\') AS d) AND `b` = ? )', + bind => [[dummy => '02/02/02'], [b => 8]], + }, + #52 + { + func => 'select', + new => {bindtype => 'columns'}, + args => ['test', '*', { a => {-in => \["(SELECT d FROM to_date(?, 'MM/DD/YY') AS d)", '02/02/02']}, b => 8 }], + exception_like => qr/bindtype 'columns' selected, you need to pass: \[column_name => bind_value\]/, + }, );