Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Update the built-in SQLite to the latest 3.37.0 alpha, for testing. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
04b725d9bf814faa24b0a35255eebfc1 |
| User & Date: | drh 2021-09-06 13:06:26.550 |
Context
|
2021-09-06
| ||
| 13:22 | Expand the 'fossil wiki export --technote' interface to support technote retrieval via tag name as discussed in the chat. The query looks to match against both 'sym-TAG' and 'TAG' as technote tags are presently prefixed with 'sym-'. This identifier should be reserved for branches, however, so may be removed from technotes, at which point this query should be changed. check-in: d71b648c6c user: jamsek tags: trunk | |
| 13:06 | Update the built-in SQLite to the latest 3.37.0 alpha, for testing. check-in: 04b725d9bf user: drh tags: trunk | |
| 12:00 | Improvement to the ticket customization documentation suggested by [forum:/forumpost/31e44444cda1a7821912|forum post 31e44444cda1a7821912] check-in: 3fcdfb0cd8 user: drh tags: trunk | |
Changes
Changes to src/shell.c.
| ︙ | ︙ | |||
12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 | u8 autoEQPtest; /* autoEQP is in test mode */ u8 autoEQPtrace; /* autoEQP is in trace mode */ u8 scanstatsOn; /* True to display scan stats before each finalize */ u8 openMode; /* SHELL_OPEN_NORMAL, _APPENDVFS, or _ZIPFILE */ u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */ u8 nEqpLevel; /* Depth of the EQP output graph */ u8 eTraceType; /* SHELL_TRACE_* value for type of trace */ unsigned statsOn; /* True to display memory stats before each finalize */ unsigned mEqpLines; /* Mask of veritical lines in the EQP output graph */ int outCount; /* Revert to stdout when reaching zero */ int cnt; /* Number of records displayed so far */ int lineno; /* Line number of last line read from in */ int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */ FILE *in; /* Read commands from this stream */ | > > | 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 | u8 autoEQPtest; /* autoEQP is in test mode */ u8 autoEQPtrace; /* autoEQP is in trace mode */ u8 scanstatsOn; /* True to display scan stats before each finalize */ u8 openMode; /* SHELL_OPEN_NORMAL, _APPENDVFS, or _ZIPFILE */ u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */ u8 nEqpLevel; /* Depth of the EQP output graph */ u8 eTraceType; /* SHELL_TRACE_* value for type of trace */ u8 bSafeMode; /* True to prohibit unsafe operations */ u8 bSafeModePersist; /* The long-term value of bSafeMode */ unsigned statsOn; /* True to display memory stats before each finalize */ unsigned mEqpLines; /* Mask of veritical lines in the EQP output graph */ int outCount; /* Revert to stdout when reaching zero */ int cnt; /* Number of records displayed so far */ int lineno; /* Line number of last line read from in */ int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */ FILE *in; /* Read commands from this stream */ |
| ︙ | ︙ | |||
12111 12112 12113 12114 12115 12116 12117 12118 |
OpenSession aSession[4]; /* Array of sessions. [0] is in focus. */
#endif
} aAuxDb[5], /* Array of all database connections */
*pAuxDb; /* Currently active database connection */
int *aiIndent; /* Array of indents used in MODE_Explain */
int nIndent; /* Size of array aiIndent[] */
int iIndent; /* Index of current op in aiIndent[] */
EQPGraph sGraph; /* Information for the graphical EXPLAIN QUERY PLAN */
| > | | 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 |
OpenSession aSession[4]; /* Array of sessions. [0] is in focus. */
#endif
} aAuxDb[5], /* Array of all database connections */
*pAuxDb; /* Currently active database connection */
int *aiIndent; /* Array of indents used in MODE_Explain */
int nIndent; /* Size of array aiIndent[] */
int iIndent; /* Index of current op in aiIndent[] */
char *zNonce; /* Nonce for temporary safe-mode excapes */
EQPGraph sGraph; /* Information for the graphical EXPLAIN QUERY PLAN */
ExpertInfo expert; /* Valid if previous command was ".expert OPT..." */
};
/* Allowed values for ShellState.autoEQP
*/
#define AUTOEQP_off 0 /* Automatic EXPLAIN QUERY PLAN is off */
#define AUTOEQP_on 1 /* Automatic EQP is on */
|
| ︙ | ︙ | |||
12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 |
sqlite3_value **apVal
){
ShellState *p = (ShellState*)sqlite3_user_data(pCtx);
(void)nVal;
utf8_printf(p->out, "%s\n", sqlite3_value_text(apVal[0]));
sqlite3_result_value(pCtx, apVal[0]);
}
/*
** SQL function: edit(VALUE)
** edit(VALUE,EDITOR)
**
** These steps:
**
| > > > > > > > > > > > > > > > > > > > > > | 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 |
sqlite3_value **apVal
){
ShellState *p = (ShellState*)sqlite3_user_data(pCtx);
(void)nVal;
utf8_printf(p->out, "%s\n", sqlite3_value_text(apVal[0]));
sqlite3_result_value(pCtx, apVal[0]);
}
/*
** If in safe mode, print an error message described by the arguments
** and exit immediately.
*/
static void failIfSafeMode(
ShellState *p,
const char *zErrMsg,
...
){
if( p->bSafeMode ){
va_list ap;
char *zMsg;
va_start(ap, zErrMsg);
zMsg = sqlite3_vmprintf(zErrMsg, ap);
va_end(ap);
raw_printf(stderr, "line %d: ", p->lineno);
utf8_printf(stderr, "%s\n", zMsg);
exit(1);
}
}
/*
** SQL function: edit(VALUE)
** edit(VALUE,EDITOR)
**
** These steps:
**
|
| ︙ | ︙ | |||
12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 |
return TRUE;
}
return FALSE;
}
#endif
#ifndef SQLITE_OMIT_AUTHORIZATION
/*
** When the ".auth ON" is set, the following authorizer callback is
** invoked. It always returns SQLITE_OK.
*/
static int shellAuth(
void *pClientData,
int op,
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 |
return TRUE;
}
return FALSE;
}
#endif
#ifndef SQLITE_OMIT_AUTHORIZATION
/*
** This authorizer runs in safe mode.
*/
static int safeModeAuth(
void *pClientData,
int op,
const char *zA1,
const char *zA2,
const char *zA3,
const char *zA4
){
ShellState *p = (ShellState*)pClientData;
static const char *azProhibitedFunctions[] = {
"edit",
"fts3_tokenizer",
"load_extension",
"readfile",
"writefile",
"zipfile",
"zipfile_cds",
};
UNUSED_PARAMETER(zA2);
UNUSED_PARAMETER(zA3);
UNUSED_PARAMETER(zA4);
switch( op ){
case SQLITE_ATTACH: {
failIfSafeMode(p, "cannot run ATTACH in safe mode");
break;
}
case SQLITE_FUNCTION: {
int i;
for(i=0; i<ArraySize(azProhibitedFunctions); i++){
if( sqlite3_stricmp(zA1, azProhibitedFunctions[i])==0 ){
failIfSafeMode(p, "cannot use the %s() function in safe mode",
azProhibitedFunctions[i]);
}
}
break;
}
}
return SQLITE_OK;
}
/*
** When the ".auth ON" is set, the following authorizer callback is
** invoked. It always returns SQLITE_OK.
*/
static int shellAuth(
void *pClientData,
int op,
|
| ︙ | ︙ | |||
12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 |
if( az[i] ){
output_c_string(p->out, az[i]);
}else{
raw_printf(p->out, "NULL");
}
}
raw_printf(p->out, "\n");
return SQLITE_OK;
}
#endif
/*
** Print a schema statement. Part of MODE_Semi and MODE_Pretty output.
**
| > | 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 |
if( az[i] ){
output_c_string(p->out, az[i]);
}else{
raw_printf(p->out, "NULL");
}
}
raw_printf(p->out, "\n");
if( p->bSafeMode ) (void)safeModeAuth(pClientData, op, zA1, zA2, zA3, zA4);
return SQLITE_OK;
}
#endif
/*
** Print a schema statement. Part of MODE_Semi and MODE_Pretty output.
**
|
| ︙ | ︙ | |||
14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 | " line One value per line", " list Values delimited by \"|\"", " markdown Markdown table format", " quote Escape answers as for SQL", " table ASCII-art table", " tabs Tab-separated values", " tcl TCL list elements", ".nullvalue STRING Use STRING in place of NULL values", ".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE", " If FILE begins with '|' then open as a pipe", " --bom Put a UTF8 byte-order mark at the beginning", " -e Send output to the system text editor", " -x Send output as CSV to a spreadsheet (same as \".excel\")", #ifdef SQLITE_DEBUG | > | 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 | " line One value per line", " list Values delimited by \"|\"", " markdown Markdown table format", " quote Escape answers as for SQL", " table ASCII-art table", " tabs Tab-separated values", " tcl TCL list elements", ".nonce STRING Disable safe mode for one command if the nonce matches", ".nullvalue STRING Use STRING in place of NULL values", ".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE", " If FILE begins with '|' then open as a pipe", " --bom Put a UTF8 byte-order mark at the beginning", " -e Send output to the system text editor", " -x Send output as CSV to a spreadsheet (same as \".excel\")", #ifdef SQLITE_DEBUG |
| ︙ | ︙ | |||
15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 |
}
if( p->szMax>0 ){
sqlite3_file_control(p->db, "main", SQLITE_FCNTL_SIZE_LIMIT, &p->szMax);
}
}
#endif
}
}
/*
** Attempt to close the databaes connection. Report errors.
*/
void close_db(sqlite3 *db){
int rc = sqlite3_close(db);
| > > > | 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 |
}
if( p->szMax>0 ){
sqlite3_file_control(p->db, "main", SQLITE_FCNTL_SIZE_LIMIT, &p->szMax);
}
}
#endif
}
if( p->bSafeModePersist && p->db!=0 ){
sqlite3_set_authorizer(p->db, safeModeAuth, p);
}
}
/*
** Attempt to close the databaes connection. Report errors.
*/
void close_db(sqlite3 *db){
int rc = sqlite3_close(db);
|
| ︙ | ︙ | |||
18417 18418 18419 18420 18421 18422 18423 18424 18425 18426 18427 18428 18429 18430 18431 18432 18433 18434 18435 18436 18437 18438 18439 18440 18441 18442 18443 18444 18445 18446 18447 18448 18449 18450 18451 18452 18453 |
raw_printf(stderr, "Usage: .auth ON|OFF\n");
rc = 1;
goto meta_command_exit;
}
open_db(p, 0);
if( booleanValue(azArg[1]) ){
sqlite3_set_authorizer(p->db, shellAuth, p);
}else{
sqlite3_set_authorizer(p->db, 0, 0);
}
}else
#endif
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB)
if( c=='a' && strncmp(azArg[0], "archive", n)==0 ){
open_db(p, 0);
rc = arDotCommand(p, 0, azArg, nArg);
}else
#endif
if( (c=='b' && n>=3 && strncmp(azArg[0], "backup", n)==0)
|| (c=='s' && n>=3 && strncmp(azArg[0], "save", n)==0)
){
const char *zDestFile = 0;
const char *zDb = 0;
sqlite3 *pDest;
sqlite3_backup *pBackup;
int j;
int bAsync = 0;
const char *zVfs = 0;
for(j=1; j<nArg; j++){
const char *z = azArg[j];
if( z[0]=='-' ){
if( z[1]=='-' ) z++;
if( strcmp(z, "-append")==0 ){
zVfs = "apndvfs";
}else
| > > > > | 18489 18490 18491 18492 18493 18494 18495 18496 18497 18498 18499 18500 18501 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 18523 18524 18525 18526 18527 18528 18529 |
raw_printf(stderr, "Usage: .auth ON|OFF\n");
rc = 1;
goto meta_command_exit;
}
open_db(p, 0);
if( booleanValue(azArg[1]) ){
sqlite3_set_authorizer(p->db, shellAuth, p);
}else if( p->bSafeModePersist ){
sqlite3_set_authorizer(p->db, safeModeAuth, p);
}else{
sqlite3_set_authorizer(p->db, 0, 0);
}
}else
#endif
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB)
if( c=='a' && strncmp(azArg[0], "archive", n)==0 ){
open_db(p, 0);
failIfSafeMode(p, "cannot run .archive in safe mode");
rc = arDotCommand(p, 0, azArg, nArg);
}else
#endif
if( (c=='b' && n>=3 && strncmp(azArg[0], "backup", n)==0)
|| (c=='s' && n>=3 && strncmp(azArg[0], "save", n)==0)
){
const char *zDestFile = 0;
const char *zDb = 0;
sqlite3 *pDest;
sqlite3_backup *pBackup;
int j;
int bAsync = 0;
const char *zVfs = 0;
failIfSafeMode(p, "cannot run .%s in safe mode", azArg[0]);
for(j=1; j<nArg; j++){
const char *z = azArg[j];
if( z[0]=='-' ){
if( z[1]=='-' ) z++;
if( strcmp(z, "-append")==0 ){
zVfs = "apndvfs";
}else
|
| ︙ | ︙ | |||
18528 18529 18530 18531 18532 18533 18534 18535 18536 18537 18538 18539 18540 18541 |
** routine named test_breakpoint().
*/
if( c=='b' && n>=3 && strncmp(azArg[0], "breakpoint", n)==0 ){
test_breakpoint();
}else
if( c=='c' && strcmp(azArg[0],"cd")==0 ){
if( nArg==2 ){
#if defined(_WIN32) || defined(WIN32)
wchar_t *z = sqlite3_win32_utf8_to_unicode(azArg[1]);
rc = !SetCurrentDirectoryW(z);
sqlite3_free(z);
#else
rc = chdir(azArg[1]);
| > | 18604 18605 18606 18607 18608 18609 18610 18611 18612 18613 18614 18615 18616 18617 18618 |
** routine named test_breakpoint().
*/
if( c=='b' && n>=3 && strncmp(azArg[0], "breakpoint", n)==0 ){
test_breakpoint();
}else
if( c=='c' && strcmp(azArg[0],"cd")==0 ){
failIfSafeMode(p, "cannot run .cd in safe mode");
if( nArg==2 ){
#if defined(_WIN32) || defined(WIN32)
wchar_t *z = sqlite3_win32_utf8_to_unicode(azArg[1]);
rc = !SetCurrentDirectoryW(z);
sqlite3_free(z);
#else
rc = chdir(azArg[1]);
|
| ︙ | ︙ | |||
18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 18592 18593 18594 |
utf8_printf(stdout, "testcase-%s ok\n", p->zTestcase);
p->nCheck++;
}
sqlite3_free(zRes);
}else
if( c=='c' && strncmp(azArg[0], "clone", n)==0 ){
if( nArg==2 ){
tryToClone(p, azArg[1]);
}else{
raw_printf(stderr, "Usage: .clone FILENAME\n");
rc = 1;
}
}else
| > | 18658 18659 18660 18661 18662 18663 18664 18665 18666 18667 18668 18669 18670 18671 18672 |
utf8_printf(stdout, "testcase-%s ok\n", p->zTestcase);
p->nCheck++;
}
sqlite3_free(zRes);
}else
if( c=='c' && strncmp(azArg[0], "clone", n)==0 ){
failIfSafeMode(p, "cannot run .clone in safe mode");
if( nArg==2 ){
tryToClone(p, azArg[1]);
}else{
raw_printf(stderr, "Usage: .clone FILENAME\n");
rc = 1;
}
}else
|
| ︙ | ︙ | |||
19142 19143 19144 19145 19146 19147 19148 19149 19150 19151 19152 19153 19154 19155 |
char *zSql; /* An SQL statement */
ImportCtx sCtx; /* Reader context */
char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */
int eVerbose = 0; /* Larger for more console output */
int nSkip = 0; /* Initial lines to skip */
int useOutputMode = 1; /* Use output mode to determine separators */
memset(&sCtx, 0, sizeof(sCtx));
if( p->mode==MODE_Ascii ){
xRead = ascii_read_one_field;
}else{
xRead = csv_read_one_field;
}
for(i=1; i<nArg; i++){
| > | 19220 19221 19222 19223 19224 19225 19226 19227 19228 19229 19230 19231 19232 19233 19234 |
char *zSql; /* An SQL statement */
ImportCtx sCtx; /* Reader context */
char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */
int eVerbose = 0; /* Larger for more console output */
int nSkip = 0; /* Initial lines to skip */
int useOutputMode = 1; /* Use output mode to determine separators */
failIfSafeMode(p, "cannot run .import in safe mode");
memset(&sCtx, 0, sizeof(sCtx));
if( p->mode==MODE_Ascii ){
xRead = ascii_read_one_field;
}else{
xRead = csv_read_one_field;
}
for(i=1; i<nArg; i++){
|
| ︙ | ︙ | |||
19593 19594 19595 19596 19597 19598 19599 19600 19601 19602 19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 19624 |
lintDotCommand(p, azArg, nArg);
}else
#ifndef SQLITE_OMIT_LOAD_EXTENSION
if( c=='l' && strncmp(azArg[0], "load", n)==0 ){
const char *zFile, *zProc;
char *zErrMsg = 0;
if( nArg<2 ){
raw_printf(stderr, "Usage: .load FILE ?ENTRYPOINT?\n");
rc = 1;
goto meta_command_exit;
}
zFile = azArg[1];
zProc = nArg>=3 ? azArg[2] : 0;
open_db(p, 0);
rc = sqlite3_load_extension(p->db, zFile, zProc, &zErrMsg);
if( rc!=SQLITE_OK ){
utf8_printf(stderr, "Error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
rc = 1;
}
}else
#endif
if( c=='l' && strncmp(azArg[0], "log", n)==0 ){
if( nArg!=2 ){
raw_printf(stderr, "Usage: .log FILENAME\n");
rc = 1;
}else{
const char *zFile = azArg[1];
output_file_close(p->pLog);
p->pLog = output_file_open(zFile, 0);
| > > | 19672 19673 19674 19675 19676 19677 19678 19679 19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 |
lintDotCommand(p, azArg, nArg);
}else
#ifndef SQLITE_OMIT_LOAD_EXTENSION
if( c=='l' && strncmp(azArg[0], "load", n)==0 ){
const char *zFile, *zProc;
char *zErrMsg = 0;
failIfSafeMode(p, "cannot run .load in safe mode");
if( nArg<2 ){
raw_printf(stderr, "Usage: .load FILE ?ENTRYPOINT?\n");
rc = 1;
goto meta_command_exit;
}
zFile = azArg[1];
zProc = nArg>=3 ? azArg[2] : 0;
open_db(p, 0);
rc = sqlite3_load_extension(p->db, zFile, zProc, &zErrMsg);
if( rc!=SQLITE_OK ){
utf8_printf(stderr, "Error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
rc = 1;
}
}else
#endif
if( c=='l' && strncmp(azArg[0], "log", n)==0 ){
failIfSafeMode(p, "cannot run .log in safe mode");
if( nArg!=2 ){
raw_printf(stderr, "Usage: .log FILENAME\n");
rc = 1;
}else{
const char *zFile = azArg[1];
output_file_close(p->pLog);
p->pLog = output_file_open(zFile, 0);
|
| ︙ | ︙ | |||
19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 |
raw_printf(stderr, "Error: mode should be one of: "
"ascii box column csv html insert json line list markdown "
"quote table tabs tcl\n");
rc = 1;
}
p->cMode = p->mode;
}else
if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 ){
if( nArg==2 ){
sqlite3_snprintf(sizeof(p->nullValue), p->nullValue,
"%.*s", (int)ArraySize(p->nullValue)-1, azArg[1]);
}else{
raw_printf(stderr, "Usage: .nullvalue STRING\n");
| > > > > > > > > > > > > > | 19761 19762 19763 19764 19765 19766 19767 19768 19769 19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 19781 19782 19783 19784 19785 19786 19787 |
raw_printf(stderr, "Error: mode should be one of: "
"ascii box column csv html insert json line list markdown "
"quote table tabs tcl\n");
rc = 1;
}
p->cMode = p->mode;
}else
if( c=='n' && strcmp(azArg[0], "nonce")==0 ){
if( nArg!=2 ){
raw_printf(stderr, "Usage: .nonce NONCE\n");
rc = 1;
}else if( p->zNonce==0 || strcmp(azArg[1],p->zNonce)!=0 ){
raw_printf(stderr, "line %d: incorrect nonce: \"%s\"\n", p->lineno, azArg[1]);
exit(1);
}
p->bSafeMode = 0;
return 0; /* Return immediately to bypass the safe mode reset
** at the end of this procedure */
}else
if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 ){
if( nArg==2 ){
sqlite3_snprintf(sizeof(p->nullValue), p->nullValue,
"%.*s", (int)ArraySize(p->nullValue)-1, azArg[1]);
}else{
raw_printf(stderr, "Usage: .nullvalue STRING\n");
|
| ︙ | ︙ | |||
19772 19773 19774 19775 19776 19777 19778 |
goto meta_command_exit;
}else{
zNewFilename = sqlite3_mprintf("%s", z);
}
}
/* If a filename is specified, try to open it first */
if( zNewFilename || p->openMode==SHELL_OPEN_HEXDB ){
| | > > > > > > > | 19866 19867 19868 19869 19870 19871 19872 19873 19874 19875 19876 19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 19887 |
goto meta_command_exit;
}else{
zNewFilename = sqlite3_mprintf("%s", z);
}
}
/* If a filename is specified, try to open it first */
if( zNewFilename || p->openMode==SHELL_OPEN_HEXDB ){
if( newFlag && !p->bSafeMode ) shellDeleteFile(zNewFilename);
if( p->bSafeMode
&& p->openMode!=SHELL_OPEN_HEXDB
&& zNewFilename
&& strcmp(zNewFilename,":memory:")!=0
){
failIfSafeMode(p, "cannot open disk-based database files in safe mode");
}
p->pAuxDb->zDbFilename = zNewFilename;
open_db(p, OPEN_DB_KEEPALIVE);
if( p->db==0 ){
utf8_printf(stderr, "Error: cannot open '%s'\n", zNewFilename);
sqlite3_free(zNewFilename);
}else{
p->pAuxDb->zFreeOnClose = zNewFilename;
|
| ︙ | ︙ | |||
19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 19811 19812 19813 |
char *zFile = 0;
int bTxtMode = 0;
int i;
int eMode = 0;
int bBOM = 0;
int bOnce = 0; /* 0: .output, 1: .once, 2: .excel */
if( c=='e' ){
eMode = 'x';
bOnce = 2;
}else if( strncmp(azArg[0],"once",n)==0 ){
bOnce = 1;
}
for(i=1; i<nArg; i++){
| > | 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 |
char *zFile = 0;
int bTxtMode = 0;
int i;
int eMode = 0;
int bBOM = 0;
int bOnce = 0; /* 0: .output, 1: .once, 2: .excel */
failIfSafeMode(p, "cannot run .%s in safe mode", azArg[0]);
if( c=='e' ){
eMode = 'x';
bOnce = 2;
}else if( strncmp(azArg[0],"once",n)==0 ){
bOnce = 1;
}
for(i=1; i<nArg; i++){
|
| ︙ | ︙ | |||
20072 20073 20074 20075 20076 20077 20078 20079 20080 20081 20082 20083 20084 20085 |
if( c=='q' && strncmp(azArg[0], "quit", n)==0 ){
rc = 2;
}else
if( c=='r' && n>=3 && strncmp(azArg[0], "read", n)==0 ){
FILE *inSaved = p->in;
int savedLineno = p->lineno;
if( nArg!=2 ){
raw_printf(stderr, "Usage: .read FILE\n");
rc = 1;
goto meta_command_exit;
}
if( azArg[1][0]=='|' ){
#ifdef SQLITE_OMIT_POPEN
| > | 20174 20175 20176 20177 20178 20179 20180 20181 20182 20183 20184 20185 20186 20187 20188 |
if( c=='q' && strncmp(azArg[0], "quit", n)==0 ){
rc = 2;
}else
if( c=='r' && n>=3 && strncmp(azArg[0], "read", n)==0 ){
FILE *inSaved = p->in;
int savedLineno = p->lineno;
failIfSafeMode(p, "cannot run .read in safe mode");
if( nArg!=2 ){
raw_printf(stderr, "Usage: .read FILE\n");
rc = 1;
goto meta_command_exit;
}
if( azArg[1][0]=='|' ){
#ifdef SQLITE_OMIT_POPEN
|
| ︙ | ︙ | |||
20110 20111 20112 20113 20114 20115 20116 20117 20118 20119 20120 20121 20122 20123 |
if( c=='r' && n>=3 && strncmp(azArg[0], "restore", n)==0 ){
const char *zSrcFile;
const char *zDb;
sqlite3 *pSrc;
sqlite3_backup *pBackup;
int nTimeout = 0;
if( nArg==2 ){
zSrcFile = azArg[1];
zDb = "main";
}else if( nArg==3 ){
zSrcFile = azArg[2];
zDb = azArg[1];
}else{
| > | 20213 20214 20215 20216 20217 20218 20219 20220 20221 20222 20223 20224 20225 20226 20227 |
if( c=='r' && n>=3 && strncmp(azArg[0], "restore", n)==0 ){
const char *zSrcFile;
const char *zDb;
sqlite3 *pSrc;
sqlite3_backup *pBackup;
int nTimeout = 0;
failIfSafeMode(p, "cannot run .restore in safe mode");
if( nArg==2 ){
zSrcFile = azArg[1];
zDb = "main";
}else if( nArg==3 ){
zSrcFile = azArg[2];
zDb = azArg[1];
}else{
|
| ︙ | ︙ | |||
20359 20360 20361 20362 20363 20364 20365 20366 20367 20368 20369 20370 20371 20372 |
/* .session changeset FILE
** .session patchset FILE
** Write a changeset or patchset into a file. The file is overwritten.
*/
if( strcmp(azCmd[0],"changeset")==0 || strcmp(azCmd[0],"patchset")==0 ){
FILE *out = 0;
if( nCmd!=2 ) goto session_syntax_error;
if( pSession->p==0 ) goto session_not_open;
out = fopen(azCmd[1], "wb");
if( out==0 ){
utf8_printf(stderr, "ERROR: cannot open \"%s\" for writing\n",
azCmd[1]);
}else{
| > | 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 20477 |
/* .session changeset FILE
** .session patchset FILE
** Write a changeset or patchset into a file. The file is overwritten.
*/
if( strcmp(azCmd[0],"changeset")==0 || strcmp(azCmd[0],"patchset")==0 ){
FILE *out = 0;
failIfSafeMode(p, "cannot run \".session %s\" in safe mode", azCmd[0]);
if( nCmd!=2 ) goto session_syntax_error;
if( pSession->p==0 ) goto session_not_open;
out = fopen(azCmd[1], "wb");
if( out==0 ){
utf8_printf(stderr, "ERROR: cannot open \"%s\" for writing\n",
azCmd[1]);
}else{
|
| ︙ | ︙ | |||
20773 20774 20775 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 |
#ifndef SQLITE_NOHAVE_SYSTEM
if( c=='s'
&& (strncmp(azArg[0], "shell", n)==0 || strncmp(azArg[0],"system",n)==0)
){
char *zCmd;
int i, x;
if( nArg<2 ){
raw_printf(stderr, "Usage: .system COMMAND\n");
rc = 1;
goto meta_command_exit;
}
zCmd = sqlite3_mprintf(strchr(azArg[1],' ')==0?"%s":"\"%s\"", azArg[1]);
for(i=2; i<nArg; i++){
| > | 20878 20879 20880 20881 20882 20883 20884 20885 20886 20887 20888 20889 20890 20891 20892 |
#ifndef SQLITE_NOHAVE_SYSTEM
if( c=='s'
&& (strncmp(azArg[0], "shell", n)==0 || strncmp(azArg[0],"system",n)==0)
){
char *zCmd;
int i, x;
failIfSafeMode(p, "cannot run .%s in safe mode", azArg[0]);
if( nArg<2 ){
raw_printf(stderr, "Usage: .system COMMAND\n");
rc = 1;
goto meta_command_exit;
}
zCmd = sqlite3_mprintf(strchr(azArg[1],' ')==0?"%s":"\"%s\"", azArg[1]);
for(i=2; i<nArg; i++){
|
| ︙ | ︙ | |||
21444 21445 21446 21447 21448 21449 21450 21451 21452 21453 21454 21455 21456 21457 |
}
meta_command_exit:
if( p->outCount ){
p->outCount--;
if( p->outCount==0 ) output_reset(p);
}
return rc;
}
/*
** Return TRUE if a semicolon occurs anywhere in the first N characters
** of string z[].
*/
| > | 21550 21551 21552 21553 21554 21555 21556 21557 21558 21559 21560 21561 21562 21563 21564 |
}
meta_command_exit:
if( p->outCount ){
p->outCount--;
if( p->outCount==0 ) output_reset(p);
}
p->bSafeMode = p->bSafeModePersist;
return rc;
}
/*
** Return TRUE if a semicolon occurs anywhere in the first N characters
** of string z[].
*/
|
| ︙ | ︙ | |||
21641 21642 21643 21644 21645 21646 21647 21648 21649 21650 21651 21652 21653 21654 |
nSql = 0;
if( p->outCount ){
output_reset(p);
p->outCount = 0;
}else{
clearTempFile(p);
}
}else if( nSql && _all_whitespace(zSql) ){
if( ShellHasFlag(p, SHFLG_Echo) ) printf("%s\n", zSql);
nSql = 0;
}
}
if( nSql && !_all_whitespace(zSql) ){
errCnt += runOneSqlLine(p, zSql, p->in, startline);
| > | 21748 21749 21750 21751 21752 21753 21754 21755 21756 21757 21758 21759 21760 21761 21762 |
nSql = 0;
if( p->outCount ){
output_reset(p);
p->outCount = 0;
}else{
clearTempFile(p);
}
p->bSafeMode = p->bSafeModePersist;
}else if( nSql && _all_whitespace(zSql) ){
if( ShellHasFlag(p, SHFLG_Echo) ) printf("%s\n", zSql);
nSql = 0;
}
}
if( nSql && !_all_whitespace(zSql) ){
errCnt += runOneSqlLine(p, zSql, p->in, startline);
|
| ︙ | ︙ | |||
21807 21808 21809 21810 21811 21812 21813 21814 21815 21816 21817 21818 21819 21820 21821 21822 21823 21824 | " -memtrace trace all memory allocations and deallocations\n" " -mmap N default mmap size set to N\n" #ifdef SQLITE_ENABLE_MULTIPLEX " -multiplex enable the multiplexor VFS\n" #endif " -newline SEP set output row separator. Default: '\\n'\n" " -nofollow refuse to open symbolic links to database files\n" " -nullvalue TEXT set text string for NULL values. Default ''\n" " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n" " -quote set output mode to 'quote'\n" " -readonly open the database read-only\n" " -separator SEP set output column separator. Default: '|'\n" #ifdef SQLITE_ENABLE_SORTER_REFERENCES " -sorterref SIZE sorter references threshold size\n" #endif " -stats print memory stats before each finalize\n" " -table set output mode to 'table'\n" " -tabs set output mode to 'tabs'\n" | > > | 21915 21916 21917 21918 21919 21920 21921 21922 21923 21924 21925 21926 21927 21928 21929 21930 21931 21932 21933 21934 | " -memtrace trace all memory allocations and deallocations\n" " -mmap N default mmap size set to N\n" #ifdef SQLITE_ENABLE_MULTIPLEX " -multiplex enable the multiplexor VFS\n" #endif " -newline SEP set output row separator. Default: '\\n'\n" " -nofollow refuse to open symbolic links to database files\n" " -nonce STRING set the safe-mode escape nonce\n" " -nullvalue TEXT set text string for NULL values. Default ''\n" " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n" " -quote set output mode to 'quote'\n" " -readonly open the database read-only\n" " -safe enable safe-mode\n" " -separator SEP set output column separator. Default: '|'\n" #ifdef SQLITE_ENABLE_SORTER_REFERENCES " -sorterref SIZE sorter references threshold size\n" #endif " -stats print memory stats before each finalize\n" " -table set output mode to 'table'\n" " -tabs set output mode to 'tabs'\n" |
| ︙ | ︙ | |||
22096 22097 22098 22099 22100 22101 22102 22103 22104 22105 22106 22107 22108 22109 |
int n, sz;
sz = (int)integerValue(cmdline_option_value(argc,argv,++i));
if( sz<0 ) sz = 0;
n = (int)integerValue(cmdline_option_value(argc,argv,++i));
if( n<0 ) n = 0;
sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, n);
if( sz*n==0 ) data.shellFlgs &= ~SHFLG_Lookaside;
#ifdef SQLITE_ENABLE_VFSTRACE
}else if( strcmp(z,"-vfstrace")==0 ){
extern int vfstrace_register(
const char *zTraceName,
const char *zOldVfsName,
int (*xOut)(const char*,void*),
void *pOutArg,
| > > > > > > > > | 22206 22207 22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 |
int n, sz;
sz = (int)integerValue(cmdline_option_value(argc,argv,++i));
if( sz<0 ) sz = 0;
n = (int)integerValue(cmdline_option_value(argc,argv,++i));
if( n<0 ) n = 0;
sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, n);
if( sz*n==0 ) data.shellFlgs &= ~SHFLG_Lookaside;
}else if( strcmp(z,"-threadsafe")==0 ){
int n;
n = (int)integerValue(cmdline_option_value(argc,argv,++i));
switch( n ){
case 0: sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); break;
case 2: sqlite3_config(SQLITE_CONFIG_MULTITHREAD); break;
default: sqlite3_config(SQLITE_CONFIG_SERIALIZED); break;
}
#ifdef SQLITE_ENABLE_VFSTRACE
}else if( strcmp(z,"-vfstrace")==0 ){
extern int vfstrace_register(
const char *zTraceName,
const char *zOldVfsName,
int (*xOut)(const char*,void*),
void *pOutArg,
|
| ︙ | ︙ | |||
22148 22149 22150 22151 22152 22153 22154 22155 22156 22157 22158 22159 22160 22161 |
** command, so ignore them */
break;
#endif
}else if( strcmp(z, "-memtrace")==0 ){
sqlite3MemTraceActivate(stderr);
}else if( strcmp(z,"-bail")==0 ){
bail_on_error = 1;
}
}
verify_uninitialized();
#ifdef SQLITE_SHELL_INIT_PROC
{
| > > > > > | 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 |
** command, so ignore them */
break;
#endif
}else if( strcmp(z, "-memtrace")==0 ){
sqlite3MemTraceActivate(stderr);
}else if( strcmp(z,"-bail")==0 ){
bail_on_error = 1;
}else if( strcmp(z,"-nonce")==0 ){
free(data.zNonce);
data.zNonce = strdup(argv[++i]);
}else if( strcmp(z,"-safe")==0 ){
/* no-op - catch this on the second pass */
}
}
verify_uninitialized();
#ifdef SQLITE_SHELL_INIT_PROC
{
|
| ︙ | ︙ | |||
22308 22309 22310 22311 22312 22313 22314 22315 22316 22317 22318 22319 22320 22321 |
stdin_is_interactive = 0;
}else if( strcmp(z,"-heap")==0 ){
i++;
}else if( strcmp(z,"-pagecache")==0 ){
i+=2;
}else if( strcmp(z,"-lookaside")==0 ){
i+=2;
}else if( strcmp(z,"-mmap")==0 ){
i++;
}else if( strcmp(z,"-memtrace")==0 ){
i++;
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
}else if( strcmp(z,"-sorterref")==0 ){
i++;
| > > > > | 22431 22432 22433 22434 22435 22436 22437 22438 22439 22440 22441 22442 22443 22444 22445 22446 22447 22448 |
stdin_is_interactive = 0;
}else if( strcmp(z,"-heap")==0 ){
i++;
}else if( strcmp(z,"-pagecache")==0 ){
i+=2;
}else if( strcmp(z,"-lookaside")==0 ){
i+=2;
}else if( strcmp(z,"-threadsafe")==0 ){
i+=2;
}else if( strcmp(z,"-nonce")==0 ){
i += 2;
}else if( strcmp(z,"-mmap")==0 ){
i++;
}else if( strcmp(z,"-memtrace")==0 ){
i++;
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
}else if( strcmp(z,"-sorterref")==0 ){
i++;
|
| ︙ | ︙ | |||
22366 22367 22368 22369 22370 22371 22372 22373 22374 22375 22376 22377 22378 22379 |
arDotCommand(&data, 1, argv+(i-1), argc-(i-1));
}else{
arDotCommand(&data, 1, argv+i, argc-i);
}
readStdin = 0;
break;
#endif
}else{
utf8_printf(stderr,"%s: Error: unknown option: %s\n", Argv0, z);
raw_printf(stderr,"Use -help for a list of options.\n");
return 1;
}
data.cMode = data.mode;
}
| > > | 22493 22494 22495 22496 22497 22498 22499 22500 22501 22502 22503 22504 22505 22506 22507 22508 |
arDotCommand(&data, 1, argv+(i-1), argc-(i-1));
}else{
arDotCommand(&data, 1, argv+i, argc-i);
}
readStdin = 0;
break;
#endif
}else if( strcmp(z,"-safe")==0 ){
data.bSafeMode = data.bSafeModePersist = 1;
}else{
utf8_printf(stderr,"%s: Error: unknown option: %s\n", Argv0, z);
raw_printf(stderr,"Use -help for a list of options.\n");
return 1;
}
data.cMode = data.mode;
}
|
| ︙ | ︙ | |||
22468 22469 22470 22471 22472 22473 22474 22475 22476 22477 22478 22479 | data.doXdgOpen = 0; clearTempFile(&data); #if !SQLITE_SHELL_IS_UTF8 for(i=0; i<argcToFree; i++) free(argvToFree[i]); free(argvToFree); #endif free(data.colWidth); /* Clear the global data structure so that valgrind will detect memory ** leaks */ memset(&data, 0, sizeof(data)); return rc; } | > | 22597 22598 22599 22600 22601 22602 22603 22604 22605 22606 22607 22608 22609 | data.doXdgOpen = 0; clearTempFile(&data); #if !SQLITE_SHELL_IS_UTF8 for(i=0; i<argcToFree; i++) free(argvToFree[i]); free(argvToFree); #endif free(data.colWidth); free(data.zNonce); /* Clear the global data structure so that valgrind will detect memory ** leaks */ memset(&data, 0, sizeof(data)); return rc; } |
Changes to src/sqlite3.c.
| ︙ | ︙ | |||
450 451 452 453 454 455 456 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.37.0" #define SQLITE_VERSION_NUMBER 3037000 | | | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.37.0" #define SQLITE_VERSION_NUMBER 3037000 #define SQLITE_SOURCE_ID "2021-09-06 11:44:19 b3cfe23bec0b95ca673802526704200e2396df715fdded72aa71addd7f47e0e1" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros |
| ︙ | ︙ | |||
863 864 865 866 867 868 869 870 871 872 873 874 875 876 | #define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) #define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) #define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8)) #define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) #define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) #define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) | > | 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 | #define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) #define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) #define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8)) #define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) #define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) #define SQLITE_CONSTRAINT_DATATYPE (SQLITE_CONSTRAINT |(12<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) #define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) |
| ︙ | ︙ | |||
13444 13445 13446 13447 13448 13449 13450 | #define TK_IF 18 #define TK_NOT 19 #define TK_EXISTS 20 #define TK_TEMP 21 #define TK_LP 22 #define TK_RP 23 #define TK_AS 24 | < | > | 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 | #define TK_IF 18 #define TK_NOT 19 #define TK_EXISTS 20 #define TK_TEMP 21 #define TK_LP 22 #define TK_RP 23 #define TK_AS 24 #define TK_COMMA 25 #define TK_WITHOUT 26 #define TK_ABORT 27 #define TK_ACTION 28 #define TK_AFTER 29 #define TK_ANALYZE 30 #define TK_ASC 31 #define TK_ATTACH 32 #define TK_BEFORE 33 |
| ︙ | ︙ | |||
15107 15108 15109 15110 15111 15112 15113 | #define OP_Yield 14 /* jump */ #define OP_MustBeInt 15 /* jump */ #define OP_Jump 16 /* jump */ #define OP_Once 17 /* jump */ #define OP_If 18 /* jump */ #define OP_Not 19 /* same as TK_NOT, synopsis: r[P2]= !r[P1] */ #define OP_IfNot 20 /* jump */ | > | | | | | | | | | | | | | | | | | | | | | < > | | | | < > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | < < | | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 |
#define OP_Yield 14 /* jump */
#define OP_MustBeInt 15 /* jump */
#define OP_Jump 16 /* jump */
#define OP_Once 17 /* jump */
#define OP_If 18 /* jump */
#define OP_Not 19 /* same as TK_NOT, synopsis: r[P2]= !r[P1] */
#define OP_IfNot 20 /* jump */
#define OP_IsNullOrType 21 /* jump, synopsis: if typeof(r[P1]) IN (P3,5) goto P2 */
#define OP_IfNullRow 22 /* jump, synopsis: if P1.nullRow then r[P3]=NULL, goto P2 */
#define OP_SeekLT 23 /* jump, synopsis: key=r[P3@P4] */
#define OP_SeekLE 24 /* jump, synopsis: key=r[P3@P4] */
#define OP_SeekGE 25 /* jump, synopsis: key=r[P3@P4] */
#define OP_SeekGT 26 /* jump, synopsis: key=r[P3@P4] */
#define OP_IfNotOpen 27 /* jump, synopsis: if( !csr[P1] ) goto P2 */
#define OP_IfNoHope 28 /* jump, synopsis: key=r[P3@P4] */
#define OP_NoConflict 29 /* jump, synopsis: key=r[P3@P4] */
#define OP_NotFound 30 /* jump, synopsis: key=r[P3@P4] */
#define OP_Found 31 /* jump, synopsis: key=r[P3@P4] */
#define OP_SeekRowid 32 /* jump, synopsis: intkey=r[P3] */
#define OP_NotExists 33 /* jump, synopsis: intkey=r[P3] */
#define OP_Last 34 /* jump */
#define OP_IfSmaller 35 /* jump */
#define OP_SorterSort 36 /* jump */
#define OP_Sort 37 /* jump */
#define OP_Rewind 38 /* jump */
#define OP_IdxLE 39 /* jump, synopsis: key=r[P3@P4] */
#define OP_IdxGT 40 /* jump, synopsis: key=r[P3@P4] */
#define OP_IdxLT 41 /* jump, synopsis: key=r[P3@P4] */
#define OP_IdxGE 42 /* jump, synopsis: key=r[P3@P4] */
#define OP_Or 43 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
#define OP_And 44 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
#define OP_RowSetRead 45 /* jump, synopsis: r[P3]=rowset(P1) */
#define OP_RowSetTest 46 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */
#define OP_Program 47 /* jump */
#define OP_FkIfZero 48 /* jump, synopsis: if fkctr[P1]==0 goto P2 */
#define OP_IfPos 49 /* jump, synopsis: if r[P1]>0 then r[P1]-=P3, goto P2 */
#define OP_IsNull 50 /* jump, same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
#define OP_NotNull 51 /* jump, same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
#define OP_Ne 52 /* jump, same as TK_NE, synopsis: IF r[P3]!=r[P1] */
#define OP_Eq 53 /* jump, same as TK_EQ, synopsis: IF r[P3]==r[P1] */
#define OP_Gt 54 /* jump, same as TK_GT, synopsis: IF r[P3]>r[P1] */
#define OP_Le 55 /* jump, same as TK_LE, synopsis: IF r[P3]<=r[P1] */
#define OP_Lt 56 /* jump, same as TK_LT, synopsis: IF r[P3]<r[P1] */
#define OP_Ge 57 /* jump, same as TK_GE, synopsis: IF r[P3]>=r[P1] */
#define OP_ElseEq 58 /* jump, same as TK_ESCAPE */
#define OP_IfNotZero 59 /* jump, synopsis: if r[P1]!=0 then r[P1]--, goto P2 */
#define OP_DecrJumpZero 60 /* jump, synopsis: if (--r[P1])==0 goto P2 */
#define OP_IncrVacuum 61 /* jump */
#define OP_VNext 62 /* jump */
#define OP_Init 63 /* jump, synopsis: Start at P2 */
#define OP_PureFunc 64 /* synopsis: r[P3]=func(r[P2@NP]) */
#define OP_Function 65 /* synopsis: r[P3]=func(r[P2@NP]) */
#define OP_Return 66
#define OP_EndCoroutine 67
#define OP_HaltIfNull 68 /* synopsis: if r[P3]=null halt */
#define OP_Halt 69
#define OP_Integer 70 /* synopsis: r[P2]=P1 */
#define OP_Int64 71 /* synopsis: r[P2]=P4 */
#define OP_String 72 /* synopsis: r[P2]='P4' (len=P1) */
#define OP_Null 73 /* synopsis: r[P2..P3]=NULL */
#define OP_SoftNull 74 /* synopsis: r[P1]=NULL */
#define OP_Blob 75 /* synopsis: r[P2]=P4 (len=P1) */
#define OP_Variable 76 /* synopsis: r[P2]=parameter(P1,P4) */
#define OP_Move 77 /* synopsis: r[P2@P3]=r[P1@P3] */
#define OP_Copy 78 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */
#define OP_SCopy 79 /* synopsis: r[P2]=r[P1] */
#define OP_IntCopy 80 /* synopsis: r[P2]=r[P1] */
#define OP_ChngCntRow 81 /* synopsis: output=r[P1] */
#define OP_ResultRow 82 /* synopsis: output=r[P1@P2] */
#define OP_CollSeq 83
#define OP_AddImm 84 /* synopsis: r[P1]=r[P1]+P2 */
#define OP_RealAffinity 85
#define OP_Cast 86 /* synopsis: affinity(r[P1]) */
#define OP_Permutation 87
#define OP_Compare 88 /* synopsis: r[P1@P3] <-> r[P2@P3] */
#define OP_IsTrue 89 /* synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 */
#define OP_ZeroOrNull 90 /* synopsis: r[P2] = 0 OR NULL */
#define OP_Offset 91 /* synopsis: r[P3] = sqlite_offset(P1) */
#define OP_Column 92 /* synopsis: r[P3]=PX */
#define OP_TypeCheck 93 /* synopsis: typecheck(r[P1@P2]) */
#define OP_Affinity 94 /* synopsis: affinity(r[P1@P2]) */
#define OP_MakeRecord 95 /* synopsis: r[P3]=mkrec(r[P1@P2]) */
#define OP_Count 96 /* synopsis: r[P2]=count() */
#define OP_ReadCookie 97
#define OP_SetCookie 98
#define OP_ReopenIdx 99 /* synopsis: root=P2 iDb=P3 */
#define OP_OpenRead 100 /* synopsis: root=P2 iDb=P3 */
#define OP_OpenWrite 101 /* synopsis: root=P2 iDb=P3 */
#define OP_BitAnd 102 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
#define OP_BitOr 103 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
#define OP_ShiftLeft 104 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
#define OP_ShiftRight 105 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
#define OP_Add 106 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
#define OP_Subtract 107 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
#define OP_Multiply 108 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
#define OP_Divide 109 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
#define OP_Remainder 110 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
#define OP_Concat 111 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
#define OP_OpenDup 112
#define OP_BitNot 113 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
#define OP_OpenAutoindex 114 /* synopsis: nColumn=P2 */
#define OP_OpenEphemeral 115 /* synopsis: nColumn=P2 */
#define OP_String8 116 /* same as TK_STRING, synopsis: r[P2]='P4' */
#define OP_SorterOpen 117
#define OP_SequenceTest 118 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */
#define OP_OpenPseudo 119 /* synopsis: P3 columns in r[P2] */
#define OP_Close 120
#define OP_ColumnsUsed 121
#define OP_SeekScan 122 /* synopsis: Scan-ahead up to P1 rows */
#define OP_SeekHit 123 /* synopsis: set P2<=seekHit<=P3 */
#define OP_Sequence 124 /* synopsis: r[P2]=cursor[P1].ctr++ */
#define OP_NewRowid 125 /* synopsis: r[P2]=rowid */
#define OP_Insert 126 /* synopsis: intkey=r[P3] data=r[P2] */
#define OP_RowCell 127
#define OP_Delete 128
#define OP_ResetCount 129
#define OP_SorterCompare 130 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
#define OP_SorterData 131 /* synopsis: r[P2]=data */
#define OP_RowData 132 /* synopsis: r[P2]=data */
#define OP_Rowid 133 /* synopsis: r[P2]=rowid */
#define OP_NullRow 134
#define OP_SeekEnd 135
#define OP_IdxInsert 136 /* synopsis: key=r[P2] */
#define OP_SorterInsert 137 /* synopsis: key=r[P2] */
#define OP_IdxDelete 138 /* synopsis: key=r[P2@P3] */
#define OP_DeferredSeek 139 /* synopsis: Move P3 to P1.rowid if needed */
#define OP_IdxRowid 140 /* synopsis: r[P2]=rowid */
#define OP_FinishSeek 141
#define OP_Destroy 142
#define OP_Clear 143
#define OP_ResetSorter 144
#define OP_CreateBtree 145 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
#define OP_SqlExec 146
#define OP_ParseSchema 147
#define OP_LoadAnalysis 148
#define OP_DropTable 149
#define OP_DropIndex 150
#define OP_DropTrigger 151
#define OP_Real 152 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
#define OP_IntegrityCk 153
#define OP_RowSetAdd 154 /* synopsis: rowset(P1)=r[P2] */
#define OP_Param 155
#define OP_FkCounter 156 /* synopsis: fkctr[P1]+=P2 */
#define OP_MemMax 157 /* synopsis: r[P1]=max(r[P1],r[P2]) */
#define OP_OffsetLimit 158 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
#define OP_AggInverse 159 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
#define OP_AggStep 160 /* synopsis: accum=r[P3] step(r[P2@P5]) */
#define OP_AggStep1 161 /* synopsis: accum=r[P3] step(r[P2@P5]) */
#define OP_AggValue 162 /* synopsis: r[P3]=value N=P2 */
#define OP_AggFinal 163 /* synopsis: accum=r[P1] N=P2 */
#define OP_Expire 164
#define OP_CursorLock 165
#define OP_CursorUnlock 166
#define OP_TableLock 167 /* synopsis: iDb=P1 root=P2 write=P3 */
#define OP_VBegin 168
#define OP_VCreate 169
#define OP_VDestroy 170
#define OP_VOpen 171
#define OP_VColumn 172 /* synopsis: r[P3]=vcolumn(P2) */
#define OP_VRename 173
#define OP_Pagecount 174
#define OP_MaxPgcnt 175
#define OP_Trace 176
#define OP_CursorHint 177
#define OP_ReleaseReg 178 /* synopsis: release r[P1@P2] mask P3 */
#define OP_Noop 179
#define OP_Explain 180
#define OP_Abortable 181
/* Properties such as "out2" or "jump" that are specified in
** comments following the "case" for each opcode in the vdbe.c
** are encoded into bitvectors as follows:
*/
#define OPFLG_JUMP 0x01 /* jump: P2 holds jmp target */
#define OPFLG_IN1 0x02 /* in1: P1 is an input */
#define OPFLG_IN2 0x04 /* in2: P2 is an input */
#define OPFLG_IN3 0x08 /* in3: P3 is an input */
#define OPFLG_OUT2 0x10 /* out2: P2 is an output */
#define OPFLG_OUT3 0x20 /* out3: P3 is an output */
#define OPFLG_INITIALIZER {\
/* 0 */ 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x10,\
/* 8 */ 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x03, 0x03,\
/* 16 */ 0x01, 0x01, 0x03, 0x12, 0x03, 0x03, 0x01, 0x09,\
/* 24 */ 0x09, 0x09, 0x09, 0x01, 0x09, 0x09, 0x09, 0x09,\
/* 32 */ 0x09, 0x09, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,\
/* 40 */ 0x01, 0x01, 0x01, 0x26, 0x26, 0x23, 0x0b, 0x01,\
/* 48 */ 0x01, 0x03, 0x03, 0x03, 0x0b, 0x0b, 0x0b, 0x0b,\
/* 56 */ 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x01, 0x01, 0x01,\
/* 64 */ 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10, 0x10,\
/* 72 */ 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10,\
/* 80 */ 0x10, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00,\
/* 88 */ 0x00, 0x12, 0x1e, 0x20, 0x00, 0x00, 0x00, 0x00,\
/* 96 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26,\
/* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\
/* 112 */ 0x00, 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,\
/* 120 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
/* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,\
/* 136 */ 0x04, 0x04, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00,\
/* 144 */ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 152 */ 0x10, 0x00, 0x06, 0x10, 0x00, 0x04, 0x1a, 0x00,\
/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
/* 176 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
/* The resolve3P2Values() routine is able to run faster if it knows
** the value of the largest JUMP opcode. The smaller the maximum
** JUMP opcode the better, so the mkopcodeh.tcl script that
** generated this include file strives to group all JUMP opcodes
** together near the beginning of the list.
*/
#define SQLITE_MX_JUMP_OPCODE 63 /* Maximum JUMP opcode */
/************** End of opcodes.h *********************************************/
/************** Continuing where we left off in vdbe.h ***********************/
/*
** Additional non-public SQLITE_PREPARE_* flags
*/
|
| ︙ | ︙ | |||
16385 16386 16387 16388 16389 16390 16391 16392 | signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */ u8 suppressErr; /* Do not issue error messages if true */ u8 vtabOnConflict; /* Value to return for s3_vtab_on_conflict() */ u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ u8 mTrace; /* zero or more SQLITE_TRACE flags */ u8 noSharedCache; /* True if no shared-cache backends */ u8 nSqlExec; /* Number of pending OP_SqlExec opcodes */ int nextPagesize; /* Pagesize after VACUUM if >0 */ | > < | 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 |
signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */
u8 suppressErr; /* Do not issue error messages if true */
u8 vtabOnConflict; /* Value to return for s3_vtab_on_conflict() */
u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */
u8 mTrace; /* zero or more SQLITE_TRACE flags */
u8 noSharedCache; /* True if no shared-cache backends */
u8 nSqlExec; /* Number of pending OP_SqlExec opcodes */
u8 eOpenState; /* Current condition of the connection */
int nextPagesize; /* Pagesize after VACUUM if >0 */
i64 nChange; /* Value returned by sqlite3_changes() */
i64 nTotalChange; /* Value returned by sqlite3_total_changes() */
int aLimit[SQLITE_N_LIMIT]; /* Limits */
int nMaxSorterMmap; /* Maximum size of regions mapped by sorter */
struct sqlite3InitInfo { /* Information used during initialization */
Pgno newTnum; /* Rootpage of table being initialized */
u8 iDb; /* Which db file is being initialized */
|
| ︙ | ︙ | |||
16613 16614 16615 16616 16617 16618 16619 | /* ** Return true if it OK to factor constant expressions into the initialization ** code. The argument is a Parse object for the code generator. */ #define ConstFactorOk(P) ((P)->okConstFactor) | < | | < > | | | | | | | 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 | /* ** Return true if it OK to factor constant expressions into the initialization ** code. The argument is a Parse object for the code generator. */ #define ConstFactorOk(P) ((P)->okConstFactor) /* Possible values for the sqlite3.eOpenState field. ** The numbers are randomly selected such that a minimum of three bits must ** change to convert any number to another or to zero */ #define SQLITE_STATE_OPEN 0x76 /* Database is open */ #define SQLITE_STATE_CLOSED 0xce /* Database is closed */ #define SQLITE_STATE_SICK 0xba /* Error and awaiting close */ #define SQLITE_STATE_BUSY 0x6d /* Database currently in use */ #define SQLITE_STATE_ERROR 0xd5 /* An SQLITE_MISUSE error occurred */ #define SQLITE_STATE_ZOMBIE 0xa7 /* Close with last statement close */ /* ** Each SQL function is defined by an instance of the following ** structure. For global built-in functions (ex: substr(), max(), count()) ** a pointer to this structure is held in the sqlite3BuiltinFunctions object. ** For per-connection application-defined functions, a pointer to this ** structure is held in the db->aHash hash table. |
| ︙ | ︙ | |||
16892 16893 16894 16895 16896 16897 16898 |
** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the
** collating sequence name is only included if the COLFLAG_HASCOLL bit is
** set.
*/
struct Column {
char *zCnName; /* Name of this column */
unsigned notNull :4; /* An OE_ code for handling a NOT NULL constraint */
| | | > | | | | | | | 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 |
** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the
** collating sequence name is only included if the COLFLAG_HASCOLL bit is
** set.
*/
struct Column {
char *zCnName; /* Name of this column */
unsigned notNull :4; /* An OE_ code for handling a NOT NULL constraint */
unsigned eCType :4; /* One of the standard types */
char affinity; /* One of the SQLITE_AFF_... values */
u8 szEst; /* Est size of value in this column. sizeof(INT)==1 */
u8 hName; /* Column name hash for faster lookup */
u16 iDflt; /* 1-based index of DEFAULT. 0 means "none" */
u16 colFlags; /* Boolean properties. See COLFLAG_ defines below */
};
/* Allowed values for Column.eCType.
**
** Values must match entries in the global constant arrays
** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more
** than the offset into these arrays for the corresponding name.
** Adjust the SQLITE_N_STDTYPE value if adding or removing entries.
*/
#define COLTYPE_CUSTOM 0 /* Type appended to zName */
#define COLTYPE_ANY 1
#define COLTYPE_BLOB 2
#define COLTYPE_INT 3
#define COLTYPE_INTEGER 4
#define COLTYPE_REAL 5
#define COLTYPE_TEXT 6
#define SQLITE_N_STDTYPE 6 /* Number of standard types */
/* Allowed values for Column.colFlags.
**
** Constraints:
** TF_HasVirtual == COLFLAG_VIRTUAL
** TF_HasStored == COLFLAG_STORED
** TF_HasHidden == COLFLAG_HIDDEN
|
| ︙ | ︙ | |||
17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 | #define TF_NoVisibleRowid 0x00000200 /* No user-visible "rowid" column */ #define TF_OOOHidden 0x00000400 /* Out-of-Order hidden columns */ #define TF_HasNotNull 0x00000800 /* Contains NOT NULL constraints */ #define TF_Shadow 0x00001000 /* True for a shadow table */ #define TF_HasStat4 0x00002000 /* STAT4 info available for this table */ #define TF_Ephemeral 0x00004000 /* An ephemeral table */ #define TF_Eponymous 0x00008000 /* An eponymous virtual table */ /* ** Allowed values for Table.eTabType */ #define TABTYP_NORM 0 /* Ordinary table */ #define TABTYP_VTAB 1 /* Virtual table */ #define TABTYP_VIEW 2 /* A view */ | > | 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 | #define TF_NoVisibleRowid 0x00000200 /* No user-visible "rowid" column */ #define TF_OOOHidden 0x00000400 /* Out-of-Order hidden columns */ #define TF_HasNotNull 0x00000800 /* Contains NOT NULL constraints */ #define TF_Shadow 0x00001000 /* True for a shadow table */ #define TF_HasStat4 0x00002000 /* STAT4 info available for this table */ #define TF_Ephemeral 0x00004000 /* An ephemeral table */ #define TF_Eponymous 0x00008000 /* An eponymous virtual table */ #define TF_Strict 0x00010000 /* STRICT mode */ /* ** Allowed values for Table.eTabType */ #define TABTYP_NORM 0 /* Ordinary table */ #define TABTYP_VTAB 1 /* Virtual table */ #define TABTYP_VIEW 2 /* A view */ |
| ︙ | ︙ | |||
19288 19289 19290 19291 19292 19293 19294 | SQLITE_PRIVATE void sqlite3AddColumn(Parse*,Token,Token); SQLITE_PRIVATE void sqlite3AddNotNull(Parse*, int); SQLITE_PRIVATE void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int); SQLITE_PRIVATE void sqlite3AddCheckConstraint(Parse*, Expr*, const char*, const char*); SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,Expr*,const char*,const char*); SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, Token*); SQLITE_PRIVATE void sqlite3AddGenerated(Parse*,Expr*,Token*); | | | 19292 19293 19294 19295 19296 19297 19298 19299 19300 19301 19302 19303 19304 19305 19306 |
SQLITE_PRIVATE void sqlite3AddColumn(Parse*,Token,Token);
SQLITE_PRIVATE void sqlite3AddNotNull(Parse*, int);
SQLITE_PRIVATE void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
SQLITE_PRIVATE void sqlite3AddCheckConstraint(Parse*, Expr*, const char*, const char*);
SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,Expr*,const char*,const char*);
SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, Token*);
SQLITE_PRIVATE void sqlite3AddGenerated(Parse*,Expr*,Token*);
SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,u32,Select*);
SQLITE_PRIVATE void sqlite3AddReturning(Parse*,ExprList*);
SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*,
sqlite3_vfs**,char**,char **);
#define sqlite3CodecQueryParameters(A,B,C) 0
SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3*,const char*);
#ifdef SQLITE_UNTESTABLE
|
| ︙ | ︙ | |||
19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 | SQLITE_PRIVATE int sqlite3ValueFromExpr(sqlite3 *, Expr *, u8, u8, sqlite3_value **); SQLITE_PRIVATE void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8); #ifndef SQLITE_AMALGAMATION SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[]; SQLITE_PRIVATE const char sqlite3StrBINARY[]; SQLITE_PRIVATE const unsigned char sqlite3StdTypeLen[]; SQLITE_PRIVATE const char sqlite3StdTypeAffinity[]; SQLITE_PRIVATE const char *sqlite3StdType[]; SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[]; SQLITE_PRIVATE const unsigned char *sqlite3aLTb; SQLITE_PRIVATE const unsigned char *sqlite3aEQb; SQLITE_PRIVATE const unsigned char *sqlite3aGTb; SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[]; SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config; | > | 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 | SQLITE_PRIVATE int sqlite3ValueFromExpr(sqlite3 *, Expr *, u8, u8, sqlite3_value **); SQLITE_PRIVATE void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8); #ifndef SQLITE_AMALGAMATION SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[]; SQLITE_PRIVATE const char sqlite3StrBINARY[]; SQLITE_PRIVATE const unsigned char sqlite3StdTypeLen[]; SQLITE_PRIVATE const char sqlite3StdTypeAffinity[]; SQLITE_PRIVATE const char sqlite3StdTypeMap[]; SQLITE_PRIVATE const char *sqlite3StdType[]; SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[]; SQLITE_PRIVATE const unsigned char *sqlite3aLTb; SQLITE_PRIVATE const unsigned char *sqlite3aEQb; SQLITE_PRIVATE const unsigned char *sqlite3aGTb; SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[]; SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config; |
| ︙ | ︙ | |||
21462 21463 21464 21465 21466 21467 21468 21469 | ** Name of the default collating sequence */ SQLITE_PRIVATE const char sqlite3StrBINARY[] = "BINARY"; /* ** Standard typenames. These names must match the COLTYPE_* definitions. ** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. */ | > > > > > > > > > > > > | > > > > > > > > > > | 21467 21468 21469 21470 21471 21472 21473 21474 21475 21476 21477 21478 21479 21480 21481 21482 21483 21484 21485 21486 21487 21488 21489 21490 21491 21492 21493 21494 21495 21496 21497 21498 21499 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 |
** Name of the default collating sequence
*/
SQLITE_PRIVATE const char sqlite3StrBINARY[] = "BINARY";
/*
** Standard typenames. These names must match the COLTYPE_* definitions.
** Adjust the SQLITE_N_STDTYPE value if adding or removing entries.
**
** sqlite3StdType[] The actual names of the datatypes.
**
** sqlite3StdTypeLen[] The length (in bytes) of each entry
** in sqlite3StdType[].
**
** sqlite3StdTypeAffinity[] The affinity associated with each entry
** in sqlite3StdType[].
**
** sqlite3StdTypeMap[] The type value (as returned from
** sqlite3_column_type() or sqlite3_value_type())
** for each entry in sqlite3StdType[].
*/
SQLITE_PRIVATE const unsigned char sqlite3StdTypeLen[] = { 3, 4, 3, 7, 4, 4 };
SQLITE_PRIVATE const char sqlite3StdTypeAffinity[] = {
SQLITE_AFF_NUMERIC,
SQLITE_AFF_BLOB,
SQLITE_AFF_INTEGER,
SQLITE_AFF_INTEGER,
SQLITE_AFF_REAL,
SQLITE_AFF_TEXT
};
SQLITE_PRIVATE const char sqlite3StdTypeMap[] = {
0,
SQLITE_BLOB,
SQLITE_INTEGER,
SQLITE_INTEGER,
SQLITE_FLOAT,
SQLITE_TEXT
};
SQLITE_PRIVATE const char *sqlite3StdType[] = {
"ANY",
"BLOB",
"INT",
"INTEGER",
"REAL",
"TEXT"
};
|
| ︙ | ︙ | |||
31894 31895 31896 31897 31898 31899 31900 31901 31902 31903 31904 |
return xCallback ? xCallback(iTest) : SQLITE_OK;
}
#endif
#ifndef SQLITE_OMIT_FLOATING_POINT
/*
** Return true if the floating point value is Not a Number (NaN).
*/
SQLITE_PRIVATE int sqlite3IsNaN(double x){
u64 y;
memcpy(&y,&x,sizeof(y));
| > > > > > > > > > > | | 31921 31922 31923 31924 31925 31926 31927 31928 31929 31930 31931 31932 31933 31934 31935 31936 31937 31938 31939 31940 31941 31942 31943 31944 31945 31946 31947 31948 31949 |
return xCallback ? xCallback(iTest) : SQLITE_OK;
}
#endif
#ifndef SQLITE_OMIT_FLOATING_POINT
/*
** Return true if the floating point value is Not a Number (NaN).
**
** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
** Otherwise, we have our own implementation that works on most systems.
*/
SQLITE_PRIVATE int sqlite3IsNaN(double x){
int rc; /* The value return */
#if !SQLITE_HAVE_ISNAN && !HAVE_ISNAN
u64 y;
memcpy(&y,&x,sizeof(y));
rc = IsNaN(y);
#else
rc = isnan(x);
#endif /* HAVE_ISNAN */
testcase( rc );
return rc;
}
#endif /* SQLITE_OMIT_FLOATING_POINT */
/*
** Compute a string length that is limited to what can be stored in
** lower 30 bits of a 32-bit signed integer.
**
|
| ︙ | ︙ | |||
31925 31926 31927 31928 31929 31930 31931 |
**
** The column type is an extra string stored after the zero-terminator on
** the column name if and only if the COLFLAG_HASTYPE flag is set.
*/
SQLITE_PRIVATE char *sqlite3ColumnType(Column *pCol, char *zDflt){
if( pCol->colFlags & COLFLAG_HASTYPE ){
return pCol->zCnName + strlen(pCol->zCnName) + 1;
| | | | | 31962 31963 31964 31965 31966 31967 31968 31969 31970 31971 31972 31973 31974 31975 31976 31977 31978 |
**
** The column type is an extra string stored after the zero-terminator on
** the column name if and only if the COLFLAG_HASTYPE flag is set.
*/
SQLITE_PRIVATE char *sqlite3ColumnType(Column *pCol, char *zDflt){
if( pCol->colFlags & COLFLAG_HASTYPE ){
return pCol->zCnName + strlen(pCol->zCnName) + 1;
}else if( pCol->eCType ){
assert( pCol->eCType<=SQLITE_N_STDTYPE );
return (char*)sqlite3StdType[pCol->eCType-1];
}else{
return zDflt;
}
}
/*
** Helper function for sqlite3Error() - called rarely. Broken out into
|
| ︙ | ︙ | |||
33233 33234 33235 33236 33237 33238 33239 |
**
** sqlite3SafetyCheckOk() requires that the db pointer be valid for
** use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to
** open properly and is not fit for general use but which can be
** used as an argument to sqlite3_errmsg() or sqlite3_close().
*/
SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3 *db){
| | | | | | | | | | 33270 33271 33272 33273 33274 33275 33276 33277 33278 33279 33280 33281 33282 33283 33284 33285 33286 33287 33288 33289 33290 33291 33292 33293 33294 33295 33296 33297 33298 33299 33300 33301 33302 33303 33304 33305 |
**
** sqlite3SafetyCheckOk() requires that the db pointer be valid for
** use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to
** open properly and is not fit for general use but which can be
** used as an argument to sqlite3_errmsg() or sqlite3_close().
*/
SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3 *db){
u8 eOpenState;
if( db==0 ){
logBadConnection("NULL");
return 0;
}
eOpenState = db->eOpenState;
if( eOpenState!=SQLITE_STATE_OPEN ){
if( sqlite3SafetyCheckSickOrOk(db) ){
testcase( sqlite3GlobalConfig.xLog!=0 );
logBadConnection("unopened");
}
return 0;
}else{
return 1;
}
}
SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){
u8 eOpenState;
eOpenState = db->eOpenState;
if( eOpenState!=SQLITE_STATE_SICK &&
eOpenState!=SQLITE_STATE_OPEN &&
eOpenState!=SQLITE_STATE_BUSY ){
testcase( sqlite3GlobalConfig.xLog!=0 );
logBadConnection("invalid");
return 0;
}else{
return 1;
}
}
|
| ︙ | ︙ | |||
33873 33874 33875 33876 33877 33878 33879 |
/* 14 */ "Yield" OpHelp(""),
/* 15 */ "MustBeInt" OpHelp(""),
/* 16 */ "Jump" OpHelp(""),
/* 17 */ "Once" OpHelp(""),
/* 18 */ "If" OpHelp(""),
/* 19 */ "Not" OpHelp("r[P2]= !r[P1]"),
/* 20 */ "IfNot" OpHelp(""),
| > | | | | | | | | | | | | | | | | | | | | | < > | | | | < > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | < < | | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | 33910 33911 33912 33913 33914 33915 33916 33917 33918 33919 33920 33921 33922 33923 33924 33925 33926 33927 33928 33929 33930 33931 33932 33933 33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027 34028 34029 34030 34031 34032 34033 34034 34035 34036 34037 34038 34039 34040 34041 34042 34043 34044 34045 34046 34047 34048 34049 34050 34051 34052 34053 34054 34055 34056 34057 34058 34059 34060 34061 34062 34063 34064 34065 34066 34067 34068 34069 34070 34071 34072 34073 34074 34075 34076 34077 34078 34079 34080 34081 34082 34083 34084 |
/* 14 */ "Yield" OpHelp(""),
/* 15 */ "MustBeInt" OpHelp(""),
/* 16 */ "Jump" OpHelp(""),
/* 17 */ "Once" OpHelp(""),
/* 18 */ "If" OpHelp(""),
/* 19 */ "Not" OpHelp("r[P2]= !r[P1]"),
/* 20 */ "IfNot" OpHelp(""),
/* 21 */ "IsNullOrType" OpHelp("if typeof(r[P1]) IN (P3,5) goto P2"),
/* 22 */ "IfNullRow" OpHelp("if P1.nullRow then r[P3]=NULL, goto P2"),
/* 23 */ "SeekLT" OpHelp("key=r[P3@P4]"),
/* 24 */ "SeekLE" OpHelp("key=r[P3@P4]"),
/* 25 */ "SeekGE" OpHelp("key=r[P3@P4]"),
/* 26 */ "SeekGT" OpHelp("key=r[P3@P4]"),
/* 27 */ "IfNotOpen" OpHelp("if( !csr[P1] ) goto P2"),
/* 28 */ "IfNoHope" OpHelp("key=r[P3@P4]"),
/* 29 */ "NoConflict" OpHelp("key=r[P3@P4]"),
/* 30 */ "NotFound" OpHelp("key=r[P3@P4]"),
/* 31 */ "Found" OpHelp("key=r[P3@P4]"),
/* 32 */ "SeekRowid" OpHelp("intkey=r[P3]"),
/* 33 */ "NotExists" OpHelp("intkey=r[P3]"),
/* 34 */ "Last" OpHelp(""),
/* 35 */ "IfSmaller" OpHelp(""),
/* 36 */ "SorterSort" OpHelp(""),
/* 37 */ "Sort" OpHelp(""),
/* 38 */ "Rewind" OpHelp(""),
/* 39 */ "IdxLE" OpHelp("key=r[P3@P4]"),
/* 40 */ "IdxGT" OpHelp("key=r[P3@P4]"),
/* 41 */ "IdxLT" OpHelp("key=r[P3@P4]"),
/* 42 */ "IdxGE" OpHelp("key=r[P3@P4]"),
/* 43 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"),
/* 44 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"),
/* 45 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"),
/* 46 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"),
/* 47 */ "Program" OpHelp(""),
/* 48 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"),
/* 49 */ "IfPos" OpHelp("if r[P1]>0 then r[P1]-=P3, goto P2"),
/* 50 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"),
/* 51 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"),
/* 52 */ "Ne" OpHelp("IF r[P3]!=r[P1]"),
/* 53 */ "Eq" OpHelp("IF r[P3]==r[P1]"),
/* 54 */ "Gt" OpHelp("IF r[P3]>r[P1]"),
/* 55 */ "Le" OpHelp("IF r[P3]<=r[P1]"),
/* 56 */ "Lt" OpHelp("IF r[P3]<r[P1]"),
/* 57 */ "Ge" OpHelp("IF r[P3]>=r[P1]"),
/* 58 */ "ElseEq" OpHelp(""),
/* 59 */ "IfNotZero" OpHelp("if r[P1]!=0 then r[P1]--, goto P2"),
/* 60 */ "DecrJumpZero" OpHelp("if (--r[P1])==0 goto P2"),
/* 61 */ "IncrVacuum" OpHelp(""),
/* 62 */ "VNext" OpHelp(""),
/* 63 */ "Init" OpHelp("Start at P2"),
/* 64 */ "PureFunc" OpHelp("r[P3]=func(r[P2@NP])"),
/* 65 */ "Function" OpHelp("r[P3]=func(r[P2@NP])"),
/* 66 */ "Return" OpHelp(""),
/* 67 */ "EndCoroutine" OpHelp(""),
/* 68 */ "HaltIfNull" OpHelp("if r[P3]=null halt"),
/* 69 */ "Halt" OpHelp(""),
/* 70 */ "Integer" OpHelp("r[P2]=P1"),
/* 71 */ "Int64" OpHelp("r[P2]=P4"),
/* 72 */ "String" OpHelp("r[P2]='P4' (len=P1)"),
/* 73 */ "Null" OpHelp("r[P2..P3]=NULL"),
/* 74 */ "SoftNull" OpHelp("r[P1]=NULL"),
/* 75 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"),
/* 76 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"),
/* 77 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"),
/* 78 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"),
/* 79 */ "SCopy" OpHelp("r[P2]=r[P1]"),
/* 80 */ "IntCopy" OpHelp("r[P2]=r[P1]"),
/* 81 */ "ChngCntRow" OpHelp("output=r[P1]"),
/* 82 */ "ResultRow" OpHelp("output=r[P1@P2]"),
/* 83 */ "CollSeq" OpHelp(""),
/* 84 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"),
/* 85 */ "RealAffinity" OpHelp(""),
/* 86 */ "Cast" OpHelp("affinity(r[P1])"),
/* 87 */ "Permutation" OpHelp(""),
/* 88 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"),
/* 89 */ "IsTrue" OpHelp("r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4"),
/* 90 */ "ZeroOrNull" OpHelp("r[P2] = 0 OR NULL"),
/* 91 */ "Offset" OpHelp("r[P3] = sqlite_offset(P1)"),
/* 92 */ "Column" OpHelp("r[P3]=PX"),
/* 93 */ "TypeCheck" OpHelp("typecheck(r[P1@P2])"),
/* 94 */ "Affinity" OpHelp("affinity(r[P1@P2])"),
/* 95 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"),
/* 96 */ "Count" OpHelp("r[P2]=count()"),
/* 97 */ "ReadCookie" OpHelp(""),
/* 98 */ "SetCookie" OpHelp(""),
/* 99 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"),
/* 100 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
/* 101 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
/* 102 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
/* 103 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
/* 104 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
/* 105 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
/* 106 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
/* 107 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
/* 108 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
/* 109 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
/* 110 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
/* 111 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
/* 112 */ "OpenDup" OpHelp(""),
/* 113 */ "BitNot" OpHelp("r[P2]= ~r[P1]"),
/* 114 */ "OpenAutoindex" OpHelp("nColumn=P2"),
/* 115 */ "OpenEphemeral" OpHelp("nColumn=P2"),
/* 116 */ "String8" OpHelp("r[P2]='P4'"),
/* 117 */ "SorterOpen" OpHelp(""),
/* 118 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"),
/* 119 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"),
/* 120 */ "Close" OpHelp(""),
/* 121 */ "ColumnsUsed" OpHelp(""),
/* 122 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"),
/* 123 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"),
/* 124 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
/* 125 */ "NewRowid" OpHelp("r[P2]=rowid"),
/* 126 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
/* 127 */ "RowCell" OpHelp(""),
/* 128 */ "Delete" OpHelp(""),
/* 129 */ "ResetCount" OpHelp(""),
/* 130 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
/* 131 */ "SorterData" OpHelp("r[P2]=data"),
/* 132 */ "RowData" OpHelp("r[P2]=data"),
/* 133 */ "Rowid" OpHelp("r[P2]=rowid"),
/* 134 */ "NullRow" OpHelp(""),
/* 135 */ "SeekEnd" OpHelp(""),
/* 136 */ "IdxInsert" OpHelp("key=r[P2]"),
/* 137 */ "SorterInsert" OpHelp("key=r[P2]"),
/* 138 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
/* 139 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
/* 140 */ "IdxRowid" OpHelp("r[P2]=rowid"),
/* 141 */ "FinishSeek" OpHelp(""),
/* 142 */ "Destroy" OpHelp(""),
/* 143 */ "Clear" OpHelp(""),
/* 144 */ "ResetSorter" OpHelp(""),
/* 145 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
/* 146 */ "SqlExec" OpHelp(""),
/* 147 */ "ParseSchema" OpHelp(""),
/* 148 */ "LoadAnalysis" OpHelp(""),
/* 149 */ "DropTable" OpHelp(""),
/* 150 */ "DropIndex" OpHelp(""),
/* 151 */ "DropTrigger" OpHelp(""),
/* 152 */ "Real" OpHelp("r[P2]=P4"),
/* 153 */ "IntegrityCk" OpHelp(""),
/* 154 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
/* 155 */ "Param" OpHelp(""),
/* 156 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
/* 157 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
/* 158 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
/* 159 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
/* 160 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
/* 161 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
/* 162 */ "AggValue" OpHelp("r[P3]=value N=P2"),
/* 163 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
/* 164 */ "Expire" OpHelp(""),
/* 165 */ "CursorLock" OpHelp(""),
/* 166 */ "CursorUnlock" OpHelp(""),
/* 167 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
/* 168 */ "VBegin" OpHelp(""),
/* 169 */ "VCreate" OpHelp(""),
/* 170 */ "VDestroy" OpHelp(""),
/* 171 */ "VOpen" OpHelp(""),
/* 172 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
/* 173 */ "VRename" OpHelp(""),
/* 174 */ "Pagecount" OpHelp(""),
/* 175 */ "MaxPgcnt" OpHelp(""),
/* 176 */ "Trace" OpHelp(""),
/* 177 */ "CursorHint" OpHelp(""),
/* 178 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"),
/* 179 */ "Noop" OpHelp(""),
/* 180 */ "Explain" OpHelp(""),
/* 181 */ "Abortable" OpHelp(""),
};
return azName[i];
}
#endif
/************** End of opcodes.c *********************************************/
/************** Begin file os_unix.c *****************************************/
|
| ︙ | ︙ | |||
49844 49845 49846 49847 49848 49849 49850 49851 49852 49853 49854 |
*/
static int numberOfCachePages(PCache *p){
if( p->szCache>=0 ){
/* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
** suggested cache size is set to N. */
return p->szCache;
}else{
/* IMPLEMANTATION-OF: R-59858-46238 If the argument N is negative, then the
** number of cache pages is adjusted to be a number of pages that would
** use approximately abs(N*1024) bytes of memory based on the current
** page size. */
| > | > > | 49883 49884 49885 49886 49887 49888 49889 49890 49891 49892 49893 49894 49895 49896 49897 49898 49899 49900 49901 49902 49903 49904 |
*/
static int numberOfCachePages(PCache *p){
if( p->szCache>=0 ){
/* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
** suggested cache size is set to N. */
return p->szCache;
}else{
i64 n;
/* IMPLEMANTATION-OF: R-59858-46238 If the argument N is negative, then the
** number of cache pages is adjusted to be a number of pages that would
** use approximately abs(N*1024) bytes of memory based on the current
** page size. */
n = ((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
if( n>1000000000 ) n = 1000000000;
return (int)n;
}
}
/*************************************************** General Interfaces ******
**
** Initialize and shutdown the page cache subsystem. Neither of these
** functions are threadsafe.
|
| ︙ | ︙ | |||
51303 51304 51305 51306 51307 51308 51309 51310 51311 51312 |
/*
** Implementation of the sqlite3_pcache.xCachesize method.
**
** Configure the cache_size limit for a cache.
*/
static void pcache1Cachesize(sqlite3_pcache *p, int nMax){
PCache1 *pCache = (PCache1 *)p;
if( pCache->bPurgeable ){
PGroup *pGroup = pCache->pGroup;
pcache1EnterMutex(pGroup);
| > > > > > > | | | | 51345 51346 51347 51348 51349 51350 51351 51352 51353 51354 51355 51356 51357 51358 51359 51360 51361 51362 51363 51364 51365 51366 51367 51368 51369 51370 51371 51372 51373 51374 51375 51376 51377 51378 51379 51380 51381 51382 51383 51384 51385 51386 |
/*
** Implementation of the sqlite3_pcache.xCachesize method.
**
** Configure the cache_size limit for a cache.
*/
static void pcache1Cachesize(sqlite3_pcache *p, int nMax){
PCache1 *pCache = (PCache1 *)p;
u32 n;
assert( nMax>=0 );
if( pCache->bPurgeable ){
PGroup *pGroup = pCache->pGroup;
pcache1EnterMutex(pGroup);
n = (u32)nMax;
if( n > 0x7fff0000 - pGroup->nMaxPage + pCache->nMax ){
n = 0x7fff0000 - pGroup->nMaxPage + pCache->nMax;
}
pGroup->nMaxPage += (n - pCache->nMax);
pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
pCache->nMax = n;
pCache->n90pct = pCache->nMax*9/10;
pcache1EnforceMaxPage(pCache);
pcache1LeaveMutex(pGroup);
}
}
/*
** Implementation of the sqlite3_pcache.xShrink method.
**
** Free up as much memory as possible.
*/
static void pcache1Shrink(sqlite3_pcache *p){
PCache1 *pCache = (PCache1*)p;
if( pCache->bPurgeable ){
PGroup *pGroup = pCache->pGroup;
unsigned int savedMaxPage;
pcache1EnterMutex(pGroup);
savedMaxPage = pGroup->nMaxPage;
pGroup->nMaxPage = 0;
pcache1EnforceMaxPage(pCache);
pGroup->nMaxPage = savedMaxPage;
pcache1LeaveMutex(pGroup);
}
|
| ︙ | ︙ | |||
68478 68479 68480 68481 68482 68483 68484 |
if( page1[18]>2 ){
pBt->btsFlags |= BTS_READ_ONLY;
}
if( page1[19]>2 ){
goto page1_init_failed;
}
| | | 68526 68527 68528 68529 68530 68531 68532 68533 68534 68535 68536 68537 68538 68539 68540 |
if( page1[18]>2 ){
pBt->btsFlags |= BTS_READ_ONLY;
}
if( page1[19]>2 ){
goto page1_init_failed;
}
/* If the read version is set to 2, this database should be accessed
** in WAL mode. If the log is not already open, open it now. Then
** return SQLITE_OK and return without populating BtShared.pPage1.
** The caller detects this and calls this function again. This is
** required as the version of page 1 currently in the page1 buffer
** may not be the latest version - there may be a newer one in the log
** file.
*/
|
| ︙ | ︙ | |||
81881 81882 81883 81884 81885 81886 81887 | #endif /* ** This routine is called the when a VDBE tries to halt. If the VDBE ** has made changes and is in autocommit mode, then commit those ** changes. If a rollback is needed, then do the rollback. ** | | | | | 81929 81930 81931 81932 81933 81934 81935 81936 81937 81938 81939 81940 81941 81942 81943 81944 81945 |
#endif
/*
** This routine is called the when a VDBE tries to halt. If the VDBE
** has made changes and is in autocommit mode, then commit those
** changes. If a rollback is needed, then do the rollback.
**
** This routine is the only way to move the sqlite3eOpenState of a VM from
** SQLITE_STATE_RUN to SQLITE_STATE_HALT. It is harmless to
** call this on a VM that is in the SQLITE_STATE_HALT state.
**
** Return an error code. If the commit could not complete because of
** lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it
** means the close did not happen and needs to be repeated.
*/
SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
int rc; /* Used to store transient return codes */
|
| ︙ | ︙ | |||
87049 87050 87051 87052 87053 87054 87055 87056 87057 87058 87059 87060 87061 87062 |
return out2PrereleaseWithClear(pOut);
}else{
pOut->flags = MEM_Int;
return pOut;
}
}
/*
** Execute as much of a VDBE program as we can.
** This is the core of sqlite3_step().
*/
SQLITE_PRIVATE int sqlite3VdbeExec(
Vdbe *p /* The VDBE */
| > > > > > > > > > > > > > | 87097 87098 87099 87100 87101 87102 87103 87104 87105 87106 87107 87108 87109 87110 87111 87112 87113 87114 87115 87116 87117 87118 87119 87120 87121 87122 87123 |
return out2PrereleaseWithClear(pOut);
}else{
pOut->flags = MEM_Int;
return pOut;
}
}
/*
** Return the symbolic name for the data type of a pMem
*/
static const char *vdbeMemTypeName(Mem *pMem){
static const char *azTypes[] = {
/* SQLITE_INTEGER */ "INT",
/* SQLITE_FLOAT */ "REAL",
/* SQLITE_TEXT */ "TEXT",
/* SQLITE_BLOB */ "BLOB",
/* SQLITE_NULL */ "NULL"
};
return azTypes[sqlite3_value_type(pMem)-1];
}
/*
** Execute as much of a VDBE program as we can.
** This is the core of sqlite3_step().
*/
SQLITE_PRIVATE int sqlite3VdbeExec(
Vdbe *p /* The VDBE */
|
| ︙ | ︙ | |||
88879 88880 88881 88882 88883 88884 88885 88886 88887 88888 88889 88890 88891 88892 |
pIn1 = &aMem[pOp->p1];
VdbeBranchTaken( (pIn1->flags & MEM_Null)!=0, 2);
if( (pIn1->flags & MEM_Null)!=0 ){
goto jump_to_p2;
}
break;
}
/* Opcode: ZeroOrNull P1 P2 P3 * *
** Synopsis: r[P2] = 0 OR NULL
**
** If all both registers P1 and P3 are NOT NULL, then store a zero in
** register P2. If either registers P1 or P3 are NULL then put
** a NULL in register P2.
| > > > > > > > > > > > > > > > > | 88940 88941 88942 88943 88944 88945 88946 88947 88948 88949 88950 88951 88952 88953 88954 88955 88956 88957 88958 88959 88960 88961 88962 88963 88964 88965 88966 88967 88968 88969 |
pIn1 = &aMem[pOp->p1];
VdbeBranchTaken( (pIn1->flags & MEM_Null)!=0, 2);
if( (pIn1->flags & MEM_Null)!=0 ){
goto jump_to_p2;
}
break;
}
/* Opcode: IsNullOrType P1 P2 P3 * *
** Synopsis: if typeof(r[P1]) IN (P3,5) goto P2
**
** Jump to P2 if the value in register P1 is NULL or has a datatype P3.
** P3 is an integer which should be one of SQLITE_INTEGER, SQLITE_FLOAT,
** SQLITE_BLOB, SQLITE_NULL, or SQLITE_TEXT.
*/
case OP_IsNullOrType: { /* jump, in1 */
int doTheJump;
pIn1 = &aMem[pOp->p1];
doTheJump = (pIn1->flags & MEM_Null)!=0 || sqlite3_value_type(pIn1)==pOp->p3;
VdbeBranchTaken( doTheJump, 2);
if( doTheJump ) goto jump_to_p2;
break;
}
/* Opcode: ZeroOrNull P1 P2 P3 * *
** Synopsis: r[P2] = 0 OR NULL
**
** If all both registers P1 and P3 are NOT NULL, then store a zero in
** register P2. If either registers P1 or P3 are NULL then put
** a NULL in register P2.
|
| ︙ | ︙ | |||
89247 89248 89249 89250 89251 89252 89253 89254 89255 89256 89257 89258 89259 89260 |
pOp = &aOp[aOp[0].p3-1];
break;
}else{
rc = SQLITE_CORRUPT_BKPT;
goto abort_due_to_error;
}
}
/* Opcode: Affinity P1 P2 * P4 *
** Synopsis: affinity(r[P1@P2])
**
** Apply affinities to a range of P2 registers starting with P1.
**
** P4 is a string that is P2 characters long. The N-th character of the
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 89324 89325 89326 89327 89328 89329 89330 89331 89332 89333 89334 89335 89336 89337 89338 89339 89340 89341 89342 89343 89344 89345 89346 89347 89348 89349 89350 89351 89352 89353 89354 89355 89356 89357 89358 89359 89360 89361 89362 89363 89364 89365 89366 89367 89368 89369 89370 89371 89372 89373 89374 89375 89376 89377 89378 89379 89380 89381 89382 89383 89384 89385 89386 89387 89388 89389 89390 89391 89392 89393 89394 89395 89396 89397 89398 89399 89400 89401 89402 89403 89404 89405 89406 89407 89408 89409 89410 89411 89412 89413 89414 89415 89416 89417 89418 89419 89420 89421 89422 89423 89424 89425 89426 89427 89428 89429 89430 89431 |
pOp = &aOp[aOp[0].p3-1];
break;
}else{
rc = SQLITE_CORRUPT_BKPT;
goto abort_due_to_error;
}
}
/* Opcode: TypeCheck P1 P2 * P4 *
** Synopsis: typecheck(r[P1@P2])
**
** Apply affinities to the range of P2 registers beginning with P1.
** Take the affinities from the Table object in P4. If any value
** cannot be coerced into the correct type, then raise an error.
**
** This opcode is similar to OP_Affinity except that this opcode
** forces the register type to the Table column type. This is used
** to implement "strict affinity".
**
** Preconditions:
**
** <ul>
** <li> P2 should be the number of non-virtual columns in the
** table of P4.
** <li> Table P4 should be a STRICT table.
** </ul>
**
** If any precondition is false, an assertion fault occurs.
*/
case OP_TypeCheck: {
Table *pTab;
Column *aCol;
int i;
assert( pOp->p4type==P4_TABLE );
pTab = pOp->p4.pTab;
assert( pTab->tabFlags & TF_Strict );
assert( pTab->nNVCol==pOp->p2 );
aCol = pTab->aCol;
pIn1 = &aMem[pOp->p1];
for(i=0; i<pTab->nCol; i++){
if( aCol[i].colFlags & COLFLAG_VIRTUAL ) continue;
assert( pIn1 < &aMem[pOp->p1+pOp->p2] );
applyAffinity(pIn1, aCol[i].affinity, encoding);
if( (pIn1->flags & MEM_Null)==0 ){
switch( aCol[i].eCType ){
case COLTYPE_BLOB: {
if( (pIn1->flags & MEM_Blob)==0 ) goto vdbe_type_error;
break;
}
case COLTYPE_INTEGER:
case COLTYPE_INT: {
if( (pIn1->flags & MEM_Int)==0 ) goto vdbe_type_error;
break;
}
case COLTYPE_TEXT: {
if( (pIn1->flags & MEM_Str)==0 ) goto vdbe_type_error;
break;
}
case COLTYPE_REAL: {
if( pIn1->flags & MEM_Int ){
/* When applying REAL affinity, if the result is still an MEM_Int
** that will fit in 6 bytes, then change the type to MEM_IntReal
** so that we keep the high-resolution integer value but know that
** the type really wants to be REAL. */
testcase( pIn1->u.i==140737488355328LL );
testcase( pIn1->u.i==140737488355327LL );
testcase( pIn1->u.i==-140737488355328LL );
testcase( pIn1->u.i==-140737488355329LL );
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL){
pIn1->flags |= MEM_IntReal;
pIn1->flags &= ~MEM_Int;
}else{
pIn1->u.r = (double)pIn1->u.i;
pIn1->flags |= MEM_Real;
pIn1->flags &= ~MEM_Int;
}
}else if( (pIn1->flags & MEM_Real)==0 ){
goto vdbe_type_error;
}
break;
}
default: {
/* COLTYPE_ANY. Accept anything. */
break;
}
}
}
REGISTER_TRACE((int)(pIn1-aMem), pIn1);
pIn1++;
}
assert( pIn1 == &aMem[pOp->p1+pOp->p2] );
break;
vdbe_type_error:
sqlite3VdbeError(p, "cannot store %s value in %s column %s.%s",
vdbeMemTypeName(pIn1), sqlite3StdType[aCol[i].eCType-1],
pTab->zName, aCol[i].zCnName);
rc = SQLITE_CONSTRAINT_DATATYPE;
goto abort_due_to_error;
}
/* Opcode: Affinity P1 P2 * P4 *
** Synopsis: affinity(r[P1@P2])
**
** Apply affinities to a range of P2 registers starting with P1.
**
** P4 is a string that is P2 characters long. The N-th character of the
|
| ︙ | ︙ | |||
92298 92299 92300 92301 92302 92303 92304 | ** index opened by cursor P1. ** ** If P5 is not zero, then raise an SQLITE_CORRUPT_INDEX error ** if no matching index entry is found. This happens when running ** an UPDATE or DELETE statement and the index entry to be updated ** or deleted is not found. For some uses of IdxDelete ** (example: the EXCEPT operator) it does not matter that no matching | | > | 92469 92470 92471 92472 92473 92474 92475 92476 92477 92478 92479 92480 92481 92482 92483 92484 |
** index opened by cursor P1.
**
** If P5 is not zero, then raise an SQLITE_CORRUPT_INDEX error
** if no matching index entry is found. This happens when running
** an UPDATE or DELETE statement and the index entry to be updated
** or deleted is not found. For some uses of IdxDelete
** (example: the EXCEPT operator) it does not matter that no matching
** entry is found. For those cases, P5 is zero. Also, do not raise
** this (self-correcting and non-critical) error if in writable_schema mode.
*/
case OP_IdxDelete: {
VdbeCursor *pC;
BtCursor *pCrsr;
int res;
UnpackedRecord r;
|
| ︙ | ︙ | |||
92324 92325 92326 92327 92328 92329 92330 |
r.default_rc = 0;
r.aMem = &aMem[pOp->p2];
rc = sqlite3BtreeIndexMoveto(pCrsr, &r, &res);
if( rc ) goto abort_due_to_error;
if( res==0 ){
rc = sqlite3BtreeDelete(pCrsr, BTREE_AUXDELETE);
if( rc ) goto abort_due_to_error;
| | | 92496 92497 92498 92499 92500 92501 92502 92503 92504 92505 92506 92507 92508 92509 92510 |
r.default_rc = 0;
r.aMem = &aMem[pOp->p2];
rc = sqlite3BtreeIndexMoveto(pCrsr, &r, &res);
if( rc ) goto abort_due_to_error;
if( res==0 ){
rc = sqlite3BtreeDelete(pCrsr, BTREE_AUXDELETE);
if( rc ) goto abort_due_to_error;
}else if( pOp->p5 && !sqlite3WritableSchema(db) ){
rc = sqlite3ReportError(SQLITE_CORRUPT_INDEX, __LINE__, "index corruption");
goto abort_due_to_error;
}
assert( pC->deferredMoveto==0 );
pC->cacheStatus = CACHE_STALE;
pC->seekResult = 0;
break;
|
| ︙ | ︙ | |||
113940 113941 113942 113943 113944 113945 113946 |
pCol->hName = hName;
sqlite3ColumnPropertiesFromName(p, pCol);
if( sType.n==0 ){
/* If there is no type specified, columns have the default affinity
** 'BLOB' with a default size of 4 bytes. */
pCol->affinity = affinity;
| | | 114112 114113 114114 114115 114116 114117 114118 114119 114120 114121 114122 114123 114124 114125 114126 |
pCol->hName = hName;
sqlite3ColumnPropertiesFromName(p, pCol);
if( sType.n==0 ){
/* If there is no type specified, columns have the default affinity
** 'BLOB' with a default size of 4 bytes. */
pCol->affinity = affinity;
pCol->eCType = eType;
pCol->szEst = szEst;
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
if( affinity==SQLITE_AFF_BLOB ){
if( 4>=sqlite3GlobalConfig.szSorterRef ){
pCol->colFlags |= COLFLAG_SORTERREF;
}
}
|
| ︙ | ︙ | |||
114235 114236 114237 114238 114239 114240 114241 |
}
}
}
}
}
if( nTerm==1
&& pCol
| | | 114407 114408 114409 114410 114411 114412 114413 114414 114415 114416 114417 114418 114419 114420 114421 |
}
}
}
}
}
if( nTerm==1
&& pCol
&& pCol->eCType==COLTYPE_INTEGER
&& sortOrder!=SQLITE_SO_DESC
){
if( IN_RENAME_OBJECT && pList ){
Expr *pCExpr = sqlite3ExprSkipCollate(pList->a[0].pExpr);
sqlite3RenameTokenRemap(pParse, &pTab->iPKey, pCExpr);
}
pTab->iPKey = iCol;
|
| ︙ | ︙ | |||
114707 114708 114709 114710 114711 114712 114713 |
sqlite3 *db = pParse->db;
Vdbe *v = pParse->pVdbe;
/* Mark every PRIMARY KEY column as NOT NULL (except for imposter tables)
*/
if( !db->init.imposterTable ){
for(i=0; i<pTab->nCol; i++){
| | > > | 114879 114880 114881 114882 114883 114884 114885 114886 114887 114888 114889 114890 114891 114892 114893 114894 114895 |
sqlite3 *db = pParse->db;
Vdbe *v = pParse->pVdbe;
/* Mark every PRIMARY KEY column as NOT NULL (except for imposter tables)
*/
if( !db->init.imposterTable ){
for(i=0; i<pTab->nCol; i++){
if( (pTab->aCol[i].colFlags & COLFLAG_PRIMKEY)!=0
&& (pTab->aCol[i].notNull==OE_None)
){
pTab->aCol[i].notNull = OE_Abort;
}
}
pTab->tabFlags |= TF_HasNotNull;
}
/* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY
|
| ︙ | ︙ | |||
114940 114941 114942 114943 114944 114945 114946 | ** "CREATE TABLE ... AS SELECT ..." statement. The column names of ** the new table will match the result set of the SELECT. */ SQLITE_PRIVATE void sqlite3EndTable( Parse *pParse, /* Parse context */ Token *pCons, /* The ',' token after the last column defn. */ Token *pEnd, /* The ')' before options in the CREATE TABLE */ | | | 115114 115115 115116 115117 115118 115119 115120 115121 115122 115123 115124 115125 115126 115127 115128 |
** "CREATE TABLE ... AS SELECT ..." statement. The column names of
** the new table will match the result set of the SELECT.
*/
SQLITE_PRIVATE void sqlite3EndTable(
Parse *pParse, /* Parse context */
Token *pCons, /* The ',' token after the last column defn. */
Token *pEnd, /* The ')' before options in the CREATE TABLE */
u32 tabOpts, /* Extra table options. Usually 0. */
Select *pSelect /* Select from a "CREATE ... AS SELECT" */
){
Table *p; /* The new table */
sqlite3 *db = pParse->db; /* The database connection */
int iDb; /* Database in which the table lives */
Index *pIdx; /* An implied index of the table */
|
| ︙ | ︙ | |||
114975 114976 114977 114978 114979 114980 114981 114982 114983 114984 114985 114986 114987 114988 |
if( pSelect ){
sqlite3ErrorMsg(pParse, "");
return;
}
p->tnum = db->init.newTnum;
if( p->tnum==1 ) p->tabFlags |= TF_Readonly;
}
assert( (p->tabFlags & TF_HasPrimaryKey)==0
|| p->iPKey>=0 || sqlite3PrimaryKeyIndex(p)!=0 );
assert( (p->tabFlags & TF_HasPrimaryKey)!=0
|| (p->iPKey<0 && sqlite3PrimaryKeyIndex(p)==0) );
/* Special processing for WITHOUT ROWID Tables */
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 115149 115150 115151 115152 115153 115154 115155 115156 115157 115158 115159 115160 115161 115162 115163 115164 115165 115166 115167 115168 115169 115170 115171 115172 115173 115174 115175 115176 115177 115178 115179 115180 115181 115182 115183 115184 115185 115186 115187 115188 115189 115190 115191 115192 115193 115194 115195 115196 115197 115198 115199 115200 |
if( pSelect ){
sqlite3ErrorMsg(pParse, "");
return;
}
p->tnum = db->init.newTnum;
if( p->tnum==1 ) p->tabFlags |= TF_Readonly;
}
/* Special processing for tables that include the STRICT keyword:
**
** * Do not allow custom column datatypes. Every column must have
** a datatype that is one of INT, INTEGER, REAL, TEXT, or BLOB.
**
** * If a PRIMARY KEY is defined, other than the INTEGER PRIMARY KEY,
** then all columns of the PRIMARY KEY must have a NOT NULL
** constraint.
*/
if( tabOpts & TF_Strict ){
int ii;
p->tabFlags |= TF_Strict;
for(ii=0; ii<p->nCol; ii++){
Column *pCol = &p->aCol[ii];
if( pCol->eCType==COLTYPE_CUSTOM ){
if( pCol->colFlags & COLFLAG_HASTYPE ){
sqlite3ErrorMsg(pParse,
"unknown datatype for %s.%s: \"%s\"",
p->zName, pCol->zCnName, sqlite3ColumnType(pCol, "")
);
}else{
sqlite3ErrorMsg(pParse, "missing datatype for %s.%s",
p->zName, pCol->zCnName);
}
return;
}else if( pCol->eCType==COLTYPE_ANY ){
pCol->affinity = SQLITE_AFF_BLOB;
}
if( (pCol->colFlags & COLFLAG_PRIMKEY)!=0
&& p->iPKey!=ii
&& pCol->notNull == OE_None
){
pCol->notNull = OE_Abort;
p->tabFlags |= TF_HasNotNull;
}
}
}
assert( (p->tabFlags & TF_HasPrimaryKey)==0
|| p->iPKey>=0 || sqlite3PrimaryKeyIndex(p)!=0 );
assert( (p->tabFlags & TF_HasPrimaryKey)!=0
|| (p->iPKey<0 && sqlite3PrimaryKeyIndex(p)==0) );
/* Special processing for WITHOUT ROWID Tables */
|
| ︙ | ︙ | |||
123284 123285 123286 123287 123288 123289 123290 123291 123292 123293 |
pIdx->zColAff[n] = 0;
}
return pIdx->zColAff;
}
/*
** Compute the affinity string for table pTab, if it has not already been
** computed. As an optimization, omit trailing SQLITE_AFF_BLOB affinities.
**
| > > > > > > | > > | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | 123496 123497 123498 123499 123500 123501 123502 123503 123504 123505 123506 123507 123508 123509 123510 123511 123512 123513 123514 123515 123516 123517 123518 123519 123520 123521 123522 123523 123524 123525 123526 123527 123528 123529 123530 123531 123532 123533 123534 123535 123536 123537 123538 123539 123540 123541 123542 123543 123544 123545 123546 123547 123548 123549 123550 123551 123552 123553 123554 123555 123556 123557 123558 123559 123560 123561 123562 123563 123564 123565 123566 123567 123568 123569 123570 123571 |
pIdx->zColAff[n] = 0;
}
return pIdx->zColAff;
}
/*
** Make changes to the evolving bytecode to do affinity transformations
** of values that are about to be gathered into a row for table pTab.
**
** For ordinary (legacy, non-strict) tables:
** -----------------------------------------
**
** Compute the affinity string for table pTab, if it has not already been
** computed. As an optimization, omit trailing SQLITE_AFF_BLOB affinities.
**
** If the affinity string is empty (because it was all SQLITE_AFF_BLOB entries
** which were then optimized out) then this routine becomes a no-op.
**
** Otherwise if iReg>0 then code an OP_Affinity opcode that will set the
** affinities for register iReg and following. Or if iReg==0,
** then just set the P4 operand of the previous opcode (which should be
** an OP_MakeRecord) to the affinity string.
**
** A column affinity string has one character per column:
**
** Character Column affinity
** --------- ---------------
** 'A' BLOB
** 'B' TEXT
** 'C' NUMERIC
** 'D' INTEGER
** 'E' REAL
**
** For STRICT tables:
** ------------------
**
** Generate an appropropriate OP_TypeCheck opcode that will verify the
** datatypes against the column definitions in pTab. If iReg==0, that
** means an OP_MakeRecord opcode has already been generated and should be
** the last opcode generated. The new OP_TypeCheck needs to be inserted
** before the OP_MakeRecord. The new OP_TypeCheck should use the same
** register set as the OP_MakeRecord. If iReg>0 then register iReg is
** the first of a series of registers that will form the new record.
** Apply the type checking to that array of registers.
*/
SQLITE_PRIVATE void sqlite3TableAffinity(Vdbe *v, Table *pTab, int iReg){
int i, j;
char *zColAff;
if( pTab->tabFlags & TF_Strict ){
if( iReg==0 ){
/* Move the previous opcode (which should be OP_MakeRecord) forward
** by one slot and insert a new OP_TypeCheck where the current
** OP_MakeRecord is found */
VdbeOp *pPrev;
sqlite3VdbeAppendP4(v, pTab, P4_TABLE);
pPrev = sqlite3VdbeGetOp(v, -1);
assert( pPrev!=0 );
assert( pPrev->opcode==OP_MakeRecord || sqlite3VdbeDb(v)->mallocFailed );
pPrev->opcode = OP_TypeCheck;
sqlite3VdbeAddOp3(v, OP_MakeRecord, pPrev->p1, pPrev->p2, pPrev->p3);
}else{
/* Insert an isolated OP_Typecheck */
sqlite3VdbeAddOp2(v, OP_TypeCheck, iReg, pTab->nNVCol);
sqlite3VdbeAppendP4(v, pTab, P4_TABLE);
}
return;
}
zColAff = pTab->zColAff;
if( zColAff==0 ){
sqlite3 *db = sqlite3VdbeDb(v);
zColAff = (char *)sqlite3DbMallocRaw(0, pTab->nCol+1);
if( !zColAff ){
sqlite3OomFault(db);
return;
}
|
| ︙ | ︙ | |||
123331 123332 123333 123334 123335 123336 123337 123338 123339 123340 123341 123342 123343 123344 |
}
assert( zColAff!=0 );
i = sqlite3Strlen30NN(zColAff);
if( i ){
if( iReg ){
sqlite3VdbeAddOp4(v, OP_Affinity, iReg, i, 0, zColAff, i);
}else{
sqlite3VdbeChangeP4(v, -1, zColAff, i);
}
}
}
/*
** Return non-zero if the table pTab in database iDb or any of its indices
| > > | 123583 123584 123585 123586 123587 123588 123589 123590 123591 123592 123593 123594 123595 123596 123597 123598 |
}
assert( zColAff!=0 );
i = sqlite3Strlen30NN(zColAff);
if( i ){
if( iReg ){
sqlite3VdbeAddOp4(v, OP_Affinity, iReg, i, 0, zColAff, i);
}else{
assert( sqlite3VdbeGetOp(v, -1)->opcode==OP_MakeRecord
|| sqlite3VdbeDb(v)->mallocFailed );
sqlite3VdbeChangeP4(v, -1, zColAff, i);
}
}
}
/*
** Return non-zero if the table pTab in database iDb or any of its indices
|
| ︙ | ︙ | |||
125968 125969 125970 125971 125972 125973 125974 125975 125976 125977 125978 125979 125980 125981 |
return 0; /* tab2 may not be a view or virtual table */
}
if( pDest->nCol!=pSrc->nCol ){
return 0; /* Number of columns must be the same in tab1 and tab2 */
}
if( pDest->iPKey!=pSrc->iPKey ){
return 0; /* Both tables must have the same INTEGER PRIMARY KEY */
}
for(i=0; i<pDest->nCol; i++){
Column *pDestCol = &pDest->aCol[i];
Column *pSrcCol = &pSrc->aCol[i];
#ifdef SQLITE_ENABLE_HIDDEN_COLUMNS
if( (db->mDbFlags & DBFLAG_Vacuum)==0
&& (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN
| > > > | 126222 126223 126224 126225 126226 126227 126228 126229 126230 126231 126232 126233 126234 126235 126236 126237 126238 |
return 0; /* tab2 may not be a view or virtual table */
}
if( pDest->nCol!=pSrc->nCol ){
return 0; /* Number of columns must be the same in tab1 and tab2 */
}
if( pDest->iPKey!=pSrc->iPKey ){
return 0; /* Both tables must have the same INTEGER PRIMARY KEY */
}
if( (pDest->tabFlags & TF_Strict)!=0 && (pSrc->tabFlags & TF_Strict)==0 ){
return 0; /* Cannot feed from a non-strict into a strict table */
}
for(i=0; i<pDest->nCol; i++){
Column *pDestCol = &pDest->aCol[i];
Column *pSrcCol = &pSrc->aCol[i];
#ifdef SQLITE_ENABLE_HIDDEN_COLUMNS
if( (db->mDbFlags & DBFLAG_Vacuum)==0
&& (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN
|
| ︙ | ︙ | |||
130235 130236 130237 130238 130239 130240 130241 130242 130243 130244 130245 130246 130247 130248 |
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
Table *pTab = sqliteHashData(x);
Index *pIdx, *pPk;
Index *pPrior = 0;
int loopTop;
int iDataCur, iIdxCur;
int r1 = -1;
if( pTab->tnum<1 ) continue; /* Skip VIEWs or VIRTUAL TABLEs */
if( pObjTab && pObjTab!=pTab ) continue;
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenRead, 0,
1, 0, &iDataCur, &iIdxCur);
/* reg[7] counts the number of entries in the table.
| > | 130492 130493 130494 130495 130496 130497 130498 130499 130500 130501 130502 130503 130504 130505 130506 |
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
Table *pTab = sqliteHashData(x);
Index *pIdx, *pPk;
Index *pPrior = 0;
int loopTop;
int iDataCur, iIdxCur;
int r1 = -1;
int bStrict;
if( pTab->tnum<1 ) continue; /* Skip VIEWs or VIRTUAL TABLEs */
if( pObjTab && pObjTab!=pTab ) continue;
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenRead, 0,
1, 0, &iDataCur, &iIdxCur);
/* reg[7] counts the number of entries in the table.
|
| ︙ | ︙ | |||
130256 130257 130258 130259 130260 130261 130262 130263 |
assert( sqlite3NoTempsInRange(pParse,1,7+j) );
sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0); VdbeCoverage(v);
loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
if( !isQuick ){
/* Sanity check on record header decoding */
sqlite3VdbeAddOp3(v, OP_Column, iDataCur, pTab->nNVCol-1,3);
sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
}
| > | > > > | | > > | | > > > > > > > > > > > > > > > | | > | | > | 130514 130515 130516 130517 130518 130519 130520 130521 130522 130523 130524 130525 130526 130527 130528 130529 130530 130531 130532 130533 130534 130535 130536 130537 130538 130539 130540 130541 130542 130543 130544 130545 130546 130547 130548 130549 130550 130551 130552 130553 130554 130555 130556 130557 130558 130559 130560 130561 130562 130563 130564 130565 130566 130567 |
assert( sqlite3NoTempsInRange(pParse,1,7+j) );
sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0); VdbeCoverage(v);
loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
if( !isQuick ){
/* Sanity check on record header decoding */
sqlite3VdbeAddOp3(v, OP_Column, iDataCur, pTab->nNVCol-1,3);
sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
VdbeComment((v, "(right-most column)"));
}
/* Verify that all NOT NULL columns really are NOT NULL. At the
** same time verify the type of the content of STRICT tables */
bStrict = (pTab->tabFlags & TF_Strict)!=0;
for(j=0; j<pTab->nCol; j++){
char *zErr;
Column *pCol = pTab->aCol + j;
int doError, jmp2;
if( j==pTab->iPKey ) continue;
if( pCol->notNull==0 && !bStrict ) continue;
doError = bStrict ? sqlite3VdbeMakeLabel(pParse) : 0;
sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, j, 3);
if( sqlite3VdbeGetOp(v,-1)->opcode==OP_Column ){
sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
}
if( pCol->notNull ){
jmp2 = sqlite3VdbeAddOp1(v, OP_NotNull, 3); VdbeCoverage(v);
zErr = sqlite3MPrintf(db, "NULL value in %s.%s", pTab->zName,
pCol->zCnName);
sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, zErr, P4_DYNAMIC);
if( bStrict ){
sqlite3VdbeGoto(v, doError);
}else{
integrityCheckResultRow(v);
}
sqlite3VdbeJumpHere(v, jmp2);
}
if( pTab->tabFlags & TF_Strict ){
jmp2 = sqlite3VdbeAddOp3(v, OP_IsNullOrType, 3, 0,
sqlite3StdTypeMap[pCol->eCType-1]);
VdbeCoverage(v);
zErr = sqlite3MPrintf(db, "non-%s value in %s.%s",
sqlite3StdType[pCol->eCType-1],
pTab->zName, pTab->aCol[j].zCnName);
sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, zErr, P4_DYNAMIC);
sqlite3VdbeResolveLabel(v, doError);
integrityCheckResultRow(v);
sqlite3VdbeJumpHere(v, jmp2);
}
}
/* Verify CHECK constraints */
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){
ExprList *pCheck = sqlite3ExprListDup(db, pTab->pCheck, 0);
if( db->mallocFailed==0 ){
int addrCkFault = sqlite3VdbeMakeLabel(pParse);
int addrCkOk = sqlite3VdbeMakeLabel(pParse);
|
| ︙ | ︙ | |||
134399 134400 134401 134402 134403 134404 134405 |
if( pCol->zCnName ){
memcpy(&pCol->zCnName[n+1], zType, m+1);
pCol->colFlags |= COLFLAG_HASTYPE;
}
}
if( pCol->affinity<=SQLITE_AFF_NONE ) pCol->affinity = aff;
pColl = sqlite3ExprCollSeq(pParse, p);
| | | 134680 134681 134682 134683 134684 134685 134686 134687 134688 134689 134690 134691 134692 134693 134694 |
if( pCol->zCnName ){
memcpy(&pCol->zCnName[n+1], zType, m+1);
pCol->colFlags |= COLFLAG_HASTYPE;
}
}
if( pCol->affinity<=SQLITE_AFF_NONE ) pCol->affinity = aff;
pColl = sqlite3ExprCollSeq(pParse, p);
if( pColl ){
assert( pTab->pIndex==0 );
sqlite3ColumnSetColl(db, pCol, pColl->zName);
}
}
pTab->szTabRow = 1; /* Any non-zero value works */
}
|
| ︙ | ︙ | |||
135221 135222 135223 135224 135225 135226 135227 |
}
sqlite3KeyInfoUnref(pKeyInfo);
}
multi_select_end:
pDest->iSdst = dest.iSdst;
pDest->nSdst = dest.nSdst;
| > > | > > | 135502 135503 135504 135505 135506 135507 135508 135509 135510 135511 135512 135513 135514 135515 135516 135517 135518 135519 135520 |
}
sqlite3KeyInfoUnref(pKeyInfo);
}
multi_select_end:
pDest->iSdst = dest.iSdst;
pDest->nSdst = dest.nSdst;
if( pDelete ){
sqlite3ParserAddCleanup(pParse,
(void(*)(sqlite3*,void*))sqlite3SelectDelete,
pDelete);
}
return rc;
}
#endif /* SQLITE_OMIT_COMPOUND_SELECT */
/*
** Error message for when two or more terms of a compound select have different
** size result sets.
|
| ︙ | ︙ | |||
138789 138790 138791 138792 138793 138794 138795 |
*/
pParse->nHeight += sqlite3SelectExprHeight(p);
/* Make copies of constant WHERE-clause terms in the outer query down
** inside the subquery. This can help the subquery to run more efficiently.
*/
if( OptimizationEnabled(db, SQLITE_PushDown)
| | > | 139074 139075 139076 139077 139078 139079 139080 139081 139082 139083 139084 139085 139086 139087 139088 139089 |
*/
pParse->nHeight += sqlite3SelectExprHeight(p);
/* Make copies of constant WHERE-clause terms in the outer query down
** inside the subquery. This can help the subquery to run more efficiently.
*/
if( OptimizationEnabled(db, SQLITE_PushDown)
&& (pItem->fg.isCte==0
|| (pItem->u2.pCteUse->eM10d!=M10d_Yes && pItem->u2.pCteUse->nUse<2))
&& pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
(pItem->fg.jointype & JT_OUTER)!=0)
){
#if SELECTTRACE_ENABLED
if( sqlite3SelectTrace & 0x100 ){
SELECTTRACE(0x100,pParse,p,
("After WHERE-clause push-down into subquery %d:\n", pSub->selId));
|
| ︙ | ︙ | |||
138850 138851 138852 138853 138854 138855 138856 138857 138858 138859 138860 138861 138862 138863 |
** generated. Invoke the subroutine to compute the materialization,
** the make the pItem->iCursor be a copy of the ephemerial table that
** holds the result of the materialization. */
CteUse *pCteUse = pItem->u2.pCteUse;
sqlite3VdbeAddOp2(v, OP_Gosub, pCteUse->regRtn, pCteUse->addrM9e);
if( pItem->iCursor!=pCteUse->iCur ){
sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pCteUse->iCur);
}
pSub->nSelectRow = pCteUse->nRowEst;
}else if( (pPrior = isSelfJoinView(pTabList, pItem))!=0 ){
/* This view has already been materialized by a prior entry in
** this same FROM clause. Reuse it. */
if( pPrior->addrFillSub ){
sqlite3VdbeAddOp2(v, OP_Gosub, pPrior->regReturn, pPrior->addrFillSub);
| > | 139136 139137 139138 139139 139140 139141 139142 139143 139144 139145 139146 139147 139148 139149 139150 |
** generated. Invoke the subroutine to compute the materialization,
** the make the pItem->iCursor be a copy of the ephemerial table that
** holds the result of the materialization. */
CteUse *pCteUse = pItem->u2.pCteUse;
sqlite3VdbeAddOp2(v, OP_Gosub, pCteUse->regRtn, pCteUse->addrM9e);
if( pItem->iCursor!=pCteUse->iCur ){
sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pCteUse->iCur);
VdbeComment((v, "%!S", pItem));
}
pSub->nSelectRow = pCteUse->nRowEst;
}else if( (pPrior = isSelfJoinView(pTabList, pItem))!=0 ){
/* This view has already been materialized by a prior entry in
** this same FROM clause. Reuse it. */
if( pPrior->addrFillSub ){
sqlite3VdbeAddOp2(v, OP_Gosub, pPrior->regReturn, pPrior->addrFillSub);
|
| ︙ | ︙ | |||
143565 143566 143567 143568 143569 143570 143571 |
** reaches zero, call the xDisconnect() method to delete the object.
*/
SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){
sqlite3 *db = pVTab->db;
assert( db );
assert( pVTab->nRef>0 );
| | > | 143852 143853 143854 143855 143856 143857 143858 143859 143860 143861 143862 143863 143864 143865 143866 143867 |
** reaches zero, call the xDisconnect() method to delete the object.
*/
SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){
sqlite3 *db = pVTab->db;
assert( db );
assert( pVTab->nRef>0 );
assert( db->eOpenState==SQLITE_STATE_OPEN
|| db->eOpenState==SQLITE_STATE_ZOMBIE );
pVTab->nRef--;
if( pVTab->nRef==0 ){
sqlite3_vtab *p = pVTab->pVtab;
sqlite3VtabModuleUnref(pVTab->db, pVTab->pMod);
if( p ){
p->pModule->xDisconnect(p);
|
| ︙ | ︙ | |||
146797 146798 146799 146800 146801 146802 146803 |
iReleaseReg = ++pParse->nMem;
iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, 0, bRev, iReleaseReg);
if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg);
addrNxt = pLevel->addrNxt;
sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg);
VdbeCoverage(v);
pLevel->op = OP_Noop;
| < < < | 147085 147086 147087 147088 147089 147090 147091 147092 147093 147094 147095 147096 147097 147098 |
iReleaseReg = ++pParse->nMem;
iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, 0, bRev, iReleaseReg);
if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg);
addrNxt = pLevel->addrNxt;
sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg);
VdbeCoverage(v);
pLevel->op = OP_Noop;
}else if( (pLoop->wsFlags & WHERE_IPK)!=0
&& (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0
){
/* Case 3: We have an inequality comparison against the ROWID field.
*/
int testOp = OP_Noop;
int start;
|
| ︙ | ︙ | |||
151456 151457 151458 151459 151460 151461 151462 |
sqlite3DbFree(pWInfo->pParse->db, p);
}
}
/*
** Return TRUE if all of the following are true:
**
| | > | 151741 151742 151743 151744 151745 151746 151747 151748 151749 151750 151751 151752 151753 151754 151755 151756 |
sqlite3DbFree(pWInfo->pParse->db, p);
}
}
/*
** Return TRUE if all of the following are true:
**
** (1) X has the same or lower cost, or returns the same or fewer rows,
** than Y.
** (2) X uses fewer WHERE clause terms than Y
** (3) Every WHERE clause term used by X is also used by Y
** (4) X skips at least as many columns as Y
** (5) If X is a covering index, than Y is too
**
** Conditions (2) and (3) mean that X is a "proper subset" of Y.
** If X is a proper subset of Y then Y is a better choice and ought
|
| ︙ | ︙ | |||
151479 151480 151481 151482 151483 151484 151485 151486 |
const WhereLoop *pX, /* First WhereLoop to compare */
const WhereLoop *pY /* Compare against this WhereLoop */
){
int i, j;
if( pX->nLTerm-pX->nSkip >= pY->nLTerm-pY->nSkip ){
return 0; /* X is not a subset of Y */
}
if( pY->nSkip > pX->nSkip ) return 0;
| > < < < < | | | > > | | | > > | | | 151765 151766 151767 151768 151769 151770 151771 151772 151773 151774 151775 151776 151777 151778 151779 151780 151781 151782 151783 151784 151785 151786 151787 151788 151789 151790 151791 151792 151793 151794 151795 151796 151797 151798 151799 151800 151801 151802 151803 151804 151805 151806 151807 151808 151809 151810 151811 151812 151813 151814 151815 151816 151817 151818 151819 151820 151821 151822 151823 151824 151825 151826 151827 151828 151829 151830 151831 |
const WhereLoop *pX, /* First WhereLoop to compare */
const WhereLoop *pY /* Compare against this WhereLoop */
){
int i, j;
if( pX->nLTerm-pX->nSkip >= pY->nLTerm-pY->nSkip ){
return 0; /* X is not a subset of Y */
}
if( pX->rRun>pY->rRun && pX->nOut>pY->nOut ) return 0;
if( pY->nSkip > pX->nSkip ) return 0;
for(i=pX->nLTerm-1; i>=0; i--){
if( pX->aLTerm[i]==0 ) continue;
for(j=pY->nLTerm-1; j>=0; j--){
if( pY->aLTerm[j]==pX->aLTerm[i] ) break;
}
if( j<0 ) return 0; /* X not a subset of Y since term X[i] not used by Y */
}
if( (pX->wsFlags&WHERE_IDX_ONLY)!=0
&& (pY->wsFlags&WHERE_IDX_ONLY)==0 ){
return 0; /* Constraint (5) */
}
return 1; /* All conditions meet */
}
/*
** Try to adjust the cost and number of output rows of WhereLoop pTemplate
** upwards or downwards so that:
**
** (1) pTemplate costs less than any other WhereLoops that are a proper
** subset of pTemplate
**
** (2) pTemplate costs more than any other WhereLoops for which pTemplate
** is a proper subset.
**
** To say "WhereLoop X is a proper subset of Y" means that X uses fewer
** WHERE clause terms than Y and that every WHERE clause term used by X is
** also used by Y.
*/
static void whereLoopAdjustCost(const WhereLoop *p, WhereLoop *pTemplate){
if( (pTemplate->wsFlags & WHERE_INDEXED)==0 ) return;
for(; p; p=p->pNextLoop){
if( p->iTab!=pTemplate->iTab ) continue;
if( (p->wsFlags & WHERE_INDEXED)==0 ) continue;
if( whereLoopCheaperProperSubset(p, pTemplate) ){
/* Adjust pTemplate cost downward so that it is cheaper than its
** subset p. */
WHERETRACE(0x80,("subset cost adjustment %d,%d to %d,%d\n",
pTemplate->rRun, pTemplate->nOut,
MIN(p->rRun, pTemplate->rRun),
MIN(p->nOut - 1, pTemplate->nOut)));
pTemplate->rRun = MIN(p->rRun, pTemplate->rRun);
pTemplate->nOut = MIN(p->nOut - 1, pTemplate->nOut);
}else if( whereLoopCheaperProperSubset(pTemplate, p) ){
/* Adjust pTemplate cost upward so that it is costlier than p since
** pTemplate is a proper subset of p */
WHERETRACE(0x80,("subset cost adjustment %d,%d to %d,%d\n",
pTemplate->rRun, pTemplate->nOut,
MAX(p->rRun, pTemplate->rRun),
MAX(p->nOut + 1, pTemplate->nOut)));
pTemplate->rRun = MAX(p->rRun, pTemplate->rRun);
pTemplate->nOut = MAX(p->nOut + 1, pTemplate->nOut);
}
}
}
/*
** Search the list of WhereLoops in *ppPrev looking for one that can be
** replaced by pTemplate.
|
| ︙ | ︙ | |||
158472 158473 158474 158475 158476 158477 158478 | #define TK_IF 18 #define TK_NOT 19 #define TK_EXISTS 20 #define TK_TEMP 21 #define TK_LP 22 #define TK_RP 23 #define TK_AS 24 | < | > | 158759 158760 158761 158762 158763 158764 158765 158766 158767 158768 158769 158770 158771 158772 158773 158774 | #define TK_IF 18 #define TK_NOT 19 #define TK_EXISTS 20 #define TK_TEMP 21 #define TK_LP 22 #define TK_RP 23 #define TK_AS 24 #define TK_COMMA 25 #define TK_WITHOUT 26 #define TK_ABORT 27 #define TK_ACTION 28 #define TK_AFTER 29 #define TK_ANALYZE 30 #define TK_ASC 31 #define TK_ATTACH 32 #define TK_BEFORE 33 |
| ︙ | ︙ | |||
158690 158691 158692 158693 158694 158695 158696 | ** YY_MAX_REDUCE Maximum value for reduce actions */ #ifndef INTERFACE # define INTERFACE 1 #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int | | | < | | | | < | | | | > | | | > | > | | | | | | | | | | | | | 158977 158978 158979 158980 158981 158982 158983 158984 158985 158986 158987 158988 158989 158990 158991 158992 158993 158994 158995 158996 158997 158998 158999 159000 159001 159002 159003 159004 159005 159006 159007 159008 159009 159010 159011 159012 159013 159014 159015 159016 159017 159018 159019 159020 159021 159022 159023 159024 159025 159026 159027 159028 159029 159030 159031 159032 159033 159034 159035 159036 159037 159038 159039 159040 159041 |
** YY_MAX_REDUCE Maximum value for reduce actions
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
#define YYNOCODE 318
#define YYACTIONTYPE unsigned short int
#define YYWILDCARD 101
#define sqlite3ParserTOKENTYPE Token
typedef union {
int yyinit;
sqlite3ParserTOKENTYPE yy0;
With* yy43;
u32 yy51;
int yy64;
struct FrameBound yy81;
struct {int value; int mask;} yy83;
TriggerStep* yy95;
Upsert* yy138;
IdList* yy240;
Cte* yy255;
Select* yy303;
Window* yy375;
u8 yy534;
ExprList* yy562;
struct TrigEvent yy570;
const char* yy600;
SrcList* yy607;
Expr* yy626;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define sqlite3ParserARG_SDECL
#define sqlite3ParserARG_PDECL
#define sqlite3ParserARG_PARAM
#define sqlite3ParserARG_FETCH
#define sqlite3ParserARG_STORE
#define sqlite3ParserCTX_SDECL Parse *pParse;
#define sqlite3ParserCTX_PDECL ,Parse *pParse
#define sqlite3ParserCTX_PARAM ,pParse
#define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
#define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
#define YYFALLBACK 1
#define YYNSTATE 572
#define YYNRULE 401
#define YYNRULE_WITH_ACTION 339
#define YYNTOKEN 184
#define YY_MAX_SHIFT 571
#define YY_MIN_SHIFTREDUCE 829
#define YY_MAX_SHIFTREDUCE 1229
#define YY_ERROR_ACTION 1230
#define YY_ACCEPT_ACTION 1231
#define YY_NO_ACTION 1232
#define YY_MIN_REDUCE 1233
#define YY_MAX_REDUCE 1633
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
**
** Applications can choose to define yytestcase() in the %include section
|
| ︙ | ︙ | |||
158806 158807 158808 158809 158810 158811 158812 | ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | < | | | | | | | | | | | | | | | | | | | | | | | | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | 159094 159095 159096 159097 159098 159099 159100 159101 159102 159103 159104 159105 159106 159107 159108 159109 159110 159111 159112 159113 159114 159115 159116 159117 159118 159119 159120 159121 159122 159123 159124 159125 159126 159127 159128 159129 159130 159131 159132 159133 159134 159135 159136 159137 159138 159139 159140 159141 159142 159143 159144 159145 159146 159147 159148 159149 159150 159151 159152 159153 159154 159155 159156 159157 159158 159159 159160 159161 159162 159163 159164 159165 159166 159167 159168 159169 159170 159171 159172 159173 159174 159175 159176 159177 159178 159179 159180 159181 159182 159183 159184 159185 159186 159187 159188 159189 159190 159191 159192 159193 159194 159195 159196 159197 159198 159199 159200 159201 159202 159203 159204 159205 159206 159207 159208 159209 159210 159211 159212 159213 159214 159215 159216 159217 159218 159219 159220 159221 159222 159223 159224 159225 159226 159227 159228 159229 159230 159231 159232 159233 159234 159235 159236 159237 159238 159239 159240 159241 159242 159243 159244 159245 159246 159247 159248 159249 159250 159251 159252 159253 159254 159255 159256 159257 159258 159259 159260 159261 159262 159263 159264 159265 159266 159267 159268 159269 159270 159271 159272 159273 159274 159275 159276 159277 159278 159279 159280 159281 159282 159283 159284 159285 159286 159287 159288 159289 159290 159291 159292 159293 159294 159295 159296 159297 159298 159299 159300 159301 159302 159303 159304 159305 159306 159307 159308 159309 159310 159311 159312 159313 159314 159315 159316 159317 159318 159319 159320 159321 159322 159323 159324 159325 159326 159327 159328 159329 159330 159331 159332 159333 159334 159335 159336 159337 159338 159339 159340 159341 159342 159343 159344 159345 159346 159347 159348 159349 159350 159351 159352 159353 159354 159355 159356 159357 159358 159359 159360 159361 159362 159363 159364 159365 159366 159367 159368 159369 159370 159371 159372 159373 159374 159375 159376 159377 159378 159379 159380 159381 159382 159383 159384 159385 159386 159387 159388 159389 159390 159391 159392 159393 159394 159395 159396 159397 159398 159399 159400 159401 159402 159403 159404 159405 159406 159407 159408 159409 159410 159411 159412 159413 159414 159415 159416 159417 159418 159419 159420 159421 159422 159423 159424 159425 159426 159427 159428 159429 159430 159431 159432 159433 159434 159435 159436 159437 159438 159439 159440 159441 159442 159443 159444 159445 159446 159447 159448 159449 159450 159451 159452 159453 159454 159455 159456 159457 159458 159459 159460 159461 159462 159463 159464 159465 159466 159467 159468 159469 159470 159471 159472 159473 159474 159475 159476 159477 159478 159479 159480 159481 159482 159483 159484 159485 159486 159487 159488 159489 159490 159491 159492 159493 159494 159495 159496 159497 159498 159499 159500 159501 159502 159503 159504 159505 159506 159507 159508 159509 159510 159511 159512 159513 159514 159515 159516 159517 159518 159519 159520 159521 159522 159523 159524 159525 159526 159527 159528 159529 159530 159531 159532 159533 159534 159535 159536 159537 159538 159539 159540 159541 159542 159543 159544 159545 159546 159547 159548 159549 159550 159551 159552 159553 159554 159555 159556 159557 159558 159559 159560 159561 159562 159563 159564 159565 159566 159567 159568 159569 159570 159571 159572 159573 159574 159575 159576 159577 159578 159579 159580 159581 159582 159583 159584 159585 159586 159587 159588 159589 159590 159591 159592 159593 159594 159595 159596 159597 159598 159599 159600 159601 159602 159603 159604 159605 159606 159607 159608 159609 159610 159611 159612 159613 159614 159615 159616 159617 159618 159619 159620 159621 159622 159623 159624 159625 159626 159627 159628 159629 159630 159631 159632 159633 159634 159635 159636 159637 159638 159639 159640 159641 159642 159643 159644 159645 159646 159647 159648 159649 159650 159651 159652 159653 159654 159655 159656 159657 159658 159659 159660 159661 159662 159663 159664 159665 159666 159667 159668 159669 159670 159671 159672 159673 159674 159675 159676 159677 159678 159679 159680 159681 159682 159683 159684 159685 159686 159687 159688 159689 159690 159691 159692 159693 159694 159695 159696 159697 159698 159699 159700 159701 159702 159703 159704 159705 159706 159707 |
** yy_shift_ofst[] For each state, the offset into yy_action for
** shifting terminals.
** yy_reduce_ofst[] For each state, the offset into yy_action for
** shifting non-terminals after a reduce.
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (2037)
static const YYACTIONTYPE yy_action[] = {
/* 0 */ 564, 115, 112, 220, 169, 199, 115, 112, 220, 564,
/* 10 */ 375, 1266, 564, 376, 564, 270, 1309, 1309, 406, 407,
/* 20 */ 1084, 199, 1513, 41, 41, 515, 489, 521, 558, 558,
/* 30 */ 558, 965, 41, 41, 395, 41, 41, 51, 51, 966,
/* 40 */ 296, 1269, 296, 122, 123, 113, 1207, 1207, 1041, 1044,
/* 50 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 564, 407,
/* 60 */ 275, 275, 275, 275, 1268, 115, 112, 220, 115, 112,
/* 70 */ 220, 1512, 846, 561, 516, 561, 115, 112, 220, 250,
/* 80 */ 217, 71, 71, 122, 123, 113, 1207, 1207, 1041, 1044,
/* 90 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 440, 440,
/* 100 */ 440, 1149, 119, 119, 119, 119, 118, 118, 117, 117,
/* 110 */ 117, 116, 442, 1183, 1149, 116, 442, 1149, 546, 513,
/* 120 */ 1548, 1554, 374, 442, 6, 1183, 1154, 522, 1154, 407,
/* 130 */ 1556, 461, 373, 1554, 535, 99, 463, 332, 121, 121,
/* 140 */ 121, 121, 119, 119, 119, 119, 118, 118, 117, 117,
/* 150 */ 117, 116, 442, 122, 123, 113, 1207, 1207, 1041, 1044,
/* 160 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 1257, 1183,
/* 170 */ 1184, 1185, 243, 1064, 564, 502, 499, 498, 567, 124,
/* 180 */ 567, 1183, 1184, 1185, 474, 497, 119, 119, 119, 119,
/* 190 */ 118, 118, 117, 117, 117, 116, 442, 70, 70, 407,
/* 200 */ 121, 121, 121, 121, 114, 117, 117, 117, 116, 442,
/* 210 */ 1409, 1469, 119, 119, 119, 119, 118, 118, 117, 117,
/* 220 */ 117, 116, 442, 122, 123, 113, 1207, 1207, 1041, 1044,
/* 230 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 407, 1031,
/* 240 */ 1031, 1042, 1045, 81, 382, 541, 378, 80, 119, 119,
/* 250 */ 119, 119, 118, 118, 117, 117, 117, 116, 442, 381,
/* 260 */ 463, 332, 122, 123, 113, 1207, 1207, 1041, 1044, 1034,
/* 270 */ 1034, 120, 120, 121, 121, 121, 121, 262, 215, 512,
/* 280 */ 1424, 422, 119, 119, 119, 119, 118, 118, 117, 117,
/* 290 */ 117, 116, 442, 1231, 1, 1, 571, 2, 1235, 1573,
/* 300 */ 571, 2, 1235, 307, 1149, 141, 1600, 307, 407, 141,
/* 310 */ 1183, 361, 1317, 1035, 866, 531, 1317, 1149, 359, 1567,
/* 320 */ 1149, 119, 119, 119, 119, 118, 118, 117, 117, 117,
/* 330 */ 116, 442, 122, 123, 113, 1207, 1207, 1041, 1044, 1034,
/* 340 */ 1034, 120, 120, 121, 121, 121, 121, 275, 275, 1001,
/* 350 */ 426, 275, 275, 1128, 1627, 1021, 1627, 137, 542, 1541,
/* 360 */ 561, 272, 950, 950, 561, 1423, 1183, 1184, 1185, 1594,
/* 370 */ 866, 1012, 530, 315, 231, 1011, 468, 1276, 231, 119,
/* 380 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 442,
/* 390 */ 1570, 119, 119, 119, 119, 118, 118, 117, 117, 117,
/* 400 */ 116, 442, 330, 359, 1567, 564, 446, 1011, 1011, 1013,
/* 410 */ 446, 207, 564, 306, 555, 407, 363, 1021, 363, 346,
/* 420 */ 184, 118, 118, 117, 117, 117, 116, 442, 71, 71,
/* 430 */ 439, 438, 1126, 1012, 472, 71, 71, 1011, 205, 122,
/* 440 */ 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120,
/* 450 */ 121, 121, 121, 121, 219, 219, 472, 1183, 407, 570,
/* 460 */ 1183, 1235, 503, 1477, 149, 546, 307, 489, 141, 1011,
/* 470 */ 1011, 1013, 546, 140, 545, 1317, 1214, 191, 1214, 950,
/* 480 */ 950, 514, 122, 123, 113, 1207, 1207, 1041, 1044, 1034,
/* 490 */ 1034, 120, 120, 121, 121, 121, 121, 563, 119, 119,
/* 500 */ 119, 119, 118, 118, 117, 117, 117, 116, 442, 283,
/* 510 */ 275, 275, 415, 1183, 1184, 1185, 1183, 1184, 1185, 372,
/* 520 */ 1183, 243, 344, 561, 502, 499, 498, 1539, 407, 1540,
/* 530 */ 1183, 288, 870, 143, 497, 1549, 185, 231, 9, 6,
/* 540 */ 253, 119, 119, 119, 119, 118, 118, 117, 117, 117,
/* 550 */ 116, 442, 122, 123, 113, 1207, 1207, 1041, 1044, 1034,
/* 560 */ 1034, 120, 120, 121, 121, 121, 121, 407, 137, 446,
/* 570 */ 447, 863, 169, 1183, 397, 1204, 1183, 1184, 1185, 931,
/* 580 */ 526, 1001, 98, 339, 564, 342, 1183, 1184, 1185, 306,
/* 590 */ 555, 122, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034,
/* 600 */ 120, 120, 121, 121, 121, 121, 452, 71, 71, 275,
/* 610 */ 275, 119, 119, 119, 119, 118, 118, 117, 117, 117,
/* 620 */ 116, 442, 561, 417, 306, 555, 1183, 1307, 1307, 1183,
/* 630 */ 1184, 1185, 1204, 1149, 330, 458, 318, 407, 363, 470,
/* 640 */ 431, 1167, 32, 541, 527, 350, 1149, 1629, 393, 1149,
/* 650 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
/* 660 */ 442, 122, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034,
/* 670 */ 120, 120, 121, 121, 121, 121, 407, 199, 472, 1183,
/* 680 */ 1022, 472, 1183, 1184, 1185, 386, 151, 539, 1548, 277,
/* 690 */ 400, 137, 6, 317, 5, 564, 562, 3, 920, 920,
/* 700 */ 122, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120,
/* 710 */ 120, 121, 121, 121, 121, 411, 505, 83, 71, 71,
/* 720 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
/* 730 */ 442, 1183, 218, 428, 1183, 1183, 1184, 1185, 363, 261,
/* 740 */ 278, 358, 508, 353, 507, 248, 407, 306, 555, 1539,
/* 750 */ 1006, 349, 363, 291, 489, 302, 293, 1542, 281, 119,
/* 760 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 442,
/* 770 */ 122, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120,
/* 780 */ 120, 121, 121, 121, 121, 407, 148, 1183, 1184, 1185,
/* 790 */ 1183, 1184, 1185, 275, 275, 1304, 1257, 1283, 483, 1476,
/* 800 */ 150, 489, 480, 564, 1187, 1304, 561, 1587, 1255, 122,
/* 810 */ 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120,
/* 820 */ 121, 121, 121, 121, 564, 886, 13, 13, 520, 119,
/* 830 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 442,
/* 840 */ 1183, 420, 417, 564, 269, 269, 1316, 13, 13, 1539,
/* 850 */ 1546, 16, 16, 322, 6, 407, 506, 561, 1089, 1089,
/* 860 */ 486, 1187, 425, 1539, 887, 292, 71, 71, 119, 119,
/* 870 */ 119, 119, 118, 118, 117, 117, 117, 116, 442, 122,
/* 880 */ 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120,
/* 890 */ 121, 121, 121, 121, 564, 12, 1183, 1184, 1185, 407,
/* 900 */ 275, 275, 451, 303, 834, 835, 836, 417, 489, 276,
/* 910 */ 276, 1547, 284, 561, 319, 6, 321, 71, 71, 429,
/* 920 */ 451, 450, 561, 952, 101, 113, 1207, 1207, 1041, 1044,
/* 930 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 119, 119,
/* 940 */ 119, 119, 118, 118, 117, 117, 117, 116, 442, 1105,
/* 950 */ 1183, 489, 564, 1312, 437, 455, 478, 564, 246, 245,
/* 960 */ 244, 1409, 1545, 547, 1106, 405, 6, 1544, 196, 1258,
/* 970 */ 413, 6, 105, 462, 103, 71, 71, 286, 564, 1107,
/* 980 */ 13, 13, 119, 119, 119, 119, 118, 118, 117, 117,
/* 990 */ 117, 116, 442, 451, 104, 427, 337, 320, 275, 275,
/* 1000 */ 906, 13, 13, 564, 1482, 1105, 1183, 1184, 1185, 126,
/* 1010 */ 907, 561, 546, 564, 407, 478, 295, 1321, 253, 200,
/* 1020 */ 1106, 548, 1482, 1484, 280, 1409, 55, 55, 1287, 561,
/* 1030 */ 478, 380, 423, 951, 407, 1107, 71, 71, 122, 123,
/* 1040 */ 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, 121,
/* 1050 */ 121, 121, 121, 1204, 407, 287, 552, 309, 122, 123,
/* 1060 */ 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, 121,
/* 1070 */ 121, 121, 121, 441, 1128, 1628, 146, 1628, 122, 111,
/* 1080 */ 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, 121,
/* 1090 */ 121, 121, 121, 404, 403, 1482, 424, 119, 119, 119,
/* 1100 */ 119, 118, 118, 117, 117, 117, 116, 442, 1183, 564,
/* 1110 */ 1204, 544, 1086, 858, 329, 361, 1086, 119, 119, 119,
/* 1120 */ 119, 118, 118, 117, 117, 117, 116, 442, 564, 294,
/* 1130 */ 144, 523, 56, 56, 224, 564, 510, 119, 119, 119,
/* 1140 */ 119, 118, 118, 117, 117, 117, 116, 442, 484, 1409,
/* 1150 */ 537, 15, 15, 1126, 434, 439, 438, 407, 13, 13,
/* 1160 */ 1523, 12, 926, 1211, 1183, 1184, 1185, 925, 1213, 536,
/* 1170 */ 858, 557, 413, 193, 1525, 494, 1212, 448, 1160, 1222,
/* 1180 */ 1183, 564, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034,
/* 1190 */ 120, 120, 121, 121, 121, 121, 1521, 1149, 564, 965,
/* 1200 */ 564, 1214, 247, 1214, 13, 13, 1409, 966, 538, 564,
/* 1210 */ 1149, 108, 556, 1149, 4, 310, 392, 1227, 17, 194,
/* 1220 */ 485, 43, 43, 57, 57, 306, 555, 524, 559, 1160,
/* 1230 */ 464, 564, 44, 44, 392, 1127, 1183, 1184, 1185, 479,
/* 1240 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
/* 1250 */ 442, 443, 564, 327, 13, 13, 564, 418, 1315, 414,
/* 1260 */ 171, 564, 311, 553, 213, 529, 1253, 564, 517, 543,
/* 1270 */ 412, 108, 556, 137, 4, 58, 58, 435, 314, 59,
/* 1280 */ 59, 274, 217, 549, 60, 60, 349, 476, 559, 1353,
/* 1290 */ 61, 61, 1021, 275, 275, 1228, 213, 564, 106, 106,
/* 1300 */ 8, 275, 275, 275, 275, 107, 561, 443, 566, 565,
/* 1310 */ 564, 443, 1011, 1228, 561, 564, 561, 564, 275, 275,
/* 1320 */ 62, 62, 1352, 553, 247, 456, 564, 98, 110, 306,
/* 1330 */ 555, 561, 564, 45, 45, 405, 1203, 533, 46, 46,
/* 1340 */ 47, 47, 532, 465, 1011, 1011, 1013, 1014, 27, 49,
/* 1350 */ 49, 564, 1021, 405, 469, 50, 50, 564, 106, 106,
/* 1360 */ 305, 564, 84, 204, 405, 107, 564, 443, 566, 565,
/* 1370 */ 405, 564, 1011, 564, 63, 63, 564, 1599, 564, 895,
/* 1380 */ 64, 64, 457, 477, 65, 65, 147, 96, 38, 14,
/* 1390 */ 14, 1528, 412, 564, 66, 66, 128, 128, 926, 67,
/* 1400 */ 67, 52, 52, 925, 1011, 1011, 1013, 1014, 27, 1572,
/* 1410 */ 1171, 445, 208, 1123, 279, 394, 68, 68, 228, 390,
/* 1420 */ 390, 389, 264, 387, 1171, 445, 843, 877, 279, 108,
/* 1430 */ 556, 453, 4, 390, 390, 389, 264, 387, 564, 225,
/* 1440 */ 843, 313, 328, 1003, 98, 252, 559, 544, 471, 312,
/* 1450 */ 252, 564, 208, 225, 564, 313, 473, 30, 252, 279,
/* 1460 */ 466, 69, 69, 312, 390, 390, 389, 264, 387, 443,
/* 1470 */ 333, 843, 98, 564, 53, 53, 323, 157, 157, 227,
/* 1480 */ 495, 553, 249, 289, 225, 564, 313, 162, 31, 1501,
/* 1490 */ 135, 564, 1500, 227, 312, 533, 158, 158, 885, 884,
/* 1500 */ 534, 162, 873, 301, 135, 564, 481, 226, 76, 76,
/* 1510 */ 1021, 347, 1071, 98, 54, 54, 106, 106, 1067, 564,
/* 1520 */ 249, 226, 519, 107, 227, 443, 566, 565, 72, 72,
/* 1530 */ 1011, 334, 162, 564, 230, 135, 108, 556, 959, 4,
/* 1540 */ 252, 408, 129, 129, 564, 1349, 306, 555, 564, 923,
/* 1550 */ 564, 110, 226, 559, 564, 408, 73, 73, 564, 873,
/* 1560 */ 306, 555, 1011, 1011, 1013, 1014, 27, 130, 130, 1071,
/* 1570 */ 449, 131, 131, 127, 127, 357, 443, 156, 156, 892,
/* 1580 */ 893, 155, 155, 338, 449, 356, 408, 564, 553, 968,
/* 1590 */ 969, 306, 555, 1015, 341, 564, 108, 556, 564, 4,
/* 1600 */ 1132, 1286, 533, 564, 856, 343, 145, 532, 345, 1300,
/* 1610 */ 136, 136, 1083, 559, 1083, 449, 564, 1021, 134, 134,
/* 1620 */ 1284, 132, 132, 106, 106, 1285, 133, 133, 564, 352,
/* 1630 */ 107, 564, 443, 566, 565, 1340, 443, 1011, 362, 75,
/* 1640 */ 75, 1082, 564, 1082, 564, 924, 1561, 110, 553, 551,
/* 1650 */ 1015, 77, 77, 1361, 74, 74, 1408, 1336, 1347, 550,
/* 1660 */ 1414, 1265, 1256, 1244, 1243, 42, 42, 48, 48, 1011,
/* 1670 */ 1011, 1013, 1014, 27, 1245, 1580, 490, 1021, 267, 202,
/* 1680 */ 1333, 365, 11, 106, 106, 930, 367, 210, 369, 391,
/* 1690 */ 107, 1395, 443, 566, 565, 223, 1390, 1011, 500, 454,
/* 1700 */ 282, 1400, 285, 108, 556, 214, 4, 325, 1383, 1283,
/* 1710 */ 475, 355, 1473, 1583, 1472, 1399, 371, 1222, 326, 398,
/* 1720 */ 559, 290, 331, 197, 100, 556, 209, 4, 198, 1011,
/* 1730 */ 1011, 1013, 1014, 27, 385, 256, 1520, 1518, 554, 1219,
/* 1740 */ 416, 559, 83, 443, 173, 206, 182, 221, 459, 167,
/* 1750 */ 177, 460, 175, 493, 233, 553, 79, 178, 1396, 179,
/* 1760 */ 35, 180, 96, 1402, 443, 396, 36, 467, 1478, 1401,
/* 1770 */ 482, 237, 1404, 399, 82, 186, 553, 1467, 89, 488,
/* 1780 */ 190, 268, 239, 491, 1021, 340, 240, 401, 1246, 1489,
/* 1790 */ 106, 106, 336, 509, 1294, 241, 1303, 107, 430, 443,
/* 1800 */ 566, 565, 1302, 91, 1011, 1021, 1598, 1301, 1273, 215,
/* 1810 */ 1597, 106, 106, 402, 877, 432, 354, 1272, 107, 1271,
/* 1820 */ 443, 566, 565, 1596, 1566, 1011, 1293, 433, 518, 299,
/* 1830 */ 300, 360, 95, 525, 1344, 364, 1011, 1011, 1013, 1014,
/* 1840 */ 27, 254, 255, 1552, 436, 1551, 125, 544, 10, 379,
/* 1850 */ 1326, 1453, 102, 97, 1345, 528, 304, 1011, 1011, 1013,
/* 1860 */ 1014, 27, 366, 377, 1343, 1342, 368, 370, 1325, 384,
/* 1870 */ 201, 383, 34, 1368, 1367, 568, 1177, 266, 263, 265,
/* 1880 */ 1505, 159, 569, 1241, 1236, 1506, 160, 142, 1504, 1503,
/* 1890 */ 297, 211, 830, 161, 212, 78, 444, 203, 308, 222,
/* 1900 */ 1081, 139, 1079, 316, 174, 163, 1203, 229, 176, 909,
/* 1910 */ 324, 232, 1095, 181, 409, 410, 172, 164, 165, 419,
/* 1920 */ 183, 85, 86, 421, 166, 87, 88, 1098, 1094, 234,
/* 1930 */ 235, 152, 18, 236, 335, 1087, 1216, 252, 187, 487,
/* 1940 */ 238, 188, 37, 845, 492, 356, 242, 496, 351, 501,
/* 1950 */ 189, 90, 19, 504, 348, 20, 875, 92, 298, 168,
/* 1960 */ 888, 153, 93, 511, 94, 1165, 154, 1047, 1134, 39,
/* 1970 */ 216, 1133, 271, 273, 958, 192, 953, 110, 1151, 1155,
/* 1980 */ 251, 7, 21, 1159, 1139, 22, 1153, 33, 23, 24,
/* 1990 */ 25, 540, 1158, 195, 98, 1062, 26, 1048, 1046, 1050,
/* 2000 */ 1104, 1051, 1103, 257, 258, 28, 40, 1173, 1016, 857,
/* 2010 */ 109, 29, 560, 388, 138, 1172, 259, 170, 260, 1232,
/* 2020 */ 1232, 919, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232,
/* 2030 */ 1232, 1232, 1589, 1232, 1232, 1232, 1588,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 192, 273, 274, 275, 192, 192, 273, 274, 275, 192,
/* 10 */ 218, 215, 192, 218, 192, 212, 234, 235, 205, 19,
/* 20 */ 11, 192, 294, 215, 216, 203, 192, 203, 209, 210,
/* 30 */ 211, 31, 215, 216, 205, 215, 216, 215, 216, 39,
/* 40 */ 227, 215, 229, 43, 44, 45, 46, 47, 48, 49,
/* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 192, 19,
/* 60 */ 238, 239, 238, 239, 215, 273, 274, 275, 273, 274,
/* 70 */ 275, 237, 21, 251, 252, 251, 273, 274, 275, 255,
/* 80 */ 256, 215, 216, 43, 44, 45, 46, 47, 48, 49,
/* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 209, 210,
/* 100 */ 211, 76, 102, 103, 104, 105, 106, 107, 108, 109,
/* 110 */ 110, 111, 112, 59, 89, 111, 112, 92, 252, 307,
/* 120 */ 308, 313, 314, 112, 312, 59, 86, 261, 88, 19,
/* 130 */ 313, 80, 315, 313, 314, 25, 127, 128, 54, 55,
/* 140 */ 56, 57, 102, 103, 104, 105, 106, 107, 108, 109,
/* 150 */ 110, 111, 112, 43, 44, 45, 46, 47, 48, 49,
/* 160 */ 50, 51, 52, 53, 54, 55, 56, 57, 192, 115,
/* 170 */ 116, 117, 118, 122, 192, 121, 122, 123, 202, 69,
/* 180 */ 204, 115, 116, 117, 192, 131, 102, 103, 104, 105,
/* 190 */ 106, 107, 108, 109, 110, 111, 112, 215, 216, 19,
/* 200 */ 54, 55, 56, 57, 58, 108, 109, 110, 111, 112,
/* 210 */ 192, 160, 102, 103, 104, 105, 106, 107, 108, 109,
/* 220 */ 110, 111, 112, 43, 44, 45, 46, 47, 48, 49,
/* 230 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 46,
/* 240 */ 47, 48, 49, 24, 248, 192, 250, 67, 102, 103,
/* 250 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 277,
/* 260 */ 127, 128, 43, 44, 45, 46, 47, 48, 49, 50,
/* 270 */ 51, 52, 53, 54, 55, 56, 57, 26, 164, 165,
/* 280 */ 272, 263, 102, 103, 104, 105, 106, 107, 108, 109,
/* 290 */ 110, 111, 112, 184, 185, 186, 187, 188, 189, 186,
/* 300 */ 187, 188, 189, 194, 76, 196, 229, 194, 19, 196,
/* 310 */ 59, 192, 203, 120, 59, 87, 203, 89, 310, 311,
/* 320 */ 92, 102, 103, 104, 105, 106, 107, 108, 109, 110,
/* 330 */ 111, 112, 43, 44, 45, 46, 47, 48, 49, 50,
/* 340 */ 51, 52, 53, 54, 55, 56, 57, 238, 239, 73,
/* 350 */ 231, 238, 239, 22, 23, 100, 25, 81, 305, 306,
/* 360 */ 251, 23, 25, 25, 251, 272, 115, 116, 117, 214,
/* 370 */ 115, 116, 144, 192, 265, 120, 114, 222, 265, 102,
/* 380 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
/* 390 */ 192, 102, 103, 104, 105, 106, 107, 108, 109, 110,
/* 400 */ 111, 112, 126, 310, 311, 192, 297, 152, 153, 154,
/* 410 */ 297, 149, 192, 137, 138, 19, 192, 100, 192, 23,
/* 420 */ 22, 106, 107, 108, 109, 110, 111, 112, 215, 216,
/* 430 */ 106, 107, 101, 116, 192, 215, 216, 120, 149, 43,
/* 440 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
/* 450 */ 54, 55, 56, 57, 117, 117, 192, 59, 19, 187,
/* 460 */ 59, 189, 23, 282, 240, 252, 194, 192, 196, 152,
/* 470 */ 153, 154, 252, 72, 261, 203, 152, 25, 154, 142,
/* 480 */ 142, 261, 43, 44, 45, 46, 47, 48, 49, 50,
/* 490 */ 51, 52, 53, 54, 55, 56, 57, 192, 102, 103,
/* 500 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 267,
/* 510 */ 238, 239, 237, 115, 116, 117, 115, 116, 117, 192,
/* 520 */ 59, 118, 16, 251, 121, 122, 123, 303, 19, 303,
/* 530 */ 59, 267, 23, 72, 131, 308, 22, 265, 22, 312,
/* 540 */ 24, 102, 103, 104, 105, 106, 107, 108, 109, 110,
/* 550 */ 111, 112, 43, 44, 45, 46, 47, 48, 49, 50,
/* 560 */ 51, 52, 53, 54, 55, 56, 57, 19, 81, 297,
/* 570 */ 295, 23, 192, 59, 203, 59, 115, 116, 117, 108,
/* 580 */ 192, 73, 25, 77, 192, 79, 115, 116, 117, 137,
/* 590 */ 138, 43, 44, 45, 46, 47, 48, 49, 50, 51,
/* 600 */ 52, 53, 54, 55, 56, 57, 119, 215, 216, 238,
/* 610 */ 239, 102, 103, 104, 105, 106, 107, 108, 109, 110,
/* 620 */ 111, 112, 251, 192, 137, 138, 59, 234, 235, 115,
/* 630 */ 116, 117, 116, 76, 126, 127, 128, 19, 192, 268,
/* 640 */ 19, 23, 22, 192, 252, 24, 89, 300, 301, 92,
/* 650 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
/* 660 */ 112, 43, 44, 45, 46, 47, 48, 49, 50, 51,
/* 670 */ 52, 53, 54, 55, 56, 57, 19, 192, 192, 59,
/* 680 */ 23, 192, 115, 116, 117, 200, 240, 307, 308, 22,
/* 690 */ 205, 81, 312, 262, 22, 192, 133, 22, 135, 136,
/* 700 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
/* 710 */ 53, 54, 55, 56, 57, 197, 95, 150, 215, 216,
/* 720 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
/* 730 */ 112, 59, 192, 112, 59, 115, 116, 117, 192, 118,
/* 740 */ 119, 120, 121, 122, 123, 124, 19, 137, 138, 303,
/* 750 */ 23, 130, 192, 267, 192, 252, 267, 306, 203, 102,
/* 760 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
/* 770 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
/* 780 */ 53, 54, 55, 56, 57, 19, 240, 115, 116, 117,
/* 790 */ 115, 116, 117, 238, 239, 222, 192, 224, 280, 237,
/* 800 */ 240, 192, 284, 192, 59, 232, 251, 140, 204, 43,
/* 810 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
/* 820 */ 54, 55, 56, 57, 192, 35, 215, 216, 192, 102,
/* 830 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
/* 840 */ 59, 230, 192, 192, 238, 239, 237, 215, 216, 303,
/* 850 */ 308, 215, 216, 16, 312, 19, 66, 251, 126, 127,
/* 860 */ 128, 116, 230, 303, 74, 203, 215, 216, 102, 103,
/* 870 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 43,
/* 880 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
/* 890 */ 54, 55, 56, 57, 192, 212, 115, 116, 117, 19,
/* 900 */ 238, 239, 192, 252, 7, 8, 9, 192, 192, 238,
/* 910 */ 239, 308, 262, 251, 77, 312, 79, 215, 216, 129,
/* 920 */ 210, 211, 251, 142, 158, 45, 46, 47, 48, 49,
/* 930 */ 50, 51, 52, 53, 54, 55, 56, 57, 102, 103,
/* 940 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 12,
/* 950 */ 59, 192, 192, 237, 252, 243, 192, 192, 126, 127,
/* 960 */ 128, 192, 308, 203, 27, 253, 312, 308, 285, 207,
/* 970 */ 208, 312, 157, 290, 159, 215, 216, 262, 192, 42,
/* 980 */ 215, 216, 102, 103, 104, 105, 106, 107, 108, 109,
/* 990 */ 110, 111, 112, 283, 158, 230, 237, 160, 238, 239,
/* 1000 */ 63, 215, 216, 192, 192, 12, 115, 116, 117, 22,
/* 1010 */ 73, 251, 252, 192, 19, 192, 230, 239, 24, 24,
/* 1020 */ 27, 261, 210, 211, 99, 192, 215, 216, 225, 251,
/* 1030 */ 192, 192, 263, 142, 19, 42, 215, 216, 43, 44,
/* 1040 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
/* 1050 */ 55, 56, 57, 59, 19, 291, 63, 132, 43, 44,
/* 1060 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
/* 1070 */ 55, 56, 57, 252, 22, 23, 22, 25, 43, 44,
/* 1080 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
/* 1090 */ 55, 56, 57, 106, 107, 283, 263, 102, 103, 104,
/* 1100 */ 105, 106, 107, 108, 109, 110, 111, 112, 59, 192,
/* 1110 */ 116, 144, 29, 59, 291, 192, 33, 102, 103, 104,
/* 1120 */ 105, 106, 107, 108, 109, 110, 111, 112, 192, 291,
/* 1130 */ 163, 19, 215, 216, 15, 192, 108, 102, 103, 104,
/* 1140 */ 105, 106, 107, 108, 109, 110, 111, 112, 65, 192,
/* 1150 */ 66, 215, 216, 101, 231, 106, 107, 19, 215, 216,
/* 1160 */ 192, 212, 134, 114, 115, 116, 117, 139, 119, 85,
/* 1170 */ 116, 207, 208, 230, 192, 19, 127, 192, 94, 60,
/* 1180 */ 59, 192, 44, 45, 46, 47, 48, 49, 50, 51,
/* 1190 */ 52, 53, 54, 55, 56, 57, 192, 76, 192, 31,
/* 1200 */ 192, 152, 46, 154, 215, 216, 192, 39, 87, 192,
/* 1210 */ 89, 19, 20, 92, 22, 192, 22, 23, 22, 230,
/* 1220 */ 263, 215, 216, 215, 216, 137, 138, 115, 36, 145,
/* 1230 */ 128, 192, 215, 216, 22, 23, 115, 116, 117, 290,
/* 1240 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
/* 1250 */ 112, 59, 192, 151, 215, 216, 192, 61, 203, 298,
/* 1260 */ 299, 192, 192, 71, 25, 144, 203, 192, 203, 230,
/* 1270 */ 114, 19, 20, 81, 22, 215, 216, 263, 192, 215,
/* 1280 */ 216, 255, 256, 203, 215, 216, 130, 19, 36, 192,
/* 1290 */ 215, 216, 100, 238, 239, 101, 25, 192, 106, 107,
/* 1300 */ 48, 238, 239, 238, 239, 113, 251, 115, 116, 117,
/* 1310 */ 192, 59, 120, 101, 251, 192, 251, 192, 238, 239,
/* 1320 */ 215, 216, 192, 71, 46, 243, 192, 25, 25, 137,
/* 1330 */ 138, 251, 192, 215, 216, 253, 25, 85, 215, 216,
/* 1340 */ 215, 216, 90, 243, 152, 153, 154, 155, 156, 215,
/* 1350 */ 216, 192, 100, 253, 243, 215, 216, 192, 106, 107,
/* 1360 */ 243, 192, 148, 149, 253, 113, 192, 115, 116, 117,
/* 1370 */ 253, 192, 120, 192, 215, 216, 192, 23, 192, 25,
/* 1380 */ 215, 216, 192, 115, 215, 216, 22, 148, 24, 215,
/* 1390 */ 216, 192, 114, 192, 215, 216, 215, 216, 134, 215,
/* 1400 */ 216, 215, 216, 139, 152, 153, 154, 155, 156, 0,
/* 1410 */ 1, 2, 141, 23, 5, 25, 215, 216, 24, 10,
/* 1420 */ 11, 12, 13, 14, 1, 2, 17, 125, 5, 19,
/* 1430 */ 20, 268, 22, 10, 11, 12, 13, 14, 192, 30,
/* 1440 */ 17, 32, 23, 23, 25, 25, 36, 144, 23, 40,
/* 1450 */ 25, 192, 141, 30, 192, 32, 23, 22, 25, 5,
/* 1460 */ 128, 215, 216, 40, 10, 11, 12, 13, 14, 59,
/* 1470 */ 23, 17, 25, 192, 215, 216, 192, 215, 216, 70,
/* 1480 */ 23, 71, 25, 151, 30, 192, 32, 78, 53, 192,
/* 1490 */ 81, 192, 192, 70, 40, 85, 215, 216, 119, 120,
/* 1500 */ 90, 78, 59, 254, 81, 192, 192, 98, 215, 216,
/* 1510 */ 100, 23, 59, 25, 215, 216, 106, 107, 23, 192,
/* 1520 */ 25, 98, 19, 113, 70, 115, 116, 117, 215, 216,
/* 1530 */ 120, 192, 78, 192, 140, 81, 19, 20, 23, 22,
/* 1540 */ 25, 132, 215, 216, 192, 192, 137, 138, 192, 23,
/* 1550 */ 192, 25, 98, 36, 192, 132, 215, 216, 192, 116,
/* 1560 */ 137, 138, 152, 153, 154, 155, 156, 215, 216, 116,
/* 1570 */ 161, 215, 216, 215, 216, 120, 59, 215, 216, 7,
/* 1580 */ 8, 215, 216, 192, 161, 130, 132, 192, 71, 83,
/* 1590 */ 84, 137, 138, 59, 192, 192, 19, 20, 192, 22,
/* 1600 */ 97, 225, 85, 192, 23, 192, 25, 90, 192, 192,
/* 1610 */ 215, 216, 152, 36, 154, 161, 192, 100, 215, 216,
/* 1620 */ 192, 215, 216, 106, 107, 225, 215, 216, 192, 192,
/* 1630 */ 113, 192, 115, 116, 117, 257, 59, 120, 192, 215,
/* 1640 */ 216, 152, 192, 154, 192, 23, 317, 25, 71, 235,
/* 1650 */ 116, 215, 216, 192, 215, 216, 192, 192, 192, 192,
/* 1660 */ 192, 192, 192, 192, 192, 215, 216, 215, 216, 152,
/* 1670 */ 153, 154, 155, 156, 192, 192, 287, 100, 286, 241,
/* 1680 */ 254, 254, 242, 106, 107, 108, 254, 213, 254, 190,
/* 1690 */ 113, 270, 115, 116, 117, 296, 266, 120, 219, 258,
/* 1700 */ 244, 270, 258, 19, 20, 228, 22, 292, 266, 224,
/* 1710 */ 292, 218, 218, 195, 218, 270, 258, 60, 245, 270,
/* 1720 */ 36, 245, 244, 248, 19, 20, 242, 22, 248, 152,
/* 1730 */ 153, 154, 155, 156, 244, 140, 199, 199, 279, 38,
/* 1740 */ 199, 36, 150, 59, 296, 149, 22, 296, 18, 43,
/* 1750 */ 236, 199, 233, 18, 198, 71, 293, 236, 271, 236,
/* 1760 */ 269, 236, 148, 271, 59, 245, 269, 245, 282, 271,
/* 1770 */ 199, 198, 233, 245, 293, 233, 71, 245, 157, 62,
/* 1780 */ 22, 199, 198, 220, 100, 199, 198, 220, 199, 289,
/* 1790 */ 106, 107, 288, 114, 226, 198, 217, 113, 64, 115,
/* 1800 */ 116, 117, 217, 22, 120, 100, 223, 217, 217, 164,
/* 1810 */ 223, 106, 107, 220, 125, 24, 217, 219, 113, 217,
/* 1820 */ 115, 116, 117, 217, 311, 120, 226, 112, 304, 281,
/* 1830 */ 281, 220, 114, 143, 260, 259, 152, 153, 154, 155,
/* 1840 */ 156, 199, 91, 316, 82, 316, 147, 144, 22, 199,
/* 1850 */ 249, 276, 157, 146, 260, 145, 278, 152, 153, 154,
/* 1860 */ 155, 156, 259, 248, 260, 260, 259, 259, 249, 245,
/* 1870 */ 247, 246, 25, 264, 264, 201, 13, 6, 193, 193,
/* 1880 */ 212, 206, 191, 191, 191, 212, 206, 221, 212, 212,
/* 1890 */ 221, 213, 4, 206, 213, 212, 3, 22, 162, 15,
/* 1900 */ 23, 16, 23, 138, 150, 129, 25, 24, 141, 20,
/* 1910 */ 16, 143, 1, 141, 302, 302, 299, 129, 129, 61,
/* 1920 */ 150, 53, 53, 37, 129, 53, 53, 115, 1, 34,
/* 1930 */ 140, 5, 22, 114, 160, 68, 75, 25, 68, 41,
/* 1940 */ 140, 114, 24, 20, 19, 130, 124, 67, 24, 67,
/* 1950 */ 22, 22, 22, 96, 23, 22, 59, 22, 67, 37,
/* 1960 */ 28, 23, 148, 22, 25, 23, 23, 23, 23, 22,
/* 1970 */ 140, 97, 23, 23, 115, 22, 142, 25, 88, 75,
/* 1980 */ 34, 44, 34, 75, 23, 34, 86, 22, 34, 34,
/* 1990 */ 34, 24, 93, 25, 25, 23, 34, 23, 23, 23,
/* 2000 */ 23, 11, 23, 25, 22, 22, 22, 1, 23, 23,
/* 2010 */ 22, 22, 25, 15, 23, 1, 140, 25, 140, 318,
/* 2020 */ 318, 134, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2030 */ 318, 318, 140, 318, 318, 318, 140, 318, 318, 318,
/* 2040 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2050 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2060 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2070 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2080 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2090 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2100 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2110 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2120 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2130 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2140 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2150 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2160 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2170 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2180 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2190 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2200 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2210 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
/* 2220 */ 318,
};
#define YY_SHIFT_COUNT (571)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (2014)
static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 1423, 1409, 1454, 1192, 1192, 610, 1252, 1410, 1517, 1684,
/* 10 */ 1684, 1684, 276, 0, 0, 180, 1015, 1684, 1684, 1684,
/* 20 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
/* 30 */ 1049, 1049, 1121, 1121, 54, 487, 610, 610, 610, 610,
/* 40 */ 610, 40, 110, 219, 289, 396, 439, 509, 548, 618,
/* 50 */ 657, 727, 766, 836, 995, 1015, 1015, 1015, 1015, 1015,
/* 60 */ 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015,
/* 70 */ 1015, 1015, 1015, 1035, 1015, 1138, 880, 880, 1577, 1684,
/* 80 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
/* 90 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
/* 100 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
/* 110 */ 1684, 1684, 1684, 1705, 1684, 1684, 1684, 1684, 1684, 1684,
/* 120 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 146, 84, 84,
/* 130 */ 84, 84, 84, 277, 315, 401, 97, 461, 251, 66,
/* 140 */ 66, 51, 1156, 66, 66, 324, 324, 66, 452, 452,
/* 150 */ 452, 452, 133, 114, 114, 4, 11, 2037, 2037, 621,
/* 160 */ 621, 621, 567, 398, 398, 398, 398, 937, 937, 228,
/* 170 */ 251, 331, 1052, 66, 66, 66, 66, 66, 66, 66,
/* 180 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
/* 190 */ 66, 66, 66, 557, 557, 66, 9, 25, 25, 745,
/* 200 */ 745, 967, 1088, 2037, 2037, 2037, 2037, 2037, 2037, 2037,
/* 210 */ 255, 317, 317, 514, 403, 620, 471, 672, 781, 891,
/* 220 */ 675, 66, 66, 66, 66, 66, 66, 66, 66, 66,
/* 230 */ 66, 508, 66, 66, 66, 66, 66, 66, 66, 66,
/* 240 */ 66, 66, 66, 66, 790, 790, 790, 66, 66, 66,
/* 250 */ 338, 66, 66, 66, 516, 1084, 66, 66, 993, 66,
/* 260 */ 66, 66, 66, 66, 66, 66, 66, 732, 1083, 563,
/* 270 */ 994, 994, 994, 994, 337, 563, 563, 1028, 987, 897,
/* 280 */ 1119, 262, 1214, 1271, 1112, 1214, 1112, 1268, 1239, 262,
/* 290 */ 262, 1239, 262, 1271, 1268, 1302, 1354, 1278, 1168, 1168,
/* 300 */ 1168, 1112, 1303, 1303, 815, 1311, 1264, 1364, 1657, 1657,
/* 310 */ 1595, 1595, 1701, 1701, 1595, 1592, 1596, 1724, 1706, 1730,
/* 320 */ 1730, 1730, 1730, 1595, 1735, 1614, 1596, 1596, 1614, 1724,
/* 330 */ 1706, 1614, 1706, 1614, 1595, 1735, 1621, 1717, 1595, 1735,
/* 340 */ 1758, 1595, 1735, 1595, 1735, 1758, 1679, 1679, 1679, 1734,
/* 350 */ 1781, 1781, 1758, 1679, 1689, 1679, 1734, 1679, 1679, 1645,
/* 360 */ 1791, 1715, 1715, 1758, 1690, 1718, 1690, 1718, 1690, 1718,
/* 370 */ 1690, 1718, 1595, 1751, 1751, 1762, 1762, 1699, 1703, 1826,
/* 380 */ 1595, 1695, 1699, 1707, 1710, 1614, 1847, 1863, 1863, 1871,
/* 390 */ 1871, 1871, 2037, 2037, 2037, 2037, 2037, 2037, 2037, 2037,
/* 400 */ 2037, 2037, 2037, 2037, 2037, 2037, 2037, 193, 837, 1194,
/* 410 */ 1212, 506, 832, 1054, 1390, 925, 1435, 1394, 1102, 1332,
/* 420 */ 1419, 1196, 1420, 1425, 1433, 1447, 1457, 1488, 1443, 1379,
/* 430 */ 1572, 1455, 1503, 1453, 1495, 1515, 1506, 1526, 1460, 1489,
/* 440 */ 1581, 1622, 1534, 667, 1888, 1893, 1875, 1736, 1884, 1885,
/* 450 */ 1877, 1879, 1765, 1754, 1776, 1881, 1881, 1883, 1767, 1889,
/* 460 */ 1768, 1894, 1911, 1772, 1788, 1881, 1789, 1858, 1886, 1881,
/* 470 */ 1770, 1868, 1869, 1872, 1873, 1795, 1812, 1895, 1790, 1927,
/* 480 */ 1926, 1910, 1819, 1774, 1867, 1912, 1870, 1861, 1898, 1800,
/* 490 */ 1827, 1918, 1923, 1925, 1815, 1822, 1928, 1880, 1929, 1930,
/* 500 */ 1931, 1933, 1882, 1897, 1924, 1857, 1932, 1935, 1891, 1922,
/* 510 */ 1938, 1814, 1941, 1942, 1943, 1944, 1939, 1945, 1947, 1874,
/* 520 */ 1830, 1949, 1950, 1859, 1946, 1953, 1834, 1952, 1948, 1951,
/* 530 */ 1954, 1955, 1890, 1904, 1900, 1937, 1908, 1899, 1956, 1961,
/* 540 */ 1965, 1967, 1968, 1969, 1962, 1972, 1952, 1974, 1975, 1976,
/* 550 */ 1977, 1978, 1979, 1982, 1990, 1983, 1984, 1985, 1986, 1988,
/* 560 */ 1989, 1987, 1887, 1876, 1878, 1892, 1896, 1992, 1991, 1998,
/* 570 */ 2006, 2014,
};
#define YY_REDUCE_COUNT (406)
#define YY_REDUCE_MIN (-272)
#define YY_REDUCE_MAX (1693)
static const short yy_reduce_ofst[] = {
/* 0 */ 109, 113, 272, 760, -178, -176, -192, -183, -180, -134,
/* 10 */ 213, 220, 371, -208, -205, -272, -197, 611, 632, 765,
/* 20 */ 786, 392, 943, 989, 503, 651, 1039, -18, 702, 821,
/* 30 */ 710, 812, -188, 380, -187, 555, 662, 1055, 1063, 1065,
/* 40 */ 1080, -267, -267, -267, -267, -267, -267, -267, -267, -267,
/* 50 */ -267, -267, -267, -267, -267, -267, -267, -267, -267, -267,
/* 60 */ -267, -267, -267, -267, -267, -267, -267, -267, -267, -267,
/* 70 */ -267, -267, -267, -267, -267, -267, -267, -267, 636, 811,
/* 80 */ 917, 936, 1006, 1008, 1017, 1060, 1064, 1069, 1075, 1105,
/* 90 */ 1118, 1123, 1125, 1134, 1140, 1159, 1165, 1169, 1174, 1179,
/* 100 */ 1181, 1184, 1186, 1201, 1246, 1259, 1262, 1281, 1293, 1299,
/* 110 */ 1313, 1327, 1341, 1352, 1356, 1358, 1362, 1366, 1395, 1403,
/* 120 */ 1406, 1411, 1424, 1436, 1439, 1450, 1452, -267, -267, -267,
/* 130 */ -267, -267, -267, -267, -267, 224, -267, 446, -24, 275,
/* 140 */ 546, 518, 573, 560, 53, -181, -111, 485, 606, 671,
/* 150 */ 606, 671, 683, 8, 93, -267, -267, -267, -267, 155,
/* 160 */ 155, 155, 181, 242, 264, 486, 489, -218, 393, 227,
/* 170 */ 604, 347, 347, -171, 431, 650, 715, -166, 562, 609,
/* 180 */ 716, 764, 18, 823, 769, 833, 838, 957, 759, 119,
/* 190 */ 923, 226, 1014, 542, 603, 451, 949, 654, 659, 762,
/* 200 */ 964, -4, 778, 961, 712, 1082, 1100, 1111, 1026, 1117,
/* 210 */ -204, -174, -151, -8, 77, 198, 305, 327, 388, 540,
/* 220 */ 839, 968, 982, 985, 1004, 1023, 1070, 1086, 1097, 1130,
/* 230 */ 1190, 1163, 1199, 1284, 1297, 1300, 1314, 1339, 1353, 1391,
/* 240 */ 1402, 1413, 1416, 1417, 803, 1376, 1400, 1428, 1437, 1446,
/* 250 */ 1378, 1461, 1464, 1465, 1249, 1329, 1466, 1467, 1414, 1468,
/* 260 */ 305, 1469, 1470, 1471, 1472, 1482, 1483, 1389, 1392, 1438,
/* 270 */ 1426, 1427, 1432, 1434, 1378, 1438, 1438, 1440, 1474, 1499,
/* 280 */ 1399, 1421, 1430, 1456, 1441, 1442, 1444, 1415, 1473, 1431,
/* 290 */ 1445, 1476, 1449, 1478, 1418, 1479, 1477, 1485, 1493, 1494,
/* 300 */ 1496, 1458, 1475, 1480, 1459, 1490, 1484, 1518, 1448, 1451,
/* 310 */ 1537, 1538, 1463, 1481, 1541, 1486, 1487, 1491, 1519, 1514,
/* 320 */ 1521, 1523, 1525, 1552, 1556, 1520, 1492, 1498, 1522, 1497,
/* 330 */ 1539, 1528, 1542, 1532, 1571, 1573, 1500, 1504, 1582, 1584,
/* 340 */ 1563, 1586, 1588, 1589, 1597, 1567, 1579, 1585, 1590, 1568,
/* 350 */ 1583, 1587, 1593, 1591, 1598, 1599, 1600, 1602, 1606, 1513,
/* 360 */ 1524, 1548, 1549, 1611, 1574, 1576, 1594, 1603, 1604, 1607,
/* 370 */ 1605, 1608, 1642, 1527, 1529, 1609, 1610, 1601, 1615, 1575,
/* 380 */ 1650, 1578, 1619, 1623, 1625, 1624, 1674, 1685, 1686, 1691,
/* 390 */ 1692, 1693, 1612, 1613, 1617, 1675, 1668, 1673, 1676, 1677,
/* 400 */ 1680, 1666, 1669, 1678, 1681, 1683, 1687,
};
static const YYACTIONTYPE yy_default[] = {
/* 0 */ 1633, 1633, 1633, 1462, 1230, 1341, 1230, 1230, 1230, 1462,
/* 10 */ 1462, 1462, 1230, 1371, 1371, 1515, 1263, 1230, 1230, 1230,
/* 20 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1461, 1230, 1230,
/* 30 */ 1230, 1230, 1550, 1550, 1230, 1230, 1230, 1230, 1230, 1230,
/* 40 */ 1230, 1230, 1380, 1230, 1387, 1230, 1230, 1230, 1230, 1230,
/* 50 */ 1463, 1464, 1230, 1230, 1230, 1514, 1516, 1479, 1394, 1393,
/* 60 */ 1392, 1391, 1497, 1358, 1385, 1378, 1382, 1457, 1458, 1456,
/* 70 */ 1460, 1464, 1463, 1230, 1381, 1428, 1442, 1427, 1230, 1230,
/* 80 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 90 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 100 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 110 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 120 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1436, 1441, 1447,
/* 130 */ 1440, 1437, 1430, 1429, 1431, 1230, 1432, 1230, 1254, 1230,
/* 140 */ 1230, 1251, 1305, 1230, 1230, 1230, 1230, 1230, 1534, 1533,
/* 150 */ 1230, 1230, 1263, 1422, 1421, 1433, 1434, 1444, 1443, 1522,
/* 160 */ 1586, 1585, 1480, 1230, 1230, 1230, 1230, 1230, 1230, 1550,
/* 170 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 180 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 190 */ 1230, 1230, 1230, 1550, 1550, 1230, 1263, 1550, 1550, 1259,
/* 200 */ 1259, 1365, 1230, 1529, 1332, 1332, 1332, 1332, 1341, 1332,
/* 210 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 220 */ 1230, 1230, 1230, 1230, 1230, 1519, 1517, 1230, 1230, 1230,
/* 230 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 240 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 250 */ 1230, 1230, 1230, 1230, 1337, 1230, 1230, 1230, 1230, 1230,
/* 260 */ 1230, 1230, 1230, 1230, 1230, 1230, 1579, 1230, 1492, 1319,
/* 270 */ 1337, 1337, 1337, 1337, 1339, 1320, 1318, 1331, 1264, 1237,
/* 280 */ 1625, 1397, 1386, 1338, 1360, 1386, 1360, 1622, 1384, 1397,
/* 290 */ 1397, 1384, 1397, 1338, 1622, 1280, 1602, 1275, 1371, 1371,
/* 300 */ 1371, 1360, 1365, 1365, 1459, 1338, 1331, 1230, 1625, 1625,
/* 310 */ 1346, 1346, 1624, 1624, 1346, 1480, 1609, 1406, 1308, 1314,
/* 320 */ 1314, 1314, 1314, 1346, 1248, 1384, 1609, 1609, 1384, 1406,
/* 330 */ 1308, 1384, 1308, 1384, 1346, 1248, 1496, 1619, 1346, 1248,
/* 340 */ 1470, 1346, 1248, 1346, 1248, 1470, 1306, 1306, 1306, 1295,
/* 350 */ 1230, 1230, 1470, 1306, 1280, 1306, 1295, 1306, 1306, 1568,
/* 360 */ 1230, 1474, 1474, 1470, 1364, 1359, 1364, 1359, 1364, 1359,
/* 370 */ 1364, 1359, 1346, 1560, 1560, 1374, 1374, 1379, 1365, 1465,
/* 380 */ 1346, 1230, 1379, 1377, 1375, 1384, 1298, 1582, 1582, 1578,
/* 390 */ 1578, 1578, 1630, 1630, 1529, 1595, 1263, 1263, 1263, 1263,
/* 400 */ 1595, 1282, 1282, 1264, 1264, 1263, 1595, 1230, 1230, 1230,
/* 410 */ 1230, 1230, 1230, 1590, 1230, 1524, 1481, 1350, 1230, 1230,
/* 420 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 430 */ 1230, 1230, 1535, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 440 */ 1230, 1230, 1230, 1411, 1230, 1233, 1526, 1230, 1230, 1230,
/* 450 */ 1230, 1230, 1230, 1230, 1230, 1388, 1389, 1351, 1230, 1230,
/* 460 */ 1230, 1230, 1230, 1230, 1230, 1403, 1230, 1230, 1230, 1398,
/* 470 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1621, 1230,
/* 480 */ 1230, 1230, 1230, 1230, 1230, 1495, 1494, 1230, 1230, 1348,
/* 490 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 500 */ 1230, 1230, 1230, 1278, 1230, 1230, 1230, 1230, 1230, 1230,
/* 510 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 520 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1376, 1230, 1230,
/* 530 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 540 */ 1230, 1230, 1565, 1366, 1230, 1230, 1612, 1230, 1230, 1230,
/* 550 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
/* 560 */ 1230, 1606, 1322, 1413, 1230, 1412, 1416, 1252, 1230, 1242,
/* 570 */ 1230, 1230,
};
/********** End of lemon-generated parsing tables *****************************/
/* The next table maps tokens (terminal symbols) into fallback tokens.
** If a construct like the following:
**
** %fallback ID X Y Z.
|
| ︙ | ︙ | |||
159445 159446 159447 159448 159449 159450 159451 |
59, /* IF => ID */
0, /* NOT => nothing */
0, /* EXISTS => nothing */
59, /* TEMP => ID */
0, /* LP => nothing */
0, /* RP => nothing */
0, /* AS => nothing */
| < > | 159738 159739 159740 159741 159742 159743 159744 159745 159746 159747 159748 159749 159750 159751 159752 159753 |
59, /* IF => ID */
0, /* NOT => nothing */
0, /* EXISTS => nothing */
59, /* TEMP => ID */
0, /* LP => nothing */
0, /* RP => nothing */
0, /* AS => nothing */
0, /* COMMA => nothing */
59, /* WITHOUT => ID */
59, /* ABORT => ID */
59, /* ACTION => ID */
59, /* AFTER => ID */
59, /* ANALYZE => ID */
59, /* ASC => ID */
59, /* ATTACH => ID */
59, /* BEFORE => ID */
|
| ︙ | ︙ | |||
159717 159718 159719 159720 159721 159722 159723 | /* 18 */ "IF", /* 19 */ "NOT", /* 20 */ "EXISTS", /* 21 */ "TEMP", /* 22 */ "LP", /* 23 */ "RP", /* 24 */ "AS", | | | | 160010 160011 160012 160013 160014 160015 160016 160017 160018 160019 160020 160021 160022 160023 160024 160025 | /* 18 */ "IF", /* 19 */ "NOT", /* 20 */ "EXISTS", /* 21 */ "TEMP", /* 22 */ "LP", /* 23 */ "RP", /* 24 */ "AS", /* 25 */ "COMMA", /* 26 */ "WITHOUT", /* 27 */ "ABORT", /* 28 */ "ACTION", /* 29 */ "AFTER", /* 30 */ "ANALYZE", /* 31 */ "ASC", /* 32 */ "ATTACH", /* 33 */ "BEFORE", |
| ︙ | ︙ | |||
159894 159895 159896 159897 159898 159899 159900 | /* 195 */ "create_table_args", /* 196 */ "createkw", /* 197 */ "temp", /* 198 */ "ifnotexists", /* 199 */ "dbnm", /* 200 */ "columnlist", /* 201 */ "conslist_opt", | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | < | | | | | | | | | | | | | | | | | | | | | | | | | | | > | 160187 160188 160189 160190 160191 160192 160193 160194 160195 160196 160197 160198 160199 160200 160201 160202 160203 160204 160205 160206 160207 160208 160209 160210 160211 160212 160213 160214 160215 160216 160217 160218 160219 160220 160221 160222 160223 160224 160225 160226 160227 160228 160229 160230 160231 160232 160233 160234 160235 160236 160237 160238 160239 160240 160241 160242 160243 160244 160245 160246 160247 160248 160249 160250 160251 160252 160253 160254 160255 160256 160257 160258 160259 160260 160261 160262 160263 160264 160265 160266 160267 160268 160269 160270 160271 160272 160273 160274 160275 160276 160277 160278 160279 160280 160281 160282 160283 160284 160285 160286 160287 160288 160289 160290 160291 160292 160293 160294 160295 160296 160297 160298 160299 160300 160301 160302 160303 160304 160305 160306 160307 160308 160309 160310 160311 160312 160313 160314 160315 160316 |
/* 195 */ "create_table_args",
/* 196 */ "createkw",
/* 197 */ "temp",
/* 198 */ "ifnotexists",
/* 199 */ "dbnm",
/* 200 */ "columnlist",
/* 201 */ "conslist_opt",
/* 202 */ "table_option_set",
/* 203 */ "select",
/* 204 */ "table_option",
/* 205 */ "columnname",
/* 206 */ "carglist",
/* 207 */ "typetoken",
/* 208 */ "typename",
/* 209 */ "signed",
/* 210 */ "plus_num",
/* 211 */ "minus_num",
/* 212 */ "scanpt",
/* 213 */ "scantok",
/* 214 */ "ccons",
/* 215 */ "term",
/* 216 */ "expr",
/* 217 */ "onconf",
/* 218 */ "sortorder",
/* 219 */ "autoinc",
/* 220 */ "eidlist_opt",
/* 221 */ "refargs",
/* 222 */ "defer_subclause",
/* 223 */ "generated",
/* 224 */ "refarg",
/* 225 */ "refact",
/* 226 */ "init_deferred_pred_opt",
/* 227 */ "conslist",
/* 228 */ "tconscomma",
/* 229 */ "tcons",
/* 230 */ "sortlist",
/* 231 */ "eidlist",
/* 232 */ "defer_subclause_opt",
/* 233 */ "orconf",
/* 234 */ "resolvetype",
/* 235 */ "raisetype",
/* 236 */ "ifexists",
/* 237 */ "fullname",
/* 238 */ "selectnowith",
/* 239 */ "oneselect",
/* 240 */ "wqlist",
/* 241 */ "multiselect_op",
/* 242 */ "distinct",
/* 243 */ "selcollist",
/* 244 */ "from",
/* 245 */ "where_opt",
/* 246 */ "groupby_opt",
/* 247 */ "having_opt",
/* 248 */ "orderby_opt",
/* 249 */ "limit_opt",
/* 250 */ "window_clause",
/* 251 */ "values",
/* 252 */ "nexprlist",
/* 253 */ "sclp",
/* 254 */ "as",
/* 255 */ "seltablist",
/* 256 */ "stl_prefix",
/* 257 */ "joinop",
/* 258 */ "indexed_opt",
/* 259 */ "on_opt",
/* 260 */ "using_opt",
/* 261 */ "exprlist",
/* 262 */ "xfullname",
/* 263 */ "idlist",
/* 264 */ "nulls",
/* 265 */ "with",
/* 266 */ "where_opt_ret",
/* 267 */ "setlist",
/* 268 */ "insert_cmd",
/* 269 */ "idlist_opt",
/* 270 */ "upsert",
/* 271 */ "returning",
/* 272 */ "filter_over",
/* 273 */ "likeop",
/* 274 */ "between_op",
/* 275 */ "in_op",
/* 276 */ "paren_exprlist",
/* 277 */ "case_operand",
/* 278 */ "case_exprlist",
/* 279 */ "case_else",
/* 280 */ "uniqueflag",
/* 281 */ "collate",
/* 282 */ "vinto",
/* 283 */ "nmnum",
/* 284 */ "trigger_decl",
/* 285 */ "trigger_cmd_list",
/* 286 */ "trigger_time",
/* 287 */ "trigger_event",
/* 288 */ "foreach_clause",
/* 289 */ "when_clause",
/* 290 */ "trigger_cmd",
/* 291 */ "trnm",
/* 292 */ "tridxby",
/* 293 */ "database_kw_opt",
/* 294 */ "key_opt",
/* 295 */ "add_column_fullname",
/* 296 */ "kwcolumn_opt",
/* 297 */ "create_vtab",
/* 298 */ "vtabarglist",
/* 299 */ "vtabarg",
/* 300 */ "vtabargtoken",
/* 301 */ "lp",
/* 302 */ "anylist",
/* 303 */ "wqitem",
/* 304 */ "wqas",
/* 305 */ "windowdefn_list",
/* 306 */ "windowdefn",
/* 307 */ "window",
/* 308 */ "frame_opt",
/* 309 */ "part_opt",
/* 310 */ "filter_clause",
/* 311 */ "over_clause",
/* 312 */ "range_or_rows",
/* 313 */ "frame_bound",
/* 314 */ "frame_bound_s",
/* 315 */ "frame_bound_e",
/* 316 */ "frame_exclude_opt",
/* 317 */ "frame_exclude",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
|
| ︙ | ︙ | |||
160035 160036 160037 160038 160039 160040 160041 | /* 12 */ "cmd ::= ROLLBACK trans_opt TO savepoint_opt nm", /* 13 */ "create_table ::= createkw temp TABLE ifnotexists nm dbnm", /* 14 */ "createkw ::= CREATE", /* 15 */ "ifnotexists ::=", /* 16 */ "ifnotexists ::= IF NOT EXISTS", /* 17 */ "temp ::= TEMP", /* 18 */ "temp ::=", | | | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < | | | > > | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 160329 160330 160331 160332 160333 160334 160335 160336 160337 160338 160339 160340 160341 160342 160343 160344 160345 160346 160347 160348 160349 160350 160351 160352 160353 160354 160355 160356 160357 160358 160359 160360 160361 160362 160363 160364 160365 160366 160367 160368 160369 160370 160371 160372 160373 160374 160375 160376 160377 160378 160379 160380 160381 160382 160383 160384 160385 160386 160387 160388 160389 160390 160391 160392 160393 160394 160395 160396 160397 160398 160399 160400 160401 160402 160403 160404 160405 160406 160407 160408 160409 160410 160411 160412 160413 160414 160415 160416 160417 160418 160419 160420 160421 160422 160423 160424 160425 160426 160427 160428 160429 160430 160431 160432 160433 160434 160435 160436 160437 160438 160439 160440 160441 160442 160443 160444 160445 160446 160447 160448 160449 160450 160451 160452 160453 160454 160455 160456 160457 160458 160459 160460 160461 160462 160463 160464 160465 160466 160467 160468 160469 160470 160471 160472 160473 160474 160475 160476 160477 160478 160479 160480 160481 160482 160483 160484 160485 160486 160487 160488 160489 160490 160491 160492 160493 160494 160495 160496 160497 160498 160499 160500 160501 160502 160503 160504 160505 160506 160507 160508 160509 160510 160511 160512 160513 160514 160515 160516 160517 160518 160519 160520 160521 160522 160523 160524 160525 160526 160527 160528 160529 160530 160531 160532 160533 160534 160535 160536 160537 160538 160539 160540 160541 160542 160543 160544 160545 160546 160547 160548 160549 160550 160551 160552 160553 160554 160555 160556 160557 160558 160559 160560 160561 160562 160563 160564 160565 160566 160567 160568 160569 160570 160571 160572 160573 160574 160575 160576 160577 160578 160579 160580 160581 160582 160583 160584 160585 160586 160587 160588 160589 160590 160591 160592 160593 160594 160595 160596 160597 160598 160599 160600 160601 160602 160603 160604 160605 160606 160607 160608 160609 160610 160611 160612 160613 160614 160615 160616 160617 160618 160619 160620 160621 160622 160623 160624 160625 160626 160627 160628 160629 160630 160631 160632 160633 160634 160635 160636 160637 160638 160639 160640 160641 160642 160643 160644 160645 160646 160647 160648 160649 160650 160651 160652 160653 160654 160655 160656 160657 160658 160659 160660 160661 160662 160663 160664 160665 160666 160667 160668 160669 160670 160671 160672 160673 160674 160675 160676 160677 160678 160679 160680 160681 160682 160683 160684 160685 160686 160687 160688 160689 160690 160691 160692 160693 160694 160695 160696 160697 160698 160699 160700 160701 160702 160703 160704 160705 160706 160707 160708 160709 160710 160711 160712 160713 160714 160715 160716 160717 160718 160719 160720 160721 160722 160723 160724 | /* 12 */ "cmd ::= ROLLBACK trans_opt TO savepoint_opt nm", /* 13 */ "create_table ::= createkw temp TABLE ifnotexists nm dbnm", /* 14 */ "createkw ::= CREATE", /* 15 */ "ifnotexists ::=", /* 16 */ "ifnotexists ::= IF NOT EXISTS", /* 17 */ "temp ::= TEMP", /* 18 */ "temp ::=", /* 19 */ "create_table_args ::= LP columnlist conslist_opt RP table_option_set", /* 20 */ "create_table_args ::= AS select", /* 21 */ "table_option_set ::=", /* 22 */ "table_option_set ::= table_option_set COMMA table_option", /* 23 */ "table_option ::= WITHOUT nm", /* 24 */ "table_option ::= nm", /* 25 */ "columnname ::= nm typetoken", /* 26 */ "typetoken ::=", /* 27 */ "typetoken ::= typename LP signed RP", /* 28 */ "typetoken ::= typename LP signed COMMA signed RP", /* 29 */ "typename ::= typename ID|STRING", /* 30 */ "scanpt ::=", /* 31 */ "scantok ::=", /* 32 */ "ccons ::= CONSTRAINT nm", /* 33 */ "ccons ::= DEFAULT scantok term", /* 34 */ "ccons ::= DEFAULT LP expr RP", /* 35 */ "ccons ::= DEFAULT PLUS scantok term", /* 36 */ "ccons ::= DEFAULT MINUS scantok term", /* 37 */ "ccons ::= DEFAULT scantok ID|INDEXED", /* 38 */ "ccons ::= NOT NULL onconf", /* 39 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc", /* 40 */ "ccons ::= UNIQUE onconf", /* 41 */ "ccons ::= CHECK LP expr RP", /* 42 */ "ccons ::= REFERENCES nm eidlist_opt refargs", /* 43 */ "ccons ::= defer_subclause", /* 44 */ "ccons ::= COLLATE ID|STRING", /* 45 */ "generated ::= LP expr RP", /* 46 */ "generated ::= LP expr RP ID", /* 47 */ "autoinc ::=", /* 48 */ "autoinc ::= AUTOINCR", /* 49 */ "refargs ::=", /* 50 */ "refargs ::= refargs refarg", /* 51 */ "refarg ::= MATCH nm", /* 52 */ "refarg ::= ON INSERT refact", /* 53 */ "refarg ::= ON DELETE refact", /* 54 */ "refarg ::= ON UPDATE refact", /* 55 */ "refact ::= SET NULL", /* 56 */ "refact ::= SET DEFAULT", /* 57 */ "refact ::= CASCADE", /* 58 */ "refact ::= RESTRICT", /* 59 */ "refact ::= NO ACTION", /* 60 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", /* 61 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", /* 62 */ "init_deferred_pred_opt ::=", /* 63 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", /* 64 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", /* 65 */ "conslist_opt ::=", /* 66 */ "tconscomma ::= COMMA", /* 67 */ "tcons ::= CONSTRAINT nm", /* 68 */ "tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf", /* 69 */ "tcons ::= UNIQUE LP sortlist RP onconf", /* 70 */ "tcons ::= CHECK LP expr RP onconf", /* 71 */ "tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt", /* 72 */ "defer_subclause_opt ::=", /* 73 */ "onconf ::=", /* 74 */ "onconf ::= ON CONFLICT resolvetype", /* 75 */ "orconf ::=", /* 76 */ "orconf ::= OR resolvetype", /* 77 */ "resolvetype ::= IGNORE", /* 78 */ "resolvetype ::= REPLACE", /* 79 */ "cmd ::= DROP TABLE ifexists fullname", /* 80 */ "ifexists ::= IF EXISTS", /* 81 */ "ifexists ::=", /* 82 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select", /* 83 */ "cmd ::= DROP VIEW ifexists fullname", /* 84 */ "cmd ::= select", /* 85 */ "select ::= WITH wqlist selectnowith", /* 86 */ "select ::= WITH RECURSIVE wqlist selectnowith", /* 87 */ "select ::= selectnowith", /* 88 */ "selectnowith ::= selectnowith multiselect_op oneselect", /* 89 */ "multiselect_op ::= UNION", /* 90 */ "multiselect_op ::= UNION ALL", /* 91 */ "multiselect_op ::= EXCEPT|INTERSECT", /* 92 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", /* 93 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt", /* 94 */ "values ::= VALUES LP nexprlist RP", /* 95 */ "values ::= values COMMA LP nexprlist RP", /* 96 */ "distinct ::= DISTINCT", /* 97 */ "distinct ::= ALL", /* 98 */ "distinct ::=", /* 99 */ "sclp ::=", /* 100 */ "selcollist ::= sclp scanpt expr scanpt as", /* 101 */ "selcollist ::= sclp scanpt STAR", /* 102 */ "selcollist ::= sclp scanpt nm DOT STAR", /* 103 */ "as ::= AS nm", /* 104 */ "as ::=", /* 105 */ "from ::=", /* 106 */ "from ::= FROM seltablist", /* 107 */ "stl_prefix ::= seltablist joinop", /* 108 */ "stl_prefix ::=", /* 109 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", /* 110 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt", /* 111 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt", /* 112 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt", /* 113 */ "dbnm ::=", /* 114 */ "dbnm ::= DOT nm", /* 115 */ "fullname ::= nm", /* 116 */ "fullname ::= nm DOT nm", /* 117 */ "xfullname ::= nm", /* 118 */ "xfullname ::= nm DOT nm", /* 119 */ "xfullname ::= nm DOT nm AS nm", /* 120 */ "xfullname ::= nm AS nm", /* 121 */ "joinop ::= COMMA|JOIN", /* 122 */ "joinop ::= JOIN_KW JOIN", /* 123 */ "joinop ::= JOIN_KW nm JOIN", /* 124 */ "joinop ::= JOIN_KW nm nm JOIN", /* 125 */ "on_opt ::= ON expr", /* 126 */ "on_opt ::=", /* 127 */ "indexed_opt ::=", /* 128 */ "indexed_opt ::= INDEXED BY nm", /* 129 */ "indexed_opt ::= NOT INDEXED", /* 130 */ "using_opt ::= USING LP idlist RP", /* 131 */ "using_opt ::=", /* 132 */ "orderby_opt ::=", /* 133 */ "orderby_opt ::= ORDER BY sortlist", /* 134 */ "sortlist ::= sortlist COMMA expr sortorder nulls", /* 135 */ "sortlist ::= expr sortorder nulls", /* 136 */ "sortorder ::= ASC", /* 137 */ "sortorder ::= DESC", /* 138 */ "sortorder ::=", /* 139 */ "nulls ::= NULLS FIRST", /* 140 */ "nulls ::= NULLS LAST", /* 141 */ "nulls ::=", /* 142 */ "groupby_opt ::=", /* 143 */ "groupby_opt ::= GROUP BY nexprlist", /* 144 */ "having_opt ::=", /* 145 */ "having_opt ::= HAVING expr", /* 146 */ "limit_opt ::=", /* 147 */ "limit_opt ::= LIMIT expr", /* 148 */ "limit_opt ::= LIMIT expr OFFSET expr", /* 149 */ "limit_opt ::= LIMIT expr COMMA expr", /* 150 */ "cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret", /* 151 */ "where_opt ::=", /* 152 */ "where_opt ::= WHERE expr", /* 153 */ "where_opt_ret ::=", /* 154 */ "where_opt_ret ::= WHERE expr", /* 155 */ "where_opt_ret ::= RETURNING selcollist", /* 156 */ "where_opt_ret ::= WHERE expr RETURNING selcollist", /* 157 */ "cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret", /* 158 */ "setlist ::= setlist COMMA nm EQ expr", /* 159 */ "setlist ::= setlist COMMA LP idlist RP EQ expr", /* 160 */ "setlist ::= nm EQ expr", /* 161 */ "setlist ::= LP idlist RP EQ expr", /* 162 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert", /* 163 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning", /* 164 */ "upsert ::=", /* 165 */ "upsert ::= RETURNING selcollist", /* 166 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert", /* 167 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert", /* 168 */ "upsert ::= ON CONFLICT DO NOTHING returning", /* 169 */ "upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning", /* 170 */ "returning ::= RETURNING selcollist", /* 171 */ "insert_cmd ::= INSERT orconf", /* 172 */ "insert_cmd ::= REPLACE", /* 173 */ "idlist_opt ::=", /* 174 */ "idlist_opt ::= LP idlist RP", /* 175 */ "idlist ::= idlist COMMA nm", /* 176 */ "idlist ::= nm", /* 177 */ "expr ::= LP expr RP", /* 178 */ "expr ::= ID|INDEXED", /* 179 */ "expr ::= JOIN_KW", /* 180 */ "expr ::= nm DOT nm", /* 181 */ "expr ::= nm DOT nm DOT nm", /* 182 */ "term ::= NULL|FLOAT|BLOB", /* 183 */ "term ::= STRING", /* 184 */ "term ::= INTEGER", /* 185 */ "expr ::= VARIABLE", /* 186 */ "expr ::= expr COLLATE ID|STRING", /* 187 */ "expr ::= CAST LP expr AS typetoken RP", /* 188 */ "expr ::= ID|INDEXED LP distinct exprlist RP", /* 189 */ "expr ::= ID|INDEXED LP STAR RP", /* 190 */ "expr ::= ID|INDEXED LP distinct exprlist RP filter_over", /* 191 */ "expr ::= ID|INDEXED LP STAR RP filter_over", /* 192 */ "term ::= CTIME_KW", /* 193 */ "expr ::= LP nexprlist COMMA expr RP", /* 194 */ "expr ::= expr AND expr", /* 195 */ "expr ::= expr OR expr", /* 196 */ "expr ::= expr LT|GT|GE|LE expr", /* 197 */ "expr ::= expr EQ|NE expr", /* 198 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", /* 199 */ "expr ::= expr PLUS|MINUS expr", /* 200 */ "expr ::= expr STAR|SLASH|REM expr", /* 201 */ "expr ::= expr CONCAT expr", /* 202 */ "likeop ::= NOT LIKE_KW|MATCH", /* 203 */ "expr ::= expr likeop expr", /* 204 */ "expr ::= expr likeop expr ESCAPE expr", /* 205 */ "expr ::= expr ISNULL|NOTNULL", /* 206 */ "expr ::= expr NOT NULL", /* 207 */ "expr ::= expr IS expr", /* 208 */ "expr ::= expr IS NOT expr", /* 209 */ "expr ::= NOT expr", /* 210 */ "expr ::= BITNOT expr", /* 211 */ "expr ::= PLUS|MINUS expr", /* 212 */ "between_op ::= BETWEEN", /* 213 */ "between_op ::= NOT BETWEEN", /* 214 */ "expr ::= expr between_op expr AND expr", /* 215 */ "in_op ::= IN", /* 216 */ "in_op ::= NOT IN", /* 217 */ "expr ::= expr in_op LP exprlist RP", /* 218 */ "expr ::= LP select RP", /* 219 */ "expr ::= expr in_op LP select RP", /* 220 */ "expr ::= expr in_op nm dbnm paren_exprlist", /* 221 */ "expr ::= EXISTS LP select RP", /* 222 */ "expr ::= CASE case_operand case_exprlist case_else END", /* 223 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", /* 224 */ "case_exprlist ::= WHEN expr THEN expr", /* 225 */ "case_else ::= ELSE expr", /* 226 */ "case_else ::=", /* 227 */ "case_operand ::= expr", /* 228 */ "case_operand ::=", /* 229 */ "exprlist ::=", /* 230 */ "nexprlist ::= nexprlist COMMA expr", /* 231 */ "nexprlist ::= expr", /* 232 */ "paren_exprlist ::=", /* 233 */ "paren_exprlist ::= LP exprlist RP", /* 234 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt", /* 235 */ "uniqueflag ::= UNIQUE", /* 236 */ "uniqueflag ::=", /* 237 */ "eidlist_opt ::=", /* 238 */ "eidlist_opt ::= LP eidlist RP", /* 239 */ "eidlist ::= eidlist COMMA nm collate sortorder", /* 240 */ "eidlist ::= nm collate sortorder", /* 241 */ "collate ::=", /* 242 */ "collate ::= COLLATE ID|STRING", /* 243 */ "cmd ::= DROP INDEX ifexists fullname", /* 244 */ "cmd ::= VACUUM vinto", /* 245 */ "cmd ::= VACUUM nm vinto", /* 246 */ "vinto ::= INTO expr", /* 247 */ "vinto ::=", /* 248 */ "cmd ::= PRAGMA nm dbnm", /* 249 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", /* 250 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", /* 251 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", /* 252 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", /* 253 */ "plus_num ::= PLUS INTEGER|FLOAT", /* 254 */ "minus_num ::= MINUS INTEGER|FLOAT", /* 255 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", /* 256 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", /* 257 */ "trigger_time ::= BEFORE|AFTER", /* 258 */ "trigger_time ::= INSTEAD OF", /* 259 */ "trigger_time ::=", /* 260 */ "trigger_event ::= DELETE|INSERT", /* 261 */ "trigger_event ::= UPDATE", /* 262 */ "trigger_event ::= UPDATE OF idlist", /* 263 */ "when_clause ::=", /* 264 */ "when_clause ::= WHEN expr", /* 265 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", /* 266 */ "trigger_cmd_list ::= trigger_cmd SEMI", /* 267 */ "trnm ::= nm DOT nm", /* 268 */ "tridxby ::= INDEXED BY nm", /* 269 */ "tridxby ::= NOT INDEXED", /* 270 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt", /* 271 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt", /* 272 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt", /* 273 */ "trigger_cmd ::= scanpt select scanpt", /* 274 */ "expr ::= RAISE LP IGNORE RP", /* 275 */ "expr ::= RAISE LP raisetype COMMA nm RP", /* 276 */ "raisetype ::= ROLLBACK", /* 277 */ "raisetype ::= ABORT", /* 278 */ "raisetype ::= FAIL", /* 279 */ "cmd ::= DROP TRIGGER ifexists fullname", /* 280 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", /* 281 */ "cmd ::= DETACH database_kw_opt expr", /* 282 */ "key_opt ::=", /* 283 */ "key_opt ::= KEY expr", /* 284 */ "cmd ::= REINDEX", /* 285 */ "cmd ::= REINDEX nm dbnm", /* 286 */ "cmd ::= ANALYZE", /* 287 */ "cmd ::= ANALYZE nm dbnm", /* 288 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", /* 289 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist", /* 290 */ "cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm", /* 291 */ "add_column_fullname ::= fullname", /* 292 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm", /* 293 */ "cmd ::= create_vtab", /* 294 */ "cmd ::= create_vtab LP vtabarglist RP", /* 295 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", /* 296 */ "vtabarg ::=", /* 297 */ "vtabargtoken ::= ANY", /* 298 */ "vtabargtoken ::= lp anylist RP", /* 299 */ "lp ::= LP", /* 300 */ "with ::= WITH wqlist", /* 301 */ "with ::= WITH RECURSIVE wqlist", /* 302 */ "wqas ::= AS", /* 303 */ "wqas ::= AS MATERIALIZED", /* 304 */ "wqas ::= AS NOT MATERIALIZED", /* 305 */ "wqitem ::= nm eidlist_opt wqas LP select RP", /* 306 */ "wqlist ::= wqitem", /* 307 */ "wqlist ::= wqlist COMMA wqitem", /* 308 */ "windowdefn_list ::= windowdefn", /* 309 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn", /* 310 */ "windowdefn ::= nm AS LP window RP", /* 311 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt", /* 312 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt", /* 313 */ "window ::= ORDER BY sortlist frame_opt", /* 314 */ "window ::= nm ORDER BY sortlist frame_opt", /* 315 */ "window ::= frame_opt", /* 316 */ "window ::= nm frame_opt", /* 317 */ "frame_opt ::=", /* 318 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt", /* 319 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt", /* 320 */ "range_or_rows ::= RANGE|ROWS|GROUPS", /* 321 */ "frame_bound_s ::= frame_bound", /* 322 */ "frame_bound_s ::= UNBOUNDED PRECEDING", /* 323 */ "frame_bound_e ::= frame_bound", /* 324 */ "frame_bound_e ::= UNBOUNDED FOLLOWING", /* 325 */ "frame_bound ::= expr PRECEDING|FOLLOWING", /* 326 */ "frame_bound ::= CURRENT ROW", /* 327 */ "frame_exclude_opt ::=", /* 328 */ "frame_exclude_opt ::= EXCLUDE frame_exclude", /* 329 */ "frame_exclude ::= NO OTHERS", /* 330 */ "frame_exclude ::= CURRENT ROW", /* 331 */ "frame_exclude ::= GROUP|TIES", /* 332 */ "window_clause ::= WINDOW windowdefn_list", /* 333 */ "filter_over ::= filter_clause over_clause", /* 334 */ "filter_over ::= over_clause", /* 335 */ "filter_over ::= filter_clause", /* 336 */ "over_clause ::= OVER LP window RP", /* 337 */ "over_clause ::= OVER nm", /* 338 */ "filter_clause ::= FILTER LP WHERE expr RP", /* 339 */ "input ::= cmdlist", /* 340 */ "cmdlist ::= cmdlist ecmd", /* 341 */ "cmdlist ::= ecmd", /* 342 */ "ecmd ::= SEMI", /* 343 */ "ecmd ::= cmdx SEMI", /* 344 */ "ecmd ::= explain cmdx SEMI", /* 345 */ "trans_opt ::=", /* 346 */ "trans_opt ::= TRANSACTION", /* 347 */ "trans_opt ::= TRANSACTION nm", /* 348 */ "savepoint_opt ::= SAVEPOINT", /* 349 */ "savepoint_opt ::=", /* 350 */ "cmd ::= create_table create_table_args", /* 351 */ "table_option_set ::= table_option", /* 352 */ "columnlist ::= columnlist COMMA columnname carglist", /* 353 */ "columnlist ::= columnname carglist", /* 354 */ "nm ::= ID|INDEXED", /* 355 */ "nm ::= STRING", /* 356 */ "nm ::= JOIN_KW", /* 357 */ "typetoken ::= typename", /* 358 */ "typename ::= ID|STRING", /* 359 */ "signed ::= plus_num", /* 360 */ "signed ::= minus_num", /* 361 */ "carglist ::= carglist ccons", /* 362 */ "carglist ::=", /* 363 */ "ccons ::= NULL onconf", /* 364 */ "ccons ::= GENERATED ALWAYS AS generated", /* 365 */ "ccons ::= AS generated", /* 366 */ "conslist_opt ::= COMMA conslist", /* 367 */ "conslist ::= conslist tconscomma tcons", /* 368 */ "conslist ::= tcons", /* 369 */ "tconscomma ::=", /* 370 */ "defer_subclause_opt ::= defer_subclause", /* 371 */ "resolvetype ::= raisetype", /* 372 */ "selectnowith ::= oneselect", /* 373 */ "oneselect ::= values", /* 374 */ "sclp ::= selcollist COMMA", /* 375 */ "as ::= ID|STRING", /* 376 */ "returning ::=", /* 377 */ "expr ::= term", /* 378 */ "likeop ::= LIKE_KW|MATCH", /* 379 */ "exprlist ::= nexprlist", /* 380 */ "nmnum ::= plus_num", /* 381 */ "nmnum ::= nm", /* 382 */ "nmnum ::= ON", /* 383 */ "nmnum ::= DELETE", /* 384 */ "nmnum ::= DEFAULT", /* 385 */ "plus_num ::= INTEGER|FLOAT", /* 386 */ "foreach_clause ::=", /* 387 */ "foreach_clause ::= FOR EACH ROW", /* 388 */ "trnm ::= nm", /* 389 */ "tridxby ::=", /* 390 */ "database_kw_opt ::= DATABASE", /* 391 */ "database_kw_opt ::=", /* 392 */ "kwcolumn_opt ::=", /* 393 */ "kwcolumn_opt ::= COLUMNKW", /* 394 */ "vtabarglist ::= vtabarg", /* 395 */ "vtabarglist ::= vtabarglist COMMA vtabarg", /* 396 */ "vtabarg ::= vtabarg vtabargtoken", /* 397 */ "anylist ::=", /* 398 */ "anylist ::= anylist LP anylist RP", /* 399 */ "anylist ::= anylist ANY", /* 400 */ "with ::=", }; #endif /* NDEBUG */ #if YYSTACKDEPTH<=0 /* ** Try to increase the size of the parser stack. Return the number |
| ︙ | ︙ | |||
160540 160541 160542 160543 160544 160545 160546 |
**
** Note: during a reduce, the only symbols destroyed are those
** which appear on the RHS of the rule, but which are *not* used
** inside the C code.
*/
/********* Begin destructor definitions ***************************************/
case 203: /* select */
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | > | | | | | | | | | | | | 160837 160838 160839 160840 160841 160842 160843 160844 160845 160846 160847 160848 160849 160850 160851 160852 160853 160854 160855 160856 160857 160858 160859 160860 160861 160862 160863 160864 160865 160866 160867 160868 160869 160870 160871 160872 160873 160874 160875 160876 160877 160878 160879 160880 160881 160882 160883 160884 160885 160886 160887 160888 160889 160890 160891 160892 160893 160894 160895 160896 160897 160898 160899 160900 160901 160902 160903 160904 160905 160906 160907 160908 160909 160910 160911 160912 160913 160914 160915 160916 160917 160918 160919 160920 160921 160922 160923 160924 160925 160926 160927 160928 160929 160930 160931 160932 160933 160934 160935 160936 160937 160938 160939 160940 160941 160942 |
**
** Note: during a reduce, the only symbols destroyed are those
** which appear on the RHS of the rule, but which are *not* used
** inside the C code.
*/
/********* Begin destructor definitions ***************************************/
case 203: /* select */
case 238: /* selectnowith */
case 239: /* oneselect */
case 251: /* values */
{
sqlite3SelectDelete(pParse->db, (yypminor->yy303));
}
break;
case 215: /* term */
case 216: /* expr */
case 245: /* where_opt */
case 247: /* having_opt */
case 259: /* on_opt */
case 266: /* where_opt_ret */
case 277: /* case_operand */
case 279: /* case_else */
case 282: /* vinto */
case 289: /* when_clause */
case 294: /* key_opt */
case 310: /* filter_clause */
{
sqlite3ExprDelete(pParse->db, (yypminor->yy626));
}
break;
case 220: /* eidlist_opt */
case 230: /* sortlist */
case 231: /* eidlist */
case 243: /* selcollist */
case 246: /* groupby_opt */
case 248: /* orderby_opt */
case 252: /* nexprlist */
case 253: /* sclp */
case 261: /* exprlist */
case 267: /* setlist */
case 276: /* paren_exprlist */
case 278: /* case_exprlist */
case 309: /* part_opt */
{
sqlite3ExprListDelete(pParse->db, (yypminor->yy562));
}
break;
case 237: /* fullname */
case 244: /* from */
case 255: /* seltablist */
case 256: /* stl_prefix */
case 262: /* xfullname */
{
sqlite3SrcListDelete(pParse->db, (yypminor->yy607));
}
break;
case 240: /* wqlist */
{
sqlite3WithDelete(pParse->db, (yypminor->yy43));
}
break;
case 250: /* window_clause */
case 305: /* windowdefn_list */
{
sqlite3WindowListDelete(pParse->db, (yypminor->yy375));
}
break;
case 260: /* using_opt */
case 263: /* idlist */
case 269: /* idlist_opt */
{
sqlite3IdListDelete(pParse->db, (yypminor->yy240));
}
break;
case 272: /* filter_over */
case 306: /* windowdefn */
case 307: /* window */
case 308: /* frame_opt */
case 311: /* over_clause */
{
sqlite3WindowDelete(pParse->db, (yypminor->yy375));
}
break;
case 285: /* trigger_cmd_list */
case 290: /* trigger_cmd */
{
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy95));
}
break;
case 287: /* trigger_event */
{
sqlite3IdListDelete(pParse->db, (yypminor->yy570).b);
}
break;
case 313: /* frame_bound */
case 314: /* frame_bound_s */
case 315: /* frame_bound_e */
{
sqlite3ExprDelete(pParse->db, (yypminor->yy81).pExpr);
}
break;
/********* End destructor definitions *****************************************/
default: break; /* If no destructor action specified: do nothing */
}
}
|
| ︙ | ︙ | |||
160941 160942 160943 160944 160945 160946 160947 | 189, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ 194, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */ 196, /* (14) createkw ::= CREATE */ 198, /* (15) ifnotexists ::= */ 198, /* (16) ifnotexists ::= IF NOT EXISTS */ 197, /* (17) temp ::= TEMP */ 197, /* (18) temp ::= */ | | | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 161238 161239 161240 161241 161242 161243 161244 161245 161246 161247 161248 161249 161250 161251 161252 161253 161254 161255 161256 161257 161258 161259 161260 161261 161262 161263 161264 161265 161266 161267 161268 161269 161270 161271 161272 161273 161274 161275 161276 161277 161278 161279 161280 161281 161282 161283 161284 161285 161286 161287 161288 161289 161290 161291 161292 161293 161294 161295 161296 161297 161298 161299 161300 161301 161302 161303 161304 161305 161306 161307 161308 161309 161310 161311 161312 161313 161314 161315 161316 161317 161318 161319 161320 161321 161322 161323 161324 161325 161326 161327 161328 161329 161330 161331 161332 161333 161334 161335 161336 161337 161338 161339 161340 161341 161342 161343 161344 161345 161346 161347 161348 161349 161350 161351 161352 161353 161354 161355 161356 161357 161358 161359 161360 161361 161362 161363 161364 161365 161366 161367 161368 161369 161370 161371 161372 161373 161374 161375 161376 161377 161378 161379 161380 161381 161382 161383 161384 161385 161386 161387 161388 161389 161390 161391 161392 161393 161394 161395 161396 161397 161398 161399 161400 161401 161402 161403 161404 161405 161406 161407 161408 161409 161410 161411 161412 161413 161414 161415 161416 161417 161418 161419 161420 161421 161422 161423 161424 161425 161426 161427 161428 161429 161430 161431 161432 161433 161434 161435 161436 161437 161438 161439 161440 161441 161442 161443 161444 161445 161446 161447 161448 161449 161450 161451 161452 161453 161454 161455 161456 161457 161458 161459 161460 161461 161462 161463 161464 161465 161466 161467 161468 161469 161470 161471 161472 161473 161474 161475 161476 161477 161478 161479 161480 161481 161482 161483 161484 161485 161486 161487 161488 161489 161490 161491 161492 161493 161494 161495 161496 161497 161498 161499 161500 161501 161502 161503 161504 161505 161506 161507 161508 161509 161510 161511 161512 161513 161514 161515 161516 161517 161518 161519 161520 161521 161522 161523 161524 161525 161526 161527 161528 161529 161530 161531 161532 161533 161534 161535 161536 161537 161538 161539 161540 161541 161542 161543 161544 161545 161546 161547 161548 161549 161550 161551 161552 161553 161554 161555 161556 161557 161558 161559 161560 161561 161562 161563 161564 161565 161566 161567 161568 161569 161570 161571 161572 161573 161574 161575 161576 161577 161578 161579 161580 161581 161582 161583 161584 161585 161586 161587 161588 161589 161590 161591 161592 161593 161594 161595 161596 161597 161598 161599 161600 161601 161602 161603 161604 161605 161606 161607 161608 161609 161610 161611 161612 161613 161614 161615 161616 161617 161618 161619 161620 161621 161622 161623 161624 161625 161626 161627 161628 161629 161630 161631 161632 161633 |
189, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
194, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
196, /* (14) createkw ::= CREATE */
198, /* (15) ifnotexists ::= */
198, /* (16) ifnotexists ::= IF NOT EXISTS */
197, /* (17) temp ::= TEMP */
197, /* (18) temp ::= */
195, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_option_set */
195, /* (20) create_table_args ::= AS select */
202, /* (21) table_option_set ::= */
202, /* (22) table_option_set ::= table_option_set COMMA table_option */
204, /* (23) table_option ::= WITHOUT nm */
204, /* (24) table_option ::= nm */
205, /* (25) columnname ::= nm typetoken */
207, /* (26) typetoken ::= */
207, /* (27) typetoken ::= typename LP signed RP */
207, /* (28) typetoken ::= typename LP signed COMMA signed RP */
208, /* (29) typename ::= typename ID|STRING */
212, /* (30) scanpt ::= */
213, /* (31) scantok ::= */
214, /* (32) ccons ::= CONSTRAINT nm */
214, /* (33) ccons ::= DEFAULT scantok term */
214, /* (34) ccons ::= DEFAULT LP expr RP */
214, /* (35) ccons ::= DEFAULT PLUS scantok term */
214, /* (36) ccons ::= DEFAULT MINUS scantok term */
214, /* (37) ccons ::= DEFAULT scantok ID|INDEXED */
214, /* (38) ccons ::= NOT NULL onconf */
214, /* (39) ccons ::= PRIMARY KEY sortorder onconf autoinc */
214, /* (40) ccons ::= UNIQUE onconf */
214, /* (41) ccons ::= CHECK LP expr RP */
214, /* (42) ccons ::= REFERENCES nm eidlist_opt refargs */
214, /* (43) ccons ::= defer_subclause */
214, /* (44) ccons ::= COLLATE ID|STRING */
223, /* (45) generated ::= LP expr RP */
223, /* (46) generated ::= LP expr RP ID */
219, /* (47) autoinc ::= */
219, /* (48) autoinc ::= AUTOINCR */
221, /* (49) refargs ::= */
221, /* (50) refargs ::= refargs refarg */
224, /* (51) refarg ::= MATCH nm */
224, /* (52) refarg ::= ON INSERT refact */
224, /* (53) refarg ::= ON DELETE refact */
224, /* (54) refarg ::= ON UPDATE refact */
225, /* (55) refact ::= SET NULL */
225, /* (56) refact ::= SET DEFAULT */
225, /* (57) refact ::= CASCADE */
225, /* (58) refact ::= RESTRICT */
225, /* (59) refact ::= NO ACTION */
222, /* (60) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
222, /* (61) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
226, /* (62) init_deferred_pred_opt ::= */
226, /* (63) init_deferred_pred_opt ::= INITIALLY DEFERRED */
226, /* (64) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
201, /* (65) conslist_opt ::= */
228, /* (66) tconscomma ::= COMMA */
229, /* (67) tcons ::= CONSTRAINT nm */
229, /* (68) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
229, /* (69) tcons ::= UNIQUE LP sortlist RP onconf */
229, /* (70) tcons ::= CHECK LP expr RP onconf */
229, /* (71) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
232, /* (72) defer_subclause_opt ::= */
217, /* (73) onconf ::= */
217, /* (74) onconf ::= ON CONFLICT resolvetype */
233, /* (75) orconf ::= */
233, /* (76) orconf ::= OR resolvetype */
234, /* (77) resolvetype ::= IGNORE */
234, /* (78) resolvetype ::= REPLACE */
189, /* (79) cmd ::= DROP TABLE ifexists fullname */
236, /* (80) ifexists ::= IF EXISTS */
236, /* (81) ifexists ::= */
189, /* (82) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
189, /* (83) cmd ::= DROP VIEW ifexists fullname */
189, /* (84) cmd ::= select */
203, /* (85) select ::= WITH wqlist selectnowith */
203, /* (86) select ::= WITH RECURSIVE wqlist selectnowith */
203, /* (87) select ::= selectnowith */
238, /* (88) selectnowith ::= selectnowith multiselect_op oneselect */
241, /* (89) multiselect_op ::= UNION */
241, /* (90) multiselect_op ::= UNION ALL */
241, /* (91) multiselect_op ::= EXCEPT|INTERSECT */
239, /* (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
239, /* (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
251, /* (94) values ::= VALUES LP nexprlist RP */
251, /* (95) values ::= values COMMA LP nexprlist RP */
242, /* (96) distinct ::= DISTINCT */
242, /* (97) distinct ::= ALL */
242, /* (98) distinct ::= */
253, /* (99) sclp ::= */
243, /* (100) selcollist ::= sclp scanpt expr scanpt as */
243, /* (101) selcollist ::= sclp scanpt STAR */
243, /* (102) selcollist ::= sclp scanpt nm DOT STAR */
254, /* (103) as ::= AS nm */
254, /* (104) as ::= */
244, /* (105) from ::= */
244, /* (106) from ::= FROM seltablist */
256, /* (107) stl_prefix ::= seltablist joinop */
256, /* (108) stl_prefix ::= */
255, /* (109) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
255, /* (110) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
255, /* (111) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
255, /* (112) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
199, /* (113) dbnm ::= */
199, /* (114) dbnm ::= DOT nm */
237, /* (115) fullname ::= nm */
237, /* (116) fullname ::= nm DOT nm */
262, /* (117) xfullname ::= nm */
262, /* (118) xfullname ::= nm DOT nm */
262, /* (119) xfullname ::= nm DOT nm AS nm */
262, /* (120) xfullname ::= nm AS nm */
257, /* (121) joinop ::= COMMA|JOIN */
257, /* (122) joinop ::= JOIN_KW JOIN */
257, /* (123) joinop ::= JOIN_KW nm JOIN */
257, /* (124) joinop ::= JOIN_KW nm nm JOIN */
259, /* (125) on_opt ::= ON expr */
259, /* (126) on_opt ::= */
258, /* (127) indexed_opt ::= */
258, /* (128) indexed_opt ::= INDEXED BY nm */
258, /* (129) indexed_opt ::= NOT INDEXED */
260, /* (130) using_opt ::= USING LP idlist RP */
260, /* (131) using_opt ::= */
248, /* (132) orderby_opt ::= */
248, /* (133) orderby_opt ::= ORDER BY sortlist */
230, /* (134) sortlist ::= sortlist COMMA expr sortorder nulls */
230, /* (135) sortlist ::= expr sortorder nulls */
218, /* (136) sortorder ::= ASC */
218, /* (137) sortorder ::= DESC */
218, /* (138) sortorder ::= */
264, /* (139) nulls ::= NULLS FIRST */
264, /* (140) nulls ::= NULLS LAST */
264, /* (141) nulls ::= */
246, /* (142) groupby_opt ::= */
246, /* (143) groupby_opt ::= GROUP BY nexprlist */
247, /* (144) having_opt ::= */
247, /* (145) having_opt ::= HAVING expr */
249, /* (146) limit_opt ::= */
249, /* (147) limit_opt ::= LIMIT expr */
249, /* (148) limit_opt ::= LIMIT expr OFFSET expr */
249, /* (149) limit_opt ::= LIMIT expr COMMA expr */
189, /* (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
245, /* (151) where_opt ::= */
245, /* (152) where_opt ::= WHERE expr */
266, /* (153) where_opt_ret ::= */
266, /* (154) where_opt_ret ::= WHERE expr */
266, /* (155) where_opt_ret ::= RETURNING selcollist */
266, /* (156) where_opt_ret ::= WHERE expr RETURNING selcollist */
189, /* (157) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
267, /* (158) setlist ::= setlist COMMA nm EQ expr */
267, /* (159) setlist ::= setlist COMMA LP idlist RP EQ expr */
267, /* (160) setlist ::= nm EQ expr */
267, /* (161) setlist ::= LP idlist RP EQ expr */
189, /* (162) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
189, /* (163) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
270, /* (164) upsert ::= */
270, /* (165) upsert ::= RETURNING selcollist */
270, /* (166) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
270, /* (167) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
270, /* (168) upsert ::= ON CONFLICT DO NOTHING returning */
270, /* (169) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
271, /* (170) returning ::= RETURNING selcollist */
268, /* (171) insert_cmd ::= INSERT orconf */
268, /* (172) insert_cmd ::= REPLACE */
269, /* (173) idlist_opt ::= */
269, /* (174) idlist_opt ::= LP idlist RP */
263, /* (175) idlist ::= idlist COMMA nm */
263, /* (176) idlist ::= nm */
216, /* (177) expr ::= LP expr RP */
216, /* (178) expr ::= ID|INDEXED */
216, /* (179) expr ::= JOIN_KW */
216, /* (180) expr ::= nm DOT nm */
216, /* (181) expr ::= nm DOT nm DOT nm */
215, /* (182) term ::= NULL|FLOAT|BLOB */
215, /* (183) term ::= STRING */
215, /* (184) term ::= INTEGER */
216, /* (185) expr ::= VARIABLE */
216, /* (186) expr ::= expr COLLATE ID|STRING */
216, /* (187) expr ::= CAST LP expr AS typetoken RP */
216, /* (188) expr ::= ID|INDEXED LP distinct exprlist RP */
216, /* (189) expr ::= ID|INDEXED LP STAR RP */
216, /* (190) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
216, /* (191) expr ::= ID|INDEXED LP STAR RP filter_over */
215, /* (192) term ::= CTIME_KW */
216, /* (193) expr ::= LP nexprlist COMMA expr RP */
216, /* (194) expr ::= expr AND expr */
216, /* (195) expr ::= expr OR expr */
216, /* (196) expr ::= expr LT|GT|GE|LE expr */
216, /* (197) expr ::= expr EQ|NE expr */
216, /* (198) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
216, /* (199) expr ::= expr PLUS|MINUS expr */
216, /* (200) expr ::= expr STAR|SLASH|REM expr */
216, /* (201) expr ::= expr CONCAT expr */
273, /* (202) likeop ::= NOT LIKE_KW|MATCH */
216, /* (203) expr ::= expr likeop expr */
216, /* (204) expr ::= expr likeop expr ESCAPE expr */
216, /* (205) expr ::= expr ISNULL|NOTNULL */
216, /* (206) expr ::= expr NOT NULL */
216, /* (207) expr ::= expr IS expr */
216, /* (208) expr ::= expr IS NOT expr */
216, /* (209) expr ::= NOT expr */
216, /* (210) expr ::= BITNOT expr */
216, /* (211) expr ::= PLUS|MINUS expr */
274, /* (212) between_op ::= BETWEEN */
274, /* (213) between_op ::= NOT BETWEEN */
216, /* (214) expr ::= expr between_op expr AND expr */
275, /* (215) in_op ::= IN */
275, /* (216) in_op ::= NOT IN */
216, /* (217) expr ::= expr in_op LP exprlist RP */
216, /* (218) expr ::= LP select RP */
216, /* (219) expr ::= expr in_op LP select RP */
216, /* (220) expr ::= expr in_op nm dbnm paren_exprlist */
216, /* (221) expr ::= EXISTS LP select RP */
216, /* (222) expr ::= CASE case_operand case_exprlist case_else END */
278, /* (223) case_exprlist ::= case_exprlist WHEN expr THEN expr */
278, /* (224) case_exprlist ::= WHEN expr THEN expr */
279, /* (225) case_else ::= ELSE expr */
279, /* (226) case_else ::= */
277, /* (227) case_operand ::= expr */
277, /* (228) case_operand ::= */
261, /* (229) exprlist ::= */
252, /* (230) nexprlist ::= nexprlist COMMA expr */
252, /* (231) nexprlist ::= expr */
276, /* (232) paren_exprlist ::= */
276, /* (233) paren_exprlist ::= LP exprlist RP */
189, /* (234) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
280, /* (235) uniqueflag ::= UNIQUE */
280, /* (236) uniqueflag ::= */
220, /* (237) eidlist_opt ::= */
220, /* (238) eidlist_opt ::= LP eidlist RP */
231, /* (239) eidlist ::= eidlist COMMA nm collate sortorder */
231, /* (240) eidlist ::= nm collate sortorder */
281, /* (241) collate ::= */
281, /* (242) collate ::= COLLATE ID|STRING */
189, /* (243) cmd ::= DROP INDEX ifexists fullname */
189, /* (244) cmd ::= VACUUM vinto */
189, /* (245) cmd ::= VACUUM nm vinto */
282, /* (246) vinto ::= INTO expr */
282, /* (247) vinto ::= */
189, /* (248) cmd ::= PRAGMA nm dbnm */
189, /* (249) cmd ::= PRAGMA nm dbnm EQ nmnum */
189, /* (250) cmd ::= PRAGMA nm dbnm LP nmnum RP */
189, /* (251) cmd ::= PRAGMA nm dbnm EQ minus_num */
189, /* (252) cmd ::= PRAGMA nm dbnm LP minus_num RP */
210, /* (253) plus_num ::= PLUS INTEGER|FLOAT */
211, /* (254) minus_num ::= MINUS INTEGER|FLOAT */
189, /* (255) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
284, /* (256) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
286, /* (257) trigger_time ::= BEFORE|AFTER */
286, /* (258) trigger_time ::= INSTEAD OF */
286, /* (259) trigger_time ::= */
287, /* (260) trigger_event ::= DELETE|INSERT */
287, /* (261) trigger_event ::= UPDATE */
287, /* (262) trigger_event ::= UPDATE OF idlist */
289, /* (263) when_clause ::= */
289, /* (264) when_clause ::= WHEN expr */
285, /* (265) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
285, /* (266) trigger_cmd_list ::= trigger_cmd SEMI */
291, /* (267) trnm ::= nm DOT nm */
292, /* (268) tridxby ::= INDEXED BY nm */
292, /* (269) tridxby ::= NOT INDEXED */
290, /* (270) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
290, /* (271) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
290, /* (272) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
290, /* (273) trigger_cmd ::= scanpt select scanpt */
216, /* (274) expr ::= RAISE LP IGNORE RP */
216, /* (275) expr ::= RAISE LP raisetype COMMA nm RP */
235, /* (276) raisetype ::= ROLLBACK */
235, /* (277) raisetype ::= ABORT */
235, /* (278) raisetype ::= FAIL */
189, /* (279) cmd ::= DROP TRIGGER ifexists fullname */
189, /* (280) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
189, /* (281) cmd ::= DETACH database_kw_opt expr */
294, /* (282) key_opt ::= */
294, /* (283) key_opt ::= KEY expr */
189, /* (284) cmd ::= REINDEX */
189, /* (285) cmd ::= REINDEX nm dbnm */
189, /* (286) cmd ::= ANALYZE */
189, /* (287) cmd ::= ANALYZE nm dbnm */
189, /* (288) cmd ::= ALTER TABLE fullname RENAME TO nm */
189, /* (289) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
189, /* (290) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
295, /* (291) add_column_fullname ::= fullname */
189, /* (292) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
189, /* (293) cmd ::= create_vtab */
189, /* (294) cmd ::= create_vtab LP vtabarglist RP */
297, /* (295) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
299, /* (296) vtabarg ::= */
300, /* (297) vtabargtoken ::= ANY */
300, /* (298) vtabargtoken ::= lp anylist RP */
301, /* (299) lp ::= LP */
265, /* (300) with ::= WITH wqlist */
265, /* (301) with ::= WITH RECURSIVE wqlist */
304, /* (302) wqas ::= AS */
304, /* (303) wqas ::= AS MATERIALIZED */
304, /* (304) wqas ::= AS NOT MATERIALIZED */
303, /* (305) wqitem ::= nm eidlist_opt wqas LP select RP */
240, /* (306) wqlist ::= wqitem */
240, /* (307) wqlist ::= wqlist COMMA wqitem */
305, /* (308) windowdefn_list ::= windowdefn */
305, /* (309) windowdefn_list ::= windowdefn_list COMMA windowdefn */
306, /* (310) windowdefn ::= nm AS LP window RP */
307, /* (311) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
307, /* (312) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
307, /* (313) window ::= ORDER BY sortlist frame_opt */
307, /* (314) window ::= nm ORDER BY sortlist frame_opt */
307, /* (315) window ::= frame_opt */
307, /* (316) window ::= nm frame_opt */
308, /* (317) frame_opt ::= */
308, /* (318) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
308, /* (319) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
312, /* (320) range_or_rows ::= RANGE|ROWS|GROUPS */
314, /* (321) frame_bound_s ::= frame_bound */
314, /* (322) frame_bound_s ::= UNBOUNDED PRECEDING */
315, /* (323) frame_bound_e ::= frame_bound */
315, /* (324) frame_bound_e ::= UNBOUNDED FOLLOWING */
313, /* (325) frame_bound ::= expr PRECEDING|FOLLOWING */
313, /* (326) frame_bound ::= CURRENT ROW */
316, /* (327) frame_exclude_opt ::= */
316, /* (328) frame_exclude_opt ::= EXCLUDE frame_exclude */
317, /* (329) frame_exclude ::= NO OTHERS */
317, /* (330) frame_exclude ::= CURRENT ROW */
317, /* (331) frame_exclude ::= GROUP|TIES */
250, /* (332) window_clause ::= WINDOW windowdefn_list */
272, /* (333) filter_over ::= filter_clause over_clause */
272, /* (334) filter_over ::= over_clause */
272, /* (335) filter_over ::= filter_clause */
311, /* (336) over_clause ::= OVER LP window RP */
311, /* (337) over_clause ::= OVER nm */
310, /* (338) filter_clause ::= FILTER LP WHERE expr RP */
184, /* (339) input ::= cmdlist */
185, /* (340) cmdlist ::= cmdlist ecmd */
185, /* (341) cmdlist ::= ecmd */
186, /* (342) ecmd ::= SEMI */
186, /* (343) ecmd ::= cmdx SEMI */
186, /* (344) ecmd ::= explain cmdx SEMI */
191, /* (345) trans_opt ::= */
191, /* (346) trans_opt ::= TRANSACTION */
191, /* (347) trans_opt ::= TRANSACTION nm */
193, /* (348) savepoint_opt ::= SAVEPOINT */
193, /* (349) savepoint_opt ::= */
189, /* (350) cmd ::= create_table create_table_args */
202, /* (351) table_option_set ::= table_option */
200, /* (352) columnlist ::= columnlist COMMA columnname carglist */
200, /* (353) columnlist ::= columnname carglist */
192, /* (354) nm ::= ID|INDEXED */
192, /* (355) nm ::= STRING */
192, /* (356) nm ::= JOIN_KW */
207, /* (357) typetoken ::= typename */
208, /* (358) typename ::= ID|STRING */
209, /* (359) signed ::= plus_num */
209, /* (360) signed ::= minus_num */
206, /* (361) carglist ::= carglist ccons */
206, /* (362) carglist ::= */
214, /* (363) ccons ::= NULL onconf */
214, /* (364) ccons ::= GENERATED ALWAYS AS generated */
214, /* (365) ccons ::= AS generated */
201, /* (366) conslist_opt ::= COMMA conslist */
227, /* (367) conslist ::= conslist tconscomma tcons */
227, /* (368) conslist ::= tcons */
228, /* (369) tconscomma ::= */
232, /* (370) defer_subclause_opt ::= defer_subclause */
234, /* (371) resolvetype ::= raisetype */
238, /* (372) selectnowith ::= oneselect */
239, /* (373) oneselect ::= values */
253, /* (374) sclp ::= selcollist COMMA */
254, /* (375) as ::= ID|STRING */
271, /* (376) returning ::= */
216, /* (377) expr ::= term */
273, /* (378) likeop ::= LIKE_KW|MATCH */
261, /* (379) exprlist ::= nexprlist */
283, /* (380) nmnum ::= plus_num */
283, /* (381) nmnum ::= nm */
283, /* (382) nmnum ::= ON */
283, /* (383) nmnum ::= DELETE */
283, /* (384) nmnum ::= DEFAULT */
210, /* (385) plus_num ::= INTEGER|FLOAT */
288, /* (386) foreach_clause ::= */
288, /* (387) foreach_clause ::= FOR EACH ROW */
291, /* (388) trnm ::= nm */
292, /* (389) tridxby ::= */
293, /* (390) database_kw_opt ::= DATABASE */
293, /* (391) database_kw_opt ::= */
296, /* (392) kwcolumn_opt ::= */
296, /* (393) kwcolumn_opt ::= COLUMNKW */
298, /* (394) vtabarglist ::= vtabarg */
298, /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */
299, /* (396) vtabarg ::= vtabarg vtabargtoken */
302, /* (397) anylist ::= */
302, /* (398) anylist ::= anylist LP anylist RP */
302, /* (399) anylist ::= anylist ANY */
265, /* (400) with ::= */
};
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
** of symbols on the right-hand side of that rule. */
static const signed char yyRuleInfoNRhs[] = {
-1, /* (0) explain ::= EXPLAIN */
-3, /* (1) explain ::= EXPLAIN QUERY PLAN */
|
| ︙ | ︙ | |||
161344 161345 161346 161347 161348 161349 161350 |
-5, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
-6, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
-1, /* (14) createkw ::= CREATE */
0, /* (15) ifnotexists ::= */
-3, /* (16) ifnotexists ::= IF NOT EXISTS */
-1, /* (17) temp ::= TEMP */
0, /* (18) temp ::= */
| | | | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 161644 161645 161646 161647 161648 161649 161650 161651 161652 161653 161654 161655 161656 161657 161658 161659 161660 161661 161662 161663 161664 161665 161666 161667 161668 161669 161670 161671 161672 161673 161674 161675 161676 161677 161678 161679 161680 161681 161682 161683 161684 161685 161686 161687 161688 161689 161690 161691 161692 161693 161694 161695 161696 161697 161698 161699 161700 161701 161702 161703 161704 161705 161706 161707 161708 161709 161710 161711 161712 161713 161714 161715 161716 161717 161718 161719 161720 161721 161722 161723 161724 161725 161726 161727 161728 161729 161730 161731 161732 161733 161734 161735 161736 161737 161738 161739 161740 161741 161742 161743 161744 161745 161746 161747 161748 161749 161750 161751 161752 161753 161754 161755 161756 161757 161758 161759 161760 161761 161762 161763 161764 161765 161766 161767 161768 161769 161770 161771 161772 161773 161774 161775 161776 161777 161778 161779 161780 161781 161782 161783 161784 161785 161786 161787 161788 161789 161790 161791 161792 161793 161794 161795 161796 161797 161798 161799 161800 161801 161802 161803 161804 161805 161806 161807 161808 161809 161810 161811 161812 161813 161814 161815 161816 161817 161818 161819 161820 161821 161822 161823 161824 161825 161826 161827 161828 161829 161830 161831 161832 161833 161834 161835 161836 161837 161838 161839 161840 161841 161842 161843 161844 161845 161846 161847 161848 161849 161850 161851 161852 161853 161854 161855 161856 161857 161858 161859 161860 161861 161862 161863 161864 161865 161866 161867 161868 161869 161870 161871 161872 161873 161874 161875 161876 161877 161878 161879 161880 161881 161882 161883 161884 161885 161886 161887 161888 161889 161890 161891 161892 161893 161894 161895 161896 161897 161898 161899 161900 161901 161902 161903 161904 161905 161906 161907 161908 161909 161910 161911 161912 161913 161914 161915 161916 161917 161918 161919 161920 161921 161922 161923 161924 161925 161926 161927 161928 161929 161930 161931 161932 161933 161934 161935 161936 161937 161938 161939 161940 161941 161942 161943 161944 161945 161946 161947 161948 161949 161950 161951 161952 161953 161954 161955 161956 161957 161958 161959 161960 161961 161962 161963 161964 161965 161966 161967 161968 161969 161970 161971 161972 161973 161974 161975 161976 161977 161978 161979 161980 161981 161982 161983 161984 161985 161986 161987 161988 161989 161990 161991 161992 161993 161994 161995 161996 161997 161998 161999 162000 162001 162002 162003 162004 162005 162006 162007 162008 162009 162010 162011 162012 162013 162014 162015 162016 162017 162018 162019 162020 162021 162022 162023 162024 162025 162026 162027 162028 162029 162030 162031 162032 162033 162034 162035 162036 162037 162038 162039 |
-5, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
-6, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
-1, /* (14) createkw ::= CREATE */
0, /* (15) ifnotexists ::= */
-3, /* (16) ifnotexists ::= IF NOT EXISTS */
-1, /* (17) temp ::= TEMP */
0, /* (18) temp ::= */
-5, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_option_set */
-2, /* (20) create_table_args ::= AS select */
0, /* (21) table_option_set ::= */
-3, /* (22) table_option_set ::= table_option_set COMMA table_option */
-2, /* (23) table_option ::= WITHOUT nm */
-1, /* (24) table_option ::= nm */
-2, /* (25) columnname ::= nm typetoken */
0, /* (26) typetoken ::= */
-4, /* (27) typetoken ::= typename LP signed RP */
-6, /* (28) typetoken ::= typename LP signed COMMA signed RP */
-2, /* (29) typename ::= typename ID|STRING */
0, /* (30) scanpt ::= */
0, /* (31) scantok ::= */
-2, /* (32) ccons ::= CONSTRAINT nm */
-3, /* (33) ccons ::= DEFAULT scantok term */
-4, /* (34) ccons ::= DEFAULT LP expr RP */
-4, /* (35) ccons ::= DEFAULT PLUS scantok term */
-4, /* (36) ccons ::= DEFAULT MINUS scantok term */
-3, /* (37) ccons ::= DEFAULT scantok ID|INDEXED */
-3, /* (38) ccons ::= NOT NULL onconf */
-5, /* (39) ccons ::= PRIMARY KEY sortorder onconf autoinc */
-2, /* (40) ccons ::= UNIQUE onconf */
-4, /* (41) ccons ::= CHECK LP expr RP */
-4, /* (42) ccons ::= REFERENCES nm eidlist_opt refargs */
-1, /* (43) ccons ::= defer_subclause */
-2, /* (44) ccons ::= COLLATE ID|STRING */
-3, /* (45) generated ::= LP expr RP */
-4, /* (46) generated ::= LP expr RP ID */
0, /* (47) autoinc ::= */
-1, /* (48) autoinc ::= AUTOINCR */
0, /* (49) refargs ::= */
-2, /* (50) refargs ::= refargs refarg */
-2, /* (51) refarg ::= MATCH nm */
-3, /* (52) refarg ::= ON INSERT refact */
-3, /* (53) refarg ::= ON DELETE refact */
-3, /* (54) refarg ::= ON UPDATE refact */
-2, /* (55) refact ::= SET NULL */
-2, /* (56) refact ::= SET DEFAULT */
-1, /* (57) refact ::= CASCADE */
-1, /* (58) refact ::= RESTRICT */
-2, /* (59) refact ::= NO ACTION */
-3, /* (60) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
-2, /* (61) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
0, /* (62) init_deferred_pred_opt ::= */
-2, /* (63) init_deferred_pred_opt ::= INITIALLY DEFERRED */
-2, /* (64) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
0, /* (65) conslist_opt ::= */
-1, /* (66) tconscomma ::= COMMA */
-2, /* (67) tcons ::= CONSTRAINT nm */
-7, /* (68) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
-5, /* (69) tcons ::= UNIQUE LP sortlist RP onconf */
-5, /* (70) tcons ::= CHECK LP expr RP onconf */
-10, /* (71) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
0, /* (72) defer_subclause_opt ::= */
0, /* (73) onconf ::= */
-3, /* (74) onconf ::= ON CONFLICT resolvetype */
0, /* (75) orconf ::= */
-2, /* (76) orconf ::= OR resolvetype */
-1, /* (77) resolvetype ::= IGNORE */
-1, /* (78) resolvetype ::= REPLACE */
-4, /* (79) cmd ::= DROP TABLE ifexists fullname */
-2, /* (80) ifexists ::= IF EXISTS */
0, /* (81) ifexists ::= */
-9, /* (82) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
-4, /* (83) cmd ::= DROP VIEW ifexists fullname */
-1, /* (84) cmd ::= select */
-3, /* (85) select ::= WITH wqlist selectnowith */
-4, /* (86) select ::= WITH RECURSIVE wqlist selectnowith */
-1, /* (87) select ::= selectnowith */
-3, /* (88) selectnowith ::= selectnowith multiselect_op oneselect */
-1, /* (89) multiselect_op ::= UNION */
-2, /* (90) multiselect_op ::= UNION ALL */
-1, /* (91) multiselect_op ::= EXCEPT|INTERSECT */
-9, /* (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
-10, /* (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
-4, /* (94) values ::= VALUES LP nexprlist RP */
-5, /* (95) values ::= values COMMA LP nexprlist RP */
-1, /* (96) distinct ::= DISTINCT */
-1, /* (97) distinct ::= ALL */
0, /* (98) distinct ::= */
0, /* (99) sclp ::= */
-5, /* (100) selcollist ::= sclp scanpt expr scanpt as */
-3, /* (101) selcollist ::= sclp scanpt STAR */
-5, /* (102) selcollist ::= sclp scanpt nm DOT STAR */
-2, /* (103) as ::= AS nm */
0, /* (104) as ::= */
0, /* (105) from ::= */
-2, /* (106) from ::= FROM seltablist */
-2, /* (107) stl_prefix ::= seltablist joinop */
0, /* (108) stl_prefix ::= */
-7, /* (109) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
-9, /* (110) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
-7, /* (111) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
-7, /* (112) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
0, /* (113) dbnm ::= */
-2, /* (114) dbnm ::= DOT nm */
-1, /* (115) fullname ::= nm */
-3, /* (116) fullname ::= nm DOT nm */
-1, /* (117) xfullname ::= nm */
-3, /* (118) xfullname ::= nm DOT nm */
-5, /* (119) xfullname ::= nm DOT nm AS nm */
-3, /* (120) xfullname ::= nm AS nm */
-1, /* (121) joinop ::= COMMA|JOIN */
-2, /* (122) joinop ::= JOIN_KW JOIN */
-3, /* (123) joinop ::= JOIN_KW nm JOIN */
-4, /* (124) joinop ::= JOIN_KW nm nm JOIN */
-2, /* (125) on_opt ::= ON expr */
0, /* (126) on_opt ::= */
0, /* (127) indexed_opt ::= */
-3, /* (128) indexed_opt ::= INDEXED BY nm */
-2, /* (129) indexed_opt ::= NOT INDEXED */
-4, /* (130) using_opt ::= USING LP idlist RP */
0, /* (131) using_opt ::= */
0, /* (132) orderby_opt ::= */
-3, /* (133) orderby_opt ::= ORDER BY sortlist */
-5, /* (134) sortlist ::= sortlist COMMA expr sortorder nulls */
-3, /* (135) sortlist ::= expr sortorder nulls */
-1, /* (136) sortorder ::= ASC */
-1, /* (137) sortorder ::= DESC */
0, /* (138) sortorder ::= */
-2, /* (139) nulls ::= NULLS FIRST */
-2, /* (140) nulls ::= NULLS LAST */
0, /* (141) nulls ::= */
0, /* (142) groupby_opt ::= */
-3, /* (143) groupby_opt ::= GROUP BY nexprlist */
0, /* (144) having_opt ::= */
-2, /* (145) having_opt ::= HAVING expr */
0, /* (146) limit_opt ::= */
-2, /* (147) limit_opt ::= LIMIT expr */
-4, /* (148) limit_opt ::= LIMIT expr OFFSET expr */
-4, /* (149) limit_opt ::= LIMIT expr COMMA expr */
-6, /* (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
0, /* (151) where_opt ::= */
-2, /* (152) where_opt ::= WHERE expr */
0, /* (153) where_opt_ret ::= */
-2, /* (154) where_opt_ret ::= WHERE expr */
-2, /* (155) where_opt_ret ::= RETURNING selcollist */
-4, /* (156) where_opt_ret ::= WHERE expr RETURNING selcollist */
-9, /* (157) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
-5, /* (158) setlist ::= setlist COMMA nm EQ expr */
-7, /* (159) setlist ::= setlist COMMA LP idlist RP EQ expr */
-3, /* (160) setlist ::= nm EQ expr */
-5, /* (161) setlist ::= LP idlist RP EQ expr */
-7, /* (162) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
-8, /* (163) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
0, /* (164) upsert ::= */
-2, /* (165) upsert ::= RETURNING selcollist */
-12, /* (166) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
-9, /* (167) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
-5, /* (168) upsert ::= ON CONFLICT DO NOTHING returning */
-8, /* (169) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
-2, /* (170) returning ::= RETURNING selcollist */
-2, /* (171) insert_cmd ::= INSERT orconf */
-1, /* (172) insert_cmd ::= REPLACE */
0, /* (173) idlist_opt ::= */
-3, /* (174) idlist_opt ::= LP idlist RP */
-3, /* (175) idlist ::= idlist COMMA nm */
-1, /* (176) idlist ::= nm */
-3, /* (177) expr ::= LP expr RP */
-1, /* (178) expr ::= ID|INDEXED */
-1, /* (179) expr ::= JOIN_KW */
-3, /* (180) expr ::= nm DOT nm */
-5, /* (181) expr ::= nm DOT nm DOT nm */
-1, /* (182) term ::= NULL|FLOAT|BLOB */
-1, /* (183) term ::= STRING */
-1, /* (184) term ::= INTEGER */
-1, /* (185) expr ::= VARIABLE */
-3, /* (186) expr ::= expr COLLATE ID|STRING */
-6, /* (187) expr ::= CAST LP expr AS typetoken RP */
-5, /* (188) expr ::= ID|INDEXED LP distinct exprlist RP */
-4, /* (189) expr ::= ID|INDEXED LP STAR RP */
-6, /* (190) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
-5, /* (191) expr ::= ID|INDEXED LP STAR RP filter_over */
-1, /* (192) term ::= CTIME_KW */
-5, /* (193) expr ::= LP nexprlist COMMA expr RP */
-3, /* (194) expr ::= expr AND expr */
-3, /* (195) expr ::= expr OR expr */
-3, /* (196) expr ::= expr LT|GT|GE|LE expr */
-3, /* (197) expr ::= expr EQ|NE expr */
-3, /* (198) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
-3, /* (199) expr ::= expr PLUS|MINUS expr */
-3, /* (200) expr ::= expr STAR|SLASH|REM expr */
-3, /* (201) expr ::= expr CONCAT expr */
-2, /* (202) likeop ::= NOT LIKE_KW|MATCH */
-3, /* (203) expr ::= expr likeop expr */
-5, /* (204) expr ::= expr likeop expr ESCAPE expr */
-2, /* (205) expr ::= expr ISNULL|NOTNULL */
-3, /* (206) expr ::= expr NOT NULL */
-3, /* (207) expr ::= expr IS expr */
-4, /* (208) expr ::= expr IS NOT expr */
-2, /* (209) expr ::= NOT expr */
-2, /* (210) expr ::= BITNOT expr */
-2, /* (211) expr ::= PLUS|MINUS expr */
-1, /* (212) between_op ::= BETWEEN */
-2, /* (213) between_op ::= NOT BETWEEN */
-5, /* (214) expr ::= expr between_op expr AND expr */
-1, /* (215) in_op ::= IN */
-2, /* (216) in_op ::= NOT IN */
-5, /* (217) expr ::= expr in_op LP exprlist RP */
-3, /* (218) expr ::= LP select RP */
-5, /* (219) expr ::= expr in_op LP select RP */
-5, /* (220) expr ::= expr in_op nm dbnm paren_exprlist */
-4, /* (221) expr ::= EXISTS LP select RP */
-5, /* (222) expr ::= CASE case_operand case_exprlist case_else END */
-5, /* (223) case_exprlist ::= case_exprlist WHEN expr THEN expr */
-4, /* (224) case_exprlist ::= WHEN expr THEN expr */
-2, /* (225) case_else ::= ELSE expr */
0, /* (226) case_else ::= */
-1, /* (227) case_operand ::= expr */
0, /* (228) case_operand ::= */
0, /* (229) exprlist ::= */
-3, /* (230) nexprlist ::= nexprlist COMMA expr */
-1, /* (231) nexprlist ::= expr */
0, /* (232) paren_exprlist ::= */
-3, /* (233) paren_exprlist ::= LP exprlist RP */
-12, /* (234) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
-1, /* (235) uniqueflag ::= UNIQUE */
0, /* (236) uniqueflag ::= */
0, /* (237) eidlist_opt ::= */
-3, /* (238) eidlist_opt ::= LP eidlist RP */
-5, /* (239) eidlist ::= eidlist COMMA nm collate sortorder */
-3, /* (240) eidlist ::= nm collate sortorder */
0, /* (241) collate ::= */
-2, /* (242) collate ::= COLLATE ID|STRING */
-4, /* (243) cmd ::= DROP INDEX ifexists fullname */
-2, /* (244) cmd ::= VACUUM vinto */
-3, /* (245) cmd ::= VACUUM nm vinto */
-2, /* (246) vinto ::= INTO expr */
0, /* (247) vinto ::= */
-3, /* (248) cmd ::= PRAGMA nm dbnm */
-5, /* (249) cmd ::= PRAGMA nm dbnm EQ nmnum */
-6, /* (250) cmd ::= PRAGMA nm dbnm LP nmnum RP */
-5, /* (251) cmd ::= PRAGMA nm dbnm EQ minus_num */
-6, /* (252) cmd ::= PRAGMA nm dbnm LP minus_num RP */
-2, /* (253) plus_num ::= PLUS INTEGER|FLOAT */
-2, /* (254) minus_num ::= MINUS INTEGER|FLOAT */
-5, /* (255) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
-11, /* (256) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
-1, /* (257) trigger_time ::= BEFORE|AFTER */
-2, /* (258) trigger_time ::= INSTEAD OF */
0, /* (259) trigger_time ::= */
-1, /* (260) trigger_event ::= DELETE|INSERT */
-1, /* (261) trigger_event ::= UPDATE */
-3, /* (262) trigger_event ::= UPDATE OF idlist */
0, /* (263) when_clause ::= */
-2, /* (264) when_clause ::= WHEN expr */
-3, /* (265) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
-2, /* (266) trigger_cmd_list ::= trigger_cmd SEMI */
-3, /* (267) trnm ::= nm DOT nm */
-3, /* (268) tridxby ::= INDEXED BY nm */
-2, /* (269) tridxby ::= NOT INDEXED */
-9, /* (270) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
-8, /* (271) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
-6, /* (272) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
-3, /* (273) trigger_cmd ::= scanpt select scanpt */
-4, /* (274) expr ::= RAISE LP IGNORE RP */
-6, /* (275) expr ::= RAISE LP raisetype COMMA nm RP */
-1, /* (276) raisetype ::= ROLLBACK */
-1, /* (277) raisetype ::= ABORT */
-1, /* (278) raisetype ::= FAIL */
-4, /* (279) cmd ::= DROP TRIGGER ifexists fullname */
-6, /* (280) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
-3, /* (281) cmd ::= DETACH database_kw_opt expr */
0, /* (282) key_opt ::= */
-2, /* (283) key_opt ::= KEY expr */
-1, /* (284) cmd ::= REINDEX */
-3, /* (285) cmd ::= REINDEX nm dbnm */
-1, /* (286) cmd ::= ANALYZE */
-3, /* (287) cmd ::= ANALYZE nm dbnm */
-6, /* (288) cmd ::= ALTER TABLE fullname RENAME TO nm */
-7, /* (289) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
-6, /* (290) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
-1, /* (291) add_column_fullname ::= fullname */
-8, /* (292) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
-1, /* (293) cmd ::= create_vtab */
-4, /* (294) cmd ::= create_vtab LP vtabarglist RP */
-8, /* (295) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
0, /* (296) vtabarg ::= */
-1, /* (297) vtabargtoken ::= ANY */
-3, /* (298) vtabargtoken ::= lp anylist RP */
-1, /* (299) lp ::= LP */
-2, /* (300) with ::= WITH wqlist */
-3, /* (301) with ::= WITH RECURSIVE wqlist */
-1, /* (302) wqas ::= AS */
-2, /* (303) wqas ::= AS MATERIALIZED */
-3, /* (304) wqas ::= AS NOT MATERIALIZED */
-6, /* (305) wqitem ::= nm eidlist_opt wqas LP select RP */
-1, /* (306) wqlist ::= wqitem */
-3, /* (307) wqlist ::= wqlist COMMA wqitem */
-1, /* (308) windowdefn_list ::= windowdefn */
-3, /* (309) windowdefn_list ::= windowdefn_list COMMA windowdefn */
-5, /* (310) windowdefn ::= nm AS LP window RP */
-5, /* (311) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
-6, /* (312) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
-4, /* (313) window ::= ORDER BY sortlist frame_opt */
-5, /* (314) window ::= nm ORDER BY sortlist frame_opt */
-1, /* (315) window ::= frame_opt */
-2, /* (316) window ::= nm frame_opt */
0, /* (317) frame_opt ::= */
-3, /* (318) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
-6, /* (319) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
-1, /* (320) range_or_rows ::= RANGE|ROWS|GROUPS */
-1, /* (321) frame_bound_s ::= frame_bound */
-2, /* (322) frame_bound_s ::= UNBOUNDED PRECEDING */
-1, /* (323) frame_bound_e ::= frame_bound */
-2, /* (324) frame_bound_e ::= UNBOUNDED FOLLOWING */
-2, /* (325) frame_bound ::= expr PRECEDING|FOLLOWING */
-2, /* (326) frame_bound ::= CURRENT ROW */
0, /* (327) frame_exclude_opt ::= */
-2, /* (328) frame_exclude_opt ::= EXCLUDE frame_exclude */
-2, /* (329) frame_exclude ::= NO OTHERS */
-2, /* (330) frame_exclude ::= CURRENT ROW */
-1, /* (331) frame_exclude ::= GROUP|TIES */
-2, /* (332) window_clause ::= WINDOW windowdefn_list */
-2, /* (333) filter_over ::= filter_clause over_clause */
-1, /* (334) filter_over ::= over_clause */
-1, /* (335) filter_over ::= filter_clause */
-4, /* (336) over_clause ::= OVER LP window RP */
-2, /* (337) over_clause ::= OVER nm */
-5, /* (338) filter_clause ::= FILTER LP WHERE expr RP */
-1, /* (339) input ::= cmdlist */
-2, /* (340) cmdlist ::= cmdlist ecmd */
-1, /* (341) cmdlist ::= ecmd */
-1, /* (342) ecmd ::= SEMI */
-2, /* (343) ecmd ::= cmdx SEMI */
-3, /* (344) ecmd ::= explain cmdx SEMI */
0, /* (345) trans_opt ::= */
-1, /* (346) trans_opt ::= TRANSACTION */
-2, /* (347) trans_opt ::= TRANSACTION nm */
-1, /* (348) savepoint_opt ::= SAVEPOINT */
0, /* (349) savepoint_opt ::= */
-2, /* (350) cmd ::= create_table create_table_args */
-1, /* (351) table_option_set ::= table_option */
-4, /* (352) columnlist ::= columnlist COMMA columnname carglist */
-2, /* (353) columnlist ::= columnname carglist */
-1, /* (354) nm ::= ID|INDEXED */
-1, /* (355) nm ::= STRING */
-1, /* (356) nm ::= JOIN_KW */
-1, /* (357) typetoken ::= typename */
-1, /* (358) typename ::= ID|STRING */
-1, /* (359) signed ::= plus_num */
-1, /* (360) signed ::= minus_num */
-2, /* (361) carglist ::= carglist ccons */
0, /* (362) carglist ::= */
-2, /* (363) ccons ::= NULL onconf */
-4, /* (364) ccons ::= GENERATED ALWAYS AS generated */
-2, /* (365) ccons ::= AS generated */
-2, /* (366) conslist_opt ::= COMMA conslist */
-3, /* (367) conslist ::= conslist tconscomma tcons */
-1, /* (368) conslist ::= tcons */
0, /* (369) tconscomma ::= */
-1, /* (370) defer_subclause_opt ::= defer_subclause */
-1, /* (371) resolvetype ::= raisetype */
-1, /* (372) selectnowith ::= oneselect */
-1, /* (373) oneselect ::= values */
-2, /* (374) sclp ::= selcollist COMMA */
-1, /* (375) as ::= ID|STRING */
0, /* (376) returning ::= */
-1, /* (377) expr ::= term */
-1, /* (378) likeop ::= LIKE_KW|MATCH */
-1, /* (379) exprlist ::= nexprlist */
-1, /* (380) nmnum ::= plus_num */
-1, /* (381) nmnum ::= nm */
-1, /* (382) nmnum ::= ON */
-1, /* (383) nmnum ::= DELETE */
-1, /* (384) nmnum ::= DEFAULT */
-1, /* (385) plus_num ::= INTEGER|FLOAT */
0, /* (386) foreach_clause ::= */
-3, /* (387) foreach_clause ::= FOR EACH ROW */
-1, /* (388) trnm ::= nm */
0, /* (389) tridxby ::= */
-1, /* (390) database_kw_opt ::= DATABASE */
0, /* (391) database_kw_opt ::= */
0, /* (392) kwcolumn_opt ::= */
-1, /* (393) kwcolumn_opt ::= COLUMNKW */
-1, /* (394) vtabarglist ::= vtabarg */
-3, /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */
-2, /* (396) vtabarg ::= vtabarg vtabargtoken */
0, /* (397) anylist ::= */
-4, /* (398) anylist ::= anylist LP anylist RP */
-2, /* (399) anylist ::= anylist ANY */
0, /* (400) with ::= */
};
static void yy_accept(yyParser*); /* Forward Declaration */
/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
|
| ︙ | ︙ | |||
161774 161775 161776 161777 161778 161779 161780 |
case 1: /* explain ::= EXPLAIN QUERY PLAN */
{ pParse->explain = 2; }
break;
case 2: /* cmdx ::= cmd */
{ sqlite3FinishCoding(pParse); }
break;
case 3: /* cmd ::= BEGIN transtype trans_opt */
| | | | | | 162077 162078 162079 162080 162081 162082 162083 162084 162085 162086 162087 162088 162089 162090 162091 162092 162093 162094 162095 162096 162097 162098 162099 162100 |
case 1: /* explain ::= EXPLAIN QUERY PLAN */
{ pParse->explain = 2; }
break;
case 2: /* cmdx ::= cmd */
{ sqlite3FinishCoding(pParse); }
break;
case 3: /* cmd ::= BEGIN transtype trans_opt */
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy64);}
break;
case 4: /* transtype ::= */
{yymsp[1].minor.yy64 = TK_DEFERRED;}
break;
case 5: /* transtype ::= DEFERRED */
case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
case 320: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==320);
{yymsp[0].minor.yy64 = yymsp[0].major; /*A-overwrites-X*/}
break;
case 8: /* cmd ::= COMMIT|END trans_opt */
case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
{sqlite3EndTransaction(pParse,yymsp[-1].major);}
break;
case 10: /* cmd ::= SAVEPOINT nm */
{
|
| ︙ | ︙ | |||
161806 161807 161808 161809 161810 161811 161812 |
case 12: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
{
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
}
break;
case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
{
| | < | | | | | | | | | | | | | > > > | > > > > | | > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 162109 162110 162111 162112 162113 162114 162115 162116 162117 162118 162119 162120 162121 162122 162123 162124 162125 162126 162127 162128 162129 162130 162131 162132 162133 162134 162135 162136 162137 162138 162139 162140 162141 162142 162143 162144 162145 162146 162147 162148 162149 162150 162151 162152 162153 162154 162155 162156 162157 162158 162159 162160 162161 162162 162163 162164 162165 162166 162167 162168 162169 162170 162171 162172 162173 162174 162175 162176 162177 162178 162179 162180 162181 162182 162183 162184 162185 162186 162187 162188 162189 162190 162191 162192 162193 162194 162195 162196 162197 162198 162199 162200 162201 162202 162203 162204 162205 162206 162207 162208 162209 162210 162211 162212 162213 162214 162215 162216 162217 162218 162219 162220 162221 162222 162223 162224 162225 162226 162227 162228 162229 162230 162231 162232 162233 162234 162235 162236 162237 162238 162239 162240 162241 162242 162243 162244 162245 162246 162247 162248 162249 162250 162251 162252 162253 162254 162255 162256 162257 162258 162259 162260 162261 162262 162263 162264 162265 162266 162267 162268 162269 162270 162271 162272 162273 162274 162275 162276 162277 162278 162279 162280 162281 162282 162283 162284 162285 162286 162287 162288 162289 162290 162291 162292 162293 162294 162295 162296 162297 162298 162299 162300 162301 162302 162303 162304 162305 162306 162307 162308 162309 162310 162311 162312 162313 162314 162315 162316 162317 162318 162319 162320 162321 162322 162323 162324 162325 162326 162327 162328 162329 162330 162331 162332 162333 162334 162335 162336 162337 162338 162339 162340 162341 162342 162343 162344 162345 162346 162347 162348 162349 162350 162351 162352 162353 162354 162355 162356 162357 162358 162359 162360 162361 162362 162363 162364 162365 162366 162367 162368 162369 162370 162371 162372 162373 162374 162375 162376 162377 162378 162379 162380 162381 162382 162383 162384 162385 162386 162387 162388 162389 162390 162391 162392 162393 162394 162395 162396 162397 162398 162399 162400 162401 162402 162403 162404 162405 162406 162407 162408 162409 162410 162411 162412 162413 162414 162415 162416 162417 162418 162419 162420 162421 162422 162423 162424 162425 162426 162427 162428 162429 162430 162431 162432 162433 162434 162435 162436 162437 162438 162439 162440 162441 162442 162443 162444 162445 162446 162447 162448 162449 162450 162451 162452 162453 162454 162455 162456 162457 162458 162459 162460 162461 162462 162463 162464 162465 162466 162467 162468 162469 162470 162471 162472 162473 162474 162475 162476 162477 162478 162479 162480 162481 162482 162483 162484 162485 162486 162487 162488 162489 162490 162491 162492 162493 162494 162495 162496 162497 162498 162499 162500 162501 162502 162503 162504 162505 162506 162507 162508 162509 162510 162511 162512 162513 162514 162515 162516 162517 162518 162519 162520 162521 162522 162523 162524 162525 162526 162527 162528 162529 162530 162531 162532 162533 162534 162535 162536 162537 162538 162539 162540 162541 162542 162543 162544 162545 162546 162547 162548 162549 162550 162551 162552 162553 162554 162555 162556 162557 162558 162559 162560 162561 162562 162563 162564 162565 162566 162567 162568 162569 162570 162571 162572 162573 162574 162575 162576 162577 162578 162579 162580 162581 162582 162583 162584 162585 162586 162587 162588 162589 162590 162591 162592 162593 162594 162595 162596 162597 162598 162599 162600 162601 162602 162603 162604 162605 162606 162607 162608 162609 162610 162611 162612 162613 162614 162615 162616 162617 162618 162619 162620 162621 162622 162623 162624 162625 162626 162627 162628 162629 162630 162631 162632 162633 162634 162635 162636 162637 162638 162639 162640 162641 162642 162643 162644 162645 162646 162647 162648 162649 162650 162651 162652 162653 162654 162655 162656 162657 162658 162659 162660 162661 162662 162663 162664 162665 162666 162667 162668 162669 162670 162671 162672 162673 162674 162675 162676 162677 162678 162679 162680 162681 162682 162683 162684 162685 162686 162687 162688 162689 162690 162691 162692 162693 162694 162695 162696 162697 162698 162699 162700 162701 162702 162703 162704 162705 162706 162707 162708 162709 162710 162711 162712 162713 162714 162715 162716 162717 162718 162719 162720 162721 162722 162723 162724 162725 162726 162727 162728 162729 162730 162731 162732 162733 162734 162735 162736 162737 162738 162739 162740 162741 162742 162743 162744 162745 162746 162747 162748 162749 162750 162751 162752 162753 162754 162755 162756 162757 162758 162759 162760 162761 162762 162763 162764 162765 162766 162767 162768 162769 162770 162771 162772 162773 162774 162775 162776 162777 162778 162779 162780 162781 162782 162783 162784 162785 162786 162787 162788 162789 162790 162791 162792 162793 162794 162795 162796 162797 162798 162799 162800 162801 162802 162803 162804 162805 162806 162807 162808 162809 162810 162811 162812 162813 162814 162815 162816 162817 162818 162819 162820 162821 162822 162823 162824 162825 162826 162827 162828 162829 162830 162831 162832 162833 162834 162835 162836 162837 162838 162839 162840 162841 162842 162843 162844 162845 162846 162847 162848 162849 162850 162851 162852 162853 162854 162855 162856 162857 162858 162859 162860 162861 162862 162863 162864 162865 162866 162867 162868 162869 162870 162871 162872 162873 162874 162875 162876 162877 162878 162879 162880 162881 162882 162883 162884 162885 162886 162887 162888 162889 162890 162891 162892 162893 162894 162895 162896 162897 162898 162899 162900 162901 162902 162903 162904 162905 162906 162907 162908 162909 162910 162911 162912 162913 162914 162915 162916 162917 162918 162919 162920 162921 162922 162923 162924 162925 162926 162927 162928 162929 162930 162931 162932 162933 162934 162935 162936 162937 162938 162939 162940 162941 162942 162943 162944 162945 162946 162947 162948 162949 162950 162951 162952 162953 162954 162955 162956 162957 162958 162959 162960 162961 162962 162963 162964 162965 162966 162967 162968 162969 162970 162971 162972 162973 162974 162975 162976 162977 162978 162979 162980 162981 162982 162983 162984 162985 162986 162987 162988 162989 162990 162991 162992 162993 162994 162995 162996 162997 162998 162999 163000 163001 163002 163003 163004 163005 163006 163007 163008 163009 163010 163011 163012 163013 163014 163015 163016 163017 163018 163019 163020 163021 163022 163023 163024 163025 163026 163027 163028 163029 163030 163031 163032 163033 163034 163035 163036 163037 163038 163039 163040 163041 163042 163043 163044 163045 163046 163047 163048 163049 163050 163051 163052 163053 163054 163055 163056 163057 163058 163059 163060 163061 163062 163063 163064 163065 163066 163067 163068 163069 163070 163071 163072 163073 163074 163075 163076 163077 163078 163079 163080 163081 163082 163083 163084 163085 163086 163087 163088 163089 163090 163091 163092 163093 163094 163095 163096 163097 163098 163099 163100 163101 163102 163103 163104 163105 163106 163107 163108 163109 163110 163111 163112 163113 163114 163115 163116 163117 163118 163119 163120 163121 163122 163123 163124 163125 163126 163127 163128 163129 163130 163131 163132 163133 163134 163135 163136 163137 163138 163139 163140 163141 163142 163143 163144 163145 163146 163147 163148 163149 163150 163151 163152 163153 163154 163155 163156 163157 163158 163159 163160 163161 163162 163163 163164 163165 163166 163167 163168 163169 163170 163171 163172 163173 163174 163175 163176 163177 163178 163179 163180 163181 163182 163183 163184 163185 163186 163187 163188 163189 163190 163191 163192 163193 163194 163195 163196 163197 163198 163199 163200 163201 163202 163203 163204 163205 163206 163207 163208 163209 163210 163211 163212 163213 163214 163215 163216 163217 163218 163219 163220 163221 163222 163223 163224 163225 163226 163227 163228 163229 163230 163231 163232 163233 163234 163235 163236 163237 163238 163239 163240 163241 163242 163243 163244 163245 163246 163247 163248 163249 163250 163251 163252 163253 163254 163255 163256 163257 163258 163259 163260 163261 163262 163263 163264 163265 163266 163267 163268 163269 163270 163271 163272 163273 163274 163275 163276 163277 163278 163279 163280 163281 163282 163283 163284 163285 163286 163287 163288 163289 163290 163291 163292 163293 163294 163295 163296 163297 163298 163299 163300 163301 163302 163303 163304 163305 163306 163307 163308 163309 163310 163311 163312 163313 163314 163315 163316 163317 163318 163319 163320 163321 163322 163323 163324 163325 163326 163327 163328 163329 163330 163331 163332 163333 163334 163335 163336 163337 163338 163339 163340 163341 163342 163343 163344 163345 163346 163347 163348 163349 163350 163351 163352 163353 163354 163355 163356 163357 163358 163359 163360 163361 163362 163363 163364 163365 163366 163367 163368 163369 163370 163371 163372 163373 163374 163375 163376 163377 163378 163379 163380 163381 163382 163383 163384 163385 163386 163387 163388 163389 163390 163391 163392 163393 163394 163395 163396 163397 163398 163399 163400 163401 163402 163403 163404 163405 163406 163407 163408 163409 163410 163411 163412 163413 163414 163415 163416 163417 163418 163419 163420 163421 163422 163423 163424 163425 163426 163427 163428 163429 163430 163431 163432 163433 163434 163435 163436 163437 163438 163439 163440 163441 163442 163443 163444 163445 163446 163447 163448 163449 163450 163451 163452 163453 163454 163455 163456 163457 163458 163459 163460 163461 163462 163463 163464 163465 163466 163467 163468 163469 163470 163471 163472 163473 163474 163475 163476 163477 163478 163479 163480 163481 163482 163483 163484 163485 163486 163487 163488 163489 163490 163491 163492 163493 163494 163495 163496 163497 163498 163499 163500 163501 163502 163503 163504 163505 163506 163507 163508 163509 163510 163511 163512 163513 163514 163515 163516 163517 163518 163519 163520 163521 163522 163523 163524 163525 163526 163527 163528 163529 163530 163531 163532 163533 163534 163535 163536 163537 163538 163539 163540 163541 163542 163543 163544 163545 163546 163547 163548 163549 163550 163551 163552 163553 163554 163555 |
case 12: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
{
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
}
break;
case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
{
sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy64,0,0,yymsp[-2].minor.yy64);
}
break;
case 14: /* createkw ::= CREATE */
{disableLookaside(pParse);}
break;
case 15: /* ifnotexists ::= */
case 18: /* temp ::= */ yytestcase(yyruleno==18);
case 47: /* autoinc ::= */ yytestcase(yyruleno==47);
case 62: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==62);
case 72: /* defer_subclause_opt ::= */ yytestcase(yyruleno==72);
case 81: /* ifexists ::= */ yytestcase(yyruleno==81);
case 98: /* distinct ::= */ yytestcase(yyruleno==98);
case 241: /* collate ::= */ yytestcase(yyruleno==241);
{yymsp[1].minor.yy64 = 0;}
break;
case 16: /* ifnotexists ::= IF NOT EXISTS */
{yymsp[-2].minor.yy64 = 1;}
break;
case 17: /* temp ::= TEMP */
{yymsp[0].minor.yy64 = pParse->db->init.busy==0;}
break;
case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */
{
sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy51,0);
}
break;
case 20: /* create_table_args ::= AS select */
{
sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy303);
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy303);
}
break;
case 21: /* table_option_set ::= */
{yymsp[1].minor.yy51 = 0;}
break;
case 22: /* table_option_set ::= table_option_set COMMA table_option */
{yylhsminor.yy51 = yymsp[-2].minor.yy51|yymsp[0].minor.yy51;}
yymsp[-2].minor.yy51 = yylhsminor.yy51;
break;
case 23: /* table_option ::= WITHOUT nm */
{
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
yymsp[-1].minor.yy51 = TF_WithoutRowid | TF_NoVisibleRowid;
}else{
yymsp[-1].minor.yy51 = 0;
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
}
}
break;
case 24: /* table_option ::= nm */
{
if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){
yylhsminor.yy51 = TF_Strict;
}else{
yylhsminor.yy51 = 0;
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
}
}
yymsp[0].minor.yy51 = yylhsminor.yy51;
break;
case 25: /* columnname ::= nm typetoken */
{sqlite3AddColumn(pParse,yymsp[-1].minor.yy0,yymsp[0].minor.yy0);}
break;
case 26: /* typetoken ::= */
case 65: /* conslist_opt ::= */ yytestcase(yyruleno==65);
case 104: /* as ::= */ yytestcase(yyruleno==104);
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;}
break;
case 27: /* typetoken ::= typename LP signed RP */
{
yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
}
break;
case 28: /* typetoken ::= typename LP signed COMMA signed RP */
{
yymsp[-5].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
}
break;
case 29: /* typename ::= typename ID|STRING */
{yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
break;
case 30: /* scanpt ::= */
{
assert( yyLookahead!=YYNOCODE );
yymsp[1].minor.yy600 = yyLookaheadToken.z;
}
break;
case 31: /* scantok ::= */
{
assert( yyLookahead!=YYNOCODE );
yymsp[1].minor.yy0 = yyLookaheadToken;
}
break;
case 32: /* ccons ::= CONSTRAINT nm */
case 67: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==67);
{pParse->constraintName = yymsp[0].minor.yy0;}
break;
case 33: /* ccons ::= DEFAULT scantok term */
{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy626,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
break;
case 34: /* ccons ::= DEFAULT LP expr RP */
{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy626,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
break;
case 35: /* ccons ::= DEFAULT PLUS scantok term */
{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy626,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
break;
case 36: /* ccons ::= DEFAULT MINUS scantok term */
{
Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy626, 0);
sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
}
break;
case 37: /* ccons ::= DEFAULT scantok ID|INDEXED */
{
Expr *p = tokenExpr(pParse, TK_STRING, yymsp[0].minor.yy0);
if( p ){
sqlite3ExprIdToTrueFalse(p);
testcase( p->op==TK_TRUEFALSE && sqlite3ExprTruthValue(p) );
}
sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
}
break;
case 38: /* ccons ::= NOT NULL onconf */
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy64);}
break;
case 39: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy64,yymsp[0].minor.yy64,yymsp[-2].minor.yy64);}
break;
case 40: /* ccons ::= UNIQUE onconf */
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy64,0,0,0,0,
SQLITE_IDXTYPE_UNIQUE);}
break;
case 41: /* ccons ::= CHECK LP expr RP */
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy626,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
break;
case 42: /* ccons ::= REFERENCES nm eidlist_opt refargs */
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy562,yymsp[0].minor.yy64);}
break;
case 43: /* ccons ::= defer_subclause */
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy64);}
break;
case 44: /* ccons ::= COLLATE ID|STRING */
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
break;
case 45: /* generated ::= LP expr RP */
{sqlite3AddGenerated(pParse,yymsp[-1].minor.yy626,0);}
break;
case 46: /* generated ::= LP expr RP ID */
{sqlite3AddGenerated(pParse,yymsp[-2].minor.yy626,&yymsp[0].minor.yy0);}
break;
case 48: /* autoinc ::= AUTOINCR */
{yymsp[0].minor.yy64 = 1;}
break;
case 49: /* refargs ::= */
{ yymsp[1].minor.yy64 = OE_None*0x0101; /* EV: R-19803-45884 */}
break;
case 50: /* refargs ::= refargs refarg */
{ yymsp[-1].minor.yy64 = (yymsp[-1].minor.yy64 & ~yymsp[0].minor.yy83.mask) | yymsp[0].minor.yy83.value; }
break;
case 51: /* refarg ::= MATCH nm */
{ yymsp[-1].minor.yy83.value = 0; yymsp[-1].minor.yy83.mask = 0x000000; }
break;
case 52: /* refarg ::= ON INSERT refact */
{ yymsp[-2].minor.yy83.value = 0; yymsp[-2].minor.yy83.mask = 0x000000; }
break;
case 53: /* refarg ::= ON DELETE refact */
{ yymsp[-2].minor.yy83.value = yymsp[0].minor.yy64; yymsp[-2].minor.yy83.mask = 0x0000ff; }
break;
case 54: /* refarg ::= ON UPDATE refact */
{ yymsp[-2].minor.yy83.value = yymsp[0].minor.yy64<<8; yymsp[-2].minor.yy83.mask = 0x00ff00; }
break;
case 55: /* refact ::= SET NULL */
{ yymsp[-1].minor.yy64 = OE_SetNull; /* EV: R-33326-45252 */}
break;
case 56: /* refact ::= SET DEFAULT */
{ yymsp[-1].minor.yy64 = OE_SetDflt; /* EV: R-33326-45252 */}
break;
case 57: /* refact ::= CASCADE */
{ yymsp[0].minor.yy64 = OE_Cascade; /* EV: R-33326-45252 */}
break;
case 58: /* refact ::= RESTRICT */
{ yymsp[0].minor.yy64 = OE_Restrict; /* EV: R-33326-45252 */}
break;
case 59: /* refact ::= NO ACTION */
{ yymsp[-1].minor.yy64 = OE_None; /* EV: R-33326-45252 */}
break;
case 60: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
{yymsp[-2].minor.yy64 = 0;}
break;
case 61: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
case 76: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==76);
case 171: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==171);
{yymsp[-1].minor.yy64 = yymsp[0].minor.yy64;}
break;
case 63: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
case 80: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==80);
case 213: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==213);
case 216: /* in_op ::= NOT IN */ yytestcase(yyruleno==216);
case 242: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==242);
{yymsp[-1].minor.yy64 = 1;}
break;
case 64: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
{yymsp[-1].minor.yy64 = 0;}
break;
case 66: /* tconscomma ::= COMMA */
{pParse->constraintName.n = 0;}
break;
case 68: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy562,yymsp[0].minor.yy64,yymsp[-2].minor.yy64,0);}
break;
case 69: /* tcons ::= UNIQUE LP sortlist RP onconf */
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy562,yymsp[0].minor.yy64,0,0,0,0,
SQLITE_IDXTYPE_UNIQUE);}
break;
case 70: /* tcons ::= CHECK LP expr RP onconf */
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy626,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
break;
case 71: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
{
sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy562, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy562, yymsp[-1].minor.yy64);
sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy64);
}
break;
case 73: /* onconf ::= */
case 75: /* orconf ::= */ yytestcase(yyruleno==75);
{yymsp[1].minor.yy64 = OE_Default;}
break;
case 74: /* onconf ::= ON CONFLICT resolvetype */
{yymsp[-2].minor.yy64 = yymsp[0].minor.yy64;}
break;
case 77: /* resolvetype ::= IGNORE */
{yymsp[0].minor.yy64 = OE_Ignore;}
break;
case 78: /* resolvetype ::= REPLACE */
case 172: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==172);
{yymsp[0].minor.yy64 = OE_Replace;}
break;
case 79: /* cmd ::= DROP TABLE ifexists fullname */
{
sqlite3DropTable(pParse, yymsp[0].minor.yy607, 0, yymsp[-1].minor.yy64);
}
break;
case 82: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
{
sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy562, yymsp[0].minor.yy303, yymsp[-7].minor.yy64, yymsp[-5].minor.yy64);
}
break;
case 83: /* cmd ::= DROP VIEW ifexists fullname */
{
sqlite3DropTable(pParse, yymsp[0].minor.yy607, 1, yymsp[-1].minor.yy64);
}
break;
case 84: /* cmd ::= select */
{
SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
sqlite3Select(pParse, yymsp[0].minor.yy303, &dest);
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy303);
}
break;
case 85: /* select ::= WITH wqlist selectnowith */
{yymsp[-2].minor.yy303 = attachWithToSelect(pParse,yymsp[0].minor.yy303,yymsp[-1].minor.yy43);}
break;
case 86: /* select ::= WITH RECURSIVE wqlist selectnowith */
{yymsp[-3].minor.yy303 = attachWithToSelect(pParse,yymsp[0].minor.yy303,yymsp[-1].minor.yy43);}
break;
case 87: /* select ::= selectnowith */
{
Select *p = yymsp[0].minor.yy303;
if( p ){
parserDoubleLinkSelect(pParse, p);
}
yymsp[0].minor.yy303 = p; /*A-overwrites-X*/
}
break;
case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
{
Select *pRhs = yymsp[0].minor.yy303;
Select *pLhs = yymsp[-2].minor.yy303;
if( pRhs && pRhs->pPrior ){
SrcList *pFrom;
Token x;
x.n = 0;
parserDoubleLinkSelect(pParse, pRhs);
pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0,0);
pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
}
if( pRhs ){
pRhs->op = (u8)yymsp[-1].minor.yy64;
pRhs->pPrior = pLhs;
if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
pRhs->selFlags &= ~SF_MultiValue;
if( yymsp[-1].minor.yy64!=TK_ALL ) pParse->hasCompound = 1;
}else{
sqlite3SelectDelete(pParse->db, pLhs);
}
yymsp[-2].minor.yy303 = pRhs;
}
break;
case 89: /* multiselect_op ::= UNION */
case 91: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==91);
{yymsp[0].minor.yy64 = yymsp[0].major; /*A-overwrites-OP*/}
break;
case 90: /* multiselect_op ::= UNION ALL */
{yymsp[-1].minor.yy64 = TK_ALL;}
break;
case 92: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
{
yymsp[-8].minor.yy303 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy562,yymsp[-5].minor.yy607,yymsp[-4].minor.yy626,yymsp[-3].minor.yy562,yymsp[-2].minor.yy626,yymsp[-1].minor.yy562,yymsp[-7].minor.yy64,yymsp[0].minor.yy626);
}
break;
case 93: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
{
yymsp[-9].minor.yy303 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy562,yymsp[-6].minor.yy607,yymsp[-5].minor.yy626,yymsp[-4].minor.yy562,yymsp[-3].minor.yy626,yymsp[-1].minor.yy562,yymsp[-8].minor.yy64,yymsp[0].minor.yy626);
if( yymsp[-9].minor.yy303 ){
yymsp[-9].minor.yy303->pWinDefn = yymsp[-2].minor.yy375;
}else{
sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy375);
}
}
break;
case 94: /* values ::= VALUES LP nexprlist RP */
{
yymsp[-3].minor.yy303 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy562,0,0,0,0,0,SF_Values,0);
}
break;
case 95: /* values ::= values COMMA LP nexprlist RP */
{
Select *pRight, *pLeft = yymsp[-4].minor.yy303;
pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy562,0,0,0,0,0,SF_Values|SF_MultiValue,0);
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
if( pRight ){
pRight->op = TK_ALL;
pRight->pPrior = pLeft;
yymsp[-4].minor.yy303 = pRight;
}else{
yymsp[-4].minor.yy303 = pLeft;
}
}
break;
case 96: /* distinct ::= DISTINCT */
{yymsp[0].minor.yy64 = SF_Distinct;}
break;
case 97: /* distinct ::= ALL */
{yymsp[0].minor.yy64 = SF_All;}
break;
case 99: /* sclp ::= */
case 132: /* orderby_opt ::= */ yytestcase(yyruleno==132);
case 142: /* groupby_opt ::= */ yytestcase(yyruleno==142);
case 229: /* exprlist ::= */ yytestcase(yyruleno==229);
case 232: /* paren_exprlist ::= */ yytestcase(yyruleno==232);
case 237: /* eidlist_opt ::= */ yytestcase(yyruleno==237);
{yymsp[1].minor.yy562 = 0;}
break;
case 100: /* selcollist ::= sclp scanpt expr scanpt as */
{
yymsp[-4].minor.yy562 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy562, yymsp[-2].minor.yy626);
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy562, &yymsp[0].minor.yy0, 1);
sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy562,yymsp[-3].minor.yy600,yymsp[-1].minor.yy600);
}
break;
case 101: /* selcollist ::= sclp scanpt STAR */
{
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
yymsp[-2].minor.yy562 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy562, p);
}
break;
case 102: /* selcollist ::= sclp scanpt nm DOT STAR */
{
Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
yymsp[-4].minor.yy562 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy562, pDot);
}
break;
case 103: /* as ::= AS nm */
case 114: /* dbnm ::= DOT nm */ yytestcase(yyruleno==114);
case 253: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==253);
case 254: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==254);
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
break;
case 105: /* from ::= */
case 108: /* stl_prefix ::= */ yytestcase(yyruleno==108);
{yymsp[1].minor.yy607 = 0;}
break;
case 106: /* from ::= FROM seltablist */
{
yymsp[-1].minor.yy607 = yymsp[0].minor.yy607;
sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy607);
}
break;
case 107: /* stl_prefix ::= seltablist joinop */
{
if( ALWAYS(yymsp[-1].minor.yy607 && yymsp[-1].minor.yy607->nSrc>0) ) yymsp[-1].minor.yy607->a[yymsp[-1].minor.yy607->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy64;
}
break;
case 109: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
{
yymsp[-6].minor.yy607 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy607,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy626,yymsp[0].minor.yy240);
sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy607, &yymsp[-2].minor.yy0);
}
break;
case 110: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
{
yymsp[-8].minor.yy607 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy607,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy626,yymsp[0].minor.yy240);
sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy607, yymsp[-4].minor.yy562);
}
break;
case 111: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
{
yymsp[-6].minor.yy607 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy607,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy303,yymsp[-1].minor.yy626,yymsp[0].minor.yy240);
}
break;
case 112: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
{
if( yymsp[-6].minor.yy607==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy626==0 && yymsp[0].minor.yy240==0 ){
yymsp[-6].minor.yy607 = yymsp[-4].minor.yy607;
}else if( yymsp[-4].minor.yy607->nSrc==1 ){
yymsp[-6].minor.yy607 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy607,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy626,yymsp[0].minor.yy240);
if( yymsp[-6].minor.yy607 ){
SrcItem *pNew = &yymsp[-6].minor.yy607->a[yymsp[-6].minor.yy607->nSrc-1];
SrcItem *pOld = yymsp[-4].minor.yy607->a;
pNew->zName = pOld->zName;
pNew->zDatabase = pOld->zDatabase;
pNew->pSelect = pOld->pSelect;
if( pOld->fg.isTabFunc ){
pNew->u1.pFuncArg = pOld->u1.pFuncArg;
pOld->u1.pFuncArg = 0;
pOld->fg.isTabFunc = 0;
pNew->fg.isTabFunc = 1;
}
pOld->zName = pOld->zDatabase = 0;
pOld->pSelect = 0;
}
sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy607);
}else{
Select *pSubquery;
sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy607);
pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy607,0,0,0,0,SF_NestedFrom,0);
yymsp[-6].minor.yy607 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy607,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy626,yymsp[0].minor.yy240);
}
}
break;
case 113: /* dbnm ::= */
case 127: /* indexed_opt ::= */ yytestcase(yyruleno==127);
{yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
break;
case 115: /* fullname ::= nm */
{
yylhsminor.yy607 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
if( IN_RENAME_OBJECT && yylhsminor.yy607 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy607->a[0].zName, &yymsp[0].minor.yy0);
}
yymsp[0].minor.yy607 = yylhsminor.yy607;
break;
case 116: /* fullname ::= nm DOT nm */
{
yylhsminor.yy607 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
if( IN_RENAME_OBJECT && yylhsminor.yy607 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy607->a[0].zName, &yymsp[0].minor.yy0);
}
yymsp[-2].minor.yy607 = yylhsminor.yy607;
break;
case 117: /* xfullname ::= nm */
{yymsp[0].minor.yy607 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
break;
case 118: /* xfullname ::= nm DOT nm */
{yymsp[-2].minor.yy607 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
case 119: /* xfullname ::= nm DOT nm AS nm */
{
yymsp[-4].minor.yy607 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
if( yymsp[-4].minor.yy607 ) yymsp[-4].minor.yy607->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
}
break;
case 120: /* xfullname ::= nm AS nm */
{
yymsp[-2].minor.yy607 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
if( yymsp[-2].minor.yy607 ) yymsp[-2].minor.yy607->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
}
break;
case 121: /* joinop ::= COMMA|JOIN */
{ yymsp[0].minor.yy64 = JT_INNER; }
break;
case 122: /* joinop ::= JOIN_KW JOIN */
{yymsp[-1].minor.yy64 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
break;
case 123: /* joinop ::= JOIN_KW nm JOIN */
{yymsp[-2].minor.yy64 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
break;
case 124: /* joinop ::= JOIN_KW nm nm JOIN */
{yymsp[-3].minor.yy64 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
break;
case 125: /* on_opt ::= ON expr */
case 145: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==145);
case 152: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==152);
case 154: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==154);
case 225: /* case_else ::= ELSE expr */ yytestcase(yyruleno==225);
case 246: /* vinto ::= INTO expr */ yytestcase(yyruleno==246);
{yymsp[-1].minor.yy626 = yymsp[0].minor.yy626;}
break;
case 126: /* on_opt ::= */
case 144: /* having_opt ::= */ yytestcase(yyruleno==144);
case 146: /* limit_opt ::= */ yytestcase(yyruleno==146);
case 151: /* where_opt ::= */ yytestcase(yyruleno==151);
case 153: /* where_opt_ret ::= */ yytestcase(yyruleno==153);
case 226: /* case_else ::= */ yytestcase(yyruleno==226);
case 228: /* case_operand ::= */ yytestcase(yyruleno==228);
case 247: /* vinto ::= */ yytestcase(yyruleno==247);
{yymsp[1].minor.yy626 = 0;}
break;
case 128: /* indexed_opt ::= INDEXED BY nm */
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
break;
case 129: /* indexed_opt ::= NOT INDEXED */
{yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
break;
case 130: /* using_opt ::= USING LP idlist RP */
{yymsp[-3].minor.yy240 = yymsp[-1].minor.yy240;}
break;
case 131: /* using_opt ::= */
case 173: /* idlist_opt ::= */ yytestcase(yyruleno==173);
{yymsp[1].minor.yy240 = 0;}
break;
case 133: /* orderby_opt ::= ORDER BY sortlist */
case 143: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==143);
{yymsp[-2].minor.yy562 = yymsp[0].minor.yy562;}
break;
case 134: /* sortlist ::= sortlist COMMA expr sortorder nulls */
{
yymsp[-4].minor.yy562 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy562,yymsp[-2].minor.yy626);
sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy562,yymsp[-1].minor.yy64,yymsp[0].minor.yy64);
}
break;
case 135: /* sortlist ::= expr sortorder nulls */
{
yymsp[-2].minor.yy562 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy626); /*A-overwrites-Y*/
sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy562,yymsp[-1].minor.yy64,yymsp[0].minor.yy64);
}
break;
case 136: /* sortorder ::= ASC */
{yymsp[0].minor.yy64 = SQLITE_SO_ASC;}
break;
case 137: /* sortorder ::= DESC */
{yymsp[0].minor.yy64 = SQLITE_SO_DESC;}
break;
case 138: /* sortorder ::= */
case 141: /* nulls ::= */ yytestcase(yyruleno==141);
{yymsp[1].minor.yy64 = SQLITE_SO_UNDEFINED;}
break;
case 139: /* nulls ::= NULLS FIRST */
{yymsp[-1].minor.yy64 = SQLITE_SO_ASC;}
break;
case 140: /* nulls ::= NULLS LAST */
{yymsp[-1].minor.yy64 = SQLITE_SO_DESC;}
break;
case 147: /* limit_opt ::= LIMIT expr */
{yymsp[-1].minor.yy626 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy626,0);}
break;
case 148: /* limit_opt ::= LIMIT expr OFFSET expr */
{yymsp[-3].minor.yy626 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy626,yymsp[0].minor.yy626);}
break;
case 149: /* limit_opt ::= LIMIT expr COMMA expr */
{yymsp[-3].minor.yy626 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy626,yymsp[-2].minor.yy626);}
break;
case 150: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
{
sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy607, &yymsp[-1].minor.yy0);
sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy607,yymsp[0].minor.yy626,0,0);
}
break;
case 155: /* where_opt_ret ::= RETURNING selcollist */
{sqlite3AddReturning(pParse,yymsp[0].minor.yy562); yymsp[-1].minor.yy626 = 0;}
break;
case 156: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
{sqlite3AddReturning(pParse,yymsp[0].minor.yy562); yymsp[-3].minor.yy626 = yymsp[-2].minor.yy626;}
break;
case 157: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
{
sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy607, &yymsp[-4].minor.yy0);
sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy562,"set list");
yymsp[-5].minor.yy607 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy607, yymsp[-1].minor.yy607);
sqlite3Update(pParse,yymsp[-5].minor.yy607,yymsp[-2].minor.yy562,yymsp[0].minor.yy626,yymsp[-6].minor.yy64,0,0,0);
}
break;
case 158: /* setlist ::= setlist COMMA nm EQ expr */
{
yymsp[-4].minor.yy562 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy562, yymsp[0].minor.yy626);
sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy562, &yymsp[-2].minor.yy0, 1);
}
break;
case 159: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
{
yymsp[-6].minor.yy562 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy562, yymsp[-3].minor.yy240, yymsp[0].minor.yy626);
}
break;
case 160: /* setlist ::= nm EQ expr */
{
yylhsminor.yy562 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy626);
sqlite3ExprListSetName(pParse, yylhsminor.yy562, &yymsp[-2].minor.yy0, 1);
}
yymsp[-2].minor.yy562 = yylhsminor.yy562;
break;
case 161: /* setlist ::= LP idlist RP EQ expr */
{
yymsp[-4].minor.yy562 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy240, yymsp[0].minor.yy626);
}
break;
case 162: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
{
sqlite3Insert(pParse, yymsp[-3].minor.yy607, yymsp[-1].minor.yy303, yymsp[-2].minor.yy240, yymsp[-5].minor.yy64, yymsp[0].minor.yy138);
}
break;
case 163: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
{
sqlite3Insert(pParse, yymsp[-4].minor.yy607, 0, yymsp[-3].minor.yy240, yymsp[-6].minor.yy64, 0);
}
break;
case 164: /* upsert ::= */
{ yymsp[1].minor.yy138 = 0; }
break;
case 165: /* upsert ::= RETURNING selcollist */
{ yymsp[-1].minor.yy138 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy562); }
break;
case 166: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
{ yymsp[-11].minor.yy138 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy562,yymsp[-6].minor.yy626,yymsp[-2].minor.yy562,yymsp[-1].minor.yy626,yymsp[0].minor.yy138);}
break;
case 167: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
{ yymsp[-8].minor.yy138 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy562,yymsp[-3].minor.yy626,0,0,yymsp[0].minor.yy138); }
break;
case 168: /* upsert ::= ON CONFLICT DO NOTHING returning */
{ yymsp[-4].minor.yy138 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
break;
case 169: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
{ yymsp[-7].minor.yy138 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy562,yymsp[-1].minor.yy626,0);}
break;
case 170: /* returning ::= RETURNING selcollist */
{sqlite3AddReturning(pParse,yymsp[0].minor.yy562);}
break;
case 174: /* idlist_opt ::= LP idlist RP */
{yymsp[-2].minor.yy240 = yymsp[-1].minor.yy240;}
break;
case 175: /* idlist ::= idlist COMMA nm */
{yymsp[-2].minor.yy240 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy240,&yymsp[0].minor.yy0);}
break;
case 176: /* idlist ::= nm */
{yymsp[0].minor.yy240 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
break;
case 177: /* expr ::= LP expr RP */
{yymsp[-2].minor.yy626 = yymsp[-1].minor.yy626;}
break;
case 178: /* expr ::= ID|INDEXED */
case 179: /* expr ::= JOIN_KW */ yytestcase(yyruleno==179);
{yymsp[0].minor.yy626=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
case 180: /* expr ::= nm DOT nm */
{
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
if( IN_RENAME_OBJECT ){
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
sqlite3RenameTokenMap(pParse, (void*)temp1, &yymsp[-2].minor.yy0);
}
yylhsminor.yy626 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
}
yymsp[-2].minor.yy626 = yylhsminor.yy626;
break;
case 181: /* expr ::= nm DOT nm DOT nm */
{
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
if( IN_RENAME_OBJECT ){
sqlite3RenameTokenMap(pParse, (void*)temp3, &yymsp[0].minor.yy0);
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[-2].minor.yy0);
}
yylhsminor.yy626 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
}
yymsp[-4].minor.yy626 = yylhsminor.yy626;
break;
case 182: /* term ::= NULL|FLOAT|BLOB */
case 183: /* term ::= STRING */ yytestcase(yyruleno==183);
{yymsp[0].minor.yy626=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
case 184: /* term ::= INTEGER */
{
yylhsminor.yy626 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
}
yymsp[0].minor.yy626 = yylhsminor.yy626;
break;
case 185: /* expr ::= VARIABLE */
{
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
u32 n = yymsp[0].minor.yy0.n;
yymsp[0].minor.yy626 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy626, n);
}else{
/* When doing a nested parse, one can include terms in an expression
** that look like this: #1 #2 ... These terms refer to registers
** in the virtual machine. #N is the N-th register. */
Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
assert( t.n>=2 );
if( pParse->nested==0 ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
yymsp[0].minor.yy626 = 0;
}else{
yymsp[0].minor.yy626 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
if( yymsp[0].minor.yy626 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy626->iTable);
}
}
}
break;
case 186: /* expr ::= expr COLLATE ID|STRING */
{
yymsp[-2].minor.yy626 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy626, &yymsp[0].minor.yy0, 1);
}
break;
case 187: /* expr ::= CAST LP expr AS typetoken RP */
{
yymsp[-5].minor.yy626 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy626, yymsp[-3].minor.yy626, 0);
}
break;
case 188: /* expr ::= ID|INDEXED LP distinct exprlist RP */
{
yylhsminor.yy626 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy562, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy64);
}
yymsp[-4].minor.yy626 = yylhsminor.yy626;
break;
case 189: /* expr ::= ID|INDEXED LP STAR RP */
{
yylhsminor.yy626 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
}
yymsp[-3].minor.yy626 = yylhsminor.yy626;
break;
case 190: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
{
yylhsminor.yy626 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy562, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy64);
sqlite3WindowAttach(pParse, yylhsminor.yy626, yymsp[0].minor.yy375);
}
yymsp[-5].minor.yy626 = yylhsminor.yy626;
break;
case 191: /* expr ::= ID|INDEXED LP STAR RP filter_over */
{
yylhsminor.yy626 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
sqlite3WindowAttach(pParse, yylhsminor.yy626, yymsp[0].minor.yy375);
}
yymsp[-4].minor.yy626 = yylhsminor.yy626;
break;
case 192: /* term ::= CTIME_KW */
{
yylhsminor.yy626 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
}
yymsp[0].minor.yy626 = yylhsminor.yy626;
break;
case 193: /* expr ::= LP nexprlist COMMA expr RP */
{
ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy562, yymsp[-1].minor.yy626);
yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
if( yymsp[-4].minor.yy626 ){
yymsp[-4].minor.yy626->x.pList = pList;
if( ALWAYS(pList->nExpr) ){
yymsp[-4].minor.yy626->flags |= pList->a[0].pExpr->flags & EP_Propagate;
}
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
}
break;
case 194: /* expr ::= expr AND expr */
{yymsp[-2].minor.yy626=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy626,yymsp[0].minor.yy626);}
break;
case 195: /* expr ::= expr OR expr */
case 196: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==196);
case 197: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==197);
case 198: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==198);
case 199: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==199);
case 200: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==200);
case 201: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==201);
{yymsp[-2].minor.yy626=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy626,yymsp[0].minor.yy626);}
break;
case 202: /* likeop ::= NOT LIKE_KW|MATCH */
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
break;
case 203: /* expr ::= expr likeop expr */
{
ExprList *pList;
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
yymsp[-1].minor.yy0.n &= 0x7fffffff;
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy626);
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy626);
yymsp[-2].minor.yy626 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
if( bNot ) yymsp[-2].minor.yy626 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy626, 0);
if( yymsp[-2].minor.yy626 ) yymsp[-2].minor.yy626->flags |= EP_InfixFunc;
}
break;
case 204: /* expr ::= expr likeop expr ESCAPE expr */
{
ExprList *pList;
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
yymsp[-3].minor.yy0.n &= 0x7fffffff;
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy626);
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy626);
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy626);
yymsp[-4].minor.yy626 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
if( bNot ) yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy626, 0);
if( yymsp[-4].minor.yy626 ) yymsp[-4].minor.yy626->flags |= EP_InfixFunc;
}
break;
case 205: /* expr ::= expr ISNULL|NOTNULL */
{yymsp[-1].minor.yy626 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy626,0);}
break;
case 206: /* expr ::= expr NOT NULL */
{yymsp[-2].minor.yy626 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy626,0);}
break;
case 207: /* expr ::= expr IS expr */
{
yymsp[-2].minor.yy626 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy626,yymsp[0].minor.yy626);
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy626, yymsp[-2].minor.yy626, TK_ISNULL);
}
break;
case 208: /* expr ::= expr IS NOT expr */
{
yymsp[-3].minor.yy626 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy626,yymsp[0].minor.yy626);
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy626, yymsp[-3].minor.yy626, TK_NOTNULL);
}
break;
case 209: /* expr ::= NOT expr */
case 210: /* expr ::= BITNOT expr */ yytestcase(yyruleno==210);
{yymsp[-1].minor.yy626 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy626, 0);/*A-overwrites-B*/}
break;
case 211: /* expr ::= PLUS|MINUS expr */
{
yymsp[-1].minor.yy626 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy626, 0);
/*A-overwrites-B*/
}
break;
case 212: /* between_op ::= BETWEEN */
case 215: /* in_op ::= IN */ yytestcase(yyruleno==215);
{yymsp[0].minor.yy64 = 0;}
break;
case 214: /* expr ::= expr between_op expr AND expr */
{
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy626);
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy626);
yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy626, 0);
if( yymsp[-4].minor.yy626 ){
yymsp[-4].minor.yy626->x.pList = pList;
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
if( yymsp[-3].minor.yy64 ) yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy626, 0);
}
break;
case 217: /* expr ::= expr in_op LP exprlist RP */
{
if( yymsp[-1].minor.yy562==0 ){
/* Expressions of the form
**
** expr1 IN ()
** expr1 NOT IN ()
**
** simplify to constants 0 (false) and 1 (true), respectively,
** regardless of the value of expr1.
*/
sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy626);
yymsp[-4].minor.yy626 = sqlite3Expr(pParse->db, TK_INTEGER, yymsp[-3].minor.yy64 ? "1" : "0");
}else{
Expr *pRHS = yymsp[-1].minor.yy562->a[0].pExpr;
if( yymsp[-1].minor.yy562->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy626->op!=TK_VECTOR ){
yymsp[-1].minor.yy562->a[0].pExpr = 0;
sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy562);
pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy626, pRHS);
}else{
yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy626, 0);
if( yymsp[-4].minor.yy626==0 ){
sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy562);
}else if( yymsp[-4].minor.yy626->pLeft->op==TK_VECTOR ){
int nExpr = yymsp[-4].minor.yy626->pLeft->x.pList->nExpr;
Select *pSelectRHS = sqlite3ExprListToValues(pParse, nExpr, yymsp[-1].minor.yy562);
if( pSelectRHS ){
parserDoubleLinkSelect(pParse, pSelectRHS);
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy626, pSelectRHS);
}
}else{
yymsp[-4].minor.yy626->x.pList = yymsp[-1].minor.yy562;
sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy626);
}
}
if( yymsp[-3].minor.yy64 ) yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy626, 0);
}
}
break;
case 218: /* expr ::= LP select RP */
{
yymsp[-2].minor.yy626 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy626, yymsp[-1].minor.yy303);
}
break;
case 219: /* expr ::= expr in_op LP select RP */
{
yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy626, 0);
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy626, yymsp[-1].minor.yy303);
if( yymsp[-3].minor.yy64 ) yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy626, 0);
}
break;
case 220: /* expr ::= expr in_op nm dbnm paren_exprlist */
{
SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
if( yymsp[0].minor.yy562 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy562);
yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy626, 0);
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy626, pSelect);
if( yymsp[-3].minor.yy64 ) yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy626, 0);
}
break;
case 221: /* expr ::= EXISTS LP select RP */
{
Expr *p;
p = yymsp[-3].minor.yy626 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy303);
}
break;
case 222: /* expr ::= CASE case_operand case_exprlist case_else END */
{
yymsp[-4].minor.yy626 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy626, 0);
if( yymsp[-4].minor.yy626 ){
yymsp[-4].minor.yy626->x.pList = yymsp[-1].minor.yy626 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy562,yymsp[-1].minor.yy626) : yymsp[-2].minor.yy562;
sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy626);
}else{
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy562);
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy626);
}
}
break;
case 223: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
{
yymsp[-4].minor.yy562 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy562, yymsp[-2].minor.yy626);
yymsp[-4].minor.yy562 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy562, yymsp[0].minor.yy626);
}
break;
case 224: /* case_exprlist ::= WHEN expr THEN expr */
{
yymsp[-3].minor.yy562 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy626);
yymsp[-3].minor.yy562 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy562, yymsp[0].minor.yy626);
}
break;
case 227: /* case_operand ::= expr */
{yymsp[0].minor.yy626 = yymsp[0].minor.yy626; /*A-overwrites-X*/}
break;
case 230: /* nexprlist ::= nexprlist COMMA expr */
{yymsp[-2].minor.yy562 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy562,yymsp[0].minor.yy626);}
break;
case 231: /* nexprlist ::= expr */
{yymsp[0].minor.yy562 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy626); /*A-overwrites-Y*/}
break;
case 233: /* paren_exprlist ::= LP exprlist RP */
case 238: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==238);
{yymsp[-2].minor.yy562 = yymsp[-1].minor.yy562;}
break;
case 234: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
{
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy562, yymsp[-10].minor.yy64,
&yymsp[-11].minor.yy0, yymsp[0].minor.yy626, SQLITE_SO_ASC, yymsp[-8].minor.yy64, SQLITE_IDXTYPE_APPDEF);
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
}
}
break;
case 235: /* uniqueflag ::= UNIQUE */
case 277: /* raisetype ::= ABORT */ yytestcase(yyruleno==277);
{yymsp[0].minor.yy64 = OE_Abort;}
break;
case 236: /* uniqueflag ::= */
{yymsp[1].minor.yy64 = OE_None;}
break;
case 239: /* eidlist ::= eidlist COMMA nm collate sortorder */
{
yymsp[-4].minor.yy562 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy562, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy64, yymsp[0].minor.yy64);
}
break;
case 240: /* eidlist ::= nm collate sortorder */
{
yymsp[-2].minor.yy562 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy64, yymsp[0].minor.yy64); /*A-overwrites-Y*/
}
break;
case 243: /* cmd ::= DROP INDEX ifexists fullname */
{sqlite3DropIndex(pParse, yymsp[0].minor.yy607, yymsp[-1].minor.yy64);}
break;
case 244: /* cmd ::= VACUUM vinto */
{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy626);}
break;
case 245: /* cmd ::= VACUUM nm vinto */
{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy626);}
break;
case 248: /* cmd ::= PRAGMA nm dbnm */
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
break;
case 249: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
break;
case 250: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
break;
case 251: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
break;
case 252: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
break;
case 255: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
{
Token all;
all.z = yymsp[-3].minor.yy0.z;
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy95, &all);
}
break;
case 256: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
{
sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy64, yymsp[-4].minor.yy570.a, yymsp[-4].minor.yy570.b, yymsp[-2].minor.yy607, yymsp[0].minor.yy626, yymsp[-10].minor.yy64, yymsp[-8].minor.yy64);
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
}
break;
case 257: /* trigger_time ::= BEFORE|AFTER */
{ yymsp[0].minor.yy64 = yymsp[0].major; /*A-overwrites-X*/ }
break;
case 258: /* trigger_time ::= INSTEAD OF */
{ yymsp[-1].minor.yy64 = TK_INSTEAD;}
break;
case 259: /* trigger_time ::= */
{ yymsp[1].minor.yy64 = TK_BEFORE; }
break;
case 260: /* trigger_event ::= DELETE|INSERT */
case 261: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==261);
{yymsp[0].minor.yy570.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy570.b = 0;}
break;
case 262: /* trigger_event ::= UPDATE OF idlist */
{yymsp[-2].minor.yy570.a = TK_UPDATE; yymsp[-2].minor.yy570.b = yymsp[0].minor.yy240;}
break;
case 263: /* when_clause ::= */
case 282: /* key_opt ::= */ yytestcase(yyruleno==282);
{ yymsp[1].minor.yy626 = 0; }
break;
case 264: /* when_clause ::= WHEN expr */
case 283: /* key_opt ::= KEY expr */ yytestcase(yyruleno==283);
{ yymsp[-1].minor.yy626 = yymsp[0].minor.yy626; }
break;
case 265: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
{
assert( yymsp[-2].minor.yy95!=0 );
yymsp[-2].minor.yy95->pLast->pNext = yymsp[-1].minor.yy95;
yymsp[-2].minor.yy95->pLast = yymsp[-1].minor.yy95;
}
break;
case 266: /* trigger_cmd_list ::= trigger_cmd SEMI */
{
assert( yymsp[-1].minor.yy95!=0 );
yymsp[-1].minor.yy95->pLast = yymsp[-1].minor.yy95;
}
break;
case 267: /* trnm ::= nm DOT nm */
{
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
sqlite3ErrorMsg(pParse,
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
"statements within triggers");
}
break;
case 268: /* tridxby ::= INDEXED BY nm */
{
sqlite3ErrorMsg(pParse,
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
"within triggers");
}
break;
case 269: /* tridxby ::= NOT INDEXED */
{
sqlite3ErrorMsg(pParse,
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
"within triggers");
}
break;
case 270: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
{yylhsminor.yy95 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy607, yymsp[-3].minor.yy562, yymsp[-1].minor.yy626, yymsp[-7].minor.yy64, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy600);}
yymsp[-8].minor.yy95 = yylhsminor.yy95;
break;
case 271: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
{
yylhsminor.yy95 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy240,yymsp[-2].minor.yy303,yymsp[-6].minor.yy64,yymsp[-1].minor.yy138,yymsp[-7].minor.yy600,yymsp[0].minor.yy600);/*yylhsminor.yy95-overwrites-yymsp[-6].minor.yy64*/
}
yymsp[-7].minor.yy95 = yylhsminor.yy95;
break;
case 272: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
{yylhsminor.yy95 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy626, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy600);}
yymsp[-5].minor.yy95 = yylhsminor.yy95;
break;
case 273: /* trigger_cmd ::= scanpt select scanpt */
{yylhsminor.yy95 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy303, yymsp[-2].minor.yy600, yymsp[0].minor.yy600); /*yylhsminor.yy95-overwrites-yymsp[-1].minor.yy303*/}
yymsp[-2].minor.yy95 = yylhsminor.yy95;
break;
case 274: /* expr ::= RAISE LP IGNORE RP */
{
yymsp[-3].minor.yy626 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
if( yymsp[-3].minor.yy626 ){
yymsp[-3].minor.yy626->affExpr = OE_Ignore;
}
}
break;
case 275: /* expr ::= RAISE LP raisetype COMMA nm RP */
{
yymsp[-5].minor.yy626 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
if( yymsp[-5].minor.yy626 ) {
yymsp[-5].minor.yy626->affExpr = (char)yymsp[-3].minor.yy64;
}
}
break;
case 276: /* raisetype ::= ROLLBACK */
{yymsp[0].minor.yy64 = OE_Rollback;}
break;
case 278: /* raisetype ::= FAIL */
{yymsp[0].minor.yy64 = OE_Fail;}
break;
case 279: /* cmd ::= DROP TRIGGER ifexists fullname */
{
sqlite3DropTrigger(pParse,yymsp[0].minor.yy607,yymsp[-1].minor.yy64);
}
break;
case 280: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
{
sqlite3Attach(pParse, yymsp[-3].minor.yy626, yymsp[-1].minor.yy626, yymsp[0].minor.yy626);
}
break;
case 281: /* cmd ::= DETACH database_kw_opt expr */
{
sqlite3Detach(pParse, yymsp[0].minor.yy626);
}
break;
case 284: /* cmd ::= REINDEX */
{sqlite3Reindex(pParse, 0, 0);}
break;
case 285: /* cmd ::= REINDEX nm dbnm */
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
break;
case 286: /* cmd ::= ANALYZE */
{sqlite3Analyze(pParse, 0, 0);}
break;
case 287: /* cmd ::= ANALYZE nm dbnm */
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
break;
case 288: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
{
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy607,&yymsp[0].minor.yy0);
}
break;
case 289: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
{
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
}
break;
case 290: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
{
sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy607, &yymsp[0].minor.yy0);
}
break;
case 291: /* add_column_fullname ::= fullname */
{
disableLookaside(pParse);
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy607);
}
break;
case 292: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
{
sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy607, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
break;
case 293: /* cmd ::= create_vtab */
{sqlite3VtabFinishParse(pParse,0);}
break;
case 294: /* cmd ::= create_vtab LP vtabarglist RP */
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
break;
case 295: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
{
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy64);
}
break;
case 296: /* vtabarg ::= */
{sqlite3VtabArgInit(pParse);}
break;
case 297: /* vtabargtoken ::= ANY */
case 298: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==298);
case 299: /* lp ::= LP */ yytestcase(yyruleno==299);
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
break;
case 300: /* with ::= WITH wqlist */
case 301: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==301);
{ sqlite3WithPush(pParse, yymsp[0].minor.yy43, 1); }
break;
case 302: /* wqas ::= AS */
{yymsp[0].minor.yy534 = M10d_Any;}
break;
case 303: /* wqas ::= AS MATERIALIZED */
{yymsp[-1].minor.yy534 = M10d_Yes;}
break;
case 304: /* wqas ::= AS NOT MATERIALIZED */
{yymsp[-2].minor.yy534 = M10d_No;}
break;
case 305: /* wqitem ::= nm eidlist_opt wqas LP select RP */
{
yymsp[-5].minor.yy255 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy562, yymsp[-1].minor.yy303, yymsp[-3].minor.yy534); /*A-overwrites-X*/
}
break;
case 306: /* wqlist ::= wqitem */
{
yymsp[0].minor.yy43 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy255); /*A-overwrites-X*/
}
break;
case 307: /* wqlist ::= wqlist COMMA wqitem */
{
yymsp[-2].minor.yy43 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy43, yymsp[0].minor.yy255);
}
break;
case 308: /* windowdefn_list ::= windowdefn */
{ yylhsminor.yy375 = yymsp[0].minor.yy375; }
yymsp[0].minor.yy375 = yylhsminor.yy375;
break;
case 309: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
{
assert( yymsp[0].minor.yy375!=0 );
sqlite3WindowChain(pParse, yymsp[0].minor.yy375, yymsp[-2].minor.yy375);
yymsp[0].minor.yy375->pNextWin = yymsp[-2].minor.yy375;
yylhsminor.yy375 = yymsp[0].minor.yy375;
}
yymsp[-2].minor.yy375 = yylhsminor.yy375;
break;
case 310: /* windowdefn ::= nm AS LP window RP */
{
if( ALWAYS(yymsp[-1].minor.yy375) ){
yymsp[-1].minor.yy375->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
}
yylhsminor.yy375 = yymsp[-1].minor.yy375;
}
yymsp[-4].minor.yy375 = yylhsminor.yy375;
break;
case 311: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
{
yymsp[-4].minor.yy375 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy375, yymsp[-2].minor.yy562, yymsp[-1].minor.yy562, 0);
}
break;
case 312: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
{
yylhsminor.yy375 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy375, yymsp[-2].minor.yy562, yymsp[-1].minor.yy562, &yymsp[-5].minor.yy0);
}
yymsp[-5].minor.yy375 = yylhsminor.yy375;
break;
case 313: /* window ::= ORDER BY sortlist frame_opt */
{
yymsp[-3].minor.yy375 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy375, 0, yymsp[-1].minor.yy562, 0);
}
break;
case 314: /* window ::= nm ORDER BY sortlist frame_opt */
{
yylhsminor.yy375 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy375, 0, yymsp[-1].minor.yy562, &yymsp[-4].minor.yy0);
}
yymsp[-4].minor.yy375 = yylhsminor.yy375;
break;
case 315: /* window ::= frame_opt */
case 334: /* filter_over ::= over_clause */ yytestcase(yyruleno==334);
{
yylhsminor.yy375 = yymsp[0].minor.yy375;
}
yymsp[0].minor.yy375 = yylhsminor.yy375;
break;
case 316: /* window ::= nm frame_opt */
{
yylhsminor.yy375 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy375, 0, 0, &yymsp[-1].minor.yy0);
}
yymsp[-1].minor.yy375 = yylhsminor.yy375;
break;
case 317: /* frame_opt ::= */
{
yymsp[1].minor.yy375 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
}
break;
case 318: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
{
yylhsminor.yy375 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy64, yymsp[-1].minor.yy81.eType, yymsp[-1].minor.yy81.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy534);
}
yymsp[-2].minor.yy375 = yylhsminor.yy375;
break;
case 319: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
{
yylhsminor.yy375 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy64, yymsp[-3].minor.yy81.eType, yymsp[-3].minor.yy81.pExpr, yymsp[-1].minor.yy81.eType, yymsp[-1].minor.yy81.pExpr, yymsp[0].minor.yy534);
}
yymsp[-5].minor.yy375 = yylhsminor.yy375;
break;
case 321: /* frame_bound_s ::= frame_bound */
case 323: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==323);
{yylhsminor.yy81 = yymsp[0].minor.yy81;}
yymsp[0].minor.yy81 = yylhsminor.yy81;
break;
case 322: /* frame_bound_s ::= UNBOUNDED PRECEDING */
case 324: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==324);
case 326: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==326);
{yylhsminor.yy81.eType = yymsp[-1].major; yylhsminor.yy81.pExpr = 0;}
yymsp[-1].minor.yy81 = yylhsminor.yy81;
break;
case 325: /* frame_bound ::= expr PRECEDING|FOLLOWING */
{yylhsminor.yy81.eType = yymsp[0].major; yylhsminor.yy81.pExpr = yymsp[-1].minor.yy626;}
yymsp[-1].minor.yy81 = yylhsminor.yy81;
break;
case 327: /* frame_exclude_opt ::= */
{yymsp[1].minor.yy534 = 0;}
break;
case 328: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
{yymsp[-1].minor.yy534 = yymsp[0].minor.yy534;}
break;
case 329: /* frame_exclude ::= NO OTHERS */
case 330: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==330);
{yymsp[-1].minor.yy534 = yymsp[-1].major; /*A-overwrites-X*/}
break;
case 331: /* frame_exclude ::= GROUP|TIES */
{yymsp[0].minor.yy534 = yymsp[0].major; /*A-overwrites-X*/}
break;
case 332: /* window_clause ::= WINDOW windowdefn_list */
{ yymsp[-1].minor.yy375 = yymsp[0].minor.yy375; }
break;
case 333: /* filter_over ::= filter_clause over_clause */
{
if( yymsp[0].minor.yy375 ){
yymsp[0].minor.yy375->pFilter = yymsp[-1].minor.yy626;
}else{
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy626);
}
yylhsminor.yy375 = yymsp[0].minor.yy375;
}
yymsp[-1].minor.yy375 = yylhsminor.yy375;
break;
case 335: /* filter_over ::= filter_clause */
{
yylhsminor.yy375 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
if( yylhsminor.yy375 ){
yylhsminor.yy375->eFrmType = TK_FILTER;
yylhsminor.yy375->pFilter = yymsp[0].minor.yy626;
}else{
sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy626);
}
}
yymsp[0].minor.yy375 = yylhsminor.yy375;
break;
case 336: /* over_clause ::= OVER LP window RP */
{
yymsp[-3].minor.yy375 = yymsp[-1].minor.yy375;
assert( yymsp[-3].minor.yy375!=0 );
}
break;
case 337: /* over_clause ::= OVER nm */
{
yymsp[-1].minor.yy375 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
if( yymsp[-1].minor.yy375 ){
yymsp[-1].minor.yy375->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
}
}
break;
case 338: /* filter_clause ::= FILTER LP WHERE expr RP */
{ yymsp[-4].minor.yy626 = yymsp[-1].minor.yy626; }
break;
default:
/* (339) input ::= cmdlist */ yytestcase(yyruleno==339);
/* (340) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==340);
/* (341) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=341);
/* (342) ecmd ::= SEMI */ yytestcase(yyruleno==342);
/* (343) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==343);
/* (344) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=344);
/* (345) trans_opt ::= */ yytestcase(yyruleno==345);
/* (346) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==346);
/* (347) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==347);
/* (348) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==348);
/* (349) savepoint_opt ::= */ yytestcase(yyruleno==349);
/* (350) cmd ::= create_table create_table_args */ yytestcase(yyruleno==350);
/* (351) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=351);
/* (352) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==352);
/* (353) columnlist ::= columnname carglist */ yytestcase(yyruleno==353);
/* (354) nm ::= ID|INDEXED */ yytestcase(yyruleno==354);
/* (355) nm ::= STRING */ yytestcase(yyruleno==355);
/* (356) nm ::= JOIN_KW */ yytestcase(yyruleno==356);
/* (357) typetoken ::= typename */ yytestcase(yyruleno==357);
/* (358) typename ::= ID|STRING */ yytestcase(yyruleno==358);
/* (359) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=359);
/* (360) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=360);
/* (361) carglist ::= carglist ccons */ yytestcase(yyruleno==361);
/* (362) carglist ::= */ yytestcase(yyruleno==362);
/* (363) ccons ::= NULL onconf */ yytestcase(yyruleno==363);
/* (364) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==364);
/* (365) ccons ::= AS generated */ yytestcase(yyruleno==365);
/* (366) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==366);
/* (367) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==367);
/* (368) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=368);
/* (369) tconscomma ::= */ yytestcase(yyruleno==369);
/* (370) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=370);
/* (371) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=371);
/* (372) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=372);
/* (373) oneselect ::= values */ yytestcase(yyruleno==373);
/* (374) sclp ::= selcollist COMMA */ yytestcase(yyruleno==374);
/* (375) as ::= ID|STRING */ yytestcase(yyruleno==375);
/* (376) returning ::= */ yytestcase(yyruleno==376);
/* (377) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=377);
/* (378) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==378);
/* (379) exprlist ::= nexprlist */ yytestcase(yyruleno==379);
/* (380) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=380);
/* (381) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=381);
/* (382) nmnum ::= ON */ yytestcase(yyruleno==382);
/* (383) nmnum ::= DELETE */ yytestcase(yyruleno==383);
/* (384) nmnum ::= DEFAULT */ yytestcase(yyruleno==384);
/* (385) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==385);
/* (386) foreach_clause ::= */ yytestcase(yyruleno==386);
/* (387) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==387);
/* (388) trnm ::= nm */ yytestcase(yyruleno==388);
/* (389) tridxby ::= */ yytestcase(yyruleno==389);
/* (390) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==390);
/* (391) database_kw_opt ::= */ yytestcase(yyruleno==391);
/* (392) kwcolumn_opt ::= */ yytestcase(yyruleno==392);
/* (393) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==393);
/* (394) vtabarglist ::= vtabarg */ yytestcase(yyruleno==394);
/* (395) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==395);
/* (396) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==396);
/* (397) anylist ::= */ yytestcase(yyruleno==397);
/* (398) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==398);
/* (399) anylist ::= anylist ANY */ yytestcase(yyruleno==399);
/* (400) with ::= */ yytestcase(yyruleno==400);
break;
/********** End reduce actions ************************************************/
};
assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
yygoto = yyRuleInfoLhs[yyruleno];
yysize = yyRuleInfoNRhs[yyruleno];
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
|
| ︙ | ︙ | |||
163477 163478 163479 163480 163481 163482 163483 |
fprintf(yyTraceFILE,"%sDiscard input token %s\n",
yyTracePrompt,yyTokenName[yymajor]);
}
#endif
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yymajor = YYNOCODE;
}else{
| | | < | < > | | 163798 163799 163800 163801 163802 163803 163804 163805 163806 163807 163808 163809 163810 163811 163812 163813 163814 163815 163816 163817 163818 |
fprintf(yyTraceFILE,"%sDiscard input token %s\n",
yyTracePrompt,yyTokenName[yymajor]);
}
#endif
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yymajor = YYNOCODE;
}else{
while( yypParser->yytos > yypParser->yystack ){
yyact = yy_find_reduce_action(yypParser->yytos->stateno,
YYERRORSYMBOL);
if( yyact<=YY_MAX_SHIFTREDUCE ) break;
yy_pop_parser_stack(yypParser);
}
if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
yymajor = YYNOCODE;
}else if( yymx!=YYERRORSYMBOL ){
|
| ︙ | ︙ | |||
166551 166552 166553 166554 166555 166556 166557 |
/* Closing the handle. Fourth parameter is passed the value 2. */
sqlite3GlobalConfig.xSqllog(sqlite3GlobalConfig.pSqllogArg, db, 0, 2);
}
#endif
/* Convert the connection into a zombie and then close it.
*/
| | | 166871 166872 166873 166874 166875 166876 166877 166878 166879 166880 166881 166882 166883 166884 166885 |
/* Closing the handle. Fourth parameter is passed the value 2. */
sqlite3GlobalConfig.xSqllog(sqlite3GlobalConfig.pSqllogArg, db, 0, 2);
}
#endif
/* Convert the connection into a zombie and then close it.
*/
db->eOpenState = SQLITE_STATE_ZOMBIE;
sqlite3LeaveMutexAndCloseZombie(db);
return SQLITE_OK;
}
/*
** Return the transaction state for a single databse, or the maximum
** transaction state over all attached databases if zSchema is null.
|
| ︙ | ︙ | |||
166615 166616 166617 166618 166619 166620 166621 | HashElem *i; /* Hash table iterator */ int j; /* If there are outstanding sqlite3_stmt or sqlite3_backup objects ** or if the connection has not yet been closed by sqlite3_close_v2(), ** then just leave the mutex and return. */ | | | 166935 166936 166937 166938 166939 166940 166941 166942 166943 166944 166945 166946 166947 166948 166949 |
HashElem *i; /* Hash table iterator */
int j;
/* If there are outstanding sqlite3_stmt or sqlite3_backup objects
** or if the connection has not yet been closed by sqlite3_close_v2(),
** then just leave the mutex and return.
*/
if( db->eOpenState!=SQLITE_STATE_ZOMBIE || connectionIsBusy(db) ){
sqlite3_mutex_leave(db->mutex);
return;
}
/* If we reach this point, it means that the database connection has
** closed all sqlite3_stmt and sqlite3_backup objects and has been
** passed to sqlite3_close (meaning that it is a zombie). Therefore,
|
| ︙ | ︙ | |||
166701 166702 166703 166704 166705 166706 166707 | sqlite3ValueFree(db->pErr); sqlite3CloseExtensions(db); #if SQLITE_USER_AUTHENTICATION sqlite3_free(db->auth.zAuthUser); sqlite3_free(db->auth.zAuthPW); #endif | | | | 167021 167022 167023 167024 167025 167026 167027 167028 167029 167030 167031 167032 167033 167034 167035 167036 167037 167038 167039 167040 167041 167042 167043 167044 167045 |
sqlite3ValueFree(db->pErr);
sqlite3CloseExtensions(db);
#if SQLITE_USER_AUTHENTICATION
sqlite3_free(db->auth.zAuthUser);
sqlite3_free(db->auth.zAuthPW);
#endif
db->eOpenState = SQLITE_STATE_ERROR;
/* The temp-database schema is allocated differently from the other schema
** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()).
** So it needs to be freed here. Todo: Why not roll the temp schema into
** the same sqliteMalloc() as the one that allocates the database
** structure?
*/
sqlite3DbFree(db, db->aDb[1].pSchema);
sqlite3_mutex_leave(db->mutex);
db->eOpenState = SQLITE_STATE_CLOSED;
sqlite3_mutex_free(db->mutex);
assert( sqlite3LookasideUsed(db,0)==0 );
if( db->lookaside.bMalloced ){
sqlite3_free(db->lookaside.pStart);
}
sqlite3_free(db);
}
|
| ︙ | ︙ | |||
167099 167100 167101 167102 167103 167104 167105 |
}
/*
** Cause any pending operation to stop at its earliest opportunity.
*/
SQLITE_API void sqlite3_interrupt(sqlite3 *db){
#ifdef SQLITE_ENABLE_API_ARMOR
| | | 167419 167420 167421 167422 167423 167424 167425 167426 167427 167428 167429 167430 167431 167432 167433 |
}
/*
** Cause any pending operation to stop at its earliest opportunity.
*/
SQLITE_API void sqlite3_interrupt(sqlite3 *db){
#ifdef SQLITE_ENABLE_API_ARMOR
if( !sqlite3SafetyCheckOk(db) && (db==0 || db->eOpenState!=SQLITE_STATE_ZOMBIE) ){
(void)SQLITE_MISUSE_BKPT;
return;
}
#endif
AtomicStore(&db->u1.isInterrupted, 1);
}
|
| ︙ | ︙ | |||
168502 168503 168504 168505 168506 168507 168508 |
if( isThreadsafe==0 ){
sqlite3MutexWarnOnContention(db->mutex);
}
}
sqlite3_mutex_enter(db->mutex);
db->errMask = 0xff;
db->nDb = 2;
| | > > > > > > > | 168822 168823 168824 168825 168826 168827 168828 168829 168830 168831 168832 168833 168834 168835 168836 168837 168838 168839 168840 168841 168842 168843 168844 168845 168846 168847 168848 168849 168850 168851 168852 168853 168854 168855 |
if( isThreadsafe==0 ){
sqlite3MutexWarnOnContention(db->mutex);
}
}
sqlite3_mutex_enter(db->mutex);
db->errMask = 0xff;
db->nDb = 2;
db->eOpenState = SQLITE_STATE_BUSY;
db->aDb = db->aDbStatic;
db->lookaside.bDisable = 1;
db->lookaside.sz = 0;
assert( sizeof(db->aLimit)==sizeof(aHardLimit) );
memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));
db->aLimit[SQLITE_LIMIT_WORKER_THREADS] = SQLITE_DEFAULT_WORKER_THREADS;
db->autoCommit = 1;
db->nextAutovac = -1;
db->szMmap = sqlite3GlobalConfig.szMmap;
db->nextPagesize = 0;
#ifdef SQLITE_ENABLE_SORTER_MMAP
/* Beginning with version 3.37.0, using the VFS xFetch() API to memory-map
** the temporary files used to do external sorts (see code in vdbesort.c)
** is disabled. It can still be used either by defining
** SQLITE_ENABLE_SORTER_MMAP at compile time or by using the
** SQLITE_TESTCTRL_SORTER_MMAP test-control at runtime. */
db->nMaxSorterMmap = 0x7FFFFFFF;
#endif
db->flags |= SQLITE_ShortColNames
| SQLITE_EnableTrigger
| SQLITE_EnableView
| SQLITE_CacheSpill
#if !defined(SQLITE_TRUSTED_SCHEMA) || SQLITE_TRUSTED_SCHEMA+0!=0
| SQLITE_TrustedSchema
#endif
|
| ︙ | ︙ | |||
168662 168663 168664 168665 168666 168667 168668 | ** database it is OFF. This matches the pager layer defaults. */ db->aDb[0].zDbSName = "main"; db->aDb[0].safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1; db->aDb[1].zDbSName = "temp"; db->aDb[1].safety_level = PAGER_SYNCHRONOUS_OFF; | | | 168989 168990 168991 168992 168993 168994 168995 168996 168997 168998 168999 169000 169001 169002 169003 |
** database it is OFF. This matches the pager layer defaults.
*/
db->aDb[0].zDbSName = "main";
db->aDb[0].safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1;
db->aDb[1].zDbSName = "temp";
db->aDb[1].safety_level = PAGER_SYNCHRONOUS_OFF;
db->eOpenState = SQLITE_STATE_OPEN;
if( db->mallocFailed ){
goto opendb_out;
}
/* Register all built-in functions, but do not attempt to read the
** database schema yet. This is delayed until the first time the database
** is accessed.
|
| ︙ | ︙ | |||
168729 168730 168731 168732 168733 168734 168735 |
}
rc = sqlite3_errcode(db);
assert( db!=0 || rc==SQLITE_NOMEM );
if( rc==SQLITE_NOMEM ){
sqlite3_close(db);
db = 0;
}else if( rc!=SQLITE_OK ){
| | | 169056 169057 169058 169059 169060 169061 169062 169063 169064 169065 169066 169067 169068 169069 169070 |
}
rc = sqlite3_errcode(db);
assert( db!=0 || rc==SQLITE_NOMEM );
if( rc==SQLITE_NOMEM ){
sqlite3_close(db);
db = 0;
}else if( rc!=SQLITE_OK ){
db->eOpenState = SQLITE_STATE_SICK;
}
*ppDb = db;
#ifdef SQLITE_ENABLE_SQLLOG
if( sqlite3GlobalConfig.xSqllog ){
/* Opening a db handle. Fourth parameter is passed 0. */
void *pArg = sqlite3GlobalConfig.pSqllogArg;
sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0);
|
| ︙ | ︙ | |||
215508 215509 215510 215511 215512 215513 215514 |
fprintf(fts5yyTraceFILE,"%sDiscard input token %s\n",
fts5yyTracePrompt,fts5yyTokenName[fts5yymajor]);
}
#endif
fts5yy_destructor(fts5yypParser, (fts5YYCODETYPE)fts5yymajor, &fts5yyminorunion);
fts5yymajor = fts5YYNOCODE;
}else{
| | | < | < > | | 215835 215836 215837 215838 215839 215840 215841 215842 215843 215844 215845 215846 215847 215848 215849 215850 215851 215852 215853 215854 215855 |
fprintf(fts5yyTraceFILE,"%sDiscard input token %s\n",
fts5yyTracePrompt,fts5yyTokenName[fts5yymajor]);
}
#endif
fts5yy_destructor(fts5yypParser, (fts5YYCODETYPE)fts5yymajor, &fts5yyminorunion);
fts5yymajor = fts5YYNOCODE;
}else{
while( fts5yypParser->fts5yytos > fts5yypParser->fts5yystack ){
fts5yyact = fts5yy_find_reduce_action(fts5yypParser->fts5yytos->stateno,
fts5YYERRORSYMBOL);
if( fts5yyact<=fts5YY_MAX_SHIFTREDUCE ) break;
fts5yy_pop_parser_stack(fts5yypParser);
}
if( fts5yypParser->fts5yytos <= fts5yypParser->fts5yystack || fts5yymajor==0 ){
fts5yy_destructor(fts5yypParser,(fts5YYCODETYPE)fts5yymajor,&fts5yyminorunion);
fts5yy_parse_failed(fts5yypParser);
#ifndef fts5YYNOERRORRECOVERY
fts5yypParser->fts5yyerrcnt = -1;
#endif
fts5yymajor = fts5YYNOCODE;
}else if( fts5yymx!=fts5YYERRORSYMBOL ){
|
| ︙ | ︙ | |||
230847 230848 230849 230850 230851 230852 230853 |
static void fts5SourceIdFunc(
sqlite3_context *pCtx, /* Function call context */
int nArg, /* Number of args */
sqlite3_value **apUnused /* Function arguments */
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
| | | 231173 231174 231175 231176 231177 231178 231179 231180 231181 231182 231183 231184 231185 231186 231187 |
static void fts5SourceIdFunc(
sqlite3_context *pCtx, /* Function call context */
int nArg, /* Number of args */
sqlite3_value **apUnused /* Function arguments */
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2021-09-06 11:44:19 b3cfe23bec0b95ca673802526704200e2396df715fdded72aa71addd7f47e0e1", -1, SQLITE_TRANSIENT);
}
/*
** Return true if zName is the extension on one of the shadow tables used
** by this module.
*/
static int fts5ShadowName(const char *zName){
|
| ︙ | ︙ |
Changes to src/sqlite3.h.
| ︙ | ︙ | |||
144 145 146 147 148 149 150 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.37.0" #define SQLITE_VERSION_NUMBER 3037000 | | | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.37.0" #define SQLITE_VERSION_NUMBER 3037000 #define SQLITE_SOURCE_ID "2021-09-06 11:44:19 b3cfe23bec0b95ca673802526704200e2396df715fdded72aa71addd7f47e0e1" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros |
| ︙ | ︙ | |||
557 558 559 560 561 562 563 564 565 566 567 568 569 570 | #define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) #define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) #define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8)) #define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) #define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) #define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) | > | 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 | #define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) #define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) #define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8)) #define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) #define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) #define SQLITE_CONSTRAINT_DATATYPE (SQLITE_CONSTRAINT |(12<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) #define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) |
| ︙ | ︙ |