Bug 53689 - apr_dbd_prepare should pass offsets to the drivers' prepare-functions
Summary: apr_dbd_prepare should pass offsets to the drivers' prepare-functions
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: HEAD
Hardware: PC FreeBSD
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-09 19:40 UTC by Mikhail T.
Modified: 2012-08-09 19:42 UTC (History)
0 users



Attachments
Alter the "prepare" API call to pass offsets found by apr_dbd_prepare to the drivers (2.17 KB, patch)
2012-08-09 19:40 UTC, Mikhail T.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2012-08-09 19:40:45 UTC
Created attachment 29202 [details]
Alter the "prepare" API call to pass offsets found by apr_dbd_prepare to the drivers

While trying to fix the FreeTDS driver (see Bug 53666), it occurred to me, that -- because the work of parsing the statement-templates is already done by the global apr_dbd_prepare() -- the function should share its findings with the drivers' prepare-calls.

FreeTDS would certainly benefit from it, while others will not be hurt -- there need not be an ABI change and the existing drivers will not need recompiling.

A brief discussion with bojan@ revealed, that he is hesitant to change the API, which is understandable. I, however, believe, that the change's usefulness makes it worthwhile.

The argument, that the list of offsets would only be useful to FreeTDS is countered by the fact, that "label" is ignored by most drivers too.

Though I'm submitting a patch for Bug 53666 fixing FreeTDS-driver without this change, I'd much rather avoid the work-duplication and hackery involved in reparsing the string, that was already processed above...
Comment 1 Mikhail T. 2012-08-09 19:42:15 UTC
Comment on attachment 29202 [details]
Alter the "prepare" API call to pass offsets found by apr_dbd_prepare to the drivers

If need be, the creation and population of the proposed offsets-array can be made conditional on driver->pformat being empty...