Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch typo Excluding Merge-Ins
This is equivalent to a diff from 5dcffa671f to cd9096e64b
2013-07-18
| ||
18:29 | Ensure that all auxiliary data registered by calls to sqlite3_set_auxdata() is destroyed when the VM is halted. (check-in: 153deac8fa user: dan tags: trunk) | |
18:28 | Fix a typo in the previous commit. (Closed-Leaf check-in: cd9096e64b user: dan tags: typo) | |
17:12 | Ensure that all auxiliary data registered by calls to sqlite3_set_auxdata() is destroyed when the VM is halted. Partial fix for [406d3b2ef9]. <i>DRH adds:</i> Stray text accidentally inserted into vdbe.c just prior to the commit breaks the build. (check-in: 71effa59c9 user: dan tags: typo) | |
14:50 | Fix a 8-byte alignment problem in the query planner that might cause problems on sparc when compiled with -m32. (check-in: 5dcffa671f user: drh tags: trunk) | |
14:16 | Documentation changes to warn that sqlite3_set_auxdata() might call the destructor even before it returns. Also fix the regexp extension to deal with that case. Ticket [406d3b2ef91c]. (check-in: 7acc8cd32d user: drh tags: trunk) | |
Changes to src/vdbe.c.
︙ | |||
1416 1417 1418 1419 1420 1421 1422 | 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 | - + - - + - - - - - - + + | assert( memIsValid(pArg) ); apVal[i] = pArg; Deephemeralize(pArg); sqlite3VdbeMemStoreType(pArg); REGISTER_TRACE(pOp->p2+i, pArg); } |
︙ | |||
1451 1452 1453 1454 1455 1456 1457 | 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | - - + - - - | db->lastRowid = lastRowid; (*ctx.pFunc->xFunc)(&ctx, n, apVal); /* IMP: R-24505-23230 */ lastRowid = db->lastRowid; /* If any auxiliary data functions have been called by this user function, ** immediately call the destructor for any non-static values. */ |
︙ |
Changes to src/vdbe.h.
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - | */ typedef struct Vdbe Vdbe; /* ** The names of the following types declared in vdbeInt.h are required ** for the VdbeOp definition. */ |
︙ | |||
50 51 52 53 54 55 56 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - | union { /* fourth parameter */ int i; /* Integer value if p4type==P4_INT32 */ void *p; /* Generic pointer */ char *z; /* Pointer to data for string (char array) types */ i64 *pI64; /* Used when p4type is P4_INT64 */ double *pReal; /* Used when p4type is P4_REAL */ FuncDef *pFunc; /* Used when p4type is P4_FUNCDEF */ |
︙ | |||
104 105 106 107 108 109 110 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | - | */ #define P4_NOTUSED 0 /* The P4 parameter is not used */ #define P4_DYNAMIC (-1) /* Pointer to a string obtained from sqliteMalloc() */ #define P4_STATIC (-2) /* Pointer to a static string */ #define P4_COLLSEQ (-4) /* P4 is a pointer to a CollSeq structure */ #define P4_FUNCDEF (-5) /* P4 is a pointer to a FuncDef structure */ #define P4_KEYINFO (-6) /* P4 is a pointer to a KeyInfo structure */ |
︙ |
Changes to src/vdbeInt.h.
︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | + + + | /* Opaque type used by code in vdbesort.c */ typedef struct VdbeSorter VdbeSorter; /* Opaque type used by the explainer */ typedef struct Explain Explain; /* Elements of the linked list at Vdbe.pAuxData */ typedef struct AuxData AuxData; /* ** A cursor is a pointer into a single BTree within a database file. ** The cursor can seek to a BTree entry with a particular key, or ** loop over all entries of the Btree. You can also insert new BTree ** entries or retrieve the key or data from the entry that the cursor ** is currently pointing to. ** |
︙ | |||
226 227 228 229 230 231 232 | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | - - + + - - - - + + - - - + + - - - - - - - + + + + + + - + + | ** Return true if a memory cell is not marked as invalid. This macro ** is for use inside assert() statements only. */ #ifdef SQLITE_DEBUG #define memIsValid(M) ((M)->flags & MEM_Invalid)==0 #endif |
︙ | |||
364 365 366 367 368 369 370 371 372 373 374 375 376 377 | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | + | VdbeFrame *pFrame; /* Parent frame */ VdbeFrame *pDelFrame; /* List of frame objects to free on VM reset */ int nFrame; /* Number of frames in pFrame list */ u32 expmask; /* Binding to these vars invalidates VM */ SubProgram *pProgram; /* Linked list of all sub-programs used by VM */ int nOnceFlag; /* Size of array aOnceFlag[] */ u8 *aOnceFlag; /* Flags for OP_Once */ AuxData *pAuxData; /* Linked list of auxdata allocations */ }; /* ** The following are allowed values for Vdbe.magic */ #define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */ #define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */ |
︙ | |||
387 388 389 390 391 392 393 | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 | - + | #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE) void sqlite3VdbePrintOp(FILE*, int, Op*); #endif u32 sqlite3VdbeSerialTypeLen(u32); u32 sqlite3VdbeSerialType(Mem*, int); u32 sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int); u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*); |
︙ |
Changes to src/vdbeapi.c.
︙ | |||
580 581 582 583 584 585 586 | 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 | - + - - + + - - + + - - + + - - - - - - - - - + + - - - - + + - - - + + + + + + + + + | } /* ** Return the auxilary data pointer, if any, for the iArg'th argument to ** the user-function defined by pCtx. */ void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ |
︙ |
Changes to src/vdbeaux.c.
︙ | |||
608 609 610 611 612 613 614 | 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | - - - - - - - | sqlite3DbFree(db, p4); break; } case P4_MPRINTF: { if( db->pnBytesFreed==0 ) sqlite3_free(p4); break; } |
︙ | |||
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 | 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 | + + + + | releaseMemArray(&p->aMem[1], p->nMem); } while( p->pDelFrame ){ VdbeFrame *pDel = p->pDelFrame; p->pDelFrame = pDel->pParent; sqlite3VdbeFrameDelete(pDel); } /* Delete any auxdata allocations made by the VM */ sqlite3VdbeDeleteAuxData(p, -1, 0); assert( p->pAuxData==0 ); } /* ** Clean up the VM after execution. ** ** This routine will automatically close any cursors, lists, and/or ** sorters that were left open. It also deletes the values of |
︙ | |||
2442 2443 2444 2445 2446 2447 2448 | 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 | - - + + + + + + + + + + + + + - - + - + - - - - + + + + + + - + + + + | assert( (rc & p->db->errMask)==rc ); } sqlite3VdbeDelete(p); return rc; } /* |
︙ |
Changes to test/func.test.
︙ | |||
677 678 679 680 681 682 683 684 685 686 687 688 689 690 | 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 | + + + + + + + + + + + + + + + + + + + + + + + + + + | sqlite3_bind_text $STMT 1 hello\000 -1 set res [list] while { "SQLITE_ROW"==[sqlite3_step $STMT] } { lappend res [sqlite3_column_text $STMT 0] } lappend res [sqlite3_finalize $STMT] } {{0 0} {1 0} SQLITE_OK} # Test that auxiliary data is discarded when a statement is reset. do_execsql_test 13.8.1 { SELECT test_auxdata('constant') FROM t4; } {0 1} do_execsql_test 13.8.2 { SELECT test_auxdata('constant') FROM t4; } {0 1} db cache flush do_execsql_test 13.8.3 { SELECT test_auxdata('constant') FROM t4; } {0 1} set V "one" do_execsql_test 13.8.4 { SELECT test_auxdata($V), $V FROM t4; } {0 one 1 one} set V "two" do_execsql_test 13.8.5 { SELECT test_auxdata($V), $V FROM t4; } {0 two 1 two} db cache flush set V "three" do_execsql_test 2.3 { SELECT test_auxdata($V), $V FROM t4; } {0 three 1 three} # Make sure that a function with a very long name is rejected do_test func-14.1 { catch { db function [string repeat X 254] {return "hello"} } } {0} |
︙ |