Preliminary fix by arcanez
[scpubgit/Q-Branch.git] / t / 07subqueries.t
index 85f973e..3c79842 100644 (file)
@@ -77,6 +77,19 @@ push @tests, {
   bind => [10, 20, '%son%'],\r
 };\r
 \r
+#6\r
+($sub_stmt, @sub_bind) = ("SELECT c1 FROM t1 WHERE c2 < ? AND c3 LIKE ?",\r
+                          100, "foo%");\r
+$where = {\r
+    foo => 1234,\r
+    bar => { -in => \[$sub_stmt => @sub_bind] },\r
+  };\r
+push @tests, {\r
+  where => $where,\r
+  stmt => " WHERE ( bar IN (SELECT c1 FROM t1 WHERE c2 < ? AND c3 LIKE ?) AND foo = ? )",\r
+  bind => [100, "foo%", 1234],\r
+};\r
+\r
 \r
 plan tests => scalar(@tests);\r
 \r