Subject: | Non parameterized values in queries consuming Oracle cursors |
Date: | Mon, 26 Oct 2015 10:57:55 -0400 |
To: | bug-TheSchwartz [...] rt.cpan.org |
From: | "Morton, Adam" <adam.morton [...] pearson.com> |
Hi there-- I've started using TheSchwartz with an Oracle db, and quickly
ran out of cursors. It seems that some queries were being specified with
values directly in the SQL, not paramaterized. Oracle does not like this.
Here's a patch against 1.12:
297,298c297,298
< run_after => \"<= $unixtime",
< grabbed_until => \"<= $unixtime",
---
Show quoted text
> run_after => { op => '<=', value => $unixtime},
> grabbed_until => { op => '<=', value => $unixtime},
357,358c357,358
< run_after => \"<= $unixtime",
< grabbed_until => \"<= $unixtime",
---
Show quoted text> run_after => { op => '<=', value => $unixtime },
> grabbed_until => { op => '<=', value => $unixtime },
There may also be an issue with this query at line 427 but I'm not fluent
enough with ObjectDriver to be sure that this will be a problem, or know
exactly how to fix it. I'm guessing tha tthe last term in the
grabbed_until array can become another op/value hashref?
if ( $driver->update( $job, {
grabbed_until => [
'-and',
{ op => '=', value => $old_grabbed_until},
\" <= $unixtime"
]}) < 1 )