Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| SHA1 Hash: | 030035345c802bb57ba855e8a7ae395b3eeb57bf |
|---|---|
| Date: | 2012-02-07 16:20:27 |
| User: | drh |
| Comment: | Update the built-in SQLite and SQL command-line shell to the latest code from the SQLite trunk. |
Tags And Properties
- branch=trunk inherited from [bf1c21ba16]
- sym-trunk inherited from [bf1c21ba16]
Changes
Changes to src/shell.c
53 # include <editline/editline.h> 53 # include <editline/editline.h> 54 #endif 54 #endif 55 #if defined(HAVE_READLINE) && HAVE_READLINE==1 55 #if defined(HAVE_READLINE) && HAVE_READLINE==1 56 # include <readline/readline.h> 56 # include <readline/readline.h> 57 # include <readline/history.h> 57 # include <readline/history.h> 58 #endif 58 #endif 59 #if !defined(HAVE_EDITLINE) && (!defined(HAVE_READLINE) || HAVE_READLINE!=1) 59 #if !defined(HAVE_EDITLINE) && (!defined(HAVE_READLINE) || HAVE_READLINE!=1) 60 # define readline(p) local_getline(p,stdin) | 60 # define readline(p) local_getline(p,stdin,0) 61 # define add_history(X) 61 # define add_history(X) 62 # define read_history(X) 62 # define read_history(X) 63 # define write_history(X) 63 # define write_history(X) 64 # define stifle_history(X) 64 # define stifle_history(X) 65 #endif 65 #endif 66 66 67 #if defined(_WIN32) || defined(WIN32) 67 #if defined(_WIN32) || defined(WIN32) ................................................................................................................................................................................ 330 ** the text in memory obtained from malloc() and returns a pointer 330 ** the text in memory obtained from malloc() and returns a pointer 331 ** to the text. NULL is returned at end of file, or if malloc() 331 ** to the text. NULL is returned at end of file, or if malloc() 332 ** fails. 332 ** fails. 333 ** 333 ** 334 ** The interface is like "readline" but no command-line editing 334 ** The interface is like "readline" but no command-line editing 335 ** is done. 335 ** is done. 336 */ 336 */ 337 static char *local_getline(char *zPrompt, FILE *in){ | 337 static char *local_getline(char *zPrompt, FILE *in, int csvFlag){ 338 char *zLine; 338 char *zLine; 339 int nLine; 339 int nLine; 340 int n; 340 int n; > 341 int inQuote = 0; 341 342 342 if( zPrompt && *zPrompt ){ 343 if( zPrompt && *zPrompt ){ 343 printf("%s",zPrompt); 344 printf("%s",zPrompt); 344 fflush(stdout); 345 fflush(stdout); 345 } 346 } 346 nLine = 100; 347 nLine = 100; 347 zLine = malloc( nLine ); 348 zLine = malloc( nLine ); ................................................................................................................................................................................ 357 if( n==0 ){ 358 if( n==0 ){ 358 free(zLine); 359 free(zLine); 359 return 0; 360 return 0; 360 } 361 } 361 zLine[n] = 0; 362 zLine[n] = 0; 362 break; 363 break; 363 } 364 } 364 while( zLine[n] ){ n++; } | 365 while( zLine[n] ){ > 366 if( zLine[n]=='"' ) inQuote = !inQuote; > 367 n++; > 368 } 365 if( n>0 && zLine[n-1]=='\n' ){ | 369 if( n>0 && zLine[n-1]=='\n' && (!inQuote || !csvFlag) ){ 366 n--; 370 n--; 367 if( n>0 && zLine[n-1]=='\r' ) n--; 371 if( n>0 && zLine[n-1]=='\r' ) n--; 368 zLine[n] = 0; 372 zLine[n] = 0; 369 break; 373 break; 370 } 374 } 371 } 375 } 372 zLine = realloc( zLine, n+1 ); 376 zLine = realloc( zLine, n+1 ); ................................................................................................................................................................................ 379 ** zPrior is a string of prior text retrieved. If not the empty 383 ** zPrior is a string of prior text retrieved. If not the empty 380 ** string, then issue a continuation prompt. 384 ** string, then issue a continuation prompt. 381 */ 385 */ 382 static char *one_input_line(const char *zPrior, FILE *in){ 386 static char *one_input_line(const char *zPrior, FILE *in){ 383 char *zPrompt; 387 char *zPrompt; 384 char *zResult; 388 char *zResult; 385 if( in!=0 ){ 389 if( in!=0 ){ 386 return local_getline(0, in); | 390 return local_getline(0, in, 0); 387 } 391 } 388 if( zPrior && zPrior[0] ){ 392 if( zPrior && zPrior[0] ){ 389 zPrompt = continuePrompt; 393 zPrompt = continuePrompt; 390 }else{ 394 }else{ 391 zPrompt = mainPrompt; 395 zPrompt = mainPrompt; 392 } 396 } 393 zResult = readline(zPrompt); 397 zResult = readline(zPrompt); ................................................................................................................................................................................ 610 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 614 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 615 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 612 }; 616 }; 613 617 614 /* 618 /* 615 ** Output a single term of CSV. Actually, p->separator is used for 619 ** Output a single term of CSV. Actually, p->separator is used for 616 ** the separator, which may or may not be a comma. p->nullvalue is 620 ** the separator, which may or may not be a comma. p->nullvalue is 617 ** the null value. Strings are quoted using ANSI-C rules. Numbers | 621 ** the null value. Strings are quoted if necessary. 618 ** appear outside of quotes. < 619 */ 622 */ 620 static void output_csv(struct callback_data *p, const char *z, int bSep){ 623 static void output_csv(struct callback_data *p, const char *z, int bSep){ 621 FILE *out = p->out; 624 FILE *out = p->out; 622 if( z==0 ){ 625 if( z==0 ){ 623 fprintf(out,"%s",p->nullvalue); 626 fprintf(out,"%s",p->nullvalue); 624 }else{ 627 }else{ 625 int i; 628 int i; ................................................................................................................................................................................ 930 } 933 } 931 934 932 return zIn; 935 return zIn; 933 } 936 } 934 937 935 938 936 /* 939 /* 937 ** Execute a query statement that has a single result column. Print | 940 ** Execute a query statement that will generate SQL output. Print 938 ** that result column on a line by itself with a semicolon terminator. | 941 ** the result columns, comma-separated, on a line and then add a > 942 ** semicolon terminator to the end of that line. 939 ** 943 ** 940 ** This is used, for example, to show the schema of the database by < 941 ** querying the SQLITE_MASTER table. | 944 ** If the number of columns is 1 and that column contains text "--" > 945 ** then write the semicolon on a separate line. That way, if a > 946 ** "--" comment occurs at the end of the statement, the comment > 947 ** won't consume the semicolon terminator. 942 */ 948 */ 943 static int run_table_dump_query( 949 static int run_table_dump_query( 944 struct callback_data *p, /* Query context */ 950 struct callback_data *p, /* Query context */ 945 const char *zSelect, /* SELECT statement to extract content */ 951 const char *zSelect, /* SELECT statement to extract content */ 946 const char *zFirstRow /* Print before first row, if not NULL */ 952 const char *zFirstRow /* Print before first row, if not NULL */ 947 ){ 953 ){ 948 sqlite3_stmt *pSelect; 954 sqlite3_stmt *pSelect; 949 int rc; 955 int rc; > 956 int nResult; > 957 int i; > 958 const char *z; 950 rc = sqlite3_prepare(p->db, zSelect, -1, &pSelect, 0); 959 rc = sqlite3_prepare(p->db, zSelect, -1, &pSelect, 0); 951 if( rc!=SQLITE_OK || !pSelect ){ 960 if( rc!=SQLITE_OK || !pSelect ){ 952 fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); 961 fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); 953 p->nErr++; 962 p->nErr++; 954 return rc; 963 return rc; 955 } 964 } 956 rc = sqlite3_step(pSelect); 965 rc = sqlite3_step(pSelect); > 966 nResult = sqlite3_column_count(pSelect); 957 while( rc==SQLITE_ROW ){ 967 while( rc==SQLITE_ROW ){ 958 if( zFirstRow ){ 968 if( zFirstRow ){ 959 fprintf(p->out, "%s", zFirstRow); 969 fprintf(p->out, "%s", zFirstRow); 960 zFirstRow = 0; 970 zFirstRow = 0; 961 } 971 } 962 fprintf(p->out, "%s;\n", sqlite3_column_text(pSelect, 0)); | 972 z = (const char*)sqlite3_column_text(pSelect, 0); > 973 fprintf(p->out, "%s", z); > 974 for(i=1; i<nResult; i++){ > 975 fprintf(p->out, ",%s", sqlite3_column_text(pSelect, i)); > 976 } > 977 if( z==0 ) z = ""; > 978 while( z[0] && (z[0]!='-' || z[1]!='-') ) z++; > 979 if( z[0] ){ > 980 fprintf(p->out, "\n;\n"); > 981 }else{ > 982 fprintf(p->out, ";\n"); > 983 } 963 rc = sqlite3_step(pSelect); 984 rc = sqlite3_step(pSelect); 964 } 985 } 965 rc = sqlite3_finalize(pSelect); 986 rc = sqlite3_finalize(pSelect); 966 if( rc!=SQLITE_OK ){ 987 if( rc!=SQLITE_OK ){ 967 fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); 988 fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); 968 p->nErr++; 989 p->nErr++; 969 } 990 } ................................................................................................................................................................................ 1262 1283 1263 if( strcmp(zType, "table")==0 ){ 1284 if( strcmp(zType, "table")==0 ){ 1264 sqlite3_stmt *pTableInfo = 0; 1285 sqlite3_stmt *pTableInfo = 0; 1265 char *zSelect = 0; 1286 char *zSelect = 0; 1266 char *zTableInfo = 0; 1287 char *zTableInfo = 0; 1267 char *zTmp = 0; 1288 char *zTmp = 0; 1268 int nRow = 0; 1289 int nRow = 0; > 1290 int kk; 1269 1291 1270 zTableInfo = appendText(zTableInfo, "PRAGMA table_info(", 0); 1292 zTableInfo = appendText(zTableInfo, "PRAGMA table_info(", 0); 1271 zTableInfo = appendText(zTableInfo, zTable, '"'); 1293 zTableInfo = appendText(zTableInfo, zTable, '"'); 1272 zTableInfo = appendText(zTableInfo, ");", 0); 1294 zTableInfo = appendText(zTableInfo, ");", 0); 1273 1295 1274 rc = sqlite3_prepare(p->db, zTableInfo, -1, &pTableInfo, 0); 1296 rc = sqlite3_prepare(p->db, zTableInfo, -1, &pTableInfo, 0); 1275 free(zTableInfo); 1297 free(zTableInfo); 1276 if( rc!=SQLITE_OK || !pTableInfo ){ 1298 if( rc!=SQLITE_OK || !pTableInfo ){ 1277 return 1; 1299 return 1; 1278 } 1300 } 1279 1301 1280 zSelect = appendText(zSelect, "SELECT 'INSERT INTO ' || ", 0); 1302 zSelect = appendText(zSelect, "SELECT 'INSERT INTO ' || ", 0); > 1303 if( !isalpha(zTable[0]) ){ > 1304 kk = 0; > 1305 }else{ > 1306 for(kk=1; isalnum(zTable[kk]); kk++){} > 1307 } 1281 zTmp = appendText(zTmp, zTable, '"'); | 1308 zTmp = appendText(zTmp, zTable, zTable[kk] ? '"' : 0); 1282 if( zTmp ){ 1309 if( zTmp ){ 1283 zSelect = appendText(zSelect, zTmp, '\''); 1310 zSelect = appendText(zSelect, zTmp, '\''); 1284 } 1311 } 1285 zSelect = appendText(zSelect, " || ' VALUES(' || ", 0); 1312 zSelect = appendText(zSelect, " || ' VALUES(' || ", 0); 1286 rc = sqlite3_step(pTableInfo); 1313 rc = sqlite3_step(pTableInfo); 1287 while( rc==SQLITE_ROW ){ 1314 while( rc==SQLITE_ROW ){ 1288 const char *zText = (const char *)sqlite3_column_text(pTableInfo, 1); 1315 const char *zText = (const char *)sqlite3_column_text(pTableInfo, 1); 1289 zSelect = appendText(zSelect, "quote(", 0); 1316 zSelect = appendText(zSelect, "quote(", 0); 1290 zSelect = appendText(zSelect, zText, '"'); 1317 zSelect = appendText(zSelect, zText, '"'); 1291 rc = sqlite3_step(pTableInfo); 1318 rc = sqlite3_step(pTableInfo); 1292 if( rc==SQLITE_ROW ){ 1319 if( rc==SQLITE_ROW ){ 1293 zSelect = appendText(zSelect, ") || ',' || ", 0); | 1320 zSelect = appendText(zSelect, "), ", 0); 1294 }else{ 1321 }else{ 1295 zSelect = appendText(zSelect, ") ", 0); 1322 zSelect = appendText(zSelect, ") ", 0); 1296 } 1323 } 1297 nRow++; 1324 nRow++; 1298 } 1325 } 1299 rc = sqlite3_finalize(pTableInfo); 1326 rc = sqlite3_finalize(pTableInfo); 1300 if( rc!=SQLITE_OK || nRow==0 ){ 1327 if( rc!=SQLITE_OK || nRow==0 ){ ................................................................................................................................................................................ 1765 fprintf(stderr, "Error: out of memory\n"); 1792 fprintf(stderr, "Error: out of memory\n"); 1766 fclose(in); 1793 fclose(in); 1767 sqlite3_finalize(pStmt); 1794 sqlite3_finalize(pStmt); 1768 return 1; 1795 return 1; 1769 } 1796 } 1770 sqlite3_exec(p->db, "BEGIN", 0, 0, 0); 1797 sqlite3_exec(p->db, "BEGIN", 0, 0, 0); 1771 zCommit = "COMMIT"; 1798 zCommit = "COMMIT"; 1772 while( (zLine = local_getline(0, in))!=0 ){ | 1799 while( (zLine = local_getline(0, in, 1))!=0 ){ 1773 char *z; | 1800 char *z, c; > 1801 int inQuote = 0; 1774 lineno++; 1802 lineno++; 1775 azCol[0] = zLine; 1803 azCol[0] = zLine; 1776 for(i=0, z=zLine; *z && *z!='\n' && *z!='\r'; z++){ | 1804 for(i=0, z=zLine; (c = *z)!=0; z++){ > 1805 if( c=='"' ) inQuote = !inQuote; > 1806 if( c=='\n' ) lineno++; 1777 if( *z==p->separator[0] && strncmp(z, p->separator, nSep)==0 ){ | 1807 if( !inQuote && c==p->separator[0] && strncmp(z,p->separator,nSep)==0 ){ 1778 *z = 0; 1808 *z = 0; 1779 i++; 1809 i++; 1780 if( i<nCol ){ 1810 if( i<nCol ){ 1781 azCol[i] = &z[nSep]; 1811 azCol[i] = &z[nSep]; 1782 z += nSep-1; 1812 z += nSep-1; 1783 } 1813 } 1784 } 1814 } ................................................................................................................................................................................ 1790 zFile, lineno, nCol, i+1); 1820 zFile, lineno, nCol, i+1); 1791 zCommit = "ROLLBACK"; 1821 zCommit = "ROLLBACK"; 1792 free(zLine); 1822 free(zLine); 1793 rc = 1; 1823 rc = 1; 1794 break; /* from while */ 1824 break; /* from while */ 1795 } 1825 } 1796 for(i=0; i<nCol; i++){ 1826 for(i=0; i<nCol; i++){ > 1827 if( azCol[i][0]=='"' ){ > 1828 int k; > 1829 for(z=azCol[i], j=1, k=0; z[j]; j++){ > 1830 if( z[j]=='"' ){ j++; if( z[j]==0 ) break; } > 1831 z[k++] = z[j]; > 1832 } > 1833 z[k] = 0; > 1834 } 1797 sqlite3_bind_text(pStmt, i+1, azCol[i], -1, SQLITE_STATIC); 1835 sqlite3_bind_text(pStmt, i+1, azCol[i], -1, SQLITE_STATIC); 1798 } 1836 } 1799 sqlite3_step(pStmt); 1837 sqlite3_step(pStmt); 1800 rc = sqlite3_reset(pStmt); 1838 rc = sqlite3_reset(pStmt); 1801 free(zLine); 1839 free(zLine); 1802 if( rc!=SQLITE_OK ){ 1840 if( rc!=SQLITE_OK ){ 1803 fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db)); 1841 fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db)); ................................................................................................................................................................................ 2662 return rc; 2700 return rc; 2663 } 2701 } 2664 2702 2665 /* 2703 /* 2666 ** Show available command line options 2704 ** Show available command line options 2667 */ 2705 */ 2668 static const char zOptions[] = 2706 static const char zOptions[] = 2669 " -help show this message\n" < 2670 " -init filename read/process named file\n" < 2671 " -echo print commands before execution\n" < 2672 " -[no]header turn headers on or off\n" < 2673 " -bail stop after hitting an error\n" 2707 " -bail stop after hitting an error\n" 2674 " -interactive force interactive I/O\n" < 2675 " -batch force batch I/O\n" 2708 " -batch force batch I/O\n" 2676 " -column set output mode to 'column'\n" 2709 " -column set output mode to 'column'\n" > 2710 " -cmd command run \"command\" before reading stdin\n" 2677 " -csv set output mode to 'csv'\n" 2711 " -csv set output mode to 'csv'\n" > 2712 " -echo print commands before execution\n" > 2713 " -init filename read/process named file\n" > 2714 " -[no]header turn headers on or off\n" > 2715 " -help show this message\n" 2678 " -html set output mode to HTML\n" 2716 " -html set output mode to HTML\n" > 2717 " -interactive force interactive I/O\n" 2679 " -line set output mode to 'line'\n" 2718 " -line set output mode to 'line'\n" 2680 " -list set output mode to 'list'\n" 2719 " -list set output mode to 'list'\n" > 2720 #ifdef SQLITE_ENABLE_MULTIPLEX > 2721 " -multiplex enable the multiplexor VFS\n" > 2722 #endif > 2723 " -nullvalue 'text' set text string for NULL values\n" 2681 " -separator 'x' set output field separator (|)\n" 2724 " -separator 'x' set output field separator (|)\n" 2682 " -stats print memory stats before each finalize\n" 2725 " -stats print memory stats before each finalize\n" 2683 " -nullvalue 'text' set text string for NULL values\n" < 2684 " -version show SQLite version\n" 2726 " -version show SQLite version\n" 2685 " -vfs NAME use NAME as the default VFS\n" 2727 " -vfs NAME use NAME as the default VFS\n" 2686 #ifdef SQLITE_ENABLE_VFSTRACE 2728 #ifdef SQLITE_ENABLE_VFSTRACE 2687 " -vfstrace enable tracing of all VFS calls\n" 2729 " -vfstrace enable tracing of all VFS calls\n" 2688 #endif 2730 #endif 2689 #ifdef SQLITE_ENABLE_MULTIPLEX < 2690 " -multiplex enable the multiplexor VFS\n" < 2691 #endif < 2692 ; 2731 ; 2693 static void usage(int showDetail){ 2732 static void usage(int showDetail){ 2694 fprintf(stderr, 2733 fprintf(stderr, 2695 "Usage: %s [OPTIONS] FILENAME [SQL]\n" 2734 "Usage: %s [OPTIONS] FILENAME [SQL]\n" 2696 "FILENAME is the name of an SQLite database. A new database is created\n" 2735 "FILENAME is the name of an SQLite database. A new database is created\n" 2697 "if the file does not previously exist.\n", Argv0); 2736 "if the file does not previously exist.\n", Argv0); 2698 if( showDetail ){ 2737 if( showDetail ){ ................................................................................................................................................................................ 2747 ** the size of the alternative malloc heap, 2786 ** the size of the alternative malloc heap, 2748 ** and the first command to execute. 2787 ** and the first command to execute. 2749 */ 2788 */ 2750 for(i=1; i<argc-1; i++){ 2789 for(i=1; i<argc-1; i++){ 2751 char *z; 2790 char *z; 2752 if( argv[i][0]!='-' ) break; 2791 if( argv[i][0]!='-' ) break; 2753 z = argv[i]; 2792 z = argv[i]; 2754 if( z[0]=='-' && z[1]=='-' ) z++; | 2793 if( z[1]=='-' ) z++; 2755 if( strcmp(argv[i],"-separator")==0 || strcmp(argv[i],"-nullvalue")==0 ){ | 2794 if( strcmp(z,"-separator")==0 > 2795 || strcmp(z,"-nullvalue")==0 > 2796 || strcmp(z,"-cmd")==0 > 2797 ){ 2756 i++; 2798 i++; 2757 }else if( strcmp(argv[i],"-init")==0 ){ | 2799 }else if( strcmp(z,"-init")==0 ){ 2758 i++; 2800 i++; 2759 zInitFile = argv[i]; 2801 zInitFile = argv[i]; 2760 /* Need to check for batch mode here to so we can avoid printing 2802 /* Need to check for batch mode here to so we can avoid printing 2761 ** informational messages (like from process_sqliterc) before 2803 ** informational messages (like from process_sqliterc) before 2762 ** we do the actual processing of arguments later in a second pass. 2804 ** we do the actual processing of arguments later in a second pass. 2763 */ 2805 */ 2764 }else if( strcmp(argv[i],"-batch")==0 ){ | 2806 }else if( strcmp(z,"-batch")==0 ){ 2765 stdin_is_interactive = 0; 2807 stdin_is_interactive = 0; 2766 }else if( strcmp(argv[i],"-heap")==0 ){ | 2808 }else if( strcmp(z,"-heap")==0 ){ 2767 #if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5) 2809 #if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5) 2768 int j, c; 2810 int j, c; 2769 const char *zSize; 2811 const char *zSize; 2770 sqlite3_int64 szHeap; 2812 sqlite3_int64 szHeap; 2771 2813 2772 zSize = argv[++i]; 2814 zSize = argv[++i]; 2773 szHeap = atoi(zSize); 2815 szHeap = atoi(zSize); ................................................................................................................................................................................ 2776 if( c=='K' ){ szHeap *= 1000; break; } 2818 if( c=='K' ){ szHeap *= 1000; break; } 2777 if( c=='G' ){ szHeap *= 1000000000; break; } 2819 if( c=='G' ){ szHeap *= 1000000000; break; } 2778 } 2820 } 2779 if( szHeap>0x7fff0000 ) szHeap = 0x7fff0000; 2821 if( szHeap>0x7fff0000 ) szHeap = 0x7fff0000; 2780 sqlite3_config(SQLITE_CONFIG_HEAP, malloc((int)szHeap), (int)szHeap, 64); 2822 sqlite3_config(SQLITE_CONFIG_HEAP, malloc((int)szHeap), (int)szHeap, 64); 2781 #endif 2823 #endif 2782 #ifdef SQLITE_ENABLE_VFSTRACE 2824 #ifdef SQLITE_ENABLE_VFSTRACE 2783 }else if( strcmp(argv[i],"-vfstrace")==0 ){ | 2825 }else if( strcmp(z,"-vfstrace")==0 ){ 2784 extern int vfstrace_register( 2826 extern int vfstrace_register( 2785 const char *zTraceName, 2827 const char *zTraceName, 2786 const char *zOldVfsName, 2828 const char *zOldVfsName, 2787 int (*xOut)(const char*,void*), 2829 int (*xOut)(const char*,void*), 2788 void *pOutArg, 2830 void *pOutArg, 2789 int makeDefault 2831 int makeDefault 2790 ); 2832 ); 2791 vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1); 2833 vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1); 2792 #endif 2834 #endif 2793 #ifdef SQLITE_ENABLE_MULTIPLEX 2835 #ifdef SQLITE_ENABLE_MULTIPLEX 2794 }else if( strcmp(argv[i],"-multiplex")==0 ){ | 2836 }else if( strcmp(z,"-multiplex")==0 ){ 2795 extern int sqlite3_multiple_initialize(const char*,int); 2837 extern int sqlite3_multiple_initialize(const char*,int); 2796 sqlite3_multiplex_initialize(0, 1); 2838 sqlite3_multiplex_initialize(0, 1); 2797 #endif 2839 #endif 2798 }else if( strcmp(argv[i],"-vfs")==0 ){ | 2840 }else if( strcmp(z,"-vfs")==0 ){ 2799 sqlite3_vfs *pVfs = sqlite3_vfs_find(argv[++i]); 2841 sqlite3_vfs *pVfs = sqlite3_vfs_find(argv[++i]); 2800 if( pVfs ){ 2842 if( pVfs ){ 2801 sqlite3_vfs_register(pVfs, 1); 2843 sqlite3_vfs_register(pVfs, 1); 2802 }else{ 2844 }else{ 2803 fprintf(stderr, "no such VFS: \"%s\"\n", argv[i]); 2845 fprintf(stderr, "no such VFS: \"%s\"\n", argv[i]); 2804 exit(1); 2846 exit(1); 2805 } 2847 } ................................................................................................................................................................................ 2879 data.mode = MODE_Column; 2921 data.mode = MODE_Column; 2880 }else if( strcmp(z,"-csv")==0 ){ 2922 }else if( strcmp(z,"-csv")==0 ){ 2881 data.mode = MODE_Csv; 2923 data.mode = MODE_Csv; 2882 memcpy(data.separator,",",2); 2924 memcpy(data.separator,",",2); 2883 }else if( strcmp(z,"-separator")==0 ){ 2925 }else if( strcmp(z,"-separator")==0 ){ 2884 i++; 2926 i++; 2885 if(i>=argc){ 2927 if(i>=argc){ 2886 fprintf(stderr,"%s: Error: missing argument for option: %s\n", Argv0, z) | 2928 fprintf(stderr,"%s: Error: missing argument for option: %s\n", > 2929 Argv0, z); 2887 fprintf(stderr,"Use -help for a list of options.\n"); 2930 fprintf(stderr,"Use -help for a list of options.\n"); 2888 return 1; 2931 return 1; 2889 } 2932 } 2890 sqlite3_snprintf(sizeof(data.separator), data.separator, 2933 sqlite3_snprintf(sizeof(data.separator), data.separator, 2891 "%.*s",(int)sizeof(data.separator)-1,argv[i]); 2934 "%.*s",(int)sizeof(data.separator)-1,argv[i]); 2892 }else if( strcmp(z,"-nullvalue")==0 ){ 2935 }else if( strcmp(z,"-nullvalue")==0 ){ 2893 i++; 2936 i++; 2894 if(i>=argc){ 2937 if(i>=argc){ 2895 fprintf(stderr,"%s: Error: missing argument for option: %s\n", Argv0, z) | 2938 fprintf(stderr,"%s: Error: missing argument for option: %s\n", > 2939 Argv0, z); 2896 fprintf(stderr,"Use -help for a list of options.\n"); 2940 fprintf(stderr,"Use -help for a list of options.\n"); 2897 return 1; 2941 return 1; 2898 } 2942 } 2899 sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, 2943 sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, 2900 "%.*s",(int)sizeof(data.nullvalue)-1,argv[i]); 2944 "%.*s",(int)sizeof(data.nullvalue)-1,argv[i]); 2901 }else if( strcmp(z,"-header")==0 ){ 2945 }else if( strcmp(z,"-header")==0 ){ 2902 data.showHeader = 1; 2946 data.showHeader = 1; ................................................................................................................................................................................ 2923 }else if( strcmp(z,"-vfstrace")==0 ){ 2967 }else if( strcmp(z,"-vfstrace")==0 ){ 2924 i++; 2968 i++; 2925 #endif 2969 #endif 2926 #ifdef SQLITE_ENABLE_MULTIPLEX 2970 #ifdef SQLITE_ENABLE_MULTIPLEX 2927 }else if( strcmp(z,"-multiplex")==0 ){ 2971 }else if( strcmp(z,"-multiplex")==0 ){ 2928 i++; 2972 i++; 2929 #endif 2973 #endif 2930 }else if( strcmp(z,"-help")==0 || strcmp(z, "--help")==0 ){ | 2974 }else if( strcmp(z,"-help")==0 ){ 2931 usage(1); 2975 usage(1); > 2976 }else if( strcmp(z,"-cmd")==0 ){ > 2977 if( i==argc-1 ) break; > 2978 i++; > 2979 z = argv[i]; > 2980 if( z[0]=='.' ){ > 2981 rc = do_meta_command(z, &data); > 2982 if( rc && bail_on_error ) return rc; > 2983 }else{ > 2984 open_db(&data); > 2985 rc = shell_exec(data.db, z, shell_callback, &data, &zErrMsg); > 2986 if( zErrMsg!=0 ){ > 2987 fprintf(stderr,"Error: %s\n", zErrMsg); > 2988 if( bail_on_error ) return rc!=0 ? rc : 1; > 2989 }else if( rc!=0 ){ > 2990 fprintf(stderr,"Error: unable to process SQL \"%s\"\n", z); > 2991 if( bail_on_error ) return rc; > 2992 } > 2993 } 2932 }else{ 2994 }else{ 2933 fprintf(stderr,"%s: Error: unknown option: %s\n", Argv0, z); 2995 fprintf(stderr,"%s: Error: unknown option: %s\n", Argv0, z); 2934 fprintf(stderr,"Use -help for a list of options.\n"); 2996 fprintf(stderr,"Use -help for a list of options.\n"); 2935 return 1; 2997 return 1; 2936 } 2998 } 2937 } 2999 } 2938 3000
Changes to src/sqlite3.c
1 /****************************************************************************** 1 /****************************************************************************** 2 ** This file is an amalgamation of many separate C source files from SQLite 2 ** This file is an amalgamation of many separate C source files from SQLite 3 ** version 3.7.10. By combining all the individual C code files into this | 3 ** version 3.7.11. By combining all the individual C code files into this 4 ** single large file, the entire code can be compiled as a single translation 4 ** single large file, the entire code can be compiled as a single translation 5 ** unit. This allows many compilers to do optimizations that would not be 5 ** unit. This allows many compilers to do optimizations that would not be 6 ** possible if the files were compiled separately. Performance improvements 6 ** possible if the files were compiled separately. Performance improvements 7 ** of 5% or more are commonly seen when SQLite is compiled as a single 7 ** of 5% or more are commonly seen when SQLite is compiled as a single 8 ** translation unit. 8 ** translation unit. 9 ** 9 ** 10 ** This file is all you need to compile SQLite. To use SQLite in other 10 ** This file is all you need to compile SQLite. To use SQLite in other ................................................................................................................................................................................ 653 ** string contains the date and time of the check-in (UTC) and an SHA1 653 ** string contains the date and time of the check-in (UTC) and an SHA1 654 ** hash of the entire source tree. 654 ** hash of the entire source tree. 655 ** 655 ** 656 ** See also: [sqlite3_libversion()], 656 ** See also: [sqlite3_libversion()], 657 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 657 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 658 ** [sqlite_version()] and [sqlite_source_id()]. 658 ** [sqlite_version()] and [sqlite_source_id()]. 659 */ 659 */ 660 #define SQLITE_VERSION "3.7.10" | 660 #define SQLITE_VERSION "3.7.11" 661 #define SQLITE_VERSION_NUMBER 3007010 | 661 #define SQLITE_VERSION_NUMBER 3007011 662 #define SQLITE_SOURCE_ID "2012-01-11 16:16:08 9e31a275ef494ea8713a1d60a15b8 | 662 #define SQLITE_SOURCE_ID "2012-02-07 14:13:50 9497893b1b9219eac4ec2183bd90b 663 663 664 /* 664 /* 665 ** CAPI3REF: Run-Time Library Version Numbers 665 ** CAPI3REF: Run-Time Library Version Numbers 666 ** KEYWORDS: sqlite3_version, sqlite3_sourceid 666 ** KEYWORDS: sqlite3_version, sqlite3_sourceid 667 ** 667 ** 668 ** These interfaces provide the same information as the [SQLITE_VERSION], 668 ** These interfaces provide the same information as the [SQLITE_VERSION], 669 ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros 669 ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros ................................................................................................................................................................................ 3178 /* 3178 /* 3179 ** CAPI3REF: Obtain Values For URI Parameters 3179 ** CAPI3REF: Obtain Values For URI Parameters 3180 ** 3180 ** 3181 ** These are utility routines, useful to VFS implementations, that check 3181 ** These are utility routines, useful to VFS implementations, that check 3182 ** to see if a database file was a URI that contained a specific query 3182 ** to see if a database file was a URI that contained a specific query 3183 ** parameter, and if so obtains the value of that query parameter. 3183 ** parameter, and if so obtains the value of that query parameter. 3184 ** 3184 ** 3185 ** If F is the filename pointer passed into the xOpen() method of a VFS | 3185 ** If F is the database filename pointer passed into the xOpen() method of > 3186 ** a VFS implementation when the flags parameter to xOpen() has one or > 3187 ** more of the [SQLITE_OPEN_URI] or [SQLITE_OPEN_MAIN_DB] bits set and 3186 ** implementation and P is the name of the query parameter, then | 3188 ** P is the name of the query parameter, then 3187 ** sqlite3_uri_parameter(F,P) returns the value of the P 3189 ** sqlite3_uri_parameter(F,P) returns the value of the P 3188 ** parameter if it exists or a NULL pointer if P does not appear as a 3190 ** parameter if it exists or a NULL pointer if P does not appear as a 3189 ** query parameter on F. If P is a query parameter of F 3191 ** query parameter on F. If P is a query parameter of F 3190 ** has no explicit value, then sqlite3_uri_parameter(F,P) returns 3192 ** has no explicit value, then sqlite3_uri_parameter(F,P) returns 3191 ** a pointer to an empty string. 3193 ** a pointer to an empty string. 3192 ** 3194 ** 3193 ** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean 3195 ** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean 3194 ** parameter and returns true (1) or false (0) according to the value 3196 ** parameter and returns true (1) or false (0) according to the value 3195 ** of P. The value of P is true if it is "yes" or "true" or "on" or | 3197 ** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the 3196 ** a non-zero number and is false otherwise. If P is not a query parameter | 3198 ** value of query parameter P is one of "yes", "true", or "on" in any > 3199 ** case or if the value begins with a non-zero number. The > 3200 ** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of > 3201 ** query parameter P is one of "no", "false", or "off" in any case or > 3202 ** if the value begins with a numeric zero. If P is not a query > 3203 ** parameter on F or if the value of P is does not match any of the 3197 ** on F then sqlite3_uri_boolean(F,P,B) returns (B!=0). | 3204 ** above, then sqlite3_uri_boolean(F,P,B) returns (B!=0). 3198 ** 3205 ** 3199 ** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a 3206 ** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a 3200 ** 64-bit signed integer and returns that integer, or D if P does not 3207 ** 64-bit signed integer and returns that integer, or D if P does not 3201 ** exist. If the value of P is something other than an integer, then 3208 ** exist. If the value of P is something other than an integer, then 3202 ** zero is returned. 3209 ** zero is returned. 3203 ** 3210 ** 3204 ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and 3211 ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and 3205 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and 3212 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and 3206 ** is not a pathname pointer that SQLite passed into the xOpen VFS method, | 3213 ** is not a database file pathname pointer that SQLite passed into the xOpen 3207 ** then the behavior of this routine is undefined and probably undesirable. | 3214 ** VFS method, then the behavior of this routine is undefined and probably > 3215 ** undesirable. 3208 */ 3216 */ 3209 SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char * 3217 SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char * 3210 SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bD 3218 SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bD 3211 SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int 3219 SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int 3212 3220 3213 3221 3214 /* 3222 /* ................................................................................................................................................................................ 6756 ** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] 6764 ** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] 6757 ** handle invalid, and will not use it with any other sqlite3_pcache_methods2 6765 ** handle invalid, and will not use it with any other sqlite3_pcache_methods2 6758 ** functions. 6766 ** functions. 6759 ** 6767 ** 6760 ** [[the xShrink() page cache method]] 6768 ** [[the xShrink() page cache method]] 6761 ** ^SQLite invokes the xShrink() method when it wants the page cache to 6769 ** ^SQLite invokes the xShrink() method when it wants the page cache to 6762 ** free up as much of heap memory as possible. The page cache implementation 6770 ** free up as much of heap memory as possible. The page cache implementation 6763 ** is not obligated to free any memory, but well-behaved implementions should | 6771 ** is not obligated to free any memory, but well-behaved implementations should 6764 ** do their best. 6772 ** do their best. 6765 */ 6773 */ 6766 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; 6774 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; 6767 struct sqlite3_pcache_methods2 { 6775 struct sqlite3_pcache_methods2 { 6768 int iVersion; 6776 int iVersion; 6769 void *pArg; 6777 void *pArg; 6770 int (*xInit)(void*); 6778 int (*xInit)(void*); ................................................................................................................................................................................ 8008 ** A convenience macro that returns the number of elements in 8016 ** A convenience macro that returns the number of elements in 8009 ** an array. 8017 ** an array. 8010 */ 8018 */ 8011 #define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0]))) 8019 #define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0]))) 8012 8020 8013 /* 8021 /* 8014 ** The following value as a destructor means to use sqlite3DbFree(). 8022 ** The following value as a destructor means to use sqlite3DbFree(). > 8023 ** The sqlite3DbFree() routine requires two parameters instead of the > 8024 ** one parameter that destructors normally want. So we have to introduce > 8025 ** this magic value that the code knows to handle differently. Any > 8026 ** pointer will work here as long as it is distinct from SQLITE_STATIC 8015 ** This is an internal extension to SQLITE_STATIC and SQLITE_TRANSIENT. | 8027 ** and SQLITE_TRANSIENT. 8016 */ 8028 */ 8017 #define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3DbFree) | 8029 #define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3MallocSize) 8018 8030 8019 /* 8031 /* 8020 ** When SQLITE_OMIT_WSD is defined, it means that the target platform does 8032 ** When SQLITE_OMIT_WSD is defined, it means that the target platform does 8021 ** not support Writable Static Data (WSD) such as global and static variables. 8033 ** not support Writable Static Data (WSD) such as global and static variables. 8022 ** All variables must either be on the stack or dynamically allocated from 8034 ** All variables must either be on the stack or dynamically allocated from 8023 ** the heap. When WSD is unsupported, the variable declarations scattered 8035 ** the heap. When WSD is unsupported, the variable declarations scattered 8024 ** throughout the SQLite code must become constants instead. The SQLITE_WSD 8036 ** throughout the SQLite code must become constants instead. The SQLITE_WSD ................................................................................................................................................................................ 8170 /* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the 8182 /* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the 8171 ** following values. 8183 ** following values. 8172 ** 8184 ** 8173 ** NOTE: These values must match the corresponding PAGER_ values in 8185 ** NOTE: These values must match the corresponding PAGER_ values in 8174 ** pager.h. 8186 ** pager.h. 8175 */ 8187 */ 8176 #define BTREE_OMIT_JOURNAL 1 /* Do not create or use a rollback journal */ 8188 #define BTREE_OMIT_JOURNAL 1 /* Do not create or use a rollback journal */ 8177 #define BTREE_NO_READLOCK 2 /* Omit readlocks on readonly files */ < 8178 #define BTREE_MEMORY 4 /* This is an in-memory DB */ | 8189 #define BTREE_MEMORY 2 /* This is an in-memory DB */ 8179 #define BTREE_SINGLE 8 /* The file contains at most 1 b-tree */ | 8190 #define BTREE_SINGLE 4 /* The file contains at most 1 b-tree */ 8180 #define BTREE_UNORDERED 16 /* Use of a hash implementation is OK */ | 8191 #define BTREE_UNORDERED 8 /* Use of a hash implementation is OK */ 8181 8192 8182 SQLITE_PRIVATE int sqlite3BtreeClose(Btree*); 8193 SQLITE_PRIVATE int sqlite3BtreeClose(Btree*); 8183 SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int); 8194 SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int); 8184 SQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree*,int,int,int); 8195 SQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree*,int,int,int); 8185 SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*); 8196 SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*); 8186 SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve 8197 SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve 8187 SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*); 8198 SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*); ................................................................................................................................................................................ 8846 8857 8847 /* 8858 /* 8848 ** Allowed values for the flags parameter to sqlite3PagerOpen(). 8859 ** Allowed values for the flags parameter to sqlite3PagerOpen(). 8849 ** 8860 ** 8850 ** NOTE: These values must match the corresponding BTREE_ values in btree.h. 8861 ** NOTE: These values must match the corresponding BTREE_ values in btree.h. 8851 */ 8862 */ 8852 #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ 8863 #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ 8853 #define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */ < 8854 #define PAGER_MEMORY 0x0004 /* In-memory database */ | 8864 #define PAGER_MEMORY 0x0002 /* In-memory database */ 8855 8865 8856 /* 8866 /* 8857 ** Valid values for the second argument to sqlite3PagerLockingMode(). 8867 ** Valid values for the second argument to sqlite3PagerLockingMode(). 8858 */ 8868 */ 8859 #define PAGER_LOCKINGMODE_QUERY -1 8869 #define PAGER_LOCKINGMODE_QUERY -1 8860 #define PAGER_LOCKINGMODE_NORMAL 0 8870 #define PAGER_LOCKINGMODE_NORMAL 0 8861 #define PAGER_LOCKINGMODE_EXCLUSIVE 1 8871 #define PAGER_LOCKINGMODE_EXCLUSIVE 1 ................................................................................................................................................................................ 9004 ** structure. 9014 ** structure. 9005 */ 9015 */ 9006 struct PgHdr { 9016 struct PgHdr { 9007 sqlite3_pcache_page *pPage; /* Pcache object page handle */ 9017 sqlite3_pcache_page *pPage; /* Pcache object page handle */ 9008 void *pData; /* Page data */ 9018 void *pData; /* Page data */ 9009 void *pExtra; /* Extra content */ 9019 void *pExtra; /* Extra content */ 9010 PgHdr *pDirty; /* Transient list of dirty pages */ 9020 PgHdr *pDirty; /* Transient list of dirty pages */ 9011 Pgno pgno; /* Page number for this page */ < 9012 Pager *pPager; /* The pager this page is part of */ 9021 Pager *pPager; /* The pager this page is part of */ > 9022 Pgno pgno; /* Page number for this page */ 9013 #ifdef SQLITE_CHECK_PAGES 9023 #ifdef SQLITE_CHECK_PAGES 9014 u32 pageHash; /* Hash of page content */ 9024 u32 pageHash; /* Hash of page content */ 9015 #endif 9025 #endif 9016 u16 flags; /* PGHDR flags defined below */ 9026 u16 flags; /* PGHDR flags defined below */ 9017 9027 9018 /********************************************************************** 9028 /********************************************************************** 9019 ** Elements above are public. All that follows is private to pcache.c 9029 ** Elements above are public. All that follows is private to pcache.c ................................................................................................................................................................................ 9233 # define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP) 9243 # define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP) 9234 #else 9244 #else 9235 # define SQLITE_TEMPNAME_SIZE 200 9245 # define SQLITE_TEMPNAME_SIZE 200 9236 #endif 9246 #endif 9237 9247 9238 /* 9248 /* 9239 ** Determine if we are dealing with Windows NT. 9249 ** Determine if we are dealing with Windows NT. 9240 */ | 9250 ** > 9251 ** We ought to be able to determine if we are compiling for win98 or winNT > 9252 ** using the _WIN32_WINNT macro as follows: > 9253 ** 9241 #if defined(_WIN32_WINNT) | 9254 ** #if defined(_WIN32_WINNT) 9242 # define SQLITE_OS_WINNT 1 | 9255 ** # define SQLITE_OS_WINNT 1 9243 #else | 9256 ** #else 9244 # define SQLITE_OS_WINNT 0 | 9257 ** # define SQLITE_OS_WINNT 0 > 9258 ** #endif > 9259 ** > 9260 ** However, vs2005 does not set _WIN32_WINNT by default, as it ought to, > 9261 ** so the above test does not work. We'll just assume that everything is > 9262 ** winNT unless the programmer explicitly says otherwise by setting > 9263 ** SQLITE_OS_WINNT to 0. > 9264 */ > 9265 #if SQLITE_OS_WIN && !defined(SQLITE_OS_WINNT) > 9266 # define SQLITE_OS_WINNT 1 9245 #endif 9267 #endif 9246 9268 9247 /* 9269 /* 9248 ** Determine if we are dealing with WindowsCE - which has a much 9270 ** Determine if we are dealing with WindowsCE - which has a much 9249 ** reduced API. 9271 ** reduced API. 9250 */ 9272 */ 9251 #if defined(_WIN32_WCE) 9273 #if defined(_WIN32_WCE) ................................................................................................................................................................................ 9635 */ 9657 */ 9636 struct FuncDefHash { 9658 struct FuncDefHash { 9637 FuncDef *a[23]; /* Hash table for functions */ 9659 FuncDef *a[23]; /* Hash table for functions */ 9638 }; 9660 }; 9639 9661 9640 /* 9662 /* 9641 ** Each database connection is an instance of the following structure. 9663 ** Each database connection is an instance of the following structure. 9642 ** < 9643 ** The sqlite.lastRowid records the last insert rowid generated by an < 9644 ** insert statement. Inserts on views do not affect its value. Each < 9645 ** trigger has its own context, so that lastRowid can be updated inside < 9646 ** triggers as usual. The previous value will be restored once the trigger < 9647 ** exits. Upon entering a before or instead of trigger, lastRowid is no < 9648 ** longer (since after version 2.8.12) reset to -1. < 9649 ** < 9650 ** The sqlite.nChange does not count changes within triggers and keeps no < 9651 ** context. It is reset at start of sqlite3_exec. < 9652 ** The sqlite.lsChange represents the number of changes made by the last < 9653 ** insert, update, or delete statement. It remains constant throughout the < 9654 ** length of a statement and is then updated by OP_SetCounts. It keeps a < 9655 ** context stack just like lastRowid so that the count of changes < 9656 ** within a trigger is not seen outside the trigger. Changes to views do not < 9657 ** affect the value of lsChange. < 9658 ** The sqlite.csChange keeps track of the number of current changes (since < 9659 ** the last statement) and is used to update sqlite_lsChange. < 9660 ** < 9661 ** The member variables sqlite.errCode, sqlite.zErrMsg and sqlite.zErrMsg16 < 9662 ** store the most recent error code and, if applicable, string. The < 9663 ** internal function sqlite3Error() is used to set these variables < 9664 ** consistently. < 9665 */ 9664 */ 9666 struct sqlite3 { 9665 struct sqlite3 { 9667 sqlite3_vfs *pVfs; /* OS Interface */ 9666 sqlite3_vfs *pVfs; /* OS Interface */ 9668 int nDb; /* Number of backends currently in use */ < > 9667 struct Vdbe *pVdbe; /* List of active virtual machines */ > 9668 CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ > 9669 sqlite3_mutex *mutex; /* Connection mutex */ 9669 Db *aDb; /* All backends */ 9670 Db *aDb; /* All backends */ > 9671 int nDb; /* Number of backends currently in use */ 9670 int flags; /* Miscellaneous flags. See below */ 9672 int flags; /* Miscellaneous flags. See below */ > 9673 i64 lastRowid; /* ROWID of most recent insert (see above) */ 9671 unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ 9674 unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ 9672 int errCode; /* Most recent error code (SQLITE_*) */ 9675 int errCode; /* Most recent error code (SQLITE_*) */ 9673 int errMask; /* & result codes with this before returning */ 9676 int errMask; /* & result codes with this before returning */ 9674 u8 autoCommit; /* The auto-commit flag. */ 9677 u8 autoCommit; /* The auto-commit flag. */ 9675 u8 temp_store; /* 1: file 2: memory 0: default */ 9678 u8 temp_store; /* 1: file 2: memory 0: default */ 9676 u8 mallocFailed; /* True if we have seen a malloc failure */ 9679 u8 mallocFailed; /* True if we have seen a malloc failure */ 9677 u8 dfltLockMode; /* Default locking-mode for attached dbs */ 9680 u8 dfltLockMode; /* Default locking-mode for attached dbs */ 9678 signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */ 9681 signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */ 9679 u8 suppressErr; /* Do not issue error messages if true */ 9682 u8 suppressErr; /* Do not issue error messages if true */ 9680 u8 vtabOnConflict; /* Value to return for s3_vtab_on_conflict() */ 9683 u8 vtabOnConflict; /* Value to return for s3_vtab_on_conflict() */ > 9684 u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ 9681 int nextPagesize; /* Pagesize after VACUUM if >0 */ 9685 int nextPagesize; /* Pagesize after VACUUM if >0 */ 9682 int nTable; /* Number of tables in the database */ < 9683 CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ < 9684 i64 lastRowid; /* ROWID of most recent insert (see above) */ < 9685 u32 magic; /* Magic number for detect library misuse */ 9686 u32 magic; /* Magic number for detect library misuse */ 9686 int nChange; /* Value returned by sqlite3_changes() */ 9687 int nChange; /* Value returned by sqlite3_changes() */ 9687 int nTotalChange; /* Value returned by sqlite3_total_changes() */ 9688 int nTotalChange; /* Value returned by sqlite3_total_changes() */ 9688 sqlite3_mutex *mutex; /* Connection mutex */ < 9689 int aLimit[SQLITE_N_LIMIT]; /* Limits */ 9689 int aLimit[SQLITE_N_LIMIT]; /* Limits */ 9690 struct sqlite3InitInfo { /* Information used during initialization */ 9690 struct sqlite3InitInfo { /* Information used during initialization */ 9691 int iDb; /* When back is being initialized */ < 9692 int newTnum; /* Rootpage of table being initialized */ 9691 int newTnum; /* Rootpage of table being initialized */ > 9692 u8 iDb; /* Which db file is being initialized */ 9693 u8 busy; /* TRUE if currently initializing */ 9693 u8 busy; /* TRUE if currently initializing */ 9694 u8 orphanTrigger; /* Last statement is orphaned TEMP trigger */ 9694 u8 orphanTrigger; /* Last statement is orphaned TEMP trigger */ 9695 } init; 9695 } init; 9696 int nExtension; /* Number of loaded extensions */ < 9697 void **aExtension; /* Array of shared library handles */ < 9698 struct Vdbe *pVdbe; /* List of active virtual machines */ < 9699 int activeVdbeCnt; /* Number of VDBEs currently executing */ 9696 int activeVdbeCnt; /* Number of VDBEs currently executing */ 9700 int writeVdbeCnt; /* Number of active VDBEs that are writing */ 9697 int writeVdbeCnt; /* Number of active VDBEs that are writing */ 9701 int vdbeExecCnt; /* Number of nested calls to VdbeExec() */ 9698 int vdbeExecCnt; /* Number of nested calls to VdbeExec() */ > 9699 int nExtension; /* Number of loaded extensions */ > 9700 void **aExtension; /* Array of shared library handles */ 9702 void (*xTrace)(void*,const char*); /* Trace function */ 9701 void (*xTrace)(void*,const char*); /* Trace function */ 9703 void *pTraceArg; /* Argument to the trace function */ 9702 void *pTraceArg; /* Argument to the trace function */ 9704 void (*xProfile)(void*,const char*,u64); /* Profiling function */ 9703 void (*xProfile)(void*,const char*,u64); /* Profiling function */ 9705 void *pProfileArg; /* Argument to profile function */ 9704 void *pProfileArg; /* Argument to profile function */ 9706 void *pCommitArg; /* Argument to xCommitCallback() */ 9705 void *pCommitArg; /* Argument to xCommitCallback() */ 9707 int (*xCommitCallback)(void*); /* Invoked at every commit. */ 9706 int (*xCommitCallback)(void*); /* Invoked at every commit. */ 9708 void *pRollbackArg; /* Argument to xRollbackCallback() */ 9707 void *pRollbackArg; /* Argument to xRollbackCallback() */ ................................................................................................................................................................................ 9731 #endif 9730 #endif 9732 #ifndef SQLITE_OMIT_PROGRESS_CALLBACK 9731 #ifndef SQLITE_OMIT_PROGRESS_CALLBACK 9733 int (*xProgress)(void *); /* The progress callback */ 9732 int (*xProgress)(void *); /* The progress callback */ 9734 void *pProgressArg; /* Argument to the progress callback */ 9733 void *pProgressArg; /* Argument to the progress callback */ 9735 int nProgressOps; /* Number of opcodes for progress callback */ 9734 int nProgressOps; /* Number of opcodes for progress callback */ 9736 #endif 9735 #endif 9737 #ifndef SQLITE_OMIT_VIRTUALTABLE 9736 #ifndef SQLITE_OMIT_VIRTUALTABLE > 9737 int nVTrans; /* Allocated size of aVTrans */ 9738 Hash aModule; /* populated by sqlite3_create_module() */ 9738 Hash aModule; /* populated by sqlite3_create_module() */ 9739 VtabCtx *pVtabCtx; /* Context for active vtab connect/create */ 9739 VtabCtx *pVtabCtx; /* Context for active vtab connect/create */ 9740 VTable **aVTrans; /* Virtual tables with open transactions */ 9740 VTable **aVTrans; /* Virtual tables with open transactions */ 9741 int nVTrans; /* Allocated size of aVTrans */ < 9742 VTable *pDisconnect; /* Disconnect these in next sqlite3_prepare() */ 9741 VTable *pDisconnect; /* Disconnect these in next sqlite3_prepare() */ 9743 #endif 9742 #endif 9744 FuncDefHash aFunc; /* Hash table of connection functions */ 9743 FuncDefHash aFunc; /* Hash table of connection functions */ 9745 Hash aCollSeq; /* All collating sequences */ 9744 Hash aCollSeq; /* All collating sequences */ 9746 BusyHandler busyHandler; /* Busy callback */ 9745 BusyHandler busyHandler; /* Busy callback */ 9747 int busyTimeout; /* Busy handler timeout, in msec */ < 9748 Db aDbStatic[2]; /* Static space for the 2 default backends */ 9746 Db aDbStatic[2]; /* Static space for the 2 default backends */ 9749 Savepoint *pSavepoint; /* List of active savepoints */ 9747 Savepoint *pSavepoint; /* List of active savepoints */ > 9748 int busyTimeout; /* Busy handler timeout, in msec */ 9750 int nSavepoint; /* Number of non-transaction savepoints */ 9749 int nSavepoint; /* Number of non-transaction savepoints */ 9751 int nStatement; /* Number of nested statement-transactions */ 9750 int nStatement; /* Number of nested statement-transactions */ 9752 u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ < 9753 i64 nDeferredCons; /* Net deferred constraints this transaction. */ 9751 i64 nDeferredCons; /* Net deferred constraints this transaction. */ 9754 int *pnBytesFreed; /* If not NULL, increment this in DbFree() */ 9752 int *pnBytesFreed; /* If not NULL, increment this in DbFree() */ 9755 9753 9756 #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY 9754 #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY 9757 /* The following variables are all protected by the STATIC_MASTER 9755 /* The following variables are all protected by the STATIC_MASTER 9758 ** mutex, not by sqlite3.mutex. They are used by code in notify.c. 9756 ** mutex, not by sqlite3.mutex. They are used by code in notify.c. 9759 ** 9757 ** ................................................................................................................................................................................ 9788 /* DELETE, or UPDATE and return */ 9786 /* DELETE, or UPDATE and return */ 9789 /* the count using a callback. */ 9787 /* the count using a callback. */ 9790 #define SQLITE_NullCallback 0x00002000 /* Invoke the callback once if the */ 9788 #define SQLITE_NullCallback 0x00002000 /* Invoke the callback once if the */ 9791 /* result set is empty */ 9789 /* result set is empty */ 9792 #define SQLITE_SqlTrace 0x00004000 /* Debug print SQL as it executes */ 9790 #define SQLITE_SqlTrace 0x00004000 /* Debug print SQL as it executes */ 9793 #define SQLITE_VdbeListing 0x00008000 /* Debug listings of VDBE programs */ 9791 #define SQLITE_VdbeListing 0x00008000 /* Debug listings of VDBE programs */ 9794 #define SQLITE_WriteSchema 0x00010000 /* OK to update SQLITE_MASTER */ 9792 #define SQLITE_WriteSchema 0x00010000 /* OK to update SQLITE_MASTER */ 9795 #define SQLITE_NoReadlock 0x00020000 /* Readlocks are omitted when | 9793 /* 0x00020000 Unused */ 9796 ** accessing read-only databases */ < 9797 #define SQLITE_IgnoreChecks 0x00040000 /* Do not enforce check constraints */ 9794 #define SQLITE_IgnoreChecks 0x00040000 /* Do not enforce check constraints */ 9798 #define SQLITE_ReadUncommitted 0x0080000 /* For shared-cache mode */ 9795 #define SQLITE_ReadUncommitted 0x0080000 /* For shared-cache mode */ 9799 #define SQLITE_LegacyFileFmt 0x00100000 /* Create new databases in format 1 */ 9796 #define SQLITE_LegacyFileFmt 0x00100000 /* Create new databases in format 1 */ 9800 #define SQLITE_FullFSync 0x00200000 /* Use full fsync on the backend */ 9797 #define SQLITE_FullFSync 0x00200000 /* Use full fsync on the backend */ 9801 #define SQLITE_CkptFullFSync 0x00400000 /* Use full fsync for checkpoint */ 9798 #define SQLITE_CkptFullFSync 0x00400000 /* Use full fsync for checkpoint */ 9802 #define SQLITE_RecoveryMode 0x00800000 /* Ignore schema errors */ 9799 #define SQLITE_RecoveryMode 0x00800000 /* Ignore schema errors */ 9803 #define SQLITE_ReverseOrder 0x01000000 /* Reverse unordered SELECTs */ 9800 #define SQLITE_ReverseOrder 0x01000000 /* Reverse unordered SELECTs */ ................................................................................................................................................................................ 9878 /* 9875 /* 9879 ** Possible values for FuncDef.flags 9876 ** Possible values for FuncDef.flags 9880 */ 9877 */ 9881 #define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */ 9878 #define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */ 9882 #define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */ 9879 #define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */ 9883 #define SQLITE_FUNC_EPHEM 0x04 /* Ephemeral. Delete with VDBE */ 9880 #define SQLITE_FUNC_EPHEM 0x04 /* Ephemeral. Delete with VDBE */ 9884 #define SQLITE_FUNC_NEEDCOLL 0x08 /* sqlite3GetFuncCollSeq() might be called */ 9881 #define SQLITE_FUNC_NEEDCOLL 0x08 /* sqlite3GetFuncCollSeq() might be called */ 9885 #define SQLITE_FUNC_PRIVATE 0x10 /* Allowed for internal use only */ < 9886 #define SQLITE_FUNC_COUNT 0x20 /* Built-in count(*) aggregate */ 9882 #define SQLITE_FUNC_COUNT 0x20 /* Built-in count(*) aggregate */ 9887 #define SQLITE_FUNC_COALESCE 0x40 /* Built-in coalesce() or ifnull() function */ 9883 #define SQLITE_FUNC_COALESCE 0x40 /* Built-in coalesce() or ifnull() function */ 9888 9884 9889 /* 9885 /* 9890 ** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are 9886 ** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are 9891 ** used to create the initializers for the FuncDef structures. 9887 ** used to create the initializers for the FuncDef structures. 9892 ** 9888 ** ................................................................................................................................................................................ 10161 ** Allowed values for Tabe.tabFlags. 10157 ** Allowed values for Tabe.tabFlags. 10162 */ 10158 */ 10163 #define TF_Readonly 0x01 /* Read-only system table */ 10159 #define TF_Readonly 0x01 /* Read-only system table */ 10164 #define TF_Ephemeral 0x02 /* An ephemeral table */ 10160 #define TF_Ephemeral 0x02 /* An ephemeral table */ 10165 #define TF_HasPrimaryKey 0x04 /* Table has a primary key */ 10161 #define TF_HasPrimaryKey 0x04 /* Table has a primary key */ 10166 #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */ 10162 #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */ 10167 #define TF_Virtual 0x10 /* Is a virtual table */ 10163 #define TF_Virtual 0x10 /* Is a virtual table */ 10168 #define TF_NeedMetadata 0x20 /* aCol[].zType and aCol[].pColl missing */ < 10169 < 10170 10164 10171 10165 10172 /* 10166 /* 10173 ** Test to see whether or not a table is a virtual table. This is 10167 ** Test to see whether or not a table is a virtual table. This is 10174 ** done as a macro so that it will be optimized out when virtual 10168 ** done as a macro so that it will be optimized out when virtual 10175 ** table support is omitted from the build. 10169 ** table support is omitted from the build. 10176 */ 10170 */ ................................................................................................................................................................................ 10324 ** it means this is not a unique index. Otherwise it is a unique index 10318 ** it means this is not a unique index. Otherwise it is a unique index 10325 ** and the value of Index.onError indicate the which conflict resolution 10319 ** and the value of Index.onError indicate the which conflict resolution 10326 ** algorithm to employ whenever an attempt is made to insert a non-unique 10320 ** algorithm to employ whenever an attempt is made to insert a non-unique 10327 ** element. 10321 ** element. 10328 */ 10322 */ 10329 struct Index { 10323 struct Index { 10330 char *zName; /* Name of this index */ 10324 char *zName; /* Name of this index */ 10331 int nColumn; /* Number of columns in the table used by this index */ < 10332 int *aiColumn; /* Which columns are used by this index. 1st is 0 */ 10325 int *aiColumn; /* Which columns are used by this index. 1st is 0 */ 10333 tRowcnt *aiRowEst; /* Result of ANALYZE: Est. rows selected by each column */ 10326 tRowcnt *aiRowEst; /* Result of ANALYZE: Est. rows selected by each column */ 10334 Table *pTable; /* The SQL table being indexed */ 10327 Table *pTable; /* The SQL table being indexed */ 10335 int tnum; /* Page containing root of this index in database file */ < 10336 u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ < 10337 u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */ < 10338 u8 bUnordered; /* Use this index for == or IN queries only */ < 10339 char *zColAff; /* String defining the affinity of each column */ 10328 char *zColAff; /* String defining the affinity of each column */ 10340 Index *pNext; /* The next index associated with the same table */ 10329 Index *pNext; /* The next index associated with the same table */ 10341 Schema *pSchema; /* Schema containing this index */ 10330 Schema *pSchema; /* Schema containing this index */ 10342 u8 *aSortOrder; /* Array of size Index.nColumn. True==DESC, False==ASC */ 10331 u8 *aSortOrder; /* Array of size Index.nColumn. True==DESC, False==ASC */ 10343 char **azColl; /* Array of collation sequence names for index */ 10332 char **azColl; /* Array of collation sequence names for index */ > 10333 int nColumn; /* Number of columns in the table used by this index */ > 10334 int tnum; /* Page containing root of this index in database file */ > 10335 u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ > 10336 u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */ > 10337 u8 bUnordered; /* Use this index for == or IN queries only */ 10344 #ifdef SQLITE_ENABLE_STAT3 10338 #ifdef SQLITE_ENABLE_STAT3 10345 int nSample; /* Number of elements in aSample[] */ 10339 int nSample; /* Number of elements in aSample[] */ 10346 tRowcnt avgEq; /* Average nEq value for key values not in aSample */ 10340 tRowcnt avgEq; /* Average nEq value for key values not in aSample */ 10347 IndexSample *aSample; /* Samples of the left-most key */ 10341 IndexSample *aSample; /* Samples of the left-most key */ 10348 #endif 10342 #endif 10349 }; 10343 }; 10350 10344 ................................................................................................................................................................................ 10395 struct AggInfo { 10389 struct AggInfo { 10396 u8 directMode; /* Direct rendering mode means take data directly 10390 u8 directMode; /* Direct rendering mode means take data directly 10397 ** from source tables rather than from accumulators */ 10391 ** from source tables rather than from accumulators */ 10398 u8 useSortingIdx; /* In direct mode, reference the sorting index rather 10392 u8 useSortingIdx; /* In direct mode, reference the sorting index rather 10399 ** than the source table */ 10393 ** than the source table */ 10400 int sortingIdx; /* Cursor number of the sorting index */ 10394 int sortingIdx; /* Cursor number of the sorting index */ 10401 int sortingIdxPTab; /* Cursor number of pseudo-table */ 10395 int sortingIdxPTab; /* Cursor number of pseudo-table */ 10402 ExprList *pGroupBy; /* The group by clause */ < 10403 int nSortingColumn; /* Number of columns in the sorting index */ 10396 int nSortingColumn; /* Number of columns in the sorting index */ > 10397 ExprList *pGroupBy; /* The group by clause */ 10404 struct AggInfo_col { /* For each column used in source tables */ 10398 struct AggInfo_col { /* For each column used in source tables */ 10405 Table *pTab; /* Source table */ 10399 Table *pTab; /* Source table */ 10406 int iTable; /* Cursor number of the source table */ 10400 int iTable; /* Cursor number of the source table */ 10407 int iColumn; /* Column number within the source table */ 10401 int iColumn; /* Column number within the source table */ 10408 int iSorterColumn; /* Column number in the sorting index */ 10402 int iSorterColumn; /* Column number in the sorting index */ 10409 int iMem; /* Memory location that acts as accumulator */ 10403 int iMem; /* Memory location that acts as accumulator */ 10410 Expr *pExpr; /* The original expression */ 10404 Expr *pExpr; /* The original expression */ 10411 } *aCol; 10405 } *aCol; 10412 int nColumn; /* Number of used entries in aCol[] */ 10406 int nColumn; /* Number of used entries in aCol[] */ 10413 int nColumnAlloc; /* Number of slots allocated for aCol[] */ < 10414 int nAccumulator; /* Number of columns that show through to the output. 10407 int nAccumulator; /* Number of columns that show through to the output. 10415 ** Additional columns are used only as parameters to 10408 ** Additional columns are used only as parameters to 10416 ** aggregate functions */ 10409 ** aggregate functions */ 10417 struct AggInfo_func { /* For each aggregate function */ 10410 struct AggInfo_func { /* For each aggregate function */ 10418 Expr *pExpr; /* Expression encoding the function */ 10411 Expr *pExpr; /* Expression encoding the function */ 10419 FuncDef *pFunc; /* The aggregate function implementation */ 10412 FuncDef *pFunc; /* The aggregate function implementation */ 10420 int iMem; /* Memory location that acts as accumulator */ 10413 int iMem; /* Memory location that acts as accumulator */ 10421 int iDistinct; /* Ephemeral table used to enforce DISTINCT */ 10414 int iDistinct; /* Ephemeral table used to enforce DISTINCT */ 10422 } *aFunc; 10415 } *aFunc; 10423 int nFunc; /* Number of entries in aFunc[] */ 10416 int nFunc; /* Number of entries in aFunc[] */ 10424 int nFuncAlloc; /* Number of slots allocated for aFunc[] */ < 10425 }; 10417 }; 10426 10418 10427 /* 10419 /* 10428 ** The datatype ynVar is a signed integer, either 16-bit or 32-bit. 10420 ** The datatype ynVar is a signed integer, either 16-bit or 32-bit. 10429 ** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater 10421 ** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater 10430 ** than 32767 we have to make it 32-bit. 16-bit is preferred because 10422 ** than 32767 we have to make it 32-bit. 16-bit is preferred because 10431 ** it uses less memory in the Expr object, which is a big memory user 10423 ** it uses less memory in the Expr object, which is a big memory user ................................................................................................................................................................................ 10614 ** as the list of "expr AS ID" fields following a "SELECT" or in the 10606 ** as the list of "expr AS ID" fields following a "SELECT" or in the 10615 ** list of "ID = expr" items in an UPDATE. A list of expressions can 10607 ** list of "ID = expr" items in an UPDATE. A list of expressions can 10616 ** also be used as the argument to a function, in which case the a.zName 10608 ** also be used as the argument to a function, in which case the a.zName 10617 ** field is not used. 10609 ** field is not used. 10618 */ 10610 */ 10619 struct ExprList { 10611 struct ExprList { 10620 int nExpr; /* Number of expressions on the list */ 10612 int nExpr; /* Number of expressions on the list */ 10621 int nAlloc; /* Number of entries allocated below */ < 10622 int iECursor; /* VDBE Cursor associated with this ExprList */ 10613 int iECursor; /* VDBE Cursor associated with this ExprList */ 10623 struct ExprList_item { | 10614 struct ExprList_item { /* For each expression in the list */ 10624 Expr *pExpr; /* The list of expressions */ 10615 Expr *pExpr; /* The list of expressions */ 10625 char *zName; /* Token associated with this expression */ 10616 char *zName; /* Token associated with this expression */ 10626 char *zSpan; /* Original text of the expression */ 10617 char *zSpan; /* Original text of the expression */ 10627 u8 sortOrder; /* 1 for DESC or 0 for ASC */ 10618 u8 sortOrder; /* 1 for DESC or 0 for ASC */ 10628 u8 done; /* A flag to indicate when processing is finished */ 10619 u8 done; /* A flag to indicate when processing is finished */ 10629 u16 iOrderByCol; /* For ORDER BY, column number in result set */ 10620 u16 iOrderByCol; /* For ORDER BY, column number in result set */ 10630 u16 iAlias; /* Index into Parse.aAlias[] for zName */ 10621 u16 iAlias; /* Index into Parse.aAlias[] for zName */ 10631 } *a; /* One entry for each expression */ | 10622 } *a; /* Alloc a power of two greater or equal to nExpr */ 10632 }; 10623 }; 10633 10624 10634 /* 10625 /* 10635 ** An instance of this structure is used by the parser to record both 10626 ** An instance of this structure is used by the parser to record both 10636 ** the parse tree for an expression and the span of input text for an 10627 ** the parse tree for an expression and the span of input text for an 10637 ** expression. 10628 ** expression. 10638 */ 10629 */ ................................................................................................................................................................................ 10659 */ 10650 */ 10660 struct IdList { 10651 struct IdList { 10661 struct IdList_item { 10652 struct IdList_item { 10662 char *zName; /* Name of the identifier */ 10653 char *zName; /* Name of the identifier */ 10663 int idx; /* Index in some Table.aCol[] of a column named zName */ 10654 int idx; /* Index in some Table.aCol[] of a column named zName */ 10664 } *a; 10655 } *a; 10665 int nId; /* Number of identifiers on the list */ 10656 int nId; /* Number of identifiers on the list */ 10666 int nAlloc; /* Number of entries allocated for a[] below */ < 10667 }; 10657 }; 10668 10658 10669 /* 10659 /* 10670 ** The bitmask datatype defined below is used for various optimizations. 10660 ** The bitmask datatype defined below is used for various optimizations. 10671 ** 10661 ** 10672 ** Changing this from a 64-bit to a 32-bit type limits the number of 10662 ** Changing this from a 64-bit to a 32-bit type limits the number of 10673 ** tables in a join to 32 instead of 64. But it also reduces the size 10663 ** tables in a join to 32 instead of 64. But it also reduces the size ................................................................................................................................................................................ 10903 ** sequences for the ORDER BY clause. 10893 ** sequences for the ORDER BY clause. 10904 */ 10894 */ 10905 struct Select { 10895 struct Select { 10906 ExprList *pEList; /* The fields of the result */ 10896 ExprList *pEList; /* The fields of the result */ 10907 u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */ 10897 u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */ 10908 char affinity; /* MakeRecord with this affinity for SRT_Set */ 10898 char affinity; /* MakeRecord with this affinity for SRT_Set */ 10909 u16 selFlags; /* Various SF_* values */ 10899 u16 selFlags; /* Various SF_* values */ > 10900 int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */ > 10901 int addrOpenEphm[3]; /* OP_OpenEphem opcodes related to this select */ > 10902 double nSelectRow; /* Estimated number of result rows */ 10910 SrcList *pSrc; /* The FROM clause */ 10903 SrcList *pSrc; /* The FROM clause */ 10911 Expr *pWhere; /* The WHERE clause */ 10904 Expr *pWhere; /* The WHERE clause */ 10912 ExprList *pGroupBy; /* The GROUP BY clause */ 10905 ExprList *pGroupBy; /* The GROUP BY clause */ 10913 Expr *pHaving; /* The HAVING clause */ 10906 Expr *pHaving; /* The HAVING clause */ 10914 ExprList *pOrderBy; /* The ORDER BY clause */ 10907 ExprList *pOrderBy; /* The ORDER BY clause */ 10915 Select *pPrior; /* Prior select in a compound select statement */ 10908 Select *pPrior; /* Prior select in a compound select statement */ 10916 Select *pNext; /* Next select to the left in a compound */ 10909 Select *pNext; /* Next select to the left in a compound */ 10917 Select *pRightmost; /* Right-most select in a compound select statement */ 10910 Select *pRightmost; /* Right-most select in a compound select statement */ 10918 Expr *pLimit; /* LIMIT expression. NULL means not used. */ 10911 Expr *pLimit; /* LIMIT expression. NULL means not used. */ 10919 Expr *pOffset; /* OFFSET expression. NULL means not used. */ 10912 Expr *pOffset; /* OFFSET expression. NULL means not used. */ 10920 int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */ < 10921 int addrOpenEphm[3]; /* OP_OpenEphem opcodes related to this select */ < 10922 double nSelectRow; /* Estimated number of result rows */ < 10923 }; 10913 }; 10924 10914 10925 /* 10915 /* 10926 ** Allowed values for Select.selFlags. The "SF" prefix stands for 10916 ** Allowed values for Select.selFlags. The "SF" prefix stands for 10927 ** "Select Flag". 10917 ** "Select Flag". 10928 */ 10918 */ 10929 #define SF_Distinct 0x01 /* Output should be DISTINCT */ 10919 #define SF_Distinct 0x01 /* Output should be DISTINCT */ 10930 #define SF_Resolved 0x02 /* Identifiers have been resolved */ 10920 #define SF_Resolved 0x02 /* Identifiers have been resolved */ 10931 #define SF_Aggregate 0x04 /* Contains aggregate functions */ 10921 #define SF_Aggregate 0x04 /* Contains aggregate functions */ 10932 #define SF_UsesEphemeral 0x08 /* Uses the OpenEphemeral opcode */ 10922 #define SF_UsesEphemeral 0x08 /* Uses the OpenEphemeral opcode */ 10933 #define SF_Expanded 0x10 /* sqlite3SelectExpand() called on this */ 10923 #define SF_Expanded 0x10 /* sqlite3SelectExpand() called on this */ 10934 #define SF_HasTypeInfo 0x20 /* FROM subqueries have Table metadata */ 10924 #define SF_HasTypeInfo 0x20 /* FROM subqueries have Table metadata */ 10935 #define SF_UseSorter 0x40 /* Sort using a sorter */ 10925 #define SF_UseSorter 0x40 /* Sort using a sorter */ > 10926 #define SF_Values 0x80 /* Synthesized from VALUES clause */ 10936 10927 10937 10928 10938 /* 10929 /* 10939 ** The results of a select can be distributed in several ways. The 10930 ** The results of a select can be distributed in several ways. The 10940 ** "SRT" prefix means "SELECT Result Type". 10931 ** "SRT" prefix means "SELECT Result Type". 10941 */ 10932 */ 10942 #define SRT_Union 1 /* Store result as keys in an index */ 10933 #define SRT_Union 1 /* Store result as keys in an index */ ................................................................................................................................................................................ 11006 ** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns 10997 ** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns 11007 ** accessed (or set to 0 for triggers fired as a result of INSERT 10998 ** accessed (or set to 0 for triggers fired as a result of INSERT 11008 ** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to 10999 ** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to 11009 ** a mask of new.* columns used by the program. 11000 ** a mask of new.* columns used by the program. 11010 */ 11001 */ 11011 struct TriggerPrg { 11002 struct TriggerPrg { 11012 Trigger *pTrigger; /* Trigger this program was coded from */ 11003 Trigger *pTrigger; /* Trigger this program was coded from */ 11013 int orconf; /* Default ON CONFLICT policy */ | 11004 TriggerPrg *pNext; /* Next entry in Parse.pTriggerPrg list */ 11014 SubProgram *pProgram; /* Program implementing pTrigger/orconf */ 11005 SubProgram *pProgram; /* Program implementing pTrigger/orconf */ > 11006 int orconf; /* Default ON CONFLICT policy */ 11015 u32 aColmask[2]; /* Masks of old.*, new.* columns accessed */ 11007 u32 aColmask[2]; /* Masks of old.*, new.* columns accessed */ 11016 TriggerPrg *pNext; /* Next entry in Parse.pTriggerPrg list */ < 11017 }; 11008 }; 11018 11009 11019 /* 11010 /* 11020 ** The yDbMask datatype for the bitmask of all attached databases. 11011 ** The yDbMask datatype for the bitmask of all attached databases. 11021 */ 11012 */ 11022 #if SQLITE_MAX_ATTACHED>30 11013 #if SQLITE_MAX_ATTACHED>30 11023 typedef sqlite3_uint64 yDbMask; 11014 typedef sqlite3_uint64 yDbMask; ................................................................................................................................................................................ 11039 ** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are 11030 ** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are 11040 ** used to store the set of table-locks required by the statement being 11031 ** used to store the set of table-locks required by the statement being 11041 ** compiled. Function sqlite3TableLock() is used to add entries to the 11032 ** compiled. Function sqlite3TableLock() is used to add entries to the 11042 ** list. 11033 ** list. 11043 */ 11034 */ 11044 struct Parse { 11035 struct Parse { 11045 sqlite3 *db; /* The main database structure */ 11036 sqlite3 *db; /* The main database structure */ 11046 int rc; /* Return code from execution */ < 11047 char *zErrMsg; /* An error message */ 11037 char *zErrMsg; /* An error message */ 11048 Vdbe *pVdbe; /* An engine for executing database bytecode */ 11038 Vdbe *pVdbe; /* An engine for executing database bytecode */ > 11039 int rc; /* Return code from execution */ 11049 u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */ 11040 u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */ 11050 u8 checkSchema; /* Causes schema cookie check after an error */ 11041 u8 checkSchema; /* Causes schema cookie check after an error */ 11051 u8 nested; /* Number of nested calls to the parser/code generator */ 11042 u8 nested; /* Number of nested calls to the parser/code generator */ 11052 u8 nTempReg; /* Number of temporary registers in aTempReg[] */ 11043 u8 nTempReg; /* Number of temporary registers in aTempReg[] */ 11053 u8 nTempInUse; /* Number of aTempReg[] currently checked out */ 11044 u8 nTempInUse; /* Number of aTempReg[] currently checked out */ > 11045 u8 nColCache; /* Number of entries in aColCache[] */ > 11046 u8 iColCache; /* Next entry in aColCache[] to replace */ > 11047 u8 isMultiWrite; /* True if statement may modify/insert multiple rows */ > 11048 u8 mayAbort; /* True if statement may throw an ABORT exception */ 11054 int aTempReg[8]; /* Holding area for temporary registers */ 11049 int aTempReg[8]; /* Holding area for temporary registers */ 11055 int nRangeReg; /* Size of the temporary register block */ 11050 int nRangeReg; /* Size of the temporary register block */ 11056 int iRangeReg; /* First register in temporary register block */ 11051 int iRangeReg; /* First register in temporary register block */ 11057 int nErr; /* Number of errors seen */ 11052 int nErr; /* Number of errors seen */ 11058 int nTab; /* Number of previously allocated VDBE cursors */ 11053 int nTab; /* Number of previously allocated VDBE cursors */ 11059 int nMem; /* Number of memory cells used so far */ 11054 int nMem; /* Number of memory cells used so far */ 11060 int nSet; /* Number of sets used so far */ 11055 int nSet; /* Number of sets used so far */ 11061 int nOnce; /* Number of OP_Once instructions so far */ 11056 int nOnce; /* Number of OP_Once instructions so far */ 11062 int ckBase; /* Base register of data during check constraints */ 11057 int ckBase; /* Base register of data during check constraints */ 11063 int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */ 11058 int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */ 11064 int iCacheCnt; /* Counter used to generate aColCache[].lru values */ 11059 int iCacheCnt; /* Counter used to generate aColCache[].lru values */ 11065 u8 nColCache; /* Number of entries in aColCache[] */ < 11066 u8 iColCache; /* Next entry in aColCache[] to replace */ < 11067 struct yColCache { 11060 struct yColCache { 11068 int iTable; /* Table cursor number */ 11061 int iTable; /* Table cursor number */ 11069 int iColumn; /* Table column number */ 11062 int iColumn; /* Table column number */ 11070 u8 tempReg; /* iReg is a temp register that needs to be freed */ 11063 u8 tempReg; /* iReg is a temp register that needs to be freed */ 11071 int iLevel; /* Nesting level */ 11064 int iLevel; /* Nesting level */ 11072 int iReg; /* Reg with value of this column. 0 means none. */ 11065 int iReg; /* Reg with value of this column. 0 means none. */ 11073 int lru; /* Least recently used entry has the smallest value */ 11066 int lru; /* Least recently used entry has the smallest value */ 11074 } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */ 11067 } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */ 11075 yDbMask writeMask; /* Start a write transaction on these databases */ 11068 yDbMask writeMask; /* Start a write transaction on these databases */ 11076 yDbMask cookieMask; /* Bitmask of schema verified databases */ 11069 yDbMask cookieMask; /* Bitmask of schema verified databases */ 11077 u8 isMultiWrite; /* True if statement may affect/insert multiple rows */ < 11078 u8 mayAbort; /* True if statement may throw an ABORT exception */ < 11079 int cookieGoto; /* Address of OP_Goto to cookie verifier subroutine */ 11070 int cookieGoto; /* Address of OP_Goto to cookie verifier subroutine */ 11080 int cookieValue[SQLITE_MAX_ATTACHED+2]; /* Values of cookies to verify */ 11071 int cookieValue[SQLITE_MAX_ATTACHED+2]; /* Values of cookies to verify */ > 11072 int regRowid; /* Register holding rowid of CREATE TABLE entry */ > 11073 int regRoot; /* Register holding root page number for new objects */ > 11074 int nMaxArg; /* Max args passed to user function by sub-program */ 11081 #ifndef SQLITE_OMIT_SHARED_CACHE 11075 #ifndef SQLITE_OMIT_SHARED_CACHE 11082 int nTableLock; /* Number of locks in aTableLock */ 11076 int nTableLock; /* Number of locks in aTableLock */ 11083 TableLock *aTableLock; /* Required table locks for shared-cache mode */ 11077 TableLock *aTableLock; /* Required table locks for shared-cache mode */ 11084 #endif 11078 #endif 11085 int regRowid; /* Register holding rowid of CREATE TABLE entry */ < 11086 int regRoot; /* Register holding root page number for new objects */ < 11087 AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */ 11079 AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */ 11088 int nMaxArg; /* Max args passed to user function by sub-program */ < 11089 11080 11090 /* Information used while coding trigger programs. */ 11081 /* Information used while coding trigger programs. */ 11091 Parse *pToplevel; /* Parse structure for main program (or NULL) */ 11082 Parse *pToplevel; /* Parse structure for main program (or NULL) */ 11092 Table *pTriggerTab; /* Table triggers are being coded for */ 11083 Table *pTriggerTab; /* Table triggers are being coded for */ > 11084 double nQueryLoop; /* Estimated number of iterations of a query */ 11093 u32 oldmask; /* Mask of old.* columns referenced */ 11085 u32 oldmask; /* Mask of old.* columns referenced */ 11094 u32 newmask; /* Mask of new.* columns referenced */ 11086 u32 newmask; /* Mask of new.* columns referenced */ 11095 u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */ 11087 u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */ 11096 u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */ 11088 u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */ 11097 u8 disableTriggers; /* True to disable triggers */ 11089 u8 disableTriggers; /* True to disable triggers */ 11098 double nQueryLoop; /* Estimated number of iterations of a query */ < 11099 11090 11100 /* Above is constant between recursions. Below is reset before and after 11091 /* Above is constant between recursions. Below is reset before and after 11101 ** each recursion */ 11092 ** each recursion */ 11102 11093 11103 int nVar; /* Number of '?' variables seen in the SQL so far */ | 11094 int nVar; /* Number of '?' variables seen in the SQL so far */ 11104 int nzVar; /* Number of available slots in azVar[] */ | 11095 int nzVar; /* Number of available slots in azVar[] */ > 11096 u8 explain; /* True if the EXPLAIN flag is found on the query */ > 11097 #ifndef SQLITE_OMIT_VIRTUALTABLE > 11098 u8 declareVtab; /* True if inside sqlite3_declare_vtab() */ > 11099 int nVtabLock; /* Number of virtual tables to lock */ > 11100 #endif > 11101 int nAlias; /* Number of aliased result set columns */ > 11102 int nHeight; /* Expression tree height of current sub-select */ > 11103 #ifndef SQLITE_OMIT_EXPLAIN > 11104 int iSelectId; /* ID of current select for EXPLAIN output */ > 11105 int iNextSelectId; /* Next available select ID for EXPLAIN output */ > 11106 #endif 11105 char **azVar; /* Pointers to names of parameters */ | 11107 char **azVar; /* Pointers to names of parameters */ 11106 Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */ | 11108 Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */ 11107 int nAlias; /* Number of aliased result set columns */ < 11108 int *aAlias; /* Register used to hold aliased result */ | 11109 int *aAlias; /* Register used to hold aliased result */ 11109 u8 explain; /* True if the EXPLAIN flag is found on the query */ < 11110 Token sNameToken; /* Token with unqualified schema object name */ < 11111 Token sLastToken; /* The last token parsed */ < 11112 const char *zTail; /* All SQL text past the last semicolon parsed */ | 11110 const char *zTail; /* All SQL text past the last semicolon parsed */ 11113 Table *pNewTable; /* A table being constructed by CREATE TABLE */ | 11111 Table *pNewTable; /* A table being constructed by CREATE TABLE */ 11114 Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */ 11112 Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */ 11115 const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */ 11113 const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */ > 11114 Token sNameToken; /* Token with unqualified schema object name */ > 11115 Token sLastToken; /* The last token parsed */ 11116 #ifndef SQLITE_OMIT_VIRTUALTABLE 11116 #ifndef SQLITE_OMIT_VIRTUALTABLE 11117 Token sArg; /* Complete text of a module argument */ | 11117 Token sArg; /* Complete text of a module argument */ 11118 u8 declareVtab; /* True if inside sqlite3_declare_vtab() */ < 11119 int nVtabLock; /* Number of virtual tables to lock */ < 11120 Table **apVtabLock; /* Pointer to virtual tables needing locking */ | 11118 Table **apVtabLock; /* Pointer to virtual tables needing locking */ 11121 #endif 11119 #endif 11122 int nHeight; /* Expression tree height of current sub-select */ < 11123 Table *pZombieTab; /* List of Table objects to delete after code gen */ | 11120 Table *pZombieTab; /* List of Table objects to delete after code gen */ 11124 TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */ | 11121 TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */ 11125 < 11126 #ifndef SQLITE_OMIT_EXPLAIN < 11127 int iSelectId; < 11128 int iNextSelectId; < 11129 #endif < 11130 }; 11122 }; 11131 11123 > 11124 /* > 11125 ** Return true if currently inside an sqlite3_declare_vtab() call. > 11126 */ 11132 #ifdef SQLITE_OMIT_VIRTUALTABLE 11127 #ifdef SQLITE_OMIT_VIRTUALTABLE 11133 #define IN_DECLARE_VTAB 0 11128 #define IN_DECLARE_VTAB 0 11134 #else 11129 #else 11135 #define IN_DECLARE_VTAB (pParse->declareVtab) 11130 #define IN_DECLARE_VTAB (pParse->declareVtab) 11136 #endif 11131 #endif 11137 11132 11138 /* 11133 /* ................................................................................................................................................................................ 11275 11270 11276 /* 11271 /* 11277 ** A pointer to this structure is used to communicate information 11272 ** A pointer to this structure is used to communicate information 11278 ** from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. 11273 ** from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. 11279 */ 11274 */ 11280 typedef struct { 11275 typedef struct { 11281 sqlite3 *db; /* The database being initialized */ 11276 sqlite3 *db; /* The database being initialized */ 11282 int iDb; /* 0 for main database. 1 for TEMP, 2.. for ATTACHed */ < 11283 char **pzErrMsg; /* Error message stored here */ 11277 char **pzErrMsg; /* Error message stored here */ > 11278 int iDb; /* 0 for main database. 1 for TEMP, 2.. for ATTACHed */ 11284 int rc; /* Result code stored here */ 11279 int rc; /* Result code stored here */ 11285 } InitData; 11280 } InitData; 11286 11281 11287 /* 11282 /* 11288 ** Structure containing global configuration data for the SQLite library. 11283 ** Structure containing global configuration data for the SQLite library. 11289 ** 11284 ** 11290 ** This structure also contains some state information. 11285 ** This structure also contains some state information. ................................................................................................................................................................................ 11601 SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse); 11596 SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse); 11602 SQLITE_PRIVATE void sqlite3AutoincrementEnd(Parse *pParse); 11597 SQLITE_PRIVATE void sqlite3AutoincrementEnd(Parse *pParse); 11603 #else 11598 #else 11604 # define sqlite3AutoincrementBegin(X) 11599 # define sqlite3AutoincrementBegin(X) 11605 # define sqlite3AutoincrementEnd(X) 11600 # define sqlite3AutoincrementEnd(X) 11606 #endif 11601 #endif 11607 SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, 11602 SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, 11608 SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int,int*,int*,int*) | 11603 SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*); 11609 SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*); 11604 SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*); 11610 SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*); 11605 SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*); 11611 SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int); 11606 SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int); 11612 SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*) 11607 SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*) 11613 SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, T 11608 SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, T 11614 Token*, Select*, Expr*, IdList*); 11609 Token*, Select*, Expr*, IdList*); 11615 SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *); 11610 SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *); ................................................................................................................................................................................ 11839 SQLITE_PRIVATE int sqlite3MulInt64(i64*,i64); 11834 SQLITE_PRIVATE int sqlite3MulInt64(i64*,i64); 11840 SQLITE_PRIVATE int sqlite3AbsInt32(int); 11835 SQLITE_PRIVATE int sqlite3AbsInt32(int); 11841 #ifdef SQLITE_ENABLE_8_3_NAMES 11836 #ifdef SQLITE_ENABLE_8_3_NAMES 11842 SQLITE_PRIVATE void sqlite3FileSuffix3(const char*, char*); 11837 SQLITE_PRIVATE void sqlite3FileSuffix3(const char*, char*); 11843 #else 11838 #else 11844 # define sqlite3FileSuffix3(X,Y) 11839 # define sqlite3FileSuffix3(X,Y) 11845 #endif 11840 #endif 11846 SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z); | 11841 SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z,int); 11847 11842 11848 SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value*, u8); 11843 SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value*, u8); 11849 SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value*, u8); 11844 SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value*, u8); 11850 SQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, 11845 SQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, 11851 void(*)(void*)); 11846 void(*)(void*)); 11852 SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value*); 11847 SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value*); 11853 SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(sqlite3 *); 11848 SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(sqlite3 *); ................................................................................................................................................................................ 11965 SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *); 11960 SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *); 11966 SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3*); 11961 SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3*); 11967 SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *, int, int); 11962 SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *, int, int); 11968 SQLITE_PRIVATE VTable *sqlite3GetVTable(sqlite3*, Table*); 11963 SQLITE_PRIVATE VTable *sqlite3GetVTable(sqlite3*, Table*); 11969 # define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0) 11964 # define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0) 11970 #endif 11965 #endif 11971 SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*); 11966 SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*); 11972 SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*); | 11967 SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*, int); 11973 SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse*, Token*); 11968 SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse*, Token*); 11974 SQLITE_PRIVATE void sqlite3VtabArgInit(Parse*); 11969 SQLITE_PRIVATE void sqlite3VtabArgInit(Parse*); 11975 SQLITE_PRIVATE void sqlite3VtabArgExtend(Parse*, Token*); 11970 SQLITE_PRIVATE void sqlite3VtabArgExtend(Parse*, Token*); 11976 SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **); 11971 SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **); 11977 SQLITE_PRIVATE int sqlite3VtabCallConnect(Parse*, Table*); 11972 SQLITE_PRIVATE int sqlite3VtabCallConnect(Parse*, Table*); 11978 SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *); 11973 SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *); 11979 SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *, VTable *); 11974 SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *, VTable *); ................................................................................................................................................................................ 12894 ** 12889 ** 12895 ** The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is 12890 ** The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is 12896 ** set to NULL if the currently executing frame is the main program. 12891 ** set to NULL if the currently executing frame is the main program. 12897 */ 12892 */ 12898 typedef struct VdbeFrame VdbeFrame; 12893 typedef struct VdbeFrame VdbeFrame; 12899 struct VdbeFrame { 12894 struct VdbeFrame { 12900 Vdbe *v; /* VM this frame belongs to */ 12895 Vdbe *v; /* VM this frame belongs to */ 12901 int pc; /* Program Counter in parent (calling) frame */ | 12896 VdbeFrame *pParent; /* Parent of this frame, or NULL if parent is main */ 12902 Op *aOp; /* Program instructions for parent frame */ 12897 Op *aOp; /* Program instructions for parent frame */ 12903 int nOp; /* Size of aOp array */ < 12904 Mem *aMem; /* Array of memory cells for parent frame */ 12898 Mem *aMem; /* Array of memory cells for parent frame */ 12905 int nMem; /* Number of entries in aMem */ < 12906 u8 *aOnceFlag; /* Array of OP_Once flags for parent frame */ 12899 u8 *aOnceFlag; /* Array of OP_Once flags for parent frame */ 12907 int nOnceFlag; /* Number of entries in aOnceFlag */ < 12908 VdbeCursor **apCsr; /* Array of Vdbe cursors for parent frame */ 12900 VdbeCursor **apCsr; /* Array of Vdbe cursors for parent frame */ > 12901 void *token; /* Copy of SubProgram.token */ > 12902 i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ 12909 u16 nCursor; /* Number of entries in apCsr */ 12903 u16 nCursor; /* Number of entries in apCsr */ > 12904 int pc; /* Program Counter in parent (calling) frame */ 12910 void *token; /* Copy of SubProgram.token */ | 12905 int nOp; /* Size of aOp array */ > 12906 int nMem; /* Number of entries in aMem */ > 12907 int nOnceFlag; /* Number of entries in aOnceFlag */ 12911 int nChildMem; /* Number of memory cells for child frame */ 12908 int nChildMem; /* Number of memory cells for child frame */ 12912 int nChildCsr; /* Number of cursors for child frame */ 12909 int nChildCsr; /* Number of cursors for child frame */ 12913 i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ < 12914 int nChange; /* Statement changes (Vdbe.nChanges) */ 12910 int nChange; /* Statement changes (Vdbe.nChanges) */ 12915 VdbeFrame *pParent; /* Parent of this frame, or NULL if parent is main */ < 12916 }; 12911 }; 12917 12912 12918 #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))]) 12913 #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))]) 12919 12914 12920 /* 12915 /* 12921 ** A value for VdbeCursor.cacheValid that means the cache is always invalid. 12916 ** A value for VdbeCursor.cacheValid that means the cache is always invalid. 12922 */ 12917 */ ................................................................................................................................................................................ 13035 ** (Mem) which are only defined there. 13030 ** (Mem) which are only defined there. 13036 */ 13031 */ 13037 struct sqlite3_context { 13032 struct sqlite3_context { 13038 FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ 13033 FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ 13039 VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ 13034 VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ 13040 Mem s; /* The return value is stored here */ 13035 Mem s; /* The return value is stored here */ 13041 Mem *pMem; /* Memory cell used to store aggregate context */ 13036 Mem *pMem; /* Memory cell used to store aggregate context */ 13042 int isError; /* Error code returned by the function. */ < 13043 CollSeq *pColl; /* Collating sequence */ 13037 CollSeq *pColl; /* Collating sequence */ > 13038 int isError; /* Error code returned by the function. */ > 13039 int skipFlag; /* Skip skip accumulator loading if true */ 13044 }; 13040 }; 13045 13041 13046 /* 13042 /* 13047 ** An Explain object accumulates indented output which is helpful 13043 ** An Explain object accumulates indented output which is helpful 13048 ** in describing recursive data structures. 13044 ** in describing recursive data structures. 13049 */ 13045 */ 13050 struct Explain { 13046 struct Explain { ................................................................................................................................................................................ 13077 Mem **apArg; /* Arguments to currently executing user function */ 13073 Mem **apArg; /* Arguments to currently executing user function */ 13078 Mem *aColName; /* Column names to return */ 13074 Mem *aColName; /* Column names to return */ 13079 Mem *pResultSet; /* Pointer to an array of results */ 13075 Mem *pResultSet; /* Pointer to an array of results */ 13080 int nMem; /* Number of memory locations currently allocated */ 13076 int nMem; /* Number of memory locations currently allocated */ 13081 int nOp; /* Number of instructions in the program */ 13077 int nOp; /* Number of instructions in the program */ 13082 int nOpAlloc; /* Number of slots allocated for aOp[] */ 13078 int nOpAlloc; /* Number of slots allocated for aOp[] */ 13083 int nLabel; /* Number of labels used */ 13079 int nLabel; /* Number of labels used */ 13084 int nLabelAlloc; /* Number of slots allocated in aLabel[] */ < 13085 int *aLabel; /* Space to hold the labels */ 13080 int *aLabel; /* Space to hold the labels */ 13086 u16 nResColumn; /* Number of columns in one row of the result set */ 13081 u16 nResColumn; /* Number of columns in one row of the result set */ 13087 u16 nCursor; /* Number of slots in apCsr[] */ 13082 u16 nCursor; /* Number of slots in apCsr[] */ 13088 u32 magic; /* Magic number for sanity checking */ 13083 u32 magic; /* Magic number for sanity checking */ 13089 char *zErrMsg; /* Error message written here */ 13084 char *zErrMsg; /* Error message written here */ 13090 Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ 13085 Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ 13091 VdbeCursor **apCsr; /* One element of this array for each open cursor */ 13086 VdbeCursor **apCsr; /* One element of this array for each open cursor */ ................................................................................................................................................................................ 15144 ************************************************************************* 15139 ************************************************************************* 15145 ** 15140 ** 15146 ** This file contains low-level memory allocation drivers for when 15141 ** This file contains low-level memory allocation drivers for when 15147 ** SQLite will use the standard C-library malloc/realloc/free interface 15142 ** SQLite will use the standard C-library malloc/realloc/free interface 15148 ** to obtain the memory it needs. 15143 ** to obtain the memory it needs. 15149 ** 15144 ** 15150 ** This file contains implementations of the low-level memory allocation 15145 ** This file contains implementations of the low-level memory allocation 15151 ** routines specified in the sqlite3_mem_methods object. | 15146 ** routines specified in the sqlite3_mem_methods object. The content of > 15147 ** this file is only used if SQLITE_SYSTEM_MALLOC is defined. The > 15148 ** SQLITE_SYSTEM_MALLOC macro is defined automatically if neither the > 15149 ** SQLITE_MEMDEBUG nor the SQLITE_WIN32_MALLOC macros are defined. The > 15150 ** default configuration is to use memory allocation routines in this > 15151 ** file. > 15152 ** > 15153 ** C-preprocessor macro summary: > 15154 ** > 15155 ** HAVE_MALLOC_USABLE_SIZE The configure script sets this symbol if > 15156 ** the malloc_usable_size() interface exists > 15157 ** on the target platform. Or, this symbol > 15158 ** can be set manually, if desired. > 15159 ** If an equivalent interface exists by > 15160 ** a different name, using a separate -D > 15161 ** option to rename it. This symbol will > 15162 ** be enabled automatically on windows > 15163 ** systems, and malloc_usable_size() will > 15164 ** be redefined to _msize(), unless the > 15165 ** SQLITE_WITHOUT_MSIZE macro is defined. > 15166 ** > 15167 ** SQLITE_WITHOUT_ZONEMALLOC Some older macs lack support for the zone > 15168 ** memory allocator. Set this symbol to enable > 15169 ** building on older macs. > 15170 ** > 15171 ** SQLITE_WITHOUT_MSIZE Set this symbol to disable the use of > 15172 ** _msize() on windows systems. This might > 15173 ** be necessary when compiling for Delphi, > 15174 ** for example. 15152 */ 15175 */ 15153 15176 15154 /* 15177 /* 15155 ** This version of the memory allocator is the default. It is 15178 ** This version of the memory allocator is the default. It is 15156 ** used when no other memory allocator is specified using compile-time 15179 ** used when no other memory allocator is specified using compile-time 15157 ** macros. 15180 ** macros. 15158 */ 15181 */ 15159 #ifdef SQLITE_SYSTEM_MALLOC 15182 #ifdef SQLITE_SYSTEM_MALLOC 15160 15183 15161 /* 15184 /* 15162 ** Windows systems have malloc_usable_size() but it is called _msize() | 15185 ** Windows systems have malloc_usable_size() but it is called _msize(). > 15186 ** The use of _msize() is automatic, but can be disabled by compiling > 15187 ** with -DSQLITE_WITHOUT_MSIZE 15163 */ 15188 */ 15164 #if !defined(HAVE_MALLOC_USABLE_SIZE) && SQLITE_OS_WIN | 15189 #if !defined(HAVE_MALLOC_USABLE_SIZE) && SQLITE_OS_WIN \ > 15190 && !defined(SQLITE_WITHOUT_MSIZE) 15165 # define HAVE_MALLOC_USABLE_SIZE 1 15191 # define HAVE_MALLOC_USABLE_SIZE 1 15166 # define malloc_usable_size _msize < > 15192 # define SQLITE_MALLOCSIZE _msize 15167 #endif 15193 #endif 15168 15194 15169 #if defined(__APPLE__) | 15195 #if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) 15170 15196 15171 /* 15197 /* 15172 ** Use the zone allocator available on apple products | 15198 ** Use the zone allocator available on apple products unless the > 15199 ** SQLITE_WITHOUT_ZONEMALLOC symbol is defined. 15173 */ 15200 */ 15174 #include <sys/sysctl.h> 15201 #include <sys/sysctl.h> 15175 #include <malloc/malloc.h> 15202 #include <malloc/malloc.h> 15176 #include <libkern/OSAtomic.h> 15203 #include <libkern/OSAtomic.h> 15177 static malloc_zone_t* _sqliteZone_; 15204 static malloc_zone_t* _sqliteZone_; 15178 #define SQLITE_MALLOC(x) malloc_zone_malloc(_sqliteZone_, (x)) 15205 #define SQLITE_MALLOC(x) malloc_zone_malloc(_sqliteZone_, (x)) 15179 #define SQLITE_FREE(x) malloc_zone_free(_sqliteZone_, (x)); 15206 #define SQLITE_FREE(x) malloc_zone_free(_sqliteZone_, (x)); ................................................................................................................................................................................ 15180 #define SQLITE_REALLOC(x,y) malloc_zone_realloc(_sqliteZone_, (x), (y)) 15207 #define SQLITE_REALLOC(x,y) malloc_zone_realloc(_sqliteZone_, (x), (y)) 15181 #define SQLITE_MALLOCSIZE(x) \ 15208 #define SQLITE_MALLOCSIZE(x) \ 15182 (_sqliteZone_ ? _sqliteZone_->size(_sqliteZone_,x) : malloc_size(x)) 15209 (_sqliteZone_ ? _sqliteZone_->size(_sqliteZone_,x) : malloc_size(x)) 15183 15210 15184 #else /* if not __APPLE__ */ 15211 #else /* if not __APPLE__ */ 15185 15212 15186 /* 15213 /* 15187 ** Use standard C library malloc and free on non-Apple systems. | 15214 ** Use standard C library malloc and free on non-Apple systems. > 15215 ** Also used by Apple systems if SQLITE_WITHOUT_ZONEMALLOC is defined. 15188 */ 15216 */ 15189 #define SQLITE_MALLOC(x) malloc(x) 15217 #define SQLITE_MALLOC(x) malloc(x) 15190 #define SQLITE_FREE(x) free(x) 15218 #define SQLITE_FREE(x) free(x) 15191 #define SQLITE_REALLOC(x,y) realloc((x),(y)) 15219 #define SQLITE_REALLOC(x,y) realloc((x),(y)) 15192 15220 15193 #ifdef HAVE_MALLOC_USABLE_SIZE 15221 #ifdef HAVE_MALLOC_USABLE_SIZE > 15222 # ifndef SQLITE_MALLOCSIZE 15194 #include <malloc.h> | 15223 # include <malloc.h> 15195 #define SQLITE_MALLOCSIZE(x) malloc_usable_size(x) | 15224 # define SQLITE_MALLOCSIZE(x) malloc_usable_size(x) > 15225 # endif 15196 #else 15226 #else 15197 #undef SQLITE_MALLOCSIZE | 15227 # undef SQLITE_MALLOCSIZE 15198 #endif 15228 #endif 15199 15229 15200 #endif /* __APPLE__ or not __APPLE__ */ 15230 #endif /* __APPLE__ or not __APPLE__ */ 15201 15231 15202 /* 15232 /* 15203 ** Like malloc(), but remember the size of the allocation 15233 ** Like malloc(), but remember the size of the allocation 15204 ** so that we can find it later using sqlite3MemSize(). 15234 ** so that we can find it later using sqlite3MemSize(). ................................................................................................................................................................................ 15312 return ROUND8(n); 15342 return ROUND8(n); 15313 } 15343 } 15314 15344 15315 /* 15345 /* 15316 ** Initialize this module. 15346 ** Initialize this module. 15317 */ 15347 */ 15318 static int sqlite3MemInit(void *NotUsed){ 15348 static int sqlite3MemInit(void *NotUsed){ 15319 #if defined(__APPLE__) | 15349 #if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) 15320 int cpuCount; 15350 int cpuCount; 15321 size_t len; 15351 size_t len; 15322 if( _sqliteZone_ ){ 15352 if( _sqliteZone_ ){ 15323 return SQLITE_OK; 15353 return SQLITE_OK; 15324 } 15354 } 15325 len = sizeof(cpuCount); 15355 len = sizeof(cpuCount); 15326 /* One usually wants to use hw.acctivecpu for MT decisions, but not here */ 15356 /* One usually wants to use hw.acctivecpu for MT decisions, but not here */ ................................................................................................................................................................................ 36784 PGroup *pGroup; /* PGroup this cache belongs to */ 36814 PGroup *pGroup; /* PGroup this cache belongs to */ 36785 int szPage; /* Size of allocated pages in bytes */ 36815 int szPage; /* Size of allocated pages in bytes */ 36786 int szExtra; /* Size of extra space in bytes */ 36816 int szExtra; /* Size of extra space in bytes */ 36787 int bPurgeable; /* True if cache is purgeable */ 36817 int bPurgeable; /* True if cache is purgeable */ 36788 unsigned int nMin; /* Minimum number of pages reserved */ 36818 unsigned int nMin; /* Minimum number of pages reserved */ 36789 unsigned int nMax; /* Configured "cache_size" value */ 36819 unsigned int nMax; /* Configured "cache_size" value */ 36790 unsigned int n90pct; /* nMax*9/10 */ 36820 unsigned int n90pct; /* nMax*9/10 */ > 36821 unsigned int iMaxKey; /* Largest key seen since xTruncate() */ 36791 36822 36792 /* Hash table of all pages. The following variables may only be accessed 36823 /* Hash table of all pages. The following variables may only be accessed 36793 ** when the accessor is holding the PGroup mutex. 36824 ** when the accessor is holding the PGroup mutex. 36794 */ 36825 */ 36795 unsigned int nRecyclable; /* Number of pages in the LRU list */ 36826 unsigned int nRecyclable; /* Number of pages in the LRU list */ 36796 unsigned int nPage; /* Total number of pages in apHash */ 36827 unsigned int nPage; /* Total number of pages in apHash */ 36797 unsigned int nHash; /* Number of slots in apHash[] */ 36828 unsigned int nHash; /* Number of slots in apHash[] */ 36798 PgHdr1 **apHash; /* Hash table for fast lookup by key */ 36829 PgHdr1 **apHash; /* Hash table for fast lookup by key */ 36799 < 36800 unsigned int iMaxKey; /* Largest key seen since xTruncate() */ < 36801 }; 36830 }; 36802 36831 36803 /* 36832 /* 36804 ** Each cache entry is represented by an instance of the following 36833 ** Each cache entry is represented by an instance of the following 36805 ** structure. Unless SQLITE_PCACHE_SEPARATE_HEADER is defined, a buffer of 36834 ** structure. Unless SQLITE_PCACHE_SEPARATE_HEADER is defined, a buffer of 36806 ** PgHdr1.pCache->szPage bytes is allocated directly before this structure 36835 ** PgHdr1.pCache->szPage bytes is allocated directly before this structure 36807 ** in memory. 36836 ** in memory. ................................................................................................................................................................................ 36837 int isInit; /* True if initialized */ 36866 int isInit; /* True if initialized */ 36838 int szSlot; /* Size of each free slot */ 36867 int szSlot; /* Size of each free slot */ 36839 int nSlot; /* The number of pcache slots */ 36868 int nSlot; /* The number of pcache slots */ 36840 int nReserve; /* Try to keep nFreeSlot above this */ 36869 int nReserve; /* Try to keep nFreeSlot above this */ 36841 void *pStart, *pEnd; /* Bounds of pagecache malloc range */ 36870 void *pStart, *pEnd; /* Bounds of pagecache malloc range */ 36842 /* Above requires no mutex. Use mutex below for variable that follow. */ 36871 /* Above requires no mutex. Use mutex below for variable that follow. */ 36843 sqlite3_mutex *mutex; /* Mutex for accessing the following: */ 36872 sqlite3_mutex *mutex; /* Mutex for accessing the following: */ 36844 int nFreeSlot; /* Number of unused pcache slots */ < 36845 PgFreeslot *pFree; /* Free page blocks */ 36873 PgFreeslot *pFree; /* Free page blocks */ > 36874 int nFreeSlot; /* Number of unused pcache slots */ 36846 /* The following value requires a mutex to change. We skip the mutex on 36875 /* The following value requires a mutex to change. We skip the mutex on 36847 ** reading because (1) most platforms read a 32-bit integer atomically and 36876 ** reading because (1) most platforms read a 32-bit integer atomically and 36848 ** (2) even if an incorrect value is read, no great harm is done since this 36877 ** (2) even if an incorrect value is read, no great harm is done since this 36849 ** is really just an optimization. */ 36878 ** is really just an optimization. */ 36850 int bUnderPressure; /* True if low on PAGECACHE memory */ 36879 int bUnderPressure; /* True if low on PAGECACHE memory */ 36851 } pcache1_g; 36880 } pcache1_g; 36852 36881 ................................................................................................................................................................................ 38896 ** sub-codes. 38925 ** sub-codes. 38897 */ 38926 */ 38898 struct Pager { 38927 struct Pager { 38899 sqlite3_vfs *pVfs; /* OS functions to use for IO */ 38928 sqlite3_vfs *pVfs; /* OS functions to use for IO */ 38900 u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ 38929 u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ 38901 u8 journalMode; /* One of the PAGER_JOURNALMODE_* values */ 38930 u8 journalMode; /* One of the PAGER_JOURNALMODE_* values */ 38902 u8 useJournal; /* Use a rollback journal on this file */ 38931 u8 useJournal; /* Use a rollback journal on this file */ 38903 u8 noReadlock; /* Do not bother to obtain readlocks */ < 38904 u8 noSync; /* Do not sync the journal if true */ 38932 u8 noSync; /* Do not sync the journal if true */ 38905 u8 fullSync; /* Do extra syncs of the journal for robustness */ 38933 u8 fullSync; /* Do extra syncs of the journal for robustness */ 38906 u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */ 38934 u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */ 38907 u8 walSyncFlags; /* SYNC_NORMAL or SYNC_FULL for wal writes */ 38935 u8 walSyncFlags; /* SYNC_NORMAL or SYNC_FULL for wal writes */ 38908 u8 syncFlags; /* SYNC_NORMAL or SYNC_FULL otherwise */ 38936 u8 syncFlags; /* SYNC_NORMAL or SYNC_FULL otherwise */ 38909 u8 tempFile; /* zFilename is a temporary file */ 38937 u8 tempFile; /* zFilename is a temporary file */ 38910 u8 readOnly; /* True for a read-only database */ 38938 u8 readOnly; /* True for a read-only database */ ................................................................................................................................................................................ 39144 assert( pPager->errCode==SQLITE_OK ); 39172 assert( pPager->errCode==SQLITE_OK ); 39145 assert( sqlite3PcacheRefCount(pPager->pPCache)==0 || pPager->tempFile ); 39173 assert( sqlite3PcacheRefCount(pPager->pPCache)==0 || pPager->tempFile ); 39146 break; 39174 break; 39147 39175 39148 case PAGER_READER: 39176 case PAGER_READER: 39149 assert( pPager->errCode==SQLITE_OK ); 39177 assert( pPager->errCode==SQLITE_OK ); 39150 assert( p->eLock!=UNKNOWN_LOCK ); 39178 assert( p->eLock!=UNKNOWN_LOCK ); 39151 assert( p->eLock>=SHARED_LOCK || p->noReadlock ); | 39179 assert( p->eLock>=SHARED_LOCK ); 39152 break; 39180 break; 39153 39181 39154 case PAGER_WRITER_LOCKED: 39182 case PAGER_WRITER_LOCKED: 39155 assert( p->eLock!=UNKNOWN_LOCK ); 39183 assert( p->eLock!=UNKNOWN_LOCK ); 39156 assert( pPager->errCode==SQLITE_OK ); 39184 assert( pPager->errCode==SQLITE_OK ); 39157 if( !pagerUseWal(pPager) ){ 39185 if( !pagerUseWal(pPager) ){ 39158 assert( p->eLock>=RESERVED_LOCK ); 39186 assert( p->eLock>=RESERVED_LOCK ); ................................................................................................................................................................................ 41353 /* Query the WAL sub-system for the database size. The WalDbsize() 41381 /* Query the WAL sub-system for the database size. The WalDbsize() 41354 ** function returns zero if the WAL is not open (i.e. Pager.pWal==0), or 41382 ** function returns zero if the WAL is not open (i.e. Pager.pWal==0), or 41355 ** if the database size is not available. The database size is not 41383 ** if the database size is not available. The database size is not 41356 ** available from the WAL sub-system if the log file is empty or 41384 ** available from the WAL sub-system if the log file is empty or 41357 ** contains no valid committed transactions. 41385 ** contains no valid committed transactions. 41358 */ 41386 */ 41359 assert( pPager->eState==PAGER_OPEN ); 41387 assert( pPager->eState==PAGER_OPEN ); 41360 assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock ); | 41388 assert( pPager->eLock>=SHARED_LOCK ); 41361 nPage = sqlite3WalDbsize(pPager->pWal); 41389 nPage = sqlite3WalDbsize(pPager->pWal); 41362 41390 41363 /* If the database size was not available from the WAL sub-system, 41391 /* If the database size was not available from the WAL sub-system, 41364 ** determine it based on the size of the database file. If the size 41392 ** determine it based on the size of the database file. If the size 41365 ** of the database file is not an integer multiple of the page-size, 41393 ** of the database file is not an integer multiple of the page-size, 41366 ** round down to the nearest page. Except, any file larger than 0 41394 ** round down to the nearest page. Except, any file larger than 0 41367 ** bytes in size is considered to contain at least one page. 41395 ** bytes in size is considered to contain at least one page. ................................................................................................................................................................................ 41408 ** a WAL on a none-empty database, this ensures there is no race condition 41436 ** a WAL on a none-empty database, this ensures there is no race condition 41409 ** between the xAccess() below and an xDelete() being executed by some 41437 ** between the xAccess() below and an xDelete() being executed by some 41410 ** other connection. 41438 ** other connection. 41411 */ 41439 */ 41412 static int pagerOpenWalIfPresent(Pager *pPager){ 41440 static int pagerOpenWalIfPresent(Pager *pPager){ 41413 int rc = SQLITE_OK; 41441 int rc = SQLITE_OK; 41414 assert( pPager->eState==PAGER_OPEN ); 41442 assert( pPager->eState==PAGER_OPEN ); 41415 assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock ); | 41443 assert( pPager->eLock>=SHARED_LOCK ); 41416 41444 41417 if( !pPager->tempFile ){ 41445 if( !pPager->tempFile ){ 41418 int isWal; /* True if WAL file exists */ 41446 int isWal; /* True if WAL file exists */ 41419 Pgno nPage; /* Size of the database file */ 41447 Pgno nPage; /* Size of the database file */ 41420 41448 41421 rc = pagerPagecount(pPager, &nPage); 41449 rc = pagerPagecount(pPager, &nPage); 41422 if( rc ) return rc; 41450 if( rc ) return rc; ................................................................................................................................................................................ 42571 ** 42599 ** 42572 ** The nExtra parameter specifies the number of bytes of space allocated 42600 ** The nExtra parameter specifies the number of bytes of space allocated 42573 ** along with each page reference. This space is available to the user 42601 ** along with each page reference. This space is available to the user 42574 ** via the sqlite3PagerGetExtra() API. 42602 ** via the sqlite3PagerGetExtra() API. 42575 ** 42603 ** 42576 ** The flags argument is used to specify properties that affect the 42604 ** The flags argument is used to specify properties that affect the 42577 ** operation of the pager. It should be passed some bitwise combination 42605 ** operation of the pager. It should be passed some bitwise combination 42578 ** of the PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK flags. | 42606 ** of the PAGER_* flags. 42579 ** 42607 ** 42580 ** The vfsFlags parameter is a bitmask to pass to the flags parameter 42608 ** The vfsFlags parameter is a bitmask to pass to the flags parameter 42581 ** of the xOpen() method of the supplied VFS when opening files. 42609 ** of the xOpen() method of the supplied VFS when opening files. 42582 ** 42610 ** 42583 ** If the pager object is allocated and the specified file opened 42611 ** If the pager object is allocated and the specified file opened 42584 ** successfully, SQLITE_OK is returned and *ppPager set to point to 42612 ** successfully, SQLITE_OK is returned and *ppPager set to point to 42585 ** the new pager object. If an error occurs, *ppPager is set to NULL 42613 ** the new pager object. If an error occurs, *ppPager is set to NULL ................................................................................................................................................................................ 42602 int tempFile = 0; /* True for temp files (incl. in-memory files) */ 42630 int tempFile = 0; /* True for temp files (incl. in-memory files) */ 42603 int memDb = 0; /* True if this is an in-memory file */ 42631 int memDb = 0; /* True if this is an in-memory file */ 42604 int readOnly = 0; /* True if this is a read-only file */ 42632 int readOnly = 0; /* True if this is a read-only file */ 42605 int journalFileSize; /* Bytes to allocate for each journal fd */ 42633 int journalFileSize; /* Bytes to allocate for each journal fd */ 42606 char *zPathname = 0; /* Full path to database file */ 42634 char *zPathname = 0; /* Full path to database file */ 42607 int nPathname = 0; /* Number of bytes in zPathname */ 42635 int nPathname = 0; /* Number of bytes in zPathname */ 42608 int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */ 42636 int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */ 42609 int noReadlock = (flags & PAGER_NO_READLOCK)!=0; /* True to omit read-lock */ < 42610 int pcacheSize = sqlite3PcacheSize(); /* Bytes to allocate for PCache */ 42637 int pcacheSize = sqlite3PcacheSize(); /* Bytes to allocate for PCache */ 42611 u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */ 42638 u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */ 42612 const char *zUri = 0; /* URI args to copy */ 42639 const char *zUri = 0; /* URI args to copy */ 42613 int nUri = 0; /* Number of bytes of URI args at *zUri */ 42640 int nUri = 0; /* Number of bytes of URI args at *zUri */ 42614 42641 42615 /* Figure out how much space is required for each journal file-handle 42642 /* Figure out how much space is required for each journal file-handle 42616 ** (there are two of them, the main journal and the sub-journal). This 42643 ** (there are two of them, the main journal and the sub-journal). This ................................................................................................................................................................................ 42809 sqlite3PcacheOpen(szPageDflt, nExtra, !memDb, 42836 sqlite3PcacheOpen(szPageDflt, nExtra, !memDb, 42810 !memDb?pagerStress:0, (void *)pPager, pPager->pPCache); 42837 !memDb?pagerStress:0, (void *)pPager, pPager->pPCache); 42811 42838 42812 PAGERTRACE(("OPEN %d %s\n", FILEHANDLEID(pPager->fd), pPager->zFilename)); 42839 PAGERTRACE(("OPEN %d %s\n", FILEHANDLEID(pPager->fd), pPager->zFilename)); 42813 IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename)) 42840 IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename)) 42814 42841 42815 pPager->useJournal = (u8)useJournal; 42842 pPager->useJournal = (u8)useJournal; 42816 pPager->noReadlock = (noReadlock && readOnly) ?1:0; < 42817 /* pPager->stmtOpen = 0; */ 42843 /* pPager->stmtOpen = 0; */ 42818 /* pPager->stmtInUse = 0; */ 42844 /* pPager->stmtInUse = 0; */ 42819 /* pPager->nRef = 0; */ 42845 /* pPager->nRef = 0; */ 42820 /* pPager->stmtSize = 0; */ 42846 /* pPager->stmtSize = 0; */ 42821 /* pPager->stmtJSize = 0; */ 42847 /* pPager->stmtJSize = 0; */ 42822 /* pPager->nPage = 0; */ 42848 /* pPager->nPage = 0; */ 42823 pPager->mxPgno = SQLITE_MAX_PAGE_COUNT; 42849 pPager->mxPgno = SQLITE_MAX_PAGE_COUNT; ................................................................................................................................................................................ 43031 assert( pPager->eState==PAGER_OPEN || pPager->eState==PAGER_READER ); 43057 assert( pPager->eState==PAGER_OPEN || pPager->eState==PAGER_READER ); 43032 if( NEVER(MEMDB && pPager->errCode) ){ return pPager->errCode; } 43058 if( NEVER(MEMDB && pPager->errCode) ){ return pPager->errCode; } 43033 43059 43034 if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ 43060 if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ 43035 int bHotJournal = 1; /* True if there exists a hot journal-file */ 43061 int bHotJournal = 1; /* True if there exists a hot journal-file */ 43036 43062 43037 assert( !MEMDB ); 43063 assert( !MEMDB ); 43038 assert( pPager->noReadlock==0 || pPager->readOnly ); < 43039 43064 43040 if( pPager->noReadlock==0 ){ < 43041 rc = pager_wait_on_lock(pPager, SHARED_LOCK); | 43065 rc = pager_wait_on_lock(pPager, SHARED_LOCK); 43042 if( rc!=SQLITE_OK ){ | 43066 if( rc!=SQLITE_OK ){ 43043 assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK ); | 43067 assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK ); 43044 goto failed; | 43068 goto failed; 43045 } < 43046 } 43069 } 43047 43070 43048 /* If a journal file exists, and there is no RESERVED lock on the 43071 /* If a journal file exists, and there is no RESERVED lock on the 43049 ** database file, then it either needs to be played back or deleted. 43072 ** database file, then it either needs to be played back or deleted. 43050 */ 43073 */ 43051 if( pPager->eLock<=SHARED_LOCK ){ 43074 if( pPager->eLock<=SHARED_LOCK ){ 43052 rc = hasHotJournal(pPager, &bHotJournal); 43075 rc = hasHotJournal(pPager, &bHotJournal); ................................................................................................................................................................................ 45046 ** lock on the database file and use heap-memory to store the wal-index 45069 ** lock on the database file and use heap-memory to store the wal-index 45047 ** in. Otherwise, use the normal shared-memory. 45070 ** in. Otherwise, use the normal shared-memory. 45048 */ 45071 */ 45049 static int pagerOpenWal(Pager *pPager){ 45072 static int pagerOpenWal(Pager *pPager){ 45050 int rc = SQLITE_OK; 45073 int rc = SQLITE_OK; 45051 45074 45052 assert( pPager->pWal==0 && pPager->tempFile==0 ); 45075 assert( pPager->pWal==0 && pPager->tempFile==0 ); 45053 assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK || pPager- | 45076 assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK ); 45054 45077 45055 /* If the pager is already in exclusive-mode, the WAL module will use 45078 /* If the pager is already in exclusive-mode, the WAL module will use 45056 ** heap-memory for the wal-index instead of the VFS shared-memory 45079 ** heap-memory for the wal-index instead of the VFS shared-memory 45057 ** implementation. Take the exclusive lock now, before opening the WAL 45080 ** implementation. Take the exclusive lock now, before opening the WAL 45058 ** file, to make sure this is safe. 45081 ** file, to make sure this is safe. 45059 */ 45082 */ 45060 if( pPager->exclusiveMode ){ 45083 if( pPager->exclusiveMode ){ ................................................................................................................................................................................ 48559 u8 max1bytePayload; /* min(maxLocal,127) */ 48582 u8 max1bytePayload; /* min(maxLocal,127) */ 48560 u16 maxLocal; /* Copy of BtShared.maxLocal or BtShared.maxLeaf */ 48583 u16 maxLocal; /* Copy of BtShared.maxLocal or BtShared.maxLeaf */ 48561 u16 minLocal; /* Copy of BtShared.minLocal or BtShared.minLeaf */ 48584 u16 minLocal; /* Copy of BtShared.minLocal or BtShared.minLeaf */ 48562 u16 cellOffset; /* Index in aData of first cell pointer */ 48585 u16 cellOffset; /* Index in aData of first cell pointer */ 48563 u16 nFree; /* Number of free bytes on the page */ 48586 u16 nFree; /* Number of free bytes on the page */ 48564 u16 nCell; /* Number of cells on this page, local and ovfl */ 48587 u16 nCell; /* Number of cells on this page, local and ovfl */ 48565 u16 maskPage; /* Mask for page offset */ 48588 u16 maskPage; /* Mask for page offset */ 48566 struct _OvflCell { /* Cells that will not fit on aData[] */ | 48589 u16 aiOvfl[5]; /* Insert the i-th overflow cell before the aiOvfl-th 48567 u8 *pCell; /* Pointers to the body of the overflow cell */ | 48590 ** non-overflow cell */ 48568 u16 idx; /* Insert this cell before idx-th non-overflow cell */ | 48591 u8 *apOvfl[5]; /* Pointers to the body of overflow cells */ 48569 } aOvfl[5]; < 48570 BtShared *pBt; /* Pointer to BtShared that this page is part of */ 48592 BtShared *pBt; /* Pointer to BtShared that this page is part of */ 48571 u8 *aData; /* Pointer to disk image of the page data */ 48593 u8 *aData; /* Pointer to disk image of the page data */ 48572 u8 *aDataEnd; /* One byte past the end of usable data */ 48594 u8 *aDataEnd; /* One byte past the end of usable data */ 48573 u8 *aCellIdx; /* The cell index area */ 48595 u8 *aCellIdx; /* The cell index area */ 48574 DbPage *pDbPage; /* Pager page handle */ 48596 DbPage *pDbPage; /* Pager page handle */ 48575 Pgno pgno; /* Page number for this page */ 48597 Pgno pgno; /* Page number for this page */ 48576 }; 48598 }; ................................................................................................................................................................................ 48770 ** found at self->pBt->mutex. 48792 ** found at self->pBt->mutex. 48771 */ 48793 */ 48772 struct BtCursor { 48794 struct BtCursor { 48773 Btree *pBtree; /* The Btree to which this cursor belongs */ 48795 Btree *pBtree; /* The Btree to which this cursor belongs */ 48774 BtShared *pBt; /* The BtShared this cursor points to */ 48796 BtShared *pBt; /* The BtShared this cursor points to */ 48775 BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */ 48797 BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */ 48776 struct KeyInfo *pKeyInfo; /* Argument passed to comparison function */ 48798 struct KeyInfo *pKeyInfo; /* Argument passed to comparison function */ > 48799 #ifndef SQLITE_OMIT_INCRBLOB > 48800 Pgno *aOverflow; /* Cache of overflow page locations */ > 48801 #endif 48777 Pgno pgnoRoot; /* The root page of this tree */ 48802 Pgno pgnoRoot; /* The root page of this tree */ 48778 sqlite3_int64 cachedRowid; /* Next rowid cache. 0 means not valid */ 48803 sqlite3_int64 cachedRowid; /* Next rowid cache. 0 means not valid */ 48779 CellInfo info; /* A parse of the cell we are pointing at */ 48804 CellInfo info; /* A parse of the cell we are pointing at */ 48780 i64 nKey; /* Size of pKey, or last integer key */ 48805 i64 nKey; /* Size of pKey, or last integer key */ 48781 void *pKey; /* Saved key that was cursor's last known position */ 48806 void *pKey; /* Saved key that was cursor's last known position */ 48782 int skipNext; /* Prev() is noop if negative. Next() is noop if positive */ 48807 int skipNext; /* Prev() is noop if negative. Next() is noop if positive */ 48783 u8 wrFlag; /* True if writable */ 48808 u8 wrFlag; /* True if writable */ 48784 u8 atLast; /* Cursor pointing to the last entry */ 48809 u8 atLast; /* Cursor pointing to the last entry */ 48785 u8 validNKey; /* True if info.nKey is valid */ 48810 u8 validNKey; /* True if info.nKey is valid */ 48786 u8 eState; /* One of the CURSOR_XXX constants (see below) */ 48811 u8 eState; /* One of the CURSOR_XXX constants (see below) */ 48787 #ifndef SQLITE_OMIT_INCRBLOB 48812 #ifndef SQLITE_OMIT_INCRBLOB 48788 Pgno *aOverflow; /* Cache of overflow page locations */ < 48789 u8 isIncrblobHandle; /* True if this cursor is an incr. io handle */ 48813 u8 isIncrblobHandle; /* True if this cursor is an incr. io handle */ 48790 #endif 48814 #endif 48791 i16 iPage; /* Index of current page in apPage */ 48815 i16 iPage; /* Index of current page in apPage */ 48792 u16 aiIdx[BTCURSOR_MAX_DEPTH]; /* Current index in apPage[i] */ 48816 u16 aiIdx[BTCURSOR_MAX_DEPTH]; /* Current index in apPage[i] */ 48793 MemPage *apPage[BTCURSOR_MAX_DEPTH]; /* Pages from root to current page */ 48817 MemPage *apPage[BTCURSOR_MAX_DEPTH]; /* Pages from root to current page */ 48794 }; 48818 }; 48795 48819 ................................................................................................................................................................................ 48910 ** This structure is passed around through all the sanity checking routines 48934 ** This structure is passed around through all the sanity checking routines 48911 ** in order to keep track of some global state information. 48935 ** in order to keep track of some global state information. 48912 */ 48936 */ 48913 typedef struct IntegrityCk IntegrityCk; 48937 typedef struct IntegrityCk IntegrityCk; 48914 struct IntegrityCk { 48938 struct IntegrityCk { 48915 BtShared *pBt; /* The tree being checked out */ 48939 BtShared *pBt; /* The tree being checked out */ 48916 Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ 48940 Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ 48917 Pgno nPage; /* Number of pages in the database */ < 48918 int *anRef; /* Number of times each page is referenced */ 48941 int *anRef; /* Number of times each page is referenced */ > 48942 Pgno nPage; /* Number of pages in the database */ 48919 int mxErr; /* Stop accumulating errors when this reaches zero */ 48943 int mxErr; /* Stop accumulating errors when this reaches zero */ 48920 int nErr; /* Number of messages written to zErrMsg so far */ 48944 int nErr; /* Number of messages written to zErrMsg so far */ 48921 int mallocFailed; /* A memory allocation error has occurred */ 48945 int mallocFailed; /* A memory allocation error has occurred */ 48922 StrAccum errMsg; /* Accumulate the error message text here */ 48946 StrAccum errMsg; /* Accumulate the error message text here */ 48923 }; 48947 }; 48924 48948 48925 /* 48949 /* ................................................................................................................................................................................ 50071 ** pages that do contain overflow cells. 50095 ** pages that do contain overflow cells. 50072 */ 50096 */ 50073 static u8 *findOverflowCell(MemPage *pPage, int iCell){ 50097 static u8 *findOverflowCell(MemPage *pPage, int iCell){ 50074 int i; 50098 int i; 50075 assert( sqlite3_mutex_held(pPage->pBt->mutex) ); 50099 assert( sqlite3_mutex_held(pPage->pBt->mutex) ); 50076 for(i=pPage->nOverflow-1; i>=0; i--){ 50100 for(i=pPage->nOverflow-1; i>=0; i--){ 50077 int k; 50101 int k; 50078 struct _OvflCell *pOvfl; | 50102 k = pPage->aiOvfl[i]; 50079 pOvfl = &pPage->aOvfl[i]; < 50080 k = pOvfl->idx; < 50081 if( k<=iCell ){ 50103 if( k<=iCell ){ 50082 if( k==iCell ){ 50104 if( k==iCell ){ 50083 return pOvfl->pCell; | 50105 return pPage->apOvfl[i]; 50084 } 50106 } 50085 iCell--; 50107 iCell--; 50086 } 50108 } 50087 } 50109 } 50088 return findCell(pPage, iCell); 50110 return findCell(pPage, iCell); 50089 } 50111 } 50090 50112 ................................................................................................................................................................................ 50890 ** be exclusively in memory, or it might use a disk-based memory cache. 50912 ** be exclusively in memory, or it might use a disk-based memory cache. 50891 ** Either way, the ephemeral database will be automatically deleted 50913 ** Either way, the ephemeral database will be automatically deleted 50892 ** when sqlite3BtreeClose() is called. 50914 ** when sqlite3BtreeClose() is called. 50893 ** 50915 ** 50894 ** If zFilename is ":memory:" then an in-memory database is created 50916 ** If zFilename is ":memory:" then an in-memory database is created 50895 ** that is automatically destroyed when it is closed. 50917 ** that is automatically destroyed when it is closed. 50896 ** 50918 ** 50897 ** The "flags" parameter is a bitmask that might contain bits | 50919 ** The "flags" parameter is a bitmask that might contain bits like 50898 ** BTREE_OMIT_JOURNAL and/or BTREE_NO_READLOCK. The BTREE_NO_READLOCK | 50920 ** BTREE_OMIT_JOURNAL and/or BTREE_MEMORY. 50899 ** bit is also set if the SQLITE_NoReadlock flags is set in db->flags. < 50900 ** These flags are passed through into sqlite3PagerOpen() and must < 50901 ** be the same values as PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK. < 50902 ** 50921 ** 50903 ** If the database is already opened in the same database connection 50922 ** If the database is already opened in the same database connection 50904 ** and we are in shared cache mode, then the open will fail with an 50923 ** and we are in shared cache mode, then the open will fail with an 50905 ** SQLITE_CONSTRAINT error. We cannot allow two or more BtShared 50924 ** SQLITE_CONSTRAINT error. We cannot allow two or more BtShared 50906 ** objects in the same database connection since doing so will lead 50925 ** objects in the same database connection since doing so will lead 50907 ** to problems with locking. 50926 ** to problems with locking. 50908 */ 50927 */ ................................................................................................................................................................................ 50941 50960 50942 /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ 50961 /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ 50943 assert( (flags & BTREE_UNORDERED)==0 || (flags & BTREE_SINGLE)!=0 ); 50962 assert( (flags & BTREE_UNORDERED)==0 || (flags & BTREE_SINGLE)!=0 ); 50944 50963 50945 /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ 50964 /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ 50946 assert( (flags & BTREE_SINGLE)==0 || isTempDb ); 50965 assert( (flags & BTREE_SINGLE)==0 || isTempDb ); 50947 50966 50948 if( db->flags & SQLITE_NoReadlock ){ < 50949 flags |= BTREE_NO_READLOCK; < 50950 } < 50951 if( isMemdb ){ 50967 if( isMemdb ){ 50952 flags |= BTREE_MEMORY; 50968 flags |= BTREE_MEMORY; 50953 } 50969 } 50954 if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ 50970 if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ 50955 vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; 50971 vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; 50956 } 50972 } 50957 p = sqlite3MallocZero(sizeof(Btree)); 50973 p = sqlite3MallocZero(sizeof(Btree)); ................................................................................................................................................................................ 53395 pCur->validNKey = 0; 53411 pCur->validNKey = 0; 53396 if( pNewPage->nCell<1 || pNewPage->intKey!=pCur->apPage[i]->intKey ){ 53412 if( pNewPage->nCell<1 || pNewPage->intKey!=pCur->apPage[i]->intKey ){ 53397 return SQLITE_CORRUPT_BKPT; 53413 return SQLITE_CORRUPT_BKPT; 53398 } 53414 } 53399 return SQLITE_OK; 53415 return SQLITE_OK; 53400 } 53416 } 53401 53417 53402 #ifndef NDEBUG | 53418 #if 0 53403 /* 53419 /* 53404 ** Page pParent is an internal (non-leaf) tree page. This function 53420 ** Page pParent is an internal (non-leaf) tree page. This function 53405 ** asserts that page number iChild is the left-child if the iIdx'th 53421 ** asserts that page number iChild is the left-child if the iIdx'th 53406 ** cell in page pParent. Or, if iIdx is equal to the total number of 53422 ** cell in page pParent. Or, if iIdx is equal to the total number of 53407 ** cells in pParent, that page number iChild is the right-child of 53423 ** cells in pParent, that page number iChild is the right-child of 53408 ** the page. 53424 ** the page. 53409 */ 53425 */ ................................................................................................................................................................................ 53428 ** the largest cell index. 53444 ** the largest cell index. 53429 */ 53445 */ 53430 static void moveToParent(BtCursor *pCur){ 53446 static void moveToParent(BtCursor *pCur){ 53431 assert( cursorHoldsMutex(pCur) ); 53447 assert( cursorHoldsMutex(pCur) ); 53432 assert( pCur->eState==CURSOR_VALID ); 53448 assert( pCur->eState==CURSOR_VALID ); 53433 assert( pCur->iPage>0 ); 53449 assert( pCur->iPage>0 ); 53434 assert( pCur->apPage[pCur->iPage] ); 53450 assert( pCur->apPage[pCur->iPage] ); > 53451 > 53452 /* UPDATE: It is actually possible for the condition tested by the assert > 53453 ** below to be untrue if the database file is corrupt. This can occur if > 53454 ** one cursor has modified page pParent while a reference to it is held > 53455 ** by a second cursor. Which can only happen if a single page is linked > 53456 ** into more than one b-tree structure in a corrupt database. */ > 53457 #if 0 53435 assertParentIndex( 53458 assertParentIndex( 53436 pCur->apPage[pCur->iPage-1], 53459 pCur->apPage[pCur->iPage-1], 53437 pCur->aiIdx[pCur->iPage-1], 53460 pCur->aiIdx[pCur->iPage-1], 53438 pCur->apPage[pCur->iPage]->pgno 53461 pCur->apPage[pCur->iPage]->pgno 53439 ); 53462 ); > 53463 #endif > 53464 testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell ); > 53465 53440 releasePage(pCur->apPage[pCur->iPage]); 53466 releasePage(pCur->apPage[pCur->iPage]); 53441 pCur->iPage--; 53467 pCur->iPage--; 53442 pCur->info.nSize = 0; 53468 pCur->info.nSize = 0; 53443 pCur->validNKey = 0; 53469 pCur->validNKey = 0; 53444 } 53470 } 53445 53471 53446 /* 53472 /* ................................................................................................................................................................................ 53902 return SQLITE_OK; 53928 return SQLITE_OK; 53903 } 53929 } 53904 pCur->skipNext = 0; 53930 pCur->skipNext = 0; 53905 53931 53906 pPage = pCur->apPage[pCur->iPage]; 53932 pPage = pCur->apPage[pCur->iPage]; 53907 idx = ++pCur->aiIdx[pCur->iPage]; 53933 idx = ++pCur->aiIdx[pCur->iPage]; 53908 assert( pPage->isInit ); 53934 assert( pPage->isInit ); > 53935 > 53936 /* If the database file is corrupt, it is possible for the value of idx > 53937 ** to be invalid here. This can only occur if a second cursor modifies > 53938 ** the page while cursor pCur is holding a reference to it. Which can > 53939 ** only happen if the database is corrupt in such a way as to link the > 53940 ** page into more than one b-tree structure. */ 53909 assert( idx<=pPage->nCell ); | 53941 testcase( idx>pPage->nCell ); 53910 53942 53911 pCur->info.nSize = 0; 53943 pCur->info.nSize = 0; 53912 pCur->validNKey = 0; 53944 pCur->validNKey = 0; 53913 if( idx>=pPage->nCell ){ 53945 if( idx>=pPage->nCell ){ 53914 if( !pPage->leaf ){ 53946 if( !pPage->leaf ){ 53915 rc = moveToChild(pCur, get4byte(&pPage->aData[pPage->hdrOffset+8])); 53947 rc = moveToChild(pCur, get4byte(&pPage->aData[pPage->hdrOffset+8])); 53916 if( rc ) return rc; 53948 if( rc ) return rc; ................................................................................................................................................................................ 54712 /* 54744 /* 54713 ** Insert a new cell on pPage at cell index "i". pCell points to the 54745 ** Insert a new cell on pPage at cell index "i". pCell points to the 54714 ** content of the cell. 54746 ** content of the cell. 54715 ** 54747 ** 54716 ** If the cell content will fit on the page, then put it there. If it 54748 ** If the cell content will fit on the page, then put it there. If it 54717 ** will not fit, then make a copy of the cell content into pTemp if 54749 ** will not fit, then make a copy of the cell content into pTemp if 54718 ** pTemp is not null. Regardless of pTemp, allocate a new entry 54750 ** pTemp is not null. Regardless of pTemp, allocate a new entry 54719 ** in pPage->aOvfl[] and make it point to the cell content (either | 54751 ** in pPage->apOvfl[] and make it point to the cell content (either 54720 ** in pTemp or the original pCell) and also record its index. 54752 ** in pTemp or the original pCell) and also record its index. 54721 ** Allocating a new entry in pPage->aCell[] implies that 54753 ** Allocating a new entry in pPage->aCell[] implies that 54722 ** pPage->nOverflow is incremented. 54754 ** pPage->nOverflow is incremented. 54723 ** 54755 ** 54724 ** If nSkip is non-zero, then do not copy the first nSkip bytes of the 54756 ** If nSkip is non-zero, then do not copy the first nSkip bytes of the 54725 ** cell. The caller will overwrite them after this function returns. If 54757 ** cell. The caller will overwrite them after this function returns. If 54726 ** nSkip is non-zero, then pCell may not point to an invalid memory location 54758 ** nSkip is non-zero, then pCell may not point to an invalid memory location ................................................................................................................................................................................ 54746 54778 54747 int nSkip = (iChild ? 4 : 0); 54779 int nSkip = (iChild ? 4 : 0); 54748 54780 54749 if( *pRC ) return; 54781 if( *pRC ) return; 54750 54782 54751 assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); 54783 assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); 54752 assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921 ); 54784 assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921 ); 54753 assert( pPage->nOverflow<=ArraySize(pPage->aOvfl) ); | 54785 assert( pPage->nOverflow<=ArraySize(pPage->apOvfl) ); > 54786 assert( ArraySize(pPage->apOvfl)==ArraySize(pPage->aiOvfl) ); 54754 assert( sqlite3_mutex_held(pPage->pBt->mutex) ); 54787 assert( sqlite3_mutex_held(pPage->pBt->mutex) ); 54755 /* The cell should normally be sized correctly. However, when moving a 54788 /* The cell should normally be sized correctly. However, when moving a 54756 ** malformed cell from a leaf page to an interior page, if the cell size 54789 ** malformed cell from a leaf page to an interior page, if the cell size 54757 ** wanted to be less than 4 but got rounded up to 4 on the leaf, then size 54790 ** wanted to be less than 4 but got rounded up to 4 on the leaf, then size 54758 ** might be less than 8 (leaf-size + pointer) on the interior node. Hence 54791 ** might be less than 8 (leaf-size + pointer) on the interior node. Hence 54759 ** the term after the || in the following assert(). */ 54792 ** the term after the || in the following assert(). */ 54760 assert( sz==cellSizePtr(pPage, pCell) || (sz==8 && iChild>0) ); 54793 assert( sz==cellSizePtr(pPage, pCell) || (sz==8 && iChild>0) ); ................................................................................................................................................................................ 54763 memcpy(pTemp+nSkip, pCell+nSkip, sz-nSkip); 54796 memcpy(pTemp+nSkip, pCell+nSkip, sz-nSkip); 54764 pCell = pTemp; 54797 pCell = pTemp; 54765 } 54798 } 54766 if( iChild ){ 54799 if( iChild ){ 54767 put4byte(pCell, iChild); 54800 put4byte(pCell, iChild); 54768 } 54801 } 54769 j = pPage->nOverflow++; 54802 j = pPage->nOverflow++; 54770 assert( j<(int)(sizeof(pPage->aOvfl)/sizeof(pPage->aOvfl[0])) ); | 54803 assert( j<(int)(sizeof(pPage->apOvfl)/sizeof(pPage->apOvfl[0])) ); 54771 pPage->aOvfl[j].pCell = pCell; | 54804 pPage->apOvfl[j] = pCell; 54772 pPage->aOvfl[j].idx = (u16)i; | 54805 pPage->aiOvfl[j] = (u16)i; 54773 }else{ 54806 }else{ 54774 int rc = sqlite3PagerWrite(pPage->pDbPage); 54807 int rc = sqlite3PagerWrite(pPage->pDbPage); 54775 if( rc!=SQLITE_OK ){ 54808 if( rc!=SQLITE_OK ){ 54776 *pRC = rc; 54809 *pRC = rc; 54777 return; 54810 return; 54778 } 54811 } 54779 assert( sqlite3PagerIswriteable(pPage->pDbPage) ); 54812 assert( sqlite3PagerIswriteable(pPage->pDbPage) ); ................................................................................................................................................................................ 54913 ** may be inserted. If both these operations are successful, proceed. 54946 ** may be inserted. If both these operations are successful, proceed. 54914 */ 54947 */ 54915 rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0); 54948 rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0); 54916 54949 54917 if( rc==SQLITE_OK ){ 54950 if( rc==SQLITE_OK ){ 54918 54951 54919 u8 *pOut = &pSpace[4]; 54952 u8 *pOut = &pSpace[4]; 54920 u8 *pCell = pPage->aOvfl[0].pCell; | 54953 u8 *pCell = pPage->apOvfl[0]; 54921 u16 szCell = cellSizePtr(pPage, pCell); 54954 u16 szCell = cellSizePtr(pPage, pCell); 54922 u8 *pStop; 54955 u8 *pStop; 54923 54956 54924 assert( sqlite3PagerIswriteable(pNew->pDbPage) ); 54957 assert( sqlite3PagerIswriteable(pNew->pDbPage) ); 54925 assert( pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF) ); 54958 assert( pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF) ); 54926 zeroPage(pNew, PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF); 54959 zeroPage(pNew, PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF); 54927 assemblePage(pNew, 1, &pCell, &szCell); 54960 assemblePage(pNew, 1, &pCell, &szCell); ................................................................................................................................................................................ 55023 ** on page pFrom to page pTo. If page pFrom was not a leaf page, then 55056 ** on page pFrom to page pTo. If page pFrom was not a leaf page, then 55024 ** the pointer-map entries for each child page are updated so that the 55057 ** the pointer-map entries for each child page are updated so that the 55025 ** parent page stored in the pointer map is page pTo. If pFrom contained 55058 ** parent page stored in the pointer map is page pTo. If pFrom contained 55026 ** any cells with overflow page pointers, then the corresponding pointer 55059 ** any cells with overflow page pointers, then the corresponding pointer 55027 ** map entries are also updated so that the parent page is page pTo. 55060 ** map entries are also updated so that the parent page is page pTo. 55028 ** 55061 ** 55029 ** If pFrom is currently carrying any overflow cells (entries in the 55062 ** If pFrom is currently carrying any overflow cells (entries in the 55030 ** MemPage.aOvfl[] array), they are not copied to pTo. | 55063 ** MemPage.apOvfl[] array), they are not copied to pTo. 55031 ** 55064 ** 55032 ** Before returning, page pTo is reinitialized using btreeInitPage(). 55065 ** Before returning, page pTo is reinitialized using btreeInitPage(). 55033 ** 55066 ** 55034 ** The performance of this function is not critical. It is only used by 55067 ** The performance of this function is not critical. It is only used by 55035 ** the balance_shallower() and balance_deeper() procedures, neither of 55068 ** the balance_shallower() and balance_deeper() procedures, neither of 55036 ** which are called often under normal circumstances. 55069 ** which are called often under normal circumstances. 55037 */ 55070 */ ................................................................................................................................................................................ 55160 55193 55161 /* At this point pParent may have at most one overflow cell. And if 55194 /* At this point pParent may have at most one overflow cell. And if 55162 ** this overflow cell is present, it must be the cell with 55195 ** this overflow cell is present, it must be the cell with 55163 ** index iParentIdx. This scenario comes about when this function 55196 ** index iParentIdx. This scenario comes about when this function 55164 ** is called (indirectly) from sqlite3BtreeDelete(). 55197 ** is called (indirectly) from sqlite3BtreeDelete(). 55165 */ 55198 */ 55166 assert( pParent->nOverflow==0 || pParent->nOverflow==1 ); 55199 assert( pParent->nOverflow==0 || pParent->nOverflow==1 ); 55167 assert( pParent->nOverflow==0 || pParent->aOvfl[0].idx==iParentIdx ); | 55200 assert( pParent->nOverflow==0 || pParent->aiOvfl[0]==iParentIdx ); 55168 55201 55169 if( !aOvflSpace ){ 55202 if( !aOvflSpace ){ 55170 return SQLITE_NOMEM; 55203 return SQLITE_NOMEM; 55171 } 55204 } 55172 55205 55173 /* Find the sibling pages to balance. Also locate the cells in pParent 55206 /* Find the sibling pages to balance. Also locate the cells in pParent 55174 ** that divide the siblings. An attempt is made to find NN siblings on 55207 ** that divide the siblings. An attempt is made to find NN siblings on ................................................................................................................................................................................ 55207 if( rc ){ 55240 if( rc ){ 55208 memset(apOld, 0, (i+1)*sizeof(MemPage*)); 55241 memset(apOld, 0, (i+1)*sizeof(MemPage*)); 55209 goto balance_cleanup; 55242 goto balance_cleanup; 55210 } 55243 } 55211 nMaxCells += 1+apOld[i]->nCell+apOld[i]->nOverflow; 55244 nMaxCells += 1+apOld[i]->nCell+apOld[i]->nOverflow; 55212 if( (i--)==0 ) break; 55245 if( (i--)==0 ) break; 55213 55246 55214 if( i+nxDiv==pParent->aOvfl[0].idx && pParent->nOverflow ){ | 55247 if( i+nxDiv==pParent->aiOvfl[0] && pParent->nOverflow ){ 55215 apDiv[i] = pParent->aOvfl[0].pCell; | 55248 apDiv[i] = pParent->apOvfl[0]; 55216 pgno = get4byte(apDiv[i]); 55249 pgno = get4byte(apDiv[i]); 55217 szNew[i] = cellSizePtr(pParent, apDiv[i]); 55250 szNew[i] = cellSizePtr(pParent, apDiv[i]); 55218 pParent->nOverflow = 0; 55251 pParent->nOverflow = 0; 55219 }else{ 55252 }else{ 55220 apDiv[i] = findCell(pParent, i+nxDiv-pParent->nOverflow); 55253 apDiv[i] = findCell(pParent, i+nxDiv-pParent->nOverflow); 55221 pgno = get4byte(apDiv[i]); 55254 pgno = get4byte(apDiv[i]); 55222 szNew[i] = cellSizePtr(pParent, apDiv[i]); 55255 szNew[i] = cellSizePtr(pParent, apDiv[i]); ................................................................................................................................................................................ 55649 ** setting a pointer map entry is a relatively expensive operation, this 55682 ** setting a pointer map entry is a relatively expensive operation, this 55650 ** code only sets pointer map entries for child or overflow pages that have 55683 ** code only sets pointer map entries for child or overflow pages that have 55651 ** actually moved between pages. */ 55684 ** actually moved between pages. */ 55652 MemPage *pNew = apNew[0]; 55685 MemPage *pNew = apNew[0]; 55653 MemPage *pOld = apCopy[0]; 55686 MemPage *pOld = apCopy[0]; 55654 int nOverflow = pOld->nOverflow; 55687 int nOverflow = pOld->nOverflow; 55655 int iNextOld = pOld->nCell + nOverflow; 55688 int iNextOld = pOld->nCell + nOverflow; 55656 int iOverflow = (nOverflow ? pOld->aOvfl[0].idx : -1); | 55689 int iOverflow = (nOverflow ? pOld->aiOvfl[0] : -1); 55657 j = 0; /* Current 'old' sibling page */ 55690 j = 0; /* Current 'old' sibling page */ 55658 k = 0; /* Current 'new' sibling page */ 55691 k = 0; /* Current 'new' sibling page */ 55659 for(i=0; i<nCell; i++){ 55692 for(i=0; i<nCell; i++){ 55660 int isDivider = 0; 55693 int isDivider = 0; 55661 while( i==iNextOld ){ 55694 while( i==iNextOld ){ 55662 /* Cell i is the cell immediately following the last cell on old 55695 /* Cell i is the cell immediately following the last cell on old 55663 ** sibling page j. If the siblings are not leaf pages of an 55696 ** sibling page j. If the siblings are not leaf pages of an 55664 ** intkey b-tree, then cell i was a divider cell. */ 55697 ** intkey b-tree, then cell i was a divider cell. */ 55665 assert( j+1 < ArraySize(apCopy) ); 55698 assert( j+1 < ArraySize(apCopy) ); 55666 pOld = apCopy[++j]; 55699 pOld = apCopy[++j]; 55667 iNextOld = i + !leafData + pOld->nCell + pOld->nOverflow; 55700 iNextOld = i + !leafData + pOld->nCell + pOld->nOverflow; 55668 if( pOld->nOverflow ){ 55701 if( pOld->nOverflow ){ 55669 nOverflow = pOld->nOverflow; 55702 nOverflow = pOld->nOverflow; 55670 iOverflow = i + !leafData + pOld->aOvfl[0].idx; | 55703 iOverflow = i + !leafData + pOld->aiOvfl[0]; 55671 } 55704 } 55672 isDivider = !leafData; 55705 isDivider = !leafData; 55673 } 55706 } 55674 55707 55675 assert(nOverflow>0 || iOverflow<i ); 55708 assert(nOverflow>0 || iOverflow<i ); 55676 assert(nOverflow<2 || pOld->aOvfl[0].idx==pOld->aOvfl[1].idx-1); | 55709 assert(nOverflow<2 || pOld->aiOvfl[0]==pOld->aiOvfl[1]-1); 55677 assert(nOverflow<3 || pOld->aOvfl[1].idx==pOld->aOvfl[2].idx-1); | 55710 assert(nOverflow<3 || pOld->aiOvfl[1]==pOld->aiOvfl[2]-1); 55678 if( i==iOverflow ){ 55711 if( i==iOverflow ){ 55679 isDivider = 1; 55712 isDivider = 1; 55680 if( (--nOverflow)>0 ){ 55713 if( (--nOverflow)>0 ){ 55681 iOverflow++; 55714 iOverflow++; 55682 } 55715 } 55683 } 55716 } 55684 55717 ................................................................................................................................................................................ 55791 assert( sqlite3PagerIswriteable(pChild->pDbPage) ); 55824 assert( sqlite3PagerIswriteable(pChild->pDbPage) ); 55792 assert( sqlite3PagerIswriteable(pRoot->pDbPage) ); 55825 assert( sqlite3PagerIswriteable(pRoot->pDbPage) ); 55793 assert( pChild->nCell==pRoot->nCell ); 55826 assert( pChild->nCell==pRoot->nCell ); 55794 55827 55795 TRACE(("BALANCE: copy root %d into %d\n", pRoot->pgno, pChild->pgno)); 55828 TRACE(("BALANCE: copy root %d into %d\n", pRoot->pgno, pChild->pgno)); 55796 55829 55797 /* Copy the overflow cells from pRoot to pChild */ 55830 /* Copy the overflow cells from pRoot to pChild */ > 55831 memcpy(pChild->aiOvfl, pRoot->aiOvfl, 55798 memcpy(pChild->aOvfl, pRoot->aOvfl, pRoot->nOverflow*sizeof(pRoot->aOvfl[0])); | 55832 pRoot->nOverflow*sizeof(pRoot->aiOvfl[0])); > 55833 memcpy(pChild->apOvfl, pRoot->apOvfl, > 55834 pRoot->nOverflow*sizeof(pRoot->apOvfl[0])); 55799 pChild->nOverflow = pRoot->nOverflow; 55835 pChild->nOverflow = pRoot->nOverflow; 55800 55836 55801 /* Zero the contents of pRoot. Then install pChild as the right-child. */ 55837 /* Zero the contents of pRoot. Then install pChild as the right-child. */ 55802 zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF); 55838 zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF); 55803 put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild); 55839 put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild); 55804 55840 55805 *ppChild = pChild; 55841 *ppChild = pChild; ................................................................................................................................................................................ 55854 int const iIdx = pCur->aiIdx[iPage-1]; 55890 int const iIdx = pCur->aiIdx[iPage-1]; 55855 55891 55856 rc = sqlite3PagerWrite(pParent->pDbPage); 55892 rc = sqlite3PagerWrite(pParent->pDbPage); 55857 if( rc==SQLITE_OK ){ 55893 if( rc==SQLITE_OK ){ 55858 #ifndef SQLITE_OMIT_QUICKBALANCE 55894 #ifndef SQLITE_OMIT_QUICKBALANCE 55859 if( pPage->hasData 55895 if( pPage->hasData 55860 && pPage->nOverflow==1 55896 && pPage->nOverflow==1 55861 && pPage->aOvfl[0].idx==pPage->nCell | 55897 && pPage->aiOvfl[0]==pPage->nCell 55862 && pParent->pgno!=1 55898 && pParent->pgno!=1 55863 && pParent->nCell==iIdx 55899 && pParent->nCell==iIdx 55864 ){ 55900 ){ 55865 /* Call balance_quick() to create a new sibling of pPage on which 55901 /* Call balance_quick() to create a new sibling of pPage on which 55866 ** to store the overflow cell. balance_quick() inserts a new cell 55902 ** to store the overflow cell. balance_quick() inserts a new cell 55867 ** into pParent, which may cause pParent overflow. If this 55903 ** into pParent, which may cause pParent overflow. If this 55868 ** happens, the next interation of the do-loop will balance pParent 55904 ** happens, the next interation of the do-loop will balance pParent ................................................................................................................................................................................ 58275 } 58311 } 58276 } 58312 } 58277 58313 58278 if( pMem->z && preserve && pMem->zMalloc && pMem->z!=pMem->zMalloc ){ 58314 if( pMem->z && preserve && pMem->zMalloc && pMem->z!=pMem->zMalloc ){ 58279 memcpy(pMem->zMalloc, pMem->z, pMem->n); 58315 memcpy(pMem->zMalloc, pMem->z, pMem->n); 58280 } 58316 } 58281 if( pMem->flags&MEM_Dyn && pMem->xDel ){ 58317 if( pMem->flags&MEM_Dyn && pMem->xDel ){ > 58318 assert( pMem->xDel!=SQLITE_DYNAMIC ); 58282 pMem->xDel((void *)(pMem->z)); 58319 pMem->xDel((void *)(pMem->z)); 58283 } 58320 } 58284 58321 58285 pMem->z = pMem->zMalloc; 58322 pMem->z = pMem->zMalloc; 58286 if( pMem->z==0 ){ 58323 if( pMem->z==0 ){ 58287 pMem->flags = MEM_Null; 58324 pMem->flags = MEM_Null; 58288 }else{ 58325 }else{ ................................................................................................................................................................................ 58454 assert( p->db==0 || sqlite3_mutex_held(p->db->mutex) ); 58491 assert( p->db==0 || sqlite3_mutex_held(p->db->mutex) ); 58455 if( p->flags&MEM_Agg ){ 58492 if( p->flags&MEM_Agg ){ 58456 sqlite3VdbeMemFinalize(p, p->u.pDef); 58493 sqlite3VdbeMemFinalize(p, p->u.pDef); 58457 assert( (p->flags & MEM_Agg)==0 ); 58494 assert( (p->flags & MEM_Agg)==0 ); 58458 sqlite3VdbeMemRelease(p); 58495 sqlite3VdbeMemRelease(p); 58459 }else if( p->flags&MEM_Dyn && p->xDel ){ 58496 }else if( p->flags&MEM_Dyn && p->xDel ){ 58460 assert( (p->flags&MEM_RowSet)==0 ); 58497 assert( (p->flags&MEM_RowSet)==0 ); > 58498 assert( p->xDel!=SQLITE_DYNAMIC ); 58461 p->xDel((void *)p->z); 58499 p->xDel((void *)p->z); 58462 p->xDel = 0; 58500 p->xDel = 0; 58463 }else if( p->flags&MEM_RowSet ){ 58501 }else if( p->flags&MEM_RowSet ){ 58464 sqlite3RowSetClear(p->u.pRowSet); 58502 sqlite3RowSetClear(p->u.pRowSet); 58465 }else if( p->flags&MEM_Frame ){ 58503 }else if( p->flags&MEM_Frame ){ 58466 sqlite3VdbeMemSetNull(p); 58504 sqlite3VdbeMemSetNull(p); 58467 } 58505 } ................................................................................................................................................................................ 59571 ** The VDBE knows that a P2 value is a label because labels are 59609 ** The VDBE knows that a P2 value is a label because labels are 59572 ** always negative and P2 values are suppose to be non-negative. 59610 ** always negative and P2 values are suppose to be non-negative. 59573 ** Hence, a negative P2 value is a label that has yet to be resolved. 59611 ** Hence, a negative P2 value is a label that has yet to be resolved. 59574 ** 59612 ** 59575 ** Zero is returned if a malloc() fails. 59613 ** Zero is returned if a malloc() fails. 59576 */ 59614 */ 59577 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *p){ 59615 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *p){ 59578 int i; < 59579 i = p->nLabel++; | 59616 int i = p->nLabel++; 59580 assert( p->magic==VDBE_MAGIC_INIT ); 59617 assert( p->magic==VDBE_MAGIC_INIT ); 59581 if( i>=p->nLabelAlloc ){ < 59582 int n = p->nLabelAlloc*2 + 5; < > 59618 if( (i & (i-1))==0 ){ 59583 p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, | 59619 p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, 59584 n*sizeof(p->aLabel[0])); | 59620 (i*2+1)*sizeof(p->aLabel[0])); 59585 p->nLabelAlloc = sqlite3DbMallocSize(p->db, p->aLabel)/sizeof(p->aLabel[0]); < 59586 } 59621 } 59587 if( p->aLabel ){ 59622 if( p->aLabel ){ 59588 p->aLabel[i] = -1; 59623 p->aLabel[i] = -1; 59589 } 59624 } 59590 return -1-i; 59625 return -1-i; 59591 } 59626 } 59592 59627 ................................................................................................................................................................................ 61623 if( eStatementOp!=SAVEPOINT_ROLLBACK ){ 61658 if( eStatementOp!=SAVEPOINT_ROLLBACK ){ 61624 sqlite3VdbeSetChanges(db, p->nChange); 61659 sqlite3VdbeSetChanges(db, p->nChange); 61625 }else{ 61660 }else{ 61626 sqlite3VdbeSetChanges(db, 0); 61661 sqlite3VdbeSetChanges(db, 0); 61627 } 61662 } 61628 p->nChange = 0; 61663 p->nChange = 0; 61629 } 61664 } 61630 < 61631 /* Rollback or commit any schema changes that occurred. */ < 61632 if( p->rc!=SQLITE_OK && db->flags&SQLITE_InternChanges ){ < 61633 sqlite3ResetInternalSchema(db, -1); < 61634 db->flags = (db->flags | SQLITE_InternChanges); < 61635 } < 61636 61665 61637 /* Release the locks */ 61666 /* Release the locks */ 61638 sqlite3VdbeLeave(p); 61667 sqlite3VdbeLeave(p); 61639 } 61668 } 61640 61669 61641 /* We have successfully halted and closed the VM. Record this fact. */ 61670 /* We have successfully halted and closed the VM. Record this fact. */ 61642 if( p->pc>=0 ){ 61671 if( p->pc>=0 ){ ................................................................................................................................................................................ 66049 break; 66078 break; 66050 66079 66051 arithmetic_result_is_null: 66080 arithmetic_result_is_null: 66052 sqlite3VdbeMemSetNull(pOut); 66081 sqlite3VdbeMemSetNull(pOut); 66053 break; 66082 break; 66054 } 66083 } 66055 66084 66056 /* Opcode: CollSeq * * P4 | 66085 /* Opcode: CollSeq P1 * * P4 66057 ** 66086 ** 66058 ** P4 is a pointer to a CollSeq struct. If the next call to a user function 66087 ** P4 is a pointer to a CollSeq struct. If the next call to a user function 66059 ** or aggregate calls sqlite3GetFuncCollSeq(), this collation sequence will 66088 ** or aggregate calls sqlite3GetFuncCollSeq(), this collation sequence will 66060 ** be returned. This is used by the built-in min(), max() and nullif() 66089 ** be returned. This is used by the built-in min(), max() and nullif() 66061 ** functions. 66090 ** functions. > 66091 ** > 66092 ** If P1 is not zero, then it is a register that a subsequent min() or > 66093 ** max() aggregate will set to 1 if the current row is not the minimum or > 66094 ** maximum. The P1 register is initialized to 0 by this instruction. 66062 ** 66095 ** 66063 ** The interface used by the implementation of the aforementioned functions 66096 ** The interface used by the implementation of the aforementioned functions 66064 ** to retrieve the collation sequence set by this opcode is not available 66097 ** to retrieve the collation sequence set by this opcode is not available 66065 ** publicly, only to user functions defined in func.c. 66098 ** publicly, only to user functions defined in func.c. 66066 */ 66099 */ 66067 case OP_CollSeq: { 66100 case OP_CollSeq: { 66068 assert( pOp->p4type==P4_COLLSEQ ); 66101 assert( pOp->p4type==P4_COLLSEQ ); > 66102 if( pOp->p1 ){ > 66103 sqlite3VdbeMemSetInt64(&aMem[pOp->p1], 0); > 66104 } 66069 break; 66105 break; 66070 } 66106 } 66071 66107 66072 /* Opcode: Function P1 P2 P3 P4 P5 66108 /* Opcode: Function P1 P2 P3 P4 P5 66073 ** 66109 ** 66074 ** Invoke a user function (P4 is a pointer to a Function structure that 66110 ** Invoke a user function (P4 is a pointer to a Function structure that 66075 ** defines the function) with P5 arguments taken from register P2 and 66111 ** defines the function) with P5 arguments taken from register P2 and ................................................................................................................................................................................ 67595 ** on the file. 67631 ** on the file. 67596 ** 67632 ** 67597 ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is 67633 ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is 67598 ** true (this flag is set if the Vdbe may modify more than one row and may 67634 ** true (this flag is set if the Vdbe may modify more than one row and may 67599 ** throw an ABORT exception), a statement transaction may also be opened. 67635 ** throw an ABORT exception), a statement transaction may also be opened. 67600 ** More specifically, a statement transaction is opened iff the database 67636 ** More specifically, a statement transaction is opened iff the database 67601 ** connection is currently not in autocommit mode, or if there are other 67637 ** connection is currently not in autocommit mode, or if there are other 67602 ** active statements. A statement transaction allows the affects of this | 67638 ** active statements. A statement transaction allows the changes made by this 67603 ** VDBE to be rolled back after an error without having to roll back the 67639 ** VDBE to be rolled back after an error without having to roll back the 67604 ** entire transaction. If no error is encountered, the statement transaction 67640 ** entire transaction. If no error is encountered, the statement transaction 67605 ** will automatically commit when the VDBE halts. 67641 ** will automatically commit when the VDBE halts. 67606 ** 67642 ** 67607 ** If P2 is zero, then a read-lock is obtained on the database file. 67643 ** If P2 is zero, then a read-lock is obtained on the database file. 67608 */ 67644 */ 67609 case OP_Transaction: { 67645 case OP_Transaction: { ................................................................................................................................................................................ 69639 assert( !db->mallocFailed ); 69675 assert( !db->mallocFailed ); 69640 rc = sqlite3_exec(db, u.by.zSql, sqlite3InitCallback, &u.by.initData, 0); 69676 rc = sqlite3_exec(db, u.by.zSql, sqlite3InitCallback, &u.by.initData, 0); 69641 if( rc==SQLITE_OK ) rc = u.by.initData.rc; 69677 if( rc==SQLITE_OK ) rc = u.by.initData.rc; 69642 sqlite3DbFree(db, u.by.zSql); 69678 sqlite3DbFree(db, u.by.zSql); 69643 db->init.busy = 0; 69679 db->init.busy = 0; 69644 } 69680 } 69645 } 69681 } > 69682 if( rc ) sqlite3ResetInternalSchema(db, -1); 69646 if( rc==SQLITE_NOMEM ){ 69683 if( rc==SQLITE_NOMEM ){ 69647 goto no_mem; 69684 goto no_mem; 69648 } 69685 } 69649 break; 69686 break; 69650 } 69687 } 69651 69688 69652 #if !defined(SQLITE_OMIT_ANALYZE) 69689 #if !defined(SQLITE_OMIT_ANALYZE) ................................................................................................................................................................................ 69981 p->nMem = u.cc.pFrame->nChildMem; 70018 p->nMem = u.cc.pFrame->nChildMem; 69982 p->nCursor = (u16)u.cc.pFrame->nChildCsr; 70019 p->nCursor = (u16)u.cc.pFrame->nChildCsr; 69983 p->apCsr = (VdbeCursor **)&aMem[p->nMem+1]; 70020 p->apCsr = (VdbeCursor **)&aMem[p->nMem+1]; 69984 p->aOp = aOp = u.cc.pProgram->aOp; 70021 p->aOp = aOp = u.cc.pProgram->aOp; 69985 p->nOp = u.cc.pProgram->nOp; 70022 p->nOp = u.cc.pProgram->nOp; 69986 p->aOnceFlag = (u8 *)&p->apCsr[p->nCursor]; 70023 p->aOnceFlag = (u8 *)&p->apCsr[p->nCursor]; 69987 p->nOnceFlag = u.cc.pProgram->nOnce; 70024 p->nOnceFlag = u.cc.pProgram->nOnce; 69988 p->nOp = u.cc.pProgram->nOp; < 69989 pc = -1; 70025 pc = -1; 69990 memset(p->aOnceFlag, 0, p->nOnceFlag); 70026 memset(p->aOnceFlag, 0, p->nOnceFlag); 69991 70027 69992 break; 70028 break; 69993 } 70029 } 69994 70030 69995 /* Opcode: Param P1 P2 * * * 70031 /* Opcode: Param P1 P2 * * * ................................................................................................................................................................................ 70176 u.cf.ctx.s.flags = MEM_Null; 70212 u.cf.ctx.s.flags = MEM_Null; 70177 u.cf.ctx.s.z = 0; 70213 u.cf.ctx.s.z = 0; 70178 u.cf.ctx.s.zMalloc = 0; 70214 u.cf.ctx.s.zMalloc = 0; 70179 u.cf.ctx.s.xDel = 0; 70215 u.cf.ctx.s.xDel = 0; 70180 u.cf.ctx.s.db = db; 70216 u.cf.ctx.s.db = db; 70181 u.cf.ctx.isError = 0; 70217 u.cf.ctx.isError = 0; 70182 u.cf.ctx.pColl = 0; 70218 u.cf.ctx.pColl = 0; > 70219 u.cf.ctx.skipFlag = 0; 70183 if( u.cf.ctx.pFunc->flags & SQLITE_FUNC_NEEDCOLL ){ 70220 if( u.cf.ctx.pFunc->flags & SQLITE_FUNC_NEEDCOLL ){ 70184 assert( pOp>p->aOp ); 70221 assert( pOp>p->aOp ); 70185 assert( pOp[-1].p4type==P4_COLLSEQ ); 70222 assert( pOp[-1].p4type==P4_COLLSEQ ); 70186 assert( pOp[-1].opcode==OP_CollSeq ); 70223 assert( pOp[-1].opcode==OP_CollSeq ); 70187 u.cf.ctx.pColl = pOp[-1].p4.pColl; 70224 u.cf.ctx.pColl = pOp[-1].p4.pColl; 70188 } 70225 } 70189 (u.cf.ctx.pFunc->xStep)(&u.cf.ctx, u.cf.n, u.cf.apVal); /* IMP: R-24505-23230 70226 (u.cf.ctx.pFunc->xStep)(&u.cf.ctx, u.cf.n, u.cf.apVal); /* IMP: R-24505-23230 70190 if( u.cf.ctx.isError ){ 70227 if( u.cf.ctx.isError ){ 70191 sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(&u.cf.ctx.s)); 70228 sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(&u.cf.ctx.s)); 70192 rc = u.cf.ctx.isError; 70229 rc = u.cf.ctx.isError; 70193 } 70230 } > 70231 if( u.cf.ctx.skipFlag ){ > 70232 assert( pOp[-1].opcode==OP_CollSeq ); > 70233 u.cf.i = pOp[-1].p1; > 70234 if( u.cf.i ) sqlite3VdbeMemSetInt64(&aMem[u.cf.i], 1); > 70235 } 70194 70236 70195 sqlite3VdbeMemRelease(&u.cf.ctx.s); 70237 sqlite3VdbeMemRelease(&u.cf.ctx.s); 70196 70238 70197 break; 70239 break; 70198 } 70240 } 70199 70241 70200 /* Opcode: AggFinal P1 P2 * P4 * 70242 /* Opcode: AggFinal P1 P2 * P4 * ................................................................................................................................................................................ 71580 ** aTree[] = { X, 0 0, 6 0, 3, 5, 6 } 71622 ** aTree[] = { X, 0 0, 6 0, 3, 5, 6 } 71581 ** 71623 ** 71582 ** In other words, each time we advance to the next sorter element, log2(N) 71624 ** In other words, each time we advance to the next sorter element, log2(N) 71583 ** key comparison operations are required, where N is the number of segments 71625 ** key comparison operations are required, where N is the number of segments 71584 ** being merged (rounded up to the next power of 2). 71626 ** being merged (rounded up to the next power of 2). 71585 */ 71627 */ 71586 struct VdbeSorter { 71628 struct VdbeSorter { > 71629 i64 iWriteOff; /* Current write offset within file pTemp1 */ > 71630 i64 iReadOff; /* Current read offset within file pTemp1 */ 71587 int nInMemory; /* Current size of pRecord list as PMA */ 71631 int nInMemory; /* Current size of pRecord list as PMA */ 71588 int nTree; /* Used size of aTree/aIter (power of 2) */ 71632 int nTree; /* Used size of aTree/aIter (power of 2) */ > 71633 int nPMA; /* Number of PMAs stored in pTemp1 */ > 71634 int mnPmaSize; /* Minimum PMA size, in bytes */ > 71635 int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */ 71589 VdbeSorterIter *aIter; /* Array of iterators to merge */ 71636 VdbeSorterIter *aIter; /* Array of iterators to merge */ 71590 int *aTree; /* Current state of incremental merge */ 71637 int *aTree; /* Current state of incremental merge */ 71591 i64 iWriteOff; /* Current write offset within file pTemp1 */ < 71592 i64 iReadOff; /* Current read offset within file pTemp1 */ < 71593 sqlite3_file *pTemp1; /* PMA file 1 */ 71638 sqlite3_file *pTemp1; /* PMA file 1 */ 71594 int nPMA; /* Number of PMAs stored in pTemp1 */ < 71595 SorterRecord *pRecord; /* Head of in-memory record list */ 71639 SorterRecord *pRecord; /* Head of in-memory record list */ 71596 int mnPmaSize; /* Minimum PMA size, in bytes */ < 71597 int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */ < 71598 UnpackedRecord *pUnpacked; /* Used to unpack keys */ 71640 UnpackedRecord *pUnpacked; /* Used to unpack keys */ 71599 }; 71641 }; 71600 71642 71601 /* 71643 /* 71602 ** The following type is an iterator for a PMA. It caches the current key in 71644 ** The following type is an iterator for a PMA. It caches the current key in 71603 ** variables nKey/aKey. If the iterator is at EOF, pFile==0. 71645 ** variables nKey/aKey. If the iterator is at EOF, pFile==0. 71604 */ 71646 */ 71605 struct VdbeSorterIter { 71647 struct VdbeSorterIter { 71606 i64 iReadOff; /* Current read offset */ 71648 i64 iReadOff; /* Current read offset */ 71607 i64 iEof; /* 1 byte past EOF for this iterator */ 71649 i64 iEof; /* 1 byte past EOF for this iterator */ 71608 sqlite3_file *pFile; /* File iterator is reading from */ < 71609 int nAlloc; /* Bytes of space at aAlloc */ 71650 int nAlloc; /* Bytes of space at aAlloc */ 71610 u8 *aAlloc; /* Allocated space */ < 71611 int nKey; /* Number of bytes in key */ 71651 int nKey; /* Number of bytes in key */ > 71652 sqlite3_file *pFile; /* File iterator is reading from */ > 71653 u8 *aAlloc; /* Allocated space */ 71612 u8 *aKey; /* Pointer to current key */ 71654 u8 *aKey; /* Pointer to current key */ 71613 }; 71655 }; 71614 71656 71615 /* 71657 /* 71616 ** A structure to store a single record. All in-memory records are connected 71658 ** A structure to store a single record. All in-memory records are connected 71617 ** together into a linked list headed at VdbeSorter.pRecord using the 71659 ** together into a linked list headed at VdbeSorter.pRecord using the 71618 ** SorterRecord.pNext pointer. 71660 ** SorterRecord.pNext pointer. ................................................................................................................................................................................ 75091 ExprList *pNew; 75133 ExprList *pNew; 75092 struct ExprList_item *pItem, *pOldItem; 75134 struct ExprList_item *pItem, *pOldItem; 75093 int i; 75135 int i; 75094 if( p==0 ) return 0; 75136 if( p==0 ) return 0; 75095 pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); 75137 pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); 75096 if( pNew==0 ) return 0; 75138 if( pNew==0 ) return 0; 75097 pNew->iECursor = 0; 75139 pNew->iECursor = 0; 75098 pNew->nExpr = pNew->nAlloc = p->nExpr; | 75140 pNew->nExpr = i = p->nExpr; > 75141 if( (flags & EXPRDUP_REDUCE)==0 ) for(i=1; i<p->nExpr; i+=i){} 75099 pNew->a = pItem = sqlite3DbMallocRaw(db, p->nExpr*sizeof(p->a[0]) ); | 75142 pNew->a = pItem = sqlite3DbMallocRaw(db, i*sizeof(p->a[0]) ); 75100 if( pItem==0 ){ 75143 if( pItem==0 ){ 75101 sqlite3DbFree(db, pNew); 75144 sqlite3DbFree(db, pNew); 75102 return 0; 75145 return 0; 75103 } 75146 } 75104 pOldItem = p->a; 75147 pOldItem = p->a; 75105 for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){ 75148 for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){ 75106 Expr *pOldExpr = pOldItem->pExpr; 75149 Expr *pOldExpr = pOldItem->pExpr; ................................................................................................................................................................................ 75160 } 75203 } 75161 SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3 *db, IdList *p){ 75204 SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3 *db, IdList *p){ 75162 IdList *pNew; 75205 IdList *pNew; 75163 int i; 75206 int i; 75164 if( p==0 ) return 0; 75207 if( p==0 ) return 0; 75165 pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); 75208 pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); 75166 if( pNew==0 ) return 0; 75209 if( pNew==0 ) return 0; 75167 pNew->nId = pNew->nAlloc = p->nId; | 75210 pNew->nId = p->nId; 75168 pNew->a = sqlite3DbMallocRaw(db, p->nId*sizeof(p->a[0]) ); 75211 pNew->a = sqlite3DbMallocRaw(db, p->nId*sizeof(p->a[0]) ); 75169 if( pNew->a==0 ){ 75212 if( pNew->a==0 ){ 75170 sqlite3DbFree(db, pNew); 75213 sqlite3DbFree(db, pNew); 75171 return 0; 75214 return 0; 75172 } 75215 } > 75216 /* Note that because the size of the allocation for p->a[] is not > 75217 ** necessarily a power of two, sqlite3IdListAppend() may not be called > 75218 ** on the duplicate created by this function. */ 75173 for(i=0; i<p->nId; i++){ 75219 for(i=0; i<p->nId; i++){ 75174 struct IdList_item *pNewItem = &pNew->a[i]; 75220 struct IdList_item *pNewItem = &pNew->a[i]; 75175 struct IdList_item *pOldItem = &p->a[i]; 75221 struct IdList_item *pOldItem = &p->a[i]; 75176 pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName); 75222 pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName); 75177 pNewItem->idx = pOldItem->idx; 75223 pNewItem->idx = pOldItem->idx; 75178 } 75224 } 75179 return pNew; 75225 return pNew; ................................................................................................................................................................................ 75227 ){ 75273 ){ 75228 sqlite3 *db = pParse->db; 75274 sqlite3 *db = pParse->db; 75229 if( pList==0 ){ 75275 if( pList==0 ){ 75230 pList = sqlite3DbMallocZero(db, sizeof(ExprList) ); 75276 pList = sqlite3DbMallocZero(db, sizeof(ExprList) ); 75231 if( pList==0 ){ 75277 if( pList==0 ){ 75232 goto no_mem; 75278 goto no_mem; 75233 } 75279 } 75234 assert( pList->nAlloc==0 ); | 75280 pList->a = sqlite3DbMallocRaw(db, sizeof(pList->a[0])); 75235 } < > 75281 if( pList->a==0 ) goto no_mem; 75236 if( pList->nAlloc<=pList->nExpr ){ | 75282 }else if( (pList->nExpr & (pList->nExpr-1))==0 ){ 75237 struct ExprList_item *a; 75283 struct ExprList_item *a; 75238 int n = pList->nAlloc*2 + 4; | 75284 assert( pList->nExpr>0 ); 75239 a = sqlite3DbRealloc(db, pList->a, n*sizeof(pList->a[0])); | 75285 a = sqlite3DbRealloc(db, pList->a, pList->nExpr*2*sizeof(pList->a[0])); 75240 if( a==0 ){ 75286 if( a==0 ){ 75241 goto no_mem; 75287 goto no_mem; 75242 } 75288 } 75243 pList->a = a; 75289 pList->a = a; 75244 pList->nAlloc = sqlite3DbMallocSize(db, a)/sizeof(a[0]); < 75245 } 75290 } 75246 assert( pList->a!=0 ); 75291 assert( pList->a!=0 ); 75247 if( 1 ){ 75292 if( 1 ){ 75248 struct ExprList_item *pItem = &pList->a[pList->nExpr++]; 75293 struct ExprList_item *pItem = &pList->a[pList->nExpr++]; 75249 memset(pItem, 0, sizeof(*pItem)); 75294 memset(pItem, 0, sizeof(*pItem)); 75250 pItem->pExpr = pExpr; 75295 pItem->pExpr = pExpr; 75251 } 75296 } ................................................................................................................................................................................ 75328 /* 75373 /* 75329 ** Delete an entire expression list. 75374 ** Delete an entire expression list. 75330 */ 75375 */ 75331 SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){ 75376 SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){ 75332 int i; 75377 int i; 75333 struct ExprList_item *pItem; 75378 struct ExprList_item *pItem; 75334 if( pList==0 ) return; 75379 if( pList==0 ) return; 75335 assert( pList->a!=0 || (pList->nExpr==0 && pList->nAlloc==0) ); | 75380 assert( pList->a!=0 || pList->nExpr==0 ); 75336 assert( pList->nExpr<=pList->nAlloc ); < 75337 for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){ 75381 for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){ 75338 sqlite3ExprDelete(db, pItem->pExpr); 75382 sqlite3ExprDelete(db, pItem->pExpr); 75339 sqlite3DbFree(db, pItem->zName); 75383 sqlite3DbFree(db, pItem->zName); 75340 sqlite3DbFree(db, pItem->zSpan); 75384 sqlite3DbFree(db, pItem->zSpan); 75341 } 75385 } 75342 sqlite3DbFree(db, pList->a); 75386 sqlite3DbFree(db, pList->a); 75343 sqlite3DbFree(db, pList); 75387 sqlite3DbFree(db, pList); ................................................................................................................................................................................ 78010 */ 78054 */ 78011 static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ 78055 static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ 78012 int i; 78056 int i; 78013 pInfo->aCol = sqlite3ArrayAllocate( 78057 pInfo->aCol = sqlite3ArrayAllocate( 78014 db, 78058 db, 78015 pInfo->aCol, 78059 pInfo->aCol, 78016 sizeof(pInfo->aCol[0]), 78060 sizeof(pInfo->aCol[0]), 78017 3, < 78018 &pInfo->nColumn, 78061 &pInfo->nColumn, 78019 &pInfo->nColumnAlloc, < 78020 &i 78062 &i 78021 ); 78063 ); 78022 return i; 78064 return i; 78023 } 78065 } 78024 78066 78025 /* 78067 /* 78026 ** Add a new element to the pAggInfo->aFunc[] array. Return the index of 78068 ** Add a new element to the pAggInfo->aFunc[] array. Return the index of ................................................................................................................................................................................ 78028 */ 78070 */ 78029 static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo){ 78071 static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo){ 78030 int i; 78072 int i; 78031 pInfo->aFunc = sqlite3ArrayAllocate( 78073 pInfo->aFunc = sqlite3ArrayAllocate( 78032 db, 78074 db, 78033 pInfo->aFunc, 78075 pInfo->aFunc, 78034 sizeof(pInfo->aFunc[0]), 78076 sizeof(pInfo->aFunc[0]), 78035 3, < 78036 &pInfo->nFunc, 78077 &pInfo->nFunc, 78037 &pInfo->nFuncAlloc, < 78038 &i 78078 &i 78039 ); 78079 ); 78040 return i; 78080 return i; 78041 } 78081 } 78042 78082 78043 /* 78083 /* 78044 ** This is the xExprCallback for a tree walker. It is used to 78084 ** This is the xExprCallback for a tree walker. It is used to ................................................................................................................................................................................ 78807 #endif 78847 #endif 78808 "tbl_name = %Q, " 78848 "tbl_name = %Q, " 78809 "name = CASE " 78849 "name = CASE " 78810 "WHEN type='table' THEN %Q " 78850 "WHEN type='table' THEN %Q " 78811 "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN " 78851 "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN " 78812 "'sqlite_autoindex_' || %Q || substr(name,%d+18) " 78852 "'sqlite_autoindex_' || %Q || substr(name,%d+18) " 78813 "ELSE name END " 78853 "ELSE name END " 78814 "WHERE tbl_name=%Q AND " | 78854 "WHERE tbl_name=%Q COLLATE nocase AND " 78815 "(type='table' OR type='index' OR type='trigger');", 78855 "(type='table' OR type='index' OR type='trigger');", 78816 zDb, SCHEMA_TABLE(iDb), zName, zName, zName, 78856 zDb, SCHEMA_TABLE(iDb), zName, zName, zName, 78817 #ifndef SQLITE_OMIT_TRIGGER 78857 #ifndef SQLITE_OMIT_TRIGGER 78818 zName, 78858 zName, 78819 #endif 78859 #endif 78820 zName, nTabName, zTabName 78860 zName, nTabName, zTabName 78821 ); 78861 ); ................................................................................................................................................................................ 82676 sqlite3Strlen30(p->zName),p); 82716 sqlite3Strlen30(p->zName),p); 82677 if( pOld ){ 82717 if( pOld ){ 82678 assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ 82718 assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ 82679 db->mallocFailed = 1; 82719 db->mallocFailed = 1; 82680 return; 82720 return; 82681 } 82721 } 82682 pParse->pNewTable = 0; 82722 pParse->pNewTable = 0; 82683 db->nTable++; < 82684 db->flags |= SQLITE_InternChanges; 82723 db->flags |= SQLITE_InternChanges; 82685 82724 82686 #ifndef SQLITE_OMIT_ALTERTABLE 82725 #ifndef SQLITE_OMIT_ALTERTABLE 82687 if( !p->pSelect ){ 82726 if( !p->pSelect ){ 82688 const char *zName = (const char *)pParse->sNameToken.z; 82727 const char *zName = (const char *)pParse->sNameToken.z; 82689 int nName; 82728 int nName; 82690 assert( !pSelect && pCons && pEnd ); 82729 assert( !pSelect && pCons && pEnd ); ................................................................................................................................................................................ 84097 ** might be the same as the pArray parameter or it might be a different 84136 ** might be the same as the pArray parameter or it might be a different 84098 ** pointer if the array was resized. 84137 ** pointer if the array was resized. 84099 */ 84138 */ 84100 SQLITE_PRIVATE void *sqlite3ArrayAllocate( 84139 SQLITE_PRIVATE void *sqlite3ArrayAllocate( 84101 sqlite3 *db, /* Connection to notify of malloc failures */ 84140 sqlite3 *db, /* Connection to notify of malloc failures */ 84102 void *pArray, /* Array of objects. Might be reallocated */ 84141 void *pArray, /* Array of objects. Might be reallocated */ 84103 int szEntry, /* Size of each object in the array */ 84142 int szEntry, /* Size of each object in the array */ 84104 int initSize, /* Suggested initial allocation, in elements */ < 84105 int *pnEntry, /* Number of objects currently in use */ 84143 int *pnEntry, /* Number of objects currently in use */ 84106 int *pnAlloc, /* Current size of the allocation, in elements */ < 84107 int *pIdx /* Write the index of a new slot here */ 84144 int *pIdx /* Write the index of a new slot here */ 84108 ){ 84145 ){ 84109 char *z; 84146 char *z; 84110 if( *pnEntry >= *pnAlloc ){ | 84147 int n = *pnEntry; 84111 void *pNew; | 84148 if( (n & (n-1))==0 ){ 84112 int newSize; | 84149 int sz = (n==0) ? 1 : 2*n; 84113 newSize = (*pnAlloc)*2 + initSize; < 84114 pNew = sqlite3DbRealloc(db, pArray, newSize*szEntry); | 84150 void *pNew = sqlite3DbRealloc(db, pArray, sz*szEntry); 84115 if( pNew==0 ){ 84151 if( pNew==0 ){ 84116 *pIdx = -1; 84152 *pIdx = -1; 84117 return pArray; 84153 return pArray; 84118 } 84154 } 84119 *pnAlloc = sqlite3DbMallocSize(db, pNew)/szEntry; < 84120 pArray = pNew; 84155 pArray = pNew; 84121 } 84156 } 84122 z = (char*)pArray; 84157 z = (char*)pArray; 84123 memset(&z[*pnEntry * szEntry], 0, szEntry); | 84158 memset(&z[n * szEntry], 0, szEntry); 84124 *pIdx = *pnEntry; | 84159 *pIdx = n; 84125 ++*pnEntry; 84160 ++*pnEntry; 84126 return pArray; 84161 return pArray; 84127 } 84162 } 84128 84163 84129 /* 84164 /* 84130 ** Append a new element to the given IdList. Create a new IdList if 84165 ** Append a new element to the given IdList. Create a new IdList if 84131 ** need be. 84166 ** need be. ................................................................................................................................................................................ 84133 ** A new IdList is returned, or NULL if malloc() fails. 84168 ** A new IdList is returned, or NULL if malloc() fails. 84134 */ 84169 */ 84135 SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3 *db, IdList *pList, Token *pT 84170 SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3 *db, IdList *pList, Token *pT 84136 int i; 84171 int i; 84137 if( pList==0 ){ 84172 if( pList==0 ){ 84138 pList = sqlite3DbMallocZero(db, sizeof(IdList) ); 84173 pList = sqlite3DbMallocZero(db, sizeof(IdList) ); 84139 if( pList==0 ) return 0; 84174 if( pList==0 ) return 0; 84140 pList->nAlloc = 0; < 84141 } 84175 } 84142 pList->a = sqlite3ArrayAllocate( 84176 pList->a = sqlite3ArrayAllocate( 84143 db, 84177 db, 84144 pList->a, 84178 pList->a, 84145 sizeof(pList->a[0]), 84179 sizeof(pList->a[0]), 84146 5, < 84147 &pList->nId, 84180 &pList->nId, 84148 &pList->nAlloc, < 84149 &i 84181 &i 84150 ); 84182 ); 84151 if( i<0 ){ 84183 if( i<0 ){ 84152 sqlite3IdListDelete(db, pList); 84184 sqlite3IdListDelete(db, pList); 84153 return 0; 84185 return 0; 84154 } 84186 } 84155 pList->a[i].zName = sqlite3NameFromToken(db, pToken); 84187 pList->a[i].zName = sqlite3NameFromToken(db, pToken); ................................................................................................................................................................................ 86000 86032 86001 /* 86033 /* 86002 ** Return the collating function associated with a function. 86034 ** Return the collating function associated with a function. 86003 */ 86035 */ 86004 static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){ 86036 static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){ 86005 return context->pColl; 86037 return context->pColl; 86006 } 86038 } > 86039 > 86040 /* > 86041 ** Indicate that the accumulator load should be skipped on this > 86042 ** iteration of the aggregate loop. > 86043 */ > 86044 static void sqlite3SkipAccumulatorLoad(sqlite3_context *context){ > 86045 context->skipFlag = 1; > 86046 } 86007 86047 86008 /* 86048 /* 86009 ** Implementation of the non-aggregate min() and max() functions 86049 ** Implementation of the non-aggregate min() and max() functions 86010 */ 86050 */ 86011 static void minmaxFunc( 86051 static void minmaxFunc( 86012 sqlite3_context *context, 86052 sqlite3_context *context, 86013 int argc, 86053 int argc, ................................................................................................................................................................................ 87307 int NotUsed, 87347 int NotUsed, 87308 sqlite3_value **argv 87348 sqlite3_value **argv 87309 ){ 87349 ){ 87310 Mem *pArg = (Mem *)argv[0]; 87350 Mem *pArg = (Mem *)argv[0]; 87311 Mem *pBest; 87351 Mem *pBest; 87312 UNUSED_PARAMETER(NotUsed); 87352 UNUSED_PARAMETER(NotUsed); 87313 87353 87314 if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; < 87315 pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest)); 87354 pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest)); 87316 if( !pBest ) return; 87355 if( !pBest ) return; 87317 87356 > 87357 if( sqlite3_value_type(argv[0])==SQLITE_NULL ){ > 87358 if( pBest->flags ) sqlite3SkipAccumulatorLoad(context); 87318 if( pBest->flags ){ | 87359 }else if( pBest->flags ){ 87319 int max; 87360 int max; 87320 int cmp; 87361 int cmp; 87321 CollSeq *pColl = sqlite3GetFuncCollSeq(context); 87362 CollSeq *pColl = sqlite3GetFuncCollSeq(context); 87322 /* This step function is used for both the min() and max() aggregates, 87363 /* This step function is used for both the min() and max() aggregates, 87323 ** the only difference between the two being that the sense of the 87364 ** the only difference between the two being that the sense of the 87324 ** comparison is inverted. For the max() aggregate, the 87365 ** comparison is inverted. For the max() aggregate, the 87325 ** sqlite3_user_data() function returns (void *)-1. For min() it 87366 ** sqlite3_user_data() function returns (void *)-1. For min() it ................................................................................................................................................................................ 87327 ** Therefore the next statement sets variable 'max' to 1 for the max() 87368 ** Therefore the next statement sets variable 'max' to 1 for the max() 87328 ** aggregate, or 0 for min(). 87369 ** aggregate, or 0 for min(). 87329 */ 87370 */ 87330 max = sqlite3_user_data(context)!=0; 87371 max = sqlite3_user_data(context)!=0; 87331 cmp = sqlite3MemCompare(pBest, pArg, pColl); 87372 cmp = sqlite3MemCompare(pBest, pArg, pColl); 87332 if( (max && cmp<0) || (!max && cmp>0) ){ 87373 if( (max && cmp<0) || (!max && cmp>0) ){ 87333 sqlite3VdbeMemCopy(pBest, pArg); 87374 sqlite3VdbeMemCopy(pBest, pArg); > 87375 }else{ > 87376 sqlite3SkipAccumulatorLoad(context); 87334 } 87377 } 87335 }else{ 87378 }else{ 87336 sqlite3VdbeMemCopy(pBest, pArg); 87379 sqlite3VdbeMemCopy(pBest, pArg); 87337 } 87380 } 87338 } 87381 } 87339 static void minMaxFinalize(sqlite3_context *context){ 87382 static void minMaxFinalize(sqlite3_context *context){ 87340 sqlite3_value *pRes; 87383 sqlite3_value *pRes; 87341 pRes = (sqlite3_value *)sqlite3_aggregate_context(context, 0); 87384 pRes = (sqlite3_value *)sqlite3_aggregate_context(context, 0); 87342 if( pRes ){ 87385 if( pRes ){ 87343 if( ALWAYS(pRes->flags) ){ | 87386 if( pRes->flags ){ 87344 sqlite3_result_value(context, pRes); 87387 sqlite3_result_value(context, pRes); 87345 } 87388 } 87346 sqlite3VdbeMemRelease(pRes); 87389 sqlite3VdbeMemRelease(pRes); 87347 } 87390 } 87348 } 87391 } 87349 87392 87350 /* 87393 /* ................................................................................................................................................................................ 91918 ************************************************************************* 91961 ************************************************************************* 91919 ** This file contains code used to implement the PRAGMA command. 91962 ** This file contains code used to implement the PRAGMA command. 91920 */ 91963 */ 91921 91964 91922 /* 91965 /* 91923 ** Interpret the given string as a safety level. Return 0 for OFF, 91966 ** Interpret the given string as a safety level. Return 0 for OFF, 91924 ** 1 for ON or NORMAL and 2 for FULL. Return 1 for an empty or 91967 ** 1 for ON or NORMAL and 2 for FULL. Return 1 for an empty or 91925 ** unrecognized string argument. | 91968 ** unrecognized string argument. The FULL option is disallowed > 91969 ** if the omitFull parameter it 1. 91926 ** 91970 ** 91927 ** Note that the values returned are one less that the values that 91971 ** Note that the values returned are one less that the values that 91928 ** should be passed into sqlite3BtreeSetSafetyLevel(). The is done 91972 ** should be passed into sqlite3BtreeSetSafetyLevel(). The is done 91929 ** to support legacy SQL code. The safety level used to be boolean 91973 ** to support legacy SQL code. The safety level used to be boolean 91930 ** and older scripts may have used numbers 0 for OFF and 1 for ON. 91974 ** and older scripts may have used numbers 0 for OFF and 1 for ON. 91931 */ 91975 */ 91932 static u8 getSafetyLevel(const char *z){ | 91976 static u8 getSafetyLevel(const char *z, int omitFull, int dflt){ 91933 /* 123456789 123456789 */ 91977 /* 123456789 123456789 */ 91934 static const char zText[] = "onoffalseyestruefull"; 91978 static const char zText[] = "onoffalseyestruefull"; 91935 static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16}; 91979 static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16}; 91936 static const u8 iLength[] = {2, 2, 3, 5, 3, 4, 4}; 91980 static const u8 iLength[] = {2, 2, 3, 5, 3, 4, 4}; 91937 static const u8 iValue[] = {1, 0, 0, 0, 1, 1, 2}; 91981 static const u8 iValue[] = {1, 0, 0, 0, 1, 1, 2}; 91938 int i, n; 91982 int i, n; 91939 if( sqlite3Isdigit(*z) ){ 91983 if( sqlite3Isdigit(*z) ){ 91940 return (u8)sqlite3Atoi(z); 91984 return (u8)sqlite3Atoi(z); 91941 } 91985 } 91942 n = sqlite3Strlen30(z); 91986 n = sqlite3Strlen30(z); 91943 for(i=0; i<ArraySize(iLength); i++){ | 91987 for(i=0; i<ArraySize(iLength)-omitFull; i++){ 91944 if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 ){ 91988 if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 ){ 91945 return iValue[i]; 91989 return iValue[i]; 91946 } 91990 } 91947 } 91991 } 91948 return 1; | 91992 return dflt; 91949 } 91993 } 91950 91994 91951 /* 91995 /* 91952 ** Interpret the given string as a boolean value. 91996 ** Interpret the given string as a boolean value. 91953 */ 91997 */ 91954 SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z){ | 91998 SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z, int dflt){ 91955 return getSafetyLevel(z)&1; | 91999 return getSafetyLevel(z,1,dflt)!=0; 91956 } 92000 } 91957 92001 91958 /* The sqlite3GetBoolean() function is used by other modules but the 92002 /* The sqlite3GetBoolean() function is used by other modules but the 91959 ** remainder of this file is specific to PRAGMA processing. So omit 92003 ** remainder of this file is specific to PRAGMA processing. So omit 91960 ** the rest of the file if PRAGMAs are omitted from the build. 92004 ** the rest of the file if PRAGMAs are omitted from the build. 91961 */ 92005 */ 91962 #if !defined(SQLITE_OMIT_PRAGMA) 92006 #if !defined(SQLITE_OMIT_PRAGMA) ................................................................................................................................................................................ 92091 { "vdbe_trace", SQLITE_VdbeTrace }, 92135 { "vdbe_trace", SQLITE_VdbeTrace }, 92092 #endif 92136 #endif 92093 #ifndef SQLITE_OMIT_CHECK 92137 #ifndef SQLITE_OMIT_CHECK 92094 { "ignore_check_constraints", SQLITE_IgnoreChecks }, 92138 { "ignore_check_constraints", SQLITE_IgnoreChecks }, 92095 #endif 92139 #endif 92096 /* The following is VERY experimental */ 92140 /* The following is VERY experimental */ 92097 { "writable_schema", SQLITE_WriteSchema|SQLITE_RecoveryMode }, 92141 { "writable_schema", SQLITE_WriteSchema|SQLITE_RecoveryMode }, 92098 { "omit_readlock", SQLITE_NoReadlock }, < 92099 92142 92100 /* TODO: Maybe it shouldn't be possible to change the ReadUncommitted 92143 /* TODO: Maybe it shouldn't be possible to change the ReadUncommitted 92101 ** flag if there are any active statements. */ 92144 ** flag if there are any active statements. */ 92102 { "read_uncommitted", SQLITE_ReadUncommitted }, 92145 { "read_uncommitted", SQLITE_ReadUncommitted }, 92103 { "recursive_triggers", SQLITE_RecTriggers }, 92146 { "recursive_triggers", SQLITE_RecTriggers }, 92104 92147 92105 /* This flag may only be set if both foreign-key and trigger support 92148 /* This flag may only be set if both foreign-key and trigger support ................................................................................................................................................................................ 92123 int mask = p->mask; /* Mask of bits to set or clear. */ 92166 int mask = p->mask; /* Mask of bits to set or clear. */ 92124 if( db->autoCommit==0 ){ 92167 if( db->autoCommit==0 ){ 92125 /* Foreign key support may not be enabled or disabled while not 92168 /* Foreign key support may not be enabled or disabled while not 92126 ** in auto-commit mode. */ 92169 ** in auto-commit mode. */ 92127 mask &= ~(SQLITE_ForeignKeys); 92170 mask &= ~(SQLITE_ForeignKeys); 92128 } 92171 } 92129 92172 92130 if( sqlite3GetBoolean(zRight) ){ | 92173 if( sqlite3GetBoolean(zRight, 0) ){ 92131 db->flags |= mask; 92174 db->flags |= mask; 92132 }else{ 92175 }else{ 92133 db->flags &= ~mask; 92176 db->flags &= ~mask; 92134 } 92177 } 92135 92178 92136 /* Many of the flag-pragmas modify the code generated by the SQL 92179 /* Many of the flag-pragmas modify the code generated by the SQL 92137 ** compiler (eg. count_changes). So add an opcode to expire all 92180 ** compiler (eg. count_changes). So add an opcode to expire all ................................................................................................................................................................................ 92339 ** flag setting and reports thenew value. 92382 ** flag setting and reports thenew value. 92340 */ 92383 */ 92341 if( sqlite3StrICmp(zLeft,"secure_delete")==0 ){ 92384 if( sqlite3StrICmp(zLeft,"secure_delete")==0 ){ 92342 Btree *pBt = pDb->pBt; 92385 Btree *pBt = pDb->pBt; 92343 int b = -1; 92386 int b = -1; 92344 assert( pBt!=0 ); 92387 assert( pBt!=0 ); 92345 if( zRight ){ 92388 if( zRight ){ 92346 b = sqlite3GetBoolean(zRight); | 92389 b = sqlite3GetBoolean(zRight, 0); 92347 } 92390 } 92348 if( pId2->n==0 && b>=0 ){ 92391 if( pId2->n==0 && b>=0 ){ 92349 int ii; 92392 int ii; 92350 for(ii=0; ii<db->nDb; ii++){ 92393 for(ii=0; ii<db->nDb; ii++){ 92351 sqlite3BtreeSecureDelete(db->aDb[ii].pBt, b); 92394 sqlite3BtreeSecureDelete(db->aDb[ii].pBt, b); 92352 } 92395 } 92353 } 92396 } ................................................................................................................................................................................ 92744 if( !zRight ){ 92787 if( !zRight ){ 92745 returnSingleInt(pParse, "synchronous", pDb->safety_level-1); 92788 returnSingleInt(pParse, "synchronous", pDb->safety_level-1); 92746 }else{ 92789 }else{ 92747 if( !db->autoCommit ){ 92790 if( !db->autoCommit ){ 92748 sqlite3ErrorMsg(pParse, 92791 sqlite3ErrorMsg(pParse, 92749 "Safety level may not be changed inside a transaction"); 92792 "Safety level may not be changed inside a transaction"); 92750 }else{ 92793 }else{ 92751 pDb->safety_level = getSafetyLevel(zRight)+1; | 92794 pDb->safety_level = getSafetyLevel(zRight,0,1)+1; 92752 } 92795 } 92753 } 92796 } 92754 }else 92797 }else 92755 #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ 92798 #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ 92756 92799 92757 #ifndef SQLITE_OMIT_FLAG_PRAGMAS 92800 #ifndef SQLITE_OMIT_FLAG_PRAGMAS 92758 if( flagPragma(pParse, zLeft, zRight) ){ 92801 if( flagPragma(pParse, zLeft, zRight) ){ ................................................................................................................................................................................ 92943 } 92986 } 92944 }else 92987 }else 92945 #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ 92988 #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ 92946 92989 92947 #ifndef NDEBUG 92990 #ifndef NDEBUG 92948 if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){ 92991 if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){ 92949 if( zRight ){ 92992 if( zRight ){ 92950 if( sqlite3GetBoolean(zRight) ){ | 92993 if( sqlite3GetBoolean(zRight, 0) ){ 92951 sqlite3ParserTrace(stderr, "parser: "); 92994 sqlite3ParserTrace(stderr, "parser: "); 92952 }else{ 92995 }else{ 92953 sqlite3ParserTrace(0, 0); 92996 sqlite3ParserTrace(0, 0); 92954 } 92997 } 92955 } 92998 } 92956 }else 92999 }else 92957 #endif 93000 #endif 92958 93001 92959 /* Reinstall the LIKE and GLOB functions. The variant of LIKE 93002 /* Reinstall the LIKE and GLOB functions. The variant of LIKE 92960 ** used will be case sensitive or not depending on the RHS. 93003 ** used will be case sensitive or not depending on the RHS. 92961 */ 93004 */ 92962 if( sqlite3StrICmp(zLeft, "case_sensitive_like")==0 ){ 93005 if( sqlite3StrICmp(zLeft, "case_sensitive_like")==0 ){ 92963 if( zRight ){ 93006 if( zRight ){ 92964 sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight)); | 93007 sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight, 0)); 92965 } 93008 } 92966 }else 93009 }else 92967 93010 92968 #ifndef SQLITE_INTEGRITY_CHECK_ERROR_MAX 93011 #ifndef SQLITE_INTEGRITY_CHECK_ERROR_MAX 92969 # define SQLITE_INTEGRITY_CHECK_ERROR_MAX 100 93012 # define SQLITE_INTEGRITY_CHECK_ERROR_MAX 100 92970 #endif 93013 #endif 92971 93014 ................................................................................................................................................................................ 94383 pNew = &standin; 94426 pNew = &standin; 94384 memset(pNew, 0, sizeof(*pNew)); 94427 memset(pNew, 0, sizeof(*pNew)); 94385 } 94428 } 94386 if( pEList==0 ){ 94429 if( pEList==0 ){ 94387 pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0)); 94430 pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0)); 94388 } 94431 } 94389 pNew->pEList = pEList; 94432 pNew->pEList = pEList; > 94433 if( pSrc==0 ) pSrc = sqlite3DbMallocZero(db, sizeof(*pSrc)); 94390 pNew->pSrc = pSrc; 94434 pNew->pSrc = pSrc; 94391 pNew->pWhere = pWhere; 94435 pNew->pWhere = pWhere; 94392 pNew->pGroupBy = pGroupBy; 94436 pNew->pGroupBy = pGroupBy; 94393 pNew->pHaving = pHaving; 94437 pNew->pHaving = pHaving; 94394 pNew->pOrderBy = pOrderBy; 94438 pNew->pOrderBy = pOrderBy; 94395 pNew->selFlags = isDistinct ? SF_Distinct : 0; 94439 pNew->selFlags = isDistinct ? SF_Distinct : 0; 94396 pNew->op = TK_SELECT; 94440 pNew->op = TK_SELECT; ................................................................................................................................................................................ 95921 } 95965 } 95922 95966 95923 /* Make sure all SELECTs in the statement have the same number of elements 95967 /* Make sure all SELECTs in the statement have the same number of elements 95924 ** in their result sets. 95968 ** in their result sets. 95925 */ 95969 */ 95926 assert( p->pEList && pPrior->pEList ); 95970 assert( p->pEList && pPrior->pEList ); 95927 if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ 95971 if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ > 95972 if( p->selFlags & SF_Values ){ > 95973 sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); > 95974 }else{ 95928 sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" | 95975 sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" 95929 " do not have the same number of result columns", selectOpName(p->op)); | 95976 " do not have the same number of result columns", selectOpName(p->op)); > 95977 } 95930 rc = 1; 95978 rc = 1; 95931 goto multi_select_end; 95979 goto multi_select_end; 95932 } 95980 } 95933 95981 95934 /* Compound SELECTs that have an ORDER BY clause are handled separately. 95982 /* Compound SELECTs that have an ORDER BY clause are handled separately. 95935 */ 95983 */ 95936 if( p->pOrderBy ){ 95984 if( p->pOrderBy ){ ................................................................................................................................................................................ 96538 } 96586 } 96539 if( j==nOrderBy ){ 96587 if( j==nOrderBy ){ 96540 Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0); 96588 Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0); 96541 if( pNew==0 ) return SQLITE_NOMEM; 96589 if( pNew==0 ) return SQLITE_NOMEM; 96542 pNew->flags |= EP_IntValue; 96590 pNew->flags |= EP_IntValue; 96543 pNew->u.iValue = i; 96591 pNew->u.iValue = i; 96544 pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew); 96592 pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew); 96545 pOrderBy->a[nOrderBy++].iOrderByCol = (u16)i; | 96593 if( pOrderBy ) pOrderBy->a[nOrderBy++].iOrderByCol = (u16)i; 96546 } 96594 } 96547 } 96595 } 96548 } 96596 } 96549 96597 96550 /* Compute the comparison permutation and keyinfo that is used with 96598 /* Compute the comparison permutation and keyinfo that is used with 96551 ** the permutation used to determine if the next 96599 ** the permutation used to determine if the next 96552 ** row of results comes from selectA or selectB. Also add explicit 96600 ** row of results comes from selectA or selectB. Also add explicit ................................................................................................................................................................................ 97901 /* 97949 /* 97902 ** Update the accumulator memory cells for an aggregate based on 97950 ** Update the accumulator memory cells for an aggregate based on 97903 ** the current cursor position. 97951 ** the current cursor position. 97904 */ 97952 */ 97905 static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ 97953 static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ 97906 Vdbe *v = pParse->pVdbe; 97954 Vdbe *v = pParse->pVdbe; 97907 int i; 97955 int i; > 97956 int regHit = 0; > 97957 int addrHitTest = 0; 97908 struct AggInfo_func *pF; 97958 struct AggInfo_func *pF; 97909 struct AggInfo_col *pC; 97959 struct AggInfo_col *pC; 97910 97960 97911 pAggInfo->directMode = 1; 97961 pAggInfo->directMode = 1; 97912 sqlite3ExprCacheClear(pParse); 97962 sqlite3ExprCacheClear(pParse); 97913 for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){ 97963 for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){ 97914 int nArg; 97964 int nArg; ................................................................................................................................................................................ 97936 assert( pList!=0 ); /* pList!=0 if pF->pFunc has NEEDCOLL */ 97986 assert( pList!=0 ); /* pList!=0 if pF->pFunc has NEEDCOLL */ 97937 for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){ 97987 for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){ 97938 pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr); 97988 pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr); 97939 } 97989 } 97940 if( !pColl ){ 97990 if( !pColl ){ 97941 pColl = pParse->db->pDfltColl; 97991 pColl = pParse->db->pDfltColl; 97942 } 97992 } > 97993 if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem; 97943 sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); | 97994 sqlite3VdbeAddOp4(v, OP_CollSeq, regHit, 0, 0, (char *)pColl, P4_COLLSEQ); 97944 } 97995 } 97945 sqlite3VdbeAddOp4(v, OP_AggStep, 0, regAgg, pF->iMem, 97996 sqlite3VdbeAddOp4(v, OP_AggStep, 0, regAgg, pF->iMem, 97946 (void*)pF->pFunc, P4_FUNCDEF); 97997 (void*)pF->pFunc, P4_FUNCDEF); 97947 sqlite3VdbeChangeP5(v, (u8)nArg); 97998 sqlite3VdbeChangeP5(v, (u8)nArg); 97948 sqlite3ExprCacheAffinityChange(pParse, regAgg, nArg); 97999 sqlite3ExprCacheAffinityChange(pParse, regAgg, nArg); 97949 sqlite3ReleaseTempRange(pParse, regAgg, nArg); 98000 sqlite3ReleaseTempRange(pParse, regAgg, nArg); 97950 if( addrNext ){ 98001 if( addrNext ){ ................................................................................................................................................................................ 97959 ** to pC->iMem. But by the time the value is used, the original register 98010 ** to pC->iMem. But by the time the value is used, the original register 97960 ** may have been used, invalidating the underlying buffer holding the 98011 ** may have been used, invalidating the underlying buffer holding the 97961 ** text or blob value. See ticket [883034dcb5]. 98012 ** text or blob value. See ticket [883034dcb5]. 97962 ** 98013 ** 97963 ** Another solution would be to change the OP_SCopy used to copy cached 98014 ** Another solution would be to change the OP_SCopy used to copy cached 97964 ** values to an OP_Copy. 98015 ** values to an OP_Copy. 97965 */ 98016 */ > 98017 if( regHit ){ > 98018 addrHitTest = sqlite3VdbeAddOp1(v, OP_If, regHit); > 98019 } 97966 sqlite3ExprCacheClear(pParse); 98020 sqlite3ExprCacheClear(pParse); 97967 for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){ 98021 for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){ 97968 sqlite3ExprCode(pParse, pC->pExpr, pC->iMem); 98022 sqlite3ExprCode(pParse, pC->pExpr, pC->iMem); 97969 } 98023 } 97970 pAggInfo->directMode = 0; 98024 pAggInfo->directMode = 0; 97971 sqlite3ExprCacheClear(pParse); 98025 sqlite3ExprCacheClear(pParse); > 98026 if( addrHitTest ){ > 98027 sqlite3VdbeJumpHere(v, addrHitTest); > 98028 } 97972 } 98029 } 97973 98030 97974 /* 98031 /* 97975 ** Add a single OP_Explain instruction to the VDBE to explain a simple 98032 ** Add a single OP_Explain instruction to the VDBE to explain a simple 97976 ** count(*) query ("SELECT count(*) FROM pTab"). 98033 ** count(*) query ("SELECT count(*) FROM pTab"). 97977 */ 98034 */ 97978 #ifndef SQLITE_OMIT_EXPLAIN 98035 #ifndef SQLITE_OMIT_EXPLAIN ................................................................................................................................................................................ 98905 } 98962 } 98906 sqlite3ExplainPrintf(pVdbe, "END"); 98963 sqlite3ExplainPrintf(pVdbe, "END"); 98907 sqlite3ExplainPop(pVdbe); 98964 sqlite3ExplainPop(pVdbe); 98908 } 98965 } 98909 98966 98910 /* End of the structure debug printing code 98967 /* End of the structure debug printing code 98911 *****************************************************************************/ 98968 *****************************************************************************/ 98912 #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ | 98969 #endif /* defined(SQLITE_ENABLE_TREE_EXPLAIN) */ 98913 98970 98914 /************** End of select.c **********************************************/ 98971 /************** End of select.c **********************************************/ 98915 /************** Begin file table.c *******************************************/ 98972 /************** Begin file table.c *******************************************/ 98916 /* 98973 /* 98917 ** 2001 September 15 98974 ** 2001 September 15 98918 ** 98975 ** 98919 ** The author disclaims copyright to this source code. In place of 98976 ** The author disclaims copyright to this source code. In place of ................................................................................................................................................................................ 101532 ** statement. The module name has been parsed, but the optional list 101589 ** statement. The module name has been parsed, but the optional list 101533 ** of parameters that follow the module name are still pending. 101590 ** of parameters that follow the module name are still pending. 101534 */ 101591 */ 101535 SQLITE_PRIVATE void sqlite3VtabBeginParse( 101592 SQLITE_PRIVATE void sqlite3VtabBeginParse( 101536 Parse *pParse, /* Parsing context */ 101593 Parse *pParse, /* Parsing context */ 101537 Token *pName1, /* Name of new table, or database name */ 101594 Token *pName1, /* Name of new table, or database name */ 101538 Token *pName2, /* Name of new table or NULL */ 101595 Token *pName2, /* Name of new table or NULL */ 101539 Token *pModuleName /* Name of the module for the virtual table */ | 101596 Token *pModuleName, /* Name of the module for the virtual table */ > 101597 int ifNotExists /* No error if the table already exists */ 101540 ){ 101598 ){ 101541 int iDb; /* The database the table is being created in */ 101599 int iDb; /* The database the table is being created in */ 101542 Table *pTable; /* The new virtual table */ 101600 Table *pTable; /* The new virtual table */ 101543 sqlite3 *db; /* Database connection */ 101601 sqlite3 *db; /* Database connection */ 101544 101602 101545 sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0); | 101603 sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, ifNotExists); 101546 pTable = pParse->pNewTable; 101604 pTable = pParse->pNewTable; 101547 if( pTable==0 ) return; 101605 if( pTable==0 ) return; 101548 assert( 0==pTable->pIndex ); 101606 assert( 0==pTable->pIndex ); 101549 101607 101550 db = pParse->db; 101608 db = pParse->db; 101551 iDb = sqlite3SchemaToIndex(db, pTable->pSchema); 101609 iDb = sqlite3SchemaToIndex(db, pTable->pSchema); 101552 assert( iDb>=0 ); 101610 assert( iDb>=0 ); ................................................................................................................................................................................ 101573 101631 101574 /* 101632 /* 101575 ** This routine takes the module argument that has been accumulating 101633 ** This routine takes the module argument that has been accumulating 101576 ** in pParse->zArg[] and appends it to the list of arguments on the 101634 ** in pParse->zArg[] and appends it to the list of arguments on the 101577 ** virtual table currently under construction in pParse->pTable. 101635 ** virtual table currently under construction in pParse->pTable. 101578 */ 101636 */ 101579 static void addArgumentToVtab(Parse *pParse){ 101637 static void addArgumentToVtab(Parse *pParse){ 101580 if( pParse->sArg.z && ALWAYS(pParse->pNewTable) ){ | 101638 if( pParse->sArg.z && pParse->pNewTable ){ 101581 const char *z = (const char*)pParse->sArg.z; 101639 const char *z = (const char*)pParse->sArg.z; 101582 int n = pParse->sArg.n; 101640 int n = pParse->sArg.n; 101583 sqlite3 *db = pParse->db; 101641 sqlite3 *db = pParse->db; 101584 addModuleArgument(db, pParse->pNewTable, sqlite3DbStrNDup(db, z, n)); 101642 addModuleArgument(db, pParse->pNewTable, sqlite3DbStrNDup(db, z, n)); 101585 } 101643 } 101586 } 101644 } 101587 101645 ................................................................................................................................................................................ 107618 struct TrigEvent { int a; IdList * b; }; 107676 struct TrigEvent { int a; IdList * b; }; 107619 107677 107620 /* 107678 /* 107621 ** An instance of this structure holds the ATTACH key and the key type. 107679 ** An instance of this structure holds the ATTACH key and the key type. 107622 */ 107680 */ 107623 struct AttachKey { int type; Token key; }; 107681 struct AttachKey { int type; Token key; }; 107624 107682 > 107683 /* > 107684 ** One or more VALUES claues > 107685 */ > 107686 struct ValueList { > 107687 ExprList *pList; > 107688 Select *pSelect; > 107689 }; > 107690 107625 107691 107626 /* This is a utility routine used to set the ExprSpan.zStart and 107692 /* This is a utility routine used to set the ExprSpan.zStart and 107627 ** ExprSpan.zEnd values of pOut so that the span covers the complete 107693 ** ExprSpan.zEnd values of pOut so that the span covers the complete 107628 ** range of text beginning with pStart and going to the end of pEnd. 107694 ** range of text beginning with pStart and going to the end of pEnd. 107629 */ 107695 */ 107630 static void spanSet(ExprSpan *pOut, Token *pStart, Token *pEnd){ 107696 static void spanSet(ExprSpan *pOut, Token *pStart, Token *pEnd){ 107631 pOut->zStart = pStart->z; 107697 pOut->zStart = pStart->z; ................................................................................................................................................................................ 107741 ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser 107807 ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser 107742 ** YYNSTATE the combined number of states. 107808 ** YYNSTATE the combined number of states. 107743 ** YYNRULE the number of rules in the grammar 107809 ** YYNRULE the number of rules in the grammar 107744 ** YYERRORSYMBOL is the code number of the error symbol. If not 107810 ** YYERRORSYMBOL is the code number of the error symbol. If not 107745 ** defined, then do no error processing. 107811 ** defined, then do no error processing. 107746 */ 107812 */ 107747 #define YYCODETYPE unsigned char 107813 #define YYCODETYPE unsigned char 107748 #define YYNOCODE 253 | 107814 #define YYNOCODE 251 107749 #define YYACTIONTYPE unsigned short int 107815 #define YYACTIONTYPE unsigned short int 107750 #define YYWILDCARD 67 107816 #define YYWILDCARD 67 107751 #define sqlite3ParserTOKENTYPE Token 107817 #define sqlite3ParserTOKENTYPE Token 107752 typedef union { 107818 typedef union { 107753 int yyinit; 107819 int yyinit; 107754 sqlite3ParserTOKENTYPE yy0; 107820 sqlite3ParserTOKENTYPE yy0; 107755 int yy4; | 107821 struct LimitVal yy64; 107756 struct TrigEvent yy90; | 107822 Expr* yy122; 107757 ExprSpan yy118; | 107823 Select* yy159; 107758 TriggerStep* yy203; | 107824 IdList* yy180; 107759 u8 yy210; < 107760 struct {int value; int mask;} yy215; | 107825 struct {int value; int mask;} yy207; 107761 SrcList* yy259; | 107826 u8 yy258; 107762 struct LimitVal yy292; | 107827 struct LikeOp yy318; > 107828 TriggerStep* yy327; 107763 Expr* yy314; | 107829 ExprSpan yy342; 107764 ExprList* yy322; | 107830 SrcList* yy347; 107765 struct LikeOp yy342; | 107831 int yy392; > 107832 struct TrigEvent yy410; 107766 IdList* yy384; | 107833 ExprList* yy442; 107767 Select* yy387; < > 107834 struct ValueList yy487; 107768 } YYMINORTYPE; 107835 } YYMINORTYPE; 107769 #ifndef YYSTACKDEPTH 107836 #ifndef YYSTACKDEPTH 107770 #define YYSTACKDEPTH 100 107837 #define YYSTACKDEPTH 100 107771 #endif 107838 #endif 107772 #define sqlite3ParserARG_SDECL Parse *pParse; 107839 #define sqlite3ParserARG_SDECL Parse *pParse; 107773 #define sqlite3ParserARG_PDECL ,Parse *pParse 107840 #define sqlite3ParserARG_PDECL ,Parse *pParse 107774 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse 107841 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse 107775 #define sqlite3ParserARG_STORE yypParser->pParse = pParse 107842 #define sqlite3ParserARG_STORE yypParser->pParse = pParse 107776 #define YYNSTATE 630 | 107843 #define YYNSTATE 629 107777 #define YYNRULE 329 | 107844 #define YYNRULE 327 107778 #define YYFALLBACK 1 107845 #define YYFALLBACK 1 107779 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) 107846 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) 107780 #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) 107847 #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) 107781 #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) 107848 #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) 107782 107849 107783 /* The yyzerominor constant is used to initialize instances of 107850 /* The yyzerominor constant is used to initialize instances of 107784 ** YYMINORTYPE objects to zero. */ 107851 ** YYMINORTYPE objects to zero. */ ................................................................................................................................................................................ 107840 ** yy_action. Used to detect hash collisions. 107907 ** yy_action. Used to detect hash collisions. 107841 ** yy_shift_ofst[] For each state, the offset into yy_action for 107908 ** yy_shift_ofst[] For each state, the offset into yy_action for 107842 ** shifting terminals. 107909 ** shifting terminals. 107843 ** yy_reduce_ofst[] For each state, the offset into yy_action for 107910 ** yy_reduce_ofst[] For each state, the offset into yy_action for 107844 ** shifting non-terminals after a reduce. 107911 ** shifting non-terminals after a reduce. 107845 ** yy_default[] Default action for each state. 107912 ** yy_default[] Default action for each state. 107846 */ 107913 */ 107847 #define YY_ACTTAB_COUNT (1557) | 107914 #define YY_ACTTAB_COUNT (1580) 107848 static const YYACTIONTYPE yy_action[] = { | 107915 static const YYACTIONTYPE yy_action[] = { 107849 /* 0 */ 313, 960, 186, 419, 2, 172, 627, 597, 55, 55, | 107916 /* 0 */ 310, 328, 574, 573, 15, 172, 187, 596, 56, 56, 107850 /* 10 */ 55, 55, 48, 53, 53, 53, 53, 52, 52, 51, | 107917 /* 10 */ 56, 56, 49, 54, 54, 54, 54, 53, 53, 52, 107851 /* 20 */ 51, 51, 50, 238, 302, 283, 623, 622, 516, 515, | 107918 /* 20 */ 52, 52, 51, 234, 622, 621, 626, 622, 621, 299, 107852 /* 30 */ 590, 584, 55, 55, 55, 55, 282, 53, 53, 53, | 107919 /* 30 */ 589, 583, 56, 56, 56, 56, 236, 54, 54, 54, 107853 /* 40 */ 53, 52, 52, 51, 51, 51, 50, 238, 6, 56, | 107920 /* 40 */ 54, 53, 53, 52, 52, 52, 51, 234, 351, 57, 107854 /* 50 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, | 107921 /* 50 */ 58, 48, 581, 580, 582, 582, 55, 55, 56, 56, 107855 /* 60 */ 55, 55, 608, 53, 53, 53, 53, 52, 52, 51, | 107922 /* 60 */ 56, 56, 570, 54, 54, 54, 54, 53, 53, 52, 107856 /* 70 */ 51, 51, 50, 238, 313, 597, 409, 330, 579, 579, | 107923 /* 70 */ 52, 52, 51, 234, 310, 596, 326, 607, 233, 232, 107857 /* 80 */ 32, 53, 53, 53, 53, 52, 52, 51, 51, 51, | 107924 /* 80 */ 33, 54, 54, 54, 54, 53, 53, 52, 52, 52, 107858 /* 90 */ 50, 238, 330, 217, 620, 619, 166, 411, 624, 382, | 107925 /* 90 */ 51, 234, 619, 618, 326, 619, 618, 166, 605, 492, 107859 /* 100 */ 379, 378, 7, 491, 590, 584, 200, 199, 198, 58, | 107926 /* 100 */ 381, 378, 377, 235, 589, 583, 554, 495, 1, 59, 107860 /* 110 */ 377, 300, 414, 621, 481, 66, 623, 622, 621, 580, | 107927 /* 110 */ 19, 376, 622, 621, 53, 53, 52, 52, 52, 51, 107861 /* 120 */ 254, 601, 94, 56, 57, 47, 582, 581, 583, 583, | 107928 /* 120 */ 234, 571, 571, 57, 58, 48, 581, 580, 582, 582, 107862 /* 130 */ 54, 54, 55, 55, 55, 55, 671, 53, 53, 53, | 107929 /* 130 */ 55, 55, 56, 56, 56, 56, 215, 54, 54, 54, 107863 /* 140 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 532, | 107930 /* 140 */ 54, 53, 53, 52, 52, 52, 51, 234, 310, 224, 107864 /* 150 */ 226, 506, 507, 133, 177, 139, 284, 385, 279, 384, | 107931 /* 150 */ 50, 47, 147, 177, 139, 281, 384, 276, 383, 169, 107865 /* 160 */ 169, 197, 342, 398, 251, 226, 253, 275, 388, 167, | 107932 /* 160 */ 408, 553, 578, 578, 622, 621, 272, 224, 439, 550, 107866 /* 170 */ 139, 284, 385, 279, 384, 169, 570, 236, 590, 584, | 107933 /* 170 */ 552, 410, 139, 281, 384, 276, 383, 169, 589, 583, 107867 /* 180 */ 672, 240, 275, 157, 620, 619, 554, 437, 51, 51, | 107934 /* 180 */ 619, 618, 280, 620, 272, 195, 413, 309, 440, 441, 107868 /* 190 */ 51, 50, 238, 343, 439, 553, 438, 56, 57, 47, | 107935 /* 190 */ 567, 491, 214, 279, 560, 600, 92, 57, 58, 48, 107869 /* 200 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, | 107936 /* 200 */ 581, 580, 582, 582, 55, 55, 56, 56, 56, 56, 107870 /* 210 */ 465, 53, 53, 53, 53, 52, 52, 51, 51, 51, | 107937 /* 210 */ 559, 54, 54, 54, 54, 53, 53, 52, 52, 52, 107871 /* 220 */ 50, 238, 313, 390, 52, 52, 51, 51, 51, 50, | 107938 /* 220 */ 51, 234, 310, 464, 233, 232, 558, 133, 519, 50, 107872 /* 230 */ 238, 391, 166, 491, 566, 382, 379, 378, 409, 440, | 107939 /* 230 */ 47, 147, 619, 618, 565, 436, 397, 515, 514, 518, 107873 /* 240 */ 579, 579, 252, 440, 607, 66, 377, 513, 621, 49, | 107940 /* 240 */ 410, 387, 438, 389, 437, 622, 621, 442, 570, 433, 107874 /* 250 */ 46, 147, 590, 584, 621, 16, 466, 189, 621, 441, | 107941 /* 250 */ 203, 390, 589, 583, 6, 413, 166, 670, 250, 381, 107875 /* 260 */ 442, 673, 526, 441, 340, 577, 595, 64, 194, 482, | 107942 /* 260 */ 378, 377, 525, 190, 600, 92, 594, 571, 571, 465, 107876 /* 270 */ 434, 56, 57, 47, 582, 581, 583, 583, 54, 54, | 107943 /* 270 */ 376, 57, 58, 48, 581, 580, 582, 582, 55, 55, 107877 /* 280 */ 55, 55, 55, 55, 30, 53, 53, 53, 53, 52, | 107944 /* 280 */ 56, 56, 56, 56, 599, 54, 54, 54, 54, 53, 107878 /* 290 */ 52, 51, 51, 51, 50, 238, 313, 593, 593, 593, | 107945 /* 290 */ 53, 52, 52, 52, 51, 234, 310, 592, 592, 592, 107879 /* 300 */ 387, 578, 606, 493, 259, 351, 258, 411, 1, 623, | 107946 /* 300 */ 490, 182, 247, 548, 249, 397, 273, 410, 7, 439, 107880 /* 310 */ 622, 496, 623, 622, 65, 240, 623, 622, 597, 443, | 107947 /* 310 */ 398, 606, 67, 619, 618, 620, 472, 256, 347, 255, 107881 /* 320 */ 237, 239, 414, 341, 237, 602, 590, 584, 18, 603, | 107948 /* 320 */ 473, 620, 413, 576, 620, 65, 589, 583, 236, 440, 107882 /* 330 */ 166, 601, 87, 382, 379, 378, 67, 623, 622, 38, | 107949 /* 330 */ 336, 600, 92, 68, 364, 192, 481, 622, 621, 547, 107883 /* 340 */ 623, 622, 176, 270, 377, 56, 57, 47, 582, 581, | 107950 /* 340 */ 622, 621, 560, 323, 207, 57, 58, 48, 581, 580, 107884 /* 350 */ 583, 583, 54, 54, 55, 55, 55, 55, 175, 53, | 107951 /* 350 */ 582, 582, 55, 55, 56, 56, 56, 56, 559, 54, 107885 /* 360 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, | 107952 /* 360 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234, 107886 /* 370 */ 313, 396, 233, 411, 531, 565, 317, 620, 619, 44, | 107953 /* 370 */ 310, 410, 397, 146, 558, 531, 401, 348, 599, 166, 107887 /* 380 */ 620, 619, 240, 206, 620, 619, 597, 266, 414, 268, | 107954 /* 380 */ 248, 204, 381, 378, 377, 541, 413, 171, 337, 570, 107888 /* 390 */ 409, 597, 579, 579, 352, 184, 505, 601, 73, 533, | 107955 /* 390 */ 622, 621, 40, 376, 38, 600, 74, 465, 548, 490, 107889 /* 400 */ 590, 584, 466, 548, 190, 620, 619, 576, 620, 619, | 107956 /* 400 */ 589, 583, 532, 350, 579, 619, 618, 297, 619, 618, 107890 /* 410 */ 547, 383, 551, 35, 332, 575, 574, 600, 504, 56, | 107957 /* 410 */ 480, 67, 470, 39, 620, 599, 406, 574, 573, 57, 107891 /* 420 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, | 107958 /* 420 */ 58, 48, 581, 580, 582, 582, 55, 55, 56, 56, 107892 /* 430 */ 55, 55, 567, 53, 53, 53, 53, 52, 52, 51, | 107959 /* 430 */ 56, 56, 577, 54, 54, 54, 54, 53, 53, 52, 107893 /* 440 */ 51, 51, 50, 238, 313, 411, 561, 561, 528, 364, | 107960 /* 440 */ 52, 52, 51, 234, 310, 256, 347, 255, 530, 52, 107894 /* 450 */ 259, 351, 258, 183, 361, 549, 524, 374, 411, 597, | 107961 /* 450 */ 52, 52, 51, 234, 345, 564, 236, 386, 619, 618, 107895 /* 460 */ 414, 240, 560, 560, 409, 604, 579, 579, 328, 601, | 107962 /* 460 */ 957, 185, 418, 2, 408, 410, 578, 578, 198, 197, 107896 /* 470 */ 93, 623, 622, 414, 590, 584, 237, 564, 559, 559, | 107963 /* 470 */ 196, 499, 183, 167, 589, 583, 671, 570, 505, 506, 107897 /* 480 */ 520, 402, 601, 87, 409, 210, 579, 579, 168, 421, | 107964 /* 480 */ 413, 267, 601, 672, 546, 208, 602, 36, 601, 600, 107898 /* 490 */ 950, 519, 950, 56, 57, 47, 582, 581, 583, 583, | 107965 /* 490 */ 91, 468, 602, 57, 58, 48, 581, 580, 582, 582, 107899 /* 500 */ 54, 54, 55, 55, 55, 55, 192, 53, 53, 53, | 107966 /* 500 */ 55, 55, 56, 56, 56, 56, 202, 54, 54, 54, 107900 /* 510 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 600, | 107967 /* 510 */ 54, 53, 53, 52, 52, 52, 51, 234, 310, 599, 107901 /* 520 */ 293, 563, 511, 234, 357, 146, 475, 475, 367, 411, | 107968 /* 520 */ 157, 408, 527, 578, 578, 263, 490, 265, 410, 873, 107902 /* 530 */ 562, 411, 358, 542, 425, 171, 411, 215, 144, 620, | 107969 /* 530 */ 410, 474, 474, 366, 373, 410, 504, 428, 67, 290, 107903 /* 540 */ 619, 544, 318, 353, 414, 203, 414, 275, 590, 584, | 107970 /* 540 */ 599, 620, 352, 413, 408, 413, 578, 578, 589, 583, 107904 /* 550 */ 549, 414, 174, 601, 94, 601, 79, 558, 471, 61, | 107971 /* 550 */ 413, 382, 600, 92, 600, 16, 543, 62, 503, 600, 107905 /* 560 */ 601, 79, 421, 949, 350, 949, 34, 56, 57, 47, | 107972 /* 560 */ 92, 408, 346, 578, 578, 168, 45, 57, 58, 48, 107906 /* 570 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, | 107973 /* 570 */ 581, 580, 582, 582, 55, 55, 56, 56, 56, 56, 107907 /* 580 */ 535, 53, 53, 53, 53, 52, 52, 51, 51, 51, | 107974 /* 580 */ 200, 54, 54, 54, 54, 53, 53, 52, 52, 52, 107908 /* 590 */ 50, 238, 313, 307, 424, 394, 272, 49, 46, 147, | 107975 /* 590 */ 51, 234, 310, 393, 395, 534, 510, 617, 616, 615, 107909 /* 600 */ 349, 322, 4, 411, 491, 312, 321, 425, 568, 492, | 107976 /* 600 */ 318, 314, 172, 66, 596, 410, 338, 596, 324, 571, 107910 /* 610 */ 216, 264, 407, 575, 574, 429, 66, 549, 414, 621, | 107977 /* 610 */ 571, 50, 47, 147, 599, 629, 627, 330, 539, 315, 107911 /* 620 */ 540, 602, 590, 584, 13, 603, 621, 601, 72, 12, | 107978 /* 620 */ 413, 30, 589, 583, 272, 236, 199, 144, 176, 600, 107912 /* 630 */ 618, 617, 616, 202, 210, 621, 546, 469, 422, 319, | 107979 /* 630 */ 73, 420, 947, 620, 947, 420, 946, 351, 946, 175, 107913 /* 640 */ 148, 56, 57, 47, 582, 581, 583, 583, 54, 54, | 107980 /* 640 */ 596, 57, 58, 48, 581, 580, 582, 582, 55, 55, 107914 /* 650 */ 55, 55, 55, 55, 338, 53, 53, 53, 53, 52, | 107981 /* 650 */ 56, 56, 56, 56, 410, 54, 54, 54, 54, 53, 107915 /* 660 */ 52, 51, 51, 51, 50, 238, 313, 600, 600, 411, | 107982 /* 660 */ 53, 52, 52, 52, 51, 234, 310, 261, 410, 413, 107916 /* 670 */ 39, 21, 37, 170, 237, 875, 411, 572, 572, 201, | 107983 /* 670 */ 269, 208, 596, 363, 410, 596, 424, 360, 600, 69, 107917 /* 680 */ 144, 473, 538, 331, 414, 474, 143, 146, 630, 628, | 107984 /* 680 */ 424, 327, 620, 413, 50, 47, 147, 410, 358, 413, 107918 /* 690 */ 334, 414, 353, 601, 68, 168, 590, 584, 132, 365, | 107985 /* 690 */ 575, 553, 600, 94, 483, 509, 589, 583, 600, 97, 107919 /* 700 */ 601, 96, 307, 423, 530, 336, 49, 46, 147, 568, | 107986 /* 700 */ 552, 484, 413, 620, 188, 599, 551, 563, 596, 566, 107920 /* 710 */ 406, 216, 549, 360, 529, 56, 57, 47, 582, 581, | 107987 /* 710 */ 334, 600, 95, 205, 201, 57, 58, 48, 581, 580, 107921 /* 720 */ 583, 583, 54, 54, 55, 55, 55, 55, 411, 53, | 107988 /* 720 */ 582, 582, 55, 55, 56, 56, 56, 56, 352, 54, 107922 /* 730 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, | 107989 /* 730 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234, 107923 /* 740 */ 313, 411, 605, 414, 484, 510, 172, 422, 597, 318, | 107990 /* 740 */ 310, 410, 261, 410, 167, 22, 356, 599, 359, 623, 107924 /* 750 */ 496, 485, 601, 99, 411, 142, 414, 411, 231, 411, | 107991 /* 750 */ 50, 47, 147, 548, 357, 562, 413, 620, 413, 332, 107925 /* 760 */ 540, 411, 359, 629, 2, 601, 97, 426, 308, 414, | 107992 /* 760 */ 523, 270, 410, 167, 620, 600, 104, 600, 103, 603, 107926 /* 770 */ 590, 584, 414, 20, 414, 621, 414, 621, 601, 106, | 107993 /* 770 */ 589, 583, 339, 539, 304, 423, 222, 413, 174, 304, 107927 /* 780 */ 503, 601, 105, 601, 108, 601, 109, 204, 28, 56, | 107994 /* 780 */ 422, 561, 567, 405, 214, 260, 600, 106, 620, 57, 107928 /* 790 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, | 107995 /* 790 */ 58, 48, 581, 580, 582, 582, 55, 55, 56, 56, 107929 /* 800 */ 55, 55, 411, 53, 53, 53, 53, 52, 52, 51, | 107996 /* 800 */ 56, 56, 410, 54, 54, 54, 54, 53, 53, 52, 107930 /* 810 */ 51, 51, 50, 238, 313, 411, 597, 414, 411, 276, | 107997 /* 810 */ 52, 52, 51, 234, 310, 410, 557, 413, 410, 421, 107931 /* 820 */ 214, 600, 411, 366, 213, 381, 601, 134, 274, 500, | 107998 /* 820 */ 273, 35, 512, 146, 421, 12, 600, 107, 213, 144, 107932 /* 830 */ 414, 167, 130, 414, 621, 411, 354, 414, 376, 601, | 107999 /* 830 */ 413, 410, 32, 413, 410, 620, 365, 353, 358, 600, 107933 /* 840 */ 135, 129, 601, 100, 590, 584, 601, 104, 522, 521, | 108000 /* 840 */ 134, 11, 600, 135, 589, 583, 413, 21, 548, 413, 107934 /* 850 */ 414, 621, 224, 273, 600, 167, 327, 282, 600, 601, | 108001 /* 850 */ 316, 148, 620, 620, 170, 600, 98, 223, 600, 102, 107935 /* 860 */ 103, 468, 521, 56, 57, 47, 582, 581, 583, 583, | 108002 /* 860 */ 374, 168, 167, 57, 58, 48, 581, 580, 582, 582, 107936 /* 870 */ 54, 54, 55, 55, 55, 55, 411, 53, 53, 53, | 108003 /* 870 */ 55, 55, 56, 56, 56, 56, 410, 54, 54, 54, 107937 /* 880 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 411, | 108004 /* 880 */ 54, 53, 53, 52, 52, 52, 51, 234, 310, 410, 107938 /* 890 */ 27, 414, 411, 375, 276, 167, 359, 544, 50, 238, | 108005 /* 890 */ 273, 413, 410, 273, 212, 469, 410, 167, 628, 2, 107939 /* 900 */ 601, 95, 128, 223, 414, 411, 165, 414, 411, 621, | 108006 /* 900 */ 600, 101, 545, 221, 413, 620, 130, 413, 620, 410, 107940 /* 910 */ 411, 621, 612, 601, 102, 372, 601, 76, 590, 584, | 108007 /* 910 */ 539, 413, 537, 600, 93, 315, 600, 100, 589, 583, 107941 /* 920 */ 414, 570, 236, 414, 470, 414, 167, 621, 188, 601, | 108008 /* 920 */ 600, 77, 425, 305, 413, 620, 254, 322, 599, 458, 107942 /* 930 */ 98, 225, 601, 138, 601, 137, 232, 56, 45, 47, | 108009 /* 930 */ 320, 171, 543, 600, 96, 521, 520, 57, 58, 48, 107943 /* 940 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, | 108010 /* 940 */ 581, 580, 582, 582, 55, 55, 56, 56, 56, 56, 107944 /* 950 */ 411, 53, 53, 53, 53, 52, 52, 51, 51, 51, | 108011 /* 950 */ 410, 54, 54, 54, 54, 53, 53, 52, 52, 52, 107945 /* 960 */ 50, 238, 313, 276, 276, 414, 411, 276, 544, 459, | 108012 /* 960 */ 51, 234, 310, 410, 273, 413, 410, 457, 358, 35, 107946 /* 970 */ 359, 171, 209, 479, 601, 136, 628, 334, 621, 621, | 108013 /* 970 */ 426, 230, 306, 319, 600, 138, 467, 520, 413, 620, 107947 /* 980 */ 125, 414, 621, 368, 411, 621, 257, 540, 589, 588, | 108014 /* 980 */ 143, 413, 410, 620, 410, 353, 529, 600, 137, 142, 107948 /* 990 */ 601, 75, 590, 584, 458, 446, 23, 23, 124, 414, | 108015 /* 990 */ 600, 136, 589, 583, 604, 261, 528, 413, 229, 413, 107949 /* 1000 */ 326, 325, 621, 427, 324, 309, 600, 288, 601, 92, | 108016 /* 1000 */ 620, 321, 495, 28, 543, 543, 600, 76, 600, 90, 107950 /* 1010 */ 586, 585, 57, 47, 582, 581, 583, 583, 54, 54, | 108017 /* 1010 */ 620, 57, 46, 48, 581, 580, 582, 582, 55, 55, 107951 /* 1020 */ 55, 55, 55, 55, 411, 53, 53, 53, 53, 52, | 108018 /* 1020 */ 56, 56, 56, 56, 410, 54, 54, 54, 54, 53, 107952 /* 1030 */ 52, 51, 51, 51, 50, 238, 313, 587, 411, 414, | 108019 /* 1030 */ 53, 52, 52, 52, 51, 234, 310, 261, 451, 413, 107953 /* 1040 */ 411, 207, 611, 476, 171, 472, 160, 123, 601, 91, | 108020 /* 1040 */ 410, 211, 611, 285, 283, 610, 609, 502, 600, 89, 107954 /* 1050 */ 323, 261, 15, 414, 464, 414, 411, 621, 411, 354, | 108021 /* 1050 */ 380, 217, 620, 128, 140, 413, 220, 620, 410, 409, 107955 /* 1060 */ 222, 411, 601, 74, 601, 90, 590, 584, 159, 264, | 108022 /* 1060 */ 620, 620, 588, 587, 600, 75, 589, 583, 271, 620, 107956 /* 1070 */ 158, 414, 461, 414, 621, 600, 414, 121, 120, 25, | 108023 /* 1070 */ 51, 234, 127, 413, 620, 599, 627, 330, 27, 375, 107957 /* 1080 */ 601, 89, 601, 101, 621, 601, 88, 47, 582, 581, | 108024 /* 1080 */ 449, 279, 600, 88, 585, 584, 58, 48, 581, 580, 107958 /* 1090 */ 583, 583, 54, 54, 55, 55, 55, 55, 544, 53, | 108025 /* 1090 */ 582, 582, 55, 55, 56, 56, 56, 56, 410, 54, 107959 /* 1100 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, | 108026 /* 1100 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234, 107960 /* 1110 */ 43, 405, 263, 3, 610, 264, 140, 415, 622, 24, | 108027 /* 1110 */ 310, 586, 410, 413, 410, 261, 593, 165, 399, 556, 107961 /* 1120 */ 410, 11, 456, 594, 118, 155, 219, 452, 408, 621, | 108028 /* 1120 */ 126, 371, 600, 87, 478, 186, 123, 413, 367, 413, 107962 /* 1130 */ 621, 621, 156, 43, 405, 621, 3, 286, 621, 113, | 108029 /* 1130 */ 620, 620, 410, 620, 620, 410, 600, 99, 600, 86, 107963 /* 1140 */ 415, 622, 111, 445, 411, 400, 557, 403, 545, 10, | 108030 /* 1140 */ 589, 583, 475, 122, 258, 171, 471, 413, 160, 121, 107964 /* 1150 */ 411, 408, 264, 110, 205, 436, 541, 566, 453, 414, | 108031 /* 1150 */ 413, 14, 159, 463, 25, 24, 600, 17, 448, 600, 107965 /* 1160 */ 621, 621, 63, 621, 435, 414, 411, 621, 601, 94, | 108032 /* 1160 */ 85, 48, 581, 580, 582, 582, 55, 55, 56, 56, 107966 /* 1170 */ 403, 621, 411, 337, 601, 86, 150, 40, 41, 534, | 108033 /* 1170 */ 56, 56, 158, 54, 54, 54, 54, 53, 53, 52, 107967 /* 1180 */ 566, 414, 242, 264, 42, 413, 412, 414, 600, 595, | 108034 /* 1180 */ 52, 52, 51, 234, 44, 404, 261, 3, 544, 261, 107968 /* 1190 */ 601, 85, 191, 333, 107, 451, 601, 84, 621, 539, | 108035 /* 1190 */ 540, 414, 621, 460, 119, 118, 538, 275, 10, 349, 107969 /* 1200 */ 40, 41, 420, 230, 411, 149, 316, 42, 413, 412, | 108036 /* 1200 */ 4, 620, 407, 620, 620, 620, 116, 44, 404, 410, 107970 /* 1210 */ 398, 127, 595, 315, 621, 399, 278, 625, 181, 414, | 108037 /* 1210 */ 3, 620, 620, 410, 414, 621, 456, 454, 252, 450, 107971 /* 1220 */ 593, 593, 593, 592, 591, 14, 450, 411, 601, 71, | 108038 /* 1220 */ 508, 402, 111, 109, 413, 407, 155, 444, 413, 447, 107972 /* 1230 */ 240, 621, 43, 405, 264, 3, 615, 180, 264, 415, | 108039 /* 1230 */ 435, 565, 219, 600, 84, 620, 108, 600, 83, 64, 107973 /* 1240 */ 622, 614, 414, 593, 593, 593, 592, 591, 14, 621, | 108040 /* 1240 */ 434, 417, 625, 150, 402, 333, 410, 237, 238, 124, 107974 /* 1250 */ 408, 601, 70, 621, 417, 33, 405, 613, 3, 411, | 108041 /* 1250 */ 274, 41, 42, 533, 565, 206, 189, 261, 43, 412, 107975 /* 1260 */ 264, 411, 415, 622, 418, 626, 178, 509, 8, 403, | 108042 /* 1260 */ 411, 413, 261, 594, 488, 620, 329, 149, 419, 268, 107976 /* 1270 */ 241, 416, 126, 408, 414, 621, 414, 449, 208, 566, | 108043 /* 1270 */ 600, 72, 620, 266, 41, 42, 181, 620, 410, 620, 107977 /* 1280 */ 240, 221, 621, 601, 83, 601, 82, 599, 297, 277, | 108044 /* 1280 */ 105, 43, 412, 411, 620, 624, 594, 614, 620, 599, 107978 /* 1290 */ 296, 30, 403, 31, 395, 264, 295, 397, 489, 40, | 108045 /* 1290 */ 228, 125, 313, 413, 592, 592, 592, 591, 590, 13, 107979 /* 1300 */ 41, 411, 566, 220, 621, 294, 42, 413, 412, 271, | 108046 /* 1300 */ 218, 410, 600, 71, 236, 244, 44, 404, 264, 3, 107980 /* 1310 */ 621, 595, 600, 621, 59, 60, 414, 269, 267, 623, | 108047 /* 1310 */ 312, 613, 340, 414, 621, 180, 413, 592, 592, 592, 107981 /* 1320 */ 622, 36, 40, 41, 621, 601, 81, 598, 235, 42, | 108048 /* 1320 */ 591, 590, 13, 620, 407, 600, 82, 410, 416, 34, 107982 /* 1330 */ 413, 412, 621, 621, 595, 265, 344, 411, 248, 556, | 108049 /* 1330 */ 404, 410, 3, 410, 262, 410, 414, 621, 612, 331, 107983 /* 1340 */ 173, 185, 593, 593, 593, 592, 591, 14, 218, 29, | 108050 /* 1340 */ 178, 415, 413, 402, 8, 236, 413, 407, 413, 620, 107984 /* 1350 */ 621, 543, 414, 305, 304, 303, 179, 301, 411, 566, | 108051 /* 1350 */ 413, 600, 81, 565, 257, 600, 80, 600, 70, 600, 107985 /* 1360 */ 454, 601, 80, 289, 335, 593, 593, 593, 592, 591, | 108052 /* 1360 */ 18, 598, 361, 462, 461, 30, 402, 294, 31, 620, 107986 /* 1370 */ 14, 411, 287, 414, 151, 392, 246, 260, 411, 196, | 108053 /* 1370 */ 293, 354, 251, 41, 42, 410, 565, 620, 620, 620, 107987 /* 1380 */ 195, 523, 601, 69, 411, 245, 414, 526, 537, 285, | 108054 /* 1380 */ 43, 412, 411, 453, 396, 594, 620, 620, 394, 61, 107988 /* 1390 */ 389, 595, 621, 414, 536, 601, 17, 362, 153, 414, | 108055 /* 1390 */ 413, 292, 443, 622, 621, 243, 41, 42, 620, 600, 107989 /* 1400 */ 466, 463, 601, 78, 154, 414, 462, 152, 601, 77, | 108056 /* 1400 */ 79, 597, 291, 43, 412, 411, 60, 620, 594, 240, 107990 /* 1410 */ 355, 255, 621, 455, 601, 9, 621, 386, 444, 517, | 108057 /* 1410 */ 620, 410, 231, 37, 555, 173, 592, 592, 592, 591, 107991 /* 1420 */ 247, 621, 593, 593, 593, 621, 621, 244, 621, 243, | 108058 /* 1420 */ 590, 13, 216, 239, 620, 184, 413, 302, 301, 300, 107992 /* 1430 */ 430, 518, 292, 621, 329, 621, 145, 393, 280, 513, | 108059 /* 1430 */ 179, 298, 388, 565, 452, 600, 78, 286, 620, 592, 107993 /* 1440 */ 291, 131, 621, 514, 621, 621, 311, 621, 259, 346, | 108060 /* 1440 */ 592, 592, 591, 590, 13, 429, 29, 413, 151, 289, 107994 /* 1450 */ 249, 621, 621, 229, 314, 621, 228, 512, 227, 240, | 108061 /* 1450 */ 242, 145, 392, 194, 193, 288, 600, 9, 542, 241, 107995 /* 1460 */ 494, 488, 310, 164, 487, 486, 373, 480, 163, 262, | 108062 /* 1460 */ 620, 525, 391, 284, 620, 594, 620, 620, 522, 536, 107996 /* 1470 */ 369, 371, 162, 26, 212, 478, 477, 161, 141, 363, | 108063 /* 1470 */ 620, 535, 153, 385, 465, 516, 282, 325, 154, 517, 107997 /* 1480 */ 467, 122, 339, 187, 119, 348, 347, 117, 116, 115, | 108064 /* 1480 */ 277, 152, 512, 511, 513, 129, 226, 308, 487, 486, 107998 /* 1490 */ 114, 112, 182, 457, 320, 22, 433, 432, 448, 19, | 108065 /* 1490 */ 485, 164, 372, 493, 307, 227, 592, 592, 592, 225, 107999 /* 1500 */ 609, 431, 428, 62, 193, 596, 573, 298, 555, 552, | 108066 /* 1500 */ 479, 163, 368, 370, 162, 476, 210, 477, 26, 259, 108000 /* 1510 */ 571, 404, 290, 380, 498, 510, 495, 306, 281, 499, | 108067 /* 1510 */ 161, 466, 362, 141, 132, 120, 117, 455, 156, 115, 108001 /* 1520 */ 250, 5, 497, 460, 345, 447, 569, 550, 238, 299, | 108068 /* 1520 */ 344, 343, 256, 342, 245, 114, 113, 446, 311, 112, 108002 /* 1530 */ 527, 525, 508, 961, 502, 501, 961, 401, 961, 211, | 108069 /* 1530 */ 23, 317, 432, 236, 131, 431, 110, 430, 20, 427, 108003 /* 1540 */ 490, 356, 256, 961, 483, 961, 961, 961, 961, 961, | 108070 /* 1540 */ 608, 595, 295, 63, 379, 287, 509, 191, 278, 403, 108004 /* 1550 */ 961, 961, 961, 961, 961, 961, 370, | 108071 /* 1550 */ 572, 569, 497, 498, 496, 494, 335, 459, 445, 303, 108005 }; | 108072 /* 1560 */ 296, 246, 341, 355, 5, 568, 369, 507, 253, 549, 108006 static const YYCODETYPE yy_lookahead[] = { | 108073 /* 1570 */ 526, 209, 400, 501, 500, 524, 234, 958, 489, 482, 108007 /* 0 */ 19, 142, 143, 144, 145, 24, 1, 26, 77, 78, | 108074 }; 108008 /* 10 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, | 108075 static const YYCODETYPE yy_lookahead[] = { 108009 /* 20 */ 89, 90, 91, 92, 15, 98, 26, 27, 7, 8, | 108076 /* 0 */ 19, 169, 170, 171, 22, 24, 24, 26, 77, 78, 108010 /* 30 */ 49, 50, 77, 78, 79, 80, 109, 82, 83, 84, | 108077 /* 10 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 108011 /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 22, 68, | 108078 /* 20 */ 89, 90, 91, 92, 26, 27, 1, 26, 27, 15, 108012 /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, | 108079 /* 30 */ 49, 50, 77, 78, 79, 80, 116, 82, 83, 84, 108013 /* 60 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, | 108080 /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 128, 68, 108014 /* 70 */ 89, 90, 91, 92, 19, 94, 112, 19, 114, 115, | 108081 /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 108015 /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90, | 108082 /* 60 */ 79, 80, 230, 82, 83, 84, 85, 86, 87, 88, 108016 /* 90 */ 91, 92, 19, 22, 94, 95, 96, 150, 150, 99, | 108083 /* 70 */ 89, 90, 91, 92, 19, 94, 19, 23, 86, 87, 108017 /* 100 */ 100, 101, 76, 150, 49, 50, 105, 106, 107, 54, | 108084 /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90, 108018 /* 110 */ 110, 158, 165, 165, 161, 162, 26, 27, 165, 113, | 108085 /* 90 */ 91, 92, 94, 95, 19, 94, 95, 96, 172, 173, 108019 /* 120 */ 16, 174, 175, 68, 69, 70, 71, 72, 73, 74, | 108086 /* 100 */ 99, 100, 101, 197, 49, 50, 177, 181, 22, 54, 108020 /* 130 */ 75, 76, 77, 78, 79, 80, 118, 82, 83, 84, | 108087 /* 110 */ 204, 110, 26, 27, 86, 87, 88, 89, 90, 91, 108021 /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 23, | 108088 /* 120 */ 92, 129, 130, 68, 69, 70, 71, 72, 73, 74, 108022 /* 150 */ 92, 97, 98, 24, 96, 97, 98, 99, 100, 101, | 108089 /* 130 */ 75, 76, 77, 78, 79, 80, 22, 82, 83, 84, 108023 /* 160 */ 102, 25, 97, 216, 60, 92, 62, 109, 221, 25, | 108090 /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 92, 108024 /* 170 */ 97, 98, 99, 100, 101, 102, 86, 87, 49, 50, | 108091 /* 150 */ 221, 222, 223, 96, 97, 98, 99, 100, 101, 102, 108025 /* 180 */ 118, 116, 109, 25, 94, 95, 32, 97, 88, 89, | 108092 /* 160 */ 112, 32, 114, 115, 26, 27, 109, 92, 150, 25, 108026 /* 190 */ 90, 91, 92, 128, 104, 41, 106, 68, 69, 70, | 108093 /* 170 */ 41, 150, 97, 98, 99, 100, 101, 102, 49, 50, 108027 /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, | 108094 /* 180 */ 94, 95, 98, 165, 109, 25, 165, 163, 170, 171, 108028 /* 210 */ 11, 82, 83, 84, 85, 86, 87, 88, 89, 90, | 108095 /* 190 */ 166, 167, 168, 109, 12, 174, 175, 68, 69, 70, 108029 /* 220 */ 91, 92, 19, 19, 86, 87, 88, 89, 90, 91, | 108096 /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 108030 /* 230 */ 92, 27, 96, 150, 66, 99, 100, 101, 112, 150, | 108097 /* 210 */ 28, 82, 83, 84, 85, 86, 87, 88, 89, 90, 108031 /* 240 */ 114, 115, 138, 150, 161, 162, 110, 103, 165, 222, | 108098 /* 220 */ 91, 92, 19, 11, 86, 87, 44, 24, 46, 221, 108032 /* 250 */ 223, 224, 49, 50, 165, 22, 57, 24, 165, 170, | 108099 /* 230 */ 222, 223, 94, 95, 66, 97, 215, 7, 8, 57, 108033 /* 260 */ 171, 118, 94, 170, 171, 23, 98, 25, 185, 186, | 108100 /* 240 */ 150, 220, 104, 19, 106, 26, 27, 229, 230, 241, 108034 /* 270 */ 243, 68, 69, 70, 71, 72, 73, 74, 75, 76, | 108101 /* 250 */ 160, 27, 49, 50, 22, 165, 96, 118, 16, 99, 108035 /* 280 */ 77, 78, 79, 80, 126, 82, 83, 84, 85, 86, | 108102 /* 260 */ 100, 101, 94, 119, 174, 175, 98, 129, 130, 57, 108036 /* 290 */ 87, 88, 89, 90, 91, 92, 19, 129, 130, 131, | 108103 /* 270 */ 110, 68, 69, 70, 71, 72, 73, 74, 75, 76, 108037 /* 300 */ 88, 23, 172, 173, 105, 106, 107, 150, 22, 26, | 108104 /* 280 */ 77, 78, 79, 80, 194, 82, 83, 84, 85, 86, 108038 /* 310 */ 27, 181, 26, 27, 22, 116, 26, 27, 26, 230, | 108105 /* 290 */ 87, 88, 89, 90, 91, 92, 19, 129, 130, 131, 108039 /* 320 */ 231, 197, 165, 230, 231, 113, 49, 50, 204, 117, | 108106 /* 300 */ 150, 23, 60, 25, 62, 215, 150, 150, 76, 150, 108040 /* 330 */ 96, 174, 175, 99, 100, 101, 22, 26, 27, 136, | 108107 /* 310 */ 220, 161, 162, 94, 95, 165, 30, 105, 106, 107, 108041 /* 340 */ 26, 27, 118, 16, 110, 68, 69, 70, 71, 72, | 108108 /* 320 */ 34, 165, 165, 23, 165, 25, 49, 50, 116, 170, 108042 /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 118, 82, | 108109 /* 330 */ 171, 174, 175, 22, 48, 185, 186, 26, 27, 120, 108043 /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, | 108110 /* 340 */ 26, 27, 12, 187, 160, 68, 69, 70, 71, 72, 108044 /* 370 */ 19, 214, 215, 150, 23, 23, 155, 94, 95, 22, | 108111 /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 28, 82, 108045 /* 380 */ 94, 95, 116, 160, 94, 95, 94, 60, 165, 62, | 108112 /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 108046 /* 390 */ 112, 26, 114, 115, 128, 23, 36, 174, 175, 88, | 108113 /* 370 */ 19, 150, 215, 95, 44, 23, 46, 220, 194, 96, 108047 /* 400 */ 49, 50, 57, 120, 22, 94, 95, 23, 94, 95, | 108114 /* 380 */ 138, 160, 99, 100, 101, 23, 165, 25, 229, 230, 108048 /* 410 */ 120, 51, 25, 136, 169, 170, 171, 194, 58, 68, | 108115 /* 390 */ 26, 27, 135, 110, 137, 174, 175, 57, 120, 150, 108049 /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, | 108116 /* 400 */ 49, 50, 88, 219, 113, 94, 95, 158, 94, 95, 108050 /* 430 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, | 108117 /* 410 */ 161, 162, 21, 136, 165, 194, 169, 170, 171, 68, 108051 /* 440 */ 89, 90, 91, 92, 19, 150, 12, 12, 23, 228, | 108118 /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 108052 /* 450 */ 105, 106, 107, 23, 233, 25, 165, 19, 150, 94, | 108119 /* 430 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, 108053 /* 460 */ 165, 116, 28, 28, 112, 174, 114, 115, 108, 174, | 108120 /* 440 */ 89, 90, 91, 92, 19, 105, 106, 107, 23, 88, 108054 /* 470 */ 175, 26, 27, 165, 49, 50, 231, 11, 44, 44, | 108121 /* 450 */ 89, 90, 91, 92, 63, 23, 116, 88, 94, 95, 108055 /* 480 */ 46, 46, 174, 175, 112, 160, 114, 115, 50, 22, | 108122 /* 460 */ 142, 143, 144, 145, 112, 150, 114, 115, 105, 106, 108056 /* 490 */ 23, 57, 25, 68, 69, 70, 71, 72, 73, 74, | 108123 /* 470 */ 107, 23, 23, 25, 49, 50, 118, 230, 97, 98, 108057 /* 500 */ 75, 76, 77, 78, 79, 80, 119, 82, 83, 84, | 108124 /* 480 */ 165, 16, 113, 118, 120, 160, 117, 136, 113, 174, 108058 /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 194, | 108125 /* 490 */ 175, 100, 117, 68, 69, 70, 71, 72, 73, 74, 108059 /* 520 */ 225, 23, 23, 215, 19, 95, 105, 106, 107, 150, | 108126 /* 500 */ 75, 76, 77, 78, 79, 80, 160, 82, 83, 84, 108060 /* 530 */ 23, 150, 27, 23, 67, 25, 150, 206, 207, 94, | 108127 /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 194, 108061 /* 540 */ 95, 166, 104, 218, 165, 22, 165, 109, 49, 50, | 108128 /* 520 */ 25, 112, 23, 114, 115, 60, 150, 62, 150, 138, 108062 /* 550 */ 120, 165, 25, 174, 175, 174, 175, 23, 21, 234, | 108129 /* 530 */ 150, 105, 106, 107, 19, 150, 36, 161, 162, 224, 108063 /* 560 */ 174, 175, 22, 23, 239, 25, 25, 68, 69, 70, | 108130 /* 540 */ 194, 165, 217, 165, 112, 165, 114, 115, 49, 50, 108064 /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, | 108131 /* 550 */ 165, 51, 174, 175, 174, 175, 166, 232, 58, 174, 108065 /* 580 */ 205, 82, 83, 84, 85, 86, 87, 88, 89, 90, | 108132 /* 560 */ 175, 112, 237, 114, 115, 50, 22, 68, 69, 70, 108066 /* 590 */ 91, 92, 19, 22, 23, 216, 23, 222, 223, 224, | 108133 /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 108067 /* 600 */ 63, 220, 35, 150, 150, 163, 220, 67, 166, 167, | 108134 /* 580 */ 160, 82, 83, 84, 85, 86, 87, 88, 89, 90, 108068 /* 610 */ 168, 150, 169, 170, 171, 161, 162, 25, 165, 165, | 108135 /* 590 */ 91, 92, 19, 215, 214, 205, 23, 7, 8, 9, 108069 /* 620 */ 150, 113, 49, 50, 25, 117, 165, 174, 175, 35, | 108136 /* 600 */ 215, 155, 24, 22, 26, 150, 97, 26, 108, 129, 108070 /* 630 */ 7, 8, 9, 160, 160, 165, 120, 100, 67, 247, | 108137 /* 610 */ 130, 221, 222, 223, 194, 0, 1, 2, 150, 104, 108071 /* 640 */ 248, 68, 69, 70, 71, 72, 73, 74, 75, 76, | 108138 /* 620 */ 165, 126, 49, 50, 109, 116, 206, 207, 118, 174, 108072 /* 650 */ 77, 78, 79, 80, 193, 82, 83, 84, 85, 86, | 108139 /* 630 */ 175, 22, 23, 165, 25, 22, 23, 128, 25, 118, 108073 /* 660 */ 87, 88, 89, 90, 91, 92, 19, 194, 194, 150, | 108140 /* 640 */ 26, 68, 69, 70, 71, 72, 73, 74, 75, 76, 108074 /* 670 */ 135, 24, 137, 35, 231, 138, 150, 129, 130, 206, | 108141 /* 650 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, 108075 /* 680 */ 207, 30, 27, 213, 165, 34, 118, 95, 0, 1, | 108142 /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 165, 108076 /* 690 */ 2, 165, 218, 174, 175, 50, 49, 50, 22, 48, | 108143 /* 670 */ 23, 160, 94, 227, 150, 94, 67, 231, 174, 175, 108077 /* 700 */ 174, 175, 22, 23, 23, 244, 222, 223, 224, 166, | 108144 /* 680 */ 67, 213, 165, 165, 221, 222, 223, 150, 150, 165, 108078 /* 710 */ 167, 168, 120, 239, 23, 68, 69, 70, 71, 72, | 108145 /* 690 */ 23, 32, 174, 175, 181, 182, 49, 50, 174, 175, 108079 /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, | 108146 /* 700 */ 41, 188, 165, 165, 22, 194, 177, 11, 94, 23, 108080 /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, | 108147 /* 710 */ 193, 174, 175, 160, 22, 68, 69, 70, 71, 72, 108081 /* 740 */ 19, 150, 173, 165, 181, 182, 24, 67, 26, 104, | 108148 /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 217, 82, 108082 /* 750 */ 181, 188, 174, 175, 150, 39, 165, 150, 52, 150, | 108149 /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 108083 /* 760 */ 150, 150, 150, 144, 145, 174, 175, 249, 250, 165, | 108150 /* 740 */ 19, 150, 150, 150, 25, 24, 19, 194, 237, 150, 108084 /* 770 */ 49, 50, 165, 52, 165, 165, 165, 165, 174, 175, | 108151 /* 750 */ 221, 222, 223, 25, 27, 23, 165, 165, 165, 242, 108085 /* 780 */ 29, 174, 175, 174, 175, 174, 175, 160, 22, 68, | 108152 /* 760 */ 165, 23, 150, 25, 165, 174, 175, 174, 175, 174, 108086 /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, | 108153 /* 770 */ 49, 50, 219, 150, 22, 23, 238, 165, 25, 22, 108087 /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88, | 108154 /* 780 */ 23, 23, 166, 167, 168, 193, 174, 175, 165, 68, 108088 /* 810 */ 89, 90, 91, 92, 19, 150, 94, 165, 150, 150, | 108155 /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 108089 /* 820 */ 160, 194, 150, 213, 160, 52, 174, 175, 23, 23, | 108156 /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88, 108090 /* 830 */ 165, 25, 22, 165, 165, 150, 150, 165, 52, 174, | 108157 /* 810 */ 89, 90, 91, 92, 19, 150, 23, 165, 150, 67, 108091 /* 840 */ 175, 22, 174, 175, 49, 50, 174, 175, 190, 191, | 108158 /* 820 */ 150, 25, 103, 95, 67, 35, 174, 175, 206, 207, 108092 /* 850 */ 165, 165, 240, 23, 194, 25, 187, 109, 194, 174, | 108159 /* 830 */ 165, 150, 25, 165, 150, 165, 213, 150, 150, 174, 108093 /* 860 */ 175, 190, 191, 68, 69, 70, 71, 72, 73, 74, | 108160 /* 840 */ 175, 35, 174, 175, 49, 50, 165, 52, 120, 165, 108094 /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84, | 108161 /* 850 */ 245, 246, 165, 165, 35, 174, 175, 187, 174, 175, 108095 /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, | 108162 /* 860 */ 23, 50, 25, 68, 69, 70, 71, 72, 73, 74, 108096 /* 890 */ 22, 165, 150, 23, 150, 25, 150, 166, 91, 92, | 108163 /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84, 108097 /* 900 */ 174, 175, 22, 217, 165, 150, 102, 165, 150, 165, | 108164 /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, 108098 /* 910 */ 150, 165, 150, 174, 175, 19, 174, 175, 49, 50, | 108165 /* 890 */ 150, 165, 150, 150, 160, 23, 150, 25, 144, 145, 108099 /* 920 */ 165, 86, 87, 165, 23, 165, 25, 165, 24, 174, | 108166 /* 900 */ 174, 175, 120, 216, 165, 165, 22, 165, 165, 150, 108100 /* 930 */ 175, 187, 174, 175, 174, 175, 205, 68, 69, 70, | 108167 /* 910 */ 150, 165, 27, 174, 175, 104, 174, 175, 49, 50, 108101 /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, | 108168 /* 920 */ 174, 175, 247, 248, 165, 165, 238, 187, 194, 23, 108102 /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90, | 108169 /* 930 */ 187, 25, 166, 174, 175, 190, 191, 68, 69, 70, 108103 /* 960 */ 91, 92, 19, 150, 150, 165, 150, 150, 166, 23, | 108170 /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 108104 /* 970 */ 150, 25, 160, 20, 174, 175, 1, 2, 165, 165, | 108171 /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90, 108105 /* 980 */ 104, 165, 165, 43, 150, 165, 240, 150, 49, 50, | 108172 /* 960 */ 91, 92, 19, 150, 150, 165, 150, 23, 150, 25, 108106 /* 990 */ 174, 175, 49, 50, 23, 23, 25, 25, 53, 165, | 108173 /* 970 */ 23, 205, 25, 213, 174, 175, 190, 191, 165, 165, 108107 /* 1000 */ 187, 187, 165, 23, 187, 25, 194, 205, 174, 175, | 108174 /* 980 */ 118, 165, 150, 165, 150, 150, 23, 174, 175, 39, 108108 /* 1010 */ 71, 72, 69, 70, 71, 72, 73, 74, 75, 76, | 108175 /* 990 */ 174, 175, 49, 50, 173, 150, 23, 165, 52, 165, 108109 /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, | 108176 /* 1000 */ 165, 187, 181, 22, 166, 166, 174, 175, 174, 175, 108110 /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 98, 150, 165, | 108177 /* 1010 */ 165, 68, 69, 70, 71, 72, 73, 74, 75, 76, 108111 /* 1040 */ 150, 160, 150, 59, 25, 53, 104, 22, 174, 175, | 108178 /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, 108112 /* 1050 */ 213, 138, 5, 165, 1, 165, 150, 165, 150, 150, | 108179 /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 150, 193, 165, 108113 /* 1060 */ 240, 150, 174, 175, 174, 175, 49, 50, 118, 150, | 108180 /* 1040 */ 150, 160, 150, 205, 205, 150, 150, 29, 174, 175, 108114 /* 1070 */ 35, 165, 27, 165, 165, 194, 165, 108, 127, 76, | 108181 /* 1050 */ 52, 216, 165, 22, 150, 165, 238, 165, 150, 150, 108115 /* 1080 */ 174, 175, 174, 175, 165, 174, 175, 70, 71, 72, | 108182 /* 1060 */ 165, 165, 49, 50, 174, 175, 49, 50, 23, 165, 108116 /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 166, 82, | 108183 /* 1070 */ 91, 92, 22, 165, 165, 194, 1, 2, 22, 52, 108117 /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, | 108184 /* 1080 */ 193, 109, 174, 175, 71, 72, 69, 70, 71, 72, 108118 /* 1110 */ 19, 20, 193, 22, 150, 150, 150, 26, 27, 76, | 108185 /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, 108119 /* 1120 */ 150, 22, 1, 150, 119, 121, 217, 20, 37, 165, | 108186 /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 108120 /* 1130 */ 165, 165, 16, 19, 20, 165, 22, 205, 165, 119, | 108187 /* 1110 */ 19, 98, 150, 165, 150, 150, 150, 102, 150, 150, 108121 /* 1140 */ 26, 27, 108, 128, 150, 150, 150, 56, 150, 22, | 108188 /* 1120 */ 22, 19, 174, 175, 20, 24, 104, 165, 43, 165, 108122 /* 1150 */ 150, 37, 150, 127, 160, 23, 150, 66, 193, 165, | 108189 /* 1130 */ 165, 165, 150, 165, 165, 150, 174, 175, 174, 175, 108123 /* 1160 */ 165, 165, 16, 165, 23, 165, 150, 165, 174, 175, | 108190 /* 1140 */ 49, 50, 59, 53, 138, 25, 53, 165, 104, 22, 108124 /* 1170 */ 56, 165, 150, 65, 174, 175, 15, 86, 87, 88, | 108191 /* 1150 */ 165, 5, 118, 1, 76, 76, 174, 175, 193, 174, 108125 /* 1180 */ 66, 165, 140, 150, 93, 94, 95, 165, 194, 98, | 108192 /* 1160 */ 175, 70, 71, 72, 73, 74, 75, 76, 77, 78, 108126 /* 1190 */ 174, 175, 22, 3, 164, 193, 174, 175, 165, 150, | 108193 /* 1170 */ 79, 80, 35, 82, 83, 84, 85, 86, 87, 88, 108127 /* 1200 */ 86, 87, 4, 180, 150, 248, 251, 93, 94, 95, | 108194 /* 1180 */ 89, 90, 91, 92, 19, 20, 150, 22, 150, 150, 108128 /* 1210 */ 216, 180, 98, 251, 165, 221, 150, 149, 6, 165, | 108195 /* 1190 */ 150, 26, 27, 27, 108, 127, 150, 150, 22, 25, 108129 /* 1220 */ 129, 130, 131, 132, 133, 134, 193, 150, 174, 175, | 108196 /* 1200 */ 22, 165, 37, 165, 165, 165, 119, 19, 20, 150, 108130 /* 1230 */ 116, 165, 19, 20, 150, 22, 149, 151, 150, 26, | 108197 /* 1210 */ 22, 165, 165, 150, 26, 27, 23, 1, 16, 20, 108131 /* 1240 */ 27, 149, 165, 129, 130, 131, 132, 133, 134, 165, | 108198 /* 1220 */ 150, 56, 119, 108, 165, 37, 121, 128, 165, 193, 108132 /* 1250 */ 37, 174, 175, 165, 149, 19, 20, 13, 22, 150, | 108199 /* 1230 */ 23, 66, 193, 174, 175, 165, 127, 174, 175, 16, 108133 /* 1260 */ 150, 150, 26, 27, 146, 147, 151, 150, 25, 56, | 108200 /* 1240 */ 23, 146, 147, 15, 56, 65, 150, 152, 140, 154, 108134 /* 1270 */ 152, 159, 154, 37, 165, 165, 165, 193, 160, 66, | 108201 /* 1250 */ 150, 86, 87, 88, 66, 160, 22, 150, 93, 94, 108135 /* 1280 */ 116, 193, 165, 174, 175, 174, 175, 194, 199, 150, | 108202 /* 1260 */ 95, 165, 150, 98, 150, 165, 3, 246, 4, 150, 108136 /* 1290 */ 200, 126, 56, 124, 123, 150, 201, 122, 150, 86, | 108203 /* 1270 */ 174, 175, 165, 150, 86, 87, 6, 165, 150, 165, 108137 /* 1300 */ 87, 150, 66, 193, 165, 202, 93, 94, 95, 150, | 108204 /* 1280 */ 164, 93, 94, 95, 165, 149, 98, 149, 165, 194, 108138 /* 1310 */ 165, 98, 194, 165, 125, 22, 165, 150, 150, 26, | 108205 /* 1290 */ 180, 180, 249, 165, 129, 130, 131, 132, 133, 134, 108139 /* 1320 */ 27, 135, 86, 87, 165, 174, 175, 203, 226, 93, | 108206 /* 1300 */ 193, 150, 174, 175, 116, 193, 19, 20, 150, 22, 108140 /* 1330 */ 94, 95, 165, 165, 98, 150, 218, 150, 193, 157, | 108207 /* 1310 */ 249, 149, 217, 26, 27, 151, 165, 129, 130, 131, 108141 /* 1340 */ 118, 157, 129, 130, 131, 132, 133, 134, 5, 104, | 108208 /* 1320 */ 132, 133, 134, 165, 37, 174, 175, 150, 149, 19, 108142 /* 1350 */ 165, 211, 165, 10, 11, 12, 13, 14, 150, 66, | 108209 /* 1330 */ 20, 150, 22, 150, 150, 150, 26, 27, 13, 244, 108143 /* 1360 */ 17, 174, 175, 210, 246, 129, 130, 131, 132, 133, | 108210 /* 1340 */ 151, 159, 165, 56, 25, 116, 165, 37, 165, 165, 108144 /* 1370 */ 134, 150, 210, 165, 31, 121, 33, 150, 150, 86, | 108211 /* 1350 */ 165, 174, 175, 66, 150, 174, 175, 174, 175, 174, 108145 /* 1380 */ 87, 176, 174, 175, 150, 42, 165, 94, 211, 210, | 108212 /* 1360 */ 175, 194, 150, 150, 150, 126, 56, 199, 124, 165, 108146 /* 1390 */ 150, 98, 165, 165, 211, 174, 175, 150, 55, 165, | 108213 /* 1370 */ 200, 150, 150, 86, 87, 150, 66, 165, 165, 165, 108147 /* 1400 */ 57, 150, 174, 175, 61, 165, 150, 64, 174, 175, | 108214 /* 1380 */ 93, 94, 95, 150, 122, 98, 165, 165, 123, 22, 108148 /* 1410 */ 150, 150, 165, 150, 174, 175, 165, 104, 150, 184, | 108215 /* 1390 */ 165, 201, 150, 26, 27, 150, 86, 87, 165, 174, 108149 /* 1420 */ 150, 165, 129, 130, 131, 165, 165, 150, 165, 150, | 108216 /* 1400 */ 175, 203, 202, 93, 94, 95, 125, 165, 98, 150, 108150 /* 1430 */ 150, 176, 150, 165, 47, 165, 150, 150, 176, 103, | 108217 /* 1410 */ 165, 150, 225, 135, 157, 118, 129, 130, 131, 132, 108151 /* 1440 */ 150, 22, 165, 178, 165, 165, 179, 165, 105, 106, | 108218 /* 1420 */ 133, 134, 5, 150, 165, 157, 165, 10, 11, 12, 108152 /* 1450 */ 107, 165, 165, 229, 111, 165, 92, 176, 229, 116, | 108219 /* 1430 */ 13, 14, 150, 66, 17, 174, 175, 210, 165, 129, 108153 /* 1460 */ 184, 176, 179, 156, 176, 176, 18, 157, 156, 237, | 108220 /* 1440 */ 130, 131, 132, 133, 134, 150, 104, 165, 31, 150, 108154 /* 1470 */ 45, 157, 156, 135, 157, 157, 238, 156, 68, 157, | 108221 /* 1450 */ 33, 150, 150, 86, 87, 150, 174, 175, 211, 42, 108155 /* 1480 */ 189, 189, 139, 219, 22, 157, 18, 192, 192, 192, | 108222 /* 1460 */ 165, 94, 121, 210, 165, 98, 165, 165, 176, 211, 108156 /* 1490 */ 192, 189, 219, 199, 157, 242, 40, 157, 199, 242, | 108223 /* 1470 */ 165, 211, 55, 104, 57, 184, 210, 47, 61, 176, 108157 /* 1500 */ 153, 157, 38, 245, 196, 166, 232, 198, 177, 177, | 108224 /* 1480 */ 176, 64, 103, 176, 178, 22, 92, 179, 176, 176, 108158 /* 1510 */ 232, 227, 209, 178, 166, 182, 166, 148, 177, 177, | 108225 /* 1490 */ 176, 156, 18, 184, 179, 228, 129, 130, 131, 228, 108159 /* 1520 */ 209, 196, 177, 199, 209, 199, 166, 208, 92, 195, | 108226 /* 1500 */ 157, 156, 45, 157, 156, 236, 157, 157, 135, 235, 108160 /* 1530 */ 174, 174, 183, 252, 183, 183, 252, 191, 252, 235, | 108227 /* 1510 */ 156, 189, 157, 68, 218, 189, 22, 199, 156, 192, 108161 /* 1540 */ 186, 241, 241, 252, 186, 252, 252, 252, 252, 252, | 108228 /* 1520 */ 157, 18, 105, 106, 107, 192, 192, 199, 111, 192, 108162 /* 1550 */ 252, 252, 252, 252, 252, 252, 236, | 108229 /* 1530 */ 240, 157, 40, 116, 218, 157, 189, 157, 240, 38, 108163 }; | 108230 /* 1540 */ 153, 166, 198, 243, 178, 209, 182, 196, 177, 226, 108164 #define YY_SHIFT_USE_DFLT (-74) | 108231 /* 1550 */ 230, 230, 166, 177, 177, 166, 139, 199, 199, 148, 108165 #define YY_SHIFT_COUNT (418) | 108232 /* 1560 */ 195, 209, 209, 239, 196, 166, 234, 183, 239, 208, 108166 #define YY_SHIFT_MIN (-73) | 108233 /* 1570 */ 174, 233, 191, 183, 183, 174, 92, 250, 186, 186, 108167 #define YY_SHIFT_MAX (1468) | 108234 }; 108168 static const short yy_shift_ofst[] = { | 108235 #define YY_SHIFT_USE_DFLT (-81) 108169 /* 0 */ 975, 1114, 1343, 1114, 1213, 1213, 90, 90, 0, -19, | 108236 #define YY_SHIFT_COUNT (417) 108170 /* 10 */ 1213, 1213, 1213, 1213, 1213, 345, 445, 721, 1091, 1213, | 108237 #define YY_SHIFT_MIN (-80) 108171 /* 20 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, | 108238 #define YY_SHIFT_MAX (1503) 108172 /* 30 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, | 108239 static const short yy_shift_ofst[] = { 108173 /* 40 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1236, 1213, 1213, | 108240 /* 0 */ 1075, 1188, 1417, 1188, 1287, 1287, 138, 138, 1, -19, 108174 /* 50 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, | 108241 /* 10 */ 1287, 1287, 1287, 1287, 340, -2, 129, 129, 795, 1165, 108175 /* 60 */ 1213, 199, 445, 445, 835, 835, 365, 1164, 55, 647, | 108242 /* 20 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 108176 /* 70 */ 573, 499, 425, 351, 277, 203, 129, 795, 795, 795, | 108243 /* 30 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 108177 /* 80 */ 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, | 108244 /* 40 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1310, 1287, 108178 /* 90 */ 795, 795, 795, 795, 795, 869, 795, 943, 1017, 1017, | 108245 /* 50 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 108179 /* 100 */ -69, -45, -45, -45, -45, -45, -1, 58, 138, 100, | 108246 /* 60 */ 1287, 1287, 212, -2, -2, -8, -8, 614, 1229, 55, 108180 /* 110 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, | 108247 /* 70 */ 721, 647, 573, 499, 425, 351, 277, 203, 869, 869, 108181 /* 120 */ 445, 445, 445, 445, 445, 445, 537, 438, 445, 445, | 108248 /* 80 */ 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, 108182 /* 130 */ 445, 445, 445, 365, 807, 1436, -74, -74, -74, 1293, | 108249 /* 90 */ 869, 869, 869, 943, 869, 1017, 1091, 1091, -69, -45, 108183 /* 140 */ 73, 434, 434, 311, 314, 290, 283, 286, 540, 467, | 108250 /* 100 */ -45, -45, -45, -45, -1, 57, 28, 361, -2, -2, 108184 /* 150 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, | 108251 /* 110 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 108185 /* 160 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, | 108252 /* 120 */ -2, -2, -2, -2, 391, 515, -2, -2, -2, -2, 108186 /* 170 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, | 108253 /* 130 */ -2, 509, -80, 614, 979, 1484, -81, -81, -81, 1367, 108187 /* 180 */ 445, 445, 65, 722, 722, 722, 688, 266, 1164, 1164, | 108254 /* 140 */ 75, 182, 182, 314, 311, 364, 219, 86, 613, 609, 108188 /* 190 */ 1164, -74, -74, -74, 136, 168, 168, 234, 360, 360, | 108255 /* 150 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 108189 /* 200 */ 360, 430, 372, 435, 352, 278, 126, -36, -36, -36, | 108256 /* 160 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 108190 /* 210 */ -36, 421, 651, -36, -36, 592, 292, 212, 623, 158, | 108257 /* 170 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 108191 /* 220 */ 204, 204, 505, 158, 505, 144, 365, 154, 365, 154, | 108258 /* 180 */ -2, -2, 578, 578, 578, 615, 1229, 1229, 1229, -81, 108192 /* 230 */ 645, 154, 204, 154, 154, 535, 548, 548, 365, 387, | 108259 /* 190 */ -81, -81, 160, 168, 168, 283, 500, 500, 500, 278, 108193 /* 240 */ 508, 233, 1464, 1222, 1222, 1456, 1456, 1222, 1462, 1410, | 108260 /* 200 */ 449, 330, 432, 409, 352, 48, 48, 48, 48, 426, 108194 /* 250 */ 1165, 1468, 1468, 1468, 1468, 1222, 1165, 1462, 1410, 1410, | 108261 /* 210 */ 286, 48, 48, 728, 581, 369, 590, 495, 224, 224, 108195 /* 260 */ 1222, 1448, 1338, 1425, 1222, 1222, 1448, 1222, 1448, 1222, | 108262 /* 220 */ 727, 495, 727, 719, 614, 659, 614, 659, 811, 659, 108196 /* 270 */ 1448, 1419, 1313, 1313, 1313, 1387, 1364, 1364, 1419, 1313, | 108263 /* 230 */ 224, 257, 480, 480, 614, 144, 375, -18, 1501, 1297, 108197 /* 280 */ 1336, 1313, 1387, 1313, 1313, 1254, 1245, 1254, 1245, 1254, | 108264 /* 240 */ 1297, 1492, 1492, 1297, 1494, 1445, 1239, 1503, 1503, 1503, 108198 /* 290 */ 1245, 1222, 1222, 1186, 1189, 1175, 1169, 1171, 1165, 1164, | 108265 /* 250 */ 1503, 1297, 1474, 1239, 1494, 1445, 1445, 1297, 1474, 1373, 108199 /* 300 */ 1243, 1244, 1244, 1212, 1212, 1212, 1212, -74, -74, -74, | 108266 /* 260 */ 1457, 1297, 1297, 1474, 1297, 1474, 1297, 1474, 1463, 1369, 108200 /* 310 */ -74, -74, -74, 939, 104, 680, 571, 327, 1, 980, | 108267 /* 270 */ 1369, 1369, 1430, 1394, 1394, 1463, 1369, 1379, 1369, 1430, 108201 /* 320 */ 26, 972, 971, 946, 901, 870, 830, 806, 54, 21, | 108268 /* 280 */ 1369, 1369, 1341, 1342, 1341, 1342, 1341, 1342, 1297, 1297, 108202 /* 330 */ -73, 510, 242, 1198, 1190, 1170, 1042, 1161, 1108, 1146, | 108269 /* 290 */ 1278, 1281, 1262, 1244, 1265, 1239, 1229, 1319, 1325, 1325, 108203 /* 340 */ 1141, 1132, 1015, 1127, 1026, 1034, 1020, 1107, 1004, 1116, | 108270 /* 300 */ 1270, 1270, 1270, 1270, -81, -81, -81, -81, -81, -81, 108204 /* 350 */ 1121, 1005, 1099, 951, 1043, 1003, 969, 1045, 1035, 950, | 108271 /* 310 */ 1013, 242, 757, 752, 465, 363, 947, 232, 944, 906, 108205 /* 360 */ 1053, 1047, 1025, 942, 913, 992, 1019, 945, 984, 940, | 108272 /* 320 */ 872, 837, 738, 448, 381, 230, 84, 362, 300, 1264, 108206 /* 370 */ 876, 904, 953, 896, 748, 804, 880, 786, 868, 819, | 108273 /* 330 */ 1263, 1234, 1108, 1228, 1180, 1223, 1217, 1207, 1099, 1174, 108207 /* 380 */ 805, 810, 773, 751, 766, 706, 716, 691, 681, 568, | 108274 /* 340 */ 1109, 1115, 1103, 1199, 1105, 1202, 1216, 1087, 1193, 1178, 108208 /* 390 */ 655, 638, 676, 516, 541, 594, 599, 567, 541, 534, | 108275 /* 350 */ 1174, 1176, 1068, 1079, 1078, 1086, 1166, 1137, 1034, 1152, 108209 /* 400 */ 507, 527, 498, 523, 466, 382, 409, 384, 357, 6, | 108276 /* 360 */ 1146, 1127, 1044, 1006, 1093, 1120, 1090, 1083, 1085, 1022, 108210 /* 410 */ 240, 224, 143, 62, 18, 71, 39, 9, 5, | 108277 /* 370 */ 1101, 1104, 1102, 972, 1015, 1098, 1027, 1056, 1050, 1045, 108211 }; | 108278 /* 380 */ 1031, 998, 1018, 981, 946, 950, 973, 963, 862, 885, 108212 #define YY_REDUCE_USE_DFLT (-142) | 108279 /* 390 */ 819, 884, 782, 796, 806, 807, 790, 796, 793, 758, 108213 #define YY_REDUCE_COUNT (312) | 108280 /* 400 */ 753, 732, 692, 696, 682, 686, 667, 544, 291, 521, 108214 #define YY_REDUCE_MIN (-141) | 108281 /* 410 */ 510, 365, 358, 139, 114, 54, 14, 25, 108215 #define YY_REDUCE_MAX (1369) | 108282 }; 108216 static const short yy_reduce_ofst[] = { | 108283 #define YY_REDUCE_USE_DFLT (-169) 108217 /* 0 */ -141, 994, 1118, 223, 157, -53, 93, 89, 83, 375, | 108284 #define YY_REDUCE_COUNT (309) 108218 /* 10 */ 386, 381, 379, 308, 295, 325, -47, 27, 1240, 1234, | 108285 #define YY_REDUCE_MIN (-168) 108219 /* 20 */ 1228, 1221, 1208, 1187, 1151, 1111, 1109, 1077, 1054, 1022, | 108286 #define YY_REDUCE_MAX (1411) 108220 /* 30 */ 1016, 1000, 911, 908, 906, 890, 888, 874, 834, 816, | 108287 static const short yy_reduce_ofst[] = { 108221 /* 40 */ 800, 760, 758, 755, 742, 739, 726, 685, 672, 668, | 108288 /* 0 */ 318, 90, 1095, 221, 157, 21, 159, 18, 150, 390, 108222 /* 50 */ 665, 652, 611, 609, 607, 604, 591, 578, 526, 519, | 108289 /* 10 */ 385, 378, 380, 315, 325, 249, 529, -71, 8, 1282, 108223 /* 60 */ 453, 474, 454, 461, 443, 245, 442, 473, 484, 484, | 108290 /* 20 */ 1261, 1225, 1185, 1183, 1181, 1177, 1151, 1128, 1096, 1063, 108224 /* 70 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, | 108291 /* 30 */ 1059, 985, 982, 964, 962, 948, 908, 890, 874, 834, 108225 /* 80 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, | 108292 /* 40 */ 832, 816, 813, 800, 759, 746, 742, 739, 726, 684, 108226 /* 90 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, | 108293 /* 50 */ 681, 668, 665, 652, 612, 593, 591, 537, 524, 518, 108227 /* 100 */ 484, 484, 484, 484, 484, 484, 484, 130, 484, 484, | 108294 /* 60 */ 504, 455, 511, 376, 517, 247, -168, 24, 420, 463, 108228 /* 110 */ 1145, 909, 1110, 1088, 1084, 1033, 1002, 965, 820, 837, | 108295 /* 70 */ 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, 108229 /* 120 */ 746, 686, 612, 817, 610, 919, 221, 563, 814, 813, | 108296 /* 80 */ 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, 108230 /* 130 */ 744, 669, 470, 543, 484, 484, 484, 484, 484, 291, | 108297 /* 90 */ 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, 108231 /* 140 */ 569, 671, 658, 970, 1290, 1287, 1286, 1282, 518, 518, | 108298 /* 100 */ 463, 463, 463, 463, 463, -74, 463, 463, 1112, 835, 108232 /* 150 */ 1280, 1279, 1277, 1270, 1268, 1263, 1261, 1260, 1256, 1251, | 108299 /* 110 */ 1107, 1039, 1036, 965, 887, 845, 818, 760, 688, 687, 108233 /* 160 */ 1247, 1227, 1185, 1168, 1167, 1159, 1148, 1139, 1117, 1066, | 108300 /* 120 */ 538, 743, 623, 592, 446, 513, 814, 740, 670, 156, 108234 /* 170 */ 1049, 1006, 998, 996, 995, 973, 970, 966, 964, 892, | 108301 /* 130 */ 468, 553, 184, 616, 463, 463, 463, 463, 463, 595, 108235 /* 180 */ 762, -52, 881, 932, 802, 731, 619, 812, 664, 660, | 108302 /* 140 */ 821, 786, 745, 909, 1305, 1302, 1301, 1299, 675, 675, 108236 /* 190 */ 627, 392, 331, 124, 1358, 1357, 1356, 1354, 1352, 1351, | 108303 /* 150 */ 1295, 1273, 1259, 1245, 1242, 1233, 1222, 1221, 1214, 1213, 108237 /* 200 */ 1349, 1319, 1334, 1346, 1334, 1334, 1334, 1334, 1334, 1334, | 108304 /* 160 */ 1212, 1204, 1184, 1158, 1123, 1119, 1114, 1100, 1070, 1047, 108238 /* 210 */ 1334, 1320, 1304, 1334, 1334, 1319, 1360, 1325, 1369, 1326, | 108305 /* 170 */ 1046, 1040, 1038, 969, 968, 966, 909, 904, 896, 895, 108239 /* 220 */ 1315, 1311, 1301, 1324, 1300, 1335, 1350, 1345, 1348, 1342, | 108306 /* 180 */ 892, 599, 839, 838, 766, 754, 881, 734, 346, 605, 108240 /* 230 */ 1333, 1341, 1303, 1332, 1331, 1284, 1278, 1274, 1339, 1309, | 108307 /* 190 */ 622, -94, 1393, 1401, 1396, 1392, 1391, 1390, 1384, 1361, 108241 /* 240 */ 1308, 1347, 1258, 1344, 1340, 1257, 1253, 1337, 1273, 1302, | 108308 /* 200 */ 1365, 1381, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1332, 108242 /* 250 */ 1299, 1298, 1297, 1296, 1295, 1328, 1294, 1264, 1292, 1291, | 108309 /* 210 */ 1338, 1365, 1365, 1361, 1399, 1368, 1411, 1359, 1353, 1352, 108243 /* 260 */ 1322, 1321, 1238, 1232, 1318, 1317, 1316, 1314, 1312, 1310, | 108310 /* 220 */ 1329, 1358, 1324, 1366, 1389, 1377, 1386, 1376, 1364, 1371, 108244 /* 270 */ 1307, 1283, 1289, 1288, 1285, 1276, 1229, 1224, 1267, 1281, | 108311 /* 230 */ 1336, 1323, 1321, 1320, 1375, 1344, 1351, 1387, 1300, 1380, 108245 /* 280 */ 1265, 1262, 1235, 1255, 1205, 1183, 1179, 1177, 1162, 1140, | 108312 /* 240 */ 1378, 1298, 1290, 1374, 1316, 1347, 1328, 1337, 1334, 1333, 108246 /* 290 */ 1153, 1184, 1182, 1102, 1124, 1103, 1095, 1090, 1089, 1093, | 108313 /* 250 */ 1327, 1363, 1362, 1318, 1296, 1326, 1322, 1355, 1354, 1269, 108247 /* 300 */ 1112, 1115, 1086, 1105, 1092, 1087, 1068, 962, 955, 957, | 108314 /* 260 */ 1274, 1350, 1349, 1348, 1346, 1345, 1343, 1335, 1315, 1314, 108248 /* 310 */ 1031, 1023, 1030, | 108315 /* 270 */ 1313, 1312, 1309, 1271, 1267, 1308, 1307, 1306, 1304, 1291, 108249 }; | 108316 /* 280 */ 1303, 1292, 1260, 1266, 1258, 1253, 1247, 1227, 1268, 1257, 108250 static const YYACTIONTYPE yy_default[] = { | 108317 /* 290 */ 1187, 1198, 1200, 1190, 1170, 1168, 1167, 1182, 1189, 1164, 108251 /* 0 */ 635, 870, 959, 959, 959, 870, 899, 899, 959, 759, | 108318 /* 300 */ 1179, 1162, 1138, 1136, 1061, 1043, 1021, 1111, 1110, 1116, 108252 /* 10 */ 959, 959, 959, 959, 868, 959, 959, 933, 959, 959, | 108319 }; 108253 /* 20 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108320 static const YYACTIONTYPE yy_default[] = { 108254 /* 30 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108321 /* 0 */ 634, 868, 956, 956, 868, 868, 956, 956, 956, 758, 108255 /* 40 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108322 /* 10 */ 956, 956, 956, 866, 956, 956, 786, 786, 930, 956, 108256 /* 50 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108323 /* 20 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108257 /* 60 */ 959, 959, 959, 959, 899, 899, 674, 763, 794, 959, | 108324 /* 30 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108258 /* 70 */ 959, 959, 959, 959, 959, 959, 959, 932, 934, 809, | 108325 /* 40 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108259 /* 80 */ 808, 802, 801, 912, 774, 799, 792, 785, 796, 871, | 108326 /* 50 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108260 /* 90 */ 864, 865, 863, 867, 872, 959, 795, 831, 848, 830, | 108327 /* 60 */ 956, 956, 956, 956, 956, 956, 956, 673, 762, 792, 108261 /* 100 */ 842, 847, 854, 846, 843, 833, 832, 666, 834, 835, | 108328 /* 70 */ 956, 956, 956, 956, 956, 956, 956, 956, 929, 931, 108262 /* 110 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108329 /* 80 */ 800, 799, 909, 773, 797, 790, 794, 869, 862, 863, 108263 /* 120 */ 959, 959, 959, 959, 959, 959, 661, 728, 959, 959, | 108330 /* 90 */ 861, 865, 870, 956, 793, 829, 846, 828, 840, 845, 108264 /* 130 */ 959, 959, 959, 959, 836, 837, 851, 850, 849, 959, | 108331 /* 100 */ 852, 844, 841, 831, 830, 665, 832, 833, 956, 956, 108265 /* 140 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108332 /* 110 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108266 /* 150 */ 959, 939, 937, 959, 883, 959, 959, 959, 959, 959, | 108333 /* 120 */ 956, 956, 956, 956, 660, 727, 956, 956, 956, 956, 108267 /* 160 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108334 /* 130 */ 956, 956, 956, 956, 834, 835, 849, 848, 847, 956, 108268 /* 170 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108335 /* 140 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108269 /* 180 */ 959, 641, 959, 759, 759, 759, 635, 959, 959, 959, | 108336 /* 150 */ 956, 936, 934, 956, 881, 956, 956, 956, 956, 956, 108270 /* 190 */ 959, 951, 763, 753, 719, 959, 959, 959, 959, 959, | 108337 /* 160 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108271 /* 200 */ 959, 959, 959, 959, 959, 959, 959, 804, 742, 922, | 108338 /* 170 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108272 /* 210 */ 924, 959, 905, 740, 663, 761, 676, 751, 643, 798, | 108339 /* 180 */ 956, 640, 758, 758, 758, 634, 956, 956, 956, 948, 108273 /* 220 */ 776, 776, 917, 798, 917, 700, 959, 788, 959, 788, | 108340 /* 190 */ 762, 752, 718, 956, 956, 956, 956, 956, 956, 956, 108274 /* 230 */ 697, 788, 776, 788, 788, 866, 959, 959, 959, 760, | 108341 /* 200 */ 956, 956, 956, 956, 956, 802, 741, 919, 921, 956, 108275 /* 240 */ 751, 959, 944, 767, 767, 936, 936, 767, 810, 732, | 108342 /* 210 */ 902, 739, 662, 760, 675, 750, 642, 796, 775, 775, 108276 /* 250 */ 798, 739, 739, 739, 739, 767, 798, 810, 732, 732, | 108343 /* 220 */ 914, 796, 914, 699, 956, 786, 956, 786, 696, 786, 108277 /* 260 */ 767, 658, 911, 909, 767, 767, 658, 767, 658, 767, | 108344 /* 230 */ 775, 864, 956, 956, 956, 759, 750, 956, 941, 766, 108278 /* 270 */ 658, 876, 730, 730, 730, 715, 880, 880, 876, 730, | 108345 /* 240 */ 766, 933, 933, 766, 808, 731, 796, 738, 738, 738, 108279 /* 280 */ 700, 730, 715, 730, 730, 780, 775, 780, 775, 780, | 108346 /* 250 */ 738, 766, 657, 796, 808, 731, 731, 766, 657, 908, 108280 /* 290 */ 775, 767, 767, 959, 793, 781, 791, 789, 798, 959, | 108347 /* 260 */ 906, 766, 766, 657, 766, 657, 766, 657, 874, 729, 108281 /* 300 */ 718, 651, 651, 640, 640, 640, 640, 956, 956, 951, | 108348 /* 270 */ 729, 729, 714, 878, 878, 874, 729, 699, 729, 714, 108282 /* 310 */ 702, 702, 684, 959, 959, 959, 959, 959, 959, 959, | 108349 /* 280 */ 729, 729, 779, 774, 779, 774, 779, 774, 766, 766, 108283 /* 320 */ 885, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108350 /* 290 */ 956, 791, 780, 789, 787, 796, 956, 717, 650, 650, 108284 /* 330 */ 959, 959, 959, 959, 636, 946, 959, 959, 943, 959, | 108351 /* 300 */ 639, 639, 639, 639, 953, 953, 948, 701, 701, 683, 108285 /* 340 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108352 /* 310 */ 956, 956, 956, 956, 956, 956, 956, 883, 956, 956, 108286 /* 350 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 915, | 108353 /* 320 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108287 /* 360 */ 959, 959, 959, 959, 959, 959, 908, 907, 959, 959, | 108354 /* 330 */ 635, 943, 956, 956, 940, 956, 956, 956, 956, 801, 108288 /* 370 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108355 /* 340 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108289 /* 380 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, | 108356 /* 350 */ 918, 956, 956, 956, 956, 956, 956, 956, 912, 956, 108290 /* 390 */ 959, 959, 959, 959, 790, 959, 782, 959, 869, 959, | 108357 /* 360 */ 956, 956, 956, 956, 956, 905, 904, 956, 956, 956, 108291 /* 400 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 745, | 108358 /* 370 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108292 /* 410 */ 819, 959, 818, 822, 817, 668, 959, 649, 959, 632, | 108359 /* 380 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 108293 /* 420 */ 637, 955, 958, 957, 954, 953, 952, 947, 945, 942, | 108360 /* 390 */ 956, 956, 956, 788, 956, 781, 956, 867, 956, 956, 108294 /* 430 */ 941, 940, 938, 935, 931, 889, 887, 894, 893, 892, | 108361 /* 400 */ 956, 956, 956, 956, 956, 956, 956, 956, 744, 817, 108295 /* 440 */ 891, 890, 888, 886, 884, 805, 803, 800, 797, 930, | 108362 /* 410 */ 956, 816, 820, 815, 667, 956, 648, 956, 631, 636, 108296 /* 450 */ 882, 741, 738, 737, 657, 948, 914, 923, 921, 811, | 108363 /* 420 */ 952, 955, 954, 951, 950, 949, 944, 942, 939, 938, 108297 /* 460 */ 920, 919, 918, 916, 913, 900, 807, 806, 733, 874, | 108364 /* 430 */ 937, 935, 932, 928, 887, 885, 892, 891, 890, 889, 108298 /* 470 */ 873, 660, 904, 903, 902, 906, 910, 901, 769, 659, | 108365 /* 440 */ 888, 886, 884, 882, 803, 798, 795, 927, 880, 740, 108299 /* 480 */ 656, 665, 722, 721, 729, 727, 726, 725, 724, 723, | 108366 /* 450 */ 737, 736, 656, 945, 911, 920, 807, 806, 809, 917, 108300 /* 490 */ 720, 667, 675, 686, 714, 699, 698, 879, 881, 878, | 108367 /* 460 */ 916, 915, 913, 910, 897, 805, 804, 732, 872, 871, 108301 /* 500 */ 877, 707, 706, 712, 711, 710, 709, 708, 705, 704, | 108368 /* 470 */ 659, 901, 900, 899, 903, 907, 898, 768, 658, 655, 108302 /* 510 */ 703, 696, 695, 701, 694, 717, 716, 713, 693, 736, | 108369 /* 480 */ 664, 721, 720, 728, 726, 725, 724, 723, 722, 719, 108303 /* 520 */ 735, 734, 731, 692, 691, 690, 822, 689, 688, 828, | 108370 /* 490 */ 666, 674, 685, 713, 698, 697, 877, 879, 876, 875, 108304 /* 530 */ 827, 815, 858, 756, 755, 754, 766, 765, 778, 777, | 108371 /* 500 */ 706, 705, 711, 710, 709, 708, 707, 704, 703, 702, 108305 /* 540 */ 813, 812, 779, 764, 758, 757, 773, 772, 771, 770, | 108372 /* 510 */ 695, 694, 700, 693, 716, 715, 712, 692, 735, 734, 108306 /* 550 */ 762, 752, 784, 787, 786, 783, 860, 768, 857, 929, | 108373 /* 520 */ 733, 730, 691, 690, 689, 820, 688, 687, 826, 825, 108307 /* 560 */ 928, 927, 926, 925, 862, 861, 829, 826, 679, 680, | 108374 /* 530 */ 813, 856, 755, 754, 753, 765, 764, 777, 776, 811, 108308 /* 570 */ 898, 896, 897, 895, 682, 681, 678, 677, 859, 747, | 108375 /* 540 */ 810, 778, 763, 757, 756, 772, 771, 770, 769, 761, 108309 /* 580 */ 746, 855, 852, 844, 840, 856, 853, 845, 841, 839, | 108376 /* 550 */ 751, 783, 785, 784, 782, 858, 767, 855, 926, 925, 108310 /* 590 */ 838, 824, 823, 821, 820, 816, 825, 670, 748, 744, | 108377 /* 560 */ 924, 923, 922, 860, 859, 827, 824, 678, 679, 895, 108311 /* 600 */ 743, 814, 750, 749, 687, 685, 683, 664, 662, 655, | 108378 /* 570 */ 894, 896, 893, 681, 680, 677, 676, 857, 746, 745, 108312 /* 610 */ 653, 652, 654, 650, 648, 647, 646, 645, 644, 673, | 108379 /* 580 */ 853, 850, 842, 838, 854, 851, 843, 839, 837, 836, 108313 /* 620 */ 672, 671, 669, 668, 642, 639, 638, 634, 633, 631, | 108380 /* 590 */ 822, 821, 819, 818, 814, 823, 669, 747, 743, 742, > 108381 /* 600 */ 812, 749, 748, 686, 684, 682, 663, 661, 654, 652, > 108382 /* 610 */ 651, 653, 649, 647, 646, 645, 644, 643, 672, 671, > 108383 /* 620 */ 670, 668, 667, 641, 638, 637, 633, 632, 630, 108314 }; 108384 }; 108315 108385 108316 /* The next table maps tokens into fallback tokens. If a construct 108386 /* The next table maps tokens into fallback tokens. If a construct 108317 ** like the following: 108387 ** like the following: 108318 ** 108388 ** 108319 ** %fallback ID X Y Z. 108389 ** %fallback ID X Y Z. 108320 ** 108390 ** ................................................................................................................................................................................ 108519 "init_deferred_pred_opt", "conslist", "tcons", "idxlist", 108589 "init_deferred_pred_opt", "conslist", "tcons", "idxlist", 108520 "defer_subclause_opt", "orconf", "resolvetype", "raisetype", 108590 "defer_subclause_opt", "orconf", "resolvetype", "raisetype", 108521 "ifexists", "fullname", "oneselect", "multiselect_op", 108591 "ifexists", "fullname", "oneselect", "multiselect_op", 108522 "distinct", "selcollist", "from", "where_opt", 108592 "distinct", "selcollist", "from", "where_opt", 108523 "groupby_opt", "having_opt", "orderby_opt", "limit_opt", 108593 "groupby_opt", "having_opt", "orderby_opt", "limit_opt", 108524 "sclp", "as", "seltablist", "stl_prefix", 108594 "sclp", "as", "seltablist", "stl_prefix", 108525 "joinop", "indexed_opt", "on_opt", "using_opt", 108595 "joinop", "indexed_opt", "on_opt", "using_opt", 108526 "joinop2", "inscollist", "sortlist", "sortitem", | 108596 "joinop2", "inscollist", "sortlist", "nexprlist", 108527 "nexprlist", "setlist", "insert_cmd", "inscollist_opt", | 108597 "setlist", "insert_cmd", "inscollist_opt", "valuelist", 108528 "itemlist", "exprlist", "likeop", "between_op", | 108598 "exprlist", "likeop", "between_op", "in_op", 108529 "in_op", "case_operand", "case_exprlist", "case_else", | 108599 "case_operand", "case_exprlist", "case_else", "uniqueflag", 108530 "uniqueflag", "collate", "nmnum", "plus_opt", | 108600 "collate", "nmnum", "number", "trigger_decl", 108531 "number", "trigger_decl", "trigger_cmd_list", "trigger_time", | 108601 "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", 108532 "trigger_event", "foreach_clause", "when_clause", "trigger_cmd", | 108602 "when_clause", "trigger_cmd", "trnm", "tridxby", 108533 "trnm", "tridxby", "database_kw_opt", "key_opt", | 108603 "database_kw_opt", "key_opt", "add_column_fullname", "kwcolumn_opt", 108534 "add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist", | 108604 "create_vtab", "vtabarglist", "vtabarg", "vtabargtoken", 108535 "vtabarg", "vtabargtoken", "lp", "anylist", | 108605 "lp", "anylist", 108536 }; 108606 }; 108537 #endif /* NDEBUG */ 108607 #endif /* NDEBUG */ 108538 108608 108539 #ifndef NDEBUG 108609 #ifndef NDEBUG 108540 /* For tracing reduce actions, the names of all rules are required. 108610 /* For tracing reduce actions, the names of all rules are required. 108541 */ 108611 */ 108542 static const char *const yyRuleName[] = { 108612 static const char *const yyRuleName[] = { ................................................................................................................................................................................ 108689 /* 146 */ "indexed_opt ::=", 108759 /* 146 */ "indexed_opt ::=", 108690 /* 147 */ "indexed_opt ::= INDEXED BY nm", 108760 /* 147 */ "indexed_opt ::= INDEXED BY nm", 108691 /* 148 */ "indexed_opt ::= NOT INDEXED", 108761 /* 148 */ "indexed_opt ::= NOT INDEXED", 108692 /* 149 */ "using_opt ::= USING LP inscollist RP", 108762 /* 149 */ "using_opt ::= USING LP inscollist RP", 108693 /* 150 */ "using_opt ::=", 108763 /* 150 */ "using_opt ::=", 108694 /* 151 */ "orderby_opt ::=", 108764 /* 151 */ "orderby_opt ::=", 108695 /* 152 */ "orderby_opt ::= ORDER BY sortlist", 108765 /* 152 */ "orderby_opt ::= ORDER BY sortlist", 108696 /* 153 */ "sortlist ::= sortlist COMMA sortitem sortorder", | 108766 /* 153 */ "sortlist ::= sortlist COMMA expr sortorder", 108697 /* 154 */ "sortlist ::= sortitem sortorder", | 108767 /* 154 */ "sortlist ::= expr sortorder", 108698 /* 155 */ "sortitem ::= expr", < 108699 /* 156 */ "sortorder ::= ASC", | 108768 /* 155 */ "sortorder ::= ASC", 108700 /* 157 */ "sortorder ::= DESC", | 108769 /* 156 */ "sortorder ::= DESC", 108701 /* 158 */ "sortorder ::=", | 108770 /* 157 */ "sortorder ::=", 108702 /* 159 */ "groupby_opt ::=", | 108771 /* 158 */ "groupby_opt ::=", 108703 /* 160 */ "groupby_opt ::= GROUP BY nexprlist", | 108772 /* 159 */ "groupby_opt ::= GROUP BY nexprlist", 108704 /* 161 */ "having_opt ::=", | 108773 /* 160 */ "having_opt ::=", 108705 /* 162 */ "having_opt ::= HAVING expr", | 108774 /* 161 */ "having_opt ::= HAVING expr", 108706 /* 163 */ "limit_opt ::=", | 108775 /* 162 */ "limit_opt ::=", 108707 /* 164 */ "limit_opt ::= LIMIT expr", | 108776 /* 163 */ "limit_opt ::= LIMIT expr", 108708 /* 165 */ "limit_opt ::= LIMIT expr OFFSET expr", | 108777 /* 164 */ "limit_opt ::= LIMIT expr OFFSET expr", 108709 /* 166 */ "limit_opt ::= LIMIT expr COMMA expr", | 108778 /* 165 */ "limit_opt ::= LIMIT expr COMMA expr", 108710 /* 167 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", | 108779 /* 166 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", 108711 /* 168 */ "where_opt ::=", | 108780 /* 167 */ "where_opt ::=", 108712 /* 169 */ "where_opt ::= WHERE expr", | 108781 /* 168 */ "where_opt ::= WHERE expr", 108713 /* 170 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", | 108782 /* 169 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", 108714 /* 171 */ "setlist ::= setlist COMMA nm EQ expr", | 108783 /* 170 */ "setlist ::= setlist COMMA nm EQ expr", 108715 /* 172 */ "setlist ::= nm EQ expr", | 108784 /* 171 */ "setlist ::= nm EQ expr", 108716 /* 173 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist R | 108785 /* 172 */ "cmd ::= insert_cmd INTO fullname inscollist_opt valuelist", 108717 /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", | 108786 /* 173 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", 108718 /* 175 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", | 108787 /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", 108719 /* 176 */ "insert_cmd ::= INSERT orconf", | 108788 /* 175 */ "insert_cmd ::= INSERT orconf", 108720 /* 177 */ "insert_cmd ::= REPLACE", | 108789 /* 176 */ "insert_cmd ::= REPLACE", > 108790 /* 177 */ "valuelist ::= VALUES LP nexprlist RP", 108721 /* 178 */ "itemlist ::= itemlist COMMA expr", | 108791 /* 178 */ "valuelist ::= valuelist COMMA LP exprlist RP", 108722 /* 179 */ "itemlist ::= expr", < 108723 /* 180 */ "inscollist_opt ::=", | 108792 /* 179 */ "inscollist_opt ::=", 108724 /* 181 */ "inscollist_opt ::= LP inscollist RP", | 108793 /* 180 */ "inscollist_opt ::= LP inscollist RP", 108725 /* 182 */ "inscollist ::= inscollist COMMA nm", | 108794 /* 181 */ "inscollist ::= inscollist COMMA nm", 108726 /* 183 */ "inscollist ::= nm", | 108795 /* 182 */ "inscollist ::= nm", 108727 /* 184 */ "expr ::= term", | 108796 /* 183 */ "expr ::= term", 108728 /* 185 */ "expr ::= LP expr RP", | 108797 /* 184 */ "expr ::= LP expr RP", 108729 /* 186 */ "term ::= NULL", | 108798 /* 185 */ "term ::= NULL", 108730 /* 187 */ "expr ::= id", | 108799 /* 186 */ "expr ::= id", 108731 /* 188 */ "expr ::= JOIN_KW", | 108800 /* 187 */ "expr ::= JOIN_KW", 108732 /* 189 */ "expr ::= nm DOT nm", | 108801 /* 188 */ "expr ::= nm DOT nm", 108733 /* 190 */ "expr ::= nm DOT nm DOT nm", | 108802 /* 189 */ "expr ::= nm DOT nm DOT nm", 108734 /* 191 */ "term ::= INTEGER|FLOAT|BLOB", | 108803 /* 190 */ "term ::= INTEGER|FLOAT|BLOB", 108735 /* 192 */ "term ::= STRING", | 108804 /* 191 */ "term ::= STRING", 108736 /* 193 */ "expr ::= REGISTER", | 108805 /* 192 */ "expr ::= REGISTER", 108737 /* 194 */ "expr ::= VARIABLE", | 108806 /* 193 */ "expr ::= VARIABLE", 108738 /* 195 */ "expr ::= expr COLLATE ids", | 108807 /* 194 */ "expr ::= expr COLLATE ids", 108739 /* 196 */ "expr ::= CAST LP expr AS typetoken RP", | 108808 /* 195 */ "expr ::= CAST LP expr AS typetoken RP", 108740 /* 197 */ "expr ::= ID LP distinct exprlist RP", | 108809 /* 196 */ "expr ::= ID LP distinct exprlist RP", 108741 /* 198 */ "expr ::= ID LP STAR RP", | 108810 /* 197 */ "expr ::= ID LP STAR RP", 108742 /* 199 */ "term ::= CTIME_KW", | 108811 /* 198 */ "term ::= CTIME_KW", 108743 /* 200 */ "expr ::= expr AND expr", | 108812 /* 199 */ "expr ::= expr AND expr", 108744 /* 201 */ "expr ::= expr OR expr", | 108813 /* 200 */ "expr ::= expr OR expr", 108745 /* 202 */ "expr ::= expr LT|GT|GE|LE expr", | 108814 /* 201 */ "expr ::= expr LT|GT|GE|LE expr", 108746 /* 203 */ "expr ::= expr EQ|NE expr", | 108815 /* 202 */ "expr ::= expr EQ|NE expr", 108747 /* 204 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", | 108816 /* 203 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", 108748 /* 205 */ "expr ::= expr PLUS|MINUS expr", | 108817 /* 204 */ "expr ::= expr PLUS|MINUS expr", 108749 /* 206 */ "expr ::= expr STAR|SLASH|REM expr", | 108818 /* 205 */ "expr ::= expr STAR|SLASH|REM expr", 108750 /* 207 */ "expr ::= expr CONCAT expr", | 108819 /* 206 */ "expr ::= expr CONCAT expr", 108751 /* 208 */ "likeop ::= LIKE_KW", | 108820 /* 207 */ "likeop ::= LIKE_KW", 108752 /* 209 */ "likeop ::= NOT LIKE_KW", | 108821 /* 208 */ "likeop ::= NOT LIKE_KW", 108753 /* 210 */ "likeop ::= MATCH", | 108822 /* 209 */ "likeop ::= MATCH", 108754 /* 211 */ "likeop ::= NOT MATCH", | 108823 /* 210 */ "likeop ::= NOT MATCH", 108755 /* 212 */ "expr ::= expr likeop expr", | 108824 /* 211 */ "expr ::= expr likeop expr", 108756 /* 213 */ "expr ::= expr likeop expr ESCAPE expr", | 108825 /* 212 */ "expr ::= expr likeop expr ESCAPE expr", 108757 /* 214 */ "expr ::= expr ISNULL|NOTNULL", | 108826 /* 213 */ "expr ::= expr ISNULL|NOTNULL", 108758 /* 215 */ "expr ::= expr NOT NULL", | 108827 /* 214 */ "expr ::= expr NOT NULL", 108759 /* 216 */ "expr ::= expr IS expr", | 108828 /* 215 */ "expr ::= expr IS expr", 108760 /* 217 */ "expr ::= expr IS NOT expr", | 108829 /* 216 */ "expr ::= expr IS NOT expr", 108761 /* 218 */ "expr ::= NOT expr", | 108830 /* 217 */ "expr ::= NOT expr", 108762 /* 219 */ "expr ::= BITNOT expr", | 108831 /* 218 */ "expr ::= BITNOT expr", 108763 /* 220 */ "expr ::= MINUS expr", | 108832 /* 219 */ "expr ::= MINUS expr", 108764 /* 221 */ "expr ::= PLUS expr", | 108833 /* 220 */ "expr ::= PLUS expr", 108765 /* 222 */ "between_op ::= BETWEEN", | 108834 /* 221 */ "between_op ::= BETWEEN", 108766 /* 223 */ "between_op ::= NOT BETWEEN", | 108835 /* 222 */ "between_op ::= NOT BETWEEN", 108767 /* 224 */ "expr ::= expr between_op expr AND expr", | 108836 /* 223 */ "expr ::= expr between_op expr AND expr", 108768 /* 225 */ "in_op ::= IN", | 108837 /* 224 */ "in_op ::= IN", 108769 /* 226 */ "in_op ::= NOT IN", | 108838 /* 225 */ "in_op ::= NOT IN", 108770 /* 227 */ "expr ::= expr in_op LP exprlist RP", | 108839 /* 226 */ "expr ::= expr in_op LP exprlist RP", 108771 /* 228 */ "expr ::= LP select RP", | 108840 /* 227 */ "expr ::= LP select RP", 108772 /* 229 */ "expr ::= expr in_op LP select RP", | 108841 /* 228 */ "expr ::= expr in_op LP select RP", 108773 /* 230 */ "expr ::= expr in_op nm dbnm", | 108842 /* 229 */ "expr ::= expr in_op nm dbnm", 108774 /* 231 */ "expr ::= EXISTS LP select RP", | 108843 /* 230 */ "expr ::= EXISTS LP select RP", 108775 /* 232 */ "expr ::= CASE case_operand case_exprlist case_else END", | 108844 /* 231 */ "expr ::= CASE case_operand case_exprlist case_else END", 108776 /* 233 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", | 108845 /* 232 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", 108777 /* 234 */ "case_exprlist ::= WHEN expr THEN expr", | 108846 /* 233 */ "case_exprlist ::= WHEN expr THEN expr", 108778 /* 235 */ "case_else ::= ELSE expr", | 108847 /* 234 */ "case_else ::= ELSE expr", 108779 /* 236 */ "case_else ::=", | 108848 /* 235 */ "case_else ::=", 108780 /* 237 */ "case_operand ::= expr", | 108849 /* 236 */ "case_operand ::= expr", 108781 /* 238 */ "case_operand ::=", | 108850 /* 237 */ "case_operand ::=", 108782 /* 239 */ "exprlist ::= nexprlist", | 108851 /* 238 */ "exprlist ::= nexprlist", 108783 /* 240 */ "exprlist ::=", | 108852 /* 239 */ "exprlist ::=", 108784 /* 241 */ "nexprlist ::= nexprlist COMMA expr", | 108853 /* 240 */ "nexprlist ::= nexprlist COMMA expr", 108785 /* 242 */ "nexprlist ::= expr", | 108854 /* 241 */ "nexprlist ::= expr", 108786 /* 243 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxli | 108855 /* 242 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxli 108787 /* 244 */ "uniqueflag ::= UNIQUE", | 108856 /* 243 */ "uniqueflag ::= UNIQUE", 108788 /* 245 */ "uniqueflag ::=", | 108857 /* 244 */ "uniqueflag ::=", 108789 /* 246 */ "idxlist_opt ::=", | 108858 /* 245 */ "idxlist_opt ::=", 108790 /* 247 */ "idxlist_opt ::= LP idxlist RP", | 108859 /* 246 */ "idxlist_opt ::= LP idxlist RP", 108791 /* 248 */ "idxlist ::= idxlist COMMA nm collate sortorder", | 108860 /* 247 */ "idxlist ::= idxlist COMMA nm collate sortorder", 108792 /* 249 */ "idxlist ::= nm collate sortorder", | 108861 /* 248 */ "idxlist ::= nm collate sortorder", 108793 /* 250 */ "collate ::=", | 108862 /* 249 */ "collate ::=", 108794 /* 251 */ "collate ::= COLLATE ids", | 108863 /* 250 */ "collate ::= COLLATE ids", 108795 /* 252 */ "cmd ::= DROP INDEX ifexists fullname", | 108864 /* 251 */ "cmd ::= DROP INDEX ifexists fullname", 108796 /* 253 */ "cmd ::= VACUUM", | 108865 /* 252 */ "cmd ::= VACUUM", 108797 /* 254 */ "cmd ::= VACUUM nm", | 108866 /* 253 */ "cmd ::= VACUUM nm", 108798 /* 255 */ "cmd ::= PRAGMA nm dbnm", | 108867 /* 254 */ "cmd ::= PRAGMA nm dbnm", 108799 /* 256 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", | 108868 /* 255 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", 108800 /* 257 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", | 108869 /* 256 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", 108801 /* 258 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", | 108870 /* 257 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", 108802 /* 259 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", | 108871 /* 258 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", 108803 /* 260 */ "nmnum ::= plus_num", | 108872 /* 259 */ "nmnum ::= plus_num", 108804 /* 261 */ "nmnum ::= nm", | 108873 /* 260 */ "nmnum ::= nm", 108805 /* 262 */ "nmnum ::= ON", | 108874 /* 261 */ "nmnum ::= ON", 108806 /* 263 */ "nmnum ::= DELETE", | 108875 /* 262 */ "nmnum ::= DELETE", 108807 /* 264 */ "nmnum ::= DEFAULT", | 108876 /* 263 */ "nmnum ::= DEFAULT", > 108877 /* 264 */ "plus_num ::= PLUS number", 108808 /* 265 */ "plus_num ::= plus_opt number", | 108878 /* 265 */ "plus_num ::= number", 108809 /* 266 */ "minus_num ::= MINUS number", 108879 /* 266 */ "minus_num ::= MINUS number", 108810 /* 267 */ "number ::= INTEGER|FLOAT", 108880 /* 267 */ "number ::= INTEGER|FLOAT", 108811 /* 268 */ "plus_opt ::= PLUS", < 108812 /* 269 */ "plus_opt ::=", < 108813 /* 270 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", | 108881 /* 268 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", 108814 /* 271 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigg | 108882 /* 269 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigg 108815 /* 272 */ "trigger_time ::= BEFORE", | 108883 /* 270 */ "trigger_time ::= BEFORE", 108816 /* 273 */ "trigger_time ::= AFTER", | 108884 /* 271 */ "trigger_time ::= AFTER", 108817 /* 274 */ "trigger_time ::= INSTEAD OF", | 108885 /* 272 */ "trigger_time ::= INSTEAD OF", 108818 /* 275 */ "trigger_time ::=", | 108886 /* 273 */ "trigger_time ::=", 108819 /* 276 */ "trigger_event ::= DELETE|INSERT", | 108887 /* 274 */ "trigger_event ::= DELETE|INSERT", 108820 /* 277 */ "trigger_event ::= UPDATE", | 108888 /* 275 */ "trigger_event ::= UPDATE", 108821 /* 278 */ "trigger_event ::= UPDATE OF inscollist", | 108889 /* 276 */ "trigger_event ::= UPDATE OF inscollist", 108822 /* 279 */ "foreach_clause ::=", | 108890 /* 277 */ "foreach_clause ::=", 108823 /* 280 */ "foreach_clause ::= FOR EACH ROW", | 108891 /* 278 */ "foreach_clause ::= FOR EACH ROW", 108824 /* 281 */ "when_clause ::=", | 108892 /* 279 */ "when_clause ::=", 108825 /* 282 */ "when_clause ::= WHEN expr", | 108893 /* 280 */ "when_clause ::= WHEN expr", 108826 /* 283 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", | 108894 /* 281 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", 108827 /* 284 */ "trigger_cmd_list ::= trigger_cmd SEMI", | 108895 /* 282 */ "trigger_cmd_list ::= trigger_cmd SEMI", 108828 /* 285 */ "trnm ::= nm", | 108896 /* 283 */ "trnm ::= nm", 108829 /* 286 */ "trnm ::= nm DOT nm", | 108897 /* 284 */ "trnm ::= nm DOT nm", 108830 /* 287 */ "tridxby ::=", | 108898 /* 285 */ "tridxby ::=", 108831 /* 288 */ "tridxby ::= INDEXED BY nm", | 108899 /* 286 */ "tridxby ::= INDEXED BY nm", 108832 /* 289 */ "tridxby ::= NOT INDEXED", | 108900 /* 287 */ "tridxby ::= NOT INDEXED", 108833 /* 290 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt", | 108901 /* 288 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt", 108834 /* 291 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemli | 108902 /* 289 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist", 108835 /* 292 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select", | 108903 /* 290 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select", 108836 /* 293 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt", | 108904 /* 291 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt", 108837 /* 294 */ "trigger_cmd ::= select", | 108905 /* 292 */ "trigger_cmd ::= select", 108838 /* 295 */ "expr ::= RAISE LP IGNORE RP", | 108906 /* 293 */ "expr ::= RAISE LP IGNORE RP", 108839 /* 296 */ "expr ::= RAISE LP raisetype COMMA nm RP", | 108907 /* 294 */ "expr ::= RAISE LP raisetype COMMA nm RP", 108840 /* 297 */ "raisetype ::= ROLLBACK", | 108908 /* 295 */ "raisetype ::= ROLLBACK", 108841 /* 298 */ "raisetype ::= ABORT", | 108909 /* 296 */ "raisetype ::= ABORT", 108842 /* 299 */ "raisetype ::= FAIL", | 108910 /* 297 */ "raisetype ::= FAIL", 108843 /* 300 */ "cmd ::= DROP TRIGGER ifexists fullname", | 108911 /* 298 */ "cmd ::= DROP TRIGGER ifexists fullname", 108844 /* 301 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", | 108912 /* 299 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", 108845 /* 302 */ "cmd ::= DETACH database_kw_opt expr", | 108913 /* 300 */ "cmd ::= DETACH database_kw_opt expr", 108846 /* 303 */ "key_opt ::=", | 108914 /* 301 */ "key_opt ::=", 108847 /* 304 */ "key_opt ::= KEY expr", | 108915 /* 302 */ "key_opt ::= KEY expr", 108848 /* 305 */ "database_kw_opt ::= DATABASE", | 108916 /* 303 */ "database_kw_opt ::= DATABASE", 108849 /* 306 */ "database_kw_opt ::=", | 108917 /* 304 */ "database_kw_opt ::=", 108850 /* 307 */ "cmd ::= REINDEX", | 108918 /* 305 */ "cmd ::= REINDEX", 108851 /* 308 */ "cmd ::= REINDEX nm dbnm", | 108919 /* 306 */ "cmd ::= REINDEX nm dbnm", 108852 /* 309 */ "cmd ::= ANALYZE", | 108920 /* 307 */ "cmd ::= ANALYZE", 108853 /* 310 */ "cmd ::= ANALYZE nm dbnm", | 108921 /* 308 */ "cmd ::= ANALYZE nm dbnm", 108854 /* 311 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", | 108922 /* 309 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", 108855 /* 312 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", | 108923 /* 310 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", 108856 /* 313 */ "add_column_fullname ::= fullname", | 108924 /* 311 */ "add_column_fullname ::= fullname", 108857 /* 314 */ "kwcolumn_opt ::=", | 108925 /* 312 */ "kwcolumn_opt ::=", 108858 /* 315 */ "kwcolumn_opt ::= COLUMNKW", | 108926 /* 313 */ "kwcolumn_opt ::= COLUMNKW", 108859 /* 316 */ "cmd ::= create_vtab", | 108927 /* 314 */ "cmd ::= create_vtab", 108860 /* 317 */ "cmd ::= create_vtab LP vtabarglist RP", | 108928 /* 315 */ "cmd ::= create_vtab LP vtabarglist RP", 108861 /* 318 */ "create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm", | 108929 /* 316 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm" 108862 /* 319 */ "vtabarglist ::= vtabarg", | 108930 /* 317 */ "vtabarglist ::= vtabarg", 108863 /* 320 */ "vtabarglist ::= vtabarglist COMMA vtabarg", | 108931 /* 318 */ "vtabarglist ::= vtabarglist COMMA vtabarg", 108864 /* 321 */ "vtabarg ::=", | 108932 /* 319 */ "vtabarg ::=", 108865 /* 322 */ "vtabarg ::= vtabarg vtabargtoken", | 108933 /* 320 */ "vtabarg ::= vtabarg vtabargtoken", 108866 /* 323 */ "vtabargtoken ::= ANY", | 108934 /* 321 */ "vtabargtoken ::= ANY", 108867 /* 324 */ "vtabargtoken ::= lp anylist RP", | 108935 /* 322 */ "vtabargtoken ::= lp anylist RP", 108868 /* 325 */ "lp ::= LP", | 108936 /* 323 */ "lp ::= LP", 108869 /* 326 */ "anylist ::=", | 108937 /* 324 */ "anylist ::=", 108870 /* 327 */ "anylist ::= anylist LP anylist RP", | 108938 /* 325 */ "anylist ::= anylist LP anylist RP", 108871 /* 328 */ "anylist ::= anylist ANY", | 108939 /* 326 */ "anylist ::= anylist ANY", 108872 }; 108940 }; 108873 #endif /* NDEBUG */ 108941 #endif /* NDEBUG */ 108874 108942 108875 108943 108876 #if YYSTACKDEPTH<=0 108944 #if YYSTACKDEPTH<=0 108877 /* 108945 /* 108878 ** Try to increase the size of the parser stack. 108946 ** Try to increase the size of the parser stack. ................................................................................................................................................................................ 108946 ** Note: during a reduce, the only symbols destroyed are those 109014 ** Note: during a reduce, the only symbols destroyed are those 108947 ** which appear on the RHS of the rule, but which are not used 109015 ** which appear on the RHS of the rule, but which are not used 108948 ** inside the C code. 109016 ** inside the C code. 108949 */ 109017 */ 108950 case 160: /* select */ 109018 case 160: /* select */ 108951 case 194: /* oneselect */ 109019 case 194: /* oneselect */ 108952 { 109020 { 108953 sqlite3SelectDelete(pParse->db, (yypminor->yy387)); | 109021 sqlite3SelectDelete(pParse->db, (yypminor->yy159)); 108954 } 109022 } 108955 break; 109023 break; 108956 case 174: /* term */ 109024 case 174: /* term */ 108957 case 175: /* expr */ 109025 case 175: /* expr */ 108958 { 109026 { 108959 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr); | 109027 sqlite3ExprDelete(pParse->db, (yypminor->yy342).pExpr); 108960 } 109028 } 108961 break; 109029 break; 108962 case 179: /* idxlist_opt */ 109030 case 179: /* idxlist_opt */ 108963 case 187: /* idxlist */ 109031 case 187: /* idxlist */ 108964 case 197: /* selcollist */ 109032 case 197: /* selcollist */ 108965 case 200: /* groupby_opt */ 109033 case 200: /* groupby_opt */ 108966 case 202: /* orderby_opt */ 109034 case 202: /* orderby_opt */ 108967 case 204: /* sclp */ 109035 case 204: /* sclp */ 108968 case 214: /* sortlist */ 109036 case 214: /* sortlist */ 108969 case 216: /* nexprlist */ | 109037 case 215: /* nexprlist */ 108970 case 217: /* setlist */ | 109038 case 216: /* setlist */ 108971 case 220: /* itemlist */ < 108972 case 221: /* exprlist */ | 109039 case 220: /* exprlist */ 108973 case 226: /* case_exprlist */ | 109040 case 225: /* case_exprlist */ 108974 { 109041 { 108975 sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); | 109042 sqlite3ExprListDelete(pParse->db, (yypminor->yy442)); 108976 } 109043 } 108977 break; 109044 break; 108978 case 193: /* fullname */ 109045 case 193: /* fullname */ 108979 case 198: /* from */ 109046 case 198: /* from */ 108980 case 206: /* seltablist */ 109047 case 206: /* seltablist */ 108981 case 207: /* stl_prefix */ 109048 case 207: /* stl_prefix */ 108982 { 109049 { 108983 sqlite3SrcListDelete(pParse->db, (yypminor->yy259)); | 109050 sqlite3SrcListDelete(pParse->db, (yypminor->yy347)); 108984 } 109051 } 108985 break; 109052 break; 108986 case 199: /* where_opt */ 109053 case 199: /* where_opt */ 108987 case 201: /* having_opt */ 109054 case 201: /* having_opt */ 108988 case 210: /* on_opt */ 109055 case 210: /* on_opt */ 108989 case 215: /* sortitem */ < 108990 case 225: /* case_operand */ | 109056 case 224: /* case_operand */ 108991 case 227: /* case_else */ | 109057 case 226: /* case_else */ 108992 case 238: /* when_clause */ | 109058 case 236: /* when_clause */ 108993 case 243: /* key_opt */ | 109059 case 241: /* key_opt */ 108994 { 109060 { 108995 sqlite3ExprDelete(pParse->db, (yypminor->yy314)); | 109061 sqlite3ExprDelete(pParse->db, (yypminor->yy122)); 108996 } 109062 } 108997 break; 109063 break; 108998 case 211: /* using_opt */ 109064 case 211: /* using_opt */ 108999 case 213: /* inscollist */ 109065 case 213: /* inscollist */ 109000 case 219: /* inscollist_opt */ | 109066 case 218: /* inscollist_opt */ 109001 { 109067 { 109002 sqlite3IdListDelete(pParse->db, (yypminor->yy384)); | 109068 sqlite3IdListDelete(pParse->db, (yypminor->yy180)); 109003 } 109069 } 109004 break; 109070 break; > 109071 case 219: /* valuelist */ > 109072 { > 109073 > 109074 sqlite3ExprListDelete(pParse->db, (yypminor->yy487).pList); > 109075 sqlite3SelectDelete(pParse->db, (yypminor->yy487).pSelect); > 109076 > 109077 } > 109078 break; 109005 case 234: /* trigger_cmd_list */ | 109079 case 232: /* trigger_cmd_list */ 109006 case 239: /* trigger_cmd */ | 109080 case 237: /* trigger_cmd */ 109007 { 109081 { 109008 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203)); | 109082 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy327)); 109009 } 109083 } 109010 break; 109084 break; 109011 case 236: /* trigger_event */ | 109085 case 234: /* trigger_event */ 109012 { 109086 { 109013 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b); | 109087 sqlite3IdListDelete(pParse->db, (yypminor->yy410).b); 109014 } 109088 } 109015 break; 109089 break; 109016 default: break; /* If no destructor action specified: do nothing */ 109090 default: break; /* If no destructor action specified: do nothing */ 109017 } 109091 } 109018 } 109092 } 109019 109093 109020 /* 109094 /* ................................................................................................................................................................................ 109406 { 209, 2 }, 109480 { 209, 2 }, 109407 { 211, 4 }, 109481 { 211, 4 }, 109408 { 211, 0 }, 109482 { 211, 0 }, 109409 { 202, 0 }, 109483 { 202, 0 }, 109410 { 202, 3 }, 109484 { 202, 3 }, 109411 { 214, 4 }, 109485 { 214, 4 }, 109412 { 214, 2 }, 109486 { 214, 2 }, 109413 { 215, 1 }, < 109414 { 177, 1 }, 109487 { 177, 1 }, 109415 { 177, 1 }, 109488 { 177, 1 }, 109416 { 177, 0 }, 109489 { 177, 0 }, 109417 { 200, 0 }, 109490 { 200, 0 }, 109418 { 200, 3 }, 109491 { 200, 3 }, 109419 { 201, 0 }, 109492 { 201, 0 }, 109420 { 201, 2 }, 109493 { 201, 2 }, ................................................................................................................................................................................ 109422 { 203, 2 }, 109495 { 203, 2 }, 109423 { 203, 4 }, 109496 { 203, 4 }, 109424 { 203, 4 }, 109497 { 203, 4 }, 109425 { 147, 5 }, 109498 { 147, 5 }, 109426 { 199, 0 }, 109499 { 199, 0 }, 109427 { 199, 2 }, 109500 { 199, 2 }, 109428 { 147, 7 }, 109501 { 147, 7 }, 109429 { 217, 5 }, | 109502 { 216, 5 }, 109430 { 217, 3 }, | 109503 { 216, 3 }, 109431 { 147, 8 }, | 109504 { 147, 5 }, 109432 { 147, 5 }, 109505 { 147, 5 }, 109433 { 147, 6 }, 109506 { 147, 6 }, 109434 { 218, 2 }, | 109507 { 217, 2 }, 109435 { 218, 1 }, | 109508 { 217, 1 }, 109436 { 220, 3 }, | 109509 { 219, 4 }, 109437 { 220, 1 }, | 109510 { 219, 5 }, 109438 { 219, 0 }, | 109511 { 218, 0 }, 109439 { 219, 3 }, | 109512 { 218, 3 }, 109440 { 213, 3 }, 109513 { 213, 3 }, 109441 { 213, 1 }, 109514 { 213, 1 }, 109442 { 175, 1 }, 109515 { 175, 1 }, 109443 { 175, 3 }, 109516 { 175, 3 }, 109444 { 174, 1 }, 109517 { 174, 1 }, 109445 { 175, 1 }, 109518 { 175, 1 }, 109446 { 175, 1 }, 109519 { 175, 1 }, ................................................................................................................................................................................ 109459 { 175, 3 }, 109532 { 175, 3 }, 109460 { 175, 3 }, 109533 { 175, 3 }, 109461 { 175, 3 }, 109534 { 175, 3 }, 109462 { 175, 3 }, 109535 { 175, 3 }, 109463 { 175, 3 }, 109536 { 175, 3 }, 109464 { 175, 3 }, 109537 { 175, 3 }, 109465 { 175, 3 }, 109538 { 175, 3 }, 109466 { 222, 1 }, | 109539 { 221, 1 }, 109467 { 222, 2 }, | 109540 { 221, 2 }, 109468 { 222, 1 }, | 109541 { 221, 1 }, 109469 { 222, 2 }, | 109542 { 221, 2 }, 109470 { 175, 3 }, 109543 { 175, 3 }, 109471 { 175, 5 }, 109544 { 175, 5 }, 109472 { 175, 2 }, 109545 { 175, 2 }, 109473 { 175, 3 }, 109546 { 175, 3 }, 109474 { 175, 3 }, 109547 { 175, 3 }, 109475 { 175, 4 }, 109548 { 175, 4 }, 109476 { 175, 2 }, 109549 { 175, 2 }, 109477 { 175, 2 }, 109550 { 175, 2 }, 109478 { 175, 2 }, 109551 { 175, 2 }, 109479 { 175, 2 }, 109552 { 175, 2 }, 109480 { 223, 1 }, | 109553 { 222, 1 }, 109481 { 223, 2 }, | 109554 { 222, 2 }, 109482 { 175, 5 }, 109555 { 175, 5 }, 109483 { 224, 1 }, | 109556 { 223, 1 }, 109484 { 224, 2 }, | 109557 { 223, 2 }, 109485 { 175, 5 }, 109558 { 175, 5 }, 109486 { 175, 3 }, 109559 { 175, 3 }, 109487 { 175, 5 }, 109560 { 175, 5 }, 109488 { 175, 4 }, 109561 { 175, 4 }, 109489 { 175, 4 }, 109562 { 175, 4 }, 109490 { 175, 5 }, 109563 { 175, 5 }, 109491 { 226, 5 }, | 109564 { 225, 5 }, 109492 { 226, 4 }, | 109565 { 225, 4 }, 109493 { 227, 2 }, | 109566 { 226, 2 }, 109494 { 227, 0 }, | 109567 { 226, 0 }, 109495 { 225, 1 }, | 109568 { 224, 1 }, 109496 { 225, 0 }, | 109569 { 224, 0 }, 109497 { 221, 1 }, | 109570 { 220, 1 }, 109498 { 221, 0 }, | 109571 { 220, 0 }, 109499 { 216, 3 }, | 109572 { 215, 3 }, 109500 { 216, 1 }, | 109573 { 215, 1 }, 109501 { 147, 11 }, 109574 { 147, 11 }, 109502 { 228, 1 }, | 109575 { 227, 1 }, 109503 { 228, 0 }, | 109576 { 227, 0 }, 109504 { 179, 0 }, 109577 { 179, 0 }, 109505 { 179, 3 }, 109578 { 179, 3 }, 109506 { 187, 5 }, 109579 { 187, 5 }, 109507 { 187, 3 }, 109580 { 187, 3 }, 109508 { 229, 0 }, | 109581 { 228, 0 }, 109509 { 229, 2 }, | 109582 { 228, 2 }, 109510 { 147, 4 }, 109583 { 147, 4 }, 109511 { 147, 1 }, 109584 { 147, 1 }, 109512 { 147, 2 }, 109585 { 147, 2 }, 109513 { 147, 3 }, 109586 { 147, 3 }, 109514 { 147, 5 }, 109587 { 147, 5 }, 109515 { 147, 6 }, 109588 { 147, 6 }, 109516 { 147, 5 }, 109589 { 147, 5 }, 109517 { 147, 6 }, 109590 { 147, 6 }, 109518 { 230, 1 }, | 109591 { 229, 1 }, 109519 { 230, 1 }, | 109592 { 229, 1 }, 109520 { 230, 1 }, | 109593 { 229, 1 }, 109521 { 230, 1 }, | 109594 { 229, 1 }, 109522 { 230, 1 }, | 109595 { 229, 1 }, 109523 { 170, 2 }, 109596 { 170, 2 }, > 109597 { 170, 1 }, 109524 { 171, 2 }, 109598 { 171, 2 }, 109525 { 232, 1 }, | 109599 { 230, 1 }, 109526 { 231, 1 }, < 109527 { 231, 0 }, < 109528 { 147, 5 }, 109600 { 147, 5 }, 109529 { 233, 11 }, | 109601 { 231, 11 }, 109530 { 235, 1 }, | 109602 { 233, 1 }, 109531 { 235, 1 }, | 109603 { 233, 1 }, 109532 { 235, 2 }, | 109604 { 233, 2 }, 109533 { 235, 0 }, | 109605 { 233, 0 }, 109534 { 236, 1 }, | 109606 { 234, 1 }, 109535 { 236, 1 }, | 109607 { 234, 1 }, 109536 { 236, 3 }, | 109608 { 234, 3 }, 109537 { 237, 0 }, | 109609 { 235, 0 }, 109538 { 237, 3 }, | 109610 { 235, 3 }, 109539 { 238, 0 }, | 109611 { 236, 0 }, 109540 { 238, 2 }, | 109612 { 236, 2 }, 109541 { 234, 3 }, | 109613 { 232, 3 }, 109542 { 234, 2 }, | 109614 { 232, 2 }, 109543 { 240, 1 }, | 109615 { 238, 1 }, 109544 { 240, 3 }, | 109616 { 238, 3 }, 109545 { 241, 0 }, | 109617 { 239, 0 }, 109546 { 241, 3 }, | 109618 { 239, 3 }, 109547 { 241, 2 }, | 109619 { 239, 2 }, 109548 { 239, 7 }, | 109620 { 237, 7 }, 109549 { 239, 8 }, | 109621 { 237, 5 }, 109550 { 239, 5 }, | 109622 { 237, 5 }, 109551 { 239, 5 }, | 109623 { 237, 5 }, 109552 { 239, 1 }, | 109624 { 237, 1 }, 109553 { 175, 4 }, 109625 { 175, 4 }, 109554 { 175, 6 }, 109626 { 175, 6 }, 109555 { 191, 1 }, 109627 { 191, 1 }, 109556 { 191, 1 }, 109628 { 191, 1 }, 109557 { 191, 1 }, 109629 { 191, 1 }, 109558 { 147, 4 }, 109630 { 147, 4 }, 109559 { 147, 6 }, 109631 { 147, 6 }, 109560 { 147, 3 }, 109632 { 147, 3 }, 109561 { 243, 0 }, | 109633 { 241, 0 }, 109562 { 243, 2 }, | 109634 { 241, 2 }, 109563 { 242, 1 }, | 109635 { 240, 1 }, 109564 { 242, 0 }, | 109636 { 240, 0 }, 109565 { 147, 1 }, 109637 { 147, 1 }, 109566 { 147, 3 }, 109638 { 147, 3 }, 109567 { 147, 1 }, 109639 { 147, 1 }, 109568 { 147, 3 }, 109640 { 147, 3 }, 109569 { 147, 6 }, 109641 { 147, 6 }, 109570 { 147, 6 }, 109642 { 147, 6 }, 109571 { 244, 1 }, | 109643 { 242, 1 }, 109572 { 245, 0 }, | 109644 { 243, 0 }, 109573 { 245, 1 }, | 109645 { 243, 1 }, 109574 { 147, 1 }, 109646 { 147, 1 }, 109575 { 147, 4 }, 109647 { 147, 4 }, 109576 { 246, 7 }, | 109648 { 244, 8 }, 109577 { 247, 1 }, | 109649 { 245, 1 }, 109578 { 247, 3 }, | 109650 { 245, 3 }, 109579 { 248, 0 }, | 109651 { 246, 0 }, 109580 { 248, 2 }, | 109652 { 246, 2 }, 109581 { 249, 1 }, | 109653 { 247, 1 }, 109582 { 249, 3 }, | 109654 { 247, 3 }, 109583 { 250, 1 }, | 109655 { 248, 1 }, 109584 { 251, 0 }, | 109656 { 249, 0 }, 109585 { 251, 4 }, | 109657 { 249, 4 }, 109586 { 251, 2 }, | 109658 { 249, 2 }, 109587 }; 109659 }; 109588 109660 109589 static void yy_accept(yyParser*); /* Forward Declaration */ 109661 static void yy_accept(yyParser*); /* Forward Declaration */ 109590 109662 109591 /* 109663 /* 109592 ** Perform a reduce action and the shift that must immediately 109664 ** Perform a reduce action and the shift that must immediately 109593 ** follow the reduce. 109665 ** follow the reduce. ................................................................................................................................................................................ 109647 case 7: /* explain ::= EXPLAIN QUERY PLAN */ 109719 case 7: /* explain ::= EXPLAIN QUERY PLAN */ 109648 { sqlite3BeginParse(pParse, 2); } 109720 { sqlite3BeginParse(pParse, 2); } 109649 break; 109721 break; 109650 case 8: /* cmdx ::= cmd */ 109722 case 8: /* cmdx ::= cmd */ 109651 { sqlite3FinishCoding(pParse); } 109723 { sqlite3FinishCoding(pParse); } 109652 break; 109724 break; 109653 case 9: /* cmd ::= BEGIN transtype trans_opt */ 109725 case 9: /* cmd ::= BEGIN transtype trans_opt */ 109654 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);} | 109726 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy392);} 109655 break; 109727 break; 109656 case 13: /* transtype ::= */ 109728 case 13: /* transtype ::= */ 109657 {yygotominor.yy4 = TK_DEFERRED;} | 109729 {yygotominor.yy392 = TK_DEFERRED;} 109658 break; 109730 break; 109659 case 14: /* transtype ::= DEFERRED */ 109731 case 14: /* transtype ::= DEFERRED */ 109660 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); 109732 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); 109661 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); 109733 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); 109662 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); 109734 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); 109663 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==1 109735 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==1 109664 {yygotominor.yy4 = yymsp[0].major;} | 109736 {yygotominor.yy392 = yymsp[0].major;} 109665 break; 109737 break; 109666 case 17: /* cmd ::= COMMIT trans_opt */ 109738 case 17: /* cmd ::= COMMIT trans_opt */ 109667 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); 109739 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); 109668 {sqlite3CommitTransaction(pParse);} 109740 {sqlite3CommitTransaction(pParse);} 109669 break; 109741 break; 109670 case 19: /* cmd ::= ROLLBACK trans_opt */ 109742 case 19: /* cmd ::= ROLLBACK trans_opt */ 109671 {sqlite3RollbackTransaction(pParse);} 109743 {sqlite3RollbackTransaction(pParse);} ................................................................................................................................................................................ 109683 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ 109755 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ 109684 { 109756 { 109685 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); 109757 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); 109686 } 109758 } 109687 break; 109759 break; 109688 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ 109760 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ 109689 { 109761 { 109690 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].m | 109762 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].m 109691 } 109763 } 109692 break; 109764 break; 109693 case 27: /* createkw ::= CREATE */ 109765 case 27: /* createkw ::= CREATE */ 109694 { 109766 { 109695 pParse->db->lookaside.bEnabled = 0; 109767 pParse->db->lookaside.bEnabled = 0; 109696 yygotominor.yy0 = yymsp[0].minor.yy0; 109768 yygotominor.yy0 = yymsp[0].minor.yy0; 109697 } 109769 } ................................................................................................................................................................................ 109702 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ y 109774 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ y 109703 case 85: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==85); 109775 case 85: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==85); 109704 case 87: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(y 109776 case 87: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(y 109705 case 98: /* defer_subclause_opt ::= */ yytestcase(yyruleno==98); 109777 case 98: /* defer_subclause_opt ::= */ yytestcase(yyruleno==98); 109706 case 109: /* ifexists ::= */ yytestcase(yyruleno==109); 109778 case 109: /* ifexists ::= */ yytestcase(yyruleno==109); 109707 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); 109779 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); 109708 case 121: /* distinct ::= */ yytestcase(yyruleno==121); 109780 case 121: /* distinct ::= */ yytestcase(yyruleno==121); 109709 case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222); | 109781 case 221: /* between_op ::= BETWEEN */ yytestcase(yyruleno==221); 109710 case 225: /* in_op ::= IN */ yytestcase(yyruleno==225); | 109782 case 224: /* in_op ::= IN */ yytestcase(yyruleno==224); 109711 {yygotominor.yy4 = 0;} | 109783 {yygotominor.yy392 = 0;} 109712 break; 109784 break; 109713 case 29: /* ifnotexists ::= IF NOT EXISTS */ 109785 case 29: /* ifnotexists ::= IF NOT EXISTS */ 109714 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); 109786 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); 109715 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); 109787 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); 109716 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yy 109788 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yy 109717 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); 109789 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); 109718 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); 109790 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); 109719 case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223); | 109791 case 222: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==222); 109720 case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226); | 109792 case 225: /* in_op ::= NOT IN */ yytestcase(yyruleno==225); 109721 {yygotominor.yy4 = 1;} | 109793 {yygotominor.yy392 = 1;} 109722 break; 109794 break; 109723 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ 109795 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ 109724 { 109796 { 109725 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); 109797 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); 109726 } 109798 } 109727 break; 109799 break; 109728 case 33: /* create_table_args ::= AS select */ 109800 case 33: /* create_table_args ::= AS select */ 109729 { 109801 { 109730 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387); | 109802 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy159); 109731 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); | 109803 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159); 109732 } 109804 } 109733 break; 109805 break; 109734 case 36: /* column ::= columnid type carglist */ 109806 case 36: /* column ::= columnid type carglist */ 109735 { 109807 { 109736 yygotominor.yy0.z = yymsp[-2].minor.yy0.z; 109808 yygotominor.yy0.z = yymsp[-2].minor.yy0.z; 109737 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse 109809 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse 109738 } 109810 } ................................................................................................................................................................................ 109751 case 43: /* nm ::= JOIN_KW */ yytestcase(yyruleno==43); 109823 case 43: /* nm ::= JOIN_KW */ yytestcase(yyruleno==43); 109752 case 46: /* typetoken ::= typename */ yytestcase(yyruleno==46); 109824 case 46: /* typetoken ::= typename */ yytestcase(yyruleno==46); 109753 case 49: /* typename ::= ids */ yytestcase(yyruleno==49); 109825 case 49: /* typename ::= ids */ yytestcase(yyruleno==49); 109754 case 127: /* as ::= AS nm */ yytestcase(yyruleno==127); 109826 case 127: /* as ::= AS nm */ yytestcase(yyruleno==127); 109755 case 128: /* as ::= ids */ yytestcase(yyruleno==128); 109827 case 128: /* as ::= ids */ yytestcase(yyruleno==128); 109756 case 138: /* dbnm ::= DOT nm */ yytestcase(yyruleno==138); 109828 case 138: /* dbnm ::= DOT nm */ yytestcase(yyruleno==138); 109757 case 147: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==147); 109829 case 147: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==147); 109758 case 251: /* collate ::= COLLATE ids */ yytestcase(yyruleno==251); | 109830 case 250: /* collate ::= COLLATE ids */ yytestcase(yyruleno==250); 109759 case 260: /* nmnum ::= plus_num */ yytestcase(yyruleno==260); | 109831 case 259: /* nmnum ::= plus_num */ yytestcase(yyruleno==259); 109760 case 261: /* nmnum ::= nm */ yytestcase(yyruleno==261); | 109832 case 260: /* nmnum ::= nm */ yytestcase(yyruleno==260); 109761 case 262: /* nmnum ::= ON */ yytestcase(yyruleno==262); | 109833 case 261: /* nmnum ::= ON */ yytestcase(yyruleno==261); 109762 case 263: /* nmnum ::= DELETE */ yytestcase(yyruleno==263); | 109834 case 262: /* nmnum ::= DELETE */ yytestcase(yyruleno==262); 109763 case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264); | 109835 case 263: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==263); > 109836 case 264: /* plus_num ::= PLUS number */ yytestcase(yyruleno==264); 109764 case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265); | 109837 case 265: /* plus_num ::= number */ yytestcase(yyruleno==265); 109765 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266); 109838 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266); 109766 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267); 109839 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267); 109767 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285); | 109840 case 283: /* trnm ::= nm */ yytestcase(yyruleno==283); 109768 {yygotominor.yy0 = yymsp[0].minor.yy0;} 109841 {yygotominor.yy0 = yymsp[0].minor.yy0;} 109769 break; 109842 break; 109770 case 45: /* type ::= typetoken */ 109843 case 45: /* type ::= typetoken */ 109771 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} 109844 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} 109772 break; 109845 break; 109773 case 47: /* typetoken ::= typename LP signed RP */ 109846 case 47: /* typetoken ::= typename LP signed RP */ 109774 { 109847 { ................................................................................................................................................................................ 109783 } 109856 } 109784 break; 109857 break; 109785 case 50: /* typename ::= typename ids */ 109858 case 50: /* typename ::= typename ids */ 109786 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n 109859 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n 109787 break; 109860 break; 109788 case 57: /* ccons ::= DEFAULT term */ 109861 case 57: /* ccons ::= DEFAULT term */ 109789 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); 109862 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); 109790 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);} | 109863 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy342);} 109791 break; 109864 break; 109792 case 58: /* ccons ::= DEFAULT LP expr RP */ 109865 case 58: /* ccons ::= DEFAULT LP expr RP */ 109793 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);} | 109866 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy342);} 109794 break; 109867 break; 109795 case 60: /* ccons ::= DEFAULT MINUS term */ 109868 case 60: /* ccons ::= DEFAULT MINUS term */ 109796 { 109869 { 109797 ExprSpan v; 109870 ExprSpan v; 109798 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0); | 109871 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy342.pExpr, 0, 0); 109799 v.zStart = yymsp[-1].minor.yy0.z; 109872 v.zStart = yymsp[-1].minor.yy0.z; 109800 v.zEnd = yymsp[0].minor.yy118.zEnd; | 109873 v.zEnd = yymsp[0].minor.yy342.zEnd; 109801 sqlite3AddDefaultValue(pParse,&v); 109874 sqlite3AddDefaultValue(pParse,&v); 109802 } 109875 } 109803 break; 109876 break; 109804 case 61: /* ccons ::= DEFAULT id */ 109877 case 61: /* ccons ::= DEFAULT id */ 109805 { 109878 { 109806 ExprSpan v; 109879 ExprSpan v; 109807 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0); 109880 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0); 109808 sqlite3AddDefaultValue(pParse,&v); 109881 sqlite3AddDefaultValue(pParse,&v); 109809 } 109882 } 109810 break; 109883 break; 109811 case 63: /* ccons ::= NOT NULL onconf */ 109884 case 63: /* ccons ::= NOT NULL onconf */ 109812 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);} | 109885 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy392);} 109813 break; 109886 break; 109814 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ 109887 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ 109815 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2]. | 109888 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy392,yymsp[0].minor.yy392,yymsp[ 109816 break; 109889 break; 109817 case 65: /* ccons ::= UNIQUE onconf */ 109890 case 65: /* ccons ::= UNIQUE onconf */ 109818 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);} | 109891 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy392,0,0,0,0);} 109819 break; 109892 break; 109820 case 66: /* ccons ::= CHECK LP expr RP */ 109893 case 66: /* ccons ::= CHECK LP expr RP */ 109821 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);} | 109894 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy342.pExpr);} 109822 break; 109895 break; 109823 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ 109896 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ 109824 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yym | 109897 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy442,yym 109825 break; 109898 break; 109826 case 68: /* ccons ::= defer_subclause */ 109899 case 68: /* ccons ::= defer_subclause */ 109827 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);} | 109900 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy392);} 109828 break; 109901 break; 109829 case 69: /* ccons ::= COLLATE ids */ 109902 case 69: /* ccons ::= COLLATE ids */ 109830 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} 109903 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} 109831 break; 109904 break; 109832 case 72: /* refargs ::= */ 109905 case 72: /* refargs ::= */ 109833 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */} | 109906 { yygotominor.yy392 = OE_None*0x0101; /* EV: R-19803-45884 */} 109834 break; 109907 break; 109835 case 73: /* refargs ::= refargs refarg */ 109908 case 73: /* refargs ::= refargs refarg */ 109836 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0 | 109909 { yygotominor.yy392 = (yymsp[-1].minor.yy392 & ~yymsp[0].minor.yy207.mask) | yym 109837 break; 109910 break; 109838 case 74: /* refarg ::= MATCH nm */ 109911 case 74: /* refarg ::= MATCH nm */ 109839 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); 109912 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); 109840 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; } | 109913 { yygotominor.yy207.value = 0; yygotominor.yy207.mask = 0x000000; } 109841 break; 109914 break; 109842 case 76: /* refarg ::= ON DELETE refact */ 109915 case 76: /* refarg ::= ON DELETE refact */ 109843 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0 | 109916 { yygotominor.yy207.value = yymsp[0].minor.yy392; yygotominor.yy207.mask = 0 109844 break; 109917 break; 109845 case 77: /* refarg ::= ON UPDATE refact */ 109918 case 77: /* refarg ::= ON UPDATE refact */ 109846 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x0 | 109919 { yygotominor.yy207.value = yymsp[0].minor.yy392<<8; yygotominor.yy207.mask = 0 109847 break; 109920 break; 109848 case 78: /* refact ::= SET NULL */ 109921 case 78: /* refact ::= SET NULL */ 109849 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */} | 109922 { yygotominor.yy392 = OE_SetNull; /* EV: R-33326-45252 */} 109850 break; 109923 break; 109851 case 79: /* refact ::= SET DEFAULT */ 109924 case 79: /* refact ::= SET DEFAULT */ 109852 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */} | 109925 { yygotominor.yy392 = OE_SetDflt; /* EV: R-33326-45252 */} 109853 break; 109926 break; 109854 case 80: /* refact ::= CASCADE */ 109927 case 80: /* refact ::= CASCADE */ 109855 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */} | 109928 { yygotominor.yy392 = OE_Cascade; /* EV: R-33326-45252 */} 109856 break; 109929 break; 109857 case 81: /* refact ::= RESTRICT */ 109930 case 81: /* refact ::= RESTRICT */ 109858 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */} | 109931 { yygotominor.yy392 = OE_Restrict; /* EV: R-33326-45252 */} 109859 break; 109932 break; 109860 case 82: /* refact ::= NO ACTION */ 109933 case 82: /* refact ::= NO ACTION */ 109861 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */} | 109934 { yygotominor.yy392 = OE_None; /* EV: R-33326-45252 */} 109862 break; 109935 break; 109863 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ 109936 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ 109864 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno 109937 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno 109865 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==10 109938 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==10 109866 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); 109939 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); 109867 {yygotominor.yy4 = yymsp[0].minor.yy4;} | 109940 {yygotominor.yy392 = yymsp[0].minor.yy392;} 109868 break; 109941 break; 109869 case 88: /* conslist_opt ::= */ 109942 case 88: /* conslist_opt ::= */ 109870 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} 109943 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} 109871 break; 109944 break; 109872 case 89: /* conslist_opt ::= COMMA conslist */ 109945 case 89: /* conslist_opt ::= COMMA conslist */ 109873 {yygotominor.yy0 = yymsp[-1].minor.yy0;} 109946 {yygotominor.yy0 = yymsp[-1].minor.yy0;} 109874 break; 109947 break; 109875 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ 109948 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ 109876 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2]. | 109949 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy442,yymsp[0].minor.yy392,yymsp[-2 109877 break; 109950 break; 109878 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ 109951 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ 109879 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0, | 109952 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy442,yymsp[0].minor.yy392,0,0, 109880 break; 109953 break; 109881 case 96: /* tcons ::= CHECK LP expr RP onconf */ 109954 case 96: /* tcons ::= CHECK LP expr RP onconf */ 109882 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);} | 109955 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy342.pExpr);} 109883 break; 109956 break; 109884 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt 109957 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt 109885 { 109958 { 109886 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, | 109959 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy442, &yymsp[-3].minor.yy0, 109887 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4); | 109960 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy392); 109888 } 109961 } 109889 break; 109962 break; 109890 case 100: /* onconf ::= */ 109963 case 100: /* onconf ::= */ 109891 {yygotominor.yy4 = OE_Default;} | 109964 {yygotominor.yy392 = OE_Default;} 109892 break; 109965 break; 109893 case 102: /* orconf ::= */ 109966 case 102: /* orconf ::= */ 109894 {yygotominor.yy210 = OE_Default;} | 109967 {yygotominor.yy258 = OE_Default;} 109895 break; 109968 break; 109896 case 103: /* orconf ::= OR resolvetype */ 109969 case 103: /* orconf ::= OR resolvetype */ 109897 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;} | 109970 {yygotominor.yy258 = (u8)yymsp[0].minor.yy392;} 109898 break; 109971 break; 109899 case 105: /* resolvetype ::= IGNORE */ 109972 case 105: /* resolvetype ::= IGNORE */ 109900 {yygotominor.yy4 = OE_Ignore;} | 109973 {yygotominor.yy392 = OE_Ignore;} 109901 break; 109974 break; 109902 case 106: /* resolvetype ::= REPLACE */ 109975 case 106: /* resolvetype ::= REPLACE */ 109903 {yygotominor.yy4 = OE_Replace;} | 109976 {yygotominor.yy392 = OE_Replace;} 109904 break; 109977 break; 109905 case 107: /* cmd ::= DROP TABLE ifexists fullname */ 109978 case 107: /* cmd ::= DROP TABLE ifexists fullname */ 109906 { 109979 { 109907 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4); | 109980 sqlite3DropTable(pParse, yymsp[0].minor.yy347, 0, yymsp[-1].minor.yy392); 109908 } 109981 } 109909 break; 109982 break; 109910 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ 109983 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ 109911 { 109984 { 109912 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[- | 109985 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[- 109913 } 109986 } 109914 break; 109987 break; 109915 case 111: /* cmd ::= DROP VIEW ifexists fullname */ 109988 case 111: /* cmd ::= DROP VIEW ifexists fullname */ 109916 { 109989 { 109917 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4); | 109990 sqlite3DropTable(pParse, yymsp[0].minor.yy347, 1, yymsp[-1].minor.yy392); 109918 } 109991 } 109919 break; 109992 break; 109920 case 112: /* cmd ::= select */ 109993 case 112: /* cmd ::= select */ 109921 { 109994 { 109922 SelectDest dest = {SRT_Output, 0, 0, 0, 0}; 109995 SelectDest dest = {SRT_Output, 0, 0, 0, 0}; 109923 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest); | 109996 sqlite3Select(pParse, yymsp[0].minor.yy159, &dest); 109924 sqlite3ExplainBegin(pParse->pVdbe); 109997 sqlite3ExplainBegin(pParse->pVdbe); 109925 sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy387); | 109998 sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy159); 109926 sqlite3ExplainFinish(pParse->pVdbe); 109999 sqlite3ExplainFinish(pParse->pVdbe); 109927 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); | 110000 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159); 109928 } 110001 } 109929 break; 110002 break; 109930 case 113: /* select ::= oneselect */ 110003 case 113: /* select ::= oneselect */ 109931 {yygotominor.yy387 = yymsp[0].minor.yy387;} | 110004 {yygotominor.yy159 = yymsp[0].minor.yy159;} 109932 break; 110005 break; 109933 case 114: /* select ::= select multiselect_op oneselect */ 110006 case 114: /* select ::= select multiselect_op oneselect */ 109934 { 110007 { 109935 if( yymsp[0].minor.yy387 ){ | 110008 if( yymsp[0].minor.yy159 ){ 109936 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4; | 110009 yymsp[0].minor.yy159->op = (u8)yymsp[-1].minor.yy392; 109937 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387; | 110010 yymsp[0].minor.yy159->pPrior = yymsp[-2].minor.yy159; 109938 }else{ 110011 }else{ 109939 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387); | 110012 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy159); 109940 } 110013 } 109941 yygotominor.yy387 = yymsp[0].minor.yy387; | 110014 yygotominor.yy159 = yymsp[0].minor.yy159; 109942 } 110015 } 109943 break; 110016 break; 109944 case 116: /* multiselect_op ::= UNION ALL */ 110017 case 116: /* multiselect_op ::= UNION ALL */ 109945 {yygotominor.yy4 = TK_ALL;} | 110018 {yygotominor.yy392 = TK_ALL;} 109946 break; 110019 break; 109947 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt group 110020 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt group 109948 { 110021 { 109949 yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].mi | 110022 yygotominor.yy159 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy442,yymsp[-5].mi 109950 } 110023 } 109951 break; 110024 break; 109952 case 122: /* sclp ::= selcollist COMMA */ 110025 case 122: /* sclp ::= selcollist COMMA */ 109953 case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247); | 110026 case 246: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==246); 109954 {yygotominor.yy322 = yymsp[-1].minor.yy322;} | 110027 {yygotominor.yy442 = yymsp[-1].minor.yy442;} 109955 break; 110028 break; 109956 case 123: /* sclp ::= */ 110029 case 123: /* sclp ::= */ 109957 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); 110030 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); 109958 case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159); | 110031 case 158: /* groupby_opt ::= */ yytestcase(yyruleno==158); 109959 case 240: /* exprlist ::= */ yytestcase(yyruleno==240); | 110032 case 239: /* exprlist ::= */ yytestcase(yyruleno==239); 109960 case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246); | 110033 case 245: /* idxlist_opt ::= */ yytestcase(yyruleno==245); 109961 {yygotominor.yy322 = 0;} | 110034 {yygotominor.yy442 = 0;} 109962 break; 110035 break; 109963 case 124: /* selcollist ::= sclp expr as */ 110036 case 124: /* selcollist ::= sclp expr as */ 109964 { 110037 { 109965 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yyms | 110038 yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy442, yyms 109966 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322 | 110039 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy442 109967 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118); | 110040 sqlite3ExprListSetSpan(pParse,yygotominor.yy442,&yymsp[-1].minor.yy342); 109968 } 110041 } 109969 break; 110042 break; 109970 case 125: /* selcollist ::= sclp STAR */ 110043 case 125: /* selcollist ::= sclp STAR */ 109971 { 110044 { 109972 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); 110045 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); 109973 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p); | 110046 yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy442, p); 109974 } 110047 } 109975 break; 110048 break; 109976 case 126: /* selcollist ::= sclp nm DOT STAR */ 110049 case 126: /* selcollist ::= sclp nm DOT STAR */ 109977 { 110050 { 109978 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); 110051 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); 109979 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 110052 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 109980 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); 110053 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); 109981 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot); | 110054 yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442, pDot); 109982 } 110055 } 109983 break; 110056 break; 109984 case 129: /* as ::= */ 110057 case 129: /* as ::= */ 109985 {yygotominor.yy0.n = 0;} 110058 {yygotominor.yy0.n = 0;} 109986 break; 110059 break; 109987 case 130: /* from ::= */ 110060 case 130: /* from ::= */ 109988 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259)) | 110061 {yygotominor.yy347 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy347)) 109989 break; 110062 break; 109990 case 131: /* from ::= FROM seltablist */ 110063 case 131: /* from ::= FROM seltablist */ 109991 { 110064 { 109992 yygotominor.yy259 = yymsp[0].minor.yy259; | 110065 yygotominor.yy347 = yymsp[0].minor.yy347; 109993 sqlite3SrcListShiftJoinType(yygotominor.yy259); | 110066 sqlite3SrcListShiftJoinType(yygotominor.yy347); 109994 } 110067 } 109995 break; 110068 break; 109996 case 132: /* stl_prefix ::= seltablist joinop */ 110069 case 132: /* stl_prefix ::= seltablist joinop */ 109997 { 110070 { 109998 yygotominor.yy259 = yymsp[-1].minor.yy259; | 110071 yygotominor.yy347 = yymsp[-1].minor.yy347; 109999 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy25 | 110072 if( ALWAYS(yygotominor.yy347 && yygotominor.yy347->nSrc>0) ) yygotominor.yy34 110000 } 110073 } 110001 break; 110074 break; 110002 case 133: /* stl_prefix ::= */ 110075 case 133: /* stl_prefix ::= */ 110003 {yygotominor.yy259 = 0;} | 110076 {yygotominor.yy347 = 0;} 110004 break; 110077 break; 110005 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using 110078 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using 110006 { 110079 { 110007 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259, | 110080 yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347, 110008 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0); | 110081 sqlite3SrcListIndexedBy(pParse, yygotominor.yy347, &yymsp[-2].minor.yy0); 110009 } 110082 } 110010 break; 110083 break; 110011 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ 110084 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ 110012 { 110085 { 110013 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy25 | 110086 yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy34 110014 } 110087 } 110015 break; 110088 break; 110016 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_op 110089 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_op 110017 { 110090 { 110018 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor. | 110091 if( yymsp[-6].minor.yy347==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor. 110019 yygotominor.yy259 = yymsp[-4].minor.yy259; | 110092 yygotominor.yy347 = yymsp[-4].minor.yy347; 110020 }else{ 110093 }else{ 110021 Select *pSubquery; 110094 Select *pSubquery; 110022 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259); | 110095 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy347); 110023 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0) | 110096 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy347,0,0,0,0,0,0,0) 110024 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy | 110097 yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy 110025 } 110098 } 110026 } 110099 } 110027 break; 110100 break; 110028 case 137: /* dbnm ::= */ 110101 case 137: /* dbnm ::= */ 110029 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); 110102 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); 110030 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} 110103 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} 110031 break; 110104 break; 110032 case 139: /* fullname ::= nm dbnm */ 110105 case 139: /* fullname ::= nm dbnm */ 110033 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yym | 110106 {yygotominor.yy347 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yym 110034 break; 110107 break; 110035 case 140: /* joinop ::= COMMA|JOIN */ 110108 case 140: /* joinop ::= COMMA|JOIN */ 110036 { yygotominor.yy4 = JT_INNER; } | 110109 { yygotominor.yy392 = JT_INNER; } 110037 break; 110110 break; 110038 case 141: /* joinop ::= JOIN_KW JOIN */ 110111 case 141: /* joinop ::= JOIN_KW JOIN */ 110039 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } | 110112 { yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } 110040 break; 110113 break; 110041 case 142: /* joinop ::= JOIN_KW nm JOIN */ 110114 case 142: /* joinop ::= JOIN_KW nm JOIN */ 110042 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor | 110115 { yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].min 110043 break; 110116 break; 110044 case 143: /* joinop ::= JOIN_KW nm nm JOIN */ 110117 case 143: /* joinop ::= JOIN_KW nm nm JOIN */ 110045 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor | 110118 { yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].min 110046 break; 110119 break; 110047 case 144: /* on_opt ::= ON expr */ 110120 case 144: /* on_opt ::= ON expr */ 110048 case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155); < 110049 case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162); | 110121 case 161: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==161); 110050 case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169); | 110122 case 168: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==168); 110051 case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235); | 110123 case 234: /* case_else ::= ELSE expr */ yytestcase(yyruleno==234); 110052 case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237); | 110124 case 236: /* case_operand ::= expr */ yytestcase(yyruleno==236); 110053 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;} | 110125 {yygotominor.yy122 = yymsp[0].minor.yy342.pExpr;} 110054 break; 110126 break; 110055 case 145: /* on_opt ::= */ 110127 case 145: /* on_opt ::= */ 110056 case 161: /* having_opt ::= */ yytestcase(yyruleno==161); | 110128 case 160: /* having_opt ::= */ yytestcase(yyruleno==160); 110057 case 168: /* where_opt ::= */ yytestcase(yyruleno==168); | 110129 case 167: /* where_opt ::= */ yytestcase(yyruleno==167); 110058 case 236: /* case_else ::= */ yytestcase(yyruleno==236); | 110130 case 235: /* case_else ::= */ yytestcase(yyruleno==235); 110059 case 238: /* case_operand ::= */ yytestcase(yyruleno==238); | 110131 case 237: /* case_operand ::= */ yytestcase(yyruleno==237); 110060 {yygotominor.yy314 = 0;} | 110132 {yygotominor.yy122 = 0;} 110061 break; 110133 break; 110062 case 148: /* indexed_opt ::= NOT INDEXED */ 110134 case 148: /* indexed_opt ::= NOT INDEXED */ 110063 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} 110135 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} 110064 break; 110136 break; 110065 case 149: /* using_opt ::= USING LP inscollist RP */ 110137 case 149: /* using_opt ::= USING LP inscollist RP */ 110066 case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==1 | 110138 case 180: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==1 110067 {yygotominor.yy384 = yymsp[-1].minor.yy384;} | 110139 {yygotominor.yy180 = yymsp[-1].minor.yy180;} 110068 break; 110140 break; 110069 case 150: /* using_opt ::= */ 110141 case 150: /* using_opt ::= */ 110070 case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180); | 110142 case 179: /* inscollist_opt ::= */ yytestcase(yyruleno==179); 110071 {yygotominor.yy384 = 0;} | 110143 {yygotominor.yy180 = 0;} 110072 break; 110144 break; 110073 case 152: /* orderby_opt ::= ORDER BY sortlist */ 110145 case 152: /* orderby_opt ::= ORDER BY sortlist */ 110074 case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==16 | 110146 case 159: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==15 110075 case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239); | 110147 case 238: /* exprlist ::= nexprlist */ yytestcase(yyruleno==238); 110076 {yygotominor.yy322 = yymsp[0].minor.yy322;} | 110148 {yygotominor.yy442 = yymsp[0].minor.yy442;} 110077 break; 110149 break; 110078 case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */ | 110150 case 153: /* sortlist ::= sortlist COMMA expr sortorder */ 110079 { 110151 { 110080 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[- | 110152 yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442,yymsp[- 110081 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortO | 110153 if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortO 110082 } 110154 } 110083 break; 110155 break; 110084 case 154: /* sortlist ::= sortitem sortorder */ | 110156 case 154: /* sortlist ::= expr sortorder */ 110085 { 110157 { 110086 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); | 110158 yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy342.pExpr 110087 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0 | 110159 if( yygotominor.yy442 && ALWAYS(yygotominor.yy442->a) ) yygotominor.yy442->a[0 110088 } 110160 } 110089 break; 110161 break; 110090 case 156: /* sortorder ::= ASC */ | 110162 case 155: /* sortorder ::= ASC */ 110091 case 158: /* sortorder ::= */ yytestcase(yyruleno==158); | 110163 case 157: /* sortorder ::= */ yytestcase(yyruleno==157); 110092 {yygotominor.yy4 = SQLITE_SO_ASC;} | 110164 {yygotominor.yy392 = SQLITE_SO_ASC;} 110093 break; 110165 break; 110094 case 157: /* sortorder ::= DESC */ | 110166 case 156: /* sortorder ::= DESC */ 110095 {yygotominor.yy4 = SQLITE_SO_DESC;} | 110167 {yygotominor.yy392 = SQLITE_SO_DESC;} 110096 break; 110168 break; 110097 case 163: /* limit_opt ::= */ | 110169 case 162: /* limit_opt ::= */ 110098 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;} | 110170 {yygotominor.yy64.pLimit = 0; yygotominor.yy64.pOffset = 0;} 110099 break; 110171 break; 110100 case 164: /* limit_opt ::= LIMIT expr */ | 110172 case 163: /* limit_opt ::= LIMIT expr */ 110101 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffse | 110173 {yygotominor.yy64.pLimit = yymsp[0].minor.yy342.pExpr; yygotominor.yy64.pOffset 110102 break; 110174 break; 110103 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */ | 110175 case 164: /* limit_opt ::= LIMIT expr OFFSET expr */ 110104 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffs | 110176 {yygotominor.yy64.pLimit = yymsp[-2].minor.yy342.pExpr; yygotominor.yy64.pOffset 110105 break; 110177 break; 110106 case 166: /* limit_opt ::= LIMIT expr COMMA expr */ | 110178 case 165: /* limit_opt ::= LIMIT expr COMMA expr */ 110107 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLim | 110179 {yygotominor.yy64.pOffset = yymsp[-2].minor.yy342.pExpr; yygotominor.yy64.pLimit 110108 break; 110180 break; 110109 case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ | 110181 case 166: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ 110110 { 110182 { 110111 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0); | 110183 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy347, &yymsp[-1].minor.yy0); 110112 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314); | 110184 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy347,yymsp[0].minor.yy122); 110113 } 110185 } 110114 break; 110186 break; 110115 case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_ | 110187 case 169: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_ 110116 { 110188 { 110117 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0); | 110189 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy347, &yymsp[-3].minor.yy0); 110118 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); | 110190 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy442,"set list"); 110119 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].mino | 110191 sqlite3Update(pParse,yymsp[-4].minor.yy347,yymsp[-1].minor.yy442,yymsp[0].mino 110120 } 110192 } 110121 break; 110193 break; 110122 case 171: /* setlist ::= setlist COMMA nm EQ expr */ | 110194 case 170: /* setlist ::= setlist COMMA nm EQ expr */ 110123 { 110195 { 110124 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp | 110196 yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy442, yymsp 110125 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); | 110197 sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); 110126 } 110198 } 110127 break; 110199 break; 110128 case 172: /* setlist ::= nm EQ expr */ | 110200 case 171: /* setlist ::= nm EQ expr */ 110129 { 110201 { 110130 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExp | 110202 yygotominor.yy442 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy342.pExp 110131 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); | 110203 sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); 110132 } 110204 } 110133 break; 110205 break; 110134 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP ite | 110206 case 172: /* cmd ::= insert_cmd INTO fullname inscollist_opt valuelist */ 110135 {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4 | 110207 {sqlite3Insert(pParse, yymsp[-2].minor.yy347, yymsp[0].minor.yy487.pList, yymsp[ 110136 break; 110208 break; 110137 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ | 110209 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ 110138 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1] | 110210 {sqlite3Insert(pParse, yymsp[-2].minor.yy347, 0, yymsp[0].minor.yy159, yymsp[-1] 110139 break; 110211 break; 110140 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUE | 110212 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUE 110141 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp | 110213 {sqlite3Insert(pParse, yymsp[-3].minor.yy347, 0, 0, yymsp[-2].minor.yy180, yymsp 110142 break; 110214 break; 110143 case 176: /* insert_cmd ::= INSERT orconf */ | 110215 case 175: /* insert_cmd ::= INSERT orconf */ 110144 {yygotominor.yy210 = yymsp[0].minor.yy210;} | 110216 {yygotominor.yy258 = yymsp[0].minor.yy258;} 110145 break; 110217 break; 110146 case 177: /* insert_cmd ::= REPLACE */ | 110218 case 176: /* insert_cmd ::= REPLACE */ 110147 {yygotominor.yy210 = OE_Replace;} | 110219 {yygotominor.yy258 = OE_Replace;} 110148 break; 110220 break; 110149 case 178: /* itemlist ::= itemlist COMMA expr */ | 110221 case 177: /* valuelist ::= VALUES LP nexprlist RP */ 110150 case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==24 < > 110222 { 110151 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0] | 110223 yygotominor.yy487.pList = yymsp[-1].minor.yy442; > 110224 yygotominor.yy487.pSelect = 0; > 110225 } 110152 break; 110226 break; 110153 case 179: /* itemlist ::= expr */ < 110154 case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242); < 110155 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr); | 110227 case 178: /* valuelist ::= valuelist COMMA LP exprlist RP */ > 110228 { > 110229 Select *pRight = sqlite3SelectNew(pParse, yymsp[-1].minor.yy442, 0, 0, 0, 0, 0 > 110230 if( yymsp[-4].minor.yy487.pList ){ > 110231 yymsp[-4].minor.yy487.pSelect = sqlite3SelectNew(pParse, yymsp[-4].minor.yy4 > 110232 yymsp[-4].minor.yy487.pList = 0; > 110233 } > 110234 yygotominor.yy487.pList = 0; > 110235 if( yymsp[-4].minor.yy487.pSelect==0 || pRight==0 ){ > 110236 sqlite3SelectDelete(pParse->db, pRight); > 110237 sqlite3SelectDelete(pParse->db, yymsp[-4].minor.yy487.pSelect); > 110238 yygotominor.yy487.pSelect = 0; > 110239 }else{ > 110240 pRight->op = TK_ALL; > 110241 pRight->pPrior = yymsp[-4].minor.yy487.pSelect; > 110242 pRight->selFlags |= SF_Values; > 110243 pRight->pPrior->selFlags |= SF_Values; > 110244 yygotominor.yy487.pSelect = pRight; > 110245 } > 110246 } 110156 break; 110247 break; 110157 case 182: /* inscollist ::= inscollist COMMA nm */ | 110248 case 181: /* inscollist ::= inscollist COMMA nm */ 110158 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp | 110249 {yygotominor.yy180 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy180,&yymsp 110159 break; 110250 break; 110160 case 183: /* inscollist ::= nm */ | 110251 case 182: /* inscollist ::= nm */ 110161 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} | 110252 {yygotominor.yy180 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} 110162 break; 110253 break; 110163 case 184: /* expr ::= term */ | 110254 case 183: /* expr ::= term */ 110164 {yygotominor.yy118 = yymsp[0].minor.yy118;} | 110255 {yygotominor.yy342 = yymsp[0].minor.yy342;} 110165 break; 110256 break; 110166 case 185: /* expr ::= LP expr RP */ | 110257 case 184: /* expr ::= LP expr RP */ 110167 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy1 < > 110258 {yygotominor.yy342.pExpr = yymsp[-1].minor.yy342.pExpr; spanSet(&yygotominor.yy3 110168 break; 110259 break; 110169 case 186: /* term ::= NULL */ | 110260 case 185: /* term ::= NULL */ 110170 case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191); | 110261 case 190: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==190); 110171 case 192: /* term ::= STRING */ yytestcase(yyruleno==192); | 110262 case 191: /* term ::= STRING */ yytestcase(yyruleno==191); 110172 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} | 110263 {spanExpr(&yygotominor.yy342, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} 110173 break; 110264 break; 110174 case 187: /* expr ::= id */ | 110265 case 186: /* expr ::= id */ 110175 case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188); | 110266 case 187: /* expr ::= JOIN_KW */ yytestcase(yyruleno==187); 110176 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);} | 110267 {spanExpr(&yygotominor.yy342, pParse, TK_ID, &yymsp[0].minor.yy0);} 110177 break; 110268 break; 110178 case 189: /* expr ::= nm DOT nm */ | 110269 case 188: /* expr ::= nm DOT nm */ 110179 { 110270 { 110180 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 110271 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 110181 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); 110272 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); 110182 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); | 110273 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); 110183 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); | 110274 spanSet(&yygotominor.yy342,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); 110184 } 110275 } 110185 break; 110276 break; 110186 case 190: /* expr ::= nm DOT nm DOT nm */ | 110277 case 189: /* expr ::= nm DOT nm DOT nm */ 110187 { 110278 { 110188 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); 110279 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); 110189 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 110280 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 110190 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); 110281 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); 110191 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); 110282 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); 110192 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); | 110283 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); 110193 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); | 110284 spanSet(&yygotominor.yy342,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); 110194 } 110285 } 110195 break; 110286 break; 110196 case 193: /* expr ::= REGISTER */ | 110287 case 192: /* expr ::= REGISTER */ 110197 { 110288 { 110198 /* When doing a nested parse, one can include terms in an expression 110289 /* When doing a nested parse, one can include terms in an expression 110199 ** that look like this: #1 #2 ... These terms refer to registers 110290 ** that look like this: #1 #2 ... These terms refer to registers 110200 ** in the virtual machine. #N is the N-th register. */ 110291 ** in the virtual machine. #N is the N-th register. */ 110201 if( pParse->nested==0 ){ 110292 if( pParse->nested==0 ){ 110202 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0); 110293 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0); 110203 yygotominor.yy118.pExpr = 0; | 110294 yygotominor.yy342.pExpr = 0; 110204 }else{ 110295 }else{ 110205 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0]. | 110296 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0]. 110206 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yyg | 110297 if( yygotominor.yy342.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yyg 110207 } 110298 } 110208 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); | 110299 spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); 110209 } 110300 } 110210 break; 110301 break; 110211 case 194: /* expr ::= VARIABLE */ | 110302 case 193: /* expr ::= VARIABLE */ 110212 { 110303 { 110213 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); | 110304 spanExpr(&yygotominor.yy342, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); 110214 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr); | 110305 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy342.pExpr); 110215 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); | 110306 spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); 110216 } 110307 } 110217 break; 110308 break; 110218 case 195: /* expr ::= expr COLLATE ids */ | 110309 case 194: /* expr ::= expr COLLATE ids */ 110219 { 110310 { 110220 yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy | 110311 yygotominor.yy342.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy 110221 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; | 110312 yygotominor.yy342.zStart = yymsp[-2].minor.yy342.zStart; 110222 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; | 110313 yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; 110223 } 110314 } 110224 break; 110315 break; 110225 case 196: /* expr ::= CAST LP expr AS typetoken RP */ | 110316 case 195: /* expr ::= CAST LP expr AS typetoken RP */ 110226 { 110317 { 110227 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118. | 110318 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy342. 110228 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); | 110319 spanSet(&yygotominor.yy342,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); 110229 } 110320 } 110230 break; 110321 break; 110231 case 197: /* expr ::= ID LP distinct exprlist RP */ | 110322 case 196: /* expr ::= ID LP distinct exprlist RP */ 110232 { 110323 { 110233 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[S | 110324 if( yymsp[-1].minor.yy442 && yymsp[-1].minor.yy442->nExpr>pParse->db->aLimit[S 110234 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].mino 110325 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].mino 110235 } 110326 } 110236 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, & | 110327 yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy442, & 110237 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); | 110328 spanSet(&yygotominor.yy342,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); 110238 if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){ | 110329 if( yymsp[-2].minor.yy392 && yygotominor.yy342.pExpr ){ 110239 yygotominor.yy118.pExpr->flags |= EP_Distinct; | 110330 yygotominor.yy342.pExpr->flags |= EP_Distinct; 110240 } 110331 } 110241 } 110332 } 110242 break; 110333 break; 110243 case 198: /* expr ::= ID LP STAR RP */ | 110334 case 197: /* expr ::= ID LP STAR RP */ 110244 { 110335 { 110245 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0) | 110336 yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0) 110246 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); | 110337 spanSet(&yygotominor.yy342,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); 110247 } 110338 } 110248 break; 110339 break; 110249 case 199: /* term ::= CTIME_KW */ | 110340 case 198: /* term ::= CTIME_KW */ 110250 { 110341 { 110251 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are 110342 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are 110252 ** treated as functions that return constants */ 110343 ** treated as functions that return constants */ 110253 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); | 110344 yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); 110254 if( yygotominor.yy118.pExpr ){ | 110345 if( yygotominor.yy342.pExpr ){ 110255 yygotominor.yy118.pExpr->op = TK_CONST_FUNC; | 110346 yygotominor.yy342.pExpr->op = TK_CONST_FUNC; 110256 } 110347 } 110257 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); | 110348 spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); 110258 } 110349 } 110259 break; 110350 break; 110260 case 200: /* expr ::= expr AND expr */ | 110351 case 199: /* expr ::= expr AND expr */ 110261 case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201); | 110352 case 200: /* expr ::= expr OR expr */ yytestcase(yyruleno==200); 110262 case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202); | 110353 case 201: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==201); 110263 case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203); | 110354 case 202: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==202); 110264 case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(y | 110355 case 203: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(y 110265 case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205); | 110356 case 204: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==204); 110266 case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206 | 110357 case 205: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==205 110267 case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207); | 110358 case 206: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==206); 110268 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118 | 110359 {spanBinaryExpr(&yygotominor.yy342,pParse,yymsp[-1].major,&yymsp[-2].minor.yy342 110269 break; 110360 break; 110270 case 208: /* likeop ::= LIKE_KW */ | 110361 case 207: /* likeop ::= LIKE_KW */ 110271 case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210); | 110362 case 209: /* likeop ::= MATCH */ yytestcase(yyruleno==209); 110272 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;} | 110363 {yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.not = 0;} 110273 break; 110364 break; 110274 case 209: /* likeop ::= NOT LIKE_KW */ | 110365 case 208: /* likeop ::= NOT LIKE_KW */ 110275 case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211); | 110366 case 210: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==210); 110276 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;} | 110367 {yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.not = 1;} 110277 break; 110368 break; 110278 case 212: /* expr ::= expr likeop expr */ | 110369 case 211: /* expr ::= expr likeop expr */ 110279 { 110370 { 110280 ExprList *pList; 110371 ExprList *pList; 110281 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr); | 110372 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy342.pExpr); 110282 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr); | 110373 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy342.pExpr); 110283 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor. | 110374 yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor. 110284 if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, | 110375 if( yymsp[-1].minor.yy318.not ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, 110285 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; | 110376 yygotominor.yy342.zStart = yymsp[-2].minor.yy342.zStart; 110286 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; | 110377 yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; 110287 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; | 110378 if( yygotominor.yy342.pExpr ) yygotominor.yy342.pExpr->flags |= EP_InfixFunc; 110288 } 110379 } 110289 break; 110380 break; 110290 case 213: /* expr ::= expr likeop expr ESCAPE expr */ | 110381 case 212: /* expr ::= expr likeop expr ESCAPE expr */ 110291 { 110382 { 110292 ExprList *pList; 110383 ExprList *pList; 110293 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); | 110384 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExpr); 110294 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr); | 110385 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy342.pExpr); 110295 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); | 110386 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy342.pExpr); 110296 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor. | 110387 yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor. 110297 if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, | 110388 if( yymsp[-3].minor.yy318.not ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, 110298 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; | 110389 yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; 110299 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; | 110390 yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; 110300 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; | 110391 if( yygotominor.yy342.pExpr ) yygotominor.yy342.pExpr->flags |= EP_InfixFunc; 110301 } 110392 } 110302 break; 110393 break; 110303 case 214: /* expr ::= expr ISNULL|NOTNULL */ | 110394 case 213: /* expr ::= expr ISNULL|NOTNULL */ 110304 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy11 | 110395 {spanUnaryPostfix(&yygotominor.yy342,pParse,yymsp[0].major,&yymsp[-1].minor.yy34 110305 break; 110396 break; 110306 case 215: /* expr ::= expr NOT NULL */ | 110397 case 214: /* expr ::= expr NOT NULL */ 110307 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&y | 110398 {spanUnaryPostfix(&yygotominor.yy342,pParse,TK_NOTNULL,&yymsp[-2].minor.yy342,&y 110308 break; 110399 break; 110309 case 216: /* expr ::= expr IS expr */ | 110400 case 215: /* expr ::= expr IS expr */ 110310 { 110401 { 110311 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0 | 110402 spanBinaryExpr(&yygotominor.yy342,pParse,TK_IS,&yymsp[-2].minor.yy342,&yymsp[0 110312 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExp | 110403 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy342.pExpr, yygotominor.yy342.pExp 110313 } 110404 } 110314 break; 110405 break; 110315 case 217: /* expr ::= expr IS NOT expr */ | 110406 case 216: /* expr ::= expr IS NOT expr */ 110316 { 110407 { 110317 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yyms | 110408 spanBinaryExpr(&yygotominor.yy342,pParse,TK_ISNOT,&yymsp[-3].minor.yy342,&yyms 110318 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExp | 110409 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy342.pExpr, yygotominor.yy342.pExp 110319 } 110410 } 110320 break; 110411 break; 110321 case 218: /* expr ::= NOT expr */ | 110412 case 217: /* expr ::= NOT expr */ 110322 case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219); | 110413 case 218: /* expr ::= BITNOT expr */ yytestcase(yyruleno==218); 110323 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118 | 110414 {spanUnaryPrefix(&yygotominor.yy342,pParse,yymsp[-1].major,&yymsp[0].minor.yy342 110324 break; 110415 break; 110325 case 220: /* expr ::= MINUS expr */ | 110416 case 219: /* expr ::= MINUS expr */ 110326 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yyms | 110417 {spanUnaryPrefix(&yygotominor.yy342,pParse,TK_UMINUS,&yymsp[0].minor.yy342,&yyms 110327 break; 110418 break; 110328 case 221: /* expr ::= PLUS expr */ | 110419 case 220: /* expr ::= PLUS expr */ 110329 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp | 110420 {spanUnaryPrefix(&yygotominor.yy342,pParse,TK_UPLUS,&yymsp[0].minor.yy342,&yymsp 110330 break; 110421 break; 110331 case 224: /* expr ::= expr between_op expr AND expr */ | 110422 case 223: /* expr ::= expr between_op expr AND expr */ 110332 { 110423 { 110333 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr) | 110424 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExpr) 110334 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); | 110425 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy342.pExpr); 110335 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy1 | 110426 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy3 110336 if( yygotominor.yy118.pExpr ){ | 110427 if( yygotominor.yy342.pExpr ){ 110337 yygotominor.yy118.pExpr->x.pList = pList; | 110428 yygotominor.yy342.pExpr->x.pList = pList; 110338 }else{ 110429 }else{ 110339 sqlite3ExprListDelete(pParse->db, pList); 110430 sqlite3ExprListDelete(pParse->db, pList); 110340 } 110431 } 110341 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NO | 110432 if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_ 110342 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; | 110433 yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; 110343 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; | 110434 yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; 110344 } 110435 } 110345 break; 110436 break; 110346 case 227: /* expr ::= expr in_op LP exprlist RP */ | 110437 case 226: /* expr ::= expr in_op LP exprlist RP */ 110347 { 110438 { 110348 if( yymsp[-1].minor.yy322==0 ){ | 110439 if( yymsp[-1].minor.yy442==0 ){ 110349 /* Expressions of the form 110440 /* Expressions of the form 110350 ** 110441 ** 110351 ** expr1 IN () 110442 ** expr1 IN () 110352 ** expr1 NOT IN () 110443 ** expr1 NOT IN () 110353 ** 110444 ** 110354 ** simplify to constants 0 (false) and 1 (true), respectively, 110445 ** simplify to constants 0 (false) and 1 (true), respectively, 110355 ** regardless of the value of expr1. 110446 ** regardless of the value of expr1. 110356 */ 110447 */ 110357 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3I | 110448 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3I 110358 sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy118.pExpr); | 110449 sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy342.pExpr); 110359 }else{ 110450 }else{ 110360 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy11 | 110451 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy34 110361 if( yygotominor.yy118.pExpr ){ | 110452 if( yygotominor.yy342.pExpr ){ 110362 yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy322; | 110453 yygotominor.yy342.pExpr->x.pList = yymsp[-1].minor.yy442; 110363 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); | 110454 sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); 110364 }else{ 110455 }else{ 110365 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322); | 110456 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy442); 110366 } 110457 } 110367 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, T | 110458 if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, 110368 } 110459 } 110369 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; | 110460 yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; 110370 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; | 110461 yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; 110371 } 110462 } 110372 break; 110463 break; 110373 case 228: /* expr ::= LP select RP */ | 110464 case 227: /* expr ::= LP select RP */ 110374 { 110465 { 110375 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); | 110466 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); 110376 if( yygotominor.yy118.pExpr ){ | 110467 if( yygotominor.yy342.pExpr ){ 110377 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; | 110468 yygotominor.yy342.pExpr->x.pSelect = yymsp[-1].minor.yy159; 110378 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); | 110469 ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); 110379 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); | 110470 sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); 110380 }else{ 110471 }else{ 110381 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); | 110472 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); 110382 } 110473 } 110383 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z; | 110474 yygotominor.yy342.zStart = yymsp[-2].minor.yy0.z; 110384 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; | 110475 yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; 110385 } 110476 } 110386 break; 110477 break; 110387 case 229: /* expr ::= expr in_op LP select RP */ | 110478 case 228: /* expr ::= expr in_op LP select RP */ 110388 { 110479 { 110389 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118. | 110480 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy342. 110390 if( yygotominor.yy118.pExpr ){ | 110481 if( yygotominor.yy342.pExpr ){ 110391 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; | 110482 yygotominor.yy342.pExpr->x.pSelect = yymsp[-1].minor.yy159; 110392 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); | 110483 ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); 110393 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); | 110484 sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); 110394 }else{ 110485 }else{ 110395 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); | 110486 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); 110396 } 110487 } 110397 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_ | 110488 if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, T 110398 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; | 110489 yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; 110399 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; | 110490 yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; 110400 } 110491 } 110401 break; 110492 break; 110402 case 230: /* expr ::= expr in_op nm dbnm */ | 110493 case 229: /* expr ::= expr in_op nm dbnm */ 110403 { 110494 { 110404 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yym 110495 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yym 110405 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118. | 110496 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy342. 110406 if( yygotominor.yy118.pExpr ){ | 110497 if( yygotominor.yy342.pExpr ){ 110407 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0 | 110498 yygotominor.yy342.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0 110408 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); | 110499 ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); 110409 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); | 110500 sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); 110410 }else{ 110501 }else{ 110411 sqlite3SrcListDelete(pParse->db, pSrc); 110502 sqlite3SrcListDelete(pParse->db, pSrc); 110412 } 110503 } 110413 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_ | 110504 if( yymsp[-2].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, T 110414 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart; | 110505 yygotominor.yy342.zStart = yymsp[-3].minor.yy342.zStart; 110415 yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[ | 110506 yygotominor.yy342.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[ 110416 } 110507 } 110417 break; 110508 break; 110418 case 231: /* expr ::= EXISTS LP select RP */ | 110509 case 230: /* expr ::= EXISTS LP select RP */ 110419 { 110510 { 110420 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0) | 110511 Expr *p = yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0) 110421 if( p ){ 110512 if( p ){ 110422 p->x.pSelect = yymsp[-1].minor.yy387; | 110513 p->x.pSelect = yymsp[-1].minor.yy159; 110423 ExprSetProperty(p, EP_xIsSelect); 110514 ExprSetProperty(p, EP_xIsSelect); 110424 sqlite3ExprSetHeight(pParse, p); 110515 sqlite3ExprSetHeight(pParse, p); 110425 }else{ 110516 }else{ 110426 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); | 110517 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); 110427 } 110518 } 110428 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; | 110519 yygotominor.yy342.zStart = yymsp[-3].minor.yy0.z; 110429 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; | 110520 yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; 110430 } 110521 } 110431 break; 110522 break; 110432 case 232: /* expr ::= CASE case_operand case_exprlist case_else END */ | 110523 case 231: /* expr ::= CASE case_operand case_exprlist case_else END */ 110433 { 110524 { 110434 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, | 110525 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy122, 110435 if( yygotominor.yy118.pExpr ){ | 110526 if( yygotominor.yy342.pExpr ){ 110436 yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322; | 110527 yygotominor.yy342.pExpr->x.pList = yymsp[-2].minor.yy442; 110437 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); | 110528 sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); 110438 }else{ 110529 }else{ 110439 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); | 110530 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy442); 110440 } 110531 } 110441 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z; | 110532 yygotominor.yy342.zStart = yymsp[-4].minor.yy0.z; 110442 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; | 110533 yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; 110443 } 110534 } 110444 break; 110535 break; 110445 case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ | 110536 case 232: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ 110446 { 110537 { 110447 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[ | 110538 yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, yymsp[ 110448 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].m | 110539 yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].m 110449 } 110540 } 110450 break; 110541 break; 110451 case 234: /* case_exprlist ::= WHEN expr THEN expr */ | 110542 case 233: /* case_exprlist ::= WHEN expr THEN expr */ 110452 { 110543 { 110453 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExp | 110544 yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExp 110454 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].m | 110545 yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].m 110455 } 110546 } 110456 break; 110547 break; > 110548 case 240: /* nexprlist ::= nexprlist COMMA expr */ > 110549 {yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy442,yymsp[0] > 110550 break; > 110551 case 241: /* nexprlist ::= expr */ > 110552 {yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy342.pExpr); > 110553 break; 110457 case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm L | 110554 case 242: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm L 110458 { 110555 { 110459 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, 110556 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, 110460 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), | 110557 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), 110461 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, | 110558 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, 110462 } 110559 } 110463 break; 110560 break; 110464 case 244: /* uniqueflag ::= UNIQUE */ | 110561 case 243: /* uniqueflag ::= UNIQUE */ 110465 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298); | 110562 case 296: /* raisetype ::= ABORT */ yytestcase(yyruleno==296); 110466 {yygotominor.yy4 = OE_Abort;} | 110563 {yygotominor.yy392 = OE_Abort;} 110467 break; 110564 break; 110468 case 245: /* uniqueflag ::= */ | 110565 case 244: /* uniqueflag ::= */ 110469 {yygotominor.yy4 = OE_None;} | 110566 {yygotominor.yy392 = OE_None;} 110470 break; 110567 break; 110471 case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */ | 110568 case 247: /* idxlist ::= idxlist COMMA nm collate sortorder */ 110472 { 110569 { 110473 Expr *p = 0; 110570 Expr *p = 0; 110474 if( yymsp[-1].minor.yy0.n>0 ){ 110571 if( yymsp[-1].minor.yy0.n>0 ){ 110475 p = sqlite3Expr(pParse->db, TK_COLUMN, 0); 110572 p = sqlite3Expr(pParse->db, TK_COLUMN, 0); 110476 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); 110573 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); 110477 } 110574 } 110478 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p); | 110575 yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, p); 110479 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1); | 110576 sqlite3ExprListSetName(pParse,yygotominor.yy442,&yymsp[-2].minor.yy0,1); 110480 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); | 110577 sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index"); 110481 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortO | 110578 if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortO 110482 } 110579 } 110483 break; 110580 break; 110484 case 249: /* idxlist ::= nm collate sortorder */ | 110581 case 248: /* idxlist ::= nm collate sortorder */ 110485 { 110582 { 110486 Expr *p = 0; 110583 Expr *p = 0; 110487 if( yymsp[-1].minor.yy0.n>0 ){ 110584 if( yymsp[-1].minor.yy0.n>0 ){ 110488 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); 110585 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); 110489 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); 110586 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); 110490 } 110587 } 110491 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p); | 110588 yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, p); 110492 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); | 110589 sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); 110493 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); | 110590 sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index"); 110494 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortO | 110591 if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortO 110495 } 110592 } 110496 break; 110593 break; 110497 case 250: /* collate ::= */ | 110594 case 249: /* collate ::= */ 110498 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} 110595 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} 110499 break; 110596 break; 110500 case 252: /* cmd ::= DROP INDEX ifexists fullname */ | 110597 case 251: /* cmd ::= DROP INDEX ifexists fullname */ 110501 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);} | 110598 {sqlite3DropIndex(pParse, yymsp[0].minor.yy347, yymsp[-1].minor.yy392);} 110502 break; 110599 break; 110503 case 253: /* cmd ::= VACUUM */ | 110600 case 252: /* cmd ::= VACUUM */ 110504 case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254); | 110601 case 253: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==253); 110505 {sqlite3Vacuum(pParse);} 110602 {sqlite3Vacuum(pParse);} 110506 break; 110603 break; 110507 case 255: /* cmd ::= PRAGMA nm dbnm */ | 110604 case 254: /* cmd ::= PRAGMA nm dbnm */ 110508 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} 110605 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} 110509 break; 110606 break; 110510 case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ | 110607 case 255: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ 110511 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor. 110608 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor. 110512 break; 110609 break; 110513 case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ | 110610 case 256: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ 110514 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor 110611 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor 110515 break; 110612 break; 110516 case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ | 110613 case 257: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ 110517 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor. 110614 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor. 110518 break; 110615 break; 110519 case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ | 110616 case 258: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ 110520 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor 110617 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor 110521 break; 110618 break; 110522 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ | 110619 case 268: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ 110523 { 110620 { 110524 Token all; 110621 Token all; 110525 all.z = yymsp[-3].minor.yy0.z; 110622 all.z = yymsp[-3].minor.yy0.z; 110526 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.y 110623 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.y 110527 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all); | 110624 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy327, &all); 110528 } 110625 } 110529 break; 110626 break; 110530 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_tim | 110627 case 269: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_tim 110531 { 110628 { 110532 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[ | 110629 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[ 110533 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].mino 110630 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].mino 110534 } 110631 } 110535 break; 110632 break; 110536 case 272: /* trigger_time ::= BEFORE */ | 110633 case 270: /* trigger_time ::= BEFORE */ 110537 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275); | 110634 case 273: /* trigger_time ::= */ yytestcase(yyruleno==273); 110538 { yygotominor.yy4 = TK_BEFORE; } | 110635 { yygotominor.yy392 = TK_BEFORE; } 110539 break; 110636 break; 110540 case 273: /* trigger_time ::= AFTER */ | 110637 case 271: /* trigger_time ::= AFTER */ 110541 { yygotominor.yy4 = TK_AFTER; } | 110638 { yygotominor.yy392 = TK_AFTER; } 110542 break; 110639 break; 110543 case 274: /* trigger_time ::= INSTEAD OF */ | 110640 case 272: /* trigger_time ::= INSTEAD OF */ 110544 { yygotominor.yy4 = TK_INSTEAD;} | 110641 { yygotominor.yy392 = TK_INSTEAD;} 110545 break; 110642 break; 110546 case 276: /* trigger_event ::= DELETE|INSERT */ | 110643 case 274: /* trigger_event ::= DELETE|INSERT */ 110547 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277); | 110644 case 275: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==275); 110548 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;} | 110645 {yygotominor.yy410.a = yymsp[0].major; yygotominor.yy410.b = 0;} 110549 break; 110646 break; 110550 case 278: /* trigger_event ::= UPDATE OF inscollist */ | 110647 case 276: /* trigger_event ::= UPDATE OF inscollist */ 110551 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;} | 110648 {yygotominor.yy410.a = TK_UPDATE; yygotominor.yy410.b = yymsp[0].minor.yy180;} 110552 break; 110649 break; 110553 case 281: /* when_clause ::= */ | 110650 case 279: /* when_clause ::= */ 110554 case 303: /* key_opt ::= */ yytestcase(yyruleno==303); | 110651 case 301: /* key_opt ::= */ yytestcase(yyruleno==301); 110555 { yygotominor.yy314 = 0; } | 110652 { yygotominor.yy122 = 0; } 110556 break; 110653 break; 110557 case 282: /* when_clause ::= WHEN expr */ | 110654 case 280: /* when_clause ::= WHEN expr */ 110558 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304); | 110655 case 302: /* key_opt ::= KEY expr */ yytestcase(yyruleno==302); 110559 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; } | 110656 { yygotominor.yy122 = yymsp[0].minor.yy342.pExpr; } 110560 break; 110657 break; 110561 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ | 110658 case 281: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ 110562 { 110659 { 110563 assert( yymsp[-2].minor.yy203!=0 ); | 110660 assert( yymsp[-2].minor.yy327!=0 ); 110564 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203; | 110661 yymsp[-2].minor.yy327->pLast->pNext = yymsp[-1].minor.yy327; 110565 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203; | 110662 yymsp[-2].minor.yy327->pLast = yymsp[-1].minor.yy327; 110566 yygotominor.yy203 = yymsp[-2].minor.yy203; | 110663 yygotominor.yy327 = yymsp[-2].minor.yy327; 110567 } 110664 } 110568 break; 110665 break; 110569 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */ | 110666 case 282: /* trigger_cmd_list ::= trigger_cmd SEMI */ 110570 { 110667 { 110571 assert( yymsp[-1].minor.yy203!=0 ); | 110668 assert( yymsp[-1].minor.yy327!=0 ); 110572 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203; | 110669 yymsp[-1].minor.yy327->pLast = yymsp[-1].minor.yy327; 110573 yygotominor.yy203 = yymsp[-1].minor.yy203; | 110670 yygotominor.yy327 = yymsp[-1].minor.yy327; 110574 } 110671 } 110575 break; 110672 break; 110576 case 286: /* trnm ::= nm DOT nm */ | 110673 case 284: /* trnm ::= nm DOT nm */ 110577 { 110674 { 110578 yygotominor.yy0 = yymsp[0].minor.yy0; 110675 yygotominor.yy0 = yymsp[0].minor.yy0; 110579 sqlite3ErrorMsg(pParse, 110676 sqlite3ErrorMsg(pParse, 110580 "qualified table names are not allowed on INSERT, UPDATE, and DELETE " 110677 "qualified table names are not allowed on INSERT, UPDATE, and DELETE " 110581 "statements within triggers"); 110678 "statements within triggers"); 110582 } 110679 } 110583 break; 110680 break; 110584 case 288: /* tridxby ::= INDEXED BY nm */ | 110681 case 286: /* tridxby ::= INDEXED BY nm */ 110585 { 110682 { 110586 sqlite3ErrorMsg(pParse, 110683 sqlite3ErrorMsg(pParse, 110587 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " 110684 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " 110588 "within triggers"); 110685 "within triggers"); 110589 } 110686 } 110590 break; 110687 break; 110591 case 289: /* tridxby ::= NOT INDEXED */ | 110688 case 287: /* tridxby ::= NOT INDEXED */ 110592 { 110689 { 110593 sqlite3ErrorMsg(pParse, 110690 sqlite3ErrorMsg(pParse, 110594 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " 110691 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " 110595 "within triggers"); 110692 "within triggers"); 110596 } 110693 } 110597 break; 110694 break; 110598 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_ | 110695 case 288: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_ 110599 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, | 110696 { yygotominor.yy327 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, 110600 break; 110697 break; 110601 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP | 110698 case 289: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist 110602 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, | 110699 {yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, 110603 break; 110700 break; 110604 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ | 110701 case 290: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ 110605 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, | 110702 {yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, 110606 break; 110703 break; 110607 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ | 110704 case 291: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ 110608 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, | 110705 {yygotominor.yy327 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, 110609 break; 110706 break; 110610 case 294: /* trigger_cmd ::= select */ | 110707 case 292: /* trigger_cmd ::= select */ 110611 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); | 110708 {yygotominor.yy327 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy159); 110612 break; 110709 break; 110613 case 295: /* expr ::= RAISE LP IGNORE RP */ | 110710 case 293: /* expr ::= RAISE LP IGNORE RP */ 110614 { 110711 { 110615 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); | 110712 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); 110616 if( yygotominor.yy118.pExpr ){ | 110713 if( yygotominor.yy342.pExpr ){ 110617 yygotominor.yy118.pExpr->affinity = OE_Ignore; | 110714 yygotominor.yy342.pExpr->affinity = OE_Ignore; 110618 } 110715 } 110619 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; | 110716 yygotominor.yy342.zStart = yymsp[-3].minor.yy0.z; 110620 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; | 110717 yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; 110621 } 110718 } 110622 break; 110719 break; 110623 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */ | 110720 case 294: /* expr ::= RAISE LP raisetype COMMA nm RP */ 110624 { 110721 { 110625 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].mino | 110722 yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].mino 110626 if( yygotominor.yy118.pExpr ) { | 110723 if( yygotominor.yy342.pExpr ) { 110627 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4; | 110724 yygotominor.yy342.pExpr->affinity = (char)yymsp[-3].minor.yy392; 110628 } 110725 } 110629 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z; | 110726 yygotominor.yy342.zStart = yymsp[-5].minor.yy0.z; 110630 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; | 110727 yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; 110631 } 110728 } 110632 break; 110729 break; 110633 case 297: /* raisetype ::= ROLLBACK */ | 110730 case 295: /* raisetype ::= ROLLBACK */ 110634 {yygotominor.yy4 = OE_Rollback;} | 110731 {yygotominor.yy392 = OE_Rollback;} 110635 break; 110732 break; 110636 case 299: /* raisetype ::= FAIL */ | 110733 case 297: /* raisetype ::= FAIL */ 110637 {yygotominor.yy4 = OE_Fail;} | 110734 {yygotominor.yy392 = OE_Fail;} 110638 break; 110735 break; 110639 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */ | 110736 case 298: /* cmd ::= DROP TRIGGER ifexists fullname */ 110640 { 110737 { 110641 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4); | 110738 sqlite3DropTrigger(pParse,yymsp[0].minor.yy347,yymsp[-1].minor.yy392); 110642 } 110739 } 110643 break; 110740 break; 110644 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ | 110741 case 299: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ 110645 { 110742 { 110646 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr | 110743 sqlite3Attach(pParse, yymsp[-3].minor.yy342.pExpr, yymsp[-1].minor.yy342.pExpr 110647 } 110744 } 110648 break; 110745 break; 110649 case 302: /* cmd ::= DETACH database_kw_opt expr */ | 110746 case 300: /* cmd ::= DETACH database_kw_opt expr */ 110650 { 110747 { 110651 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr); | 110748 sqlite3Detach(pParse, yymsp[0].minor.yy342.pExpr); 110652 } 110749 } 110653 break; 110750 break; 110654 case 307: /* cmd ::= REINDEX */ | 110751 case 305: /* cmd ::= REINDEX */ 110655 {sqlite3Reindex(pParse, 0, 0);} 110752 {sqlite3Reindex(pParse, 0, 0);} 110656 break; 110753 break; 110657 case 308: /* cmd ::= REINDEX nm dbnm */ | 110754 case 306: /* cmd ::= REINDEX nm dbnm */ 110658 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} 110755 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} 110659 break; 110756 break; 110660 case 309: /* cmd ::= ANALYZE */ | 110757 case 307: /* cmd ::= ANALYZE */ 110661 {sqlite3Analyze(pParse, 0, 0);} 110758 {sqlite3Analyze(pParse, 0, 0);} 110662 break; 110759 break; 110663 case 310: /* cmd ::= ANALYZE nm dbnm */ | 110760 case 308: /* cmd ::= ANALYZE nm dbnm */ 110664 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} 110761 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} 110665 break; 110762 break; 110666 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ | 110763 case 309: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ 110667 { 110764 { 110668 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0); | 110765 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy347,&yymsp[0].minor.yy0); 110669 } 110766 } 110670 break; 110767 break; 110671 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt colu | 110768 case 310: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt colu 110672 { 110769 { 110673 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); 110770 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); 110674 } 110771 } 110675 break; 110772 break; 110676 case 313: /* add_column_fullname ::= fullname */ | 110773 case 311: /* add_column_fullname ::= fullname */ 110677 { 110774 { 110678 pParse->db->lookaside.bEnabled = 0; 110775 pParse->db->lookaside.bEnabled = 0; 110679 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259); | 110776 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy347); 110680 } 110777 } 110681 break; 110778 break; 110682 case 316: /* cmd ::= create_vtab */ | 110779 case 314: /* cmd ::= create_vtab */ 110683 {sqlite3VtabFinishParse(pParse,0);} 110780 {sqlite3VtabFinishParse(pParse,0);} 110684 break; 110781 break; 110685 case 317: /* cmd ::= create_vtab LP vtabarglist RP */ | 110782 case 315: /* cmd ::= create_vtab LP vtabarglist RP */ 110686 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} 110783 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} 110687 break; 110784 break; 110688 case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */ | 110785 case 316: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm US 110689 { 110786 { 110690 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &y | 110787 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &y 110691 } 110788 } 110692 break; 110789 break; 110693 case 321: /* vtabarg ::= */ | 110790 case 319: /* vtabarg ::= */ 110694 {sqlite3VtabArgInit(pParse);} 110791 {sqlite3VtabArgInit(pParse);} 110695 break; 110792 break; 110696 case 323: /* vtabargtoken ::= ANY */ | 110793 case 321: /* vtabargtoken ::= ANY */ 110697 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324); | 110794 case 322: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==322); 110698 case 325: /* lp ::= LP */ yytestcase(yyruleno==325); | 110795 case 323: /* lp ::= LP */ yytestcase(yyruleno==323); 110699 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} 110796 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} 110700 break; 110797 break; 110701 default: 110798 default: 110702 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); 110799 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); 110703 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1); 110800 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno