Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Beginning to clean up the trigger code. Still lots of work to do. (CVS 566) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
b10346818b25940c6dc85e94de8e36d2 |
User & Date: | drh 2002-05-15 12:45:43.000 |
Context
2002-05-15
| ||
14:17 | Fix for ticket #41: Better handling of CREATE TRIGGER in the sqlite_complete() function. (CVS 567) (check-in: f45c4b767a user: drh tags: trunk) | |
12:45 | Beginning to clean up the trigger code. Still lots of work to do. (CVS 566) (check-in: b10346818b user: drh tags: trunk) | |
11:44 | Remove all tabs from the beginning of source code lines. Replace tabs with the appropriate number of spaces. (CVS 565) (check-in: 690f9a1631 user: drh tags: trunk) | |
Changes
Changes to Makefile.template.
︙ | |||
114 115 116 117 118 119 120 | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | - + | # TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src # Object files for the SQLite library. # LIBOBJ = btree.o build.o delete.o expr.o func.o hash.o insert.o \ main.o os.o pager.o parse.o printf.o random.o select.o table.o \ |
︙ | |||
142 143 144 145 146 147 148 149 150 151 152 153 154 155 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | + | $(TOP)/src/select.c \ $(TOP)/src/shell.c \ $(TOP)/src/sqlite.h.in \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/table.c \ $(TOP)/src/tclsqlite.c \ $(TOP)/src/tokenize.c \ $(TOP)/src/trigger.c \ $(TOP)/src/update.c \ $(TOP)/src/util.c \ $(TOP)/src/vdbe.c \ $(TOP)/src/vdbe.h \ $(TOP)/src/where.c # Source code to the test files. |
︙ | |||
240 241 242 243 244 245 246 247 248 249 250 251 252 253 | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | + + + | sqlite.h: $(TOP)/src/sqlite.h.in sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \ -e s/--ENCODING--/$(ENCODING)/ \ $(TOP)/src/sqlite.h.in >sqlite.h tokenize.o: $(TOP)/src/tokenize.c $(HDR) $(TCCX) -c $(TOP)/src/tokenize.c trigger.o: $(TOP)/src/trigger.c $(HDR) $(TCCX) -c $(TOP)/src/trigger.c util.o: $(TOP)/src/util.c $(HDR) $(TCCX) -c $(TOP)/src/util.c vdbe.o: $(TOP)/src/vdbe.c $(HDR) $(TCCX) -c $(TOP)/src/vdbe.c |
︙ |
Changes to src/build.c.
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + | ** COPY ** VACUUM ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK ** PRAGMA ** |
︙ | |||
352 353 354 355 356 357 358 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | - | /* Any triggers that were dropped - put 'em back in place */ for(pElem = sqliteHashFirst(&db->trigDrop); pElem; pElem = sqliteHashNext(pElem)) { Trigger * pTrigger = sqliteHashData(pElem); Table * tab = sqliteFindTable(db, pTrigger->table); sqliteHashInsert(&db->trigHash, pTrigger->name, strlen(pTrigger->name) + 1, pTrigger); |
︙ | |||
649 650 651 652 653 654 655 | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | - + | ** ** This plan is not completely bullet-proof. It is possible for ** the schema to change multiple times and for the cookie to be ** set back to prior value. But schema changes are infrequent ** and the probability of hitting the same cookie value is only ** 1 chance in 2^32. So we're safe enough. */ |
︙ | |||
848 849 850 851 852 853 854 | 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | - + | }else{ assert( pEnd!=0 ); n = Addr(pEnd->z) - Addr(pParse->sFirstToken.z) + 1; sqliteVdbeChangeP3(v, -1, pParse->sFirstToken.z, n); } sqliteVdbeAddOp(v, OP_MakeRecord, 5, 0); sqliteVdbeAddOp(v, OP_PutIntKey, 0, 0); |
︙ | |||
1091 1092 1093 1094 1095 1096 1097 | 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 | - + - + | { OP_Integer, 0, 0, 0}, /* 9 */ { OP_SetCookie, 0, 0, 0}, { OP_Close, 0, 0, 0}, }; Index *pIdx; sqliteBeginWriteOperation(pParse); /* Drop all triggers associated with the table being dropped */ |
︙ | |||
1405 1406 1407 1408 1409 1410 1411 | 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 | - + | sqliteVdbeAddOp(v, OP_Next, 2, lbl1); sqliteVdbeResolveLabel(v, lbl2); sqliteVdbeAddOp(v, OP_Close, 2, 0); sqliteVdbeAddOp(v, OP_Close, 1, 0); } if( pTable!=0 ){ if( !isTemp ){ |
︙ | |||
1468 1469 1470 1471 1472 1473 1474 | 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 | - + | int base; Table *pTab = pIndex->pTable; sqliteBeginWriteOperation(pParse); if( !pTab->isTemp ){ base = sqliteVdbeAddOpList(v, ArraySize(dropIndex), dropIndex); sqliteVdbeChangeP3(v, base+2, pIndex->zName, P3_STATIC); |
︙ | |||
1707 1708 1709 1710 1711 1712 1713 | 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 | - + - + - + | db->onError = OE_Default; } /* ** Generate VDBE code that prepares for doing an operation that ** might change the database. The operation will be atomic in the ** sense that it will either do its changes completely or not at |
︙ |
Changes to src/sqliteInt.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Internal interface definitions for SQLite. ** |
︙ | |||
554 555 556 557 558 559 560 | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 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 | - - + - - - - - - + + + + + + - + - - + + - - - - - - - - + + + + + + + + - + - - - + + - - - - - - - - - - - - | int nSet; /* Number of sets used so far */ int nAgg; /* Number of aggregate expressions */ AggExpr *aAgg; /* An array of aggregate expressions */ int useAgg; /* If true, extract field values from the aggregator ** while generating expressions. Normally false */ int schemaVerified; /* True if an OP_VerifySchema has been coded someplace ** other than after an OP_Transaction */ |
︙ | |||
722 723 724 725 726 727 728 | 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | - - + + + + + + + + + + + | IdList *sqliteIdListDup(IdList*); Select *sqliteSelectDup(Select*); FuncDef *sqliteFindFunction(sqlite*,const char*,int,int,int); void sqliteRegisterBuildinFunctions(sqlite*); int sqliteSafetyOn(sqlite*); int sqliteSafetyOff(sqlite*); int sqliteSafetyCheck(sqlite*); |
Changes to src/trigger.c.
︙ | |||
98 99 100 101 102 103 104 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - + | sqliteVdbeAddOp(pParse->pVdbe, OP_Integer, 0, 0); sqliteVdbeAddOp(pParse->pVdbe, OP_String, 0, 0); sqliteVdbeChangeP3(pParse->pVdbe, -1, nt->strings, 0); sqliteVdbeAddOp(pParse->pVdbe, OP_MakeRecord, 5, 0); sqliteVdbeAddOp(pParse->pVdbe, OP_PutIntKey, 0, 1); /* Change the cookie, since the schema is changed */ |
︙ | |||
296 297 298 299 300 301 302 | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | - + - + - - - - + + + - - + + | { OP_Delete, 0, 0, 0}, { OP_Next, 0, ADDR(4), 0}, /* 8 */ { OP_Integer, 0, 0, 0}, /* 9 */ { OP_SetCookie, 0, 0, 0}, { OP_Close, 0, 0, 0}, }; |
︙ |