From: Matt S Trout Date: Sat, 12 Oct 2013 16:12:28 +0000 (+0000) Subject: complete murdering emulate_limit X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7027fcdb42f20465bd1155f7dbc503d21b342ca8;p=dbsrgits%2FDBIx-Class.git complete murdering emulate_limit --- diff --git a/lib/DBIx/Class/SQLMaker.pm b/lib/DBIx/Class/SQLMaker.pm index 0256793..dc62763 100644 --- a/lib/DBIx/Class/SQLMaker.pm +++ b/lib/DBIx/Class/SQLMaker.pm @@ -53,6 +53,15 @@ has limit_dialect => ( trigger => sub { shift->clear_renderer_class } ); +sub BUILD { + if ($_[0]->can('emulate_limit')) { + die < 'GenericSubquery', ); diff --git a/t/sqlmaker/limit_dialects/custom.t b/t/sqlmaker/limit_dialects/custom.t index c5e61c6..8bdee1a 100644 --- a/t/sqlmaker/limit_dialects/custom.t +++ b/t/sqlmaker/limit_dialects/custom.t @@ -2,7 +2,6 @@ use strict; use warnings; use Test::More; -use Test::Warn; use lib qw(t/lib); use DBICTest; @@ -29,27 +28,6 @@ $s->storage->sql_maker_class ('DBICTest::SQLMaker::CustomDialect'); my $rs = $s->resultset ('CD'); -warnings_exist { is_same_sql_bind ( - $rs->search ({}, { rows => 1, offset => 3,columns => [ - { id => 'foo.id' }, - { 'artist.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' - )} - qr/\Qthe legacy emulate_limit() mechanism inherited from SQL::Abstract::Limit has been deprecated/, - 'deprecation warning' -; +ok(!eval { $rs->all }, 'Legacy emulate_limit method dies'); done_testing;