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

Fix some errors to do with attached databases and text encodings in shared-cache mode. (CVS 2895)

FossilOrigin-Name: 3e75d3d5efebc0dfff1adfc13d85e85ec39db3eb
This commit is contained in:
danielk1977
2006-01-09 16:12:04 +00:00
parent 52622828ce
commit 14db26653a
19 changed files with 205 additions and 143 deletions

View File

@@ -13,7 +13,7 @@
** This file contains functions used to access the internal hash tables
** of user defined functions and collation sequences.
**
** $Id: callback.c,v 1.8 2006/01/09 06:29:48 danielk1977 Exp $
** $Id: callback.c,v 1.9 2006/01/09 16:12:05 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -29,7 +29,7 @@ static void callCollNeeded(sqlite3 *db, const char *zName, int nName){
if( db->xCollNeeded ){
char *zExternal = sqliteStrNDup(zName, nName);
if( !zExternal ) return;
db->xCollNeeded(db->pCollNeededArg, db, (int)db->enc, zExternal);
db->xCollNeeded(db->pCollNeededArg, db, (int)ENC(db), zExternal);
sqliteFree(zExternal);
}
#ifndef SQLITE_OMIT_UTF16
@@ -39,7 +39,7 @@ static void callCollNeeded(sqlite3 *db, const char *zName, int nName){
sqlite3ValueSetStr(pTmp, nName, zName, SQLITE_UTF8, SQLITE_STATIC);
zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);
if( zExternal ){
db->xCollNeeded16(db->pCollNeededArg, db, (int)db->enc, zExternal);
db->xCollNeeded16(db->pCollNeededArg, db, (int)ENC(db), zExternal);
}
sqlite3ValueFree(pTmp);
}
@@ -92,14 +92,14 @@ CollSeq *sqlite3GetCollSeq(
p = pColl;
if( !p ){
p = sqlite3FindCollSeq(db, db->enc, zName, nName, 0);
p = sqlite3FindCollSeq(db, ENC(db), zName, nName, 0);
}
if( !p || !p->xCmp ){
/* No collation sequence of this type for this encoding is registered.
** Call the collation factory to see if it can supply us with one.
*/
callCollNeeded(db, zName, nName);
p = sqlite3FindCollSeq(db, db->enc, zName, nName, 0);
p = sqlite3FindCollSeq(db, ENC(db), zName, nName, 0);
}
if( p && !p->xCmp && synthCollSeq(db, p) ){
p = 0;