[Bast-commits] r9275 - in DBIx-Class/0.08/trunk: lib/DBIx/Class
t/sqlahacks/limit_dialects
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Thu Apr 29 08:32:09 GMT 2010
Author: ribasushi
Date: 2010-04-29 09:32:09 +0100 (Thu, 29 Apr 2010)
New Revision: 9275
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm
DBIx-Class/0.08/trunk/t/sqlahacks/limit_dialects/rownumberover.t
DBIx-Class/0.08/trunk/t/sqlahacks/limit_dialects/toplimit.t
Log:
Allow limit syntax change in-flight without digging into internals
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm 2010-04-29 03:04:46 UTC (rev 9274)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm 2010-04-29 08:32:09 UTC (rev 9275)
@@ -609,7 +609,10 @@
sub limit_dialect {
my $self = shift;
- $self->{limit_dialect} = shift if @_;
+ if (@_) {
+ $self->{limit_dialect} = shift;
+ undef $self->{_cached_syntax};
+ }
return $self->{limit_dialect};
}
Modified: DBIx-Class/0.08/trunk/t/sqlahacks/limit_dialects/rownumberover.t
===================================================================
--- DBIx-Class/0.08/trunk/t/sqlahacks/limit_dialects/rownumberover.t 2010-04-29 03:04:46 UTC (rev 9274)
+++ DBIx-Class/0.08/trunk/t/sqlahacks/limit_dialects/rownumberover.t 2010-04-29 08:32:09 UTC (rev 9275)
@@ -8,7 +8,6 @@
my $schema = DBICTest->init_schema;
-delete $schema->storage->_sql_maker->{_cached_syntax};
$schema->storage->_sql_maker->limit_dialect ('RowNumberOver');
my $rs_selectas_col = $schema->resultset ('BooksInLibrary')->search ({}, {
@@ -18,10 +17,6 @@
rows => 1,
});
-use Data::Dumper;
-$Data::Dumper::Maxdepth = 4;
-#die Dumper $rs_selectas_col->_resolved_attrs;
-
is_same_sql_bind(
$rs_selectas_col->as_query,
'(
Modified: DBIx-Class/0.08/trunk/t/sqlahacks/limit_dialects/toplimit.t
===================================================================
--- DBIx-Class/0.08/trunk/t/sqlahacks/limit_dialects/toplimit.t 2010-04-29 03:04:46 UTC (rev 9274)
+++ DBIx-Class/0.08/trunk/t/sqlahacks/limit_dialects/toplimit.t 2010-04-29 08:32:09 UTC (rev 9275)
@@ -11,7 +11,6 @@
# Trick the sqlite DB to use Top limit emulation
# We could test all of this via $sq->$op directly,
# but some conditions need a $rsrc
-delete $schema->storage->_sql_maker->{_cached_syntax};
$schema->storage->_sql_maker->limit_dialect ('Top');
my $rs = $schema->resultset ('BooksInLibrary')->search ({}, { prefetch => 'owner', rows => 1, offset => 3 });
More information about the Bast-commits
mailing list