This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erlendaasland
Recipients berker.peksag, christian.heimes, corona10, erlendaasland, serhiy.storchaka
Date 2021-02-25.12:58:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614257896.15.0.0599936036308.issue43290@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-02-25 12:58:16erlendaaslandsetrecipients: + erlendaasland, christian.heimes, berker.peksag, serhiy.storchaka, corona10
2021-02-25 12:58:16erlendaaslandsetmessageid: <1614257896.15.0.0599936036308.issue43290@roundup.psfhosted.org>
2021-02-25 12:58:16erlendaaslandlinkissue43290 messages
2021-02-25 12:58:14erlendaaslandcreate