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

Fix a problem with creating virtual table with names specified using malformed utf-8 within utf-16 databases.

FossilOrigin-Name: 9969cff2d0553c9bfa88a437e1bb0cc4200d49d7
This commit is contained in:
dan
2015-03-19 18:56:17 +00:00
parent b7134d0863
commit 7377945a7b
5 changed files with 45 additions and 16 deletions

View File

@@ -6009,13 +6009,21 @@ case OP_VBegin: {
#endif /* SQLITE_OMIT_VIRTUALTABLE */
#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Opcode: VCreate P1 * * P4 *
/* Opcode: VCreate P1 P2 * * *
**
** P4 is the name of a virtual table in database P1. Call the xCreate method
** for that table.
** P2 is a register that holds the name of a virtual table in database
** P1. Call the xCreate method for that table.
*/
case OP_VCreate: {
rc = sqlite3VtabCallCreate(db, pOp->p1, pOp->p4.z, &p->zErrMsg);
Mem sMem; /* For storing the record being decoded */
memset(&sMem, 0, sizeof(sMem));
sMem.db = db;
rc = sqlite3VdbeMemCopy(&sMem, &aMem[pOp->p2]);
if( rc==SQLITE_OK ){
const char *zTab = (const char*)sqlite3_value_text(&sMem);
rc = sqlite3VtabCallCreate(db, pOp->p1, zTab, &p->zErrMsg);
}
sqlite3VdbeMemRelease(&sMem);
break;
}
#endif /* SQLITE_OMIT_VIRTUALTABLE */