/ Check-in [425e3edb]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Move the expired-statement test for OP_Function until after all memory has been freed. The test is still commented out, however.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 425e3edb146c497817855dd741878709a25c8b98
User & Date: drh 2011-04-04 12:29:20
Context
2011-04-04
14:03
Have test_syscall.c include "sqliteInt.h". Otherwise the SQLITE_OS_UNIX symbol may not be defined correctly. check-in: fda8fadd user: dan tags: trunk
13:19
Merge the latest changes of trunk into the session branch. check-in: 95d53c44 user: drh tags: sessions
13:11
Merge in the latest changes from trunk. check-in: 6d78a25d user: drh tags: apple-osx
13:07
Merge in the latest changes from trunk. check-in: 47b79c40 user: drh tags: schema-parse-refactor
12:29
Move the expired-statement test for OP_Function until after all memory has been freed. The test is still commented out, however. check-in: 425e3edb user: drh tags: trunk
07:05
Changes to oserror.test and syscall.test so that they work with the in-memory journal permutation test. check-in: 4e996f36 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
....
1433
1434
1435
1436
1437
1438
1439









1440
1441
1442
1443
1444
1445
1446
    ** to return a value. The following call releases any resources
    ** associated with such a value.
    */
    sqlite3VdbeMemRelease(&ctx.s);
    goto no_mem;
  }

  /* The app-defined function has done something that as caused this
  ** statement to expire.  (Perhaps the function called sqlite3_exec()
  ** with a CREATE TABLE statement.)
  */
#if 0
  if( p->expired ){
    rc = SQLITE_ABORT;
    break;
  }
#endif

  /* If any auxiliary data functions have been called by this user function,
  ** immediately call the destructor for any non-static values.
  */
  if( ctx.pVdbeFunc ){
    sqlite3VdbeDeleteAuxData(ctx.pVdbeFunc, pOp->p1);
    pOp->p4.pVdbeFunc = ctx.pVdbeFunc;
    pOp->p4type = P4_VDBEFUNC;
................................................................................

  /* Copy the result of the function into register P3 */
  sqlite3VdbeChangeEncoding(&ctx.s, encoding);
  sqlite3VdbeMemMove(pOut, &ctx.s);
  if( sqlite3VdbeMemTooBig(pOut) ){
    goto too_big;
  }









  REGISTER_TRACE(pOp->p3, pOut);
  UPDATE_MAX_BLOBSIZE(pOut);
  break;
}

/* Opcode: BitAnd P1 P2 P3 * *
**







<
<
<
<
<
<
<
<
<
<
<







 







>
>
>
>
>
>
>
>
>







1401
1402
1403
1404
1405
1406
1407











1408
1409
1410
1411
1412
1413
1414
....
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
    ** to return a value. The following call releases any resources
    ** associated with such a value.
    */
    sqlite3VdbeMemRelease(&ctx.s);
    goto no_mem;
  }












  /* If any auxiliary data functions have been called by this user function,
  ** immediately call the destructor for any non-static values.
  */
  if( ctx.pVdbeFunc ){
    sqlite3VdbeDeleteAuxData(ctx.pVdbeFunc, pOp->p1);
    pOp->p4.pVdbeFunc = ctx.pVdbeFunc;
    pOp->p4type = P4_VDBEFUNC;
................................................................................

  /* Copy the result of the function into register P3 */
  sqlite3VdbeChangeEncoding(&ctx.s, encoding);
  sqlite3VdbeMemMove(pOut, &ctx.s);
  if( sqlite3VdbeMemTooBig(pOut) ){
    goto too_big;
  }

#if 0
  /* The app-defined function has done something that as caused this
  ** statement to expire.  (Perhaps the function called sqlite3_exec()
  ** with a CREATE TABLE statement.)
  */
  if( p->expired ) rc = SQLITE_ABORT;
#endif

  REGISTER_TRACE(pOp->p3, pOut);
  UPDATE_MAX_BLOBSIZE(pOut);
  break;
}

/* Opcode: BitAnd P1 P2 P3 * *
**