Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

@sneils
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant