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

Prevent subtype values from slipping across a subquery boundry when the

subquery is implemented as a co-routine.

FossilOrigin-Name: 9e51a6c0fbfb1899b2b01888430125fba6d4da9bad9eeaa3ad41e29fca54bbe5
This commit is contained in:
drh
2022-06-09 17:17:14 +00:00
parent 8878f8a8d3
commit e5dea28482
5 changed files with 25 additions and 14 deletions

View File

@@ -1479,11 +1479,16 @@ case OP_Move: {
break;
}
/* Opcode: Copy P1 P2 P3 * *
/* Opcode: Copy P1 P2 P3 * P5
** Synopsis: r[P2@P3+1]=r[P1@P3+1]
**
** Make a copy of registers P1..P1+P3 into registers P2..P2+P3.
**
** If the 0x0002 bit of P5 is set then also clear the MEM_Subtype flag in the
** destination. The 0x0001 bit of P5 indicates that this Copy opcode cannot
** be merged. The 0x0001 bit is used by the query planner and does not
** come into play during query execution.
**
** This instruction makes a deep copy of the value. A duplicate
** is made of any string or blob constant. See also OP_SCopy.
*/
@@ -1498,6 +1503,9 @@ case OP_Copy: {
memAboutToChange(p, pOut);
sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem);
Deephemeralize(pOut);
if( (pOut->flags & MEM_Subtype)!=0 && (pOp->p5 & 0x0002)!=0 ){
pOut->flags &= ~MEM_Subtype;
}
#ifdef SQLITE_DEBUG
pOut->pScopyFrom = 0;
#endif