From: Dagfinn Ilmari Mannsåker Date: Fri, 22 Mar 2013 23:21:36 +0000 (+0000) Subject: Test NULLS FIRST/LAST for limit dialects that mangle ordering X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c9795e4890a770a4ecc7b74e010ba06c7ab971e;p=dbsrgits%2FDBIx-Class-Historic.git Test NULLS FIRST/LAST for limit dialects that mangle ordering --- diff --git a/t/sqlmaker/limit_dialects/fetch_first.t b/t/sqlmaker/limit_dialects/fetch_first.t index b867086..6a1dd7c 100644 --- a/t/sqlmaker/limit_dialects/fetch_first.t +++ b/t/sqlmaker/limit_dialects/fetch_first.t @@ -114,6 +114,17 @@ for my $ord_set ( exselect_outer => 'ORDER__BY__001, ORDER__BY__002, ORDER__BY__003', exselect_inner => 'title AS ORDER__BY__001, bar AS ORDER__BY__002, sensors AS ORDER__BY__003', }, + { + order_by => [ + { -asc => 'title', -nulls => 'first' }, + { -desc => 'bar', -nulls => 'last' }, + ], + order_inner => 'title NULLS FIRST, bar DESC NULLS LAST', + order_outer => 'ORDER__BY__001 DESC NULLS LAST, ORDER__BY__002 NULLS FIRST', + order_req => 'ORDER__BY__001 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} diff --git a/t/sqlmaker/limit_dialects/toplimit.t b/t/sqlmaker/limit_dialects/toplimit.t index a4e7836..6374588 100644 --- a/t/sqlmaker/limit_dialects/toplimit.t +++ b/t/sqlmaker/limit_dialects/toplimit.t @@ -153,6 +153,17 @@ for my $ord_set ( exselect_outer => 'ORDER__BY__001, ORDER__BY__002, ORDER__BY__003', exselect_inner => 'title AS ORDER__BY__001, bar AS ORDER__BY__002, sensors AS ORDER__BY__003', }, + { + order_by => [ + { -asc => 'title', -nulls => 'first' }, + { -desc => 'bar', -nulls => 'last' }, + ], + order_inner => 'title NULLS FIRST, bar DESC NULLS LAST', + order_outer => 'ORDER__BY__001 DESC NULLS LAST, ORDER__BY__002 NULLS FIRST', + order_req => 'ORDER__BY__001 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}