apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronen Mizrahi <ro...@tversity.com>
Subject Re: possible bug in apr_dbd_sqlite3.c
Date Fri, 09 Sep 2005 16:20:40 GMT
Any feedback of this?

Ronen Mizrahi wrote:

> Hello,
>
> In sqlite3 "END TRANSACTION" and "COMMIT" are synonyms, yet the code 
> below, taken from the svn head of apr_dbd_sqlite3.c, invokes them both 
> resulting in sqlite returning an SQL error when doing the commit 
> becuase there is no active transaction. Can someone that knows sqlite 
> better please check it and confirm this? I would like to know if I am 
> correct or I am missing something. As a side comment, in case you are 
> wondering, I just realized that this issue was not detected earlier 
> due to various bugs in dbd_sqlite3_query() (now they are fixed, thank 
> you to whoever fixed them, BTW) that prevented the correct error code 
> from being returned.
>
> Thank you,
>
> Ronen
>
> static int dbd_sqlite3_end_transaction(apr_dbd_transaction_t *trans)
> {
>    int ret = 0;
>    int nrows = 0;
>
>    if (trans) {
>        ret = dbd_sqlite3_query(trans->handle, &nrows, "END 
> TRANSACTION;");
>        if (trans->errnum) {
>            trans->errnum = 0;
>            ret = dbd_sqlite3_query(trans->handle, &nrows, "ROLLBACK;");
>        } else {
>            ret = dbd_sqlite3_query(trans->handle, &nrows, "COMMIT;");
>        }
>        trans->handle->trans = NULL;
>    }
>
>    return ret;
> }
>


Mime
View raw message