subselect in from renders ok
[scpubgit/Q-Branch.git] / xt / clauses.t
index 450b616..8b7427f 100644 (file)
@@ -88,4 +88,12 @@ is_same_sql(
   q{SELECT x.*, y.* FROM x JOIN y USING (y_id)},
 );
 
+is_same_sql(
+  $sqlac->select({
+    select => 'x.*',
+    from => [ { -select => { select => '*', from => 'y' } }, -as => 'x' ],
+  }),
+  q{SELECT x.* FROM (SELECT * FROM y) AS x},
+);
+
 done_testing;