]
], 'real life statement 1 parsed correctly');
+is_deeply($sqlat->parse("CASE WHEN FOO() > BAR()"), [
+ [
+ "-MISC",
+ [
+ [
+ "-LITERAL",
+ [
+ "CASE"
+ ]
+ ],
+ [
+ "-LITERAL",
+ [
+ "WHEN"
+ ]
+ ]
+ ]
+ ],
+ [
+ ">",
+ [
+ [
+ "FOO",
+ [
+ [
+ "-PAREN",
+ []
+ ]
+ ]
+ ],
+ [
+ "BAR",
+ [
+ [
+ "-PAREN",
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+]);
+
+
is_deeply($sqlat->parse("SELECT x, y FROM foo WHERE x IN (?, ?, ?, ?)"), [
[
"SELECT",
]
], 'Crazy ORDER BY parsed correctly');
-is_deeply( $sqlat->parse("META SELECT * * FROM (SELECT *, FROM foobar baz buzz) foo bar WHERE NOT NOT NOT EXISTS (SELECT 'cr,ap') AND foo.a = ? STUFF moar(stuff) and not (foo.b LIKE 'station') and x = y and a = b and GROUP BY , ORDER BY x x1 x2 y asc, max(y) desc x z desc"), [
+is_deeply( $sqlat->parse("META SELECT * * FROM (SELECT *, FROM foobar baz buzz) foo bar WHERE NOT NOT NOT EXISTS (SELECT 'cr,ap') AND foo.a = ? STUFF moar(stuff) and not (foo.b LIKE 'station') and x = y and z in ((1, 2)) and a = b and GROUP BY , ORDER BY x x1 x2 y asc, max(y) desc x z desc"), [
[
"-LITERAL",
[
]
],
[
+ 'IN',
+ [
+ [
+ '-LITERAL',
+ [
+ 'z',
+ ],
+ ],
+ [
+ '-PAREN',
+ [
+ [
+ '-PAREN',
+ [
+ [
+ '-LIST',
+ [
+ [
+ '-LITERAL',
+ [
+ '1'
+ ]
+ ],
+ [
+ '-LITERAL',
+ [
+ '2'
+ ]
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ [
"=",
[
[