Erlend Egeberg Aasland <erlend.aasl...@innova.no> added the comment:
Ah, at last I found the source of the confusion: The SQLite changelog. Quoting from msg387619 and https://sqlite.org/changes.html: > From the SQLite 3.5.3 changelog: > - sqlite3_step() returns SQLITE_MISUSE instead of crashing when called with a > NULL parameter. I assumed this was correct without even trying it. This short snippet shows something else: int rc = sqlite3_reset(NULL); printf("reset with NULL: %d %s\n", rc, sqlite3_errstr(rc)); $ ./a.out reset with NULL: 0 not an error Gerhard's comment was right and the workaround was right. I'll adjust the comment. 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. Behaviour stays the same; no regressions introduced. I learned a lot about the sqlite3 module, and I relearned I should not trust changelogs/documentation without trying stuff myself first. I'll adjust the erroneous comment and re-request a review, Dong-hee. ---------- _______________________________________ 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