Auto adding "LIMIT" to quick_select lets fail queries for DBD::Oracle #39

Open
sneils opened this Issue Jun 6, 2013 · 0 comments

Projects

None yet

1 participant

sneils commented Jun 6, 2013

DBD::Oracle or rather Oracle in common doesn't have a "LIMIT" key word, so
database->quick_select
produces invalid queries!

Dancer::Plugin::Database::Handle

306: } elsif ($type eq 'SELECT' && !wantarray) {
307:        # We're only returning one row in scalar context, so don't ask for any
308:        # more than that
309:        $sql .= " LIMIT 1";
310: }

So the following

my $row = database->quick_select('mytable', { id => params->{id} });

Produces

(DBD ERROR: error possibly near <> indicator at char 46 in 'SELECT * FROM "mytable" WHERE "id"=:p1 <>LIMIT 1') [for Statement "SELECT * FROM "mytable" WHERE "id"=? LIMIT 1"] at /usr/lib/perl5/site_perl/5.10.0/Dancer/Plugin/Database/Handle.pm line 336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment