A yet more-smarter parser for SQLA::Test - any smarter than that and we go skynet
[dbsrgits/SQL-Abstract.git] / t / 10test.t
index d099cbd..c1057c6 100644 (file)
@@ -200,6 +200,20 @@ my @sql_tests = (
           q/SELECT foo FROM bar WHERE a = 1 OR (b = 1 AND c = 1)/,
         ]
       },
+      {
+        equal => 0,
+        statements => [
+          # BETWEEN with/without parenthesis around itself/RHS is a sticky business
+          # if I made a mistake here, simply rewrite the special BETWEEN handling in
+          # _recurse_parse()
+          #
+          # by RIBASUSHI
+          q/SELECT foo FROM bar WHERE ( completion_date BETWEEN ? AND ? AND status = ? )/,
+          q/SELECT foo FROM bar WHERE completion_date BETWEEN (? AND ?) AND status = ?/,
+          q/SELECT foo FROM bar WHERE ( (completion_date BETWEEN (? AND ?) ) AND status = ? )/,
+          q/SELECT foo FROM bar WHERE ( (completion_date BETWEEN (? AND ? AND status = ?) ) )/,
+        ]
+      },
 
       # JOIN condition - equal
       {