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

Merge recent trunk enhancements into the jsonb branch.

FossilOrigin-Name: f47a8d0a207a8442a7f621b070ce9dd1d6013ce26bcf68165d20bb379bd478a0
This commit is contained in:
drh
2023-10-19 20:46:22 +00:00
102 changed files with 3769 additions and 2329 deletions

View File

@@ -762,11 +762,11 @@ static SQLITE_NOINLINE int vdbeColumnFromOverflow(
sqlite3RCStrRef(pBuf);
if( t&1 ){
rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, encoding,
(void(*)(void*))sqlite3RCStrUnref);
sqlite3RCStrUnref);
pDest->flags |= MEM_Term;
}else{
rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, 0,
(void(*)(void*))sqlite3RCStrUnref);
sqlite3RCStrUnref);
}
}else{
rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, iOffset, len, pDest);
@@ -6906,13 +6906,33 @@ case OP_CreateBtree: { /* out2 */
/* Opcode: SqlExec * * * P4 *
**
** Run the SQL statement or statements specified in the P4 string.
** Disable Auth and Trace callbacks while those statements are running if
** P1 is true.
*/
case OP_SqlExec: {
char *zErr;
sqlite3_xauth xAuth;
u8 mTrace;
sqlite3VdbeIncrWriteCounter(p, 0);
db->nSqlExec++;
rc = sqlite3_exec(db, pOp->p4.z, 0, 0, 0);
zErr = 0;
xAuth = db->xAuth;
mTrace = db->mTrace;
if( pOp->p1 ){
db->xAuth = 0;
db->mTrace = 0;
}
rc = sqlite3_exec(db, pOp->p4.z, 0, 0, &zErr);
db->nSqlExec--;
if( rc ) goto abort_due_to_error;
db->xAuth = xAuth;
db->mTrace = mTrace;
if( zErr || rc ){
sqlite3VdbeError(p, "%s", zErr);
sqlite3_free(zErr);
if( rc==SQLITE_NOMEM ) goto no_mem;
goto abort_due_to_error;
}
break;
}