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

Fix the virtual table rename logic so that it works even if the database

encoding is something other than UTF8.
Ticket [8290242b2a9a81683]

FossilOrigin-Name: d65f63531c3f8e3e55e656f049240714a3d7433f
This commit is contained in:
drh
2011-10-18 22:07:47 +00:00
parent a2153f75c3
commit 98655a696e
4 changed files with 70 additions and 12 deletions

View File

@@ -5888,10 +5888,15 @@ case OP_VRename: {
assert( memIsValid(pName) );
REGISTER_TRACE(pOp->p1, pName);
assert( pName->flags & MEM_Str );
rc = pVtab->pModule->xRename(pVtab, pName->z);
importVtabErrMsg(p, pVtab);
p->expired = 0;
testcase( pName->enc==SQLITE_UTF8 );
testcase( pName->enc==SQLITE_UTF16BE );
testcase( pName->enc==SQLITE_UTF16LE );
rc = sqlite3VdbeChangeEncoding(pName, SQLITE_UTF8);
if( rc==SQLITE_OK ){
rc = pVtab->pModule->xRename(pVtab, pName->z);
importVtabErrMsg(p, pVtab);
p->expired = 0;
}
break;
}
#endif