Handle NULLS clauses when mangling ordering
[dbsrgits/DBIx-Class.git] / t / sqlmaker / limit_dialects / fetch_first.t
index 625a464..13adac2 100644 (file)
@@ -124,6 +124,17 @@ for my $ord_set (
     order_outer => 'name DESC',
     order_req => 'name',
   },
+  {
+    order_by => [
+        { -asc => 'title', -nulls => 'first' },
+        { -desc => 'bar', -nulls => 'last' },
+    ],
+    order_inner => 'title ASC NULLS FIRST, bar DESC NULLS LAST',
+    order_outer => 'ORDER__BY__001 DESC NULLS LAST, ORDER__BY__002 ASC NULLS FIRST',
+    order_req => 'ORDER__BY__001 ASC NULLS FIRST, ORDER__BY__002 DESC NULLS LAST',
+    exselect_outer => 'ORDER__BY__001, ORDER__BY__002',
+    exselect_inner => 'title AS ORDER__BY__001, bar AS ORDER__BY__002',
+  },
 ) {
   my $o_sel = $ord_set->{exselect_outer}
     ? ', ' . $ord_set->{exselect_outer}