Erlend Egeberg Aasland <erlend.aasl...@innova.no> added the comment:

msg387668 was a little bit hasty. I'll try again:

Dong-hee Na:
> Hmm by the way the current implementation returns SQLITE_OK if the statement 
> is NULL, but it looks like return SQLITE_MISUSE if we apply this patch.
> Does it not cause any behavior regression? if so we should add news also.

No, behaviour still stays the same; no regressions introduced. The bug is 
triggered by executing an empty statement. This will pass an empty statement to 
pysqlite_step() in line 519 of Modules/_sqlite/cursor.c. Earlier, this returned 
SQLITE_OK. sqlite3_column_count(NULL) returns 0, so we slide through the rest 
of the loop without much happening. Now, pysqlite_step() returns SQLITE_MISUSE, 
which only results in the statement being reset in line 529, and the error 
cleared in line 530. Then we bail out of the loop.

So, the current comment is correct, the SQLite changelog was correct, the 
workaround and old comment was wrong.

I'm done :)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43290>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to