From: Matt S Trout Date: Sun, 14 Apr 2019 19:16:56 +0000 (+0000) Subject: verify "col = (SELECT ...)" works X-Git-Tag: v2.000000~3^2~240 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=578d90531072dd5fd9c7f3bd017349acd15f1316;p=dbsrgits%2FSQL-Abstract.git verify "col = (SELECT ...)" works --- diff --git a/xt/clauses.t b/xt/clauses.t index 37ef057..4d6a219 100644 --- a/xt/clauses.t +++ b/xt/clauses.t @@ -131,4 +131,15 @@ is_same_sql( WHERE NOT EXISTS (SELECT 1 FROM bar WHERE foo.id = bar.foo_id)}, ); +is_same_sql( + $sqlac->select({ + select => '*', + from => 'foo', + where => { id => { + '=' => { -select => { select => { -max => 'id' }, from => 'foo' } } + } }, + }), + q{SELECT * FROM foo WHERE id = (SELECT MAX(id) FROM foo)}, +); + done_testing;