1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Check that the encoding of values passed to sqlite3_bind_value() matches that of the database. (CVS 5138)

FossilOrigin-Name: e94a2883060b9ef59809ff4de9525d897d95546c
This commit is contained in:
danielk1977
2008-05-16 15:24:58 +00:00
parent 822a51628f
commit 1e740c6f88
3 changed files with 11 additions and 8 deletions

View File

@@ -13,7 +13,7 @@
** This file contains code use to implement APIs that are part of the
** VDBE.
**
** $Id: vdbeapi.c,v 1.131 2008/05/16 04:51:55 danielk1977 Exp $
** $Id: vdbeapi.c,v 1.132 2008/05/16 15:24:58 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
@@ -1131,6 +1131,9 @@ int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
rc = vdbeUnbind(p, i);
if( rc==SQLITE_OK ){
rc = sqlite3VdbeMemCopy(&p->aVar[i-1], pValue);
if( rc==SQLITE_OK ){
rc = sqlite3VdbeChangeEncoding(&p->aVar[i-1], ENC(p->db));
}
}
rc = sqlite3ApiExit(p->db, rc);
sqlite3_mutex_leave(p->db->mutex);