diff options
author | drh <drh@noemail.net> | 2009-11-26 14:01:53 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-11-26 14:01:53 +0000 |
commit | 5f18a221a186919e804c8416c314903e413d2cfe (patch) | |
tree | 507bd5a8e076ffc1af74f6b462c06821155914fb /src/vdbeapi.c | |
parent | f7829ad0e94b02b26703795369632902c9e955ce (diff) | |
download | sqlite-5f18a221a186919e804c8416c314903e413d2cfe.tar.gz sqlite-5f18a221a186919e804c8416c314903e413d2cfe.zip |
Simplifications to the sqlite3_trace() bound parameter substitution logic.
FossilOrigin-Name: cb4b928648504ce29d751834e9ee3b5278dfca65
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r-- | src/vdbeapi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 8bf3024e7..a8667080b 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -1120,8 +1120,7 @@ const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ ** with that name. If there is no variable with the given name, ** return 0. */ -int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ - Vdbe *p = (Vdbe*)pStmt; +int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){ int i; if( p==0 ){ return 0; @@ -1130,13 +1129,16 @@ int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ if( zName ){ for(i=0; i<p->nVar; i++){ const char *z = p->azVar[i]; - if( z && strcmp(z,zName)==0 ){ + if( z && memcmp(z,zName,nName)==0 && z[nName]==0 ){ return i+1; } } } return 0; } +int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ + return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName)); +} /* ** Transfer all bindings from the first statement over to the second. |