It looks like the empty-not-undef fix in
7cc47319 also fixes the general
issue of throwing on unknown operators (e.g. reverting
af75bd59 would
still yield passing code, though the AST will still be incorrect).
Add a currently passing test as a reminder of what stuff to look for
#!/usr/bin/env perl
use Test::More;
+use Test::Exception;
+
use SQL::Abstract::Test import => ['is_same_sql'];
use SQL::Abstract::Tree;
my $sql = 'SELECT COUNT( * ) FROM foo';
is($sqlat->format($sql), $sql, 'Roundtripping to mysql-compatible paren. syntax');
+lives_ok { $sqlat->unparse( $sqlat->parse( <<'EOS' ) ) } 'Able to parse/unparse grossly malformed sql';
+SELECT
+ (
+ SELECT *, * FROM EXISTS bar JOIN ON a = b
+ NOT WHERE c !!= d
+ ),
+ NOT x,
+ (
+ SELECT * FROM bar WHERE NOT NOT EXISTS (SELECT 1)
+ ),
+WHERE NOT NOT 1 AND OR foo IN (1,2,,,3,,,),
+GROUP BY bar
+
+EOS
+
done_testing;