apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronen Mizrahi <ro...@tversity.com>
Subject possible bug in apr_dbd_sqlite3.c
Date Tue, 06 Sep 2005 22:15:02 GMT

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,


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;

View raw message