Overview
| SHA1 Hash: | aef7945c423a8338374572eeda9444866c64569b |
|---|---|
| Date: | 2011-10-10 18:59:05 |
| User: | drh |
| Edited Comment: | Cherrypick the sqlite_data_count() changes from d4f95b3b6e and 9913996e7b into the apple-osx branch for version 3.7.7. |
| Original Comment: | Cherrypick the sqlite_data_count() changes from d4f95b3b6e and 9913996e7b into the apple-osx branch for version 3.7.7. |
Tags And Properties
- bgcolor cancelled by [fe0f9bb6e4] on 2011-10-10 18:59:58
- branch=apple-osx-377 propagates to descendants
- comment=Cherrypick the sqlite_data_count() changes from [d4f95b3b6e] and [9913996e7b] into the apple-osx branch for version 3.7.7. added by [fe0f9bb6e4] on 2011-10-10 18:59:58
- sym-apple-osx cancelled
- sym-apple-osx-377 propagates to descendants
Changes
Changes to src/sqlite.h.in
3319 ** 3319 ** 3320 ** ^The sqlite3_data_count(P) interface returns the number of columns in the 3320 ** ^The sqlite3_data_count(P) interface returns the number of columns in the 3321 ** current row of the result set of [prepared statement] P. 3321 ** current row of the result set of [prepared statement] P. 3322 ** ^If prepared statement P does not have results ready to return 3322 ** ^If prepared statement P does not have results ready to return 3323 ** (via calls to the [sqlite3_column_int | sqlite3_column_*()] of 3323 ** (via calls to the [sqlite3_column_int | sqlite3_column_*()] of 3324 ** interfaces) then sqlite3_data_count(P) returns 0. 3324 ** interfaces) then sqlite3_data_count(P) returns 0. 3325 ** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer. 3325 ** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer. > 3326 ** ^The sqlite3_data_count(P) routine returns 0 if the previous call to > 3327 ** [sqlite3_step](P) returned [SQLITE_DONE]. ^The sqlite3_data_count(P) > 3328 ** will return non-zero if previous call to [sqlite3_step](P) returned > 3329 ** [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum] > 3330 ** where it always returns zero since each step of that multi-step > 3331 ** pragma returns 0 columns of data. 3326 ** 3332 ** 3327 ** See also: [sqlite3_column_count()] 3333 ** See also: [sqlite3_column_count()] 3328 */ 3334 */ 3329 int sqlite3_data_count(sqlite3_stmt *pStmt); 3335 int sqlite3_data_count(sqlite3_stmt *pStmt); 3330 3336 3331 /* 3337 /* 3332 ** CAPI3REF: Fundamental Datatypes 3338 ** CAPI3REF: Fundamental Datatypes
Changes to src/vdbeaux.c
1134 int nRow; /* Stop when row count reaches this */ 1134 int nRow; /* Stop when row count reaches this */ 1135 int nSub = 0; /* Number of sub-vdbes seen so far */ 1135 int nSub = 0; /* Number of sub-vdbes seen so far */ 1136 SubProgram **apSub = 0; /* Array of sub-vdbes */ 1136 SubProgram **apSub = 0; /* Array of sub-vdbes */ 1137 Mem *pSub = 0; /* Memory cell hold array of subprogs */ 1137 Mem *pSub = 0; /* Memory cell hold array of subprogs */ 1138 sqlite3 *db = p->db; /* The database connection */ 1138 sqlite3 *db = p->db; /* The database connection */ 1139 int i; /* Loop counter */ 1139 int i; /* Loop counter */ 1140 int rc = SQLITE_OK; /* Return code */ 1140 int rc = SQLITE_OK; /* Return code */ 1141 Mem *pMem = p->pResultSet = &p->aMem[1]; /* First Mem of result set */ | 1141 Mem *pMem = &p->aMem[1]; /* First Mem of result set */ 1142 1142 1143 assert( p->explain ); 1143 assert( p->explain ); 1144 assert( p->magic==VDBE_MAGIC_RUN ); 1144 assert( p->magic==VDBE_MAGIC_RUN ); 1145 assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM ); 1145 assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM ); 1146 1146 1147 /* Even though this opcode does not use dynamic strings for 1147 /* Even though this opcode does not use dynamic strings for 1148 ** the result, result columns may become dynamic if the user calls 1148 ** the result, result columns may become dynamic if the user calls 1149 ** sqlite3_column_text16(), causing a translation to UTF-16 encoding. 1149 ** sqlite3_column_text16(), causing a translation to UTF-16 encoding. 1150 */ 1150 */ 1151 releaseMemArray(pMem, 8); 1151 releaseMemArray(pMem, 8); > 1152 p->pResultSet = 0; 1152 1153 1153 if( p->rc==SQLITE_NOMEM ){ 1154 if( p->rc==SQLITE_NOMEM ){ 1154 /* This happens if a malloc() inside a call to sqlite3_column_text() or 1155 /* This happens if a malloc() inside a call to sqlite3_column_text() or 1155 ** sqlite3_column_text16() failed. */ 1156 ** sqlite3_column_text16() failed. */ 1156 db->mallocFailed = 1; 1157 db->mallocFailed = 1; 1157 return SQLITE_ERROR; 1158 return SQLITE_ERROR; 1158 } 1159 } ................................................................................................................................................................................ 1299 { 1300 { 1300 pMem->flags = MEM_Null; /* Comment */ 1301 pMem->flags = MEM_Null; /* Comment */ 1301 pMem->type = SQLITE_NULL; 1302 pMem->type = SQLITE_NULL; 1302 } 1303 } 1303 } 1304 } 1304 1305 1305 p->nResColumn = 8 - 4*(p->explain-1); 1306 p->nResColumn = 8 - 4*(p->explain-1); > 1307 p->pResultSet = &p->aMem[1]; 1306 p->rc = SQLITE_OK; 1308 p->rc = SQLITE_OK; 1307 rc = SQLITE_ROW; 1309 rc = SQLITE_ROW; 1308 } 1310 } 1309 return rc; 1311 return rc; 1310 } 1312 } 1311 #endif /* SQLITE_OMIT_EXPLAIN */ 1313 #endif /* SQLITE_OMIT_EXPLAIN */ 1312 1314