From: drh Date: Tue, 14 Apr 2009 12:58:20 +0000 (+0000) Subject: Change the sqlite3_bind_value() implementation to use a default branch on X-Git-Tag: version-3.6.15~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac80db78450aaf42ae29d788e4dd6c5645323e84;p=thirdparty%2Fsqlite.git Change the sqlite3_bind_value() implementation to use a default branch on the type switch so that there are no untested jumps in the switch. (CVS 6505) FossilOrigin-Name: d0a8bd6a53c5da0ac6b88818f82c7f7d330b527a --- diff --git a/manifest b/manifest index e8a81b196f..45e7803d3b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Reimplement\sthe\ssqlite3_bind_value()\sinterface\sso\sthat\sit\sworks\swhen\sthe\nvalue\sbeing\sbound\scomes\sfrom\sa\sdifferent\sdatabase\sconnection.\s(CVS\s6504) -D 2009-04-14T12:43:34 +C Change\sthe\ssqlite3_bind_value()\simplementation\sto\suse\sa\sdefault\sbranch\son\nthe\stype\sswitch\sso\sthat\sthere\sare\sno\suntested\sjumps\sin\sthe\sswitch.\s(CVS\s6505) +D 2009-04-14T12:58:20 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -203,7 +203,7 @@ F src/vacuum.c 07121a727beeee88f27d704a00313ad6a7c9bef0 F src/vdbe.c 88bc70921ccdcff8bfdf574f3e2285d17ab97103 F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a F src/vdbeInt.h df5c5a1c739c98af2c83440dde3fc361240f3a25 -F src/vdbeapi.c 3783c3416206e66749abf5d15c0e8500acef8e0e +F src/vdbeapi.c 015c9d0fb7047657a13a7bb6aa886f75e43db02d F src/vdbeaux.c 5ecb4c7a041b8926a8927b1a27bcbb8ff74ae5c4 F src/vdbeblob.c e67757450ae8581a8b354d9d7e467e41502dfe38 F src/vdbemem.c 9798905787baae83d0b53b62030e32ecf7a0586f @@ -717,7 +717,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P b0b2b2831cc84d57e90bf587ebed600fa72926e9 -R e950f079c16a2cf0cbd9a746b0c47391 +P 3db0c7980668cf38165add13f833863cd00a0cfe +R 34f39946bda012d0092593a65918e629 U drh -Z b6c79b5e1dc82c0024406556d80ccdad +Z 98a6c859bf61c1e15172ad734a5c6432 diff --git a/manifest.uuid b/manifest.uuid index 53202499dd..11d2f66ff6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3db0c7980668cf38165add13f833863cd00a0cfe \ No newline at end of file +d0a8bd6a53c5da0ac6b88818f82c7f7d330b527a \ No newline at end of file diff --git a/src/vdbeapi.c b/src/vdbeapi.c index c23d88f5ef..0c3cd7b221 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -13,7 +13,7 @@ ** This file contains code use to implement APIs that are part of the ** VDBE. ** -** $Id: vdbeapi.c,v 1.162 2009/04/14 12:43:34 drh Exp $ +** $Id: vdbeapi.c,v 1.163 2009/04/14 12:58:20 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -1153,10 +1153,6 @@ int sqlite3_bind_text16( int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ int rc; switch( pValue->type ){ - case SQLITE_NULL: { - rc = sqlite3_bind_null(pStmt, i); - break; - } case SQLITE_INTEGER: { rc = sqlite3_bind_int64(pStmt, i, pValue->u.i); break; @@ -1174,7 +1170,12 @@ int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ break; } case SQLITE_TEXT: { - rc = bindText(pStmt,i, pValue->z, pValue->n, SQLITE_TRANSIENT, pValue->enc); + rc = bindText(pStmt,i, pValue->z, pValue->n, SQLITE_TRANSIENT, + pValue->enc); + break; + } + default: { + rc = sqlite3_bind_null(pStmt, i); break; } }