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:
16
src/vdbe.c
16
src/vdbe.c
@@ -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 */
|
||||
|
Reference in New Issue
Block a user