[Dbix-class] SQL::Abstract 1.x subqueries patch

Zbigniew Lukasiak zzbbyy at gmail.com
Wed Nov 5 13:58:12 GMT 2008


I've started testing it with the latest DBIC.

Here is a test I propose:

Index: t/02where.t
===================================================================
--- t/02where.t (wersja 5054)
+++ t/02where.t (kopia robocza)
@@ -175,6 +175,18 @@
         stmt => " WHERE ( (bar > ? AND bar < ?) AND foo IN (?, ?) )",
         bind => [44, 55, 22, 33],
     },
+    {
+        where => {
+                       '-and' => [
+                                   {},
+                                   {
+                                     'me.id' => '1'
+                                   }
+                                 ]
+        },
+        stmt => " WHERE ( ( me.id = ? ) )",
+        bind => [ 1 ],
+    },

 );

Currently this is translated into "WHERE ( 0 AND ( me.id = ? ) )" and
that causes t/relationship_doesnt_exist.t in DBIC fail.  I've tested
that the 1.24 does ignore that spurious clause (it is added in the
'single' method in ResultSet).

-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/



More information about the DBIx-Class mailing list