Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Remove the OP_SetInsert opcode. (CVS 1443) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
18e690e405710c9a8010340c01754bbf |
User & Date: | drh 2004-05-22 21:30:41.000 |
Context
2004-05-23
| ||
13:30 | Begin changing the vdbe so all stack values use the database encoding. (CVS 1444) (check-in: f47de3a933 user: danielk1977 tags: trunk) | |
2004-05-22
| ||
21:30 | Remove the OP_SetInsert opcode. (CVS 1443) (check-in: 18e690e405 user: drh tags: trunk) | |
17:46 | Move btree_rb.c into the attic. (CVS 1442) (check-in: 4159ef235d user: drh tags: trunk) | |
Changes
Changes to src/os_unix.c.
︙ | ︙ | |||
807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | #endif } /* ** Static variables used for thread synchronization */ static int inMutex = 0; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* ** The following pair of routine implement mutual exclusion for ** multi-threaded processes. Only a single thread is allowed to ** executed code that is surrounded by EnterMutex() and LeaveMutex(). ** ** SQLite uses only a single Mutex. There is not much critical | > > | 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 | #endif } /* ** Static variables used for thread synchronization */ static int inMutex = 0; #ifdef SQLITE_UNIX_THREADS static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; #endif /* ** The following pair of routine implement mutual exclusion for ** multi-threaded processes. Only a single thread is allowed to ** executed code that is surrounded by EnterMutex() and LeaveMutex(). ** ** SQLite uses only a single Mutex. There is not much critical |
︙ | ︙ |
Changes to src/pragma.c.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /* ** 2003 April 6 ** ** 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. ** ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /* ** 2003 April 6 ** ** 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. ** ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** ** $Id: pragma.c,v 1.28 2004/05/22 21:30:41 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> /* ** Interpret the given string as a boolean value. */ |
︙ | ︙ | |||
570 571 572 573 574 575 576 | */ static VdbeOpList initCode[] = { { OP_Integer, 0, 0, 0}, { OP_MemStore, 0, 1, 0}, { OP_ColumnName, 0, 1, "integrity_check"}, }; | < < < < < < < < < < < < < < < < < < < < < < < < < > > > > | > > | > > > | | > | | | > > > > | 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 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | */ static VdbeOpList initCode[] = { { OP_Integer, 0, 0, 0}, { OP_MemStore, 0, 1, 0}, { OP_ColumnName, 0, 1, "integrity_check"}, }; /* Code that appears at the end of the integrity check. If no error ** messages have been generated, output OK. Otherwise output the ** error message */ static VdbeOpList endCode[] = { { OP_MemLoad, 0, 0, 0}, { OP_Integer, 0, 0, 0}, { OP_Ne, 0, 0, 0}, /* 2 */ { OP_String, 0, 0, "ok"}, { OP_Callback, 1, 0, 0}, }; /* Initialize the VDBE program */ sqlite3VdbeAddOpList(v, ArraySize(initCode), initCode); /* Do an integrity check on each database file */ for(i=0; i<db->nDb; i++){ HashElem *x; int cnt = 0; /* Do an integrity check of the B-Tree */ for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){ Table *pTab = sqliteHashData(x); Index *pIdx; sqlite3VdbeAddOp(v, OP_Integer, pTab->tnum, 0); cnt++; for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ sqlite3VdbeAddOp(v, OP_Integer, pIdx->tnum, 0); cnt++; } } sqlite3VdbeAddOp(v, OP_IntegrityCk, cnt, i); sqlite3VdbeAddOp(v, OP_Dup, 0, 1); addr = sqlite3VdbeOp3(v, OP_String, 0, 0, "ok", P3_STATIC); sqlite3VdbeAddOp(v, OP_Eq, 0, addr+6); sqlite3VdbeOp3(v, OP_String, 0, 0, sqlite3MPrintf("*** in database %s ***\n", db->aDb[i].zName), P3_DYNAMIC); sqlite3VdbeAddOp(v, OP_Pull, 1, 0); sqlite3VdbeAddOp(v, OP_Concat, 2, 1); sqlite3VdbeAddOp(v, OP_Callback, 1, 0); /* Make sure all the indices are constructed correctly. */ sqlite3CodeVerifySchema(pParse, i); for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){ Table *pTab = sqliteHashData(x); Index *pIdx; |
︙ | ︙ |
Changes to src/vdbe.c.
︙ | ︙ | |||
39 40 41 42 43 44 45 | ** ** Various scripts scan this source file in order to generate HTML ** documentation, headers files, or other derived files. The formatting ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** | | | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ** ** Various scripts scan this source file in order to generate HTML ** documentation, headers files, or other derived files. The formatting ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** ** $Id: vdbe.c,v 1.320 2004/05/22 21:30:41 drh Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> #include "vdbeInt.h" /* |
︙ | ︙ | |||
1558 1559 1560 1561 1562 1563 1564 | Stringify(pCol); azArgv[i] = pCol->z; } } p->resOnStack = 1; azArgv[i] = 0; | < > | 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 | Stringify(pCol); azArgv[i] = pCol->z; } } p->resOnStack = 1; azArgv[i] = 0; p->azResColumn = azArgv; p->nCallback++; assert( p->nResColumn==pOp->p1 ); p->popStack = pOp->p1; p->pc = pc + 1; p->pTos = pTos; return SQLITE_ROW; } |
︙ | ︙ | |||
4465 4466 4467 4468 4469 4470 4471 | pOp->p3 = 0; }else{ pTos->flags = MEM_Null; } break; } | | | < | | < < < < | < > > | | < | < > | | < > | 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 | pOp->p3 = 0; }else{ pTos->flags = MEM_Null; } break; } /* Opcode: IntegrityCk * P2 * ** ** Do an analysis of the currently open database. Push onto the ** stack the text of an error message describing any problems. ** If there are no errors, push a "ok" onto the stack. ** ** The root page numbers of all tables in the database are integer ** values on the stack. This opcode pulls as many integers as it ** can off of the stack and uses those numbers as the root pages. ** ** If P2 is not zero, the check is done on the auxiliary database ** file, not the main database file. ** ** This opcode is used for testing purposes only. */ case OP_IntegrityCk: { int nRoot; int *aRoot; int j; char *z; for(nRoot=0; &pTos[-nRoot]>=p->aStack; nRoot++){ if( (pTos[-nRoot].flags & MEM_Int)==0 ) break; } assert( nRoot>0 ); aRoot = sqliteMallocRaw( sizeof(int*)*(nRoot+1) ); if( aRoot==0 ) goto no_mem; for(j=0; j<nRoot; j++){ Mem *pMem = &pTos[-j]; aRoot[j] = pMem->i; } aRoot[j] = 0; popStack(&pTos, nRoot); pTos++; z = sqlite3BtreeIntegrityCheck(db->aDb[pOp->p2].pBt, aRoot, nRoot); if( z==0 || z[0]==0 ){ if( z ) sqliteFree(z); pTos->z = "ok"; pTos->n = 3; pTos->flags = MEM_Utf8 | MEM_Str | MEM_Static; }else{ |
︙ | ︙ | |||
5252 5253 5254 5255 5256 5257 5258 | aMem[i].z = aMem[i].zShort; } } } break; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 | aMem[i].z = aMem[i].zShort; } } } break; } /* Opcode: Vacuum * * * ** ** Vacuum the entire database. This opcode will cause other virtual ** machines to be created and run. It may not be called from within ** a transaction. */ case OP_Vacuum: { |
︙ | ︙ | |||
5367 5368 5369 5370 5371 5372 5373 | fprintf(p->trace, " si:%lld", pTos[i].i); }else if( pTos[i].flags & MEM_Int ){ fprintf(p->trace, " i:%lld", pTos[i].i); }else if( pTos[i].flags & MEM_Real ){ fprintf(p->trace, " r:%g", pTos[i].r); }else{ char zBuf[100]; | | | 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 | fprintf(p->trace, " si:%lld", pTos[i].i); }else if( pTos[i].flags & MEM_Int ){ fprintf(p->trace, " i:%lld", pTos[i].i); }else if( pTos[i].flags & MEM_Real ){ fprintf(p->trace, " r:%g", pTos[i].r); }else{ char zBuf[100]; prettyPrintMem(&pTos[i], zBuf, 100); fprintf(p->trace, " "); fprintf(p->trace, zBuf); } } if( rc!=0 ) fprintf(p->trace," rc=%d",rc); fprintf(p->trace,"\n"); } |
︙ | ︙ |
Changes to src/vdbeInt.h.
︙ | ︙ | |||
281 282 283 284 285 286 287 | Mem *apVar; /* Values for the OP_Variable opcode. */ char *zLine; /* A single line from the input file */ int nLineAlloc; /* Number of spaces allocated for zLine */ int magic; /* Magic number for sanity checking */ int nMem; /* Number of memory locations currently allocated */ Mem *aMem; /* The memory locations */ Agg agg; /* Aggregate information */ | < < | 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | Mem *apVar; /* Values for the OP_Variable opcode. */ char *zLine; /* A single line from the input file */ int nLineAlloc; /* Number of spaces allocated for zLine */ int magic; /* Magic number for sanity checking */ int nMem; /* Number of memory locations currently allocated */ Mem *aMem; /* The memory locations */ Agg agg; /* Aggregate information */ int nCallback; /* Number of callbacks invoked so far */ Keylist *pList; /* A list of ROWIDs */ int keylistStackDepth; /* The size of the "keylist" stack */ Keylist **keylistStack; /* The stack used by opcodes ListPush & ListPop */ int contextStackDepth; /* The size of the "context" stack */ Context *contextStack; /* Stack used by opcodes ContextPush & ContextPop*/ int pc; /* The program counter */ |
︙ | ︙ | |||
339 340 341 342 343 344 345 | int sqlite3VdbeIdxRowid(BtCursor *, i64 *); int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); int sqlite3VdbeKeyCompare(void*,int,const void*,int, const void*); int sqlite3VdbeRowCompare(void*,int,const void*,int, const void*); int sqlite3VdbeExec(Vdbe*); int sqlite3VdbeList(Vdbe*); int sqlite3VdbeSetEncoding(Mem *, u8); | < | 337 338 339 340 341 342 343 | int sqlite3VdbeIdxRowid(BtCursor *, i64 *); int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); int sqlite3VdbeKeyCompare(void*,int,const void*,int, const void*); int sqlite3VdbeRowCompare(void*,int,const void*,int, const void*); int sqlite3VdbeExec(Vdbe*); int sqlite3VdbeList(Vdbe*); int sqlite3VdbeSetEncoding(Mem *, u8); |
Changes to src/vdbeaux.c.
︙ | ︙ | |||
919 920 921 922 923 924 925 | p->nField = 0; if( p->zLine ){ sqliteFree(p->zLine); p->zLine = 0; } p->nLineAlloc = 0; sqlite3VdbeAggReset(&p->agg); | < < < < < < < < | 919 920 921 922 923 924 925 926 927 928 929 930 931 932 | p->nField = 0; if( p->zLine ){ sqliteFree(p->zLine); p->zLine = 0; } p->nLineAlloc = 0; sqlite3VdbeAggReset(&p->agg); if( p->keylistStack ){ int ii; for(ii = 0; ii < p->keylistStackDepth; ii++){ sqlite3VdbeKeylistFree(p->keylistStack[ii]); } sqliteFree(p->keylistStack); p->keylistStackDepth = 0; |
︙ | ︙ |