[Dovecot] Oracle SQL driver
Timo Sirainen
tss at iki.fi
Wed Jan 6 14:30:46 EET 2010
On 6.1.2010, at 14.09, Alexander Bukharov wrote:
>> The transaction handling doesn't look correct to me. The sql_update()s
>> just add the change to a linked list and commit() is then supposed to
>> run them in one transaction and either everything should succeed or
>> fail. Your commit appears to ignore errors and just commit everything
>> that goes through? Also since nothing is actually sent before commit(),
>> your rollback() shouldn't need to send ROLLBACK.
>
> You right. I've corrected the transaction handling mechanism. The only
> thing I couldn't understand: why rollback() shouldn't need to make real
> ROLLBACK? In case when whole transaction was failed succeded statements
> will remain uncommited. Then they will be commited later on next successful
> transaction. May be ROLLBACK is still needed?
There wouldn't be any uncommitted statements. The only such statements are sent inside commit(), the others are SELECTs and such that don't modify anything.
>> The "VARCHAR sqltext[2048]" seems like an unnecessary restriction on the
>> query length. Wasn't there a way to do this without the limit? Or in
>
> AFAIK there is no possibility to use C types in PREPARE statement. Also
> Oracle cannot handle unsized VARCHARs. I've increased VARCHAR size to
> 65535.
Well, that also wastes memory :) I thought I remembered using VARCHAR pointers about 10 years ago. I think I still have that code around, but I currently don't have a computer where I could put that hard drive. Maybe in a few days.
>> driver_oracle_escape_string() really should be escaping the string.
>
> I made this function to replace single quote in string with two single
> quotes. IMHO this should be enough. How do you think?
Does Oracle handle \ specially? I don't have Oracle installed currently or access to any installations.
I'll check the updated patch later.
More information about the dovecot
mailing list