[Bast-commits] r5166 - in SQL-Abstract/1.x/branches/1.50_RC: .
lib/SQL t
norbi at dev.catalyst.perl.org
norbi at dev.catalyst.perl.org
Thu Nov 20 11:32:24 GMT 2008
Author: norbi
Date: 2008-11-20 11:32:24 +0000 (Thu, 20 Nov 2008)
New Revision: 5166
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:
r5190 at vger: mendel | 2008-11-20 12:32:12 +0100
* Support for the { operator => \"..." } construct (to embed literal SQL).
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:5172
+ 4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC:5190
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 2008-11-20 11:09:11 UTC (rev 5165)
+++ SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm 2008-11-20 11:32:24 UTC (rev 5166)
@@ -529,6 +529,13 @@
($sql, @bind) = $self->_where_field_op_ARRAYREF($k, $op, $val);
}
+ # CASE: col => {op => \$scalar}
+ elsif (ref $val eq 'SCALAR') {
+ $sql = join ' ', $self->_convert($self->_quote($k)),
+ $self->_sqlcase($op),
+ $$val;
+ }
+
# CASE: col => {op => undef} : sql "IS (NOT)? NULL"
elsif (! defined($val)) {
my $is = ($op =~ $self->{equality_op}) ? 'is' :
@@ -2066,6 +2073,10 @@
=item *
+support for the { operator => \"..." } construct (to embed literal SQL)
+
+=item *
+
added -nest1, -nest2 or -nest_1, -nest_2, ...
=item *
Modified: SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t 2008-11-20 11:09:11 UTC (rev 5165)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t 2008-11-20 11:32:24 UTC (rev 5166)
@@ -344,6 +344,14 @@
stmt_q => 'UPDATE `test` SET `a` = ?, `b` = ?',
bind => [[a => 1], [b => [1, 1, 2, 3, 5, 8]]],
},
+ #37
+ {
+ func => 'select',
+ args => ['test', '*', { a => {'>', \'1 + 1'}, b => 8 }],
+ stmt => 'SELECT * FROM test WHERE ( a > 1 + 1 AND b = ? )',
+ stmt_q => 'SELECT * FROM `test` WHERE ( `a` > 1 + 1 AND `b` = ? )',
+ bind => [8],
+ },
);
More information about the Bast-commits
mailing list