aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2011-10-07 12:59:23 +0000
committerdrh <drh@noemail.net>2011-10-07 12:59:23 +0000
commitf3259997c017d9660587ffd61a5ca3d3a7db973e (patch)
treee5b0b322d74abd3110de7bf8bc261f8311647b19 /src
parenta624fd50389b802e6eb11100277e524eff3c8628 (diff)
downloadsqlite-f3259997c017d9660587ffd61a5ca3d3a7db973e.tar.gz
sqlite-f3259997c017d9660587ffd61a5ca3d3a7db973e.zip
Enhance the sqlite3_data_count() routine so that it can be used to determine
if SQLITE_DONE has been seen on the prepared statement. FossilOrigin-Name: 9913996e7b0f94ba1c51200b61433193002f3638
Diffstat (limited to 'src')
-rw-r--r--src/sqlite.h.in6
-rw-r--r--src/vdbeaux.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 4c243796a..d13f17639 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -3348,6 +3348,12 @@ int sqlite3_step(sqlite3_stmt*);
** (via calls to the [sqlite3_column_int | sqlite3_column_*()] of
** interfaces) then sqlite3_data_count(P) returns 0.
** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer.
+** ^The sqlite3_data_count(P) routine returns 0 if the previous call to
+** [sqlite3_step](P) returned [SQLITE_DONE]. ^The sqlite3_data_count(P)
+** will return non-zero if previous call to [sqlite3_step](P) returned
+** [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum]
+** where it always returns zero since each step of that multi-step
+** pragma returns 0 columns of data.
**
** See also: [sqlite3_column_count()]
*/
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 8a9ef81ea..90d1e9c8a 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -1153,6 +1153,7 @@ int sqlite3VdbeList(
** sqlite3_column_text16(), causing a translation to UTF-16 encoding.
*/
releaseMemArray(pMem, 8);
+ p->nResColumn = 0;
if( p->rc==SQLITE_NOMEM ){
/* This happens if a malloc() inside a call to sqlite3_column_text() or