diff options
author | drh <> | 2023-05-19 16:42:49 +0000 |
---|---|---|
committer | drh <> | 2023-05-19 16:42:49 +0000 |
commit | fe19414331799123d72d066e58164cee19a3ec30 (patch) | |
tree | 4990f3e0c0b5348bf47422e23c8903289b593345 /src | |
parent | 7fe416fae1b5265c53cda46e0c2dbf4a83bc649a (diff) | |
download | sqlite-fe19414331799123d72d066e58164cee19a3ec30.tar.gz sqlite-fe19414331799123d72d066e58164cee19a3ec30.zip |
Improved documentation for sqlite3_reset(), in response to
[forum:/forumpost/a72bab3dea|forum post a72bab3dea].
FossilOrigin-Name: 1dfeb3dceee8f30daf5462683f264b9de23e7068e036e70b11ee1b608ac2f7fa
Diffstat (limited to 'src')
-rw-r--r-- | src/sqlite.h.in | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in index b78adc2a3..5634e6a29 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -5260,14 +5260,26 @@ int sqlite3_finalize(sqlite3_stmt *pStmt); ** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S ** back to the beginning of its program. ** -** ^If the most recent call to [sqlite3_step(S)] for the -** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], -** or if [sqlite3_step(S)] has never before been called on S, -** then [sqlite3_reset(S)] returns [SQLITE_OK]. +** ^The return code from [sqlite3_reset(S)] indicates whether or not +** the previous evaluation of prepared statement S completed successfully. +** ^If [sqlite3_step(S)] has never before been called on S or if +** [sqlite3_step(S)] has not been called since the previous call +** to [sqlite3_reset(S)], then [sqlite3_reset(S)] will return +** [SQLITE_OK]. ** ** ^If the most recent call to [sqlite3_step(S)] for the ** [prepared statement] S indicated an error, then ** [sqlite3_reset(S)] returns an appropriate [error code]. +** ^The [sqlite3_reset(S)] interface might also return an [error code] +** if there were no prior errors but the process of resetting +** the prepared statement caused a new error. ^For example, if an +** [INSERT] statement with a [RETURNING] clause is only stepped one time, +** that one call to [sqlite3_step(S)] might return SQLITE_ROW but +** the overall statement might still fail and the [sqlite3_reset(S)] call +** might return SQLITE_BUSY if locking constraints prevent the +** database change from committing. Therefore, it is important that +** applications check the return code from [sqlite3_reset(S)] even if +** no prior call to [sqlite3_step(S)] indicated a problem. ** ** ^The [sqlite3_reset(S)] interface does not change the values ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |