From: Peter Rabbitson Date: Fri, 3 Jul 2009 18:18:53 +0000 (+0000) Subject: detabify X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed0648ee6d4351e36104eda1ac8b19834a774937;p=dbsrgits%2FDBIx-Class-Historic.git detabify --- diff --git a/t/42toplimit.t b/t/42toplimit.t index 3968996..242e623 100644 --- a/t/42toplimit.t +++ b/t/42toplimit.t @@ -5,12 +5,12 @@ use Test::More; use lib qw(t/lib); use DBICTest; use DBIC::SqlMakerTest; -$|++; + my $schema = DBICTest->init_schema; # Trick the sqlite DB to use Top limit emulation # We could test all of this via $sq->$op directly, -# but some conditions needs a $rsrc +# but some conditions need a $rsrc delete $schema->storage->_sql_maker->{_cached_syntax}; $schema->storage->_sql_maker->limit_dialect ('Top'); @@ -49,13 +49,13 @@ sub test_order { me__id, source, owner, title, price, owner__id, name FROM (SELECT TOP 1 me__id, source, owner, title, price, owner__id, name FROM - (SELECT - TOP 4 me.id AS me__id, me.source, me.owner, me.title, me.price, owner.id AS owner__id, owner.name FROM - books me - JOIN owners owner ON owner.id = me.owner - WHERE ( source = ? ) - ORDER BY $args->{order_inner} - ) me ORDER BY $args->{order_outer} + (SELECT + TOP 4 me.id AS me__id, me.source, me.owner, me.title, me.price, owner.id AS owner__id, owner.name FROM + books me + JOIN owners owner ON owner.id = me.owner + WHERE ( source = ? ) + ORDER BY $args->{order_inner} + ) me ORDER BY $args->{order_outer} ) me $req_order )", [ [ source => 'Library' ] ], @@ -132,16 +132,16 @@ me.id, me.source, me.owner, me.title, me.price, owner.id, owner.name FROM ( SELECT id, source, owner, title, price FROM ( SELECT - TOP 1 id, source, owner, title, price FROM - ( SELECT - TOP 4 me.id, me.source, me.owner, me.title, me.price FROM - books me JOIN - owners owner ON owner.id = me.owner - WHERE ( source = ? ) - GROUP BY title - ORDER BY title ASC - ) me - ORDER BY title DESC + TOP 1 id, source, owner, title, price FROM + ( SELECT + TOP 4 me.id, me.source, me.owner, me.title, me.price FROM + books me JOIN + owners owner ON owner.id = me.owner + WHERE ( source = ? ) + GROUP BY title + ORDER BY title ASC + ) me + ORDER BY title DESC ) me ORDER BY title ) me JOIN