Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | 3.14 code merge |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | sourceforge |
Files: | files | file ages | folders |
SHA1: |
1eef5ec724761830204f413041df6f11 |
User & Date: | rmsimpson 2005-03-11 15:03:28.000 |
Context
2005-03-11
| ||
21:39 | 1.08 check-in: 40c497decf user: rmsimpson tags: sourceforge | |
15:03 | 3.14 code merge check-in: 1eef5ec724 user: rmsimpson tags: sourceforge | |
2005-03-09
| ||
22:57 | Was not meant to be committed in the first place, superceded by SQLiteStatement check-in: df0aff485f user: rmsimpson tags: sourceforge | |
Changes
Changes to SQLite.Interop/src/alter.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that used to generate VDBE code ** that implements the ALTER TABLE command. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that used to generate VDBE code ** that implements the ALTER TABLE command. ** ** $Id: alter.c,v 1.2 2005/03/11 15:03:28 rmsimpson Exp $ */ #include "sqliteInt.h" /* ** The code in this file only exists if we are not omitting the ** ALTER TABLE logic from the build. */ |
︙ | ︙ |
Changes to SQLite.Interop/src/attach.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 ATTACH and DETACH commands. ** | | | 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 ATTACH and DETACH commands. ** ** $Id: attach.c,v 1.2 2005/03/11 15:03:28 rmsimpson Exp $ */ #include "sqliteInt.h" /* ** This routine is called by the parser to process an ATTACH statement: ** ** ATTACH DATABASE filename AS dbname |
︙ | ︙ |
Changes to SQLite.Interop/src/auth.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** This file contains code used to implement the sqlite3_set_authorizer() ** API. This facility is an optional feature of the library. Embedded ** systems that do not need this facility may omit it by recompiling ** the library with -DSQLITE_OMIT_AUTHORIZATION=1 ** | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ** ************************************************************************* ** This file contains code used to implement the sqlite3_set_authorizer() ** API. This facility is an optional feature of the library. Embedded ** systems that do not need this facility may omit it by recompiling ** the library with -DSQLITE_OMIT_AUTHORIZATION=1 ** ** $Id: auth.c,v 1.2 2005/03/11 15:03:28 rmsimpson Exp $ */ #include "sqliteInt.h" /* ** All of the code in this file may be omitted by defining a single ** macro. */ |
︙ | ︙ |
Changes to SQLite.Interop/src/btree.c.
1 2 3 4 5 6 7 8 9 10 11 | /* ** 2004 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. ** ************************************************************************* | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* ** 2004 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. ** ************************************************************************* ** $Id: btree.c,v 1.2 2005/03/11 15:03:28 rmsimpson Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to ** ** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3: ** "Sorting And Searching", pages 473-480. Addison-Wesley ** Publishing Company, Reading, Massachusetts. |
︙ | ︙ | |||
1839 1840 1841 1842 1843 1844 1845 | /* If iDbPage is a pointer map page, or the pending-byte page, skip it. */ if( PTRMAP_ISPAGE(pgsz, iDbPage) || iDbPage==PENDING_BYTE_PAGE(pBt) ){ continue; } rc = ptrmapGet(pBt, iDbPage, &eType, &iPtrPage); if( rc!=SQLITE_OK ) goto autovacuum_out; | | > > > | 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 | /* If iDbPage is a pointer map page, or the pending-byte page, skip it. */ if( PTRMAP_ISPAGE(pgsz, iDbPage) || iDbPage==PENDING_BYTE_PAGE(pBt) ){ continue; } rc = ptrmapGet(pBt, iDbPage, &eType, &iPtrPage); if( rc!=SQLITE_OK ) goto autovacuum_out; if( eType==PTRMAP_ROOTPAGE ){ rc = SQLITE_CORRUPT; goto autovacuum_out; } /* If iDbPage is free, do not swap it. */ if( eType==PTRMAP_FREEPAGE ){ continue; } rc = getPage(pBt, iDbPage, &pDbMemPage); if( rc!=SQLITE_OK ) goto autovacuum_out; |
︙ | ︙ | |||
2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 | ** Return SQLITE_OK on success or an error code if anything goes ** wrong. An error is returned if "offset+amt" is larger than ** the available payload. */ int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){ assert( pCur->isValid ); assert( pCur->pPage!=0 ); assert( pCur->pPage->intKey==0 ); assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell ); return getPayload(pCur, offset, amt, (unsigned char*)pBuf, 0); } /* ** Read part of the data associated with cursor pCur. Exactly | > > > | 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 | ** Return SQLITE_OK on success or an error code if anything goes ** wrong. An error is returned if "offset+amt" is larger than ** the available payload. */ int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){ assert( pCur->isValid ); assert( pCur->pPage!=0 ); if( pCur->pPage->intKey ){ return SQLITE_CORRUPT; } assert( pCur->pPage->intKey==0 ); assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell ); return getPayload(pCur, offset, amt, (unsigned char*)pBuf, 0); } /* ** Read part of the data associated with cursor pCur. Exactly |
︙ | ︙ | |||
4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 | releasePage(pPageMove); rc = getPage(pBt, pgnoRoot, &pRoot); if( rc!=SQLITE_OK ){ return rc; } rc = ptrmapGet(pBt, pgnoRoot, &eType, &iPtrPage); assert( eType!=PTRMAP_ROOTPAGE ); assert( eType!=PTRMAP_FREEPAGE ); if( rc!=SQLITE_OK ){ releasePage(pRoot); return rc; } rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove); releasePage(pRoot); if( rc!=SQLITE_OK ){ | > > > > > | 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 | releasePage(pPageMove); rc = getPage(pBt, pgnoRoot, &pRoot); if( rc!=SQLITE_OK ){ return rc; } rc = ptrmapGet(pBt, pgnoRoot, &eType, &iPtrPage); if( rc!=SQLITE_OK || eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){ releasePage(pRoot); return rc; } assert( eType!=PTRMAP_ROOTPAGE ); assert( eType!=PTRMAP_FREEPAGE ); rc = sqlite3pager_write(pRoot->aData); if( rc!=SQLITE_OK ){ releasePage(pRoot); return rc; } rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove); releasePage(pRoot); if( rc!=SQLITE_OK ){ |
︙ | ︙ |
Changes to SQLite.Interop/src/btree.h.
︙ | ︙ | |||
9 10 11 12 13 14 15 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the sqlite B-Tree file ** subsystem. See comments in the source code for a detailed description ** of what each interface routine does. ** | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the sqlite B-Tree file ** subsystem. See comments in the source code for a detailed description ** of what each interface routine does. ** ** @(#) $Id: btree.h,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #ifndef _BTREE_H_ #define _BTREE_H_ /* TODO: This definition is just included so other modules compile. It ** needs to be revisited. */ |
︙ | ︙ |
Changes to SQLite.Interop/src/build.c.
︙ | ︙ | |||
18 19 20 21 22 23 24 | ** CREATE INDEX ** DROP INDEX ** creating ID lists ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK ** | | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ** CREATE INDEX ** DROP INDEX ** creating ID lists ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK ** ** $Id: build.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #include "sqliteInt.h" #include <ctype.h> /* ** This routine is called when a new SQL statement is beginning to ** be parsed. Initialize the pParse structure as needed. |
︙ | ︙ |
Changes to SQLite.Interop/src/date.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 | ** This file contains the C functions that implement date and time ** functions for SQLite. ** ** There is only one exported symbol in this file - the function ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ** This file contains the C functions that implement date and time ** functions for SQLite. ** ** There is only one exported symbol in this file - the function ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** ** $Id: date.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ ** ** NOTES: ** ** SQLite processes all times and dates as Julian Day numbers. The ** dates and times are stored as the number of days since noon ** in Greenwich on November 24, 4714 B.C. according to the Gregorian ** calendar system. |
︙ | ︙ |
Changes to SQLite.Interop/src/delete.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** in order to generate code for DELETE FROM statements. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** in order to generate code for DELETE FROM statements. ** ** $Id: delete.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #include "sqliteInt.h" /* ** Look up every table that is named in pSrc. If any table is not found, ** add an error message to pParse->zErrMsg and return NULL. If all tables ** are found, return a pointer to the last table. |
︙ | ︙ | |||
432 433 434 435 436 437 438 439 440 441 442 443 | sqlite3VdbeAddOp(v, OP_Recno, iCur, 0); for(j=0; j<pIdx->nColumn; j++){ int idx = pIdx->aiColumn[j]; if( idx==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_Dup, j, 0); }else{ sqlite3VdbeAddOp(v, OP_Column, iCur, idx); } } sqlite3VdbeAddOp(v, OP_MakeRecord, pIdx->nColumn, (1<<24)); sqlite3IndexAffinityStr(v, pIdx); } | > | 432 433 434 435 436 437 438 439 440 441 442 443 444 | sqlite3VdbeAddOp(v, OP_Recno, iCur, 0); for(j=0; j<pIdx->nColumn; j++){ int idx = pIdx->aiColumn[j]; if( idx==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_Dup, j, 0); }else{ sqlite3VdbeAddOp(v, OP_Column, iCur, idx); sqlite3ColumnDefault(v, pTab, idx); } } sqlite3VdbeAddOp(v, OP_MakeRecord, pIdx->nColumn, (1<<24)); sqlite3IndexAffinityStr(v, pIdx); } |
Changes to SQLite.Interop/src/expr.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** ** $Id: expr.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #include "sqliteInt.h" #include <ctype.h> /* ** Return the 'affinity' of the expression pExpr if any. ** |
︙ | ︙ | |||
399 400 401 402 403 404 405 406 407 408 409 410 411 412 | assert( pNew->token.z==0 ); } pNew->span.z = 0; pNew->pLeft = sqlite3ExprDup(p->pLeft); pNew->pRight = sqlite3ExprDup(p->pRight); pNew->pList = sqlite3ExprListDup(p->pList); pNew->pSelect = sqlite3SelectDup(p->pSelect); return pNew; } void sqlite3TokenCopy(Token *pTo, Token *pFrom){ if( pTo->dyn ) sqliteFree((char*)pTo->z); if( pFrom->z ){ pTo->n = pFrom->n; pTo->z = sqliteStrNDup(pFrom->z, pFrom->n); | > | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | assert( pNew->token.z==0 ); } pNew->span.z = 0; pNew->pLeft = sqlite3ExprDup(p->pLeft); pNew->pRight = sqlite3ExprDup(p->pRight); pNew->pList = sqlite3ExprListDup(p->pList); pNew->pSelect = sqlite3SelectDup(p->pSelect); pNew->pTab = p->pTab; return pNew; } void sqlite3TokenCopy(Token *pTo, Token *pFrom){ if( pTo->dyn ) sqliteFree((char*)pTo->z); if( pFrom->z ){ pTo->n = pFrom->n; pTo->z = sqliteStrNDup(pFrom->z, pFrom->n); |
︙ | ︙ | |||
843 844 845 846 847 848 849 850 851 852 853 854 855 856 | cntTab++; for(j=0; j < pTab->nCol; j++, pCol++) { if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ cnt++; pExpr->iColumn = j==pTab->iPKey ? -1 : j; pExpr->affinity = pTab->aCol[j].affinity; pExpr->pColl = pTab->aCol[j].pColl; break; } } } } #endif /* !defined(SQLITE_OMIT_TRIGGER) */ | > | 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 | cntTab++; for(j=0; j < pTab->nCol; j++, pCol++) { if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ cnt++; pExpr->iColumn = j==pTab->iPKey ? -1 : j; pExpr->affinity = pTab->aCol[j].affinity; pExpr->pColl = pTab->aCol[j].pColl; pExpr->pTab = pTab; break; } } } } #endif /* !defined(SQLITE_OMIT_TRIGGER) */ |
︙ | ︙ | |||
954 955 956 957 958 959 960 961 962 963 964 965 966 967 | pExpr->pLeft = 0; sqlite3ExprDelete(pExpr->pRight); pExpr->pRight = 0; pExpr->op = TK_COLUMN; if( cnt==1 ){ assert( pNC!=0 ); sqlite3AuthRead(pParse, pExpr, pNC->pSrcList); } return cnt!=1; } /* ** pExpr is a node that defines a function of some kind. It might ** be a syntactic function like "count(x)" or it might be a function | > > > | 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 | pExpr->pLeft = 0; sqlite3ExprDelete(pExpr->pRight); pExpr->pRight = 0; pExpr->op = TK_COLUMN; if( cnt==1 ){ assert( pNC!=0 ); sqlite3AuthRead(pParse, pExpr, pNC->pSrcList); if( pMatch && !pMatch->pSelect ){ pExpr->pTab = pMatch->pTab; } } return cnt!=1; } /* ** pExpr is a node that defines a function of some kind. It might ** be a syntactic function like "count(x)" or it might be a function |
︙ | ︙ | |||
1381 1382 1383 1384 1385 1386 1387 | op = pExpr->op; switch( op ){ case TK_COLUMN: { if( !pParse->fillAgg && pExpr->iAgg>=0 ){ sqlite3VdbeAddOp(v, OP_AggGet, pExpr->iAggCtx, pExpr->iAgg); }else if( pExpr->iColumn>=0 ){ sqlite3VdbeAddOp(v, OP_Column, pExpr->iTable, pExpr->iColumn); | < < | < < | 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 | op = pExpr->op; switch( op ){ case TK_COLUMN: { if( !pParse->fillAgg && pExpr->iAgg>=0 ){ sqlite3VdbeAddOp(v, OP_AggGet, pExpr->iAggCtx, pExpr->iAgg); }else if( pExpr->iColumn>=0 ){ sqlite3VdbeAddOp(v, OP_Column, pExpr->iTable, pExpr->iColumn); sqlite3ColumnDefault(v, pExpr->pTab, pExpr->iColumn); }else{ sqlite3VdbeAddOp(v, OP_Recno, pExpr->iTable, 0); } break; } case TK_INTEGER: { codeInteger(v, pExpr->token.z, pExpr->token.n); |
︙ | ︙ |
Changes to SQLite.Interop/src/func.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 | ** This file contains the C functions that implement various SQL ** functions of SQLite. ** ** There is only one exported symbol in this file - the function ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ** This file contains the C functions that implement various SQL ** functions of SQLite. ** ** There is only one exported symbol in this file - the function ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** ** $Id: func.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #include "sqliteInt.h" #include <ctype.h> #include <math.h> #include <stdlib.h> #include <assert.h> #include "vdbeInt.h" |
︙ | ︙ |
Changes to SQLite.Interop/src/hash.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of generic hash-tables ** used in SQLite. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of generic hash-tables ** used in SQLite. ** ** $Id: hash.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #include "sqliteInt.h" #include <assert.h> /* Turn bulk memory into a hash table object by initializing the ** fields of the Hash structure. ** |
︙ | ︙ |
Changes to SQLite.Interop/src/hash.h.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the header file for the generic hash-table implemenation ** used in SQLite. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the header file for the generic hash-table implemenation ** used in SQLite. ** ** $Id: hash.h,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #ifndef _SQLITE_HASH_H_ #define _SQLITE_HASH_H_ /* Forward declarations of structures. */ typedef struct Hash Hash; typedef struct HashElem HashElem; |
︙ | ︙ |
Changes to SQLite.Interop/src/insert.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** ** $Id: insert.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #include "sqliteInt.h" /* ** Set P3 of the most recently inserted opcode to a column affinity ** string for index pIdx. A column affinity string has one character ** for each column in the table, according to the affinity of the column: |
︙ | ︙ |
Changes to SQLite.Interop/src/legacy.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ** ************************************************************************* ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** ** $Id: legacy.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> /* |
︙ | ︙ |
Changes to SQLite.Interop/src/main.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ** ************************************************************************* ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** ** $Id: main.c,v 1.2 2005/03/11 15:03:29 rmsimpson Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> /* ** The following constant value is used by the SQLITE_BIGENDIAN and |
︙ | ︙ | |||
254 255 256 257 258 259 260 | if( iDb==0 ){ db->file_format = meta[1]; if( db->file_format==0 ){ /* This happens if the database was initially empty */ db->file_format = 1; } | | > > | | 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 280 281 282 283 284 285 | if( iDb==0 ){ db->file_format = meta[1]; if( db->file_format==0 ){ /* This happens if the database was initially empty */ db->file_format = 1; } if( db->file_format==2 || db->file_format==3 ){ /* File format 2 is treated exactly as file format 1. New ** databases are created with file format 1. */ db->file_format = 1; } } /* ** file_format==1 Version 3.0.0. ** file_format==2 Version 3.1.3. ** file_format==3 Version 3.1.4. ** ** Version 3.0 can only use files with file_format==1. Version 3.1.3 ** can read and write files with file_format==1 or file_format==2. ** Version 3.1.4 can read and write file formats 1, 2 and 3. */ if( meta[1]>3 ){ sqlite3BtreeCloseCursor(curMain); sqlite3SetString(pzErrMsg, "unsupported file format", (char*)0); return SQLITE_ERROR; } sqlite3BtreeSetCacheSize(db->aDb[iDb].pBt, db->aDb[iDb].cache_size); |
︙ | ︙ |
Changes to SQLite.Interop/src/opcodes.c.
1 2 3 4 | /* Automatically generated. Do not edit */ /* See the mkopcodec.awk script for details. */ #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) const char *const sqlite3OpcodeNames[] = { "?", | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | /* Automatically generated. Do not edit */ /* See the mkopcodec.awk script for details. */ #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) const char *const sqlite3OpcodeNames[] = { "?", /* 1 */ "MemLoad", /* 2 */ "Column", /* 3 */ "SetCookie", /* 4 */ "IfMemPos", /* 5 */ "MoveGt", /* 6 */ "AggFocus", /* 7 */ "RowKey", /* 8 */ "IdxRecno", /* 9 */ "AggNext", /* 10 */ "OpenWrite", /* 11 */ "If", /* 12 */ "PutStrKey", /* 13 */ "Pop", /* 14 */ "SortPut", /* 15 */ "AggContextPush", /* 16 */ "CollSeq", /* 17 */ "OpenRead", /* 18 */ "Expire", /* 19 */ "SortReset", /* 20 */ "AutoCommit", /* 21 */ "Sort", /* 22 */ "ListRewind", /* 23 */ "IntegrityCk", /* 24 */ "Function", /* 25 */ "Noop", /* 26 */ "Return", /* 27 */ "Variable", /* 28 */ "String", /* 29 */ "ParseSchema", /* 30 */ "PutIntKey", /* 31 */ "AggFunc", /* 32 */ "Close", /* 33 */ "ListWrite", /* 34 */ "CreateIndex", /* 35 */ "IsUnique", /* 36 */ "IdxIsNull", /* 37 */ "NotFound", /* 38 */ "MustBeInt", /* 39 */ "Halt", /* 40 */ "IdxLT", /* 41 */ "AddImm", /* 42 */ "Statement", /* 43 */ "RowData", /* 44 */ "MemMax", /* 45 */ "Push", /* 46 */ "KeyAsData", /* 47 */ "NotExists", /* 48 */ "OpenTemp", /* 49 */ "MemIncr", /* 50 */ "Gosub", /* 51 */ "AggSet", /* 52 */ "Integer", /* 53 */ "SortNext", /* 54 */ "Prev", /* 55 */ "CreateTable", /* 56 */ "Last", /* 57 */ "ResetCount", /* 58 */ "Callback", /* 59 */ "ContextPush", /* 60 */ "DropTrigger", /* 61 */ "DropIndex", /* 62 */ "FullKey", /* 63 */ "IdxGE", /* 64 */ "Or", /* 65 */ "And", /* 66 */ "Not", /* 67 */ "IdxDelete", /* 68 */ "Vacuum", /* 69 */ "MoveLe", /* 70 */ "IsNull", /* 71 */ "NotNull", /* 72 */ "Ne", /* 73 */ "Eq", /* 74 */ "Gt", /* 75 */ "Le", /* 76 */ "Lt", /* 77 */ "Ge", /* 78 */ "IfNot", /* 79 */ "BitAnd", /* 80 */ "BitOr", /* 81 */ "ShiftLeft", /* 82 */ "ShiftRight", /* 83 */ "Add", /* 84 */ "Subtract", /* 85 */ "Multiply", /* 86 */ "Divide", /* 87 */ "Remainder", /* 88 */ "Concat", /* 89 */ "Negative", /* 90 */ "DropTable", /* 91 */ "BitNot", /* 92 */ "String8", /* 93 */ "MakeRecord", /* 94 */ "Delete", /* 95 */ "AggContextPop", /* 96 */ "ListRead", /* 97 */ "ListReset", /* 98 */ "Dup", /* 99 */ "Goto", /* 100 */ "Clear", /* 101 */ "IdxGT", /* 102 */ "MoveLt", /* 103 */ "VerifyCookie", /* 104 */ "Pull", /* 105 */ "SetNumColumns", /* 106 */ "AbsValue", /* 107 */ "Transaction", /* 108 */ "AggGet", /* 109 */ "ContextPop", /* 110 */ "Next", /* 111 */ "AggInit", /* 112 */ "Distinct", /* 113 */ "NewRecno", /* 114 */ "AggReset", /* 115 */ "Destroy", /* 116 */ "ReadCookie", /* 117 */ "ForceInt", /* 118 */ "Recno", /* 119 */ "OpenPseudo", /* 120 */ "Blob", /* 121 */ "MemStore", /* 122 */ "Rewind", /* 123 */ "MoveGe", /* 124 */ "IdxPut", /* 125 */ "Found", /* 126 */ "NullRow", /* 127 */ "NotUsed_127", /* 128 */ "NotUsed_128", /* 129 */ "NotUsed_129", /* 130 */ "Real", /* 131 */ "HexBlob", }; #endif |
Changes to SQLite.Interop/src/opcodes.h.
1 2 | /* Automatically generated. Do not edit */ /* See the mkopcodeh.awk script for details */ | | | | | | | < | | | < < < < | < | | < < < < | < < < < < < < < < < < < < < < < < < < < > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < | < | < < < < < < | | < | < | | | < < < < > | | | | | > > > > > | | | | | > > | | | | | < < < | | | < | | | | | | < | | | < | | > < | > > | | | | > | | | < < | < < | < | < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | /* Automatically generated. Do not edit */ /* See the mkopcodeh.awk script for details */ #define OP_MemLoad 1 #define OP_HexBlob 131 /* same as TK_BLOB */ #define OP_Column 2 #define OP_SetCookie 3 #define OP_IfMemPos 4 #define OP_Real 130 /* same as TK_FLOAT */ #define OP_MoveGt 5 #define OP_Ge 77 /* same as TK_GE */ #define OP_AggFocus 6 #define OP_RowKey 7 #define OP_IdxRecno 8 #define OP_AggNext 9 #define OP_Eq 73 /* same as TK_EQ */ #define OP_OpenWrite 10 #define OP_NotNull 71 /* same as TK_NOTNULL */ #define OP_If 11 #define OP_PutStrKey 12 #define OP_String8 92 /* same as TK_STRING */ #define OP_Pop 13 #define OP_SortPut 14 #define OP_AggContextPush 15 #define OP_CollSeq 16 #define OP_OpenRead 17 #define OP_Expire 18 #define OP_SortReset 19 #define OP_AutoCommit 20 #define OP_Gt 74 /* same as TK_GT */ #define OP_Sort 21 #define OP_ListRewind 22 #define OP_IntegrityCk 23 #define OP_Function 24 #define OP_Subtract 84 /* same as TK_MINUS */ #define OP_And 65 /* same as TK_AND */ #define OP_Noop 25 #define OP_Return 26 #define OP_Remainder 87 /* same as TK_REM */ #define OP_Multiply 85 /* same as TK_STAR */ #define OP_Variable 27 #define OP_String 28 #define OP_ParseSchema 29 #define OP_PutIntKey 30 #define OP_AggFunc 31 #define OP_Close 32 #define OP_ListWrite 33 #define OP_CreateIndex 34 #define OP_IsUnique 35 #define OP_IdxIsNull 36 #define OP_NotFound 37 #define OP_MustBeInt 38 #define OP_Halt 39 #define OP_IdxLT 40 #define OP_AddImm 41 #define OP_Statement 42 #define OP_RowData 43 #define OP_MemMax 44 #define OP_Push 45 #define OP_Or 64 /* same as TK_OR */ #define OP_KeyAsData 46 #define OP_NotExists 47 #define OP_OpenTemp 48 #define OP_MemIncr 49 #define OP_Gosub 50 #define OP_Divide 86 /* same as TK_SLASH */ #define OP_AggSet 51 #define OP_Integer 52 #define OP_SortNext 53 #define OP_Prev 54 #define OP_Concat 88 /* same as TK_CONCAT */ #define OP_BitAnd 79 /* same as TK_BITAND */ #define OP_CreateTable 55 #define OP_Last 56 #define OP_IsNull 70 /* same as TK_ISNULL */ #define OP_ShiftRight 82 /* same as TK_RSHIFT */ #define OP_ResetCount 57 #define OP_Callback 58 #define OP_ContextPush 59 #define OP_DropTrigger 60 #define OP_DropIndex 61 #define OP_FullKey 62 #define OP_IdxGE 63 #define OP_IdxDelete 67 #define OP_Vacuum 68 #define OP_MoveLe 69 #define OP_IfNot 78 #define OP_DropTable 90 #define OP_MakeRecord 93 #define OP_Delete 94 #define OP_AggContextPop 95 #define OP_ListRead 96 #define OP_ListReset 97 #define OP_ShiftLeft 81 /* same as TK_LSHIFT */ #define OP_Dup 98 #define OP_Goto 99 #define OP_Clear 100 #define OP_IdxGT 101 #define OP_MoveLt 102 #define OP_Le 75 /* same as TK_LE */ #define OP_VerifyCookie 103 #define OP_Pull 104 #define OP_Not 66 /* same as TK_NOT */ #define OP_SetNumColumns 105 #define OP_AbsValue 106 #define OP_Transaction 107 #define OP_Negative 89 /* same as TK_UMINUS */ #define OP_Ne 72 /* same as TK_NE */ #define OP_AggGet 108 #define OP_ContextPop 109 #define OP_BitOr 80 /* same as TK_BITOR */ #define OP_Next 110 #define OP_AggInit 111 #define OP_Distinct 112 #define OP_NewRecno 113 #define OP_Lt 76 /* same as TK_LT */ #define OP_AggReset 114 #define OP_Destroy 115 #define OP_ReadCookie 116 #define OP_ForceInt 117 #define OP_Recno 118 #define OP_OpenPseudo 119 #define OP_Blob 120 #define OP_Add 83 /* same as TK_PLUS */ #define OP_MemStore 121 #define OP_Rewind 122 #define OP_MoveGe 123 #define OP_IdxPut 124 #define OP_BitNot 91 /* same as TK_BITNOT */ #define OP_Found 125 #define OP_NullRow 126 /* The following opcode values are never used */ #define OP_NotUsed_127 127 #define OP_NotUsed_128 128 #define OP_NotUsed_129 129 |
Changes to SQLite.Interop/src/os.h.
︙ | ︙ | |||
49 50 51 52 53 54 55 56 57 58 59 60 61 62 | #endif #if OS_UNIX # include "os_unix.h" #endif #if OS_WIN # include "os_win.h" #endif /* ** Temporary files are named starting with this prefix followed by 16 random ** alphanumeric characters, and no file extension. They are stored in the ** OS's standard temporary file directory, and are deleted prior to exit. ** If sqlite is being embedded in another program, you may wish to change the ** prefix to reflect your program's name, so that if your program exits | > > > > > > > | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | #endif #if OS_UNIX # include "os_unix.h" #endif #if OS_WIN # include "os_win.h" #endif /* If the SET_FULLSYNC macro is not defined above, then make it ** a no-op */ #ifndef SET_FULLSYNC # define SET_FULLSYNC(x,y) #endif /* ** Temporary files are named starting with this prefix followed by 16 random ** alphanumeric characters, and no file extension. They are stored in the ** OS's standard temporary file directory, and are deleted prior to exit. ** If sqlite is being embedded in another program, you may wish to change the ** prefix to reflect your program's name, so that if your program exits |
︙ | ︙ |
Changes to SQLite.Interop/src/os_unix.c.
︙ | ︙ | |||
683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | */ int sqlite3OsSeek(OsFile *id, i64 offset){ assert( id->isOpen ); SEEK(offset/1024 + 1); lseek(id->h, offset, SEEK_SET); return SQLITE_OK; } /* ** The fsync() system call does not work as advertised on many ** unix systems. The following procedure is an attempt to make ** it work better. ** ** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful ** for testing when we want to run through the test suite quickly. ** You are strongly advised *not* to deploy with SQLITE_NO_SYNC ** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash ** or power failure will likely corrupt the database file. */ | > > > > > > > > > > | > > > > > > > > > > > > > > | | > | > > > > > | > > < | | > > > > | 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 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | */ int sqlite3OsSeek(OsFile *id, i64 offset){ assert( id->isOpen ); SEEK(offset/1024 + 1); lseek(id->h, offset, SEEK_SET); return SQLITE_OK; } #ifdef SQLITE_TEST /* ** Count the number of fullsyncs and normal syncs. This is used to test ** that syncs and fullsyncs are occuring at the right times. */ int sqlite3_sync_count = 0; int sqlite3_fullsync_count = 0; #endif /* ** The fsync() system call does not work as advertised on many ** unix systems. The following procedure is an attempt to make ** it work better. ** ** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful ** for testing when we want to run through the test suite quickly. ** You are strongly advised *not* to deploy with SQLITE_NO_SYNC ** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash ** or power failure will likely corrupt the database file. */ static int full_fsync(int fd, int fullSync){ int rc; /* Record the number of times that we do a normal fsync() and ** FULLSYNC. This is used during testing to verify that this procedure ** gets called with the correct arguments. */ #ifdef SQLITE_TEST if( fullSync ) sqlite3_fullsync_count++; sqlite3_sync_count++; #endif /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a ** no-op */ #ifdef SQLITE_NO_SYNC rc = SQLITE_OK; #else #ifdef F_FULLFSYNC if( fullSync ){ rc = fcntl(fd, F_FULLSYNC, 0); }else{ rc = 1; } /* If the FULLSYNC failed, try to do a normal fsync() */ if( rc ) rc = fsync(fd); #else rc = fsync(fd); #endif /* defined(F_FULLSYNC) */ #endif /* defined(SQLITE_NO_SYNC) */ return rc; } /* ** Make sure all writes to a particular file are committed to disk. ** ** Under Unix, also make sure that the directory entry for the file ** has been created by fsync-ing the directory that contains the file. ** If we do not do this and we encounter a power failure, the directory ** entry for the journal might not exist after we reboot. The next ** SQLite to access the file will not know that the journal exists (because ** the directory entry for the journal was never created) and the transaction ** will not roll back - possibly leading to database corruption. */ int sqlite3OsSync(OsFile *id){ assert( id->isOpen ); SimulateIOError(SQLITE_IOERR); TRACE2("SYNC %-3d\n", id->h); if( full_fsync(id->h, id->fullSync) ){ return SQLITE_IOERR; } if( id->dirfd>=0 ){ TRACE2("DIRSYNC %-3d\n", id->dirfd); full_fsync(id->dirfd, id->fullSync); close(id->dirfd); /* Only need to sync once, so close the directory */ id->dirfd = -1; /* when we are done. */ } return SQLITE_OK; } /* ** Sync the directory zDirname. This is a no-op on operating systems other ** than UNIX. ** ** This is used to make sure the master journal file has truely been deleted ** before making changes to individual journals on a multi-database commit. ** The F_FULLSYNC option is not needed here. */ int sqlite3OsSyncDirectory(const char *zDirname){ int fd; int r; SimulateIOError(SQLITE_IOERR); fd = open(zDirname, O_RDONLY|O_BINARY, 0644); TRACE3("DIRSYNC %-3d (%s)\n", fd, zDirname); |
︙ | ︙ |
Changes to SQLite.Interop/src/os_unix.h.
︙ | ︙ | |||
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | struct OsFile { struct Pager *pPager; /* The pager that owns this OsFile. Might be 0 */ struct openCnt *pOpen; /* Info about all open fd's on this inode */ struct lockInfo *pLock; /* Info about locks on this inode */ int h; /* The file descriptor */ unsigned char locktype; /* The type of lock held on this fd */ unsigned char isOpen; /* True if needs to be closed */ int dirfd; /* File descriptor for the directory */ }; /* ** Maximum number of characters in a temporary file name */ #define SQLITE_TEMPNAME_SIZE 200 /* ** Minimum interval supported by sqlite3OsSleep(). | > > > > > > | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | struct OsFile { struct Pager *pPager; /* The pager that owns this OsFile. Might be 0 */ struct openCnt *pOpen; /* Info about all open fd's on this inode */ struct lockInfo *pLock; /* Info about locks on this inode */ int h; /* The file descriptor */ unsigned char locktype; /* The type of lock held on this fd */ unsigned char isOpen; /* True if needs to be closed */ unsigned char fullSync; /* Use F_FULLSYNC if available */ int dirfd; /* File descriptor for the directory */ }; /* ** A macro to set the OsFile.fullSync flag, if it exists. */ #define SET_FULLSYNC(x,y) ((x).fullSync = (y)) /* ** Maximum number of characters in a temporary file name */ #define SQLITE_TEMPNAME_SIZE 200 /* ** Minimum interval supported by sqlite3OsSleep(). |
︙ | ︙ |
Changes to SQLite.Interop/src/pager.c.
︙ | ︙ | |||
14 15 16 17 18 19 20 | ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** ** @(#) $Id: pager.c,v 1.2 2005/03/11 15:03:30 rmsimpson Exp $ */ #include "sqliteInt.h" #include "os.h" #include "pager.h" #include <assert.h> #include <string.h> |
︙ | ︙ | |||
2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 | rc = sqlite3OsOpenExclusive(pPager->zJournal, &pPager->jfd,pPager->tempFile); pPager->journalOff = 0; pPager->setMaster = 0; pPager->journalHdr = 0; if( rc!=SQLITE_OK ){ goto failed_to_open_journal; } sqlite3OsOpenDirectory(pPager->zDirectory, &pPager->jfd); pPager->journalOpen = 1; pPager->journalStarted = 0; pPager->needSync = 0; pPager->alwaysRollback = 0; pPager->nRec = 0; if( pPager->errMask!=0 ){ | > > | 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 | rc = sqlite3OsOpenExclusive(pPager->zJournal, &pPager->jfd,pPager->tempFile); pPager->journalOff = 0; pPager->setMaster = 0; pPager->journalHdr = 0; if( rc!=SQLITE_OK ){ goto failed_to_open_journal; } SET_FULLSYNC(pPager->jfd, pPager->fullSync); SET_FULLSYNC(pPager->fd, pPager->fullSync); sqlite3OsOpenDirectory(pPager->zDirectory, &pPager->jfd); pPager->journalOpen = 1; pPager->journalStarted = 0; pPager->needSync = 0; pPager->alwaysRollback = 0; pPager->nRec = 0; if( pPager->errMask!=0 ){ |
︙ | ︙ | |||
3402 3403 3404 3405 3406 3407 3408 | ** by this routine. The same applies to the page pData refers to on entry to ** this routine. ** ** References to the page refered to by pData remain valid. Updating any ** meta-data associated with page pData (i.e. data stored in the nExtra bytes ** allocated along with the page) is the responsibility of the caller. ** | | > > | < | 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 | ** by this routine. The same applies to the page pData refers to on entry to ** this routine. ** ** References to the page refered to by pData remain valid. Updating any ** meta-data associated with page pData (i.e. data stored in the nExtra bytes ** allocated along with the page) is the responsibility of the caller. ** ** A transaction must be active when this routine is called. It used to be ** required that a statement transaction was not active, but this restriction ** has been removed (CREATE INDEX needs to move a page when a statement ** transaction is active). */ int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){ PgHdr *pPg = DATA_TO_PGHDR(pData); PgHdr *pPgOld; int h; Pgno needSyncPgno = 0; assert( pPg->nRef>0 ); TRACE5("MOVE %d page %d (needSync=%d) moves to %d\n", PAGERID(pPager), pPg->pgno, pPg->needSync, pgno); if( pPg->needSync ){ needSyncPgno = pPg->pgno; |
︙ | ︙ |
Changes to SQLite.Interop/src/pager.h.
︙ | ︙ | |||
9 10 11 12 13 14 15 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the sqlite page cache ** subsystem. The page cache subsystem reads and writes a file a page ** at a time and provides a journal for rollback. ** | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the sqlite page cache ** subsystem. The page cache subsystem reads and writes a file a page ** at a time and provides a journal for rollback. ** ** @(#) $Id: pager.h,v 1.2 2005/03/11 15:03:30 rmsimpson Exp $ */ /* ** The default size of a database page. */ #ifndef SQLITE_DEFAULT_PAGE_SIZE # define SQLITE_DEFAULT_PAGE_SIZE 1024 |
︙ | ︙ |
Changes to SQLite.Interop/src/parse.c.
︙ | ︙ | |||
171 172 173 174 175 176 177 | ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. */ static const YYACTIONTYPE yy_action[] = { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 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 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 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 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 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 | ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. */ static const YYACTIONTYPE yy_action[] = { /* 0 */ 263, 9, 261, 154, 124, 126, 128, 130, 132, 134, /* 10 */ 136, 138, 140, 142, 3, 562, 145, 641, 83, 369, /* 20 */ 144, 114, 116, 112, 118, 286, 124, 126, 128, 130, /* 30 */ 132, 134, 136, 138, 140, 142, 136, 138, 140, 142, /* 40 */ 110, 94, 146, 157, 162, 167, 156, 161, 120, 122, /* 50 */ 114, 116, 112, 118, 567, 124, 126, 128, 130, 132, /* 60 */ 134, 136, 138, 140, 142, 7, 223, 407, 262, 124, /* 70 */ 126, 128, 130, 132, 134, 136, 138, 140, 142, 399, /* 80 */ 309, 145, 870, 1, 563, 144, 398, 4, 371, 92, /* 90 */ 435, 373, 380, 385, 132, 134, 136, 138, 140, 142, /* 100 */ 279, 10, 415, 388, 410, 110, 94, 146, 157, 162, /* 110 */ 167, 156, 161, 120, 122, 114, 116, 112, 118, 96, /* 120 */ 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, /* 130 */ 145, 574, 77, 13, 144, 152, 222, 163, 168, 75, /* 140 */ 44, 45, 367, 176, 280, 258, 839, 28, 13, 281, /* 150 */ 402, 33, 233, 13, 110, 94, 146, 157, 162, 167, /* 160 */ 156, 161, 120, 122, 114, 116, 112, 118, 572, 124, /* 170 */ 126, 128, 130, 132, 134, 136, 138, 140, 142, 421, /* 180 */ 371, 298, 720, 373, 380, 385, 107, 106, 108, 107, /* 190 */ 106, 108, 169, 217, 295, 388, 13, 575, 471, 14, /* 200 */ 15, 371, 175, 145, 373, 380, 385, 144, 2, 343, /* 210 */ 346, 4, 292, 13, 14, 15, 388, 423, 345, 14, /* 220 */ 15, 345, 95, 261, 12, 95, 802, 110, 94, 146, /* 230 */ 157, 162, 167, 156, 161, 120, 122, 114, 116, 112, /* 240 */ 118, 51, 124, 126, 128, 130, 132, 134, 136, 138, /* 250 */ 140, 142, 36, 340, 800, 101, 102, 103, 101, 102, /* 260 */ 103, 335, 14, 15, 847, 152, 188, 163, 168, 37, /* 270 */ 341, 40, 59, 67, 69, 305, 336, 145, 265, 14, /* 280 */ 15, 144, 171, 338, 173, 174, 351, 356, 357, 262, /* 290 */ 171, 34, 173, 174, 366, 349, 51, 72, 460, 244, /* 300 */ 197, 110, 94, 146, 157, 162, 167, 156, 161, 120, /* 310 */ 122, 114, 116, 112, 118, 288, 124, 126, 128, 130, /* 320 */ 132, 134, 136, 138, 140, 142, 40, 59, 67, 69, /* 330 */ 305, 336, 152, 13, 163, 168, 248, 258, 338, 96, /* 340 */ 96, 145, 16, 17, 18, 144, 687, 170, 358, 6, /* 350 */ 5, 494, 466, 456, 171, 25, 173, 174, 20, 75, /* 360 */ 75, 507, 81, 176, 176, 110, 94, 146, 157, 162, /* 370 */ 167, 156, 161, 120, 122, 114, 116, 112, 118, 77, /* 380 */ 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, /* 390 */ 364, 362, 596, 77, 623, 367, 327, 48, 297, 14, /* 400 */ 15, 243, 213, 32, 33, 96, 49, 688, 96, 250, /* 410 */ 534, 96, 278, 217, 217, 145, 13, 50, 518, 144, /* 420 */ 46, 52, 354, 356, 357, 75, 368, 401, 75, 190, /* 430 */ 47, 75, 235, 54, 171, 235, 173, 174, 211, 110, /* 440 */ 94, 146, 157, 162, 167, 156, 161, 120, 122, 114, /* 450 */ 116, 112, 118, 387, 124, 126, 128, 130, 132, 134, /* 460 */ 136, 138, 140, 142, 303, 13, 48, 227, 236, 13, /* 470 */ 96, 229, 96, 64, 294, 49, 191, 252, 293, 406, /* 480 */ 96, 145, 14, 15, 358, 144, 50, 78, 564, 201, /* 490 */ 75, 580, 75, 801, 176, 588, 493, 3, 562, 152, /* 500 */ 75, 163, 168, 251, 296, 110, 94, 146, 157, 162, /* 510 */ 167, 156, 161, 120, 122, 114, 116, 112, 118, 77, /* 520 */ 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, /* 530 */ 660, 14, 15, 96, 81, 14, 15, 817, 489, 96, /* 540 */ 310, 39, 250, 263, 216, 261, 145, 487, 533, 335, /* 550 */ 144, 442, 350, 75, 13, 453, 261, 302, 253, 75, /* 560 */ 852, 397, 255, 493, 535, 536, 573, 499, 850, 11, /* 570 */ 110, 94, 146, 157, 162, 167, 156, 161, 120, 122, /* 580 */ 114, 116, 112, 118, 845, 124, 126, 128, 130, 132, /* 590 */ 134, 136, 138, 140, 142, 65, 662, 171, 312, 173, /* 600 */ 174, 66, 505, 338, 501, 525, 866, 57, 58, 42, /* 610 */ 252, 262, 195, 145, 207, 172, 441, 144, 665, 455, /* 620 */ 14, 15, 262, 13, 640, 358, 31, 726, 313, 320, /* 630 */ 322, 421, 171, 844, 173, 174, 251, 110, 94, 146, /* 640 */ 157, 162, 167, 156, 161, 120, 122, 114, 116, 112, /* 650 */ 118, 77, 124, 126, 128, 130, 132, 134, 136, 138, /* 660 */ 140, 142, 171, 96, 173, 174, 432, 434, 433, 500, /* 670 */ 171, 318, 173, 174, 581, 96, 479, 27, 145, 403, /* 680 */ 310, 824, 144, 75, 455, 22, 503, 91, 246, 14, /* 690 */ 15, 319, 461, 452, 537, 75, 582, 463, 171, 93, /* 700 */ 173, 174, 110, 94, 146, 157, 162, 167, 156, 161, /* 710 */ 120, 122, 114, 116, 112, 118, 77, 124, 126, 128, /* 720 */ 130, 132, 134, 136, 138, 140, 142, 265, 96, 171, /* 730 */ 96, 173, 174, 331, 810, 96, 96, 214, 312, 215, /* 740 */ 275, 479, 272, 145, 273, 532, 315, 144, 75, 299, /* 750 */ 75, 215, 109, 348, 111, 75, 75, 465, 426, 113, /* 760 */ 115, 342, 463, 265, 266, 187, 325, 110, 165, 146, /* 770 */ 157, 162, 167, 156, 161, 120, 122, 114, 116, 112, /* 780 */ 118, 247, 124, 126, 128, 130, 132, 134, 136, 138, /* 790 */ 140, 142, 26, 96, 96, 96, 96, 77, 271, 159, /* 800 */ 283, 96, 96, 96, 96, 326, 275, 327, 145, 332, /* 810 */ 364, 362, 144, 75, 75, 75, 75, 117, 119, 121, /* 820 */ 123, 75, 75, 75, 75, 125, 127, 129, 131, 158, /* 830 */ 317, 316, 24, 94, 146, 157, 162, 167, 156, 161, /* 840 */ 120, 122, 114, 116, 112, 118, 96, 124, 126, 128, /* 850 */ 130, 132, 134, 136, 138, 140, 142, 96, 331, 96, /* 860 */ 96, 331, 96, 331, 436, 96, 75, 96, 96, 273, /* 870 */ 133, 360, 361, 96, 145, 96, 583, 75, 144, 75, /* 880 */ 75, 135, 75, 137, 139, 75, 141, 75, 75, 143, /* 890 */ 689, 153, 155, 75, 376, 75, 382, 164, 331, 166, /* 900 */ 146, 157, 162, 167, 156, 161, 120, 122, 114, 116, /* 910 */ 112, 118, 261, 124, 126, 128, 130, 132, 134, 136, /* 920 */ 138, 140, 142, 76, 96, 96, 438, 71, 457, 437, /* 930 */ 96, 391, 29, 96, 328, 96, 96, 332, 352, 332, /* 940 */ 353, 439, 148, 689, 75, 75, 147, 840, 178, 180, /* 950 */ 75, 199, 96, 75, 182, 75, 75, 184, 652, 196, /* 960 */ 198, 107, 106, 108, 383, 720, 327, 177, 404, 860, /* 970 */ 150, 151, 75, 30, 332, 96, 208, 392, 262, 327, /* 980 */ 430, 431, 476, 219, 183, 181, 300, 96, 96, 587, /* 990 */ 96, 654, 179, 73, 74, 75, 96, 95, 149, 210, /* 1000 */ 77, 96, 290, 96, 96, 331, 546, 75, 75, 76, /* 1010 */ 75, 212, 224, 71, 240, 689, 75, 548, 414, 96, /* 1020 */ 245, 75, 75, 75, 75, 277, 287, 386, 427, 219, /* 1030 */ 101, 102, 103, 104, 105, 185, 189, 199, 449, 75, /* 1040 */ 96, 275, 96, 474, 450, 470, 327, 107, 106, 108, /* 1050 */ 77, 219, 42, 177, 458, 45, 484, 486, 273, 492, /* 1060 */ 75, 490, 75, 476, 478, 522, 491, 35, 421, 421, /* 1070 */ 183, 181, 421, 421, 421, 421, 421, 81, 179, 73, /* 1080 */ 74, 332, 244, 95, 526, 38, 490, 42, 41, 77, /* 1090 */ 523, 43, 53, 56, 55, 60, 64, 77, 70, 483, /* 1100 */ 61, 76, 81, 62, 63, 71, 502, 504, 68, 597, /* 1110 */ 506, 510, 514, 520, 558, 598, 101, 102, 103, 104, /* 1120 */ 105, 185, 189, 79, 81, 80, 516, 244, 241, 199, /* 1130 */ 82, 84, 239, 225, 85, 90, 97, 86, 98, 107, /* 1140 */ 106, 108, 87, 89, 88, 177, 99, 100, 142, 160, /* 1150 */ 218, 186, 666, 667, 668, 194, 209, 200, 203, 202, /* 1160 */ 206, 205, 183, 181, 204, 192, 220, 193, 221, 219, /* 1170 */ 179, 73, 74, 228, 232, 95, 226, 230, 231, 233, /* 1180 */ 234, 237, 215, 257, 242, 238, 249, 276, 260, 267, /* 1190 */ 254, 256, 259, 76, 264, 269, 268, 71, 270, 284, /* 1200 */ 274, 282, 291, 301, 285, 306, 304, 324, 101, 102, /* 1210 */ 103, 104, 105, 185, 189, 803, 311, 355, 307, 374, /* 1220 */ 375, 199, 308, 309, 359, 337, 314, 321, 329, 330, /* 1230 */ 363, 107, 106, 108, 333, 323, 372, 177, 344, 334, /* 1240 */ 347, 365, 378, 379, 381, 339, 389, 377, 384, 390, /* 1250 */ 393, 400, 394, 370, 183, 181, 289, 395, 408, 396, /* 1260 */ 54, 409, 179, 73, 74, 411, 412, 95, 413, 416, /* 1270 */ 417, 420, 422, 428, 832, 429, 440, 837, 838, 76, /* 1280 */ 443, 444, 445, 71, 446, 451, 448, 808, 809, 459, /* 1290 */ 418, 454, 447, 727, 728, 831, 462, 464, 846, 457, /* 1300 */ 101, 102, 103, 104, 105, 185, 189, 199, 467, 468, /* 1310 */ 469, 475, 419, 472, 424, 473, 848, 107, 106, 108, /* 1320 */ 477, 425, 480, 177, 482, 485, 488, 481, 849, 495, /* 1330 */ 851, 659, 496, 661, 497, 816, 858, 511, 509, 719, /* 1340 */ 183, 181, 722, 513, 515, 517, 725, 521, 179, 73, /* 1350 */ 74, 519, 528, 95, 524, 818, 530, 819, 531, 820, /* 1360 */ 8, 821, 822, 538, 539, 19, 21, 23, 405, 823, /* 1370 */ 549, 542, 859, 544, 861, 543, 862, 547, 552, 540, /* 1380 */ 541, 865, 545, 551, 555, 550, 101, 102, 103, 104, /* 1390 */ 105, 185, 189, 554, 867, 557, 560, 559, 529, 561, /* 1400 */ 460, 868, 545, 545, 545, 527, 545, 553, 545, 545, /* 1410 */ 545, 545, 556, 545, 545, 545, 545, 545, 545, 545, /* 1420 */ 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, /* 1430 */ 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, /* 1440 */ 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, /* 1450 */ 545, 545, 545, 508, 512, 456, 545, 545, 545, 498, /* 1460 */ 545, 545, 545, 545, 81, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 24, 148, 26, 78, 79, 80, 81, 82, 83, 84, /* 10 */ 85, 86, 87, 88, 9, 10, 40, 23, 192, 25, /* 20 */ 44, 74, 75, 76, 77, 199, 79, 80, 81, 82, /* 30 */ 83, 84, 85, 86, 87, 88, 85, 86, 87, 88, /* 40 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, /* 50 */ 74, 75, 76, 77, 9, 79, 80, 81, 82, 83, /* 60 */ 84, 85, 86, 87, 88, 9, 25, 20, 92, 79, /* 70 */ 80, 81, 82, 83, 84, 85, 86, 87, 88, 177, /* 80 */ 178, 40, 142, 143, 144, 44, 184, 147, 94, 48, /* 90 */ 47, 97, 98, 99, 83, 84, 85, 86, 87, 88, /* 100 */ 157, 149, 55, 109, 57, 64, 65, 66, 67, 68, /* 110 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 150, /* 120 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, /* 130 */ 40, 9, 189, 26, 44, 217, 218, 219, 220, 170, /* 140 */ 186, 187, 150, 174, 201, 202, 103, 155, 26, 206, /* 150 */ 158, 159, 26, 26, 64, 65, 66, 67, 68, 69, /* 160 */ 70, 71, 72, 73, 74, 75, 76, 77, 9, 79, /* 170 */ 80, 81, 82, 83, 84, 85, 86, 87, 88, 150, /* 180 */ 94, 212, 9, 97, 98, 99, 60, 61, 62, 60, /* 190 */ 61, 62, 22, 224, 23, 109, 26, 9, 25, 92, /* 200 */ 93, 94, 23, 40, 97, 98, 99, 44, 144, 83, /* 210 */ 84, 147, 85, 26, 92, 93, 109, 188, 92, 92, /* 220 */ 93, 92, 96, 26, 150, 96, 136, 64, 65, 66, /* 230 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* 240 */ 77, 66, 79, 80, 81, 82, 83, 84, 85, 86, /* 250 */ 87, 88, 168, 169, 17, 129, 130, 131, 129, 130, /* 260 */ 131, 177, 92, 93, 17, 217, 23, 219, 220, 94, /* 270 */ 95, 96, 97, 98, 99, 100, 101, 40, 163, 92, /* 280 */ 93, 44, 111, 108, 113, 114, 165, 166, 167, 92, /* 290 */ 111, 160, 113, 114, 163, 164, 66, 22, 51, 126, /* 300 */ 137, 64, 65, 66, 67, 68, 69, 70, 71, 72, /* 310 */ 73, 74, 75, 76, 77, 200, 79, 80, 81, 82, /* 320 */ 83, 84, 85, 86, 87, 88, 96, 97, 98, 99, /* 330 */ 100, 101, 217, 26, 219, 220, 201, 202, 108, 150, /* 340 */ 150, 40, 13, 14, 15, 44, 23, 157, 227, 145, /* 350 */ 146, 104, 105, 106, 111, 151, 113, 114, 149, 170, /* 360 */ 170, 157, 115, 174, 174, 64, 65, 66, 67, 68, /* 370 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 189, /* 380 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, /* 390 */ 83, 84, 117, 189, 23, 150, 25, 18, 23, 92, /* 400 */ 93, 212, 212, 158, 159, 150, 27, 23, 150, 25, /* 410 */ 103, 150, 22, 224, 224, 40, 26, 38, 214, 44, /* 420 */ 41, 96, 165, 166, 167, 170, 181, 182, 170, 174, /* 430 */ 51, 170, 174, 108, 111, 174, 113, 114, 137, 64, /* 440 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, /* 450 */ 75, 76, 77, 171, 79, 80, 81, 82, 83, 84, /* 460 */ 85, 86, 87, 88, 23, 26, 18, 209, 210, 26, /* 470 */ 150, 210, 150, 102, 112, 27, 221, 93, 116, 153, /* 480 */ 150, 40, 92, 93, 227, 44, 38, 157, 0, 41, /* 490 */ 170, 9, 170, 17, 174, 9, 174, 9, 10, 217, /* 500 */ 170, 219, 220, 119, 174, 64, 65, 66, 67, 68, /* 510 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 189, /* 520 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, /* 530 */ 9, 92, 93, 150, 115, 92, 93, 9, 216, 150, /* 540 */ 45, 169, 25, 24, 224, 26, 40, 128, 150, 177, /* 550 */ 44, 225, 22, 170, 26, 229, 26, 174, 119, 170, /* 560 */ 9, 66, 119, 174, 166, 167, 9, 20, 9, 12, /* 570 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, /* 580 */ 74, 75, 76, 77, 11, 79, 80, 81, 82, 83, /* 590 */ 84, 85, 86, 87, 88, 29, 9, 111, 103, 113, /* 600 */ 114, 35, 55, 108, 57, 216, 9, 13, 14, 103, /* 610 */ 93, 92, 136, 40, 138, 112, 21, 44, 115, 157, /* 620 */ 92, 93, 92, 26, 23, 227, 25, 9, 104, 105, /* 630 */ 106, 150, 111, 11, 113, 114, 119, 64, 65, 66, /* 640 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* 650 */ 77, 189, 79, 80, 81, 82, 83, 84, 85, 86, /* 660 */ 87, 88, 111, 150, 113, 114, 104, 105, 106, 188, /* 670 */ 111, 32, 113, 114, 9, 150, 214, 22, 40, 24, /* 680 */ 45, 9, 44, 170, 157, 149, 139, 174, 25, 92, /* 690 */ 93, 52, 230, 98, 22, 170, 9, 235, 111, 174, /* 700 */ 113, 114, 64, 65, 66, 67, 68, 69, 70, 71, /* 710 */ 72, 73, 74, 75, 76, 77, 189, 79, 80, 81, /* 720 */ 82, 83, 84, 85, 86, 87, 88, 163, 150, 111, /* 730 */ 150, 113, 114, 150, 139, 150, 150, 23, 103, 25, /* 740 */ 150, 214, 23, 40, 25, 73, 107, 44, 170, 23, /* 750 */ 170, 25, 174, 162, 174, 170, 170, 230, 136, 174, /* 760 */ 174, 170, 235, 163, 200, 157, 183, 64, 65, 66, /* 770 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* 780 */ 77, 118, 79, 80, 81, 82, 83, 84, 85, 86, /* 790 */ 87, 88, 152, 150, 150, 150, 150, 189, 208, 66, /* 800 */ 200, 150, 150, 150, 150, 23, 150, 25, 40, 226, /* 810 */ 83, 84, 44, 170, 170, 170, 170, 174, 174, 174, /* 820 */ 174, 170, 170, 170, 170, 174, 174, 174, 174, 96, /* 830 */ 95, 96, 149, 65, 66, 67, 68, 69, 70, 71, /* 840 */ 72, 73, 74, 75, 76, 77, 150, 79, 80, 81, /* 850 */ 82, 83, 84, 85, 86, 87, 88, 150, 150, 150, /* 860 */ 150, 150, 150, 150, 208, 150, 170, 150, 150, 25, /* 870 */ 174, 129, 130, 150, 40, 150, 9, 170, 44, 170, /* 880 */ 170, 174, 170, 174, 174, 170, 174, 170, 170, 174, /* 890 */ 24, 174, 174, 170, 183, 170, 183, 174, 150, 174, /* 900 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, /* 910 */ 76, 77, 26, 79, 80, 81, 82, 83, 84, 85, /* 920 */ 86, 87, 88, 22, 150, 150, 28, 26, 64, 31, /* 930 */ 150, 183, 156, 150, 226, 150, 150, 226, 23, 226, /* 940 */ 25, 43, 40, 9, 170, 170, 44, 103, 174, 174, /* 950 */ 170, 50, 150, 170, 174, 170, 170, 174, 9, 174, /* 960 */ 174, 60, 61, 62, 23, 9, 25, 66, 157, 9, /* 970 */ 68, 69, 170, 23, 226, 150, 174, 23, 92, 25, /* 980 */ 53, 54, 150, 117, 83, 84, 85, 150, 150, 9, /* 990 */ 150, 127, 91, 92, 93, 170, 150, 96, 96, 174, /* 1000 */ 189, 150, 150, 150, 150, 150, 46, 170, 170, 22, /* 1010 */ 170, 174, 174, 26, 174, 103, 170, 131, 157, 150, /* 1020 */ 174, 170, 170, 170, 170, 174, 174, 174, 174, 117, /* 1030 */ 129, 130, 131, 132, 133, 134, 135, 50, 183, 170, /* 1040 */ 150, 150, 150, 174, 23, 213, 25, 60, 61, 62, /* 1050 */ 189, 117, 103, 66, 186, 187, 23, 157, 25, 23, /* 1060 */ 170, 25, 170, 150, 174, 157, 174, 161, 150, 150, /* 1070 */ 83, 84, 150, 150, 150, 150, 150, 115, 91, 92, /* 1080 */ 93, 226, 126, 96, 23, 150, 25, 103, 171, 189, /* 1090 */ 128, 33, 171, 42, 180, 46, 102, 189, 22, 208, /* 1100 */ 172, 22, 115, 171, 173, 26, 188, 188, 171, 117, /* 1110 */ 188, 188, 188, 188, 188, 117, 129, 130, 131, 132, /* 1120 */ 133, 134, 135, 190, 115, 189, 213, 126, 123, 50, /* 1130 */ 191, 193, 124, 121, 194, 125, 117, 195, 150, 60, /* 1140 */ 61, 62, 196, 198, 197, 66, 117, 150, 88, 96, /* 1150 */ 150, 22, 115, 115, 115, 17, 136, 22, 187, 23, /* 1160 */ 23, 150, 83, 84, 25, 222, 150, 223, 154, 117, /* 1170 */ 91, 92, 93, 25, 101, 96, 122, 211, 172, 26, /* 1180 */ 162, 211, 25, 119, 122, 172, 203, 103, 154, 204, /* 1190 */ 150, 150, 150, 22, 150, 120, 205, 26, 22, 204, /* 1200 */ 150, 23, 117, 23, 205, 150, 171, 22, 129, 130, /* 1210 */ 131, 132, 133, 134, 135, 136, 150, 23, 175, 46, /* 1220 */ 22, 50, 176, 178, 228, 162, 179, 179, 211, 172, /* 1230 */ 228, 60, 61, 62, 211, 179, 150, 66, 170, 172, /* 1240 */ 170, 163, 23, 171, 22, 180, 46, 173, 171, 22, /* 1250 */ 100, 182, 150, 182, 83, 84, 85, 175, 150, 176, /* 1260 */ 108, 154, 91, 92, 93, 150, 154, 96, 24, 150, /* 1270 */ 154, 103, 154, 39, 11, 37, 47, 103, 103, 22, /* 1280 */ 139, 150, 154, 26, 103, 171, 22, 9, 139, 185, /* 1290 */ 231, 11, 150, 127, 127, 9, 17, 9, 17, 64, /* 1300 */ 129, 130, 131, 132, 133, 134, 135, 50, 185, 150, /* 1310 */ 107, 194, 232, 150, 233, 73, 9, 60, 61, 62, /* 1320 */ 73, 234, 127, 66, 22, 215, 22, 150, 9, 118, /* 1330 */ 9, 9, 150, 9, 194, 9, 9, 194, 118, 9, /* 1340 */ 83, 84, 9, 185, 107, 194, 9, 215, 91, 92, /* 1350 */ 93, 127, 150, 96, 22, 9, 150, 9, 154, 9, /* 1360 */ 11, 9, 9, 150, 23, 16, 17, 18, 19, 9, /* 1370 */ 34, 163, 9, 150, 9, 24, 9, 163, 150, 30, /* 1380 */ 236, 9, 237, 236, 154, 36, 129, 130, 131, 132, /* 1390 */ 133, 134, 135, 150, 9, 20, 140, 59, 49, 150, /* 1400 */ 51, 9, 238, 238, 238, 56, 238, 58, 238, 238, /* 1410 */ 238, 238, 63, 238, 238, 238, 238, 238, 238, 238, /* 1420 */ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, /* 1430 */ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, /* 1440 */ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, /* 1450 */ 238, 238, 238, 104, 105, 106, 238, 238, 238, 110, /* 1460 */ 238, 238, 238, 238, 115, }; #define YY_SHIFT_USE_DFLT (-76) static const short yy_shift_ofst[] = { /* 0 */ 5, 488, -76, -76, 1349, 45, 56, -76, 329, 557, /* 10 */ 159, 122, 188, -76, -76, -76, -76, -76, -76, 557, /* 20 */ 482, 557, 665, 557, 687, 655, 867, 187, 601, 950, /* 30 */ 980, 107, -76, 197, -76, 175, -76, 187, 230, -76, /* 40 */ 984, -76, 1058, 379, -76, -76, -76, -76, -76, -76, /* 50 */ -76, 325, 984, -76, 1051, -76, 594, -76, -76, 1049, /* 60 */ 566, 984, 994, -76, -76, -76, -76, 984, -76, 1076, /* 70 */ 1257, 275, 901, 992, 998, -76, 987, -76, 171, 1009, /* 80 */ -76, 362, -76, 663, 1001, 1005, 1008, 1012, 1010, -76, /* 90 */ 1257, 41, 1257, 638, 1257, -76, 1019, 187, 1029, 187, /* 100 */ -76, -76, -76, -76, -76, -76, -76, -76, -76, 834, /* 110 */ 1257, 768, 1257, -10, 1257, -10, 1257, -10, 1257, -10, /* 120 */ 1257, -53, 1257, -53, 1257, 11, 1257, 11, 1257, 11, /* 130 */ 1257, 11, 1257, -49, 1257, -49, 1257, 1060, 1257, 1060, /* 140 */ 1257, 1060, 1257, -76, -76, -76, 902, -76, -76, -76, /* 150 */ -76, -76, 1257, -75, 1257, -10, -76, 733, -76, 1053, /* 160 */ -76, -76, -76, 1257, 703, 1257, -53, -76, 170, 987, /* 170 */ 179, 503, 1037, 1038, 1039, -76, 638, 1257, 834, 1257, /* 180 */ -76, 1257, -76, 1257, -76, 1129, 1009, 243, -76, 1079, /* 190 */ 90, 1020, 476, 1138, -76, 1257, 163, 1257, 638, 1135, /* 200 */ 448, 1136, -76, 1139, 187, 1137, -76, 1257, 237, 1257, /* 210 */ 301, 1257, 638, 714, -76, 1257, -76, -76, 1052, 187, /* 220 */ -76, -76, -76, 1257, 638, 1054, 1257, 1148, 1257, 1073, /* 230 */ 566, -76, 1153, -76, -76, 638, 1073, 566, -76, 1257, /* 240 */ 638, 1062, 1257, 1157, 1257, 638, -76, -76, 517, -76, /* 250 */ -76, -76, 439, -76, 443, -76, 1064, -76, 390, 1052, /* 260 */ 519, -76, -76, 187, -76, -76, 1084, 1075, -76, 1176, /* 270 */ 187, 719, -76, 187, -76, -76, 1257, 638, 1009, 323, /* 280 */ 384, 1178, 519, 1084, 1075, -76, 1171, -24, -76, -76, /* 290 */ 1085, 127, -76, -76, -76, -76, 375, -76, 726, -76, /* 300 */ 1180, -76, 441, 984, -76, 187, 1185, -76, 635, -76, /* 310 */ 187, -76, 524, 639, -76, 735, -76, -76, -76, -76, /* 320 */ 639, -76, 639, -76, 187, 782, -76, 187, 1073, 566, /* 330 */ -76, -76, 1073, 566, -76, -76, 1153, -76, 1051, -76, /* 340 */ -76, 126, -76, 129, -76, -76, 129, -76, -76, 530, /* 350 */ 727, 915, -76, 727, 1194, -76, -76, -76, 742, -76, /* 360 */ -76, -76, 742, -76, -76, -76, -76, -76, -6, 86, /* 370 */ -76, 187, -76, 1173, 1198, 187, 371, 1219, 984, -76, /* 380 */ 1222, 187, 941, 984, -76, 1257, 506, -76, 1200, 1227, /* 390 */ 187, 954, 1150, 187, 1185, -76, 495, 1152, -76, -76, /* 400 */ -76, -76, -76, 1009, 486, 595, 47, 187, 1052, -76, /* 410 */ 187, 866, 1244, 1009, 521, 187, 1052, 898, 562, 1168, /* 420 */ 187, 1052, -76, 1234, 622, 1263, 1257, 573, 1238, 927, /* 430 */ -76, -76, 1174, 1175, 43, 187, 844, -76, -76, 1229, /* 440 */ -76, -76, 1141, 187, 912, 1181, 187, 1264, 187, 1021, /* 450 */ 949, 1278, 1149, 1280, 247, 551, 864, 379, -76, 1166, /* 460 */ 1167, 1279, 1286, 1288, 247, 1281, 1235, 187, 1203, 187, /* 470 */ 173, 187, 1242, 1257, 638, 1307, 1247, 1257, 638, 1195, /* 480 */ 187, 1302, 187, 1033, -76, 419, 559, 1304, 1257, 1036, /* 490 */ 1257, 638, 1319, 638, 1211, 187, 956, 1321, 547, 187, /* 500 */ 1322, 187, 1324, 187, 1326, 187, 1327, 587, 1220, 187, /* 510 */ 956, 1330, 1235, 187, 1237, 187, 173, 1333, 1224, 187, /* 520 */ 1302, 962, 618, 1332, 1257, 1061, 1337, 528, 1346, 187, /* 530 */ 1052, 672, 307, 1348, 1350, 1352, 1353, 187, 1341, 1360, /* 540 */ 1336, 197, 1351, 187, 960, 1363, 886, 1365, 1367, -76, /* 550 */ 1336, 187, 1372, 597, 934, 1385, 1375, 187, 1338, 1256, /* 560 */ 187, 1392, -76, -76, }; #define YY_REDUCE_USE_DFLT (-175) static const short yy_reduce_ofst[] = { /* 0 */ -60, 64, -175, -175, 204, -175, -175, -175, -147, -48, /* 10 */ -175, 74, -175, -175, -175, -175, -175, -175, -175, 209, /* 20 */ -175, 536, -175, 683, -175, 640, -175, -8, 776, -175, /* 30 */ -175, 245, -175, 131, 906, 84, -175, 935, 372, -175, /* 40 */ 917, -175, -175, -46, -175, -175, -175, -175, -175, -175, /* 50 */ -175, -175, 921, -175, 914, -175, -175, -175, -175, -175, /* 60 */ 928, 932, 931, -175, -175, -175, -175, 937, -175, -175, /* 70 */ 383, -175, -31, -175, -175, -175, 330, -175, 933, 936, /* 80 */ -175, 939, -174, 938, 940, 942, 946, 947, 945, -175, /* 90 */ 513, 48, 525, 48, 578, -175, -175, 988, -175, 997, /* 100 */ -175, -175, -175, -175, -175, -175, -175, -175, -175, 48, /* 110 */ 580, 48, 585, 48, 586, 48, 643, 48, 644, 48, /* 120 */ 645, 48, 646, 48, 651, 48, 652, 48, 653, 48, /* 130 */ 654, 48, 696, 48, 707, 48, 709, 48, 710, 48, /* 140 */ 712, 48, 715, 48, -175, -175, -175, -175, -175, -175, /* 150 */ -175, -175, 717, -82, 718, 48, -175, -175, -175, -175, /* 160 */ -175, -175, -175, 723, 48, 725, 48, -175, 1000, 190, /* 170 */ 933, -175, -175, -175, -175, -175, 48, 774, 48, 775, /* 180 */ 48, 780, 48, 783, 48, -175, 608, 933, -175, 255, /* 190 */ 48, 943, 944, -175, -175, 785, 48, 786, 48, -175, /* 200 */ 971, -175, -175, -175, 1011, -175, -175, 802, 48, 825, /* 210 */ 48, 837, 48, -175, -175, 320, -175, -175, 1014, 1016, /* 220 */ -175, -175, -175, 838, 48, -175, 258, -175, 261, 966, /* 230 */ 1006, -175, 1018, -175, -175, 48, 970, 1013, -175, 840, /* 240 */ 48, -175, 189, -175, 846, 48, -175, 135, 983, -175, /* 250 */ -175, -175, 1040, -175, 1041, -175, -175, -175, 1042, 1034, /* 260 */ 564, -175, -175, 1044, -175, -175, 985, 991, -175, -175, /* 270 */ 590, -175, -175, 1050, -175, -175, 851, 48, -57, 933, /* 280 */ 983, -175, 600, 995, 999, -175, 852, 115, -175, -175, /* 290 */ -175, 988, -175, -175, -175, -175, 48, -175, -175, -175, /* 300 */ -175, -175, 48, 1035, -175, 1055, 1043, 1046, 1045, -175, /* 310 */ 1066, -175, -175, 1047, -175, -175, -175, -175, -175, -175, /* 320 */ 1048, -175, 1056, -175, 583, -175, -175, 708, 1017, 1057, /* 330 */ -175, -175, 1023, 1067, -175, -175, 1063, -175, 1065, -175, /* 340 */ -175, 591, -175, 1068, -175, -175, 1070, -175, -175, 1078, /* 350 */ 121, -175, -175, 257, -175, -175, -175, -175, 996, -175, /* 360 */ -175, -175, 1002, -175, -175, -175, -175, -175, 1069, 1071, /* 370 */ -175, 1086, -175, -175, -175, 711, 1074, -175, 1072, -175, /* 380 */ -175, 713, -175, 1077, -175, 853, 282, -175, -175, -175, /* 390 */ 748, -175, -175, 1102, 1082, 1083, -98, -175, -175, -175, /* 400 */ -175, -175, -175, 811, 933, 326, -175, 1108, 1107, -175, /* 410 */ 1115, 1112, -175, 861, 933, 1119, 1116, 1059, 1080, -175, /* 420 */ 29, 1118, -175, 1081, 1087, -175, 854, 48, -175, -175, /* 430 */ -175, -175, -175, -175, -175, 656, -175, -175, -175, -175, /* 440 */ -175, -175, -175, 1131, 1128, -175, 1142, -175, 855, -175, /* 450 */ 1114, -175, -175, -175, 462, 933, 1104, 868, -175, -175, /* 460 */ -175, -175, -175, -175, 527, -175, 1123, 1159, -175, 832, /* 470 */ 1117, 1163, -175, 869, 48, -175, -175, 890, 48, -175, /* 480 */ 1177, 1110, 891, -175, -175, 900, 933, -175, 322, -175, /* 490 */ 892, 48, -175, 48, -175, 1182, 1140, -175, -175, 481, /* 500 */ -175, 918, -175, 919, -175, 922, -175, 933, -175, 923, /* 510 */ 1143, -175, 1158, 924, -175, 913, 1151, -175, -175, 925, /* 520 */ 1132, 908, 933, -175, 389, -175, -175, 1202, -175, 1206, /* 530 */ 1204, -175, 398, -175, -175, -175, -175, 1213, -175, -175, /* 540 */ 1144, 1208, -175, 1223, 1145, -175, 1214, -175, -175, -175, /* 550 */ 1147, 1228, -175, 1243, 1230, -175, -175, 926, -175, -175, /* 560 */ 1249, -175, -175, -175, }; static const YYACTIONTYPE yy_default[] = { /* 0 */ 570, 570, 565, 568, 869, 869, 869, 569, 576, 869, /* 10 */ 869, 869, 869, 596, 597, 598, 577, 578, 579, 869, /* 20 */ 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, /* 30 */ 869, 869, 589, 599, 608, 591, 607, 869, 869, 609, /* 40 */ 652, 615, 869, 869, 653, 656, 657, 658, 855, 856, |
︙ | ︙ | |||
1120 1121 1122 1123 1124 1125 1126 | /* 174 */ "expr ::= ID", /* 175 */ "expr ::= JOIN_KW", /* 176 */ "expr ::= nm DOT nm", /* 177 */ "expr ::= nm DOT nm DOT nm", /* 178 */ "term ::= INTEGER", /* 179 */ "term ::= FLOAT", /* 180 */ "term ::= STRING", | | | 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 | /* 174 */ "expr ::= ID", /* 175 */ "expr ::= JOIN_KW", /* 176 */ "expr ::= nm DOT nm", /* 177 */ "expr ::= nm DOT nm DOT nm", /* 178 */ "term ::= INTEGER", /* 179 */ "term ::= FLOAT", /* 180 */ "term ::= STRING", /* 181 */ "term ::= BLOB", /* 182 */ "expr ::= REGISTER", /* 183 */ "expr ::= VARIABLE", /* 184 */ "expr ::= ID LP exprlist RP", /* 185 */ "expr ::= ID LP STAR RP", /* 186 */ "term ::= CTIME", /* 187 */ "term ::= CDATE", /* 188 */ "term ::= CTIMESTAMP", |
︙ | ︙ | |||
1723 1724 1725 1726 1727 1728 1729 | { 174, 1 }, { 174, 1 }, { 174, 3 }, { 174, 5 }, { 170, 1 }, { 170, 1 }, { 170, 1 }, | | | 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 | { 174, 1 }, { 174, 1 }, { 174, 3 }, { 174, 5 }, { 170, 1 }, { 170, 1 }, { 170, 1 }, { 170, 1 }, { 174, 1 }, { 174, 1 }, { 174, 4 }, { 174, 4 }, { 170, 1 }, { 170, 1 }, { 170, 1 }, |
︙ | ︙ |
Changes to SQLite.Interop/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.2 2005/03/11 15:03:30 rmsimpson Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> /* Ignore this whole file if pragmas are disabled */ |
︙ | ︙ | |||
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | return 1; }else if( sqlite3StrICmp(z, "memory")==0 ){ return 2; }else{ return 0; } } /* ** Invalidate temp storage, either when the temp storage is changed ** from default, or when 'file' and the temp_store_directory has changed */ static int invalidateTempStorage(Parse *pParse){ sqlite3 *db = pParse->db; if( db->aDb[1].pBt!=0 ){ if( db->flags & SQLITE_InTrans ){ sqlite3ErrorMsg(pParse, "temporary storage cannot be changed " "from within a transaction"); return SQLITE_ERROR; } sqlite3BtreeClose(db->aDb[1].pBt); db->aDb[1].pBt = 0; sqlite3ResetInternalSchema(db, 0); } return SQLITE_OK; } /* ** If the TEMP database is open, close it and mark the database schema ** as needing reloading. This must be done when using the TEMP_STORE ** or DEFAULT_TEMP_STORE pragmas. */ static int changeTempStorage(Parse *pParse, const char *zStorageType){ int ts = getTempStore(zStorageType); sqlite3 *db = pParse->db; if( db->temp_store==ts ) return SQLITE_OK; if( invalidateTempStorage( pParse ) != SQLITE_OK ){ return SQLITE_ERROR; } db->temp_store = ts; return SQLITE_OK; } | > > > > | > | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | return 1; }else if( sqlite3StrICmp(z, "memory")==0 ){ return 2; }else{ return 0; } } #endif /* SQLITE_PAGER_PRAGMAS */ #ifndef SQLITE_OMIT_PAGER_PRAGMAS /* ** Invalidate temp storage, either when the temp storage is changed ** from default, or when 'file' and the temp_store_directory has changed */ static int invalidateTempStorage(Parse *pParse){ sqlite3 *db = pParse->db; if( db->aDb[1].pBt!=0 ){ if( db->flags & SQLITE_InTrans ){ sqlite3ErrorMsg(pParse, "temporary storage cannot be changed " "from within a transaction"); return SQLITE_ERROR; } sqlite3BtreeClose(db->aDb[1].pBt); db->aDb[1].pBt = 0; sqlite3ResetInternalSchema(db, 0); } return SQLITE_OK; } #endif /* SQLITE_PAGER_PRAGMAS */ #ifndef SQLITE_OMIT_PAGER_PRAGMAS /* ** If the TEMP database is open, close it and mark the database schema ** as needing reloading. This must be done when using the TEMP_STORE ** or DEFAULT_TEMP_STORE pragmas. */ static int changeTempStorage(Parse *pParse, const char *zStorageType){ int ts = getTempStore(zStorageType); sqlite3 *db = pParse->db; if( db->temp_store==ts ) return SQLITE_OK; if( invalidateTempStorage( pParse ) != SQLITE_OK ){ return SQLITE_ERROR; } db->temp_store = ts; return SQLITE_OK; } #endif /* SQLITE_PAGER_PRAGMAS */ /* ** Generate code to return a single integer value. */ static void returnSingleInt(Parse *pParse, const char *zLabel, int value){ Vdbe *v = sqlite3GetVdbe(pParse); sqlite3VdbeAddOp(v, OP_Integer, value, 0); if( pParse->explain==0 ){ sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeSetColName(v, 0, zLabel, P3_STATIC); } sqlite3VdbeAddOp(v, OP_Callback, 1, 0); } #ifndef SQLITE_OMIT_FLAG_PRAGMAS /* ** Check to see if zRight and zLeft refer to a pragma that queries ** or changes one of the flags in db->flags. Return 1 if so and 0 if not. ** Also, implement the pragma. */ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){ static const struct sPragmaType { |
︙ | ︙ | |||
173 174 175 176 177 178 179 180 181 182 183 184 185 186 | sqlite3VdbeAddOp(v, OP_Expire, 0, 0); } return 1; } } return 0; } /* ** Process a pragma statement. ** ** Pragmas are of this form: ** ** PRAGMA [database.]id [= value] | > | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | sqlite3VdbeAddOp(v, OP_Expire, 0, 0); } return 1; } } return 0; } #endif /* SQLITE_OMIT_FLAG_PRAGMAS */ /* ** Process a pragma statement. ** ** Pragmas are of this form: ** ** PRAGMA [database.]id [= value] |
︙ | ︙ | |||
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | pDb->safety_level = getSafetyLevel(zRight)+1; sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level); } } }else #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ if( flagPragma(pParse, zLeft, zRight) ){ /* The flagPragma() subroutine also generates any necessary code ** there is nothing more to do here */ }else #ifndef SQLITE_OMIT_SCHEMA_PRAGMAS /* ** PRAGMA table_info(<table>) ** ** Return a single row for each column of the named table. The columns of ** the returned data set are: | > > | 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | pDb->safety_level = getSafetyLevel(zRight)+1; sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level); } } }else #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ #ifndef SQLITE_OMIT_FLAG_PRAGMAS if( flagPragma(pParse, zLeft, zRight) ){ /* The flagPragma() subroutine also generates any necessary code ** there is nothing more to do here */ }else #endif /* SQLITE_OMIT_FLAG_PRAGMAS */ #ifndef SQLITE_OMIT_SCHEMA_PRAGMAS /* ** PRAGMA table_info(<table>) ** ** Return a single row for each column of the named table. The columns of ** the returned data set are: |
︙ | ︙ |
Changes to SQLite.Interop/src/random.c.
︙ | ︙ | |||
11 12 13 14 15 16 17 | ************************************************************************* ** This file contains code to implement a pseudo-random number ** generator (PRNG) for SQLite. ** ** Random numbers are used by some of the database backends in order ** to generate random integer keys for tables or random filenames. ** | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ************************************************************************* ** This file contains code to implement a pseudo-random number ** generator (PRNG) for SQLite. ** ** Random numbers are used by some of the database backends in order ** to generate random integer keys for tables or random filenames. ** ** $Id: random.c,v 1.2 2005/03/11 15:03:30 rmsimpson Exp $ */ #include "sqliteInt.h" #include "os.h" /* ** Get a single 8-bit random value from the RC4 PRNG. The Mutex |
︙ | ︙ |
Changes to SQLite.Interop/src/select.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** ** $Id: select.c,v 1.2 2005/03/11 15:03:30 rmsimpson Exp $ */ #include "sqliteInt.h" #include "../interop.h" /* ** Allocate a new Select structure and return a pointer to that ** structure. |
︙ | ︙ |
Changes to SQLite.Interop/src/shell.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** ** $Id: shell.c,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #include <stdlib.h> #include <string.h> #include <stdio.h> #include <assert.h> #include "sqlite3.h" #include <ctype.h> |
︙ | ︙ | |||
652 653 654 655 656 657 658 | struct callback_data *p = (struct callback_data *)pArg; if( nArg!=3 ) return 1; zTable = azArg[0]; zType = azArg[1]; zSql = azArg[2]; | | | 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 | struct callback_data *p = (struct callback_data *)pArg; if( nArg!=3 ) return 1; zTable = azArg[0]; zType = azArg[1]; zSql = azArg[2]; if( strcmp(zTable,"sqlite_sequence")!=0 ){ fprintf(p->out, "%s;\n", zSql); }else{ fprintf(p->out, "DELETE FROM sqlite_sequence;\n"); } if( strcmp(zType, "table")==0 ){ sqlite3_stmt *pTableInfo = 0; |
︙ | ︙ |
Changes to SQLite.Interop/src/sqlite3.h.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the SQLite library ** presents to client programs. ** | | | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the SQLite library ** presents to client programs. ** ** @(#) $Id: sqlite3.h,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ #include <stdarg.h> /* Needed for the definition of va_list */ /* ** Make sure we can call this stuff from C++. */ #ifdef __cplusplus extern "C" { #endif /* ** The version of the SQLite library. */ #ifdef SQLITE_VERSION # undef SQLITE_VERSION #endif #define SQLITE_VERSION "3.1.4" /* ** The format of the version string is "X.Y.Z<trailing string>", where ** X is the major version number, Y is the minor version number and Z ** is the release number. The trailing string is often "alpha" or "beta". ** For example "3.1.1beta". ** ** The SQLITE_VERSION_NUMBER is an integer with the value ** (X*100000 + Y*1000 + Z). For example, for version "3.1.1beta", ** SQLITE_VERSION_NUMBER is set to 3001001. To detect if they are using ** version 3.1.1 or greater at compile time, programs may use the test ** (SQLITE_VERSION_NUMBER>=3001001). */ #ifdef SQLITE_VERSION_NUMBER # undef SQLITE_VERSION_NUMBER #endif #define SQLITE_VERSION_NUMBER 3001004 /* ** The version string is also compiled into the library so that a program ** can check to make sure that the lib*.a file and the *.h file are from ** the same version. The sqlite3_libversion() function returns a pointer ** to the sqlite3_version variable - useful in DLLs which cannot access ** global variables. |
︙ | ︙ |
Changes to SQLite.Interop/src/sqliteInt.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /* ** 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. ** | | | 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. ** ** @(#) $Id: sqliteInt.h,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ /* ** These #defines should enable >2GB file support on Posix if the ** underlying operating system supports it. If the OS lacks |
︙ | ︙ | |||
801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 | ** gives a different answer at different times during statement processing ** then iTable is the address of a subroutine that computes the subquery. ** ** The Expr.pSelect field points to a SELECT statement. The SELECT might ** be the right operand of an IN operator. Or, if a scalar SELECT appears ** in an expression the opcode is TK_SELECT and Expr.pSelect is the only ** operand. */ struct Expr { u8 op; /* Operation performed by this node */ char affinity; /* The affinity of the column or 0 if not a column */ u8 iDb; /* Database referenced by this expression */ u8 flags; /* Various flags. See below */ CollSeq *pColl; /* The collation type of the column or 0 */ Expr *pLeft, *pRight; /* Left and right subnodes */ ExprList *pList; /* A list of expressions used as function arguments ** or in "<expr> IN (<expr-list)" */ Token token; /* An operand token */ Token span; /* Complete text of the expression */ int iTable, iColumn; /* When op==TK_COLUMN, then this expr node means the ** iColumn-th field of the iTable-th table. */ int iAgg; /* When op==TK_COLUMN and pParse->fillAgg==FALSE, pull ** result from the iAgg-th element of the aggregator */ int iAggCtx; /* The value to pass as P1 of OP_AggGet. */ Select *pSelect; /* When the expression is a sub-select. Also the ** right side of "<expr> IN (<select>)" */ }; /* ** The following are the meanings of bits in the Expr.flags field. */ #define EP_FromJoin 0x0001 /* Originated in ON or USING clause of a join */ #define EP_Agg 0x0002 /* Contains one or more aggregate functions */ | > > > > > | 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 | ** gives a different answer at different times during statement processing ** then iTable is the address of a subroutine that computes the subquery. ** ** The Expr.pSelect field points to a SELECT statement. The SELECT might ** be the right operand of an IN operator. Or, if a scalar SELECT appears ** in an expression the opcode is TK_SELECT and Expr.pSelect is the only ** operand. ** ** If the Expr is of type OP_Column, and the table it is selecting from ** is a disk table or the "old.*" pseudo-table, then pTab points to the ** corresponding table definition. */ struct Expr { u8 op; /* Operation performed by this node */ char affinity; /* The affinity of the column or 0 if not a column */ u8 iDb; /* Database referenced by this expression */ u8 flags; /* Various flags. See below */ CollSeq *pColl; /* The collation type of the column or 0 */ Expr *pLeft, *pRight; /* Left and right subnodes */ ExprList *pList; /* A list of expressions used as function arguments ** or in "<expr> IN (<expr-list)" */ Token token; /* An operand token */ Token span; /* Complete text of the expression */ int iTable, iColumn; /* When op==TK_COLUMN, then this expr node means the ** iColumn-th field of the iTable-th table. */ int iAgg; /* When op==TK_COLUMN and pParse->fillAgg==FALSE, pull ** result from the iAgg-th element of the aggregator */ int iAggCtx; /* The value to pass as P1 of OP_AggGet. */ Select *pSelect; /* When the expression is a sub-select. Also the ** right side of "<expr> IN (<select>)" */ Table *pTab; /* Table for OP_Column expressions. */ }; /* ** The following are the meanings of bits in the Expr.flags field. */ #define EP_FromJoin 0x0001 /* Originated in ON or USING clause of a join */ #define EP_Agg 0x0002 /* Contains one or more aggregate functions */ |
︙ | ︙ | |||
1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 | const void *sqlite3ValueText(sqlite3_value*, u8); int sqlite3ValueBytes(sqlite3_value*, u8); void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*)); void sqlite3ValueFree(sqlite3_value*); sqlite3_value *sqlite3ValueNew(); sqlite3_value *sqlite3GetTransientValue(sqlite3*db); extern const unsigned char sqlite3UpperToLower[]; void sqlite3RootPageMoved(Db*, int, int); void sqlite3Reindex(Parse*, Token*, Token*); void sqlite3AlterFunctions(sqlite3*); void sqlite3AlterRenameTable(Parse*, SrcList*, Token*); int sqlite3GetToken(const unsigned char *, int *); void sqlite3NestedParse(Parse*, const char*, ...); void sqlite3ExpirePreparedStatements(sqlite3*); void sqlite3CodeSubselect(Parse *, Expr *); int sqlite3SelectResolve(Parse *, Select *, NameContext *); #endif | > > > | 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 | const void *sqlite3ValueText(sqlite3_value*, u8); int sqlite3ValueBytes(sqlite3_value*, u8); void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*)); void sqlite3ValueFree(sqlite3_value*); sqlite3_value *sqlite3ValueNew(); sqlite3_value *sqlite3GetTransientValue(sqlite3*db); int sqlite3ValueFromExpr(Expr *, u8, u8, sqlite3_value **); void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8); extern const unsigned char sqlite3UpperToLower[]; void sqlite3RootPageMoved(Db*, int, int); void sqlite3Reindex(Parse*, Token*, Token*); void sqlite3AlterFunctions(sqlite3*); void sqlite3AlterRenameTable(Parse*, SrcList*, Token*); int sqlite3GetToken(const unsigned char *, int *); void sqlite3NestedParse(Parse*, const char*, ...); void sqlite3ExpirePreparedStatements(sqlite3*); void sqlite3CodeSubselect(Parse *, Expr *); int sqlite3SelectResolve(Parse *, Select *, NameContext *); void sqlite3ColumnDefault(Vdbe *, Table *, int); #endif |
Changes to SQLite.Interop/src/tclsqlite.c.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /* ** 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. ** ************************************************************************* ** A TCL Interface to SQLite ** | | | 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. ** ************************************************************************* ** A TCL Interface to SQLite ** ** $Id: tclsqlite.c,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ #include "sqliteInt.h" #include "hash.h" #include "tcl.h" #include <stdlib.h> |
︙ | ︙ | |||
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 | /* $db complete SQL ** ** Return TRUE if SQL is a complete SQL statement. Return FALSE if ** additional lines of input are needed. This is similar to the ** built-in "info complete" command of Tcl. */ case DB_COMPLETE: { Tcl_Obj *pResult; int isComplete; if( objc!=3 ){ Tcl_WrongNumArgs(interp, 2, objv, "SQL"); return TCL_ERROR; } isComplete = sqlite3_complete( Tcl_GetStringFromObj(objv[2], 0) ); pResult = Tcl_GetObjResult(interp); Tcl_SetBooleanObj(pResult, isComplete); break; } /* ** $db errorcode ** ** Return the numeric error code that was returned by the most recent | > > | 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 | /* $db complete SQL ** ** Return TRUE if SQL is a complete SQL statement. Return FALSE if ** additional lines of input are needed. This is similar to the ** built-in "info complete" command of Tcl. */ case DB_COMPLETE: { #ifndef SQLITE_OMIT_COMPLETE Tcl_Obj *pResult; int isComplete; if( objc!=3 ){ Tcl_WrongNumArgs(interp, 2, objv, "SQL"); return TCL_ERROR; } isComplete = sqlite3_complete( Tcl_GetStringFromObj(objv[2], 0) ); pResult = Tcl_GetObjResult(interp); Tcl_SetBooleanObj(pResult, isComplete); #endif break; } /* ** $db errorcode ** ** Return the numeric error code that was returned by the most recent |
︙ | ︙ |
Changes to SQLite.Interop/src/tokenize.c.
︙ | ︙ | |||
11 12 13 14 15 16 17 | ************************************************************************* ** An tokenizer for SQL ** ** This file contains C code that splits an SQL input string up into ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ************************************************************************* ** An tokenizer for SQL ** ** This file contains C code that splits an SQL input string up into ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** ** $Id: tokenize.c,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> #include <stdlib.h> /* |
︙ | ︙ | |||
427 428 429 430 431 432 433 434 435 436 437 438 439 440 | sqliteFree(pParse->apVarExpr); if( nErr>0 && (pParse->rc==SQLITE_OK || pParse->rc==SQLITE_DONE) ){ pParse->rc = SQLITE_ERROR; } return nErr; } /* ** Token types used by the sqlite3_complete() routine. See the header ** comments on that procedure for additional information. */ #define tkSEMI 0 #define tkWS 1 #define tkOTHER 2 | > > > > > | 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | sqliteFree(pParse->apVarExpr); if( nErr>0 && (pParse->rc==SQLITE_OK || pParse->rc==SQLITE_DONE) ){ pParse->rc = SQLITE_ERROR; } return nErr; } /* The sqlite3_complete() API may be omitted (to save code space) by ** defining the following symbol. */ #ifndef SQLITE_OMIT_COMPLETE /* ** Token types used by the sqlite3_complete() routine. See the header ** comments on that procedure for additional information. */ #define tkSEMI 0 #define tkWS 1 #define tkOTHER 2 |
︙ | ︙ | |||
658 659 660 661 662 663 664 | if( zSql8 ){ rc = sqlite3_complete(zSql8); } sqlite3ValueFree(pVal); return rc; } #endif /* SQLITE_OMIT_UTF16 */ | > | 663 664 665 666 667 668 669 670 | if( zSql8 ){ rc = sqlite3_complete(zSql8); } sqlite3ValueFree(pVal); return rc; } #endif /* SQLITE_OMIT_UTF16 */ #endif /* SQLITE_OMIT_COMPLETE */ |
Changes to SQLite.Interop/src/update.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** ** $Id: update.c,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #include "sqliteInt.h" /* ** The most recently coded instruction was an OP_Column to retrieve column ** 'i' of table pTab. This routine sets the P3 parameter of the ** OP_Column to the default value, if any. ** ** The default value of a column is specified by a DEFAULT clause in the ** column definition. This was either supplied by the user when the table ** was created, or added later to the table definition by an ALTER TABLE ** command. If the latter, then the row-records in the table btree on disk ** may not contain a value for the column and the default value, taken ** from the P3 parameter of the OP_Column instruction, is returned instead. ** If the former, then all row-records are guaranteed to include a value ** for the column and the P3 value is not required. ** ** Column definitions created by an ALTER TABLE command may only have ** literal default values specified: a number, null or a string. (If a more ** complicated default expression value was provided, it is evaluated ** when the ALTER TABLE is executed and one of the literal values written ** into the sqlite_master table.) ** ** Therefore, the P3 parameter is only required if the default value for ** the column is a literal number, string or null. The sqlite3ValueFromExpr() ** function is capable of transforming these types of expressions into ** sqlite3_value objects. */ void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){ if( pTab && !pTab->pSelect ){ sqlite3_value *pValue; u8 enc = sqlite3VdbeDb(v)->enc; Column *pCol = &pTab->aCol[i]; sqlite3ValueFromExpr(pCol->pDflt, enc, pCol->affinity, &pValue); sqlite3VdbeChangeP3(v, -1, (const char *)pValue, P3_MEM); } } /* ** Process an UPDATE statement. ** ** UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL; ** \_______/ \________/ \______/ \________________/ * onError pTabList pChanges pWhere |
︙ | ︙ | |||
290 291 292 293 294 295 296 297 298 299 300 301 302 303 | if( i==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_String8, 0, 0); continue; } j = aXRef[i]; if( j<0 ){ sqlite3VdbeAddOp(v, OP_Column, iCur, i); }else{ sqlite3ExprCodeAndCache(pParse, pChanges->a[j].pExpr); } } sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); if( !isView ){ sqlite3TableAffinityStr(v, pTab); | > | 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | if( i==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_String8, 0, 0); continue; } j = aXRef[i]; if( j<0 ){ sqlite3VdbeAddOp(v, OP_Column, iCur, i); sqlite3ColumnDefault(v, pTab, i); }else{ sqlite3ExprCodeAndCache(pParse, pChanges->a[j].pExpr); } } sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); if( !isView ){ sqlite3TableAffinityStr(v, pTab); |
︙ | ︙ | |||
374 375 376 377 378 379 380 381 382 383 384 385 386 387 | if( i==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_String8, 0, 0); continue; } j = aXRef[i]; if( j<0 ){ sqlite3VdbeAddOp(v, OP_Column, iCur, i); }else{ sqlite3ExprCode(pParse, pChanges->a[j].pExpr); } } /* Do constraint checks */ | > | 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | if( i==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_String8, 0, 0); continue; } j = aXRef[i]; if( j<0 ){ sqlite3VdbeAddOp(v, OP_Column, iCur, i); sqlite3ColumnDefault(v, pTab, i); }else{ sqlite3ExprCode(pParse, pChanges->a[j].pExpr); } } /* Do constraint checks */ |
︙ | ︙ |
Changes to SQLite.Interop/src/utf.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used to translate between UTF-8, ** UTF-16, UTF-16BE, and UTF-16LE. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used to translate between UTF-8, ** UTF-16, UTF-16BE, and UTF-16LE. ** ** $Id: utf.c,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ ** ** Notes on UTF-8: ** ** Byte-0 Byte-1 Byte-2 Byte-3 Value ** 0xxxxxxx 00000000 00000000 0xxxxxxx ** 110yyyyy 10xxxxxx 00000000 00000yyy yyxxxxxx ** 1110zzzz 10yyyyyy 10xxxxxx 00000000 zzzzyyyy yyxxxxxx |
︙ | ︙ |
Changes to SQLite.Interop/src/util.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** Utility functions used throughout sqlite. ** ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ** ************************************************************************* ** Utility functions used throughout sqlite. ** ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** ** $Id: util.c,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #include "sqliteInt.h" #include <stdarg.h> #include <ctype.h> #if SQLITE_MEMDEBUG>2 && defined(__GLIBC__) #include <execinfo.h> |
︙ | ︙ | |||
898 899 900 901 902 903 904 | do{ i++; v >>= 7; }while( v!=0 && i<9 ); return i; } | | | | 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 | do{ i++; v >>= 7; }while( v!=0 && i<9 ); return i; } #if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) \ || defined(SQLITE_TEST) /* ** Translate a single byte of Hex into an integer. */ static int hexToInt(int h){ if( h>='0' && h<='9' ){ return h - '0'; }else if( h>='a' && h<='f' ){ return h - 'a' + 10; }else{ assert( h>='A' && h<='F' ); return h - 'A' + 10; } } #endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC || SQLITE_TEST */ #if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) /* ** Convert a BLOB literal of the form "x'hhhhhh'" into its binary ** value. Return a pointer to its binary value. Space to hold the ** binary value has been obtained from malloc and must be freed by ** the calling routine. |
︙ | ︙ |
Changes to SQLite.Interop/src/vacuum.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** This file contains code used to implement the VACUUM command. ** ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. ** | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ** ************************************************************************* ** This file contains code used to implement the VACUUM command. ** ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. ** ** $Id: vacuum.c,v 1.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #include "sqliteInt.h" #include "os.h" #ifndef SQLITE_OMIT_VACUUM /* ** Generate a random name of 20 character in length. |
︙ | ︙ |
Changes to SQLite.Interop/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.2 2005/03/11 15:03:31 rmsimpson Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> #include "vdbeInt.h" /* |
︙ | ︙ | |||
298 299 300 301 302 303 304 305 306 307 308 309 310 311 | if( ((double)pRec->i)==pRec->r ){ pRec->flags |= MEM_Int; } } } } } #ifdef SQLITE_DEBUG /* ** Write a nice string representation of the contents of cell pMem ** into buffer zBuf, length nBuf. */ void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf){ | > > > > > > > > | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | if( ((double)pRec->i)==pRec->r ){ pRec->flags |= MEM_Int; } } } } } /* ** Exported version of applyAffinity(). This one works on sqlite3_value*, ** not the internal Mem* type. */ void sqlite3ValueApplyAffinity(sqlite3_value *pVal, u8 affinity, u8 enc){ applyAffinity((Mem *)pVal, affinity, enc); } #ifdef SQLITE_DEBUG /* ** Write a nice string representation of the contents of cell pMem ** into buffer zBuf, length nBuf. */ void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf){ |
︙ | ︙ | |||
1673 1674 1675 1676 1677 1678 1679 | if( (!pC->keyAsData && pC->zeroData) || (pC->keyAsData && pC->intKey) ){ rc = SQLITE_CORRUPT; goto abort_due_to_error; } break; } | | | 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 | if( (!pC->keyAsData && pC->zeroData) || (pC->keyAsData && pC->intKey) ){ rc = SQLITE_CORRUPT; goto abort_due_to_error; } break; } /* Opcode: Column P1 P2 P3 ** ** Interpret the data that cursor P1 points to as a structure built using ** the MakeRecord instruction. (See the MakeRecord opcode for additional ** information about the format of the data.) Push onto the stack the value ** of the P2-th column contained in the data. If there are less that (P2+1) ** values in the record, push a NULL onto the stack. ** |
︙ | ︙ | |||
1907 1908 1909 1910 1911 1912 1913 | goto op_column_out; } zData = sMem.z; } sqlite3VdbeSerialGet(zData, aType[p2], pTos); pTos->enc = db->enc; }else{ | > > > | > | 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 | goto op_column_out; } zData = sMem.z; } sqlite3VdbeSerialGet(zData, aType[p2], pTos); pTos->enc = db->enc; }else{ if( pOp->p3 ){ sqlite3VdbeMemShallowCopy(pTos, (Mem *)(pOp->p3), MEM_Static); }else{ pTos->flags = MEM_Null; } } /* If we dynamically allocated space to hold the data (in the ** sqlite3VdbeMemFromBtree() call above) then transfer control of that ** dynamically allocated space over to the pTos structure rather. ** This prevents a memory copy. */ |
︙ | ︙ |
Changes to SQLite.Interop/src/vdbe.h.
︙ | ︙ | |||
11 12 13 14 15 16 17 | ************************************************************************* ** Header file for the Virtual DataBase Engine (VDBE) ** ** This header defines the interface to the virtual database engine ** or VDBE. The VDBE implements an abstract machine that runs a ** simple program to access and modify the underlying database. ** | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ************************************************************************* ** Header file for the Virtual DataBase Engine (VDBE) ** ** This header defines the interface to the virtual database engine ** or VDBE. The VDBE implements an abstract machine that runs a ** simple program to access and modify the underlying database. ** ** $Id: vdbe.h,v 1.2 2005/03/11 15:03:32 rmsimpson Exp $ */ #ifndef _SQLITE_VDBE_H_ #define _SQLITE_VDBE_H_ #include <stdio.h> /* ** A single VDBE is an opaque structure named "Vdbe". Only routines |
︙ | ︙ | |||
65 66 67 68 69 70 71 72 73 74 75 76 77 78 | #define P3_DYNAMIC (-1) /* Pointer to a string obtained from sqliteMalloc() */ #define P3_STATIC (-2) /* Pointer to a static string */ #define P3_POINTER (-3) /* P3 is a pointer to some structure or object */ #define P3_COLLSEQ (-4) /* P3 is a pointer to a CollSeq structure */ #define P3_FUNCDEF (-5) /* P3 is a pointer to a FuncDef structure */ #define P3_KEYINFO (-6) /* P3 is a pointer to a KeyInfo structure */ #define P3_VDBEFUNC (-7) /* P3 is a pointer to a VdbeFunc structure */ /* When adding a P3 argument using P3_KEYINFO, a copy of the KeyInfo structure ** is made. That copy is freed when the Vdbe is finalized. But if the ** argument is P3_KEYINFO_HANDOFF, the passed in pointer is used. It still ** gets freed when the Vdbe is finalized so it still should be obtained ** from a single sqliteMalloc(). But no copy is made and the calling ** function should *not* try to free the KeyInfo. | > | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | #define P3_DYNAMIC (-1) /* Pointer to a string obtained from sqliteMalloc() */ #define P3_STATIC (-2) /* Pointer to a static string */ #define P3_POINTER (-3) /* P3 is a pointer to some structure or object */ #define P3_COLLSEQ (-4) /* P3 is a pointer to a CollSeq structure */ #define P3_FUNCDEF (-5) /* P3 is a pointer to a FuncDef structure */ #define P3_KEYINFO (-6) /* P3 is a pointer to a KeyInfo structure */ #define P3_VDBEFUNC (-7) /* P3 is a pointer to a VdbeFunc structure */ #define P3_MEM (-8) /* P3 is a pointer to a Mem* structure */ /* When adding a P3 argument using P3_KEYINFO, a copy of the KeyInfo structure ** is made. That copy is freed when the Vdbe is finalized. But if the ** argument is P3_KEYINFO_HANDOFF, the passed in pointer is used. It still ** gets freed when the Vdbe is finalized so it still should be obtained ** from a single sqliteMalloc(). But no copy is made and the calling ** function should *not* try to free the KeyInfo. |
︙ | ︙ | |||
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | int sqlite3VdbeCurrentAddr(Vdbe*); void sqlite3VdbeTrace(Vdbe*,FILE*); int sqlite3VdbeReset(Vdbe*); int sqliteVdbeSetVariables(Vdbe*,int,const char**); void sqlite3VdbeSetNumCols(Vdbe*,int); int sqlite3VdbeSetColName(Vdbe*, int, const char *, int); void sqlite3VdbeCountChanges(Vdbe*); #ifndef NDEBUG void sqlite3VdbeComment(Vdbe*, const char*, ...); # define VdbeComment(X) sqlite3VdbeComment X #else # define VdbeComment(X) #endif #endif | > | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | int sqlite3VdbeCurrentAddr(Vdbe*); void sqlite3VdbeTrace(Vdbe*,FILE*); int sqlite3VdbeReset(Vdbe*); int sqliteVdbeSetVariables(Vdbe*,int,const char**); void sqlite3VdbeSetNumCols(Vdbe*,int); int sqlite3VdbeSetColName(Vdbe*, int, const char *, int); void sqlite3VdbeCountChanges(Vdbe*); sqlite3 *sqlite3VdbeDb(Vdbe*); #ifndef NDEBUG void sqlite3VdbeComment(Vdbe*, const char*, ...); # define VdbeComment(X) sqlite3VdbeComment X #else # define VdbeComment(X) #endif #endif |
Changes to SQLite.Interop/src/vdbeaux.c.
︙ | ︙ | |||
1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 | sqliteFree(pOp->p3); } if( pOp->p3type==P3_VDBEFUNC ){ VdbeFunc *pVdbeFunc = (VdbeFunc *)pOp->p3; sqlite3VdbeDeleteAuxData(pVdbeFunc, 0); sqliteFree(pVdbeFunc); } } sqliteFree(p->aOp); } releaseMemArray(p->aVar, p->nVar); sqliteFree(p->aLabel); sqliteFree(p->aStack); releaseMemArray(p->aColName, p->nResColumn*2); | > > > | 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 | sqliteFree(pOp->p3); } if( pOp->p3type==P3_VDBEFUNC ){ VdbeFunc *pVdbeFunc = (VdbeFunc *)pOp->p3; sqlite3VdbeDeleteAuxData(pVdbeFunc, 0); sqliteFree(pVdbeFunc); } if( pOp->p3type==P3_MEM ){ sqlite3ValueFree((sqlite3_value*)pOp->p3); } } sqliteFree(p->aOp); } releaseMemArray(p->aVar, p->nVar); sqliteFree(p->aLabel); sqliteFree(p->aStack); releaseMemArray(p->aColName, p->nResColumn*2); |
︙ | ︙ | |||
1843 1844 1845 1846 1847 1848 1849 | */ void sqlite3ExpirePreparedStatements(sqlite3 *db){ Vdbe *p; for(p = db->pVdbe; p; p=p->pNext){ p->expired = 1; } } | > > > > > > > | 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 | */ void sqlite3ExpirePreparedStatements(sqlite3 *db){ Vdbe *p; for(p = db->pVdbe; p; p=p->pNext){ p->expired = 1; } } /* ** Return the database associated with the Vdbe. */ sqlite3 *sqlite3VdbeDb(Vdbe *v){ return v->db; } |
Changes to SQLite.Interop/src/vdbemem.c.
︙ | ︙ | |||
695 696 697 698 699 700 701 702 703 704 705 706 707 708 | Mem *p = sqliteMalloc(sizeof(*p)); if( p ){ p->flags = MEM_Null; p->type = SQLITE_NULL; } return p; } /* ** Change the string value of an sqlite3_value object */ void sqlite3ValueSetStr( sqlite3_value *v, int n, | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 | Mem *p = sqliteMalloc(sizeof(*p)); if( p ){ p->flags = MEM_Null; p->type = SQLITE_NULL; } return p; } /* ** Create a new sqlite3_value object, containing the value of pExpr. ** ** This only works for very simple expressions that consist of one constant ** token (i.e. "5", "5.1", "NULL", "'a string'"). If the expression can ** be converted directly into a value, then the value is allocated and ** a pointer written to *ppVal. The caller is responsible for deallocating ** the value by passing it to sqlite3ValueFree() later on. If the expression ** cannot be converted to a value, then *ppVal is set to NULL. */ int sqlite3ValueFromExpr( Expr *pExpr, u8 enc, u8 affinity, sqlite3_value **ppVal ){ int op; char *zVal = 0; sqlite3_value *pVal = 0; if( !pExpr ){ *ppVal = 0; return SQLITE_OK; } op = pExpr->op; if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){ zVal = sqliteStrNDup(pExpr->token.z, pExpr->token.n); pVal = sqlite3ValueNew(); if( !zVal || !pVal ) goto no_mem; sqlite3Dequote(zVal); sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, sqlite3FreeX); if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_NONE ){ sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, enc); }else{ sqlite3ValueApplyAffinity(pVal, affinity, enc); } }else if( op==TK_UMINUS ) { if( SQLITE_OK==sqlite3ValueFromExpr(pExpr->pLeft, enc, affinity, &pVal) ){ pVal->i = -1 * pVal->i; pVal->r = -1.0 * pVal->r; } } #ifndef SQLITE_OMIT_BLOB_LITERAL else if( op==TK_BLOB ){ int nVal; pVal = sqlite3ValueNew(); zVal = sqliteStrNDup(pExpr->token.z+1, pExpr->token.n-1); if( !zVal || !pVal ) goto no_mem; sqlite3Dequote(zVal); nVal = strlen(zVal)/2; sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(zVal), nVal, 0, sqlite3FreeX); sqliteFree(zVal); } #endif *ppVal = pVal; return SQLITE_OK; no_mem: sqliteFree(zVal); sqlite3ValueFree(pVal); *ppVal = 0; return SQLITE_NOMEM; } /* ** Change the string value of an sqlite3_value object */ void sqlite3ValueSetStr( sqlite3_value *v, int n, |
︙ | ︙ |
Changes to SQLite.Interop/src/where.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 | ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. This module is reponsible for ** generating the code that loops through a table looking for applicable ** rows. Indices are selected and used to speed the search when doing ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. This module is reponsible for ** generating the code that loops through a table looking for applicable ** rows. Indices are selected and used to speed the search when doing ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** ** $Id: where.c,v 1.2 2005/03/11 15:03:32 rmsimpson Exp $ */ #include "sqliteInt.h" /* ** The query generator uses an array of instances of this structure to ** help it analyze the subexpressions of the WHERE clause. Each WHERE ** clause subexpression is separated from the others by an AND operator. |
︙ | ︙ | |||
1119 1120 1121 1122 1123 1124 1125 | start = sqlite3VdbeCurrentAddr(v); pLevel->op = bRev ? OP_Prev : OP_Next; pLevel->p1 = iCur; pLevel->p2 = start; if( testOp!=OP_Noop ){ sqlite3VdbeAddOp(v, OP_Recno, iCur, 0); sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); | | | 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | start = sqlite3VdbeCurrentAddr(v); pLevel->op = bRev ? OP_Prev : OP_Next; pLevel->p1 = iCur; pLevel->p2 = start; if( testOp!=OP_Noop ){ sqlite3VdbeAddOp(v, OP_Recno, iCur, 0); sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); sqlite3VdbeAddOp(v, testOp, (int)(('n'<<8)&0x0000FF00), brk); } }else if( pIdx==0 ){ /* Case 4: There is no usable index. We must do a complete ** scan of the entire database table. */ int start; int opRewind; |
︙ | ︙ |