From: Matt S Trout Date: Fri, 20 Apr 2012 04:07:03 +0000 (+0000) Subject: Not supporting the old SQL::Abstract::Limit custom horror X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5959fae55938a2d518df42ab8216e83683164f96;p=dbsrgits%2FDBIx-Class-Historic.git Not supporting the old SQL::Abstract::Limit custom horror --- diff --git a/t/sqlmaker/limit_dialects/custom.t b/t/sqlmaker/limit_dialects/custom.t deleted file mode 100644 index 650cd99..0000000 --- a/t/sqlmaker/limit_dialects/custom.t +++ /dev/null @@ -1,50 +0,0 @@ -use strict; -use warnings; - -use Test::More; - -use lib qw(t/lib); -use DBICTest; -use DBICTest::Schema; -use DBIC::SqlMakerTest; - -# This is legacy stuff from SQL::Absract::Limit -# Keep it around just in case someone is using it - -{ - package DBICTest::SQLMaker::CustomDialect; - use base qw/DBIx::Class::SQLMaker/; - sub emulate_limit { - my ($self, $sql, $rs_attrs, $limit, $offset) = @_; - return sprintf ('shiny sproc ((%s), %d, %d)', - $sql, - $limit || 0, - $offset || 0, - ); - } -} -my $s = DBICTest::Schema->connect (DBICTest->_database); -$s->storage->sql_maker_class ('DBICTest::SQLMaker::CustomDialect'); - -my $rs = $s->resultset ('CD'); -is_same_sql_bind ( - $rs->search ({}, { rows => 1, offset => 3,columns => [ - { id => 'foo.id' }, - { 'bar.id' => 'bar.id' }, - { bleh => \ 'TO_CHAR (foo.womble, "blah")' }, - ]})->as_query, - '( - shiny sproc ( - ( - SELECT foo.id, bar.id, TO_CHAR (foo.womble, "blah") - FROM cd me - ), - 1, - 3 - ) - )', - [], - 'Rownum subsel aliasing works correctly' -); - -done_testing;