aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-12-23 03:59:31 +0000
committerdrh <drh@noemail.net>2016-12-23 03:59:31 +0000
commit9bf755cc4467dd1e2d2fb8257f14ef974ec8bc41 (patch)
treefe4338736e7319a9d947ecbf8a7a3231a4eceef9 /src/vdbeapi.c
parent344a1bf133771614774acd3233fc098eae26e5f7 (diff)
downloadsqlite-9bf755cc4467dd1e2d2fb8257f14ef974ec8bc41.tar.gz
sqlite-9bf755cc4467dd1e2d2fb8257f14ef974ec8bc41.zip
Use the VList object to replace Parse.azVar for tracking the mapping between
SQL parameter names and parameter numbers. There is a performance improvement, though there are still a few hiccups in the current code. FossilOrigin-Name: 68ecafa1425a41358c88f41efea3262f1b4490f2
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 213ba830d..32794de9a 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -1470,10 +1470,8 @@ int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
*/
const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
Vdbe *p = (Vdbe*)pStmt;
- if( p==0 || i<1 || i>p->nzVar ){
- return 0;
- }
- return p->azVar[i-1];
+ if( p==0 ) return 0;
+ return sqlite3VListNumToName(p->pVList, i);
}
/*
@@ -1482,19 +1480,8 @@ const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
** return 0.
*/
int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){
- int i;
- if( p==0 ){
- return 0;
- }
- if( zName ){
- for(i=0; i<p->nzVar; i++){
- const char *z = p->azVar[i];
- if( z && strncmp(z,zName,nName)==0 && z[nName]==0 ){
- return i+1;
- }
- }
- }
- return 0;
+ if( p==0 || zName==0 ) return 0;
+ return sqlite3VListNameToNum(p->pVList, zName, nName);
}
int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));