Permalink
Browse files

Fix auto-tests for SQL::Dialect.

  • Loading branch information...
1 parent 95acec2 commit 22696797a52d6b67f0f3a061717d87a3bd14677b @bluefeet committed Oct 5, 2011
Showing with 7 additions and 5 deletions.
  1. +2 −2 lib/SQL/Abstract/Query/Select.pm
  2. +5 −3 t/select.t
@@ -362,7 +362,7 @@ sub _apply_limit {
my $abstract = $self->query->abstract();
my $dialect = $self->query->dialect();
- if ($dialect->supports('limit_offset')) {
+ if ($dialect->supports('limit-offset')) {
$$sql .= ' LIMIT ?';
push @$bind_values, $limit;
@@ -371,7 +371,7 @@ sub _apply_limit {
push @$bind_values, $offset;
}
}
- elsif ($dialect->supports('limit_xy')) {
+ elsif ($dialect->supports('limit-xy')) {
$$sql .= ' LIMIT';
if (defined $offset) {
$$sql .= ' ?,';
View
@@ -110,7 +110,7 @@ my $query = SQL::Abstract::Query->new();
# LIMIT
{
- my $query = SQL::Abstract::Query->new( limit_dialect => 'offset' );
+ my $query = SQL::Abstract::Query->new( SQL::Dialect->new(limit=>'offset') );
my $select = $query->select(
['user_id'],
@@ -133,7 +133,7 @@ my $query = SQL::Abstract::Query->new();
}
{
- my $query = SQL::Abstract::Query->new( limit_dialect => 'xy' );
+ my $query = SQL::Abstract::Query->new( SQL::Dialect->new(limit=>'xy') );
my $select = $query->select(
['user_id'],
@@ -156,7 +156,7 @@ my $query = SQL::Abstract::Query->new();
}
{
- my $query = SQL::Abstract::Query->new( limit_dialect => 'rownum' );
+ my $query = SQL::Abstract::Query->new( SQL::Dialect->new(rownum=>1) );
my $select = $query->select(
['user_id'],
@@ -181,6 +181,8 @@ my $query = SQL::Abstract::Query->new();
# ALL TOGETHER NOW!
{
+ my $query = SQL::Abstract::Query->new( SQL::Dialect->new(limit=>'offset') );
+
my $select = $query->select(
['u.user_id', 'e.address', \'MAX(logs.level)'],
[ {'users' => 'u'}, {name=>'user_emails', as=>'e', on=>{'e.user_id' => \'= u.user_id'}}, 'logs' ],

0 comments on commit 2269679

Please sign in to comment.