-C Changes\sto\sthe\strigger.c\smodule\sthat\sfacilitate\sfull\scoverage\stesting.\s(CVS\s6621)
-D 2009-05-09T00:18:38
+C Change\ssqlite_blob_open()\sso\sthat\sit\szeros\sthe\soutput\spBlob\spointer\swhen\nit\sfails.\s\sThe\sother\ssqlite3_blob\sinterfaces\saccept\sa\sNULL\spointer\sas\ninput.\s(CVS\s6622)
+D 2009-05-09T15:17:47
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/vdbeInt.h 43183a2a18654fa570219ab65e53a608057c48ae
F src/vdbeapi.c 86aa27a5f3493aaffb8ac051782aa3b22670d7ed
F src/vdbeaux.c 1a07329bdf51cc3687f88d9f5b2bd3f1d47cc5a8
-F src/vdbeblob.c e67757450ae8581a8b354d9d7e467e41502dfe38
+F src/vdbeblob.c 5c5abe9af28316772e7829359f6f9cda2c737ebd
F src/vdbemem.c d8b985eeb88214941380372466a30ca410043a93
F src/vtab.c 53355aa2381ec3ef2eaad25672cfd5877a02fe45
F src/walker.c 7cdf63223c953d4343c6833e940f110281a378ee
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 254ca3273cfbd833de82296b4859e1ec5535e8be
-R 29c312f4710fcc89e520e552563a8498
+P 567ccc68cc8c73b952a91c71a0e00b08bb25c689
+R 886144e41731ebf2955c0b2ed8aed044
U drh
-Z 4d4c05b89d8d2f3c2da064b74794e76b
+Z fabb4ba3bc1d6719d08d21dcbbdf7cee
**
** This file contains code used to implement incremental BLOB I/O.
**
-** $Id: vdbeblob.c,v 1.31 2009/03/24 15:08:10 drh Exp $
+** $Id: vdbeblob.c,v 1.32 2009/05/09 15:17:47 drh Exp $
*/
#include "sqliteInt.h"
int rc = SQLITE_OK;
char zErr[128];
+ *ppBlob = 0;
zErr[0] = 0;
sqlite3_mutex_enter(db->mutex);
do {
/* Remove either the OP_OpenWrite or OpenRead. Set the P2
** parameter of the other to pTab->tnum.
*/
- sqlite3VdbeChangeToNoop(v, (flags ? 2 : 3), 1);
- sqlite3VdbeChangeP2(v, (flags ? 3 : 2), pTab->tnum);
- sqlite3VdbeChangeP3(v, (flags ? 3 : 2), iDb);
+ flags = !!flags;
+ sqlite3VdbeChangeToNoop(v, 3 - flags, 1);
+ sqlite3VdbeChangeP2(v, 2 + flags, pTab->tnum);
+ sqlite3VdbeChangeP3(v, 2 + flags, iDb);
/* Configure the number of columns. Configure the cursor to
** think that the table has one more column than it really
** we can invoke OP_Column to fill in the vdbe cursors type
** and offset cache without causing any IO.
*/
- sqlite3VdbeChangeP4(v, flags ? 3 : 2, SQLITE_INT_TO_PTR(pTab->nCol+1), P4_INT32);
+ sqlite3VdbeChangeP4(v, 2+flags, SQLITE_INT_TO_PTR(pTab->nCol+1),P4_INT32);
sqlite3VdbeChangeP2(v, 6, pTab->nCol);
if( !db->mallocFailed ){
sqlite3VdbeMakeReady(v, 1, 1, 1, 0);
sqlite3BtreeLeaveAll(db);
rc = sqlite3SafetyOff(db);
- if( rc!=SQLITE_OK || db->mallocFailed ){
+ if( NEVER(rc!=SQLITE_OK) || db->mallocFailed ){
goto blob_open_out;
}
int rc;
sqlite3 *db;
- db = p->db;
- sqlite3_mutex_enter(db->mutex);
- rc = sqlite3_finalize(p->pStmt);
- sqlite3DbFree(db, p);
- sqlite3_mutex_leave(db->mutex);
+ if( p ){
+ db = p->db;
+ sqlite3_mutex_enter(db->mutex);
+ rc = sqlite3_finalize(p->pStmt);
+ sqlite3DbFree(db, p);
+ sqlite3_mutex_leave(db->mutex);
+ }else{
+ rc = SQLITE_OK;
+ }
return rc;
}
int rc;
Incrblob *p = (Incrblob *)pBlob;
Vdbe *v;
- sqlite3 *db = p->db;
+ sqlite3 *db;
+ if( p==0 ) return SQLITE_MISUSE;
+ db = p->db;
sqlite3_mutex_enter(db->mutex);
v = (Vdbe*)p->pStmt;
*/
int sqlite3_blob_bytes(sqlite3_blob *pBlob){
Incrblob *p = (Incrblob *)pBlob;
- return p->nByte;
+ return p ? p->nByte : 0;
}
#endif /* #ifndef SQLITE_OMIT_INCRBLOB */