Author palaviv
Recipients berker.peksag, fschulze, ghaering, jaraco, palaviv, serhiy.storchaka, socketpair, xiang.zhang
Date 2016-10-31.17:07:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477933656.14.0.0420789965532.issue28518@psf.upfronthosting.co.za>
In-reply-to
Content
I looked into this error and I think the problem is the sqlite3_stmt_readonly check in _pysqlite_query_execute (cursor.c line 517):

    if (self->connection->begin_statement && !sqlite3_stmt_readonly(self->statement->st) && !self->statement->is_ddl) {
        if (sqlite3_get_autocommit(self->connection->db)) {
            result = _pysqlite_connection_begin(self->connection);
            if (!result) {
                goto error;
            }
            Py_DECREF(result);
        }
    }

As you can see we check if the current statement is not readonly and if so we start a transaction. The problem is that sqlite3_stmt_readonly return false for the "begin immediate" statement. When this happens we open a transaction with _pysqlite_connection_begin and then executing the "begin immediate".

I think this is a error in sqlite as the documentation says:
"ransaction control statements such as BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE cause sqlite3_stmt_readonly() to return true,"
(https://www.sqlite.org/c3ref/stmt_readonly.html)
History
Date User Action Args
2016-10-31 17:07:36palavivsetrecipients: + palaviv, ghaering, jaraco, socketpair, berker.peksag, serhiy.storchaka, xiang.zhang, fschulze
2016-10-31 17:07:36palavivsetmessageid: <1477933656.14.0.0420789965532.issue28518@psf.upfronthosting.co.za>
2016-10-31 17:07:36palavivlinkissue28518 messages
2016-10-31 17:07:35palavivcreate