Fossil SCM
Update the built-in SQLite amalgamation to the latest 3.7.8 beta.
Commit
a0cf985a42a7552525c74a8e5d6c6427f9cc0146
Parent
2210be19cc6c9b5…
2 files changed
+699
-151
+1
-1
+699
-151
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -24,10 +24,11 @@ | ||
| 24 | 24 | #endif |
| 25 | 25 | #ifndef SQLITE_API |
| 26 | 26 | # define SQLITE_API |
| 27 | 27 | #endif |
| 28 | 28 | /************** Begin file sqliteInt.h ***************************************/ |
| 29 | +#line 1 "tsrc/sqliteInt.h" | |
| 29 | 30 | /* |
| 30 | 31 | ** 2001 September 15 |
| 31 | 32 | ** |
| 32 | 33 | ** The author disclaims copyright to this source code. In place of |
| 33 | 34 | ** a legal notice, here is a blessing: |
| @@ -78,10 +79,11 @@ | ||
| 78 | 79 | #include "config.h" |
| 79 | 80 | #endif |
| 80 | 81 | |
| 81 | 82 | /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/ |
| 82 | 83 | /************** Begin file sqliteLimit.h *************************************/ |
| 84 | +#line 1 "tsrc/sqliteLimit.h" | |
| 83 | 85 | /* |
| 84 | 86 | ** 2007 May 7 |
| 85 | 87 | ** |
| 86 | 88 | ** The author disclaims copyright to this source code. In place of |
| 87 | 89 | ** a legal notice, here is a blessing: |
| @@ -289,10 +291,11 @@ | ||
| 289 | 291 | # define SQLITE_MAX_TRIGGER_DEPTH 1000 |
| 290 | 292 | #endif |
| 291 | 293 | |
| 292 | 294 | /************** End of sqliteLimit.h *****************************************/ |
| 293 | 295 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 296 | +#line 54 "tsrc/sqliteInt.h" | |
| 294 | 297 | |
| 295 | 298 | /* Disable nuisance warnings on Borland compilers */ |
| 296 | 299 | #if defined(__BORLANDC__) |
| 297 | 300 | #pragma warn -rch /* unreachable code */ |
| 298 | 301 | #pragma warn -ccc /* Condition is always true or false */ |
| @@ -545,10 +548,11 @@ | ||
| 545 | 548 | # define unlikely(X) !!(X) |
| 546 | 549 | #endif |
| 547 | 550 | |
| 548 | 551 | /************** Include sqlite3.h in the middle of sqliteInt.h ***************/ |
| 549 | 552 | /************** Begin file sqlite3.h *****************************************/ |
| 553 | +#line 1 "tsrc/sqlite3.h" | |
| 550 | 554 | /* |
| 551 | 555 | ** 2001 September 15 |
| 552 | 556 | ** |
| 553 | 557 | ** The author disclaims copyright to this source code. In place of |
| 554 | 558 | ** a legal notice, here is a blessing: |
| @@ -656,11 +660,11 @@ | ||
| 656 | 660 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 657 | 661 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 658 | 662 | */ |
| 659 | 663 | #define SQLITE_VERSION "3.7.8" |
| 660 | 664 | #define SQLITE_VERSION_NUMBER 3007008 |
| 661 | -#define SQLITE_SOURCE_ID "2011-09-04 01:27:00 6b657ae75035eb10b0ad640998d3c9eadfdffa6e" | |
| 665 | +#define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2" | |
| 662 | 666 | |
| 663 | 667 | /* |
| 664 | 668 | ** CAPI3REF: Run-Time Library Version Numbers |
| 665 | 669 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 666 | 670 | ** |
| @@ -7305,12 +7309,14 @@ | ||
| 7305 | 7309 | #endif /* ifndef _SQLITE3RTREE_H_ */ |
| 7306 | 7310 | |
| 7307 | 7311 | |
| 7308 | 7312 | /************** End of sqlite3.h *********************************************/ |
| 7309 | 7313 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7314 | +#line 309 "tsrc/sqliteInt.h" | |
| 7310 | 7315 | /************** Include hash.h in the middle of sqliteInt.h ******************/ |
| 7311 | 7316 | /************** Begin file hash.h ********************************************/ |
| 7317 | +#line 1 "tsrc/hash.h" | |
| 7312 | 7318 | /* |
| 7313 | 7319 | ** 2001 September 22 |
| 7314 | 7320 | ** |
| 7315 | 7321 | ** The author disclaims copyright to this source code. In place of |
| 7316 | 7322 | ** a legal notice, here is a blessing: |
| @@ -7406,12 +7412,14 @@ | ||
| 7406 | 7412 | |
| 7407 | 7413 | #endif /* _SQLITE_HASH_H_ */ |
| 7408 | 7414 | |
| 7409 | 7415 | /************** End of hash.h ************************************************/ |
| 7410 | 7416 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7417 | +#line 310 "tsrc/sqliteInt.h" | |
| 7411 | 7418 | /************** Include parse.h in the middle of sqliteInt.h *****************/ |
| 7412 | 7419 | /************** Begin file parse.h *******************************************/ |
| 7420 | +#line 1 "tsrc/parse.h" | |
| 7413 | 7421 | #define TK_SEMI 1 |
| 7414 | 7422 | #define TK_EXPLAIN 2 |
| 7415 | 7423 | #define TK_QUERY 3 |
| 7416 | 7424 | #define TK_PLAN 4 |
| 7417 | 7425 | #define TK_BEGIN 5 |
| @@ -7568,10 +7576,11 @@ | ||
| 7568 | 7576 | #define TK_UMINUS 156 |
| 7569 | 7577 | #define TK_UPLUS 157 |
| 7570 | 7578 | |
| 7571 | 7579 | /************** End of parse.h ***********************************************/ |
| 7572 | 7580 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7581 | +#line 311 "tsrc/sqliteInt.h" | |
| 7573 | 7582 | #include <stdio.h> |
| 7574 | 7583 | #include <stdlib.h> |
| 7575 | 7584 | #include <string.h> |
| 7576 | 7585 | #include <assert.h> |
| 7577 | 7586 | #include <stddef.h> |
| @@ -7911,10 +7920,11 @@ | ||
| 7911 | 7920 | ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque |
| 7912 | 7921 | ** pointer types (i.e. FuncDef) defined above. |
| 7913 | 7922 | */ |
| 7914 | 7923 | /************** Include btree.h in the middle of sqliteInt.h *****************/ |
| 7915 | 7924 | /************** Begin file btree.h *******************************************/ |
| 7925 | +#line 1 "tsrc/btree.h" | |
| 7916 | 7926 | /* |
| 7917 | 7927 | ** 2001 September 15 |
| 7918 | 7928 | ** |
| 7919 | 7929 | ** The author disclaims copyright to this source code. In place of |
| 7920 | 7930 | ** a legal notice, here is a blessing: |
| @@ -8155,12 +8165,14 @@ | ||
| 8155 | 8165 | |
| 8156 | 8166 | #endif /* _BTREE_H_ */ |
| 8157 | 8167 | |
| 8158 | 8168 | /************** End of btree.h ***********************************************/ |
| 8159 | 8169 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8170 | +#line 653 "tsrc/sqliteInt.h" | |
| 8160 | 8171 | /************** Include vdbe.h in the middle of sqliteInt.h ******************/ |
| 8161 | 8172 | /************** Begin file vdbe.h ********************************************/ |
| 8173 | +#line 1 "tsrc/vdbe.h" | |
| 8162 | 8174 | /* |
| 8163 | 8175 | ** 2001 September 15 |
| 8164 | 8176 | ** |
| 8165 | 8177 | ** The author disclaims copyright to this source code. In place of |
| 8166 | 8178 | ** a legal notice, here is a blessing: |
| @@ -8321,10 +8333,11 @@ | ||
| 8321 | 8333 | ** The makefile scans the vdbe.c source file and creates the "opcodes.h" |
| 8322 | 8334 | ** header file that defines a number for each opcode used by the VDBE. |
| 8323 | 8335 | */ |
| 8324 | 8336 | /************** Include opcodes.h in the middle of vdbe.h ********************/ |
| 8325 | 8337 | /************** Begin file opcodes.h *****************************************/ |
| 8338 | +#line 1 "tsrc/opcodes.h" | |
| 8326 | 8339 | /* Automatically generated. Do not edit */ |
| 8327 | 8340 | /* See the mkopcodeh.awk script for details */ |
| 8328 | 8341 | #define OP_Goto 1 |
| 8329 | 8342 | #define OP_Gosub 2 |
| 8330 | 8343 | #define OP_Return 3 |
| @@ -8508,10 +8521,11 @@ | ||
| 8508 | 8521 | /* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\ |
| 8509 | 8522 | /* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,} |
| 8510 | 8523 | |
| 8511 | 8524 | /************** End of opcodes.h *********************************************/ |
| 8512 | 8525 | /************** Continuing where we left off in vdbe.h ***********************/ |
| 8526 | +#line 164 "tsrc/vdbe.h" | |
| 8513 | 8527 | |
| 8514 | 8528 | /* |
| 8515 | 8529 | ** Prototypes for the VDBE interface. See comments on the implementation |
| 8516 | 8530 | ** for a description of what each of these routines does. |
| 8517 | 8531 | */ |
| @@ -8559,13 +8573,13 @@ | ||
| 8559 | 8573 | SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int); |
| 8560 | 8574 | #ifndef SQLITE_OMIT_TRACE |
| 8561 | 8575 | SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*); |
| 8562 | 8576 | #endif |
| 8563 | 8577 | |
| 8564 | -SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int); | |
| 8565 | -SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*); | |
| 8578 | +SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*); | |
| 8566 | 8579 | SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*); |
| 8580 | +SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **); | |
| 8567 | 8581 | |
| 8568 | 8582 | #ifndef SQLITE_OMIT_TRIGGER |
| 8569 | 8583 | SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *); |
| 8570 | 8584 | #endif |
| 8571 | 8585 | |
| @@ -8582,12 +8596,14 @@ | ||
| 8582 | 8596 | |
| 8583 | 8597 | #endif |
| 8584 | 8598 | |
| 8585 | 8599 | /************** End of vdbe.h ************************************************/ |
| 8586 | 8600 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8601 | +#line 654 "tsrc/sqliteInt.h" | |
| 8587 | 8602 | /************** Include pager.h in the middle of sqliteInt.h *****************/ |
| 8588 | 8603 | /************** Begin file pager.h *******************************************/ |
| 8604 | +#line 1 "tsrc/pager.h" | |
| 8589 | 8605 | /* |
| 8590 | 8606 | ** 2001 September 15 |
| 8591 | 8607 | ** |
| 8592 | 8608 | ** The author disclaims copyright to this source code. In place of |
| 8593 | 8609 | ** a legal notice, here is a blessing: |
| @@ -8769,12 +8785,14 @@ | ||
| 8769 | 8785 | |
| 8770 | 8786 | #endif /* _PAGER_H_ */ |
| 8771 | 8787 | |
| 8772 | 8788 | /************** End of pager.h ***********************************************/ |
| 8773 | 8789 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8790 | +#line 655 "tsrc/sqliteInt.h" | |
| 8774 | 8791 | /************** Include pcache.h in the middle of sqliteInt.h ****************/ |
| 8775 | 8792 | /************** Begin file pcache.h ******************************************/ |
| 8793 | +#line 1 "tsrc/pcache.h" | |
| 8776 | 8794 | /* |
| 8777 | 8795 | ** 2008 August 05 |
| 8778 | 8796 | ** |
| 8779 | 8797 | ** The author disclaims copyright to this source code. In place of |
| 8780 | 8798 | ** a legal notice, here is a blessing: |
| @@ -8929,13 +8947,15 @@ | ||
| 8929 | 8947 | |
| 8930 | 8948 | #endif /* _PCACHE_H_ */ |
| 8931 | 8949 | |
| 8932 | 8950 | /************** End of pcache.h **********************************************/ |
| 8933 | 8951 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8952 | +#line 656 "tsrc/sqliteInt.h" | |
| 8934 | 8953 | |
| 8935 | 8954 | /************** Include os.h in the middle of sqliteInt.h ********************/ |
| 8936 | 8955 | /************** Begin file os.h **********************************************/ |
| 8956 | +#line 1 "tsrc/os.h" | |
| 8937 | 8957 | /* |
| 8938 | 8958 | ** 2001 September 16 |
| 8939 | 8959 | ** |
| 8940 | 8960 | ** The author disclaims copyright to this source code. In place of |
| 8941 | 8961 | ** a legal notice, here is a blessing: |
| @@ -9214,12 +9234,14 @@ | ||
| 9214 | 9234 | |
| 9215 | 9235 | #endif /* _SQLITE_OS_H_ */ |
| 9216 | 9236 | |
| 9217 | 9237 | /************** End of os.h **************************************************/ |
| 9218 | 9238 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 9239 | +#line 658 "tsrc/sqliteInt.h" | |
| 9219 | 9240 | /************** Include mutex.h in the middle of sqliteInt.h *****************/ |
| 9220 | 9241 | /************** Begin file mutex.h *******************************************/ |
| 9242 | +#line 1 "tsrc/mutex.h" | |
| 9221 | 9243 | /* |
| 9222 | 9244 | ** 2007 August 28 |
| 9223 | 9245 | ** |
| 9224 | 9246 | ** The author disclaims copyright to this source code. In place of |
| 9225 | 9247 | ** a legal notice, here is a blessing: |
| @@ -9290,10 +9312,11 @@ | ||
| 9290 | 9312 | #define sqlite3MutexEnd() |
| 9291 | 9313 | #endif /* defined(SQLITE_MUTEX_OMIT) */ |
| 9292 | 9314 | |
| 9293 | 9315 | /************** End of mutex.h ***********************************************/ |
| 9294 | 9316 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 9317 | +#line 659 "tsrc/sqliteInt.h" | |
| 9295 | 9318 | |
| 9296 | 9319 | |
| 9297 | 9320 | /* |
| 9298 | 9321 | ** Each database file to be accessed by the system is an instance |
| 9299 | 9322 | ** of the following structure. There are normally two of these structures |
| @@ -11892,10 +11915,11 @@ | ||
| 11892 | 11915 | |
| 11893 | 11916 | #endif /* _SQLITEINT_H_ */ |
| 11894 | 11917 | |
| 11895 | 11918 | /************** End of sqliteInt.h *******************************************/ |
| 11896 | 11919 | /************** Begin file global.c ******************************************/ |
| 11920 | +#line 1 "tsrc/global.c" | |
| 11897 | 11921 | /* |
| 11898 | 11922 | ** 2008 June 13 |
| 11899 | 11923 | ** |
| 11900 | 11924 | ** The author disclaims copyright to this source code. In place of |
| 11901 | 11925 | ** a legal notice, here is a blessing: |
| @@ -12114,10 +12138,11 @@ | ||
| 12114 | 12138 | */ |
| 12115 | 12139 | SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER; |
| 12116 | 12140 | |
| 12117 | 12141 | /************** End of global.c **********************************************/ |
| 12118 | 12142 | /************** Begin file ctime.c *******************************************/ |
| 12143 | +#line 1 "tsrc/ctime.c" | |
| 12119 | 12144 | /* |
| 12120 | 12145 | ** 2010 February 23 |
| 12121 | 12146 | ** |
| 12122 | 12147 | ** The author disclaims copyright to this source code. In place of |
| 12123 | 12148 | ** a legal notice, here is a blessing: |
| @@ -12518,10 +12543,11 @@ | ||
| 12518 | 12543 | |
| 12519 | 12544 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 12520 | 12545 | |
| 12521 | 12546 | /************** End of ctime.c ***********************************************/ |
| 12522 | 12547 | /************** Begin file status.c ******************************************/ |
| 12548 | +#line 1 "tsrc/status.c" | |
| 12523 | 12549 | /* |
| 12524 | 12550 | ** 2008 June 18 |
| 12525 | 12551 | ** |
| 12526 | 12552 | ** The author disclaims copyright to this source code. In place of |
| 12527 | 12553 | ** a legal notice, here is a blessing: |
| @@ -12535,10 +12561,11 @@ | ||
| 12535 | 12561 | ** This module implements the sqlite3_status() interface and related |
| 12536 | 12562 | ** functionality. |
| 12537 | 12563 | */ |
| 12538 | 12564 | /************** Include vdbeInt.h in the middle of status.c ******************/ |
| 12539 | 12565 | /************** Begin file vdbeInt.h *****************************************/ |
| 12566 | +#line 1 "tsrc/vdbeInt.h" | |
| 12540 | 12567 | /* |
| 12541 | 12568 | ** 2003 September 6 |
| 12542 | 12569 | ** |
| 12543 | 12570 | ** The author disclaims copyright to this source code. In place of |
| 12544 | 12571 | ** a legal notice, here is a blessing: |
| @@ -12986,10 +13013,11 @@ | ||
| 12986 | 13013 | |
| 12987 | 13014 | #endif /* !defined(_VDBEINT_H_) */ |
| 12988 | 13015 | |
| 12989 | 13016 | /************** End of vdbeInt.h *********************************************/ |
| 12990 | 13017 | /************** Continuing where we left off in status.c *********************/ |
| 13018 | +#line 18 "tsrc/status.c" | |
| 12991 | 13019 | |
| 12992 | 13020 | /* |
| 12993 | 13021 | ** Variables in which to record status information. |
| 12994 | 13022 | */ |
| 12995 | 13023 | typedef struct sqlite3StatType sqlite3StatType; |
| @@ -13199,10 +13227,11 @@ | ||
| 13199 | 13227 | return rc; |
| 13200 | 13228 | } |
| 13201 | 13229 | |
| 13202 | 13230 | /************** End of status.c **********************************************/ |
| 13203 | 13231 | /************** Begin file date.c ********************************************/ |
| 13232 | +#line 1 "tsrc/date.c" | |
| 13204 | 13233 | /* |
| 13205 | 13234 | ** 2003 October 31 |
| 13206 | 13235 | ** |
| 13207 | 13236 | ** The author disclaims copyright to this source code. In place of |
| 13208 | 13237 | ** a legal notice, here is a blessing: |
| @@ -14326,10 +14355,11 @@ | ||
| 14326 | 14355 | } |
| 14327 | 14356 | } |
| 14328 | 14357 | |
| 14329 | 14358 | /************** End of date.c ************************************************/ |
| 14330 | 14359 | /************** Begin file os.c **********************************************/ |
| 14360 | +#line 1 "tsrc/os.c" | |
| 14331 | 14361 | /* |
| 14332 | 14362 | ** 2005 November 29 |
| 14333 | 14363 | ** |
| 14334 | 14364 | ** The author disclaims copyright to this source code. In place of |
| 14335 | 14365 | ** a legal notice, here is a blessing: |
| @@ -14659,10 +14689,11 @@ | ||
| 14659 | 14689 | return SQLITE_OK; |
| 14660 | 14690 | } |
| 14661 | 14691 | |
| 14662 | 14692 | /************** End of os.c **************************************************/ |
| 14663 | 14693 | /************** Begin file fault.c *******************************************/ |
| 14694 | +#line 1 "tsrc/fault.c" | |
| 14664 | 14695 | /* |
| 14665 | 14696 | ** 2008 Jan 22 |
| 14666 | 14697 | ** |
| 14667 | 14698 | ** The author disclaims copyright to this source code. In place of |
| 14668 | 14699 | ** a legal notice, here is a blessing: |
| @@ -14748,10 +14779,11 @@ | ||
| 14748 | 14779 | |
| 14749 | 14780 | #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */ |
| 14750 | 14781 | |
| 14751 | 14782 | /************** End of fault.c ***********************************************/ |
| 14752 | 14783 | /************** Begin file mem0.c ********************************************/ |
| 14784 | +#line 1 "tsrc/mem0.c" | |
| 14753 | 14785 | /* |
| 14754 | 14786 | ** 2008 October 28 |
| 14755 | 14787 | ** |
| 14756 | 14788 | ** The author disclaims copyright to this source code. In place of |
| 14757 | 14789 | ** a legal notice, here is a blessing: |
| @@ -14809,10 +14841,11 @@ | ||
| 14809 | 14841 | |
| 14810 | 14842 | #endif /* SQLITE_ZERO_MALLOC */ |
| 14811 | 14843 | |
| 14812 | 14844 | /************** End of mem0.c ************************************************/ |
| 14813 | 14845 | /************** Begin file mem1.c ********************************************/ |
| 14846 | +#line 1 "tsrc/mem1.c" | |
| 14814 | 14847 | /* |
| 14815 | 14848 | ** 2007 August 14 |
| 14816 | 14849 | ** |
| 14817 | 14850 | ** The author disclaims copyright to this source code. In place of |
| 14818 | 14851 | ** a legal notice, here is a blessing: |
| @@ -14961,10 +14994,11 @@ | ||
| 14961 | 14994 | |
| 14962 | 14995 | #endif /* SQLITE_SYSTEM_MALLOC */ |
| 14963 | 14996 | |
| 14964 | 14997 | /************** End of mem1.c ************************************************/ |
| 14965 | 14998 | /************** Begin file mem2.c ********************************************/ |
| 14999 | +#line 1 "tsrc/mem2.c" | |
| 14966 | 15000 | /* |
| 14967 | 15001 | ** 2007 August 15 |
| 14968 | 15002 | ** |
| 14969 | 15003 | ** The author disclaims copyright to this source code. In place of |
| 14970 | 15004 | ** a legal notice, here is a blessing: |
| @@ -15491,10 +15525,11 @@ | ||
| 15491 | 15525 | |
| 15492 | 15526 | #endif /* SQLITE_MEMDEBUG */ |
| 15493 | 15527 | |
| 15494 | 15528 | /************** End of mem2.c ************************************************/ |
| 15495 | 15529 | /************** Begin file mem3.c ********************************************/ |
| 15530 | +#line 1 "tsrc/mem3.c" | |
| 15496 | 15531 | /* |
| 15497 | 15532 | ** 2007 October 14 |
| 15498 | 15533 | ** |
| 15499 | 15534 | ** The author disclaims copyright to this source code. In place of |
| 15500 | 15535 | ** a legal notice, here is a blessing: |
| @@ -16180,10 +16215,11 @@ | ||
| 16180 | 16215 | |
| 16181 | 16216 | #endif /* SQLITE_ENABLE_MEMSYS3 */ |
| 16182 | 16217 | |
| 16183 | 16218 | /************** End of mem3.c ************************************************/ |
| 16184 | 16219 | /************** Begin file mem5.c ********************************************/ |
| 16220 | +#line 1 "tsrc/mem5.c" | |
| 16185 | 16221 | /* |
| 16186 | 16222 | ** 2007 October 14 |
| 16187 | 16223 | ** |
| 16188 | 16224 | ** The author disclaims copyright to this source code. In place of |
| 16189 | 16225 | ** a legal notice, here is a blessing: |
| @@ -16763,10 +16799,11 @@ | ||
| 16763 | 16799 | |
| 16764 | 16800 | #endif /* SQLITE_ENABLE_MEMSYS5 */ |
| 16765 | 16801 | |
| 16766 | 16802 | /************** End of mem5.c ************************************************/ |
| 16767 | 16803 | /************** Begin file mutex.c *******************************************/ |
| 16804 | +#line 1 "tsrc/mutex.c" | |
| 16768 | 16805 | /* |
| 16769 | 16806 | ** 2007 August 14 |
| 16770 | 16807 | ** |
| 16771 | 16808 | ** The author disclaims copyright to this source code. In place of |
| 16772 | 16809 | ** a legal notice, here is a blessing: |
| @@ -16918,10 +16955,11 @@ | ||
| 16918 | 16955 | |
| 16919 | 16956 | #endif /* SQLITE_MUTEX_OMIT */ |
| 16920 | 16957 | |
| 16921 | 16958 | /************** End of mutex.c ***********************************************/ |
| 16922 | 16959 | /************** Begin file mutex_noop.c **************************************/ |
| 16960 | +#line 1 "tsrc/mutex_noop.c" | |
| 16923 | 16961 | /* |
| 16924 | 16962 | ** 2008 October 07 |
| 16925 | 16963 | ** |
| 16926 | 16964 | ** The author disclaims copyright to this source code. In place of |
| 16927 | 16965 | ** a legal notice, here is a blessing: |
| @@ -17126,10 +17164,11 @@ | ||
| 17126 | 17164 | #endif /* SQLITE_MUTEX_NOOP */ |
| 17127 | 17165 | #endif /* SQLITE_MUTEX_OMIT */ |
| 17128 | 17166 | |
| 17129 | 17167 | /************** End of mutex_noop.c ******************************************/ |
| 17130 | 17168 | /************** Begin file mutex_os2.c ***************************************/ |
| 17169 | +#line 1 "tsrc/mutex_os2.c" | |
| 17131 | 17170 | /* |
| 17132 | 17171 | ** 2007 August 28 |
| 17133 | 17172 | ** |
| 17134 | 17173 | ** The author disclaims copyright to this source code. In place of |
| 17135 | 17174 | ** a legal notice, here is a blessing: |
| @@ -17402,10 +17441,11 @@ | ||
| 17402 | 17441 | } |
| 17403 | 17442 | #endif /* SQLITE_MUTEX_OS2 */ |
| 17404 | 17443 | |
| 17405 | 17444 | /************** End of mutex_os2.c *******************************************/ |
| 17406 | 17445 | /************** Begin file mutex_unix.c **************************************/ |
| 17446 | +#line 1 "tsrc/mutex_unix.c" | |
| 17407 | 17447 | /* |
| 17408 | 17448 | ** 2007 August 28 |
| 17409 | 17449 | ** |
| 17410 | 17450 | ** The author disclaims copyright to this source code. In place of |
| 17411 | 17451 | ** a legal notice, here is a blessing: |
| @@ -17755,10 +17795,11 @@ | ||
| 17755 | 17795 | |
| 17756 | 17796 | #endif /* SQLITE_MUTEX_PTHREAD */ |
| 17757 | 17797 | |
| 17758 | 17798 | /************** End of mutex_unix.c ******************************************/ |
| 17759 | 17799 | /************** Begin file mutex_w32.c ***************************************/ |
| 17800 | +#line 1 "tsrc/mutex_w32.c" | |
| 17760 | 17801 | /* |
| 17761 | 17802 | ** 2007 August 14 |
| 17762 | 17803 | ** |
| 17763 | 17804 | ** The author disclaims copyright to this source code. In place of |
| 17764 | 17805 | ** a legal notice, here is a blessing: |
| @@ -18089,10 +18130,11 @@ | ||
| 18089 | 18130 | } |
| 18090 | 18131 | #endif /* SQLITE_MUTEX_W32 */ |
| 18091 | 18132 | |
| 18092 | 18133 | /************** End of mutex_w32.c *******************************************/ |
| 18093 | 18134 | /************** Begin file malloc.c ******************************************/ |
| 18135 | +#line 1 "tsrc/malloc.c" | |
| 18094 | 18136 | /* |
| 18095 | 18137 | ** 2001 September 15 |
| 18096 | 18138 | ** |
| 18097 | 18139 | ** The author disclaims copyright to this source code. In place of |
| 18098 | 18140 | ** a legal notice, here is a blessing: |
| @@ -18868,10 +18910,11 @@ | ||
| 18868 | 18910 | return rc & (db ? db->errMask : 0xff); |
| 18869 | 18911 | } |
| 18870 | 18912 | |
| 18871 | 18913 | /************** End of malloc.c **********************************************/ |
| 18872 | 18914 | /************** Begin file printf.c ******************************************/ |
| 18915 | +#line 1 "tsrc/printf.c" | |
| 18873 | 18916 | /* |
| 18874 | 18917 | ** The "printf" code that follows dates from the 1980's. It is in |
| 18875 | 18918 | ** the public domain. The original comments are included here for |
| 18876 | 18919 | ** completeness. They are very out-of-date but might be useful as |
| 18877 | 18920 | ** an historical reference. Most of the "enhancements" have been backed |
| @@ -19899,10 +19942,11 @@ | ||
| 19899 | 19942 | } |
| 19900 | 19943 | #endif |
| 19901 | 19944 | |
| 19902 | 19945 | /************** End of printf.c **********************************************/ |
| 19903 | 19946 | /************** Begin file random.c ******************************************/ |
| 19947 | +#line 1 "tsrc/random.c" | |
| 19904 | 19948 | /* |
| 19905 | 19949 | ** 2001 September 15 |
| 19906 | 19950 | ** |
| 19907 | 19951 | ** The author disclaims copyright to this source code. In place of |
| 19908 | 19952 | ** a legal notice, here is a blessing: |
| @@ -20046,10 +20090,11 @@ | ||
| 20046 | 20090 | } |
| 20047 | 20091 | #endif /* SQLITE_OMIT_BUILTIN_TEST */ |
| 20048 | 20092 | |
| 20049 | 20093 | /************** End of random.c **********************************************/ |
| 20050 | 20094 | /************** Begin file utf.c *********************************************/ |
| 20095 | +#line 1 "tsrc/utf.c" | |
| 20051 | 20096 | /* |
| 20052 | 20097 | ** 2004 April 13 |
| 20053 | 20098 | ** |
| 20054 | 20099 | ** The author disclaims copyright to this source code. In place of |
| 20055 | 20100 | ** a legal notice, here is a blessing: |
| @@ -20607,10 +20652,11 @@ | ||
| 20607 | 20652 | #endif /* SQLITE_TEST */ |
| 20608 | 20653 | #endif /* SQLITE_OMIT_UTF16 */ |
| 20609 | 20654 | |
| 20610 | 20655 | /************** End of utf.c *************************************************/ |
| 20611 | 20656 | /************** Begin file util.c ********************************************/ |
| 20657 | +#line 1 "tsrc/util.c" | |
| 20612 | 20658 | /* |
| 20613 | 20659 | ** 2001 September 15 |
| 20614 | 20660 | ** |
| 20615 | 20661 | ** The author disclaims copyright to this source code. In place of |
| 20616 | 20662 | ** a legal notice, here is a blessing: |
| @@ -21789,10 +21835,11 @@ | ||
| 21789 | 21835 | } |
| 21790 | 21836 | #endif |
| 21791 | 21837 | |
| 21792 | 21838 | /************** End of util.c ************************************************/ |
| 21793 | 21839 | /************** Begin file hash.c ********************************************/ |
| 21840 | +#line 1 "tsrc/hash.c" | |
| 21794 | 21841 | /* |
| 21795 | 21842 | ** 2001 September 22 |
| 21796 | 21843 | ** |
| 21797 | 21844 | ** The author disclaims copyright to this source code. In place of |
| 21798 | 21845 | ** a legal notice, here is a blessing: |
| @@ -22068,10 +22115,11 @@ | ||
| 22068 | 22115 | return 0; |
| 22069 | 22116 | } |
| 22070 | 22117 | |
| 22071 | 22118 | /************** End of hash.c ************************************************/ |
| 22072 | 22119 | /************** Begin file opcodes.c *****************************************/ |
| 22120 | +#line 1 "tsrc/opcodes.c" | |
| 22073 | 22121 | /* Automatically generated. Do not edit */ |
| 22074 | 22122 | /* See the mkopcodec.awk script for details. */ |
| 22075 | 22123 | #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) |
| 22076 | 22124 | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ |
| 22077 | 22125 | static const char *const azName[] = { "?", |
| @@ -22229,10 +22277,11 @@ | ||
| 22229 | 22277 | } |
| 22230 | 22278 | #endif |
| 22231 | 22279 | |
| 22232 | 22280 | /************** End of opcodes.c *********************************************/ |
| 22233 | 22281 | /************** Begin file os_os2.c ******************************************/ |
| 22282 | +#line 1 "tsrc/os_os2.c" | |
| 22234 | 22283 | /* |
| 22235 | 22284 | ** 2006 Feb 14 |
| 22236 | 22285 | ** |
| 22237 | 22286 | ** The author disclaims copyright to this source code. In place of |
| 22238 | 22287 | ** a legal notice, here is a blessing: |
| @@ -22285,10 +22334,11 @@ | ||
| 22285 | 22334 | /* |
| 22286 | 22335 | ** Include code that is common to all os_*.c files |
| 22287 | 22336 | */ |
| 22288 | 22337 | /************** Include os_common.h in the middle of os_os2.c ****************/ |
| 22289 | 22338 | /************** Begin file os_common.h ***************************************/ |
| 22339 | +#line 1 "tsrc/os_common.h" | |
| 22290 | 22340 | /* |
| 22291 | 22341 | ** 2004 May 22 |
| 22292 | 22342 | ** |
| 22293 | 22343 | ** The author disclaims copyright to this source code. In place of |
| 22294 | 22344 | ** a legal notice, here is a blessing: |
| @@ -22338,10 +22388,11 @@ | ||
| 22338 | 22388 | ** hwtime.h contains inline assembler code for implementing |
| 22339 | 22389 | ** high-performance timing routines. |
| 22340 | 22390 | */ |
| 22341 | 22391 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 22342 | 22392 | /************** Begin file hwtime.h ******************************************/ |
| 22393 | +#line 1 "tsrc/hwtime.h" | |
| 22343 | 22394 | /* |
| 22344 | 22395 | ** 2008 May 27 |
| 22345 | 22396 | ** |
| 22346 | 22397 | ** The author disclaims copyright to this source code. In place of |
| 22347 | 22398 | ** a legal notice, here is a blessing: |
| @@ -22426,10 +22477,11 @@ | ||
| 22426 | 22477 | |
| 22427 | 22478 | #endif /* !defined(_HWTIME_H_) */ |
| 22428 | 22479 | |
| 22429 | 22480 | /************** End of hwtime.h **********************************************/ |
| 22430 | 22481 | /************** Continuing where we left off in os_common.h ******************/ |
| 22482 | +#line 53 "tsrc/os_common.h" | |
| 22431 | 22483 | |
| 22432 | 22484 | static sqlite_uint64 g_start; |
| 22433 | 22485 | static sqlite_uint64 g_elapsed; |
| 22434 | 22486 | #define TIMER_START g_start=sqlite3Hwtime() |
| 22435 | 22487 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -22492,10 +22544,11 @@ | ||
| 22492 | 22544 | |
| 22493 | 22545 | #endif /* !defined(_OS_COMMON_H_) */ |
| 22494 | 22546 | |
| 22495 | 22547 | /************** End of os_common.h *******************************************/ |
| 22496 | 22548 | /************** Continuing where we left off in os_os2.c *********************/ |
| 22549 | +#line 57 "tsrc/os_os2.c" | |
| 22497 | 22550 | |
| 22498 | 22551 | /* Forward references */ |
| 22499 | 22552 | typedef struct os2File os2File; /* The file structure */ |
| 22500 | 22553 | typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */ |
| 22501 | 22554 | typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */ |
| @@ -24363,10 +24416,11 @@ | ||
| 24363 | 24416 | |
| 24364 | 24417 | #endif /* SQLITE_OS_OS2 */ |
| 24365 | 24418 | |
| 24366 | 24419 | /************** End of os_os2.c **********************************************/ |
| 24367 | 24420 | /************** Begin file os_unix.c *****************************************/ |
| 24421 | +#line 1 "tsrc/os_unix.c" | |
| 24368 | 24422 | /* |
| 24369 | 24423 | ** 2004 May 22 |
| 24370 | 24424 | ** |
| 24371 | 24425 | ** The author disclaims copyright to this source code. In place of |
| 24372 | 24426 | ** a legal notice, here is a blessing: |
| @@ -24627,10 +24681,11 @@ | ||
| 24627 | 24681 | /* |
| 24628 | 24682 | ** Include code that is common to all os_*.c files |
| 24629 | 24683 | */ |
| 24630 | 24684 | /************** Include os_common.h in the middle of os_unix.c ***************/ |
| 24631 | 24685 | /************** Begin file os_common.h ***************************************/ |
| 24686 | +#line 1 "tsrc/os_common.h" | |
| 24632 | 24687 | /* |
| 24633 | 24688 | ** 2004 May 22 |
| 24634 | 24689 | ** |
| 24635 | 24690 | ** The author disclaims copyright to this source code. In place of |
| 24636 | 24691 | ** a legal notice, here is a blessing: |
| @@ -24680,10 +24735,11 @@ | ||
| 24680 | 24735 | ** hwtime.h contains inline assembler code for implementing |
| 24681 | 24736 | ** high-performance timing routines. |
| 24682 | 24737 | */ |
| 24683 | 24738 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 24684 | 24739 | /************** Begin file hwtime.h ******************************************/ |
| 24740 | +#line 1 "tsrc/hwtime.h" | |
| 24685 | 24741 | /* |
| 24686 | 24742 | ** 2008 May 27 |
| 24687 | 24743 | ** |
| 24688 | 24744 | ** The author disclaims copyright to this source code. In place of |
| 24689 | 24745 | ** a legal notice, here is a blessing: |
| @@ -24768,10 +24824,11 @@ | ||
| 24768 | 24824 | |
| 24769 | 24825 | #endif /* !defined(_HWTIME_H_) */ |
| 24770 | 24826 | |
| 24771 | 24827 | /************** End of hwtime.h **********************************************/ |
| 24772 | 24828 | /************** Continuing where we left off in os_common.h ******************/ |
| 24829 | +#line 53 "tsrc/os_common.h" | |
| 24773 | 24830 | |
| 24774 | 24831 | static sqlite_uint64 g_start; |
| 24775 | 24832 | static sqlite_uint64 g_elapsed; |
| 24776 | 24833 | #define TIMER_START g_start=sqlite3Hwtime() |
| 24777 | 24834 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -24834,10 +24891,11 @@ | ||
| 24834 | 24891 | |
| 24835 | 24892 | #endif /* !defined(_OS_COMMON_H_) */ |
| 24836 | 24893 | |
| 24837 | 24894 | /************** End of os_common.h *******************************************/ |
| 24838 | 24895 | /************** Continuing where we left off in os_unix.c ********************/ |
| 24896 | +#line 265 "tsrc/os_unix.c" | |
| 24839 | 24897 | |
| 24840 | 24898 | /* |
| 24841 | 24899 | ** Define various macros that are missing from some systems. |
| 24842 | 24900 | */ |
| 24843 | 24901 | #ifndef O_LARGEFILE |
| @@ -31343,10 +31401,11 @@ | ||
| 31343 | 31401 | |
| 31344 | 31402 | #endif /* SQLITE_OS_UNIX */ |
| 31345 | 31403 | |
| 31346 | 31404 | /************** End of os_unix.c *********************************************/ |
| 31347 | 31405 | /************** Begin file os_win.c ******************************************/ |
| 31406 | +#line 1 "tsrc/os_win.c" | |
| 31348 | 31407 | /* |
| 31349 | 31408 | ** 2004 May 22 |
| 31350 | 31409 | ** |
| 31351 | 31410 | ** The author disclaims copyright to this source code. In place of |
| 31352 | 31411 | ** a legal notice, here is a blessing: |
| @@ -31404,10 +31463,11 @@ | ||
| 31404 | 31463 | /* |
| 31405 | 31464 | ** Include code that is common to all os_*.c files |
| 31406 | 31465 | */ |
| 31407 | 31466 | /************** Include os_common.h in the middle of os_win.c ****************/ |
| 31408 | 31467 | /************** Begin file os_common.h ***************************************/ |
| 31468 | +#line 1 "tsrc/os_common.h" | |
| 31409 | 31469 | /* |
| 31410 | 31470 | ** 2004 May 22 |
| 31411 | 31471 | ** |
| 31412 | 31472 | ** The author disclaims copyright to this source code. In place of |
| 31413 | 31473 | ** a legal notice, here is a blessing: |
| @@ -31457,10 +31517,11 @@ | ||
| 31457 | 31517 | ** hwtime.h contains inline assembler code for implementing |
| 31458 | 31518 | ** high-performance timing routines. |
| 31459 | 31519 | */ |
| 31460 | 31520 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 31461 | 31521 | /************** Begin file hwtime.h ******************************************/ |
| 31522 | +#line 1 "tsrc/hwtime.h" | |
| 31462 | 31523 | /* |
| 31463 | 31524 | ** 2008 May 27 |
| 31464 | 31525 | ** |
| 31465 | 31526 | ** The author disclaims copyright to this source code. In place of |
| 31466 | 31527 | ** a legal notice, here is a blessing: |
| @@ -31545,10 +31606,11 @@ | ||
| 31545 | 31606 | |
| 31546 | 31607 | #endif /* !defined(_HWTIME_H_) */ |
| 31547 | 31608 | |
| 31548 | 31609 | /************** End of hwtime.h **********************************************/ |
| 31549 | 31610 | /************** Continuing where we left off in os_common.h ******************/ |
| 31611 | +#line 53 "tsrc/os_common.h" | |
| 31550 | 31612 | |
| 31551 | 31613 | static sqlite_uint64 g_start; |
| 31552 | 31614 | static sqlite_uint64 g_elapsed; |
| 31553 | 31615 | #define TIMER_START g_start=sqlite3Hwtime() |
| 31554 | 31616 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -31611,10 +31673,11 @@ | ||
| 31611 | 31673 | |
| 31612 | 31674 | #endif /* !defined(_OS_COMMON_H_) */ |
| 31613 | 31675 | |
| 31614 | 31676 | /************** End of os_common.h *******************************************/ |
| 31615 | 31677 | /************** Continuing where we left off in os_win.c *********************/ |
| 31678 | +#line 62 "tsrc/os_win.c" | |
| 31616 | 31679 | |
| 31617 | 31680 | /* |
| 31618 | 31681 | ** Some microsoft compilers lack this definition. |
| 31619 | 31682 | */ |
| 31620 | 31683 | #ifndef INVALID_FILE_ATTRIBUTES |
| @@ -34746,10 +34809,11 @@ | ||
| 34746 | 34809 | |
| 34747 | 34810 | #endif /* SQLITE_OS_WIN */ |
| 34748 | 34811 | |
| 34749 | 34812 | /************** End of os_win.c **********************************************/ |
| 34750 | 34813 | /************** Begin file bitvec.c ******************************************/ |
| 34814 | +#line 1 "tsrc/bitvec.c" | |
| 34751 | 34815 | /* |
| 34752 | 34816 | ** 2008 February 16 |
| 34753 | 34817 | ** |
| 34754 | 34818 | ** The author disclaims copyright to this source code. In place of |
| 34755 | 34819 | ** a legal notice, here is a blessing: |
| @@ -35156,10 +35220,11 @@ | ||
| 35156 | 35220 | } |
| 35157 | 35221 | #endif /* SQLITE_OMIT_BUILTIN_TEST */ |
| 35158 | 35222 | |
| 35159 | 35223 | /************** End of bitvec.c **********************************************/ |
| 35160 | 35224 | /************** Begin file pcache.c ******************************************/ |
| 35225 | +#line 1 "tsrc/pcache.c" | |
| 35161 | 35226 | /* |
| 35162 | 35227 | ** 2008 August 05 |
| 35163 | 35228 | ** |
| 35164 | 35229 | ** The author disclaims copyright to this source code. In place of |
| 35165 | 35230 | ** a legal notice, here is a blessing: |
| @@ -35752,10 +35817,11 @@ | ||
| 35752 | 35817 | } |
| 35753 | 35818 | #endif |
| 35754 | 35819 | |
| 35755 | 35820 | /************** End of pcache.c **********************************************/ |
| 35756 | 35821 | /************** Begin file pcache1.c *****************************************/ |
| 35822 | +#line 1 "tsrc/pcache1.c" | |
| 35757 | 35823 | /* |
| 35758 | 35824 | ** 2008 November 05 |
| 35759 | 35825 | ** |
| 35760 | 35826 | ** The author disclaims copyright to this source code. In place of |
| 35761 | 35827 | ** a legal notice, here is a blessing: |
| @@ -36968,10 +37034,11 @@ | ||
| 36968 | 37034 | } |
| 36969 | 37035 | #endif |
| 36970 | 37036 | |
| 36971 | 37037 | /************** End of pcache1.c *********************************************/ |
| 36972 | 37038 | /************** Begin file rowset.c ******************************************/ |
| 37039 | +#line 1 "tsrc/rowset.c" | |
| 36973 | 37040 | /* |
| 36974 | 37041 | ** 2008 December 3 |
| 36975 | 37042 | ** |
| 36976 | 37043 | ** The author disclaims copyright to this source code. In place of |
| 36977 | 37044 | ** a legal notice, here is a blessing: |
| @@ -37392,10 +37459,11 @@ | ||
| 37392 | 37459 | return 0; |
| 37393 | 37460 | } |
| 37394 | 37461 | |
| 37395 | 37462 | /************** End of rowset.c **********************************************/ |
| 37396 | 37463 | /************** Begin file pager.c *******************************************/ |
| 37464 | +#line 1 "tsrc/pager.c" | |
| 37397 | 37465 | /* |
| 37398 | 37466 | ** 2001 September 15 |
| 37399 | 37467 | ** |
| 37400 | 37468 | ** The author disclaims copyright to this source code. In place of |
| 37401 | 37469 | ** a legal notice, here is a blessing: |
| @@ -37415,10 +37483,11 @@ | ||
| 37415 | 37483 | ** another is writing. |
| 37416 | 37484 | */ |
| 37417 | 37485 | #ifndef SQLITE_OMIT_DISKIO |
| 37418 | 37486 | /************** Include wal.h in the middle of pager.c ***********************/ |
| 37419 | 37487 | /************** Begin file wal.h *********************************************/ |
| 37488 | +#line 1 "tsrc/wal.h" | |
| 37420 | 37489 | /* |
| 37421 | 37490 | ** 2010 February 1 |
| 37422 | 37491 | ** |
| 37423 | 37492 | ** The author disclaims copyright to this source code. In place of |
| 37424 | 37493 | ** a legal notice, here is a blessing: |
| @@ -37539,10 +37608,11 @@ | ||
| 37539 | 37608 | #endif /* ifndef SQLITE_OMIT_WAL */ |
| 37540 | 37609 | #endif /* _WAL_H_ */ |
| 37541 | 37610 | |
| 37542 | 37611 | /************** End of wal.h *************************************************/ |
| 37543 | 37612 | /************** Continuing where we left off in pager.c **********************/ |
| 37613 | +#line 24 "tsrc/pager.c" | |
| 37544 | 37614 | |
| 37545 | 37615 | |
| 37546 | 37616 | /******************* NOTES ON THE DESIGN OF THE PAGER ************************ |
| 37547 | 37617 | ** |
| 37548 | 37618 | ** This comment block describes invariants that hold when using a rollback |
| @@ -44352,10 +44422,11 @@ | ||
| 44352 | 44422 | |
| 44353 | 44423 | #endif /* SQLITE_OMIT_DISKIO */ |
| 44354 | 44424 | |
| 44355 | 44425 | /************** End of pager.c ***********************************************/ |
| 44356 | 44426 | /************** Begin file wal.c *********************************************/ |
| 44427 | +#line 1 "tsrc/wal.c" | |
| 44357 | 44428 | /* |
| 44358 | 44429 | ** 2010 February 1 |
| 44359 | 44430 | ** |
| 44360 | 44431 | ** The author disclaims copyright to this source code. In place of |
| 44361 | 44432 | ** a legal notice, here is a blessing: |
| @@ -47306,10 +47377,11 @@ | ||
| 47306 | 47377 | |
| 47307 | 47378 | #endif /* #ifndef SQLITE_OMIT_WAL */ |
| 47308 | 47379 | |
| 47309 | 47380 | /************** End of wal.c *************************************************/ |
| 47310 | 47381 | /************** Begin file btmutex.c *****************************************/ |
| 47382 | +#line 1 "tsrc/btmutex.c" | |
| 47311 | 47383 | /* |
| 47312 | 47384 | ** 2007 August 27 |
| 47313 | 47385 | ** |
| 47314 | 47386 | ** The author disclaims copyright to this source code. In place of |
| 47315 | 47387 | ** a legal notice, here is a blessing: |
| @@ -47325,10 +47397,11 @@ | ||
| 47325 | 47397 | ** big and we want to break it down some. This packaged seemed like |
| 47326 | 47398 | ** a good breakout. |
| 47327 | 47399 | */ |
| 47328 | 47400 | /************** Include btreeInt.h in the middle of btmutex.c ****************/ |
| 47329 | 47401 | /************** Begin file btreeInt.h ****************************************/ |
| 47402 | +#line 1 "tsrc/btreeInt.h" | |
| 47330 | 47403 | /* |
| 47331 | 47404 | ** 2004 April 6 |
| 47332 | 47405 | ** |
| 47333 | 47406 | ** The author disclaims copyright to this source code. In place of |
| 47334 | 47407 | ** a legal notice, here is a blessing: |
| @@ -47970,10 +48043,11 @@ | ||
| 47970 | 48043 | #define get4byte sqlite3Get4byte |
| 47971 | 48044 | #define put4byte sqlite3Put4byte |
| 47972 | 48045 | |
| 47973 | 48046 | /************** End of btreeInt.h ********************************************/ |
| 47974 | 48047 | /************** Continuing where we left off in btmutex.c ********************/ |
| 48048 | +#line 19 "tsrc/btmutex.c" | |
| 47975 | 48049 | #ifndef SQLITE_OMIT_SHARED_CACHE |
| 47976 | 48050 | #if SQLITE_THREADSAFE |
| 47977 | 48051 | |
| 47978 | 48052 | /* |
| 47979 | 48053 | ** Obtain the BtShared mutex associated with B-Tree handle p. Also, |
| @@ -48242,10 +48316,11 @@ | ||
| 48242 | 48316 | #endif /* if SQLITE_THREADSAFE */ |
| 48243 | 48317 | #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */ |
| 48244 | 48318 | |
| 48245 | 48319 | /************** End of btmutex.c *********************************************/ |
| 48246 | 48320 | /************** Begin file btree.c *******************************************/ |
| 48321 | +#line 1 "tsrc/btree.c" | |
| 48247 | 48322 | /* |
| 48248 | 48323 | ** 2004 April 6 |
| 48249 | 48324 | ** |
| 48250 | 48325 | ** The author disclaims copyright to this source code. In place of |
| 48251 | 48326 | ** a legal notice, here is a blessing: |
| @@ -48899,22 +48974,25 @@ | ||
| 48899 | 48974 | int *pRes /* Write search results here */ |
| 48900 | 48975 | ){ |
| 48901 | 48976 | int rc; /* Status code */ |
| 48902 | 48977 | UnpackedRecord *pIdxKey; /* Unpacked index key */ |
| 48903 | 48978 | char aSpace[150]; /* Temp space for pIdxKey - to avoid a malloc */ |
| 48979 | + char *pFree = 0; | |
| 48904 | 48980 | |
| 48905 | 48981 | if( pKey ){ |
| 48906 | 48982 | assert( nKey==(i64)(int)nKey ); |
| 48907 | - pIdxKey = sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, | |
| 48908 | - aSpace, sizeof(aSpace)); | |
| 48983 | + pIdxKey = sqlite3VdbeAllocUnpackedRecord( | |
| 48984 | + pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree | |
| 48985 | + ); | |
| 48909 | 48986 | if( pIdxKey==0 ) return SQLITE_NOMEM; |
| 48987 | + sqlite3VdbeRecordUnpack(pCur->pKeyInfo, nKey, pKey, pIdxKey); | |
| 48910 | 48988 | }else{ |
| 48911 | 48989 | pIdxKey = 0; |
| 48912 | 48990 | } |
| 48913 | 48991 | rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes); |
| 48914 | - if( pKey ){ | |
| 48915 | - sqlite3VdbeDeleteUnpackedRecord(pIdxKey); | |
| 48992 | + if( pFree ){ | |
| 48993 | + sqlite3DbFree(pCur->pKeyInfo->db, pFree); | |
| 48916 | 48994 | } |
| 48917 | 48995 | return rc; |
| 48918 | 48996 | } |
| 48919 | 48997 | |
| 48920 | 48998 | /* |
| @@ -56426,10 +56504,11 @@ | ||
| 56426 | 56504 | return rc; |
| 56427 | 56505 | } |
| 56428 | 56506 | |
| 56429 | 56507 | /************** End of btree.c ***********************************************/ |
| 56430 | 56508 | /************** Begin file backup.c ******************************************/ |
| 56509 | +#line 1 "tsrc/backup.c" | |
| 56431 | 56510 | /* |
| 56432 | 56511 | ** 2009 January 28 |
| 56433 | 56512 | ** |
| 56434 | 56513 | ** The author disclaims copyright to this source code. In place of |
| 56435 | 56514 | ** a legal notice, here is a blessing: |
| @@ -57132,10 +57211,11 @@ | ||
| 57132 | 57211 | } |
| 57133 | 57212 | #endif /* SQLITE_OMIT_VACUUM */ |
| 57134 | 57213 | |
| 57135 | 57214 | /************** End of backup.c **********************************************/ |
| 57136 | 57215 | /************** Begin file vdbemem.c *****************************************/ |
| 57216 | +#line 1 "tsrc/vdbemem.c" | |
| 57137 | 57217 | /* |
| 57138 | 57218 | ** 2004 May 26 |
| 57139 | 57219 | ** |
| 57140 | 57220 | ** The author disclaims copyright to this source code. In place of |
| 57141 | 57221 | ** a legal notice, here is a blessing: |
| @@ -58286,10 +58366,11 @@ | ||
| 58286 | 58366 | return 0; |
| 58287 | 58367 | } |
| 58288 | 58368 | |
| 58289 | 58369 | /************** End of vdbemem.c *********************************************/ |
| 58290 | 58370 | /************** Begin file vdbeaux.c *****************************************/ |
| 58371 | +#line 1 "tsrc/vdbeaux.c" | |
| 58291 | 58372 | /* |
| 58292 | 58373 | ** 2003 September 6 |
| 58293 | 58374 | ** |
| 58294 | 58375 | ** The author disclaims copyright to this source code. In place of |
| 58295 | 58376 | ** a legal notice, here is a blessing: |
| @@ -61116,61 +61197,74 @@ | ||
| 61116 | 61197 | } |
| 61117 | 61198 | } |
| 61118 | 61199 | return 0; |
| 61119 | 61200 | } |
| 61120 | 61201 | |
| 61121 | - | |
| 61122 | -/* | |
| 61123 | -** Given the nKey-byte encoding of a record in pKey[], parse the | |
| 61124 | -** record into a UnpackedRecord structure. Return a pointer to | |
| 61125 | -** that structure. | |
| 61126 | -** | |
| 61127 | -** The calling function might provide szSpace bytes of memory | |
| 61128 | -** space at pSpace. This space can be used to hold the returned | |
| 61129 | -** VDbeParsedRecord structure if it is large enough. If it is | |
| 61130 | -** not big enough, space is obtained from sqlite3_malloc(). | |
| 61131 | -** | |
| 61132 | -** The returned structure should be closed by a call to | |
| 61133 | -** sqlite3VdbeDeleteUnpackedRecord(). | |
| 61134 | -*/ | |
| 61135 | -SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack( | |
| 61136 | - KeyInfo *pKeyInfo, /* Information about the record format */ | |
| 61137 | - int nKey, /* Size of the binary record */ | |
| 61138 | - const void *pKey, /* The binary record */ | |
| 61139 | - char *pSpace, /* Unaligned space available to hold the object */ | |
| 61140 | - int szSpace /* Size of pSpace[] in bytes */ | |
| 61141 | -){ | |
| 61142 | - const unsigned char *aKey = (const unsigned char *)pKey; | |
| 61143 | - UnpackedRecord *p; /* The unpacked record that we will return */ | |
| 61144 | - int nByte; /* Memory space needed to hold p, in bytes */ | |
| 61145 | - int d; | |
| 61146 | - u32 idx; | |
| 61147 | - u16 u; /* Unsigned loop counter */ | |
| 61148 | - u32 szHdr; | |
| 61149 | - Mem *pMem; | |
| 61150 | - int nOff; /* Increase pSpace by this much to 8-byte align it */ | |
| 61151 | - | |
| 61152 | - /* | |
| 61153 | - ** We want to shift the pointer pSpace up such that it is 8-byte aligned. | |
| 61202 | +/* | |
| 61203 | +** This routine is used to allocate sufficient space for an UnpackedRecord | |
| 61204 | +** structure large enough to be used with sqlite3VdbeRecordUnpack() if | |
| 61205 | +** the first argument is a pointer to KeyInfo structure pKeyInfo. | |
| 61206 | +** | |
| 61207 | +** The space is either allocated using sqlite3DbMallocRaw() or from within | |
| 61208 | +** the unaligned buffer passed via the second and third arguments (presumably | |
| 61209 | +** stack space). If the former, then *ppFree is set to a pointer that should | |
| 61210 | +** be eventually freed by the caller using sqlite3DbFree(). Or, if the | |
| 61211 | +** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL | |
| 61212 | +** before returning. | |
| 61213 | +** | |
| 61214 | +** If an OOM error occurs, NULL is returned. | |
| 61215 | +*/ | |
| 61216 | +SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord( | |
| 61217 | + KeyInfo *pKeyInfo, /* Description of the record */ | |
| 61218 | + char *pSpace, /* Unaligned space available */ | |
| 61219 | + int szSpace, /* Size of pSpace[] in bytes */ | |
| 61220 | + char **ppFree /* OUT: Caller should free this pointer */ | |
| 61221 | +){ | |
| 61222 | + UnpackedRecord *p; /* Unpacked record to return */ | |
| 61223 | + int nOff; /* Increment pSpace by nOff to align it */ | |
| 61224 | + int nByte; /* Number of bytes required for *p */ | |
| 61225 | + | |
| 61226 | + /* We want to shift the pointer pSpace up such that it is 8-byte aligned. | |
| 61154 | 61227 | ** Thus, we need to calculate a value, nOff, between 0 and 7, to shift |
| 61155 | 61228 | ** it by. If pSpace is already 8-byte aligned, nOff should be zero. |
| 61156 | 61229 | */ |
| 61157 | 61230 | nOff = (8 - (SQLITE_PTR_TO_INT(pSpace) & 7)) & 7; |
| 61158 | - pSpace += nOff; | |
| 61159 | - szSpace -= nOff; | |
| 61160 | 61231 | nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nField+1); |
| 61161 | - if( nByte>szSpace ){ | |
| 61162 | - p = sqlite3DbMallocRaw(pKeyInfo->db, nByte); | |
| 61163 | - if( p==0 ) return 0; | |
| 61164 | - p->flags = UNPACKED_NEED_FREE | UNPACKED_NEED_DESTROY; | |
| 61232 | + if( nByte>szSpace+nOff ){ | |
| 61233 | + p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte); | |
| 61234 | + *ppFree = (char *)p; | |
| 61235 | + if( !p ) return 0; | |
| 61165 | 61236 | }else{ |
| 61166 | - p = (UnpackedRecord*)pSpace; | |
| 61167 | - p->flags = UNPACKED_NEED_DESTROY; | |
| 61237 | + p = (UnpackedRecord*)&pSpace[nOff]; | |
| 61238 | + *ppFree = 0; | |
| 61168 | 61239 | } |
| 61240 | + | |
| 61241 | + p->aMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))]; | |
| 61169 | 61242 | p->pKeyInfo = pKeyInfo; |
| 61170 | 61243 | p->nField = pKeyInfo->nField + 1; |
| 61171 | - p->aMem = pMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))]; | |
| 61244 | + return p; | |
| 61245 | +} | |
| 61246 | + | |
| 61247 | +/* | |
| 61248 | +** Given the nKey-byte encoding of a record in pKey[], populate the | |
| 61249 | +** UnpackedRecord structure indicated by the fourth argument with the | |
| 61250 | +** contents of the decoded record. | |
| 61251 | +*/ | |
| 61252 | +SQLITE_PRIVATE void sqlite3VdbeRecordUnpack( | |
| 61253 | + KeyInfo *pKeyInfo, /* Information about the record format */ | |
| 61254 | + int nKey, /* Size of the binary record */ | |
| 61255 | + const void *pKey, /* The binary record */ | |
| 61256 | + UnpackedRecord *p /* Populate this structure before returning. */ | |
| 61257 | +){ | |
| 61258 | + const unsigned char *aKey = (const unsigned char *)pKey; | |
| 61259 | + int d; | |
| 61260 | + u32 idx; /* Offset in aKey[] to read from */ | |
| 61261 | + u16 u; /* Unsigned loop counter */ | |
| 61262 | + u32 szHdr; | |
| 61263 | + Mem *pMem = p->aMem; | |
| 61264 | + | |
| 61265 | + p->flags = 0; | |
| 61172 | 61266 | assert( EIGHT_BYTE_ALIGNMENT(pMem) ); |
| 61173 | 61267 | idx = getVarint32(aKey, szHdr); |
| 61174 | 61268 | d = szHdr; |
| 61175 | 61269 | u = 0; |
| 61176 | 61270 | while( idx<szHdr && u<p->nField && d<=nKey ){ |
| @@ -61185,35 +61279,10 @@ | ||
| 61185 | 61279 | pMem++; |
| 61186 | 61280 | u++; |
| 61187 | 61281 | } |
| 61188 | 61282 | assert( u<=pKeyInfo->nField + 1 ); |
| 61189 | 61283 | p->nField = u; |
| 61190 | - return (void*)p; | |
| 61191 | -} | |
| 61192 | - | |
| 61193 | -/* | |
| 61194 | -** This routine destroys a UnpackedRecord object. | |
| 61195 | -*/ | |
| 61196 | -SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord *p){ | |
| 61197 | -#ifdef SQLITE_DEBUG | |
| 61198 | - int i; | |
| 61199 | - Mem *pMem; | |
| 61200 | - | |
| 61201 | - assert( p!=0 ); | |
| 61202 | - assert( p->flags & UNPACKED_NEED_DESTROY ); | |
| 61203 | - for(i=0, pMem=p->aMem; i<p->nField; i++, pMem++){ | |
| 61204 | - /* The unpacked record is always constructed by the | |
| 61205 | - ** sqlite3VdbeUnpackRecord() function above, which makes all | |
| 61206 | - ** strings and blobs static. And none of the elements are | |
| 61207 | - ** ever transformed, so there is never anything to delete. | |
| 61208 | - */ | |
| 61209 | - if( NEVER(pMem->zMalloc) ) sqlite3VdbeMemRelease(pMem); | |
| 61210 | - } | |
| 61211 | -#endif | |
| 61212 | - if( p->flags & UNPACKED_NEED_FREE ){ | |
| 61213 | - sqlite3DbFree(p->pKeyInfo->db, p); | |
| 61214 | - } | |
| 61215 | 61284 | } |
| 61216 | 61285 | |
| 61217 | 61286 | /* |
| 61218 | 61287 | ** This function compares the two table rows or index records |
| 61219 | 61288 | ** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero |
| @@ -61540,10 +61609,11 @@ | ||
| 61540 | 61609 | } |
| 61541 | 61610 | } |
| 61542 | 61611 | |
| 61543 | 61612 | /************** End of vdbeaux.c *********************************************/ |
| 61544 | 61613 | /************** Begin file vdbeapi.c *****************************************/ |
| 61614 | +#line 1 "tsrc/vdbeapi.c" | |
| 61545 | 61615 | /* |
| 61546 | 61616 | ** 2004 May 26 |
| 61547 | 61617 | ** |
| 61548 | 61618 | ** The author disclaims copyright to this source code. In place of |
| 61549 | 61619 | ** a legal notice, here is a blessing: |
| @@ -62847,10 +62917,11 @@ | ||
| 62847 | 62917 | return v; |
| 62848 | 62918 | } |
| 62849 | 62919 | |
| 62850 | 62920 | /************** End of vdbeapi.c *********************************************/ |
| 62851 | 62921 | /************** Begin file vdbetrace.c ***************************************/ |
| 62922 | +#line 1 "tsrc/vdbetrace.c" | |
| 62852 | 62923 | /* |
| 62853 | 62924 | ** 2009 November 25 |
| 62854 | 62925 | ** |
| 62855 | 62926 | ** The author disclaims copyright to this source code. In place of |
| 62856 | 62927 | ** a legal notice, here is a blessing: |
| @@ -63002,10 +63073,11 @@ | ||
| 63002 | 63073 | |
| 63003 | 63074 | #endif /* #ifndef SQLITE_OMIT_TRACE */ |
| 63004 | 63075 | |
| 63005 | 63076 | /************** End of vdbetrace.c *******************************************/ |
| 63006 | 63077 | /************** Begin file vdbe.c ********************************************/ |
| 63078 | +#line 1 "tsrc/vdbe.c" | |
| 63007 | 63079 | /* |
| 63008 | 63080 | ** 2001 September 15 |
| 63009 | 63081 | ** |
| 63010 | 63082 | ** The author disclaims copyright to this source code. In place of |
| 63011 | 63083 | ** a legal notice, here is a blessing: |
| @@ -63471,10 +63543,11 @@ | ||
| 63471 | 63543 | ** hwtime.h contains inline assembler code for implementing |
| 63472 | 63544 | ** high-performance timing routines. |
| 63473 | 63545 | */ |
| 63474 | 63546 | /************** Include hwtime.h in the middle of vdbe.c *********************/ |
| 63475 | 63547 | /************** Begin file hwtime.h ******************************************/ |
| 63548 | +#line 1 "tsrc/hwtime.h" | |
| 63476 | 63549 | /* |
| 63477 | 63550 | ** 2008 May 27 |
| 63478 | 63551 | ** |
| 63479 | 63552 | ** The author disclaims copyright to this source code. In place of |
| 63480 | 63553 | ** a legal notice, here is a blessing: |
| @@ -63559,10 +63632,11 @@ | ||
| 63559 | 63632 | |
| 63560 | 63633 | #endif /* !defined(_HWTIME_H_) */ |
| 63561 | 63634 | |
| 63562 | 63635 | /************** End of hwtime.h **********************************************/ |
| 63563 | 63636 | /************** Continuing where we left off in vdbe.c ***********************/ |
| 63637 | +#line 471 "tsrc/vdbe.c" | |
| 63564 | 63638 | |
| 63565 | 63639 | #endif |
| 63566 | 63640 | |
| 63567 | 63641 | /* |
| 63568 | 63642 | ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the |
| @@ -63853,10 +63927,11 @@ | ||
| 63853 | 63927 | } bb; |
| 63854 | 63928 | struct OP_Found_stack_vars { |
| 63855 | 63929 | int alreadyExists; |
| 63856 | 63930 | VdbeCursor *pC; |
| 63857 | 63931 | int res; |
| 63932 | + char *pFree; | |
| 63858 | 63933 | UnpackedRecord *pIdxKey; |
| 63859 | 63934 | UnpackedRecord r; |
| 63860 | 63935 | char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7]; |
| 63861 | 63936 | } bc; |
| 63862 | 63937 | struct OP_IsUnique_stack_vars { |
| @@ -67097,10 +67172,11 @@ | ||
| 67097 | 67172 | case OP_Found: { /* jump, in3 */ |
| 67098 | 67173 | #if 0 /* local variables moved into u.bc */ |
| 67099 | 67174 | int alreadyExists; |
| 67100 | 67175 | VdbeCursor *pC; |
| 67101 | 67176 | int res; |
| 67177 | + char *pFree; | |
| 67102 | 67178 | UnpackedRecord *pIdxKey; |
| 67103 | 67179 | UnpackedRecord r; |
| 67104 | 67180 | char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7]; |
| 67105 | 67181 | #endif /* local variables moved into u.bc */ |
| 67106 | 67182 | |
| @@ -67125,22 +67201,22 @@ | ||
| 67125 | 67201 | { int i; for(i=0; i<u.bc.r.nField; i++) assert( memIsValid(&u.bc.r.aMem[i]) ); } |
| 67126 | 67202 | #endif |
| 67127 | 67203 | u.bc.r.flags = UNPACKED_PREFIX_MATCH; |
| 67128 | 67204 | u.bc.pIdxKey = &u.bc.r; |
| 67129 | 67205 | }else{ |
| 67206 | + u.bc.pIdxKey = sqlite3VdbeAllocUnpackedRecord( | |
| 67207 | + u.bc.pC->pKeyInfo, u.bc.aTempRec, sizeof(u.bc.aTempRec), &u.bc.pFree | |
| 67208 | + ); | |
| 67209 | + if( u.bc.pIdxKey==0 ) goto no_mem; | |
| 67130 | 67210 | assert( pIn3->flags & MEM_Blob ); |
| 67131 | 67211 | assert( (pIn3->flags & MEM_Zero)==0 ); /* zeroblobs already expanded */ |
| 67132 | - u.bc.pIdxKey = sqlite3VdbeRecordUnpack(u.bc.pC->pKeyInfo, pIn3->n, pIn3->z, | |
| 67133 | - u.bc.aTempRec, sizeof(u.bc.aTempRec)); | |
| 67134 | - if( u.bc.pIdxKey==0 ){ | |
| 67135 | - goto no_mem; | |
| 67136 | - } | |
| 67212 | + sqlite3VdbeRecordUnpack(u.bc.pC->pKeyInfo, pIn3->n, pIn3->z, u.bc.pIdxKey); | |
| 67137 | 67213 | u.bc.pIdxKey->flags |= UNPACKED_PREFIX_MATCH; |
| 67138 | 67214 | } |
| 67139 | 67215 | rc = sqlite3BtreeMovetoUnpacked(u.bc.pC->pCursor, u.bc.pIdxKey, 0, 0, &u.bc.res); |
| 67140 | 67216 | if( pOp->p4.i==0 ){ |
| 67141 | - sqlite3VdbeDeleteUnpackedRecord(u.bc.pIdxKey); | |
| 67217 | + sqlite3DbFree(db, u.bc.pFree); | |
| 67142 | 67218 | } |
| 67143 | 67219 | if( rc!=SQLITE_OK ){ |
| 67144 | 67220 | break; |
| 67145 | 67221 | } |
| 67146 | 67222 | u.bc.alreadyExists = (u.bc.res==0); |
| @@ -69784,10 +69860,11 @@ | ||
| 69784 | 69860 | goto vdbe_error_halt; |
| 69785 | 69861 | } |
| 69786 | 69862 | |
| 69787 | 69863 | /************** End of vdbe.c ************************************************/ |
| 69788 | 69864 | /************** Begin file vdbeblob.c ****************************************/ |
| 69865 | +#line 1 "tsrc/vdbeblob.c" | |
| 69789 | 69866 | /* |
| 69790 | 69867 | ** 2007 May 1 |
| 69791 | 69868 | ** |
| 69792 | 69869 | ** The author disclaims copyright to this source code. In place of |
| 69793 | 69870 | ** a legal notice, here is a blessing: |
| @@ -70254,10 +70331,11 @@ | ||
| 70254 | 70331 | |
| 70255 | 70332 | #endif /* #ifndef SQLITE_OMIT_INCRBLOB */ |
| 70256 | 70333 | |
| 70257 | 70334 | /************** End of vdbeblob.c ********************************************/ |
| 70258 | 70335 | /************** Begin file vdbesort.c ****************************************/ |
| 70336 | +#line 1 "tsrc/vdbesort.c" | |
| 70259 | 70337 | /* |
| 70260 | 70338 | ** 2011 July 9 |
| 70261 | 70339 | ** |
| 70262 | 70340 | ** The author disclaims copyright to this source code. In place of |
| 70263 | 70341 | ** a legal notice, here is a blessing: |
| @@ -70358,12 +70436,11 @@ | ||
| 70358 | 70436 | sqlite3_file *pTemp1; /* PMA file 1 */ |
| 70359 | 70437 | int nPMA; /* Number of PMAs stored in pTemp1 */ |
| 70360 | 70438 | SorterRecord *pRecord; /* Head of in-memory record list */ |
| 70361 | 70439 | int mnPmaSize; /* Minimum PMA size, in bytes */ |
| 70362 | 70440 | int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */ |
| 70363 | - char *aSpace; /* Space for UnpackRecord() */ | |
| 70364 | - int nSpace; /* Size of aSpace in bytes */ | |
| 70441 | + UnpackedRecord *pUnpacked; /* Used to unpack keys */ | |
| 70365 | 70442 | }; |
| 70366 | 70443 | |
| 70367 | 70444 | /* |
| 70368 | 70445 | ** The following type is an iterator for a PMA. It caches the current key in |
| 70369 | 70446 | ** variables nKey/aKey. If the iterator is at EOF, pFile==0. |
| @@ -70553,56 +70630,39 @@ | ||
| 70553 | 70630 | ** be less than key2. Even if key2 also contains NULL values. |
| 70554 | 70631 | ** |
| 70555 | 70632 | ** If pKey2 is passed a NULL pointer, then it is assumed that the pCsr->aSpace |
| 70556 | 70633 | ** has been allocated and contains an unpacked record that is used as key2. |
| 70557 | 70634 | */ |
| 70558 | -static int vdbeSorterCompare( | |
| 70635 | +static void vdbeSorterCompare( | |
| 70559 | 70636 | VdbeCursor *pCsr, /* Cursor object (for pKeyInfo) */ |
| 70560 | 70637 | int bOmitRowid, /* Ignore rowid field at end of keys */ |
| 70561 | 70638 | void *pKey1, int nKey1, /* Left side of comparison */ |
| 70562 | 70639 | void *pKey2, int nKey2, /* Right side of comparison */ |
| 70563 | 70640 | int *pRes /* OUT: Result of comparison */ |
| 70564 | 70641 | ){ |
| 70565 | 70642 | KeyInfo *pKeyInfo = pCsr->pKeyInfo; |
| 70566 | 70643 | VdbeSorter *pSorter = pCsr->pSorter; |
| 70567 | - char *aSpace = pSorter->aSpace; | |
| 70568 | - int nSpace = pSorter->nSpace; | |
| 70569 | - UnpackedRecord *r2; | |
| 70644 | + UnpackedRecord *r2 = pSorter->pUnpacked; | |
| 70570 | 70645 | int i; |
| 70571 | 70646 | |
| 70572 | - if( aSpace==0 ){ | |
| 70573 | - nSpace = ROUND8(sizeof(UnpackedRecord))+(pKeyInfo->nField+1)*sizeof(Mem); | |
| 70574 | - aSpace = (char *)sqlite3Malloc(nSpace); | |
| 70575 | - if( aSpace==0 ) return SQLITE_NOMEM; | |
| 70576 | - pSorter->aSpace = aSpace; | |
| 70577 | - pSorter->nSpace = nSpace; | |
| 70578 | - } | |
| 70579 | - | |
| 70580 | 70647 | if( pKey2 ){ |
| 70581 | - /* This call cannot fail. As the memory is already allocated. */ | |
| 70582 | - r2 = sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, aSpace, nSpace); | |
| 70583 | - assert( r2 && (r2->flags & UNPACKED_NEED_FREE)==0 ); | |
| 70584 | - assert( r2==(UnpackedRecord*)aSpace ); | |
| 70585 | - }else{ | |
| 70586 | - r2 = (UnpackedRecord *)aSpace; | |
| 70587 | - assert( !bOmitRowid ); | |
| 70648 | + sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, r2); | |
| 70588 | 70649 | } |
| 70589 | 70650 | |
| 70590 | 70651 | if( bOmitRowid ){ |
| 70591 | - for(i=0; i<r2->nField-1; i++){ | |
| 70652 | + r2->nField = pKeyInfo->nField; | |
| 70653 | + assert( r2->nField>0 ); | |
| 70654 | + for(i=0; i<r2->nField; i++){ | |
| 70592 | 70655 | if( r2->aMem[i].flags & MEM_Null ){ |
| 70593 | 70656 | *pRes = -1; |
| 70594 | - return SQLITE_OK; | |
| 70657 | + return; | |
| 70595 | 70658 | } |
| 70596 | 70659 | } |
| 70597 | 70660 | r2->flags |= UNPACKED_PREFIX_MATCH; |
| 70598 | - r2->nField--; | |
| 70599 | - assert( r2->nField>0 ); | |
| 70600 | 70661 | } |
| 70601 | 70662 | |
| 70602 | 70663 | *pRes = sqlite3VdbeRecordCompare(nKey1, pKey1, r2); |
| 70603 | - return SQLITE_OK; | |
| 70604 | 70664 | } |
| 70605 | 70665 | |
| 70606 | 70666 | /* |
| 70607 | 70667 | ** This function is called to compare two iterator keys when merging |
| 70608 | 70668 | ** multiple b-tree segments. Parameter iOut is the index of the aTree[] |
| @@ -70633,19 +70693,14 @@ | ||
| 70633 | 70693 | iRes = i2; |
| 70634 | 70694 | }else if( p2->pFile==0 ){ |
| 70635 | 70695 | iRes = i1; |
| 70636 | 70696 | }else{ |
| 70637 | 70697 | int res; |
| 70638 | - int rc; | |
| 70639 | - assert( pCsr->pSorter->aSpace!=0 ); /* allocated in vdbeSorterMerge() */ | |
| 70640 | - rc = vdbeSorterCompare( | |
| 70698 | + assert( pCsr->pSorter->pUnpacked!=0 ); /* allocated in vdbeSorterMerge() */ | |
| 70699 | + vdbeSorterCompare( | |
| 70641 | 70700 | pCsr, 0, p1->aKey, p1->nKey, p2->aKey, p2->nKey, &res |
| 70642 | 70701 | ); |
| 70643 | - /* The vdbeSorterCompare() call cannot fail since pCsr->pSorter->aSpace | |
| 70644 | - ** has already been allocated. */ | |
| 70645 | - assert( rc==SQLITE_OK ); | |
| 70646 | - | |
| 70647 | 70702 | if( res<=0 ){ |
| 70648 | 70703 | iRes = i1; |
| 70649 | 70704 | }else{ |
| 70650 | 70705 | iRes = i2; |
| 70651 | 70706 | } |
| @@ -70660,16 +70715,21 @@ | ||
| 70660 | 70715 | */ |
| 70661 | 70716 | SQLITE_PRIVATE int sqlite3VdbeSorterInit(sqlite3 *db, VdbeCursor *pCsr){ |
| 70662 | 70717 | int pgsz; /* Page size of main database */ |
| 70663 | 70718 | int mxCache; /* Cache size */ |
| 70664 | 70719 | VdbeSorter *pSorter; /* The new sorter */ |
| 70720 | + char *d; /* Dummy */ | |
| 70665 | 70721 | |
| 70666 | 70722 | assert( pCsr->pKeyInfo && pCsr->pBt==0 ); |
| 70667 | 70723 | pCsr->pSorter = pSorter = sqlite3DbMallocZero(db, sizeof(VdbeSorter)); |
| 70668 | 70724 | if( pSorter==0 ){ |
| 70669 | 70725 | return SQLITE_NOMEM; |
| 70670 | 70726 | } |
| 70727 | + | |
| 70728 | + pSorter->pUnpacked = sqlite3VdbeAllocUnpackedRecord(pCsr->pKeyInfo, 0, 0, &d); | |
| 70729 | + if( pSorter->pUnpacked==0 ) return SQLITE_NOMEM; | |
| 70730 | + assert( pSorter->pUnpacked==(UnpackedRecord *)d ); | |
| 70671 | 70731 | |
| 70672 | 70732 | if( !sqlite3TempInMemory(db) ){ |
| 70673 | 70733 | pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt); |
| 70674 | 70734 | pSorter->mnPmaSize = SORTER_MIN_WORKING * pgsz; |
| 70675 | 70735 | mxCache = db->aDb[0].pSchema->cache_size; |
| @@ -70707,11 +70767,11 @@ | ||
| 70707 | 70767 | } |
| 70708 | 70768 | if( pSorter->pTemp1 ){ |
| 70709 | 70769 | sqlite3OsCloseFree(pSorter->pTemp1); |
| 70710 | 70770 | } |
| 70711 | 70771 | vdbeSorterRecordFree(db, pSorter->pRecord); |
| 70712 | - sqlite3_free(pSorter->aSpace); | |
| 70772 | + sqlite3DbFree(db, pSorter->pUnpacked); | |
| 70713 | 70773 | sqlite3DbFree(db, pSorter); |
| 70714 | 70774 | pCsr->pSorter = 0; |
| 70715 | 70775 | } |
| 70716 | 70776 | } |
| 70717 | 70777 | |
| @@ -70728,36 +70788,26 @@ | ||
| 70728 | 70788 | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE, &dummy |
| 70729 | 70789 | ); |
| 70730 | 70790 | } |
| 70731 | 70791 | |
| 70732 | 70792 | /* |
| 70733 | -** Attemp to merge the two sorted lists p1 and p2 into a single list. If no | |
| 70734 | -** error occurs set *ppOut to the head of the new list and return SQLITE_OK. | |
| 70793 | +** Merge the two sorted lists p1 and p2 into a single list. | |
| 70794 | +** Set *ppOut to the head of the new list. | |
| 70735 | 70795 | */ |
| 70736 | -static int vdbeSorterMerge( | |
| 70737 | - sqlite3 *db, /* Database handle */ | |
| 70796 | +static void vdbeSorterMerge( | |
| 70738 | 70797 | VdbeCursor *pCsr, /* For pKeyInfo */ |
| 70739 | 70798 | SorterRecord *p1, /* First list to merge */ |
| 70740 | 70799 | SorterRecord *p2, /* Second list to merge */ |
| 70741 | 70800 | SorterRecord **ppOut /* OUT: Head of merged list */ |
| 70742 | 70801 | ){ |
| 70743 | - int rc = SQLITE_OK; | |
| 70744 | 70802 | SorterRecord *pFinal = 0; |
| 70745 | 70803 | SorterRecord **pp = &pFinal; |
| 70746 | 70804 | void *pVal2 = p2 ? p2->pVal : 0; |
| 70747 | 70805 | |
| 70748 | 70806 | while( p1 && p2 ){ |
| 70749 | 70807 | int res; |
| 70750 | - rc = vdbeSorterCompare(pCsr, 0, p1->pVal, p1->nVal, pVal2, p2->nVal, &res); | |
| 70751 | - if( rc!=SQLITE_OK ){ | |
| 70752 | - *pp = 0; | |
| 70753 | - vdbeSorterRecordFree(db, p1); | |
| 70754 | - vdbeSorterRecordFree(db, p2); | |
| 70755 | - vdbeSorterRecordFree(db, pFinal); | |
| 70756 | - *ppOut = 0; | |
| 70757 | - return rc; | |
| 70758 | - } | |
| 70808 | + vdbeSorterCompare(pCsr, 0, p1->pVal, p1->nVal, pVal2, p2->nVal, &res); | |
| 70759 | 70809 | if( res<=0 ){ |
| 70760 | 70810 | *pp = p1; |
| 70761 | 70811 | pp = &p1->pNext; |
| 70762 | 70812 | p1 = p1->pNext; |
| 70763 | 70813 | pVal2 = 0; |
| @@ -70768,22 +70818,19 @@ | ||
| 70768 | 70818 | if( p2==0 ) break; |
| 70769 | 70819 | pVal2 = p2->pVal; |
| 70770 | 70820 | } |
| 70771 | 70821 | } |
| 70772 | 70822 | *pp = p1 ? p1 : p2; |
| 70773 | - | |
| 70774 | 70823 | *ppOut = pFinal; |
| 70775 | - return SQLITE_OK; | |
| 70776 | 70824 | } |
| 70777 | 70825 | |
| 70778 | 70826 | /* |
| 70779 | 70827 | ** Sort the linked list of records headed at pCsr->pRecord. Return SQLITE_OK |
| 70780 | 70828 | ** if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if an error |
| 70781 | 70829 | ** occurs. |
| 70782 | 70830 | */ |
| 70783 | -static int vdbeSorterSort(sqlite3 *db, VdbeCursor *pCsr){ | |
| 70784 | - int rc = SQLITE_OK; | |
| 70831 | +static int vdbeSorterSort(VdbeCursor *pCsr){ | |
| 70785 | 70832 | int i; |
| 70786 | 70833 | SorterRecord **aSlot; |
| 70787 | 70834 | SorterRecord *p; |
| 70788 | 70835 | VdbeSorter *pSorter = pCsr->pSorter; |
| 70789 | 70836 | |
| @@ -70794,34 +70841,26 @@ | ||
| 70794 | 70841 | |
| 70795 | 70842 | p = pSorter->pRecord; |
| 70796 | 70843 | while( p ){ |
| 70797 | 70844 | SorterRecord *pNext = p->pNext; |
| 70798 | 70845 | p->pNext = 0; |
| 70799 | - for(i=0; rc==SQLITE_OK && aSlot[i]; i++){ | |
| 70800 | - rc = vdbeSorterMerge(db, pCsr, p, aSlot[i], &p); | |
| 70846 | + for(i=0; aSlot[i]; i++){ | |
| 70847 | + vdbeSorterMerge(pCsr, p, aSlot[i], &p); | |
| 70801 | 70848 | aSlot[i] = 0; |
| 70802 | 70849 | } |
| 70803 | - if( rc!=SQLITE_OK ){ | |
| 70804 | - vdbeSorterRecordFree(db, pNext); | |
| 70805 | - break; | |
| 70806 | - } | |
| 70807 | 70850 | aSlot[i] = p; |
| 70808 | 70851 | p = pNext; |
| 70809 | 70852 | } |
| 70810 | 70853 | |
| 70811 | 70854 | p = 0; |
| 70812 | 70855 | for(i=0; i<64; i++){ |
| 70813 | - if( rc==SQLITE_OK ){ | |
| 70814 | - rc = vdbeSorterMerge(db, pCsr, p, aSlot[i], &p); | |
| 70815 | - }else{ | |
| 70816 | - vdbeSorterRecordFree(db, aSlot[i]); | |
| 70817 | - } | |
| 70856 | + vdbeSorterMerge(pCsr, p, aSlot[i], &p); | |
| 70818 | 70857 | } |
| 70819 | 70858 | pSorter->pRecord = p; |
| 70820 | 70859 | |
| 70821 | 70860 | sqlite3_free(aSlot); |
| 70822 | - return rc; | |
| 70861 | + return SQLITE_OK; | |
| 70823 | 70862 | } |
| 70824 | 70863 | |
| 70825 | 70864 | |
| 70826 | 70865 | /* |
| 70827 | 70866 | ** Write the current contents of the in-memory linked-list to a PMA. Return |
| @@ -70843,11 +70882,11 @@ | ||
| 70843 | 70882 | if( pSorter->nInMemory==0 ){ |
| 70844 | 70883 | assert( pSorter->pRecord==0 ); |
| 70845 | 70884 | return rc; |
| 70846 | 70885 | } |
| 70847 | 70886 | |
| 70848 | - rc = vdbeSorterSort(db, pCsr); | |
| 70887 | + rc = vdbeSorterSort(pCsr); | |
| 70849 | 70888 | |
| 70850 | 70889 | /* If the first temporary PMA file has not been opened, open it now. */ |
| 70851 | 70890 | if( rc==SQLITE_OK && pSorter->pTemp1==0 ){ |
| 70852 | 70891 | rc = vdbeSorterOpenTempFile(db, &pSorter->pTemp1); |
| 70853 | 70892 | assert( rc!=SQLITE_OK || pSorter->pTemp1 ); |
| @@ -70990,11 +71029,11 @@ | ||
| 70990 | 71029 | ** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly |
| 70991 | 71030 | ** from the in-memory list. */ |
| 70992 | 71031 | if( pSorter->nPMA==0 ){ |
| 70993 | 71032 | *pbEof = !pSorter->pRecord; |
| 70994 | 71033 | assert( pSorter->aTree==0 ); |
| 70995 | - return vdbeSorterSort(db, pCsr); | |
| 71034 | + return vdbeSorterSort(pCsr); | |
| 70996 | 71035 | } |
| 70997 | 71036 | |
| 70998 | 71037 | /* Write the current b-tree to a PMA. Close the b-tree cursor. */ |
| 70999 | 71038 | rc = vdbeSorterListToPMA(db, pCsr); |
| 71000 | 71039 | if( rc!=SQLITE_OK ) return rc; |
| @@ -71160,24 +71199,23 @@ | ||
| 71160 | 71199 | SQLITE_PRIVATE int sqlite3VdbeSorterCompare( |
| 71161 | 71200 | VdbeCursor *pCsr, /* Sorter cursor */ |
| 71162 | 71201 | Mem *pVal, /* Value to compare to current sorter key */ |
| 71163 | 71202 | int *pRes /* OUT: Result of comparison */ |
| 71164 | 71203 | ){ |
| 71165 | - int rc; | |
| 71166 | 71204 | VdbeSorter *pSorter = pCsr->pSorter; |
| 71167 | 71205 | void *pKey; int nKey; /* Sorter key to compare pVal with */ |
| 71168 | 71206 | |
| 71169 | 71207 | pKey = vdbeSorterRowkey(pSorter, &nKey); |
| 71170 | - rc = vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes); | |
| 71171 | - assert( rc!=SQLITE_OK || pVal->db->mallocFailed || (*pRes)<=0 ); | |
| 71172 | - return rc; | |
| 71208 | + vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes); | |
| 71209 | + return SQLITE_OK; | |
| 71173 | 71210 | } |
| 71174 | 71211 | |
| 71175 | 71212 | #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */ |
| 71176 | 71213 | |
| 71177 | 71214 | /************** End of vdbesort.c ********************************************/ |
| 71178 | 71215 | /************** Begin file journal.c *****************************************/ |
| 71216 | +#line 1 "tsrc/journal.c" | |
| 71179 | 71217 | /* |
| 71180 | 71218 | ** 2007 August 22 |
| 71181 | 71219 | ** |
| 71182 | 71220 | ** The author disclaims copyright to this source code. In place of |
| 71183 | 71221 | ** a legal notice, here is a blessing: |
| @@ -71414,10 +71452,11 @@ | ||
| 71414 | 71452 | } |
| 71415 | 71453 | #endif |
| 71416 | 71454 | |
| 71417 | 71455 | /************** End of journal.c *********************************************/ |
| 71418 | 71456 | /************** Begin file memjournal.c **************************************/ |
| 71457 | +#line 1 "tsrc/memjournal.c" | |
| 71419 | 71458 | /* |
| 71420 | 71459 | ** 2008 October 7 |
| 71421 | 71460 | ** |
| 71422 | 71461 | ** The author disclaims copyright to this source code. In place of |
| 71423 | 71462 | ** a legal notice, here is a blessing: |
| @@ -71675,10 +71714,11 @@ | ||
| 71675 | 71714 | return sizeof(MemJournal); |
| 71676 | 71715 | } |
| 71677 | 71716 | |
| 71678 | 71717 | /************** End of memjournal.c ******************************************/ |
| 71679 | 71718 | /************** Begin file walker.c ******************************************/ |
| 71719 | +#line 1 "tsrc/walker.c" | |
| 71680 | 71720 | /* |
| 71681 | 71721 | ** 2008 August 16 |
| 71682 | 71722 | ** |
| 71683 | 71723 | ** The author disclaims copyright to this source code. In place of |
| 71684 | 71724 | ** a legal notice, here is a blessing: |
| @@ -71813,10 +71853,11 @@ | ||
| 71813 | 71853 | return rc & WRC_Abort; |
| 71814 | 71854 | } |
| 71815 | 71855 | |
| 71816 | 71856 | /************** End of walker.c **********************************************/ |
| 71817 | 71857 | /************** Begin file resolve.c *****************************************/ |
| 71858 | +#line 1 "tsrc/resolve.c" | |
| 71818 | 71859 | /* |
| 71819 | 71860 | ** 2008 August 18 |
| 71820 | 71861 | ** |
| 71821 | 71862 | ** The author disclaims copyright to this source code. In place of |
| 71822 | 71863 | ** a legal notice, here is a blessing: |
| @@ -73033,10 +73074,11 @@ | ||
| 73033 | 73074 | sqlite3WalkSelect(&w, p); |
| 73034 | 73075 | } |
| 73035 | 73076 | |
| 73036 | 73077 | /************** End of resolve.c *********************************************/ |
| 73037 | 73078 | /************** Begin file expr.c ********************************************/ |
| 73079 | +#line 1 "tsrc/expr.c" | |
| 73038 | 73080 | /* |
| 73039 | 73081 | ** 2001 September 15 |
| 73040 | 73082 | ** |
| 73041 | 73083 | ** The author disclaims copyright to this source code. In place of |
| 73042 | 73084 | ** a legal notice, here is a blessing: |
| @@ -76793,10 +76835,11 @@ | ||
| 76793 | 76835 | } |
| 76794 | 76836 | } |
| 76795 | 76837 | |
| 76796 | 76838 | /************** End of expr.c ************************************************/ |
| 76797 | 76839 | /************** Begin file alter.c *******************************************/ |
| 76840 | +#line 1 "tsrc/alter.c" | |
| 76798 | 76841 | /* |
| 76799 | 76842 | ** 2005 February 15 |
| 76800 | 76843 | ** |
| 76801 | 76844 | ** The author disclaims copyright to this source code. In place of |
| 76802 | 76845 | ** a legal notice, here is a blessing: |
| @@ -77621,10 +77664,11 @@ | ||
| 77621 | 77664 | } |
| 77622 | 77665 | #endif /* SQLITE_ALTER_TABLE */ |
| 77623 | 77666 | |
| 77624 | 77667 | /************** End of alter.c ***********************************************/ |
| 77625 | 77668 | /************** Begin file analyze.c *****************************************/ |
| 77669 | +#line 1 "tsrc/analyze.c" | |
| 77626 | 77670 | /* |
| 77627 | 77671 | ** 2005 July 8 |
| 77628 | 77672 | ** |
| 77629 | 77673 | ** The author disclaims copyright to this source code. In place of |
| 77630 | 77674 | ** a legal notice, here is a blessing: |
| @@ -78342,10 +78386,11 @@ | ||
| 78342 | 78386 | |
| 78343 | 78387 | #endif /* SQLITE_OMIT_ANALYZE */ |
| 78344 | 78388 | |
| 78345 | 78389 | /************** End of analyze.c *********************************************/ |
| 78346 | 78390 | /************** Begin file attach.c ******************************************/ |
| 78391 | +#line 1 "tsrc/attach.c" | |
| 78347 | 78392 | /* |
| 78348 | 78393 | ** 2003 April 6 |
| 78349 | 78394 | ** |
| 78350 | 78395 | ** The author disclaims copyright to this source code. In place of |
| 78351 | 78396 | ** a legal notice, here is a blessing: |
| @@ -78901,10 +78946,11 @@ | ||
| 78901 | 78946 | } |
| 78902 | 78947 | #endif |
| 78903 | 78948 | |
| 78904 | 78949 | /************** End of attach.c **********************************************/ |
| 78905 | 78950 | /************** Begin file auth.c ********************************************/ |
| 78951 | +#line 1 "tsrc/auth.c" | |
| 78906 | 78952 | /* |
| 78907 | 78953 | ** 2003 January 11 |
| 78908 | 78954 | ** |
| 78909 | 78955 | ** The author disclaims copyright to this source code. In place of |
| 78910 | 78956 | ** a legal notice, here is a blessing: |
| @@ -79152,10 +79198,11 @@ | ||
| 79152 | 79198 | |
| 79153 | 79199 | #endif /* SQLITE_OMIT_AUTHORIZATION */ |
| 79154 | 79200 | |
| 79155 | 79201 | /************** End of auth.c ************************************************/ |
| 79156 | 79202 | /************** Begin file build.c *******************************************/ |
| 79203 | +#line 1 "tsrc/build.c" | |
| 79157 | 79204 | /* |
| 79158 | 79205 | ** 2001 September 15 |
| 79159 | 79206 | ** |
| 79160 | 79207 | ** The author disclaims copyright to this source code. In place of |
| 79161 | 79208 | ** a legal notice, here is a blessing: |
| @@ -82955,10 +83002,11 @@ | ||
| 82955 | 83002 | return pKey; |
| 82956 | 83003 | } |
| 82957 | 83004 | |
| 82958 | 83005 | /************** End of build.c ***********************************************/ |
| 82959 | 83006 | /************** Begin file callback.c ****************************************/ |
| 83007 | +#line 1 "tsrc/callback.c" | |
| 82960 | 83008 | /* |
| 82961 | 83009 | ** 2005 May 23 |
| 82962 | 83010 | ** |
| 82963 | 83011 | ** The author disclaims copyright to this source code. In place of |
| 82964 | 83012 | ** a legal notice, here is a blessing: |
| @@ -83414,10 +83462,11 @@ | ||
| 83414 | 83462 | return p; |
| 83415 | 83463 | } |
| 83416 | 83464 | |
| 83417 | 83465 | /************** End of callback.c ********************************************/ |
| 83418 | 83466 | /************** Begin file delete.c ******************************************/ |
| 83467 | +#line 1 "tsrc/delete.c" | |
| 83419 | 83468 | /* |
| 83420 | 83469 | ** 2001 September 15 |
| 83421 | 83470 | ** |
| 83422 | 83471 | ** The author disclaims copyright to this source code. In place of |
| 83423 | 83472 | ** a legal notice, here is a blessing: |
| @@ -84068,10 +84117,11 @@ | ||
| 84068 | 84117 | return regBase; |
| 84069 | 84118 | } |
| 84070 | 84119 | |
| 84071 | 84120 | /************** End of delete.c **********************************************/ |
| 84072 | 84121 | /************** Begin file func.c ********************************************/ |
| 84122 | +#line 1 "tsrc/func.c" | |
| 84073 | 84123 | /* |
| 84074 | 84124 | ** 2002 February 23 |
| 84075 | 84125 | ** |
| 84076 | 84126 | ** The author disclaims copyright to this source code. In place of |
| 84077 | 84127 | ** a legal notice, here is a blessing: |
| @@ -85676,10 +85726,11 @@ | ||
| 85676 | 85726 | #endif |
| 85677 | 85727 | } |
| 85678 | 85728 | |
| 85679 | 85729 | /************** End of func.c ************************************************/ |
| 85680 | 85730 | /************** Begin file fkey.c ********************************************/ |
| 85731 | +#line 1 "tsrc/fkey.c" | |
| 85681 | 85732 | /* |
| 85682 | 85733 | ** |
| 85683 | 85734 | ** The author disclaims copyright to this source code. In place of |
| 85684 | 85735 | ** a legal notice, here is a blessing: |
| 85685 | 85736 | ** |
| @@ -86896,10 +86947,11 @@ | ||
| 86896 | 86947 | } |
| 86897 | 86948 | #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */ |
| 86898 | 86949 | |
| 86899 | 86950 | /************** End of fkey.c ************************************************/ |
| 86900 | 86951 | /************** Begin file insert.c ******************************************/ |
| 86952 | +#line 1 "tsrc/insert.c" | |
| 86901 | 86953 | /* |
| 86902 | 86954 | ** 2001 September 15 |
| 86903 | 86955 | ** |
| 86904 | 86956 | ** The author disclaims copyright to this source code. In place of |
| 86905 | 86957 | ** a legal notice, here is a blessing: |
| @@ -88741,10 +88793,11 @@ | ||
| 88741 | 88793 | } |
| 88742 | 88794 | #endif /* SQLITE_OMIT_XFER_OPT */ |
| 88743 | 88795 | |
| 88744 | 88796 | /************** End of insert.c **********************************************/ |
| 88745 | 88797 | /************** Begin file legacy.c ******************************************/ |
| 88798 | +#line 1 "tsrc/legacy.c" | |
| 88746 | 88799 | /* |
| 88747 | 88800 | ** 2001 September 15 |
| 88748 | 88801 | ** |
| 88749 | 88802 | ** The author disclaims copyright to this source code. In place of |
| 88750 | 88803 | ** a legal notice, here is a blessing: |
| @@ -88888,10 +88941,11 @@ | ||
| 88888 | 88941 | return rc; |
| 88889 | 88942 | } |
| 88890 | 88943 | |
| 88891 | 88944 | /************** End of legacy.c **********************************************/ |
| 88892 | 88945 | /************** Begin file loadext.c *****************************************/ |
| 88946 | +#line 1 "tsrc/loadext.c" | |
| 88893 | 88947 | /* |
| 88894 | 88948 | ** 2006 June 7 |
| 88895 | 88949 | ** |
| 88896 | 88950 | ** The author disclaims copyright to this source code. In place of |
| 88897 | 88951 | ** a legal notice, here is a blessing: |
| @@ -88908,10 +88962,11 @@ | ||
| 88908 | 88962 | #ifndef SQLITE_CORE |
| 88909 | 88963 | #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */ |
| 88910 | 88964 | #endif |
| 88911 | 88965 | /************** Include sqlite3ext.h in the middle of loadext.c **************/ |
| 88912 | 88966 | /************** Begin file sqlite3ext.h **************************************/ |
| 88967 | +#line 1 "tsrc/sqlite3ext.h" | |
| 88913 | 88968 | /* |
| 88914 | 88969 | ** 2006 June 7 |
| 88915 | 88970 | ** |
| 88916 | 88971 | ** The author disclaims copyright to this source code. In place of |
| 88917 | 88972 | ** a legal notice, here is a blessing: |
| @@ -89336,10 +89391,11 @@ | ||
| 89336 | 89391 | |
| 89337 | 89392 | #endif /* _SQLITE3EXT_H_ */ |
| 89338 | 89393 | |
| 89339 | 89394 | /************** End of sqlite3ext.h ******************************************/ |
| 89340 | 89395 | /************** Continuing where we left off in loadext.c ********************/ |
| 89396 | +#line 20 "tsrc/loadext.c" | |
| 89341 | 89397 | /* #include <string.h> */ |
| 89342 | 89398 | |
| 89343 | 89399 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 89344 | 89400 | |
| 89345 | 89401 | /* |
| @@ -89975,10 +90031,11 @@ | ||
| 89975 | 90031 | } |
| 89976 | 90032 | } |
| 89977 | 90033 | |
| 89978 | 90034 | /************** End of loadext.c *********************************************/ |
| 89979 | 90035 | /************** Begin file pragma.c ******************************************/ |
| 90036 | +#line 1 "tsrc/pragma.c" | |
| 89980 | 90037 | /* |
| 89981 | 90038 | ** 2003 April 6 |
| 89982 | 90039 | ** |
| 89983 | 90040 | ** The author disclaims copyright to this source code. In place of |
| 89984 | 90041 | ** a legal notice, here is a blessing: |
| @@ -91503,10 +91560,11 @@ | ||
| 91503 | 91560 | |
| 91504 | 91561 | #endif /* SQLITE_OMIT_PRAGMA */ |
| 91505 | 91562 | |
| 91506 | 91563 | /************** End of pragma.c **********************************************/ |
| 91507 | 91564 | /************** Begin file prepare.c *****************************************/ |
| 91565 | +#line 1 "tsrc/prepare.c" | |
| 91508 | 91566 | /* |
| 91509 | 91567 | ** 2005 May 25 |
| 91510 | 91568 | ** |
| 91511 | 91569 | ** The author disclaims copyright to this source code. In place of |
| 91512 | 91570 | ** a legal notice, here is a blessing: |
| @@ -92363,10 +92421,11 @@ | ||
| 92363 | 92421 | |
| 92364 | 92422 | #endif /* SQLITE_OMIT_UTF16 */ |
| 92365 | 92423 | |
| 92366 | 92424 | /************** End of prepare.c *********************************************/ |
| 92367 | 92425 | /************** Begin file select.c ******************************************/ |
| 92426 | +#line 1 "tsrc/select.c" | |
| 92368 | 92427 | /* |
| 92369 | 92428 | ** 2001 September 15 |
| 92370 | 92429 | ** |
| 92371 | 92430 | ** The author disclaims copyright to this source code. In place of |
| 92372 | 92431 | ** a legal notice, here is a blessing: |
| @@ -96922,10 +96981,11 @@ | ||
| 96922 | 96981 | *****************************************************************************/ |
| 96923 | 96982 | #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ |
| 96924 | 96983 | |
| 96925 | 96984 | /************** End of select.c **********************************************/ |
| 96926 | 96985 | /************** Begin file table.c *******************************************/ |
| 96986 | +#line 1 "tsrc/table.c" | |
| 96927 | 96987 | /* |
| 96928 | 96988 | ** 2001 September 15 |
| 96929 | 96989 | ** |
| 96930 | 96990 | ** The author disclaims copyright to this source code. In place of |
| 96931 | 96991 | ** a legal notice, here is a blessing: |
| @@ -97121,10 +97181,11 @@ | ||
| 97121 | 97181 | |
| 97122 | 97182 | #endif /* SQLITE_OMIT_GET_TABLE */ |
| 97123 | 97183 | |
| 97124 | 97184 | /************** End of table.c ***********************************************/ |
| 97125 | 97185 | /************** Begin file trigger.c *****************************************/ |
| 97186 | +#line 1 "tsrc/trigger.c" | |
| 97126 | 97187 | /* |
| 97127 | 97188 | ** |
| 97128 | 97189 | ** The author disclaims copyright to this source code. In place of |
| 97129 | 97190 | ** a legal notice, here is a blessing: |
| 97130 | 97191 | ** |
| @@ -98246,10 +98307,11 @@ | ||
| 98246 | 98307 | |
| 98247 | 98308 | #endif /* !defined(SQLITE_OMIT_TRIGGER) */ |
| 98248 | 98309 | |
| 98249 | 98310 | /************** End of trigger.c *********************************************/ |
| 98250 | 98311 | /************** Begin file update.c ******************************************/ |
| 98312 | +#line 1 "tsrc/update.c" | |
| 98251 | 98313 | /* |
| 98252 | 98314 | ** 2001 September 15 |
| 98253 | 98315 | ** |
| 98254 | 98316 | ** The author disclaims copyright to this source code. In place of |
| 98255 | 98317 | ** a legal notice, here is a blessing: |
| @@ -98918,10 +98980,11 @@ | ||
| 98918 | 98980 | } |
| 98919 | 98981 | #endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 98920 | 98982 | |
| 98921 | 98983 | /************** End of update.c **********************************************/ |
| 98922 | 98984 | /************** Begin file vacuum.c ******************************************/ |
| 98985 | +#line 1 "tsrc/vacuum.c" | |
| 98923 | 98986 | /* |
| 98924 | 98987 | ** 2003 April 6 |
| 98925 | 98988 | ** |
| 98926 | 98989 | ** The author disclaims copyright to this source code. In place of |
| 98927 | 98990 | ** a legal notice, here is a blessing: |
| @@ -99264,10 +99327,11 @@ | ||
| 99264 | 99327 | |
| 99265 | 99328 | #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */ |
| 99266 | 99329 | |
| 99267 | 99330 | /************** End of vacuum.c **********************************************/ |
| 99268 | 99331 | /************** Begin file vtab.c ********************************************/ |
| 99332 | +#line 1 "tsrc/vtab.c" | |
| 99269 | 99333 | /* |
| 99270 | 99334 | ** 2006 June 10 |
| 99271 | 99335 | ** |
| 99272 | 99336 | ** The author disclaims copyright to this source code. In place of |
| 99273 | 99337 | ** a legal notice, here is a blessing: |
| @@ -100332,10 +100396,11 @@ | ||
| 100332 | 100396 | |
| 100333 | 100397 | #endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 100334 | 100398 | |
| 100335 | 100399 | /************** End of vtab.c ************************************************/ |
| 100336 | 100400 | /************** Begin file where.c *******************************************/ |
| 100401 | +#line 1 "tsrc/where.c" | |
| 100337 | 100402 | /* |
| 100338 | 100403 | ** 2001 September 15 |
| 100339 | 100404 | ** |
| 100340 | 100405 | ** The author disclaims copyright to this source code. In place of |
| 100341 | 100406 | ** a legal notice, here is a blessing: |
| @@ -105518,10 +105583,11 @@ | ||
| 105518 | 105583 | return; |
| 105519 | 105584 | } |
| 105520 | 105585 | |
| 105521 | 105586 | /************** End of where.c ***********************************************/ |
| 105522 | 105587 | /************** Begin file parse.c *******************************************/ |
| 105588 | +#line 1 "tsrc/parse.c" | |
| 105523 | 105589 | /* Driver template for the LEMON parser generator. |
| 105524 | 105590 | ** The author disclaims copyright to this source code. |
| 105525 | 105591 | ** |
| 105526 | 105592 | ** This version of "lempar.c" is modified, slightly, for use by SQLite. |
| 105527 | 105593 | ** The only modifications are the addition of a couple of NEVER() |
| @@ -105530,10 +105596,11 @@ | ||
| 105530 | 105596 | ** specific grammar used by SQLite. |
| 105531 | 105597 | */ |
| 105532 | 105598 | /* First off, code is included that follows the "include" declaration |
| 105533 | 105599 | ** in the input grammar file. */ |
| 105534 | 105600 | /* #include <stdio.h> */ |
| 105601 | +#line 51 "parse.y" | |
| 105535 | 105602 | |
| 105536 | 105603 | |
| 105537 | 105604 | /* |
| 105538 | 105605 | ** Disable all error recovery processing in the parser push-down |
| 105539 | 105606 | ** automaton. |
| @@ -105577,10 +105644,11 @@ | ||
| 105577 | 105644 | /* |
| 105578 | 105645 | ** An instance of this structure holds the ATTACH key and the key type. |
| 105579 | 105646 | */ |
| 105580 | 105647 | struct AttachKey { int type; Token key; }; |
| 105581 | 105648 | |
| 105649 | +#line 722 "parse.y" | |
| 105582 | 105650 | |
| 105583 | 105651 | /* This is a utility routine used to set the ExprSpan.zStart and |
| 105584 | 105652 | ** ExprSpan.zEnd values of pOut so that the span covers the complete |
| 105585 | 105653 | ** range of text beginning with pStart and going to the end of pEnd. |
| 105586 | 105654 | */ |
| @@ -105596,10 +105664,11 @@ | ||
| 105596 | 105664 | static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){ |
| 105597 | 105665 | pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue); |
| 105598 | 105666 | pOut->zStart = pValue->z; |
| 105599 | 105667 | pOut->zEnd = &pValue->z[pValue->n]; |
| 105600 | 105668 | } |
| 105669 | +#line 817 "parse.y" | |
| 105601 | 105670 | |
| 105602 | 105671 | /* This routine constructs a binary expression node out of two ExprSpan |
| 105603 | 105672 | ** objects and uses the result to populate a new ExprSpan object. |
| 105604 | 105673 | */ |
| 105605 | 105674 | static void spanBinaryExpr( |
| @@ -105611,10 +105680,11 @@ | ||
| 105611 | 105680 | ){ |
| 105612 | 105681 | pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0); |
| 105613 | 105682 | pOut->zStart = pLeft->zStart; |
| 105614 | 105683 | pOut->zEnd = pRight->zEnd; |
| 105615 | 105684 | } |
| 105685 | +#line 873 "parse.y" | |
| 105616 | 105686 | |
| 105617 | 105687 | /* Construct an expression node for a unary postfix operator |
| 105618 | 105688 | */ |
| 105619 | 105689 | static void spanUnaryPostfix( |
| 105620 | 105690 | ExprSpan *pOut, /* Write the new expression node here */ |
| @@ -105625,10 +105695,11 @@ | ||
| 105625 | 105695 | ){ |
| 105626 | 105696 | pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0); |
| 105627 | 105697 | pOut->zStart = pOperand->zStart; |
| 105628 | 105698 | pOut->zEnd = &pPostOp->z[pPostOp->n]; |
| 105629 | 105699 | } |
| 105700 | +#line 892 "parse.y" | |
| 105630 | 105701 | |
| 105631 | 105702 | /* A routine to convert a binary TK_IS or TK_ISNOT expression into a |
| 105632 | 105703 | ** unary TK_ISNULL or TK_NOTNULL expression. */ |
| 105633 | 105704 | static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){ |
| 105634 | 105705 | sqlite3 *db = pParse->db; |
| @@ -105636,10 +105707,11 @@ | ||
| 105636 | 105707 | pA->op = (u8)op; |
| 105637 | 105708 | sqlite3ExprDelete(db, pA->pRight); |
| 105638 | 105709 | pA->pRight = 0; |
| 105639 | 105710 | } |
| 105640 | 105711 | } |
| 105712 | +#line 920 "parse.y" | |
| 105641 | 105713 | |
| 105642 | 105714 | /* Construct an expression node for a unary prefix operator |
| 105643 | 105715 | */ |
| 105644 | 105716 | static void spanUnaryPrefix( |
| 105645 | 105717 | ExprSpan *pOut, /* Write the new expression node here */ |
| @@ -105650,10 +105722,11 @@ | ||
| 105650 | 105722 | ){ |
| 105651 | 105723 | pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0); |
| 105652 | 105724 | pOut->zStart = pPreOp->z; |
| 105653 | 105725 | pOut->zEnd = pOperand->zEnd; |
| 105654 | 105726 | } |
| 105727 | +#line 141 "parse.c" | |
| 105655 | 105728 | /* Next is all token values, in a form suitable for use by makeheaders. |
| 105656 | 105729 | ** This section will be null unless lemon is run with the -m switch. |
| 105657 | 105730 | */ |
| 105658 | 105731 | /* |
| 105659 | 105732 | ** These constants (all generated automatically by the parser generator) |
| @@ -106905,17 +106978,21 @@ | ||
| 106905 | 106978 | ** inside the C code. |
| 106906 | 106979 | */ |
| 106907 | 106980 | case 160: /* select */ |
| 106908 | 106981 | case 194: /* oneselect */ |
| 106909 | 106982 | { |
| 106983 | +#line 403 "parse.y" | |
| 106910 | 106984 | sqlite3SelectDelete(pParse->db, (yypminor->yy387)); |
| 106985 | +#line 1399 "parse.c" | |
| 106911 | 106986 | } |
| 106912 | 106987 | break; |
| 106913 | 106988 | case 174: /* term */ |
| 106914 | 106989 | case 175: /* expr */ |
| 106915 | 106990 | { |
| 106991 | +#line 720 "parse.y" | |
| 106916 | 106992 | sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr); |
| 106993 | +#line 1407 "parse.c" | |
| 106917 | 106994 | } |
| 106918 | 106995 | break; |
| 106919 | 106996 | case 179: /* idxlist_opt */ |
| 106920 | 106997 | case 187: /* idxlist */ |
| 106921 | 106998 | case 197: /* selcollist */ |
| @@ -106927,19 +107004,23 @@ | ||
| 106927 | 107004 | case 217: /* setlist */ |
| 106928 | 107005 | case 220: /* itemlist */ |
| 106929 | 107006 | case 221: /* exprlist */ |
| 106930 | 107007 | case 226: /* case_exprlist */ |
| 106931 | 107008 | { |
| 107009 | +#line 1103 "parse.y" | |
| 106932 | 107010 | sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); |
| 107011 | +#line 1425 "parse.c" | |
| 106933 | 107012 | } |
| 106934 | 107013 | break; |
| 106935 | 107014 | case 193: /* fullname */ |
| 106936 | 107015 | case 198: /* from */ |
| 106937 | 107016 | case 206: /* seltablist */ |
| 106938 | 107017 | case 207: /* stl_prefix */ |
| 106939 | 107018 | { |
| 107019 | +#line 534 "parse.y" | |
| 106940 | 107020 | sqlite3SrcListDelete(pParse->db, (yypminor->yy259)); |
| 107021 | +#line 1435 "parse.c" | |
| 106941 | 107022 | } |
| 106942 | 107023 | break; |
| 106943 | 107024 | case 199: /* where_opt */ |
| 106944 | 107025 | case 201: /* having_opt */ |
| 106945 | 107026 | case 210: /* on_opt */ |
| @@ -106947,29 +107028,37 @@ | ||
| 106947 | 107028 | case 225: /* case_operand */ |
| 106948 | 107029 | case 227: /* case_else */ |
| 106949 | 107030 | case 238: /* when_clause */ |
| 106950 | 107031 | case 243: /* key_opt */ |
| 106951 | 107032 | { |
| 107033 | +#line 644 "parse.y" | |
| 106952 | 107034 | sqlite3ExprDelete(pParse->db, (yypminor->yy314)); |
| 107035 | +#line 1449 "parse.c" | |
| 106953 | 107036 | } |
| 106954 | 107037 | break; |
| 106955 | 107038 | case 211: /* using_opt */ |
| 106956 | 107039 | case 213: /* inscollist */ |
| 106957 | 107040 | case 219: /* inscollist_opt */ |
| 106958 | 107041 | { |
| 107042 | +#line 566 "parse.y" | |
| 106959 | 107043 | sqlite3IdListDelete(pParse->db, (yypminor->yy384)); |
| 107044 | +#line 1458 "parse.c" | |
| 106960 | 107045 | } |
| 106961 | 107046 | break; |
| 106962 | 107047 | case 234: /* trigger_cmd_list */ |
| 106963 | 107048 | case 239: /* trigger_cmd */ |
| 106964 | 107049 | { |
| 107050 | +#line 1210 "parse.y" | |
| 106965 | 107051 | sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203)); |
| 107052 | +#line 1466 "parse.c" | |
| 106966 | 107053 | } |
| 106967 | 107054 | break; |
| 106968 | 107055 | case 236: /* trigger_event */ |
| 106969 | 107056 | { |
| 107057 | +#line 1196 "parse.y" | |
| 106970 | 107058 | sqlite3IdListDelete(pParse->db, (yypminor->yy90).b); |
| 107059 | +#line 1473 "parse.c" | |
| 106971 | 107060 | } |
| 106972 | 107061 | break; |
| 106973 | 107062 | default: break; /* If no destructor action specified: do nothing */ |
| 106974 | 107063 | } |
| 106975 | 107064 | } |
| @@ -107151,14 +107240,16 @@ | ||
| 107151 | 107240 | } |
| 107152 | 107241 | #endif |
| 107153 | 107242 | while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); |
| 107154 | 107243 | /* Here code is inserted which will execute if the parser |
| 107155 | 107244 | ** stack every overflows */ |
| 107245 | +#line 38 "parse.y" | |
| 107156 | 107246 | |
| 107157 | 107247 | UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */ |
| 107158 | 107248 | sqlite3ErrorMsg(pParse, "parser stack overflow"); |
| 107159 | 107249 | pParse->parseError = 1; |
| 107250 | +#line 1664 "parse.c" | |
| 107160 | 107251 | sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */ |
| 107161 | 107252 | } |
| 107162 | 107253 | |
| 107163 | 107254 | /* |
| 107164 | 107255 | ** Perform a shift action. |
| @@ -107595,66 +107686,94 @@ | ||
| 107595 | 107686 | ** { ... } // User supplied code |
| 107596 | 107687 | ** #line <lineno> <thisfile> |
| 107597 | 107688 | ** break; |
| 107598 | 107689 | */ |
| 107599 | 107690 | case 5: /* explain ::= */ |
| 107691 | +#line 107 "parse.y" | |
| 107600 | 107692 | { sqlite3BeginParse(pParse, 0); } |
| 107693 | +#line 2107 "parse.c" | |
| 107601 | 107694 | break; |
| 107602 | 107695 | case 6: /* explain ::= EXPLAIN */ |
| 107696 | +#line 109 "parse.y" | |
| 107603 | 107697 | { sqlite3BeginParse(pParse, 1); } |
| 107698 | +#line 2112 "parse.c" | |
| 107604 | 107699 | break; |
| 107605 | 107700 | case 7: /* explain ::= EXPLAIN QUERY PLAN */ |
| 107701 | +#line 110 "parse.y" | |
| 107606 | 107702 | { sqlite3BeginParse(pParse, 2); } |
| 107703 | +#line 2117 "parse.c" | |
| 107607 | 107704 | break; |
| 107608 | 107705 | case 8: /* cmdx ::= cmd */ |
| 107706 | +#line 112 "parse.y" | |
| 107609 | 107707 | { sqlite3FinishCoding(pParse); } |
| 107708 | +#line 2122 "parse.c" | |
| 107610 | 107709 | break; |
| 107611 | 107710 | case 9: /* cmd ::= BEGIN transtype trans_opt */ |
| 107711 | +#line 117 "parse.y" | |
| 107612 | 107712 | {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);} |
| 107713 | +#line 2127 "parse.c" | |
| 107613 | 107714 | break; |
| 107614 | 107715 | case 13: /* transtype ::= */ |
| 107716 | +#line 122 "parse.y" | |
| 107615 | 107717 | {yygotominor.yy4 = TK_DEFERRED;} |
| 107718 | +#line 2132 "parse.c" | |
| 107616 | 107719 | break; |
| 107617 | 107720 | case 14: /* transtype ::= DEFERRED */ |
| 107618 | 107721 | case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); |
| 107619 | 107722 | case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); |
| 107620 | 107723 | case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); |
| 107621 | 107724 | case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117); |
| 107725 | +#line 123 "parse.y" | |
| 107622 | 107726 | {yygotominor.yy4 = yymsp[0].major;} |
| 107727 | +#line 2141 "parse.c" | |
| 107623 | 107728 | break; |
| 107624 | 107729 | case 17: /* cmd ::= COMMIT trans_opt */ |
| 107625 | 107730 | case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); |
| 107731 | +#line 126 "parse.y" | |
| 107626 | 107732 | {sqlite3CommitTransaction(pParse);} |
| 107733 | +#line 2147 "parse.c" | |
| 107627 | 107734 | break; |
| 107628 | 107735 | case 19: /* cmd ::= ROLLBACK trans_opt */ |
| 107736 | +#line 128 "parse.y" | |
| 107629 | 107737 | {sqlite3RollbackTransaction(pParse);} |
| 107738 | +#line 2152 "parse.c" | |
| 107630 | 107739 | break; |
| 107631 | 107740 | case 22: /* cmd ::= SAVEPOINT nm */ |
| 107741 | +#line 132 "parse.y" | |
| 107632 | 107742 | { |
| 107633 | 107743 | sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0); |
| 107634 | 107744 | } |
| 107745 | +#line 2159 "parse.c" | |
| 107635 | 107746 | break; |
| 107636 | 107747 | case 23: /* cmd ::= RELEASE savepoint_opt nm */ |
| 107748 | +#line 135 "parse.y" | |
| 107637 | 107749 | { |
| 107638 | 107750 | sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0); |
| 107639 | 107751 | } |
| 107752 | +#line 2166 "parse.c" | |
| 107640 | 107753 | break; |
| 107641 | 107754 | case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ |
| 107755 | +#line 138 "parse.y" | |
| 107642 | 107756 | { |
| 107643 | 107757 | sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); |
| 107644 | 107758 | } |
| 107759 | +#line 2173 "parse.c" | |
| 107645 | 107760 | break; |
| 107646 | 107761 | case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ |
| 107762 | +#line 145 "parse.y" | |
| 107647 | 107763 | { |
| 107648 | 107764 | sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4); |
| 107649 | 107765 | } |
| 107766 | +#line 2180 "parse.c" | |
| 107650 | 107767 | break; |
| 107651 | 107768 | case 27: /* createkw ::= CREATE */ |
| 107769 | +#line 148 "parse.y" | |
| 107652 | 107770 | { |
| 107653 | 107771 | pParse->db->lookaside.bEnabled = 0; |
| 107654 | 107772 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 107655 | 107773 | } |
| 107774 | +#line 2188 "parse.c" | |
| 107656 | 107775 | break; |
| 107657 | 107776 | case 28: /* ifnotexists ::= */ |
| 107658 | 107777 | case 31: /* temp ::= */ yytestcase(yyruleno==31); |
| 107659 | 107778 | case 70: /* autoinc ::= */ yytestcase(yyruleno==70); |
| 107660 | 107779 | case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83); |
| @@ -107664,44 +107783,56 @@ | ||
| 107664 | 107783 | case 109: /* ifexists ::= */ yytestcase(yyruleno==109); |
| 107665 | 107784 | case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); |
| 107666 | 107785 | case 121: /* distinct ::= */ yytestcase(yyruleno==121); |
| 107667 | 107786 | case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222); |
| 107668 | 107787 | case 225: /* in_op ::= IN */ yytestcase(yyruleno==225); |
| 107788 | +#line 153 "parse.y" | |
| 107669 | 107789 | {yygotominor.yy4 = 0;} |
| 107790 | +#line 2204 "parse.c" | |
| 107670 | 107791 | break; |
| 107671 | 107792 | case 29: /* ifnotexists ::= IF NOT EXISTS */ |
| 107672 | 107793 | case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); |
| 107673 | 107794 | case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); |
| 107674 | 107795 | case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86); |
| 107675 | 107796 | case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); |
| 107676 | 107797 | case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); |
| 107677 | 107798 | case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223); |
| 107678 | 107799 | case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226); |
| 107800 | +#line 154 "parse.y" | |
| 107679 | 107801 | {yygotominor.yy4 = 1;} |
| 107802 | +#line 2216 "parse.c" | |
| 107680 | 107803 | break; |
| 107681 | 107804 | case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ |
| 107805 | +#line 160 "parse.y" | |
| 107682 | 107806 | { |
| 107683 | 107807 | sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); |
| 107684 | 107808 | } |
| 107809 | +#line 2223 "parse.c" | |
| 107685 | 107810 | break; |
| 107686 | 107811 | case 33: /* create_table_args ::= AS select */ |
| 107812 | +#line 163 "parse.y" | |
| 107687 | 107813 | { |
| 107688 | 107814 | sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387); |
| 107689 | 107815 | sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); |
| 107690 | 107816 | } |
| 107817 | +#line 2231 "parse.c" | |
| 107691 | 107818 | break; |
| 107692 | 107819 | case 36: /* column ::= columnid type carglist */ |
| 107820 | +#line 175 "parse.y" | |
| 107693 | 107821 | { |
| 107694 | 107822 | yygotominor.yy0.z = yymsp[-2].minor.yy0.z; |
| 107695 | 107823 | yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n; |
| 107696 | 107824 | } |
| 107825 | +#line 2239 "parse.c" | |
| 107697 | 107826 | break; |
| 107698 | 107827 | case 37: /* columnid ::= nm */ |
| 107828 | +#line 179 "parse.y" | |
| 107699 | 107829 | { |
| 107700 | 107830 | sqlite3AddColumn(pParse,&yymsp[0].minor.yy0); |
| 107701 | 107831 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 107702 | 107832 | } |
| 107833 | +#line 2247 "parse.c" | |
| 107703 | 107834 | break; |
| 107704 | 107835 | case 38: /* id ::= ID */ |
| 107705 | 107836 | case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39); |
| 107706 | 107837 | case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40); |
| 107707 | 107838 | case 41: /* nm ::= id */ yytestcase(yyruleno==41); |
| @@ -107721,256 +107852,373 @@ | ||
| 107721 | 107852 | case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264); |
| 107722 | 107853 | case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265); |
| 107723 | 107854 | case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266); |
| 107724 | 107855 | case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267); |
| 107725 | 107856 | case 285: /* trnm ::= nm */ yytestcase(yyruleno==285); |
| 107857 | +#line 189 "parse.y" | |
| 107726 | 107858 | {yygotominor.yy0 = yymsp[0].minor.yy0;} |
| 107859 | +#line 2273 "parse.c" | |
| 107727 | 107860 | break; |
| 107728 | 107861 | case 45: /* type ::= typetoken */ |
| 107862 | +#line 251 "parse.y" | |
| 107729 | 107863 | {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} |
| 107864 | +#line 2278 "parse.c" | |
| 107730 | 107865 | break; |
| 107731 | 107866 | case 47: /* typetoken ::= typename LP signed RP */ |
| 107867 | +#line 253 "parse.y" | |
| 107732 | 107868 | { |
| 107733 | 107869 | yygotominor.yy0.z = yymsp[-3].minor.yy0.z; |
| 107734 | 107870 | yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z); |
| 107735 | 107871 | } |
| 107872 | +#line 2286 "parse.c" | |
| 107736 | 107873 | break; |
| 107737 | 107874 | case 48: /* typetoken ::= typename LP signed COMMA signed RP */ |
| 107875 | +#line 257 "parse.y" | |
| 107738 | 107876 | { |
| 107739 | 107877 | yygotominor.yy0.z = yymsp[-5].minor.yy0.z; |
| 107740 | 107878 | yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z); |
| 107741 | 107879 | } |
| 107880 | +#line 2294 "parse.c" | |
| 107742 | 107881 | break; |
| 107743 | 107882 | case 50: /* typename ::= typename ids */ |
| 107883 | +#line 263 "parse.y" | |
| 107744 | 107884 | {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);} |
| 107885 | +#line 2299 "parse.c" | |
| 107745 | 107886 | break; |
| 107746 | 107887 | case 57: /* ccons ::= DEFAULT term */ |
| 107747 | 107888 | case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); |
| 107889 | +#line 274 "parse.y" | |
| 107748 | 107890 | {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);} |
| 107891 | +#line 2305 "parse.c" | |
| 107749 | 107892 | break; |
| 107750 | 107893 | case 58: /* ccons ::= DEFAULT LP expr RP */ |
| 107894 | +#line 275 "parse.y" | |
| 107751 | 107895 | {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);} |
| 107896 | +#line 2310 "parse.c" | |
| 107752 | 107897 | break; |
| 107753 | 107898 | case 60: /* ccons ::= DEFAULT MINUS term */ |
| 107899 | +#line 277 "parse.y" | |
| 107754 | 107900 | { |
| 107755 | 107901 | ExprSpan v; |
| 107756 | 107902 | v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0); |
| 107757 | 107903 | v.zStart = yymsp[-1].minor.yy0.z; |
| 107758 | 107904 | v.zEnd = yymsp[0].minor.yy118.zEnd; |
| 107759 | 107905 | sqlite3AddDefaultValue(pParse,&v); |
| 107760 | 107906 | } |
| 107907 | +#line 2321 "parse.c" | |
| 107761 | 107908 | break; |
| 107762 | 107909 | case 61: /* ccons ::= DEFAULT id */ |
| 107910 | +#line 284 "parse.y" | |
| 107763 | 107911 | { |
| 107764 | 107912 | ExprSpan v; |
| 107765 | 107913 | spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0); |
| 107766 | 107914 | sqlite3AddDefaultValue(pParse,&v); |
| 107767 | 107915 | } |
| 107916 | +#line 2330 "parse.c" | |
| 107768 | 107917 | break; |
| 107769 | 107918 | case 63: /* ccons ::= NOT NULL onconf */ |
| 107919 | +#line 294 "parse.y" | |
| 107770 | 107920 | {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);} |
| 107921 | +#line 2335 "parse.c" | |
| 107771 | 107922 | break; |
| 107772 | 107923 | case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ |
| 107924 | +#line 296 "parse.y" | |
| 107773 | 107925 | {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);} |
| 107926 | +#line 2340 "parse.c" | |
| 107774 | 107927 | break; |
| 107775 | 107928 | case 65: /* ccons ::= UNIQUE onconf */ |
| 107929 | +#line 297 "parse.y" | |
| 107776 | 107930 | {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);} |
| 107931 | +#line 2345 "parse.c" | |
| 107777 | 107932 | break; |
| 107778 | 107933 | case 66: /* ccons ::= CHECK LP expr RP */ |
| 107934 | +#line 298 "parse.y" | |
| 107779 | 107935 | {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);} |
| 107936 | +#line 2350 "parse.c" | |
| 107780 | 107937 | break; |
| 107781 | 107938 | case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ |
| 107939 | +#line 300 "parse.y" | |
| 107782 | 107940 | {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);} |
| 107941 | +#line 2355 "parse.c" | |
| 107783 | 107942 | break; |
| 107784 | 107943 | case 68: /* ccons ::= defer_subclause */ |
| 107944 | +#line 301 "parse.y" | |
| 107785 | 107945 | {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);} |
| 107946 | +#line 2360 "parse.c" | |
| 107786 | 107947 | break; |
| 107787 | 107948 | case 69: /* ccons ::= COLLATE ids */ |
| 107949 | +#line 302 "parse.y" | |
| 107788 | 107950 | {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} |
| 107951 | +#line 2365 "parse.c" | |
| 107789 | 107952 | break; |
| 107790 | 107953 | case 72: /* refargs ::= */ |
| 107954 | +#line 315 "parse.y" | |
| 107791 | 107955 | { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */} |
| 107956 | +#line 2370 "parse.c" | |
| 107792 | 107957 | break; |
| 107793 | 107958 | case 73: /* refargs ::= refargs refarg */ |
| 107959 | +#line 316 "parse.y" | |
| 107794 | 107960 | { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; } |
| 107961 | +#line 2375 "parse.c" | |
| 107795 | 107962 | break; |
| 107796 | 107963 | case 74: /* refarg ::= MATCH nm */ |
| 107797 | 107964 | case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); |
| 107965 | +#line 318 "parse.y" | |
| 107798 | 107966 | { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; } |
| 107967 | +#line 2381 "parse.c" | |
| 107799 | 107968 | break; |
| 107800 | 107969 | case 76: /* refarg ::= ON DELETE refact */ |
| 107970 | +#line 320 "parse.y" | |
| 107801 | 107971 | { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; } |
| 107972 | +#line 2386 "parse.c" | |
| 107802 | 107973 | break; |
| 107803 | 107974 | case 77: /* refarg ::= ON UPDATE refact */ |
| 107975 | +#line 321 "parse.y" | |
| 107804 | 107976 | { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; } |
| 107977 | +#line 2391 "parse.c" | |
| 107805 | 107978 | break; |
| 107806 | 107979 | case 78: /* refact ::= SET NULL */ |
| 107980 | +#line 323 "parse.y" | |
| 107807 | 107981 | { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */} |
| 107982 | +#line 2396 "parse.c" | |
| 107808 | 107983 | break; |
| 107809 | 107984 | case 79: /* refact ::= SET DEFAULT */ |
| 107985 | +#line 324 "parse.y" | |
| 107810 | 107986 | { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */} |
| 107987 | +#line 2401 "parse.c" | |
| 107811 | 107988 | break; |
| 107812 | 107989 | case 80: /* refact ::= CASCADE */ |
| 107990 | +#line 325 "parse.y" | |
| 107813 | 107991 | { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */} |
| 107992 | +#line 2406 "parse.c" | |
| 107814 | 107993 | break; |
| 107815 | 107994 | case 81: /* refact ::= RESTRICT */ |
| 107995 | +#line 326 "parse.y" | |
| 107816 | 107996 | { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */} |
| 107997 | +#line 2411 "parse.c" | |
| 107817 | 107998 | break; |
| 107818 | 107999 | case 82: /* refact ::= NO ACTION */ |
| 108000 | +#line 327 "parse.y" | |
| 107819 | 108001 | { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */} |
| 108002 | +#line 2416 "parse.c" | |
| 107820 | 108003 | break; |
| 107821 | 108004 | case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ |
| 107822 | 108005 | case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99); |
| 107823 | 108006 | case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101); |
| 107824 | 108007 | case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); |
| 108008 | +#line 330 "parse.y" | |
| 107825 | 108009 | {yygotominor.yy4 = yymsp[0].minor.yy4;} |
| 108010 | +#line 2424 "parse.c" | |
| 107826 | 108011 | break; |
| 107827 | 108012 | case 88: /* conslist_opt ::= */ |
| 108013 | +#line 339 "parse.y" | |
| 107828 | 108014 | {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} |
| 108015 | +#line 2429 "parse.c" | |
| 107829 | 108016 | break; |
| 107830 | 108017 | case 89: /* conslist_opt ::= COMMA conslist */ |
| 108018 | +#line 340 "parse.y" | |
| 107831 | 108019 | {yygotominor.yy0 = yymsp[-1].minor.yy0;} |
| 108020 | +#line 2434 "parse.c" | |
| 107832 | 108021 | break; |
| 107833 | 108022 | case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ |
| 108023 | +#line 346 "parse.y" | |
| 107834 | 108024 | {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);} |
| 108025 | +#line 2439 "parse.c" | |
| 107835 | 108026 | break; |
| 107836 | 108027 | case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ |
| 108028 | +#line 348 "parse.y" | |
| 107837 | 108029 | {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);} |
| 108030 | +#line 2444 "parse.c" | |
| 107838 | 108031 | break; |
| 107839 | 108032 | case 96: /* tcons ::= CHECK LP expr RP onconf */ |
| 108033 | +#line 350 "parse.y" | |
| 107840 | 108034 | {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);} |
| 108035 | +#line 2449 "parse.c" | |
| 107841 | 108036 | break; |
| 107842 | 108037 | case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ |
| 108038 | +#line 352 "parse.y" | |
| 107843 | 108039 | { |
| 107844 | 108040 | sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4); |
| 107845 | 108041 | sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4); |
| 107846 | 108042 | } |
| 108043 | +#line 2457 "parse.c" | |
| 107847 | 108044 | break; |
| 107848 | 108045 | case 100: /* onconf ::= */ |
| 108046 | +#line 366 "parse.y" | |
| 107849 | 108047 | {yygotominor.yy4 = OE_Default;} |
| 108048 | +#line 2462 "parse.c" | |
| 107850 | 108049 | break; |
| 107851 | 108050 | case 102: /* orconf ::= */ |
| 108051 | +#line 368 "parse.y" | |
| 107852 | 108052 | {yygotominor.yy210 = OE_Default;} |
| 108053 | +#line 2467 "parse.c" | |
| 107853 | 108054 | break; |
| 107854 | 108055 | case 103: /* orconf ::= OR resolvetype */ |
| 108056 | +#line 369 "parse.y" | |
| 107855 | 108057 | {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;} |
| 108058 | +#line 2472 "parse.c" | |
| 107856 | 108059 | break; |
| 107857 | 108060 | case 105: /* resolvetype ::= IGNORE */ |
| 108061 | +#line 371 "parse.y" | |
| 107858 | 108062 | {yygotominor.yy4 = OE_Ignore;} |
| 108063 | +#line 2477 "parse.c" | |
| 107859 | 108064 | break; |
| 107860 | 108065 | case 106: /* resolvetype ::= REPLACE */ |
| 108066 | +#line 372 "parse.y" | |
| 107861 | 108067 | {yygotominor.yy4 = OE_Replace;} |
| 108068 | +#line 2482 "parse.c" | |
| 107862 | 108069 | break; |
| 107863 | 108070 | case 107: /* cmd ::= DROP TABLE ifexists fullname */ |
| 108071 | +#line 376 "parse.y" | |
| 107864 | 108072 | { |
| 107865 | 108073 | sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4); |
| 107866 | 108074 | } |
| 108075 | +#line 2489 "parse.c" | |
| 107867 | 108076 | break; |
| 107868 | 108077 | case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ |
| 108078 | +#line 386 "parse.y" | |
| 107869 | 108079 | { |
| 107870 | 108080 | sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4); |
| 107871 | 108081 | } |
| 108082 | +#line 2496 "parse.c" | |
| 107872 | 108083 | break; |
| 107873 | 108084 | case 111: /* cmd ::= DROP VIEW ifexists fullname */ |
| 108085 | +#line 389 "parse.y" | |
| 107874 | 108086 | { |
| 107875 | 108087 | sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4); |
| 107876 | 108088 | } |
| 108089 | +#line 2503 "parse.c" | |
| 107877 | 108090 | break; |
| 107878 | 108091 | case 112: /* cmd ::= select */ |
| 108092 | +#line 396 "parse.y" | |
| 107879 | 108093 | { |
| 107880 | 108094 | SelectDest dest = {SRT_Output, 0, 0, 0, 0}; |
| 107881 | 108095 | sqlite3Select(pParse, yymsp[0].minor.yy387, &dest); |
| 107882 | 108096 | sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); |
| 107883 | 108097 | } |
| 108098 | +#line 2512 "parse.c" | |
| 107884 | 108099 | break; |
| 107885 | 108100 | case 113: /* select ::= oneselect */ |
| 108101 | +#line 407 "parse.y" | |
| 107886 | 108102 | {yygotominor.yy387 = yymsp[0].minor.yy387;} |
| 108103 | +#line 2517 "parse.c" | |
| 107887 | 108104 | break; |
| 107888 | 108105 | case 114: /* select ::= select multiselect_op oneselect */ |
| 108106 | +#line 409 "parse.y" | |
| 107889 | 108107 | { |
| 107890 | 108108 | if( yymsp[0].minor.yy387 ){ |
| 107891 | 108109 | yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4; |
| 107892 | 108110 | yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387; |
| 107893 | 108111 | }else{ |
| 107894 | 108112 | sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387); |
| 107895 | 108113 | } |
| 107896 | 108114 | yygotominor.yy387 = yymsp[0].minor.yy387; |
| 107897 | 108115 | } |
| 108116 | +#line 2530 "parse.c" | |
| 107898 | 108117 | break; |
| 107899 | 108118 | case 116: /* multiselect_op ::= UNION ALL */ |
| 108119 | +#line 420 "parse.y" | |
| 107900 | 108120 | {yygotominor.yy4 = TK_ALL;} |
| 108121 | +#line 2535 "parse.c" | |
| 107901 | 108122 | break; |
| 107902 | 108123 | case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 108124 | +#line 424 "parse.y" | |
| 107903 | 108125 | { |
| 107904 | 108126 | yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset); |
| 107905 | 108127 | } |
| 108128 | +#line 2542 "parse.c" | |
| 107906 | 108129 | break; |
| 107907 | 108130 | case 122: /* sclp ::= selcollist COMMA */ |
| 107908 | 108131 | case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247); |
| 108132 | +#line 445 "parse.y" | |
| 107909 | 108133 | {yygotominor.yy322 = yymsp[-1].minor.yy322;} |
| 108134 | +#line 2548 "parse.c" | |
| 107910 | 108135 | break; |
| 107911 | 108136 | case 123: /* sclp ::= */ |
| 107912 | 108137 | case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); |
| 107913 | 108138 | case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159); |
| 107914 | 108139 | case 240: /* exprlist ::= */ yytestcase(yyruleno==240); |
| 107915 | 108140 | case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246); |
| 108141 | +#line 446 "parse.y" | |
| 107916 | 108142 | {yygotominor.yy322 = 0;} |
| 108143 | +#line 2557 "parse.c" | |
| 107917 | 108144 | break; |
| 107918 | 108145 | case 124: /* selcollist ::= sclp expr as */ |
| 108146 | +#line 447 "parse.y" | |
| 107919 | 108147 | { |
| 107920 | 108148 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr); |
| 107921 | 108149 | if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1); |
| 107922 | 108150 | sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118); |
| 107923 | 108151 | } |
| 108152 | +#line 2566 "parse.c" | |
| 107924 | 108153 | break; |
| 107925 | 108154 | case 125: /* selcollist ::= sclp STAR */ |
| 108155 | +#line 452 "parse.y" | |
| 107926 | 108156 | { |
| 107927 | 108157 | Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); |
| 107928 | 108158 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p); |
| 107929 | 108159 | } |
| 108160 | +#line 2574 "parse.c" | |
| 107930 | 108161 | break; |
| 107931 | 108162 | case 126: /* selcollist ::= sclp nm DOT STAR */ |
| 108163 | +#line 456 "parse.y" | |
| 107932 | 108164 | { |
| 107933 | 108165 | Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); |
| 107934 | 108166 | Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 107935 | 108167 | Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); |
| 107936 | 108168 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot); |
| 107937 | 108169 | } |
| 108170 | +#line 2584 "parse.c" | |
| 107938 | 108171 | break; |
| 107939 | 108172 | case 129: /* as ::= */ |
| 108173 | +#line 469 "parse.y" | |
| 107940 | 108174 | {yygotominor.yy0.n = 0;} |
| 108175 | +#line 2589 "parse.c" | |
| 107941 | 108176 | break; |
| 107942 | 108177 | case 130: /* from ::= */ |
| 108178 | +#line 481 "parse.y" | |
| 107943 | 108179 | {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));} |
| 108180 | +#line 2594 "parse.c" | |
| 107944 | 108181 | break; |
| 107945 | 108182 | case 131: /* from ::= FROM seltablist */ |
| 108183 | +#line 482 "parse.y" | |
| 107946 | 108184 | { |
| 107947 | 108185 | yygotominor.yy259 = yymsp[0].minor.yy259; |
| 107948 | 108186 | sqlite3SrcListShiftJoinType(yygotominor.yy259); |
| 107949 | 108187 | } |
| 108188 | +#line 2602 "parse.c" | |
| 107950 | 108189 | break; |
| 107951 | 108190 | case 132: /* stl_prefix ::= seltablist joinop */ |
| 108191 | +#line 490 "parse.y" | |
| 107952 | 108192 | { |
| 107953 | 108193 | yygotominor.yy259 = yymsp[-1].minor.yy259; |
| 107954 | 108194 | if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4; |
| 107955 | 108195 | } |
| 108196 | +#line 2610 "parse.c" | |
| 107956 | 108197 | break; |
| 107957 | 108198 | case 133: /* stl_prefix ::= */ |
| 108199 | +#line 494 "parse.y" | |
| 107958 | 108200 | {yygotominor.yy259 = 0;} |
| 108201 | +#line 2615 "parse.c" | |
| 107959 | 108202 | break; |
| 107960 | 108203 | case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 108204 | +#line 495 "parse.y" | |
| 107961 | 108205 | { |
| 107962 | 108206 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 107963 | 108207 | sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0); |
| 107964 | 108208 | } |
| 108209 | +#line 2623 "parse.c" | |
| 107965 | 108210 | break; |
| 107966 | 108211 | case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 108212 | +#line 501 "parse.y" | |
| 107967 | 108213 | { |
| 107968 | 108214 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 107969 | 108215 | } |
| 108216 | +#line 2630 "parse.c" | |
| 107970 | 108217 | break; |
| 107971 | 108218 | case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 108219 | +#line 505 "parse.y" | |
| 107972 | 108220 | { |
| 107973 | 108221 | if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){ |
| 107974 | 108222 | yygotominor.yy259 = yymsp[-4].minor.yy259; |
| 107975 | 108223 | }else{ |
| 107976 | 108224 | Select *pSubquery; |
| @@ -107977,180 +108225,260 @@ | ||
| 107977 | 108225 | sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259); |
| 107978 | 108226 | pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0); |
| 107979 | 108227 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 107980 | 108228 | } |
| 107981 | 108229 | } |
| 108230 | +#line 2644 "parse.c" | |
| 107982 | 108231 | break; |
| 107983 | 108232 | case 137: /* dbnm ::= */ |
| 107984 | 108233 | case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); |
| 108234 | +#line 530 "parse.y" | |
| 107985 | 108235 | {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} |
| 108236 | +#line 2650 "parse.c" | |
| 107986 | 108237 | break; |
| 107987 | 108238 | case 139: /* fullname ::= nm dbnm */ |
| 108239 | +#line 535 "parse.y" | |
| 107988 | 108240 | {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} |
| 108241 | +#line 2655 "parse.c" | |
| 107989 | 108242 | break; |
| 107990 | 108243 | case 140: /* joinop ::= COMMA|JOIN */ |
| 108244 | +#line 539 "parse.y" | |
| 107991 | 108245 | { yygotominor.yy4 = JT_INNER; } |
| 108246 | +#line 2660 "parse.c" | |
| 107992 | 108247 | break; |
| 107993 | 108248 | case 141: /* joinop ::= JOIN_KW JOIN */ |
| 108249 | +#line 540 "parse.y" | |
| 107994 | 108250 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } |
| 108251 | +#line 2665 "parse.c" | |
| 107995 | 108252 | break; |
| 107996 | 108253 | case 142: /* joinop ::= JOIN_KW nm JOIN */ |
| 108254 | +#line 541 "parse.y" | |
| 107997 | 108255 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } |
| 108256 | +#line 2670 "parse.c" | |
| 107998 | 108257 | break; |
| 107999 | 108258 | case 143: /* joinop ::= JOIN_KW nm nm JOIN */ |
| 108259 | +#line 543 "parse.y" | |
| 108000 | 108260 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } |
| 108261 | +#line 2675 "parse.c" | |
| 108001 | 108262 | break; |
| 108002 | 108263 | case 144: /* on_opt ::= ON expr */ |
| 108003 | 108264 | case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155); |
| 108004 | 108265 | case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162); |
| 108005 | 108266 | case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169); |
| 108006 | 108267 | case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235); |
| 108007 | 108268 | case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237); |
| 108269 | +#line 547 "parse.y" | |
| 108008 | 108270 | {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;} |
| 108271 | +#line 2685 "parse.c" | |
| 108009 | 108272 | break; |
| 108010 | 108273 | case 145: /* on_opt ::= */ |
| 108011 | 108274 | case 161: /* having_opt ::= */ yytestcase(yyruleno==161); |
| 108012 | 108275 | case 168: /* where_opt ::= */ yytestcase(yyruleno==168); |
| 108013 | 108276 | case 236: /* case_else ::= */ yytestcase(yyruleno==236); |
| 108014 | 108277 | case 238: /* case_operand ::= */ yytestcase(yyruleno==238); |
| 108278 | +#line 548 "parse.y" | |
| 108015 | 108279 | {yygotominor.yy314 = 0;} |
| 108280 | +#line 2694 "parse.c" | |
| 108016 | 108281 | break; |
| 108017 | 108282 | case 148: /* indexed_opt ::= NOT INDEXED */ |
| 108283 | +#line 563 "parse.y" | |
| 108018 | 108284 | {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} |
| 108285 | +#line 2699 "parse.c" | |
| 108019 | 108286 | break; |
| 108020 | 108287 | case 149: /* using_opt ::= USING LP inscollist RP */ |
| 108021 | 108288 | case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181); |
| 108289 | +#line 567 "parse.y" | |
| 108022 | 108290 | {yygotominor.yy384 = yymsp[-1].minor.yy384;} |
| 108291 | +#line 2705 "parse.c" | |
| 108023 | 108292 | break; |
| 108024 | 108293 | case 150: /* using_opt ::= */ |
| 108025 | 108294 | case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180); |
| 108295 | +#line 568 "parse.y" | |
| 108026 | 108296 | {yygotominor.yy384 = 0;} |
| 108297 | +#line 2711 "parse.c" | |
| 108027 | 108298 | break; |
| 108028 | 108299 | case 152: /* orderby_opt ::= ORDER BY sortlist */ |
| 108029 | 108300 | case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160); |
| 108030 | 108301 | case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239); |
| 108302 | +#line 579 "parse.y" | |
| 108031 | 108303 | {yygotominor.yy322 = yymsp[0].minor.yy322;} |
| 108304 | +#line 2718 "parse.c" | |
| 108032 | 108305 | break; |
| 108033 | 108306 | case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */ |
| 108307 | +#line 580 "parse.y" | |
| 108034 | 108308 | { |
| 108035 | 108309 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314); |
| 108036 | 108310 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108037 | 108311 | } |
| 108312 | +#line 2726 "parse.c" | |
| 108038 | 108313 | break; |
| 108039 | 108314 | case 154: /* sortlist ::= sortitem sortorder */ |
| 108315 | +#line 584 "parse.y" | |
| 108040 | 108316 | { |
| 108041 | 108317 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); |
| 108042 | 108318 | if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108043 | 108319 | } |
| 108320 | +#line 2734 "parse.c" | |
| 108044 | 108321 | break; |
| 108045 | 108322 | case 156: /* sortorder ::= ASC */ |
| 108046 | 108323 | case 158: /* sortorder ::= */ yytestcase(yyruleno==158); |
| 108324 | +#line 592 "parse.y" | |
| 108047 | 108325 | {yygotominor.yy4 = SQLITE_SO_ASC;} |
| 108326 | +#line 2740 "parse.c" | |
| 108048 | 108327 | break; |
| 108049 | 108328 | case 157: /* sortorder ::= DESC */ |
| 108329 | +#line 593 "parse.y" | |
| 108050 | 108330 | {yygotominor.yy4 = SQLITE_SO_DESC;} |
| 108331 | +#line 2745 "parse.c" | |
| 108051 | 108332 | break; |
| 108052 | 108333 | case 163: /* limit_opt ::= */ |
| 108334 | +#line 619 "parse.y" | |
| 108053 | 108335 | {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;} |
| 108336 | +#line 2750 "parse.c" | |
| 108054 | 108337 | break; |
| 108055 | 108338 | case 164: /* limit_opt ::= LIMIT expr */ |
| 108339 | +#line 620 "parse.y" | |
| 108056 | 108340 | {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;} |
| 108341 | +#line 2755 "parse.c" | |
| 108057 | 108342 | break; |
| 108058 | 108343 | case 165: /* limit_opt ::= LIMIT expr OFFSET expr */ |
| 108344 | +#line 622 "parse.y" | |
| 108059 | 108345 | {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;} |
| 108346 | +#line 2760 "parse.c" | |
| 108060 | 108347 | break; |
| 108061 | 108348 | case 166: /* limit_opt ::= LIMIT expr COMMA expr */ |
| 108349 | +#line 624 "parse.y" | |
| 108062 | 108350 | {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;} |
| 108351 | +#line 2765 "parse.c" | |
| 108063 | 108352 | break; |
| 108064 | 108353 | case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ |
| 108354 | +#line 637 "parse.y" | |
| 108065 | 108355 | { |
| 108066 | 108356 | sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0); |
| 108067 | 108357 | sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314); |
| 108068 | 108358 | } |
| 108359 | +#line 2773 "parse.c" | |
| 108069 | 108360 | break; |
| 108070 | 108361 | case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ |
| 108362 | +#line 660 "parse.y" | |
| 108071 | 108363 | { |
| 108072 | 108364 | sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0); |
| 108073 | 108365 | sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); |
| 108074 | 108366 | sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210); |
| 108075 | 108367 | } |
| 108368 | +#line 2782 "parse.c" | |
| 108076 | 108369 | break; |
| 108077 | 108370 | case 171: /* setlist ::= setlist COMMA nm EQ expr */ |
| 108371 | +#line 670 "parse.y" | |
| 108078 | 108372 | { |
| 108079 | 108373 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108080 | 108374 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108081 | 108375 | } |
| 108376 | +#line 2790 "parse.c" | |
| 108082 | 108377 | break; |
| 108083 | 108378 | case 172: /* setlist ::= nm EQ expr */ |
| 108379 | +#line 674 "parse.y" | |
| 108084 | 108380 | { |
| 108085 | 108381 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr); |
| 108086 | 108382 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108087 | 108383 | } |
| 108384 | +#line 2798 "parse.c" | |
| 108088 | 108385 | break; |
| 108089 | 108386 | case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ |
| 108387 | +#line 683 "parse.y" | |
| 108090 | 108388 | {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);} |
| 108389 | +#line 2803 "parse.c" | |
| 108091 | 108390 | break; |
| 108092 | 108391 | case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ |
| 108392 | +#line 685 "parse.y" | |
| 108093 | 108393 | {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);} |
| 108394 | +#line 2808 "parse.c" | |
| 108094 | 108395 | break; |
| 108095 | 108396 | case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ |
| 108397 | +#line 687 "parse.y" | |
| 108096 | 108398 | {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);} |
| 108399 | +#line 2813 "parse.c" | |
| 108097 | 108400 | break; |
| 108098 | 108401 | case 176: /* insert_cmd ::= INSERT orconf */ |
| 108402 | +#line 690 "parse.y" | |
| 108099 | 108403 | {yygotominor.yy210 = yymsp[0].minor.yy210;} |
| 108404 | +#line 2818 "parse.c" | |
| 108100 | 108405 | break; |
| 108101 | 108406 | case 177: /* insert_cmd ::= REPLACE */ |
| 108407 | +#line 691 "parse.y" | |
| 108102 | 108408 | {yygotominor.yy210 = OE_Replace;} |
| 108409 | +#line 2823 "parse.c" | |
| 108103 | 108410 | break; |
| 108104 | 108411 | case 178: /* itemlist ::= itemlist COMMA expr */ |
| 108105 | 108412 | case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241); |
| 108413 | +#line 698 "parse.y" | |
| 108106 | 108414 | {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);} |
| 108415 | +#line 2829 "parse.c" | |
| 108107 | 108416 | break; |
| 108108 | 108417 | case 179: /* itemlist ::= expr */ |
| 108109 | 108418 | case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242); |
| 108419 | +#line 700 "parse.y" | |
| 108110 | 108420 | {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);} |
| 108421 | +#line 2835 "parse.c" | |
| 108111 | 108422 | break; |
| 108112 | 108423 | case 182: /* inscollist ::= inscollist COMMA nm */ |
| 108424 | +#line 710 "parse.y" | |
| 108113 | 108425 | {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);} |
| 108426 | +#line 2840 "parse.c" | |
| 108114 | 108427 | break; |
| 108115 | 108428 | case 183: /* inscollist ::= nm */ |
| 108429 | +#line 712 "parse.y" | |
| 108116 | 108430 | {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} |
| 108431 | +#line 2845 "parse.c" | |
| 108117 | 108432 | break; |
| 108118 | 108433 | case 184: /* expr ::= term */ |
| 108434 | +#line 743 "parse.y" | |
| 108119 | 108435 | {yygotominor.yy118 = yymsp[0].minor.yy118;} |
| 108436 | +#line 2850 "parse.c" | |
| 108120 | 108437 | break; |
| 108121 | 108438 | case 185: /* expr ::= LP expr RP */ |
| 108439 | +#line 744 "parse.y" | |
| 108122 | 108440 | {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} |
| 108441 | +#line 2855 "parse.c" | |
| 108123 | 108442 | break; |
| 108124 | 108443 | case 186: /* term ::= NULL */ |
| 108125 | 108444 | case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191); |
| 108126 | 108445 | case 192: /* term ::= STRING */ yytestcase(yyruleno==192); |
| 108446 | +#line 745 "parse.y" | |
| 108127 | 108447 | {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} |
| 108448 | +#line 2862 "parse.c" | |
| 108128 | 108449 | break; |
| 108129 | 108450 | case 187: /* expr ::= id */ |
| 108130 | 108451 | case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188); |
| 108452 | +#line 746 "parse.y" | |
| 108131 | 108453 | {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);} |
| 108454 | +#line 2868 "parse.c" | |
| 108132 | 108455 | break; |
| 108133 | 108456 | case 189: /* expr ::= nm DOT nm */ |
| 108457 | +#line 748 "parse.y" | |
| 108134 | 108458 | { |
| 108135 | 108459 | Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 108136 | 108460 | Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); |
| 108137 | 108461 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); |
| 108138 | 108462 | spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); |
| 108139 | 108463 | } |
| 108464 | +#line 2878 "parse.c" | |
| 108140 | 108465 | break; |
| 108141 | 108466 | case 190: /* expr ::= nm DOT nm DOT nm */ |
| 108467 | +#line 754 "parse.y" | |
| 108142 | 108468 | { |
| 108143 | 108469 | Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); |
| 108144 | 108470 | Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 108145 | 108471 | Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); |
| 108146 | 108472 | Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); |
| 108147 | 108473 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); |
| 108148 | 108474 | spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); |
| 108149 | 108475 | } |
| 108476 | +#line 2890 "parse.c" | |
| 108150 | 108477 | break; |
| 108151 | 108478 | case 193: /* expr ::= REGISTER */ |
| 108479 | +#line 764 "parse.y" | |
| 108152 | 108480 | { |
| 108153 | 108481 | /* When doing a nested parse, one can include terms in an expression |
| 108154 | 108482 | ** that look like this: #1 #2 ... These terms refer to registers |
| 108155 | 108483 | ** in the virtual machine. #N is the N-th register. */ |
| 108156 | 108484 | if( pParse->nested==0 ){ |
| @@ -108160,32 +108488,40 @@ | ||
| 108160 | 108488 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); |
| 108161 | 108489 | if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable); |
| 108162 | 108490 | } |
| 108163 | 108491 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108164 | 108492 | } |
| 108493 | +#line 2907 "parse.c" | |
| 108165 | 108494 | break; |
| 108166 | 108495 | case 194: /* expr ::= VARIABLE */ |
| 108496 | +#line 777 "parse.y" | |
| 108167 | 108497 | { |
| 108168 | 108498 | spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); |
| 108169 | 108499 | sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr); |
| 108170 | 108500 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108171 | 108501 | } |
| 108502 | +#line 2916 "parse.c" | |
| 108172 | 108503 | break; |
| 108173 | 108504 | case 195: /* expr ::= expr COLLATE ids */ |
| 108505 | +#line 782 "parse.y" | |
| 108174 | 108506 | { |
| 108175 | 108507 | yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0); |
| 108176 | 108508 | yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; |
| 108177 | 108509 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108178 | 108510 | } |
| 108511 | +#line 2925 "parse.c" | |
| 108179 | 108512 | break; |
| 108180 | 108513 | case 196: /* expr ::= CAST LP expr AS typetoken RP */ |
| 108514 | +#line 788 "parse.y" | |
| 108181 | 108515 | { |
| 108182 | 108516 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0); |
| 108183 | 108517 | spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); |
| 108184 | 108518 | } |
| 108519 | +#line 2933 "parse.c" | |
| 108185 | 108520 | break; |
| 108186 | 108521 | case 197: /* expr ::= ID LP distinct exprlist RP */ |
| 108522 | +#line 793 "parse.y" | |
| 108187 | 108523 | { |
| 108188 | 108524 | if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ |
| 108189 | 108525 | sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); |
| 108190 | 108526 | } |
| 108191 | 108527 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); |
| @@ -108192,47 +108528,59 @@ | ||
| 108192 | 108528 | spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); |
| 108193 | 108529 | if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){ |
| 108194 | 108530 | yygotominor.yy118.pExpr->flags |= EP_Distinct; |
| 108195 | 108531 | } |
| 108196 | 108532 | } |
| 108533 | +#line 2947 "parse.c" | |
| 108197 | 108534 | break; |
| 108198 | 108535 | case 198: /* expr ::= ID LP STAR RP */ |
| 108536 | +#line 803 "parse.y" | |
| 108199 | 108537 | { |
| 108200 | 108538 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); |
| 108201 | 108539 | spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); |
| 108202 | 108540 | } |
| 108541 | +#line 2955 "parse.c" | |
| 108203 | 108542 | break; |
| 108204 | 108543 | case 199: /* term ::= CTIME_KW */ |
| 108544 | +#line 807 "parse.y" | |
| 108205 | 108545 | { |
| 108206 | 108546 | /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are |
| 108207 | 108547 | ** treated as functions that return constants */ |
| 108208 | 108548 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); |
| 108209 | 108549 | if( yygotominor.yy118.pExpr ){ |
| 108210 | 108550 | yygotominor.yy118.pExpr->op = TK_CONST_FUNC; |
| 108211 | 108551 | } |
| 108212 | 108552 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108213 | 108553 | } |
| 108554 | +#line 2968 "parse.c" | |
| 108214 | 108555 | break; |
| 108215 | 108556 | case 200: /* expr ::= expr AND expr */ |
| 108216 | 108557 | case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201); |
| 108217 | 108558 | case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202); |
| 108218 | 108559 | case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203); |
| 108219 | 108560 | case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204); |
| 108220 | 108561 | case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205); |
| 108221 | 108562 | case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206); |
| 108222 | 108563 | case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207); |
| 108564 | +#line 834 "parse.y" | |
| 108223 | 108565 | {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);} |
| 108566 | +#line 2980 "parse.c" | |
| 108224 | 108567 | break; |
| 108225 | 108568 | case 208: /* likeop ::= LIKE_KW */ |
| 108226 | 108569 | case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210); |
| 108570 | +#line 847 "parse.y" | |
| 108227 | 108571 | {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;} |
| 108572 | +#line 2986 "parse.c" | |
| 108228 | 108573 | break; |
| 108229 | 108574 | case 209: /* likeop ::= NOT LIKE_KW */ |
| 108230 | 108575 | case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211); |
| 108576 | +#line 848 "parse.y" | |
| 108231 | 108577 | {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;} |
| 108578 | +#line 2992 "parse.c" | |
| 108232 | 108579 | break; |
| 108233 | 108580 | case 212: /* expr ::= expr likeop expr */ |
| 108581 | +#line 851 "parse.y" | |
| 108234 | 108582 | { |
| 108235 | 108583 | ExprList *pList; |
| 108236 | 108584 | pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr); |
| 108237 | 108585 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr); |
| 108238 | 108586 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator); |
| @@ -108239,12 +108587,14 @@ | ||
| 108239 | 108587 | if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108240 | 108588 | yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; |
| 108241 | 108589 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108242 | 108590 | if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; |
| 108243 | 108591 | } |
| 108592 | +#line 3006 "parse.c" | |
| 108244 | 108593 | break; |
| 108245 | 108594 | case 213: /* expr ::= expr likeop expr ESCAPE expr */ |
| 108595 | +#line 861 "parse.y" | |
| 108246 | 108596 | { |
| 108247 | 108597 | ExprList *pList; |
| 108248 | 108598 | pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108249 | 108599 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr); |
| 108250 | 108600 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); |
| @@ -108252,40 +108602,56 @@ | ||
| 108252 | 108602 | if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108253 | 108603 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108254 | 108604 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108255 | 108605 | if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; |
| 108256 | 108606 | } |
| 108607 | +#line 3021 "parse.c" | |
| 108257 | 108608 | break; |
| 108258 | 108609 | case 214: /* expr ::= expr ISNULL|NOTNULL */ |
| 108610 | +#line 889 "parse.y" | |
| 108259 | 108611 | {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);} |
| 108612 | +#line 3026 "parse.c" | |
| 108260 | 108613 | break; |
| 108261 | 108614 | case 215: /* expr ::= expr NOT NULL */ |
| 108615 | +#line 890 "parse.y" | |
| 108262 | 108616 | {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);} |
| 108617 | +#line 3031 "parse.c" | |
| 108263 | 108618 | break; |
| 108264 | 108619 | case 216: /* expr ::= expr IS expr */ |
| 108620 | +#line 911 "parse.y" | |
| 108265 | 108621 | { |
| 108266 | 108622 | spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118); |
| 108267 | 108623 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL); |
| 108268 | 108624 | } |
| 108625 | +#line 3039 "parse.c" | |
| 108269 | 108626 | break; |
| 108270 | 108627 | case 217: /* expr ::= expr IS NOT expr */ |
| 108628 | +#line 915 "parse.y" | |
| 108271 | 108629 | { |
| 108272 | 108630 | spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118); |
| 108273 | 108631 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL); |
| 108274 | 108632 | } |
| 108633 | +#line 3047 "parse.c" | |
| 108275 | 108634 | break; |
| 108276 | 108635 | case 218: /* expr ::= NOT expr */ |
| 108277 | 108636 | case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219); |
| 108637 | +#line 938 "parse.y" | |
| 108278 | 108638 | {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108639 | +#line 3053 "parse.c" | |
| 108279 | 108640 | break; |
| 108280 | 108641 | case 220: /* expr ::= MINUS expr */ |
| 108642 | +#line 941 "parse.y" | |
| 108281 | 108643 | {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108644 | +#line 3058 "parse.c" | |
| 108282 | 108645 | break; |
| 108283 | 108646 | case 221: /* expr ::= PLUS expr */ |
| 108647 | +#line 943 "parse.y" | |
| 108284 | 108648 | {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108649 | +#line 3063 "parse.c" | |
| 108285 | 108650 | break; |
| 108286 | 108651 | case 224: /* expr ::= expr between_op expr AND expr */ |
| 108652 | +#line 948 "parse.y" | |
| 108287 | 108653 | { |
| 108288 | 108654 | ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108289 | 108655 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); |
| 108290 | 108656 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0); |
| 108291 | 108657 | if( yygotominor.yy118.pExpr ){ |
| @@ -108295,12 +108661,14 @@ | ||
| 108295 | 108661 | } |
| 108296 | 108662 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108297 | 108663 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108298 | 108664 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108299 | 108665 | } |
| 108666 | +#line 3080 "parse.c" | |
| 108300 | 108667 | break; |
| 108301 | 108668 | case 227: /* expr ::= expr in_op LP exprlist RP */ |
| 108669 | +#line 965 "parse.y" | |
| 108302 | 108670 | { |
| 108303 | 108671 | if( yymsp[-1].minor.yy322==0 ){ |
| 108304 | 108672 | /* Expressions of the form |
| 108305 | 108673 | ** |
| 108306 | 108674 | ** expr1 IN () |
| @@ -108322,12 +108690,14 @@ | ||
| 108322 | 108690 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108323 | 108691 | } |
| 108324 | 108692 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108325 | 108693 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108326 | 108694 | } |
| 108695 | +#line 3109 "parse.c" | |
| 108327 | 108696 | break; |
| 108328 | 108697 | case 228: /* expr ::= LP select RP */ |
| 108698 | +#line 990 "parse.y" | |
| 108329 | 108699 | { |
| 108330 | 108700 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); |
| 108331 | 108701 | if( yygotominor.yy118.pExpr ){ |
| 108332 | 108702 | yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; |
| 108333 | 108703 | ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); |
| @@ -108336,12 +108706,14 @@ | ||
| 108336 | 108706 | sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); |
| 108337 | 108707 | } |
| 108338 | 108708 | yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z; |
| 108339 | 108709 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108340 | 108710 | } |
| 108711 | +#line 3125 "parse.c" | |
| 108341 | 108712 | break; |
| 108342 | 108713 | case 229: /* expr ::= expr in_op LP select RP */ |
| 108714 | +#line 1002 "parse.y" | |
| 108343 | 108715 | { |
| 108344 | 108716 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); |
| 108345 | 108717 | if( yygotominor.yy118.pExpr ){ |
| 108346 | 108718 | yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; |
| 108347 | 108719 | ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); |
| @@ -108351,12 +108723,14 @@ | ||
| 108351 | 108723 | } |
| 108352 | 108724 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108353 | 108725 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108354 | 108726 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108355 | 108727 | } |
| 108728 | +#line 3142 "parse.c" | |
| 108356 | 108729 | break; |
| 108357 | 108730 | case 230: /* expr ::= expr in_op nm dbnm */ |
| 108731 | +#line 1015 "parse.y" | |
| 108358 | 108732 | { |
| 108359 | 108733 | SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); |
| 108360 | 108734 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0); |
| 108361 | 108735 | if( yygotominor.yy118.pExpr ){ |
| 108362 | 108736 | yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); |
| @@ -108367,12 +108741,14 @@ | ||
| 108367 | 108741 | } |
| 108368 | 108742 | if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108369 | 108743 | yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart; |
| 108370 | 108744 | yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; |
| 108371 | 108745 | } |
| 108746 | +#line 3160 "parse.c" | |
| 108372 | 108747 | break; |
| 108373 | 108748 | case 231: /* expr ::= EXISTS LP select RP */ |
| 108749 | +#line 1029 "parse.y" | |
| 108374 | 108750 | { |
| 108375 | 108751 | Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); |
| 108376 | 108752 | if( p ){ |
| 108377 | 108753 | p->x.pSelect = yymsp[-1].minor.yy387; |
| 108378 | 108754 | ExprSetProperty(p, EP_xIsSelect); |
| @@ -108381,12 +108757,14 @@ | ||
| 108381 | 108757 | sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); |
| 108382 | 108758 | } |
| 108383 | 108759 | yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; |
| 108384 | 108760 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108385 | 108761 | } |
| 108762 | +#line 3176 "parse.c" | |
| 108386 | 108763 | break; |
| 108387 | 108764 | case 232: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 108765 | +#line 1044 "parse.y" | |
| 108388 | 108766 | { |
| 108389 | 108767 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0); |
| 108390 | 108768 | if( yygotominor.yy118.pExpr ){ |
| 108391 | 108769 | yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322; |
| 108392 | 108770 | sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); |
| @@ -108394,38 +108772,50 @@ | ||
| 108394 | 108772 | sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); |
| 108395 | 108773 | } |
| 108396 | 108774 | yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z; |
| 108397 | 108775 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108398 | 108776 | } |
| 108777 | +#line 3191 "parse.c" | |
| 108399 | 108778 | break; |
| 108400 | 108779 | case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 108780 | +#line 1057 "parse.y" | |
| 108401 | 108781 | { |
| 108402 | 108782 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr); |
| 108403 | 108783 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108404 | 108784 | } |
| 108785 | +#line 3199 "parse.c" | |
| 108405 | 108786 | break; |
| 108406 | 108787 | case 234: /* case_exprlist ::= WHEN expr THEN expr */ |
| 108788 | +#line 1061 "parse.y" | |
| 108407 | 108789 | { |
| 108408 | 108790 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108409 | 108791 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108410 | 108792 | } |
| 108793 | +#line 3207 "parse.c" | |
| 108411 | 108794 | break; |
| 108412 | 108795 | case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ |
| 108796 | +#line 1090 "parse.y" | |
| 108413 | 108797 | { |
| 108414 | 108798 | sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, |
| 108415 | 108799 | sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4, |
| 108416 | 108800 | &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4); |
| 108417 | 108801 | } |
| 108802 | +#line 3216 "parse.c" | |
| 108418 | 108803 | break; |
| 108419 | 108804 | case 244: /* uniqueflag ::= UNIQUE */ |
| 108420 | 108805 | case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298); |
| 108806 | +#line 1097 "parse.y" | |
| 108421 | 108807 | {yygotominor.yy4 = OE_Abort;} |
| 108808 | +#line 3222 "parse.c" | |
| 108422 | 108809 | break; |
| 108423 | 108810 | case 245: /* uniqueflag ::= */ |
| 108811 | +#line 1098 "parse.y" | |
| 108424 | 108812 | {yygotominor.yy4 = OE_None;} |
| 108813 | +#line 3227 "parse.c" | |
| 108425 | 108814 | break; |
| 108426 | 108815 | case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */ |
| 108816 | +#line 1107 "parse.y" | |
| 108427 | 108817 | { |
| 108428 | 108818 | Expr *p = 0; |
| 108429 | 108819 | if( yymsp[-1].minor.yy0.n>0 ){ |
| 108430 | 108820 | p = sqlite3Expr(pParse->db, TK_COLUMN, 0); |
| 108431 | 108821 | sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); |
| @@ -108433,12 +108823,14 @@ | ||
| 108433 | 108823 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p); |
| 108434 | 108824 | sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1); |
| 108435 | 108825 | sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); |
| 108436 | 108826 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108437 | 108827 | } |
| 108828 | +#line 3242 "parse.c" | |
| 108438 | 108829 | break; |
| 108439 | 108830 | case 249: /* idxlist ::= nm collate sortorder */ |
| 108831 | +#line 1118 "parse.y" | |
| 108440 | 108832 | { |
| 108441 | 108833 | Expr *p = 0; |
| 108442 | 108834 | if( yymsp[-1].minor.yy0.n>0 ){ |
| 108443 | 108835 | p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); |
| 108444 | 108836 | sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); |
| @@ -108446,214 +108838,307 @@ | ||
| 108446 | 108838 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p); |
| 108447 | 108839 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108448 | 108840 | sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); |
| 108449 | 108841 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108450 | 108842 | } |
| 108843 | +#line 3257 "parse.c" | |
| 108451 | 108844 | break; |
| 108452 | 108845 | case 250: /* collate ::= */ |
| 108846 | +#line 1131 "parse.y" | |
| 108453 | 108847 | {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} |
| 108848 | +#line 3262 "parse.c" | |
| 108454 | 108849 | break; |
| 108455 | 108850 | case 252: /* cmd ::= DROP INDEX ifexists fullname */ |
| 108851 | +#line 1137 "parse.y" | |
| 108456 | 108852 | {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);} |
| 108853 | +#line 3267 "parse.c" | |
| 108457 | 108854 | break; |
| 108458 | 108855 | case 253: /* cmd ::= VACUUM */ |
| 108459 | 108856 | case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254); |
| 108857 | +#line 1143 "parse.y" | |
| 108460 | 108858 | {sqlite3Vacuum(pParse);} |
| 108859 | +#line 3273 "parse.c" | |
| 108461 | 108860 | break; |
| 108462 | 108861 | case 255: /* cmd ::= PRAGMA nm dbnm */ |
| 108862 | +#line 1151 "parse.y" | |
| 108463 | 108863 | {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} |
| 108864 | +#line 3278 "parse.c" | |
| 108464 | 108865 | break; |
| 108465 | 108866 | case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 108867 | +#line 1152 "parse.y" | |
| 108466 | 108868 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} |
| 108869 | +#line 3283 "parse.c" | |
| 108467 | 108870 | break; |
| 108468 | 108871 | case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 108872 | +#line 1153 "parse.y" | |
| 108469 | 108873 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} |
| 108874 | +#line 3288 "parse.c" | |
| 108470 | 108875 | break; |
| 108471 | 108876 | case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 108877 | +#line 1155 "parse.y" | |
| 108472 | 108878 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} |
| 108879 | +#line 3293 "parse.c" | |
| 108473 | 108880 | break; |
| 108474 | 108881 | case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 108882 | +#line 1157 "parse.y" | |
| 108475 | 108883 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} |
| 108884 | +#line 3298 "parse.c" | |
| 108476 | 108885 | break; |
| 108477 | 108886 | case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 108887 | +#line 1175 "parse.y" | |
| 108478 | 108888 | { |
| 108479 | 108889 | Token all; |
| 108480 | 108890 | all.z = yymsp[-3].minor.yy0.z; |
| 108481 | 108891 | all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; |
| 108482 | 108892 | sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all); |
| 108483 | 108893 | } |
| 108894 | +#line 3308 "parse.c" | |
| 108484 | 108895 | break; |
| 108485 | 108896 | case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 108897 | +#line 1184 "parse.y" | |
| 108486 | 108898 | { |
| 108487 | 108899 | sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4); |
| 108488 | 108900 | yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); |
| 108489 | 108901 | } |
| 108902 | +#line 3316 "parse.c" | |
| 108490 | 108903 | break; |
| 108491 | 108904 | case 272: /* trigger_time ::= BEFORE */ |
| 108492 | 108905 | case 275: /* trigger_time ::= */ yytestcase(yyruleno==275); |
| 108906 | +#line 1190 "parse.y" | |
| 108493 | 108907 | { yygotominor.yy4 = TK_BEFORE; } |
| 108908 | +#line 3322 "parse.c" | |
| 108494 | 108909 | break; |
| 108495 | 108910 | case 273: /* trigger_time ::= AFTER */ |
| 108911 | +#line 1191 "parse.y" | |
| 108496 | 108912 | { yygotominor.yy4 = TK_AFTER; } |
| 108913 | +#line 3327 "parse.c" | |
| 108497 | 108914 | break; |
| 108498 | 108915 | case 274: /* trigger_time ::= INSTEAD OF */ |
| 108916 | +#line 1192 "parse.y" | |
| 108499 | 108917 | { yygotominor.yy4 = TK_INSTEAD;} |
| 108918 | +#line 3332 "parse.c" | |
| 108500 | 108919 | break; |
| 108501 | 108920 | case 276: /* trigger_event ::= DELETE|INSERT */ |
| 108502 | 108921 | case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277); |
| 108922 | +#line 1197 "parse.y" | |
| 108503 | 108923 | {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;} |
| 108924 | +#line 3338 "parse.c" | |
| 108504 | 108925 | break; |
| 108505 | 108926 | case 278: /* trigger_event ::= UPDATE OF inscollist */ |
| 108927 | +#line 1199 "parse.y" | |
| 108506 | 108928 | {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;} |
| 108929 | +#line 3343 "parse.c" | |
| 108507 | 108930 | break; |
| 108508 | 108931 | case 281: /* when_clause ::= */ |
| 108509 | 108932 | case 303: /* key_opt ::= */ yytestcase(yyruleno==303); |
| 108933 | +#line 1206 "parse.y" | |
| 108510 | 108934 | { yygotominor.yy314 = 0; } |
| 108935 | +#line 3349 "parse.c" | |
| 108511 | 108936 | break; |
| 108512 | 108937 | case 282: /* when_clause ::= WHEN expr */ |
| 108513 | 108938 | case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304); |
| 108939 | +#line 1207 "parse.y" | |
| 108514 | 108940 | { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; } |
| 108941 | +#line 3355 "parse.c" | |
| 108515 | 108942 | break; |
| 108516 | 108943 | case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 108944 | +#line 1211 "parse.y" | |
| 108517 | 108945 | { |
| 108518 | 108946 | assert( yymsp[-2].minor.yy203!=0 ); |
| 108519 | 108947 | yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203; |
| 108520 | 108948 | yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203; |
| 108521 | 108949 | yygotominor.yy203 = yymsp[-2].minor.yy203; |
| 108522 | 108950 | } |
| 108951 | +#line 3365 "parse.c" | |
| 108523 | 108952 | break; |
| 108524 | 108953 | case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 108954 | +#line 1217 "parse.y" | |
| 108525 | 108955 | { |
| 108526 | 108956 | assert( yymsp[-1].minor.yy203!=0 ); |
| 108527 | 108957 | yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203; |
| 108528 | 108958 | yygotominor.yy203 = yymsp[-1].minor.yy203; |
| 108529 | 108959 | } |
| 108960 | +#line 3374 "parse.c" | |
| 108530 | 108961 | break; |
| 108531 | 108962 | case 286: /* trnm ::= nm DOT nm */ |
| 108963 | +#line 1229 "parse.y" | |
| 108532 | 108964 | { |
| 108533 | 108965 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 108534 | 108966 | sqlite3ErrorMsg(pParse, |
| 108535 | 108967 | "qualified table names are not allowed on INSERT, UPDATE, and DELETE " |
| 108536 | 108968 | "statements within triggers"); |
| 108537 | 108969 | } |
| 108970 | +#line 3384 "parse.c" | |
| 108538 | 108971 | break; |
| 108539 | 108972 | case 288: /* tridxby ::= INDEXED BY nm */ |
| 108973 | +#line 1241 "parse.y" | |
| 108540 | 108974 | { |
| 108541 | 108975 | sqlite3ErrorMsg(pParse, |
| 108542 | 108976 | "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " |
| 108543 | 108977 | "within triggers"); |
| 108544 | 108978 | } |
| 108979 | +#line 3393 "parse.c" | |
| 108545 | 108980 | break; |
| 108546 | 108981 | case 289: /* tridxby ::= NOT INDEXED */ |
| 108982 | +#line 1246 "parse.y" | |
| 108547 | 108983 | { |
| 108548 | 108984 | sqlite3ErrorMsg(pParse, |
| 108549 | 108985 | "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " |
| 108550 | 108986 | "within triggers"); |
| 108551 | 108987 | } |
| 108988 | +#line 3402 "parse.c" | |
| 108552 | 108989 | break; |
| 108553 | 108990 | case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */ |
| 108991 | +#line 1259 "parse.y" | |
| 108554 | 108992 | { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); } |
| 108993 | +#line 3407 "parse.c" | |
| 108555 | 108994 | break; |
| 108556 | 108995 | case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */ |
| 108996 | +#line 1264 "parse.y" | |
| 108557 | 108997 | {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);} |
| 108998 | +#line 3412 "parse.c" | |
| 108558 | 108999 | break; |
| 108559 | 109000 | case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ |
| 109001 | +#line 1267 "parse.y" | |
| 108560 | 109002 | {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);} |
| 109003 | +#line 3417 "parse.c" | |
| 108561 | 109004 | break; |
| 108562 | 109005 | case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ |
| 109006 | +#line 1271 "parse.y" | |
| 108563 | 109007 | {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);} |
| 109008 | +#line 3422 "parse.c" | |
| 108564 | 109009 | break; |
| 108565 | 109010 | case 294: /* trigger_cmd ::= select */ |
| 109011 | +#line 1274 "parse.y" | |
| 108566 | 109012 | {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); } |
| 109013 | +#line 3427 "parse.c" | |
| 108567 | 109014 | break; |
| 108568 | 109015 | case 295: /* expr ::= RAISE LP IGNORE RP */ |
| 109016 | +#line 1277 "parse.y" | |
| 108569 | 109017 | { |
| 108570 | 109018 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); |
| 108571 | 109019 | if( yygotominor.yy118.pExpr ){ |
| 108572 | 109020 | yygotominor.yy118.pExpr->affinity = OE_Ignore; |
| 108573 | 109021 | } |
| 108574 | 109022 | yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; |
| 108575 | 109023 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108576 | 109024 | } |
| 109025 | +#line 3439 "parse.c" | |
| 108577 | 109026 | break; |
| 108578 | 109027 | case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 109028 | +#line 1285 "parse.y" | |
| 108579 | 109029 | { |
| 108580 | 109030 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); |
| 108581 | 109031 | if( yygotominor.yy118.pExpr ) { |
| 108582 | 109032 | yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4; |
| 108583 | 109033 | } |
| 108584 | 109034 | yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z; |
| 108585 | 109035 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108586 | 109036 | } |
| 109037 | +#line 3451 "parse.c" | |
| 108587 | 109038 | break; |
| 108588 | 109039 | case 297: /* raisetype ::= ROLLBACK */ |
| 109040 | +#line 1296 "parse.y" | |
| 108589 | 109041 | {yygotominor.yy4 = OE_Rollback;} |
| 109042 | +#line 3456 "parse.c" | |
| 108590 | 109043 | break; |
| 108591 | 109044 | case 299: /* raisetype ::= FAIL */ |
| 109045 | +#line 1298 "parse.y" | |
| 108592 | 109046 | {yygotominor.yy4 = OE_Fail;} |
| 109047 | +#line 3461 "parse.c" | |
| 108593 | 109048 | break; |
| 108594 | 109049 | case 300: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 109050 | +#line 1303 "parse.y" | |
| 108595 | 109051 | { |
| 108596 | 109052 | sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4); |
| 108597 | 109053 | } |
| 109054 | +#line 3468 "parse.c" | |
| 108598 | 109055 | break; |
| 108599 | 109056 | case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 109057 | +#line 1310 "parse.y" | |
| 108600 | 109058 | { |
| 108601 | 109059 | sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314); |
| 108602 | 109060 | } |
| 109061 | +#line 3475 "parse.c" | |
| 108603 | 109062 | break; |
| 108604 | 109063 | case 302: /* cmd ::= DETACH database_kw_opt expr */ |
| 109064 | +#line 1313 "parse.y" | |
| 108605 | 109065 | { |
| 108606 | 109066 | sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr); |
| 108607 | 109067 | } |
| 109068 | +#line 3482 "parse.c" | |
| 108608 | 109069 | break; |
| 108609 | 109070 | case 307: /* cmd ::= REINDEX */ |
| 109071 | +#line 1328 "parse.y" | |
| 108610 | 109072 | {sqlite3Reindex(pParse, 0, 0);} |
| 109073 | +#line 3487 "parse.c" | |
| 108611 | 109074 | break; |
| 108612 | 109075 | case 308: /* cmd ::= REINDEX nm dbnm */ |
| 109076 | +#line 1329 "parse.y" | |
| 108613 | 109077 | {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 109078 | +#line 3492 "parse.c" | |
| 108614 | 109079 | break; |
| 108615 | 109080 | case 309: /* cmd ::= ANALYZE */ |
| 109081 | +#line 1334 "parse.y" | |
| 108616 | 109082 | {sqlite3Analyze(pParse, 0, 0);} |
| 109083 | +#line 3497 "parse.c" | |
| 108617 | 109084 | break; |
| 108618 | 109085 | case 310: /* cmd ::= ANALYZE nm dbnm */ |
| 109086 | +#line 1335 "parse.y" | |
| 108619 | 109087 | {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 109088 | +#line 3502 "parse.c" | |
| 108620 | 109089 | break; |
| 108621 | 109090 | case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 109091 | +#line 1340 "parse.y" | |
| 108622 | 109092 | { |
| 108623 | 109093 | sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0); |
| 108624 | 109094 | } |
| 109095 | +#line 3509 "parse.c" | |
| 108625 | 109096 | break; |
| 108626 | 109097 | case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ |
| 109098 | +#line 1343 "parse.y" | |
| 108627 | 109099 | { |
| 108628 | 109100 | sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); |
| 108629 | 109101 | } |
| 109102 | +#line 3516 "parse.c" | |
| 108630 | 109103 | break; |
| 108631 | 109104 | case 313: /* add_column_fullname ::= fullname */ |
| 109105 | +#line 1346 "parse.y" | |
| 108632 | 109106 | { |
| 108633 | 109107 | pParse->db->lookaside.bEnabled = 0; |
| 108634 | 109108 | sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259); |
| 108635 | 109109 | } |
| 109110 | +#line 3524 "parse.c" | |
| 108636 | 109111 | break; |
| 108637 | 109112 | case 316: /* cmd ::= create_vtab */ |
| 109113 | +#line 1356 "parse.y" | |
| 108638 | 109114 | {sqlite3VtabFinishParse(pParse,0);} |
| 109115 | +#line 3529 "parse.c" | |
| 108639 | 109116 | break; |
| 108640 | 109117 | case 317: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 109118 | +#line 1357 "parse.y" | |
| 108641 | 109119 | {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} |
| 109120 | +#line 3534 "parse.c" | |
| 108642 | 109121 | break; |
| 108643 | 109122 | case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */ |
| 109123 | +#line 1358 "parse.y" | |
| 108644 | 109124 | { |
| 108645 | 109125 | sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); |
| 108646 | 109126 | } |
| 109127 | +#line 3541 "parse.c" | |
| 108647 | 109128 | break; |
| 108648 | 109129 | case 321: /* vtabarg ::= */ |
| 109130 | +#line 1363 "parse.y" | |
| 108649 | 109131 | {sqlite3VtabArgInit(pParse);} |
| 109132 | +#line 3546 "parse.c" | |
| 108650 | 109133 | break; |
| 108651 | 109134 | case 323: /* vtabargtoken ::= ANY */ |
| 108652 | 109135 | case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324); |
| 108653 | 109136 | case 325: /* lp ::= LP */ yytestcase(yyruleno==325); |
| 109137 | +#line 1365 "parse.y" | |
| 108654 | 109138 | {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} |
| 109139 | +#line 3553 "parse.c" | |
| 108655 | 109140 | break; |
| 108656 | 109141 | default: |
| 108657 | 109142 | /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); |
| 108658 | 109143 | /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1); |
| 108659 | 109144 | /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2); |
| @@ -108751,15 +109236,17 @@ | ||
| 108751 | 109236 | int yymajor, /* The major type of the error token */ |
| 108752 | 109237 | YYMINORTYPE yyminor /* The minor type of the error token */ |
| 108753 | 109238 | ){ |
| 108754 | 109239 | sqlite3ParserARG_FETCH; |
| 108755 | 109240 | #define TOKEN (yyminor.yy0) |
| 109241 | +#line 32 "parse.y" | |
| 108756 | 109242 | |
| 108757 | 109243 | UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */ |
| 108758 | 109244 | assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */ |
| 108759 | 109245 | sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); |
| 108760 | 109246 | pParse->parseError = 1; |
| 109247 | +#line 3661 "parse.c" | |
| 108761 | 109248 | sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ |
| 108762 | 109249 | } |
| 108763 | 109250 | |
| 108764 | 109251 | /* |
| 108765 | 109252 | ** The following is executed when the parser accepts |
| @@ -108949,10 +109436,11 @@ | ||
| 108949 | 109436 | return; |
| 108950 | 109437 | } |
| 108951 | 109438 | |
| 108952 | 109439 | /************** End of parse.c ***********************************************/ |
| 108953 | 109440 | /************** Begin file tokenize.c ****************************************/ |
| 109441 | +#line 1 "tsrc/tokenize.c" | |
| 108954 | 109442 | /* |
| 108955 | 109443 | ** 2001 September 15 |
| 108956 | 109444 | ** |
| 108957 | 109445 | ** The author disclaims copyright to this source code. In place of |
| 108958 | 109446 | ** a legal notice, here is a blessing: |
| @@ -109014,10 +109502,11 @@ | ||
| 109014 | 109502 | ** named keywordhash.h and then included into this source file by |
| 109015 | 109503 | ** the #include below. |
| 109016 | 109504 | */ |
| 109017 | 109505 | /************** Include keywordhash.h in the middle of tokenize.c ************/ |
| 109018 | 109506 | /************** Begin file keywordhash.h *************************************/ |
| 109507 | +#line 1 "tsrc/keywordhash.h" | |
| 109019 | 109508 | /***** This file contains automatically generated code ****** |
| 109020 | 109509 | ** |
| 109021 | 109510 | ** The code in this file has been automatically generated by |
| 109022 | 109511 | ** |
| 109023 | 109512 | ** sqlite/tool/mkkeywordhash.c |
| @@ -109287,10 +109776,11 @@ | ||
| 109287 | 109776 | } |
| 109288 | 109777 | #define SQLITE_N_KEYWORD 121 |
| 109289 | 109778 | |
| 109290 | 109779 | /************** End of keywordhash.h *****************************************/ |
| 109291 | 109780 | /************** Continuing where we left off in tokenize.c *******************/ |
| 109781 | +#line 66 "tsrc/tokenize.c" | |
| 109292 | 109782 | |
| 109293 | 109783 | |
| 109294 | 109784 | /* |
| 109295 | 109785 | ** If X is a character that can be used in an identifier then |
| 109296 | 109786 | ** IdChar(X) will be true. Otherwise it is false. |
| @@ -109751,10 +110241,11 @@ | ||
| 109751 | 110241 | return nErr; |
| 109752 | 110242 | } |
| 109753 | 110243 | |
| 109754 | 110244 | /************** End of tokenize.c ********************************************/ |
| 109755 | 110245 | /************** Begin file complete.c ****************************************/ |
| 110246 | +#line 1 "tsrc/complete.c" | |
| 109756 | 110247 | /* |
| 109757 | 110248 | ** 2001 September 15 |
| 109758 | 110249 | ** |
| 109759 | 110250 | ** The author disclaims copyright to this source code. In place of |
| 109760 | 110251 | ** a legal notice, here is a blessing: |
| @@ -110036,10 +110527,11 @@ | ||
| 110036 | 110527 | #endif /* SQLITE_OMIT_UTF16 */ |
| 110037 | 110528 | #endif /* SQLITE_OMIT_COMPLETE */ |
| 110038 | 110529 | |
| 110039 | 110530 | /************** End of complete.c ********************************************/ |
| 110040 | 110531 | /************** Begin file main.c ********************************************/ |
| 110532 | +#line 1 "tsrc/main.c" | |
| 110041 | 110533 | /* |
| 110042 | 110534 | ** 2001 September 15 |
| 110043 | 110535 | ** |
| 110044 | 110536 | ** The author disclaims copyright to this source code. In place of |
| 110045 | 110537 | ** a legal notice, here is a blessing: |
| @@ -110056,10 +110548,11 @@ | ||
| 110056 | 110548 | */ |
| 110057 | 110549 | |
| 110058 | 110550 | #ifdef SQLITE_ENABLE_FTS3 |
| 110059 | 110551 | /************** Include fts3.h in the middle of main.c ***********************/ |
| 110060 | 110552 | /************** Begin file fts3.h ********************************************/ |
| 110553 | +#line 1 "tsrc/fts3.h" | |
| 110061 | 110554 | /* |
| 110062 | 110555 | ** 2006 Oct 10 |
| 110063 | 110556 | ** |
| 110064 | 110557 | ** The author disclaims copyright to this source code. In place of |
| 110065 | 110558 | ** a legal notice, here is a blessing: |
| @@ -110084,14 +110577,16 @@ | ||
| 110084 | 110577 | } /* extern "C" */ |
| 110085 | 110578 | #endif /* __cplusplus */ |
| 110086 | 110579 | |
| 110087 | 110580 | /************** End of fts3.h ************************************************/ |
| 110088 | 110581 | /************** Continuing where we left off in main.c ***********************/ |
| 110582 | +#line 21 "tsrc/main.c" | |
| 110089 | 110583 | #endif |
| 110090 | 110584 | #ifdef SQLITE_ENABLE_RTREE |
| 110091 | 110585 | /************** Include rtree.h in the middle of main.c **********************/ |
| 110092 | 110586 | /************** Begin file rtree.h *******************************************/ |
| 110587 | +#line 1 "tsrc/rtree.h" | |
| 110093 | 110588 | /* |
| 110094 | 110589 | ** 2008 May 26 |
| 110095 | 110590 | ** |
| 110096 | 110591 | ** The author disclaims copyright to this source code. In place of |
| 110097 | 110592 | ** a legal notice, here is a blessing: |
| @@ -110116,14 +110611,16 @@ | ||
| 110116 | 110611 | } /* extern "C" */ |
| 110117 | 110612 | #endif /* __cplusplus */ |
| 110118 | 110613 | |
| 110119 | 110614 | /************** End of rtree.h ***********************************************/ |
| 110120 | 110615 | /************** Continuing where we left off in main.c ***********************/ |
| 110616 | +#line 24 "tsrc/main.c" | |
| 110121 | 110617 | #endif |
| 110122 | 110618 | #ifdef SQLITE_ENABLE_ICU |
| 110123 | 110619 | /************** Include sqliteicu.h in the middle of main.c ******************/ |
| 110124 | 110620 | /************** Begin file sqliteicu.h ***************************************/ |
| 110621 | +#line 1 "tsrc/sqliteicu.h" | |
| 110125 | 110622 | /* |
| 110126 | 110623 | ** 2008 May 26 |
| 110127 | 110624 | ** |
| 110128 | 110625 | ** The author disclaims copyright to this source code. In place of |
| 110129 | 110626 | ** a legal notice, here is a blessing: |
| @@ -110149,10 +110646,11 @@ | ||
| 110149 | 110646 | #endif /* __cplusplus */ |
| 110150 | 110647 | |
| 110151 | 110648 | |
| 110152 | 110649 | /************** End of sqliteicu.h *******************************************/ |
| 110153 | 110650 | /************** Continuing where we left off in main.c ***********************/ |
| 110651 | +#line 27 "tsrc/main.c" | |
| 110154 | 110652 | #endif |
| 110155 | 110653 | |
| 110156 | 110654 | #ifndef SQLITE_AMALGAMATION |
| 110157 | 110655 | /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant |
| 110158 | 110656 | ** contains the text of SQLITE_VERSION macro. |
| @@ -113079,10 +113577,11 @@ | ||
| 113079 | 113577 | return 0; |
| 113080 | 113578 | } |
| 113081 | 113579 | |
| 113082 | 113580 | /************** End of main.c ************************************************/ |
| 113083 | 113581 | /************** Begin file notify.c ******************************************/ |
| 113582 | +#line 1 "tsrc/notify.c" | |
| 113084 | 113583 | /* |
| 113085 | 113584 | ** 2009 March 3 |
| 113086 | 113585 | ** |
| 113087 | 113586 | ** The author disclaims copyright to this source code. In place of |
| 113088 | 113587 | ** a legal notice, here is a blessing: |
| @@ -113412,10 +113911,11 @@ | ||
| 113412 | 113911 | } |
| 113413 | 113912 | #endif |
| 113414 | 113913 | |
| 113415 | 113914 | /************** End of notify.c **********************************************/ |
| 113416 | 113915 | /************** Begin file fts3.c ********************************************/ |
| 113916 | +#line 1 "tsrc/fts3.c" | |
| 113417 | 113917 | /* |
| 113418 | 113918 | ** 2006 Oct 10 |
| 113419 | 113919 | ** |
| 113420 | 113920 | ** The author disclaims copyright to this source code. In place of |
| 113421 | 113921 | ** a legal notice, here is a blessing: |
| @@ -113708,10 +114208,11 @@ | ||
| 113708 | 114208 | ** into a single segment. |
| 113709 | 114209 | */ |
| 113710 | 114210 | |
| 113711 | 114211 | /************** Include fts3Int.h in the middle of fts3.c ********************/ |
| 113712 | 114212 | /************** Begin file fts3Int.h *****************************************/ |
| 114213 | +#line 1 "tsrc/fts3Int.h" | |
| 113713 | 114214 | /* |
| 113714 | 114215 | ** 2009 Nov 12 |
| 113715 | 114216 | ** |
| 113716 | 114217 | ** The author disclaims copyright to this source code. In place of |
| 113717 | 114218 | ** a legal notice, here is a blessing: |
| @@ -113746,10 +114247,11 @@ | ||
| 113746 | 114247 | SQLITE_API extern const sqlite3_api_routines *sqlite3_api; |
| 113747 | 114248 | #endif |
| 113748 | 114249 | |
| 113749 | 114250 | /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/ |
| 113750 | 114251 | /************** Begin file fts3_tokenizer.h **********************************/ |
| 114252 | +#line 1 "tsrc/fts3_tokenizer.h" | |
| 113751 | 114253 | /* |
| 113752 | 114254 | ** 2006 July 10 |
| 113753 | 114255 | ** |
| 113754 | 114256 | ** The author disclaims copyright to this source code. |
| 113755 | 114257 | ** |
| @@ -113900,12 +114402,14 @@ | ||
| 113900 | 114402 | |
| 113901 | 114403 | #endif /* _FTS3_TOKENIZER_H_ */ |
| 113902 | 114404 | |
| 113903 | 114405 | /************** End of fts3_tokenizer.h **************************************/ |
| 113904 | 114406 | /************** Continuing where we left off in fts3Int.h ********************/ |
| 114407 | +#line 40 "tsrc/fts3Int.h" | |
| 113905 | 114408 | /************** Include fts3_hash.h in the middle of fts3Int.h ***************/ |
| 113906 | 114409 | /************** Begin file fts3_hash.h ***************************************/ |
| 114410 | +#line 1 "tsrc/fts3_hash.h" | |
| 113907 | 114411 | /* |
| 113908 | 114412 | ** 2001 September 22 |
| 113909 | 114413 | ** |
| 113910 | 114414 | ** The author disclaims copyright to this source code. In place of |
| 113911 | 114415 | ** a legal notice, here is a blessing: |
| @@ -114017,10 +114521,11 @@ | ||
| 114017 | 114521 | |
| 114018 | 114522 | #endif /* _FTS3_HASH_H_ */ |
| 114019 | 114523 | |
| 114020 | 114524 | /************** End of fts3_hash.h *******************************************/ |
| 114021 | 114525 | /************** Continuing where we left off in fts3Int.h ********************/ |
| 114526 | +#line 41 "tsrc/fts3Int.h" | |
| 114022 | 114527 | |
| 114023 | 114528 | /* |
| 114024 | 114529 | ** This constant controls how often segments are merged. Once there are |
| 114025 | 114530 | ** FTS3_MERGE_COUNT segments of level N, they are merged into a single |
| 114026 | 114531 | ** segment of level N+1. |
| @@ -114493,10 +114998,11 @@ | ||
| 114493 | 114998 | #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */ |
| 114494 | 114999 | #endif /* _FTSINT_H */ |
| 114495 | 115000 | |
| 114496 | 115001 | /************** End of fts3Int.h *********************************************/ |
| 114497 | 115002 | /************** Continuing where we left off in fts3.c ***********************/ |
| 115003 | +#line 296 "tsrc/fts3.c" | |
| 114498 | 115004 | #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) |
| 114499 | 115005 | |
| 114500 | 115006 | #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE) |
| 114501 | 115007 | # define SQLITE_CORE 1 |
| 114502 | 115008 | #endif |
| @@ -116264,11 +116770,41 @@ | ||
| 116264 | 116770 | char *aOut; |
| 116265 | 116771 | int bFirstOut = 0; |
| 116266 | 116772 | |
| 116267 | 116773 | *paOut = 0; |
| 116268 | 116774 | *pnOut = 0; |
| 116269 | - aOut = sqlite3_malloc(n1+n2); | |
| 116775 | + | |
| 116776 | + /* Allocate space for the output. Both the input and output doclists | |
| 116777 | + ** are delta encoded. If they are in ascending order (bDescDoclist==0), | |
| 116778 | + ** then the first docid in each list is simply encoded as a varint. For | |
| 116779 | + ** each subsequent docid, the varint stored is the difference between the | |
| 116780 | + ** current and previous docid (a positive number - since the list is in | |
| 116781 | + ** ascending order). | |
| 116782 | + ** | |
| 116783 | + ** The first docid written to the output is therefore encoded using the | |
| 116784 | + ** same number of bytes as it is in whichever of the input lists it is | |
| 116785 | + ** read from. And each subsequent docid read from the same input list | |
| 116786 | + ** consumes either the same or less bytes as it did in the input (since | |
| 116787 | + ** the difference between it and the previous value in the output must | |
| 116788 | + ** be a positive value less than or equal to the delta value read from | |
| 116789 | + ** the input list). The same argument applies to all but the first docid | |
| 116790 | + ** read from the 'other' list. And to the contents of all position lists | |
| 116791 | + ** that will be copied and merged from the input to the output. | |
| 116792 | + ** | |
| 116793 | + ** However, if the first docid copied to the output is a negative number, | |
| 116794 | + ** then the encoding of the first docid from the 'other' input list may | |
| 116795 | + ** be larger in the output than it was in the input (since the delta value | |
| 116796 | + ** may be a larger positive integer than the actual docid). | |
| 116797 | + ** | |
| 116798 | + ** The space required to store the output is therefore the sum of the | |
| 116799 | + ** sizes of the two inputs, plus enough space for exactly one of the input | |
| 116800 | + ** docids to grow. | |
| 116801 | + ** | |
| 116802 | + ** A symetric argument may be made if the doclists are in descending | |
| 116803 | + ** order. | |
| 116804 | + */ | |
| 116805 | + aOut = sqlite3_malloc(n1+n2+FTS3_VARINT_MAX-1); | |
| 116270 | 116806 | if( !aOut ) return SQLITE_NOMEM; |
| 116271 | 116807 | |
| 116272 | 116808 | p = aOut; |
| 116273 | 116809 | fts3GetDeltaVarint3(&p1, pEnd1, 0, &i1); |
| 116274 | 116810 | fts3GetDeltaVarint3(&p2, pEnd2, 0, &i2); |
| @@ -116291,10 +116827,11 @@ | ||
| 116291 | 116827 | } |
| 116292 | 116828 | } |
| 116293 | 116829 | |
| 116294 | 116830 | *paOut = aOut; |
| 116295 | 116831 | *pnOut = (p-aOut); |
| 116832 | + assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 ); | |
| 116296 | 116833 | return SQLITE_OK; |
| 116297 | 116834 | } |
| 116298 | 116835 | |
| 116299 | 116836 | /* |
| 116300 | 116837 | ** This function does a "phrase" merge of two doclists. In a phrase merge, |
| @@ -119011,10 +119548,11 @@ | ||
| 119011 | 119548 | |
| 119012 | 119549 | #endif |
| 119013 | 119550 | |
| 119014 | 119551 | /************** End of fts3.c ************************************************/ |
| 119015 | 119552 | /************** Begin file fts3_aux.c ****************************************/ |
| 119553 | +#line 1 "tsrc/fts3_aux.c" | |
| 119016 | 119554 | /* |
| 119017 | 119555 | ** 2011 Jan 27 |
| 119018 | 119556 | ** |
| 119019 | 119557 | ** The author disclaims copyright to this source code. In place of |
| 119020 | 119558 | ** a legal notice, here is a blessing: |
| @@ -119487,10 +120025,11 @@ | ||
| 119487 | 120025 | |
| 119488 | 120026 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 119489 | 120027 | |
| 119490 | 120028 | /************** End of fts3_aux.c ********************************************/ |
| 119491 | 120029 | /************** Begin file fts3_expr.c ***************************************/ |
| 120030 | +#line 1 "tsrc/fts3_expr.c" | |
| 119492 | 120031 | /* |
| 119493 | 120032 | ** 2008 Nov 28 |
| 119494 | 120033 | ** |
| 119495 | 120034 | ** The author disclaims copyright to this source code. In place of |
| 119496 | 120035 | ** a legal notice, here is a blessing: |
| @@ -120453,10 +120992,11 @@ | ||
| 120453 | 120992 | #endif |
| 120454 | 120993 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 120455 | 120994 | |
| 120456 | 120995 | /************** End of fts3_expr.c *******************************************/ |
| 120457 | 120996 | /************** Begin file fts3_hash.c ***************************************/ |
| 120997 | +#line 1 "tsrc/fts3_hash.c" | |
| 120458 | 120998 | /* |
| 120459 | 120999 | ** 2001 September 22 |
| 120460 | 121000 | ** |
| 120461 | 121001 | ** The author disclaims copyright to this source code. In place of |
| 120462 | 121002 | ** a legal notice, here is a blessing: |
| @@ -120837,10 +121377,11 @@ | ||
| 120837 | 121377 | |
| 120838 | 121378 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 120839 | 121379 | |
| 120840 | 121380 | /************** End of fts3_hash.c *******************************************/ |
| 120841 | 121381 | /************** Begin file fts3_porter.c *************************************/ |
| 121382 | +#line 1 "tsrc/fts3_porter.c" | |
| 120842 | 121383 | /* |
| 120843 | 121384 | ** 2006 September 30 |
| 120844 | 121385 | ** |
| 120845 | 121386 | ** The author disclaims copyright to this source code. In place of |
| 120846 | 121387 | ** a legal notice, here is a blessing: |
| @@ -121483,10 +122024,11 @@ | ||
| 121483 | 122024 | |
| 121484 | 122025 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 121485 | 122026 | |
| 121486 | 122027 | /************** End of fts3_porter.c *****************************************/ |
| 121487 | 122028 | /************** Begin file fts3_tokenizer.c **********************************/ |
| 122029 | +#line 1 "tsrc/fts3_tokenizer.c" | |
| 121488 | 122030 | /* |
| 121489 | 122031 | ** 2007 June 22 |
| 121490 | 122032 | ** |
| 121491 | 122033 | ** The author disclaims copyright to this source code. In place of |
| 121492 | 122034 | ** a legal notice, here is a blessing: |
| @@ -121974,10 +122516,11 @@ | ||
| 121974 | 122516 | |
| 121975 | 122517 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 121976 | 122518 | |
| 121977 | 122519 | /************** End of fts3_tokenizer.c **************************************/ |
| 121978 | 122520 | /************** Begin file fts3_tokenizer1.c *********************************/ |
| 122521 | +#line 1 "tsrc/fts3_tokenizer1.c" | |
| 121979 | 122522 | /* |
| 121980 | 122523 | ** 2006 Oct 10 |
| 121981 | 122524 | ** |
| 121982 | 122525 | ** The author disclaims copyright to this source code. In place of |
| 121983 | 122526 | ** a legal notice, here is a blessing: |
| @@ -122208,10 +122751,11 @@ | ||
| 122208 | 122751 | |
| 122209 | 122752 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 122210 | 122753 | |
| 122211 | 122754 | /************** End of fts3_tokenizer1.c *************************************/ |
| 122212 | 122755 | /************** Begin file fts3_write.c **************************************/ |
| 122756 | +#line 1 "tsrc/fts3_write.c" | |
| 122213 | 122757 | /* |
| 122214 | 122758 | ** 2009 Oct 23 |
| 122215 | 122759 | ** |
| 122216 | 122760 | ** The author disclaims copyright to this source code. In place of |
| 122217 | 122761 | ** a legal notice, here is a blessing: |
| @@ -125478,10 +126022,11 @@ | ||
| 125478 | 126022 | |
| 125479 | 126023 | #endif |
| 125480 | 126024 | |
| 125481 | 126025 | /************** End of fts3_write.c ******************************************/ |
| 125482 | 126026 | /************** Begin file fts3_snippet.c ************************************/ |
| 126027 | +#line 1 "tsrc/fts3_snippet.c" | |
| 125483 | 126028 | /* |
| 125484 | 126029 | ** 2009 Oct 23 |
| 125485 | 126030 | ** |
| 125486 | 126031 | ** The author disclaims copyright to this source code. In place of |
| 125487 | 126032 | ** a legal notice, here is a blessing: |
| @@ -126979,10 +127524,11 @@ | ||
| 126979 | 127524 | |
| 126980 | 127525 | #endif |
| 126981 | 127526 | |
| 126982 | 127527 | /************** End of fts3_snippet.c ****************************************/ |
| 126983 | 127528 | /************** Begin file rtree.c *******************************************/ |
| 127529 | +#line 1 "tsrc/rtree.c" | |
| 126984 | 127530 | /* |
| 126985 | 127531 | ** 2001 September 15 |
| 126986 | 127532 | ** |
| 126987 | 127533 | ** The author disclaims copyright to this source code. In place of |
| 126988 | 127534 | ** a legal notice, here is a blessing: |
| @@ -130260,10 +130806,11 @@ | ||
| 130260 | 130806 | |
| 130261 | 130807 | #endif |
| 130262 | 130808 | |
| 130263 | 130809 | /************** End of rtree.c ***********************************************/ |
| 130264 | 130810 | /************** Begin file icu.c *********************************************/ |
| 130811 | +#line 1 "tsrc/icu.c" | |
| 130265 | 130812 | /* |
| 130266 | 130813 | ** 2007 May 6 |
| 130267 | 130814 | ** |
| 130268 | 130815 | ** The author disclaims copyright to this source code. In place of |
| 130269 | 130816 | ** a legal notice, here is a blessing: |
| @@ -130762,10 +131309,11 @@ | ||
| 130762 | 131309 | |
| 130763 | 131310 | #endif |
| 130764 | 131311 | |
| 130765 | 131312 | /************** End of icu.c *************************************************/ |
| 130766 | 131313 | /************** Begin file fts3_icu.c ****************************************/ |
| 131314 | +#line 1 "tsrc/fts3_icu.c" | |
| 130767 | 131315 | /* |
| 130768 | 131316 | ** 2007 June 22 |
| 130769 | 131317 | ** |
| 130770 | 131318 | ** The author disclaims copyright to this source code. In place of |
| 130771 | 131319 | ** a legal notice, here is a blessing: |
| 130772 | 131320 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -24,10 +24,11 @@ | |
| 24 | #endif |
| 25 | #ifndef SQLITE_API |
| 26 | # define SQLITE_API |
| 27 | #endif |
| 28 | /************** Begin file sqliteInt.h ***************************************/ |
| 29 | /* |
| 30 | ** 2001 September 15 |
| 31 | ** |
| 32 | ** The author disclaims copyright to this source code. In place of |
| 33 | ** a legal notice, here is a blessing: |
| @@ -78,10 +79,11 @@ | |
| 78 | #include "config.h" |
| 79 | #endif |
| 80 | |
| 81 | /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/ |
| 82 | /************** Begin file sqliteLimit.h *************************************/ |
| 83 | /* |
| 84 | ** 2007 May 7 |
| 85 | ** |
| 86 | ** The author disclaims copyright to this source code. In place of |
| 87 | ** a legal notice, here is a blessing: |
| @@ -289,10 +291,11 @@ | |
| 289 | # define SQLITE_MAX_TRIGGER_DEPTH 1000 |
| 290 | #endif |
| 291 | |
| 292 | /************** End of sqliteLimit.h *****************************************/ |
| 293 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 294 | |
| 295 | /* Disable nuisance warnings on Borland compilers */ |
| 296 | #if defined(__BORLANDC__) |
| 297 | #pragma warn -rch /* unreachable code */ |
| 298 | #pragma warn -ccc /* Condition is always true or false */ |
| @@ -545,10 +548,11 @@ | |
| 545 | # define unlikely(X) !!(X) |
| 546 | #endif |
| 547 | |
| 548 | /************** Include sqlite3.h in the middle of sqliteInt.h ***************/ |
| 549 | /************** Begin file sqlite3.h *****************************************/ |
| 550 | /* |
| 551 | ** 2001 September 15 |
| 552 | ** |
| 553 | ** The author disclaims copyright to this source code. In place of |
| 554 | ** a legal notice, here is a blessing: |
| @@ -656,11 +660,11 @@ | |
| 656 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 657 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 658 | */ |
| 659 | #define SQLITE_VERSION "3.7.8" |
| 660 | #define SQLITE_VERSION_NUMBER 3007008 |
| 661 | #define SQLITE_SOURCE_ID "2011-09-04 01:27:00 6b657ae75035eb10b0ad640998d3c9eadfdffa6e" |
| 662 | |
| 663 | /* |
| 664 | ** CAPI3REF: Run-Time Library Version Numbers |
| 665 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 666 | ** |
| @@ -7305,12 +7309,14 @@ | |
| 7305 | #endif /* ifndef _SQLITE3RTREE_H_ */ |
| 7306 | |
| 7307 | |
| 7308 | /************** End of sqlite3.h *********************************************/ |
| 7309 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7310 | /************** Include hash.h in the middle of sqliteInt.h ******************/ |
| 7311 | /************** Begin file hash.h ********************************************/ |
| 7312 | /* |
| 7313 | ** 2001 September 22 |
| 7314 | ** |
| 7315 | ** The author disclaims copyright to this source code. In place of |
| 7316 | ** a legal notice, here is a blessing: |
| @@ -7406,12 +7412,14 @@ | |
| 7406 | |
| 7407 | #endif /* _SQLITE_HASH_H_ */ |
| 7408 | |
| 7409 | /************** End of hash.h ************************************************/ |
| 7410 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7411 | /************** Include parse.h in the middle of sqliteInt.h *****************/ |
| 7412 | /************** Begin file parse.h *******************************************/ |
| 7413 | #define TK_SEMI 1 |
| 7414 | #define TK_EXPLAIN 2 |
| 7415 | #define TK_QUERY 3 |
| 7416 | #define TK_PLAN 4 |
| 7417 | #define TK_BEGIN 5 |
| @@ -7568,10 +7576,11 @@ | |
| 7568 | #define TK_UMINUS 156 |
| 7569 | #define TK_UPLUS 157 |
| 7570 | |
| 7571 | /************** End of parse.h ***********************************************/ |
| 7572 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7573 | #include <stdio.h> |
| 7574 | #include <stdlib.h> |
| 7575 | #include <string.h> |
| 7576 | #include <assert.h> |
| 7577 | #include <stddef.h> |
| @@ -7911,10 +7920,11 @@ | |
| 7911 | ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque |
| 7912 | ** pointer types (i.e. FuncDef) defined above. |
| 7913 | */ |
| 7914 | /************** Include btree.h in the middle of sqliteInt.h *****************/ |
| 7915 | /************** Begin file btree.h *******************************************/ |
| 7916 | /* |
| 7917 | ** 2001 September 15 |
| 7918 | ** |
| 7919 | ** The author disclaims copyright to this source code. In place of |
| 7920 | ** a legal notice, here is a blessing: |
| @@ -8155,12 +8165,14 @@ | |
| 8155 | |
| 8156 | #endif /* _BTREE_H_ */ |
| 8157 | |
| 8158 | /************** End of btree.h ***********************************************/ |
| 8159 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8160 | /************** Include vdbe.h in the middle of sqliteInt.h ******************/ |
| 8161 | /************** Begin file vdbe.h ********************************************/ |
| 8162 | /* |
| 8163 | ** 2001 September 15 |
| 8164 | ** |
| 8165 | ** The author disclaims copyright to this source code. In place of |
| 8166 | ** a legal notice, here is a blessing: |
| @@ -8321,10 +8333,11 @@ | |
| 8321 | ** The makefile scans the vdbe.c source file and creates the "opcodes.h" |
| 8322 | ** header file that defines a number for each opcode used by the VDBE. |
| 8323 | */ |
| 8324 | /************** Include opcodes.h in the middle of vdbe.h ********************/ |
| 8325 | /************** Begin file opcodes.h *****************************************/ |
| 8326 | /* Automatically generated. Do not edit */ |
| 8327 | /* See the mkopcodeh.awk script for details */ |
| 8328 | #define OP_Goto 1 |
| 8329 | #define OP_Gosub 2 |
| 8330 | #define OP_Return 3 |
| @@ -8508,10 +8521,11 @@ | |
| 8508 | /* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\ |
| 8509 | /* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,} |
| 8510 | |
| 8511 | /************** End of opcodes.h *********************************************/ |
| 8512 | /************** Continuing where we left off in vdbe.h ***********************/ |
| 8513 | |
| 8514 | /* |
| 8515 | ** Prototypes for the VDBE interface. See comments on the implementation |
| 8516 | ** for a description of what each of these routines does. |
| 8517 | */ |
| @@ -8559,13 +8573,13 @@ | |
| 8559 | SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int); |
| 8560 | #ifndef SQLITE_OMIT_TRACE |
| 8561 | SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*); |
| 8562 | #endif |
| 8563 | |
| 8564 | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int); |
| 8565 | SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*); |
| 8566 | SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*); |
| 8567 | |
| 8568 | #ifndef SQLITE_OMIT_TRIGGER |
| 8569 | SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *); |
| 8570 | #endif |
| 8571 | |
| @@ -8582,12 +8596,14 @@ | |
| 8582 | |
| 8583 | #endif |
| 8584 | |
| 8585 | /************** End of vdbe.h ************************************************/ |
| 8586 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8587 | /************** Include pager.h in the middle of sqliteInt.h *****************/ |
| 8588 | /************** Begin file pager.h *******************************************/ |
| 8589 | /* |
| 8590 | ** 2001 September 15 |
| 8591 | ** |
| 8592 | ** The author disclaims copyright to this source code. In place of |
| 8593 | ** a legal notice, here is a blessing: |
| @@ -8769,12 +8785,14 @@ | |
| 8769 | |
| 8770 | #endif /* _PAGER_H_ */ |
| 8771 | |
| 8772 | /************** End of pager.h ***********************************************/ |
| 8773 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8774 | /************** Include pcache.h in the middle of sqliteInt.h ****************/ |
| 8775 | /************** Begin file pcache.h ******************************************/ |
| 8776 | /* |
| 8777 | ** 2008 August 05 |
| 8778 | ** |
| 8779 | ** The author disclaims copyright to this source code. In place of |
| 8780 | ** a legal notice, here is a blessing: |
| @@ -8929,13 +8947,15 @@ | |
| 8929 | |
| 8930 | #endif /* _PCACHE_H_ */ |
| 8931 | |
| 8932 | /************** End of pcache.h **********************************************/ |
| 8933 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8934 | |
| 8935 | /************** Include os.h in the middle of sqliteInt.h ********************/ |
| 8936 | /************** Begin file os.h **********************************************/ |
| 8937 | /* |
| 8938 | ** 2001 September 16 |
| 8939 | ** |
| 8940 | ** The author disclaims copyright to this source code. In place of |
| 8941 | ** a legal notice, here is a blessing: |
| @@ -9214,12 +9234,14 @@ | |
| 9214 | |
| 9215 | #endif /* _SQLITE_OS_H_ */ |
| 9216 | |
| 9217 | /************** End of os.h **************************************************/ |
| 9218 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 9219 | /************** Include mutex.h in the middle of sqliteInt.h *****************/ |
| 9220 | /************** Begin file mutex.h *******************************************/ |
| 9221 | /* |
| 9222 | ** 2007 August 28 |
| 9223 | ** |
| 9224 | ** The author disclaims copyright to this source code. In place of |
| 9225 | ** a legal notice, here is a blessing: |
| @@ -9290,10 +9312,11 @@ | |
| 9290 | #define sqlite3MutexEnd() |
| 9291 | #endif /* defined(SQLITE_MUTEX_OMIT) */ |
| 9292 | |
| 9293 | /************** End of mutex.h ***********************************************/ |
| 9294 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 9295 | |
| 9296 | |
| 9297 | /* |
| 9298 | ** Each database file to be accessed by the system is an instance |
| 9299 | ** of the following structure. There are normally two of these structures |
| @@ -11892,10 +11915,11 @@ | |
| 11892 | |
| 11893 | #endif /* _SQLITEINT_H_ */ |
| 11894 | |
| 11895 | /************** End of sqliteInt.h *******************************************/ |
| 11896 | /************** Begin file global.c ******************************************/ |
| 11897 | /* |
| 11898 | ** 2008 June 13 |
| 11899 | ** |
| 11900 | ** The author disclaims copyright to this source code. In place of |
| 11901 | ** a legal notice, here is a blessing: |
| @@ -12114,10 +12138,11 @@ | |
| 12114 | */ |
| 12115 | SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER; |
| 12116 | |
| 12117 | /************** End of global.c **********************************************/ |
| 12118 | /************** Begin file ctime.c *******************************************/ |
| 12119 | /* |
| 12120 | ** 2010 February 23 |
| 12121 | ** |
| 12122 | ** The author disclaims copyright to this source code. In place of |
| 12123 | ** a legal notice, here is a blessing: |
| @@ -12518,10 +12543,11 @@ | |
| 12518 | |
| 12519 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 12520 | |
| 12521 | /************** End of ctime.c ***********************************************/ |
| 12522 | /************** Begin file status.c ******************************************/ |
| 12523 | /* |
| 12524 | ** 2008 June 18 |
| 12525 | ** |
| 12526 | ** The author disclaims copyright to this source code. In place of |
| 12527 | ** a legal notice, here is a blessing: |
| @@ -12535,10 +12561,11 @@ | |
| 12535 | ** This module implements the sqlite3_status() interface and related |
| 12536 | ** functionality. |
| 12537 | */ |
| 12538 | /************** Include vdbeInt.h in the middle of status.c ******************/ |
| 12539 | /************** Begin file vdbeInt.h *****************************************/ |
| 12540 | /* |
| 12541 | ** 2003 September 6 |
| 12542 | ** |
| 12543 | ** The author disclaims copyright to this source code. In place of |
| 12544 | ** a legal notice, here is a blessing: |
| @@ -12986,10 +13013,11 @@ | |
| 12986 | |
| 12987 | #endif /* !defined(_VDBEINT_H_) */ |
| 12988 | |
| 12989 | /************** End of vdbeInt.h *********************************************/ |
| 12990 | /************** Continuing where we left off in status.c *********************/ |
| 12991 | |
| 12992 | /* |
| 12993 | ** Variables in which to record status information. |
| 12994 | */ |
| 12995 | typedef struct sqlite3StatType sqlite3StatType; |
| @@ -13199,10 +13227,11 @@ | |
| 13199 | return rc; |
| 13200 | } |
| 13201 | |
| 13202 | /************** End of status.c **********************************************/ |
| 13203 | /************** Begin file date.c ********************************************/ |
| 13204 | /* |
| 13205 | ** 2003 October 31 |
| 13206 | ** |
| 13207 | ** The author disclaims copyright to this source code. In place of |
| 13208 | ** a legal notice, here is a blessing: |
| @@ -14326,10 +14355,11 @@ | |
| 14326 | } |
| 14327 | } |
| 14328 | |
| 14329 | /************** End of date.c ************************************************/ |
| 14330 | /************** Begin file os.c **********************************************/ |
| 14331 | /* |
| 14332 | ** 2005 November 29 |
| 14333 | ** |
| 14334 | ** The author disclaims copyright to this source code. In place of |
| 14335 | ** a legal notice, here is a blessing: |
| @@ -14659,10 +14689,11 @@ | |
| 14659 | return SQLITE_OK; |
| 14660 | } |
| 14661 | |
| 14662 | /************** End of os.c **************************************************/ |
| 14663 | /************** Begin file fault.c *******************************************/ |
| 14664 | /* |
| 14665 | ** 2008 Jan 22 |
| 14666 | ** |
| 14667 | ** The author disclaims copyright to this source code. In place of |
| 14668 | ** a legal notice, here is a blessing: |
| @@ -14748,10 +14779,11 @@ | |
| 14748 | |
| 14749 | #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */ |
| 14750 | |
| 14751 | /************** End of fault.c ***********************************************/ |
| 14752 | /************** Begin file mem0.c ********************************************/ |
| 14753 | /* |
| 14754 | ** 2008 October 28 |
| 14755 | ** |
| 14756 | ** The author disclaims copyright to this source code. In place of |
| 14757 | ** a legal notice, here is a blessing: |
| @@ -14809,10 +14841,11 @@ | |
| 14809 | |
| 14810 | #endif /* SQLITE_ZERO_MALLOC */ |
| 14811 | |
| 14812 | /************** End of mem0.c ************************************************/ |
| 14813 | /************** Begin file mem1.c ********************************************/ |
| 14814 | /* |
| 14815 | ** 2007 August 14 |
| 14816 | ** |
| 14817 | ** The author disclaims copyright to this source code. In place of |
| 14818 | ** a legal notice, here is a blessing: |
| @@ -14961,10 +14994,11 @@ | |
| 14961 | |
| 14962 | #endif /* SQLITE_SYSTEM_MALLOC */ |
| 14963 | |
| 14964 | /************** End of mem1.c ************************************************/ |
| 14965 | /************** Begin file mem2.c ********************************************/ |
| 14966 | /* |
| 14967 | ** 2007 August 15 |
| 14968 | ** |
| 14969 | ** The author disclaims copyright to this source code. In place of |
| 14970 | ** a legal notice, here is a blessing: |
| @@ -15491,10 +15525,11 @@ | |
| 15491 | |
| 15492 | #endif /* SQLITE_MEMDEBUG */ |
| 15493 | |
| 15494 | /************** End of mem2.c ************************************************/ |
| 15495 | /************** Begin file mem3.c ********************************************/ |
| 15496 | /* |
| 15497 | ** 2007 October 14 |
| 15498 | ** |
| 15499 | ** The author disclaims copyright to this source code. In place of |
| 15500 | ** a legal notice, here is a blessing: |
| @@ -16180,10 +16215,11 @@ | |
| 16180 | |
| 16181 | #endif /* SQLITE_ENABLE_MEMSYS3 */ |
| 16182 | |
| 16183 | /************** End of mem3.c ************************************************/ |
| 16184 | /************** Begin file mem5.c ********************************************/ |
| 16185 | /* |
| 16186 | ** 2007 October 14 |
| 16187 | ** |
| 16188 | ** The author disclaims copyright to this source code. In place of |
| 16189 | ** a legal notice, here is a blessing: |
| @@ -16763,10 +16799,11 @@ | |
| 16763 | |
| 16764 | #endif /* SQLITE_ENABLE_MEMSYS5 */ |
| 16765 | |
| 16766 | /************** End of mem5.c ************************************************/ |
| 16767 | /************** Begin file mutex.c *******************************************/ |
| 16768 | /* |
| 16769 | ** 2007 August 14 |
| 16770 | ** |
| 16771 | ** The author disclaims copyright to this source code. In place of |
| 16772 | ** a legal notice, here is a blessing: |
| @@ -16918,10 +16955,11 @@ | |
| 16918 | |
| 16919 | #endif /* SQLITE_MUTEX_OMIT */ |
| 16920 | |
| 16921 | /************** End of mutex.c ***********************************************/ |
| 16922 | /************** Begin file mutex_noop.c **************************************/ |
| 16923 | /* |
| 16924 | ** 2008 October 07 |
| 16925 | ** |
| 16926 | ** The author disclaims copyright to this source code. In place of |
| 16927 | ** a legal notice, here is a blessing: |
| @@ -17126,10 +17164,11 @@ | |
| 17126 | #endif /* SQLITE_MUTEX_NOOP */ |
| 17127 | #endif /* SQLITE_MUTEX_OMIT */ |
| 17128 | |
| 17129 | /************** End of mutex_noop.c ******************************************/ |
| 17130 | /************** Begin file mutex_os2.c ***************************************/ |
| 17131 | /* |
| 17132 | ** 2007 August 28 |
| 17133 | ** |
| 17134 | ** The author disclaims copyright to this source code. In place of |
| 17135 | ** a legal notice, here is a blessing: |
| @@ -17402,10 +17441,11 @@ | |
| 17402 | } |
| 17403 | #endif /* SQLITE_MUTEX_OS2 */ |
| 17404 | |
| 17405 | /************** End of mutex_os2.c *******************************************/ |
| 17406 | /************** Begin file mutex_unix.c **************************************/ |
| 17407 | /* |
| 17408 | ** 2007 August 28 |
| 17409 | ** |
| 17410 | ** The author disclaims copyright to this source code. In place of |
| 17411 | ** a legal notice, here is a blessing: |
| @@ -17755,10 +17795,11 @@ | |
| 17755 | |
| 17756 | #endif /* SQLITE_MUTEX_PTHREAD */ |
| 17757 | |
| 17758 | /************** End of mutex_unix.c ******************************************/ |
| 17759 | /************** Begin file mutex_w32.c ***************************************/ |
| 17760 | /* |
| 17761 | ** 2007 August 14 |
| 17762 | ** |
| 17763 | ** The author disclaims copyright to this source code. In place of |
| 17764 | ** a legal notice, here is a blessing: |
| @@ -18089,10 +18130,11 @@ | |
| 18089 | } |
| 18090 | #endif /* SQLITE_MUTEX_W32 */ |
| 18091 | |
| 18092 | /************** End of mutex_w32.c *******************************************/ |
| 18093 | /************** Begin file malloc.c ******************************************/ |
| 18094 | /* |
| 18095 | ** 2001 September 15 |
| 18096 | ** |
| 18097 | ** The author disclaims copyright to this source code. In place of |
| 18098 | ** a legal notice, here is a blessing: |
| @@ -18868,10 +18910,11 @@ | |
| 18868 | return rc & (db ? db->errMask : 0xff); |
| 18869 | } |
| 18870 | |
| 18871 | /************** End of malloc.c **********************************************/ |
| 18872 | /************** Begin file printf.c ******************************************/ |
| 18873 | /* |
| 18874 | ** The "printf" code that follows dates from the 1980's. It is in |
| 18875 | ** the public domain. The original comments are included here for |
| 18876 | ** completeness. They are very out-of-date but might be useful as |
| 18877 | ** an historical reference. Most of the "enhancements" have been backed |
| @@ -19899,10 +19942,11 @@ | |
| 19899 | } |
| 19900 | #endif |
| 19901 | |
| 19902 | /************** End of printf.c **********************************************/ |
| 19903 | /************** Begin file random.c ******************************************/ |
| 19904 | /* |
| 19905 | ** 2001 September 15 |
| 19906 | ** |
| 19907 | ** The author disclaims copyright to this source code. In place of |
| 19908 | ** a legal notice, here is a blessing: |
| @@ -20046,10 +20090,11 @@ | |
| 20046 | } |
| 20047 | #endif /* SQLITE_OMIT_BUILTIN_TEST */ |
| 20048 | |
| 20049 | /************** End of random.c **********************************************/ |
| 20050 | /************** Begin file utf.c *********************************************/ |
| 20051 | /* |
| 20052 | ** 2004 April 13 |
| 20053 | ** |
| 20054 | ** The author disclaims copyright to this source code. In place of |
| 20055 | ** a legal notice, here is a blessing: |
| @@ -20607,10 +20652,11 @@ | |
| 20607 | #endif /* SQLITE_TEST */ |
| 20608 | #endif /* SQLITE_OMIT_UTF16 */ |
| 20609 | |
| 20610 | /************** End of utf.c *************************************************/ |
| 20611 | /************** Begin file util.c ********************************************/ |
| 20612 | /* |
| 20613 | ** 2001 September 15 |
| 20614 | ** |
| 20615 | ** The author disclaims copyright to this source code. In place of |
| 20616 | ** a legal notice, here is a blessing: |
| @@ -21789,10 +21835,11 @@ | |
| 21789 | } |
| 21790 | #endif |
| 21791 | |
| 21792 | /************** End of util.c ************************************************/ |
| 21793 | /************** Begin file hash.c ********************************************/ |
| 21794 | /* |
| 21795 | ** 2001 September 22 |
| 21796 | ** |
| 21797 | ** The author disclaims copyright to this source code. In place of |
| 21798 | ** a legal notice, here is a blessing: |
| @@ -22068,10 +22115,11 @@ | |
| 22068 | return 0; |
| 22069 | } |
| 22070 | |
| 22071 | /************** End of hash.c ************************************************/ |
| 22072 | /************** Begin file opcodes.c *****************************************/ |
| 22073 | /* Automatically generated. Do not edit */ |
| 22074 | /* See the mkopcodec.awk script for details. */ |
| 22075 | #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) |
| 22076 | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ |
| 22077 | static const char *const azName[] = { "?", |
| @@ -22229,10 +22277,11 @@ | |
| 22229 | } |
| 22230 | #endif |
| 22231 | |
| 22232 | /************** End of opcodes.c *********************************************/ |
| 22233 | /************** Begin file os_os2.c ******************************************/ |
| 22234 | /* |
| 22235 | ** 2006 Feb 14 |
| 22236 | ** |
| 22237 | ** The author disclaims copyright to this source code. In place of |
| 22238 | ** a legal notice, here is a blessing: |
| @@ -22285,10 +22334,11 @@ | |
| 22285 | /* |
| 22286 | ** Include code that is common to all os_*.c files |
| 22287 | */ |
| 22288 | /************** Include os_common.h in the middle of os_os2.c ****************/ |
| 22289 | /************** Begin file os_common.h ***************************************/ |
| 22290 | /* |
| 22291 | ** 2004 May 22 |
| 22292 | ** |
| 22293 | ** The author disclaims copyright to this source code. In place of |
| 22294 | ** a legal notice, here is a blessing: |
| @@ -22338,10 +22388,11 @@ | |
| 22338 | ** hwtime.h contains inline assembler code for implementing |
| 22339 | ** high-performance timing routines. |
| 22340 | */ |
| 22341 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 22342 | /************** Begin file hwtime.h ******************************************/ |
| 22343 | /* |
| 22344 | ** 2008 May 27 |
| 22345 | ** |
| 22346 | ** The author disclaims copyright to this source code. In place of |
| 22347 | ** a legal notice, here is a blessing: |
| @@ -22426,10 +22477,11 @@ | |
| 22426 | |
| 22427 | #endif /* !defined(_HWTIME_H_) */ |
| 22428 | |
| 22429 | /************** End of hwtime.h **********************************************/ |
| 22430 | /************** Continuing where we left off in os_common.h ******************/ |
| 22431 | |
| 22432 | static sqlite_uint64 g_start; |
| 22433 | static sqlite_uint64 g_elapsed; |
| 22434 | #define TIMER_START g_start=sqlite3Hwtime() |
| 22435 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -22492,10 +22544,11 @@ | |
| 22492 | |
| 22493 | #endif /* !defined(_OS_COMMON_H_) */ |
| 22494 | |
| 22495 | /************** End of os_common.h *******************************************/ |
| 22496 | /************** Continuing where we left off in os_os2.c *********************/ |
| 22497 | |
| 22498 | /* Forward references */ |
| 22499 | typedef struct os2File os2File; /* The file structure */ |
| 22500 | typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */ |
| 22501 | typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */ |
| @@ -24363,10 +24416,11 @@ | |
| 24363 | |
| 24364 | #endif /* SQLITE_OS_OS2 */ |
| 24365 | |
| 24366 | /************** End of os_os2.c **********************************************/ |
| 24367 | /************** Begin file os_unix.c *****************************************/ |
| 24368 | /* |
| 24369 | ** 2004 May 22 |
| 24370 | ** |
| 24371 | ** The author disclaims copyright to this source code. In place of |
| 24372 | ** a legal notice, here is a blessing: |
| @@ -24627,10 +24681,11 @@ | |
| 24627 | /* |
| 24628 | ** Include code that is common to all os_*.c files |
| 24629 | */ |
| 24630 | /************** Include os_common.h in the middle of os_unix.c ***************/ |
| 24631 | /************** Begin file os_common.h ***************************************/ |
| 24632 | /* |
| 24633 | ** 2004 May 22 |
| 24634 | ** |
| 24635 | ** The author disclaims copyright to this source code. In place of |
| 24636 | ** a legal notice, here is a blessing: |
| @@ -24680,10 +24735,11 @@ | |
| 24680 | ** hwtime.h contains inline assembler code for implementing |
| 24681 | ** high-performance timing routines. |
| 24682 | */ |
| 24683 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 24684 | /************** Begin file hwtime.h ******************************************/ |
| 24685 | /* |
| 24686 | ** 2008 May 27 |
| 24687 | ** |
| 24688 | ** The author disclaims copyright to this source code. In place of |
| 24689 | ** a legal notice, here is a blessing: |
| @@ -24768,10 +24824,11 @@ | |
| 24768 | |
| 24769 | #endif /* !defined(_HWTIME_H_) */ |
| 24770 | |
| 24771 | /************** End of hwtime.h **********************************************/ |
| 24772 | /************** Continuing where we left off in os_common.h ******************/ |
| 24773 | |
| 24774 | static sqlite_uint64 g_start; |
| 24775 | static sqlite_uint64 g_elapsed; |
| 24776 | #define TIMER_START g_start=sqlite3Hwtime() |
| 24777 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -24834,10 +24891,11 @@ | |
| 24834 | |
| 24835 | #endif /* !defined(_OS_COMMON_H_) */ |
| 24836 | |
| 24837 | /************** End of os_common.h *******************************************/ |
| 24838 | /************** Continuing where we left off in os_unix.c ********************/ |
| 24839 | |
| 24840 | /* |
| 24841 | ** Define various macros that are missing from some systems. |
| 24842 | */ |
| 24843 | #ifndef O_LARGEFILE |
| @@ -31343,10 +31401,11 @@ | |
| 31343 | |
| 31344 | #endif /* SQLITE_OS_UNIX */ |
| 31345 | |
| 31346 | /************** End of os_unix.c *********************************************/ |
| 31347 | /************** Begin file os_win.c ******************************************/ |
| 31348 | /* |
| 31349 | ** 2004 May 22 |
| 31350 | ** |
| 31351 | ** The author disclaims copyright to this source code. In place of |
| 31352 | ** a legal notice, here is a blessing: |
| @@ -31404,10 +31463,11 @@ | |
| 31404 | /* |
| 31405 | ** Include code that is common to all os_*.c files |
| 31406 | */ |
| 31407 | /************** Include os_common.h in the middle of os_win.c ****************/ |
| 31408 | /************** Begin file os_common.h ***************************************/ |
| 31409 | /* |
| 31410 | ** 2004 May 22 |
| 31411 | ** |
| 31412 | ** The author disclaims copyright to this source code. In place of |
| 31413 | ** a legal notice, here is a blessing: |
| @@ -31457,10 +31517,11 @@ | |
| 31457 | ** hwtime.h contains inline assembler code for implementing |
| 31458 | ** high-performance timing routines. |
| 31459 | */ |
| 31460 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 31461 | /************** Begin file hwtime.h ******************************************/ |
| 31462 | /* |
| 31463 | ** 2008 May 27 |
| 31464 | ** |
| 31465 | ** The author disclaims copyright to this source code. In place of |
| 31466 | ** a legal notice, here is a blessing: |
| @@ -31545,10 +31606,11 @@ | |
| 31545 | |
| 31546 | #endif /* !defined(_HWTIME_H_) */ |
| 31547 | |
| 31548 | /************** End of hwtime.h **********************************************/ |
| 31549 | /************** Continuing where we left off in os_common.h ******************/ |
| 31550 | |
| 31551 | static sqlite_uint64 g_start; |
| 31552 | static sqlite_uint64 g_elapsed; |
| 31553 | #define TIMER_START g_start=sqlite3Hwtime() |
| 31554 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -31611,10 +31673,11 @@ | |
| 31611 | |
| 31612 | #endif /* !defined(_OS_COMMON_H_) */ |
| 31613 | |
| 31614 | /************** End of os_common.h *******************************************/ |
| 31615 | /************** Continuing where we left off in os_win.c *********************/ |
| 31616 | |
| 31617 | /* |
| 31618 | ** Some microsoft compilers lack this definition. |
| 31619 | */ |
| 31620 | #ifndef INVALID_FILE_ATTRIBUTES |
| @@ -34746,10 +34809,11 @@ | |
| 34746 | |
| 34747 | #endif /* SQLITE_OS_WIN */ |
| 34748 | |
| 34749 | /************** End of os_win.c **********************************************/ |
| 34750 | /************** Begin file bitvec.c ******************************************/ |
| 34751 | /* |
| 34752 | ** 2008 February 16 |
| 34753 | ** |
| 34754 | ** The author disclaims copyright to this source code. In place of |
| 34755 | ** a legal notice, here is a blessing: |
| @@ -35156,10 +35220,11 @@ | |
| 35156 | } |
| 35157 | #endif /* SQLITE_OMIT_BUILTIN_TEST */ |
| 35158 | |
| 35159 | /************** End of bitvec.c **********************************************/ |
| 35160 | /************** Begin file pcache.c ******************************************/ |
| 35161 | /* |
| 35162 | ** 2008 August 05 |
| 35163 | ** |
| 35164 | ** The author disclaims copyright to this source code. In place of |
| 35165 | ** a legal notice, here is a blessing: |
| @@ -35752,10 +35817,11 @@ | |
| 35752 | } |
| 35753 | #endif |
| 35754 | |
| 35755 | /************** End of pcache.c **********************************************/ |
| 35756 | /************** Begin file pcache1.c *****************************************/ |
| 35757 | /* |
| 35758 | ** 2008 November 05 |
| 35759 | ** |
| 35760 | ** The author disclaims copyright to this source code. In place of |
| 35761 | ** a legal notice, here is a blessing: |
| @@ -36968,10 +37034,11 @@ | |
| 36968 | } |
| 36969 | #endif |
| 36970 | |
| 36971 | /************** End of pcache1.c *********************************************/ |
| 36972 | /************** Begin file rowset.c ******************************************/ |
| 36973 | /* |
| 36974 | ** 2008 December 3 |
| 36975 | ** |
| 36976 | ** The author disclaims copyright to this source code. In place of |
| 36977 | ** a legal notice, here is a blessing: |
| @@ -37392,10 +37459,11 @@ | |
| 37392 | return 0; |
| 37393 | } |
| 37394 | |
| 37395 | /************** End of rowset.c **********************************************/ |
| 37396 | /************** Begin file pager.c *******************************************/ |
| 37397 | /* |
| 37398 | ** 2001 September 15 |
| 37399 | ** |
| 37400 | ** The author disclaims copyright to this source code. In place of |
| 37401 | ** a legal notice, here is a blessing: |
| @@ -37415,10 +37483,11 @@ | |
| 37415 | ** another is writing. |
| 37416 | */ |
| 37417 | #ifndef SQLITE_OMIT_DISKIO |
| 37418 | /************** Include wal.h in the middle of pager.c ***********************/ |
| 37419 | /************** Begin file wal.h *********************************************/ |
| 37420 | /* |
| 37421 | ** 2010 February 1 |
| 37422 | ** |
| 37423 | ** The author disclaims copyright to this source code. In place of |
| 37424 | ** a legal notice, here is a blessing: |
| @@ -37539,10 +37608,11 @@ | |
| 37539 | #endif /* ifndef SQLITE_OMIT_WAL */ |
| 37540 | #endif /* _WAL_H_ */ |
| 37541 | |
| 37542 | /************** End of wal.h *************************************************/ |
| 37543 | /************** Continuing where we left off in pager.c **********************/ |
| 37544 | |
| 37545 | |
| 37546 | /******************* NOTES ON THE DESIGN OF THE PAGER ************************ |
| 37547 | ** |
| 37548 | ** This comment block describes invariants that hold when using a rollback |
| @@ -44352,10 +44422,11 @@ | |
| 44352 | |
| 44353 | #endif /* SQLITE_OMIT_DISKIO */ |
| 44354 | |
| 44355 | /************** End of pager.c ***********************************************/ |
| 44356 | /************** Begin file wal.c *********************************************/ |
| 44357 | /* |
| 44358 | ** 2010 February 1 |
| 44359 | ** |
| 44360 | ** The author disclaims copyright to this source code. In place of |
| 44361 | ** a legal notice, here is a blessing: |
| @@ -47306,10 +47377,11 @@ | |
| 47306 | |
| 47307 | #endif /* #ifndef SQLITE_OMIT_WAL */ |
| 47308 | |
| 47309 | /************** End of wal.c *************************************************/ |
| 47310 | /************** Begin file btmutex.c *****************************************/ |
| 47311 | /* |
| 47312 | ** 2007 August 27 |
| 47313 | ** |
| 47314 | ** The author disclaims copyright to this source code. In place of |
| 47315 | ** a legal notice, here is a blessing: |
| @@ -47325,10 +47397,11 @@ | |
| 47325 | ** big and we want to break it down some. This packaged seemed like |
| 47326 | ** a good breakout. |
| 47327 | */ |
| 47328 | /************** Include btreeInt.h in the middle of btmutex.c ****************/ |
| 47329 | /************** Begin file btreeInt.h ****************************************/ |
| 47330 | /* |
| 47331 | ** 2004 April 6 |
| 47332 | ** |
| 47333 | ** The author disclaims copyright to this source code. In place of |
| 47334 | ** a legal notice, here is a blessing: |
| @@ -47970,10 +48043,11 @@ | |
| 47970 | #define get4byte sqlite3Get4byte |
| 47971 | #define put4byte sqlite3Put4byte |
| 47972 | |
| 47973 | /************** End of btreeInt.h ********************************************/ |
| 47974 | /************** Continuing where we left off in btmutex.c ********************/ |
| 47975 | #ifndef SQLITE_OMIT_SHARED_CACHE |
| 47976 | #if SQLITE_THREADSAFE |
| 47977 | |
| 47978 | /* |
| 47979 | ** Obtain the BtShared mutex associated with B-Tree handle p. Also, |
| @@ -48242,10 +48316,11 @@ | |
| 48242 | #endif /* if SQLITE_THREADSAFE */ |
| 48243 | #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */ |
| 48244 | |
| 48245 | /************** End of btmutex.c *********************************************/ |
| 48246 | /************** Begin file btree.c *******************************************/ |
| 48247 | /* |
| 48248 | ** 2004 April 6 |
| 48249 | ** |
| 48250 | ** The author disclaims copyright to this source code. In place of |
| 48251 | ** a legal notice, here is a blessing: |
| @@ -48899,22 +48974,25 @@ | |
| 48899 | int *pRes /* Write search results here */ |
| 48900 | ){ |
| 48901 | int rc; /* Status code */ |
| 48902 | UnpackedRecord *pIdxKey; /* Unpacked index key */ |
| 48903 | char aSpace[150]; /* Temp space for pIdxKey - to avoid a malloc */ |
| 48904 | |
| 48905 | if( pKey ){ |
| 48906 | assert( nKey==(i64)(int)nKey ); |
| 48907 | pIdxKey = sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, |
| 48908 | aSpace, sizeof(aSpace)); |
| 48909 | if( pIdxKey==0 ) return SQLITE_NOMEM; |
| 48910 | }else{ |
| 48911 | pIdxKey = 0; |
| 48912 | } |
| 48913 | rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes); |
| 48914 | if( pKey ){ |
| 48915 | sqlite3VdbeDeleteUnpackedRecord(pIdxKey); |
| 48916 | } |
| 48917 | return rc; |
| 48918 | } |
| 48919 | |
| 48920 | /* |
| @@ -56426,10 +56504,11 @@ | |
| 56426 | return rc; |
| 56427 | } |
| 56428 | |
| 56429 | /************** End of btree.c ***********************************************/ |
| 56430 | /************** Begin file backup.c ******************************************/ |
| 56431 | /* |
| 56432 | ** 2009 January 28 |
| 56433 | ** |
| 56434 | ** The author disclaims copyright to this source code. In place of |
| 56435 | ** a legal notice, here is a blessing: |
| @@ -57132,10 +57211,11 @@ | |
| 57132 | } |
| 57133 | #endif /* SQLITE_OMIT_VACUUM */ |
| 57134 | |
| 57135 | /************** End of backup.c **********************************************/ |
| 57136 | /************** Begin file vdbemem.c *****************************************/ |
| 57137 | /* |
| 57138 | ** 2004 May 26 |
| 57139 | ** |
| 57140 | ** The author disclaims copyright to this source code. In place of |
| 57141 | ** a legal notice, here is a blessing: |
| @@ -58286,10 +58366,11 @@ | |
| 58286 | return 0; |
| 58287 | } |
| 58288 | |
| 58289 | /************** End of vdbemem.c *********************************************/ |
| 58290 | /************** Begin file vdbeaux.c *****************************************/ |
| 58291 | /* |
| 58292 | ** 2003 September 6 |
| 58293 | ** |
| 58294 | ** The author disclaims copyright to this source code. In place of |
| 58295 | ** a legal notice, here is a blessing: |
| @@ -61116,61 +61197,74 @@ | |
| 61116 | } |
| 61117 | } |
| 61118 | return 0; |
| 61119 | } |
| 61120 | |
| 61121 | |
| 61122 | /* |
| 61123 | ** Given the nKey-byte encoding of a record in pKey[], parse the |
| 61124 | ** record into a UnpackedRecord structure. Return a pointer to |
| 61125 | ** that structure. |
| 61126 | ** |
| 61127 | ** The calling function might provide szSpace bytes of memory |
| 61128 | ** space at pSpace. This space can be used to hold the returned |
| 61129 | ** VDbeParsedRecord structure if it is large enough. If it is |
| 61130 | ** not big enough, space is obtained from sqlite3_malloc(). |
| 61131 | ** |
| 61132 | ** The returned structure should be closed by a call to |
| 61133 | ** sqlite3VdbeDeleteUnpackedRecord(). |
| 61134 | */ |
| 61135 | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack( |
| 61136 | KeyInfo *pKeyInfo, /* Information about the record format */ |
| 61137 | int nKey, /* Size of the binary record */ |
| 61138 | const void *pKey, /* The binary record */ |
| 61139 | char *pSpace, /* Unaligned space available to hold the object */ |
| 61140 | int szSpace /* Size of pSpace[] in bytes */ |
| 61141 | ){ |
| 61142 | const unsigned char *aKey = (const unsigned char *)pKey; |
| 61143 | UnpackedRecord *p; /* The unpacked record that we will return */ |
| 61144 | int nByte; /* Memory space needed to hold p, in bytes */ |
| 61145 | int d; |
| 61146 | u32 idx; |
| 61147 | u16 u; /* Unsigned loop counter */ |
| 61148 | u32 szHdr; |
| 61149 | Mem *pMem; |
| 61150 | int nOff; /* Increase pSpace by this much to 8-byte align it */ |
| 61151 | |
| 61152 | /* |
| 61153 | ** We want to shift the pointer pSpace up such that it is 8-byte aligned. |
| 61154 | ** Thus, we need to calculate a value, nOff, between 0 and 7, to shift |
| 61155 | ** it by. If pSpace is already 8-byte aligned, nOff should be zero. |
| 61156 | */ |
| 61157 | nOff = (8 - (SQLITE_PTR_TO_INT(pSpace) & 7)) & 7; |
| 61158 | pSpace += nOff; |
| 61159 | szSpace -= nOff; |
| 61160 | nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nField+1); |
| 61161 | if( nByte>szSpace ){ |
| 61162 | p = sqlite3DbMallocRaw(pKeyInfo->db, nByte); |
| 61163 | if( p==0 ) return 0; |
| 61164 | p->flags = UNPACKED_NEED_FREE | UNPACKED_NEED_DESTROY; |
| 61165 | }else{ |
| 61166 | p = (UnpackedRecord*)pSpace; |
| 61167 | p->flags = UNPACKED_NEED_DESTROY; |
| 61168 | } |
| 61169 | p->pKeyInfo = pKeyInfo; |
| 61170 | p->nField = pKeyInfo->nField + 1; |
| 61171 | p->aMem = pMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))]; |
| 61172 | assert( EIGHT_BYTE_ALIGNMENT(pMem) ); |
| 61173 | idx = getVarint32(aKey, szHdr); |
| 61174 | d = szHdr; |
| 61175 | u = 0; |
| 61176 | while( idx<szHdr && u<p->nField && d<=nKey ){ |
| @@ -61185,35 +61279,10 @@ | |
| 61185 | pMem++; |
| 61186 | u++; |
| 61187 | } |
| 61188 | assert( u<=pKeyInfo->nField + 1 ); |
| 61189 | p->nField = u; |
| 61190 | return (void*)p; |
| 61191 | } |
| 61192 | |
| 61193 | /* |
| 61194 | ** This routine destroys a UnpackedRecord object. |
| 61195 | */ |
| 61196 | SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord *p){ |
| 61197 | #ifdef SQLITE_DEBUG |
| 61198 | int i; |
| 61199 | Mem *pMem; |
| 61200 | |
| 61201 | assert( p!=0 ); |
| 61202 | assert( p->flags & UNPACKED_NEED_DESTROY ); |
| 61203 | for(i=0, pMem=p->aMem; i<p->nField; i++, pMem++){ |
| 61204 | /* The unpacked record is always constructed by the |
| 61205 | ** sqlite3VdbeUnpackRecord() function above, which makes all |
| 61206 | ** strings and blobs static. And none of the elements are |
| 61207 | ** ever transformed, so there is never anything to delete. |
| 61208 | */ |
| 61209 | if( NEVER(pMem->zMalloc) ) sqlite3VdbeMemRelease(pMem); |
| 61210 | } |
| 61211 | #endif |
| 61212 | if( p->flags & UNPACKED_NEED_FREE ){ |
| 61213 | sqlite3DbFree(p->pKeyInfo->db, p); |
| 61214 | } |
| 61215 | } |
| 61216 | |
| 61217 | /* |
| 61218 | ** This function compares the two table rows or index records |
| 61219 | ** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero |
| @@ -61540,10 +61609,11 @@ | |
| 61540 | } |
| 61541 | } |
| 61542 | |
| 61543 | /************** End of vdbeaux.c *********************************************/ |
| 61544 | /************** Begin file vdbeapi.c *****************************************/ |
| 61545 | /* |
| 61546 | ** 2004 May 26 |
| 61547 | ** |
| 61548 | ** The author disclaims copyright to this source code. In place of |
| 61549 | ** a legal notice, here is a blessing: |
| @@ -62847,10 +62917,11 @@ | |
| 62847 | return v; |
| 62848 | } |
| 62849 | |
| 62850 | /************** End of vdbeapi.c *********************************************/ |
| 62851 | /************** Begin file vdbetrace.c ***************************************/ |
| 62852 | /* |
| 62853 | ** 2009 November 25 |
| 62854 | ** |
| 62855 | ** The author disclaims copyright to this source code. In place of |
| 62856 | ** a legal notice, here is a blessing: |
| @@ -63002,10 +63073,11 @@ | |
| 63002 | |
| 63003 | #endif /* #ifndef SQLITE_OMIT_TRACE */ |
| 63004 | |
| 63005 | /************** End of vdbetrace.c *******************************************/ |
| 63006 | /************** Begin file vdbe.c ********************************************/ |
| 63007 | /* |
| 63008 | ** 2001 September 15 |
| 63009 | ** |
| 63010 | ** The author disclaims copyright to this source code. In place of |
| 63011 | ** a legal notice, here is a blessing: |
| @@ -63471,10 +63543,11 @@ | |
| 63471 | ** hwtime.h contains inline assembler code for implementing |
| 63472 | ** high-performance timing routines. |
| 63473 | */ |
| 63474 | /************** Include hwtime.h in the middle of vdbe.c *********************/ |
| 63475 | /************** Begin file hwtime.h ******************************************/ |
| 63476 | /* |
| 63477 | ** 2008 May 27 |
| 63478 | ** |
| 63479 | ** The author disclaims copyright to this source code. In place of |
| 63480 | ** a legal notice, here is a blessing: |
| @@ -63559,10 +63632,11 @@ | |
| 63559 | |
| 63560 | #endif /* !defined(_HWTIME_H_) */ |
| 63561 | |
| 63562 | /************** End of hwtime.h **********************************************/ |
| 63563 | /************** Continuing where we left off in vdbe.c ***********************/ |
| 63564 | |
| 63565 | #endif |
| 63566 | |
| 63567 | /* |
| 63568 | ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the |
| @@ -63853,10 +63927,11 @@ | |
| 63853 | } bb; |
| 63854 | struct OP_Found_stack_vars { |
| 63855 | int alreadyExists; |
| 63856 | VdbeCursor *pC; |
| 63857 | int res; |
| 63858 | UnpackedRecord *pIdxKey; |
| 63859 | UnpackedRecord r; |
| 63860 | char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7]; |
| 63861 | } bc; |
| 63862 | struct OP_IsUnique_stack_vars { |
| @@ -67097,10 +67172,11 @@ | |
| 67097 | case OP_Found: { /* jump, in3 */ |
| 67098 | #if 0 /* local variables moved into u.bc */ |
| 67099 | int alreadyExists; |
| 67100 | VdbeCursor *pC; |
| 67101 | int res; |
| 67102 | UnpackedRecord *pIdxKey; |
| 67103 | UnpackedRecord r; |
| 67104 | char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7]; |
| 67105 | #endif /* local variables moved into u.bc */ |
| 67106 | |
| @@ -67125,22 +67201,22 @@ | |
| 67125 | { int i; for(i=0; i<u.bc.r.nField; i++) assert( memIsValid(&u.bc.r.aMem[i]) ); } |
| 67126 | #endif |
| 67127 | u.bc.r.flags = UNPACKED_PREFIX_MATCH; |
| 67128 | u.bc.pIdxKey = &u.bc.r; |
| 67129 | }else{ |
| 67130 | assert( pIn3->flags & MEM_Blob ); |
| 67131 | assert( (pIn3->flags & MEM_Zero)==0 ); /* zeroblobs already expanded */ |
| 67132 | u.bc.pIdxKey = sqlite3VdbeRecordUnpack(u.bc.pC->pKeyInfo, pIn3->n, pIn3->z, |
| 67133 | u.bc.aTempRec, sizeof(u.bc.aTempRec)); |
| 67134 | if( u.bc.pIdxKey==0 ){ |
| 67135 | goto no_mem; |
| 67136 | } |
| 67137 | u.bc.pIdxKey->flags |= UNPACKED_PREFIX_MATCH; |
| 67138 | } |
| 67139 | rc = sqlite3BtreeMovetoUnpacked(u.bc.pC->pCursor, u.bc.pIdxKey, 0, 0, &u.bc.res); |
| 67140 | if( pOp->p4.i==0 ){ |
| 67141 | sqlite3VdbeDeleteUnpackedRecord(u.bc.pIdxKey); |
| 67142 | } |
| 67143 | if( rc!=SQLITE_OK ){ |
| 67144 | break; |
| 67145 | } |
| 67146 | u.bc.alreadyExists = (u.bc.res==0); |
| @@ -69784,10 +69860,11 @@ | |
| 69784 | goto vdbe_error_halt; |
| 69785 | } |
| 69786 | |
| 69787 | /************** End of vdbe.c ************************************************/ |
| 69788 | /************** Begin file vdbeblob.c ****************************************/ |
| 69789 | /* |
| 69790 | ** 2007 May 1 |
| 69791 | ** |
| 69792 | ** The author disclaims copyright to this source code. In place of |
| 69793 | ** a legal notice, here is a blessing: |
| @@ -70254,10 +70331,11 @@ | |
| 70254 | |
| 70255 | #endif /* #ifndef SQLITE_OMIT_INCRBLOB */ |
| 70256 | |
| 70257 | /************** End of vdbeblob.c ********************************************/ |
| 70258 | /************** Begin file vdbesort.c ****************************************/ |
| 70259 | /* |
| 70260 | ** 2011 July 9 |
| 70261 | ** |
| 70262 | ** The author disclaims copyright to this source code. In place of |
| 70263 | ** a legal notice, here is a blessing: |
| @@ -70358,12 +70436,11 @@ | |
| 70358 | sqlite3_file *pTemp1; /* PMA file 1 */ |
| 70359 | int nPMA; /* Number of PMAs stored in pTemp1 */ |
| 70360 | SorterRecord *pRecord; /* Head of in-memory record list */ |
| 70361 | int mnPmaSize; /* Minimum PMA size, in bytes */ |
| 70362 | int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */ |
| 70363 | char *aSpace; /* Space for UnpackRecord() */ |
| 70364 | int nSpace; /* Size of aSpace in bytes */ |
| 70365 | }; |
| 70366 | |
| 70367 | /* |
| 70368 | ** The following type is an iterator for a PMA. It caches the current key in |
| 70369 | ** variables nKey/aKey. If the iterator is at EOF, pFile==0. |
| @@ -70553,56 +70630,39 @@ | |
| 70553 | ** be less than key2. Even if key2 also contains NULL values. |
| 70554 | ** |
| 70555 | ** If pKey2 is passed a NULL pointer, then it is assumed that the pCsr->aSpace |
| 70556 | ** has been allocated and contains an unpacked record that is used as key2. |
| 70557 | */ |
| 70558 | static int vdbeSorterCompare( |
| 70559 | VdbeCursor *pCsr, /* Cursor object (for pKeyInfo) */ |
| 70560 | int bOmitRowid, /* Ignore rowid field at end of keys */ |
| 70561 | void *pKey1, int nKey1, /* Left side of comparison */ |
| 70562 | void *pKey2, int nKey2, /* Right side of comparison */ |
| 70563 | int *pRes /* OUT: Result of comparison */ |
| 70564 | ){ |
| 70565 | KeyInfo *pKeyInfo = pCsr->pKeyInfo; |
| 70566 | VdbeSorter *pSorter = pCsr->pSorter; |
| 70567 | char *aSpace = pSorter->aSpace; |
| 70568 | int nSpace = pSorter->nSpace; |
| 70569 | UnpackedRecord *r2; |
| 70570 | int i; |
| 70571 | |
| 70572 | if( aSpace==0 ){ |
| 70573 | nSpace = ROUND8(sizeof(UnpackedRecord))+(pKeyInfo->nField+1)*sizeof(Mem); |
| 70574 | aSpace = (char *)sqlite3Malloc(nSpace); |
| 70575 | if( aSpace==0 ) return SQLITE_NOMEM; |
| 70576 | pSorter->aSpace = aSpace; |
| 70577 | pSorter->nSpace = nSpace; |
| 70578 | } |
| 70579 | |
| 70580 | if( pKey2 ){ |
| 70581 | /* This call cannot fail. As the memory is already allocated. */ |
| 70582 | r2 = sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, aSpace, nSpace); |
| 70583 | assert( r2 && (r2->flags & UNPACKED_NEED_FREE)==0 ); |
| 70584 | assert( r2==(UnpackedRecord*)aSpace ); |
| 70585 | }else{ |
| 70586 | r2 = (UnpackedRecord *)aSpace; |
| 70587 | assert( !bOmitRowid ); |
| 70588 | } |
| 70589 | |
| 70590 | if( bOmitRowid ){ |
| 70591 | for(i=0; i<r2->nField-1; i++){ |
| 70592 | if( r2->aMem[i].flags & MEM_Null ){ |
| 70593 | *pRes = -1; |
| 70594 | return SQLITE_OK; |
| 70595 | } |
| 70596 | } |
| 70597 | r2->flags |= UNPACKED_PREFIX_MATCH; |
| 70598 | r2->nField--; |
| 70599 | assert( r2->nField>0 ); |
| 70600 | } |
| 70601 | |
| 70602 | *pRes = sqlite3VdbeRecordCompare(nKey1, pKey1, r2); |
| 70603 | return SQLITE_OK; |
| 70604 | } |
| 70605 | |
| 70606 | /* |
| 70607 | ** This function is called to compare two iterator keys when merging |
| 70608 | ** multiple b-tree segments. Parameter iOut is the index of the aTree[] |
| @@ -70633,19 +70693,14 @@ | |
| 70633 | iRes = i2; |
| 70634 | }else if( p2->pFile==0 ){ |
| 70635 | iRes = i1; |
| 70636 | }else{ |
| 70637 | int res; |
| 70638 | int rc; |
| 70639 | assert( pCsr->pSorter->aSpace!=0 ); /* allocated in vdbeSorterMerge() */ |
| 70640 | rc = vdbeSorterCompare( |
| 70641 | pCsr, 0, p1->aKey, p1->nKey, p2->aKey, p2->nKey, &res |
| 70642 | ); |
| 70643 | /* The vdbeSorterCompare() call cannot fail since pCsr->pSorter->aSpace |
| 70644 | ** has already been allocated. */ |
| 70645 | assert( rc==SQLITE_OK ); |
| 70646 | |
| 70647 | if( res<=0 ){ |
| 70648 | iRes = i1; |
| 70649 | }else{ |
| 70650 | iRes = i2; |
| 70651 | } |
| @@ -70660,16 +70715,21 @@ | |
| 70660 | */ |
| 70661 | SQLITE_PRIVATE int sqlite3VdbeSorterInit(sqlite3 *db, VdbeCursor *pCsr){ |
| 70662 | int pgsz; /* Page size of main database */ |
| 70663 | int mxCache; /* Cache size */ |
| 70664 | VdbeSorter *pSorter; /* The new sorter */ |
| 70665 | |
| 70666 | assert( pCsr->pKeyInfo && pCsr->pBt==0 ); |
| 70667 | pCsr->pSorter = pSorter = sqlite3DbMallocZero(db, sizeof(VdbeSorter)); |
| 70668 | if( pSorter==0 ){ |
| 70669 | return SQLITE_NOMEM; |
| 70670 | } |
| 70671 | |
| 70672 | if( !sqlite3TempInMemory(db) ){ |
| 70673 | pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt); |
| 70674 | pSorter->mnPmaSize = SORTER_MIN_WORKING * pgsz; |
| 70675 | mxCache = db->aDb[0].pSchema->cache_size; |
| @@ -70707,11 +70767,11 @@ | |
| 70707 | } |
| 70708 | if( pSorter->pTemp1 ){ |
| 70709 | sqlite3OsCloseFree(pSorter->pTemp1); |
| 70710 | } |
| 70711 | vdbeSorterRecordFree(db, pSorter->pRecord); |
| 70712 | sqlite3_free(pSorter->aSpace); |
| 70713 | sqlite3DbFree(db, pSorter); |
| 70714 | pCsr->pSorter = 0; |
| 70715 | } |
| 70716 | } |
| 70717 | |
| @@ -70728,36 +70788,26 @@ | |
| 70728 | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE, &dummy |
| 70729 | ); |
| 70730 | } |
| 70731 | |
| 70732 | /* |
| 70733 | ** Attemp to merge the two sorted lists p1 and p2 into a single list. If no |
| 70734 | ** error occurs set *ppOut to the head of the new list and return SQLITE_OK. |
| 70735 | */ |
| 70736 | static int vdbeSorterMerge( |
| 70737 | sqlite3 *db, /* Database handle */ |
| 70738 | VdbeCursor *pCsr, /* For pKeyInfo */ |
| 70739 | SorterRecord *p1, /* First list to merge */ |
| 70740 | SorterRecord *p2, /* Second list to merge */ |
| 70741 | SorterRecord **ppOut /* OUT: Head of merged list */ |
| 70742 | ){ |
| 70743 | int rc = SQLITE_OK; |
| 70744 | SorterRecord *pFinal = 0; |
| 70745 | SorterRecord **pp = &pFinal; |
| 70746 | void *pVal2 = p2 ? p2->pVal : 0; |
| 70747 | |
| 70748 | while( p1 && p2 ){ |
| 70749 | int res; |
| 70750 | rc = vdbeSorterCompare(pCsr, 0, p1->pVal, p1->nVal, pVal2, p2->nVal, &res); |
| 70751 | if( rc!=SQLITE_OK ){ |
| 70752 | *pp = 0; |
| 70753 | vdbeSorterRecordFree(db, p1); |
| 70754 | vdbeSorterRecordFree(db, p2); |
| 70755 | vdbeSorterRecordFree(db, pFinal); |
| 70756 | *ppOut = 0; |
| 70757 | return rc; |
| 70758 | } |
| 70759 | if( res<=0 ){ |
| 70760 | *pp = p1; |
| 70761 | pp = &p1->pNext; |
| 70762 | p1 = p1->pNext; |
| 70763 | pVal2 = 0; |
| @@ -70768,22 +70818,19 @@ | |
| 70768 | if( p2==0 ) break; |
| 70769 | pVal2 = p2->pVal; |
| 70770 | } |
| 70771 | } |
| 70772 | *pp = p1 ? p1 : p2; |
| 70773 | |
| 70774 | *ppOut = pFinal; |
| 70775 | return SQLITE_OK; |
| 70776 | } |
| 70777 | |
| 70778 | /* |
| 70779 | ** Sort the linked list of records headed at pCsr->pRecord. Return SQLITE_OK |
| 70780 | ** if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if an error |
| 70781 | ** occurs. |
| 70782 | */ |
| 70783 | static int vdbeSorterSort(sqlite3 *db, VdbeCursor *pCsr){ |
| 70784 | int rc = SQLITE_OK; |
| 70785 | int i; |
| 70786 | SorterRecord **aSlot; |
| 70787 | SorterRecord *p; |
| 70788 | VdbeSorter *pSorter = pCsr->pSorter; |
| 70789 | |
| @@ -70794,34 +70841,26 @@ | |
| 70794 | |
| 70795 | p = pSorter->pRecord; |
| 70796 | while( p ){ |
| 70797 | SorterRecord *pNext = p->pNext; |
| 70798 | p->pNext = 0; |
| 70799 | for(i=0; rc==SQLITE_OK && aSlot[i]; i++){ |
| 70800 | rc = vdbeSorterMerge(db, pCsr, p, aSlot[i], &p); |
| 70801 | aSlot[i] = 0; |
| 70802 | } |
| 70803 | if( rc!=SQLITE_OK ){ |
| 70804 | vdbeSorterRecordFree(db, pNext); |
| 70805 | break; |
| 70806 | } |
| 70807 | aSlot[i] = p; |
| 70808 | p = pNext; |
| 70809 | } |
| 70810 | |
| 70811 | p = 0; |
| 70812 | for(i=0; i<64; i++){ |
| 70813 | if( rc==SQLITE_OK ){ |
| 70814 | rc = vdbeSorterMerge(db, pCsr, p, aSlot[i], &p); |
| 70815 | }else{ |
| 70816 | vdbeSorterRecordFree(db, aSlot[i]); |
| 70817 | } |
| 70818 | } |
| 70819 | pSorter->pRecord = p; |
| 70820 | |
| 70821 | sqlite3_free(aSlot); |
| 70822 | return rc; |
| 70823 | } |
| 70824 | |
| 70825 | |
| 70826 | /* |
| 70827 | ** Write the current contents of the in-memory linked-list to a PMA. Return |
| @@ -70843,11 +70882,11 @@ | |
| 70843 | if( pSorter->nInMemory==0 ){ |
| 70844 | assert( pSorter->pRecord==0 ); |
| 70845 | return rc; |
| 70846 | } |
| 70847 | |
| 70848 | rc = vdbeSorterSort(db, pCsr); |
| 70849 | |
| 70850 | /* If the first temporary PMA file has not been opened, open it now. */ |
| 70851 | if( rc==SQLITE_OK && pSorter->pTemp1==0 ){ |
| 70852 | rc = vdbeSorterOpenTempFile(db, &pSorter->pTemp1); |
| 70853 | assert( rc!=SQLITE_OK || pSorter->pTemp1 ); |
| @@ -70990,11 +71029,11 @@ | |
| 70990 | ** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly |
| 70991 | ** from the in-memory list. */ |
| 70992 | if( pSorter->nPMA==0 ){ |
| 70993 | *pbEof = !pSorter->pRecord; |
| 70994 | assert( pSorter->aTree==0 ); |
| 70995 | return vdbeSorterSort(db, pCsr); |
| 70996 | } |
| 70997 | |
| 70998 | /* Write the current b-tree to a PMA. Close the b-tree cursor. */ |
| 70999 | rc = vdbeSorterListToPMA(db, pCsr); |
| 71000 | if( rc!=SQLITE_OK ) return rc; |
| @@ -71160,24 +71199,23 @@ | |
| 71160 | SQLITE_PRIVATE int sqlite3VdbeSorterCompare( |
| 71161 | VdbeCursor *pCsr, /* Sorter cursor */ |
| 71162 | Mem *pVal, /* Value to compare to current sorter key */ |
| 71163 | int *pRes /* OUT: Result of comparison */ |
| 71164 | ){ |
| 71165 | int rc; |
| 71166 | VdbeSorter *pSorter = pCsr->pSorter; |
| 71167 | void *pKey; int nKey; /* Sorter key to compare pVal with */ |
| 71168 | |
| 71169 | pKey = vdbeSorterRowkey(pSorter, &nKey); |
| 71170 | rc = vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes); |
| 71171 | assert( rc!=SQLITE_OK || pVal->db->mallocFailed || (*pRes)<=0 ); |
| 71172 | return rc; |
| 71173 | } |
| 71174 | |
| 71175 | #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */ |
| 71176 | |
| 71177 | /************** End of vdbesort.c ********************************************/ |
| 71178 | /************** Begin file journal.c *****************************************/ |
| 71179 | /* |
| 71180 | ** 2007 August 22 |
| 71181 | ** |
| 71182 | ** The author disclaims copyright to this source code. In place of |
| 71183 | ** a legal notice, here is a blessing: |
| @@ -71414,10 +71452,11 @@ | |
| 71414 | } |
| 71415 | #endif |
| 71416 | |
| 71417 | /************** End of journal.c *********************************************/ |
| 71418 | /************** Begin file memjournal.c **************************************/ |
| 71419 | /* |
| 71420 | ** 2008 October 7 |
| 71421 | ** |
| 71422 | ** The author disclaims copyright to this source code. In place of |
| 71423 | ** a legal notice, here is a blessing: |
| @@ -71675,10 +71714,11 @@ | |
| 71675 | return sizeof(MemJournal); |
| 71676 | } |
| 71677 | |
| 71678 | /************** End of memjournal.c ******************************************/ |
| 71679 | /************** Begin file walker.c ******************************************/ |
| 71680 | /* |
| 71681 | ** 2008 August 16 |
| 71682 | ** |
| 71683 | ** The author disclaims copyright to this source code. In place of |
| 71684 | ** a legal notice, here is a blessing: |
| @@ -71813,10 +71853,11 @@ | |
| 71813 | return rc & WRC_Abort; |
| 71814 | } |
| 71815 | |
| 71816 | /************** End of walker.c **********************************************/ |
| 71817 | /************** Begin file resolve.c *****************************************/ |
| 71818 | /* |
| 71819 | ** 2008 August 18 |
| 71820 | ** |
| 71821 | ** The author disclaims copyright to this source code. In place of |
| 71822 | ** a legal notice, here is a blessing: |
| @@ -73033,10 +73074,11 @@ | |
| 73033 | sqlite3WalkSelect(&w, p); |
| 73034 | } |
| 73035 | |
| 73036 | /************** End of resolve.c *********************************************/ |
| 73037 | /************** Begin file expr.c ********************************************/ |
| 73038 | /* |
| 73039 | ** 2001 September 15 |
| 73040 | ** |
| 73041 | ** The author disclaims copyright to this source code. In place of |
| 73042 | ** a legal notice, here is a blessing: |
| @@ -76793,10 +76835,11 @@ | |
| 76793 | } |
| 76794 | } |
| 76795 | |
| 76796 | /************** End of expr.c ************************************************/ |
| 76797 | /************** Begin file alter.c *******************************************/ |
| 76798 | /* |
| 76799 | ** 2005 February 15 |
| 76800 | ** |
| 76801 | ** The author disclaims copyright to this source code. In place of |
| 76802 | ** a legal notice, here is a blessing: |
| @@ -77621,10 +77664,11 @@ | |
| 77621 | } |
| 77622 | #endif /* SQLITE_ALTER_TABLE */ |
| 77623 | |
| 77624 | /************** End of alter.c ***********************************************/ |
| 77625 | /************** Begin file analyze.c *****************************************/ |
| 77626 | /* |
| 77627 | ** 2005 July 8 |
| 77628 | ** |
| 77629 | ** The author disclaims copyright to this source code. In place of |
| 77630 | ** a legal notice, here is a blessing: |
| @@ -78342,10 +78386,11 @@ | |
| 78342 | |
| 78343 | #endif /* SQLITE_OMIT_ANALYZE */ |
| 78344 | |
| 78345 | /************** End of analyze.c *********************************************/ |
| 78346 | /************** Begin file attach.c ******************************************/ |
| 78347 | /* |
| 78348 | ** 2003 April 6 |
| 78349 | ** |
| 78350 | ** The author disclaims copyright to this source code. In place of |
| 78351 | ** a legal notice, here is a blessing: |
| @@ -78901,10 +78946,11 @@ | |
| 78901 | } |
| 78902 | #endif |
| 78903 | |
| 78904 | /************** End of attach.c **********************************************/ |
| 78905 | /************** Begin file auth.c ********************************************/ |
| 78906 | /* |
| 78907 | ** 2003 January 11 |
| 78908 | ** |
| 78909 | ** The author disclaims copyright to this source code. In place of |
| 78910 | ** a legal notice, here is a blessing: |
| @@ -79152,10 +79198,11 @@ | |
| 79152 | |
| 79153 | #endif /* SQLITE_OMIT_AUTHORIZATION */ |
| 79154 | |
| 79155 | /************** End of auth.c ************************************************/ |
| 79156 | /************** Begin file build.c *******************************************/ |
| 79157 | /* |
| 79158 | ** 2001 September 15 |
| 79159 | ** |
| 79160 | ** The author disclaims copyright to this source code. In place of |
| 79161 | ** a legal notice, here is a blessing: |
| @@ -82955,10 +83002,11 @@ | |
| 82955 | return pKey; |
| 82956 | } |
| 82957 | |
| 82958 | /************** End of build.c ***********************************************/ |
| 82959 | /************** Begin file callback.c ****************************************/ |
| 82960 | /* |
| 82961 | ** 2005 May 23 |
| 82962 | ** |
| 82963 | ** The author disclaims copyright to this source code. In place of |
| 82964 | ** a legal notice, here is a blessing: |
| @@ -83414,10 +83462,11 @@ | |
| 83414 | return p; |
| 83415 | } |
| 83416 | |
| 83417 | /************** End of callback.c ********************************************/ |
| 83418 | /************** Begin file delete.c ******************************************/ |
| 83419 | /* |
| 83420 | ** 2001 September 15 |
| 83421 | ** |
| 83422 | ** The author disclaims copyright to this source code. In place of |
| 83423 | ** a legal notice, here is a blessing: |
| @@ -84068,10 +84117,11 @@ | |
| 84068 | return regBase; |
| 84069 | } |
| 84070 | |
| 84071 | /************** End of delete.c **********************************************/ |
| 84072 | /************** Begin file func.c ********************************************/ |
| 84073 | /* |
| 84074 | ** 2002 February 23 |
| 84075 | ** |
| 84076 | ** The author disclaims copyright to this source code. In place of |
| 84077 | ** a legal notice, here is a blessing: |
| @@ -85676,10 +85726,11 @@ | |
| 85676 | #endif |
| 85677 | } |
| 85678 | |
| 85679 | /************** End of func.c ************************************************/ |
| 85680 | /************** Begin file fkey.c ********************************************/ |
| 85681 | /* |
| 85682 | ** |
| 85683 | ** The author disclaims copyright to this source code. In place of |
| 85684 | ** a legal notice, here is a blessing: |
| 85685 | ** |
| @@ -86896,10 +86947,11 @@ | |
| 86896 | } |
| 86897 | #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */ |
| 86898 | |
| 86899 | /************** End of fkey.c ************************************************/ |
| 86900 | /************** Begin file insert.c ******************************************/ |
| 86901 | /* |
| 86902 | ** 2001 September 15 |
| 86903 | ** |
| 86904 | ** The author disclaims copyright to this source code. In place of |
| 86905 | ** a legal notice, here is a blessing: |
| @@ -88741,10 +88793,11 @@ | |
| 88741 | } |
| 88742 | #endif /* SQLITE_OMIT_XFER_OPT */ |
| 88743 | |
| 88744 | /************** End of insert.c **********************************************/ |
| 88745 | /************** Begin file legacy.c ******************************************/ |
| 88746 | /* |
| 88747 | ** 2001 September 15 |
| 88748 | ** |
| 88749 | ** The author disclaims copyright to this source code. In place of |
| 88750 | ** a legal notice, here is a blessing: |
| @@ -88888,10 +88941,11 @@ | |
| 88888 | return rc; |
| 88889 | } |
| 88890 | |
| 88891 | /************** End of legacy.c **********************************************/ |
| 88892 | /************** Begin file loadext.c *****************************************/ |
| 88893 | /* |
| 88894 | ** 2006 June 7 |
| 88895 | ** |
| 88896 | ** The author disclaims copyright to this source code. In place of |
| 88897 | ** a legal notice, here is a blessing: |
| @@ -88908,10 +88962,11 @@ | |
| 88908 | #ifndef SQLITE_CORE |
| 88909 | #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */ |
| 88910 | #endif |
| 88911 | /************** Include sqlite3ext.h in the middle of loadext.c **************/ |
| 88912 | /************** Begin file sqlite3ext.h **************************************/ |
| 88913 | /* |
| 88914 | ** 2006 June 7 |
| 88915 | ** |
| 88916 | ** The author disclaims copyright to this source code. In place of |
| 88917 | ** a legal notice, here is a blessing: |
| @@ -89336,10 +89391,11 @@ | |
| 89336 | |
| 89337 | #endif /* _SQLITE3EXT_H_ */ |
| 89338 | |
| 89339 | /************** End of sqlite3ext.h ******************************************/ |
| 89340 | /************** Continuing where we left off in loadext.c ********************/ |
| 89341 | /* #include <string.h> */ |
| 89342 | |
| 89343 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 89344 | |
| 89345 | /* |
| @@ -89975,10 +90031,11 @@ | |
| 89975 | } |
| 89976 | } |
| 89977 | |
| 89978 | /************** End of loadext.c *********************************************/ |
| 89979 | /************** Begin file pragma.c ******************************************/ |
| 89980 | /* |
| 89981 | ** 2003 April 6 |
| 89982 | ** |
| 89983 | ** The author disclaims copyright to this source code. In place of |
| 89984 | ** a legal notice, here is a blessing: |
| @@ -91503,10 +91560,11 @@ | |
| 91503 | |
| 91504 | #endif /* SQLITE_OMIT_PRAGMA */ |
| 91505 | |
| 91506 | /************** End of pragma.c **********************************************/ |
| 91507 | /************** Begin file prepare.c *****************************************/ |
| 91508 | /* |
| 91509 | ** 2005 May 25 |
| 91510 | ** |
| 91511 | ** The author disclaims copyright to this source code. In place of |
| 91512 | ** a legal notice, here is a blessing: |
| @@ -92363,10 +92421,11 @@ | |
| 92363 | |
| 92364 | #endif /* SQLITE_OMIT_UTF16 */ |
| 92365 | |
| 92366 | /************** End of prepare.c *********************************************/ |
| 92367 | /************** Begin file select.c ******************************************/ |
| 92368 | /* |
| 92369 | ** 2001 September 15 |
| 92370 | ** |
| 92371 | ** The author disclaims copyright to this source code. In place of |
| 92372 | ** a legal notice, here is a blessing: |
| @@ -96922,10 +96981,11 @@ | |
| 96922 | *****************************************************************************/ |
| 96923 | #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ |
| 96924 | |
| 96925 | /************** End of select.c **********************************************/ |
| 96926 | /************** Begin file table.c *******************************************/ |
| 96927 | /* |
| 96928 | ** 2001 September 15 |
| 96929 | ** |
| 96930 | ** The author disclaims copyright to this source code. In place of |
| 96931 | ** a legal notice, here is a blessing: |
| @@ -97121,10 +97181,11 @@ | |
| 97121 | |
| 97122 | #endif /* SQLITE_OMIT_GET_TABLE */ |
| 97123 | |
| 97124 | /************** End of table.c ***********************************************/ |
| 97125 | /************** Begin file trigger.c *****************************************/ |
| 97126 | /* |
| 97127 | ** |
| 97128 | ** The author disclaims copyright to this source code. In place of |
| 97129 | ** a legal notice, here is a blessing: |
| 97130 | ** |
| @@ -98246,10 +98307,11 @@ | |
| 98246 | |
| 98247 | #endif /* !defined(SQLITE_OMIT_TRIGGER) */ |
| 98248 | |
| 98249 | /************** End of trigger.c *********************************************/ |
| 98250 | /************** Begin file update.c ******************************************/ |
| 98251 | /* |
| 98252 | ** 2001 September 15 |
| 98253 | ** |
| 98254 | ** The author disclaims copyright to this source code. In place of |
| 98255 | ** a legal notice, here is a blessing: |
| @@ -98918,10 +98980,11 @@ | |
| 98918 | } |
| 98919 | #endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 98920 | |
| 98921 | /************** End of update.c **********************************************/ |
| 98922 | /************** Begin file vacuum.c ******************************************/ |
| 98923 | /* |
| 98924 | ** 2003 April 6 |
| 98925 | ** |
| 98926 | ** The author disclaims copyright to this source code. In place of |
| 98927 | ** a legal notice, here is a blessing: |
| @@ -99264,10 +99327,11 @@ | |
| 99264 | |
| 99265 | #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */ |
| 99266 | |
| 99267 | /************** End of vacuum.c **********************************************/ |
| 99268 | /************** Begin file vtab.c ********************************************/ |
| 99269 | /* |
| 99270 | ** 2006 June 10 |
| 99271 | ** |
| 99272 | ** The author disclaims copyright to this source code. In place of |
| 99273 | ** a legal notice, here is a blessing: |
| @@ -100332,10 +100396,11 @@ | |
| 100332 | |
| 100333 | #endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 100334 | |
| 100335 | /************** End of vtab.c ************************************************/ |
| 100336 | /************** Begin file where.c *******************************************/ |
| 100337 | /* |
| 100338 | ** 2001 September 15 |
| 100339 | ** |
| 100340 | ** The author disclaims copyright to this source code. In place of |
| 100341 | ** a legal notice, here is a blessing: |
| @@ -105518,10 +105583,11 @@ | |
| 105518 | return; |
| 105519 | } |
| 105520 | |
| 105521 | /************** End of where.c ***********************************************/ |
| 105522 | /************** Begin file parse.c *******************************************/ |
| 105523 | /* Driver template for the LEMON parser generator. |
| 105524 | ** The author disclaims copyright to this source code. |
| 105525 | ** |
| 105526 | ** This version of "lempar.c" is modified, slightly, for use by SQLite. |
| 105527 | ** The only modifications are the addition of a couple of NEVER() |
| @@ -105530,10 +105596,11 @@ | |
| 105530 | ** specific grammar used by SQLite. |
| 105531 | */ |
| 105532 | /* First off, code is included that follows the "include" declaration |
| 105533 | ** in the input grammar file. */ |
| 105534 | /* #include <stdio.h> */ |
| 105535 | |
| 105536 | |
| 105537 | /* |
| 105538 | ** Disable all error recovery processing in the parser push-down |
| 105539 | ** automaton. |
| @@ -105577,10 +105644,11 @@ | |
| 105577 | /* |
| 105578 | ** An instance of this structure holds the ATTACH key and the key type. |
| 105579 | */ |
| 105580 | struct AttachKey { int type; Token key; }; |
| 105581 | |
| 105582 | |
| 105583 | /* This is a utility routine used to set the ExprSpan.zStart and |
| 105584 | ** ExprSpan.zEnd values of pOut so that the span covers the complete |
| 105585 | ** range of text beginning with pStart and going to the end of pEnd. |
| 105586 | */ |
| @@ -105596,10 +105664,11 @@ | |
| 105596 | static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){ |
| 105597 | pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue); |
| 105598 | pOut->zStart = pValue->z; |
| 105599 | pOut->zEnd = &pValue->z[pValue->n]; |
| 105600 | } |
| 105601 | |
| 105602 | /* This routine constructs a binary expression node out of two ExprSpan |
| 105603 | ** objects and uses the result to populate a new ExprSpan object. |
| 105604 | */ |
| 105605 | static void spanBinaryExpr( |
| @@ -105611,10 +105680,11 @@ | |
| 105611 | ){ |
| 105612 | pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0); |
| 105613 | pOut->zStart = pLeft->zStart; |
| 105614 | pOut->zEnd = pRight->zEnd; |
| 105615 | } |
| 105616 | |
| 105617 | /* Construct an expression node for a unary postfix operator |
| 105618 | */ |
| 105619 | static void spanUnaryPostfix( |
| 105620 | ExprSpan *pOut, /* Write the new expression node here */ |
| @@ -105625,10 +105695,11 @@ | |
| 105625 | ){ |
| 105626 | pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0); |
| 105627 | pOut->zStart = pOperand->zStart; |
| 105628 | pOut->zEnd = &pPostOp->z[pPostOp->n]; |
| 105629 | } |
| 105630 | |
| 105631 | /* A routine to convert a binary TK_IS or TK_ISNOT expression into a |
| 105632 | ** unary TK_ISNULL or TK_NOTNULL expression. */ |
| 105633 | static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){ |
| 105634 | sqlite3 *db = pParse->db; |
| @@ -105636,10 +105707,11 @@ | |
| 105636 | pA->op = (u8)op; |
| 105637 | sqlite3ExprDelete(db, pA->pRight); |
| 105638 | pA->pRight = 0; |
| 105639 | } |
| 105640 | } |
| 105641 | |
| 105642 | /* Construct an expression node for a unary prefix operator |
| 105643 | */ |
| 105644 | static void spanUnaryPrefix( |
| 105645 | ExprSpan *pOut, /* Write the new expression node here */ |
| @@ -105650,10 +105722,11 @@ | |
| 105650 | ){ |
| 105651 | pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0); |
| 105652 | pOut->zStart = pPreOp->z; |
| 105653 | pOut->zEnd = pOperand->zEnd; |
| 105654 | } |
| 105655 | /* Next is all token values, in a form suitable for use by makeheaders. |
| 105656 | ** This section will be null unless lemon is run with the -m switch. |
| 105657 | */ |
| 105658 | /* |
| 105659 | ** These constants (all generated automatically by the parser generator) |
| @@ -106905,17 +106978,21 @@ | |
| 106905 | ** inside the C code. |
| 106906 | */ |
| 106907 | case 160: /* select */ |
| 106908 | case 194: /* oneselect */ |
| 106909 | { |
| 106910 | sqlite3SelectDelete(pParse->db, (yypminor->yy387)); |
| 106911 | } |
| 106912 | break; |
| 106913 | case 174: /* term */ |
| 106914 | case 175: /* expr */ |
| 106915 | { |
| 106916 | sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr); |
| 106917 | } |
| 106918 | break; |
| 106919 | case 179: /* idxlist_opt */ |
| 106920 | case 187: /* idxlist */ |
| 106921 | case 197: /* selcollist */ |
| @@ -106927,19 +107004,23 @@ | |
| 106927 | case 217: /* setlist */ |
| 106928 | case 220: /* itemlist */ |
| 106929 | case 221: /* exprlist */ |
| 106930 | case 226: /* case_exprlist */ |
| 106931 | { |
| 106932 | sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); |
| 106933 | } |
| 106934 | break; |
| 106935 | case 193: /* fullname */ |
| 106936 | case 198: /* from */ |
| 106937 | case 206: /* seltablist */ |
| 106938 | case 207: /* stl_prefix */ |
| 106939 | { |
| 106940 | sqlite3SrcListDelete(pParse->db, (yypminor->yy259)); |
| 106941 | } |
| 106942 | break; |
| 106943 | case 199: /* where_opt */ |
| 106944 | case 201: /* having_opt */ |
| 106945 | case 210: /* on_opt */ |
| @@ -106947,29 +107028,37 @@ | |
| 106947 | case 225: /* case_operand */ |
| 106948 | case 227: /* case_else */ |
| 106949 | case 238: /* when_clause */ |
| 106950 | case 243: /* key_opt */ |
| 106951 | { |
| 106952 | sqlite3ExprDelete(pParse->db, (yypminor->yy314)); |
| 106953 | } |
| 106954 | break; |
| 106955 | case 211: /* using_opt */ |
| 106956 | case 213: /* inscollist */ |
| 106957 | case 219: /* inscollist_opt */ |
| 106958 | { |
| 106959 | sqlite3IdListDelete(pParse->db, (yypminor->yy384)); |
| 106960 | } |
| 106961 | break; |
| 106962 | case 234: /* trigger_cmd_list */ |
| 106963 | case 239: /* trigger_cmd */ |
| 106964 | { |
| 106965 | sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203)); |
| 106966 | } |
| 106967 | break; |
| 106968 | case 236: /* trigger_event */ |
| 106969 | { |
| 106970 | sqlite3IdListDelete(pParse->db, (yypminor->yy90).b); |
| 106971 | } |
| 106972 | break; |
| 106973 | default: break; /* If no destructor action specified: do nothing */ |
| 106974 | } |
| 106975 | } |
| @@ -107151,14 +107240,16 @@ | |
| 107151 | } |
| 107152 | #endif |
| 107153 | while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); |
| 107154 | /* Here code is inserted which will execute if the parser |
| 107155 | ** stack every overflows */ |
| 107156 | |
| 107157 | UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */ |
| 107158 | sqlite3ErrorMsg(pParse, "parser stack overflow"); |
| 107159 | pParse->parseError = 1; |
| 107160 | sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */ |
| 107161 | } |
| 107162 | |
| 107163 | /* |
| 107164 | ** Perform a shift action. |
| @@ -107595,66 +107686,94 @@ | |
| 107595 | ** { ... } // User supplied code |
| 107596 | ** #line <lineno> <thisfile> |
| 107597 | ** break; |
| 107598 | */ |
| 107599 | case 5: /* explain ::= */ |
| 107600 | { sqlite3BeginParse(pParse, 0); } |
| 107601 | break; |
| 107602 | case 6: /* explain ::= EXPLAIN */ |
| 107603 | { sqlite3BeginParse(pParse, 1); } |
| 107604 | break; |
| 107605 | case 7: /* explain ::= EXPLAIN QUERY PLAN */ |
| 107606 | { sqlite3BeginParse(pParse, 2); } |
| 107607 | break; |
| 107608 | case 8: /* cmdx ::= cmd */ |
| 107609 | { sqlite3FinishCoding(pParse); } |
| 107610 | break; |
| 107611 | case 9: /* cmd ::= BEGIN transtype trans_opt */ |
| 107612 | {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);} |
| 107613 | break; |
| 107614 | case 13: /* transtype ::= */ |
| 107615 | {yygotominor.yy4 = TK_DEFERRED;} |
| 107616 | break; |
| 107617 | case 14: /* transtype ::= DEFERRED */ |
| 107618 | case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); |
| 107619 | case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); |
| 107620 | case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); |
| 107621 | case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117); |
| 107622 | {yygotominor.yy4 = yymsp[0].major;} |
| 107623 | break; |
| 107624 | case 17: /* cmd ::= COMMIT trans_opt */ |
| 107625 | case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); |
| 107626 | {sqlite3CommitTransaction(pParse);} |
| 107627 | break; |
| 107628 | case 19: /* cmd ::= ROLLBACK trans_opt */ |
| 107629 | {sqlite3RollbackTransaction(pParse);} |
| 107630 | break; |
| 107631 | case 22: /* cmd ::= SAVEPOINT nm */ |
| 107632 | { |
| 107633 | sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0); |
| 107634 | } |
| 107635 | break; |
| 107636 | case 23: /* cmd ::= RELEASE savepoint_opt nm */ |
| 107637 | { |
| 107638 | sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0); |
| 107639 | } |
| 107640 | break; |
| 107641 | case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ |
| 107642 | { |
| 107643 | sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); |
| 107644 | } |
| 107645 | break; |
| 107646 | case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ |
| 107647 | { |
| 107648 | sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4); |
| 107649 | } |
| 107650 | break; |
| 107651 | case 27: /* createkw ::= CREATE */ |
| 107652 | { |
| 107653 | pParse->db->lookaside.bEnabled = 0; |
| 107654 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 107655 | } |
| 107656 | break; |
| 107657 | case 28: /* ifnotexists ::= */ |
| 107658 | case 31: /* temp ::= */ yytestcase(yyruleno==31); |
| 107659 | case 70: /* autoinc ::= */ yytestcase(yyruleno==70); |
| 107660 | case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83); |
| @@ -107664,44 +107783,56 @@ | |
| 107664 | case 109: /* ifexists ::= */ yytestcase(yyruleno==109); |
| 107665 | case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); |
| 107666 | case 121: /* distinct ::= */ yytestcase(yyruleno==121); |
| 107667 | case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222); |
| 107668 | case 225: /* in_op ::= IN */ yytestcase(yyruleno==225); |
| 107669 | {yygotominor.yy4 = 0;} |
| 107670 | break; |
| 107671 | case 29: /* ifnotexists ::= IF NOT EXISTS */ |
| 107672 | case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); |
| 107673 | case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); |
| 107674 | case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86); |
| 107675 | case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); |
| 107676 | case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); |
| 107677 | case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223); |
| 107678 | case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226); |
| 107679 | {yygotominor.yy4 = 1;} |
| 107680 | break; |
| 107681 | case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ |
| 107682 | { |
| 107683 | sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); |
| 107684 | } |
| 107685 | break; |
| 107686 | case 33: /* create_table_args ::= AS select */ |
| 107687 | { |
| 107688 | sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387); |
| 107689 | sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); |
| 107690 | } |
| 107691 | break; |
| 107692 | case 36: /* column ::= columnid type carglist */ |
| 107693 | { |
| 107694 | yygotominor.yy0.z = yymsp[-2].minor.yy0.z; |
| 107695 | yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n; |
| 107696 | } |
| 107697 | break; |
| 107698 | case 37: /* columnid ::= nm */ |
| 107699 | { |
| 107700 | sqlite3AddColumn(pParse,&yymsp[0].minor.yy0); |
| 107701 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 107702 | } |
| 107703 | break; |
| 107704 | case 38: /* id ::= ID */ |
| 107705 | case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39); |
| 107706 | case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40); |
| 107707 | case 41: /* nm ::= id */ yytestcase(yyruleno==41); |
| @@ -107721,256 +107852,373 @@ | |
| 107721 | case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264); |
| 107722 | case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265); |
| 107723 | case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266); |
| 107724 | case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267); |
| 107725 | case 285: /* trnm ::= nm */ yytestcase(yyruleno==285); |
| 107726 | {yygotominor.yy0 = yymsp[0].minor.yy0;} |
| 107727 | break; |
| 107728 | case 45: /* type ::= typetoken */ |
| 107729 | {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} |
| 107730 | break; |
| 107731 | case 47: /* typetoken ::= typename LP signed RP */ |
| 107732 | { |
| 107733 | yygotominor.yy0.z = yymsp[-3].minor.yy0.z; |
| 107734 | yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z); |
| 107735 | } |
| 107736 | break; |
| 107737 | case 48: /* typetoken ::= typename LP signed COMMA signed RP */ |
| 107738 | { |
| 107739 | yygotominor.yy0.z = yymsp[-5].minor.yy0.z; |
| 107740 | yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z); |
| 107741 | } |
| 107742 | break; |
| 107743 | case 50: /* typename ::= typename ids */ |
| 107744 | {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);} |
| 107745 | break; |
| 107746 | case 57: /* ccons ::= DEFAULT term */ |
| 107747 | case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); |
| 107748 | {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);} |
| 107749 | break; |
| 107750 | case 58: /* ccons ::= DEFAULT LP expr RP */ |
| 107751 | {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);} |
| 107752 | break; |
| 107753 | case 60: /* ccons ::= DEFAULT MINUS term */ |
| 107754 | { |
| 107755 | ExprSpan v; |
| 107756 | v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0); |
| 107757 | v.zStart = yymsp[-1].minor.yy0.z; |
| 107758 | v.zEnd = yymsp[0].minor.yy118.zEnd; |
| 107759 | sqlite3AddDefaultValue(pParse,&v); |
| 107760 | } |
| 107761 | break; |
| 107762 | case 61: /* ccons ::= DEFAULT id */ |
| 107763 | { |
| 107764 | ExprSpan v; |
| 107765 | spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0); |
| 107766 | sqlite3AddDefaultValue(pParse,&v); |
| 107767 | } |
| 107768 | break; |
| 107769 | case 63: /* ccons ::= NOT NULL onconf */ |
| 107770 | {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);} |
| 107771 | break; |
| 107772 | case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ |
| 107773 | {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);} |
| 107774 | break; |
| 107775 | case 65: /* ccons ::= UNIQUE onconf */ |
| 107776 | {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);} |
| 107777 | break; |
| 107778 | case 66: /* ccons ::= CHECK LP expr RP */ |
| 107779 | {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);} |
| 107780 | break; |
| 107781 | case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ |
| 107782 | {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);} |
| 107783 | break; |
| 107784 | case 68: /* ccons ::= defer_subclause */ |
| 107785 | {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);} |
| 107786 | break; |
| 107787 | case 69: /* ccons ::= COLLATE ids */ |
| 107788 | {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} |
| 107789 | break; |
| 107790 | case 72: /* refargs ::= */ |
| 107791 | { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */} |
| 107792 | break; |
| 107793 | case 73: /* refargs ::= refargs refarg */ |
| 107794 | { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; } |
| 107795 | break; |
| 107796 | case 74: /* refarg ::= MATCH nm */ |
| 107797 | case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); |
| 107798 | { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; } |
| 107799 | break; |
| 107800 | case 76: /* refarg ::= ON DELETE refact */ |
| 107801 | { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; } |
| 107802 | break; |
| 107803 | case 77: /* refarg ::= ON UPDATE refact */ |
| 107804 | { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; } |
| 107805 | break; |
| 107806 | case 78: /* refact ::= SET NULL */ |
| 107807 | { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */} |
| 107808 | break; |
| 107809 | case 79: /* refact ::= SET DEFAULT */ |
| 107810 | { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */} |
| 107811 | break; |
| 107812 | case 80: /* refact ::= CASCADE */ |
| 107813 | { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */} |
| 107814 | break; |
| 107815 | case 81: /* refact ::= RESTRICT */ |
| 107816 | { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */} |
| 107817 | break; |
| 107818 | case 82: /* refact ::= NO ACTION */ |
| 107819 | { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */} |
| 107820 | break; |
| 107821 | case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ |
| 107822 | case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99); |
| 107823 | case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101); |
| 107824 | case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); |
| 107825 | {yygotominor.yy4 = yymsp[0].minor.yy4;} |
| 107826 | break; |
| 107827 | case 88: /* conslist_opt ::= */ |
| 107828 | {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} |
| 107829 | break; |
| 107830 | case 89: /* conslist_opt ::= COMMA conslist */ |
| 107831 | {yygotominor.yy0 = yymsp[-1].minor.yy0;} |
| 107832 | break; |
| 107833 | case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ |
| 107834 | {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);} |
| 107835 | break; |
| 107836 | case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ |
| 107837 | {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);} |
| 107838 | break; |
| 107839 | case 96: /* tcons ::= CHECK LP expr RP onconf */ |
| 107840 | {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);} |
| 107841 | break; |
| 107842 | case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ |
| 107843 | { |
| 107844 | sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4); |
| 107845 | sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4); |
| 107846 | } |
| 107847 | break; |
| 107848 | case 100: /* onconf ::= */ |
| 107849 | {yygotominor.yy4 = OE_Default;} |
| 107850 | break; |
| 107851 | case 102: /* orconf ::= */ |
| 107852 | {yygotominor.yy210 = OE_Default;} |
| 107853 | break; |
| 107854 | case 103: /* orconf ::= OR resolvetype */ |
| 107855 | {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;} |
| 107856 | break; |
| 107857 | case 105: /* resolvetype ::= IGNORE */ |
| 107858 | {yygotominor.yy4 = OE_Ignore;} |
| 107859 | break; |
| 107860 | case 106: /* resolvetype ::= REPLACE */ |
| 107861 | {yygotominor.yy4 = OE_Replace;} |
| 107862 | break; |
| 107863 | case 107: /* cmd ::= DROP TABLE ifexists fullname */ |
| 107864 | { |
| 107865 | sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4); |
| 107866 | } |
| 107867 | break; |
| 107868 | case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ |
| 107869 | { |
| 107870 | sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4); |
| 107871 | } |
| 107872 | break; |
| 107873 | case 111: /* cmd ::= DROP VIEW ifexists fullname */ |
| 107874 | { |
| 107875 | sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4); |
| 107876 | } |
| 107877 | break; |
| 107878 | case 112: /* cmd ::= select */ |
| 107879 | { |
| 107880 | SelectDest dest = {SRT_Output, 0, 0, 0, 0}; |
| 107881 | sqlite3Select(pParse, yymsp[0].minor.yy387, &dest); |
| 107882 | sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); |
| 107883 | } |
| 107884 | break; |
| 107885 | case 113: /* select ::= oneselect */ |
| 107886 | {yygotominor.yy387 = yymsp[0].minor.yy387;} |
| 107887 | break; |
| 107888 | case 114: /* select ::= select multiselect_op oneselect */ |
| 107889 | { |
| 107890 | if( yymsp[0].minor.yy387 ){ |
| 107891 | yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4; |
| 107892 | yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387; |
| 107893 | }else{ |
| 107894 | sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387); |
| 107895 | } |
| 107896 | yygotominor.yy387 = yymsp[0].minor.yy387; |
| 107897 | } |
| 107898 | break; |
| 107899 | case 116: /* multiselect_op ::= UNION ALL */ |
| 107900 | {yygotominor.yy4 = TK_ALL;} |
| 107901 | break; |
| 107902 | case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 107903 | { |
| 107904 | yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset); |
| 107905 | } |
| 107906 | break; |
| 107907 | case 122: /* sclp ::= selcollist COMMA */ |
| 107908 | case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247); |
| 107909 | {yygotominor.yy322 = yymsp[-1].minor.yy322;} |
| 107910 | break; |
| 107911 | case 123: /* sclp ::= */ |
| 107912 | case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); |
| 107913 | case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159); |
| 107914 | case 240: /* exprlist ::= */ yytestcase(yyruleno==240); |
| 107915 | case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246); |
| 107916 | {yygotominor.yy322 = 0;} |
| 107917 | break; |
| 107918 | case 124: /* selcollist ::= sclp expr as */ |
| 107919 | { |
| 107920 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr); |
| 107921 | if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1); |
| 107922 | sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118); |
| 107923 | } |
| 107924 | break; |
| 107925 | case 125: /* selcollist ::= sclp STAR */ |
| 107926 | { |
| 107927 | Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); |
| 107928 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p); |
| 107929 | } |
| 107930 | break; |
| 107931 | case 126: /* selcollist ::= sclp nm DOT STAR */ |
| 107932 | { |
| 107933 | Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); |
| 107934 | Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 107935 | Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); |
| 107936 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot); |
| 107937 | } |
| 107938 | break; |
| 107939 | case 129: /* as ::= */ |
| 107940 | {yygotominor.yy0.n = 0;} |
| 107941 | break; |
| 107942 | case 130: /* from ::= */ |
| 107943 | {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));} |
| 107944 | break; |
| 107945 | case 131: /* from ::= FROM seltablist */ |
| 107946 | { |
| 107947 | yygotominor.yy259 = yymsp[0].minor.yy259; |
| 107948 | sqlite3SrcListShiftJoinType(yygotominor.yy259); |
| 107949 | } |
| 107950 | break; |
| 107951 | case 132: /* stl_prefix ::= seltablist joinop */ |
| 107952 | { |
| 107953 | yygotominor.yy259 = yymsp[-1].minor.yy259; |
| 107954 | if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4; |
| 107955 | } |
| 107956 | break; |
| 107957 | case 133: /* stl_prefix ::= */ |
| 107958 | {yygotominor.yy259 = 0;} |
| 107959 | break; |
| 107960 | case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 107961 | { |
| 107962 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 107963 | sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0); |
| 107964 | } |
| 107965 | break; |
| 107966 | case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 107967 | { |
| 107968 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 107969 | } |
| 107970 | break; |
| 107971 | case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 107972 | { |
| 107973 | if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){ |
| 107974 | yygotominor.yy259 = yymsp[-4].minor.yy259; |
| 107975 | }else{ |
| 107976 | Select *pSubquery; |
| @@ -107977,180 +108225,260 @@ | |
| 107977 | sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259); |
| 107978 | pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0); |
| 107979 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 107980 | } |
| 107981 | } |
| 107982 | break; |
| 107983 | case 137: /* dbnm ::= */ |
| 107984 | case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); |
| 107985 | {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} |
| 107986 | break; |
| 107987 | case 139: /* fullname ::= nm dbnm */ |
| 107988 | {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} |
| 107989 | break; |
| 107990 | case 140: /* joinop ::= COMMA|JOIN */ |
| 107991 | { yygotominor.yy4 = JT_INNER; } |
| 107992 | break; |
| 107993 | case 141: /* joinop ::= JOIN_KW JOIN */ |
| 107994 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } |
| 107995 | break; |
| 107996 | case 142: /* joinop ::= JOIN_KW nm JOIN */ |
| 107997 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } |
| 107998 | break; |
| 107999 | case 143: /* joinop ::= JOIN_KW nm nm JOIN */ |
| 108000 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } |
| 108001 | break; |
| 108002 | case 144: /* on_opt ::= ON expr */ |
| 108003 | case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155); |
| 108004 | case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162); |
| 108005 | case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169); |
| 108006 | case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235); |
| 108007 | case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237); |
| 108008 | {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;} |
| 108009 | break; |
| 108010 | case 145: /* on_opt ::= */ |
| 108011 | case 161: /* having_opt ::= */ yytestcase(yyruleno==161); |
| 108012 | case 168: /* where_opt ::= */ yytestcase(yyruleno==168); |
| 108013 | case 236: /* case_else ::= */ yytestcase(yyruleno==236); |
| 108014 | case 238: /* case_operand ::= */ yytestcase(yyruleno==238); |
| 108015 | {yygotominor.yy314 = 0;} |
| 108016 | break; |
| 108017 | case 148: /* indexed_opt ::= NOT INDEXED */ |
| 108018 | {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} |
| 108019 | break; |
| 108020 | case 149: /* using_opt ::= USING LP inscollist RP */ |
| 108021 | case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181); |
| 108022 | {yygotominor.yy384 = yymsp[-1].minor.yy384;} |
| 108023 | break; |
| 108024 | case 150: /* using_opt ::= */ |
| 108025 | case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180); |
| 108026 | {yygotominor.yy384 = 0;} |
| 108027 | break; |
| 108028 | case 152: /* orderby_opt ::= ORDER BY sortlist */ |
| 108029 | case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160); |
| 108030 | case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239); |
| 108031 | {yygotominor.yy322 = yymsp[0].minor.yy322;} |
| 108032 | break; |
| 108033 | case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */ |
| 108034 | { |
| 108035 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314); |
| 108036 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108037 | } |
| 108038 | break; |
| 108039 | case 154: /* sortlist ::= sortitem sortorder */ |
| 108040 | { |
| 108041 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); |
| 108042 | if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108043 | } |
| 108044 | break; |
| 108045 | case 156: /* sortorder ::= ASC */ |
| 108046 | case 158: /* sortorder ::= */ yytestcase(yyruleno==158); |
| 108047 | {yygotominor.yy4 = SQLITE_SO_ASC;} |
| 108048 | break; |
| 108049 | case 157: /* sortorder ::= DESC */ |
| 108050 | {yygotominor.yy4 = SQLITE_SO_DESC;} |
| 108051 | break; |
| 108052 | case 163: /* limit_opt ::= */ |
| 108053 | {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;} |
| 108054 | break; |
| 108055 | case 164: /* limit_opt ::= LIMIT expr */ |
| 108056 | {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;} |
| 108057 | break; |
| 108058 | case 165: /* limit_opt ::= LIMIT expr OFFSET expr */ |
| 108059 | {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;} |
| 108060 | break; |
| 108061 | case 166: /* limit_opt ::= LIMIT expr COMMA expr */ |
| 108062 | {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;} |
| 108063 | break; |
| 108064 | case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ |
| 108065 | { |
| 108066 | sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0); |
| 108067 | sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314); |
| 108068 | } |
| 108069 | break; |
| 108070 | case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ |
| 108071 | { |
| 108072 | sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0); |
| 108073 | sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); |
| 108074 | sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210); |
| 108075 | } |
| 108076 | break; |
| 108077 | case 171: /* setlist ::= setlist COMMA nm EQ expr */ |
| 108078 | { |
| 108079 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108080 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108081 | } |
| 108082 | break; |
| 108083 | case 172: /* setlist ::= nm EQ expr */ |
| 108084 | { |
| 108085 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr); |
| 108086 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108087 | } |
| 108088 | break; |
| 108089 | case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ |
| 108090 | {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);} |
| 108091 | break; |
| 108092 | case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ |
| 108093 | {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);} |
| 108094 | break; |
| 108095 | case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ |
| 108096 | {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);} |
| 108097 | break; |
| 108098 | case 176: /* insert_cmd ::= INSERT orconf */ |
| 108099 | {yygotominor.yy210 = yymsp[0].minor.yy210;} |
| 108100 | break; |
| 108101 | case 177: /* insert_cmd ::= REPLACE */ |
| 108102 | {yygotominor.yy210 = OE_Replace;} |
| 108103 | break; |
| 108104 | case 178: /* itemlist ::= itemlist COMMA expr */ |
| 108105 | case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241); |
| 108106 | {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);} |
| 108107 | break; |
| 108108 | case 179: /* itemlist ::= expr */ |
| 108109 | case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242); |
| 108110 | {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);} |
| 108111 | break; |
| 108112 | case 182: /* inscollist ::= inscollist COMMA nm */ |
| 108113 | {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);} |
| 108114 | break; |
| 108115 | case 183: /* inscollist ::= nm */ |
| 108116 | {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} |
| 108117 | break; |
| 108118 | case 184: /* expr ::= term */ |
| 108119 | {yygotominor.yy118 = yymsp[0].minor.yy118;} |
| 108120 | break; |
| 108121 | case 185: /* expr ::= LP expr RP */ |
| 108122 | {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} |
| 108123 | break; |
| 108124 | case 186: /* term ::= NULL */ |
| 108125 | case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191); |
| 108126 | case 192: /* term ::= STRING */ yytestcase(yyruleno==192); |
| 108127 | {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} |
| 108128 | break; |
| 108129 | case 187: /* expr ::= id */ |
| 108130 | case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188); |
| 108131 | {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);} |
| 108132 | break; |
| 108133 | case 189: /* expr ::= nm DOT nm */ |
| 108134 | { |
| 108135 | Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 108136 | Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); |
| 108137 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); |
| 108138 | spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); |
| 108139 | } |
| 108140 | break; |
| 108141 | case 190: /* expr ::= nm DOT nm DOT nm */ |
| 108142 | { |
| 108143 | Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); |
| 108144 | Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 108145 | Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); |
| 108146 | Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); |
| 108147 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); |
| 108148 | spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); |
| 108149 | } |
| 108150 | break; |
| 108151 | case 193: /* expr ::= REGISTER */ |
| 108152 | { |
| 108153 | /* When doing a nested parse, one can include terms in an expression |
| 108154 | ** that look like this: #1 #2 ... These terms refer to registers |
| 108155 | ** in the virtual machine. #N is the N-th register. */ |
| 108156 | if( pParse->nested==0 ){ |
| @@ -108160,32 +108488,40 @@ | |
| 108160 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); |
| 108161 | if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable); |
| 108162 | } |
| 108163 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108164 | } |
| 108165 | break; |
| 108166 | case 194: /* expr ::= VARIABLE */ |
| 108167 | { |
| 108168 | spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); |
| 108169 | sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr); |
| 108170 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108171 | } |
| 108172 | break; |
| 108173 | case 195: /* expr ::= expr COLLATE ids */ |
| 108174 | { |
| 108175 | yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0); |
| 108176 | yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; |
| 108177 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108178 | } |
| 108179 | break; |
| 108180 | case 196: /* expr ::= CAST LP expr AS typetoken RP */ |
| 108181 | { |
| 108182 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0); |
| 108183 | spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); |
| 108184 | } |
| 108185 | break; |
| 108186 | case 197: /* expr ::= ID LP distinct exprlist RP */ |
| 108187 | { |
| 108188 | if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ |
| 108189 | sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); |
| 108190 | } |
| 108191 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); |
| @@ -108192,47 +108528,59 @@ | |
| 108192 | spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); |
| 108193 | if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){ |
| 108194 | yygotominor.yy118.pExpr->flags |= EP_Distinct; |
| 108195 | } |
| 108196 | } |
| 108197 | break; |
| 108198 | case 198: /* expr ::= ID LP STAR RP */ |
| 108199 | { |
| 108200 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); |
| 108201 | spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); |
| 108202 | } |
| 108203 | break; |
| 108204 | case 199: /* term ::= CTIME_KW */ |
| 108205 | { |
| 108206 | /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are |
| 108207 | ** treated as functions that return constants */ |
| 108208 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); |
| 108209 | if( yygotominor.yy118.pExpr ){ |
| 108210 | yygotominor.yy118.pExpr->op = TK_CONST_FUNC; |
| 108211 | } |
| 108212 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108213 | } |
| 108214 | break; |
| 108215 | case 200: /* expr ::= expr AND expr */ |
| 108216 | case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201); |
| 108217 | case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202); |
| 108218 | case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203); |
| 108219 | case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204); |
| 108220 | case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205); |
| 108221 | case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206); |
| 108222 | case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207); |
| 108223 | {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);} |
| 108224 | break; |
| 108225 | case 208: /* likeop ::= LIKE_KW */ |
| 108226 | case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210); |
| 108227 | {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;} |
| 108228 | break; |
| 108229 | case 209: /* likeop ::= NOT LIKE_KW */ |
| 108230 | case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211); |
| 108231 | {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;} |
| 108232 | break; |
| 108233 | case 212: /* expr ::= expr likeop expr */ |
| 108234 | { |
| 108235 | ExprList *pList; |
| 108236 | pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr); |
| 108237 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr); |
| 108238 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator); |
| @@ -108239,12 +108587,14 @@ | |
| 108239 | if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108240 | yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; |
| 108241 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108242 | if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; |
| 108243 | } |
| 108244 | break; |
| 108245 | case 213: /* expr ::= expr likeop expr ESCAPE expr */ |
| 108246 | { |
| 108247 | ExprList *pList; |
| 108248 | pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108249 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr); |
| 108250 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); |
| @@ -108252,40 +108602,56 @@ | |
| 108252 | if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108253 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108254 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108255 | if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; |
| 108256 | } |
| 108257 | break; |
| 108258 | case 214: /* expr ::= expr ISNULL|NOTNULL */ |
| 108259 | {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);} |
| 108260 | break; |
| 108261 | case 215: /* expr ::= expr NOT NULL */ |
| 108262 | {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);} |
| 108263 | break; |
| 108264 | case 216: /* expr ::= expr IS expr */ |
| 108265 | { |
| 108266 | spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118); |
| 108267 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL); |
| 108268 | } |
| 108269 | break; |
| 108270 | case 217: /* expr ::= expr IS NOT expr */ |
| 108271 | { |
| 108272 | spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118); |
| 108273 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL); |
| 108274 | } |
| 108275 | break; |
| 108276 | case 218: /* expr ::= NOT expr */ |
| 108277 | case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219); |
| 108278 | {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108279 | break; |
| 108280 | case 220: /* expr ::= MINUS expr */ |
| 108281 | {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108282 | break; |
| 108283 | case 221: /* expr ::= PLUS expr */ |
| 108284 | {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108285 | break; |
| 108286 | case 224: /* expr ::= expr between_op expr AND expr */ |
| 108287 | { |
| 108288 | ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108289 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); |
| 108290 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0); |
| 108291 | if( yygotominor.yy118.pExpr ){ |
| @@ -108295,12 +108661,14 @@ | |
| 108295 | } |
| 108296 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108297 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108298 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108299 | } |
| 108300 | break; |
| 108301 | case 227: /* expr ::= expr in_op LP exprlist RP */ |
| 108302 | { |
| 108303 | if( yymsp[-1].minor.yy322==0 ){ |
| 108304 | /* Expressions of the form |
| 108305 | ** |
| 108306 | ** expr1 IN () |
| @@ -108322,12 +108690,14 @@ | |
| 108322 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108323 | } |
| 108324 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108325 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108326 | } |
| 108327 | break; |
| 108328 | case 228: /* expr ::= LP select RP */ |
| 108329 | { |
| 108330 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); |
| 108331 | if( yygotominor.yy118.pExpr ){ |
| 108332 | yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; |
| 108333 | ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); |
| @@ -108336,12 +108706,14 @@ | |
| 108336 | sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); |
| 108337 | } |
| 108338 | yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z; |
| 108339 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108340 | } |
| 108341 | break; |
| 108342 | case 229: /* expr ::= expr in_op LP select RP */ |
| 108343 | { |
| 108344 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); |
| 108345 | if( yygotominor.yy118.pExpr ){ |
| 108346 | yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; |
| 108347 | ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); |
| @@ -108351,12 +108723,14 @@ | |
| 108351 | } |
| 108352 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108353 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108354 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108355 | } |
| 108356 | break; |
| 108357 | case 230: /* expr ::= expr in_op nm dbnm */ |
| 108358 | { |
| 108359 | SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); |
| 108360 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0); |
| 108361 | if( yygotominor.yy118.pExpr ){ |
| 108362 | yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); |
| @@ -108367,12 +108741,14 @@ | |
| 108367 | } |
| 108368 | if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108369 | yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart; |
| 108370 | yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; |
| 108371 | } |
| 108372 | break; |
| 108373 | case 231: /* expr ::= EXISTS LP select RP */ |
| 108374 | { |
| 108375 | Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); |
| 108376 | if( p ){ |
| 108377 | p->x.pSelect = yymsp[-1].minor.yy387; |
| 108378 | ExprSetProperty(p, EP_xIsSelect); |
| @@ -108381,12 +108757,14 @@ | |
| 108381 | sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); |
| 108382 | } |
| 108383 | yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; |
| 108384 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108385 | } |
| 108386 | break; |
| 108387 | case 232: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 108388 | { |
| 108389 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0); |
| 108390 | if( yygotominor.yy118.pExpr ){ |
| 108391 | yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322; |
| 108392 | sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); |
| @@ -108394,38 +108772,50 @@ | |
| 108394 | sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); |
| 108395 | } |
| 108396 | yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z; |
| 108397 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108398 | } |
| 108399 | break; |
| 108400 | case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 108401 | { |
| 108402 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr); |
| 108403 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108404 | } |
| 108405 | break; |
| 108406 | case 234: /* case_exprlist ::= WHEN expr THEN expr */ |
| 108407 | { |
| 108408 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108409 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108410 | } |
| 108411 | break; |
| 108412 | case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ |
| 108413 | { |
| 108414 | sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, |
| 108415 | sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4, |
| 108416 | &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4); |
| 108417 | } |
| 108418 | break; |
| 108419 | case 244: /* uniqueflag ::= UNIQUE */ |
| 108420 | case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298); |
| 108421 | {yygotominor.yy4 = OE_Abort;} |
| 108422 | break; |
| 108423 | case 245: /* uniqueflag ::= */ |
| 108424 | {yygotominor.yy4 = OE_None;} |
| 108425 | break; |
| 108426 | case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */ |
| 108427 | { |
| 108428 | Expr *p = 0; |
| 108429 | if( yymsp[-1].minor.yy0.n>0 ){ |
| 108430 | p = sqlite3Expr(pParse->db, TK_COLUMN, 0); |
| 108431 | sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); |
| @@ -108433,12 +108823,14 @@ | |
| 108433 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p); |
| 108434 | sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1); |
| 108435 | sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); |
| 108436 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108437 | } |
| 108438 | break; |
| 108439 | case 249: /* idxlist ::= nm collate sortorder */ |
| 108440 | { |
| 108441 | Expr *p = 0; |
| 108442 | if( yymsp[-1].minor.yy0.n>0 ){ |
| 108443 | p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); |
| 108444 | sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); |
| @@ -108446,214 +108838,307 @@ | |
| 108446 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p); |
| 108447 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108448 | sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); |
| 108449 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108450 | } |
| 108451 | break; |
| 108452 | case 250: /* collate ::= */ |
| 108453 | {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} |
| 108454 | break; |
| 108455 | case 252: /* cmd ::= DROP INDEX ifexists fullname */ |
| 108456 | {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);} |
| 108457 | break; |
| 108458 | case 253: /* cmd ::= VACUUM */ |
| 108459 | case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254); |
| 108460 | {sqlite3Vacuum(pParse);} |
| 108461 | break; |
| 108462 | case 255: /* cmd ::= PRAGMA nm dbnm */ |
| 108463 | {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} |
| 108464 | break; |
| 108465 | case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 108466 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} |
| 108467 | break; |
| 108468 | case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 108469 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} |
| 108470 | break; |
| 108471 | case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 108472 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} |
| 108473 | break; |
| 108474 | case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 108475 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} |
| 108476 | break; |
| 108477 | case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 108478 | { |
| 108479 | Token all; |
| 108480 | all.z = yymsp[-3].minor.yy0.z; |
| 108481 | all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; |
| 108482 | sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all); |
| 108483 | } |
| 108484 | break; |
| 108485 | case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 108486 | { |
| 108487 | sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4); |
| 108488 | yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); |
| 108489 | } |
| 108490 | break; |
| 108491 | case 272: /* trigger_time ::= BEFORE */ |
| 108492 | case 275: /* trigger_time ::= */ yytestcase(yyruleno==275); |
| 108493 | { yygotominor.yy4 = TK_BEFORE; } |
| 108494 | break; |
| 108495 | case 273: /* trigger_time ::= AFTER */ |
| 108496 | { yygotominor.yy4 = TK_AFTER; } |
| 108497 | break; |
| 108498 | case 274: /* trigger_time ::= INSTEAD OF */ |
| 108499 | { yygotominor.yy4 = TK_INSTEAD;} |
| 108500 | break; |
| 108501 | case 276: /* trigger_event ::= DELETE|INSERT */ |
| 108502 | case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277); |
| 108503 | {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;} |
| 108504 | break; |
| 108505 | case 278: /* trigger_event ::= UPDATE OF inscollist */ |
| 108506 | {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;} |
| 108507 | break; |
| 108508 | case 281: /* when_clause ::= */ |
| 108509 | case 303: /* key_opt ::= */ yytestcase(yyruleno==303); |
| 108510 | { yygotominor.yy314 = 0; } |
| 108511 | break; |
| 108512 | case 282: /* when_clause ::= WHEN expr */ |
| 108513 | case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304); |
| 108514 | { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; } |
| 108515 | break; |
| 108516 | case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 108517 | { |
| 108518 | assert( yymsp[-2].minor.yy203!=0 ); |
| 108519 | yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203; |
| 108520 | yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203; |
| 108521 | yygotominor.yy203 = yymsp[-2].minor.yy203; |
| 108522 | } |
| 108523 | break; |
| 108524 | case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 108525 | { |
| 108526 | assert( yymsp[-1].minor.yy203!=0 ); |
| 108527 | yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203; |
| 108528 | yygotominor.yy203 = yymsp[-1].minor.yy203; |
| 108529 | } |
| 108530 | break; |
| 108531 | case 286: /* trnm ::= nm DOT nm */ |
| 108532 | { |
| 108533 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 108534 | sqlite3ErrorMsg(pParse, |
| 108535 | "qualified table names are not allowed on INSERT, UPDATE, and DELETE " |
| 108536 | "statements within triggers"); |
| 108537 | } |
| 108538 | break; |
| 108539 | case 288: /* tridxby ::= INDEXED BY nm */ |
| 108540 | { |
| 108541 | sqlite3ErrorMsg(pParse, |
| 108542 | "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " |
| 108543 | "within triggers"); |
| 108544 | } |
| 108545 | break; |
| 108546 | case 289: /* tridxby ::= NOT INDEXED */ |
| 108547 | { |
| 108548 | sqlite3ErrorMsg(pParse, |
| 108549 | "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " |
| 108550 | "within triggers"); |
| 108551 | } |
| 108552 | break; |
| 108553 | case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */ |
| 108554 | { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); } |
| 108555 | break; |
| 108556 | case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */ |
| 108557 | {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);} |
| 108558 | break; |
| 108559 | case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ |
| 108560 | {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);} |
| 108561 | break; |
| 108562 | case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ |
| 108563 | {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);} |
| 108564 | break; |
| 108565 | case 294: /* trigger_cmd ::= select */ |
| 108566 | {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); } |
| 108567 | break; |
| 108568 | case 295: /* expr ::= RAISE LP IGNORE RP */ |
| 108569 | { |
| 108570 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); |
| 108571 | if( yygotominor.yy118.pExpr ){ |
| 108572 | yygotominor.yy118.pExpr->affinity = OE_Ignore; |
| 108573 | } |
| 108574 | yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; |
| 108575 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108576 | } |
| 108577 | break; |
| 108578 | case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 108579 | { |
| 108580 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); |
| 108581 | if( yygotominor.yy118.pExpr ) { |
| 108582 | yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4; |
| 108583 | } |
| 108584 | yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z; |
| 108585 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108586 | } |
| 108587 | break; |
| 108588 | case 297: /* raisetype ::= ROLLBACK */ |
| 108589 | {yygotominor.yy4 = OE_Rollback;} |
| 108590 | break; |
| 108591 | case 299: /* raisetype ::= FAIL */ |
| 108592 | {yygotominor.yy4 = OE_Fail;} |
| 108593 | break; |
| 108594 | case 300: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 108595 | { |
| 108596 | sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4); |
| 108597 | } |
| 108598 | break; |
| 108599 | case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 108600 | { |
| 108601 | sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314); |
| 108602 | } |
| 108603 | break; |
| 108604 | case 302: /* cmd ::= DETACH database_kw_opt expr */ |
| 108605 | { |
| 108606 | sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr); |
| 108607 | } |
| 108608 | break; |
| 108609 | case 307: /* cmd ::= REINDEX */ |
| 108610 | {sqlite3Reindex(pParse, 0, 0);} |
| 108611 | break; |
| 108612 | case 308: /* cmd ::= REINDEX nm dbnm */ |
| 108613 | {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 108614 | break; |
| 108615 | case 309: /* cmd ::= ANALYZE */ |
| 108616 | {sqlite3Analyze(pParse, 0, 0);} |
| 108617 | break; |
| 108618 | case 310: /* cmd ::= ANALYZE nm dbnm */ |
| 108619 | {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 108620 | break; |
| 108621 | case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 108622 | { |
| 108623 | sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0); |
| 108624 | } |
| 108625 | break; |
| 108626 | case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ |
| 108627 | { |
| 108628 | sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); |
| 108629 | } |
| 108630 | break; |
| 108631 | case 313: /* add_column_fullname ::= fullname */ |
| 108632 | { |
| 108633 | pParse->db->lookaside.bEnabled = 0; |
| 108634 | sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259); |
| 108635 | } |
| 108636 | break; |
| 108637 | case 316: /* cmd ::= create_vtab */ |
| 108638 | {sqlite3VtabFinishParse(pParse,0);} |
| 108639 | break; |
| 108640 | case 317: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 108641 | {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} |
| 108642 | break; |
| 108643 | case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */ |
| 108644 | { |
| 108645 | sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); |
| 108646 | } |
| 108647 | break; |
| 108648 | case 321: /* vtabarg ::= */ |
| 108649 | {sqlite3VtabArgInit(pParse);} |
| 108650 | break; |
| 108651 | case 323: /* vtabargtoken ::= ANY */ |
| 108652 | case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324); |
| 108653 | case 325: /* lp ::= LP */ yytestcase(yyruleno==325); |
| 108654 | {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} |
| 108655 | break; |
| 108656 | default: |
| 108657 | /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); |
| 108658 | /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1); |
| 108659 | /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2); |
| @@ -108751,15 +109236,17 @@ | |
| 108751 | int yymajor, /* The major type of the error token */ |
| 108752 | YYMINORTYPE yyminor /* The minor type of the error token */ |
| 108753 | ){ |
| 108754 | sqlite3ParserARG_FETCH; |
| 108755 | #define TOKEN (yyminor.yy0) |
| 108756 | |
| 108757 | UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */ |
| 108758 | assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */ |
| 108759 | sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); |
| 108760 | pParse->parseError = 1; |
| 108761 | sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ |
| 108762 | } |
| 108763 | |
| 108764 | /* |
| 108765 | ** The following is executed when the parser accepts |
| @@ -108949,10 +109436,11 @@ | |
| 108949 | return; |
| 108950 | } |
| 108951 | |
| 108952 | /************** End of parse.c ***********************************************/ |
| 108953 | /************** Begin file tokenize.c ****************************************/ |
| 108954 | /* |
| 108955 | ** 2001 September 15 |
| 108956 | ** |
| 108957 | ** The author disclaims copyright to this source code. In place of |
| 108958 | ** a legal notice, here is a blessing: |
| @@ -109014,10 +109502,11 @@ | |
| 109014 | ** named keywordhash.h and then included into this source file by |
| 109015 | ** the #include below. |
| 109016 | */ |
| 109017 | /************** Include keywordhash.h in the middle of tokenize.c ************/ |
| 109018 | /************** Begin file keywordhash.h *************************************/ |
| 109019 | /***** This file contains automatically generated code ****** |
| 109020 | ** |
| 109021 | ** The code in this file has been automatically generated by |
| 109022 | ** |
| 109023 | ** sqlite/tool/mkkeywordhash.c |
| @@ -109287,10 +109776,11 @@ | |
| 109287 | } |
| 109288 | #define SQLITE_N_KEYWORD 121 |
| 109289 | |
| 109290 | /************** End of keywordhash.h *****************************************/ |
| 109291 | /************** Continuing where we left off in tokenize.c *******************/ |
| 109292 | |
| 109293 | |
| 109294 | /* |
| 109295 | ** If X is a character that can be used in an identifier then |
| 109296 | ** IdChar(X) will be true. Otherwise it is false. |
| @@ -109751,10 +110241,11 @@ | |
| 109751 | return nErr; |
| 109752 | } |
| 109753 | |
| 109754 | /************** End of tokenize.c ********************************************/ |
| 109755 | /************** Begin file complete.c ****************************************/ |
| 109756 | /* |
| 109757 | ** 2001 September 15 |
| 109758 | ** |
| 109759 | ** The author disclaims copyright to this source code. In place of |
| 109760 | ** a legal notice, here is a blessing: |
| @@ -110036,10 +110527,11 @@ | |
| 110036 | #endif /* SQLITE_OMIT_UTF16 */ |
| 110037 | #endif /* SQLITE_OMIT_COMPLETE */ |
| 110038 | |
| 110039 | /************** End of complete.c ********************************************/ |
| 110040 | /************** Begin file main.c ********************************************/ |
| 110041 | /* |
| 110042 | ** 2001 September 15 |
| 110043 | ** |
| 110044 | ** The author disclaims copyright to this source code. In place of |
| 110045 | ** a legal notice, here is a blessing: |
| @@ -110056,10 +110548,11 @@ | |
| 110056 | */ |
| 110057 | |
| 110058 | #ifdef SQLITE_ENABLE_FTS3 |
| 110059 | /************** Include fts3.h in the middle of main.c ***********************/ |
| 110060 | /************** Begin file fts3.h ********************************************/ |
| 110061 | /* |
| 110062 | ** 2006 Oct 10 |
| 110063 | ** |
| 110064 | ** The author disclaims copyright to this source code. In place of |
| 110065 | ** a legal notice, here is a blessing: |
| @@ -110084,14 +110577,16 @@ | |
| 110084 | } /* extern "C" */ |
| 110085 | #endif /* __cplusplus */ |
| 110086 | |
| 110087 | /************** End of fts3.h ************************************************/ |
| 110088 | /************** Continuing where we left off in main.c ***********************/ |
| 110089 | #endif |
| 110090 | #ifdef SQLITE_ENABLE_RTREE |
| 110091 | /************** Include rtree.h in the middle of main.c **********************/ |
| 110092 | /************** Begin file rtree.h *******************************************/ |
| 110093 | /* |
| 110094 | ** 2008 May 26 |
| 110095 | ** |
| 110096 | ** The author disclaims copyright to this source code. In place of |
| 110097 | ** a legal notice, here is a blessing: |
| @@ -110116,14 +110611,16 @@ | |
| 110116 | } /* extern "C" */ |
| 110117 | #endif /* __cplusplus */ |
| 110118 | |
| 110119 | /************** End of rtree.h ***********************************************/ |
| 110120 | /************** Continuing where we left off in main.c ***********************/ |
| 110121 | #endif |
| 110122 | #ifdef SQLITE_ENABLE_ICU |
| 110123 | /************** Include sqliteicu.h in the middle of main.c ******************/ |
| 110124 | /************** Begin file sqliteicu.h ***************************************/ |
| 110125 | /* |
| 110126 | ** 2008 May 26 |
| 110127 | ** |
| 110128 | ** The author disclaims copyright to this source code. In place of |
| 110129 | ** a legal notice, here is a blessing: |
| @@ -110149,10 +110646,11 @@ | |
| 110149 | #endif /* __cplusplus */ |
| 110150 | |
| 110151 | |
| 110152 | /************** End of sqliteicu.h *******************************************/ |
| 110153 | /************** Continuing where we left off in main.c ***********************/ |
| 110154 | #endif |
| 110155 | |
| 110156 | #ifndef SQLITE_AMALGAMATION |
| 110157 | /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant |
| 110158 | ** contains the text of SQLITE_VERSION macro. |
| @@ -113079,10 +113577,11 @@ | |
| 113079 | return 0; |
| 113080 | } |
| 113081 | |
| 113082 | /************** End of main.c ************************************************/ |
| 113083 | /************** Begin file notify.c ******************************************/ |
| 113084 | /* |
| 113085 | ** 2009 March 3 |
| 113086 | ** |
| 113087 | ** The author disclaims copyright to this source code. In place of |
| 113088 | ** a legal notice, here is a blessing: |
| @@ -113412,10 +113911,11 @@ | |
| 113412 | } |
| 113413 | #endif |
| 113414 | |
| 113415 | /************** End of notify.c **********************************************/ |
| 113416 | /************** Begin file fts3.c ********************************************/ |
| 113417 | /* |
| 113418 | ** 2006 Oct 10 |
| 113419 | ** |
| 113420 | ** The author disclaims copyright to this source code. In place of |
| 113421 | ** a legal notice, here is a blessing: |
| @@ -113708,10 +114208,11 @@ | |
| 113708 | ** into a single segment. |
| 113709 | */ |
| 113710 | |
| 113711 | /************** Include fts3Int.h in the middle of fts3.c ********************/ |
| 113712 | /************** Begin file fts3Int.h *****************************************/ |
| 113713 | /* |
| 113714 | ** 2009 Nov 12 |
| 113715 | ** |
| 113716 | ** The author disclaims copyright to this source code. In place of |
| 113717 | ** a legal notice, here is a blessing: |
| @@ -113746,10 +114247,11 @@ | |
| 113746 | SQLITE_API extern const sqlite3_api_routines *sqlite3_api; |
| 113747 | #endif |
| 113748 | |
| 113749 | /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/ |
| 113750 | /************** Begin file fts3_tokenizer.h **********************************/ |
| 113751 | /* |
| 113752 | ** 2006 July 10 |
| 113753 | ** |
| 113754 | ** The author disclaims copyright to this source code. |
| 113755 | ** |
| @@ -113900,12 +114402,14 @@ | |
| 113900 | |
| 113901 | #endif /* _FTS3_TOKENIZER_H_ */ |
| 113902 | |
| 113903 | /************** End of fts3_tokenizer.h **************************************/ |
| 113904 | /************** Continuing where we left off in fts3Int.h ********************/ |
| 113905 | /************** Include fts3_hash.h in the middle of fts3Int.h ***************/ |
| 113906 | /************** Begin file fts3_hash.h ***************************************/ |
| 113907 | /* |
| 113908 | ** 2001 September 22 |
| 113909 | ** |
| 113910 | ** The author disclaims copyright to this source code. In place of |
| 113911 | ** a legal notice, here is a blessing: |
| @@ -114017,10 +114521,11 @@ | |
| 114017 | |
| 114018 | #endif /* _FTS3_HASH_H_ */ |
| 114019 | |
| 114020 | /************** End of fts3_hash.h *******************************************/ |
| 114021 | /************** Continuing where we left off in fts3Int.h ********************/ |
| 114022 | |
| 114023 | /* |
| 114024 | ** This constant controls how often segments are merged. Once there are |
| 114025 | ** FTS3_MERGE_COUNT segments of level N, they are merged into a single |
| 114026 | ** segment of level N+1. |
| @@ -114493,10 +114998,11 @@ | |
| 114493 | #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */ |
| 114494 | #endif /* _FTSINT_H */ |
| 114495 | |
| 114496 | /************** End of fts3Int.h *********************************************/ |
| 114497 | /************** Continuing where we left off in fts3.c ***********************/ |
| 114498 | #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) |
| 114499 | |
| 114500 | #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE) |
| 114501 | # define SQLITE_CORE 1 |
| 114502 | #endif |
| @@ -116264,11 +116770,41 @@ | |
| 116264 | char *aOut; |
| 116265 | int bFirstOut = 0; |
| 116266 | |
| 116267 | *paOut = 0; |
| 116268 | *pnOut = 0; |
| 116269 | aOut = sqlite3_malloc(n1+n2); |
| 116270 | if( !aOut ) return SQLITE_NOMEM; |
| 116271 | |
| 116272 | p = aOut; |
| 116273 | fts3GetDeltaVarint3(&p1, pEnd1, 0, &i1); |
| 116274 | fts3GetDeltaVarint3(&p2, pEnd2, 0, &i2); |
| @@ -116291,10 +116827,11 @@ | |
| 116291 | } |
| 116292 | } |
| 116293 | |
| 116294 | *paOut = aOut; |
| 116295 | *pnOut = (p-aOut); |
| 116296 | return SQLITE_OK; |
| 116297 | } |
| 116298 | |
| 116299 | /* |
| 116300 | ** This function does a "phrase" merge of two doclists. In a phrase merge, |
| @@ -119011,10 +119548,11 @@ | |
| 119011 | |
| 119012 | #endif |
| 119013 | |
| 119014 | /************** End of fts3.c ************************************************/ |
| 119015 | /************** Begin file fts3_aux.c ****************************************/ |
| 119016 | /* |
| 119017 | ** 2011 Jan 27 |
| 119018 | ** |
| 119019 | ** The author disclaims copyright to this source code. In place of |
| 119020 | ** a legal notice, here is a blessing: |
| @@ -119487,10 +120025,11 @@ | |
| 119487 | |
| 119488 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 119489 | |
| 119490 | /************** End of fts3_aux.c ********************************************/ |
| 119491 | /************** Begin file fts3_expr.c ***************************************/ |
| 119492 | /* |
| 119493 | ** 2008 Nov 28 |
| 119494 | ** |
| 119495 | ** The author disclaims copyright to this source code. In place of |
| 119496 | ** a legal notice, here is a blessing: |
| @@ -120453,10 +120992,11 @@ | |
| 120453 | #endif |
| 120454 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 120455 | |
| 120456 | /************** End of fts3_expr.c *******************************************/ |
| 120457 | /************** Begin file fts3_hash.c ***************************************/ |
| 120458 | /* |
| 120459 | ** 2001 September 22 |
| 120460 | ** |
| 120461 | ** The author disclaims copyright to this source code. In place of |
| 120462 | ** a legal notice, here is a blessing: |
| @@ -120837,10 +121377,11 @@ | |
| 120837 | |
| 120838 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 120839 | |
| 120840 | /************** End of fts3_hash.c *******************************************/ |
| 120841 | /************** Begin file fts3_porter.c *************************************/ |
| 120842 | /* |
| 120843 | ** 2006 September 30 |
| 120844 | ** |
| 120845 | ** The author disclaims copyright to this source code. In place of |
| 120846 | ** a legal notice, here is a blessing: |
| @@ -121483,10 +122024,11 @@ | |
| 121483 | |
| 121484 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 121485 | |
| 121486 | /************** End of fts3_porter.c *****************************************/ |
| 121487 | /************** Begin file fts3_tokenizer.c **********************************/ |
| 121488 | /* |
| 121489 | ** 2007 June 22 |
| 121490 | ** |
| 121491 | ** The author disclaims copyright to this source code. In place of |
| 121492 | ** a legal notice, here is a blessing: |
| @@ -121974,10 +122516,11 @@ | |
| 121974 | |
| 121975 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 121976 | |
| 121977 | /************** End of fts3_tokenizer.c **************************************/ |
| 121978 | /************** Begin file fts3_tokenizer1.c *********************************/ |
| 121979 | /* |
| 121980 | ** 2006 Oct 10 |
| 121981 | ** |
| 121982 | ** The author disclaims copyright to this source code. In place of |
| 121983 | ** a legal notice, here is a blessing: |
| @@ -122208,10 +122751,11 @@ | |
| 122208 | |
| 122209 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 122210 | |
| 122211 | /************** End of fts3_tokenizer1.c *************************************/ |
| 122212 | /************** Begin file fts3_write.c **************************************/ |
| 122213 | /* |
| 122214 | ** 2009 Oct 23 |
| 122215 | ** |
| 122216 | ** The author disclaims copyright to this source code. In place of |
| 122217 | ** a legal notice, here is a blessing: |
| @@ -125478,10 +126022,11 @@ | |
| 125478 | |
| 125479 | #endif |
| 125480 | |
| 125481 | /************** End of fts3_write.c ******************************************/ |
| 125482 | /************** Begin file fts3_snippet.c ************************************/ |
| 125483 | /* |
| 125484 | ** 2009 Oct 23 |
| 125485 | ** |
| 125486 | ** The author disclaims copyright to this source code. In place of |
| 125487 | ** a legal notice, here is a blessing: |
| @@ -126979,10 +127524,11 @@ | |
| 126979 | |
| 126980 | #endif |
| 126981 | |
| 126982 | /************** End of fts3_snippet.c ****************************************/ |
| 126983 | /************** Begin file rtree.c *******************************************/ |
| 126984 | /* |
| 126985 | ** 2001 September 15 |
| 126986 | ** |
| 126987 | ** The author disclaims copyright to this source code. In place of |
| 126988 | ** a legal notice, here is a blessing: |
| @@ -130260,10 +130806,11 @@ | |
| 130260 | |
| 130261 | #endif |
| 130262 | |
| 130263 | /************** End of rtree.c ***********************************************/ |
| 130264 | /************** Begin file icu.c *********************************************/ |
| 130265 | /* |
| 130266 | ** 2007 May 6 |
| 130267 | ** |
| 130268 | ** The author disclaims copyright to this source code. In place of |
| 130269 | ** a legal notice, here is a blessing: |
| @@ -130762,10 +131309,11 @@ | |
| 130762 | |
| 130763 | #endif |
| 130764 | |
| 130765 | /************** End of icu.c *************************************************/ |
| 130766 | /************** Begin file fts3_icu.c ****************************************/ |
| 130767 | /* |
| 130768 | ** 2007 June 22 |
| 130769 | ** |
| 130770 | ** The author disclaims copyright to this source code. In place of |
| 130771 | ** a legal notice, here is a blessing: |
| 130772 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -24,10 +24,11 @@ | |
| 24 | #endif |
| 25 | #ifndef SQLITE_API |
| 26 | # define SQLITE_API |
| 27 | #endif |
| 28 | /************** Begin file sqliteInt.h ***************************************/ |
| 29 | #line 1 "tsrc/sqliteInt.h" |
| 30 | /* |
| 31 | ** 2001 September 15 |
| 32 | ** |
| 33 | ** The author disclaims copyright to this source code. In place of |
| 34 | ** a legal notice, here is a blessing: |
| @@ -78,10 +79,11 @@ | |
| 79 | #include "config.h" |
| 80 | #endif |
| 81 | |
| 82 | /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/ |
| 83 | /************** Begin file sqliteLimit.h *************************************/ |
| 84 | #line 1 "tsrc/sqliteLimit.h" |
| 85 | /* |
| 86 | ** 2007 May 7 |
| 87 | ** |
| 88 | ** The author disclaims copyright to this source code. In place of |
| 89 | ** a legal notice, here is a blessing: |
| @@ -289,10 +291,11 @@ | |
| 291 | # define SQLITE_MAX_TRIGGER_DEPTH 1000 |
| 292 | #endif |
| 293 | |
| 294 | /************** End of sqliteLimit.h *****************************************/ |
| 295 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 296 | #line 54 "tsrc/sqliteInt.h" |
| 297 | |
| 298 | /* Disable nuisance warnings on Borland compilers */ |
| 299 | #if defined(__BORLANDC__) |
| 300 | #pragma warn -rch /* unreachable code */ |
| 301 | #pragma warn -ccc /* Condition is always true or false */ |
| @@ -545,10 +548,11 @@ | |
| 548 | # define unlikely(X) !!(X) |
| 549 | #endif |
| 550 | |
| 551 | /************** Include sqlite3.h in the middle of sqliteInt.h ***************/ |
| 552 | /************** Begin file sqlite3.h *****************************************/ |
| 553 | #line 1 "tsrc/sqlite3.h" |
| 554 | /* |
| 555 | ** 2001 September 15 |
| 556 | ** |
| 557 | ** The author disclaims copyright to this source code. In place of |
| 558 | ** a legal notice, here is a blessing: |
| @@ -656,11 +660,11 @@ | |
| 660 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 661 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 662 | */ |
| 663 | #define SQLITE_VERSION "3.7.8" |
| 664 | #define SQLITE_VERSION_NUMBER 3007008 |
| 665 | #define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2" |
| 666 | |
| 667 | /* |
| 668 | ** CAPI3REF: Run-Time Library Version Numbers |
| 669 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 670 | ** |
| @@ -7305,12 +7309,14 @@ | |
| 7309 | #endif /* ifndef _SQLITE3RTREE_H_ */ |
| 7310 | |
| 7311 | |
| 7312 | /************** End of sqlite3.h *********************************************/ |
| 7313 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7314 | #line 309 "tsrc/sqliteInt.h" |
| 7315 | /************** Include hash.h in the middle of sqliteInt.h ******************/ |
| 7316 | /************** Begin file hash.h ********************************************/ |
| 7317 | #line 1 "tsrc/hash.h" |
| 7318 | /* |
| 7319 | ** 2001 September 22 |
| 7320 | ** |
| 7321 | ** The author disclaims copyright to this source code. In place of |
| 7322 | ** a legal notice, here is a blessing: |
| @@ -7406,12 +7412,14 @@ | |
| 7412 | |
| 7413 | #endif /* _SQLITE_HASH_H_ */ |
| 7414 | |
| 7415 | /************** End of hash.h ************************************************/ |
| 7416 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7417 | #line 310 "tsrc/sqliteInt.h" |
| 7418 | /************** Include parse.h in the middle of sqliteInt.h *****************/ |
| 7419 | /************** Begin file parse.h *******************************************/ |
| 7420 | #line 1 "tsrc/parse.h" |
| 7421 | #define TK_SEMI 1 |
| 7422 | #define TK_EXPLAIN 2 |
| 7423 | #define TK_QUERY 3 |
| 7424 | #define TK_PLAN 4 |
| 7425 | #define TK_BEGIN 5 |
| @@ -7568,10 +7576,11 @@ | |
| 7576 | #define TK_UMINUS 156 |
| 7577 | #define TK_UPLUS 157 |
| 7578 | |
| 7579 | /************** End of parse.h ***********************************************/ |
| 7580 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 7581 | #line 311 "tsrc/sqliteInt.h" |
| 7582 | #include <stdio.h> |
| 7583 | #include <stdlib.h> |
| 7584 | #include <string.h> |
| 7585 | #include <assert.h> |
| 7586 | #include <stddef.h> |
| @@ -7911,10 +7920,11 @@ | |
| 7920 | ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque |
| 7921 | ** pointer types (i.e. FuncDef) defined above. |
| 7922 | */ |
| 7923 | /************** Include btree.h in the middle of sqliteInt.h *****************/ |
| 7924 | /************** Begin file btree.h *******************************************/ |
| 7925 | #line 1 "tsrc/btree.h" |
| 7926 | /* |
| 7927 | ** 2001 September 15 |
| 7928 | ** |
| 7929 | ** The author disclaims copyright to this source code. In place of |
| 7930 | ** a legal notice, here is a blessing: |
| @@ -8155,12 +8165,14 @@ | |
| 8165 | |
| 8166 | #endif /* _BTREE_H_ */ |
| 8167 | |
| 8168 | /************** End of btree.h ***********************************************/ |
| 8169 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8170 | #line 653 "tsrc/sqliteInt.h" |
| 8171 | /************** Include vdbe.h in the middle of sqliteInt.h ******************/ |
| 8172 | /************** Begin file vdbe.h ********************************************/ |
| 8173 | #line 1 "tsrc/vdbe.h" |
| 8174 | /* |
| 8175 | ** 2001 September 15 |
| 8176 | ** |
| 8177 | ** The author disclaims copyright to this source code. In place of |
| 8178 | ** a legal notice, here is a blessing: |
| @@ -8321,10 +8333,11 @@ | |
| 8333 | ** The makefile scans the vdbe.c source file and creates the "opcodes.h" |
| 8334 | ** header file that defines a number for each opcode used by the VDBE. |
| 8335 | */ |
| 8336 | /************** Include opcodes.h in the middle of vdbe.h ********************/ |
| 8337 | /************** Begin file opcodes.h *****************************************/ |
| 8338 | #line 1 "tsrc/opcodes.h" |
| 8339 | /* Automatically generated. Do not edit */ |
| 8340 | /* See the mkopcodeh.awk script for details */ |
| 8341 | #define OP_Goto 1 |
| 8342 | #define OP_Gosub 2 |
| 8343 | #define OP_Return 3 |
| @@ -8508,10 +8521,11 @@ | |
| 8521 | /* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\ |
| 8522 | /* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,} |
| 8523 | |
| 8524 | /************** End of opcodes.h *********************************************/ |
| 8525 | /************** Continuing where we left off in vdbe.h ***********************/ |
| 8526 | #line 164 "tsrc/vdbe.h" |
| 8527 | |
| 8528 | /* |
| 8529 | ** Prototypes for the VDBE interface. See comments on the implementation |
| 8530 | ** for a description of what each of these routines does. |
| 8531 | */ |
| @@ -8559,13 +8573,13 @@ | |
| 8573 | SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int); |
| 8574 | #ifndef SQLITE_OMIT_TRACE |
| 8575 | SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*); |
| 8576 | #endif |
| 8577 | |
| 8578 | SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*); |
| 8579 | SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*); |
| 8580 | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **); |
| 8581 | |
| 8582 | #ifndef SQLITE_OMIT_TRIGGER |
| 8583 | SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *); |
| 8584 | #endif |
| 8585 | |
| @@ -8582,12 +8596,14 @@ | |
| 8596 | |
| 8597 | #endif |
| 8598 | |
| 8599 | /************** End of vdbe.h ************************************************/ |
| 8600 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8601 | #line 654 "tsrc/sqliteInt.h" |
| 8602 | /************** Include pager.h in the middle of sqliteInt.h *****************/ |
| 8603 | /************** Begin file pager.h *******************************************/ |
| 8604 | #line 1 "tsrc/pager.h" |
| 8605 | /* |
| 8606 | ** 2001 September 15 |
| 8607 | ** |
| 8608 | ** The author disclaims copyright to this source code. In place of |
| 8609 | ** a legal notice, here is a blessing: |
| @@ -8769,12 +8785,14 @@ | |
| 8785 | |
| 8786 | #endif /* _PAGER_H_ */ |
| 8787 | |
| 8788 | /************** End of pager.h ***********************************************/ |
| 8789 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8790 | #line 655 "tsrc/sqliteInt.h" |
| 8791 | /************** Include pcache.h in the middle of sqliteInt.h ****************/ |
| 8792 | /************** Begin file pcache.h ******************************************/ |
| 8793 | #line 1 "tsrc/pcache.h" |
| 8794 | /* |
| 8795 | ** 2008 August 05 |
| 8796 | ** |
| 8797 | ** The author disclaims copyright to this source code. In place of |
| 8798 | ** a legal notice, here is a blessing: |
| @@ -8929,13 +8947,15 @@ | |
| 8947 | |
| 8948 | #endif /* _PCACHE_H_ */ |
| 8949 | |
| 8950 | /************** End of pcache.h **********************************************/ |
| 8951 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 8952 | #line 656 "tsrc/sqliteInt.h" |
| 8953 | |
| 8954 | /************** Include os.h in the middle of sqliteInt.h ********************/ |
| 8955 | /************** Begin file os.h **********************************************/ |
| 8956 | #line 1 "tsrc/os.h" |
| 8957 | /* |
| 8958 | ** 2001 September 16 |
| 8959 | ** |
| 8960 | ** The author disclaims copyright to this source code. In place of |
| 8961 | ** a legal notice, here is a blessing: |
| @@ -9214,12 +9234,14 @@ | |
| 9234 | |
| 9235 | #endif /* _SQLITE_OS_H_ */ |
| 9236 | |
| 9237 | /************** End of os.h **************************************************/ |
| 9238 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 9239 | #line 658 "tsrc/sqliteInt.h" |
| 9240 | /************** Include mutex.h in the middle of sqliteInt.h *****************/ |
| 9241 | /************** Begin file mutex.h *******************************************/ |
| 9242 | #line 1 "tsrc/mutex.h" |
| 9243 | /* |
| 9244 | ** 2007 August 28 |
| 9245 | ** |
| 9246 | ** The author disclaims copyright to this source code. In place of |
| 9247 | ** a legal notice, here is a blessing: |
| @@ -9290,10 +9312,11 @@ | |
| 9312 | #define sqlite3MutexEnd() |
| 9313 | #endif /* defined(SQLITE_MUTEX_OMIT) */ |
| 9314 | |
| 9315 | /************** End of mutex.h ***********************************************/ |
| 9316 | /************** Continuing where we left off in sqliteInt.h ******************/ |
| 9317 | #line 659 "tsrc/sqliteInt.h" |
| 9318 | |
| 9319 | |
| 9320 | /* |
| 9321 | ** Each database file to be accessed by the system is an instance |
| 9322 | ** of the following structure. There are normally two of these structures |
| @@ -11892,10 +11915,11 @@ | |
| 11915 | |
| 11916 | #endif /* _SQLITEINT_H_ */ |
| 11917 | |
| 11918 | /************** End of sqliteInt.h *******************************************/ |
| 11919 | /************** Begin file global.c ******************************************/ |
| 11920 | #line 1 "tsrc/global.c" |
| 11921 | /* |
| 11922 | ** 2008 June 13 |
| 11923 | ** |
| 11924 | ** The author disclaims copyright to this source code. In place of |
| 11925 | ** a legal notice, here is a blessing: |
| @@ -12114,10 +12138,11 @@ | |
| 12138 | */ |
| 12139 | SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER; |
| 12140 | |
| 12141 | /************** End of global.c **********************************************/ |
| 12142 | /************** Begin file ctime.c *******************************************/ |
| 12143 | #line 1 "tsrc/ctime.c" |
| 12144 | /* |
| 12145 | ** 2010 February 23 |
| 12146 | ** |
| 12147 | ** The author disclaims copyright to this source code. In place of |
| 12148 | ** a legal notice, here is a blessing: |
| @@ -12518,10 +12543,11 @@ | |
| 12543 | |
| 12544 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 12545 | |
| 12546 | /************** End of ctime.c ***********************************************/ |
| 12547 | /************** Begin file status.c ******************************************/ |
| 12548 | #line 1 "tsrc/status.c" |
| 12549 | /* |
| 12550 | ** 2008 June 18 |
| 12551 | ** |
| 12552 | ** The author disclaims copyright to this source code. In place of |
| 12553 | ** a legal notice, here is a blessing: |
| @@ -12535,10 +12561,11 @@ | |
| 12561 | ** This module implements the sqlite3_status() interface and related |
| 12562 | ** functionality. |
| 12563 | */ |
| 12564 | /************** Include vdbeInt.h in the middle of status.c ******************/ |
| 12565 | /************** Begin file vdbeInt.h *****************************************/ |
| 12566 | #line 1 "tsrc/vdbeInt.h" |
| 12567 | /* |
| 12568 | ** 2003 September 6 |
| 12569 | ** |
| 12570 | ** The author disclaims copyright to this source code. In place of |
| 12571 | ** a legal notice, here is a blessing: |
| @@ -12986,10 +13013,11 @@ | |
| 13013 | |
| 13014 | #endif /* !defined(_VDBEINT_H_) */ |
| 13015 | |
| 13016 | /************** End of vdbeInt.h *********************************************/ |
| 13017 | /************** Continuing where we left off in status.c *********************/ |
| 13018 | #line 18 "tsrc/status.c" |
| 13019 | |
| 13020 | /* |
| 13021 | ** Variables in which to record status information. |
| 13022 | */ |
| 13023 | typedef struct sqlite3StatType sqlite3StatType; |
| @@ -13199,10 +13227,11 @@ | |
| 13227 | return rc; |
| 13228 | } |
| 13229 | |
| 13230 | /************** End of status.c **********************************************/ |
| 13231 | /************** Begin file date.c ********************************************/ |
| 13232 | #line 1 "tsrc/date.c" |
| 13233 | /* |
| 13234 | ** 2003 October 31 |
| 13235 | ** |
| 13236 | ** The author disclaims copyright to this source code. In place of |
| 13237 | ** a legal notice, here is a blessing: |
| @@ -14326,10 +14355,11 @@ | |
| 14355 | } |
| 14356 | } |
| 14357 | |
| 14358 | /************** End of date.c ************************************************/ |
| 14359 | /************** Begin file os.c **********************************************/ |
| 14360 | #line 1 "tsrc/os.c" |
| 14361 | /* |
| 14362 | ** 2005 November 29 |
| 14363 | ** |
| 14364 | ** The author disclaims copyright to this source code. In place of |
| 14365 | ** a legal notice, here is a blessing: |
| @@ -14659,10 +14689,11 @@ | |
| 14689 | return SQLITE_OK; |
| 14690 | } |
| 14691 | |
| 14692 | /************** End of os.c **************************************************/ |
| 14693 | /************** Begin file fault.c *******************************************/ |
| 14694 | #line 1 "tsrc/fault.c" |
| 14695 | /* |
| 14696 | ** 2008 Jan 22 |
| 14697 | ** |
| 14698 | ** The author disclaims copyright to this source code. In place of |
| 14699 | ** a legal notice, here is a blessing: |
| @@ -14748,10 +14779,11 @@ | |
| 14779 | |
| 14780 | #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */ |
| 14781 | |
| 14782 | /************** End of fault.c ***********************************************/ |
| 14783 | /************** Begin file mem0.c ********************************************/ |
| 14784 | #line 1 "tsrc/mem0.c" |
| 14785 | /* |
| 14786 | ** 2008 October 28 |
| 14787 | ** |
| 14788 | ** The author disclaims copyright to this source code. In place of |
| 14789 | ** a legal notice, here is a blessing: |
| @@ -14809,10 +14841,11 @@ | |
| 14841 | |
| 14842 | #endif /* SQLITE_ZERO_MALLOC */ |
| 14843 | |
| 14844 | /************** End of mem0.c ************************************************/ |
| 14845 | /************** Begin file mem1.c ********************************************/ |
| 14846 | #line 1 "tsrc/mem1.c" |
| 14847 | /* |
| 14848 | ** 2007 August 14 |
| 14849 | ** |
| 14850 | ** The author disclaims copyright to this source code. In place of |
| 14851 | ** a legal notice, here is a blessing: |
| @@ -14961,10 +14994,11 @@ | |
| 14994 | |
| 14995 | #endif /* SQLITE_SYSTEM_MALLOC */ |
| 14996 | |
| 14997 | /************** End of mem1.c ************************************************/ |
| 14998 | /************** Begin file mem2.c ********************************************/ |
| 14999 | #line 1 "tsrc/mem2.c" |
| 15000 | /* |
| 15001 | ** 2007 August 15 |
| 15002 | ** |
| 15003 | ** The author disclaims copyright to this source code. In place of |
| 15004 | ** a legal notice, here is a blessing: |
| @@ -15491,10 +15525,11 @@ | |
| 15525 | |
| 15526 | #endif /* SQLITE_MEMDEBUG */ |
| 15527 | |
| 15528 | /************** End of mem2.c ************************************************/ |
| 15529 | /************** Begin file mem3.c ********************************************/ |
| 15530 | #line 1 "tsrc/mem3.c" |
| 15531 | /* |
| 15532 | ** 2007 October 14 |
| 15533 | ** |
| 15534 | ** The author disclaims copyright to this source code. In place of |
| 15535 | ** a legal notice, here is a blessing: |
| @@ -16180,10 +16215,11 @@ | |
| 16215 | |
| 16216 | #endif /* SQLITE_ENABLE_MEMSYS3 */ |
| 16217 | |
| 16218 | /************** End of mem3.c ************************************************/ |
| 16219 | /************** Begin file mem5.c ********************************************/ |
| 16220 | #line 1 "tsrc/mem5.c" |
| 16221 | /* |
| 16222 | ** 2007 October 14 |
| 16223 | ** |
| 16224 | ** The author disclaims copyright to this source code. In place of |
| 16225 | ** a legal notice, here is a blessing: |
| @@ -16763,10 +16799,11 @@ | |
| 16799 | |
| 16800 | #endif /* SQLITE_ENABLE_MEMSYS5 */ |
| 16801 | |
| 16802 | /************** End of mem5.c ************************************************/ |
| 16803 | /************** Begin file mutex.c *******************************************/ |
| 16804 | #line 1 "tsrc/mutex.c" |
| 16805 | /* |
| 16806 | ** 2007 August 14 |
| 16807 | ** |
| 16808 | ** The author disclaims copyright to this source code. In place of |
| 16809 | ** a legal notice, here is a blessing: |
| @@ -16918,10 +16955,11 @@ | |
| 16955 | |
| 16956 | #endif /* SQLITE_MUTEX_OMIT */ |
| 16957 | |
| 16958 | /************** End of mutex.c ***********************************************/ |
| 16959 | /************** Begin file mutex_noop.c **************************************/ |
| 16960 | #line 1 "tsrc/mutex_noop.c" |
| 16961 | /* |
| 16962 | ** 2008 October 07 |
| 16963 | ** |
| 16964 | ** The author disclaims copyright to this source code. In place of |
| 16965 | ** a legal notice, here is a blessing: |
| @@ -17126,10 +17164,11 @@ | |
| 17164 | #endif /* SQLITE_MUTEX_NOOP */ |
| 17165 | #endif /* SQLITE_MUTEX_OMIT */ |
| 17166 | |
| 17167 | /************** End of mutex_noop.c ******************************************/ |
| 17168 | /************** Begin file mutex_os2.c ***************************************/ |
| 17169 | #line 1 "tsrc/mutex_os2.c" |
| 17170 | /* |
| 17171 | ** 2007 August 28 |
| 17172 | ** |
| 17173 | ** The author disclaims copyright to this source code. In place of |
| 17174 | ** a legal notice, here is a blessing: |
| @@ -17402,10 +17441,11 @@ | |
| 17441 | } |
| 17442 | #endif /* SQLITE_MUTEX_OS2 */ |
| 17443 | |
| 17444 | /************** End of mutex_os2.c *******************************************/ |
| 17445 | /************** Begin file mutex_unix.c **************************************/ |
| 17446 | #line 1 "tsrc/mutex_unix.c" |
| 17447 | /* |
| 17448 | ** 2007 August 28 |
| 17449 | ** |
| 17450 | ** The author disclaims copyright to this source code. In place of |
| 17451 | ** a legal notice, here is a blessing: |
| @@ -17755,10 +17795,11 @@ | |
| 17795 | |
| 17796 | #endif /* SQLITE_MUTEX_PTHREAD */ |
| 17797 | |
| 17798 | /************** End of mutex_unix.c ******************************************/ |
| 17799 | /************** Begin file mutex_w32.c ***************************************/ |
| 17800 | #line 1 "tsrc/mutex_w32.c" |
| 17801 | /* |
| 17802 | ** 2007 August 14 |
| 17803 | ** |
| 17804 | ** The author disclaims copyright to this source code. In place of |
| 17805 | ** a legal notice, here is a blessing: |
| @@ -18089,10 +18130,11 @@ | |
| 18130 | } |
| 18131 | #endif /* SQLITE_MUTEX_W32 */ |
| 18132 | |
| 18133 | /************** End of mutex_w32.c *******************************************/ |
| 18134 | /************** Begin file malloc.c ******************************************/ |
| 18135 | #line 1 "tsrc/malloc.c" |
| 18136 | /* |
| 18137 | ** 2001 September 15 |
| 18138 | ** |
| 18139 | ** The author disclaims copyright to this source code. In place of |
| 18140 | ** a legal notice, here is a blessing: |
| @@ -18868,10 +18910,11 @@ | |
| 18910 | return rc & (db ? db->errMask : 0xff); |
| 18911 | } |
| 18912 | |
| 18913 | /************** End of malloc.c **********************************************/ |
| 18914 | /************** Begin file printf.c ******************************************/ |
| 18915 | #line 1 "tsrc/printf.c" |
| 18916 | /* |
| 18917 | ** The "printf" code that follows dates from the 1980's. It is in |
| 18918 | ** the public domain. The original comments are included here for |
| 18919 | ** completeness. They are very out-of-date but might be useful as |
| 18920 | ** an historical reference. Most of the "enhancements" have been backed |
| @@ -19899,10 +19942,11 @@ | |
| 19942 | } |
| 19943 | #endif |
| 19944 | |
| 19945 | /************** End of printf.c **********************************************/ |
| 19946 | /************** Begin file random.c ******************************************/ |
| 19947 | #line 1 "tsrc/random.c" |
| 19948 | /* |
| 19949 | ** 2001 September 15 |
| 19950 | ** |
| 19951 | ** The author disclaims copyright to this source code. In place of |
| 19952 | ** a legal notice, here is a blessing: |
| @@ -20046,10 +20090,11 @@ | |
| 20090 | } |
| 20091 | #endif /* SQLITE_OMIT_BUILTIN_TEST */ |
| 20092 | |
| 20093 | /************** End of random.c **********************************************/ |
| 20094 | /************** Begin file utf.c *********************************************/ |
| 20095 | #line 1 "tsrc/utf.c" |
| 20096 | /* |
| 20097 | ** 2004 April 13 |
| 20098 | ** |
| 20099 | ** The author disclaims copyright to this source code. In place of |
| 20100 | ** a legal notice, here is a blessing: |
| @@ -20607,10 +20652,11 @@ | |
| 20652 | #endif /* SQLITE_TEST */ |
| 20653 | #endif /* SQLITE_OMIT_UTF16 */ |
| 20654 | |
| 20655 | /************** End of utf.c *************************************************/ |
| 20656 | /************** Begin file util.c ********************************************/ |
| 20657 | #line 1 "tsrc/util.c" |
| 20658 | /* |
| 20659 | ** 2001 September 15 |
| 20660 | ** |
| 20661 | ** The author disclaims copyright to this source code. In place of |
| 20662 | ** a legal notice, here is a blessing: |
| @@ -21789,10 +21835,11 @@ | |
| 21835 | } |
| 21836 | #endif |
| 21837 | |
| 21838 | /************** End of util.c ************************************************/ |
| 21839 | /************** Begin file hash.c ********************************************/ |
| 21840 | #line 1 "tsrc/hash.c" |
| 21841 | /* |
| 21842 | ** 2001 September 22 |
| 21843 | ** |
| 21844 | ** The author disclaims copyright to this source code. In place of |
| 21845 | ** a legal notice, here is a blessing: |
| @@ -22068,10 +22115,11 @@ | |
| 22115 | return 0; |
| 22116 | } |
| 22117 | |
| 22118 | /************** End of hash.c ************************************************/ |
| 22119 | /************** Begin file opcodes.c *****************************************/ |
| 22120 | #line 1 "tsrc/opcodes.c" |
| 22121 | /* Automatically generated. Do not edit */ |
| 22122 | /* See the mkopcodec.awk script for details. */ |
| 22123 | #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) |
| 22124 | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ |
| 22125 | static const char *const azName[] = { "?", |
| @@ -22229,10 +22277,11 @@ | |
| 22277 | } |
| 22278 | #endif |
| 22279 | |
| 22280 | /************** End of opcodes.c *********************************************/ |
| 22281 | /************** Begin file os_os2.c ******************************************/ |
| 22282 | #line 1 "tsrc/os_os2.c" |
| 22283 | /* |
| 22284 | ** 2006 Feb 14 |
| 22285 | ** |
| 22286 | ** The author disclaims copyright to this source code. In place of |
| 22287 | ** a legal notice, here is a blessing: |
| @@ -22285,10 +22334,11 @@ | |
| 22334 | /* |
| 22335 | ** Include code that is common to all os_*.c files |
| 22336 | */ |
| 22337 | /************** Include os_common.h in the middle of os_os2.c ****************/ |
| 22338 | /************** Begin file os_common.h ***************************************/ |
| 22339 | #line 1 "tsrc/os_common.h" |
| 22340 | /* |
| 22341 | ** 2004 May 22 |
| 22342 | ** |
| 22343 | ** The author disclaims copyright to this source code. In place of |
| 22344 | ** a legal notice, here is a blessing: |
| @@ -22338,10 +22388,11 @@ | |
| 22388 | ** hwtime.h contains inline assembler code for implementing |
| 22389 | ** high-performance timing routines. |
| 22390 | */ |
| 22391 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 22392 | /************** Begin file hwtime.h ******************************************/ |
| 22393 | #line 1 "tsrc/hwtime.h" |
| 22394 | /* |
| 22395 | ** 2008 May 27 |
| 22396 | ** |
| 22397 | ** The author disclaims copyright to this source code. In place of |
| 22398 | ** a legal notice, here is a blessing: |
| @@ -22426,10 +22477,11 @@ | |
| 22477 | |
| 22478 | #endif /* !defined(_HWTIME_H_) */ |
| 22479 | |
| 22480 | /************** End of hwtime.h **********************************************/ |
| 22481 | /************** Continuing where we left off in os_common.h ******************/ |
| 22482 | #line 53 "tsrc/os_common.h" |
| 22483 | |
| 22484 | static sqlite_uint64 g_start; |
| 22485 | static sqlite_uint64 g_elapsed; |
| 22486 | #define TIMER_START g_start=sqlite3Hwtime() |
| 22487 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -22492,10 +22544,11 @@ | |
| 22544 | |
| 22545 | #endif /* !defined(_OS_COMMON_H_) */ |
| 22546 | |
| 22547 | /************** End of os_common.h *******************************************/ |
| 22548 | /************** Continuing where we left off in os_os2.c *********************/ |
| 22549 | #line 57 "tsrc/os_os2.c" |
| 22550 | |
| 22551 | /* Forward references */ |
| 22552 | typedef struct os2File os2File; /* The file structure */ |
| 22553 | typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */ |
| 22554 | typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */ |
| @@ -24363,10 +24416,11 @@ | |
| 24416 | |
| 24417 | #endif /* SQLITE_OS_OS2 */ |
| 24418 | |
| 24419 | /************** End of os_os2.c **********************************************/ |
| 24420 | /************** Begin file os_unix.c *****************************************/ |
| 24421 | #line 1 "tsrc/os_unix.c" |
| 24422 | /* |
| 24423 | ** 2004 May 22 |
| 24424 | ** |
| 24425 | ** The author disclaims copyright to this source code. In place of |
| 24426 | ** a legal notice, here is a blessing: |
| @@ -24627,10 +24681,11 @@ | |
| 24681 | /* |
| 24682 | ** Include code that is common to all os_*.c files |
| 24683 | */ |
| 24684 | /************** Include os_common.h in the middle of os_unix.c ***************/ |
| 24685 | /************** Begin file os_common.h ***************************************/ |
| 24686 | #line 1 "tsrc/os_common.h" |
| 24687 | /* |
| 24688 | ** 2004 May 22 |
| 24689 | ** |
| 24690 | ** The author disclaims copyright to this source code. In place of |
| 24691 | ** a legal notice, here is a blessing: |
| @@ -24680,10 +24735,11 @@ | |
| 24735 | ** hwtime.h contains inline assembler code for implementing |
| 24736 | ** high-performance timing routines. |
| 24737 | */ |
| 24738 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 24739 | /************** Begin file hwtime.h ******************************************/ |
| 24740 | #line 1 "tsrc/hwtime.h" |
| 24741 | /* |
| 24742 | ** 2008 May 27 |
| 24743 | ** |
| 24744 | ** The author disclaims copyright to this source code. In place of |
| 24745 | ** a legal notice, here is a blessing: |
| @@ -24768,10 +24824,11 @@ | |
| 24824 | |
| 24825 | #endif /* !defined(_HWTIME_H_) */ |
| 24826 | |
| 24827 | /************** End of hwtime.h **********************************************/ |
| 24828 | /************** Continuing where we left off in os_common.h ******************/ |
| 24829 | #line 53 "tsrc/os_common.h" |
| 24830 | |
| 24831 | static sqlite_uint64 g_start; |
| 24832 | static sqlite_uint64 g_elapsed; |
| 24833 | #define TIMER_START g_start=sqlite3Hwtime() |
| 24834 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -24834,10 +24891,11 @@ | |
| 24891 | |
| 24892 | #endif /* !defined(_OS_COMMON_H_) */ |
| 24893 | |
| 24894 | /************** End of os_common.h *******************************************/ |
| 24895 | /************** Continuing where we left off in os_unix.c ********************/ |
| 24896 | #line 265 "tsrc/os_unix.c" |
| 24897 | |
| 24898 | /* |
| 24899 | ** Define various macros that are missing from some systems. |
| 24900 | */ |
| 24901 | #ifndef O_LARGEFILE |
| @@ -31343,10 +31401,11 @@ | |
| 31401 | |
| 31402 | #endif /* SQLITE_OS_UNIX */ |
| 31403 | |
| 31404 | /************** End of os_unix.c *********************************************/ |
| 31405 | /************** Begin file os_win.c ******************************************/ |
| 31406 | #line 1 "tsrc/os_win.c" |
| 31407 | /* |
| 31408 | ** 2004 May 22 |
| 31409 | ** |
| 31410 | ** The author disclaims copyright to this source code. In place of |
| 31411 | ** a legal notice, here is a blessing: |
| @@ -31404,10 +31463,11 @@ | |
| 31463 | /* |
| 31464 | ** Include code that is common to all os_*.c files |
| 31465 | */ |
| 31466 | /************** Include os_common.h in the middle of os_win.c ****************/ |
| 31467 | /************** Begin file os_common.h ***************************************/ |
| 31468 | #line 1 "tsrc/os_common.h" |
| 31469 | /* |
| 31470 | ** 2004 May 22 |
| 31471 | ** |
| 31472 | ** The author disclaims copyright to this source code. In place of |
| 31473 | ** a legal notice, here is a blessing: |
| @@ -31457,10 +31517,11 @@ | |
| 31517 | ** hwtime.h contains inline assembler code for implementing |
| 31518 | ** high-performance timing routines. |
| 31519 | */ |
| 31520 | /************** Include hwtime.h in the middle of os_common.h ****************/ |
| 31521 | /************** Begin file hwtime.h ******************************************/ |
| 31522 | #line 1 "tsrc/hwtime.h" |
| 31523 | /* |
| 31524 | ** 2008 May 27 |
| 31525 | ** |
| 31526 | ** The author disclaims copyright to this source code. In place of |
| 31527 | ** a legal notice, here is a blessing: |
| @@ -31545,10 +31606,11 @@ | |
| 31606 | |
| 31607 | #endif /* !defined(_HWTIME_H_) */ |
| 31608 | |
| 31609 | /************** End of hwtime.h **********************************************/ |
| 31610 | /************** Continuing where we left off in os_common.h ******************/ |
| 31611 | #line 53 "tsrc/os_common.h" |
| 31612 | |
| 31613 | static sqlite_uint64 g_start; |
| 31614 | static sqlite_uint64 g_elapsed; |
| 31615 | #define TIMER_START g_start=sqlite3Hwtime() |
| 31616 | #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start |
| @@ -31611,10 +31673,11 @@ | |
| 31673 | |
| 31674 | #endif /* !defined(_OS_COMMON_H_) */ |
| 31675 | |
| 31676 | /************** End of os_common.h *******************************************/ |
| 31677 | /************** Continuing where we left off in os_win.c *********************/ |
| 31678 | #line 62 "tsrc/os_win.c" |
| 31679 | |
| 31680 | /* |
| 31681 | ** Some microsoft compilers lack this definition. |
| 31682 | */ |
| 31683 | #ifndef INVALID_FILE_ATTRIBUTES |
| @@ -34746,10 +34809,11 @@ | |
| 34809 | |
| 34810 | #endif /* SQLITE_OS_WIN */ |
| 34811 | |
| 34812 | /************** End of os_win.c **********************************************/ |
| 34813 | /************** Begin file bitvec.c ******************************************/ |
| 34814 | #line 1 "tsrc/bitvec.c" |
| 34815 | /* |
| 34816 | ** 2008 February 16 |
| 34817 | ** |
| 34818 | ** The author disclaims copyright to this source code. In place of |
| 34819 | ** a legal notice, here is a blessing: |
| @@ -35156,10 +35220,11 @@ | |
| 35220 | } |
| 35221 | #endif /* SQLITE_OMIT_BUILTIN_TEST */ |
| 35222 | |
| 35223 | /************** End of bitvec.c **********************************************/ |
| 35224 | /************** Begin file pcache.c ******************************************/ |
| 35225 | #line 1 "tsrc/pcache.c" |
| 35226 | /* |
| 35227 | ** 2008 August 05 |
| 35228 | ** |
| 35229 | ** The author disclaims copyright to this source code. In place of |
| 35230 | ** a legal notice, here is a blessing: |
| @@ -35752,10 +35817,11 @@ | |
| 35817 | } |
| 35818 | #endif |
| 35819 | |
| 35820 | /************** End of pcache.c **********************************************/ |
| 35821 | /************** Begin file pcache1.c *****************************************/ |
| 35822 | #line 1 "tsrc/pcache1.c" |
| 35823 | /* |
| 35824 | ** 2008 November 05 |
| 35825 | ** |
| 35826 | ** The author disclaims copyright to this source code. In place of |
| 35827 | ** a legal notice, here is a blessing: |
| @@ -36968,10 +37034,11 @@ | |
| 37034 | } |
| 37035 | #endif |
| 37036 | |
| 37037 | /************** End of pcache1.c *********************************************/ |
| 37038 | /************** Begin file rowset.c ******************************************/ |
| 37039 | #line 1 "tsrc/rowset.c" |
| 37040 | /* |
| 37041 | ** 2008 December 3 |
| 37042 | ** |
| 37043 | ** The author disclaims copyright to this source code. In place of |
| 37044 | ** a legal notice, here is a blessing: |
| @@ -37392,10 +37459,11 @@ | |
| 37459 | return 0; |
| 37460 | } |
| 37461 | |
| 37462 | /************** End of rowset.c **********************************************/ |
| 37463 | /************** Begin file pager.c *******************************************/ |
| 37464 | #line 1 "tsrc/pager.c" |
| 37465 | /* |
| 37466 | ** 2001 September 15 |
| 37467 | ** |
| 37468 | ** The author disclaims copyright to this source code. In place of |
| 37469 | ** a legal notice, here is a blessing: |
| @@ -37415,10 +37483,11 @@ | |
| 37483 | ** another is writing. |
| 37484 | */ |
| 37485 | #ifndef SQLITE_OMIT_DISKIO |
| 37486 | /************** Include wal.h in the middle of pager.c ***********************/ |
| 37487 | /************** Begin file wal.h *********************************************/ |
| 37488 | #line 1 "tsrc/wal.h" |
| 37489 | /* |
| 37490 | ** 2010 February 1 |
| 37491 | ** |
| 37492 | ** The author disclaims copyright to this source code. In place of |
| 37493 | ** a legal notice, here is a blessing: |
| @@ -37539,10 +37608,11 @@ | |
| 37608 | #endif /* ifndef SQLITE_OMIT_WAL */ |
| 37609 | #endif /* _WAL_H_ */ |
| 37610 | |
| 37611 | /************** End of wal.h *************************************************/ |
| 37612 | /************** Continuing where we left off in pager.c **********************/ |
| 37613 | #line 24 "tsrc/pager.c" |
| 37614 | |
| 37615 | |
| 37616 | /******************* NOTES ON THE DESIGN OF THE PAGER ************************ |
| 37617 | ** |
| 37618 | ** This comment block describes invariants that hold when using a rollback |
| @@ -44352,10 +44422,11 @@ | |
| 44422 | |
| 44423 | #endif /* SQLITE_OMIT_DISKIO */ |
| 44424 | |
| 44425 | /************** End of pager.c ***********************************************/ |
| 44426 | /************** Begin file wal.c *********************************************/ |
| 44427 | #line 1 "tsrc/wal.c" |
| 44428 | /* |
| 44429 | ** 2010 February 1 |
| 44430 | ** |
| 44431 | ** The author disclaims copyright to this source code. In place of |
| 44432 | ** a legal notice, here is a blessing: |
| @@ -47306,10 +47377,11 @@ | |
| 47377 | |
| 47378 | #endif /* #ifndef SQLITE_OMIT_WAL */ |
| 47379 | |
| 47380 | /************** End of wal.c *************************************************/ |
| 47381 | /************** Begin file btmutex.c *****************************************/ |
| 47382 | #line 1 "tsrc/btmutex.c" |
| 47383 | /* |
| 47384 | ** 2007 August 27 |
| 47385 | ** |
| 47386 | ** The author disclaims copyright to this source code. In place of |
| 47387 | ** a legal notice, here is a blessing: |
| @@ -47325,10 +47397,11 @@ | |
| 47397 | ** big and we want to break it down some. This packaged seemed like |
| 47398 | ** a good breakout. |
| 47399 | */ |
| 47400 | /************** Include btreeInt.h in the middle of btmutex.c ****************/ |
| 47401 | /************** Begin file btreeInt.h ****************************************/ |
| 47402 | #line 1 "tsrc/btreeInt.h" |
| 47403 | /* |
| 47404 | ** 2004 April 6 |
| 47405 | ** |
| 47406 | ** The author disclaims copyright to this source code. In place of |
| 47407 | ** a legal notice, here is a blessing: |
| @@ -47970,10 +48043,11 @@ | |
| 48043 | #define get4byte sqlite3Get4byte |
| 48044 | #define put4byte sqlite3Put4byte |
| 48045 | |
| 48046 | /************** End of btreeInt.h ********************************************/ |
| 48047 | /************** Continuing where we left off in btmutex.c ********************/ |
| 48048 | #line 19 "tsrc/btmutex.c" |
| 48049 | #ifndef SQLITE_OMIT_SHARED_CACHE |
| 48050 | #if SQLITE_THREADSAFE |
| 48051 | |
| 48052 | /* |
| 48053 | ** Obtain the BtShared mutex associated with B-Tree handle p. Also, |
| @@ -48242,10 +48316,11 @@ | |
| 48316 | #endif /* if SQLITE_THREADSAFE */ |
| 48317 | #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */ |
| 48318 | |
| 48319 | /************** End of btmutex.c *********************************************/ |
| 48320 | /************** Begin file btree.c *******************************************/ |
| 48321 | #line 1 "tsrc/btree.c" |
| 48322 | /* |
| 48323 | ** 2004 April 6 |
| 48324 | ** |
| 48325 | ** The author disclaims copyright to this source code. In place of |
| 48326 | ** a legal notice, here is a blessing: |
| @@ -48899,22 +48974,25 @@ | |
| 48974 | int *pRes /* Write search results here */ |
| 48975 | ){ |
| 48976 | int rc; /* Status code */ |
| 48977 | UnpackedRecord *pIdxKey; /* Unpacked index key */ |
| 48978 | char aSpace[150]; /* Temp space for pIdxKey - to avoid a malloc */ |
| 48979 | char *pFree = 0; |
| 48980 | |
| 48981 | if( pKey ){ |
| 48982 | assert( nKey==(i64)(int)nKey ); |
| 48983 | pIdxKey = sqlite3VdbeAllocUnpackedRecord( |
| 48984 | pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree |
| 48985 | ); |
| 48986 | if( pIdxKey==0 ) return SQLITE_NOMEM; |
| 48987 | sqlite3VdbeRecordUnpack(pCur->pKeyInfo, nKey, pKey, pIdxKey); |
| 48988 | }else{ |
| 48989 | pIdxKey = 0; |
| 48990 | } |
| 48991 | rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes); |
| 48992 | if( pFree ){ |
| 48993 | sqlite3DbFree(pCur->pKeyInfo->db, pFree); |
| 48994 | } |
| 48995 | return rc; |
| 48996 | } |
| 48997 | |
| 48998 | /* |
| @@ -56426,10 +56504,11 @@ | |
| 56504 | return rc; |
| 56505 | } |
| 56506 | |
| 56507 | /************** End of btree.c ***********************************************/ |
| 56508 | /************** Begin file backup.c ******************************************/ |
| 56509 | #line 1 "tsrc/backup.c" |
| 56510 | /* |
| 56511 | ** 2009 January 28 |
| 56512 | ** |
| 56513 | ** The author disclaims copyright to this source code. In place of |
| 56514 | ** a legal notice, here is a blessing: |
| @@ -57132,10 +57211,11 @@ | |
| 57211 | } |
| 57212 | #endif /* SQLITE_OMIT_VACUUM */ |
| 57213 | |
| 57214 | /************** End of backup.c **********************************************/ |
| 57215 | /************** Begin file vdbemem.c *****************************************/ |
| 57216 | #line 1 "tsrc/vdbemem.c" |
| 57217 | /* |
| 57218 | ** 2004 May 26 |
| 57219 | ** |
| 57220 | ** The author disclaims copyright to this source code. In place of |
| 57221 | ** a legal notice, here is a blessing: |
| @@ -58286,10 +58366,11 @@ | |
| 58366 | return 0; |
| 58367 | } |
| 58368 | |
| 58369 | /************** End of vdbemem.c *********************************************/ |
| 58370 | /************** Begin file vdbeaux.c *****************************************/ |
| 58371 | #line 1 "tsrc/vdbeaux.c" |
| 58372 | /* |
| 58373 | ** 2003 September 6 |
| 58374 | ** |
| 58375 | ** The author disclaims copyright to this source code. In place of |
| 58376 | ** a legal notice, here is a blessing: |
| @@ -61116,61 +61197,74 @@ | |
| 61197 | } |
| 61198 | } |
| 61199 | return 0; |
| 61200 | } |
| 61201 | |
| 61202 | /* |
| 61203 | ** This routine is used to allocate sufficient space for an UnpackedRecord |
| 61204 | ** structure large enough to be used with sqlite3VdbeRecordUnpack() if |
| 61205 | ** the first argument is a pointer to KeyInfo structure pKeyInfo. |
| 61206 | ** |
| 61207 | ** The space is either allocated using sqlite3DbMallocRaw() or from within |
| 61208 | ** the unaligned buffer passed via the second and third arguments (presumably |
| 61209 | ** stack space). If the former, then *ppFree is set to a pointer that should |
| 61210 | ** be eventually freed by the caller using sqlite3DbFree(). Or, if the |
| 61211 | ** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL |
| 61212 | ** before returning. |
| 61213 | ** |
| 61214 | ** If an OOM error occurs, NULL is returned. |
| 61215 | */ |
| 61216 | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord( |
| 61217 | KeyInfo *pKeyInfo, /* Description of the record */ |
| 61218 | char *pSpace, /* Unaligned space available */ |
| 61219 | int szSpace, /* Size of pSpace[] in bytes */ |
| 61220 | char **ppFree /* OUT: Caller should free this pointer */ |
| 61221 | ){ |
| 61222 | UnpackedRecord *p; /* Unpacked record to return */ |
| 61223 | int nOff; /* Increment pSpace by nOff to align it */ |
| 61224 | int nByte; /* Number of bytes required for *p */ |
| 61225 | |
| 61226 | /* We want to shift the pointer pSpace up such that it is 8-byte aligned. |
| 61227 | ** Thus, we need to calculate a value, nOff, between 0 and 7, to shift |
| 61228 | ** it by. If pSpace is already 8-byte aligned, nOff should be zero. |
| 61229 | */ |
| 61230 | nOff = (8 - (SQLITE_PTR_TO_INT(pSpace) & 7)) & 7; |
| 61231 | nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nField+1); |
| 61232 | if( nByte>szSpace+nOff ){ |
| 61233 | p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte); |
| 61234 | *ppFree = (char *)p; |
| 61235 | if( !p ) return 0; |
| 61236 | }else{ |
| 61237 | p = (UnpackedRecord*)&pSpace[nOff]; |
| 61238 | *ppFree = 0; |
| 61239 | } |
| 61240 | |
| 61241 | p->aMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))]; |
| 61242 | p->pKeyInfo = pKeyInfo; |
| 61243 | p->nField = pKeyInfo->nField + 1; |
| 61244 | return p; |
| 61245 | } |
| 61246 | |
| 61247 | /* |
| 61248 | ** Given the nKey-byte encoding of a record in pKey[], populate the |
| 61249 | ** UnpackedRecord structure indicated by the fourth argument with the |
| 61250 | ** contents of the decoded record. |
| 61251 | */ |
| 61252 | SQLITE_PRIVATE void sqlite3VdbeRecordUnpack( |
| 61253 | KeyInfo *pKeyInfo, /* Information about the record format */ |
| 61254 | int nKey, /* Size of the binary record */ |
| 61255 | const void *pKey, /* The binary record */ |
| 61256 | UnpackedRecord *p /* Populate this structure before returning. */ |
| 61257 | ){ |
| 61258 | const unsigned char *aKey = (const unsigned char *)pKey; |
| 61259 | int d; |
| 61260 | u32 idx; /* Offset in aKey[] to read from */ |
| 61261 | u16 u; /* Unsigned loop counter */ |
| 61262 | u32 szHdr; |
| 61263 | Mem *pMem = p->aMem; |
| 61264 | |
| 61265 | p->flags = 0; |
| 61266 | assert( EIGHT_BYTE_ALIGNMENT(pMem) ); |
| 61267 | idx = getVarint32(aKey, szHdr); |
| 61268 | d = szHdr; |
| 61269 | u = 0; |
| 61270 | while( idx<szHdr && u<p->nField && d<=nKey ){ |
| @@ -61185,35 +61279,10 @@ | |
| 61279 | pMem++; |
| 61280 | u++; |
| 61281 | } |
| 61282 | assert( u<=pKeyInfo->nField + 1 ); |
| 61283 | p->nField = u; |
| 61284 | } |
| 61285 | |
| 61286 | /* |
| 61287 | ** This function compares the two table rows or index records |
| 61288 | ** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero |
| @@ -61540,10 +61609,11 @@ | |
| 61609 | } |
| 61610 | } |
| 61611 | |
| 61612 | /************** End of vdbeaux.c *********************************************/ |
| 61613 | /************** Begin file vdbeapi.c *****************************************/ |
| 61614 | #line 1 "tsrc/vdbeapi.c" |
| 61615 | /* |
| 61616 | ** 2004 May 26 |
| 61617 | ** |
| 61618 | ** The author disclaims copyright to this source code. In place of |
| 61619 | ** a legal notice, here is a blessing: |
| @@ -62847,10 +62917,11 @@ | |
| 62917 | return v; |
| 62918 | } |
| 62919 | |
| 62920 | /************** End of vdbeapi.c *********************************************/ |
| 62921 | /************** Begin file vdbetrace.c ***************************************/ |
| 62922 | #line 1 "tsrc/vdbetrace.c" |
| 62923 | /* |
| 62924 | ** 2009 November 25 |
| 62925 | ** |
| 62926 | ** The author disclaims copyright to this source code. In place of |
| 62927 | ** a legal notice, here is a blessing: |
| @@ -63002,10 +63073,11 @@ | |
| 63073 | |
| 63074 | #endif /* #ifndef SQLITE_OMIT_TRACE */ |
| 63075 | |
| 63076 | /************** End of vdbetrace.c *******************************************/ |
| 63077 | /************** Begin file vdbe.c ********************************************/ |
| 63078 | #line 1 "tsrc/vdbe.c" |
| 63079 | /* |
| 63080 | ** 2001 September 15 |
| 63081 | ** |
| 63082 | ** The author disclaims copyright to this source code. In place of |
| 63083 | ** a legal notice, here is a blessing: |
| @@ -63471,10 +63543,11 @@ | |
| 63543 | ** hwtime.h contains inline assembler code for implementing |
| 63544 | ** high-performance timing routines. |
| 63545 | */ |
| 63546 | /************** Include hwtime.h in the middle of vdbe.c *********************/ |
| 63547 | /************** Begin file hwtime.h ******************************************/ |
| 63548 | #line 1 "tsrc/hwtime.h" |
| 63549 | /* |
| 63550 | ** 2008 May 27 |
| 63551 | ** |
| 63552 | ** The author disclaims copyright to this source code. In place of |
| 63553 | ** a legal notice, here is a blessing: |
| @@ -63559,10 +63632,11 @@ | |
| 63632 | |
| 63633 | #endif /* !defined(_HWTIME_H_) */ |
| 63634 | |
| 63635 | /************** End of hwtime.h **********************************************/ |
| 63636 | /************** Continuing where we left off in vdbe.c ***********************/ |
| 63637 | #line 471 "tsrc/vdbe.c" |
| 63638 | |
| 63639 | #endif |
| 63640 | |
| 63641 | /* |
| 63642 | ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the |
| @@ -63853,10 +63927,11 @@ | |
| 63927 | } bb; |
| 63928 | struct OP_Found_stack_vars { |
| 63929 | int alreadyExists; |
| 63930 | VdbeCursor *pC; |
| 63931 | int res; |
| 63932 | char *pFree; |
| 63933 | UnpackedRecord *pIdxKey; |
| 63934 | UnpackedRecord r; |
| 63935 | char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7]; |
| 63936 | } bc; |
| 63937 | struct OP_IsUnique_stack_vars { |
| @@ -67097,10 +67172,11 @@ | |
| 67172 | case OP_Found: { /* jump, in3 */ |
| 67173 | #if 0 /* local variables moved into u.bc */ |
| 67174 | int alreadyExists; |
| 67175 | VdbeCursor *pC; |
| 67176 | int res; |
| 67177 | char *pFree; |
| 67178 | UnpackedRecord *pIdxKey; |
| 67179 | UnpackedRecord r; |
| 67180 | char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7]; |
| 67181 | #endif /* local variables moved into u.bc */ |
| 67182 | |
| @@ -67125,22 +67201,22 @@ | |
| 67201 | { int i; for(i=0; i<u.bc.r.nField; i++) assert( memIsValid(&u.bc.r.aMem[i]) ); } |
| 67202 | #endif |
| 67203 | u.bc.r.flags = UNPACKED_PREFIX_MATCH; |
| 67204 | u.bc.pIdxKey = &u.bc.r; |
| 67205 | }else{ |
| 67206 | u.bc.pIdxKey = sqlite3VdbeAllocUnpackedRecord( |
| 67207 | u.bc.pC->pKeyInfo, u.bc.aTempRec, sizeof(u.bc.aTempRec), &u.bc.pFree |
| 67208 | ); |
| 67209 | if( u.bc.pIdxKey==0 ) goto no_mem; |
| 67210 | assert( pIn3->flags & MEM_Blob ); |
| 67211 | assert( (pIn3->flags & MEM_Zero)==0 ); /* zeroblobs already expanded */ |
| 67212 | sqlite3VdbeRecordUnpack(u.bc.pC->pKeyInfo, pIn3->n, pIn3->z, u.bc.pIdxKey); |
| 67213 | u.bc.pIdxKey->flags |= UNPACKED_PREFIX_MATCH; |
| 67214 | } |
| 67215 | rc = sqlite3BtreeMovetoUnpacked(u.bc.pC->pCursor, u.bc.pIdxKey, 0, 0, &u.bc.res); |
| 67216 | if( pOp->p4.i==0 ){ |
| 67217 | sqlite3DbFree(db, u.bc.pFree); |
| 67218 | } |
| 67219 | if( rc!=SQLITE_OK ){ |
| 67220 | break; |
| 67221 | } |
| 67222 | u.bc.alreadyExists = (u.bc.res==0); |
| @@ -69784,10 +69860,11 @@ | |
| 69860 | goto vdbe_error_halt; |
| 69861 | } |
| 69862 | |
| 69863 | /************** End of vdbe.c ************************************************/ |
| 69864 | /************** Begin file vdbeblob.c ****************************************/ |
| 69865 | #line 1 "tsrc/vdbeblob.c" |
| 69866 | /* |
| 69867 | ** 2007 May 1 |
| 69868 | ** |
| 69869 | ** The author disclaims copyright to this source code. In place of |
| 69870 | ** a legal notice, here is a blessing: |
| @@ -70254,10 +70331,11 @@ | |
| 70331 | |
| 70332 | #endif /* #ifndef SQLITE_OMIT_INCRBLOB */ |
| 70333 | |
| 70334 | /************** End of vdbeblob.c ********************************************/ |
| 70335 | /************** Begin file vdbesort.c ****************************************/ |
| 70336 | #line 1 "tsrc/vdbesort.c" |
| 70337 | /* |
| 70338 | ** 2011 July 9 |
| 70339 | ** |
| 70340 | ** The author disclaims copyright to this source code. In place of |
| 70341 | ** a legal notice, here is a blessing: |
| @@ -70358,12 +70436,11 @@ | |
| 70436 | sqlite3_file *pTemp1; /* PMA file 1 */ |
| 70437 | int nPMA; /* Number of PMAs stored in pTemp1 */ |
| 70438 | SorterRecord *pRecord; /* Head of in-memory record list */ |
| 70439 | int mnPmaSize; /* Minimum PMA size, in bytes */ |
| 70440 | int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */ |
| 70441 | UnpackedRecord *pUnpacked; /* Used to unpack keys */ |
| 70442 | }; |
| 70443 | |
| 70444 | /* |
| 70445 | ** The following type is an iterator for a PMA. It caches the current key in |
| 70446 | ** variables nKey/aKey. If the iterator is at EOF, pFile==0. |
| @@ -70553,56 +70630,39 @@ | |
| 70630 | ** be less than key2. Even if key2 also contains NULL values. |
| 70631 | ** |
| 70632 | ** If pKey2 is passed a NULL pointer, then it is assumed that the pCsr->aSpace |
| 70633 | ** has been allocated and contains an unpacked record that is used as key2. |
| 70634 | */ |
| 70635 | static void vdbeSorterCompare( |
| 70636 | VdbeCursor *pCsr, /* Cursor object (for pKeyInfo) */ |
| 70637 | int bOmitRowid, /* Ignore rowid field at end of keys */ |
| 70638 | void *pKey1, int nKey1, /* Left side of comparison */ |
| 70639 | void *pKey2, int nKey2, /* Right side of comparison */ |
| 70640 | int *pRes /* OUT: Result of comparison */ |
| 70641 | ){ |
| 70642 | KeyInfo *pKeyInfo = pCsr->pKeyInfo; |
| 70643 | VdbeSorter *pSorter = pCsr->pSorter; |
| 70644 | UnpackedRecord *r2 = pSorter->pUnpacked; |
| 70645 | int i; |
| 70646 | |
| 70647 | if( pKey2 ){ |
| 70648 | sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, r2); |
| 70649 | } |
| 70650 | |
| 70651 | if( bOmitRowid ){ |
| 70652 | r2->nField = pKeyInfo->nField; |
| 70653 | assert( r2->nField>0 ); |
| 70654 | for(i=0; i<r2->nField; i++){ |
| 70655 | if( r2->aMem[i].flags & MEM_Null ){ |
| 70656 | *pRes = -1; |
| 70657 | return; |
| 70658 | } |
| 70659 | } |
| 70660 | r2->flags |= UNPACKED_PREFIX_MATCH; |
| 70661 | } |
| 70662 | |
| 70663 | *pRes = sqlite3VdbeRecordCompare(nKey1, pKey1, r2); |
| 70664 | } |
| 70665 | |
| 70666 | /* |
| 70667 | ** This function is called to compare two iterator keys when merging |
| 70668 | ** multiple b-tree segments. Parameter iOut is the index of the aTree[] |
| @@ -70633,19 +70693,14 @@ | |
| 70693 | iRes = i2; |
| 70694 | }else if( p2->pFile==0 ){ |
| 70695 | iRes = i1; |
| 70696 | }else{ |
| 70697 | int res; |
| 70698 | assert( pCsr->pSorter->pUnpacked!=0 ); /* allocated in vdbeSorterMerge() */ |
| 70699 | vdbeSorterCompare( |
| 70700 | pCsr, 0, p1->aKey, p1->nKey, p2->aKey, p2->nKey, &res |
| 70701 | ); |
| 70702 | if( res<=0 ){ |
| 70703 | iRes = i1; |
| 70704 | }else{ |
| 70705 | iRes = i2; |
| 70706 | } |
| @@ -70660,16 +70715,21 @@ | |
| 70715 | */ |
| 70716 | SQLITE_PRIVATE int sqlite3VdbeSorterInit(sqlite3 *db, VdbeCursor *pCsr){ |
| 70717 | int pgsz; /* Page size of main database */ |
| 70718 | int mxCache; /* Cache size */ |
| 70719 | VdbeSorter *pSorter; /* The new sorter */ |
| 70720 | char *d; /* Dummy */ |
| 70721 | |
| 70722 | assert( pCsr->pKeyInfo && pCsr->pBt==0 ); |
| 70723 | pCsr->pSorter = pSorter = sqlite3DbMallocZero(db, sizeof(VdbeSorter)); |
| 70724 | if( pSorter==0 ){ |
| 70725 | return SQLITE_NOMEM; |
| 70726 | } |
| 70727 | |
| 70728 | pSorter->pUnpacked = sqlite3VdbeAllocUnpackedRecord(pCsr->pKeyInfo, 0, 0, &d); |
| 70729 | if( pSorter->pUnpacked==0 ) return SQLITE_NOMEM; |
| 70730 | assert( pSorter->pUnpacked==(UnpackedRecord *)d ); |
| 70731 | |
| 70732 | if( !sqlite3TempInMemory(db) ){ |
| 70733 | pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt); |
| 70734 | pSorter->mnPmaSize = SORTER_MIN_WORKING * pgsz; |
| 70735 | mxCache = db->aDb[0].pSchema->cache_size; |
| @@ -70707,11 +70767,11 @@ | |
| 70767 | } |
| 70768 | if( pSorter->pTemp1 ){ |
| 70769 | sqlite3OsCloseFree(pSorter->pTemp1); |
| 70770 | } |
| 70771 | vdbeSorterRecordFree(db, pSorter->pRecord); |
| 70772 | sqlite3DbFree(db, pSorter->pUnpacked); |
| 70773 | sqlite3DbFree(db, pSorter); |
| 70774 | pCsr->pSorter = 0; |
| 70775 | } |
| 70776 | } |
| 70777 | |
| @@ -70728,36 +70788,26 @@ | |
| 70788 | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE, &dummy |
| 70789 | ); |
| 70790 | } |
| 70791 | |
| 70792 | /* |
| 70793 | ** Merge the two sorted lists p1 and p2 into a single list. |
| 70794 | ** Set *ppOut to the head of the new list. |
| 70795 | */ |
| 70796 | static void vdbeSorterMerge( |
| 70797 | VdbeCursor *pCsr, /* For pKeyInfo */ |
| 70798 | SorterRecord *p1, /* First list to merge */ |
| 70799 | SorterRecord *p2, /* Second list to merge */ |
| 70800 | SorterRecord **ppOut /* OUT: Head of merged list */ |
| 70801 | ){ |
| 70802 | SorterRecord *pFinal = 0; |
| 70803 | SorterRecord **pp = &pFinal; |
| 70804 | void *pVal2 = p2 ? p2->pVal : 0; |
| 70805 | |
| 70806 | while( p1 && p2 ){ |
| 70807 | int res; |
| 70808 | vdbeSorterCompare(pCsr, 0, p1->pVal, p1->nVal, pVal2, p2->nVal, &res); |
| 70809 | if( res<=0 ){ |
| 70810 | *pp = p1; |
| 70811 | pp = &p1->pNext; |
| 70812 | p1 = p1->pNext; |
| 70813 | pVal2 = 0; |
| @@ -70768,22 +70818,19 @@ | |
| 70818 | if( p2==0 ) break; |
| 70819 | pVal2 = p2->pVal; |
| 70820 | } |
| 70821 | } |
| 70822 | *pp = p1 ? p1 : p2; |
| 70823 | *ppOut = pFinal; |
| 70824 | } |
| 70825 | |
| 70826 | /* |
| 70827 | ** Sort the linked list of records headed at pCsr->pRecord. Return SQLITE_OK |
| 70828 | ** if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if an error |
| 70829 | ** occurs. |
| 70830 | */ |
| 70831 | static int vdbeSorterSort(VdbeCursor *pCsr){ |
| 70832 | int i; |
| 70833 | SorterRecord **aSlot; |
| 70834 | SorterRecord *p; |
| 70835 | VdbeSorter *pSorter = pCsr->pSorter; |
| 70836 | |
| @@ -70794,34 +70841,26 @@ | |
| 70841 | |
| 70842 | p = pSorter->pRecord; |
| 70843 | while( p ){ |
| 70844 | SorterRecord *pNext = p->pNext; |
| 70845 | p->pNext = 0; |
| 70846 | for(i=0; aSlot[i]; i++){ |
| 70847 | vdbeSorterMerge(pCsr, p, aSlot[i], &p); |
| 70848 | aSlot[i] = 0; |
| 70849 | } |
| 70850 | aSlot[i] = p; |
| 70851 | p = pNext; |
| 70852 | } |
| 70853 | |
| 70854 | p = 0; |
| 70855 | for(i=0; i<64; i++){ |
| 70856 | vdbeSorterMerge(pCsr, p, aSlot[i], &p); |
| 70857 | } |
| 70858 | pSorter->pRecord = p; |
| 70859 | |
| 70860 | sqlite3_free(aSlot); |
| 70861 | return SQLITE_OK; |
| 70862 | } |
| 70863 | |
| 70864 | |
| 70865 | /* |
| 70866 | ** Write the current contents of the in-memory linked-list to a PMA. Return |
| @@ -70843,11 +70882,11 @@ | |
| 70882 | if( pSorter->nInMemory==0 ){ |
| 70883 | assert( pSorter->pRecord==0 ); |
| 70884 | return rc; |
| 70885 | } |
| 70886 | |
| 70887 | rc = vdbeSorterSort(pCsr); |
| 70888 | |
| 70889 | /* If the first temporary PMA file has not been opened, open it now. */ |
| 70890 | if( rc==SQLITE_OK && pSorter->pTemp1==0 ){ |
| 70891 | rc = vdbeSorterOpenTempFile(db, &pSorter->pTemp1); |
| 70892 | assert( rc!=SQLITE_OK || pSorter->pTemp1 ); |
| @@ -70990,11 +71029,11 @@ | |
| 71029 | ** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly |
| 71030 | ** from the in-memory list. */ |
| 71031 | if( pSorter->nPMA==0 ){ |
| 71032 | *pbEof = !pSorter->pRecord; |
| 71033 | assert( pSorter->aTree==0 ); |
| 71034 | return vdbeSorterSort(pCsr); |
| 71035 | } |
| 71036 | |
| 71037 | /* Write the current b-tree to a PMA. Close the b-tree cursor. */ |
| 71038 | rc = vdbeSorterListToPMA(db, pCsr); |
| 71039 | if( rc!=SQLITE_OK ) return rc; |
| @@ -71160,24 +71199,23 @@ | |
| 71199 | SQLITE_PRIVATE int sqlite3VdbeSorterCompare( |
| 71200 | VdbeCursor *pCsr, /* Sorter cursor */ |
| 71201 | Mem *pVal, /* Value to compare to current sorter key */ |
| 71202 | int *pRes /* OUT: Result of comparison */ |
| 71203 | ){ |
| 71204 | VdbeSorter *pSorter = pCsr->pSorter; |
| 71205 | void *pKey; int nKey; /* Sorter key to compare pVal with */ |
| 71206 | |
| 71207 | pKey = vdbeSorterRowkey(pSorter, &nKey); |
| 71208 | vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes); |
| 71209 | return SQLITE_OK; |
| 71210 | } |
| 71211 | |
| 71212 | #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */ |
| 71213 | |
| 71214 | /************** End of vdbesort.c ********************************************/ |
| 71215 | /************** Begin file journal.c *****************************************/ |
| 71216 | #line 1 "tsrc/journal.c" |
| 71217 | /* |
| 71218 | ** 2007 August 22 |
| 71219 | ** |
| 71220 | ** The author disclaims copyright to this source code. In place of |
| 71221 | ** a legal notice, here is a blessing: |
| @@ -71414,10 +71452,11 @@ | |
| 71452 | } |
| 71453 | #endif |
| 71454 | |
| 71455 | /************** End of journal.c *********************************************/ |
| 71456 | /************** Begin file memjournal.c **************************************/ |
| 71457 | #line 1 "tsrc/memjournal.c" |
| 71458 | /* |
| 71459 | ** 2008 October 7 |
| 71460 | ** |
| 71461 | ** The author disclaims copyright to this source code. In place of |
| 71462 | ** a legal notice, here is a blessing: |
| @@ -71675,10 +71714,11 @@ | |
| 71714 | return sizeof(MemJournal); |
| 71715 | } |
| 71716 | |
| 71717 | /************** End of memjournal.c ******************************************/ |
| 71718 | /************** Begin file walker.c ******************************************/ |
| 71719 | #line 1 "tsrc/walker.c" |
| 71720 | /* |
| 71721 | ** 2008 August 16 |
| 71722 | ** |
| 71723 | ** The author disclaims copyright to this source code. In place of |
| 71724 | ** a legal notice, here is a blessing: |
| @@ -71813,10 +71853,11 @@ | |
| 71853 | return rc & WRC_Abort; |
| 71854 | } |
| 71855 | |
| 71856 | /************** End of walker.c **********************************************/ |
| 71857 | /************** Begin file resolve.c *****************************************/ |
| 71858 | #line 1 "tsrc/resolve.c" |
| 71859 | /* |
| 71860 | ** 2008 August 18 |
| 71861 | ** |
| 71862 | ** The author disclaims copyright to this source code. In place of |
| 71863 | ** a legal notice, here is a blessing: |
| @@ -73033,10 +73074,11 @@ | |
| 73074 | sqlite3WalkSelect(&w, p); |
| 73075 | } |
| 73076 | |
| 73077 | /************** End of resolve.c *********************************************/ |
| 73078 | /************** Begin file expr.c ********************************************/ |
| 73079 | #line 1 "tsrc/expr.c" |
| 73080 | /* |
| 73081 | ** 2001 September 15 |
| 73082 | ** |
| 73083 | ** The author disclaims copyright to this source code. In place of |
| 73084 | ** a legal notice, here is a blessing: |
| @@ -76793,10 +76835,11 @@ | |
| 76835 | } |
| 76836 | } |
| 76837 | |
| 76838 | /************** End of expr.c ************************************************/ |
| 76839 | /************** Begin file alter.c *******************************************/ |
| 76840 | #line 1 "tsrc/alter.c" |
| 76841 | /* |
| 76842 | ** 2005 February 15 |
| 76843 | ** |
| 76844 | ** The author disclaims copyright to this source code. In place of |
| 76845 | ** a legal notice, here is a blessing: |
| @@ -77621,10 +77664,11 @@ | |
| 77664 | } |
| 77665 | #endif /* SQLITE_ALTER_TABLE */ |
| 77666 | |
| 77667 | /************** End of alter.c ***********************************************/ |
| 77668 | /************** Begin file analyze.c *****************************************/ |
| 77669 | #line 1 "tsrc/analyze.c" |
| 77670 | /* |
| 77671 | ** 2005 July 8 |
| 77672 | ** |
| 77673 | ** The author disclaims copyright to this source code. In place of |
| 77674 | ** a legal notice, here is a blessing: |
| @@ -78342,10 +78386,11 @@ | |
| 78386 | |
| 78387 | #endif /* SQLITE_OMIT_ANALYZE */ |
| 78388 | |
| 78389 | /************** End of analyze.c *********************************************/ |
| 78390 | /************** Begin file attach.c ******************************************/ |
| 78391 | #line 1 "tsrc/attach.c" |
| 78392 | /* |
| 78393 | ** 2003 April 6 |
| 78394 | ** |
| 78395 | ** The author disclaims copyright to this source code. In place of |
| 78396 | ** a legal notice, here is a blessing: |
| @@ -78901,10 +78946,11 @@ | |
| 78946 | } |
| 78947 | #endif |
| 78948 | |
| 78949 | /************** End of attach.c **********************************************/ |
| 78950 | /************** Begin file auth.c ********************************************/ |
| 78951 | #line 1 "tsrc/auth.c" |
| 78952 | /* |
| 78953 | ** 2003 January 11 |
| 78954 | ** |
| 78955 | ** The author disclaims copyright to this source code. In place of |
| 78956 | ** a legal notice, here is a blessing: |
| @@ -79152,10 +79198,11 @@ | |
| 79198 | |
| 79199 | #endif /* SQLITE_OMIT_AUTHORIZATION */ |
| 79200 | |
| 79201 | /************** End of auth.c ************************************************/ |
| 79202 | /************** Begin file build.c *******************************************/ |
| 79203 | #line 1 "tsrc/build.c" |
| 79204 | /* |
| 79205 | ** 2001 September 15 |
| 79206 | ** |
| 79207 | ** The author disclaims copyright to this source code. In place of |
| 79208 | ** a legal notice, here is a blessing: |
| @@ -82955,10 +83002,11 @@ | |
| 83002 | return pKey; |
| 83003 | } |
| 83004 | |
| 83005 | /************** End of build.c ***********************************************/ |
| 83006 | /************** Begin file callback.c ****************************************/ |
| 83007 | #line 1 "tsrc/callback.c" |
| 83008 | /* |
| 83009 | ** 2005 May 23 |
| 83010 | ** |
| 83011 | ** The author disclaims copyright to this source code. In place of |
| 83012 | ** a legal notice, here is a blessing: |
| @@ -83414,10 +83462,11 @@ | |
| 83462 | return p; |
| 83463 | } |
| 83464 | |
| 83465 | /************** End of callback.c ********************************************/ |
| 83466 | /************** Begin file delete.c ******************************************/ |
| 83467 | #line 1 "tsrc/delete.c" |
| 83468 | /* |
| 83469 | ** 2001 September 15 |
| 83470 | ** |
| 83471 | ** The author disclaims copyright to this source code. In place of |
| 83472 | ** a legal notice, here is a blessing: |
| @@ -84068,10 +84117,11 @@ | |
| 84117 | return regBase; |
| 84118 | } |
| 84119 | |
| 84120 | /************** End of delete.c **********************************************/ |
| 84121 | /************** Begin file func.c ********************************************/ |
| 84122 | #line 1 "tsrc/func.c" |
| 84123 | /* |
| 84124 | ** 2002 February 23 |
| 84125 | ** |
| 84126 | ** The author disclaims copyright to this source code. In place of |
| 84127 | ** a legal notice, here is a blessing: |
| @@ -85676,10 +85726,11 @@ | |
| 85726 | #endif |
| 85727 | } |
| 85728 | |
| 85729 | /************** End of func.c ************************************************/ |
| 85730 | /************** Begin file fkey.c ********************************************/ |
| 85731 | #line 1 "tsrc/fkey.c" |
| 85732 | /* |
| 85733 | ** |
| 85734 | ** The author disclaims copyright to this source code. In place of |
| 85735 | ** a legal notice, here is a blessing: |
| 85736 | ** |
| @@ -86896,10 +86947,11 @@ | |
| 86947 | } |
| 86948 | #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */ |
| 86949 | |
| 86950 | /************** End of fkey.c ************************************************/ |
| 86951 | /************** Begin file insert.c ******************************************/ |
| 86952 | #line 1 "tsrc/insert.c" |
| 86953 | /* |
| 86954 | ** 2001 September 15 |
| 86955 | ** |
| 86956 | ** The author disclaims copyright to this source code. In place of |
| 86957 | ** a legal notice, here is a blessing: |
| @@ -88741,10 +88793,11 @@ | |
| 88793 | } |
| 88794 | #endif /* SQLITE_OMIT_XFER_OPT */ |
| 88795 | |
| 88796 | /************** End of insert.c **********************************************/ |
| 88797 | /************** Begin file legacy.c ******************************************/ |
| 88798 | #line 1 "tsrc/legacy.c" |
| 88799 | /* |
| 88800 | ** 2001 September 15 |
| 88801 | ** |
| 88802 | ** The author disclaims copyright to this source code. In place of |
| 88803 | ** a legal notice, here is a blessing: |
| @@ -88888,10 +88941,11 @@ | |
| 88941 | return rc; |
| 88942 | } |
| 88943 | |
| 88944 | /************** End of legacy.c **********************************************/ |
| 88945 | /************** Begin file loadext.c *****************************************/ |
| 88946 | #line 1 "tsrc/loadext.c" |
| 88947 | /* |
| 88948 | ** 2006 June 7 |
| 88949 | ** |
| 88950 | ** The author disclaims copyright to this source code. In place of |
| 88951 | ** a legal notice, here is a blessing: |
| @@ -88908,10 +88962,11 @@ | |
| 88962 | #ifndef SQLITE_CORE |
| 88963 | #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */ |
| 88964 | #endif |
| 88965 | /************** Include sqlite3ext.h in the middle of loadext.c **************/ |
| 88966 | /************** Begin file sqlite3ext.h **************************************/ |
| 88967 | #line 1 "tsrc/sqlite3ext.h" |
| 88968 | /* |
| 88969 | ** 2006 June 7 |
| 88970 | ** |
| 88971 | ** The author disclaims copyright to this source code. In place of |
| 88972 | ** a legal notice, here is a blessing: |
| @@ -89336,10 +89391,11 @@ | |
| 89391 | |
| 89392 | #endif /* _SQLITE3EXT_H_ */ |
| 89393 | |
| 89394 | /************** End of sqlite3ext.h ******************************************/ |
| 89395 | /************** Continuing where we left off in loadext.c ********************/ |
| 89396 | #line 20 "tsrc/loadext.c" |
| 89397 | /* #include <string.h> */ |
| 89398 | |
| 89399 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 89400 | |
| 89401 | /* |
| @@ -89975,10 +90031,11 @@ | |
| 90031 | } |
| 90032 | } |
| 90033 | |
| 90034 | /************** End of loadext.c *********************************************/ |
| 90035 | /************** Begin file pragma.c ******************************************/ |
| 90036 | #line 1 "tsrc/pragma.c" |
| 90037 | /* |
| 90038 | ** 2003 April 6 |
| 90039 | ** |
| 90040 | ** The author disclaims copyright to this source code. In place of |
| 90041 | ** a legal notice, here is a blessing: |
| @@ -91503,10 +91560,11 @@ | |
| 91560 | |
| 91561 | #endif /* SQLITE_OMIT_PRAGMA */ |
| 91562 | |
| 91563 | /************** End of pragma.c **********************************************/ |
| 91564 | /************** Begin file prepare.c *****************************************/ |
| 91565 | #line 1 "tsrc/prepare.c" |
| 91566 | /* |
| 91567 | ** 2005 May 25 |
| 91568 | ** |
| 91569 | ** The author disclaims copyright to this source code. In place of |
| 91570 | ** a legal notice, here is a blessing: |
| @@ -92363,10 +92421,11 @@ | |
| 92421 | |
| 92422 | #endif /* SQLITE_OMIT_UTF16 */ |
| 92423 | |
| 92424 | /************** End of prepare.c *********************************************/ |
| 92425 | /************** Begin file select.c ******************************************/ |
| 92426 | #line 1 "tsrc/select.c" |
| 92427 | /* |
| 92428 | ** 2001 September 15 |
| 92429 | ** |
| 92430 | ** The author disclaims copyright to this source code. In place of |
| 92431 | ** a legal notice, here is a blessing: |
| @@ -96922,10 +96981,11 @@ | |
| 96981 | *****************************************************************************/ |
| 96982 | #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ |
| 96983 | |
| 96984 | /************** End of select.c **********************************************/ |
| 96985 | /************** Begin file table.c *******************************************/ |
| 96986 | #line 1 "tsrc/table.c" |
| 96987 | /* |
| 96988 | ** 2001 September 15 |
| 96989 | ** |
| 96990 | ** The author disclaims copyright to this source code. In place of |
| 96991 | ** a legal notice, here is a blessing: |
| @@ -97121,10 +97181,11 @@ | |
| 97181 | |
| 97182 | #endif /* SQLITE_OMIT_GET_TABLE */ |
| 97183 | |
| 97184 | /************** End of table.c ***********************************************/ |
| 97185 | /************** Begin file trigger.c *****************************************/ |
| 97186 | #line 1 "tsrc/trigger.c" |
| 97187 | /* |
| 97188 | ** |
| 97189 | ** The author disclaims copyright to this source code. In place of |
| 97190 | ** a legal notice, here is a blessing: |
| 97191 | ** |
| @@ -98246,10 +98307,11 @@ | |
| 98307 | |
| 98308 | #endif /* !defined(SQLITE_OMIT_TRIGGER) */ |
| 98309 | |
| 98310 | /************** End of trigger.c *********************************************/ |
| 98311 | /************** Begin file update.c ******************************************/ |
| 98312 | #line 1 "tsrc/update.c" |
| 98313 | /* |
| 98314 | ** 2001 September 15 |
| 98315 | ** |
| 98316 | ** The author disclaims copyright to this source code. In place of |
| 98317 | ** a legal notice, here is a blessing: |
| @@ -98918,10 +98980,11 @@ | |
| 98980 | } |
| 98981 | #endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 98982 | |
| 98983 | /************** End of update.c **********************************************/ |
| 98984 | /************** Begin file vacuum.c ******************************************/ |
| 98985 | #line 1 "tsrc/vacuum.c" |
| 98986 | /* |
| 98987 | ** 2003 April 6 |
| 98988 | ** |
| 98989 | ** The author disclaims copyright to this source code. In place of |
| 98990 | ** a legal notice, here is a blessing: |
| @@ -99264,10 +99327,11 @@ | |
| 99327 | |
| 99328 | #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */ |
| 99329 | |
| 99330 | /************** End of vacuum.c **********************************************/ |
| 99331 | /************** Begin file vtab.c ********************************************/ |
| 99332 | #line 1 "tsrc/vtab.c" |
| 99333 | /* |
| 99334 | ** 2006 June 10 |
| 99335 | ** |
| 99336 | ** The author disclaims copyright to this source code. In place of |
| 99337 | ** a legal notice, here is a blessing: |
| @@ -100332,10 +100396,11 @@ | |
| 100396 | |
| 100397 | #endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 100398 | |
| 100399 | /************** End of vtab.c ************************************************/ |
| 100400 | /************** Begin file where.c *******************************************/ |
| 100401 | #line 1 "tsrc/where.c" |
| 100402 | /* |
| 100403 | ** 2001 September 15 |
| 100404 | ** |
| 100405 | ** The author disclaims copyright to this source code. In place of |
| 100406 | ** a legal notice, here is a blessing: |
| @@ -105518,10 +105583,11 @@ | |
| 105583 | return; |
| 105584 | } |
| 105585 | |
| 105586 | /************** End of where.c ***********************************************/ |
| 105587 | /************** Begin file parse.c *******************************************/ |
| 105588 | #line 1 "tsrc/parse.c" |
| 105589 | /* Driver template for the LEMON parser generator. |
| 105590 | ** The author disclaims copyright to this source code. |
| 105591 | ** |
| 105592 | ** This version of "lempar.c" is modified, slightly, for use by SQLite. |
| 105593 | ** The only modifications are the addition of a couple of NEVER() |
| @@ -105530,10 +105596,11 @@ | |
| 105596 | ** specific grammar used by SQLite. |
| 105597 | */ |
| 105598 | /* First off, code is included that follows the "include" declaration |
| 105599 | ** in the input grammar file. */ |
| 105600 | /* #include <stdio.h> */ |
| 105601 | #line 51 "parse.y" |
| 105602 | |
| 105603 | |
| 105604 | /* |
| 105605 | ** Disable all error recovery processing in the parser push-down |
| 105606 | ** automaton. |
| @@ -105577,10 +105644,11 @@ | |
| 105644 | /* |
| 105645 | ** An instance of this structure holds the ATTACH key and the key type. |
| 105646 | */ |
| 105647 | struct AttachKey { int type; Token key; }; |
| 105648 | |
| 105649 | #line 722 "parse.y" |
| 105650 | |
| 105651 | /* This is a utility routine used to set the ExprSpan.zStart and |
| 105652 | ** ExprSpan.zEnd values of pOut so that the span covers the complete |
| 105653 | ** range of text beginning with pStart and going to the end of pEnd. |
| 105654 | */ |
| @@ -105596,10 +105664,11 @@ | |
| 105664 | static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){ |
| 105665 | pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue); |
| 105666 | pOut->zStart = pValue->z; |
| 105667 | pOut->zEnd = &pValue->z[pValue->n]; |
| 105668 | } |
| 105669 | #line 817 "parse.y" |
| 105670 | |
| 105671 | /* This routine constructs a binary expression node out of two ExprSpan |
| 105672 | ** objects and uses the result to populate a new ExprSpan object. |
| 105673 | */ |
| 105674 | static void spanBinaryExpr( |
| @@ -105611,10 +105680,11 @@ | |
| 105680 | ){ |
| 105681 | pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0); |
| 105682 | pOut->zStart = pLeft->zStart; |
| 105683 | pOut->zEnd = pRight->zEnd; |
| 105684 | } |
| 105685 | #line 873 "parse.y" |
| 105686 | |
| 105687 | /* Construct an expression node for a unary postfix operator |
| 105688 | */ |
| 105689 | static void spanUnaryPostfix( |
| 105690 | ExprSpan *pOut, /* Write the new expression node here */ |
| @@ -105625,10 +105695,11 @@ | |
| 105695 | ){ |
| 105696 | pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0); |
| 105697 | pOut->zStart = pOperand->zStart; |
| 105698 | pOut->zEnd = &pPostOp->z[pPostOp->n]; |
| 105699 | } |
| 105700 | #line 892 "parse.y" |
| 105701 | |
| 105702 | /* A routine to convert a binary TK_IS or TK_ISNOT expression into a |
| 105703 | ** unary TK_ISNULL or TK_NOTNULL expression. */ |
| 105704 | static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){ |
| 105705 | sqlite3 *db = pParse->db; |
| @@ -105636,10 +105707,11 @@ | |
| 105707 | pA->op = (u8)op; |
| 105708 | sqlite3ExprDelete(db, pA->pRight); |
| 105709 | pA->pRight = 0; |
| 105710 | } |
| 105711 | } |
| 105712 | #line 920 "parse.y" |
| 105713 | |
| 105714 | /* Construct an expression node for a unary prefix operator |
| 105715 | */ |
| 105716 | static void spanUnaryPrefix( |
| 105717 | ExprSpan *pOut, /* Write the new expression node here */ |
| @@ -105650,10 +105722,11 @@ | |
| 105722 | ){ |
| 105723 | pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0); |
| 105724 | pOut->zStart = pPreOp->z; |
| 105725 | pOut->zEnd = pOperand->zEnd; |
| 105726 | } |
| 105727 | #line 141 "parse.c" |
| 105728 | /* Next is all token values, in a form suitable for use by makeheaders. |
| 105729 | ** This section will be null unless lemon is run with the -m switch. |
| 105730 | */ |
| 105731 | /* |
| 105732 | ** These constants (all generated automatically by the parser generator) |
| @@ -106905,17 +106978,21 @@ | |
| 106978 | ** inside the C code. |
| 106979 | */ |
| 106980 | case 160: /* select */ |
| 106981 | case 194: /* oneselect */ |
| 106982 | { |
| 106983 | #line 403 "parse.y" |
| 106984 | sqlite3SelectDelete(pParse->db, (yypminor->yy387)); |
| 106985 | #line 1399 "parse.c" |
| 106986 | } |
| 106987 | break; |
| 106988 | case 174: /* term */ |
| 106989 | case 175: /* expr */ |
| 106990 | { |
| 106991 | #line 720 "parse.y" |
| 106992 | sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr); |
| 106993 | #line 1407 "parse.c" |
| 106994 | } |
| 106995 | break; |
| 106996 | case 179: /* idxlist_opt */ |
| 106997 | case 187: /* idxlist */ |
| 106998 | case 197: /* selcollist */ |
| @@ -106927,19 +107004,23 @@ | |
| 107004 | case 217: /* setlist */ |
| 107005 | case 220: /* itemlist */ |
| 107006 | case 221: /* exprlist */ |
| 107007 | case 226: /* case_exprlist */ |
| 107008 | { |
| 107009 | #line 1103 "parse.y" |
| 107010 | sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); |
| 107011 | #line 1425 "parse.c" |
| 107012 | } |
| 107013 | break; |
| 107014 | case 193: /* fullname */ |
| 107015 | case 198: /* from */ |
| 107016 | case 206: /* seltablist */ |
| 107017 | case 207: /* stl_prefix */ |
| 107018 | { |
| 107019 | #line 534 "parse.y" |
| 107020 | sqlite3SrcListDelete(pParse->db, (yypminor->yy259)); |
| 107021 | #line 1435 "parse.c" |
| 107022 | } |
| 107023 | break; |
| 107024 | case 199: /* where_opt */ |
| 107025 | case 201: /* having_opt */ |
| 107026 | case 210: /* on_opt */ |
| @@ -106947,29 +107028,37 @@ | |
| 107028 | case 225: /* case_operand */ |
| 107029 | case 227: /* case_else */ |
| 107030 | case 238: /* when_clause */ |
| 107031 | case 243: /* key_opt */ |
| 107032 | { |
| 107033 | #line 644 "parse.y" |
| 107034 | sqlite3ExprDelete(pParse->db, (yypminor->yy314)); |
| 107035 | #line 1449 "parse.c" |
| 107036 | } |
| 107037 | break; |
| 107038 | case 211: /* using_opt */ |
| 107039 | case 213: /* inscollist */ |
| 107040 | case 219: /* inscollist_opt */ |
| 107041 | { |
| 107042 | #line 566 "parse.y" |
| 107043 | sqlite3IdListDelete(pParse->db, (yypminor->yy384)); |
| 107044 | #line 1458 "parse.c" |
| 107045 | } |
| 107046 | break; |
| 107047 | case 234: /* trigger_cmd_list */ |
| 107048 | case 239: /* trigger_cmd */ |
| 107049 | { |
| 107050 | #line 1210 "parse.y" |
| 107051 | sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203)); |
| 107052 | #line 1466 "parse.c" |
| 107053 | } |
| 107054 | break; |
| 107055 | case 236: /* trigger_event */ |
| 107056 | { |
| 107057 | #line 1196 "parse.y" |
| 107058 | sqlite3IdListDelete(pParse->db, (yypminor->yy90).b); |
| 107059 | #line 1473 "parse.c" |
| 107060 | } |
| 107061 | break; |
| 107062 | default: break; /* If no destructor action specified: do nothing */ |
| 107063 | } |
| 107064 | } |
| @@ -107151,14 +107240,16 @@ | |
| 107240 | } |
| 107241 | #endif |
| 107242 | while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); |
| 107243 | /* Here code is inserted which will execute if the parser |
| 107244 | ** stack every overflows */ |
| 107245 | #line 38 "parse.y" |
| 107246 | |
| 107247 | UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */ |
| 107248 | sqlite3ErrorMsg(pParse, "parser stack overflow"); |
| 107249 | pParse->parseError = 1; |
| 107250 | #line 1664 "parse.c" |
| 107251 | sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */ |
| 107252 | } |
| 107253 | |
| 107254 | /* |
| 107255 | ** Perform a shift action. |
| @@ -107595,66 +107686,94 @@ | |
| 107686 | ** { ... } // User supplied code |
| 107687 | ** #line <lineno> <thisfile> |
| 107688 | ** break; |
| 107689 | */ |
| 107690 | case 5: /* explain ::= */ |
| 107691 | #line 107 "parse.y" |
| 107692 | { sqlite3BeginParse(pParse, 0); } |
| 107693 | #line 2107 "parse.c" |
| 107694 | break; |
| 107695 | case 6: /* explain ::= EXPLAIN */ |
| 107696 | #line 109 "parse.y" |
| 107697 | { sqlite3BeginParse(pParse, 1); } |
| 107698 | #line 2112 "parse.c" |
| 107699 | break; |
| 107700 | case 7: /* explain ::= EXPLAIN QUERY PLAN */ |
| 107701 | #line 110 "parse.y" |
| 107702 | { sqlite3BeginParse(pParse, 2); } |
| 107703 | #line 2117 "parse.c" |
| 107704 | break; |
| 107705 | case 8: /* cmdx ::= cmd */ |
| 107706 | #line 112 "parse.y" |
| 107707 | { sqlite3FinishCoding(pParse); } |
| 107708 | #line 2122 "parse.c" |
| 107709 | break; |
| 107710 | case 9: /* cmd ::= BEGIN transtype trans_opt */ |
| 107711 | #line 117 "parse.y" |
| 107712 | {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);} |
| 107713 | #line 2127 "parse.c" |
| 107714 | break; |
| 107715 | case 13: /* transtype ::= */ |
| 107716 | #line 122 "parse.y" |
| 107717 | {yygotominor.yy4 = TK_DEFERRED;} |
| 107718 | #line 2132 "parse.c" |
| 107719 | break; |
| 107720 | case 14: /* transtype ::= DEFERRED */ |
| 107721 | case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); |
| 107722 | case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); |
| 107723 | case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); |
| 107724 | case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117); |
| 107725 | #line 123 "parse.y" |
| 107726 | {yygotominor.yy4 = yymsp[0].major;} |
| 107727 | #line 2141 "parse.c" |
| 107728 | break; |
| 107729 | case 17: /* cmd ::= COMMIT trans_opt */ |
| 107730 | case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); |
| 107731 | #line 126 "parse.y" |
| 107732 | {sqlite3CommitTransaction(pParse);} |
| 107733 | #line 2147 "parse.c" |
| 107734 | break; |
| 107735 | case 19: /* cmd ::= ROLLBACK trans_opt */ |
| 107736 | #line 128 "parse.y" |
| 107737 | {sqlite3RollbackTransaction(pParse);} |
| 107738 | #line 2152 "parse.c" |
| 107739 | break; |
| 107740 | case 22: /* cmd ::= SAVEPOINT nm */ |
| 107741 | #line 132 "parse.y" |
| 107742 | { |
| 107743 | sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0); |
| 107744 | } |
| 107745 | #line 2159 "parse.c" |
| 107746 | break; |
| 107747 | case 23: /* cmd ::= RELEASE savepoint_opt nm */ |
| 107748 | #line 135 "parse.y" |
| 107749 | { |
| 107750 | sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0); |
| 107751 | } |
| 107752 | #line 2166 "parse.c" |
| 107753 | break; |
| 107754 | case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ |
| 107755 | #line 138 "parse.y" |
| 107756 | { |
| 107757 | sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); |
| 107758 | } |
| 107759 | #line 2173 "parse.c" |
| 107760 | break; |
| 107761 | case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ |
| 107762 | #line 145 "parse.y" |
| 107763 | { |
| 107764 | sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4); |
| 107765 | } |
| 107766 | #line 2180 "parse.c" |
| 107767 | break; |
| 107768 | case 27: /* createkw ::= CREATE */ |
| 107769 | #line 148 "parse.y" |
| 107770 | { |
| 107771 | pParse->db->lookaside.bEnabled = 0; |
| 107772 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 107773 | } |
| 107774 | #line 2188 "parse.c" |
| 107775 | break; |
| 107776 | case 28: /* ifnotexists ::= */ |
| 107777 | case 31: /* temp ::= */ yytestcase(yyruleno==31); |
| 107778 | case 70: /* autoinc ::= */ yytestcase(yyruleno==70); |
| 107779 | case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83); |
| @@ -107664,44 +107783,56 @@ | |
| 107783 | case 109: /* ifexists ::= */ yytestcase(yyruleno==109); |
| 107784 | case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); |
| 107785 | case 121: /* distinct ::= */ yytestcase(yyruleno==121); |
| 107786 | case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222); |
| 107787 | case 225: /* in_op ::= IN */ yytestcase(yyruleno==225); |
| 107788 | #line 153 "parse.y" |
| 107789 | {yygotominor.yy4 = 0;} |
| 107790 | #line 2204 "parse.c" |
| 107791 | break; |
| 107792 | case 29: /* ifnotexists ::= IF NOT EXISTS */ |
| 107793 | case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); |
| 107794 | case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); |
| 107795 | case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86); |
| 107796 | case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); |
| 107797 | case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); |
| 107798 | case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223); |
| 107799 | case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226); |
| 107800 | #line 154 "parse.y" |
| 107801 | {yygotominor.yy4 = 1;} |
| 107802 | #line 2216 "parse.c" |
| 107803 | break; |
| 107804 | case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ |
| 107805 | #line 160 "parse.y" |
| 107806 | { |
| 107807 | sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); |
| 107808 | } |
| 107809 | #line 2223 "parse.c" |
| 107810 | break; |
| 107811 | case 33: /* create_table_args ::= AS select */ |
| 107812 | #line 163 "parse.y" |
| 107813 | { |
| 107814 | sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387); |
| 107815 | sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); |
| 107816 | } |
| 107817 | #line 2231 "parse.c" |
| 107818 | break; |
| 107819 | case 36: /* column ::= columnid type carglist */ |
| 107820 | #line 175 "parse.y" |
| 107821 | { |
| 107822 | yygotominor.yy0.z = yymsp[-2].minor.yy0.z; |
| 107823 | yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n; |
| 107824 | } |
| 107825 | #line 2239 "parse.c" |
| 107826 | break; |
| 107827 | case 37: /* columnid ::= nm */ |
| 107828 | #line 179 "parse.y" |
| 107829 | { |
| 107830 | sqlite3AddColumn(pParse,&yymsp[0].minor.yy0); |
| 107831 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 107832 | } |
| 107833 | #line 2247 "parse.c" |
| 107834 | break; |
| 107835 | case 38: /* id ::= ID */ |
| 107836 | case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39); |
| 107837 | case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40); |
| 107838 | case 41: /* nm ::= id */ yytestcase(yyruleno==41); |
| @@ -107721,256 +107852,373 @@ | |
| 107852 | case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264); |
| 107853 | case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265); |
| 107854 | case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266); |
| 107855 | case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267); |
| 107856 | case 285: /* trnm ::= nm */ yytestcase(yyruleno==285); |
| 107857 | #line 189 "parse.y" |
| 107858 | {yygotominor.yy0 = yymsp[0].minor.yy0;} |
| 107859 | #line 2273 "parse.c" |
| 107860 | break; |
| 107861 | case 45: /* type ::= typetoken */ |
| 107862 | #line 251 "parse.y" |
| 107863 | {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} |
| 107864 | #line 2278 "parse.c" |
| 107865 | break; |
| 107866 | case 47: /* typetoken ::= typename LP signed RP */ |
| 107867 | #line 253 "parse.y" |
| 107868 | { |
| 107869 | yygotominor.yy0.z = yymsp[-3].minor.yy0.z; |
| 107870 | yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z); |
| 107871 | } |
| 107872 | #line 2286 "parse.c" |
| 107873 | break; |
| 107874 | case 48: /* typetoken ::= typename LP signed COMMA signed RP */ |
| 107875 | #line 257 "parse.y" |
| 107876 | { |
| 107877 | yygotominor.yy0.z = yymsp[-5].minor.yy0.z; |
| 107878 | yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z); |
| 107879 | } |
| 107880 | #line 2294 "parse.c" |
| 107881 | break; |
| 107882 | case 50: /* typename ::= typename ids */ |
| 107883 | #line 263 "parse.y" |
| 107884 | {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);} |
| 107885 | #line 2299 "parse.c" |
| 107886 | break; |
| 107887 | case 57: /* ccons ::= DEFAULT term */ |
| 107888 | case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); |
| 107889 | #line 274 "parse.y" |
| 107890 | {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);} |
| 107891 | #line 2305 "parse.c" |
| 107892 | break; |
| 107893 | case 58: /* ccons ::= DEFAULT LP expr RP */ |
| 107894 | #line 275 "parse.y" |
| 107895 | {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);} |
| 107896 | #line 2310 "parse.c" |
| 107897 | break; |
| 107898 | case 60: /* ccons ::= DEFAULT MINUS term */ |
| 107899 | #line 277 "parse.y" |
| 107900 | { |
| 107901 | ExprSpan v; |
| 107902 | v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0); |
| 107903 | v.zStart = yymsp[-1].minor.yy0.z; |
| 107904 | v.zEnd = yymsp[0].minor.yy118.zEnd; |
| 107905 | sqlite3AddDefaultValue(pParse,&v); |
| 107906 | } |
| 107907 | #line 2321 "parse.c" |
| 107908 | break; |
| 107909 | case 61: /* ccons ::= DEFAULT id */ |
| 107910 | #line 284 "parse.y" |
| 107911 | { |
| 107912 | ExprSpan v; |
| 107913 | spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0); |
| 107914 | sqlite3AddDefaultValue(pParse,&v); |
| 107915 | } |
| 107916 | #line 2330 "parse.c" |
| 107917 | break; |
| 107918 | case 63: /* ccons ::= NOT NULL onconf */ |
| 107919 | #line 294 "parse.y" |
| 107920 | {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);} |
| 107921 | #line 2335 "parse.c" |
| 107922 | break; |
| 107923 | case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ |
| 107924 | #line 296 "parse.y" |
| 107925 | {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);} |
| 107926 | #line 2340 "parse.c" |
| 107927 | break; |
| 107928 | case 65: /* ccons ::= UNIQUE onconf */ |
| 107929 | #line 297 "parse.y" |
| 107930 | {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);} |
| 107931 | #line 2345 "parse.c" |
| 107932 | break; |
| 107933 | case 66: /* ccons ::= CHECK LP expr RP */ |
| 107934 | #line 298 "parse.y" |
| 107935 | {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);} |
| 107936 | #line 2350 "parse.c" |
| 107937 | break; |
| 107938 | case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ |
| 107939 | #line 300 "parse.y" |
| 107940 | {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);} |
| 107941 | #line 2355 "parse.c" |
| 107942 | break; |
| 107943 | case 68: /* ccons ::= defer_subclause */ |
| 107944 | #line 301 "parse.y" |
| 107945 | {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);} |
| 107946 | #line 2360 "parse.c" |
| 107947 | break; |
| 107948 | case 69: /* ccons ::= COLLATE ids */ |
| 107949 | #line 302 "parse.y" |
| 107950 | {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} |
| 107951 | #line 2365 "parse.c" |
| 107952 | break; |
| 107953 | case 72: /* refargs ::= */ |
| 107954 | #line 315 "parse.y" |
| 107955 | { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */} |
| 107956 | #line 2370 "parse.c" |
| 107957 | break; |
| 107958 | case 73: /* refargs ::= refargs refarg */ |
| 107959 | #line 316 "parse.y" |
| 107960 | { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; } |
| 107961 | #line 2375 "parse.c" |
| 107962 | break; |
| 107963 | case 74: /* refarg ::= MATCH nm */ |
| 107964 | case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); |
| 107965 | #line 318 "parse.y" |
| 107966 | { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; } |
| 107967 | #line 2381 "parse.c" |
| 107968 | break; |
| 107969 | case 76: /* refarg ::= ON DELETE refact */ |
| 107970 | #line 320 "parse.y" |
| 107971 | { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; } |
| 107972 | #line 2386 "parse.c" |
| 107973 | break; |
| 107974 | case 77: /* refarg ::= ON UPDATE refact */ |
| 107975 | #line 321 "parse.y" |
| 107976 | { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; } |
| 107977 | #line 2391 "parse.c" |
| 107978 | break; |
| 107979 | case 78: /* refact ::= SET NULL */ |
| 107980 | #line 323 "parse.y" |
| 107981 | { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */} |
| 107982 | #line 2396 "parse.c" |
| 107983 | break; |
| 107984 | case 79: /* refact ::= SET DEFAULT */ |
| 107985 | #line 324 "parse.y" |
| 107986 | { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */} |
| 107987 | #line 2401 "parse.c" |
| 107988 | break; |
| 107989 | case 80: /* refact ::= CASCADE */ |
| 107990 | #line 325 "parse.y" |
| 107991 | { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */} |
| 107992 | #line 2406 "parse.c" |
| 107993 | break; |
| 107994 | case 81: /* refact ::= RESTRICT */ |
| 107995 | #line 326 "parse.y" |
| 107996 | { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */} |
| 107997 | #line 2411 "parse.c" |
| 107998 | break; |
| 107999 | case 82: /* refact ::= NO ACTION */ |
| 108000 | #line 327 "parse.y" |
| 108001 | { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */} |
| 108002 | #line 2416 "parse.c" |
| 108003 | break; |
| 108004 | case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ |
| 108005 | case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99); |
| 108006 | case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101); |
| 108007 | case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); |
| 108008 | #line 330 "parse.y" |
| 108009 | {yygotominor.yy4 = yymsp[0].minor.yy4;} |
| 108010 | #line 2424 "parse.c" |
| 108011 | break; |
| 108012 | case 88: /* conslist_opt ::= */ |
| 108013 | #line 339 "parse.y" |
| 108014 | {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} |
| 108015 | #line 2429 "parse.c" |
| 108016 | break; |
| 108017 | case 89: /* conslist_opt ::= COMMA conslist */ |
| 108018 | #line 340 "parse.y" |
| 108019 | {yygotominor.yy0 = yymsp[-1].minor.yy0;} |
| 108020 | #line 2434 "parse.c" |
| 108021 | break; |
| 108022 | case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ |
| 108023 | #line 346 "parse.y" |
| 108024 | {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);} |
| 108025 | #line 2439 "parse.c" |
| 108026 | break; |
| 108027 | case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ |
| 108028 | #line 348 "parse.y" |
| 108029 | {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);} |
| 108030 | #line 2444 "parse.c" |
| 108031 | break; |
| 108032 | case 96: /* tcons ::= CHECK LP expr RP onconf */ |
| 108033 | #line 350 "parse.y" |
| 108034 | {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);} |
| 108035 | #line 2449 "parse.c" |
| 108036 | break; |
| 108037 | case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ |
| 108038 | #line 352 "parse.y" |
| 108039 | { |
| 108040 | sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4); |
| 108041 | sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4); |
| 108042 | } |
| 108043 | #line 2457 "parse.c" |
| 108044 | break; |
| 108045 | case 100: /* onconf ::= */ |
| 108046 | #line 366 "parse.y" |
| 108047 | {yygotominor.yy4 = OE_Default;} |
| 108048 | #line 2462 "parse.c" |
| 108049 | break; |
| 108050 | case 102: /* orconf ::= */ |
| 108051 | #line 368 "parse.y" |
| 108052 | {yygotominor.yy210 = OE_Default;} |
| 108053 | #line 2467 "parse.c" |
| 108054 | break; |
| 108055 | case 103: /* orconf ::= OR resolvetype */ |
| 108056 | #line 369 "parse.y" |
| 108057 | {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;} |
| 108058 | #line 2472 "parse.c" |
| 108059 | break; |
| 108060 | case 105: /* resolvetype ::= IGNORE */ |
| 108061 | #line 371 "parse.y" |
| 108062 | {yygotominor.yy4 = OE_Ignore;} |
| 108063 | #line 2477 "parse.c" |
| 108064 | break; |
| 108065 | case 106: /* resolvetype ::= REPLACE */ |
| 108066 | #line 372 "parse.y" |
| 108067 | {yygotominor.yy4 = OE_Replace;} |
| 108068 | #line 2482 "parse.c" |
| 108069 | break; |
| 108070 | case 107: /* cmd ::= DROP TABLE ifexists fullname */ |
| 108071 | #line 376 "parse.y" |
| 108072 | { |
| 108073 | sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4); |
| 108074 | } |
| 108075 | #line 2489 "parse.c" |
| 108076 | break; |
| 108077 | case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ |
| 108078 | #line 386 "parse.y" |
| 108079 | { |
| 108080 | sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4); |
| 108081 | } |
| 108082 | #line 2496 "parse.c" |
| 108083 | break; |
| 108084 | case 111: /* cmd ::= DROP VIEW ifexists fullname */ |
| 108085 | #line 389 "parse.y" |
| 108086 | { |
| 108087 | sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4); |
| 108088 | } |
| 108089 | #line 2503 "parse.c" |
| 108090 | break; |
| 108091 | case 112: /* cmd ::= select */ |
| 108092 | #line 396 "parse.y" |
| 108093 | { |
| 108094 | SelectDest dest = {SRT_Output, 0, 0, 0, 0}; |
| 108095 | sqlite3Select(pParse, yymsp[0].minor.yy387, &dest); |
| 108096 | sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); |
| 108097 | } |
| 108098 | #line 2512 "parse.c" |
| 108099 | break; |
| 108100 | case 113: /* select ::= oneselect */ |
| 108101 | #line 407 "parse.y" |
| 108102 | {yygotominor.yy387 = yymsp[0].minor.yy387;} |
| 108103 | #line 2517 "parse.c" |
| 108104 | break; |
| 108105 | case 114: /* select ::= select multiselect_op oneselect */ |
| 108106 | #line 409 "parse.y" |
| 108107 | { |
| 108108 | if( yymsp[0].minor.yy387 ){ |
| 108109 | yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4; |
| 108110 | yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387; |
| 108111 | }else{ |
| 108112 | sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387); |
| 108113 | } |
| 108114 | yygotominor.yy387 = yymsp[0].minor.yy387; |
| 108115 | } |
| 108116 | #line 2530 "parse.c" |
| 108117 | break; |
| 108118 | case 116: /* multiselect_op ::= UNION ALL */ |
| 108119 | #line 420 "parse.y" |
| 108120 | {yygotominor.yy4 = TK_ALL;} |
| 108121 | #line 2535 "parse.c" |
| 108122 | break; |
| 108123 | case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 108124 | #line 424 "parse.y" |
| 108125 | { |
| 108126 | yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset); |
| 108127 | } |
| 108128 | #line 2542 "parse.c" |
| 108129 | break; |
| 108130 | case 122: /* sclp ::= selcollist COMMA */ |
| 108131 | case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247); |
| 108132 | #line 445 "parse.y" |
| 108133 | {yygotominor.yy322 = yymsp[-1].minor.yy322;} |
| 108134 | #line 2548 "parse.c" |
| 108135 | break; |
| 108136 | case 123: /* sclp ::= */ |
| 108137 | case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); |
| 108138 | case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159); |
| 108139 | case 240: /* exprlist ::= */ yytestcase(yyruleno==240); |
| 108140 | case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246); |
| 108141 | #line 446 "parse.y" |
| 108142 | {yygotominor.yy322 = 0;} |
| 108143 | #line 2557 "parse.c" |
| 108144 | break; |
| 108145 | case 124: /* selcollist ::= sclp expr as */ |
| 108146 | #line 447 "parse.y" |
| 108147 | { |
| 108148 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr); |
| 108149 | if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1); |
| 108150 | sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118); |
| 108151 | } |
| 108152 | #line 2566 "parse.c" |
| 108153 | break; |
| 108154 | case 125: /* selcollist ::= sclp STAR */ |
| 108155 | #line 452 "parse.y" |
| 108156 | { |
| 108157 | Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); |
| 108158 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p); |
| 108159 | } |
| 108160 | #line 2574 "parse.c" |
| 108161 | break; |
| 108162 | case 126: /* selcollist ::= sclp nm DOT STAR */ |
| 108163 | #line 456 "parse.y" |
| 108164 | { |
| 108165 | Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); |
| 108166 | Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 108167 | Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); |
| 108168 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot); |
| 108169 | } |
| 108170 | #line 2584 "parse.c" |
| 108171 | break; |
| 108172 | case 129: /* as ::= */ |
| 108173 | #line 469 "parse.y" |
| 108174 | {yygotominor.yy0.n = 0;} |
| 108175 | #line 2589 "parse.c" |
| 108176 | break; |
| 108177 | case 130: /* from ::= */ |
| 108178 | #line 481 "parse.y" |
| 108179 | {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));} |
| 108180 | #line 2594 "parse.c" |
| 108181 | break; |
| 108182 | case 131: /* from ::= FROM seltablist */ |
| 108183 | #line 482 "parse.y" |
| 108184 | { |
| 108185 | yygotominor.yy259 = yymsp[0].minor.yy259; |
| 108186 | sqlite3SrcListShiftJoinType(yygotominor.yy259); |
| 108187 | } |
| 108188 | #line 2602 "parse.c" |
| 108189 | break; |
| 108190 | case 132: /* stl_prefix ::= seltablist joinop */ |
| 108191 | #line 490 "parse.y" |
| 108192 | { |
| 108193 | yygotominor.yy259 = yymsp[-1].minor.yy259; |
| 108194 | if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4; |
| 108195 | } |
| 108196 | #line 2610 "parse.c" |
| 108197 | break; |
| 108198 | case 133: /* stl_prefix ::= */ |
| 108199 | #line 494 "parse.y" |
| 108200 | {yygotominor.yy259 = 0;} |
| 108201 | #line 2615 "parse.c" |
| 108202 | break; |
| 108203 | case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 108204 | #line 495 "parse.y" |
| 108205 | { |
| 108206 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 108207 | sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0); |
| 108208 | } |
| 108209 | #line 2623 "parse.c" |
| 108210 | break; |
| 108211 | case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 108212 | #line 501 "parse.y" |
| 108213 | { |
| 108214 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 108215 | } |
| 108216 | #line 2630 "parse.c" |
| 108217 | break; |
| 108218 | case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 108219 | #line 505 "parse.y" |
| 108220 | { |
| 108221 | if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){ |
| 108222 | yygotominor.yy259 = yymsp[-4].minor.yy259; |
| 108223 | }else{ |
| 108224 | Select *pSubquery; |
| @@ -107977,180 +108225,260 @@ | |
| 108225 | sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259); |
| 108226 | pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0); |
| 108227 | yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 108228 | } |
| 108229 | } |
| 108230 | #line 2644 "parse.c" |
| 108231 | break; |
| 108232 | case 137: /* dbnm ::= */ |
| 108233 | case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); |
| 108234 | #line 530 "parse.y" |
| 108235 | {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} |
| 108236 | #line 2650 "parse.c" |
| 108237 | break; |
| 108238 | case 139: /* fullname ::= nm dbnm */ |
| 108239 | #line 535 "parse.y" |
| 108240 | {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} |
| 108241 | #line 2655 "parse.c" |
| 108242 | break; |
| 108243 | case 140: /* joinop ::= COMMA|JOIN */ |
| 108244 | #line 539 "parse.y" |
| 108245 | { yygotominor.yy4 = JT_INNER; } |
| 108246 | #line 2660 "parse.c" |
| 108247 | break; |
| 108248 | case 141: /* joinop ::= JOIN_KW JOIN */ |
| 108249 | #line 540 "parse.y" |
| 108250 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } |
| 108251 | #line 2665 "parse.c" |
| 108252 | break; |
| 108253 | case 142: /* joinop ::= JOIN_KW nm JOIN */ |
| 108254 | #line 541 "parse.y" |
| 108255 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } |
| 108256 | #line 2670 "parse.c" |
| 108257 | break; |
| 108258 | case 143: /* joinop ::= JOIN_KW nm nm JOIN */ |
| 108259 | #line 543 "parse.y" |
| 108260 | { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } |
| 108261 | #line 2675 "parse.c" |
| 108262 | break; |
| 108263 | case 144: /* on_opt ::= ON expr */ |
| 108264 | case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155); |
| 108265 | case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162); |
| 108266 | case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169); |
| 108267 | case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235); |
| 108268 | case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237); |
| 108269 | #line 547 "parse.y" |
| 108270 | {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;} |
| 108271 | #line 2685 "parse.c" |
| 108272 | break; |
| 108273 | case 145: /* on_opt ::= */ |
| 108274 | case 161: /* having_opt ::= */ yytestcase(yyruleno==161); |
| 108275 | case 168: /* where_opt ::= */ yytestcase(yyruleno==168); |
| 108276 | case 236: /* case_else ::= */ yytestcase(yyruleno==236); |
| 108277 | case 238: /* case_operand ::= */ yytestcase(yyruleno==238); |
| 108278 | #line 548 "parse.y" |
| 108279 | {yygotominor.yy314 = 0;} |
| 108280 | #line 2694 "parse.c" |
| 108281 | break; |
| 108282 | case 148: /* indexed_opt ::= NOT INDEXED */ |
| 108283 | #line 563 "parse.y" |
| 108284 | {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} |
| 108285 | #line 2699 "parse.c" |
| 108286 | break; |
| 108287 | case 149: /* using_opt ::= USING LP inscollist RP */ |
| 108288 | case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181); |
| 108289 | #line 567 "parse.y" |
| 108290 | {yygotominor.yy384 = yymsp[-1].minor.yy384;} |
| 108291 | #line 2705 "parse.c" |
| 108292 | break; |
| 108293 | case 150: /* using_opt ::= */ |
| 108294 | case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180); |
| 108295 | #line 568 "parse.y" |
| 108296 | {yygotominor.yy384 = 0;} |
| 108297 | #line 2711 "parse.c" |
| 108298 | break; |
| 108299 | case 152: /* orderby_opt ::= ORDER BY sortlist */ |
| 108300 | case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160); |
| 108301 | case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239); |
| 108302 | #line 579 "parse.y" |
| 108303 | {yygotominor.yy322 = yymsp[0].minor.yy322;} |
| 108304 | #line 2718 "parse.c" |
| 108305 | break; |
| 108306 | case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */ |
| 108307 | #line 580 "parse.y" |
| 108308 | { |
| 108309 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314); |
| 108310 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108311 | } |
| 108312 | #line 2726 "parse.c" |
| 108313 | break; |
| 108314 | case 154: /* sortlist ::= sortitem sortorder */ |
| 108315 | #line 584 "parse.y" |
| 108316 | { |
| 108317 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); |
| 108318 | if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108319 | } |
| 108320 | #line 2734 "parse.c" |
| 108321 | break; |
| 108322 | case 156: /* sortorder ::= ASC */ |
| 108323 | case 158: /* sortorder ::= */ yytestcase(yyruleno==158); |
| 108324 | #line 592 "parse.y" |
| 108325 | {yygotominor.yy4 = SQLITE_SO_ASC;} |
| 108326 | #line 2740 "parse.c" |
| 108327 | break; |
| 108328 | case 157: /* sortorder ::= DESC */ |
| 108329 | #line 593 "parse.y" |
| 108330 | {yygotominor.yy4 = SQLITE_SO_DESC;} |
| 108331 | #line 2745 "parse.c" |
| 108332 | break; |
| 108333 | case 163: /* limit_opt ::= */ |
| 108334 | #line 619 "parse.y" |
| 108335 | {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;} |
| 108336 | #line 2750 "parse.c" |
| 108337 | break; |
| 108338 | case 164: /* limit_opt ::= LIMIT expr */ |
| 108339 | #line 620 "parse.y" |
| 108340 | {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;} |
| 108341 | #line 2755 "parse.c" |
| 108342 | break; |
| 108343 | case 165: /* limit_opt ::= LIMIT expr OFFSET expr */ |
| 108344 | #line 622 "parse.y" |
| 108345 | {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;} |
| 108346 | #line 2760 "parse.c" |
| 108347 | break; |
| 108348 | case 166: /* limit_opt ::= LIMIT expr COMMA expr */ |
| 108349 | #line 624 "parse.y" |
| 108350 | {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;} |
| 108351 | #line 2765 "parse.c" |
| 108352 | break; |
| 108353 | case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ |
| 108354 | #line 637 "parse.y" |
| 108355 | { |
| 108356 | sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0); |
| 108357 | sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314); |
| 108358 | } |
| 108359 | #line 2773 "parse.c" |
| 108360 | break; |
| 108361 | case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ |
| 108362 | #line 660 "parse.y" |
| 108363 | { |
| 108364 | sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0); |
| 108365 | sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); |
| 108366 | sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210); |
| 108367 | } |
| 108368 | #line 2782 "parse.c" |
| 108369 | break; |
| 108370 | case 171: /* setlist ::= setlist COMMA nm EQ expr */ |
| 108371 | #line 670 "parse.y" |
| 108372 | { |
| 108373 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108374 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108375 | } |
| 108376 | #line 2790 "parse.c" |
| 108377 | break; |
| 108378 | case 172: /* setlist ::= nm EQ expr */ |
| 108379 | #line 674 "parse.y" |
| 108380 | { |
| 108381 | yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr); |
| 108382 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108383 | } |
| 108384 | #line 2798 "parse.c" |
| 108385 | break; |
| 108386 | case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ |
| 108387 | #line 683 "parse.y" |
| 108388 | {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);} |
| 108389 | #line 2803 "parse.c" |
| 108390 | break; |
| 108391 | case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ |
| 108392 | #line 685 "parse.y" |
| 108393 | {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);} |
| 108394 | #line 2808 "parse.c" |
| 108395 | break; |
| 108396 | case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ |
| 108397 | #line 687 "parse.y" |
| 108398 | {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);} |
| 108399 | #line 2813 "parse.c" |
| 108400 | break; |
| 108401 | case 176: /* insert_cmd ::= INSERT orconf */ |
| 108402 | #line 690 "parse.y" |
| 108403 | {yygotominor.yy210 = yymsp[0].minor.yy210;} |
| 108404 | #line 2818 "parse.c" |
| 108405 | break; |
| 108406 | case 177: /* insert_cmd ::= REPLACE */ |
| 108407 | #line 691 "parse.y" |
| 108408 | {yygotominor.yy210 = OE_Replace;} |
| 108409 | #line 2823 "parse.c" |
| 108410 | break; |
| 108411 | case 178: /* itemlist ::= itemlist COMMA expr */ |
| 108412 | case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241); |
| 108413 | #line 698 "parse.y" |
| 108414 | {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);} |
| 108415 | #line 2829 "parse.c" |
| 108416 | break; |
| 108417 | case 179: /* itemlist ::= expr */ |
| 108418 | case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242); |
| 108419 | #line 700 "parse.y" |
| 108420 | {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);} |
| 108421 | #line 2835 "parse.c" |
| 108422 | break; |
| 108423 | case 182: /* inscollist ::= inscollist COMMA nm */ |
| 108424 | #line 710 "parse.y" |
| 108425 | {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);} |
| 108426 | #line 2840 "parse.c" |
| 108427 | break; |
| 108428 | case 183: /* inscollist ::= nm */ |
| 108429 | #line 712 "parse.y" |
| 108430 | {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} |
| 108431 | #line 2845 "parse.c" |
| 108432 | break; |
| 108433 | case 184: /* expr ::= term */ |
| 108434 | #line 743 "parse.y" |
| 108435 | {yygotominor.yy118 = yymsp[0].minor.yy118;} |
| 108436 | #line 2850 "parse.c" |
| 108437 | break; |
| 108438 | case 185: /* expr ::= LP expr RP */ |
| 108439 | #line 744 "parse.y" |
| 108440 | {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} |
| 108441 | #line 2855 "parse.c" |
| 108442 | break; |
| 108443 | case 186: /* term ::= NULL */ |
| 108444 | case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191); |
| 108445 | case 192: /* term ::= STRING */ yytestcase(yyruleno==192); |
| 108446 | #line 745 "parse.y" |
| 108447 | {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} |
| 108448 | #line 2862 "parse.c" |
| 108449 | break; |
| 108450 | case 187: /* expr ::= id */ |
| 108451 | case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188); |
| 108452 | #line 746 "parse.y" |
| 108453 | {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);} |
| 108454 | #line 2868 "parse.c" |
| 108455 | break; |
| 108456 | case 189: /* expr ::= nm DOT nm */ |
| 108457 | #line 748 "parse.y" |
| 108458 | { |
| 108459 | Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 108460 | Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); |
| 108461 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); |
| 108462 | spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); |
| 108463 | } |
| 108464 | #line 2878 "parse.c" |
| 108465 | break; |
| 108466 | case 190: /* expr ::= nm DOT nm DOT nm */ |
| 108467 | #line 754 "parse.y" |
| 108468 | { |
| 108469 | Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); |
| 108470 | Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); |
| 108471 | Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); |
| 108472 | Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); |
| 108473 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); |
| 108474 | spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); |
| 108475 | } |
| 108476 | #line 2890 "parse.c" |
| 108477 | break; |
| 108478 | case 193: /* expr ::= REGISTER */ |
| 108479 | #line 764 "parse.y" |
| 108480 | { |
| 108481 | /* When doing a nested parse, one can include terms in an expression |
| 108482 | ** that look like this: #1 #2 ... These terms refer to registers |
| 108483 | ** in the virtual machine. #N is the N-th register. */ |
| 108484 | if( pParse->nested==0 ){ |
| @@ -108160,32 +108488,40 @@ | |
| 108488 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); |
| 108489 | if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable); |
| 108490 | } |
| 108491 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108492 | } |
| 108493 | #line 2907 "parse.c" |
| 108494 | break; |
| 108495 | case 194: /* expr ::= VARIABLE */ |
| 108496 | #line 777 "parse.y" |
| 108497 | { |
| 108498 | spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); |
| 108499 | sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr); |
| 108500 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108501 | } |
| 108502 | #line 2916 "parse.c" |
| 108503 | break; |
| 108504 | case 195: /* expr ::= expr COLLATE ids */ |
| 108505 | #line 782 "parse.y" |
| 108506 | { |
| 108507 | yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0); |
| 108508 | yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; |
| 108509 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108510 | } |
| 108511 | #line 2925 "parse.c" |
| 108512 | break; |
| 108513 | case 196: /* expr ::= CAST LP expr AS typetoken RP */ |
| 108514 | #line 788 "parse.y" |
| 108515 | { |
| 108516 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0); |
| 108517 | spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); |
| 108518 | } |
| 108519 | #line 2933 "parse.c" |
| 108520 | break; |
| 108521 | case 197: /* expr ::= ID LP distinct exprlist RP */ |
| 108522 | #line 793 "parse.y" |
| 108523 | { |
| 108524 | if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ |
| 108525 | sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); |
| 108526 | } |
| 108527 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); |
| @@ -108192,47 +108528,59 @@ | |
| 108528 | spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); |
| 108529 | if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){ |
| 108530 | yygotominor.yy118.pExpr->flags |= EP_Distinct; |
| 108531 | } |
| 108532 | } |
| 108533 | #line 2947 "parse.c" |
| 108534 | break; |
| 108535 | case 198: /* expr ::= ID LP STAR RP */ |
| 108536 | #line 803 "parse.y" |
| 108537 | { |
| 108538 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); |
| 108539 | spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); |
| 108540 | } |
| 108541 | #line 2955 "parse.c" |
| 108542 | break; |
| 108543 | case 199: /* term ::= CTIME_KW */ |
| 108544 | #line 807 "parse.y" |
| 108545 | { |
| 108546 | /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are |
| 108547 | ** treated as functions that return constants */ |
| 108548 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); |
| 108549 | if( yygotominor.yy118.pExpr ){ |
| 108550 | yygotominor.yy118.pExpr->op = TK_CONST_FUNC; |
| 108551 | } |
| 108552 | spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); |
| 108553 | } |
| 108554 | #line 2968 "parse.c" |
| 108555 | break; |
| 108556 | case 200: /* expr ::= expr AND expr */ |
| 108557 | case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201); |
| 108558 | case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202); |
| 108559 | case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203); |
| 108560 | case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204); |
| 108561 | case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205); |
| 108562 | case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206); |
| 108563 | case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207); |
| 108564 | #line 834 "parse.y" |
| 108565 | {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);} |
| 108566 | #line 2980 "parse.c" |
| 108567 | break; |
| 108568 | case 208: /* likeop ::= LIKE_KW */ |
| 108569 | case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210); |
| 108570 | #line 847 "parse.y" |
| 108571 | {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;} |
| 108572 | #line 2986 "parse.c" |
| 108573 | break; |
| 108574 | case 209: /* likeop ::= NOT LIKE_KW */ |
| 108575 | case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211); |
| 108576 | #line 848 "parse.y" |
| 108577 | {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;} |
| 108578 | #line 2992 "parse.c" |
| 108579 | break; |
| 108580 | case 212: /* expr ::= expr likeop expr */ |
| 108581 | #line 851 "parse.y" |
| 108582 | { |
| 108583 | ExprList *pList; |
| 108584 | pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr); |
| 108585 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr); |
| 108586 | yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator); |
| @@ -108239,12 +108587,14 @@ | |
| 108587 | if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108588 | yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; |
| 108589 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108590 | if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; |
| 108591 | } |
| 108592 | #line 3006 "parse.c" |
| 108593 | break; |
| 108594 | case 213: /* expr ::= expr likeop expr ESCAPE expr */ |
| 108595 | #line 861 "parse.y" |
| 108596 | { |
| 108597 | ExprList *pList; |
| 108598 | pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108599 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr); |
| 108600 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); |
| @@ -108252,40 +108602,56 @@ | |
| 108602 | if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108603 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108604 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108605 | if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; |
| 108606 | } |
| 108607 | #line 3021 "parse.c" |
| 108608 | break; |
| 108609 | case 214: /* expr ::= expr ISNULL|NOTNULL */ |
| 108610 | #line 889 "parse.y" |
| 108611 | {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);} |
| 108612 | #line 3026 "parse.c" |
| 108613 | break; |
| 108614 | case 215: /* expr ::= expr NOT NULL */ |
| 108615 | #line 890 "parse.y" |
| 108616 | {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);} |
| 108617 | #line 3031 "parse.c" |
| 108618 | break; |
| 108619 | case 216: /* expr ::= expr IS expr */ |
| 108620 | #line 911 "parse.y" |
| 108621 | { |
| 108622 | spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118); |
| 108623 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL); |
| 108624 | } |
| 108625 | #line 3039 "parse.c" |
| 108626 | break; |
| 108627 | case 217: /* expr ::= expr IS NOT expr */ |
| 108628 | #line 915 "parse.y" |
| 108629 | { |
| 108630 | spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118); |
| 108631 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL); |
| 108632 | } |
| 108633 | #line 3047 "parse.c" |
| 108634 | break; |
| 108635 | case 218: /* expr ::= NOT expr */ |
| 108636 | case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219); |
| 108637 | #line 938 "parse.y" |
| 108638 | {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108639 | #line 3053 "parse.c" |
| 108640 | break; |
| 108641 | case 220: /* expr ::= MINUS expr */ |
| 108642 | #line 941 "parse.y" |
| 108643 | {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108644 | #line 3058 "parse.c" |
| 108645 | break; |
| 108646 | case 221: /* expr ::= PLUS expr */ |
| 108647 | #line 943 "parse.y" |
| 108648 | {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} |
| 108649 | #line 3063 "parse.c" |
| 108650 | break; |
| 108651 | case 224: /* expr ::= expr between_op expr AND expr */ |
| 108652 | #line 948 "parse.y" |
| 108653 | { |
| 108654 | ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108655 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); |
| 108656 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0); |
| 108657 | if( yygotominor.yy118.pExpr ){ |
| @@ -108295,12 +108661,14 @@ | |
| 108661 | } |
| 108662 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108663 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108664 | yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; |
| 108665 | } |
| 108666 | #line 3080 "parse.c" |
| 108667 | break; |
| 108668 | case 227: /* expr ::= expr in_op LP exprlist RP */ |
| 108669 | #line 965 "parse.y" |
| 108670 | { |
| 108671 | if( yymsp[-1].minor.yy322==0 ){ |
| 108672 | /* Expressions of the form |
| 108673 | ** |
| 108674 | ** expr1 IN () |
| @@ -108322,12 +108690,14 @@ | |
| 108690 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108691 | } |
| 108692 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108693 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108694 | } |
| 108695 | #line 3109 "parse.c" |
| 108696 | break; |
| 108697 | case 228: /* expr ::= LP select RP */ |
| 108698 | #line 990 "parse.y" |
| 108699 | { |
| 108700 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); |
| 108701 | if( yygotominor.yy118.pExpr ){ |
| 108702 | yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; |
| 108703 | ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); |
| @@ -108336,12 +108706,14 @@ | |
| 108706 | sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); |
| 108707 | } |
| 108708 | yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z; |
| 108709 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108710 | } |
| 108711 | #line 3125 "parse.c" |
| 108712 | break; |
| 108713 | case 229: /* expr ::= expr in_op LP select RP */ |
| 108714 | #line 1002 "parse.y" |
| 108715 | { |
| 108716 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); |
| 108717 | if( yygotominor.yy118.pExpr ){ |
| 108718 | yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; |
| 108719 | ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); |
| @@ -108351,12 +108723,14 @@ | |
| 108723 | } |
| 108724 | if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108725 | yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; |
| 108726 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108727 | } |
| 108728 | #line 3142 "parse.c" |
| 108729 | break; |
| 108730 | case 230: /* expr ::= expr in_op nm dbnm */ |
| 108731 | #line 1015 "parse.y" |
| 108732 | { |
| 108733 | SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); |
| 108734 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0); |
| 108735 | if( yygotominor.yy118.pExpr ){ |
| 108736 | yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); |
| @@ -108367,12 +108741,14 @@ | |
| 108741 | } |
| 108742 | if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); |
| 108743 | yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart; |
| 108744 | yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; |
| 108745 | } |
| 108746 | #line 3160 "parse.c" |
| 108747 | break; |
| 108748 | case 231: /* expr ::= EXISTS LP select RP */ |
| 108749 | #line 1029 "parse.y" |
| 108750 | { |
| 108751 | Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); |
| 108752 | if( p ){ |
| 108753 | p->x.pSelect = yymsp[-1].minor.yy387; |
| 108754 | ExprSetProperty(p, EP_xIsSelect); |
| @@ -108381,12 +108757,14 @@ | |
| 108757 | sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); |
| 108758 | } |
| 108759 | yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; |
| 108760 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108761 | } |
| 108762 | #line 3176 "parse.c" |
| 108763 | break; |
| 108764 | case 232: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 108765 | #line 1044 "parse.y" |
| 108766 | { |
| 108767 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0); |
| 108768 | if( yygotominor.yy118.pExpr ){ |
| 108769 | yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322; |
| 108770 | sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); |
| @@ -108394,38 +108772,50 @@ | |
| 108772 | sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); |
| 108773 | } |
| 108774 | yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z; |
| 108775 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 108776 | } |
| 108777 | #line 3191 "parse.c" |
| 108778 | break; |
| 108779 | case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 108780 | #line 1057 "parse.y" |
| 108781 | { |
| 108782 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr); |
| 108783 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108784 | } |
| 108785 | #line 3199 "parse.c" |
| 108786 | break; |
| 108787 | case 234: /* case_exprlist ::= WHEN expr THEN expr */ |
| 108788 | #line 1061 "parse.y" |
| 108789 | { |
| 108790 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); |
| 108791 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); |
| 108792 | } |
| 108793 | #line 3207 "parse.c" |
| 108794 | break; |
| 108795 | case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ |
| 108796 | #line 1090 "parse.y" |
| 108797 | { |
| 108798 | sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, |
| 108799 | sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4, |
| 108800 | &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4); |
| 108801 | } |
| 108802 | #line 3216 "parse.c" |
| 108803 | break; |
| 108804 | case 244: /* uniqueflag ::= UNIQUE */ |
| 108805 | case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298); |
| 108806 | #line 1097 "parse.y" |
| 108807 | {yygotominor.yy4 = OE_Abort;} |
| 108808 | #line 3222 "parse.c" |
| 108809 | break; |
| 108810 | case 245: /* uniqueflag ::= */ |
| 108811 | #line 1098 "parse.y" |
| 108812 | {yygotominor.yy4 = OE_None;} |
| 108813 | #line 3227 "parse.c" |
| 108814 | break; |
| 108815 | case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */ |
| 108816 | #line 1107 "parse.y" |
| 108817 | { |
| 108818 | Expr *p = 0; |
| 108819 | if( yymsp[-1].minor.yy0.n>0 ){ |
| 108820 | p = sqlite3Expr(pParse->db, TK_COLUMN, 0); |
| 108821 | sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); |
| @@ -108433,12 +108823,14 @@ | |
| 108823 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p); |
| 108824 | sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1); |
| 108825 | sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); |
| 108826 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108827 | } |
| 108828 | #line 3242 "parse.c" |
| 108829 | break; |
| 108830 | case 249: /* idxlist ::= nm collate sortorder */ |
| 108831 | #line 1118 "parse.y" |
| 108832 | { |
| 108833 | Expr *p = 0; |
| 108834 | if( yymsp[-1].minor.yy0.n>0 ){ |
| 108835 | p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); |
| 108836 | sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); |
| @@ -108446,214 +108838,307 @@ | |
| 108838 | yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p); |
| 108839 | sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); |
| 108840 | sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); |
| 108841 | if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; |
| 108842 | } |
| 108843 | #line 3257 "parse.c" |
| 108844 | break; |
| 108845 | case 250: /* collate ::= */ |
| 108846 | #line 1131 "parse.y" |
| 108847 | {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} |
| 108848 | #line 3262 "parse.c" |
| 108849 | break; |
| 108850 | case 252: /* cmd ::= DROP INDEX ifexists fullname */ |
| 108851 | #line 1137 "parse.y" |
| 108852 | {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);} |
| 108853 | #line 3267 "parse.c" |
| 108854 | break; |
| 108855 | case 253: /* cmd ::= VACUUM */ |
| 108856 | case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254); |
| 108857 | #line 1143 "parse.y" |
| 108858 | {sqlite3Vacuum(pParse);} |
| 108859 | #line 3273 "parse.c" |
| 108860 | break; |
| 108861 | case 255: /* cmd ::= PRAGMA nm dbnm */ |
| 108862 | #line 1151 "parse.y" |
| 108863 | {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} |
| 108864 | #line 3278 "parse.c" |
| 108865 | break; |
| 108866 | case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 108867 | #line 1152 "parse.y" |
| 108868 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} |
| 108869 | #line 3283 "parse.c" |
| 108870 | break; |
| 108871 | case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 108872 | #line 1153 "parse.y" |
| 108873 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} |
| 108874 | #line 3288 "parse.c" |
| 108875 | break; |
| 108876 | case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 108877 | #line 1155 "parse.y" |
| 108878 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} |
| 108879 | #line 3293 "parse.c" |
| 108880 | break; |
| 108881 | case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 108882 | #line 1157 "parse.y" |
| 108883 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} |
| 108884 | #line 3298 "parse.c" |
| 108885 | break; |
| 108886 | case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 108887 | #line 1175 "parse.y" |
| 108888 | { |
| 108889 | Token all; |
| 108890 | all.z = yymsp[-3].minor.yy0.z; |
| 108891 | all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; |
| 108892 | sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all); |
| 108893 | } |
| 108894 | #line 3308 "parse.c" |
| 108895 | break; |
| 108896 | case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 108897 | #line 1184 "parse.y" |
| 108898 | { |
| 108899 | sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4); |
| 108900 | yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); |
| 108901 | } |
| 108902 | #line 3316 "parse.c" |
| 108903 | break; |
| 108904 | case 272: /* trigger_time ::= BEFORE */ |
| 108905 | case 275: /* trigger_time ::= */ yytestcase(yyruleno==275); |
| 108906 | #line 1190 "parse.y" |
| 108907 | { yygotominor.yy4 = TK_BEFORE; } |
| 108908 | #line 3322 "parse.c" |
| 108909 | break; |
| 108910 | case 273: /* trigger_time ::= AFTER */ |
| 108911 | #line 1191 "parse.y" |
| 108912 | { yygotominor.yy4 = TK_AFTER; } |
| 108913 | #line 3327 "parse.c" |
| 108914 | break; |
| 108915 | case 274: /* trigger_time ::= INSTEAD OF */ |
| 108916 | #line 1192 "parse.y" |
| 108917 | { yygotominor.yy4 = TK_INSTEAD;} |
| 108918 | #line 3332 "parse.c" |
| 108919 | break; |
| 108920 | case 276: /* trigger_event ::= DELETE|INSERT */ |
| 108921 | case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277); |
| 108922 | #line 1197 "parse.y" |
| 108923 | {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;} |
| 108924 | #line 3338 "parse.c" |
| 108925 | break; |
| 108926 | case 278: /* trigger_event ::= UPDATE OF inscollist */ |
| 108927 | #line 1199 "parse.y" |
| 108928 | {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;} |
| 108929 | #line 3343 "parse.c" |
| 108930 | break; |
| 108931 | case 281: /* when_clause ::= */ |
| 108932 | case 303: /* key_opt ::= */ yytestcase(yyruleno==303); |
| 108933 | #line 1206 "parse.y" |
| 108934 | { yygotominor.yy314 = 0; } |
| 108935 | #line 3349 "parse.c" |
| 108936 | break; |
| 108937 | case 282: /* when_clause ::= WHEN expr */ |
| 108938 | case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304); |
| 108939 | #line 1207 "parse.y" |
| 108940 | { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; } |
| 108941 | #line 3355 "parse.c" |
| 108942 | break; |
| 108943 | case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 108944 | #line 1211 "parse.y" |
| 108945 | { |
| 108946 | assert( yymsp[-2].minor.yy203!=0 ); |
| 108947 | yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203; |
| 108948 | yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203; |
| 108949 | yygotominor.yy203 = yymsp[-2].minor.yy203; |
| 108950 | } |
| 108951 | #line 3365 "parse.c" |
| 108952 | break; |
| 108953 | case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 108954 | #line 1217 "parse.y" |
| 108955 | { |
| 108956 | assert( yymsp[-1].minor.yy203!=0 ); |
| 108957 | yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203; |
| 108958 | yygotominor.yy203 = yymsp[-1].minor.yy203; |
| 108959 | } |
| 108960 | #line 3374 "parse.c" |
| 108961 | break; |
| 108962 | case 286: /* trnm ::= nm DOT nm */ |
| 108963 | #line 1229 "parse.y" |
| 108964 | { |
| 108965 | yygotominor.yy0 = yymsp[0].minor.yy0; |
| 108966 | sqlite3ErrorMsg(pParse, |
| 108967 | "qualified table names are not allowed on INSERT, UPDATE, and DELETE " |
| 108968 | "statements within triggers"); |
| 108969 | } |
| 108970 | #line 3384 "parse.c" |
| 108971 | break; |
| 108972 | case 288: /* tridxby ::= INDEXED BY nm */ |
| 108973 | #line 1241 "parse.y" |
| 108974 | { |
| 108975 | sqlite3ErrorMsg(pParse, |
| 108976 | "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " |
| 108977 | "within triggers"); |
| 108978 | } |
| 108979 | #line 3393 "parse.c" |
| 108980 | break; |
| 108981 | case 289: /* tridxby ::= NOT INDEXED */ |
| 108982 | #line 1246 "parse.y" |
| 108983 | { |
| 108984 | sqlite3ErrorMsg(pParse, |
| 108985 | "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " |
| 108986 | "within triggers"); |
| 108987 | } |
| 108988 | #line 3402 "parse.c" |
| 108989 | break; |
| 108990 | case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */ |
| 108991 | #line 1259 "parse.y" |
| 108992 | { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); } |
| 108993 | #line 3407 "parse.c" |
| 108994 | break; |
| 108995 | case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */ |
| 108996 | #line 1264 "parse.y" |
| 108997 | {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);} |
| 108998 | #line 3412 "parse.c" |
| 108999 | break; |
| 109000 | case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ |
| 109001 | #line 1267 "parse.y" |
| 109002 | {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);} |
| 109003 | #line 3417 "parse.c" |
| 109004 | break; |
| 109005 | case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ |
| 109006 | #line 1271 "parse.y" |
| 109007 | {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);} |
| 109008 | #line 3422 "parse.c" |
| 109009 | break; |
| 109010 | case 294: /* trigger_cmd ::= select */ |
| 109011 | #line 1274 "parse.y" |
| 109012 | {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); } |
| 109013 | #line 3427 "parse.c" |
| 109014 | break; |
| 109015 | case 295: /* expr ::= RAISE LP IGNORE RP */ |
| 109016 | #line 1277 "parse.y" |
| 109017 | { |
| 109018 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); |
| 109019 | if( yygotominor.yy118.pExpr ){ |
| 109020 | yygotominor.yy118.pExpr->affinity = OE_Ignore; |
| 109021 | } |
| 109022 | yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; |
| 109023 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 109024 | } |
| 109025 | #line 3439 "parse.c" |
| 109026 | break; |
| 109027 | case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 109028 | #line 1285 "parse.y" |
| 109029 | { |
| 109030 | yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); |
| 109031 | if( yygotominor.yy118.pExpr ) { |
| 109032 | yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4; |
| 109033 | } |
| 109034 | yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z; |
| 109035 | yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; |
| 109036 | } |
| 109037 | #line 3451 "parse.c" |
| 109038 | break; |
| 109039 | case 297: /* raisetype ::= ROLLBACK */ |
| 109040 | #line 1296 "parse.y" |
| 109041 | {yygotominor.yy4 = OE_Rollback;} |
| 109042 | #line 3456 "parse.c" |
| 109043 | break; |
| 109044 | case 299: /* raisetype ::= FAIL */ |
| 109045 | #line 1298 "parse.y" |
| 109046 | {yygotominor.yy4 = OE_Fail;} |
| 109047 | #line 3461 "parse.c" |
| 109048 | break; |
| 109049 | case 300: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 109050 | #line 1303 "parse.y" |
| 109051 | { |
| 109052 | sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4); |
| 109053 | } |
| 109054 | #line 3468 "parse.c" |
| 109055 | break; |
| 109056 | case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 109057 | #line 1310 "parse.y" |
| 109058 | { |
| 109059 | sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314); |
| 109060 | } |
| 109061 | #line 3475 "parse.c" |
| 109062 | break; |
| 109063 | case 302: /* cmd ::= DETACH database_kw_opt expr */ |
| 109064 | #line 1313 "parse.y" |
| 109065 | { |
| 109066 | sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr); |
| 109067 | } |
| 109068 | #line 3482 "parse.c" |
| 109069 | break; |
| 109070 | case 307: /* cmd ::= REINDEX */ |
| 109071 | #line 1328 "parse.y" |
| 109072 | {sqlite3Reindex(pParse, 0, 0);} |
| 109073 | #line 3487 "parse.c" |
| 109074 | break; |
| 109075 | case 308: /* cmd ::= REINDEX nm dbnm */ |
| 109076 | #line 1329 "parse.y" |
| 109077 | {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 109078 | #line 3492 "parse.c" |
| 109079 | break; |
| 109080 | case 309: /* cmd ::= ANALYZE */ |
| 109081 | #line 1334 "parse.y" |
| 109082 | {sqlite3Analyze(pParse, 0, 0);} |
| 109083 | #line 3497 "parse.c" |
| 109084 | break; |
| 109085 | case 310: /* cmd ::= ANALYZE nm dbnm */ |
| 109086 | #line 1335 "parse.y" |
| 109087 | {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 109088 | #line 3502 "parse.c" |
| 109089 | break; |
| 109090 | case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 109091 | #line 1340 "parse.y" |
| 109092 | { |
| 109093 | sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0); |
| 109094 | } |
| 109095 | #line 3509 "parse.c" |
| 109096 | break; |
| 109097 | case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ |
| 109098 | #line 1343 "parse.y" |
| 109099 | { |
| 109100 | sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); |
| 109101 | } |
| 109102 | #line 3516 "parse.c" |
| 109103 | break; |
| 109104 | case 313: /* add_column_fullname ::= fullname */ |
| 109105 | #line 1346 "parse.y" |
| 109106 | { |
| 109107 | pParse->db->lookaside.bEnabled = 0; |
| 109108 | sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259); |
| 109109 | } |
| 109110 | #line 3524 "parse.c" |
| 109111 | break; |
| 109112 | case 316: /* cmd ::= create_vtab */ |
| 109113 | #line 1356 "parse.y" |
| 109114 | {sqlite3VtabFinishParse(pParse,0);} |
| 109115 | #line 3529 "parse.c" |
| 109116 | break; |
| 109117 | case 317: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 109118 | #line 1357 "parse.y" |
| 109119 | {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} |
| 109120 | #line 3534 "parse.c" |
| 109121 | break; |
| 109122 | case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */ |
| 109123 | #line 1358 "parse.y" |
| 109124 | { |
| 109125 | sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); |
| 109126 | } |
| 109127 | #line 3541 "parse.c" |
| 109128 | break; |
| 109129 | case 321: /* vtabarg ::= */ |
| 109130 | #line 1363 "parse.y" |
| 109131 | {sqlite3VtabArgInit(pParse);} |
| 109132 | #line 3546 "parse.c" |
| 109133 | break; |
| 109134 | case 323: /* vtabargtoken ::= ANY */ |
| 109135 | case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324); |
| 109136 | case 325: /* lp ::= LP */ yytestcase(yyruleno==325); |
| 109137 | #line 1365 "parse.y" |
| 109138 | {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} |
| 109139 | #line 3553 "parse.c" |
| 109140 | break; |
| 109141 | default: |
| 109142 | /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); |
| 109143 | /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1); |
| 109144 | /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2); |
| @@ -108751,15 +109236,17 @@ | |
| 109236 | int yymajor, /* The major type of the error token */ |
| 109237 | YYMINORTYPE yyminor /* The minor type of the error token */ |
| 109238 | ){ |
| 109239 | sqlite3ParserARG_FETCH; |
| 109240 | #define TOKEN (yyminor.yy0) |
| 109241 | #line 32 "parse.y" |
| 109242 | |
| 109243 | UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */ |
| 109244 | assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */ |
| 109245 | sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); |
| 109246 | pParse->parseError = 1; |
| 109247 | #line 3661 "parse.c" |
| 109248 | sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ |
| 109249 | } |
| 109250 | |
| 109251 | /* |
| 109252 | ** The following is executed when the parser accepts |
| @@ -108949,10 +109436,11 @@ | |
| 109436 | return; |
| 109437 | } |
| 109438 | |
| 109439 | /************** End of parse.c ***********************************************/ |
| 109440 | /************** Begin file tokenize.c ****************************************/ |
| 109441 | #line 1 "tsrc/tokenize.c" |
| 109442 | /* |
| 109443 | ** 2001 September 15 |
| 109444 | ** |
| 109445 | ** The author disclaims copyright to this source code. In place of |
| 109446 | ** a legal notice, here is a blessing: |
| @@ -109014,10 +109502,11 @@ | |
| 109502 | ** named keywordhash.h and then included into this source file by |
| 109503 | ** the #include below. |
| 109504 | */ |
| 109505 | /************** Include keywordhash.h in the middle of tokenize.c ************/ |
| 109506 | /************** Begin file keywordhash.h *************************************/ |
| 109507 | #line 1 "tsrc/keywordhash.h" |
| 109508 | /***** This file contains automatically generated code ****** |
| 109509 | ** |
| 109510 | ** The code in this file has been automatically generated by |
| 109511 | ** |
| 109512 | ** sqlite/tool/mkkeywordhash.c |
| @@ -109287,10 +109776,11 @@ | |
| 109776 | } |
| 109777 | #define SQLITE_N_KEYWORD 121 |
| 109778 | |
| 109779 | /************** End of keywordhash.h *****************************************/ |
| 109780 | /************** Continuing where we left off in tokenize.c *******************/ |
| 109781 | #line 66 "tsrc/tokenize.c" |
| 109782 | |
| 109783 | |
| 109784 | /* |
| 109785 | ** If X is a character that can be used in an identifier then |
| 109786 | ** IdChar(X) will be true. Otherwise it is false. |
| @@ -109751,10 +110241,11 @@ | |
| 110241 | return nErr; |
| 110242 | } |
| 110243 | |
| 110244 | /************** End of tokenize.c ********************************************/ |
| 110245 | /************** Begin file complete.c ****************************************/ |
| 110246 | #line 1 "tsrc/complete.c" |
| 110247 | /* |
| 110248 | ** 2001 September 15 |
| 110249 | ** |
| 110250 | ** The author disclaims copyright to this source code. In place of |
| 110251 | ** a legal notice, here is a blessing: |
| @@ -110036,10 +110527,11 @@ | |
| 110527 | #endif /* SQLITE_OMIT_UTF16 */ |
| 110528 | #endif /* SQLITE_OMIT_COMPLETE */ |
| 110529 | |
| 110530 | /************** End of complete.c ********************************************/ |
| 110531 | /************** Begin file main.c ********************************************/ |
| 110532 | #line 1 "tsrc/main.c" |
| 110533 | /* |
| 110534 | ** 2001 September 15 |
| 110535 | ** |
| 110536 | ** The author disclaims copyright to this source code. In place of |
| 110537 | ** a legal notice, here is a blessing: |
| @@ -110056,10 +110548,11 @@ | |
| 110548 | */ |
| 110549 | |
| 110550 | #ifdef SQLITE_ENABLE_FTS3 |
| 110551 | /************** Include fts3.h in the middle of main.c ***********************/ |
| 110552 | /************** Begin file fts3.h ********************************************/ |
| 110553 | #line 1 "tsrc/fts3.h" |
| 110554 | /* |
| 110555 | ** 2006 Oct 10 |
| 110556 | ** |
| 110557 | ** The author disclaims copyright to this source code. In place of |
| 110558 | ** a legal notice, here is a blessing: |
| @@ -110084,14 +110577,16 @@ | |
| 110577 | } /* extern "C" */ |
| 110578 | #endif /* __cplusplus */ |
| 110579 | |
| 110580 | /************** End of fts3.h ************************************************/ |
| 110581 | /************** Continuing where we left off in main.c ***********************/ |
| 110582 | #line 21 "tsrc/main.c" |
| 110583 | #endif |
| 110584 | #ifdef SQLITE_ENABLE_RTREE |
| 110585 | /************** Include rtree.h in the middle of main.c **********************/ |
| 110586 | /************** Begin file rtree.h *******************************************/ |
| 110587 | #line 1 "tsrc/rtree.h" |
| 110588 | /* |
| 110589 | ** 2008 May 26 |
| 110590 | ** |
| 110591 | ** The author disclaims copyright to this source code. In place of |
| 110592 | ** a legal notice, here is a blessing: |
| @@ -110116,14 +110611,16 @@ | |
| 110611 | } /* extern "C" */ |
| 110612 | #endif /* __cplusplus */ |
| 110613 | |
| 110614 | /************** End of rtree.h ***********************************************/ |
| 110615 | /************** Continuing where we left off in main.c ***********************/ |
| 110616 | #line 24 "tsrc/main.c" |
| 110617 | #endif |
| 110618 | #ifdef SQLITE_ENABLE_ICU |
| 110619 | /************** Include sqliteicu.h in the middle of main.c ******************/ |
| 110620 | /************** Begin file sqliteicu.h ***************************************/ |
| 110621 | #line 1 "tsrc/sqliteicu.h" |
| 110622 | /* |
| 110623 | ** 2008 May 26 |
| 110624 | ** |
| 110625 | ** The author disclaims copyright to this source code. In place of |
| 110626 | ** a legal notice, here is a blessing: |
| @@ -110149,10 +110646,11 @@ | |
| 110646 | #endif /* __cplusplus */ |
| 110647 | |
| 110648 | |
| 110649 | /************** End of sqliteicu.h *******************************************/ |
| 110650 | /************** Continuing where we left off in main.c ***********************/ |
| 110651 | #line 27 "tsrc/main.c" |
| 110652 | #endif |
| 110653 | |
| 110654 | #ifndef SQLITE_AMALGAMATION |
| 110655 | /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant |
| 110656 | ** contains the text of SQLITE_VERSION macro. |
| @@ -113079,10 +113577,11 @@ | |
| 113577 | return 0; |
| 113578 | } |
| 113579 | |
| 113580 | /************** End of main.c ************************************************/ |
| 113581 | /************** Begin file notify.c ******************************************/ |
| 113582 | #line 1 "tsrc/notify.c" |
| 113583 | /* |
| 113584 | ** 2009 March 3 |
| 113585 | ** |
| 113586 | ** The author disclaims copyright to this source code. In place of |
| 113587 | ** a legal notice, here is a blessing: |
| @@ -113412,10 +113911,11 @@ | |
| 113911 | } |
| 113912 | #endif |
| 113913 | |
| 113914 | /************** End of notify.c **********************************************/ |
| 113915 | /************** Begin file fts3.c ********************************************/ |
| 113916 | #line 1 "tsrc/fts3.c" |
| 113917 | /* |
| 113918 | ** 2006 Oct 10 |
| 113919 | ** |
| 113920 | ** The author disclaims copyright to this source code. In place of |
| 113921 | ** a legal notice, here is a blessing: |
| @@ -113708,10 +114208,11 @@ | |
| 114208 | ** into a single segment. |
| 114209 | */ |
| 114210 | |
| 114211 | /************** Include fts3Int.h in the middle of fts3.c ********************/ |
| 114212 | /************** Begin file fts3Int.h *****************************************/ |
| 114213 | #line 1 "tsrc/fts3Int.h" |
| 114214 | /* |
| 114215 | ** 2009 Nov 12 |
| 114216 | ** |
| 114217 | ** The author disclaims copyright to this source code. In place of |
| 114218 | ** a legal notice, here is a blessing: |
| @@ -113746,10 +114247,11 @@ | |
| 114247 | SQLITE_API extern const sqlite3_api_routines *sqlite3_api; |
| 114248 | #endif |
| 114249 | |
| 114250 | /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/ |
| 114251 | /************** Begin file fts3_tokenizer.h **********************************/ |
| 114252 | #line 1 "tsrc/fts3_tokenizer.h" |
| 114253 | /* |
| 114254 | ** 2006 July 10 |
| 114255 | ** |
| 114256 | ** The author disclaims copyright to this source code. |
| 114257 | ** |
| @@ -113900,12 +114402,14 @@ | |
| 114402 | |
| 114403 | #endif /* _FTS3_TOKENIZER_H_ */ |
| 114404 | |
| 114405 | /************** End of fts3_tokenizer.h **************************************/ |
| 114406 | /************** Continuing where we left off in fts3Int.h ********************/ |
| 114407 | #line 40 "tsrc/fts3Int.h" |
| 114408 | /************** Include fts3_hash.h in the middle of fts3Int.h ***************/ |
| 114409 | /************** Begin file fts3_hash.h ***************************************/ |
| 114410 | #line 1 "tsrc/fts3_hash.h" |
| 114411 | /* |
| 114412 | ** 2001 September 22 |
| 114413 | ** |
| 114414 | ** The author disclaims copyright to this source code. In place of |
| 114415 | ** a legal notice, here is a blessing: |
| @@ -114017,10 +114521,11 @@ | |
| 114521 | |
| 114522 | #endif /* _FTS3_HASH_H_ */ |
| 114523 | |
| 114524 | /************** End of fts3_hash.h *******************************************/ |
| 114525 | /************** Continuing where we left off in fts3Int.h ********************/ |
| 114526 | #line 41 "tsrc/fts3Int.h" |
| 114527 | |
| 114528 | /* |
| 114529 | ** This constant controls how often segments are merged. Once there are |
| 114530 | ** FTS3_MERGE_COUNT segments of level N, they are merged into a single |
| 114531 | ** segment of level N+1. |
| @@ -114493,10 +114998,11 @@ | |
| 114998 | #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */ |
| 114999 | #endif /* _FTSINT_H */ |
| 115000 | |
| 115001 | /************** End of fts3Int.h *********************************************/ |
| 115002 | /************** Continuing where we left off in fts3.c ***********************/ |
| 115003 | #line 296 "tsrc/fts3.c" |
| 115004 | #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) |
| 115005 | |
| 115006 | #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE) |
| 115007 | # define SQLITE_CORE 1 |
| 115008 | #endif |
| @@ -116264,11 +116770,41 @@ | |
| 116770 | char *aOut; |
| 116771 | int bFirstOut = 0; |
| 116772 | |
| 116773 | *paOut = 0; |
| 116774 | *pnOut = 0; |
| 116775 | |
| 116776 | /* Allocate space for the output. Both the input and output doclists |
| 116777 | ** are delta encoded. If they are in ascending order (bDescDoclist==0), |
| 116778 | ** then the first docid in each list is simply encoded as a varint. For |
| 116779 | ** each subsequent docid, the varint stored is the difference between the |
| 116780 | ** current and previous docid (a positive number - since the list is in |
| 116781 | ** ascending order). |
| 116782 | ** |
| 116783 | ** The first docid written to the output is therefore encoded using the |
| 116784 | ** same number of bytes as it is in whichever of the input lists it is |
| 116785 | ** read from. And each subsequent docid read from the same input list |
| 116786 | ** consumes either the same or less bytes as it did in the input (since |
| 116787 | ** the difference between it and the previous value in the output must |
| 116788 | ** be a positive value less than or equal to the delta value read from |
| 116789 | ** the input list). The same argument applies to all but the first docid |
| 116790 | ** read from the 'other' list. And to the contents of all position lists |
| 116791 | ** that will be copied and merged from the input to the output. |
| 116792 | ** |
| 116793 | ** However, if the first docid copied to the output is a negative number, |
| 116794 | ** then the encoding of the first docid from the 'other' input list may |
| 116795 | ** be larger in the output than it was in the input (since the delta value |
| 116796 | ** may be a larger positive integer than the actual docid). |
| 116797 | ** |
| 116798 | ** The space required to store the output is therefore the sum of the |
| 116799 | ** sizes of the two inputs, plus enough space for exactly one of the input |
| 116800 | ** docids to grow. |
| 116801 | ** |
| 116802 | ** A symetric argument may be made if the doclists are in descending |
| 116803 | ** order. |
| 116804 | */ |
| 116805 | aOut = sqlite3_malloc(n1+n2+FTS3_VARINT_MAX-1); |
| 116806 | if( !aOut ) return SQLITE_NOMEM; |
| 116807 | |
| 116808 | p = aOut; |
| 116809 | fts3GetDeltaVarint3(&p1, pEnd1, 0, &i1); |
| 116810 | fts3GetDeltaVarint3(&p2, pEnd2, 0, &i2); |
| @@ -116291,10 +116827,11 @@ | |
| 116827 | } |
| 116828 | } |
| 116829 | |
| 116830 | *paOut = aOut; |
| 116831 | *pnOut = (p-aOut); |
| 116832 | assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 ); |
| 116833 | return SQLITE_OK; |
| 116834 | } |
| 116835 | |
| 116836 | /* |
| 116837 | ** This function does a "phrase" merge of two doclists. In a phrase merge, |
| @@ -119011,10 +119548,11 @@ | |
| 119548 | |
| 119549 | #endif |
| 119550 | |
| 119551 | /************** End of fts3.c ************************************************/ |
| 119552 | /************** Begin file fts3_aux.c ****************************************/ |
| 119553 | #line 1 "tsrc/fts3_aux.c" |
| 119554 | /* |
| 119555 | ** 2011 Jan 27 |
| 119556 | ** |
| 119557 | ** The author disclaims copyright to this source code. In place of |
| 119558 | ** a legal notice, here is a blessing: |
| @@ -119487,10 +120025,11 @@ | |
| 120025 | |
| 120026 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 120027 | |
| 120028 | /************** End of fts3_aux.c ********************************************/ |
| 120029 | /************** Begin file fts3_expr.c ***************************************/ |
| 120030 | #line 1 "tsrc/fts3_expr.c" |
| 120031 | /* |
| 120032 | ** 2008 Nov 28 |
| 120033 | ** |
| 120034 | ** The author disclaims copyright to this source code. In place of |
| 120035 | ** a legal notice, here is a blessing: |
| @@ -120453,10 +120992,11 @@ | |
| 120992 | #endif |
| 120993 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 120994 | |
| 120995 | /************** End of fts3_expr.c *******************************************/ |
| 120996 | /************** Begin file fts3_hash.c ***************************************/ |
| 120997 | #line 1 "tsrc/fts3_hash.c" |
| 120998 | /* |
| 120999 | ** 2001 September 22 |
| 121000 | ** |
| 121001 | ** The author disclaims copyright to this source code. In place of |
| 121002 | ** a legal notice, here is a blessing: |
| @@ -120837,10 +121377,11 @@ | |
| 121377 | |
| 121378 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 121379 | |
| 121380 | /************** End of fts3_hash.c *******************************************/ |
| 121381 | /************** Begin file fts3_porter.c *************************************/ |
| 121382 | #line 1 "tsrc/fts3_porter.c" |
| 121383 | /* |
| 121384 | ** 2006 September 30 |
| 121385 | ** |
| 121386 | ** The author disclaims copyright to this source code. In place of |
| 121387 | ** a legal notice, here is a blessing: |
| @@ -121483,10 +122024,11 @@ | |
| 122024 | |
| 122025 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 122026 | |
| 122027 | /************** End of fts3_porter.c *****************************************/ |
| 122028 | /************** Begin file fts3_tokenizer.c **********************************/ |
| 122029 | #line 1 "tsrc/fts3_tokenizer.c" |
| 122030 | /* |
| 122031 | ** 2007 June 22 |
| 122032 | ** |
| 122033 | ** The author disclaims copyright to this source code. In place of |
| 122034 | ** a legal notice, here is a blessing: |
| @@ -121974,10 +122516,11 @@ | |
| 122516 | |
| 122517 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 122518 | |
| 122519 | /************** End of fts3_tokenizer.c **************************************/ |
| 122520 | /************** Begin file fts3_tokenizer1.c *********************************/ |
| 122521 | #line 1 "tsrc/fts3_tokenizer1.c" |
| 122522 | /* |
| 122523 | ** 2006 Oct 10 |
| 122524 | ** |
| 122525 | ** The author disclaims copyright to this source code. In place of |
| 122526 | ** a legal notice, here is a blessing: |
| @@ -122208,10 +122751,11 @@ | |
| 122751 | |
| 122752 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| 122753 | |
| 122754 | /************** End of fts3_tokenizer1.c *************************************/ |
| 122755 | /************** Begin file fts3_write.c **************************************/ |
| 122756 | #line 1 "tsrc/fts3_write.c" |
| 122757 | /* |
| 122758 | ** 2009 Oct 23 |
| 122759 | ** |
| 122760 | ** The author disclaims copyright to this source code. In place of |
| 122761 | ** a legal notice, here is a blessing: |
| @@ -125478,10 +126022,11 @@ | |
| 126022 | |
| 126023 | #endif |
| 126024 | |
| 126025 | /************** End of fts3_write.c ******************************************/ |
| 126026 | /************** Begin file fts3_snippet.c ************************************/ |
| 126027 | #line 1 "tsrc/fts3_snippet.c" |
| 126028 | /* |
| 126029 | ** 2009 Oct 23 |
| 126030 | ** |
| 126031 | ** The author disclaims copyright to this source code. In place of |
| 126032 | ** a legal notice, here is a blessing: |
| @@ -126979,10 +127524,11 @@ | |
| 127524 | |
| 127525 | #endif |
| 127526 | |
| 127527 | /************** End of fts3_snippet.c ****************************************/ |
| 127528 | /************** Begin file rtree.c *******************************************/ |
| 127529 | #line 1 "tsrc/rtree.c" |
| 127530 | /* |
| 127531 | ** 2001 September 15 |
| 127532 | ** |
| 127533 | ** The author disclaims copyright to this source code. In place of |
| 127534 | ** a legal notice, here is a blessing: |
| @@ -130260,10 +130806,11 @@ | |
| 130806 | |
| 130807 | #endif |
| 130808 | |
| 130809 | /************** End of rtree.c ***********************************************/ |
| 130810 | /************** Begin file icu.c *********************************************/ |
| 130811 | #line 1 "tsrc/icu.c" |
| 130812 | /* |
| 130813 | ** 2007 May 6 |
| 130814 | ** |
| 130815 | ** The author disclaims copyright to this source code. In place of |
| 130816 | ** a legal notice, here is a blessing: |
| @@ -130762,10 +131309,11 @@ | |
| 131309 | |
| 131310 | #endif |
| 131311 | |
| 131312 | /************** End of icu.c *************************************************/ |
| 131313 | /************** Begin file fts3_icu.c ****************************************/ |
| 131314 | #line 1 "tsrc/fts3_icu.c" |
| 131315 | /* |
| 131316 | ** 2007 June 22 |
| 131317 | ** |
| 131318 | ** The author disclaims copyright to this source code. In place of |
| 131319 | ** a legal notice, here is a blessing: |
| 131320 |
+1
-1
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.7.8" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3007008 |
| 112 | -#define SQLITE_SOURCE_ID "2011-09-04 01:27:00 6b657ae75035eb10b0ad640998d3c9eadfdffa6e" | |
| 112 | +#define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| 118 | 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.7.8" |
| 111 | #define SQLITE_VERSION_NUMBER 3007008 |
| 112 | #define SQLITE_SOURCE_ID "2011-09-04 01:27:00 6b657ae75035eb10b0ad640998d3c9eadfdffa6e" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.7.8" |
| 111 | #define SQLITE_VERSION_NUMBER 3007008 |
| 112 | #define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |