[Bast-commits] r5390 - in SQL-Abstract/1.x/branches/1.50_RC: .
lib/SQL t
norbi at dev.catalyst.perl.org
norbi at dev.catalyst.perl.org
Fri Jan 30 20:22:11 GMT 2009
Author: norbi
Date: 2009-01-30 20:22:09 +0000 (Fri, 30 Jan 2009)
New Revision: 5390
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:
r5491 at vger: mendel | 2009-01-30 21:21:41 +0100
* Passing a hashref as bind value in insert() does not blow up, but passes the hashref through (like older SQLA versions did) and emits a warning. Later to be changed to die (with a helpful message).
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:5311
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:5491
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-01-30 18:00:09 UTC (rev 5389)
+++ SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm 2009-01-30 20:22:09 UTC (rev 5390)
@@ -161,6 +161,12 @@
},
# THINK : anything useful to do with a HASHREF ?
+ HASHREF => sub { # (nothing, but old SQLA passed it through)
+ #TODO in SQLA >= 2.0 it will die instead
+ belch "HASH ref as bind value in insert is not supported";
+ push @values, '?';
+ push @all_bind, $v;
+ },
SCALARREF => sub { # literal SQL without bind
push @values, $$v;
Modified: SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t 2009-01-30 18:00:09 UTC (rev 5389)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t 2009-01-30 20:22:09 UTC (rev 5390)
@@ -360,6 +360,14 @@
stmt_q => 'SELECT * FROM `test` WHERE ( `a` < to_date(?, \'MM/DD/YY\') AND `b` = ? )',
bind => ['02/02/02', 8],
},
+ #39
+ { #TODO in SQLA >= 2.0 it will die instead (we kept this just because old SQLA passed it through)
+ func => 'insert',
+ args => ['test', {a => 1, b => 2, c => 3, d => 4, e => { answer => 42 }}],
+ stmt => 'INSERT INTO test (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)',
+ stmt_q => 'INSERT INTO `test` (`a`, `b`, `c`, `d`, `e`) VALUES (?, ?, ?, ?, ?)',
+ bind => [qw/1 2 3 4/, { answer => 42}],
+ },
);
More information about the Bast-commits
mailing list