diff options
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. |