From: Matt S Trout Date: Sun, 14 Apr 2019 19:16:56 +0000 (+0000) Subject: verify "col = (SELECT ...)" works X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=abf130017ed6431f7455a58ada8e6d599a1d16fb;p=scpubgit%2FQ-Branch.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;