Message387668
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. |
|
Date |
User |
Action |
Args |
2021-02-25 12:58:16 | erlendaasland | set | recipients:
+ erlendaasland, christian.heimes, berker.peksag, serhiy.storchaka, corona10 |
2021-02-25 12:58:16 | erlendaasland | set | messageid: <1614257896.15.0.0599936036308.issue43290@roundup.psfhosted.org> |
2021-02-25 12:58:16 | erlendaasland | link | issue43290 messages |
2021-02-25 12:58:14 | erlendaasland | create | |
|