Permalink
Browse files

nested {}-blocks bugfix

git-svn-id: svn://dklab.ru/lib/DbSimple/trunk@204 78bb956b-1e24-0410-b8d0-c528fdc9eae3
  • Loading branch information...
1 parent 088a7cd commit 05465c1b15d3fea5a4be03598bf6363469f354e0 dk committed Jul 2, 2007
Showing with 22 additions and 0 deletions.
  1. +22 −0 t/DbSimple/Generic/070_nested_blocks.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Generic: nested {}-blocks usage
+--FILE--
+<?php
+require_once dirname(__FILE__) . '/../init.php';
+
+function main(&$DB)
+{
+ @$DB->query("SELECT * FROM t1 WHERE 1 { AND a = ?d } AND c = ?d", 1, 3);
+ @$DB->query("SELECT * FROM t1 WHERE 1 { AND a = ?d } AND c = ?d", DBSIMPLE_SKIP, 3);
+ @$DB->query("SELECT * FROM t1 WHERE 1 { AND a = ?d { AND b=?d } } AND c = ?d", 1, 2, 3);
+ @$DB->query("SELECT * FROM t1 WHERE 1 { AND a = ?d { AND b=?d } } AND c = ?d", 1, DBSIMPLE_SKIP, 3);
+ @$DB->query("SELECT * FROM t1 WHERE 1 { AND a = ?d { AND b=?d } } AND c = ?d", DBSIMPLE_SKIP, 2, 3);
+}
+
+?>
+--EXPECT--
+Query: 'SELECT * FROM t1 WHERE 1 AND a = 1 AND c = 3'
+Query: 'SELECT * FROM t1 WHERE 1 AND c = 3'
+Query: 'SELECT * FROM t1 WHERE 1 AND a = 1 AND b=2 AND c = 3'
+Query: 'SELECT * FROM t1 WHERE 1 AND a = 1 AND c = 3'
+Query: 'SELECT * FROM t1 WHERE 1 AND c = 3'

0 comments on commit 05465c1

Please sign in to comment.