sub limit_dialect {
my $self = shift;
- $self->{limit_dialect} = shift if @_;
+ if (@_) {
+ $self->{limit_dialect} = shift;
+ undef $self->{_cached_syntax};
+ }
return $self->{limit_dialect};
}
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 ({}, {
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,
'(
# 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 });