[Bast-commits] r5475 - in SQL-Abstract/1.x/branches/1.50_RC: . lib/SQL t

norbi at dev.catalyst.perl.org norbi at dev.catalyst.perl.org
Sun Feb 15 14:33:19 GMT 2009


Author: norbi
Date: 2009-02-15 14:33:19 +0000 (Sun, 15 Feb 2009)
New Revision: 5475

Modified:
   SQL-Abstract/1.x/branches/1.50_RC/
   SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm
   SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t
Log:
 r5582 at vger:  mendel | 2009-02-15 15:29:13 +0100
  * Fixed a bug in hashpair with literal SQL and bind value (ie. col => { op => \[$sql, @bind] }) when bindtype => 1.
  * Added tests for hashpair with literal SQL and bind value (ie. col => { op => \[$sql, @bind] }) when bindtype => 1.



Property changes on: SQL-Abstract/1.x/branches/1.50_RC
___________________________________________________________________
Name: svk:merge
   - 4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC:5557
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC-extraparens:5308
   + 4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC:5582
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC-extraparens:5308

Modified: SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm	2009-02-15 14:20:25 UTC (rev 5474)
+++ SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm	2009-02-15 14:33:19 UTC (rev 5475)
@@ -547,7 +547,7 @@
           $sql  = join ' ', $self->_convert($self->_quote($k)),
                             $self->_sqlcase($op),
                             $sub_sql;
-          @bind = @sub_bind;
+          @bind = $self->_bindtype($k, @sub_bind);
         },
 
         UNDEF => sub {          # CASE: col => {op => undef} : sql "IS (NOT)? NULL"

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t	2009-02-15 14:20:25 UTC (rev 5474)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t	2009-02-15 14:33:19 UTC (rev 5475)
@@ -402,6 +402,43 @@
               stmt_q => 'SELECT * FROM `test` WHERE ( `a` < 42 AND `b` = ? )',
               bind   => [qw(8)],
       },             
+
+      #44
+      {
+              func   => 'insert',
+              new    => {bindtype => 'columns'},
+              args   => ['test', {a => 1, b => \["to_date(?, 'MM/DD/YY')", '02/02/02']}],
+              stmt   => 'INSERT INTO test (a, b) VALUES (?, to_date(?, \'MM/DD/YY\'))',
+              stmt_q => 'INSERT INTO `test` (`a`, `b`) VALUES (?, to_date(?, \'MM/DD/YY\'))',
+              bind   => [[a => '1'], [b => '02/02/02']],
+      },
+      #45
+      {              
+              func   => 'update',
+              new    => {bindtype => 'columns'},
+              args   => ['test', {a => 1, b => \["to_date(?, 'MM/DD/YY')", '02/02/02']}, {a => {'between', [1,2]}}],
+              stmt   => 'UPDATE test SET a = ?, b = to_date(?, \'MM/DD/YY\') WHERE ( a BETWEEN ? AND ? )',
+              stmt_q => 'UPDATE `test` SET `a` = ?, `b` = to_date(?, \'MM/DD/YY\') WHERE ( `a` BETWEEN ? AND ? )',
+              bind   => [[a => '1'], [b => '02/02/02'], [a => '1'], [a => '2']],
+      },             
+      #46
+      {
+              func   => 'select',
+              new    => {bindtype => 'columns'},
+              args   => ['test', '*', { a => \["= to_date(?, 'MM/DD/YY')", '02/02/02']}],
+              stmt   => q{SELECT * FROM test WHERE ( a = to_date(?, 'MM/DD/YY') )},
+              stmt_q => q{SELECT * FROM `test` WHERE ( `a` = to_date(?, 'MM/DD/YY') )},
+              bind   => [[a => '02/02/02']],
+      },
+      #47
+      {
+              func   => 'select',
+              new    => {bindtype => 'columns'},
+              args   => ['test', '*', { a => {'<' => \["to_date(?, 'MM/DD/YY')", '02/02/02']}, b => 8 }],
+              stmt   => 'SELECT * FROM test WHERE ( a < to_date(?, \'MM/DD/YY\') AND b = ? )',
+              stmt_q => 'SELECT * FROM `test` WHERE ( `a` < to_date(?, \'MM/DD/YY\') AND `b` = ? )',
+              bind   => [[a => '02/02/02'], [b => 8]],
+      },             
 );
 
 




More information about the Bast-commits mailing list