1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Make sure sqlite3_data_count() behaves as documented, even for

EXPLAIN QUERY PLAN queries.

FossilOrigin-Name: d4f95b3b6e9f4a4072606af5daa17ea7c645382e
This commit is contained in:
drh
2011-10-07 18:24:25 +00:00
parent be7beab5f4
commit 9734e6e1f4
3 changed files with 10 additions and 9 deletions

View File

@@ -1142,7 +1142,7 @@ int sqlite3VdbeList(
sqlite3 *db = p->db; /* The database connection */
int i; /* Loop counter */
int rc = SQLITE_OK; /* Return code */
Mem *pMem = p->pResultSet = &p->aMem[1]; /* First Mem of result set */
Mem *pMem = &p->aMem[1]; /* First Mem of result set */
assert( p->explain );
assert( p->magic==VDBE_MAGIC_RUN );
@@ -1153,7 +1153,7 @@ int sqlite3VdbeList(
** sqlite3_column_text16(), causing a translation to UTF-16 encoding.
*/
releaseMemArray(pMem, 8);
p->nResColumn = 0;
p->pResultSet = 0;
if( p->rc==SQLITE_NOMEM ){
/* This happens if a malloc() inside a call to sqlite3_column_text() or
@@ -1308,6 +1308,7 @@ int sqlite3VdbeList(
}
p->nResColumn = 8 - 4*(p->explain-1);
p->pResultSet = &p->aMem[1];
p->rc = SQLITE_OK;
rc = SQLITE_ROW;
}