[Bast-commits] r6391 - in DBIx-Class/0.08/trunk:
lib/DBIx/Class/Storage/DBI t/resultset
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat May 23 21:37:19 GMT 2009
Author: ribasushi
Date: 2009-05-23 21:37:19 +0000 (Sat, 23 May 2009)
New Revision: 6391
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm
DBIx-Class/0.08/trunk/t/resultset/update_delete.t
Log:
Make sure MultiColumnIn quotes column names while munging literal sql
Tested by running t/resultset/update_delete against pg with quote char " and name sep .
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm 2009-05-23 21:04:01 UTC (rev 6390)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm 2009-05-23 21:37:19 UTC (rev 6391)
@@ -33,9 +33,10 @@
if ( ref $attrs->{select} ne 'ARRAY' or @{$attrs->{select}} != @pcols );
# This is hideously ugly, but SQLA does not understand multicol IN expressions
+ my $sqla = $self->_sql_maker;
my ($sql, @bind) = @${$rs->as_query};
- $sql = sprintf ('(%s) IN %s',
- join (', ', @pcols),
+ $sql = sprintf ('(%s) IN %s', # the as_query stuff is already enclosed in ()s
+ join (', ', map { $sqla->_quote ($_) } @pcols),
$sql,
);
Modified: DBIx-Class/0.08/trunk/t/resultset/update_delete.t
===================================================================
--- DBIx-Class/0.08/trunk/t/resultset/update_delete.t 2009-05-23 21:04:01 UTC (rev 6390)
+++ DBIx-Class/0.08/trunk/t/resultset/update_delete.t 2009-05-23 21:37:19 UTC (rev 6391)
@@ -13,8 +13,6 @@
my $tkfks = $schema->resultset('FourKeys_to_TwoKeys');
-warn "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
-
my ($fa, $fb) = $tkfks->related_resultset ('fourkeys')->populate ([
[qw/foo bar hello goodbye sensors read_count/],
[qw/1 1 1 1 a 10 /],
More information about the Bast-commits
mailing list