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

Avoid using the sqlite3ErrStr function in the Tcl package if USE_SYSTEM_SQLITE is defined.

FossilOrigin-Name: a716b9a3091072774d067c0a1258b0f4c39a4180
This commit is contained in:
mistachkin
2012-09-10 09:33:09 +00:00
parent 8765b4660e
commit 9dc2a73662
3 changed files with 13 additions and 7 deletions

View File

@@ -45,7 +45,9 @@
** This function is used to translate a return code into an error
** message.
*/
#ifndef USE_SYSTEM_SQLITE
const char *sqlite3ErrStr(int rc);
#endif
/*
* Windows needs to know which symbols to export. Unix does not.
@@ -3042,15 +3044,19 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
zFile = Tcl_TranslateFileName(interp, zFile, &translatedFilename);
rc = sqlite3_open_v2(zFile, &p->db, flags, zVfs);
Tcl_DStringFree(&translatedFilename);
#ifndef USE_SYSTEM_SQLITE
if( p->db ){
#endif
if( SQLITE_OK!=sqlite3_errcode(p->db) ){
zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(p->db));
sqlite3_close(p->db);
p->db = 0;
}
#ifndef USE_SYSTEM_SQLITE
}else{
zErrMsg = sqlite3_mprintf("%s", sqlite3ErrStr(rc));
}
#endif
#ifdef SQLITE_HAS_CODEC
if( p->db ){
sqlite3_key(p->db, pKey, nKey);