mirror of https://github.com/sqlite/sqlite
Avoid a segfault in sqlite3_bind_parameter_index when there are
unnamed parameters. Ticket #918. (CVS 1977) FossilOrigin-Name: 49f25ddf8382d588e00bf927e2acae93e332e4d4
This commit is contained in:
parent
670404626d
commit
971a7c87bc
14
manifest
14
manifest
|
@ -1,5 +1,5 @@
|
||||||
C Simplification\sof\sthe\strigger\scode.\s(CVS\s1976)
|
C Avoid\sa\ssegfault\sin\ssqlite3_bind_parameter_index\swhen\sthere\sare\nunnamed\sparameters.\s\sTicket\s#918.\s(CVS\s1977)
|
||||||
D 2004-09-24T12:24:36
|
D 2004-09-24T12:48:13
|
||||||
F Makefile.in abdeb5bd9d017822691884935c320037c33f6ee6
|
F Makefile.in abdeb5bd9d017822691884935c320037c33f6ee6
|
||||||
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
|
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
|
||||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||||
|
@ -77,7 +77,7 @@ F src/vacuum.c 257de36230cb988842f66eb08dc6c0250b8e05f3
|
||||||
F src/vdbe.c 0542852785220807feb02b9dee1150ac2e592c8d
|
F src/vdbe.c 0542852785220807feb02b9dee1150ac2e592c8d
|
||||||
F src/vdbe.h 067ca8d6750ba4f69a50284765e5883dee860181
|
F src/vdbe.h 067ca8d6750ba4f69a50284765e5883dee860181
|
||||||
F src/vdbeInt.h 6017100adff362b8dfa37a69e3f1431f084bfa5b
|
F src/vdbeInt.h 6017100adff362b8dfa37a69e3f1431f084bfa5b
|
||||||
F src/vdbeapi.c c7208bb89fc4efc605e20328099a540175e2dae6
|
F src/vdbeapi.c f1e060aae5adace5f3a6ae2b0527cfe73e880f1c
|
||||||
F src/vdbeaux.c 3b67c86338d6a39a173704ffd9e09ae9ceda6601
|
F src/vdbeaux.c 3b67c86338d6a39a173704ffd9e09ae9ceda6601
|
||||||
F src/vdbemem.c ef9ac7d32acfe4bce5c5b408b1294c8d9e0cdb56
|
F src/vdbemem.c ef9ac7d32acfe4bce5c5b408b1294c8d9e0cdb56
|
||||||
F src/where.c 5d573333c07f259c8d3b8423d82ba774b78b63a9
|
F src/where.c 5d573333c07f259c8d3b8423d82ba774b78b63a9
|
||||||
|
@ -88,7 +88,7 @@ F test/attach3.test 6d060986ff004ebb89e1876a331d96c6bb62269e
|
||||||
F test/auth.test 300024c28fd0aac163a135b94504dffe82f06952
|
F test/auth.test 300024c28fd0aac163a135b94504dffe82f06952
|
||||||
F test/bigfile.test 62722ac4b420dfbcdceb137b8634e2cf2865fe27
|
F test/bigfile.test 62722ac4b420dfbcdceb137b8634e2cf2865fe27
|
||||||
F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747
|
F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747
|
||||||
F test/bind.test d7e7f44817a6dbe0faedbb699ad2b559e5a3a7bb
|
F test/bind.test a8682ba41433b93bb36a4213a43f282ca9aec5a9
|
||||||
F test/blob.test 8727a7b46b2073a369cfc9bcb6f54dd366b9d884
|
F test/blob.test 8727a7b46b2073a369cfc9bcb6f54dd366b9d884
|
||||||
F test/btree.test 97b563e1ab999bf8764b129e8c4b4be0a116a52a
|
F test/btree.test 97b563e1ab999bf8764b129e8c4b4be0a116a52a
|
||||||
F test/btree2.test aa4a6d05b1ea90b1acaf83ba89039dd302a88635
|
F test/btree2.test aa4a6d05b1ea90b1acaf83ba89039dd302a88635
|
||||||
|
@ -247,7 +247,7 @@ F www/tclsqlite.tcl 560ecd6a916b320e59f2917317398f3d59b7cc25
|
||||||
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
|
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
|
||||||
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
|
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
|
||||||
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
|
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
|
||||||
P 9001e2220d2e35b81a9b7dc70c012f94bb6db679
|
P 9fa904d94ec1787bc8b97ec06a5423248fcb67fb
|
||||||
R fcc40213cf4f43ad3198270005b0847c
|
R 3df8be3373e722de1a905bb4ac454886
|
||||||
U drh
|
U drh
|
||||||
Z e0420e53be5e67880217af54cf3a9844
|
Z b33e881c15a4c20293ac74264af60f9b
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
9fa904d94ec1787bc8b97ec06a5423248fcb67fb
|
49f25ddf8382d588e00bf927e2acae93e332e4d4
|
|
@ -595,7 +595,8 @@ int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
|
||||||
}
|
}
|
||||||
createVarMap(p);
|
createVarMap(p);
|
||||||
for(i=0; i<p->nVar; i++){
|
for(i=0; i<p->nVar; i++){
|
||||||
if( strcmp(p->azVar[i],zName)==0 ){
|
const char *z = p->azVar[i];
|
||||||
|
if( z && strcmp(z,zName)==0 ){
|
||||||
return i+1;
|
return i+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# This file implements regression tests for SQLite library. The
|
# This file implements regression tests for SQLite library. The
|
||||||
# focus of this script testing the sqlite_bind API.
|
# focus of this script testing the sqlite_bind API.
|
||||||
#
|
#
|
||||||
# $Id: bind.test,v 1.19 2004/09/07 16:19:54 drh Exp $
|
# $Id: bind.test,v 1.20 2004/09/24 12:48:13 drh Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
set testdir [file dirname $argv0]
|
set testdir [file dirname $argv0]
|
||||||
|
@ -386,4 +386,44 @@ do_test bind-10.10 {
|
||||||
execsql {SELECT * FROM t2}
|
execsql {SELECT * FROM t2}
|
||||||
} {1 999 1000 1001 {} {} 1 2 1 3 2 1}
|
} {1 999 1000 1001 {} {} 1 2 1 3 2 1}
|
||||||
|
|
||||||
|
# Ticket #918
|
||||||
|
#
|
||||||
|
do_test bind-10.11 {
|
||||||
|
catch {sqlite3_finalize $VM}
|
||||||
|
set VM [
|
||||||
|
sqlite3_prepare $DB {
|
||||||
|
INSERT INTO t2(a,b,c,d,e,f) VALUES(:abc,?,?4,:pqr,:abc,?4)
|
||||||
|
} -1 TAIL
|
||||||
|
]
|
||||||
|
sqlite3_bind_parameter_count $VM
|
||||||
|
} 5
|
||||||
|
do_test bind-10.12 {
|
||||||
|
sqlite3_bind_parameter_index $VM :xyz
|
||||||
|
} 0
|
||||||
|
do_test bind-10.13 {
|
||||||
|
sqlite3_bind_parameter_index $VM {}
|
||||||
|
} 0
|
||||||
|
do_test bind-10.14 {
|
||||||
|
sqlite3_bind_parameter_index $VM :pqr
|
||||||
|
} 5
|
||||||
|
do_test bind-10.15 {
|
||||||
|
sqlite3_bind_parameter_index $VM ?4
|
||||||
|
} 4
|
||||||
|
do_test bind-10.16 {
|
||||||
|
sqlite3_bind_parameter_name $VM 1
|
||||||
|
} :abc
|
||||||
|
do_test bind-10.16 {
|
||||||
|
sqlite3_bind_parameter_name $VM 2
|
||||||
|
} {}
|
||||||
|
do_test bind-10.16 {
|
||||||
|
sqlite3_bind_parameter_name $VM 3
|
||||||
|
} {}
|
||||||
|
do_test bind-10.16 {
|
||||||
|
sqlite3_bind_parameter_name $VM 4
|
||||||
|
} {?4}
|
||||||
|
do_test bind-10.16 {
|
||||||
|
sqlite3_bind_parameter_name $VM 5
|
||||||
|
} :pqr
|
||||||
|
catch {sqlite3_finalize $VM}
|
||||||
|
|
||||||
finish_test
|
finish_test
|
||||||
|
|
Loading…
Reference in New Issue