Bojan Smojver wrote: > Some time ago we had quite a few e-mails exchanged about DBD's prepared > statement support and various ways of getting binary data in and out of > prepared statements. So, I prepared these two patches to outline with > code what I had in mind. You may find some of your suggestions in these > patches - this is not by accident. > > Before you attempt to compile and run this, let me put it bluntly: these > patches DON'T WORK! They have not been tested at all - they are here > just to express some of the ideas in code. The code in there may (and > most likely does) have serious flaws, even to the point where you could > be scratching you head thinking "what did he want with this". Hopefully, > main ideas will remain visible. > > What is in the patches? This (roughly): > > - parsing of SQL to find parameters has been moved out of the drivers > and into the upper layer, so it should be identical for all supported > databases > > - new functions apr_dbd_pb[v]query/select() have been introduced, which > take "binary" (void *) arguments instead of const char * > > - new function apr_dbd_datum_get() has been introduced to fetch binary > data from prepared queries > > - structure apr_dbd_blob_t has been defined to pass BLOBs into the query > > - SQL to C types have been enumerated > > - some situations of in-driver duplication of code have been avoided > (this is mostly as a consequence of new functions being introduced) > > - "streaming" of BLOB data using a bucket brigade from MySQL (now there > is some code that *definitely* won't work :-) > > - the code should be binary compatible with 1.2.x (i.e. no need to go to > APR-Util 2.x to have this) > > - lots and lots of new bugs ;-) > > You will find that I haven't done any work on the Oracle driver. It is > simply because I really have no idea about the API. But, I tried to > incorporate some of the concerns raised into the patches (i.e. in terms > of BLOBs). I guess SQLite3, PGSQL and MySQL stuff should be sufficient > enough to represent the ideas. > > Criticise away - this is what the patches are for!
Wow, this is quite a lot of work! I'm going to have some travel next week so I'll take it with me to review on the plane trips. I'll have to remind myself -- again -- what Oracle's various weirdnesses are with regard to LOBs. :-) Thanks! Chris. -- GPG Key ID: 366A375B GPG Key Fingerprint: 485E 5041 17E1 E2BB C263 E4DE C8E3 FA36 366A 375B
