Fossil

Check-in [b58b3051]
Login

Check-in [b58b3051]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update the built-in SQLite to a version from the exists-to-join branch in the SQLite source tree, in order to beta-test the exists-to-join optimization. Fossil uses EXISTS operators in the WHERE clause of queries in many places and is therefore a good test case.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b58b30512e88213cfc43a3ac252f41b46cb7b6ce8ffe7b522e991d28df8706be
User & Date: drh 2024-06-11 18:44:53
Context
2024-06-14
00:06
Temporary fix for a bad query plan caused by issues in SQLite. See forum post 6900455c28dcd3da. ... (check-in: 9866c97b user: drh tags: trunk)
2024-06-11
18:44
Update the built-in SQLite to a version from the exists-to-join branch in the SQLite source tree, in order to beta-test the exists-to-join optimization. Fossil uses EXISTS operators in the WHERE clause of queries in many places and is therefore a good test case. ... (check-in: b58b3051 user: drh tags: trunk)
2024-06-09
10:53
Typo fixes reported in forum post 10167c5f79. ... (check-in: 382a61e3 user: stephan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to extsrc/shell.c.

9406
9407
9408
9409
9410
9411
9412

9413

9414
9415
9416
9417
9418
9419
9420
**    *  Only the "inflate/deflate" (zlib) compression method is supported
*/
/* #include "sqlite3ext.h" */
SQLITE_EXTENSION_INIT1
#include <stdio.h>
#include <string.h>
#include <assert.h>

#include <stdint.h>


#include <zlib.h>

#ifndef SQLITE_OMIT_VIRTUALTABLE

#ifndef SQLITE_AMALGAMATION








>
|
>







9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
**    *  Only the "inflate/deflate" (zlib) compression method is supported
*/
/* #include "sqlite3ext.h" */
SQLITE_EXTENSION_INIT1
#include <stdio.h>
#include <string.h>
#include <assert.h>
#ifndef SQLITE_NO_STDINT
#  include <stdint.h>
#endif

#include <zlib.h>

#ifndef SQLITE_OMIT_VIRTUALTABLE

#ifndef SQLITE_AMALGAMATION

22456
22457
22458
22459
22460
22461
22462

22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479

22480
22481
22482
22483
22484
22485
22486
        if( pArg->autoEQP>=AUTOEQP_trigger ){
          sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 1, 0);
        }
        pExplain = pStmt;
        sqlite3_reset(pExplain);
        rc = sqlite3_stmt_explain(pExplain, 2);
        if( rc==SQLITE_OK ){

          while( sqlite3_step(pExplain)==SQLITE_ROW ){
            const char *zEQPLine = (const char*)sqlite3_column_text(pExplain,3);
            int iEqpId = sqlite3_column_int(pExplain, 0);
            int iParentId = sqlite3_column_int(pExplain, 1);
            if( zEQPLine==0 ) zEQPLine = "";
            if( zEQPLine[0]=='-' ) eqp_render(pArg, 0);
            eqp_append(pArg, iEqpId, iParentId, zEQPLine);
          }
          eqp_render(pArg, 0);
        }
        if( pArg->autoEQP>=AUTOEQP_full ){
          /* Also do an EXPLAIN for ".eqp full" mode */
          sqlite3_reset(pExplain);
          rc = sqlite3_stmt_explain(pExplain, 1);
          if( rc==SQLITE_OK ){
            pArg->cMode = MODE_Explain;
            assert( sqlite3_stmt_isexplain(pExplain)==1 );

            explain_data_prepare(pArg, pExplain);
            exec_prepared_stmt(pArg, pExplain);
            explain_data_delete(pArg);
          }
        }
        if( pArg->autoEQP>=AUTOEQP_trigger && triggerEQP==0 ){
          sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 0, 0);







>

















>







22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
        if( pArg->autoEQP>=AUTOEQP_trigger ){
          sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 1, 0);
        }
        pExplain = pStmt;
        sqlite3_reset(pExplain);
        rc = sqlite3_stmt_explain(pExplain, 2);
        if( rc==SQLITE_OK ){
          bind_prepared_stmt(pArg, pExplain);
          while( sqlite3_step(pExplain)==SQLITE_ROW ){
            const char *zEQPLine = (const char*)sqlite3_column_text(pExplain,3);
            int iEqpId = sqlite3_column_int(pExplain, 0);
            int iParentId = sqlite3_column_int(pExplain, 1);
            if( zEQPLine==0 ) zEQPLine = "";
            if( zEQPLine[0]=='-' ) eqp_render(pArg, 0);
            eqp_append(pArg, iEqpId, iParentId, zEQPLine);
          }
          eqp_render(pArg, 0);
        }
        if( pArg->autoEQP>=AUTOEQP_full ){
          /* Also do an EXPLAIN for ".eqp full" mode */
          sqlite3_reset(pExplain);
          rc = sqlite3_stmt_explain(pExplain, 1);
          if( rc==SQLITE_OK ){
            pArg->cMode = MODE_Explain;
            assert( sqlite3_stmt_isexplain(pExplain)==1 );
            bind_prepared_stmt(pArg, pExplain);
            explain_data_prepare(pArg, pExplain);
            exec_prepared_stmt(pArg, pExplain);
            explain_data_delete(pArg);
          }
        }
        if( pArg->autoEQP>=AUTOEQP_trigger && triggerEQP==0 ){
          sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 0, 0);
27158
27159
27160
27161
27162
27163
27164

27165
27166
27167
27168
27169
27170
27171
        sqlite3_free(zRenames);
      }
      assert(dbCols==0);
      if( zColDefs==0 ){
        eputf("%s: empty file\n", sCtx.zFile);
        import_cleanup(&sCtx);
        rc = 1;

        goto meta_command_exit;
      }
      zCreate = sqlite3_mprintf("%z%z\n", zCreate, zColDefs);
      if( zCreate==0 ){
        import_cleanup(&sCtx);
        shell_out_of_memory();
      }







>







27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
        sqlite3_free(zRenames);
      }
      assert(dbCols==0);
      if( zColDefs==0 ){
        eputf("%s: empty file\n", sCtx.zFile);
        import_cleanup(&sCtx);
        rc = 1;
        sqlite3_free(zCreate);
        goto meta_command_exit;
      }
      zCreate = sqlite3_mprintf("%z%z\n", zCreate, zColDefs);
      if( zCreate==0 ){
        import_cleanup(&sCtx);
        shell_out_of_memory();
      }
29108
29109
29110
29111
29112
29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
    {"json_selfcheck",     SQLITE_TESTCTRL_JSON_SELFCHECK ,0,"BOOLEAN"      },
    {"localtime_fault",    SQLITE_TESTCTRL_LOCALTIME_FAULT,0,"BOOLEAN"      },
    {"never_corrupt",      SQLITE_TESTCTRL_NEVER_CORRUPT,1, "BOOLEAN"       },
    {"optimizations",      SQLITE_TESTCTRL_OPTIMIZATIONS,0,"DISABLE-MASK"   },
#ifdef YYCOVERAGE
    {"parser_coverage",    SQLITE_TESTCTRL_PARSER_COVERAGE,0,""             },
#endif
    {"pending_byte",       SQLITE_TESTCTRL_PENDING_BYTE,0, "OFFSET  "       },
    {"prng_restore",       SQLITE_TESTCTRL_PRNG_RESTORE,0, ""               },
    {"prng_save",          SQLITE_TESTCTRL_PRNG_SAVE,   0, ""               },
    {"prng_seed",          SQLITE_TESTCTRL_PRNG_SEED,   0, "SEED ?db?"      },
    {"seek_count",         SQLITE_TESTCTRL_SEEK_COUNT,  0, ""               },
    {"sorter_mmap",        SQLITE_TESTCTRL_SORTER_MMAP, 0, "NMAX"           },
    {"tune",               SQLITE_TESTCTRL_TUNE,        1, "ID VALUE"       },
    {"uselongdouble",  SQLITE_TESTCTRL_USELONGDOUBLE,0,"?BOOLEAN|\"default\"?"},







|







29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
29123
29124
29125
29126
29127
    {"json_selfcheck",     SQLITE_TESTCTRL_JSON_SELFCHECK ,0,"BOOLEAN"      },
    {"localtime_fault",    SQLITE_TESTCTRL_LOCALTIME_FAULT,0,"BOOLEAN"      },
    {"never_corrupt",      SQLITE_TESTCTRL_NEVER_CORRUPT,1, "BOOLEAN"       },
    {"optimizations",      SQLITE_TESTCTRL_OPTIMIZATIONS,0,"DISABLE-MASK"   },
#ifdef YYCOVERAGE
    {"parser_coverage",    SQLITE_TESTCTRL_PARSER_COVERAGE,0,""             },
#endif
    {"pending_byte",       SQLITE_TESTCTRL_PENDING_BYTE,1, "OFFSET  "       },
    {"prng_restore",       SQLITE_TESTCTRL_PRNG_RESTORE,0, ""               },
    {"prng_save",          SQLITE_TESTCTRL_PRNG_SAVE,   0, ""               },
    {"prng_seed",          SQLITE_TESTCTRL_PRNG_SEED,   0, "SEED ?db?"      },
    {"seek_count",         SQLITE_TESTCTRL_SEEK_COUNT,  0, ""               },
    {"sorter_mmap",        SQLITE_TESTCTRL_SORTER_MMAP, 0, "NMAX"           },
    {"tune",               SQLITE_TESTCTRL_TUNE,        1, "ID VALUE"       },
    {"uselongdouble",  SQLITE_TESTCTRL_USELONGDOUBLE,0,"?BOOLEAN|\"default\"?"},
30952
30953
30954
30955
30956
30957
30958
30959
30960

30961
30962
30963
30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974

30975
30976
30977
30978
30979
30980
30981
    ** command-line inputs, except for the argToSkip argument which contains
    ** the database filename.
    */
    for(i=0; i<nCmd; i++){
      if( azCmd[i][0]=='.' ){
        rc = do_meta_command(azCmd[i], &data);
        if( rc ){
          free(azCmd);
          return rc==2 ? 0 : rc;

        }
      }else{
        open_db(&data, 0);
        echo_group_input(&data, azCmd[i]);
        rc = shell_exec(&data, azCmd[i], &zErrMsg);
        if( zErrMsg || rc ){
          if( zErrMsg!=0 ){
            eputf("Error: %s\n", zErrMsg);
          }else{
            eputf("Error: unable to process SQL: %s\n", azCmd[i]);
          }
          sqlite3_free(zErrMsg);
          free(azCmd);
          return rc!=0 ? rc : 1;

        }
      }
    }
  }else{
    /* Run commands received from standard input
    */
    if( stdin_is_interactive ){







<
|
>












<
|
>







30957
30958
30959
30960
30961
30962
30963

30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974
30975
30976
30977

30978
30979
30980
30981
30982
30983
30984
30985
30986
    ** command-line inputs, except for the argToSkip argument which contains
    ** the database filename.
    */
    for(i=0; i<nCmd; i++){
      if( azCmd[i][0]=='.' ){
        rc = do_meta_command(azCmd[i], &data);
        if( rc ){

          if( rc==2 ) rc = 0;
          goto shell_main_exit;
        }
      }else{
        open_db(&data, 0);
        echo_group_input(&data, azCmd[i]);
        rc = shell_exec(&data, azCmd[i], &zErrMsg);
        if( zErrMsg || rc ){
          if( zErrMsg!=0 ){
            eputf("Error: %s\n", zErrMsg);
          }else{
            eputf("Error: unable to process SQL: %s\n", azCmd[i]);
          }
          sqlite3_free(zErrMsg);

          if( rc==0 ) rc = 1;
          goto shell_main_exit;
        }
      }
    }
  }else{
    /* Run commands received from standard input
    */
    if( stdin_is_interactive ){
31027
31028
31029
31030
31031
31032
31033

31034
31035
31036
31037
31038
31039
31040
  /* In WASM mode we have to leave the db state in place so that
  ** client code can "push" SQL into it after this call returns. */
#ifndef SQLITE_OMIT_VIRTUALTABLE
  if( data.expert.pExpert ){
    expertFinish(&data, 1, 0);
  }
#endif

  free(azCmd);
  set_table_name(&data, 0);
  if( data.db ){
    session_close_all(&data, -1);
    close_db(data.db);
  }
  for(i=0; i<ArraySize(data.aAuxDb); i++){







>







31032
31033
31034
31035
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045
31046
  /* In WASM mode we have to leave the db state in place so that
  ** client code can "push" SQL into it after this call returns. */
#ifndef SQLITE_OMIT_VIRTUALTABLE
  if( data.expert.pExpert ){
    expertFinish(&data, 1, 0);
  }
#endif
 shell_main_exit:
  free(azCmd);
  set_table_name(&data, 0);
  if( data.db ){
    session_close_all(&data, -1);
    close_db(data.db);
  }
  for(i=0; i<ArraySize(data.aAuxDb); i++){
31059
31060
31061
31062
31063
31064
31065
31066


31067
31068
31069
31070
31071
31072
31073
  memset(&data, 0, sizeof(data));
#ifdef SQLITE_DEBUG
  if( sqlite3_memory_used()>mem_main_enter ){
    eputf("Memory leaked: %u bytes\n",
          (unsigned int)(sqlite3_memory_used()-mem_main_enter));
  }
#endif
#endif /* !SQLITE_SHELL_FIDDLE */


  return rc;
}


#ifdef SQLITE_SHELL_FIDDLE
/* Only for emcc experimentation purposes. */
int fiddle_experiment(int a,int b){







|
>
>







31065
31066
31067
31068
31069
31070
31071
31072
31073
31074
31075
31076
31077
31078
31079
31080
31081
  memset(&data, 0, sizeof(data));
#ifdef SQLITE_DEBUG
  if( sqlite3_memory_used()>mem_main_enter ){
    eputf("Memory leaked: %u bytes\n",
          (unsigned int)(sqlite3_memory_used()-mem_main_enter));
  }
#endif
#else /* SQLITE_SHELL_FIDDLE... */
  shell_main_exit:
#endif
  return rc;
}


#ifdef SQLITE_SHELL_FIDDLE
/* Only for emcc experimentation purposes. */
int fiddle_experiment(int a,int b){

Changes to extsrc/sqlite3.c.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** the text of this file.  Search for "Begin file sqlite3.h" to find the start
** of the embedded sqlite3.h header file.) Additional code files may be needed
** if you want a wrapper to interface SQLite with your choice of programming
** language. The code for the "sqlite3" command-line shell is also in a
** separate file. This file contains only code for the core SQLite library.
**
** The content in this amalgamation comes from Fossil check-in
** a47c644fef71f3ab3dc584ea917eaab9a8e5.
*/
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static
#endif
/************** Begin file sqliteInt.h ***************************************/







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** the text of this file.  Search for "Begin file sqlite3.h" to find the start
** of the embedded sqlite3.h header file.) Additional code files may be needed
** if you want a wrapper to interface SQLite with your choice of programming
** language. The code for the "sqlite3" command-line shell is also in a
** separate file. This file contains only code for the core SQLite library.
**
** The content in this amalgamation comes from Fossil check-in
** 33a3f327855b427ae6ba0057218d043a1417.
*/
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static
#endif
/************** Begin file sqliteInt.h ***************************************/
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.47.0"
#define SQLITE_VERSION_NUMBER 3047000
#define SQLITE_SOURCE_ID      "2024-05-30 13:27:29 a47c644fef71f3ab3dc584ea917eaab9a8e5b4c9dcb57bdd29747ba32108e85f"

/*
** 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







|







457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.47.0"
#define SQLITE_VERSION_NUMBER 3047000
#define SQLITE_SOURCE_ID      "2024-06-11 18:22:48 33a3f327855b427ae6ba0057218d043a1417bc9d780728f47f23acdd836e1686"

/*
** 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
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
#ifdef SQLITE_OMIT_FLOATING_POINT
# undef double
#endif

#if defined(__wasi__)
# undef SQLITE_WASI
# define SQLITE_WASI 1
# undef SQLITE_OMIT_WAL
# define SQLITE_OMIT_WAL 1/* because it requires shared memory APIs */
# ifndef SQLITE_OMIT_LOAD_EXTENSION
#  define SQLITE_OMIT_LOAD_EXTENSION
# endif
# ifndef SQLITE_THREADSAFE
#  define SQLITE_THREADSAFE 0
# endif
#endif







<
<







11141
11142
11143
11144
11145
11146
11147


11148
11149
11150
11151
11152
11153
11154
#ifdef SQLITE_OMIT_FLOATING_POINT
# undef double
#endif

#if defined(__wasi__)
# undef SQLITE_WASI
# define SQLITE_WASI 1


# ifndef SQLITE_OMIT_LOAD_EXTENSION
#  define SQLITE_OMIT_LOAD_EXTENSION
# endif
# ifndef SQLITE_THREADSAFE
#  define SQLITE_THREADSAFE 0
# endif
#endif
14528
14529
14530
14531
14532
14533
14534

14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
#define TK_DESC                            39
#define TK_DETACH                          40
#define TK_EACH                            41
#define TK_FAIL                            42
#define TK_OR                              43
#define TK_AND                             44
#define TK_IS                              45

#define TK_MATCH                           46
#define TK_LIKE_KW                         47
#define TK_BETWEEN                         48
#define TK_IN                              49
#define TK_ISNULL                          50
#define TK_NOTNULL                         51
#define TK_NE                              52
#define TK_EQ                              53
#define TK_GT                              54
#define TK_LE                              55
#define TK_LT                              56
#define TK_GE                              57
#define TK_ESCAPE                          58
#define TK_ID                              59
#define TK_COLUMNKW                        60
#define TK_DO                              61
#define TK_FOR                             62
#define TK_IGNORE                          63
#define TK_INITIALLY                       64
#define TK_INSTEAD                         65
#define TK_NO                              66
#define TK_KEY                             67
#define TK_OF                              68
#define TK_OFFSET                          69
#define TK_PRAGMA                          70
#define TK_RAISE                           71
#define TK_RECURSIVE                       72
#define TK_REPLACE                         73
#define TK_RESTRICT                        74
#define TK_ROW                             75
#define TK_ROWS                            76
#define TK_TRIGGER                         77
#define TK_VACUUM                          78
#define TK_VIEW                            79
#define TK_VIRTUAL                         80
#define TK_WITH                            81
#define TK_NULLS                           82
#define TK_FIRST                           83
#define TK_LAST                            84
#define TK_CURRENT                         85
#define TK_FOLLOWING                       86
#define TK_PARTITION                       87
#define TK_PRECEDING                       88
#define TK_RANGE                           89
#define TK_UNBOUNDED                       90
#define TK_EXCLUDE                         91
#define TK_GROUPS                          92
#define TK_OTHERS                          93
#define TK_TIES                            94
#define TK_GENERATED                       95
#define TK_ALWAYS                          96
#define TK_MATERIALIZED                    97
#define TK_REINDEX                         98
#define TK_RENAME                          99
#define TK_CTIME_KW                       100
#define TK_ANY                            101
#define TK_BITAND                         102
#define TK_BITOR                          103
#define TK_LSHIFT                         104
#define TK_RSHIFT                         105
#define TK_PLUS                           106
#define TK_MINUS                          107
#define TK_STAR                           108
#define TK_SLASH                          109
#define TK_REM                            110
#define TK_CONCAT                         111
#define TK_PTR                            112
#define TK_COLLATE                        113
#define TK_BITNOT                         114
#define TK_ON                             115
#define TK_INDEXED                        116
#define TK_STRING                         117
#define TK_JOIN_KW                        118
#define TK_CONSTRAINT                     119
#define TK_DEFAULT                        120
#define TK_NULL                           121
#define TK_PRIMARY                        122
#define TK_UNIQUE                         123
#define TK_CHECK                          124
#define TK_REFERENCES                     125
#define TK_AUTOINCR                       126
#define TK_INSERT                         127
#define TK_DELETE                         128
#define TK_UPDATE                         129
#define TK_SET                            130
#define TK_DEFERRABLE                     131
#define TK_FOREIGN                        132
#define TK_DROP                           133
#define TK_UNION                          134
#define TK_ALL                            135
#define TK_EXCEPT                         136
#define TK_INTERSECT                      137
#define TK_SELECT                         138
#define TK_VALUES                         139
#define TK_DISTINCT                       140
#define TK_DOT                            141
#define TK_FROM                           142
#define TK_JOIN                           143
#define TK_USING                          144
#define TK_ORDER                          145
#define TK_GROUP                          146
#define TK_HAVING                         147
#define TK_LIMIT                          148
#define TK_WHERE                          149
#define TK_RETURNING                      150
#define TK_INTO                           151
#define TK_NOTHING                        152
#define TK_FLOAT                          153
#define TK_BLOB                           154
#define TK_INTEGER                        155
#define TK_VARIABLE                       156
#define TK_CASE                           157
#define TK_WHEN                           158
#define TK_THEN                           159
#define TK_ELSE                           160
#define TK_INDEX                          161
#define TK_ALTER                          162
#define TK_ADD                            163
#define TK_WINDOW                         164
#define TK_OVER                           165
#define TK_FILTER                         166
#define TK_COLUMN                         167
#define TK_AGG_FUNCTION                   168
#define TK_AGG_COLUMN                     169
#define TK_TRUEFALSE                      170
#define TK_ISNOT                          171
#define TK_FUNCTION                       172
#define TK_UPLUS                          173
#define TK_UMINUS                         174
#define TK_TRUTH                          175
#define TK_REGISTER                       176
#define TK_VECTOR                         177
#define TK_SELECT_COLUMN                  178







>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<







14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658

14659
14660
14661
14662
14663
14664
14665
#define TK_DESC                            39
#define TK_DETACH                          40
#define TK_EACH                            41
#define TK_FAIL                            42
#define TK_OR                              43
#define TK_AND                             44
#define TK_IS                              45
#define TK_ISNOT                           46
#define TK_MATCH                           47
#define TK_LIKE_KW                         48
#define TK_BETWEEN                         49
#define TK_IN                              50
#define TK_ISNULL                          51
#define TK_NOTNULL                         52
#define TK_NE                              53
#define TK_EQ                              54
#define TK_GT                              55
#define TK_LE                              56
#define TK_LT                              57
#define TK_GE                              58
#define TK_ESCAPE                          59
#define TK_ID                              60
#define TK_COLUMNKW                        61
#define TK_DO                              62
#define TK_FOR                             63
#define TK_IGNORE                          64
#define TK_INITIALLY                       65
#define TK_INSTEAD                         66
#define TK_NO                              67
#define TK_KEY                             68
#define TK_OF                              69
#define TK_OFFSET                          70
#define TK_PRAGMA                          71
#define TK_RAISE                           72
#define TK_RECURSIVE                       73
#define TK_REPLACE                         74
#define TK_RESTRICT                        75
#define TK_ROW                             76
#define TK_ROWS                            77
#define TK_TRIGGER                         78
#define TK_VACUUM                          79
#define TK_VIEW                            80
#define TK_VIRTUAL                         81
#define TK_WITH                            82
#define TK_NULLS                           83
#define TK_FIRST                           84
#define TK_LAST                            85
#define TK_CURRENT                         86
#define TK_FOLLOWING                       87
#define TK_PARTITION                       88
#define TK_PRECEDING                       89
#define TK_RANGE                           90
#define TK_UNBOUNDED                       91
#define TK_EXCLUDE                         92
#define TK_GROUPS                          93
#define TK_OTHERS                          94
#define TK_TIES                            95
#define TK_GENERATED                       96
#define TK_ALWAYS                          97
#define TK_MATERIALIZED                    98
#define TK_REINDEX                         99
#define TK_RENAME                         100
#define TK_CTIME_KW                       101
#define TK_ANY                            102
#define TK_BITAND                         103
#define TK_BITOR                          104
#define TK_LSHIFT                         105
#define TK_RSHIFT                         106
#define TK_PLUS                           107
#define TK_MINUS                          108
#define TK_STAR                           109
#define TK_SLASH                          110
#define TK_REM                            111
#define TK_CONCAT                         112
#define TK_PTR                            113
#define TK_COLLATE                        114
#define TK_BITNOT                         115
#define TK_ON                             116
#define TK_INDEXED                        117
#define TK_STRING                         118
#define TK_JOIN_KW                        119
#define TK_CONSTRAINT                     120
#define TK_DEFAULT                        121
#define TK_NULL                           122
#define TK_PRIMARY                        123
#define TK_UNIQUE                         124
#define TK_CHECK                          125
#define TK_REFERENCES                     126
#define TK_AUTOINCR                       127
#define TK_INSERT                         128
#define TK_DELETE                         129
#define TK_UPDATE                         130
#define TK_SET                            131
#define TK_DEFERRABLE                     132
#define TK_FOREIGN                        133
#define TK_DROP                           134
#define TK_UNION                          135
#define TK_ALL                            136
#define TK_EXCEPT                         137
#define TK_INTERSECT                      138
#define TK_SELECT                         139
#define TK_VALUES                         140
#define TK_DISTINCT                       141
#define TK_DOT                            142
#define TK_FROM                           143
#define TK_JOIN                           144
#define TK_USING                          145
#define TK_ORDER                          146
#define TK_GROUP                          147
#define TK_HAVING                         148
#define TK_LIMIT                          149
#define TK_WHERE                          150
#define TK_RETURNING                      151
#define TK_INTO                           152
#define TK_NOTHING                        153
#define TK_FLOAT                          154
#define TK_BLOB                           155
#define TK_INTEGER                        156
#define TK_VARIABLE                       157
#define TK_CASE                           158
#define TK_WHEN                           159
#define TK_THEN                           160
#define TK_ELSE                           161
#define TK_INDEX                          162
#define TK_ALTER                          163
#define TK_ADD                            164
#define TK_WINDOW                         165
#define TK_OVER                           166
#define TK_FILTER                         167
#define TK_COLUMN                         168
#define TK_AGG_FUNCTION                   169
#define TK_AGG_COLUMN                     170
#define TK_TRUEFALSE                      171

#define TK_FUNCTION                       172
#define TK_UPLUS                          173
#define TK_UMINUS                         174
#define TK_TRUTH                          175
#define TK_REGISTER                       176
#define TK_VECTOR                         177
#define TK_SELECT_COLUMN                  178
15167
15168
15169
15170
15171
15172
15173

15174
15175
15176
15177
15178
15179
15180
**   0x00002000     Constant propagation
**   0x00004000     Push-down optimization
**   0x00008000     After all FROM-clause analysis
**   0x00010000     Beginning of DELETE/INSERT/UPDATE processing
**   0x00020000     Transform DISTINCT into GROUP BY
**   0x00040000     SELECT tree dump after all code has been generated
**   0x00080000     NOT NULL strength reduction

*/

/*
** Macros for "wheretrace"
*/
SQLITE_PRIVATE u32 sqlite3WhereTrace;
#if defined(SQLITE_DEBUG) \







>







15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
**   0x00002000     Constant propagation
**   0x00004000     Push-down optimization
**   0x00008000     After all FROM-clause analysis
**   0x00010000     Beginning of DELETE/INSERT/UPDATE processing
**   0x00020000     Transform DISTINCT into GROUP BY
**   0x00040000     SELECT tree dump after all code has been generated
**   0x00080000     NOT NULL strength reduction
**   0x00100000     EXISTS-to-JOIN optimization
*/

/*
** Macros for "wheretrace"
*/
SQLITE_PRIVATE u32 sqlite3WhereTrace;
#if defined(SQLITE_DEBUG) \
16659
16660
16661
16662
16663
16664
16665

16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
#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_IdxGE          45 /* jump, synopsis: key=r[P3@P4]               */
#define OP_RowSetRead     46 /* jump, synopsis: r[P3]=rowset(P1)           */
#define OP_RowSetTest     47 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */
#define OP_Program        48 /* jump0                                      */
#define OP_FkIfZero       49 /* jump, synopsis: if fkctr[P1]==0 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_IfPos          59 /* jump, synopsis: if r[P1]>0 then r[P1]-=P3, goto P2 */
#define OP_IfNotZero      60 /* jump, synopsis: if r[P1]!=0 then r[P1]--, goto P2 */
#define OP_DecrJumpZero   61 /* jump, synopsis: if (--r[P1])==0 goto P2    */
#define OP_IncrVacuum     62 /* jump                                       */
#define OP_VNext          63 /* jump                                       */
#define OP_Filter         64 /* jump, synopsis: if key(P3@P4) not in filter(P1) goto P2 */
#define OP_PureFunc       65 /* synopsis: r[P3]=func(r[P2@NP])             */
#define OP_Function       66 /* synopsis: r[P3]=func(r[P2@NP])             */







>
|
|
|
|
|
|
|
|
|
<







16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674

16675
16676
16677
16678
16679
16680
16681
#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_IdxGE          45 /* jump, synopsis: key=r[P3@P4]               */
#define OP_RowSetRead     46 /* jump, synopsis: r[P3]=rowset(P1)           */
#define OP_RowSetTest     47 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */
#define OP_Program        48 /* jump0                                      */
#define OP_FkIfZero       49 /* jump, synopsis: if fkctr[P1]==0 goto P2    */
#define OP_IfPos          50 /* jump, synopsis: if r[P1]>0 then r[P1]-=P3, goto P2 */
#define OP_IsNull         51 /* jump, same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
#define OP_NotNull        52 /* jump, same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
#define OP_Ne             53 /* jump, same as TK_NE, synopsis: IF r[P3]!=r[P1] */
#define OP_Eq             54 /* jump, same as TK_EQ, synopsis: IF r[P3]==r[P1] */
#define OP_Gt             55 /* jump, same as TK_GT, synopsis: IF r[P3]>r[P1] */
#define OP_Le             56 /* jump, same as TK_LE, synopsis: IF r[P3]<=r[P1] */
#define OP_Lt             57 /* jump, same as TK_LT, synopsis: IF r[P3]<r[P1] */
#define OP_Ge             58 /* jump, same as TK_GE, synopsis: IF r[P3]>=r[P1] */
#define OP_ElseEq         59 /* jump, same as TK_ESCAPE                    */

#define OP_IfNotZero      60 /* jump, synopsis: if r[P1]!=0 then r[P1]--, goto P2 */
#define OP_DecrJumpZero   61 /* jump, synopsis: if (--r[P1])==0 goto P2    */
#define OP_IncrVacuum     62 /* jump                                       */
#define OP_VNext          63 /* jump                                       */
#define OP_Filter         64 /* jump, synopsis: if key(P3@P4) not in filter(P1) goto P2 */
#define OP_PureFunc       65 /* synopsis: r[P3]=func(r[P2@NP])             */
#define OP_Function       66 /* synopsis: r[P3]=func(r[P2@NP])             */
16711
16712
16713
16714
16715
16716
16717

16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731

16732
16733
16734

16735
16736
16737
16738
16739
16740
16741
#define OP_TypeCheck      95 /* synopsis: typecheck(r[P1@P2])              */
#define OP_Affinity       96 /* synopsis: affinity(r[P1@P2])               */
#define OP_MakeRecord     97 /* synopsis: r[P3]=mkrec(r[P1@P2])            */
#define OP_Count          98 /* synopsis: r[P2]=count()                    */
#define OP_ReadCookie     99
#define OP_SetCookie     100
#define OP_ReopenIdx     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_OpenRead      112 /* synopsis: root=P2 iDb=P3                   */
#define OP_OpenWrite     113 /* synopsis: root=P2 iDb=P3                   */
#define OP_BitNot        114 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
#define OP_OpenDup       115

#define OP_OpenAutoindex 116 /* synopsis: nColumn=P2                       */
#define OP_String8       117 /* same as TK_STRING, synopsis: r[P2]='P4'    */
#define OP_OpenEphemeral 118 /* synopsis: nColumn=P2                       */

#define OP_SorterOpen    119
#define OP_SequenceTest  120 /* synopsis: if( cursor[P1].ctr++ ) pc = P2   */
#define OP_OpenPseudo    121 /* synopsis: P3 columns in r[P2]              */
#define OP_Close         122
#define OP_ColumnsUsed   123
#define OP_SeekScan      124 /* synopsis: Scan-ahead up to P1 rows         */
#define OP_SeekHit       125 /* synopsis: set P2<=seekHit<=P3              */







>
|
|
|
|
|
|
|
|
|
|
<

<
|
>

<
|
>







16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727

16728

16729
16730
16731

16732
16733
16734
16735
16736
16737
16738
16739
16740
#define OP_TypeCheck      95 /* synopsis: typecheck(r[P1@P2])              */
#define OP_Affinity       96 /* synopsis: affinity(r[P1@P2])               */
#define OP_MakeRecord     97 /* synopsis: r[P3]=mkrec(r[P1@P2])            */
#define OP_Count          98 /* synopsis: r[P2]=count()                    */
#define OP_ReadCookie     99
#define OP_SetCookie     100
#define OP_ReopenIdx     101 /* synopsis: root=P2 iDb=P3                   */
#define OP_OpenRead      102 /* synopsis: root=P2 iDb=P3                   */
#define OP_BitAnd        103 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
#define OP_BitOr         104 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
#define OP_ShiftLeft     105 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
#define OP_ShiftRight    106 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
#define OP_Add           107 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
#define OP_Subtract      108 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
#define OP_Multiply      109 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
#define OP_Divide        110 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
#define OP_Remainder     111 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
#define OP_Concat        112 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */

#define OP_OpenWrite     113 /* synopsis: root=P2 iDb=P3                   */

#define OP_OpenDup       114
#define OP_BitNot        115 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
#define OP_OpenAutoindex 116 /* synopsis: nColumn=P2                       */

#define OP_OpenEphemeral 117 /* synopsis: nColumn=P2                       */
#define OP_String8       118 /* same as TK_STRING, synopsis: r[P2]='P4'    */
#define OP_SorterOpen    119
#define OP_SequenceTest  120 /* synopsis: if( cursor[P1].ctr++ ) pc = P2   */
#define OP_OpenPseudo    121 /* synopsis: P3 columns in r[P2]              */
#define OP_Close         122
#define OP_ColumnsUsed   123
#define OP_SeekScan      124 /* synopsis: Scan-ahead up to P1 rows         */
#define OP_SeekHit       125 /* synopsis: set P2<=seekHit<=P3              */
16762
16763
16764
16765
16766
16767
16768
16769
16770

16771
16772
16773
16774
16775
16776
16777
#define OP_ResetSorter   146
#define OP_CreateBtree   147 /* synopsis: r[P2]=root iDb=P1 flags=P3       */
#define OP_SqlExec       148
#define OP_ParseSchema   149
#define OP_LoadAnalysis  150
#define OP_DropTable     151
#define OP_DropIndex     152
#define OP_Real          153 /* same as TK_FLOAT, synopsis: r[P2]=P4       */
#define OP_DropTrigger   154

#define OP_IntegrityCk   155
#define OP_RowSetAdd     156 /* synopsis: rowset(P1)=r[P2]                 */
#define OP_Param         157
#define OP_FkCounter     158 /* synopsis: fkctr[P1]+=P2                    */
#define OP_MemMax        159 /* synopsis: r[P1]=max(r[P1],r[P2])           */
#define OP_OffsetLimit   160 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
#define OP_AggInverse    161 /* synopsis: accum=r[P3] inverse(r[P2@P5])    */







<
|
>







16761
16762
16763
16764
16765
16766
16767

16768
16769
16770
16771
16772
16773
16774
16775
16776
#define OP_ResetSorter   146
#define OP_CreateBtree   147 /* synopsis: r[P2]=root iDb=P1 flags=P3       */
#define OP_SqlExec       148
#define OP_ParseSchema   149
#define OP_LoadAnalysis  150
#define OP_DropTable     151
#define OP_DropIndex     152

#define OP_DropTrigger   153
#define OP_Real          154 /* same as TK_FLOAT, synopsis: r[P2]=P4       */
#define OP_IntegrityCk   155
#define OP_RowSetAdd     156 /* synopsis: rowset(P1)=r[P2]                 */
#define OP_Param         157
#define OP_FkCounter     158 /* synopsis: fkctr[P1]+=P2                    */
#define OP_MemMax        159 /* synopsis: r[P1]=max(r[P1],r[P2])           */
#define OP_OffsetLimit   160 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
#define OP_AggInverse    161 /* synopsis: accum=r[P3] inverse(r[P2@P5])    */
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
#define OPFLG_INITIALIZER {\
/*   0 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x00,\
/*   8 */ 0x81, 0x01, 0x01, 0x81, 0x83, 0x83, 0x01, 0x01,\
/*  16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0xc9, 0xc9, 0xc9,\
/*  24 */ 0xc9, 0x01, 0x49, 0x49, 0x49, 0x49, 0xc9, 0x49,\
/*  32 */ 0xc1, 0x01, 0x41, 0x41, 0xc1, 0x01, 0x41, 0x41,\
/*  40 */ 0x41, 0x41, 0x41, 0x26, 0x26, 0x41, 0x23, 0x0b,\
/*  48 */ 0x81, 0x01, 0x03, 0x03, 0x0b, 0x0b, 0x0b, 0x0b,\
/*  56 */ 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x03, 0x01, 0x41,\
/*  64 */ 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10,\
/*  72 */ 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00,\
/*  80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02,\
/*  88 */ 0x02, 0x00, 0x00, 0x12, 0x1e, 0x20, 0x40, 0x00,\
/*  96 */ 0x00, 0x00, 0x10, 0x10, 0x00, 0x40, 0x26, 0x26,\
/* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\
/* 112 */ 0x40, 0x00, 0x12, 0x40, 0x40, 0x10, 0x40, 0x00,\
/* 120 */ 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x10, 0x10,\
/* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x50,\
/* 136 */ 0x00, 0x40, 0x04, 0x04, 0x00, 0x40, 0x50, 0x40,\
/* 144 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
/* 152 */ 0x00, 0x10, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\
/* 160 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x50,\
/* 176 */ 0x40, 0x00, 0x10, 0x10, 0x02, 0x12, 0x12, 0x00,\
/* 184 */ 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







|
|




|

|




|







16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
#define OPFLG_INITIALIZER {\
/*   0 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x00,\
/*   8 */ 0x81, 0x01, 0x01, 0x81, 0x83, 0x83, 0x01, 0x01,\
/*  16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0xc9, 0xc9, 0xc9,\
/*  24 */ 0xc9, 0x01, 0x49, 0x49, 0x49, 0x49, 0xc9, 0x49,\
/*  32 */ 0xc1, 0x01, 0x41, 0x41, 0xc1, 0x01, 0x41, 0x41,\
/*  40 */ 0x41, 0x41, 0x41, 0x26, 0x26, 0x41, 0x23, 0x0b,\
/*  48 */ 0x81, 0x01, 0x03, 0x03, 0x03, 0x0b, 0x0b, 0x0b,\
/*  56 */ 0x0b, 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x01, 0x41,\
/*  64 */ 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10,\
/*  72 */ 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00,\
/*  80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02,\
/*  88 */ 0x02, 0x00, 0x00, 0x12, 0x1e, 0x20, 0x40, 0x00,\
/*  96 */ 0x00, 0x00, 0x10, 0x10, 0x00, 0x40, 0x40, 0x26,\
/* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\
/* 112 */ 0x26, 0x00, 0x40, 0x12, 0x40, 0x40, 0x10, 0x00,\
/* 120 */ 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x10, 0x10,\
/* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x50,\
/* 136 */ 0x00, 0x40, 0x04, 0x04, 0x00, 0x40, 0x50, 0x40,\
/* 144 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
/* 152 */ 0x00, 0x00, 0x10, 0x00, 0x06, 0x10, 0x00, 0x04,\
/* 160 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x50,\
/* 176 */ 0x40, 0x00, 0x10, 0x10, 0x02, 0x12, 0x12, 0x00,\
/* 184 */ 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
17893
17894
17895
17896
17897
17898
17899

17900
17901
17902
17903
17904
17905
17906
#define SQLITE_ReleaseReg     0x00400000 /* Use OP_ReleaseReg for testing */
#define SQLITE_FlttnUnionAll  0x00800000 /* Disable the UNION ALL flattener */
   /* TH3 expects this value  ^^^^^^^^^^ See flatten04.test */
#define SQLITE_IndexedExpr    0x01000000 /* Pull exprs from index when able */
#define SQLITE_Coroutines     0x02000000 /* Co-routines for subqueries */
#define SQLITE_NullUnusedCols 0x04000000 /* NULL unused columns in subqueries */
#define SQLITE_OnePass        0x08000000 /* Single-pass DELETE and UPDATE */

#define SQLITE_AllOpts        0xffffffff /* All optimizations */

/*
** Macros for testing whether or not optimizations are enabled or disabled.
*/
#define OptimizationDisabled(db, mask)  (((db)->dbOptFlags&(mask))!=0)
#define OptimizationEnabled(db, mask)   (((db)->dbOptFlags&(mask))==0)







>







17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
#define SQLITE_ReleaseReg     0x00400000 /* Use OP_ReleaseReg for testing */
#define SQLITE_FlttnUnionAll  0x00800000 /* Disable the UNION ALL flattener */
   /* TH3 expects this value  ^^^^^^^^^^ See flatten04.test */
#define SQLITE_IndexedExpr    0x01000000 /* Pull exprs from index when able */
#define SQLITE_Coroutines     0x02000000 /* Co-routines for subqueries */
#define SQLITE_NullUnusedCols 0x04000000 /* NULL unused columns in subqueries */
#define SQLITE_OnePass        0x08000000 /* Single-pass DELETE and UPDATE */
#define SQLITE_ExistsToJoin   0x10000000 /* The EXISTS-to-JOIN optimization */
#define SQLITE_AllOpts        0xffffffff /* All optimizations */

/*
** Macros for testing whether or not optimizations are enabled or disabled.
*/
#define OptimizationDisabled(db, mask)  (((db)->dbOptFlags&(mask))!=0)
#define OptimizationEnabled(db, mask)   (((db)->dbOptFlags&(mask))==0)
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
#define WHERE_GROUPBY          0x0040 /* pOrderBy is really a GROUP BY */
#define WHERE_DISTINCTBY       0x0080 /* pOrderby is really a DISTINCT clause */
#define WHERE_WANT_DISTINCT    0x0100 /* All output needs to be distinct */
#define WHERE_SORTBYGROUP      0x0200 /* Support sqlite3WhereIsSorted() */
#define WHERE_AGG_DISTINCT     0x0400 /* Query is "SELECT agg(DISTINCT ...)" */
#define WHERE_ORDERBY_LIMIT    0x0800 /* ORDERBY+LIMIT on the inner loop */
#define WHERE_RIGHT_JOIN       0x1000 /* Processing a RIGHT JOIN */
                        /*     0x2000    not currently used */
#define WHERE_USE_LIMIT        0x4000 /* Use the LIMIT in cost estimates */
                        /*     0x8000    not currently used */

/* Allowed return values from sqlite3WhereIsDistinct()
*/
#define WHERE_DISTINCT_NOOP      0  /* DISTINCT keyword not used */
#define WHERE_DISTINCT_UNIQUE    1  /* No duplicates */







|







19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
#define WHERE_GROUPBY          0x0040 /* pOrderBy is really a GROUP BY */
#define WHERE_DISTINCTBY       0x0080 /* pOrderby is really a DISTINCT clause */
#define WHERE_WANT_DISTINCT    0x0100 /* All output needs to be distinct */
#define WHERE_SORTBYGROUP      0x0200 /* Support sqlite3WhereIsSorted() */
#define WHERE_AGG_DISTINCT     0x0400 /* Query is "SELECT agg(DISTINCT ...)" */
#define WHERE_ORDERBY_LIMIT    0x0800 /* ORDERBY+LIMIT on the inner loop */
#define WHERE_RIGHT_JOIN       0x1000 /* Processing a RIGHT JOIN */
#define WHERE_KEEP_ALL_JOINS   0x2000 /* Do not do the omit-noop-join opt */
#define WHERE_USE_LIMIT        0x4000 /* Use the LIMIT in cost estimates */
                        /*     0x8000    not currently used */

/* Allowed return values from sqlite3WhereIsDistinct()
*/
#define WHERE_DISTINCT_NOOP      0  /* DISTINCT keyword not used */
#define WHERE_DISTINCT_UNIQUE    1  /* No duplicates */
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
#define NC_SelfRef   0x00002e /* Combo: PartIdx, isCheck, GenCol, and IdxExpr */
#define NC_Subquery  0x000040 /* A subquery has been seen */
#define NC_UEList    0x000080 /* True if uNC.pEList is used */
#define NC_UAggInfo  0x000100 /* True if uNC.pAggInfo is used */
#define NC_UUpsert   0x000200 /* True if uNC.pUpsert is used */
#define NC_UBaseReg  0x000400 /* True if uNC.iBaseReg is used */
#define NC_MinMaxAgg 0x001000 /* min/max aggregates seen.  See note above */
#define NC_Complex   0x002000 /* True if a function or subquery seen */
#define NC_AllowWin  0x004000 /* Window functions are allowed here */
#define NC_HasWin    0x008000 /* One or more window functions seen */
#define NC_IsDDL     0x010000 /* Resolving names in a CREATE statement */
#define NC_InAggFunc 0x020000 /* True if analyzing arguments to an agg func */
#define NC_FromDDL   0x040000 /* SQL text comes from sqlite_schema */
#define NC_NoSelect  0x080000 /* Do not descend into sub-selects */
#define NC_Where     0x100000 /* Processing WHERE clause of a SELECT */







|







19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
#define NC_SelfRef   0x00002e /* Combo: PartIdx, isCheck, GenCol, and IdxExpr */
#define NC_Subquery  0x000040 /* A subquery has been seen */
#define NC_UEList    0x000080 /* True if uNC.pEList is used */
#define NC_UAggInfo  0x000100 /* True if uNC.pAggInfo is used */
#define NC_UUpsert   0x000200 /* True if uNC.pUpsert is used */
#define NC_UBaseReg  0x000400 /* True if uNC.iBaseReg is used */
#define NC_MinMaxAgg 0x001000 /* min/max aggregates seen.  See note above */
/*                   0x002000 // available for reuse */
#define NC_AllowWin  0x004000 /* Window functions are allowed here */
#define NC_HasWin    0x008000 /* One or more window functions seen */
#define NC_IsDDL     0x010000 /* Resolving names in a CREATE statement */
#define NC_InAggFunc 0x020000 /* True if analyzing arguments to an agg func */
#define NC_FromDDL   0x040000 /* SQL text comes from sqlite_schema */
#define NC_NoSelect  0x080000 /* Do not descend into sub-selects */
#define NC_Where     0x100000 /* Processing WHERE clause of a SELECT */
19796
19797
19798
19799
19800
19801
19802

19803
19804
19805
19806
19807
19808
19809
  u8 mayAbort;         /* True if statement may throw an ABORT exception */
  u8 hasCompound;      /* Need to invoke convertCompoundSelectToSubquery() */
  u8 okConstFactor;    /* OK to factor out constants */
  u8 disableLookaside; /* Number of times lookaside has been disabled */
  u8 prepFlags;        /* SQLITE_PREPARE_* flags */
  u8 withinRJSubrtn;   /* Nesting level for RIGHT JOIN body subroutines */
  u8 bHasWith;         /* True if statement contains WITH */

#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
  u8 earlyCleanup;     /* OOM inside sqlite3ParserAddCleanup() */
#endif
#ifdef SQLITE_DEBUG
  u8 ifNotExists;      /* Might be true if IF NOT EXISTS.  Assert()s only */
#endif
  int nRangeReg;       /* Size of the temporary register block */







>







19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
  u8 mayAbort;         /* True if statement may throw an ABORT exception */
  u8 hasCompound;      /* Need to invoke convertCompoundSelectToSubquery() */
  u8 okConstFactor;    /* OK to factor out constants */
  u8 disableLookaside; /* Number of times lookaside has been disabled */
  u8 prepFlags;        /* SQLITE_PREPARE_* flags */
  u8 withinRJSubrtn;   /* Nesting level for RIGHT JOIN body subroutines */
  u8 bHasWith;         /* True if statement contains WITH */
  u8 bHasExists;       /* Has a correlated "EXISTS (SELECT ....)" expression */
#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
  u8 earlyCleanup;     /* OOM inside sqlite3ParserAddCleanup() */
#endif
#ifdef SQLITE_DEBUG
  u8 ifNotExists;      /* Might be true if IF NOT EXISTS.  Assert()s only */
#endif
  int nRangeReg;       /* Size of the temporary register block */
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
SQLITE_PRIVATE int sqlite3ExprIsConstant(Parse*,Expr*);
SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*, u8);
SQLITE_PRIVATE int sqlite3ExprIsConstantOrGroupBy(Parse*, Expr*, ExprList*);
SQLITE_PRIVATE int sqlite3ExprIsSingleTableConstraint(Expr*,const SrcList*,int,int);
#ifdef SQLITE_ENABLE_CURSOR_HINTS
SQLITE_PRIVATE int sqlite3ExprContainsSubquery(Expr*);
#endif
SQLITE_PRIVATE int sqlite3ExprIsInteger(const Expr*, int*);
SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*);
SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
SQLITE_PRIVATE int sqlite3IsRowid(const char*);
SQLITE_PRIVATE const char *sqlite3RowidAlias(Table *pTab);
SQLITE_PRIVATE void sqlite3GenerateRowDelete(
    Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8,int);
SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*, int);







|







21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
SQLITE_PRIVATE int sqlite3ExprIsConstant(Parse*,Expr*);
SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*, u8);
SQLITE_PRIVATE int sqlite3ExprIsConstantOrGroupBy(Parse*, Expr*, ExprList*);
SQLITE_PRIVATE int sqlite3ExprIsSingleTableConstraint(Expr*,const SrcList*,int,int);
#ifdef SQLITE_ENABLE_CURSOR_HINTS
SQLITE_PRIVATE int sqlite3ExprContainsSubquery(Expr*);
#endif
SQLITE_PRIVATE int sqlite3ExprIsInteger(const Expr*, int*, Parse*);
SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*);
SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
SQLITE_PRIVATE int sqlite3IsRowid(const char*);
SQLITE_PRIVATE const char *sqlite3RowidAlias(Table *pTab);
SQLITE_PRIVATE void sqlite3GenerateRowDelete(
    Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8,int);
SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*, int);
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
  float rLimit;       /* Maximum NNN value for this transform */
  float rXform;       /* Constant used for this transform */
} aXformType[] = {
  /* 0 */ { 6, "second",   4.6427e+14,         1.0  },
  /* 1 */ { 6, "minute",   7.7379e+12,        60.0  },
  /* 2 */ { 4, "hour",     1.2897e+11,      3600.0  },
  /* 3 */ { 3, "day",      5373485.0,      86400.0  },
  /* 4 */ { 5, "month",    176546.0,  30.0*86400.0  },
  /* 5 */ { 4, "year",     14713.0,  365.0*86400.0  },
};

/*
** If the DateTime p is raw number, try to figure out if it is
** a julian day number of a unix timestamp.  Set the p value
** appropriately.
*/







|
|







24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
  float rLimit;       /* Maximum NNN value for this transform */
  float rXform;       /* Constant used for this transform */
} aXformType[] = {
  /* 0 */ { 6, "second",   4.6427e+14,         1.0  },
  /* 1 */ { 6, "minute",   7.7379e+12,        60.0  },
  /* 2 */ { 4, "hour",     1.2897e+11,      3600.0  },
  /* 3 */ { 3, "day",      5373485.0,      86400.0  },
  /* 4 */ { 5, "month",    176546.0,     2592000.0  },
  /* 5 */ { 4, "year",     14713.0,     31536000.0  },
};

/*
** If the DateTime p is raw number, try to figure out if it is
** a julian day number of a unix timestamp.  Set the p value
** appropriately.
*/
35922
35923
35924
35925
35926
35927
35928
35929

35930
35931
35932



35933
35934
35935
35936
35937
35938
35939
35940
35941
35942
35943
35944


35945
35946
35947
35948
35949
35950
35951
  return x;
}

/*
** Decode a floating-point value into an approximate decimal
** representation.
**
** Round the decimal representation to n significant digits if

** n is positive.  Or round to -n signficant digits after the
** decimal point if n is negative.  No rounding is performed if
** n is zero.



**
** The significant digits of the decimal representation are
** stored in p->z[] which is a often (but not always) a pointer
** into the middle of p->zBuf[].  There are p->n significant digits.
** The p->z[] array is *not* zero-terminated.
*/
SQLITE_PRIVATE void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){
  int i;
  u64 v;
  int e, exp = 0;
  p->isSpecial = 0;
  p->z = p->zBuf;



  /* Convert negative numbers to positive.  Deal with Infinity, 0.0, and
  ** NaN. */
  if( r<0.0 ){
    p->sign = '-';
    r = -r;
  }else if( r==0.0 ){







|
>
|
<
|
>
>
>












>
>







35923
35924
35925
35926
35927
35928
35929
35930
35931
35932

35933
35934
35935
35936
35937
35938
35939
35940
35941
35942
35943
35944
35945
35946
35947
35948
35949
35950
35951
35952
35953
35954
35955
35956
35957
  return x;
}

/*
** Decode a floating-point value into an approximate decimal
** representation.
**
** If iRound<=0 then round to -iRound significant digits to the
** the left of the decimal point, or to a maximum of mxRound total
** significant digits.

**
** If iRound>0 round to min(iRound,mxRound) significant digits total.
**
** mxRound must be positive.
**
** The significant digits of the decimal representation are
** stored in p->z[] which is a often (but not always) a pointer
** into the middle of p->zBuf[].  There are p->n significant digits.
** The p->z[] array is *not* zero-terminated.
*/
SQLITE_PRIVATE void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){
  int i;
  u64 v;
  int e, exp = 0;
  p->isSpecial = 0;
  p->z = p->zBuf;

  assert( mxRound>0 );

  /* Convert negative numbers to positive.  Deal with Infinity, 0.0, and
  ** NaN. */
  if( r<0.0 ){
    p->sign = '-';
    r = -r;
  }else if( r==0.0 ){
37225
37226
37227
37228
37229
37230
37231

37232
37233
37234
37235
37236
37237
37238
37239
37240
37241
37242
37243
37244
37245
37246
37247
37248
    /*  43 */ "Or"               OpHelp("r[P3]=(r[P1] || r[P2])"),
    /*  44 */ "And"              OpHelp("r[P3]=(r[P1] && r[P2])"),
    /*  45 */ "IdxGE"            OpHelp("key=r[P3@P4]"),
    /*  46 */ "RowSetRead"       OpHelp("r[P3]=rowset(P1)"),
    /*  47 */ "RowSetTest"       OpHelp("if r[P3] in rowset(P1) goto P2"),
    /*  48 */ "Program"          OpHelp(""),
    /*  49 */ "FkIfZero"         OpHelp("if fkctr[P1]==0 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 */ "IfPos"            OpHelp("if r[P1]>0 then r[P1]-=P3, goto P2"),
    /*  60 */ "IfNotZero"        OpHelp("if r[P1]!=0 then r[P1]--, goto P2"),
    /*  61 */ "DecrJumpZero"     OpHelp("if (--r[P1])==0 goto P2"),
    /*  62 */ "IncrVacuum"       OpHelp(""),
    /*  63 */ "VNext"            OpHelp(""),
    /*  64 */ "Filter"           OpHelp("if key(P3@P4) not in filter(P1) goto P2"),
    /*  65 */ "PureFunc"         OpHelp("r[P3]=func(r[P2@NP])"),
    /*  66 */ "Function"         OpHelp("r[P3]=func(r[P2@NP])"),







>
|
|
|
|
|
|
|
|
|
<







37231
37232
37233
37234
37235
37236
37237
37238
37239
37240
37241
37242
37243
37244
37245
37246
37247

37248
37249
37250
37251
37252
37253
37254
    /*  43 */ "Or"               OpHelp("r[P3]=(r[P1] || r[P2])"),
    /*  44 */ "And"              OpHelp("r[P3]=(r[P1] && r[P2])"),
    /*  45 */ "IdxGE"            OpHelp("key=r[P3@P4]"),
    /*  46 */ "RowSetRead"       OpHelp("r[P3]=rowset(P1)"),
    /*  47 */ "RowSetTest"       OpHelp("if r[P3] in rowset(P1) goto P2"),
    /*  48 */ "Program"          OpHelp(""),
    /*  49 */ "FkIfZero"         OpHelp("if fkctr[P1]==0 goto P2"),
    /*  50 */ "IfPos"            OpHelp("if r[P1]>0 then r[P1]-=P3, goto P2"),
    /*  51 */ "IsNull"           OpHelp("if r[P1]==NULL goto P2"),
    /*  52 */ "NotNull"          OpHelp("if r[P1]!=NULL goto P2"),
    /*  53 */ "Ne"               OpHelp("IF r[P3]!=r[P1]"),
    /*  54 */ "Eq"               OpHelp("IF r[P3]==r[P1]"),
    /*  55 */ "Gt"               OpHelp("IF r[P3]>r[P1]"),
    /*  56 */ "Le"               OpHelp("IF r[P3]<=r[P1]"),
    /*  57 */ "Lt"               OpHelp("IF r[P3]<r[P1]"),
    /*  58 */ "Ge"               OpHelp("IF r[P3]>=r[P1]"),
    /*  59 */ "ElseEq"           OpHelp(""),

    /*  60 */ "IfNotZero"        OpHelp("if r[P1]!=0 then r[P1]--, goto P2"),
    /*  61 */ "DecrJumpZero"     OpHelp("if (--r[P1])==0 goto P2"),
    /*  62 */ "IncrVacuum"       OpHelp(""),
    /*  63 */ "VNext"            OpHelp(""),
    /*  64 */ "Filter"           OpHelp("if key(P3@P4) not in filter(P1) goto P2"),
    /*  65 */ "PureFunc"         OpHelp("r[P3]=func(r[P2@NP])"),
    /*  66 */ "Function"         OpHelp("r[P3]=func(r[P2@NP])"),
37277
37278
37279
37280
37281
37282
37283

37284
37285
37286
37287
37288
37289
37290
37291
37292
37293
37294
37295

37296
37297
37298
37299
37300

37301
37302
37303
37304
37305
37306
37307
    /*  95 */ "TypeCheck"        OpHelp("typecheck(r[P1@P2])"),
    /*  96 */ "Affinity"         OpHelp("affinity(r[P1@P2])"),
    /*  97 */ "MakeRecord"       OpHelp("r[P3]=mkrec(r[P1@P2])"),
    /*  98 */ "Count"            OpHelp("r[P2]=count()"),
    /*  99 */ "ReadCookie"       OpHelp(""),
    /* 100 */ "SetCookie"        OpHelp(""),
    /* 101 */ "ReopenIdx"        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 */ "OpenRead"         OpHelp("root=P2 iDb=P3"),
    /* 113 */ "OpenWrite"        OpHelp("root=P2 iDb=P3"),

    /* 114 */ "BitNot"           OpHelp("r[P2]= ~r[P1]"),
    /* 115 */ "OpenDup"          OpHelp(""),
    /* 116 */ "OpenAutoindex"    OpHelp("nColumn=P2"),
    /* 117 */ "String8"          OpHelp("r[P2]='P4'"),
    /* 118 */ "OpenEphemeral"    OpHelp("nColumn=P2"),

    /* 119 */ "SorterOpen"       OpHelp(""),
    /* 120 */ "SequenceTest"     OpHelp("if( cursor[P1].ctr++ ) pc = P2"),
    /* 121 */ "OpenPseudo"       OpHelp("P3 columns in r[P2]"),
    /* 122 */ "Close"            OpHelp(""),
    /* 123 */ "ColumnsUsed"      OpHelp(""),
    /* 124 */ "SeekScan"         OpHelp("Scan-ahead up to P1 rows"),
    /* 125 */ "SeekHit"          OpHelp("set P2<=seekHit<=P3"),







>
|
|
|
|
|
|
|
|
|
|
<

>
|
<

<
|
>







37283
37284
37285
37286
37287
37288
37289
37290
37291
37292
37293
37294
37295
37296
37297
37298
37299
37300

37301
37302
37303

37304

37305
37306
37307
37308
37309
37310
37311
37312
37313
    /*  95 */ "TypeCheck"        OpHelp("typecheck(r[P1@P2])"),
    /*  96 */ "Affinity"         OpHelp("affinity(r[P1@P2])"),
    /*  97 */ "MakeRecord"       OpHelp("r[P3]=mkrec(r[P1@P2])"),
    /*  98 */ "Count"            OpHelp("r[P2]=count()"),
    /*  99 */ "ReadCookie"       OpHelp(""),
    /* 100 */ "SetCookie"        OpHelp(""),
    /* 101 */ "ReopenIdx"        OpHelp("root=P2 iDb=P3"),
    /* 102 */ "OpenRead"         OpHelp("root=P2 iDb=P3"),
    /* 103 */ "BitAnd"           OpHelp("r[P3]=r[P1]&r[P2]"),
    /* 104 */ "BitOr"            OpHelp("r[P3]=r[P1]|r[P2]"),
    /* 105 */ "ShiftLeft"        OpHelp("r[P3]=r[P2]<<r[P1]"),
    /* 106 */ "ShiftRight"       OpHelp("r[P3]=r[P2]>>r[P1]"),
    /* 107 */ "Add"              OpHelp("r[P3]=r[P1]+r[P2]"),
    /* 108 */ "Subtract"         OpHelp("r[P3]=r[P2]-r[P1]"),
    /* 109 */ "Multiply"         OpHelp("r[P3]=r[P1]*r[P2]"),
    /* 110 */ "Divide"           OpHelp("r[P3]=r[P2]/r[P1]"),
    /* 111 */ "Remainder"        OpHelp("r[P3]=r[P2]%r[P1]"),
    /* 112 */ "Concat"           OpHelp("r[P3]=r[P2]+r[P1]"),

    /* 113 */ "OpenWrite"        OpHelp("root=P2 iDb=P3"),
    /* 114 */ "OpenDup"          OpHelp(""),
    /* 115 */ "BitNot"           OpHelp("r[P2]= ~r[P1]"),

    /* 116 */ "OpenAutoindex"    OpHelp("nColumn=P2"),

    /* 117 */ "OpenEphemeral"    OpHelp("nColumn=P2"),
    /* 118 */ "String8"          OpHelp("r[P2]='P4'"),
    /* 119 */ "SorterOpen"       OpHelp(""),
    /* 120 */ "SequenceTest"     OpHelp("if( cursor[P1].ctr++ ) pc = P2"),
    /* 121 */ "OpenPseudo"       OpHelp("P3 columns in r[P2]"),
    /* 122 */ "Close"            OpHelp(""),
    /* 123 */ "ColumnsUsed"      OpHelp(""),
    /* 124 */ "SeekScan"         OpHelp("Scan-ahead up to P1 rows"),
    /* 125 */ "SeekHit"          OpHelp("set P2<=seekHit<=P3"),
37328
37329
37330
37331
37332
37333
37334

37335
37336
37337
37338
37339
37340
37341
37342
37343
    /* 146 */ "ResetSorter"      OpHelp(""),
    /* 147 */ "CreateBtree"      OpHelp("r[P2]=root iDb=P1 flags=P3"),
    /* 148 */ "SqlExec"          OpHelp(""),
    /* 149 */ "ParseSchema"      OpHelp(""),
    /* 150 */ "LoadAnalysis"     OpHelp(""),
    /* 151 */ "DropTable"        OpHelp(""),
    /* 152 */ "DropIndex"        OpHelp(""),

    /* 153 */ "Real"             OpHelp("r[P2]=P4"),
    /* 154 */ "DropTrigger"      OpHelp(""),
    /* 155 */ "IntegrityCk"      OpHelp(""),
    /* 156 */ "RowSetAdd"        OpHelp("rowset(P1)=r[P2]"),
    /* 157 */ "Param"            OpHelp(""),
    /* 158 */ "FkCounter"        OpHelp("fkctr[P1]+=P2"),
    /* 159 */ "MemMax"           OpHelp("r[P1]=max(r[P1],r[P2])"),
    /* 160 */ "OffsetLimit"      OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
    /* 161 */ "AggInverse"       OpHelp("accum=r[P3] inverse(r[P2@P5])"),







>
|
<







37334
37335
37336
37337
37338
37339
37340
37341
37342

37343
37344
37345
37346
37347
37348
37349
    /* 146 */ "ResetSorter"      OpHelp(""),
    /* 147 */ "CreateBtree"      OpHelp("r[P2]=root iDb=P1 flags=P3"),
    /* 148 */ "SqlExec"          OpHelp(""),
    /* 149 */ "ParseSchema"      OpHelp(""),
    /* 150 */ "LoadAnalysis"     OpHelp(""),
    /* 151 */ "DropTable"        OpHelp(""),
    /* 152 */ "DropIndex"        OpHelp(""),
    /* 153 */ "DropTrigger"      OpHelp(""),
    /* 154 */ "Real"             OpHelp("r[P2]=P4"),

    /* 155 */ "IntegrityCk"      OpHelp(""),
    /* 156 */ "RowSetAdd"        OpHelp("rowset(P1)=r[P2]"),
    /* 157 */ "Param"            OpHelp(""),
    /* 158 */ "FkCounter"        OpHelp("fkctr[P1]+=P2"),
    /* 159 */ "MemMax"           OpHelp("r[P1]=max(r[P1],r[P2])"),
    /* 160 */ "OffsetLimit"      OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
    /* 161 */ "AggInverse"       OpHelp("accum=r[P3] inverse(r[P2@P5])"),
42343
42344
42345
42346
42347
42348
42349
42350
42351
42352
42353
42354
42355
42356
42357
  }else{
    pFile->ctrlFlags |= mask;
  }
}

/* Forward declaration */
static int unixGetTempname(int nBuf, char *zBuf);
#ifndef SQLITE_OMIT_WAL
 static int unixFcntlExternalReader(unixFile*, int*);
#endif

/*
** Information and control of an open file handle.
*/
static int unixFileControl(sqlite3_file *id, int op, void *pArg){







|







42349
42350
42351
42352
42353
42354
42355
42356
42357
42358
42359
42360
42361
42362
42363
  }else{
    pFile->ctrlFlags |= mask;
  }
}

/* Forward declaration */
static int unixGetTempname(int nBuf, char *zBuf);
#if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL)
 static int unixFcntlExternalReader(unixFile*, int*);
#endif

/*
** Information and control of an open file handle.
*/
static int unixFileControl(sqlite3_file *id, int op, void *pArg){
42470
42471
42472
42473
42474
42475
42476
42477
42478
42479
42480
42481
42482
42483
42484
    case SQLITE_FCNTL_SET_LOCKPROXYFILE:
    case SQLITE_FCNTL_GET_LOCKPROXYFILE: {
      return proxyFileControl(id,op,pArg);
    }
#endif /* SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) */

    case SQLITE_FCNTL_EXTERNAL_READER: {
#ifndef SQLITE_OMIT_WAL
      return unixFcntlExternalReader((unixFile*)id, (int*)pArg);
#else
      *(int*)pArg = 0;
      return SQLITE_OK;
#endif
    }
  }







|







42476
42477
42478
42479
42480
42481
42482
42483
42484
42485
42486
42487
42488
42489
42490
    case SQLITE_FCNTL_SET_LOCKPROXYFILE:
    case SQLITE_FCNTL_GET_LOCKPROXYFILE: {
      return proxyFileControl(id,op,pArg);
    }
#endif /* SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) */

    case SQLITE_FCNTL_EXTERNAL_READER: {
#if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL)
      return unixFcntlExternalReader((unixFile*)id, (int*)pArg);
#else
      *(int*)pArg = 0;
      return SQLITE_OK;
#endif
    }
  }
42643
42644
42645
42646
42647
42648
42649
42650
42651
42652
42653
42654
42655
42656
42657
#else
  return (int)sysconf(_SC_PAGESIZE);
#endif
}

#endif /* !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 */

#ifndef SQLITE_OMIT_WAL

/*
** Object used to represent an shared memory buffer.
**
** When multiple threads all reference the same wal-index, each thread
** has its own unixShm object, but they all point to a single instance
** of this unixShmNode object.  In other words, each wal-index is opened







|







42649
42650
42651
42652
42653
42654
42655
42656
42657
42658
42659
42660
42661
42662
42663
#else
  return (int)sysconf(_SC_PAGESIZE);
#endif
}

#endif /* !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 */

#if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL)

/*
** Object used to represent an shared memory buffer.
**
** When multiple threads all reference the same wal-index, each thread
** has its own unixShm object, but they all point to a single instance
** of this unixShmNode object.  In other words, each wal-index is opened
102132
102133
102134
102135
102136
102137
102138
102139
102140
102141

102142
102143

102144














102145
102146
102147
102148
102149
102150
102151
102152
102153
  }
  break;
}
#endif

/* Opcode: Noop * * * * *
**
** Do nothing.  This instruction is often useful as a jump
** destination.
*/

/*
** The magic Explain opcode are only inserted when explain==2 (which

** is to say when the EXPLAIN QUERY PLAN syntax is used.)














** This opcode records information from the optimizer.  It is the
** the same as a no-op.  This opcodesnever appears in a real VM program.
*/
default: {          /* This is really OP_Noop, OP_Explain */
  assert( pOp->opcode==OP_Noop || pOp->opcode==OP_Explain );

  break;
}








|
<

>
|
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|







102138
102139
102140
102141
102142
102143
102144
102145

102146
102147
102148
102149
102150
102151
102152
102153
102154
102155
102156
102157
102158
102159
102160
102161
102162
102163
102164
102165
102166
102167
102168
102169
102170
102171
102172
102173
102174
  }
  break;
}
#endif

/* Opcode: Noop * * * * *
**
** Do nothing.  Continue downward to the next opcode.

*/
/* Opcode: Explain P1 P2 P3 P4 *
**
** This is the same as OP_Noop during normal query execution.  The
** purpose of this opcode is to hold information about the query
** plan for the purpose of EXPLAIN QUERY PLAN output.
**
** The P4 value is human-readable text that describes the query plan
** element.  Something like "SCAN t1" or "SEARCH t2 USING INDEX t2x1".
**
** The P1 value is the ID of the current element and P2 is the parent
** element for the case of nested query plan elements.  If P2 is zero
** then this element is a top-level element.
**
** For loop elements, P3 is the estimated code of each invocation of this
** element.
**
** As with all opcodes, the meanings of the parameters for OP_Explain
** are subject to change from one release to the next.  Applications
** should not attempt to interpret or use any of the information
** contined in the OP_Explain opcode.  The information provided by this
** opcode is intended for testing and debugging use only.
*/
default: {          /* This is really OP_Noop, OP_Explain */
  assert( pOp->opcode==OP_Noop || pOp->opcode==OP_Explain );

  break;
}

106968
106969
106970
106971
106972
106973
106974
106975
106976
106977
106978
106979
106980
106981
106982
106983
106984
106985
106986
106987
106988
106989
106990
106991
106992
106993

/*
** Return TRUE (non-zero) if zTab is a valid name for the schema table pTab.
*/
static SQLITE_NOINLINE int isValidSchemaTableName(
  const char *zTab,         /* Name as it appears in the SQL */
  Table *pTab,              /* The schema table we are trying to match */
  Schema *pSchema           /* non-NULL if a database qualifier is present */
){
  const char *zLegacy;
  assert( pTab!=0 );
  assert( pTab->tnum==1 );
  if( sqlite3StrNICmp(zTab, "sqlite_", 7)!=0 ) return 0;
  zLegacy = pTab->zName;
  if( strcmp(zLegacy+7, &LEGACY_TEMP_SCHEMA_TABLE[7])==0 ){
    if( sqlite3StrICmp(zTab+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){
      return 1;
    }
    if( pSchema==0 ) return 0;
    if( sqlite3StrICmp(zTab+7, &LEGACY_SCHEMA_TABLE[7])==0 ) return 1;
    if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1;
  }else{
    if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1;
  }
  return 0;
}







|










|







106989
106990
106991
106992
106993
106994
106995
106996
106997
106998
106999
107000
107001
107002
107003
107004
107005
107006
107007
107008
107009
107010
107011
107012
107013
107014

/*
** Return TRUE (non-zero) if zTab is a valid name for the schema table pTab.
*/
static SQLITE_NOINLINE int isValidSchemaTableName(
  const char *zTab,         /* Name as it appears in the SQL */
  Table *pTab,              /* The schema table we are trying to match */
  const char *zDb           /* non-NULL if a database qualifier is present */
){
  const char *zLegacy;
  assert( pTab!=0 );
  assert( pTab->tnum==1 );
  if( sqlite3StrNICmp(zTab, "sqlite_", 7)!=0 ) return 0;
  zLegacy = pTab->zName;
  if( strcmp(zLegacy+7, &LEGACY_TEMP_SCHEMA_TABLE[7])==0 ){
    if( sqlite3StrICmp(zTab+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){
      return 1;
    }
    if( zDb==0 ) return 0;
    if( sqlite3StrICmp(zTab+7, &LEGACY_SCHEMA_TABLE[7])==0 ) return 1;
    if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1;
  }else{
    if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1;
  }
  return 0;
}
107162
107163
107164
107165
107166
107167
107168
107169
107170
107171
107172
107173
107174
107175
107176
          }
          if( pItem->zAlias!=0 ){
            if( sqlite3StrICmp(zTab, pItem->zAlias)!=0 ){
              continue;
            }
          }else if( sqlite3StrICmp(zTab, pTab->zName)!=0 ){
            if( pTab->tnum!=1 ) continue;
            if( !isValidSchemaTableName(zTab, pTab, pSchema) ) continue;
          }
          assert( ExprUseYTab(pExpr) );
          if( IN_RENAME_OBJECT && pItem->zAlias ){
            sqlite3RenameTokenRemap(pParse, 0, (void*)&pExpr->y.pTab);
          }
        }
        hCol = sqlite3StrIHash(zCol);







|







107183
107184
107185
107186
107187
107188
107189
107190
107191
107192
107193
107194
107195
107196
107197
          }
          if( pItem->zAlias!=0 ){
            if( sqlite3StrICmp(zTab, pItem->zAlias)!=0 ){
              continue;
            }
          }else if( sqlite3StrICmp(zTab, pTab->zName)!=0 ){
            if( pTab->tnum!=1 ) continue;
            if( !isValidSchemaTableName(zTab, pTab, zDb) ) continue;
          }
          assert( ExprUseYTab(pExpr) );
          if( IN_RENAME_OBJECT && pItem->zAlias ){
            sqlite3RenameTokenRemap(pParse, 0, (void*)&pExpr->y.pTab);
          }
        }
        hCol = sqlite3StrIHash(zCol);
108107
108108
108109
108110
108111
108112
108113

108114
108115
108116
108117
108118
108119
108120
        }else{
          sqlite3WalkSelect(pWalker, pExpr->x.pSelect);
        }
        assert( pNC->nRef>=nRef );
        if( nRef!=pNC->nRef ){
          ExprSetProperty(pExpr, EP_VarSelect);
          pExpr->x.pSelect->selFlags |= SF_Correlated;

        }
        pNC->ncFlags |= NC_Subquery;
      }
      break;
    }
    case TK_VARIABLE: {
      testcase( pNC->ncFlags & NC_IsCheck );







>







108128
108129
108130
108131
108132
108133
108134
108135
108136
108137
108138
108139
108140
108141
108142
        }else{
          sqlite3WalkSelect(pWalker, pExpr->x.pSelect);
        }
        assert( pNC->nRef>=nRef );
        if( nRef!=pNC->nRef ){
          ExprSetProperty(pExpr, EP_VarSelect);
          pExpr->x.pSelect->selFlags |= SF_Correlated;
          if( pExpr->op==TK_EXISTS ) pParse->bHasExists = 1;
        }
        pNC->ncFlags |= NC_Subquery;
      }
      break;
    }
    case TK_VARIABLE: {
      testcase( pNC->ncFlags & NC_IsCheck );
108245
108246
108247
108248
108249
108250
108251
108252
108253
108254
108255
108256
108257
108258
108259
  int i;             /* Loop counter */
  ExprList *pEList;  /* The columns of the result set */
  NameContext nc;    /* Name context for resolving pE */
  sqlite3 *db;       /* Database connection */
  int rc;            /* Return code from subprocedures */
  u8 savedSuppErr;   /* Saved value of db->suppressErr */

  assert( sqlite3ExprIsInteger(pE, &i)==0 );
  pEList = pSelect->pEList;

  /* Resolve all names in the ORDER BY term expression
  */
  memset(&nc, 0, sizeof(nc));
  nc.pParse = pParse;
  nc.pSrcList = pSelect->pSrc;







|







108267
108268
108269
108270
108271
108272
108273
108274
108275
108276
108277
108278
108279
108280
108281
  int i;             /* Loop counter */
  ExprList *pEList;  /* The columns of the result set */
  NameContext nc;    /* Name context for resolving pE */
  sqlite3 *db;       /* Database connection */
  int rc;            /* Return code from subprocedures */
  u8 savedSuppErr;   /* Saved value of db->suppressErr */

  assert( sqlite3ExprIsInteger(pE, &i, 0)==0 );
  pEList = pSelect->pEList;

  /* Resolve all names in the ORDER BY term expression
  */
  memset(&nc, 0, sizeof(nc));
  nc.pParse = pParse;
  nc.pSrcList = pSelect->pSrc;
108344
108345
108346
108347
108348
108349
108350
108351
108352
108353
108354
108355
108356
108357
108358
    assert( pEList!=0 );
    for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
      int iCol = -1;
      Expr *pE, *pDup;
      if( pItem->fg.done ) continue;
      pE = sqlite3ExprSkipCollateAndLikely(pItem->pExpr);
      if( NEVER(pE==0) ) continue;
      if( sqlite3ExprIsInteger(pE, &iCol) ){
        if( iCol<=0 || iCol>pEList->nExpr ){
          resolveOutOfRangeError(pParse, "ORDER", i+1, pEList->nExpr, pE);
          return 1;
        }
      }else{
        iCol = resolveAsName(pParse, pEList, pE);
        if( iCol==0 ){







|







108366
108367
108368
108369
108370
108371
108372
108373
108374
108375
108376
108377
108378
108379
108380
    assert( pEList!=0 );
    for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
      int iCol = -1;
      Expr *pE, *pDup;
      if( pItem->fg.done ) continue;
      pE = sqlite3ExprSkipCollateAndLikely(pItem->pExpr);
      if( NEVER(pE==0) ) continue;
      if( sqlite3ExprIsInteger(pE, &iCol, 0) ){
        if( iCol<=0 || iCol>pEList->nExpr ){
          resolveOutOfRangeError(pParse, "ORDER", i+1, pEList->nExpr, pE);
          return 1;
        }
      }else{
        iCol = resolveAsName(pParse, pEList, pE);
        if( iCol==0 ){
108529
108530
108531
108532
108533
108534
108535
108536
108537
108538
108539
108540
108541
108542
108543
        ** a copy of the iCol-th result-set column.  The subsequent call to
        ** sqlite3ResolveOrderGroupBy() will convert the expression to a
        ** copy of the iCol-th result-set expression. */
        pItem->u.x.iOrderByCol = (u16)iCol;
        continue;
      }
    }
    if( sqlite3ExprIsInteger(pE2, &iCol) ){
      /* The ORDER BY term is an integer constant.  Again, set the column
      ** number so that sqlite3ResolveOrderGroupBy() will convert the
      ** order-by term to a copy of the result-set expression */
      if( iCol<1 || iCol>0xffff ){
        resolveOutOfRangeError(pParse, zType, i+1, nResult, pE2);
        return 1;
      }







|







108551
108552
108553
108554
108555
108556
108557
108558
108559
108560
108561
108562
108563
108564
108565
        ** a copy of the iCol-th result-set column.  The subsequent call to
        ** sqlite3ResolveOrderGroupBy() will convert the expression to a
        ** copy of the iCol-th result-set expression. */
        pItem->u.x.iOrderByCol = (u16)iCol;
        continue;
      }
    }
    if( sqlite3ExprIsInteger(pE2, &iCol, 0) ){
      /* The ORDER BY term is an integer constant.  Again, set the column
      ** number so that sqlite3ResolveOrderGroupBy() will convert the
      ** order-by term to a copy of the result-set expression */
      if( iCol<1 || iCol>0xffff ){
        resolveOutOfRangeError(pParse, zType, i+1, nResult, pE2);
        return 1;
      }
111813
111814
111815
111816
111817
111818
111819




111820
111821
111822
111823
111824
111825
111826
111827
111828
111829
111830
111831
111832
111833
111834
111835
111836
111837
111838
111839
111840
111841
111842
111843
111844
111845
111846




















111847
111848
111849
111850
111851
111852
111853
#endif

/*
** If the expression p codes a constant integer that is small enough
** to fit in a 32-bit integer, return 1 and put the value of the integer
** in *pValue.  If the expression is not an integer or if it is too big
** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.




*/
SQLITE_PRIVATE int sqlite3ExprIsInteger(const Expr *p, int *pValue){
  int rc = 0;
  if( NEVER(p==0) ) return 0;  /* Used to only happen following on OOM */

  /* If an expression is an integer literal that fits in a signed 32-bit
  ** integer, then the EP_IntValue flag will have already been set */
  assert( p->op!=TK_INTEGER || (p->flags & EP_IntValue)!=0
           || sqlite3GetInt32(p->u.zToken, &rc)==0 );

  if( p->flags & EP_IntValue ){
    *pValue = p->u.iValue;
    return 1;
  }
  switch( p->op ){
    case TK_UPLUS: {
      rc = sqlite3ExprIsInteger(p->pLeft, pValue);
      break;
    }
    case TK_UMINUS: {
      int v = 0;
      if( sqlite3ExprIsInteger(p->pLeft, &v) ){
        assert( ((unsigned int)v)!=0x80000000 );
        *pValue = -v;
        rc = 1;
      }
      break;




















    }
    default: break;
  }
  return rc;
}

/*







>
>
>
>

|














|




|





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







111835
111836
111837
111838
111839
111840
111841
111842
111843
111844
111845
111846
111847
111848
111849
111850
111851
111852
111853
111854
111855
111856
111857
111858
111859
111860
111861
111862
111863
111864
111865
111866
111867
111868
111869
111870
111871
111872
111873
111874
111875
111876
111877
111878
111879
111880
111881
111882
111883
111884
111885
111886
111887
111888
111889
111890
111891
111892
111893
111894
111895
111896
111897
111898
111899
#endif

/*
** If the expression p codes a constant integer that is small enough
** to fit in a 32-bit integer, return 1 and put the value of the integer
** in *pValue.  If the expression is not an integer or if it is too big
** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.
**
** If the pParse pointer is provided, then allow the expression p to be
** a parameter (TK_VARIABLE) that is bound to an integer.
** But if pParse is NULL, then p must be a pure integer literal.
*/
SQLITE_PRIVATE int sqlite3ExprIsInteger(const Expr *p, int *pValue, Parse *pParse){
  int rc = 0;
  if( NEVER(p==0) ) return 0;  /* Used to only happen following on OOM */

  /* If an expression is an integer literal that fits in a signed 32-bit
  ** integer, then the EP_IntValue flag will have already been set */
  assert( p->op!=TK_INTEGER || (p->flags & EP_IntValue)!=0
           || sqlite3GetInt32(p->u.zToken, &rc)==0 );

  if( p->flags & EP_IntValue ){
    *pValue = p->u.iValue;
    return 1;
  }
  switch( p->op ){
    case TK_UPLUS: {
      rc = sqlite3ExprIsInteger(p->pLeft, pValue, 0);
      break;
    }
    case TK_UMINUS: {
      int v = 0;
      if( sqlite3ExprIsInteger(p->pLeft, &v, 0) ){
        assert( ((unsigned int)v)!=0x80000000 );
        *pValue = -v;
        rc = 1;
      }
      break;
    }
    case TK_VARIABLE: {
      sqlite3_value *pVal;
      if( pParse==0 ) break;
      if( NEVER(pParse->pVdbe==0) ) break;
      if( (pParse->db->flags & SQLITE_EnableQPSG)!=0 ) break;
      sqlite3VdbeSetVarmask(pParse->pVdbe, p->iColumn);
      pVal = sqlite3VdbeGetBoundValue(pParse->pReprepare, p->iColumn,
                                      SQLITE_AFF_BLOB);
      if( pVal ){
        if( sqlite3_value_type(pVal)==SQLITE_INTEGER ){
          sqlite3_int64 vv = sqlite3_value_int64(pVal);
          if( vv == (vv & 0x7fffffff) ){ /* non-negative numbers only */
            *pValue = (int)vv;
            rc = 1;
          }
        }
        sqlite3ValueFree(pVal);
      }
      break;
    }
    default: break;
  }
  return rc;
}

/*
126428
126429
126430
126431
126432
126433
126434
126435
126436

126437
126438
126439
126440
126441
126442


126443
126444
126445
126446
126447
126448
126449

/*
** Append the contents of SrcList p2 to SrcList p1 and return the resulting
** SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2
** are deleted by this function.
*/
SQLITE_PRIVATE SrcList *sqlite3SrcListAppendList(Parse *pParse, SrcList *p1, SrcList *p2){
  assert( p1 && p1->nSrc==1 );
  if( p2 ){

    SrcList *pNew = sqlite3SrcListEnlarge(pParse, p1, p2->nSrc, 1);
    if( pNew==0 ){
      sqlite3SrcListDelete(pParse->db, p2);
    }else{
      p1 = pNew;
      memcpy(&p1->a[1], p2->a, p2->nSrc*sizeof(SrcItem));


      sqlite3DbFree(pParse->db, p2);
      p1->a[0].fg.jointype |= (JT_LTORJ & p1->a[1].fg.jointype);
    }
  }
  return p1;
}








|

>
|




|
>
>







126474
126475
126476
126477
126478
126479
126480
126481
126482
126483
126484
126485
126486
126487
126488
126489
126490
126491
126492
126493
126494
126495
126496
126497
126498

/*
** Append the contents of SrcList p2 to SrcList p1 and return the resulting
** SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2
** are deleted by this function.
*/
SQLITE_PRIVATE SrcList *sqlite3SrcListAppendList(Parse *pParse, SrcList *p1, SrcList *p2){
  assert( p1 );
  if( p2 ){
    int nOld = p1->nSrc;
    SrcList *pNew = sqlite3SrcListEnlarge(pParse, p1, p2->nSrc, nOld);
    if( pNew==0 ){
      sqlite3SrcListDelete(pParse->db, p2);
    }else{
      p1 = pNew;
      memcpy(&p1->a[nOld], p2->a, p2->nSrc*sizeof(SrcItem));
      assert( nOld==1 || (p2->nSrc==1 && (p2->a[0].fg.jointype&JT_LTORJ)==0) );
      assert( p1->nSrc>=2 );
      sqlite3DbFree(pParse->db, p2);
      p1->a[0].fg.jointype |= (JT_LTORJ & p1->a[1].fg.jointype);
    }
  }
  return p1;
}

131207
131208
131209
131210
131211
131212
131213

131214
131215
131216
131217
131218
131219
131220
  int y, z;
  char zBuf[100];
  UNUSED_PARAMETER(argc);
  assert( argc==3 );
  x = sqlite3_value_double(argv[0]);
  y = sqlite3_value_int(argv[1]);
  z = sqlite3_value_int(argv[2]);

  sqlite3FpDecode(&s, x, y, z);
  if( s.isSpecial==2 ){
    sqlite3_snprintf(sizeof(zBuf), zBuf, "NaN");
  }else{
    sqlite3_snprintf(sizeof(zBuf), zBuf, "%c%.*s/%d", s.sign, s.n, s.z, s.iDP);
  }
  sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);







>







131256
131257
131258
131259
131260
131261
131262
131263
131264
131265
131266
131267
131268
131269
131270
  int y, z;
  char zBuf[100];
  UNUSED_PARAMETER(argc);
  assert( argc==3 );
  x = sqlite3_value_double(argv[0]);
  y = sqlite3_value_int(argv[1]);
  z = sqlite3_value_int(argv[2]);
  if( z<=0 ) z = 1;
  sqlite3FpDecode(&s, x, y, z);
  if( s.isSpecial==2 ){
    sqlite3_snprintf(sizeof(zBuf), zBuf, "NaN");
  }else{
    sqlite3_snprintf(sizeof(zBuf), zBuf, "%c%.*s/%d", s.sign, s.n, s.z, s.iDP);
  }
  sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
145395
145396
145397
145398
145399
145400
145401
145402
145403
145404
145405
145406
145407
145408
145409
  */
  if( pLimit ){
    assert( pLimit->op==TK_LIMIT );
    assert( pLimit->pLeft!=0 );
    p->iLimit = iLimit = ++pParse->nMem;
    v = sqlite3GetVdbe(pParse);
    assert( v!=0 );
    if( sqlite3ExprIsInteger(pLimit->pLeft, &n) ){
      sqlite3VdbeAddOp2(v, OP_Integer, n, iLimit);
      VdbeComment((v, "LIMIT counter"));
      if( n==0 ){
        sqlite3VdbeGoto(v, iBreak);
      }else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){
        p->nSelectRow = sqlite3LogEst((u64)n);
        p->selFlags |= SF_FixedLimit;







|







145445
145446
145447
145448
145449
145450
145451
145452
145453
145454
145455
145456
145457
145458
145459
  */
  if( pLimit ){
    assert( pLimit->op==TK_LIMIT );
    assert( pLimit->pLeft!=0 );
    p->iLimit = iLimit = ++pParse->nMem;
    v = sqlite3GetVdbe(pParse);
    assert( v!=0 );
    if( sqlite3ExprIsInteger(pLimit->pLeft, &n, pParse) ){
      sqlite3VdbeAddOp2(v, OP_Integer, n, iLimit);
      VdbeComment((v, "LIMIT counter"));
      if( n==0 ){
        sqlite3VdbeGoto(v, iBreak);
      }else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){
        p->nSelectRow = sqlite3LogEst((u64)n);
        p->selFlags |= SF_FixedLimit;
145875
145876
145877
145878
145879
145880
145881
145882
145883
145884
145885
145886
145887
145888
145889
        TREETRACE(0x200, pParse, p, ("multiSelect UNION ALL right...\n"));
        rc = sqlite3Select(pParse, p, &dest);
        testcase( rc!=SQLITE_OK );
        pDelete = p->pPrior;
        p->pPrior = pPrior;
        p->nSelectRow = sqlite3LogEstAdd(p->nSelectRow, pPrior->nSelectRow);
        if( p->pLimit
         && sqlite3ExprIsInteger(p->pLimit->pLeft, &nLimit)
         && nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit)
        ){
          p->nSelectRow = sqlite3LogEst((u64)nLimit);
        }
        if( addr ){
          sqlite3VdbeJumpHere(v, addr);
        }







|







145925
145926
145927
145928
145929
145930
145931
145932
145933
145934
145935
145936
145937
145938
145939
        TREETRACE(0x200, pParse, p, ("multiSelect UNION ALL right...\n"));
        rc = sqlite3Select(pParse, p, &dest);
        testcase( rc!=SQLITE_OK );
        pDelete = p->pPrior;
        p->pPrior = pPrior;
        p->nSelectRow = sqlite3LogEstAdd(p->nSelectRow, pPrior->nSelectRow);
        if( p->pLimit
         && sqlite3ExprIsInteger(p->pLimit->pLeft, &nLimit, pParse)
         && nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit)
        ){
          p->nSelectRow = sqlite3LogEst((u64)nLimit);
        }
        if( addr ){
          sqlite3VdbeJumpHere(v, addr);
        }
150185
150186
150187
150188
150189
150190
150191
























































































































































150192
150193
150194
150195
150196
150197
150198
    if( i==0 ) break;
    i--;
    pItem--;
    if( pItem->pSelect!=0 ) return 0;                             /* (1c-i) */
  }
  return 1;
}

























































































































































/*
** Generate code for the SELECT statement given in the p argument.
**
** The results are returned according to the SelectDest structure.
** See comments in sqliteInt.h for further information.
**







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







150235
150236
150237
150238
150239
150240
150241
150242
150243
150244
150245
150246
150247
150248
150249
150250
150251
150252
150253
150254
150255
150256
150257
150258
150259
150260
150261
150262
150263
150264
150265
150266
150267
150268
150269
150270
150271
150272
150273
150274
150275
150276
150277
150278
150279
150280
150281
150282
150283
150284
150285
150286
150287
150288
150289
150290
150291
150292
150293
150294
150295
150296
150297
150298
150299
150300
150301
150302
150303
150304
150305
150306
150307
150308
150309
150310
150311
150312
150313
150314
150315
150316
150317
150318
150319
150320
150321
150322
150323
150324
150325
150326
150327
150328
150329
150330
150331
150332
150333
150334
150335
150336
150337
150338
150339
150340
150341
150342
150343
150344
150345
150346
150347
150348
150349
150350
150351
150352
150353
150354
150355
150356
150357
150358
150359
150360
150361
150362
150363
150364
150365
150366
150367
150368
150369
150370
150371
150372
150373
150374
150375
150376
150377
150378
150379
150380
150381
150382
150383
150384
150385
150386
150387
150388
150389
150390
150391
150392
150393
150394
150395
150396
150397
150398
150399
150400
    if( i==0 ) break;
    i--;
    pItem--;
    if( pItem->pSelect!=0 ) return 0;                             /* (1c-i) */
  }
  return 1;
}

/*
** sqlite3WalkExpr() callback used by exprReferencesTable().
*/
static int exprReferencesTableExprCb(Walker *pWalker, Expr *pExpr){
  if( pExpr->op==TK_COLUMN && pExpr->iTable==pWalker->u.iCur ){
    pWalker->eCode = 1;
  }
  return WRC_Continue;
}

/*
** Return true if the expression passed as the first argument refers
** to cursor number iCur. Otherwise return false.
*/
static int exprReferencesTable(Expr *pExpr, int iCur){
  Walker w;
  memset(&w, 0, sizeof(w));
  w.u.iCur = iCur;
  w.xExprCallback = exprReferencesTableExprCb;
  w.xSelectCallback = sqlite3SelectWalkNoop;
  sqlite3WalkExpr(&w, pExpr);
  return w.eCode;
}

/*
** Index pIdx is a UNIQUE index on the table accessed by cursor number
** iCsr. This function returns a mask of the index columns that are
** constrained to match a single, non-NULL value by the WHERE clause
** passed as the 4th argument. For example, if the index is:
**
**      CREATE UNIQUE INDEX idx ON tbl(a, b, c);
**
** and pWhere:
**
**      WHERE a=? AND c=?
**
** then this function returns 5.
*/
static u64 findConstIdxTerms(
  Parse *pParse,
  int iCsr,
  Index *pIdx,
  Expr *pWhere
){
  u64 m = 0;
  if( pWhere->op==TK_AND ){
    m = findConstIdxTerms(pParse, iCsr, pIdx, pWhere->pLeft);
    m |= findConstIdxTerms(pParse, iCsr, pIdx, pWhere->pRight);
  }else if( pWhere->op==TK_EQ ){
    Expr *pLeft = sqlite3ExprSkipCollateAndLikely(pWhere->pLeft);
    Expr *pRight = sqlite3ExprSkipCollateAndLikely(pWhere->pRight);
    if( pRight->op==TK_COLUMN && pRight->iTable==iCsr ){
      SWAP(Expr*, pLeft, pRight);
    }
    if( pLeft->op==TK_COLUMN
     && pLeft->iTable==iCsr
     && exprReferencesTable(pRight, iCsr)==0
    ){
      if( pIdx ){
        int ii;
        for(ii=0; ii<pIdx->nKeyCol; ii++){
          assert( pIdx->azColl[ii] );
          if( pLeft->iColumn==pIdx->aiColumn[ii] ){
            CollSeq *pColl = sqlite3ExprCompareCollSeq(pParse, pWhere);
            if( pColl && sqlite3StrICmp(pColl->zName, pIdx->azColl[ii])==0 ){
              m |= ((u64)1 << ii);
              break;
            }
          }
        }
      }else{
        if( pLeft->iColumn<0 ) m = 1;
      }
    }
  }
  return m;
}

/*
** Argument pWhere is the WHERE clause belonging to SELECT statement p. This
** function attempts to transform expressions of the form:
**
**     EXISTS (SELECT ...)
**
** into joins. For example, given
**
**    CREATE TABLE sailors(sid INTEGER PRIMARY KEY, name TEXT);
**    CREATE TABLE reserves(sid INT, day DATE, PRIMARY KEY(sid, day));
**
**    SELECT name FROM sailors AS S WHERE EXISTS (
**      SELECT * FROM reserves AS R WHERE S.sid = R.sid AND R.day = '2022-10-25'
**    );
**
** the SELECT statement may be transformed as follows:
**
**    SELECT name FROM sailors AS S, reserves AS R
**      WHERE S.sid = R.sid AND R.day = '2022-10-25';
*/
static void existsToJoin(Parse *pParse, Select *p, Expr *pWhere){
  if( pWhere && p->pSrc->nSrc>0 && pParse->db->mallocFailed==0 ){
    if( pWhere->op==TK_AND ){
      Expr *pRight = pWhere->pRight;
      existsToJoin(pParse, p, pWhere->pLeft);
      existsToJoin(pParse, p, pRight);
    }
    else if( pWhere->op==TK_EXISTS ){
      Select *pSub = pWhere->x.pSelect;
      if( pSub->pSrc->nSrc==1
       && (pSub->selFlags & (SF_Aggregate|SF_Correlated))==SF_Correlated
       && pSub->pWhere
      ){
        int bTransform = 0;       /* True if EXISTS can be made into join */
        Table *pTab = pSub->pSrc->a[0].pTab;
        int iCsr = pSub->pSrc->a[0].iCursor;
        Index *pIdx;
        if( HasRowid(pTab) && findConstIdxTerms(pParse, iCsr, 0,pSub->pWhere) ){
          bTransform = 1;
        }
        for(pIdx=pTab->pIndex; pIdx && bTransform==0; pIdx=pIdx->pNext){
          if( pIdx->onError && pIdx->nKeyCol<=63 ){
            u64 c = findConstIdxTerms(pParse, iCsr, pIdx, pSub->pWhere);
            if( c==((u64)1 << pIdx->nKeyCol)-1 ){
              bTransform = 1;
            }
          }
        }
        if( bTransform ){
          memset(pWhere, 0, sizeof(*pWhere));
          pWhere->op = TK_INTEGER;
          pWhere->u.iValue = 1;
          ExprSetProperty(pWhere, EP_IntValue);

          assert( p->pWhere!=0 );
          p->pSrc = sqlite3SrcListAppendList(pParse, p->pSrc, pSub->pSrc);
          p->pWhere = sqlite3PExpr(pParse, TK_AND, p->pWhere, pSub->pWhere);

          pSub->pWhere = 0;
          pSub->pSrc = 0;
          sqlite3ParserAddCleanup(pParse, sqlite3SelectDeleteGeneric, pSub);
#if TREETRACE_ENABLED
          if( sqlite3TreeTrace & 0x100000 ){
            TREETRACE(0x100000,pParse,p,
                      ("After EXISTS-to-JOIN optimization:\n"));
            sqlite3TreeViewSelect(0, p, 0);
          }
#endif
        }
      }
    }
  }
}

/*
** Generate code for the SELECT statement given in the p argument.
**
** The results are returned according to the SelectDest structure.
** See comments in sqliteInt.h for further information.
**
150511
150512
150513
150514
150515
150516
150517







150518
150519
150520
150521
150522
150523
150524
      sqlite3TreeViewSelect(0, p, 0);
    }
#endif
    if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
    return rc;
  }
#endif








  /* Do the WHERE-clause constant propagation optimization if this is
  ** a join.  No need to speed time on this operation for non-join queries
  ** as the equivalent optimization will be handled by query planner in
  ** sqlite3WhereBegin().
  */
  if( p->pWhere!=0







>
>
>
>
>
>
>







150713
150714
150715
150716
150717
150718
150719
150720
150721
150722
150723
150724
150725
150726
150727
150728
150729
150730
150731
150732
150733
      sqlite3TreeViewSelect(0, p, 0);
    }
#endif
    if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
    return rc;
  }
#endif

  /* If there may be an "EXISTS (SELECT ...)" in the WHERE clause, attempt
  ** to change it into a join.  */
  if( pParse->bHasExists && OptimizationEnabled(db,SQLITE_ExistsToJoin) ){
    existsToJoin(pParse, p, p->pWhere);
    pTabList = p->pSrc;
  }

  /* Do the WHERE-clause constant propagation optimization if this is
  ** a join.  No need to speed time on this operation for non-join queries
  ** as the equivalent optimization will be handled by query planner in
  ** sqlite3WhereBegin().
  */
  if( p->pWhere!=0
151234
151235
151236
151237
151238
151239
151240



151241

151242
151243
151244
151245
151246
151247
151248
          sqlite3VdbeAddOp3(v, OP_Column, sortPTab, j, iBMem+j);
        }else{
          pAggInfo->directMode = 1;
          sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j);
        }

        if( iOrderByCol ){



          sqlite3ExprToRegister(p->pEList->a[iOrderByCol-1].pExpr, iAMem+j);

        }
      }
      sqlite3VdbeAddOp4(v, OP_Compare, iAMem, iBMem, pGroupBy->nExpr,
                          (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO);
      addr1 = sqlite3VdbeCurrentAddr(v);
      sqlite3VdbeAddOp3(v, OP_Jump, addr1+1, 0, addr1+1); VdbeCoverage(v);








>
>
>
|
>







151443
151444
151445
151446
151447
151448
151449
151450
151451
151452
151453
151454
151455
151456
151457
151458
151459
151460
151461
          sqlite3VdbeAddOp3(v, OP_Column, sortPTab, j, iBMem+j);
        }else{
          pAggInfo->directMode = 1;
          sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j);
        }

        if( iOrderByCol ){
          Expr *pX = p->pEList->a[iOrderByCol-1].pExpr;
          Expr *pBase = sqlite3ExprSkipCollateAndLikely(pX);
          if( ALWAYS(pBase!=0) && pBase->op!=TK_AGG_COLUMN ){
            sqlite3ExprToRegister(pX, iAMem+j);
          }
        }
      }
      sqlite3VdbeAddOp4(v, OP_Compare, iAMem, iBMem, pGroupBy->nExpr,
                          (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO);
      addr1 = sqlite3VdbeCurrentAddr(v);
      sqlite3VdbeAddOp3(v, OP_Jump, addr1+1, 0, addr1+1); VdbeCoverage(v);

157656
157657
157658
157659
157660
157661
157662
157663

157664
157665
157666
157667
157668
157669
157670
    }else{
      sqlite3_str_append(&str, " (~1 row)", 9);
    }
#endif
    zMsg = sqlite3StrAccumFinish(&str);
    sqlite3ExplainBreakpoint("",zMsg);
    ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v),
                            pParse->addrExplain, 0, zMsg,P4_DYNAMIC);

  }
  return ret;
}

/*
** Add a single OP_Explain opcode that describes a Bloom filter.
**







|
>







157869
157870
157871
157872
157873
157874
157875
157876
157877
157878
157879
157880
157881
157882
157883
157884
    }else{
      sqlite3_str_append(&str, " (~1 row)", 9);
    }
#endif
    zMsg = sqlite3StrAccumFinish(&str);
    sqlite3ExplainBreakpoint("",zMsg);
    ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v),
                            pParse->addrExplain, pLoop->rRun,
                            zMsg, P4_DYNAMIC);
  }
  return ret;
}

/*
** Add a single OP_Explain opcode that describes a Bloom filter.
**
158040
158041
158042
158043
158044
158045
158046













































































































































158047
158048
158049
158050
158051
158052
158053
      sqlite3TreeViewExpr(0, pNew, 0);
#endif
    }
  }
  return pNew;
}















































































































































/*
** Generate code for a single equality term of the WHERE clause.  An equality
** term can be either X=expr or X IN (...).   pTerm is the term to be
** coded.
**
** The current value for the constraint is left in a register, the index







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







158254
158255
158256
158257
158258
158259
158260
158261
158262
158263
158264
158265
158266
158267
158268
158269
158270
158271
158272
158273
158274
158275
158276
158277
158278
158279
158280
158281
158282
158283
158284
158285
158286
158287
158288
158289
158290
158291
158292
158293
158294
158295
158296
158297
158298
158299
158300
158301
158302
158303
158304
158305
158306
158307
158308
158309
158310
158311
158312
158313
158314
158315
158316
158317
158318
158319
158320
158321
158322
158323
158324
158325
158326
158327
158328
158329
158330
158331
158332
158333
158334
158335
158336
158337
158338
158339
158340
158341
158342
158343
158344
158345
158346
158347
158348
158349
158350
158351
158352
158353
158354
158355
158356
158357
158358
158359
158360
158361
158362
158363
158364
158365
158366
158367
158368
158369
158370
158371
158372
158373
158374
158375
158376
158377
158378
158379
158380
158381
158382
158383
158384
158385
158386
158387
158388
158389
158390
158391
158392
158393
158394
158395
158396
158397
158398
158399
158400
158401
158402
158403
158404
158405
158406
158407
158408
      sqlite3TreeViewExpr(0, pNew, 0);
#endif
    }
  }
  return pNew;
}


#ifndef SQLITE_OMIT_SUBQUERY
/*
** Generate code for a single X IN (....) term of the WHERE clause.
**
** This is a special-case of codeEqualityTerm() that works for IN operators
** only.  It is broken out into a subroutine because this case is
** uncommon and by splitting it off into a subroutine, the common case
** runs faster.
**
** The current value for the constraint is left in  register iTarget.
** This routine sets up a loop that will iterate over all values of X.
*/
static SQLITE_NOINLINE void codeINTerm(
  Parse *pParse,      /* The parsing context */
  WhereTerm *pTerm,   /* The term of the WHERE clause to be coded */
  WhereLevel *pLevel, /* The level of the FROM clause we are working on */
  int iEq,            /* Index of the equality term within this level */
  int bRev,           /* True for reverse-order IN operations */
  int iTarget         /* Attempt to leave results in this register */
){
  Expr *pX = pTerm->pExpr;
  int eType = IN_INDEX_NOOP;
  int iTab;
  struct InLoop *pIn;
  WhereLoop *pLoop = pLevel->pWLoop;
  Vdbe *v = pParse->pVdbe;
  int i;
  int nEq = 0;
  int *aiMap = 0;

  if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0
    && pLoop->u.btree.pIndex!=0
    && pLoop->u.btree.pIndex->aSortOrder[iEq]
  ){
    testcase( iEq==0 );
    testcase( bRev );
    bRev = !bRev;
  }
  assert( pX->op==TK_IN );

  for(i=0; i<iEq; i++){
    if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){
      disableTerm(pLevel, pTerm);
      return;
    }
  }
  for(i=iEq;i<pLoop->nLTerm; i++){
    assert( pLoop->aLTerm[i]!=0 );
    if( pLoop->aLTerm[i]->pExpr==pX ) nEq++;
  }

  iTab = 0;
  if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){
    eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab);
  }else{
    Expr *pExpr = pTerm->pExpr;
    if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){
      sqlite3 *db = pParse->db;
      pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX);
      if( !db->mallocFailed ){
        aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq);
        eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap,&iTab);
        pExpr->iTable = iTab;
      }
      sqlite3ExprDelete(db, pX);
    }else{
      int n = sqlite3ExprVectorSize(pX->pLeft);
      aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n));
      eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab);
    }
    pX = pExpr;
  }

  if( eType==IN_INDEX_INDEX_DESC ){
    testcase( bRev );
    bRev = !bRev;
  }
  sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0);
  VdbeCoverageIf(v, bRev);
  VdbeCoverageIf(v, !bRev);

  assert( (pLoop->wsFlags & WHERE_MULTI_OR)==0 );
  pLoop->wsFlags |= WHERE_IN_ABLE;
  if( pLevel->u.in.nIn==0 ){
    pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse);
  }
  if( iEq>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 ){
    pLoop->wsFlags |= WHERE_IN_EARLYOUT;
  }

  i = pLevel->u.in.nIn;
  pLevel->u.in.nIn += nEq;
  pLevel->u.in.aInLoop =
     sqlite3WhereRealloc(pTerm->pWC->pWInfo,
                         pLevel->u.in.aInLoop,
                         sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn);
  pIn = pLevel->u.in.aInLoop;
  if( pIn ){
    int iMap = 0;               /* Index in aiMap[] */
    pIn += i;
    for(i=iEq;i<pLoop->nLTerm; i++){
      if( pLoop->aLTerm[i]->pExpr==pX ){
        int iOut = iTarget + i - iEq;
        if( eType==IN_INDEX_ROWID ){
          pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
        }else{
          int iCol = aiMap ? aiMap[iMap++] : 0;
          pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut);
        }
        sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v);
        if( i==iEq ){
          pIn->iCur = iTab;
          pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next;
          if( iEq>0 ){
            pIn->iBase = iTarget - i;
            pIn->nPrefix = i;
          }else{
            pIn->nPrefix = 0;
          }
        }else{
          pIn->eEndLoopOp = OP_Noop;
        }
        pIn++;
      }
    }
    testcase( iEq>0
              && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0
              && (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 );
    if( iEq>0
     && (pLoop->wsFlags & (WHERE_IN_SEEKSCAN|WHERE_VIRTUALTABLE))==0
    ){
      sqlite3VdbeAddOp3(v, OP_SeekHit, pLevel->iIdxCur, 0, iEq);
    }
  }else{
    pLevel->u.in.nIn = 0;
  }
  sqlite3DbFree(pParse->db, aiMap);
}
#endif


/*
** Generate code for a single equality term of the WHERE clause.  An equality
** term can be either X=expr or X IN (...).   pTerm is the term to be
** coded.
**
** The current value for the constraint is left in a register, the index
158065
158066
158067
158068
158069
158070
158071
158072
158073
158074
158075
158076
158077
158078
158079
158080
158081
158082
158083
158084
158085
158086
158087
158088
158089
158090
158091
158092
158093
158094
158095
158096
158097
158098
158099
158100
158101
158102
158103
158104
158105
158106
158107
158108
158109
158110
158111
158112
158113
158114
158115
158116
158117
158118
158119
158120
158121
158122
158123
158124
158125
158126
158127
158128
158129
158130
158131
158132
158133
158134
158135
158136
158137
158138
158139
158140
158141
158142
158143
158144
158145
158146
158147
158148
158149
158150
158151
158152
158153
158154
158155
158156
158157
158158
158159
158160
158161
158162
158163
158164
158165
158166
158167
158168
158169
158170
158171
158172
158173
158174
158175
158176
158177
158178
158179
158180
158181
158182
158183
158184
158185
158186
158187
158188
158189
158190
158191
158192
158193
158194
158195
158196
158197
158198
158199
158200
158201
158202
158203
158204
158205
158206
  WhereTerm *pTerm,   /* The term of the WHERE clause to be coded */
  WhereLevel *pLevel, /* The level of the FROM clause we are working on */
  int iEq,            /* Index of the equality term within this level */
  int bRev,           /* True for reverse-order IN operations */
  int iTarget         /* Attempt to leave results in this register */
){
  Expr *pX = pTerm->pExpr;
  Vdbe *v = pParse->pVdbe;
  int iReg;                  /* Register holding results */

  assert( pLevel->pWLoop->aLTerm[iEq]==pTerm );
  assert( iTarget>0 );
  if( pX->op==TK_EQ || pX->op==TK_IS ){
    iReg = sqlite3ExprCodeTarget(pParse, pX->pRight, iTarget);
  }else if( pX->op==TK_ISNULL ){
    iReg = iTarget;
    sqlite3VdbeAddOp2(v, OP_Null, 0, iReg);
#ifndef SQLITE_OMIT_SUBQUERY
  }else{
    int eType = IN_INDEX_NOOP;
    int iTab;
    struct InLoop *pIn;
    WhereLoop *pLoop = pLevel->pWLoop;
    int i;
    int nEq = 0;
    int *aiMap = 0;

    if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0
      && pLoop->u.btree.pIndex!=0
      && pLoop->u.btree.pIndex->aSortOrder[iEq]
    ){
      testcase( iEq==0 );
      testcase( bRev );
      bRev = !bRev;
    }
    assert( pX->op==TK_IN );
    iReg = iTarget;

    for(i=0; i<iEq; i++){
      if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){
        disableTerm(pLevel, pTerm);
        return iTarget;
      }
    }
    for(i=iEq;i<pLoop->nLTerm; i++){
      assert( pLoop->aLTerm[i]!=0 );
      if( pLoop->aLTerm[i]->pExpr==pX ) nEq++;
    }

    iTab = 0;
    if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){
      eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab);
    }else{
      Expr *pExpr = pTerm->pExpr;
      if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){
        sqlite3 *db = pParse->db;
        pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX);
        if( !db->mallocFailed ){
          aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq);
          eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap,&iTab);
          pExpr->iTable = iTab;
        }
        sqlite3ExprDelete(db, pX);
      }else{
        int n = sqlite3ExprVectorSize(pX->pLeft);
        aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n));
        eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab);
      }
      pX = pExpr;
    }

    if( eType==IN_INDEX_INDEX_DESC ){
      testcase( bRev );
      bRev = !bRev;
    }
    sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0);
    VdbeCoverageIf(v, bRev);
    VdbeCoverageIf(v, !bRev);

    assert( (pLoop->wsFlags & WHERE_MULTI_OR)==0 );
    pLoop->wsFlags |= WHERE_IN_ABLE;
    if( pLevel->u.in.nIn==0 ){
      pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse);
    }
    if( iEq>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 ){
      pLoop->wsFlags |= WHERE_IN_EARLYOUT;
    }

    i = pLevel->u.in.nIn;
    pLevel->u.in.nIn += nEq;
    pLevel->u.in.aInLoop =
       sqlite3WhereRealloc(pTerm->pWC->pWInfo,
                           pLevel->u.in.aInLoop,
                           sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn);
    pIn = pLevel->u.in.aInLoop;
    if( pIn ){
      int iMap = 0;               /* Index in aiMap[] */
      pIn += i;
      for(i=iEq;i<pLoop->nLTerm; i++){
        if( pLoop->aLTerm[i]->pExpr==pX ){
          int iOut = iReg + i - iEq;
          if( eType==IN_INDEX_ROWID ){
            pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
          }else{
            int iCol = aiMap ? aiMap[iMap++] : 0;
            pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut);
          }
          sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v);
          if( i==iEq ){
            pIn->iCur = iTab;
            pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next;
            if( iEq>0 ){
              pIn->iBase = iReg - i;
              pIn->nPrefix = i;
            }else{
              pIn->nPrefix = 0;
            }
          }else{
            pIn->eEndLoopOp = OP_Noop;
          }
          pIn++;
        }
      }
      testcase( iEq>0
                && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0
                && (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 );
      if( iEq>0
       && (pLoop->wsFlags & (WHERE_IN_SEEKSCAN|WHERE_VIRTUALTABLE))==0
      ){
        sqlite3VdbeAddOp3(v, OP_SeekHit, pLevel->iIdxCur, 0, iEq);
      }
    }else{
      pLevel->u.in.nIn = 0;
    }
    sqlite3DbFree(pParse->db, aiMap);
#endif
  }

  /* As an optimization, try to disable the WHERE clause term that is
  ** driving the index as it will always be true.  The correct answer is
  ** obtained regardless, but we might get the answer with fewer CPU cycles
  ** by omitting the term.







<








|


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







158420
158421
158422
158423
158424
158425
158426

158427
158428
158429
158430
158431
158432
158433
158434
158435
158436
158437
















158438
158439
158440

































































































158441
158442
158443
158444
158445
158446
158447
  WhereTerm *pTerm,   /* The term of the WHERE clause to be coded */
  WhereLevel *pLevel, /* The level of the FROM clause we are working on */
  int iEq,            /* Index of the equality term within this level */
  int bRev,           /* True for reverse-order IN operations */
  int iTarget         /* Attempt to leave results in this register */
){
  Expr *pX = pTerm->pExpr;

  int iReg;                  /* Register holding results */

  assert( pLevel->pWLoop->aLTerm[iEq]==pTerm );
  assert( iTarget>0 );
  if( pX->op==TK_EQ || pX->op==TK_IS ){
    iReg = sqlite3ExprCodeTarget(pParse, pX->pRight, iTarget);
  }else if( pX->op==TK_ISNULL ){
    iReg = iTarget;
    sqlite3VdbeAddOp2(pParse->pVdbe, OP_Null, 0, iReg);
#ifndef SQLITE_OMIT_SUBQUERY
  }else{
















    assert( pX->op==TK_IN );
    iReg = iTarget;
    codeINTerm(pParse, pTerm, pLevel, iEq, bRev, iTarget);

































































































#endif
  }

  /* As an optimization, try to disable the WHERE clause term that is
  ** driving the index as it will always be true.  The correct answer is
  ** obtained regardless, but we might get the answer with fewer CPU cycles
  ** by omitting the term.
160401
160402
160403
160404
160405
160406
160407





160408
160409
160410
160411
160412
160413
160414
160415
** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL"
*/
static int allowedOp(int op){
  assert( TK_GT>TK_EQ && TK_GT<TK_GE );
  assert( TK_LT>TK_EQ && TK_LT<TK_GE );
  assert( TK_LE>TK_EQ && TK_LE<TK_GE );
  assert( TK_GE==TK_EQ+4 );





  return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS;
}

/*
** Commute a comparison operator.  Expressions of the form "X op Y"
** are converted into "Y op X".
*/
static u16 exprCommute(Parse *pParse, Expr *pExpr){







>
>
>
>
>
|







160642
160643
160644
160645
160646
160647
160648
160649
160650
160651
160652
160653
160654
160655
160656
160657
160658
160659
160660
160661
** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL"
*/
static int allowedOp(int op){
  assert( TK_GT>TK_EQ && TK_GT<TK_GE );
  assert( TK_LT>TK_EQ && TK_LT<TK_GE );
  assert( TK_LE>TK_EQ && TK_LE<TK_GE );
  assert( TK_GE==TK_EQ+4 );
  assert( TK_IN<TK_EQ );
  assert( TK_IS<TK_EQ );
  assert( TK_ISNULL<TK_EQ );
  if( op>TK_GE ) return 0;
  if( op>=TK_EQ ) return 1;
  return op==TK_IN || op==TK_ISNULL || op==TK_IS;
}

/*
** Commute a comparison operator.  Expressions of the form "X op Y"
** are converted into "Y op X".
*/
static u16 exprCommute(Parse *pParse, Expr *pExpr){
160434
160435
160436
160437
160438
160439
160440



160441
160442
160443
160444

160445
160446
160447
160448
160449
160450
160451
160452
160453
160454
160455
160456

/*
** Translate from TK_xx operator to WO_xx bitmask.
*/
static u16 operatorMask(int op){
  u16 c;
  assert( allowedOp(op) );



  if( op==TK_IN ){
    c = WO_IN;
  }else if( op==TK_ISNULL ){
    c = WO_ISNULL;

  }else if( op==TK_IS ){
    c = WO_IS;
  }else{
    assert( (WO_EQ<<(op-TK_EQ)) < 0x7fff );
    c = (u16)(WO_EQ<<(op-TK_EQ));
  }
  assert( op!=TK_ISNULL || c==WO_ISNULL );
  assert( op!=TK_IN || c==WO_IN );
  assert( op!=TK_EQ || c==WO_EQ );
  assert( op!=TK_LT || c==WO_LT );
  assert( op!=TK_LE || c==WO_LE );
  assert( op!=TK_GT || c==WO_GT );







>
>
>
|



>
|

<
<
<







160680
160681
160682
160683
160684
160685
160686
160687
160688
160689
160690
160691
160692
160693
160694
160695
160696



160697
160698
160699
160700
160701
160702
160703

/*
** Translate from TK_xx operator to WO_xx bitmask.
*/
static u16 operatorMask(int op){
  u16 c;
  assert( allowedOp(op) );
  if( op>=TK_EQ ){
    assert( (WO_EQ<<(op-TK_EQ)) < 0x7fff );
    c = (u16)(WO_EQ<<(op-TK_EQ));
  }else if( op==TK_IN ){
    c = WO_IN;
  }else if( op==TK_ISNULL ){
    c = WO_ISNULL;
  }else{
    assert( op==TK_IS );
    c = WO_IS;



  }
  assert( op!=TK_ISNULL || c==WO_ISNULL );
  assert( op!=TK_IN || c==WO_IN );
  assert( op!=TK_EQ || c==WO_EQ );
  assert( op!=TK_LT || c==WO_LT );
  assert( op!=TK_LE || c==WO_LE );
  assert( op!=TK_GT || c==WO_GT );
160729
160730
160731
160732
160733
160734
160735







160736
160737
160738
160739
160740
160741
160742
          *peOp2 = i;
          *ppRight = pList->a[1].pExpr;
          *ppLeft = pCol;
          return 1;
        }
      }
    }







  }else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){
    int res = 0;
    Expr *pLeft = pExpr->pLeft;
    Expr *pRight = pExpr->pRight;
    assert( pLeft->op!=TK_COLUMN || (ExprUseYTab(pLeft) && pLeft->y.pTab!=0) );
    if( ExprIsVtab(pLeft) ){
      res++;







>
>
>
>
>
>
>







160976
160977
160978
160979
160980
160981
160982
160983
160984
160985
160986
160987
160988
160989
160990
160991
160992
160993
160994
160995
160996
          *peOp2 = i;
          *ppRight = pList->a[1].pExpr;
          *ppLeft = pCol;
          return 1;
        }
      }
    }
  }else if( pExpr->op>=TK_EQ ){
    /* Comparison operators are a common case.  Save a few comparisons for
    ** that common case by terminating early. */
    assert( TK_NE < TK_EQ );
    assert( TK_ISNOT < TK_EQ );
    assert( TK_NOTNULL < TK_EQ );
    return 0;
  }else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){
    int res = 0;
    Expr *pLeft = pExpr->pLeft;
    Expr *pRight = pExpr->pRight;
    assert( pLeft->op!=TK_COLUMN || (ExprUseYTab(pLeft) && pLeft->y.pTab!=0) );
    if( ExprIsVtab(pLeft) ){
      res++;
161870
161871
161872
161873
161874
161875
161876
161877
161878
161879
161880
161881
161882
161883
161884
  int eMatchOp        /* SQLITE_INDEX_CONSTRAINT_LIMIT or _OFFSET */
){
  Parse *pParse = pWC->pWInfo->pParse;
  sqlite3 *db = pParse->db;
  Expr *pNew;
  int iVal = 0;

  if( sqlite3ExprIsInteger(pExpr, &iVal) && iVal>=0 ){
    Expr *pVal = sqlite3Expr(db, TK_INTEGER, 0);
    if( pVal==0 ) return;
    ExprSetProperty(pVal, EP_IntValue);
    pVal->u.iValue = iVal;
    pNew = sqlite3PExpr(pParse, TK_MATCH, 0, pVal);
  }else{
    Expr *pVal = sqlite3Expr(db, TK_REGISTER, 0);







|







162124
162125
162126
162127
162128
162129
162130
162131
162132
162133
162134
162135
162136
162137
162138
  int eMatchOp        /* SQLITE_INDEX_CONSTRAINT_LIMIT or _OFFSET */
){
  Parse *pParse = pWC->pWInfo->pParse;
  sqlite3 *db = pParse->db;
  Expr *pNew;
  int iVal = 0;

  if( sqlite3ExprIsInteger(pExpr, &iVal, pParse) && iVal>=0 ){
    Expr *pVal = sqlite3Expr(db, TK_INTEGER, 0);
    if( pVal==0 ) return;
    ExprSetProperty(pVal, EP_IntValue);
    pVal->u.iValue = iVal;
    pNew = sqlite3PExpr(pParse, TK_MATCH, 0, pVal);
  }else{
    Expr *pVal = sqlite3Expr(db, TK_REGISTER, 0);
163522
163523
163524
163525
163526
163527
163528














163529
163530
163531
163532
163533
163534
163535
  sqlite3VdbeJumpHere(v, addrOnce);
  pParse->pIdxEpr = saved_pIdxEpr;
  pParse->pIdxPartExpr = saved_pIdxPartExpr;
}


#ifndef SQLITE_OMIT_VIRTUALTABLE














/*
** Allocate and populate an sqlite3_index_info structure. It is the
** responsibility of the caller to eventually release the structure
** by passing the pointer returned by this function to freeIndexInfo().
*/
static sqlite3_index_info *allocateIndexInfo(
  WhereInfo *pWInfo,              /* The WHERE clause */







>
>
>
>
>
>
>
>
>
>
>
>
>
>







163776
163777
163778
163779
163780
163781
163782
163783
163784
163785
163786
163787
163788
163789
163790
163791
163792
163793
163794
163795
163796
163797
163798
163799
163800
163801
163802
163803
  sqlite3VdbeJumpHere(v, addrOnce);
  pParse->pIdxEpr = saved_pIdxEpr;
  pParse->pIdxPartExpr = saved_pIdxPartExpr;
}


#ifndef SQLITE_OMIT_VIRTUALTABLE
/*
** Return term iTerm of the WhereClause passed as the first argument. Terms
** are numbered from 0 upwards, starting with the terms in pWC->a[], then
** those in pWC->pOuter->a[] (if any), and so on.
*/
static WhereTerm *termFromWhereClause(WhereClause *pWC, int iTerm){
  WhereClause *p;
  for(p=pWC; p; p=p->pOuter){
    if( iTerm<p->nTerm ) return &p->a[iTerm];
    iTerm -= p->nTerm;
  }
  return 0;
}

/*
** Allocate and populate an sqlite3_index_info structure. It is the
** responsibility of the caller to eventually release the structure
** by passing the pointer returned by this function to freeIndexInfo().
*/
static sqlite3_index_info *allocateIndexInfo(
  WhereInfo *pWInfo,              /* The WHERE clause */
163548
163549
163550
163551
163552
163553
163554

163555
163556
163557
163558
163559
163560
163561
163562
163563
163564

163565
163566
163567
163568
163569
163570
163571
163572
163573
163574
163575
163576
163577
163578
163579
163580
163581
163582
163583
163584
163585
163586

163587
163588
163589
163590
163591
163592
163593
  WhereTerm *pTerm;
  int nOrderBy;
  sqlite3_index_info *pIdxInfo;
  u16 mNoOmit = 0;
  const Table *pTab;
  int eDistinct = 0;
  ExprList *pOrderBy = pWInfo->pOrderBy;


  assert( pSrc!=0 );
  pTab = pSrc->pTab;
  assert( pTab!=0 );
  assert( IsVirtual(pTab) );

  /* Find all WHERE clause constraints referring to this virtual table.
  ** Mark each term with the TERM_OK flag.  Set nTerm to the number of
  ** terms found.
  */

  for(i=nTerm=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
    pTerm->wtFlags &= ~TERM_OK;
    if( pTerm->leftCursor != pSrc->iCursor ) continue;
    if( pTerm->prereqRight & mUnusable ) continue;
    assert( IsPowerOfTwo(pTerm->eOperator & ~WO_EQUIV) );
    testcase( pTerm->eOperator & WO_IN );
    testcase( pTerm->eOperator & WO_ISNULL );
    testcase( pTerm->eOperator & WO_IS );
    testcase( pTerm->eOperator & WO_ALL );
    if( (pTerm->eOperator & ~(WO_EQUIV))==0 ) continue;
    if( pTerm->wtFlags & TERM_VNULL ) continue;

    assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 );
    assert( pTerm->u.x.leftColumn>=XN_ROWID );
    assert( pTerm->u.x.leftColumn<pTab->nCol );
    if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0
     && !constraintCompatibleWithOuterJoin(pTerm,pSrc)
    ){
      continue;
    }
    nTerm++;
    pTerm->wtFlags |= TERM_OK;

  }

  /* If the ORDER BY clause contains only columns in the current
  ** virtual table then allocate space for the aOrderBy part of
  ** the sqlite3_index_info structure.
  */
  nOrderBy = 0;







>










>
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
>







163816
163817
163818
163819
163820
163821
163822
163823
163824
163825
163826
163827
163828
163829
163830
163831
163832
163833
163834
163835
163836
163837
163838
163839
163840
163841
163842
163843
163844
163845
163846
163847
163848
163849
163850
163851
163852
163853
163854
163855
163856
163857
163858
163859
163860
163861
163862
163863
163864
  WhereTerm *pTerm;
  int nOrderBy;
  sqlite3_index_info *pIdxInfo;
  u16 mNoOmit = 0;
  const Table *pTab;
  int eDistinct = 0;
  ExprList *pOrderBy = pWInfo->pOrderBy;
  WhereClause *p;

  assert( pSrc!=0 );
  pTab = pSrc->pTab;
  assert( pTab!=0 );
  assert( IsVirtual(pTab) );

  /* Find all WHERE clause constraints referring to this virtual table.
  ** Mark each term with the TERM_OK flag.  Set nTerm to the number of
  ** terms found.
  */
  for(p=pWC, nTerm=0; p; p=p->pOuter){
    for(i=0, pTerm=p->a; i<p->nTerm; i++, pTerm++){
      pTerm->wtFlags &= ~TERM_OK;
      if( pTerm->leftCursor != pSrc->iCursor ) continue;
      if( pTerm->prereqRight & mUnusable ) continue;
      assert( IsPowerOfTwo(pTerm->eOperator & ~WO_EQUIV) );
      testcase( pTerm->eOperator & WO_IN );
      testcase( pTerm->eOperator & WO_ISNULL );
      testcase( pTerm->eOperator & WO_IS );
      testcase( pTerm->eOperator & WO_ALL );
      if( (pTerm->eOperator & ~(WO_EQUIV))==0 ) continue;
      if( pTerm->wtFlags & TERM_VNULL ) continue;

      assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 );
      assert( pTerm->u.x.leftColumn>=XN_ROWID );
      assert( pTerm->u.x.leftColumn<pTab->nCol );
      if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0
          && !constraintCompatibleWithOuterJoin(pTerm,pSrc)
        ){
        continue;
      }
      nTerm++;
      pTerm->wtFlags |= TERM_OK;
    }
  }

  /* If the ORDER BY clause contains only columns in the current
  ** virtual table then allocate space for the aOrderBy part of
  ** the sqlite3_index_info structure.
  */
  nOrderBy = 0;
163658
163659
163660
163661
163662
163663
163664


163665
163666
163667
163668
163669
163670
163671
163672
163673
163674
163675
163676
163677
163678
163679
163680
163681
163682
163683
163684
163685
163686
163687
163688
163689
163690
163691
163692
163693
163694
163695
163696
163697
163698
163699
163700
163701
163702
163703
163704
163705
163706
163707

163708
163709
163710
163711
163712
163713
163714
163715
163716
163717
163718
163719
163720
163721
163722
163723
163724
163725











163726
163727
163728
163729
163730
163731
163732
163733
163734
163735
163736
163737
163738
163739
163740
163741

163742
163743
163744
163745
163746
163747
163748
  pIdxInfo->aConstraint = pIdxCons;
  pIdxInfo->aOrderBy = pIdxOrderBy;
  pIdxInfo->aConstraintUsage = pUsage;
  pHidden->pWC = pWC;
  pHidden->pParse = pParse;
  pHidden->eDistinct = eDistinct;
  pHidden->mIn = 0;


  for(i=j=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
    u16 op;
    if( (pTerm->wtFlags & TERM_OK)==0 ) continue;
    pIdxCons[j].iColumn = pTerm->u.x.leftColumn;
    pIdxCons[j].iTermOffset = i;
    op = pTerm->eOperator & WO_ALL;
    if( op==WO_IN ){
      if( (pTerm->wtFlags & TERM_SLICE)==0 ){
        pHidden->mIn |= SMASKBIT32(j);
      }
      op = WO_EQ;
    }
    if( op==WO_AUX ){
      pIdxCons[j].op = pTerm->eMatchOp;
    }else if( op & (WO_ISNULL|WO_IS) ){
      if( op==WO_ISNULL ){
        pIdxCons[j].op = SQLITE_INDEX_CONSTRAINT_ISNULL;
      }else{
        pIdxCons[j].op = SQLITE_INDEX_CONSTRAINT_IS;
      }
    }else{
      pIdxCons[j].op = (u8)op;
      /* The direct assignment in the previous line is possible only because
      ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical.  The
      ** following asserts verify this fact. */
      assert( WO_EQ==SQLITE_INDEX_CONSTRAINT_EQ );
      assert( WO_LT==SQLITE_INDEX_CONSTRAINT_LT );
      assert( WO_LE==SQLITE_INDEX_CONSTRAINT_LE );
      assert( WO_GT==SQLITE_INDEX_CONSTRAINT_GT );
      assert( WO_GE==SQLITE_INDEX_CONSTRAINT_GE );
      assert( pTerm->eOperator&(WO_IN|WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_AUX) );

      if( op & (WO_LT|WO_LE|WO_GT|WO_GE)
       && sqlite3ExprIsVector(pTerm->pExpr->pRight)
      ){
        testcase( j!=i );
        if( j<16 ) mNoOmit |= (1 << j);
        if( op==WO_LT ) pIdxCons[j].op = WO_LE;
        if( op==WO_GT ) pIdxCons[j].op = WO_GE;
      }
    }

    j++;

  }
  assert( j==nTerm );
  pIdxInfo->nConstraint = j;
  for(i=j=0; i<nOrderBy; i++){
    Expr *pExpr = pOrderBy->a[i].pExpr;
    if( sqlite3ExprIsConstant(0, pExpr) ) continue;
    assert( pExpr->op==TK_COLUMN
         || (pExpr->op==TK_COLLATE && pExpr->pLeft->op==TK_COLUMN
              && pExpr->iColumn==pExpr->pLeft->iColumn) );
    pIdxOrderBy[j].iColumn = pExpr->iColumn;
    pIdxOrderBy[j].desc = pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_DESC;
    j++;
  }
  pIdxInfo->nOrderBy = j;

  *pmNoOmit = mNoOmit;
  return pIdxInfo;
}












/*
** Free an sqlite3_index_info structure allocated by allocateIndexInfo()
** and possibly modified by xBestIndex methods.
*/
static void freeIndexInfo(sqlite3 *db, sqlite3_index_info *pIdxInfo){
  HiddenIndexInfo *pHidden;
  int i;
  assert( pIdxInfo!=0 );
  pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
  assert( pHidden->pParse!=0 );
  assert( pHidden->pParse->db==db );
  for(i=0; i<pIdxInfo->nConstraint; i++){
    sqlite3ValueFree(pHidden->aRhs[i]); /* IMP: R-14553-25174 */
    pHidden->aRhs[i] = 0;
  }

  sqlite3DbFree(db, pIdxInfo);
}

/*
** The table object reference passed as the second argument to this function
** must represent a virtual table. This function invokes the xBestIndex()
** method of the virtual table with the sqlite3_index_info object that







>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|

|
>


















>
>
>
>
>
>
>
>
>
>
>
















>







163929
163930
163931
163932
163933
163934
163935
163936
163937
163938
163939
163940
163941
163942
163943
163944
163945
163946
163947
163948
163949
163950
163951
163952
163953
163954
163955
163956
163957
163958
163959
163960
163961
163962
163963
163964
163965
163966
163967
163968
163969
163970
163971
163972
163973
163974
163975
163976
163977
163978
163979
163980
163981
163982
163983
163984
163985
163986
163987
163988
163989
163990
163991
163992
163993
163994
163995
163996
163997
163998
163999
164000
164001
164002
164003
164004
164005
164006
164007
164008
164009
164010
164011
164012
164013
164014
164015
164016
164017
164018
164019
164020
164021
164022
164023
164024
164025
164026
164027
164028
164029
164030
164031
164032
164033
164034
  pIdxInfo->aConstraint = pIdxCons;
  pIdxInfo->aOrderBy = pIdxOrderBy;
  pIdxInfo->aConstraintUsage = pUsage;
  pHidden->pWC = pWC;
  pHidden->pParse = pParse;
  pHidden->eDistinct = eDistinct;
  pHidden->mIn = 0;
  for(p=pWC, i=j=0; p; p=p->pOuter){
    int nLast = i+p->nTerm;;
    for(pTerm=p->a; i<nLast; i++, pTerm++){
      u16 op;
      if( (pTerm->wtFlags & TERM_OK)==0 ) continue;
      pIdxCons[j].iColumn = pTerm->u.x.leftColumn;
      pIdxCons[j].iTermOffset = i;
      op = pTerm->eOperator & WO_ALL;
      if( op==WO_IN ){
        if( (pTerm->wtFlags & TERM_SLICE)==0 ){
          pHidden->mIn |= SMASKBIT32(j);
        }
        op = WO_EQ;
      }
      if( op==WO_AUX ){
        pIdxCons[j].op = pTerm->eMatchOp;
      }else if( op & (WO_ISNULL|WO_IS) ){
        if( op==WO_ISNULL ){
          pIdxCons[j].op = SQLITE_INDEX_CONSTRAINT_ISNULL;
        }else{
          pIdxCons[j].op = SQLITE_INDEX_CONSTRAINT_IS;
        }
      }else{
        pIdxCons[j].op = (u8)op;
        /* The direct assignment in the previous line is possible only because
        ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical.  The
        ** following asserts verify this fact. */
        assert( WO_EQ==SQLITE_INDEX_CONSTRAINT_EQ );
        assert( WO_LT==SQLITE_INDEX_CONSTRAINT_LT );
        assert( WO_LE==SQLITE_INDEX_CONSTRAINT_LE );
        assert( WO_GT==SQLITE_INDEX_CONSTRAINT_GT );
        assert( WO_GE==SQLITE_INDEX_CONSTRAINT_GE );
        assert( pTerm->eOperator&(WO_IN|WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_AUX) );

        if( op & (WO_LT|WO_LE|WO_GT|WO_GE)
            && sqlite3ExprIsVector(pTerm->pExpr->pRight)
          ){
          testcase( j!=i );
          if( j<16 ) mNoOmit |= (1 << j);
          if( op==WO_LT ) pIdxCons[j].op = WO_LE;
          if( op==WO_GT ) pIdxCons[j].op = WO_GE;
        }
      }

      j++;
    }
  }
  assert( j==nTerm );
  pIdxInfo->nConstraint = j;
  for(i=j=0; i<nOrderBy; i++){
    Expr *pExpr = pOrderBy->a[i].pExpr;
    if( sqlite3ExprIsConstant(0, pExpr) ) continue;
    assert( pExpr->op==TK_COLUMN
         || (pExpr->op==TK_COLLATE && pExpr->pLeft->op==TK_COLUMN
              && pExpr->iColumn==pExpr->pLeft->iColumn) );
    pIdxOrderBy[j].iColumn = pExpr->iColumn;
    pIdxOrderBy[j].desc = pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_DESC;
    j++;
  }
  pIdxInfo->nOrderBy = j;

  *pmNoOmit = mNoOmit;
  return pIdxInfo;
}

/*
** Free and zero the sqlite3_index_info.idxStr value if needed.
*/
static void freeIdxStr(sqlite3_index_info *pIdxInfo){
  if( pIdxInfo->needToFreeIdxStr ){
    sqlite3_free(pIdxInfo->idxStr);
    pIdxInfo->idxStr = 0;
    pIdxInfo->needToFreeIdxStr = 0;
  }
}

/*
** Free an sqlite3_index_info structure allocated by allocateIndexInfo()
** and possibly modified by xBestIndex methods.
*/
static void freeIndexInfo(sqlite3 *db, sqlite3_index_info *pIdxInfo){
  HiddenIndexInfo *pHidden;
  int i;
  assert( pIdxInfo!=0 );
  pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
  assert( pHidden->pParse!=0 );
  assert( pHidden->pParse->db==db );
  for(i=0; i<pIdxInfo->nConstraint; i++){
    sqlite3ValueFree(pHidden->aRhs[i]); /* IMP: R-14553-25174 */
    pHidden->aRhs[i] = 0;
  }
  freeIdxStr(pIdxInfo);
  sqlite3DbFree(db, pIdxInfo);
}

/*
** The table object reference passed as the second argument to this function
** must represent a virtual table. This function invokes the xBestIndex()
** method of the virtual table with the sqlite3_index_info object that
165086
165087
165088
165089
165090
165091
165092
165093
165094
165095
165096
165097
165098
165099
165100
        pLoop->nOut--;
        if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0
         && (pTerm->wtFlags & TERM_HIGHTRUTH)==0  /* tag-20200224-1 */
        ){
          Expr *pRight = pTerm->pExpr->pRight;
          int k = 0;
          testcase( pTerm->pExpr->op==TK_IS );
          if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){
            k = 10;
          }else{
            k = 20;
          }
          if( iReduce<k ){
            pTerm->wtFlags |= TERM_HEURTRUTH;
            iReduce = k;







|







165372
165373
165374
165375
165376
165377
165378
165379
165380
165381
165382
165383
165384
165385
165386
        pLoop->nOut--;
        if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0
         && (pTerm->wtFlags & TERM_HIGHTRUTH)==0  /* tag-20200224-1 */
        ){
          Expr *pRight = pTerm->pExpr->pRight;
          int k = 0;
          testcase( pTerm->pExpr->op==TK_IS );
          if( sqlite3ExprIsInteger(pRight, &k, 0) && k>=(-1) && k<=1 ){
            k = 10;
          }else{
            k = 20;
          }
          if( iReduce<k ){
            pTerm->wtFlags |= TERM_HEURTRUTH;
            iReduce = k;
166335
166336
166337
166338
166339
166340
166341
166342
166343
166344
166345
166346
166347
166348
166349
  *pbIn = 0;
  pNew->prereq = mPrereq;

  /* Set the usable flag on the subset of constraints identified by
  ** arguments mUsable and mExclude. */
  pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
  for(i=0; i<nConstraint; i++, pIdxCons++){
    WhereTerm *pTerm = &pWC->a[pIdxCons->iTermOffset];
    pIdxCons->usable = 0;
    if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight
     && (pTerm->eOperator & mExclude)==0
     && (pbRetryLimit || !isLimitTerm(pTerm))
    ){
      pIdxCons->usable = 1;
    }







|







166621
166622
166623
166624
166625
166626
166627
166628
166629
166630
166631
166632
166633
166634
166635
  *pbIn = 0;
  pNew->prereq = mPrereq;

  /* Set the usable flag on the subset of constraints identified by
  ** arguments mUsable and mExclude. */
  pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
  for(i=0; i<nConstraint; i++, pIdxCons++){
    WhereTerm *pTerm = termFromWhereClause(pWC, pIdxCons->iTermOffset);
    pIdxCons->usable = 0;
    if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight
     && (pTerm->eOperator & mExclude)==0
     && (pbRetryLimit || !isLimitTerm(pTerm))
    ){
      pIdxCons->usable = 1;
    }
166366
166367
166368
166369
166370
166371
166372

166373
166374
166375
166376
166377
166378
166379
166380
166381
166382
166383
166384
166385
166386
166387
166388
166389
166390
166391
166392
166393
166394
166395
166396
166397
166398
166399
166400
166401
166402
166403
166404
166405
166406
166407
166408
  if( rc ){
    if( rc==SQLITE_CONSTRAINT ){
      /* If the xBestIndex method returns SQLITE_CONSTRAINT, that means
      ** that the particular combination of parameters provided is unusable.
      ** Make no entries in the loop table.
      */
      WHERETRACE(0xffffffff, ("  ^^^^--- non-viable plan rejected!\n"));

      return SQLITE_OK;
    }
    return rc;
  }

  mxTerm = -1;
  assert( pNew->nLSlot>=nConstraint );
  memset(pNew->aLTerm, 0, sizeof(pNew->aLTerm[0])*nConstraint );
  memset(&pNew->u.vtab, 0, sizeof(pNew->u.vtab));
  pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
  for(i=0; i<nConstraint; i++, pIdxCons++){
    int iTerm;
    if( (iTerm = pUsage[i].argvIndex - 1)>=0 ){
      WhereTerm *pTerm;
      int j = pIdxCons->iTermOffset;
      if( iTerm>=nConstraint
       || j<0
       || j>=pWC->nTerm
       || pNew->aLTerm[iTerm]!=0
       || pIdxCons->usable==0
      ){
        sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
        testcase( pIdxInfo->needToFreeIdxStr );
        return SQLITE_ERROR;
      }
      testcase( iTerm==nConstraint-1 );
      testcase( j==0 );
      testcase( j==pWC->nTerm-1 );
      pTerm = &pWC->a[j];
      pNew->prereq |= pTerm->prereqRight;
      assert( iTerm<pNew->nLSlot );
      pNew->aLTerm[iTerm] = pTerm;
      if( iTerm>mxTerm ) mxTerm = iTerm;
      testcase( iTerm==15 );
      testcase( iTerm==16 );
      if( pUsage[i].omit ){







>

















|




|





<







166652
166653
166654
166655
166656
166657
166658
166659
166660
166661
166662
166663
166664
166665
166666
166667
166668
166669
166670
166671
166672
166673
166674
166675
166676
166677
166678
166679
166680
166681
166682
166683
166684
166685
166686
166687

166688
166689
166690
166691
166692
166693
166694
  if( rc ){
    if( rc==SQLITE_CONSTRAINT ){
      /* If the xBestIndex method returns SQLITE_CONSTRAINT, that means
      ** that the particular combination of parameters provided is unusable.
      ** Make no entries in the loop table.
      */
      WHERETRACE(0xffffffff, ("  ^^^^--- non-viable plan rejected!\n"));
      freeIdxStr(pIdxInfo);
      return SQLITE_OK;
    }
    return rc;
  }

  mxTerm = -1;
  assert( pNew->nLSlot>=nConstraint );
  memset(pNew->aLTerm, 0, sizeof(pNew->aLTerm[0])*nConstraint );
  memset(&pNew->u.vtab, 0, sizeof(pNew->u.vtab));
  pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
  for(i=0; i<nConstraint; i++, pIdxCons++){
    int iTerm;
    if( (iTerm = pUsage[i].argvIndex - 1)>=0 ){
      WhereTerm *pTerm;
      int j = pIdxCons->iTermOffset;
      if( iTerm>=nConstraint
       || j<0
       || (pTerm = termFromWhereClause(pWC, j))==0
       || pNew->aLTerm[iTerm]!=0
       || pIdxCons->usable==0
      ){
        sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
        freeIdxStr(pIdxInfo);
        return SQLITE_ERROR;
      }
      testcase( iTerm==nConstraint-1 );
      testcase( j==0 );
      testcase( j==pWC->nTerm-1 );

      pNew->prereq |= pTerm->prereqRight;
      assert( iTerm<pNew->nLSlot );
      pNew->aLTerm[iTerm] = pTerm;
      if( iTerm>mxTerm ) mxTerm = iTerm;
      testcase( iTerm==15 );
      testcase( iTerm==16 );
      if( pUsage[i].omit ){
166439
166440
166441
166442
166443
166444
166445
166446
166447
166448
166449
166450
166451
166452
166453
166454
166455
166456
166457
166458
166459
166460
166461
166462
166463
166464
166465
166466
166467
166468
166469
166470
        /* If there is an IN(...) term handled as an == (separate call to
        ** xFilter for each value on the RHS of the IN) and a LIMIT or
        ** OFFSET term handled as well, the plan is unusable. Similarly,
        ** if there is a LIMIT/OFFSET and there are other unused terms,
        ** the plan cannot be used. In these cases set variable *pbRetryLimit
        ** to true to tell the caller to retry with LIMIT and OFFSET
        ** disabled. */
        if( pIdxInfo->needToFreeIdxStr ){
          sqlite3_free(pIdxInfo->idxStr);
          pIdxInfo->idxStr = 0;
          pIdxInfo->needToFreeIdxStr = 0;
        }
        *pbRetryLimit = 1;
        return SQLITE_OK;
      }
    }
  }

  pNew->nLTerm = mxTerm+1;
  for(i=0; i<=mxTerm; i++){
    if( pNew->aLTerm[i]==0 ){
      /* The non-zero argvIdx values must be contiguous.  Raise an
      ** error if they are not */
      sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
      testcase( pIdxInfo->needToFreeIdxStr );
      return SQLITE_ERROR;
    }
  }
  assert( pNew->nLTerm<=pNew->nLSlot );
  pNew->u.vtab.idxNum = pIdxInfo->idxNum;
  pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
  pIdxInfo->needToFreeIdxStr = 0;







<
<
|
<
<












|







166725
166726
166727
166728
166729
166730
166731


166732


166733
166734
166735
166736
166737
166738
166739
166740
166741
166742
166743
166744
166745
166746
166747
166748
166749
166750
166751
166752
        /* If there is an IN(...) term handled as an == (separate call to
        ** xFilter for each value on the RHS of the IN) and a LIMIT or
        ** OFFSET term handled as well, the plan is unusable. Similarly,
        ** if there is a LIMIT/OFFSET and there are other unused terms,
        ** the plan cannot be used. In these cases set variable *pbRetryLimit
        ** to true to tell the caller to retry with LIMIT and OFFSET
        ** disabled. */


        freeIdxStr(pIdxInfo);


        *pbRetryLimit = 1;
        return SQLITE_OK;
      }
    }
  }

  pNew->nLTerm = mxTerm+1;
  for(i=0; i<=mxTerm; i++){
    if( pNew->aLTerm[i]==0 ){
      /* The non-zero argvIdx values must be contiguous.  Raise an
      ** error if they are not */
      sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
      freeIdxStr(pIdxInfo);
      return SQLITE_ERROR;
    }
  }
  assert( pNew->nLTerm<=pNew->nLSlot );
  pNew->u.vtab.idxNum = pIdxInfo->idxNum;
  pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
  pIdxInfo->needToFreeIdxStr = 0;
166511
166512
166513
166514
166515
166516
166517
166518
166519
166520
166521
166522
166523
166524
166525
*/
SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info *pIdxInfo, int iCons){
  HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
  const char *zRet = 0;
  if( iCons>=0 && iCons<pIdxInfo->nConstraint ){
    CollSeq *pC = 0;
    int iTerm = pIdxInfo->aConstraint[iCons].iTermOffset;
    Expr *pX = pHidden->pWC->a[iTerm].pExpr;
    if( pX->pLeft ){
      pC = sqlite3ExprCompareCollSeq(pHidden->pParse, pX);
    }
    zRet = (pC ? pC->zName : sqlite3StrBINARY);
  }
  return zRet;
}







|







166793
166794
166795
166796
166797
166798
166799
166800
166801
166802
166803
166804
166805
166806
166807
*/
SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info *pIdxInfo, int iCons){
  HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
  const char *zRet = 0;
  if( iCons>=0 && iCons<pIdxInfo->nConstraint ){
    CollSeq *pC = 0;
    int iTerm = pIdxInfo->aConstraint[iCons].iTermOffset;
    Expr *pX = termFromWhereClause(pHidden->pWC, iTerm)->pExpr;
    if( pX->pLeft ){
      pC = sqlite3ExprCompareCollSeq(pHidden->pParse, pX);
    }
    zRet = (pC ? pC->zName : sqlite3StrBINARY);
  }
  return zRet;
}
166557
166558
166559
166560
166561
166562
166563

166564

166565
166566
166567
166568
166569
166570
166571
  HiddenIndexInfo *pH = (HiddenIndexInfo*)&pIdxInfo[1];
  sqlite3_value *pVal = 0;
  int rc = SQLITE_OK;
  if( iCons<0 || iCons>=pIdxInfo->nConstraint ){
    rc = SQLITE_MISUSE_BKPT; /* EV: R-30545-25046 */
  }else{
    if( pH->aRhs[iCons]==0 ){

      WhereTerm *pTerm = &pH->pWC->a[pIdxInfo->aConstraint[iCons].iTermOffset];

      rc = sqlite3ValueFromExpr(
          pH->pParse->db, pTerm->pExpr->pRight, ENC(pH->pParse->db),
          SQLITE_AFF_BLOB, &pH->aRhs[iCons]
      );
      testcase( rc!=SQLITE_OK );
    }
    pVal = pH->aRhs[iCons];







>
|
>







166839
166840
166841
166842
166843
166844
166845
166846
166847
166848
166849
166850
166851
166852
166853
166854
166855
  HiddenIndexInfo *pH = (HiddenIndexInfo*)&pIdxInfo[1];
  sqlite3_value *pVal = 0;
  int rc = SQLITE_OK;
  if( iCons<0 || iCons>=pIdxInfo->nConstraint ){
    rc = SQLITE_MISUSE_BKPT; /* EV: R-30545-25046 */
  }else{
    if( pH->aRhs[iCons]==0 ){
      WhereTerm *pTerm = termFromWhereClause(
          pH->pWC, pIdxInfo->aConstraint[iCons].iTermOffset
      );
      rc = sqlite3ValueFromExpr(
          pH->pParse->db, pTerm->pExpr->pRight, ENC(pH->pParse->db),
          SQLITE_AFF_BLOB, &pH->aRhs[iCons]
      );
      testcase( rc!=SQLITE_OK );
    }
    pVal = pH->aRhs[iCons];
166713
166714
166715
166716
166717
166718
166719
166720
166721
166722

166723
166724
166725
166726
166727
166728
166729
    /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq)
    ** in the set of terms that apply to the current virtual table.  */
    while( rc==SQLITE_OK ){
      int i;
      Bitmask mNext = ALLBITS;
      assert( mNext>0 );
      for(i=0; i<nConstraint; i++){
        Bitmask mThis = (
            pWC->a[p->aConstraint[i].iTermOffset].prereqRight & ~mPrereq
        );

        if( mThis>mPrev && mThis<mNext ) mNext = mThis;
      }
      mPrev = mNext;
      if( mNext==ALLBITS ) break;
      if( mNext==mBest || mNext==mBestNoIn ) continue;
      WHERETRACE(0x800, ("  VirtualOne: mPrev=%04llx mNext=%04llx\n",
                       (sqlite3_uint64)mPrev, (sqlite3_uint64)mNext));







<
|
<
>







166997
166998
166999
167000
167001
167002
167003

167004

167005
167006
167007
167008
167009
167010
167011
167012
    /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq)
    ** in the set of terms that apply to the current virtual table.  */
    while( rc==SQLITE_OK ){
      int i;
      Bitmask mNext = ALLBITS;
      assert( mNext>0 );
      for(i=0; i<nConstraint; i++){

        int iTerm = p->aConstraint[i].iTermOffset;

        Bitmask mThis = termFromWhereClause(pWC, iTerm)->prereqRight & ~mPrereq;
        if( mThis>mPrev && mThis<mNext ) mNext = mThis;
      }
      mPrev = mNext;
      if( mNext==ALLBITS ) break;
      if( mNext==mBest || mNext==mBestNoIn ) continue;
      WHERETRACE(0x800, ("  VirtualOne: mPrev=%04llx mNext=%04llx\n",
                       (sqlite3_uint64)mPrev, (sqlite3_uint64)mNext));
166751
166752
166753
166754
166755
166756
166757
166758
166759
166760
166761
166762
166763
166764
166765
    if( rc==SQLITE_OK && seenZeroNoIN==0 ){
      WHERETRACE(0x800, ("  VirtualOne: all disabled and w/o IN\n"));
      rc = whereLoopAddVirtualOne(
          pBuilder, mPrereq, mPrereq, WO_IN, p, mNoOmit, &bIn, 0);
    }
  }

  if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr);
  freeIndexInfo(pParse->db, p);
  WHERETRACE(0x800, ("END %s.addVirtual(), rc=%d\n", pSrc->pTab->zName, rc));
  return rc;
}
#endif /* SQLITE_OMIT_VIRTUALTABLE */

/*







<







167034
167035
167036
167037
167038
167039
167040

167041
167042
167043
167044
167045
167046
167047
    if( rc==SQLITE_OK && seenZeroNoIN==0 ){
      WHERETRACE(0x800, ("  VirtualOne: all disabled and w/o IN\n"));
      rc = whereLoopAddVirtualOne(
          pBuilder, mPrereq, mPrereq, WO_IN, p, mNoOmit, &bIn, 0);
    }
  }


  freeIndexInfo(pParse->db, p);
  WHERETRACE(0x800, ("END %s.addVirtual(), rc=%d\n", pSrc->pTab->zName, rc));
  return rc;
}
#endif /* SQLITE_OMIT_VIRTUALTABLE */

/*
167438
167439
167440
167441
167442
167443
167444
167445
167446
167447
167448
167449
167450
167451
167452
167453
167454
167455
167456
167457
167458
167459
167460
167461
167462
167463
167464
**     12    otherwise
**
** For the purposes of SQLite, a star-query is defined as a query
** with a large central table that is joined against four or more
** smaller tables.  The central table is called the "fact" table.
** The smaller tables that get joined are "dimension tables".
**
** SIDE EFFECT:
**
** If pWInfo describes a star-query, then the cost on WhereLoops for the
** fact table is reduced.  This heuristic helps keep fact tables in
** outer loops.  Without this heuristic, paths with fact tables in outer
** loops tend to get pruned by the mxChoice limit on the number of paths,
** resulting in poor query plans.  The total amount of heuristic cost
** adjustment is stored in pWInfo->nOutStarDelta and the cost adjustment
** for each WhereLoop is stored in its rStarDelta field.
*/
static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){
  int nLoop = pWInfo->nLevel;    /* Number of terms in the join */
  if( nRowEst==0 && nLoop>=4 ){
    /* Check to see if we are dealing with a star schema and if so, reduce
    ** the cost of fact tables relative to dimension tables, as a heuristic
    ** to help keep the fact tables in outer loops.
    */
    int iLoop;                /* Counter over join terms */
    Bitmask m;                /* Bitmask for current loop */
    assert( pWInfo->nOutStarDelta==0 );







|











|







167720
167721
167722
167723
167724
167725
167726
167727
167728
167729
167730
167731
167732
167733
167734
167735
167736
167737
167738
167739
167740
167741
167742
167743
167744
167745
167746
**     12    otherwise
**
** For the purposes of SQLite, a star-query is defined as a query
** with a large central table that is joined against four or more
** smaller tables.  The central table is called the "fact" table.
** The smaller tables that get joined are "dimension tables".
**
** SIDE EFFECT:  (and really the whole point of this subroutine)
**
** If pWInfo describes a star-query, then the cost on WhereLoops for the
** fact table is reduced.  This heuristic helps keep fact tables in
** outer loops.  Without this heuristic, paths with fact tables in outer
** loops tend to get pruned by the mxChoice limit on the number of paths,
** resulting in poor query plans.  The total amount of heuristic cost
** adjustment is stored in pWInfo->nOutStarDelta and the cost adjustment
** for each WhereLoop is stored in its rStarDelta field.
*/
static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){
  int nLoop = pWInfo->nLevel;    /* Number of terms in the join */
  if( nRowEst==0 && nLoop>=5 ){
    /* Check to see if we are dealing with a star schema and if so, reduce
    ** the cost of fact tables relative to dimension tables, as a heuristic
    ** to help keep the fact tables in outer loops.
    */
    int iLoop;                /* Counter over join terms */
    Bitmask m;                /* Bitmask for current loop */
    assert( pWInfo->nOutStarDelta==0 );
168166
168167
168168
168169
168170
168171
168172




168173
168174
168175
168176
168177
168178
168179
**   5) The table must not have an inner-join ON or USING clause if there is
**      a RIGHT JOIN anywhere in the query.  Otherwise the ON/USING clause
**      might move from the right side to the left side of the RIGHT JOIN.
**      Note: Due to (2), this condition can only arise if the table is
**      the right-most table of a subquery that was flattened into the
**      main query and that subquery was the right-hand operand of an
**      inner join that held an ON or USING clause.




**
** For example, given:
**
**     CREATE TABLE t1(ipk INTEGER PRIMARY KEY, v1);
**     CREATE TABLE t2(ipk INTEGER PRIMARY KEY, v2);
**     CREATE TABLE t3(ipk INTEGER PRIMARY KEY, v3);
**







>
>
>
>







168448
168449
168450
168451
168452
168453
168454
168455
168456
168457
168458
168459
168460
168461
168462
168463
168464
168465
**   5) The table must not have an inner-join ON or USING clause if there is
**      a RIGHT JOIN anywhere in the query.  Otherwise the ON/USING clause
**      might move from the right side to the left side of the RIGHT JOIN.
**      Note: Due to (2), this condition can only arise if the table is
**      the right-most table of a subquery that was flattened into the
**      main query and that subquery was the right-hand operand of an
**      inner join that held an ON or USING clause.
**   6) The ORDER BY clause has 63 or fewer terms
**   7) The omit-noop-join optimization is enabled.
**
** Items (1), (6), and (7) are checked by the caller.
**
** For example, given:
**
**     CREATE TABLE t1(ipk INTEGER PRIMARY KEY, v1);
**     CREATE TABLE t2(ipk INTEGER PRIMARY KEY, v2);
**     CREATE TABLE t3(ipk INTEGER PRIMARY KEY, v3);
**
168580
168581
168582
168583
168584
168585
168586

168587
168588
168589
168590
168591
168592
168593
  memset(&sWLB, 0, sizeof(sWLB));

  /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */
  testcase( pOrderBy && pOrderBy->nExpr==BMS-1 );
  if( pOrderBy && pOrderBy->nExpr>=BMS ){
    pOrderBy = 0;
    wctrlFlags &= ~WHERE_WANT_DISTINCT;

  }

  /* The number of tables in the FROM clause is limited by the number of
  ** bits in a Bitmask
  */
  testcase( pTabList->nSrc==BMS );
  if( pTabList->nSrc>BMS ){







>







168866
168867
168868
168869
168870
168871
168872
168873
168874
168875
168876
168877
168878
168879
168880
  memset(&sWLB, 0, sizeof(sWLB));

  /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */
  testcase( pOrderBy && pOrderBy->nExpr==BMS-1 );
  if( pOrderBy && pOrderBy->nExpr>=BMS ){
    pOrderBy = 0;
    wctrlFlags &= ~WHERE_WANT_DISTINCT;
    wctrlFlags |= WHERE_KEEP_ALL_JOINS; /* Disable omit-noop-join opt */
  }

  /* The number of tables in the FROM clause is limited by the number of
  ** bits in a Bitmask
  */
  testcase( pTabList->nSrc==BMS );
  if( pTabList->nSrc>BMS ){
168880
168881
168882
168883
168884
168885
168886
168887
168888
168889
168890
168891
168892
168893
168894
168895
168896
168897
  ** procedure to keep the sqlite3WhereBegin() procedure from becoming
  ** too large.  If sqlite3WhereBegin() becomes too large, that prevents
  ** some C-compiler optimizers from in-lining the
  ** sqlite3WhereCodeOneLoopStart() procedure, and it is important to
  ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons.
  */
  notReady = ~(Bitmask)0;
  if( pWInfo->nLevel>=2
   && pResultSet!=0                         /* these two combine to guarantee */
   && 0==(wctrlFlags & WHERE_AGG_DISTINCT)  /* condition (1) above */
   && OptimizationEnabled(db, SQLITE_OmitNoopJoin)
  ){
    notReady = whereOmitNoopJoin(pWInfo, notReady);
    nTabList = pWInfo->nLevel;
    assert( nTabList>0 );
  }

  /* Check to see if there are any SEARCH loops that might benefit from







|
|
|
|







169167
169168
169169
169170
169171
169172
169173
169174
169175
169176
169177
169178
169179
169180
169181
169182
169183
169184
  ** procedure to keep the sqlite3WhereBegin() procedure from becoming
  ** too large.  If sqlite3WhereBegin() becomes too large, that prevents
  ** some C-compiler optimizers from in-lining the
  ** sqlite3WhereCodeOneLoopStart() procedure, and it is important to
  ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons.
  */
  notReady = ~(Bitmask)0;
  if( pWInfo->nLevel>=2       /* Must be a join, or this opt8n is pointless */
   && pResultSet!=0           /* Condition (1) */
   && 0==(wctrlFlags & (WHERE_AGG_DISTINCT|WHERE_KEEP_ALL_JOINS)) /* (1),(6) */
   && OptimizationEnabled(db, SQLITE_OmitNoopJoin)                /* (7) */
  ){
    notReady = whereOmitNoopJoin(pWInfo, notReady);
    nTabList = pWInfo->nLevel;
    assert( nTabList>0 );
  }

  /* Check to see if there are any SEARCH loops that might benefit from
170477
170478
170479
170480
170481
170482
170483
170484
170485
170486
170487
170488
170489
170490
170491
        sqlite3ExprDelete(db, pDup);
        break;
      }
      if( bIntToNull ){
        int iDummy;
        Expr *pSub;
        pSub = sqlite3ExprSkipCollateAndLikely(pDup);
        if( sqlite3ExprIsInteger(pSub, &iDummy) ){
          pSub->op = TK_NULL;
          pSub->flags &= ~(EP_IntValue|EP_IsTrue|EP_IsFalse);
          pSub->u.zToken = 0;
        }
      }
      pList = sqlite3ExprListAppend(pParse, pList, pDup);
      if( pList ) pList->a[nInit+i].fg.sortFlags = pAppend->a[i].fg.sortFlags;







|







170764
170765
170766
170767
170768
170769
170770
170771
170772
170773
170774
170775
170776
170777
170778
        sqlite3ExprDelete(db, pDup);
        break;
      }
      if( bIntToNull ){
        int iDummy;
        Expr *pSub;
        pSub = sqlite3ExprSkipCollateAndLikely(pDup);
        if( sqlite3ExprIsInteger(pSub, &iDummy, 0) ){
          pSub->op = TK_NULL;
          pSub->flags &= ~(EP_IntValue|EP_IsTrue|EP_IsFalse);
          pSub->u.zToken = 0;
        }
      }
      pList = sqlite3ExprListAppend(pParse, pList, pDup);
      if( pList ) pList->a[nInit+i].fg.sortFlags = pAppend->a[i].fg.sortFlags;
172954
172955
172956
172957
172958
172959
172960

172961
172962
172963
172964
172965
172966
172967
172968
172969
172970
172971
172972
172973
172974
172975
172976
172977
172978
172979
172980
172981
172982
172983
172984
172985
172986
172987
172988
172989
172990
172991
172992
172993
172994
172995
172996
172997
172998
172999
173000
173001
173002
173003
173004
173005
173006
173007
173008
173009
173010
173011
173012
173013
173014
173015
173016
173017
173018
173019
173020
173021
173022
173023
173024
173025
173026
173027
173028
173029
173030
173031
173032
173033
173034
173035
173036
173037
173038
173039
173040
173041
173042
173043
173044
173045
173046
173047
173048
173049
173050
173051
173052
173053
173054
173055
173056
173057
173058
173059
173060
173061
173062
173063
173064
173065
173066
173067
173068
173069
173070
173071
173072
173073
173074
173075
173076
173077
173078
173079
173080
173081
173082
173083
173084
173085
173086
173087
173088
173089
173090
173091
173092
173093
#define TK_DESC                           39
#define TK_DETACH                         40
#define TK_EACH                           41
#define TK_FAIL                           42
#define TK_OR                             43
#define TK_AND                            44
#define TK_IS                             45

#define TK_MATCH                          46
#define TK_LIKE_KW                        47
#define TK_BETWEEN                        48
#define TK_IN                             49
#define TK_ISNULL                         50
#define TK_NOTNULL                        51
#define TK_NE                             52
#define TK_EQ                             53
#define TK_GT                             54
#define TK_LE                             55
#define TK_LT                             56
#define TK_GE                             57
#define TK_ESCAPE                         58
#define TK_ID                             59
#define TK_COLUMNKW                       60
#define TK_DO                             61
#define TK_FOR                            62
#define TK_IGNORE                         63
#define TK_INITIALLY                      64
#define TK_INSTEAD                        65
#define TK_NO                             66
#define TK_KEY                            67
#define TK_OF                             68
#define TK_OFFSET                         69
#define TK_PRAGMA                         70
#define TK_RAISE                          71
#define TK_RECURSIVE                      72
#define TK_REPLACE                        73
#define TK_RESTRICT                       74
#define TK_ROW                            75
#define TK_ROWS                           76
#define TK_TRIGGER                        77
#define TK_VACUUM                         78
#define TK_VIEW                           79
#define TK_VIRTUAL                        80
#define TK_WITH                           81
#define TK_NULLS                          82
#define TK_FIRST                          83
#define TK_LAST                           84
#define TK_CURRENT                        85
#define TK_FOLLOWING                      86
#define TK_PARTITION                      87
#define TK_PRECEDING                      88
#define TK_RANGE                          89
#define TK_UNBOUNDED                      90
#define TK_EXCLUDE                        91
#define TK_GROUPS                         92
#define TK_OTHERS                         93
#define TK_TIES                           94
#define TK_GENERATED                      95
#define TK_ALWAYS                         96
#define TK_MATERIALIZED                   97
#define TK_REINDEX                        98
#define TK_RENAME                         99
#define TK_CTIME_KW                       100
#define TK_ANY                            101
#define TK_BITAND                         102
#define TK_BITOR                          103
#define TK_LSHIFT                         104
#define TK_RSHIFT                         105
#define TK_PLUS                           106
#define TK_MINUS                          107
#define TK_STAR                           108
#define TK_SLASH                          109
#define TK_REM                            110
#define TK_CONCAT                         111
#define TK_PTR                            112
#define TK_COLLATE                        113
#define TK_BITNOT                         114
#define TK_ON                             115
#define TK_INDEXED                        116
#define TK_STRING                         117
#define TK_JOIN_KW                        118
#define TK_CONSTRAINT                     119
#define TK_DEFAULT                        120
#define TK_NULL                           121
#define TK_PRIMARY                        122
#define TK_UNIQUE                         123
#define TK_CHECK                          124
#define TK_REFERENCES                     125
#define TK_AUTOINCR                       126
#define TK_INSERT                         127
#define TK_DELETE                         128
#define TK_UPDATE                         129
#define TK_SET                            130
#define TK_DEFERRABLE                     131
#define TK_FOREIGN                        132
#define TK_DROP                           133
#define TK_UNION                          134
#define TK_ALL                            135
#define TK_EXCEPT                         136
#define TK_INTERSECT                      137
#define TK_SELECT                         138
#define TK_VALUES                         139
#define TK_DISTINCT                       140
#define TK_DOT                            141
#define TK_FROM                           142
#define TK_JOIN                           143
#define TK_USING                          144
#define TK_ORDER                          145
#define TK_GROUP                          146
#define TK_HAVING                         147
#define TK_LIMIT                          148
#define TK_WHERE                          149
#define TK_RETURNING                      150
#define TK_INTO                           151
#define TK_NOTHING                        152
#define TK_FLOAT                          153
#define TK_BLOB                           154
#define TK_INTEGER                        155
#define TK_VARIABLE                       156
#define TK_CASE                           157
#define TK_WHEN                           158
#define TK_THEN                           159
#define TK_ELSE                           160
#define TK_INDEX                          161
#define TK_ALTER                          162
#define TK_ADD                            163
#define TK_WINDOW                         164
#define TK_OVER                           165
#define TK_FILTER                         166
#define TK_COLUMN                         167
#define TK_AGG_FUNCTION                   168
#define TK_AGG_COLUMN                     169
#define TK_TRUEFALSE                      170
#define TK_ISNOT                          171
#define TK_FUNCTION                       172
#define TK_UPLUS                          173
#define TK_UMINUS                         174
#define TK_TRUTH                          175
#define TK_REGISTER                       176
#define TK_VECTOR                         177
#define TK_SELECT_COLUMN                  178







>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<







173241
173242
173243
173244
173245
173246
173247
173248
173249
173250
173251
173252
173253
173254
173255
173256
173257
173258
173259
173260
173261
173262
173263
173264
173265
173266
173267
173268
173269
173270
173271
173272
173273
173274
173275
173276
173277
173278
173279
173280
173281
173282
173283
173284
173285
173286
173287
173288
173289
173290
173291
173292
173293
173294
173295
173296
173297
173298
173299
173300
173301
173302
173303
173304
173305
173306
173307
173308
173309
173310
173311
173312
173313
173314
173315
173316
173317
173318
173319
173320
173321
173322
173323
173324
173325
173326
173327
173328
173329
173330
173331
173332
173333
173334
173335
173336
173337
173338
173339
173340
173341
173342
173343
173344
173345
173346
173347
173348
173349
173350
173351
173352
173353
173354
173355
173356
173357
173358
173359
173360
173361
173362
173363
173364
173365
173366
173367
173368
173369
173370
173371
173372
173373

173374
173375
173376
173377
173378
173379
173380
#define TK_DESC                           39
#define TK_DETACH                         40
#define TK_EACH                           41
#define TK_FAIL                           42
#define TK_OR                             43
#define TK_AND                            44
#define TK_IS                             45
#define TK_ISNOT                          46
#define TK_MATCH                          47
#define TK_LIKE_KW                        48
#define TK_BETWEEN                        49
#define TK_IN                             50
#define TK_ISNULL                         51
#define TK_NOTNULL                        52
#define TK_NE                             53
#define TK_EQ                             54
#define TK_GT                             55
#define TK_LE                             56
#define TK_LT                             57
#define TK_GE                             58
#define TK_ESCAPE                         59
#define TK_ID                             60
#define TK_COLUMNKW                       61
#define TK_DO                             62
#define TK_FOR                            63
#define TK_IGNORE                         64
#define TK_INITIALLY                      65
#define TK_INSTEAD                        66
#define TK_NO                             67
#define TK_KEY                            68
#define TK_OF                             69
#define TK_OFFSET                         70
#define TK_PRAGMA                         71
#define TK_RAISE                          72
#define TK_RECURSIVE                      73
#define TK_REPLACE                        74
#define TK_RESTRICT                       75
#define TK_ROW                            76
#define TK_ROWS                           77
#define TK_TRIGGER                        78
#define TK_VACUUM                         79
#define TK_VIEW                           80
#define TK_VIRTUAL                        81
#define TK_WITH                           82
#define TK_NULLS                          83
#define TK_FIRST                          84
#define TK_LAST                           85
#define TK_CURRENT                        86
#define TK_FOLLOWING                      87
#define TK_PARTITION                      88
#define TK_PRECEDING                      89
#define TK_RANGE                          90
#define TK_UNBOUNDED                      91
#define TK_EXCLUDE                        92
#define TK_GROUPS                         93
#define TK_OTHERS                         94
#define TK_TIES                           95
#define TK_GENERATED                      96
#define TK_ALWAYS                         97
#define TK_MATERIALIZED                   98
#define TK_REINDEX                        99
#define TK_RENAME                         100
#define TK_CTIME_KW                       101
#define TK_ANY                            102
#define TK_BITAND                         103
#define TK_BITOR                          104
#define TK_LSHIFT                         105
#define TK_RSHIFT                         106
#define TK_PLUS                           107
#define TK_MINUS                          108
#define TK_STAR                           109
#define TK_SLASH                          110
#define TK_REM                            111
#define TK_CONCAT                         112
#define TK_PTR                            113
#define TK_COLLATE                        114
#define TK_BITNOT                         115
#define TK_ON                             116
#define TK_INDEXED                        117
#define TK_STRING                         118
#define TK_JOIN_KW                        119
#define TK_CONSTRAINT                     120
#define TK_DEFAULT                        121
#define TK_NULL                           122
#define TK_PRIMARY                        123
#define TK_UNIQUE                         124
#define TK_CHECK                          125
#define TK_REFERENCES                     126
#define TK_AUTOINCR                       127
#define TK_INSERT                         128
#define TK_DELETE                         129
#define TK_UPDATE                         130
#define TK_SET                            131
#define TK_DEFERRABLE                     132
#define TK_FOREIGN                        133
#define TK_DROP                           134
#define TK_UNION                          135
#define TK_ALL                            136
#define TK_EXCEPT                         137
#define TK_INTERSECT                      138
#define TK_SELECT                         139
#define TK_VALUES                         140
#define TK_DISTINCT                       141
#define TK_DOT                            142
#define TK_FROM                           143
#define TK_JOIN                           144
#define TK_USING                          145
#define TK_ORDER                          146
#define TK_GROUP                          147
#define TK_HAVING                         148
#define TK_LIMIT                          149
#define TK_WHERE                          150
#define TK_RETURNING                      151
#define TK_INTO                           152
#define TK_NOTHING                        153
#define TK_FLOAT                          154
#define TK_BLOB                           155
#define TK_INTEGER                        156
#define TK_VARIABLE                       157
#define TK_CASE                           158
#define TK_WHEN                           159
#define TK_THEN                           160
#define TK_ELSE                           161
#define TK_INDEX                          162
#define TK_ALTER                          163
#define TK_ADD                            164
#define TK_WINDOW                         165
#define TK_OVER                           166
#define TK_FILTER                         167
#define TK_COLUMN                         168
#define TK_AGG_FUNCTION                   169
#define TK_AGG_COLUMN                     170
#define TK_TRUEFALSE                      171

#define TK_FUNCTION                       172
#define TK_UPLUS                          173
#define TK_UMINUS                         174
#define TK_TRUTH                          175
#define TK_REGISTER                       176
#define TK_VECTOR                         177
#define TK_SELECT_COLUMN                  178
173160
173161
173162
173163
173164
173165
173166
173167
173168
173169
173170
173171
173172
173173
173174
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
#define YYNOCODE 322
#define YYACTIONTYPE unsigned short int
#define YYWILDCARD 101
#define sqlite3ParserTOKENTYPE Token
typedef union {
  int yyinit;
  sqlite3ParserTOKENTYPE yy0;
  ExprList* yy14;
  With* yy59;
  Cte* yy67;







|







173447
173448
173449
173450
173451
173452
173453
173454
173455
173456
173457
173458
173459
173460
173461
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
#define YYNOCODE 322
#define YYACTIONTYPE unsigned short int
#define YYWILDCARD 102
#define sqlite3ParserTOKENTYPE Token
typedef union {
  int yyinit;
  sqlite3ParserTOKENTYPE yy0;
  ExprList* yy14;
  With* yy59;
  Cte* yy67;
173297
173298
173299
173300
173301
173302
173303
173304
173305
173306
173307
173308
173309
173310
173311
173312
173313
173314
173315
173316
173317
173318
173319
173320
173321
173322
173323
173324
173325
173326
173327
173328
173329
173330
173331
173332
173333
173334
173335
173336
173337

173338

173339
173340
173341
173342
173343
173344
173345
173346
173347
173348
173349
173350
173351


173352
173353
173354
173355
173356
173357
173358

173359
173360
173361
173362
173363
173364
173365

173366
173367
173368



173369
173370
173371

173372
173373
173374
173375
173376

173377
173378
173379
173380
173381
173382

173383
173384
173385
173386
173387
173388
173389

173390
173391
173392
173393
173394
173395
173396
173397
173398
173399
173400
173401
173402
173403
173404
173405
173406
173407
173408
173409
173410
173411

173412
173413
173414
173415
173416
173417

173418
173419
173420
173421
173422
173423
173424
173425
173426
173427


173428










173429
173430
173431
173432
173433
173434
173435
173436
173437
173438
173439
173440
173441
173442
173443
173444
173445
173446
173447
173448
173449
173450
173451
173452
173453
173454
173455
173456
173457
173458
173459
173460
173461
173462
173463
173464
173465
173466
173467
173468
173469
173470
173471
173472
173473
173474
173475
173476
173477
173478
173479
173480
173481
173482
173483
173484
173485
173486
173487
173488
173489
173490
173491
173492




173493
173494
173495
173496
173497
173498
173499
173500
173501
173502
173503
173504
173505
173506
173507
173508
173509
173510
173511
173512
173513

173514
173515
173516
173517
173518
173519
173520

173521
173522




173523
173524
173525
173526
173527
173528
173529
173530
173531
173532
173533
173534
173535
173536
173537
173538
173539
173540
173541
173542
173543
173544
173545
173546
173547
173548
173549
173550
173551
173552
173553
173554
173555
173556

173557
173558
173559
173560
173561
173562
173563

173564

173565
173566
173567
173568
173569
173570

173571
173572


173573
173574
173575
173576
173577
173578
173579
173580
173581
173582
173583
173584
173585
173586
173587
173588
173589
173590
173591
173592
173593
173594
173595
173596
173597
173598
173599
173600
173601
173602
173603
173604
173605
173606
173607

173608



173609
173610
173611

173612
173613
173614
173615




173616


173617
173618
173619
173620
173621
173622
173623
173624
173625
173626
173627
173628
173629
173630

173631
173632
173633
173634
173635
173636

173637
173638
173639
173640
173641
173642
173643
173644
173645
173646
173647
173648
173649
173650
173651
173652
173653
173654
173655
173656

173657
173658
173659
173660
173661
173662
173663
173664
173665
173666
173667
173668
173669
173670
173671
173672
173673
173674
173675
173676
173677
173678
173679
173680
173681
173682
173683
173684
173685
173686
173687
173688
173689
173690
173691
173692


173693
173694
173695
173696
173697
173698
173699
173700
173701
173702
173703
173704
173705
173706
173707
173708
173709
173710
173711
173712
173713
173714
173715
173716
173717
173718
173719
173720
173721
173722
173723
173724
173725
173726
173727
173728
173729
173730
173731
173732
173733
173734
173735
173736
173737
173738
173739

173740
173741
173742
173743
173744
173745
173746
173747
173748
173749
173750
173751
173752
173753
173754
173755
173756
173757
173758
173759
173760




173761
173762
173763
173764
173765
173766
173767
173768
173769
173770
173771
173772
173773
173774
173775
173776
173777
173778
173779
173780
173781
173782
173783
173784
173785
173786
173787
173788
173789
173790
173791
173792
173793
173794
173795
173796
173797
173798
173799
173800
173801
173802
173803
173804
173805
173806
173807
173808
173809
173810
173811
173812
173813
173814
173815
173816
173817
173818
173819
173820
173821
173822
173823
173824
173825
173826
173827
173828
173829
173830
173831
173832
173833
173834
173835
173836
173837
173838
173839
173840
173841
173842
173843
173844
173845
173846
173847
173848
173849
173850
173851
173852
173853
173854
173855
173856
173857
173858
173859
173860
173861
173862
173863
173864
173865
173866
173867
173868
173869
173870
173871
173872
173873
173874
173875
173876
173877
173878
**  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 (2167)
static const YYACTIONTYPE yy_action[] = {
 /*     0 */   576,  130,  127,  234, 1622,  550,  576, 1290, 1281,  576,
 /*    10 */   329,  576, 1300,  214,  576,  130,  127,  234,  578,  413,
 /*    20 */   578,  392, 1542,   51,   51,  524,  406, 1293,  530,   51,
 /*    30 */    51,  983,   51,   51,   82,   82, 1107,   61,   61,  984,
 /*    40 */  1107, 1292,  381,  137,  138,   91, 1228, 1228, 1063, 1066,
 /*    50 */  1053, 1053,  135,  135,  136,  136,  136,  136, 1577,  413,
 /*    60 */   288,  288,    7,  288,  288,  423, 1050, 1050, 1064, 1067,
 /*    70 */   290,  557,  493,  573,  525,  562,  573,  498,  562,  483,
 /*    80 */   531,  264,  231,  137,  138,   91, 1228, 1228, 1063, 1066,
 /*    90 */  1053, 1053,  135,  135,  136,  136,  136,  136,  130,  127,
 /*   100 */   234, 1506,  134,  134,  134,  134,  133,  133,  132,  132,
 /*   110 */   132,  131,  128,  451, 1204, 1255,    1,    1,  582,    2,
 /*   120 */  1259, 1571,  421, 1582,  380,  321, 1174,  155, 1174, 1584,
 /*   130 */   413,  379, 1582,  544, 1341,  331,  112,  570,  570,  570,
 /*   140 */   294, 1054,  134,  134,  134,  134,  133,  133,  132,  132,
 /*   150 */   132,  131,  128,  451,  137,  138,   91, 1228, 1228, 1063,
 /*   160 */  1066, 1053, 1053,  135,  135,  136,  136,  136,  136,  288,
 /*   170 */   288, 1204, 1205, 1204,  257,  288,  288,  511,  508,  507,
 /*   180 */   139,  456,  573,  214,  562,  448,  447,  506,  573, 1616,
 /*   190 */   562,  136,  136,  136,  136,  129,  401,  245,  134,  134,
 /*   200 */   134,  134,  133,  133,  132,  132,  132,  131,  128,  451,
 /*   210 */   283,  472,  346,  134,  134,  134,  134,  133,  133,  132,
 /*   220 */   132,  132,  131,  128,  451,  574,  157,  936,  936,  455,
 /*   230 */   229,  522, 1236,  413, 1236,  136,  136,  136,  136,  134,
 /*   240 */   134,  134,  134,  133,  133,  132,  132,  132,  131,  128,
 /*   250 */   451,  132,  132,  132,  131,  128,  451,  137,  138,   91,
 /*   260 */  1228, 1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,
 /*   270 */   136,  136,  130,  127,  234,  451,  576,  413,  398, 1249,
 /*   280 */   182,   93,   94,  134,  134,  134,  134,  133,  133,  132,
 /*   290 */   132,  132,  131,  128,  451,  382,  388, 1204,  384,   82,
 /*   300 */    82,  137,  138,   91, 1228, 1228, 1063, 1066, 1053, 1053,
 /*   310 */   135,  135,  136,  136,  136,  136,  134,  134,  134,  134,

 /*   320 */   133,  133,  132,  132,  132,  131,  128,  451,  133,  133,

 /*   330 */   132,  132,  132,  131,  128,  451,  557, 1204,  303,  320,
 /*   340 */   567,  123,  568,  481,    4,  556, 1149, 1657, 1628, 1657,
 /*   350 */    45,  130,  127,  234, 1204, 1205, 1204, 1250,  571, 1169,
 /*   360 */   134,  134,  134,  134,  133,  133,  132,  132,  132,  131,
 /*   370 */   128,  451, 1169,  288,  288, 1169, 1019,  576,  423, 1019,
 /*   380 */   413,  452, 1602,  582,    2, 1259,  573,   44,  562,   96,
 /*   390 */   321,  111,  155,  565, 1204, 1205, 1204,  523,  523, 1341,
 /*   400 */    82,   82,    7,   44,  137,  138,   91, 1228, 1228, 1063,
 /*   410 */  1066, 1053, 1053,  135,  135,  136,  136,  136,  136,  296,
 /*   420 */  1149, 1658, 1040, 1658, 1204, 1147,  320,  567,  121,  121,
 /*   430 */   344,  467,  332,  344,  288,  288,  122,  557,  452,  577,
 /*   440 */   452, 1169, 1169, 1028,  320,  567,  439,  573,  212,  562,
 /*   450 */  1339, 1451,  547,  532, 1169, 1169, 1598, 1169, 1169,  417,


 /*   460 */   320,  567,  245,  134,  134,  134,  134,  133,  133,  132,
 /*   470 */   132,  132,  131,  128,  451, 1028, 1028, 1030, 1031,   35,
 /*   480 */    44, 1204, 1205, 1204,  473,  288,  288, 1328,  413, 1307,
 /*   490 */   373, 1595,  360,  227,  455, 1204,  197, 1328,  573, 1147,
 /*   500 */   562, 1333, 1333,  275,  576, 1188,  576,  341,   46,  198,
 /*   510 */   538,  219,  137,  138,   91, 1228, 1228, 1063, 1066, 1053,
 /*   520 */  1053,  135,  135,  136,  136,  136,  136,   19,   19,   19,

 /*   530 */    19,  413,  581, 1204, 1259,  512, 1204,  320,  567,  321,
 /*   540 */   944,  155,  426,  492,  431,  943, 1204,  489, 1341, 1450,
 /*   550 */   533, 1277, 1204, 1205, 1204,  137,  138,   91, 1228, 1228,
 /*   560 */  1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,  136,
 /*   570 */   575,  134,  134,  134,  134,  133,  133,  132,  132,  132,
 /*   580 */   131,  128,  451,  288,  288,  529,  288,  288,  373, 1595,
 /*   590 */  1204, 1205, 1204, 1204, 1205, 1204,  573,  487,  562,  573,

 /*   600 */   889,  562,  413, 1204, 1205, 1204,  886,   40,   22,   22,
 /*   610 */   222,  245,  526, 1449,  134,  134,  134,  134,  133,  133,
 /*   620 */   132,  132,  132,  131,  128,  451,  137,  138,   91, 1228,



 /*   630 */  1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,
 /*   640 */   136,  413,  182,  455, 1204,  879,  257,  288,  288,  511,
 /*   650 */   508,  507,  373, 1595, 1568, 1331, 1331,  576,  889,  506,

 /*   660 */   573,   44,  562,  560,  378,  137,  138,   91, 1228, 1228,
 /*   670 */  1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,  136,
 /*   680 */    82,   82,  423,  576,  375,  134,  134,  134,  134,  133,
 /*   690 */   133,  132,  132,  132,  131,  128,  451,  298,  288,  288,
 /*   700 */   461, 1204, 1205, 1204, 1204,  535,   19,   19,  232,  550,

 /*   710 */  1281,  573,  413,  562,  386,  437, 1187,  536,  320,  567,
 /*   720 */   364,  433, 1279,  432,  134,  134,  134,  134,  133,  133,
 /*   730 */   132,  132,  132,  131,  128,  451,  137,  138,   91, 1228,
 /*   740 */  1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,
 /*   750 */   136,  413,  213,  949, 1169, 1041,  449,  449,  449,  548,
 /*   760 */   548, 1204, 1205, 1204,    7,  540, 1570, 1169,  377,  576,

 /*   770 */  1169,    5, 1204, 1552,    3,  137,  138,   91, 1228, 1228,
 /*   780 */  1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,  136,
 /*   790 */   576,  514,   19,   19, 1554,  134,  134,  134,  134,  133,
 /*   800 */   133,  132,  132,  132,  131,  128,  451,  306, 1204,  434,
 /*   810 */  1435, 1204, 1435,   19,   19,  274,  291,  372,  517,  367,
 /*   820 */   516,  262,  413,  539,  551,  551, 1024,  363,  438, 1204,
 /*   830 */  1205, 1204, 1659,  399,  134,  134,  134,  134,  133,  133,

 /*   840 */   132,  132,  132,  131,  128,  451,  137,  138,   91, 1228,
 /*   850 */  1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,
 /*   860 */   136,  413,  481,  282,  282, 1204, 1205, 1204, 1204, 1205,
 /*   870 */  1204,  131,  128,  451, 1568, 1568,  573, 1627,  562,  911,
 /*   880 */   576,  428,  285,  429,  969,  137,  138,   91, 1228, 1228,
 /*   890 */  1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,  136,
 /*   900 */   553,  576,  457,   19,   19,  134,  134,  134,  134,  133,
 /*   910 */   133,  132,  132,  132,  131,  128,  451, 1345,  206,  158,
 /*   920 */  1040, 1550,   48,   50,   19,   19, 1204,  289,  289,  573,
 /*   930 */  1105,  562,  413, 1110, 1110,  495, 1125, 1029,  299,  207,
 /*   940 */   573, 1028,  562,  403,  134,  134,  134,  134,  133,  133,
 /*   950 */   132,  132,  132,  131,  128,  451,  137,  138,   91, 1228,
 /*   960 */  1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,
 /*   970 */   136,  576,  375, 1028, 1028, 1030,  576,  233,  288,  288,
 /*   980 */   481,  576, 1126, 1204, 1205, 1204, 1569, 1569,  377,  377,
 /*   990 */   576,  573,  558,  562,   82,   82, 1204, 1127,  481,   82,
 /*  1000 */    82,  115,  969, 1188,   82,   82,  576,  902,  141,  479,
 /*  1010 */   971,  442, 1128,   81,   81,  134,  134,  134,  134,  133,
 /*  1020 */   133,  132,  132,  132,  131,  128,  451,  288,  288,   19,
 /*  1030 */    19,  316,  498,  922,  576,  413,  317, 1568,  515,   23,
 /*  1040 */   573,  557,  562,  923,  552, 1575,  903,  472,  346,    7,
 /*  1050 */   559,  532,  267, 1204, 1205, 1204,  302,   82,   82,  137,

 /*  1060 */   138,   91, 1228, 1228, 1063, 1066, 1053, 1053,  135,  135,
 /*  1070 */   136,  136,  136,  136,  304,  576,  387, 1541,  424,  413,
 /*  1080 */   970,  166,  460, 1204,  215,   47, 1568, 1224,  260,  259,
 /*  1090 */   258,  487,  410,  409,  445, 1368,  315,  336,   82,   82,
 /*  1100 */   460,  459,  435,  137,  138,   91, 1228, 1228, 1063, 1066,
 /*  1110 */  1053, 1053,  135,  135,  136,  136,  136,  136,  134,  134,

 /*  1120 */   134,  134,  133,  133,  132,  132,  132,  131,  128,  451,
 /*  1130 */   448,  447,  576,  358,   49,  446,  850,  851,  852, 1233,
 /*  1140 */  1204, 1205, 1204,  487, 1235, 1224,  214,  108,  533, 1569,
 /*  1150 */   498,  377, 1234, 1576,  498,   82,   82,    7,  333,  412,
 /*  1160 */   335,  576,  134,  134,  134,  134,  133,  133,  132,  132,
 /*  1170 */   132,  131,  128,  451,  460,  119,  534, 1236,  498, 1236,
 /*  1180 */   111,  307,  413,  307,  145,  145, 1511,   10,  160,  267,
 /*  1190 */   324,  343,  450, 1435,  353, 1505,  356,  325, 1569, 1340,
 /*  1200 */   377,  498,  413,  520, 1511, 1513,  137,  138,   91, 1228,
 /*  1210 */  1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,


 /*  1220 */   136,  576,  413, 1336, 1224,  874,  137,  126,   91, 1228,










 /*  1230 */  1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,
 /*  1240 */   136,  862,  334,  305,  147,  147,  351,  138,   91, 1228,
 /*  1250 */  1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,
 /*  1260 */   136,  398, 1148,    6,  430,  134,  134,  134,  134,  133,
 /*  1270 */   133,  132,  132,  132,  131,  128,  451,  882, 1511,  576,
 /*  1280 */  1574,  893, 1224,  874,    7,  134,  134,  134,  134,  133,
 /*  1290 */   133,  132,  132,  132,  131,  128,  451,  576,  546,  576,
 /*  1300 */   470,    6,   66,   66,  576,  134,  134,  134,  134,  133,
 /*  1310 */   133,  132,  132,  132,  131,  128,  451,  545, 1040, 1207,
 /*  1320 */    67,   67,   21,   21,  576,  413, 1180,   53,   53,  969,
 /*  1330 */  1282,  419,  328, 1435,  882, 1029, 1435, 1573,  503, 1028,
 /*  1340 */  1250,    7,  488, 1085,  576,  463,  297,   68,   68,  463,
 /*  1350 */   297,   91, 1228, 1228, 1063, 1066, 1053, 1053,  135,  135,
 /*  1360 */   136,  136,  136,  136,  576,  261,  576,   54,   54, 1126,
 /*  1370 */   576, 1028, 1028, 1030,  576,  209,  238, 1207, 1180,  576,
 /*  1380 */   471, 1498,  576, 1380, 1127,  287,  231,   69,   69,   70,
 /*  1390 */    70,  569,  419,   71,   71,  420,  184,   72,   72, 1128,
 /*  1400 */   576, 1188,   73,   73,  494,   55,   55,  443,  134,  134,
 /*  1410 */   134,  134,  133,  133,  132,  132,  132,  131,  128,  451,
 /*  1420 */   564, 1244,  233,   56,   56,   97,  218,  485,  123,  568,
 /*  1430 */   576,    4,  576,  983,  418,  576,  227,  576,  161,  576,
 /*  1440 */    16,  984,  477,  576, 1223,  571,  576,  969,  123,  568,
 /*  1450 */   363,    4,  576,   57,   57,   59,   59,    9,   60,   60,
 /*  1460 */    74,   74,   75,   75,  108,  571,   76,   76,  452,   20,
 /*  1470 */    20,  464,  576,  465,  576,   77,   77,  221, 1379,  125,
 /*  1480 */   565,  576,  411,  576,  411,  242,  261,  576,  452,  576,
 /*  1490 */   519,  474,  478,  534,  542,  143,  143,  144,  144,  541,
 /*  1500 */   565,  466,  411,  411,   78,   78,   62,   62,  576, 1040,
 /*  1510 */    79,   79,   63,   63,  542,  121,  121,  944, 1144,  543,
 /*  1520 */   400,  462,  943,  122,  486,  452,  577,  452, 1557, 1040,
 /*  1530 */  1028,   80,   80,  319,  576,  121,  121,  337,   38,  123,
 /*  1540 */   568, 1530,    4,  122,  411,  452,  577,  452,  576,  120,
 /*  1550 */  1028,  117,  576,  528,  576,  418,  571,   64,   64,  293,
 /*  1560 */   109,  222, 1028, 1028, 1030, 1031,   35,  475,  342,   39,
 /*  1570 */   111,  170,  170,  901,  900,  171,  171,   87,   87,  452,
 /*  1580 */   908,  909, 1028, 1028, 1030, 1031,   35,  986,  987,  292,
 /*  1590 */   300,  565, 1188,  323,  396,  396,  395,  277,  393,  553,
 /*  1600 */  1092,  859,  244, 1032, 1529,  542,  576,  371,  490, 1021,
 /*  1610 */   541,  266, 1188,  480,  239,  266,  327,  370,  348,  576,
 /*  1620 */  1040,  482, 1376,  266,  326,  352,  121,  121,  355,   65,
 /*  1630 */    65, 1153,  123,  568,  122,    4,  452,  577,  452,  357,
 /*  1640 */   576, 1028,   83,   83,  576,  347,  576,  111, 1311,  571,
 /*  1650 */   504,  361,  263,  111,  241, 1366,  359,  165, 1092,  111,
 /*  1660 */  1324, 1032,  175,  146,  146,   43, 1310,   84,   84,  168,
 /*  1670 */   168, 1309,  452, 1028, 1028, 1030, 1031,   35, 1601, 1192,
 /*  1680 */   454, 1308,  240,  292,  565,  366,  376, 1389,  396,  396,
 /*  1690 */   395,  277,  393, 1434, 1088,  859,  263,  974,  942,  266,
 /*  1700 */   125,  576,  939, 1188,  125, 1104, 1362, 1104,  239,  576,
 /*  1710 */   327,  123,  568, 1040,    4,  205, 1374,  414,  326,  121,
 /*  1720 */   121,  948,  320,  567,  148,  148,  576,  122,  571,  452,
 /*  1730 */   577,  452,  142,  142, 1028,  563, 1103,  576, 1103, 1589,
 /*  1740 */  1439,  576,  872,  941,  159,  125,  458, 1289,  241,  169,
 /*  1750 */   169,  452, 1280, 1268, 1267, 1269,  175,  576, 1609,   43,
 /*  1760 */   162,  162,  499,  565,  152,  152, 1028, 1028, 1030, 1031,
 /*  1770 */    35,  576,  280,  167, 1359,  312,  240,   12,  313,  576,
 /*  1780 */   151,  151,  314,   90,  568,  224,    4,  397,  237,  339,
 /*  1790 */   509,  576, 1040, 1307,  149,  149, 1188, 1421,  121,  121,
 /*  1800 */   571,  576,  150,  150, 1416,  576,  122, 1409,  452,  577,
 /*  1810 */   452,  414,  295, 1028,   86,   86,  320,  567,  340,  576,
 /*  1820 */   345, 1426, 1425,  452,   88,   88,  301,  576,   85,   85,
 /*  1830 */   404,  484,  555,  228,  369,  565, 1502, 1501,  210, 1371,
 /*  1840 */   458, 1372,   52,   52,  211, 1028, 1028, 1030, 1031,   35,
 /*  1850 */    58,   58, 1370, 1369,  566,  391,  223, 1612, 1244,  270,
 /*  1860 */  1549,  186, 1547, 1241, 1040,  422,   96,  235,  195,  180,




 /*  1870 */   121,  121,   92,  220, 1507, 1188, 1422,   95,  122,  188,
 /*  1880 */   452,  577,  452, 1192,  454, 1028,  468,  292,  190,  191,
 /*  1890 */    13,  192,  396,  396,  395,  277,  393,  469,  502,  859,
 /*  1900 */   193,  247,  109,  402,  554, 1428, 1427,   14, 1430,  491,
 /*  1910 */   476,  199,  239,  405,  327, 1496,  251, 1028, 1028, 1030,
 /*  1920 */  1031,   35,  326,  102,  497,  281,  253,  203, 1518,  350,
 /*  1930 */   354,  500,  254,  407, 1270,  255,  518,  123,  568,  436,
 /*  1940 */     4, 1327, 1318,  104, 1326,  893, 1325, 1188,  229, 1317,
 /*  1950 */  1297,  440,  241, 1626,  571, 1625,  408, 1296,  368, 1295,
 /*  1960 */   175, 1624, 1594,   43,  527,  441,  310,  311,  374,  268,
 /*  1970 */   269,  444, 1580, 1394, 1579,  140,  553,  452,   11, 1393,
 /*  1980 */   240, 1483,  385,  110,  318,  537,  116,  216, 1350,  565,
 /*  1990 */    42,  383,  389,  579, 1349,  390, 1198,  276,  278,  279,
 /*  2000 */   580, 1265, 1260,  415,  416,  172,  185, 1534, 1535, 1533,
 /*  2010 */  1532,  156,  173,   89,  308,  414,  225,  846, 1040,  453,
 /*  2020 */   320,  567,  174,  217,  121,  121,  226,  322,  154,  236,
 /*  2030 */  1102, 1100,  122,  330,  452,  577,  452,  187,  176, 1028,
 /*  2040 */  1223,  243,  189,  925,  458,  246,  338, 1116,  194,  177,
 /*  2050 */   178,  425,   98,  196,  179,  427,   99,  100,  101, 1119,
 /*  2060 */   248, 1115,  163,  249,   24,  250, 1108, 1238,  349,  266,
 /*  2070 */   200, 1028, 1028, 1030, 1031,   35,  496,  252,  201,   15,

 /*  2080 */   370,  861,  501,  256,  202,  513,  505,  103,   25,  510,
 /*  2090 */   362,   26,  891,  105,  365,  309,  904,  164,   27,  521,
 /*  2100 */   106, 1188, 1185, 1069,  978, 1155,  107,   17, 1154,  181,
 /*  2110 */   230,  284,  286,  204,  972,  125, 1175,  265,   28, 1171,
 /*  2120 */    29,   30, 1173, 1179, 1160, 1178,   31,   41,   32,  208,
 /*  2130 */   549,   33,  111,  113, 1083, 1070,  114,    8, 1068, 1072,
 /*  2140 */    34, 1073,  561, 1124,  118,  271,   36,   18, 1194, 1033,

 /*  2150 */   873,  124,  394,   37, 1193,  935, 1256,  572,  183,  153,
 /*  2160 */  1256, 1256,  272, 1256, 1256,  273, 1617,




};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */   194,  276,  277,  278,  216,  194,  194,  217,  194,  194,
 /*    10 */   194,  194,  224,  194,  194,  276,  277,  278,  204,   19,
 /*    20 */   206,  202,  297,  217,  218,  205,  207,  217,  205,  217,
 /*    30 */   218,   31,  217,  218,  217,  218,   29,  217,  218,   39,
 /*    40 */    33,  217,  220,   43,   44,   45,   46,   47,   48,   49,
 /*    50 */    50,   51,   52,   53,   54,   55,   56,   57,  312,   19,
 /*    60 */   240,  241,  316,  240,  241,  194,   46,   47,   48,   49,
 /*    70 */    22,  254,   65,  253,  254,  255,  253,  194,  255,  194,
 /*    80 */   263,  258,  259,   43,   44,   45,   46,   47,   48,   49,
 /*    90 */    50,   51,   52,   53,   54,   55,   56,   57,  276,  277,
 /*   100 */   278,  285,  102,  103,  104,  105,  106,  107,  108,  109,
 /*   110 */   110,  111,  112,  113,   59,  186,  187,  188,  189,  190,
 /*   120 */   191,  310,  239,  317,  318,  196,   86,  198,   88,  317,
 /*   130 */    19,  319,  317,  318,  205,  264,   25,  211,  212,  213,
 /*   140 */   205,  121,  102,  103,  104,  105,  106,  107,  108,  109,
 /*   150 */   110,  111,  112,  113,   43,   44,   45,   46,   47,   48,
 /*   160 */    49,   50,   51,   52,   53,   54,   55,   56,   57,  240,
 /*   170 */   241,  116,  117,  118,  119,  240,  241,  122,  123,  124,
 /*   180 */    69,  298,  253,  194,  255,  106,  107,  132,  253,  141,
 /*   190 */   255,   54,   55,   56,   57,   58,  207,  268,  102,  103,
 /*   200 */   104,  105,  106,  107,  108,  109,  110,  111,  112,  113,
 /*   210 */   214,  128,  129,  102,  103,  104,  105,  106,  107,  108,
 /*   220 */   109,  110,  111,  112,  113,  134,   25,  136,  137,  300,
 /*   230 */   165,  166,  153,   19,  155,   54,   55,   56,   57,  102,
 /*   240 */   103,  104,  105,  106,  107,  108,  109,  110,  111,  112,
 /*   250 */   113,  108,  109,  110,  111,  112,  113,   43,   44,   45,
 /*   260 */    46,   47,   48,   49,   50,   51,   52,   53,   54,   55,
 /*   270 */    56,   57,  276,  277,  278,  113,  194,   19,   22,   23,
 /*   280 */   194,   67,   24,  102,  103,  104,  105,  106,  107,  108,
 /*   290 */   109,  110,  111,  112,  113,  220,  250,   59,  252,  217,
 /*   300 */   218,   43,   44,   45,   46,   47,   48,   49,   50,   51,
 /*   310 */    52,   53,   54,   55,   56,   57,  102,  103,  104,  105,

 /*   320 */   106,  107,  108,  109,  110,  111,  112,  113,  106,  107,
 /*   330 */   108,  109,  110,  111,  112,  113,  254,   59,  205,  138,
 /*   340 */   139,   19,   20,  194,   22,  263,   22,   23,  231,   25,
 /*   350 */    72,  276,  277,  278,  116,  117,  118,  101,   36,   76,
 /*   360 */   102,  103,  104,  105,  106,  107,  108,  109,  110,  111,
 /*   370 */   112,  113,   89,  240,  241,   92,   73,  194,  194,   73,
 /*   380 */    19,   59,  188,  189,  190,  191,  253,   81,  255,  151,

 /*   390 */   196,   25,  198,   71,  116,  117,  118,  311,  312,  205,

 /*   400 */   217,  218,  316,   81,   43,   44,   45,   46,   47,   48,
 /*   410 */    49,   50,   51,   52,   53,   54,   55,   56,   57,  270,
 /*   420 */    22,   23,  100,   25,   59,  101,  138,  139,  106,  107,
 /*   430 */   127,  128,  129,  127,  240,  241,  114,  254,  116,  117,
 /*   440 */   118,   76,   76,  121,  138,  139,  263,  253,  264,  255,
 /*   450 */   205,  275,   87,   19,   89,   89,  194,   92,   92,  199,

 /*   460 */   138,  139,  268,  102,  103,  104,  105,  106,  107,  108,
 /*   470 */   109,  110,  111,  112,  113,  153,  154,  155,  156,  157,


 /*   480 */    81,  116,  117,  118,  129,  240,  241,  224,   19,  226,
 /*   490 */   314,  315,   23,   25,  300,   59,   22,  234,  253,  101,
 /*   500 */   255,  236,  237,   26,  194,  183,  194,  152,   72,   22,
 /*   510 */   145,  150,   43,   44,   45,   46,   47,   48,   49,   50,
 /*   520 */    51,   52,   53,   54,   55,   56,   57,  217,  218,  217,
 /*   530 */   218,   19,  189,   59,  191,   23,   59,  138,  139,  196,
 /*   540 */   135,  198,  232,  283,  232,  140,   59,  287,  205,  275,
 /*   550 */   116,  205,  116,  117,  118,   43,   44,   45,   46,   47,
 /*   560 */    48,   49,   50,   51,   52,   53,   54,   55,   56,   57,
 /*   570 */   194,  102,  103,  104,  105,  106,  107,  108,  109,  110,
 /*   580 */   111,  112,  113,  240,  241,  194,  240,  241,  314,  315,
 /*   590 */   116,  117,  118,  116,  117,  118,  253,  194,  255,  253,
 /*   600 */    59,  255,   19,  116,  117,  118,   23,   22,  217,  218,
 /*   610 */   142,  268,  205,  275,  102,  103,  104,  105,  106,  107,
 /*   620 */   108,  109,  110,  111,  112,  113,   43,   44,   45,   46,
 /*   630 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*   640 */    57,   19,  194,  300,   59,   23,  119,  240,  241,  122,
 /*   650 */   123,  124,  314,  315,  194,  236,  237,  194,  117,  132,
 /*   660 */   253,   81,  255,  205,  194,   43,   44,   45,   46,   47,
 /*   670 */    48,   49,   50,   51,   52,   53,   54,   55,   56,   57,
 /*   680 */   217,  218,  194,  194,  194,  102,  103,  104,  105,  106,
 /*   690 */   107,  108,  109,  110,  111,  112,  113,  294,  240,  241,
 /*   700 */   120,  116,  117,  118,   59,  194,  217,  218,  194,  194,
 /*   710 */   194,  253,   19,  255,  194,   19,   23,  254,  138,  139,
 /*   720 */    24,  232,  206,  233,  102,  103,  104,  105,  106,  107,
 /*   730 */   108,  109,  110,  111,  112,  113,   43,   44,   45,   46,
 /*   740 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*   750 */    57,   19,  264,  108,   76,   23,  211,  212,  213,  311,
 /*   760 */   312,  116,  117,  118,  316,   87,  306,   89,  308,  194,
 /*   770 */    92,   22,   59,  194,   22,   43,   44,   45,   46,   47,
 /*   780 */    48,   49,   50,   51,   52,   53,   54,   55,   56,   57,
 /*   790 */   194,   95,  217,  218,  194,  102,  103,  104,  105,  106,
 /*   800 */   107,  108,  109,  110,  111,  112,  113,  232,   59,  113,
 /*   810 */   194,   59,  194,  217,  218,  119,  120,  121,  122,  123,
 /*   820 */   124,  125,   19,  145,  309,  310,   23,  131,  232,  116,

 /*   830 */   117,  118,  303,  304,  102,  103,  104,  105,  106,  107,



 /*   840 */   108,  109,  110,  111,  112,  113,   43,   44,   45,   46,
 /*   850 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*   860 */    57,   19,  194,  240,  241,  116,  117,  118,  116,  117,

 /*   870 */   118,  111,  112,  113,  194,  194,  253,   23,  255,   25,
 /*   880 */   194,  265,   23,  265,   25,   43,   44,   45,   46,   47,
 /*   890 */    48,   49,   50,   51,   52,   53,   54,   55,   56,   57,
 /*   900 */   145,  194,  194,  217,  218,  102,  103,  104,  105,  106,




 /*   910 */   107,  108,  109,  110,  111,  112,  113,  241,  232,  164,


 /*   920 */   100,  194,  242,  242,  217,  218,   59,  240,  241,  253,
 /*   930 */    11,  255,   19,  127,  128,  129,   23,  117,  270,  232,
 /*   940 */   253,  121,  255,  205,  102,  103,  104,  105,  106,  107,
 /*   950 */   108,  109,  110,  111,  112,  113,   43,   44,   45,   46,
 /*   960 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*   970 */    57,  194,  194,  153,  154,  155,  194,  118,  240,  241,
 /*   980 */   194,  194,   12,  116,  117,  118,  306,  306,  308,  308,
 /*   990 */   194,  253,  205,  255,  217,  218,   59,   27,  194,  217,
 /*  1000 */   218,  159,  143,  183,  217,  218,  194,   35,   22,  271,
 /*  1010 */   143,  233,   42,  217,  218,  102,  103,  104,  105,  106,
 /*  1020 */   107,  108,  109,  110,  111,  112,  113,  240,  241,  217,
 /*  1030 */   218,  254,  194,   63,  194,   19,  254,  194,   66,   22,
 /*  1040 */   253,  254,  255,   73,  232,  312,   74,  128,  129,  316,
 /*  1050 */   263,   19,   24,  116,  117,  118,  270,  217,  218,   43,

 /*  1060 */    44,   45,   46,   47,   48,   49,   50,   51,   52,   53,
 /*  1070 */    54,   55,   56,   57,  270,  194,  280,  239,   61,   19,
 /*  1080 */   143,   23,  194,   59,   24,  242,  194,   59,  127,  128,
 /*  1090 */   129,  194,  106,  107,  254,  261,  262,   16,  217,  218,
 /*  1100 */   212,  213,  130,   43,   44,   45,   46,   47,   48,   49,
 /*  1110 */    50,   51,   52,   53,   54,   55,   56,   57,  102,  103,

 /*  1120 */   104,  105,  106,  107,  108,  109,  110,  111,  112,  113,
 /*  1130 */   106,  107,  194,   16,  242,  254,    7,    8,    9,  115,
 /*  1140 */   116,  117,  118,  194,  120,  117,  194,  115,  116,  306,
 /*  1150 */   194,  308,  128,  312,  194,  217,  218,  316,   77,  207,
 /*  1160 */    79,  194,  102,  103,  104,  105,  106,  107,  108,  109,
 /*  1170 */   110,  111,  112,  113,  286,  159,  144,  153,  194,  155,
 /*  1180 */    25,  229,   19,  231,  217,  218,  194,   22,   22,   24,
 /*  1190 */   194,  294,  254,  194,   77,  239,   79,  194,  306,  239,
 /*  1200 */   308,  194,   19,  145,  212,  213,   43,   44,   45,   46,
 /*  1210 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*  1220 */    57,  194,   19,  239,   59,   59,   43,   44,   45,   46,
 /*  1230 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*  1240 */    57,   21,  161,  294,  217,  218,  239,   44,   45,   46,
 /*  1250 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*  1260 */    57,   22,   23,  214,  265,  102,  103,  104,  105,  106,
 /*  1270 */   107,  108,  109,  110,  111,  112,  113,   59,  286,  194,
 /*  1280 */   312,  126,  117,  117,  316,  102,  103,  104,  105,  106,
 /*  1290 */   107,  108,  109,  110,  111,  112,  113,  194,   66,  194,
 /*  1300 */    80,  214,  217,  218,  194,  102,  103,  104,  105,  106,
 /*  1310 */   107,  108,  109,  110,  111,  112,  113,   85,  100,   59,

 /*  1320 */   217,  218,  217,  218,  194,   19,   94,  217,  218,   25,
 /*  1330 */   209,  210,  194,  194,  116,  117,  194,  312,   19,  121,
 /*  1340 */   101,  316,  293,  123,  194,  262,  262,  217,  218,  266,
 /*  1350 */   266,   45,   46,   47,   48,   49,   50,   51,   52,   53,
 /*  1360 */    54,   55,   56,   57,  194,   46,  194,  217,  218,   12,
 /*  1370 */   194,  153,  154,  155,  194,  288,   15,  117,  146,  194,
 /*  1380 */   293,  161,  194,  194,   27,  258,  259,  217,  218,  217,
 /*  1390 */   218,  209,  210,  217,  218,  301,  302,  217,  218,   42,
 /*  1400 */   194,  183,  217,  218,  265,  217,  218,  265,  102,  103,
 /*  1410 */   104,  105,  106,  107,  108,  109,  110,  111,  112,  113,
 /*  1420 */    63,   60,  118,  217,  218,  149,  150,   19,   19,   20,
 /*  1430 */   194,   22,  194,   31,  115,  194,   25,  194,   22,  194,
 /*  1440 */    24,   39,  115,  194,   25,   36,  194,  143,   19,   20,
 /*  1450 */   131,   22,  194,  217,  218,  217,  218,   48,  217,  218,
 /*  1460 */   217,  218,  217,  218,  115,   36,  217,  218,   59,  217,
 /*  1470 */   218,  245,  194,  245,  194,  217,  218,  150,  194,   25,
 /*  1480 */    71,  194,  256,  194,  256,   24,   46,  194,   59,  194,
 /*  1490 */   108,  245,  245,  144,   85,  217,  218,  217,  218,   90,
 /*  1500 */    71,  194,  256,  256,  217,  218,  217,  218,  194,  100,
 /*  1510 */   217,  218,  217,  218,   85,  106,  107,  135,   23,   90,
 /*  1520 */    25,  271,  140,  114,  116,  116,  117,  118,  194,  100,
 /*  1530 */   121,  217,  218,  245,  194,  106,  107,  194,   22,   19,
 /*  1540 */    20,  194,   22,  114,  256,  116,  117,  118,  194,  158,
 /*  1550 */   121,  160,  194,   19,  194,  115,   36,  217,  218,   99,
 /*  1560 */   149,  142,  153,  154,  155,  156,  157,  129,   23,   53,
 /*  1570 */    25,  217,  218,  120,  121,  217,  218,  217,  218,   59,
 /*  1580 */     7,    8,  153,  154,  155,  156,  157,   83,   84,    5,
 /*  1590 */   152,   71,  183,  133,   10,   11,   12,   13,   14,  145,
 /*  1600 */    59,   17,  141,   59,  194,   85,  194,  121,  194,   23,
 /*  1610 */    90,   25,  183,   23,   30,   25,   32,  131,  194,  194,
 /*  1620 */   100,   23,  194,   25,   40,  194,  106,  107,  194,  217,
 /*  1630 */   218,   97,   19,   20,  114,   22,  116,  117,  118,  194,
 /*  1640 */   194,  121,  217,  218,  194,   23,  194,   25,  227,   36,
 /*  1650 */    23,   23,   25,   25,   70,  260,  194,   23,  117,   25,
 /*  1660 */   194,  117,   78,  217,  218,   81,  227,  217,  218,  217,
 /*  1670 */   218,  227,   59,  153,  154,  155,  156,  157,    0,    1,


 /*  1680 */     2,  194,   98,    5,   71,  194,  194,  194,   10,   11,
 /*  1690 */    12,   13,   14,  194,   23,   17,   25,   23,   23,   25,
 /*  1700 */    25,  194,   23,  183,   25,  153,  194,  155,   30,  194,
 /*  1710 */    32,   19,   20,  100,   22,  257,  194,  133,   40,  106,
 /*  1720 */   107,  108,  138,  139,  217,  218,  194,  114,   36,  116,
 /*  1730 */   117,  118,  217,  218,  121,  237,  153,  194,  155,  321,
 /*  1740 */   194,  194,   23,   23,   25,   25,  162,  194,   70,  217,
 /*  1750 */   218,   59,  194,  194,  194,  194,   78,  194,  194,   81,
 /*  1760 */   217,  218,  290,   71,  217,  218,  153,  154,  155,  156,
 /*  1770 */   157,  194,  289,  243,  257,  257,   98,  244,  257,  194,
 /*  1780 */   217,  218,  257,   19,   20,  215,   22,  192,  299,  295,
 /*  1790 */   221,  194,  100,  226,  217,  218,  183,  273,  106,  107,
 /*  1800 */    36,  194,  217,  218,  269,  194,  114,  269,  116,  117,
 /*  1810 */   118,  133,  246,  121,  217,  218,  138,  139,  247,  194,
 /*  1820 */   246,  273,  273,   59,  217,  218,  247,  194,  217,  218,
 /*  1830 */   273,  295,  140,  230,  220,   71,  220,  220,  250,  261,
 /*  1840 */   162,  261,  217,  218,  250,  153,  154,  155,  156,  157,
 /*  1850 */   217,  218,  261,  261,  282,  246,  244,  197,   60,  141,
 /*  1860 */   201,  299,  201,   38,  100,  201,  151,  299,   22,   43,
 /*  1870 */   106,  107,  296,  150,  285,  183,  274,  296,  114,  235,
 /*  1880 */   116,  117,  118,    1,    2,  121,   18,    5,  238,  238,
 /*  1890 */   272,  238,   10,   11,   12,   13,   14,  201,   18,   17,
 /*  1900 */   238,  200,  149,  247,  140,  274,  274,  272,  235,  201,
 /*  1910 */   247,  235,   30,  247,   32,  247,  200,  153,  154,  155,
 /*  1920 */   156,  157,   40,  158,   62,  201,  200,   22,  292,  291,
 /*  1930 */   201,  222,  200,  222,  201,  200,  115,   19,   20,   64,
 /*  1940 */    22,  219,  228,   22,  219,  126,  219,  183,  165,  228,
 /*  1950 */   219,   24,   70,  225,   36,  225,  222,  221,  219,  219,
 /*  1960 */    78,  219,  315,   81,  307,  113,  284,  284,  222,  201,
 /*  1970 */    91,   82,  320,  267,  320,  148,  145,   59,   22,  267,
 /*  1980 */    98,  279,  201,  147,  281,  146,  158,  249,  251,   71,
 /*  1990 */    25,  250,  248,  203,  251,  247,   13,  195,  195,    6,
 /*  2000 */   193,  193,  193,  305,  305,  208,  302,  214,  214,  214,
 /*  2010 */   214,  223,  208,  214,  223,  133,  215,    4,  100,    3,
 /*  2020 */   138,  139,  208,   22,  106,  107,  215,  163,   16,   15,
 /*  2030 */    23,   23,  114,  139,  116,  117,  118,  151,  130,  121,
 /*  2040 */    25,   24,  142,   20,  162,  144,   16,    1,  142,  130,
 /*  2050 */   130,   61,   53,  151,  130,   37,   53,   53,   53,  116,
 /*  2060 */    34,    1,    5,  141,   22,  115,   68,   75,  161,   25,
 /*  2070 */    68,  153,  154,  155,  156,  157,   41,  141,  115,   24,
 /*  2080 */   131,   20,   19,  125,   22,   96,   67,   22,   22,   67,
 /*  2090 */    23,   22,   59,   22,   24,   67,   28,   23,   34,   22,
 /*  2100 */   149,  183,   23,   23,  116,   23,   25,   22,   97,   37,
 /*  2110 */   141,   23,   23,   22,  143,   25,   75,   34,   34,   88,
 /*  2120 */    34,   34,   86,   75,   23,   93,   34,   22,   34,   25,
 /*  2130 */    24,   34,   25,  142,   23,   23,  142,   44,   23,   23,
 /*  2140 */    22,   11,   25,   23,   25,   22,   22,   22,    1,   23,

 /*  2150 */    23,   22,   15,   22,    1,  135,  322,   25,   25,   23,
 /*  2160 */   322,  322,  141,  322,  322,  141,  141,  322,  322,  322,
 /*  2170 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2180 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2190 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2200 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2210 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2220 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2230 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2240 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2250 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2260 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2270 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2280 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2290 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2300 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2310 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2320 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2330 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2340 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2350 */   322,  322,  322,




};
#define YY_SHIFT_COUNT    (582)
#define YY_SHIFT_MIN      (0)
#define YY_SHIFT_MAX      (2153)
static const unsigned short int yy_shift_ofst[] = {
 /*     0 */  1882, 1678, 1584,  322,  322,  399,  306, 1409, 1429, 1520,
 /*    10 */  1918, 1918, 1918,  580,  399,  399,  399,  399,  399,    0,
 /*    20 */     0,  214, 1163, 1918, 1918, 1918, 1918, 1918, 1918, 1918,
 /*    30 */  1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1024, 1024,
 /*    40 */   365,  365,   55,  278,  436,  713,  713,  201,  201,  201,
 /*    50 */   201,   40,  111,  258,  361,  469,  512,  583,  622,  693,
 /*    60 */   732,  803,  842,  913, 1016, 1060, 1163, 1163, 1163, 1163,
 /*    70 */  1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163,
 /*    80 */  1163, 1163, 1163, 1163, 1183, 1163, 1203, 1306, 1306, 1613,
 /*    90 */  1692, 1764, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918,
 /*   100 */  1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918,
 /*   110 */  1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918,
 /*   120 */  1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918,
 /*   130 */  1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918,
 /*   140 */  1918, 1918,  137,  181,  181,  181,  181,  181,  181,  181,
 /*   150 */    96,  222,  143,  477,  713, 1220, 1319,  713,  713,   79,
 /*   160 */    79,  713,  760,   83,   65,   65,   65,  288,  162,  162,
 /*   170 */  2167, 2167,  696,  696,  696,  238,  474,  474,  474,  474,
 /*   180 */   970,  970,  678,  477,  324,  398,  713,  713,  713,  713,
 /*   190 */   713,  713,  713,  713,  713,  713,  713,  713,  713,  713,
 /*   200 */   713,  713,  713,  713,  713, 1032,  366,  366,  713,  919,
 /*   210 */   283,  283,  434,  434, 1260, 1260,  755, 2167, 2167, 2167,
 /*   220 */  2167, 2167, 2167, 2167, 1218,  820,  820,  487,  527,  585,
 /*   230 */   645,  749,  867,  937,  752,  713,  713,  713,  713,  713,
 /*   240 */   713,  713,  713,  713,  713,  303,  713,  713,  713,  713,
 /*   250 */   713,  713,  713,  713,  713,  713,  713,  713,  972,  972,
 /*   260 */   972,  713,  713,  713,  859,  713,  713,  713, 1165, 1232,
 /*   270 */   713, 1357,  713,  713,  713,  713,  713,  713,  713,  713,
 /*   280 */   806,    7,   91, 1028, 1028, 1028, 1028, 1304,   91,   91,
 /*   290 */  1382,  986, 1129, 1361, 1327, 1276,  468, 1276, 1408, 1411,
 /*   300 */  1327, 1327, 1411, 1327,  468, 1408, 1155,  854, 1440, 1402,
 /*   310 */  1402, 1402, 1349, 1349, 1349, 1349, 1454, 1454, 1391, 1419,
 /*   320 */   405, 1416, 1798, 1798, 1718, 1718, 1825, 1825, 1718, 1715,
 /*   330 */  1723, 1846, 1826, 1868, 1868, 1868, 1868, 1718, 1880, 1753,
 /*   340 */  1723, 1723, 1753, 1846, 1826, 1753, 1826, 1753, 1718, 1880,
 /*   350 */  1765, 1862, 1718, 1880, 1905, 1718, 1880, 1718, 1880, 1905,
 /*   360 */  1821, 1821, 1821, 1875, 1921, 1921, 1905, 1821, 1819, 1821,
 /*   370 */  1875, 1821, 1821, 1783, 1927, 1852, 1852, 1905, 1718, 1879,
 /*   380 */  1879, 1889, 1889, 1827, 1831, 1956, 1718, 1828, 1827, 1836,
 /*   390 */  1839, 1753, 1965, 1983, 1983, 1993, 1993, 1993, 2167, 2167,
 /*   400 */  2167, 2167, 2167, 2167, 2167, 2167, 2167, 2167, 2167, 2167,
 /*   410 */  2167, 2167, 2167,   20, 1081,  256, 1239, 1117,  961, 1166,
 /*   420 */  1495, 1460, 1516, 1461,  355, 1438, 1545, 1017, 1586, 1590,
 /*   430 */  1598, 1622, 1627, 1628,  541, 1453, 1573, 1486, 1634, 1058,
 /*   440 */  1534, 1541, 1671, 1674, 1504, 1675, 1679, 1552, 1583, 1719,
 /*   450 */  1720, 1544,   48, 2013, 2016, 2001, 1864, 2014, 2012, 2007,
 /*   460 */  2008, 1894, 1886, 1908, 2015, 2015, 2017, 1900, 2023, 1901,
 /*   470 */  2030, 2046, 1906, 1919, 2015, 1920, 1990, 2018, 2015, 1902,
 /*   480 */  1999, 2003, 2004, 2005, 1924, 1943, 2026, 1922, 2060, 2057,
 /*   490 */  2042, 1950, 1907, 1998, 2044, 2002, 1992, 2035, 1936, 1963,
 /*   500 */  2055, 2061, 2063, 1949, 1958, 2062, 2019, 2065, 2066, 2067,
 /*   510 */  2069, 2022, 2033, 2070, 1989, 2068, 2071, 2028, 2072, 2074,
 /*   520 */  2064, 1951, 2077, 2079, 2080, 2081, 2082, 2085, 2011, 1969,
 /*   530 */  2088, 2089, 1988, 2083, 2091, 1971, 2090, 2084, 2086, 2087,
 /*   540 */  2092, 2031, 2041, 2036, 2093, 2048, 2032, 2094, 2101, 2105,
 /*   550 */  2106, 2104, 2107, 2097, 1991, 1994, 2111, 2090, 2112, 2115,
 /*   560 */  2116, 2118, 2117, 2119, 2120, 2123, 2130, 2124, 2125, 2126,
 /*   570 */  2127, 2129, 2131, 2132, 2020, 2021, 2024, 2025, 2133, 2136,
 /*   580 */  2137, 2147, 2153,
};
#define YY_REDUCE_COUNT (412)
#define YY_REDUCE_MIN   (-275)
#define YY_REDUCE_MAX   (1814)
static const short yy_reduce_ofst[] = {
 /*     0 */   -71,  194,  343,  787, -180, -177,  738, -194, -188, -185,
 /*    10 */  -183,   82,  183,  -65,  133,  245,  346,  407,  458, -178,
 /*    20 */    75, -275,   -4,  310,  312,  489,  575,  596,  463,  686,
 /*    30 */   707,  777,  782,  812,  840,  796,  881,  938,  888,  992,
 /*    40 */    86,  448,  952,  680,  681,  843,  892,  623,  687,  623,
 /*    50 */   687, -261, -261, -261, -261, -261, -261, -261, -261, -261,
 /*    60 */  -261, -261, -261, -261, -261, -261, -261, -261, -261, -261,
 /*    70 */  -261, -261, -261, -261, -261, -261, -261, -261, -261, -261,
 /*    80 */  -261, -261, -261, -261, -261, -261, -261, -261, -261,  391,
 /*    90 */   967, 1027, 1085, 1103, 1105, 1110, 1130, 1150, 1170, 1172,
 /*   100 */  1176, 1180, 1185, 1188, 1206, 1236, 1238, 1241, 1243, 1245,
 /*   110 */  1249, 1252, 1258, 1278, 1280, 1287, 1289, 1293, 1295, 1314,
 /*   120 */  1340, 1354, 1358, 1360, 1412, 1425, 1446, 1450, 1452, 1507,
 /*   130 */  1515, 1532, 1543, 1547, 1563, 1577, 1585, 1597, 1607, 1611,
 /*   140 */  1625, 1633, -261, -261, -261, -261, -261, -261, -261, -261,
 /*   150 */  -261, -261, -261, -186, -117,  260,  263,  460,  515,  -74,
 /*   160 */   545, -181, -261, 1087,  176,  274,  338,  676, -261, -261,
 /*   170 */  -261, -261, -212, -212, -212, -184,  149,  668,  786,  804,
 /*   180 */   265,  419, -254,  516,  529,  529,  -11, -129,  184,  488,
 /*   190 */   838,  956,  960,  984,  403,  616,  897,  618,  999,  949,
 /*   200 */  1139, 1007,  490,  778, 1142,  834,  733,  841, -189, 1049,
 /*   210 */   968, 1025, 1083, 1084, 1121, 1182,   46, 1094, 1226, 1228,
 /*   220 */  1246, 1247, 1127, 1288, -210, -190, -176, -115,  117,  262,
 /*   230 */   376,  470,  511,  514,  520,  579,  600,  708,  727,  996,
 /*   240 */  1003, 1138, 1189, 1284, 1307, 1250, 1334, 1343, 1347, 1410,
 /*   250 */  1414, 1424, 1428, 1431, 1434, 1445, 1462, 1466, 1421, 1439,
 /*   260 */  1444, 1487, 1491, 1492, 1395, 1493, 1499, 1512, 1458, 1418,
 /*   270 */  1522, 1498, 1546,  376, 1553, 1558, 1559, 1560, 1561, 1564,
 /*   280 */  1472, 1483, 1530, 1517, 1518, 1521, 1525, 1395, 1530, 1530,
 /*   290 */  1533, 1570, 1595, 1489, 1524, 1535, 1566, 1538, 1494, 1571,
 /*   300 */  1548, 1549, 1579, 1557, 1574, 1536, 1569, 1603, 1567, 1614,
 /*   310 */  1616, 1617, 1578, 1580, 1591, 1592, 1588, 1594, 1572, 1609,
 /*   320 */  1612, 1660, 1562, 1568, 1659, 1661, 1576, 1581, 1664, 1589,
 /*   330 */  1602, 1618, 1644, 1650, 1651, 1653, 1662, 1696, 1701, 1656,
 /*   340 */  1631, 1632, 1663, 1635, 1673, 1666, 1676, 1668, 1708, 1716,
 /*   350 */  1636, 1638, 1724, 1726, 1709, 1729, 1732, 1733, 1735, 1711,
 /*   360 */  1722, 1725, 1727, 1714, 1728, 1730, 1734, 1731, 1736, 1739,
 /*   370 */  1721, 1740, 1742, 1647, 1657, 1682, 1683, 1746, 1768, 1652,
 /*   380 */  1654, 1706, 1712, 1737, 1741, 1702, 1781, 1703, 1743, 1738,
 /*   390 */  1744, 1748, 1790, 1802, 1803, 1807, 1808, 1809, 1698, 1699,
 /*   400 */  1704, 1797, 1793, 1794, 1795, 1796, 1804, 1788, 1791, 1801,
 /*   410 */  1811, 1799, 1814,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */  1663, 1663, 1663, 1491, 1254, 1367, 1254, 1254, 1254, 1254,
 /*    10 */  1491, 1491, 1491, 1254, 1254, 1254, 1254, 1254, 1254, 1397,
 /*    20 */  1397, 1544, 1287, 1254, 1254, 1254, 1254, 1254, 1254, 1254,
 /*    30 */  1254, 1254, 1254, 1254, 1254, 1490, 1254, 1254, 1254, 1254,
 /*    40 */  1578, 1578, 1254, 1254, 1254, 1254, 1254, 1563, 1562, 1254,







|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
<
<
|
<
|
|
|
|
|
>
|
>
|
<
<
|
|
|
|
|
|
|
|
|
|
>
>
|
|
|
|
|
|
|
>
|
<
|
|
|
<
|
>
|
|
|
>
>
>
|
|
|
>
|
|
<
|
|
>
|
|
<
<
|
|
>
|
|
<
|
|
|
|
>
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
<
|
|
|
|
>
|
<
|
|
|
|
|
|
|
|
>
>
|
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
<
|
|
|
|
|
|
<
<
|
<
|
|
|
|
|
|
|
|
|
|
<
<
<
<
|
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
<
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
>
|
|
|
|
|
<
|
>
|
|
>
>
>
>


|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
|
>
|
|
|
<
|
|
|
>
|
>
|
|
<
|
|
|
>
|
|
>
>
|
|
|
|
|
|
<
<
|
<
<
<
<
<
|
<
<
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
>
>
>
|
|
|
>
|
<
|
|
>
>
>
>
|
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
<
|
|
|
|
>
|
<
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
|
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
>
|
|
|
|
|
|













|
|
>
>
>
>



|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|


|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







173584
173585
173586
173587
173588
173589
173590
173591
173592
173593
173594
173595
173596
173597
173598
173599
173600
173601
173602
173603
173604
173605
173606
173607
173608
173609
173610
173611
173612
173613

173614


173615

173616
173617
173618
173619
173620
173621
173622
173623
173624


173625
173626
173627
173628
173629
173630
173631
173632
173633
173634
173635
173636
173637
173638
173639
173640
173641
173642
173643
173644
173645

173646
173647
173648

173649
173650
173651
173652
173653
173654
173655
173656
173657
173658
173659
173660
173661
173662

173663
173664
173665
173666
173667


173668
173669
173670
173671
173672

173673
173674
173675
173676
173677
173678

173679
173680
173681
173682
173683
173684
173685
173686
173687
173688
173689
173690
173691
173692
173693
173694
173695
173696
173697
173698
173699
173700

173701
173702
173703
173704
173705
173706

173707
173708
173709
173710
173711
173712
173713
173714
173715
173716
173717
173718
173719
173720
173721
173722
173723
173724
173725
173726
173727
173728
173729
173730
173731
173732
173733
173734
173735
173736
173737

173738
173739
173740
173741

173742
173743
173744
173745
173746
173747


173748

173749
173750
173751
173752
173753
173754
173755
173756
173757
173758




173759



173760
173761
173762
173763
173764
173765
173766
173767
173768
173769
173770
173771
173772
173773
173774
173775
173776
173777
173778
173779
173780
173781
173782
173783




173784
173785
173786
173787
173788
173789
173790
173791
173792
173793
173794
173795
173796
173797
173798

173799
173800
173801
173802
173803
173804
173805

173806
173807
173808
173809
173810
173811
173812
173813
173814
173815
173816
173817
173818
173819
173820
173821
173822
173823
173824
173825
173826
173827
173828
173829
173830
173831
173832
173833
173834
173835
173836
173837
173838
173839
173840
173841
173842




173843
173844
173845
173846
173847

173848
173849
173850
173851
173852
173853
173854
173855

173856
173857
173858
173859
173860
173861
173862
173863
173864
173865
173866
173867
173868
173869


173870





173871


173872

173873
173874
173875
173876
173877
173878
173879
173880
173881
173882
173883
173884
173885
173886
173887
173888
173889
173890
173891
173892
173893
173894
173895
173896
173897
173898

173899
173900
173901
173902
173903
173904
173905
173906
173907
173908
173909
173910
173911
173912
173913
173914
173915
173916
173917
173918
173919
173920
173921
173922
173923

173924
173925
173926
173927
173928
173929

173930
173931
173932
173933
173934
173935

173936
173937
173938
173939
173940
173941
173942
173943
173944
173945
173946
173947
173948
173949
173950
173951
173952
173953
173954
173955
173956
173957
173958
173959
173960
173961
173962
173963
173964
173965
173966
173967
173968
173969
173970
173971
173972
173973
173974
173975
173976
173977
173978
173979
173980


173981
173982
173983
173984
173985
173986
173987
173988
173989
173990
173991
173992
173993
173994
173995
173996
173997
173998
173999
174000
174001
174002
174003
174004
174005
174006
174007
174008
174009
174010
174011
174012
174013
174014
174015
174016
174017
174018
174019
174020
174021
174022
174023
174024
174025
174026
174027
174028

174029
174030
174031
174032
174033
174034
174035
174036
174037
174038
174039
174040
174041
174042
174043
174044
174045
174046
174047
174048
174049
174050
174051
174052
174053
174054
174055
174056
174057
174058
174059
174060
174061
174062
174063
174064
174065
174066
174067
174068
174069
174070
174071
174072
174073
174074
174075
174076
174077
174078
174079
174080
174081
174082
174083
174084
174085
174086
174087
174088
174089
174090
174091
174092
174093
174094
174095
174096
174097
174098
174099
174100
174101
174102
174103
174104
174105
174106
174107
174108
174109
174110
174111
174112
174113
174114
174115
174116
174117
174118
174119
174120
174121
174122
174123
174124
174125
174126
174127
174128
174129
174130
174131
174132
174133
174134
174135
174136
174137
174138
174139
174140
174141
174142
174143
174144
174145
174146
174147
174148
174149
174150
174151
174152
174153
174154
174155
174156
174157
174158
174159
174160
174161
174162
174163
174164
174165
174166
174167
174168
174169
174170
174171
174172
174173
**  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 (2207)
static const YYACTIONTYPE yy_action[] = {
 /*     0 */   130,  127,  234,  282,  282, 1328,  576, 1307,  460,  289,
 /*    10 */   289,  576, 1622,  381,  576, 1328,  573,  576,  562,  413,
 /*    20 */  1300, 1542,  573,  481,  562,  524,  460,  459,  558,   82,
 /*    30 */    82,  983,  294,  375,   51,   51,  498,   61,   61,  984,
 /*    40 */    82,   82, 1577,  137,  138,   91,    7, 1228, 1228, 1063,
 /*    50 */  1066, 1053, 1053,  135,  135,  136,  136,  136,  136,  413,
 /*    60 */   288,  288,  182,  288,  288,  481,  536,  288,  288,  130,
 /*    70 */   127,  234,  432,  573,  525,  562,  573,  557,  562, 1290,
 /*    80 */   573,  421,  562,  137,  138,   91,  559, 1228, 1228, 1063,
 /*    90 */  1066, 1053, 1053,  135,  135,  136,  136,  136,  136,  296,
 /*   100 */   460,  398, 1249,  134,  134,  134,  134,  133,  133,  132,
 /*   110 */   132,  132,  131,  128,  451,   44, 1050, 1050, 1064, 1067,
 /*   120 */  1255,    1,    1,  582,    2, 1259,  581, 1174, 1259, 1174,
 /*   130 */   321,  413,  155,  321, 1584,  155,  379,  112,  498, 1341,
 /*   140 */   456,  299, 1341,  134,  134,  134,  134,  133,  133,  132,
 /*   150 */   132,  132,  131,  128,  451,  137,  138,   91, 1105, 1228,
 /*   160 */  1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,
 /*   170 */   136, 1204,  320,  567,  288,  288,  283,  288,  288,  523,
 /*   180 */   523, 1250,  139, 1541,    7,  214,  503,  573, 1169,  562,
 /*   190 */   573, 1054,  562,  136,  136,  136,  136,  129,  401,  547,
 /*   200 */   487, 1169,  245, 1568, 1169,  245,  133,  133,  132,  132,

 /*   210 */   132,  131,  128,  451,  261,  134,  134,  134,  134,  133,


 /*   220 */   133,  132,  132,  132,  131,  128,  451,  451, 1204, 1205,

 /*   230 */  1204,  130,  127,  234,  455,  413,  182,  455,  130,  127,
 /*   240 */   234,  134,  134,  134,  134,  133,  133,  132,  132,  132,
 /*   250 */   131,  128,  451,  136,  136,  136,  136,  538,  576,  137,
 /*   260 */   138,   91,  261, 1228, 1228, 1063, 1066, 1053, 1053,  135,
 /*   270 */   135,  136,  136,  136,  136,   44,  472,  346, 1204,  472,
 /*   280 */   346,   51,   51,  418,   93,  157,  134,  134,  134,  134,
 /*   290 */   133,  133,  132,  132,  132,  131,  128,  451,  166,  363,
 /*   300 */   298,  134,  134,  134,  134,  133,  133,  132,  132,  132,
 /*   310 */   131,  128,  451, 1293,  461, 1570,  423,  377,  275,  134,


 /*   320 */   134,  134,  134,  133,  133,  132,  132,  132,  131,  128,
 /*   330 */   451,  418,  320,  567, 1292, 1204, 1205, 1204,  257,  413,
 /*   340 */   483,  511,  508,  507,   94,  132,  132,  132,  131,  128,
 /*   350 */   451,  506, 1204,  548,  548,  388,  576,  384,    7,  413,
 /*   360 */   550,  229,  522,  137,  138,   91,  530, 1228, 1228, 1063,
 /*   370 */  1066, 1053, 1053,  135,  135,  136,  136,  136,  136,   51,
 /*   380 */    51, 1582,  380,  137,  138,   91,  331, 1228, 1228, 1063,
 /*   390 */  1066, 1053, 1053,  135,  135,  136,  136,  136,  136,  320,
 /*   400 */   567,  288,  288,  320,  567, 1602,  582,    2, 1259, 1204,
 /*   410 */  1205, 1204, 1628,  321,  573,  155,  562,  576, 1511,  264,
 /*   420 */   231,  520, 1341,  134,  134,  134,  134,  133,  133,  132,
 /*   430 */   132,  132,  131,  128,  451,  519, 1511, 1513, 1333, 1333,
 /*   440 */    82,   82,  498,  134,  134,  134,  134,  133,  133,  132,
 /*   450 */   132,  132,  131,  128,  451, 1435,  257,  288,  288,  511,
 /*   460 */   508,  507,  944, 1568,  413, 1019, 1204,  943,  360,  506,
 /*   470 */   573, 1598,  562,   44,  575,  551,  551,  557, 1107, 1582,
 /*   480 */   544,  576, 1107,   40,  417,  245,  531, 1505,  137,  138,
 /*   490 */    91,  219, 1228, 1228, 1063, 1066, 1053, 1053,  135,  135,
 /*   500 */   136,  136,  136,  136,   81,   81, 1281, 1204,  413,  553,
 /*   510 */  1511,   48,  512,  448,  447,  493,  578,  455,  578,  344,
 /*   520 */    45, 1204, 1233, 1204, 1205, 1204,  428, 1235,  158,  882,

 /*   530 */   320,  567,  137,  138,   91, 1234, 1228, 1228, 1063, 1066,
 /*   540 */  1053, 1053,  135,  135,  136,  136,  136,  136,  134,  134,
 /*   550 */   134,  134,  133,  133,  132,  132,  132,  131,  128,  451,

 /*   560 */  1236,  576, 1236,  329, 1204, 1205, 1204,  387,  492,  403,
 /*   570 */  1040,  382,  489,  123,  568, 1569,    4,  377, 1204, 1205,
 /*   580 */  1204,  570,  570,  570,   82,   82,  882, 1029, 1331, 1331,
 /*   590 */   571, 1028,  134,  134,  134,  134,  133,  133,  132,  132,
 /*   600 */   132,  131,  128,  451,  288,  288, 1281, 1204,  576,  423,
 /*   610 */   576, 1568,  413,  423,  452,  378,  886,  573, 1279,  562,
 /*   620 */    46,  557,  532, 1028, 1028, 1030,  565,  130,  127,  234,
 /*   630 */   556,   82,   82,   82,   82,  479,  137,  138,   91,  462,
 /*   640 */  1228, 1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,
 /*   650 */   136,  136, 1188,  487, 1506, 1040,  413,    6, 1204,   50,
 /*   660 */   879,  121,  121,  948, 1204, 1205, 1204,  358,  557,  122,
 /*   670 */   316,  452,  577,  452,  535, 1204, 1028,  439,  303,  212,
 /*   680 */   137,  138,   91,  213, 1228, 1228, 1063, 1066, 1053, 1053,
 /*   690 */   135,  135,  136,  136,  136,  136,  134,  134,  134,  134,

 /*   700 */   133,  133,  132,  132,  132,  131,  128,  451, 1028, 1028,
 /*   710 */  1030, 1031,   35,  288,  288, 1204, 1205, 1204, 1040, 1339,
 /*   720 */   533,  123,  568, 1569,    4,  377,  573, 1019,  562,  353,
 /*   730 */  1277,  356, 1204, 1205, 1204, 1029,  488, 1188,  571, 1028,
 /*   740 */   134,  134,  134,  134,  133,  133,  132,  132,  132,  131,


 /*   750 */   128,  451,  576,  343,  288,  288,  449,  449,  449,  971,
 /*   760 */   413, 1627,  452,  911, 1187,  288,  288,  573,  464,  562,
 /*   770 */   238, 1028, 1028, 1030,  565,   82,   82,  498,  573,  411,
 /*   780 */   562,  344,  467,  332,  137,  138,   91,  197, 1228, 1228,
 /*   790 */  1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,  136,

 /*   800 */  1188,  528, 1169, 1040,  413, 1110, 1110,  495, 1041,  121,
 /*   810 */   121, 1204,  317,  540,  862, 1169, 1244,  122, 1169,  452,
 /*   820 */   577,  452, 1340,  198, 1028, 1204,  481,  526,  137,  138,
 /*   830 */    91,  560, 1228, 1228, 1063, 1066, 1053, 1053,  135,  135,
 /*   840 */   136,  136,  136,  136,  134,  134,  134,  134,  133,  133,
 /*   850 */   132,  132,  132,  131,  128,  451, 1028, 1028, 1030, 1031,

 /*   860 */    35, 1204,  288,  288, 1204,  477,  288,  288, 1204, 1205,
 /*   870 */  1204,  539,  481,  437,  470,  573, 1451,  562,  364,  573,
 /*   880 */  1153,  562, 1204, 1205, 1204, 1188,    5,  576,  134,  134,
 /*   890 */   134,  134,  133,  133,  132,  132,  132,  131,  128,  451,
 /*   900 */   221,  214,  302,   96, 1149, 1657,  232, 1657,  413,  392,
 /*   910 */    19,   19, 1024,  949,  406,  373, 1595, 1085, 1204, 1205,
 /*   920 */  1204, 1204, 1205, 1204, 1204,  426, 1149, 1658,  413, 1658,
 /*   930 */  1659,  399,  137,  138,   91,    3, 1228, 1228, 1063, 1066,
 /*   940 */  1053, 1053,  135,  135,  136,  136,  136,  136,  304, 1311,
 /*   950 */   514, 1204,  137,  138,   91, 1498, 1228, 1228, 1063, 1066,
 /*   960 */  1053, 1053,  135,  135,  136,  136,  136,  136,  434,  131,
 /*   970 */   128,  451,  375, 1204,  274,  291,  372,  517,  367,  516,
 /*   980 */   262, 1204, 1205, 1204, 1147,  227,  363,  448,  447, 1435,
 /*   990 */  1568, 1310,  134,  134,  134,  134,  133,  133,  132,  132,
 /*  1000 */   132,  131,  128,  451, 1568,  576, 1147,  487, 1204, 1205,
 /*  1010 */  1204,  442,  134,  134,  134,  134,  133,  133,  132,  132,
 /*  1020 */   132,  131,  128,  451,  386,  576,  485,  576,   19,   19,
 /*  1030 */  1204, 1205, 1204, 1345, 1236,  970, 1236,  574,   47,  936,
 /*  1040 */   936,  473,  413,  431, 1552,  573, 1125,  562,   19,   19,
 /*  1050 */    19,   19,   49,  336,  850,  851,  852,  111, 1368,  315,
 /*  1060 */   429,  576,  413,  433,  341,  306,  137,  138,   91,  115,
 /*  1070 */  1228, 1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,

 /*  1080 */   136,  136,  576, 1309,   82,   82,  137,  138,   91,  529,
 /*  1090 */  1228, 1228, 1063, 1066, 1053, 1053,  135,  135,  136,  136,
 /*  1100 */   136,  136, 1569,  222,  377,   19,   19,  305, 1126, 1169,
 /*  1110 */   398, 1148,   22,   22,  498,  333, 1569,  335,  377,  576,
 /*  1120 */   438,  445, 1169, 1127,  486, 1169,  134,  134,  134,  134,
 /*  1130 */   133,  133,  132,  132,  132,  131,  128,  451, 1128,  576,

 /*  1140 */   902,  576,  145,  145,    6,  576,  134,  134,  134,  134,
 /*  1150 */   133,  133,  132,  132,  132,  131,  128,  451,  214, 1336,
 /*  1160 */   922,  576,   19,   19,   19,   19, 1282,  419,   19,   19,
 /*  1170 */   923,  412,  515,  141,  576, 1169,  413,  206,  465,  207,
 /*  1180 */   903,  215, 1575,  552,  147,  147,    7,  227, 1169,  411,
 /*  1190 */  1250, 1169,  120,  307,  117,  307,  413,   66,   66,  334,
 /*  1200 */   137,  138,   91,  119, 1228, 1228, 1063, 1066, 1053, 1053,
 /*  1210 */   135,  135,  136,  136,  136,  136,  413,  285,  209,  969,
 /*  1220 */   137,  138,   91,  471, 1228, 1228, 1063, 1066, 1053, 1053,
 /*  1230 */   135,  135,  136,  136,  136,  136,  435,   10, 1450,  267,
 /*  1240 */   137,  126,   91, 1435, 1228, 1228, 1063, 1066, 1053, 1053,
 /*  1250 */   135,  135,  136,  136,  136,  136, 1435, 1435,  410,  409,
 /*  1260 */   134,  134,  134,  134,  133,  133,  132,  132,  132,  131,
 /*  1270 */   128,  451,  576,  969,  576, 1224,  498,  373, 1595, 1554,
 /*  1280 */   134,  134,  134,  134,  133,  133,  132,  132,  132,  131,
 /*  1290 */   128,  451,  532,  457,  576,   82,   82,   82,   82,  111,
 /*  1300 */   134,  134,  134,  134,  133,  133,  132,  132,  132,  131,
 /*  1310 */   128,  451,  109,  233,  430, 1576,  546,   67,   67,    7,
 /*  1320 */   413,  351,  550, 1550,  260,  259,  258,  494,  443,  569,
 /*  1330 */   419,  983,  446, 1224,  450,  545, 1207,  576,  969,  984,
 /*  1340 */   413,  475, 1449, 1574, 1180,  138,   91,    7, 1228, 1228,
 /*  1350 */  1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,  136,
 /*  1360 */    21,   21,  267,  576,  300, 1126,   91,  233, 1228, 1228,
 /*  1370 */  1063, 1066, 1053, 1053,  135,  135,  136,  136,  136,  136,
 /*  1380 */  1127,  373, 1595,  161, 1573,   16,   53,   53,    7,  108,
 /*  1390 */   533,   38,  969,  125, 1207, 1128, 1180,  576, 1224,  123,
 /*  1400 */   568,  893,    4,  324,  134,  134,  134,  134,  133,  133,
 /*  1410 */   132,  132,  132,  131,  128,  451,  571,  564,  534,  576,
 /*  1420 */    68,   68,  576,   39,  134,  134,  134,  134,  133,  133,
 /*  1430 */   132,  132,  132,  131,  128,  451,  576,  160, 1571, 1223,
 /*  1440 */   452,  576,   54,   54,  576,   69,   69,  576, 1366,  576,

 /*  1450 */   420,  184,  565,  463,  297,  576, 1224,  463,  297,   70,
 /*  1460 */    70,  576,   44,  474,   71,   71,  576,   72,   72,  576,
 /*  1470 */    73,   73,   55,   55,  411,  874,  242,  576,   56,   56,
 /*  1480 */   576, 1040,  576,  478,   57,   57,  576,  121,  121,   59,

 /*  1490 */    59,   23,   60,   60,  411,  122,  319,  452,  577,  452,
 /*  1500 */    74,   74, 1028,   75,   75,   76,   76,  411,  290,   20,
 /*  1510 */    20,  108,  287,  231,  553,  123,  568,  325,    4,  320,
 /*  1520 */   567,   97,  218,  944, 1144,  328,  400,  576,  943,  576,
 /*  1530 */  1380,  424,  571,  874, 1028, 1028, 1030, 1031,   35,  293,
 /*  1540 */   534,  576, 1104,  576, 1104,    9,  576,  342,  576,  111,


 /*  1550 */    77,   77,  143,  143,  576,  205,  452,  222, 1379,  889,

 /*  1560 */   576,  901,  900, 1188,  144,  144,   78,   78,  565,   62,
 /*  1570 */    62,   79,   79,  323, 1021,  576,  266,   63,   63,  908,
 /*  1580 */   909, 1589,  542,   80,   80,  576,  371,  541,  123,  568,
 /*  1590 */   480,    4,  266,  482,  244,  266,  370, 1040,   64,   64,
 /*  1600 */   576,  466,  576,  121,  121,  571, 1557,  576,  170,  170,
 /*  1610 */   576,  122,  576,  452,  577,  452,  576,  889, 1028,  576,
 /*  1620 */   165,  576,  111,  171,  171,   87,   87,  337, 1616,  452,
 /*  1630 */    65,   65, 1530,   83,   83,  146,  146,  986,  987,   84,
 /*  1640 */    84,  565,  168,  168,  148,  148, 1092,  347, 1032,  111,
 /*  1650 */  1028, 1028, 1030, 1031,   35,  542, 1103,  576, 1103,  576,




 /*  1660 */   543,  123,  568,  504,    4,  263,  576,  361, 1529,  111,



 /*  1670 */  1040, 1088,  576,  263,  576,  490,  121,  121,  571, 1188,
 /*  1680 */   142,  142,  169,  169,  122,  576,  452,  577,  452,  162,
 /*  1690 */   162, 1028,  576,  563,  576,  152,  152,  151,  151,  348,
 /*  1700 */  1376,  974,  452,  266, 1092,  942, 1032,  125,  149,  149,
 /*  1710 */   939,  576,  125,  576,  565,  150,  150,   86,   86,  872,
 /*  1720 */   352,  159,  576, 1028, 1028, 1030, 1031,   35,  542,  941,
 /*  1730 */   576,  125,  355,  541,   88,   88,   85,   85,  357,  359,
 /*  1740 */  1324, 1308,  366, 1040,  376,   52,   52,  499, 1389,  121,
 /*  1750 */   121, 1434, 1188,   58,   58, 1362, 1374,  122, 1439,  452,
 /*  1760 */   577,  452, 1289,  167, 1028, 1280,  280, 1268, 1267, 1269,
 /*  1770 */  1609, 1359,  312,  313,   12,  314,  397, 1421,  224, 1416,
 /*  1780 */   295,  237, 1409,  339,  340, 1426,  301,  345,  484,  228,
 /*  1790 */  1371, 1307, 1372, 1370, 1425,  404, 1028, 1028, 1030, 1031,
 /*  1800 */    35, 1601, 1192,  454,  509,  369,  292, 1502,  210, 1501,
 /*  1810 */  1369,  396,  396,  395,  277,  393,  211,  566,  859, 1612,
 /*  1820 */  1244,  123,  568,  391,    4, 1188,  223,  270, 1549, 1547,
 /*  1830 */  1241,  239,  186,  327,  422,   96,  195,  220,  571,  235,
 /*  1840 */   180,  326,  188,  468,  190, 1507,  191,  192,   92,  193,
 /*  1850 */   469,   95, 1422,   13,  502,  247, 1430,  109,  199,  402,
 /*  1860 */   476,  405,  452, 1496, 1428, 1427,   14,  491,  251,  102,
 /*  1870 */   497, 1518,  241,  281,  565,  253,  203,  354,  500,  254,
 /*  1880 */   175, 1270,  407,   43,  350,  518, 1327,  436,  255, 1326,
 /*  1890 */  1325, 1318,  104,  893, 1626,  229,  408,  440, 1625,  441,
 /*  1900 */   240,  310, 1296, 1040,  311, 1317,  527, 1594, 1297,  121,




 /*  1910 */   121,  368, 1295, 1624,  268,  269, 1580,  122, 1579,  452,
 /*  1920 */   577,  452,  374,  444, 1028, 1394, 1393,  140,  553,   90,
 /*  1930 */   568,   11,    4, 1483,  383,  414,  385,  110,  116,  216,
 /*  1940 */   320,  567, 1350,  555,   42,  318,  571,  537, 1349,  389,
 /*  1950 */   390,  579, 1198,  276,  279,  278, 1028, 1028, 1030, 1031,
 /*  1960 */    35,  580,  415, 1265,  458, 1260,  416,  185, 1534,  172,
 /*  1970 */   452, 1535,  173,  156,  308,  846, 1533, 1532,  453,  217,
 /*  1980 */   225,   89,  565,  174,  322, 1188,  226,  236, 1102,  154,
 /*  1990 */  1100,  330,  176,  187, 1223,  189,  925,  338,  243, 1116,
 /*  2000 */   246,  194,  177,  178,  425,  427,   98,   99,  196,  100,
 /*  2010 */   101, 1040,  179, 1119,  248, 1115,  249,  121,  121,   24,
 /*  2020 */   163,  250,  349, 1108,  266,  122, 1238,  452,  577,  452,
 /*  2030 */  1192,  454, 1028,  200,  292,  496,  252,  201,  861,  396,
 /*  2040 */   396,  395,  277,  393,   15,  501,  859,  370,  292,  256,
 /*  2050 */   202,  554,  505,  396,  396,  395,  277,  393,  103,  239,

 /*  2060 */   859,  327,   25,   26, 1028, 1028, 1030, 1031,   35,  326,
 /*  2070 */   362,  510,  891,  239,  365,  327,  513,  904,  105,  309,
 /*  2080 */   164,  181,   27,  326,  106,  521,  107, 1185, 1069, 1155,
 /*  2090 */    17, 1154,  284, 1188,  286,  978,  265,  204,  125, 1171,
 /*  2100 */   241,  230,  972, 1175,   28, 1160,   29, 1179,  175, 1173,
 /*  2110 */    30,   43,   31, 1178,  241,   32,   41,  549,    8,   33,
 /*  2120 */   208,  111,  175, 1083, 1070,   43,  113, 1068,  240,  114,

 /*  2130 */  1072,   34, 1073,  561, 1124,  118,  271,   36,   18, 1194,
 /*  2140 */  1033,  873,  240,  935,  124,   37,  272,  273, 1617,  572,
 /*  2150 */   183,  153,  394, 1193, 1256, 1256, 1256, 1256, 1256, 1256,
 /*  2160 */  1256, 1256, 1256,  414, 1256, 1256, 1256, 1256,  320,  567,
 /*  2170 */  1256, 1256, 1256, 1256, 1256, 1256, 1256,  414, 1256, 1256,
 /*  2180 */  1256, 1256,  320,  567, 1256, 1256, 1256, 1256, 1256, 1256,
 /*  2190 */  1256, 1256,  458, 1256, 1256, 1256, 1256, 1256, 1256, 1256,
 /*  2200 */  1256, 1256, 1256, 1256, 1256, 1256,  458,
};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */   276,  277,  278,  240,  241,  224,  194,  226,  194,  240,
 /*    10 */   241,  194,  216,  220,  194,  234,  253,  194,  255,   19,
 /*    20 */   224,  297,  253,  194,  255,  205,  212,  213,  205,  217,
 /*    30 */   218,   31,  205,  194,  217,  218,  194,  217,  218,   39,
 /*    40 */   217,  218,  312,   43,   44,   45,  316,   47,   48,   49,
 /*    50 */    50,   51,   52,   53,   54,   55,   56,   57,   58,   19,
 /*    60 */   240,  241,  194,  240,  241,  194,  254,  240,  241,  276,
 /*    70 */   277,  278,  233,  253,  254,  255,  253,  254,  255,  217,
 /*    80 */   253,  239,  255,   43,   44,   45,  263,   47,   48,   49,
 /*    90 */    50,   51,   52,   53,   54,   55,   56,   57,   58,  270,
 /*   100 */   286,   22,   23,  103,  104,  105,  106,  107,  108,  109,
 /*   110 */   110,  111,  112,  113,  114,   82,   47,   48,   49,   50,
 /*   120 */   186,  187,  188,  189,  190,  191,  189,   87,  191,   89,
 /*   130 */   196,   19,  198,  196,  317,  198,  319,   25,  194,  205,
 /*   140 */   298,  270,  205,  103,  104,  105,  106,  107,  108,  109,
 /*   150 */   110,  111,  112,  113,  114,   43,   44,   45,   11,   47,
 /*   160 */    48,   49,   50,   51,   52,   53,   54,   55,   56,   57,
 /*   170 */    58,   60,  139,  140,  240,  241,  214,  240,  241,  311,
 /*   180 */   312,  102,   70,  239,  316,  194,   19,  253,   77,  255,
 /*   190 */   253,  122,  255,   55,   56,   57,   58,   59,  207,   88,
 /*   200 */   194,   90,  268,  194,   93,  268,  107,  108,  109,  110,
 /*   210 */   111,  112,  113,  114,   47,  103,  104,  105,  106,  107,
 /*   220 */   108,  109,  110,  111,  112,  113,  114,  114,  117,  118,
 /*   230 */   119,  276,  277,  278,  300,   19,  194,  300,  276,  277,
 /*   240 */   278,  103,  104,  105,  106,  107,  108,  109,  110,  111,
 /*   250 */   112,  113,  114,   55,   56,   57,   58,  146,  194,   43,
 /*   260 */    44,   45,   47,   47,   48,   49,   50,   51,   52,   53,




 /*   270 */    54,   55,   56,   57,   58,   82,  129,  130,   60,  129,
 /*   280 */   130,  217,  218,  116,   68,   25,  103,  104,  105,  106,
 /*   290 */   107,  108,  109,  110,  111,  112,  113,  114,   23,  132,
 /*   300 */   294,  103,  104,  105,  106,  107,  108,  109,  110,  111,
 /*   310 */   112,  113,  114,  217,  121,  306,  194,  308,   26,  103,

 /*   320 */   104,  105,  106,  107,  108,  109,  110,  111,  112,  113,
 /*   330 */   114,  116,  139,  140,  217,  117,  118,  119,  120,   19,
 /*   340 */   194,  123,  124,  125,   24,  109,  110,  111,  112,  113,
 /*   350 */   114,  133,   60,  311,  312,  250,  194,  252,  316,   19,
 /*   360 */   194,  166,  167,   43,   44,   45,  205,   47,   48,   49,
 /*   370 */    50,   51,   52,   53,   54,   55,   56,   57,   58,  217,
 /*   380 */   218,  317,  318,   43,   44,   45,  264,   47,   48,   49,
 /*   390 */    50,   51,   52,   53,   54,   55,   56,   57,   58,  139,

 /*   400 */   140,  240,  241,  139,  140,  188,  189,  190,  191,  117,
 /*   410 */   118,  119,  231,  196,  253,  198,  255,  194,  194,  258,
 /*   420 */   259,  146,  205,  103,  104,  105,  106,  107,  108,  109,
 /*   430 */   110,  111,  112,  113,  114,  109,  212,  213,  236,  237,
 /*   440 */   217,  218,  194,  103,  104,  105,  106,  107,  108,  109,
 /*   450 */   110,  111,  112,  113,  114,  194,  120,  240,  241,  123,
 /*   460 */   124,  125,  136,  194,   19,   74,   60,  141,   23,  133,
 /*   470 */   253,  194,  255,   82,  194,  309,  310,  254,   29,  317,
 /*   480 */   318,  194,   33,   22,  199,  268,  263,  239,   43,   44,
 /*   490 */    45,  151,   47,   48,   49,   50,   51,   52,   53,   54,
 /*   500 */    55,   56,   57,   58,  217,  218,  194,   60,   19,  146,
 /*   510 */   286,  242,   23,  107,  108,   66,  204,  300,  206,  128,
 /*   520 */    73,   60,  116,  117,  118,  119,  265,  121,  165,   60,
 /*   530 */   139,  140,   43,   44,   45,  129,   47,   48,   49,   50,


 /*   540 */    51,   52,   53,   54,   55,   56,   57,   58,  103,  104,





 /*   550 */   105,  106,  107,  108,  109,  110,  111,  112,  113,  114,


 /*   560 */   154,  194,  156,  194,  117,  118,  119,  280,  283,  205,

 /*   570 */   101,  220,  287,   19,   20,  306,   22,  308,  117,  118,
 /*   580 */   119,  211,  212,  213,  217,  218,  117,  118,  236,  237,
 /*   590 */    36,  122,  103,  104,  105,  106,  107,  108,  109,  110,
 /*   600 */   111,  112,  113,  114,  240,  241,  194,   60,  194,  194,
 /*   610 */   194,  194,   19,  194,   60,  194,   23,  253,  206,  255,
 /*   620 */    73,  254,   19,  154,  155,  156,   72,  276,  277,  278,
 /*   630 */   263,  217,  218,  217,  218,  271,   43,   44,   45,  271,
 /*   640 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*   650 */    57,   58,  183,  194,  285,  101,   19,  214,   60,  242,
 /*   660 */    23,  107,  108,  109,  117,  118,  119,   16,  254,  115,
 /*   670 */   254,  117,  118,  119,  194,   60,  122,  263,  205,  264,
 /*   680 */    43,   44,   45,  264,   47,   48,   49,   50,   51,   52,
 /*   690 */    53,   54,   55,   56,   57,   58,  103,  104,  105,  106,
 /*   700 */   107,  108,  109,  110,  111,  112,  113,  114,  154,  155,
 /*   710 */   156,  157,  158,  240,  241,  117,  118,  119,  101,  205,
 /*   720 */   117,   19,   20,  306,   22,  308,  253,   74,  255,   78,
 /*   730 */   205,   80,  117,  118,  119,  118,  293,  183,   36,  122,
 /*   740 */   103,  104,  105,  106,  107,  108,  109,  110,  111,  112,
 /*   750 */   113,  114,  194,  294,  240,  241,  211,  212,  213,  144,
 /*   760 */    19,   23,   60,   25,   23,  240,  241,  253,  245,  255,
 /*   770 */    15,  154,  155,  156,   72,  217,  218,  194,  253,  256,
 /*   780 */   255,  128,  129,  130,   43,   44,   45,   22,   47,   48,
 /*   790 */    49,   50,   51,   52,   53,   54,   55,   56,   57,   58,
 /*   800 */   183,   19,   77,  101,   19,  128,  129,  130,   23,  107,
 /*   810 */   108,   60,  254,   88,   21,   90,   61,  115,   93,  117,
 /*   820 */   118,  119,  239,   22,  122,   60,  194,  205,   43,   44,

 /*   830 */    45,  205,   47,   48,   49,   50,   51,   52,   53,   54,
 /*   840 */    55,   56,   57,   58,  103,  104,  105,  106,  107,  108,
 /*   850 */   109,  110,  111,  112,  113,  114,  154,  155,  156,  157,
 /*   860 */   158,   60,  240,  241,   60,  116,  240,  241,  117,  118,
 /*   870 */   119,  146,  194,   19,   81,  253,  275,  255,   24,  253,
 /*   880 */    98,  255,  117,  118,  119,  183,   22,  194,  103,  104,
 /*   890 */   105,  106,  107,  108,  109,  110,  111,  112,  113,  114,
 /*   900 */   151,  194,  270,  152,   22,   23,  194,   25,   19,  202,
 /*   910 */   217,  218,   23,  109,  207,  314,  315,  124,  117,  118,
 /*   920 */   119,  117,  118,  119,   60,  232,   22,   23,   19,   25,
 /*   930 */   303,  304,   43,   44,   45,   22,   47,   48,   49,   50,
 /*   940 */    51,   52,   53,   54,   55,   56,   57,   58,  270,  227,
 /*   950 */    96,   60,   43,   44,   45,  162,   47,   48,   49,   50,
 /*   960 */    51,   52,   53,   54,   55,   56,   57,   58,  114,  112,
 /*   970 */   113,  114,  194,   60,  120,  121,  122,  123,  124,  125,
 /*   980 */   126,  117,  118,  119,  102,   25,  132,  107,  108,  194,
 /*   990 */   194,  227,  103,  104,  105,  106,  107,  108,  109,  110,
 /*  1000 */   111,  112,  113,  114,  194,  194,  102,  194,  117,  118,
 /*  1010 */   119,  233,  103,  104,  105,  106,  107,  108,  109,  110,
 /*  1020 */   111,  112,  113,  114,  194,  194,   19,  194,  217,  218,
 /*  1030 */   117,  118,  119,  241,  154,  144,  156,  135,  242,  137,
 /*  1040 */   138,  130,   19,  232,  194,  253,   23,  255,  217,  218,
 /*  1050 */   217,  218,  242,   16,    7,    8,    9,   25,  261,  262,
 /*  1060 */   265,  194,   19,  232,  153,  232,   43,   44,   45,  160,
 /*  1070 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,

 /*  1080 */    57,   58,  194,  227,  217,  218,   43,   44,   45,  194,
 /*  1090 */    47,   48,   49,   50,   51,   52,   53,   54,   55,   56,
 /*  1100 */    57,   58,  306,  143,  308,  217,  218,  294,   12,   77,
 /*  1110 */    22,   23,  217,  218,  194,   78,  306,   80,  308,  194,
 /*  1120 */   232,  254,   90,   27,  117,   93,  103,  104,  105,  106,
 /*  1130 */   107,  108,  109,  110,  111,  112,  113,  114,   42,  194,

 /*  1140 */    35,  194,  217,  218,  214,  194,  103,  104,  105,  106,
 /*  1150 */   107,  108,  109,  110,  111,  112,  113,  114,  194,  239,
 /*  1160 */    64,  194,  217,  218,  217,  218,  209,  210,  217,  218,
 /*  1170 */    74,  207,   67,   22,  194,   77,   19,  232,  245,  232,
 /*  1180 */    75,   24,  312,  232,  217,  218,  316,   25,   90,  256,
 /*  1190 */   102,   93,  159,  229,  161,  231,   19,  217,  218,  162,

 /*  1200 */    43,   44,   45,  160,   47,   48,   49,   50,   51,   52,
 /*  1210 */    53,   54,   55,   56,   57,   58,   19,   23,  288,   25,
 /*  1220 */    43,   44,   45,  293,   47,   48,   49,   50,   51,   52,
 /*  1230 */    53,   54,   55,   56,   57,   58,  131,   22,  275,   24,
 /*  1240 */    43,   44,   45,  194,   47,   48,   49,   50,   51,   52,
 /*  1250 */    53,   54,   55,   56,   57,   58,  194,  194,  107,  108,
 /*  1260 */   103,  104,  105,  106,  107,  108,  109,  110,  111,  112,
 /*  1270 */   113,  114,  194,   25,  194,   60,  194,  314,  315,  194,
 /*  1280 */   103,  104,  105,  106,  107,  108,  109,  110,  111,  112,
 /*  1290 */   113,  114,   19,  194,  194,  217,  218,  217,  218,   25,
 /*  1300 */   103,  104,  105,  106,  107,  108,  109,  110,  111,  112,
 /*  1310 */   113,  114,  150,  119,  265,  312,   67,  217,  218,  316,
 /*  1320 */    19,  239,  194,  194,  128,  129,  130,  265,  265,  209,
 /*  1330 */   210,   31,  254,  118,  254,   86,   60,  194,  144,   39,
 /*  1340 */    19,  130,  275,  312,   95,   44,   45,  316,   47,   48,
 /*  1350 */    49,   50,   51,   52,   53,   54,   55,   56,   57,   58,
 /*  1360 */   217,  218,   24,  194,  153,   12,   45,  119,   47,   48,
 /*  1370 */    49,   50,   51,   52,   53,   54,   55,   56,   57,   58,
 /*  1380 */    27,  314,  315,   22,  312,   24,  217,  218,  316,  116,
 /*  1390 */   117,   22,  144,   25,  118,   42,  147,  194,   60,   19,
 /*  1400 */    20,  127,   22,  194,  103,  104,  105,  106,  107,  108,
 /*  1410 */   109,  110,  111,  112,  113,  114,   36,   64,  145,  194,
 /*  1420 */   217,  218,  194,   54,  103,  104,  105,  106,  107,  108,
 /*  1430 */   109,  110,  111,  112,  113,  114,  194,   22,  310,   25,
 /*  1440 */    60,  194,  217,  218,  194,  217,  218,  194,  260,  194,
 /*  1450 */   301,  302,   72,  262,  262,  194,  118,  266,  266,  217,
 /*  1460 */   218,  194,   82,  245,  217,  218,  194,  217,  218,  194,
 /*  1470 */   217,  218,  217,  218,  256,   60,   24,  194,  217,  218,
 /*  1480 */   194,  101,  194,  245,  217,  218,  194,  107,  108,  217,
 /*  1490 */   218,   22,  217,  218,  256,  115,  245,  117,  118,  119,
 /*  1500 */   217,  218,  122,  217,  218,  217,  218,  256,   22,  217,
 /*  1510 */   218,  116,  258,  259,  146,   19,   20,  194,   22,  139,
 /*  1520 */   140,  150,  151,  136,   23,  194,   25,  194,  141,  194,
 /*  1530 */   194,   62,   36,  118,  154,  155,  156,  157,  158,  100,
 /*  1540 */   145,  194,  154,  194,  156,   49,  194,   23,  194,   25,
 /*  1550 */   217,  218,  217,  218,  194,  257,   60,  143,  194,   60,
 /*  1560 */   194,  121,  122,  183,  217,  218,  217,  218,   72,  217,
 /*  1570 */   218,  217,  218,  134,   23,  194,   25,  217,  218,    7,
 /*  1580 */     8,  321,   86,  217,  218,  194,  122,   91,   19,   20,
 /*  1590 */    23,   22,   25,   23,  142,   25,  132,  101,  217,  218,
 /*  1600 */   194,  194,  194,  107,  108,   36,  194,  194,  217,  218,
 /*  1610 */   194,  115,  194,  117,  118,  119,  194,  118,  122,  194,
 /*  1620 */    23,  194,   25,  217,  218,  217,  218,  194,  142,   60,
 /*  1630 */   217,  218,  194,  217,  218,  217,  218,   84,   85,  217,
 /*  1640 */   218,   72,  217,  218,  217,  218,   60,   23,   60,   25,


 /*  1650 */   154,  155,  156,  157,  158,   86,  154,  194,  156,  194,
 /*  1660 */    91,   19,   20,   23,   22,   25,  194,   23,  194,   25,
 /*  1670 */   101,   23,  194,   25,  194,  194,  107,  108,   36,  183,
 /*  1680 */   217,  218,  217,  218,  115,  194,  117,  118,  119,  217,
 /*  1690 */   218,  122,  194,  237,  194,  217,  218,  217,  218,  194,
 /*  1700 */   194,   23,   60,   25,  118,   23,  118,   25,  217,  218,
 /*  1710 */    23,  194,   25,  194,   72,  217,  218,  217,  218,   23,
 /*  1720 */   194,   25,  194,  154,  155,  156,  157,  158,   86,   23,
 /*  1730 */   194,   25,  194,   91,  217,  218,  217,  218,  194,  194,
 /*  1740 */   194,  194,  194,  101,  194,  217,  218,  290,  194,  107,
 /*  1750 */   108,  194,  183,  217,  218,  194,  194,  115,  194,  117,
 /*  1760 */   118,  119,  194,  243,  122,  194,  289,  194,  194,  194,
 /*  1770 */   194,  257,  257,  257,  244,  257,  192,  273,  215,  269,
 /*  1780 */   246,  299,  269,  295,  247,  273,  247,  246,  295,  230,
 /*  1790 */   261,  226,  261,  261,  273,  273,  154,  155,  156,  157,
 /*  1800 */   158,    0,    1,    2,  221,  220,    5,  220,  250,  220,
 /*  1810 */   261,   10,   11,   12,   13,   14,  250,  282,   17,  197,
 /*  1820 */    61,   19,   20,  246,   22,  183,  244,  142,  201,  201,
 /*  1830 */    38,   30,  299,   32,  201,  152,   22,  151,   36,  299,
 /*  1840 */    43,   40,  235,   18,  238,  285,  238,  238,  296,  238,
 /*  1850 */   201,  296,  274,  272,   18,  200,  235,  150,  235,  247,
 /*  1860 */   247,  247,   60,  247,  274,  274,  272,  201,  200,  159,
 /*  1870 */    63,  292,   71,  201,   72,  200,   22,  201,  222,  200,
 /*  1880 */    79,  201,  222,   82,  291,  116,  219,   65,  200,  219,
 /*  1890 */   219,  228,   22,  127,  225,  166,  222,   24,  225,  114,
 /*  1900 */    99,  284,  221,  101,  284,  228,  307,  315,  219,  107,
 /*  1910 */   108,  219,  219,  219,  201,   92,  320,  115,  320,  117,
 /*  1920 */   118,  119,  222,   83,  122,  267,  267,  149,  146,   19,
 /*  1930 */    20,   22,   22,  279,  250,  134,  201,  148,  159,  249,
 /*  1940 */   139,  140,  251,  141,   25,  281,   36,  147,  251,  248,
 /*  1950 */   247,  203,   13,  195,    6,  195,  154,  155,  156,  157,
 /*  1960 */   158,  193,  305,  193,  163,  193,  305,  302,  214,  208,
 /*  1970 */    60,  214,  208,  223,  223,    4,  214,  214,    3,   22,
 /*  1980 */   215,  214,   72,  208,  164,  183,  215,   15,   23,   16,
 /*  1990 */    23,  140,  131,  152,   25,  143,   20,   16,   24,    1,
 /*  2000 */   145,  143,  131,  131,   62,   37,   54,   54,  152,   54,
 /*  2010 */    54,  101,  131,  117,   34,    1,  142,  107,  108,   22,
 /*  2020 */     5,  116,  162,   69,   25,  115,   76,  117,  118,  119,
 /*  2030 */     1,    2,  122,   69,    5,   41,  142,  116,   20,   10,
 /*  2040 */    11,   12,   13,   14,   24,   19,   17,  132,    5,  126,
 /*  2050 */    22,  141,   68,   10,   11,   12,   13,   14,   22,   30,
 /*  2060 */    17,   32,   22,   22,  154,  155,  156,  157,  158,   40,
 /*  2070 */    23,   68,   60,   30,   24,   32,   97,   28,   22,   68,
 /*  2080 */    23,   37,   34,   40,  150,   22,   25,   23,   23,   23,
 /*  2090 */    22,   98,   23,  183,   23,  117,   34,   22,   25,   89,
 /*  2100 */    71,  142,  144,   76,   34,   23,   34,   76,   79,   87,
 /*  2110 */    34,   82,   34,   94,   71,   34,   22,   24,   44,   34,
 /*  2120 */    25,   25,   79,   23,   23,   82,  143,   23,   99,  143,

 /*  2130 */    23,   22,   11,   25,   23,   25,   22,   22,   22,    1,
 /*  2140 */    23,   23,   99,  136,   22,   22,  142,  142,  142,   25,
 /*  2150 */    25,   23,   15,    1,  322,  322,  322,  322,  322,  322,
 /*  2160 */   322,  322,  322,  134,  322,  322,  322,  322,  139,  140,
 /*  2170 */   322,  322,  322,  322,  322,  322,  322,  134,  322,  322,
 /*  2180 */   322,  322,  139,  140,  322,  322,  322,  322,  322,  322,
 /*  2190 */   322,  322,  163,  322,  322,  322,  322,  322,  322,  322,
 /*  2200 */   322,  322,  322,  322,  322,  322,  163,  322,  322,  322,
 /*  2210 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2220 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2230 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2240 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2250 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2260 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2270 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2280 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2290 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2300 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2310 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2320 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2330 */   322,  322,  322,  322,  322,  322,  322,  322,  322,  322,
 /*  2340 */   186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
 /*  2350 */   186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
 /*  2360 */   186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
 /*  2370 */   186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
 /*  2380 */   186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
 /*  2390 */   186,  186,  186,
};
#define YY_SHIFT_COUNT    (582)
#define YY_SHIFT_MIN      (0)
#define YY_SHIFT_MAX      (2152)
static const unsigned short int yy_shift_ofst[] = {
 /*     0 */  2029, 1801, 2043, 1380, 1380,   33,  391, 1496, 1569, 1642,
 /*    10 */   702,  702,  702,  193,   33,   33,   33,   33,   33,    0,
 /*    20 */     0,  216, 1177,  702,  702,  702,  702,  702,  702,  702,
 /*    30 */   702,  702,  702,  702,  702,  702,  702,  702,  406,  406,
 /*    40 */   111,  111,  218,  447,  547,  598,  598,  260,  260,  260,
 /*    50 */   260,   40,  112,  320,  340,  445,  489,  593,  637,  741,
 /*    60 */   785,  889,  909, 1023, 1043, 1157, 1177, 1177, 1177, 1177,
 /*    70 */  1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177,
 /*    80 */  1177, 1177, 1177, 1177, 1197, 1177, 1301, 1321, 1321,  554,
 /*    90 */  1802, 1910,  702,  702,  702,  702,  702,  702,  702,  702,
 /*   100 */   702,  702,  702,  702,  702,  702,  702,  702,  702,  702,
 /*   110 */   702,  702,  702,  702,  702,  702,  702,  702,  702,  702,
 /*   120 */   702,  702,  702,  702,  702,  702,  702,  702,  702,  702,
 /*   130 */   702,  702,  702,  702,  702,  702,  702,  702,  702,  702,
 /*   140 */   702,  702,  138,  198,  198,  198,  198,  198,  198,  198,
 /*   150 */   183,   99,  236,  292,  598,  793,  167,  598,  598,  880,
 /*   160 */   880,  598,  857,  150,  195,  195,  195,  264,  113,  113,
 /*   170 */  2207, 2207,  854,  854,  854,  751,  765,  765,  765,  765,
 /*   180 */  1096, 1096,  725,  292,  882,  904,  598,  598,  598,  598,
 /*   190 */   598,  598,  598,  598,  598,  598,  598,  598,  598,  598,
 /*   200 */   598,  598,  598,  598,  598, 1273, 1032, 1032,  598,  147,
 /*   210 */  1098, 1098,  603,  603, 1276, 1276,  363, 2207, 2207, 2207,
 /*   220 */  2207, 2207, 2207, 2207,  469,  617,  617,  801,  336,  461,
 /*   230 */   804,  864,  615,  891,  913,  598,  598,  598,  598,  598,
 /*   240 */   598,  598,  598,  598,  598,  653,  598,  598,  598,  598,
 /*   250 */   598,  598,  598,  598,  598,  598,  598,  598, 1105, 1105,
 /*   260 */  1105,  598,  598,  598, 1194,  598,  598,  598, 1215, 1249,
 /*   270 */   598, 1353,  598,  598,  598,  598,  598,  598,  598,  598,
 /*   280 */   677,  449,  902, 1338, 1338, 1338, 1338, 1248,  902,  902,
 /*   290 */   326, 1151, 1047,  755,  749, 1371,  960, 1371, 1007, 1162,
 /*   300 */   749,  749, 1162,  749,  960, 1007, 1274,  738,  215, 1300,
 /*   310 */  1300, 1300, 1395, 1395, 1395, 1395, 1368, 1368, 1033, 1414,
 /*   320 */  1387, 1361, 1759, 1759, 1685, 1685, 1792, 1792, 1685, 1683,
 /*   330 */  1686, 1814, 1797, 1825, 1825, 1825, 1825, 1685, 1836, 1707,
 /*   340 */  1686, 1686, 1707, 1814, 1797, 1707, 1797, 1707, 1685, 1836,
 /*   350 */  1710, 1807, 1685, 1836, 1854, 1685, 1836, 1685, 1836, 1854,
 /*   360 */  1769, 1769, 1769, 1822, 1870, 1870, 1854, 1769, 1766, 1769,
 /*   370 */  1822, 1769, 1769, 1729, 1873, 1785, 1785, 1854, 1685, 1823,
 /*   380 */  1823, 1840, 1840, 1778, 1782, 1909, 1685, 1779, 1778, 1789,
 /*   390 */  1800, 1707, 1919, 1939, 1939, 1948, 1948, 1948, 2207, 2207,
 /*   400 */  2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
 /*   410 */  2207, 2207, 2207,   69, 1037,   79, 1088,  651, 1196, 1415,
 /*   420 */  1501, 1439, 1369, 1452,  911, 1211, 1524, 1469, 1551, 1567,
 /*   430 */  1570, 1624, 1640, 1644, 1499, 1440, 1572, 1464, 1597,  275,
 /*   440 */   782, 1586, 1648, 1678, 1553, 1682, 1687, 1388, 1502, 1696,
 /*   450 */  1706, 1588, 1486, 1971, 1975, 1957, 1820, 1972, 1973, 1965,
 /*   460 */  1967, 1851, 1841, 1861, 1969, 1969, 1974, 1852, 1976, 1855,
 /*   470 */  1981, 1998, 1858, 1871, 1969, 1872, 1942, 1968, 1969, 1856,
 /*   480 */  1952, 1953, 1955, 1956, 1881, 1896, 1980, 1874, 2014, 2015,
 /*   490 */  1997, 1905, 1860, 1954, 1999, 1964, 1950, 1994, 1894, 1921,
 /*   500 */  2020, 2018, 2026, 1915, 1923, 2028, 1984, 2036, 2040, 2047,
 /*   510 */  2041, 2003, 2012, 2050, 1979, 2049, 2056, 2011, 2044, 2057,
 /*   520 */  2048, 1934, 2063, 2064, 2065, 2061, 2066, 2068, 1993, 1959,
 /*   530 */  2069, 2071, 1978, 2062, 2075, 1958, 2073, 2070, 2072, 2076,
 /*   540 */  2078, 2010, 2027, 2022, 2074, 2031, 2019, 2081, 2082, 2094,
 /*   550 */  2093, 2095, 2096, 2085, 1983, 1986, 2100, 2073, 2101, 2104,
 /*   560 */  2107, 2109, 2108, 2110, 2111, 2114, 2121, 2115, 2116, 2117,
 /*   570 */  2118, 2122, 2123, 2124, 2007, 2004, 2005, 2006, 2125, 2128,
 /*   580 */  2137, 2138, 2152,
};
#define YY_REDUCE_COUNT (412)
#define YY_REDUCE_MIN   (-276)
#define YY_REDUCE_MAX   (1775)
static const short yy_reduce_ofst[] = {
 /*     0 */   -66,  217,  -63, -177, -180,  161,  364,   64, -183,  162,
 /*    10 */   223,  367,  414, -173,  473,  514,  525,  622,  626, -207,
 /*    20 */   351, -276,  -38,  693,  811,  831,  833,  888, -188,  945,
 /*    30 */   947,  416,  558,  951,  867,  287, 1078, 1080, -186,  224,
 /*    40 */  -132,   42,  964,  269,  417,  796,  810, -237, -231, -237,
 /*    50 */  -231,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
 /*    60 */   -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
 /*    70 */   -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
 /*    80 */   -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  895,
 /*    90 */   925,  967,  980, 1100, 1143, 1169, 1203, 1225, 1228, 1242,
 /*   100 */  1247, 1250, 1253, 1255, 1261, 1267, 1272, 1275, 1283, 1286,
 /*   110 */  1288, 1292, 1333, 1335, 1347, 1349, 1352, 1354, 1360, 1366,
 /*   120 */  1381, 1391, 1406, 1408, 1413, 1416, 1418, 1422, 1425, 1427,
 /*   130 */  1463, 1465, 1472, 1478, 1480, 1491, 1498, 1500, 1517, 1519,
 /*   140 */  1528, 1536,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
 /*   150 */   -45,  -45,  -45,  312, -158,  285, -219,    9,  166,  370,
 /*   160 */   545,  707,  -45,  930,  601,  963, 1067,  792,  -45,  -45,
 /*   170 */   -45,  -45, -204, -204, -204,  369, -171, -129,  632,  678,
 /*   180 */   202,  352, -270,  412,  627,  627,   -9,  122,  415,  419,
 /*   190 */   -56,  248,  583,  920,    6,  261,  459,  795, 1049,  813,
 /*   200 */  1062, 1082, -161,  778, 1063,  797,  870, 1003, 1128,  443,
 /*   210 */  1031, 1072, 1191, 1192,  957, 1120,  105, 1149,  523,  933,
 /*   220 */  1218, 1238, 1254, 1251, -138,   96,  117,  146,  181,  277,
 /*   230 */   280,  421,  480,  712,  830,  850, 1085, 1099, 1129, 1209,
 /*   240 */  1323, 1331, 1336, 1364, 1407,  368, 1412, 1433, 1438, 1474,
 /*   250 */  1481, 1505, 1506, 1526, 1538, 1544, 1545, 1546,  722,  764,
 /*   260 */   856, 1547, 1548, 1550, 1188, 1554, 1557, 1561, 1298, 1260,
 /*   270 */  1562, 1456, 1564,  280, 1568, 1571, 1573, 1574, 1575, 1576,
 /*   280 */  1457, 1477, 1520, 1514, 1515, 1516, 1518, 1188, 1520, 1520,
 /*   290 */  1530, 1563, 1584, 1482, 1504, 1510, 1534, 1513, 1488, 1537,
 /*   300 */  1512, 1521, 1539, 1522, 1541, 1493, 1583, 1559, 1565, 1585,
 /*   310 */  1587, 1589, 1529, 1531, 1532, 1549, 1558, 1566, 1535, 1577,
 /*   320 */  1582, 1622, 1533, 1540, 1627, 1628, 1552, 1555, 1633, 1560,
 /*   330 */  1578, 1581, 1607, 1606, 1608, 1609, 1611, 1649, 1655, 1612,
 /*   340 */  1590, 1591, 1613, 1594, 1621, 1614, 1623, 1616, 1666, 1668,
 /*   350 */  1579, 1593, 1672, 1675, 1656, 1676, 1679, 1680, 1688, 1660,
 /*   360 */  1667, 1670, 1671, 1663, 1669, 1673, 1674, 1689, 1681, 1692,
 /*   370 */  1677, 1693, 1694, 1592, 1599, 1617, 1620, 1700, 1713, 1596,
 /*   380 */  1598, 1658, 1659, 1691, 1684, 1654, 1735, 1664, 1697, 1690,
 /*   390 */  1701, 1703, 1748, 1758, 1760, 1768, 1770, 1772, 1657, 1661,
 /*   400 */  1665, 1761, 1754, 1757, 1762, 1763, 1764, 1750, 1751, 1765,
 /*   410 */  1771, 1767, 1775,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */  1663, 1663, 1663, 1491, 1254, 1367, 1254, 1254, 1254, 1254,
 /*    10 */  1491, 1491, 1491, 1254, 1254, 1254, 1254, 1254, 1254, 1397,
 /*    20 */  1397, 1544, 1287, 1254, 1254, 1254, 1254, 1254, 1254, 1254,
 /*    30 */  1254, 1254, 1254, 1254, 1254, 1490, 1254, 1254, 1254, 1254,
 /*    40 */  1578, 1578, 1254, 1254, 1254, 1254, 1254, 1563, 1562, 1254,
173947
173948
173949
173950
173951
173952
173953
173954
173955
173956
173957
173958
173959
173960
173961
173962
173963
173964
173965
173966
173967
173968
173969
173970
173971
173972
173973
173974
173975
173976
173977
173978
173979
173980
173981
173982
173983
173984
173985
173986
173987
173988
173989
173990
173991
173992
173993
173994
173995
173996
173997

173998
173999
174000
174001
174002
174003
174004
174005
174006
174007
174008
174009
174010
174011
174012
174013
174014
174015
174016
174017
174018
174019
174020
174021
174022
174023
174024
174025
174026
174027
174028
174029
174030
174031
174032
174033
174034
174035
174036
174037
174038
174039
174040
174041
174042
174043
174044
174045
174046
174047
174048
174049
174050
174051
174052
174053
174054
174055
174056
174057
174058
174059
** to revert to identifiers if they keyword does not apply in the context where
** it appears.
*/
#ifdef YYFALLBACK
static const YYCODETYPE yyFallback[] = {
    0,  /*          $ => nothing */
    0,  /*       SEMI => nothing */
   59,  /*    EXPLAIN => ID */
   59,  /*      QUERY => ID */
   59,  /*       PLAN => ID */
   59,  /*      BEGIN => ID */
    0,  /* TRANSACTION => nothing */
   59,  /*   DEFERRED => ID */
   59,  /*  IMMEDIATE => ID */
   59,  /*  EXCLUSIVE => ID */
    0,  /*     COMMIT => nothing */
   59,  /*        END => ID */
   59,  /*   ROLLBACK => ID */
   59,  /*  SAVEPOINT => ID */
   59,  /*    RELEASE => ID */
    0,  /*         TO => nothing */
    0,  /*      TABLE => nothing */
    0,  /*     CREATE => nothing */
   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 */
   59,  /*         BY => ID */
   59,  /*    CASCADE => ID */
   59,  /*       CAST => ID */
   59,  /*   CONFLICT => ID */
   59,  /*   DATABASE => ID */
   59,  /*       DESC => ID */
   59,  /*     DETACH => ID */
   59,  /*       EACH => ID */
   59,  /*       FAIL => ID */
    0,  /*         OR => nothing */
    0,  /*        AND => nothing */
    0,  /*         IS => nothing */

   59,  /*      MATCH => ID */
   59,  /*    LIKE_KW => ID */
    0,  /*    BETWEEN => nothing */
    0,  /*         IN => nothing */
    0,  /*     ISNULL => nothing */
    0,  /*    NOTNULL => nothing */
    0,  /*         NE => nothing */
    0,  /*         EQ => nothing */
    0,  /*         GT => nothing */
    0,  /*         LE => nothing */
    0,  /*         LT => nothing */
    0,  /*         GE => nothing */
    0,  /*     ESCAPE => nothing */
    0,  /*         ID => nothing */
   59,  /*   COLUMNKW => ID */
   59,  /*         DO => ID */
   59,  /*        FOR => ID */
   59,  /*     IGNORE => ID */
   59,  /*  INITIALLY => ID */
   59,  /*    INSTEAD => ID */
   59,  /*         NO => ID */
   59,  /*        KEY => ID */
   59,  /*         OF => ID */
   59,  /*     OFFSET => ID */
   59,  /*     PRAGMA => ID */
   59,  /*      RAISE => ID */
   59,  /*  RECURSIVE => ID */
   59,  /*    REPLACE => ID */
   59,  /*   RESTRICT => ID */
   59,  /*        ROW => ID */
   59,  /*       ROWS => ID */
   59,  /*    TRIGGER => ID */
   59,  /*     VACUUM => ID */
   59,  /*       VIEW => ID */
   59,  /*    VIRTUAL => ID */
   59,  /*       WITH => ID */
   59,  /*      NULLS => ID */
   59,  /*      FIRST => ID */
   59,  /*       LAST => ID */
   59,  /*    CURRENT => ID */
   59,  /*  FOLLOWING => ID */
   59,  /*  PARTITION => ID */
   59,  /*  PRECEDING => ID */
   59,  /*      RANGE => ID */
   59,  /*  UNBOUNDED => ID */
   59,  /*    EXCLUDE => ID */
   59,  /*     GROUPS => ID */
   59,  /*     OTHERS => ID */
   59,  /*       TIES => ID */
   59,  /*  GENERATED => ID */
   59,  /*     ALWAYS => ID */
   59,  /* MATERIALIZED => ID */
   59,  /*    REINDEX => ID */
   59,  /*     RENAME => ID */
   59,  /*   CTIME_KW => ID */
    0,  /*        ANY => nothing */
    0,  /*     BITAND => nothing */
    0,  /*      BITOR => nothing */
    0,  /*     LSHIFT => nothing */
    0,  /*     RSHIFT => nothing */
    0,  /*       PLUS => nothing */
    0,  /*      MINUS => nothing */







|
|
|
|

|
|
|

|
|
|
|



|


|




|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|



>
|
|












|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







174242
174243
174244
174245
174246
174247
174248
174249
174250
174251
174252
174253
174254
174255
174256
174257
174258
174259
174260
174261
174262
174263
174264
174265
174266
174267
174268
174269
174270
174271
174272
174273
174274
174275
174276
174277
174278
174279
174280
174281
174282
174283
174284
174285
174286
174287
174288
174289
174290
174291
174292
174293
174294
174295
174296
174297
174298
174299
174300
174301
174302
174303
174304
174305
174306
174307
174308
174309
174310
174311
174312
174313
174314
174315
174316
174317
174318
174319
174320
174321
174322
174323
174324
174325
174326
174327
174328
174329
174330
174331
174332
174333
174334
174335
174336
174337
174338
174339
174340
174341
174342
174343
174344
174345
174346
174347
174348
174349
174350
174351
174352
174353
174354
174355
** to revert to identifiers if they keyword does not apply in the context where
** it appears.
*/
#ifdef YYFALLBACK
static const YYCODETYPE yyFallback[] = {
    0,  /*          $ => nothing */
    0,  /*       SEMI => nothing */
   60,  /*    EXPLAIN => ID */
   60,  /*      QUERY => ID */
   60,  /*       PLAN => ID */
   60,  /*      BEGIN => ID */
    0,  /* TRANSACTION => nothing */
   60,  /*   DEFERRED => ID */
   60,  /*  IMMEDIATE => ID */
   60,  /*  EXCLUSIVE => ID */
    0,  /*     COMMIT => nothing */
   60,  /*        END => ID */
   60,  /*   ROLLBACK => ID */
   60,  /*  SAVEPOINT => ID */
   60,  /*    RELEASE => ID */
    0,  /*         TO => nothing */
    0,  /*      TABLE => nothing */
    0,  /*     CREATE => nothing */
   60,  /*         IF => ID */
    0,  /*        NOT => nothing */
    0,  /*     EXISTS => nothing */
   60,  /*       TEMP => ID */
    0,  /*         LP => nothing */
    0,  /*         RP => nothing */
    0,  /*         AS => nothing */
    0,  /*      COMMA => nothing */
   60,  /*    WITHOUT => ID */
   60,  /*      ABORT => ID */
   60,  /*     ACTION => ID */
   60,  /*      AFTER => ID */
   60,  /*    ANALYZE => ID */
   60,  /*        ASC => ID */
   60,  /*     ATTACH => ID */
   60,  /*     BEFORE => ID */
   60,  /*         BY => ID */
   60,  /*    CASCADE => ID */
   60,  /*       CAST => ID */
   60,  /*   CONFLICT => ID */
   60,  /*   DATABASE => ID */
   60,  /*       DESC => ID */
   60,  /*     DETACH => ID */
   60,  /*       EACH => ID */
   60,  /*       FAIL => ID */
    0,  /*         OR => nothing */
    0,  /*        AND => nothing */
    0,  /*         IS => nothing */
    0,  /*      ISNOT => nothing */
   60,  /*      MATCH => ID */
   60,  /*    LIKE_KW => ID */
    0,  /*    BETWEEN => nothing */
    0,  /*         IN => nothing */
    0,  /*     ISNULL => nothing */
    0,  /*    NOTNULL => nothing */
    0,  /*         NE => nothing */
    0,  /*         EQ => nothing */
    0,  /*         GT => nothing */
    0,  /*         LE => nothing */
    0,  /*         LT => nothing */
    0,  /*         GE => nothing */
    0,  /*     ESCAPE => nothing */
    0,  /*         ID => nothing */
   60,  /*   COLUMNKW => ID */
   60,  /*         DO => ID */
   60,  /*        FOR => ID */
   60,  /*     IGNORE => ID */
   60,  /*  INITIALLY => ID */
   60,  /*    INSTEAD => ID */
   60,  /*         NO => ID */
   60,  /*        KEY => ID */
   60,  /*         OF => ID */
   60,  /*     OFFSET => ID */
   60,  /*     PRAGMA => ID */
   60,  /*      RAISE => ID */
   60,  /*  RECURSIVE => ID */
   60,  /*    REPLACE => ID */
   60,  /*   RESTRICT => ID */
   60,  /*        ROW => ID */
   60,  /*       ROWS => ID */
   60,  /*    TRIGGER => ID */
   60,  /*     VACUUM => ID */
   60,  /*       VIEW => ID */
   60,  /*    VIRTUAL => ID */
   60,  /*       WITH => ID */
   60,  /*      NULLS => ID */
   60,  /*      FIRST => ID */
   60,  /*       LAST => ID */
   60,  /*    CURRENT => ID */
   60,  /*  FOLLOWING => ID */
   60,  /*  PARTITION => ID */
   60,  /*  PRECEDING => ID */
   60,  /*      RANGE => ID */
   60,  /*  UNBOUNDED => ID */
   60,  /*    EXCLUDE => ID */
   60,  /*     GROUPS => ID */
   60,  /*     OTHERS => ID */
   60,  /*       TIES => ID */
   60,  /*  GENERATED => ID */
   60,  /*     ALWAYS => ID */
   60,  /* MATERIALIZED => ID */
   60,  /*    REINDEX => ID */
   60,  /*     RENAME => ID */
   60,  /*   CTIME_KW => ID */
    0,  /*        ANY => nothing */
    0,  /*     BITAND => nothing */
    0,  /*      BITOR => nothing */
    0,  /*     LSHIFT => nothing */
    0,  /*     RSHIFT => nothing */
    0,  /*       PLUS => nothing */
    0,  /*      MINUS => nothing */
174116
174117
174118
174119
174120
174121
174122
174123
174124
174125
174126
174127
174128
174129
174130
    0,  /*     WINDOW => nothing */
    0,  /*       OVER => nothing */
    0,  /*     FILTER => nothing */
    0,  /*     COLUMN => nothing */
    0,  /* AGG_FUNCTION => nothing */
    0,  /* AGG_COLUMN => nothing */
    0,  /*  TRUEFALSE => nothing */
    0,  /*      ISNOT => nothing */
    0,  /*   FUNCTION => nothing */
    0,  /*      UPLUS => nothing */
    0,  /*     UMINUS => nothing */
    0,  /*      TRUTH => nothing */
    0,  /*   REGISTER => nothing */
    0,  /*     VECTOR => nothing */
    0,  /* SELECT_COLUMN => nothing */







<







174412
174413
174414
174415
174416
174417
174418

174419
174420
174421
174422
174423
174424
174425
    0,  /*     WINDOW => nothing */
    0,  /*       OVER => nothing */
    0,  /*     FILTER => nothing */
    0,  /*     COLUMN => nothing */
    0,  /* AGG_FUNCTION => nothing */
    0,  /* AGG_COLUMN => nothing */
    0,  /*  TRUEFALSE => nothing */

    0,  /*   FUNCTION => nothing */
    0,  /*      UPLUS => nothing */
    0,  /*     UMINUS => nothing */
    0,  /*      TRUTH => nothing */
    0,  /*   REGISTER => nothing */
    0,  /*     VECTOR => nothing */
    0,  /* SELECT_COLUMN => nothing */
174260
174261
174262
174263
174264
174265
174266
174267
174268
174269
174270
174271
174272
174273
174274
174275
174276
174277
174278
174279
174280
174281
174282
174283
174284
174285
174286
174287
174288
174289
174290
174291
174292
174293
174294
174295
174296
174297
174298
174299
174300
174301
174302
174303
174304
174305
174306
174307
174308
174309
174310
174311
174312
174313
174314
174315
174316
174317
174318
174319
174320
174321
174322
174323
174324
174325
174326
174327
174328
174329
174330
174331
174332
174333
174334
174335
174336
174337
174338
174339
174340
174341
174342
174343
174344
174345
174346
174347
174348
174349
174350
174351
174352
174353
174354
174355
174356
174357
174358
174359
174360
174361
174362
174363
174364
174365
174366
174367
174368
174369
174370
174371
174372
174373
174374
174375
174376
174377
174378
174379
174380
174381
174382
174383
174384
174385
174386
174387
174388
174389
174390
174391
174392
174393
174394
174395
174396
174397
174398
174399
  /*   39 */ "DESC",
  /*   40 */ "DETACH",
  /*   41 */ "EACH",
  /*   42 */ "FAIL",
  /*   43 */ "OR",
  /*   44 */ "AND",
  /*   45 */ "IS",
  /*   46 */ "MATCH",
  /*   47 */ "LIKE_KW",
  /*   48 */ "BETWEEN",
  /*   49 */ "IN",
  /*   50 */ "ISNULL",
  /*   51 */ "NOTNULL",
  /*   52 */ "NE",
  /*   53 */ "EQ",
  /*   54 */ "GT",
  /*   55 */ "LE",
  /*   56 */ "LT",
  /*   57 */ "GE",
  /*   58 */ "ESCAPE",
  /*   59 */ "ID",
  /*   60 */ "COLUMNKW",
  /*   61 */ "DO",
  /*   62 */ "FOR",
  /*   63 */ "IGNORE",
  /*   64 */ "INITIALLY",
  /*   65 */ "INSTEAD",
  /*   66 */ "NO",
  /*   67 */ "KEY",
  /*   68 */ "OF",
  /*   69 */ "OFFSET",
  /*   70 */ "PRAGMA",
  /*   71 */ "RAISE",
  /*   72 */ "RECURSIVE",
  /*   73 */ "REPLACE",
  /*   74 */ "RESTRICT",
  /*   75 */ "ROW",
  /*   76 */ "ROWS",
  /*   77 */ "TRIGGER",
  /*   78 */ "VACUUM",
  /*   79 */ "VIEW",
  /*   80 */ "VIRTUAL",
  /*   81 */ "WITH",
  /*   82 */ "NULLS",
  /*   83 */ "FIRST",
  /*   84 */ "LAST",
  /*   85 */ "CURRENT",
  /*   86 */ "FOLLOWING",
  /*   87 */ "PARTITION",
  /*   88 */ "PRECEDING",
  /*   89 */ "RANGE",
  /*   90 */ "UNBOUNDED",
  /*   91 */ "EXCLUDE",
  /*   92 */ "GROUPS",
  /*   93 */ "OTHERS",
  /*   94 */ "TIES",
  /*   95 */ "GENERATED",
  /*   96 */ "ALWAYS",
  /*   97 */ "MATERIALIZED",
  /*   98 */ "REINDEX",
  /*   99 */ "RENAME",
  /*  100 */ "CTIME_KW",
  /*  101 */ "ANY",
  /*  102 */ "BITAND",
  /*  103 */ "BITOR",
  /*  104 */ "LSHIFT",
  /*  105 */ "RSHIFT",
  /*  106 */ "PLUS",
  /*  107 */ "MINUS",
  /*  108 */ "STAR",
  /*  109 */ "SLASH",
  /*  110 */ "REM",
  /*  111 */ "CONCAT",
  /*  112 */ "PTR",
  /*  113 */ "COLLATE",
  /*  114 */ "BITNOT",
  /*  115 */ "ON",
  /*  116 */ "INDEXED",
  /*  117 */ "STRING",
  /*  118 */ "JOIN_KW",
  /*  119 */ "CONSTRAINT",
  /*  120 */ "DEFAULT",
  /*  121 */ "NULL",
  /*  122 */ "PRIMARY",
  /*  123 */ "UNIQUE",
  /*  124 */ "CHECK",
  /*  125 */ "REFERENCES",
  /*  126 */ "AUTOINCR",
  /*  127 */ "INSERT",
  /*  128 */ "DELETE",
  /*  129 */ "UPDATE",
  /*  130 */ "SET",
  /*  131 */ "DEFERRABLE",
  /*  132 */ "FOREIGN",
  /*  133 */ "DROP",
  /*  134 */ "UNION",
  /*  135 */ "ALL",
  /*  136 */ "EXCEPT",
  /*  137 */ "INTERSECT",
  /*  138 */ "SELECT",
  /*  139 */ "VALUES",
  /*  140 */ "DISTINCT",
  /*  141 */ "DOT",
  /*  142 */ "FROM",
  /*  143 */ "JOIN",
  /*  144 */ "USING",
  /*  145 */ "ORDER",
  /*  146 */ "GROUP",
  /*  147 */ "HAVING",
  /*  148 */ "LIMIT",
  /*  149 */ "WHERE",
  /*  150 */ "RETURNING",
  /*  151 */ "INTO",
  /*  152 */ "NOTHING",
  /*  153 */ "FLOAT",
  /*  154 */ "BLOB",
  /*  155 */ "INTEGER",
  /*  156 */ "VARIABLE",
  /*  157 */ "CASE",
  /*  158 */ "WHEN",
  /*  159 */ "THEN",
  /*  160 */ "ELSE",
  /*  161 */ "INDEX",
  /*  162 */ "ALTER",
  /*  163 */ "ADD",
  /*  164 */ "WINDOW",
  /*  165 */ "OVER",
  /*  166 */ "FILTER",
  /*  167 */ "COLUMN",
  /*  168 */ "AGG_FUNCTION",
  /*  169 */ "AGG_COLUMN",
  /*  170 */ "TRUEFALSE",
  /*  171 */ "ISNOT",
  /*  172 */ "FUNCTION",
  /*  173 */ "UPLUS",
  /*  174 */ "UMINUS",
  /*  175 */ "TRUTH",
  /*  176 */ "REGISTER",
  /*  177 */ "VECTOR",
  /*  178 */ "SELECT_COLUMN",







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







174555
174556
174557
174558
174559
174560
174561
174562
174563
174564
174565
174566
174567
174568
174569
174570
174571
174572
174573
174574
174575
174576
174577
174578
174579
174580
174581
174582
174583
174584
174585
174586
174587
174588
174589
174590
174591
174592
174593
174594
174595
174596
174597
174598
174599
174600
174601
174602
174603
174604
174605
174606
174607
174608
174609
174610
174611
174612
174613
174614
174615
174616
174617
174618
174619
174620
174621
174622
174623
174624
174625
174626
174627
174628
174629
174630
174631
174632
174633
174634
174635
174636
174637
174638
174639
174640
174641
174642
174643
174644
174645
174646
174647
174648
174649
174650
174651
174652
174653
174654
174655
174656
174657
174658
174659
174660
174661
174662
174663
174664
174665
174666
174667
174668
174669
174670
174671
174672
174673
174674
174675
174676
174677
174678
174679
174680
174681
174682
174683
174684
174685
174686
174687
174688
174689
174690
174691
174692
174693
174694
  /*   39 */ "DESC",
  /*   40 */ "DETACH",
  /*   41 */ "EACH",
  /*   42 */ "FAIL",
  /*   43 */ "OR",
  /*   44 */ "AND",
  /*   45 */ "IS",
  /*   46 */ "ISNOT",
  /*   47 */ "MATCH",
  /*   48 */ "LIKE_KW",
  /*   49 */ "BETWEEN",
  /*   50 */ "IN",
  /*   51 */ "ISNULL",
  /*   52 */ "NOTNULL",
  /*   53 */ "NE",
  /*   54 */ "EQ",
  /*   55 */ "GT",
  /*   56 */ "LE",
  /*   57 */ "LT",
  /*   58 */ "GE",
  /*   59 */ "ESCAPE",
  /*   60 */ "ID",
  /*   61 */ "COLUMNKW",
  /*   62 */ "DO",
  /*   63 */ "FOR",
  /*   64 */ "IGNORE",
  /*   65 */ "INITIALLY",
  /*   66 */ "INSTEAD",
  /*   67 */ "NO",
  /*   68 */ "KEY",
  /*   69 */ "OF",
  /*   70 */ "OFFSET",
  /*   71 */ "PRAGMA",
  /*   72 */ "RAISE",
  /*   73 */ "RECURSIVE",
  /*   74 */ "REPLACE",
  /*   75 */ "RESTRICT",
  /*   76 */ "ROW",
  /*   77 */ "ROWS",
  /*   78 */ "TRIGGER",
  /*   79 */ "VACUUM",
  /*   80 */ "VIEW",
  /*   81 */ "VIRTUAL",
  /*   82 */ "WITH",
  /*   83 */ "NULLS",
  /*   84 */ "FIRST",
  /*   85 */ "LAST",
  /*   86 */ "CURRENT",
  /*   87 */ "FOLLOWING",
  /*   88 */ "PARTITION",
  /*   89 */ "PRECEDING",
  /*   90 */ "RANGE",
  /*   91 */ "UNBOUNDED",
  /*   92 */ "EXCLUDE",
  /*   93 */ "GROUPS",
  /*   94 */ "OTHERS",
  /*   95 */ "TIES",
  /*   96 */ "GENERATED",
  /*   97 */ "ALWAYS",
  /*   98 */ "MATERIALIZED",
  /*   99 */ "REINDEX",
  /*  100 */ "RENAME",
  /*  101 */ "CTIME_KW",
  /*  102 */ "ANY",
  /*  103 */ "BITAND",
  /*  104 */ "BITOR",
  /*  105 */ "LSHIFT",
  /*  106 */ "RSHIFT",
  /*  107 */ "PLUS",
  /*  108 */ "MINUS",
  /*  109 */ "STAR",
  /*  110 */ "SLASH",
  /*  111 */ "REM",
  /*  112 */ "CONCAT",
  /*  113 */ "PTR",
  /*  114 */ "COLLATE",
  /*  115 */ "BITNOT",
  /*  116 */ "ON",
  /*  117 */ "INDEXED",
  /*  118 */ "STRING",
  /*  119 */ "JOIN_KW",
  /*  120 */ "CONSTRAINT",
  /*  121 */ "DEFAULT",
  /*  122 */ "NULL",
  /*  123 */ "PRIMARY",
  /*  124 */ "UNIQUE",
  /*  125 */ "CHECK",
  /*  126 */ "REFERENCES",
  /*  127 */ "AUTOINCR",
  /*  128 */ "INSERT",
  /*  129 */ "DELETE",
  /*  130 */ "UPDATE",
  /*  131 */ "SET",
  /*  132 */ "DEFERRABLE",
  /*  133 */ "FOREIGN",
  /*  134 */ "DROP",
  /*  135 */ "UNION",
  /*  136 */ "ALL",
  /*  137 */ "EXCEPT",
  /*  138 */ "INTERSECT",
  /*  139 */ "SELECT",
  /*  140 */ "VALUES",
  /*  141 */ "DISTINCT",
  /*  142 */ "DOT",
  /*  143 */ "FROM",
  /*  144 */ "JOIN",
  /*  145 */ "USING",
  /*  146 */ "ORDER",
  /*  147 */ "GROUP",
  /*  148 */ "HAVING",
  /*  149 */ "LIMIT",
  /*  150 */ "WHERE",
  /*  151 */ "RETURNING",
  /*  152 */ "INTO",
  /*  153 */ "NOTHING",
  /*  154 */ "FLOAT",
  /*  155 */ "BLOB",
  /*  156 */ "INTEGER",
  /*  157 */ "VARIABLE",
  /*  158 */ "CASE",
  /*  159 */ "WHEN",
  /*  160 */ "THEN",
  /*  161 */ "ELSE",
  /*  162 */ "INDEX",
  /*  163 */ "ALTER",
  /*  164 */ "ADD",
  /*  165 */ "WINDOW",
  /*  166 */ "OVER",
  /*  167 */ "FILTER",
  /*  168 */ "COLUMN",
  /*  169 */ "AGG_FUNCTION",
  /*  170 */ "AGG_COLUMN",
  /*  171 */ "TRUEFALSE",
  /*  172 */ "FUNCTION",
  /*  173 */ "UPLUS",
  /*  174 */ "UMINUS",
  /*  175 */ "TRUTH",
  /*  176 */ "REGISTER",
  /*  177 */ "VECTOR",
  /*  178 */ "SELECT_COLUMN",
236535
236536
236537
236538
236539
236540
236541
236542
236543
236544
236545
236546
236547
236548
236549
*/
static void sqlite3Fts5ConfigFree(Fts5Config *pConfig){
  if( pConfig ){
    int i;
    if( pConfig->t.pTok ){
      pConfig->t.pTokApi->xDelete(pConfig->t.pTok);
    }
    sqlite3_free(pConfig->t.azArg);
    sqlite3_free(pConfig->zDb);
    sqlite3_free(pConfig->zName);
    for(i=0; i<pConfig->nCol; i++){
      sqlite3_free(pConfig->azCol[i]);
    }
    sqlite3_free(pConfig->azCol);
    sqlite3_free(pConfig->aPrefix);







|







236830
236831
236832
236833
236834
236835
236836
236837
236838
236839
236840
236841
236842
236843
236844
*/
static void sqlite3Fts5ConfigFree(Fts5Config *pConfig){
  if( pConfig ){
    int i;
    if( pConfig->t.pTok ){
      pConfig->t.pTokApi->xDelete(pConfig->t.pTok);
    }
    sqlite3_free((char*)pConfig->t.azArg);
    sqlite3_free(pConfig->zDb);
    sqlite3_free(pConfig->zName);
    for(i=0; i<pConfig->nCol; i++){
      sqlite3_free(pConfig->azCol[i]);
    }
    sqlite3_free(pConfig->azCol);
    sqlite3_free(pConfig->aPrefix);
250350
250351
250352
250353
250354
250355
250356
250357

250358
250359
250360
250361
250362
250363
250364
250365
250366
250367
250368
**   Equality constraint against the rowid: "="
**   A < or <= against the rowid:           "<"
**   A > or >= against the rowid:           ">"
**
** This function ensures that there is at most one "r" or "=". And that if
** there exists an "=" then there is no "<" or ">".
**
** Costs are assigned as follows:

**
**  a) If an unusable MATCH operator is present in the WHERE clause, the
**     cost is unconditionally set to 1e50 (a really big number).
**
**  a) If a MATCH operator is present, the cost depends on the other
**     constraints also present. As follows:
**
**       * No other constraints:         cost=1000.0
**       * One rowid range constraint:   cost=750.0
**       * Both rowid range constraints: cost=500.0
**       * An == rowid constraint:       cost=100.0







|
>

<
|








250645
250646
250647
250648
250649
250650
250651
250652
250653
250654

250655
250656
250657
250658
250659
250660
250661
250662
250663
**   Equality constraint against the rowid: "="
**   A < or <= against the rowid:           "<"
**   A > or >= against the rowid:           ">"
**
** This function ensures that there is at most one "r" or "=". And that if
** there exists an "=" then there is no "<" or ">".
**
** If an unusable MATCH operator is present in the WHERE clause, then
** SQLITE_CONSTRAINT is returned.
**

** Costs are assigned as follows:
**
**  a) If a MATCH operator is present, the cost depends on the other
**     constraints also present. As follows:
**
**       * No other constraints:         cost=1000.0
**       * One rowid range constraint:   cost=750.0
**       * Both rowid range constraints: cost=500.0
**       * An == rowid constraint:       cost=100.0
250386
250387
250388
250389
250390
250391
250392
250393
250394
250395
250396
250397
250398
250399
250400
  char *idxStr;
  int iIdxStr = 0;
  int iCons = 0;

  int bSeenEq = 0;
  int bSeenGt = 0;
  int bSeenLt = 0;
  int bSeenMatch = 0;
  int bSeenRank = 0;


  assert( SQLITE_INDEX_CONSTRAINT_EQ<SQLITE_INDEX_CONSTRAINT_MATCH );
  assert( SQLITE_INDEX_CONSTRAINT_GT<SQLITE_INDEX_CONSTRAINT_MATCH );
  assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH );
  assert( SQLITE_INDEX_CONSTRAINT_GE<SQLITE_INDEX_CONSTRAINT_MATCH );







|







250681
250682
250683
250684
250685
250686
250687
250688
250689
250690
250691
250692
250693
250694
250695
  char *idxStr;
  int iIdxStr = 0;
  int iCons = 0;

  int bSeenEq = 0;
  int bSeenGt = 0;
  int bSeenLt = 0;
  int nSeenMatch = 0;
  int bSeenRank = 0;


  assert( SQLITE_INDEX_CONSTRAINT_EQ<SQLITE_INDEX_CONSTRAINT_MATCH );
  assert( SQLITE_INDEX_CONSTRAINT_GT<SQLITE_INDEX_CONSTRAINT_MATCH );
  assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH );
  assert( SQLITE_INDEX_CONSTRAINT_GE<SQLITE_INDEX_CONSTRAINT_MATCH );
250417
250418
250419
250420
250421
250422
250423
250424
250425
250426
250427
250428
250429
250430
250431
250432
250433
250434
250435
250436
250437
250438
250439
250440
250441
250442
250443
250444
250445
250446
250447
250448
250449
250450
250451
250452
250453
250454
250455
250456
250457
250458
250459
    int iCol = p->iColumn;
    if( p->op==SQLITE_INDEX_CONSTRAINT_MATCH
     || (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol)
    ){
      /* A MATCH operator or equivalent */
      if( p->usable==0 || iCol<0 ){
        /* As there exists an unusable MATCH constraint this is an
        ** unusable plan. Set a prohibitively high cost. */
        pInfo->estimatedCost = 1e50;
        assert( iIdxStr < pInfo->nConstraint*6 + 1 );
        idxStr[iIdxStr] = 0;
        return SQLITE_OK;
      }else{
        if( iCol==nCol+1 ){
          if( bSeenRank ) continue;
          idxStr[iIdxStr++] = 'r';
          bSeenRank = 1;
        }else if( iCol>=0 ){
          bSeenMatch = 1;
          idxStr[iIdxStr++] = 'M';
          sqlite3_snprintf(6, &idxStr[iIdxStr], "%d", iCol);
          idxStr += strlen(&idxStr[iIdxStr]);
          assert( idxStr[iIdxStr]=='\0' );
        }
        pInfo->aConstraintUsage[i].argvIndex = ++iCons;
        pInfo->aConstraintUsage[i].omit = 1;
      }
    }else if( p->usable ){
      if( iCol>=0 && iCol<nCol && fts5UsePatternMatch(pConfig, p) ){
        assert( p->op==FTS5_PATTERN_LIKE || p->op==FTS5_PATTERN_GLOB );
        idxStr[iIdxStr++] = p->op==FTS5_PATTERN_LIKE ? 'L' : 'G';
        sqlite3_snprintf(6, &idxStr[iIdxStr], "%d", iCol);
        idxStr += strlen(&idxStr[iIdxStr]);
        pInfo->aConstraintUsage[i].argvIndex = ++iCons;
        assert( idxStr[iIdxStr]=='\0' );
        bSeenMatch = 1;
      }else if( bSeenEq==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol<0 ){
        idxStr[iIdxStr++] = '=';
        bSeenEq = 1;
        pInfo->aConstraintUsage[i].argvIndex = ++iCons;
      }
    }
  }







|
<
<
<
|






|
















|







250712
250713
250714
250715
250716
250717
250718
250719



250720
250721
250722
250723
250724
250725
250726
250727
250728
250729
250730
250731
250732
250733
250734
250735
250736
250737
250738
250739
250740
250741
250742
250743
250744
250745
250746
250747
250748
250749
250750
250751
    int iCol = p->iColumn;
    if( p->op==SQLITE_INDEX_CONSTRAINT_MATCH
     || (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol)
    ){
      /* A MATCH operator or equivalent */
      if( p->usable==0 || iCol<0 ){
        /* As there exists an unusable MATCH constraint this is an
        ** unusable plan. Return SQLITE_CONSTRAINT. */



        return SQLITE_CONSTRAINT;
      }else{
        if( iCol==nCol+1 ){
          if( bSeenRank ) continue;
          idxStr[iIdxStr++] = 'r';
          bSeenRank = 1;
        }else if( iCol>=0 ){
          nSeenMatch++;
          idxStr[iIdxStr++] = 'M';
          sqlite3_snprintf(6, &idxStr[iIdxStr], "%d", iCol);
          idxStr += strlen(&idxStr[iIdxStr]);
          assert( idxStr[iIdxStr]=='\0' );
        }
        pInfo->aConstraintUsage[i].argvIndex = ++iCons;
        pInfo->aConstraintUsage[i].omit = 1;
      }
    }else if( p->usable ){
      if( iCol>=0 && iCol<nCol && fts5UsePatternMatch(pConfig, p) ){
        assert( p->op==FTS5_PATTERN_LIKE || p->op==FTS5_PATTERN_GLOB );
        idxStr[iIdxStr++] = p->op==FTS5_PATTERN_LIKE ? 'L' : 'G';
        sqlite3_snprintf(6, &idxStr[iIdxStr], "%d", iCol);
        idxStr += strlen(&idxStr[iIdxStr]);
        pInfo->aConstraintUsage[i].argvIndex = ++iCons;
        assert( idxStr[iIdxStr]=='\0' );
        nSeenMatch++;
      }else if( bSeenEq==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol<0 ){
        idxStr[iIdxStr++] = '=';
        bSeenEq = 1;
        pInfo->aConstraintUsage[i].argvIndex = ++iCons;
      }
    }
  }
250482
250483
250484
250485
250486
250487
250488
250489
250490
250491
250492
250493
250494
250495
250496
250497
250498
250499
250500
250501
250502
250503
250504
250505
250506
250507
250508
250509
250510



250511
250512
250513
250514
250515
250516
250517
250518

  /* Set idxFlags flags for the ORDER BY clause
  **
  ** Note that tokendata=1 tables cannot currently handle "ORDER BY rowid DESC".
  */
  if( pInfo->nOrderBy==1 ){
    int iSort = pInfo->aOrderBy[0].iColumn;
    if( iSort==(pConfig->nCol+1) && bSeenMatch ){
      idxFlags |= FTS5_BI_ORDER_RANK;
    }else if( iSort==-1 && (!pInfo->aOrderBy[0].desc || !pConfig->bTokendata) ){
      idxFlags |= FTS5_BI_ORDER_ROWID;
    }
    if( BitFlagTest(idxFlags, FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) ){
      pInfo->orderByConsumed = 1;
      if( pInfo->aOrderBy[0].desc ){
        idxFlags |= FTS5_BI_ORDER_DESC;
      }
    }
  }

  /* Calculate the estimated cost based on the flags set in idxFlags. */
  if( bSeenEq ){
    pInfo->estimatedCost = bSeenMatch ? 100.0 : 10.0;
    if( bSeenMatch==0 ) fts5SetUniqueFlag(pInfo);
  }else if( bSeenLt && bSeenGt ){
    pInfo->estimatedCost = bSeenMatch ? 500.0 : 250000.0;
  }else if( bSeenLt || bSeenGt ){
    pInfo->estimatedCost = bSeenMatch ? 750.0 : 750000.0;
  }else{



    pInfo->estimatedCost = bSeenMatch ? 1000.0 : 1000000.0;
  }

  pInfo->idxNum = idxFlags;
  return SQLITE_OK;
}

static int fts5NewTransaction(Fts5FullTable *pTab){







|














|
|

|

|

>
>
>
|







250774
250775
250776
250777
250778
250779
250780
250781
250782
250783
250784
250785
250786
250787
250788
250789
250790
250791
250792
250793
250794
250795
250796
250797
250798
250799
250800
250801
250802
250803
250804
250805
250806
250807
250808
250809
250810
250811
250812
250813

  /* Set idxFlags flags for the ORDER BY clause
  **
  ** Note that tokendata=1 tables cannot currently handle "ORDER BY rowid DESC".
  */
  if( pInfo->nOrderBy==1 ){
    int iSort = pInfo->aOrderBy[0].iColumn;
    if( iSort==(pConfig->nCol+1) && nSeenMatch>0 ){
      idxFlags |= FTS5_BI_ORDER_RANK;
    }else if( iSort==-1 && (!pInfo->aOrderBy[0].desc || !pConfig->bTokendata) ){
      idxFlags |= FTS5_BI_ORDER_ROWID;
    }
    if( BitFlagTest(idxFlags, FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) ){
      pInfo->orderByConsumed = 1;
      if( pInfo->aOrderBy[0].desc ){
        idxFlags |= FTS5_BI_ORDER_DESC;
      }
    }
  }

  /* Calculate the estimated cost based on the flags set in idxFlags. */
  if( bSeenEq ){
    pInfo->estimatedCost = nSeenMatch ? 1000.0 : 10.0;
    if( nSeenMatch==0 ) fts5SetUniqueFlag(pInfo);
  }else if( bSeenLt && bSeenGt ){
    pInfo->estimatedCost = nSeenMatch ? 5000.0 : 250000.0;
  }else if( bSeenLt || bSeenGt ){
    pInfo->estimatedCost = nSeenMatch ? 7500.0 : 750000.0;
  }else{
    pInfo->estimatedCost = nSeenMatch ? 10000.0 : 1000000.0;
  }
  for(i=1; i<nSeenMatch; i++){
    pInfo->estimatedCost *= 0.4;
  }

  pInfo->idxNum = idxFlags;
  return SQLITE_OK;
}

static int fts5NewTransaction(Fts5FullTable *pTab){
251520
251521
251522
251523
251524
251525
251526

251527
251528
251529
251530
251531
251532
251533
      if( pConfig->bContentlessDelete ){
        fts5SetVtabError(pTab,
            "'delete' may not be used with a contentless_delete=1 table"
        );
        rc = SQLITE_ERROR;
      }else{
        rc = fts5SpecialDelete(pTab, apVal);

      }
    }else{
      rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]);
    }
  }else{
    /* A regular INSERT, UPDATE or DELETE statement. The trick here is that
    ** any conflict on the rowid value must be detected before any







>







251815
251816
251817
251818
251819
251820
251821
251822
251823
251824
251825
251826
251827
251828
251829
      if( pConfig->bContentlessDelete ){
        fts5SetVtabError(pTab,
            "'delete' may not be used with a contentless_delete=1 table"
        );
        rc = SQLITE_ERROR;
      }else{
        rc = fts5SpecialDelete(pTab, apVal);
        bUpdateOrDelete = 1;
      }
    }else{
      rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]);
    }
  }else{
    /* A regular INSERT, UPDATE or DELETE statement. The trick here is that
    ** any conflict on the rowid value must be detected before any
252773
252774
252775
252776
252777
252778
252779
252780
252781
252782
252783
252784
252785
252786
252787
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: 2024-05-30 11:14:16 ee92fa8366b743266b17c692499087c0d11b9302d096c3dfb4e6356b467e939e", -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){







|







253069
253070
253071
253072
253073
253074
253075
253076
253077
253078
253079
253080
253081
253082
253083
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: 2024-06-11 17:37:36 5f25a9518a675efbd0525cc2f5595ee7bc7122be7cfecdf6b20c909185dea370", -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 extsrc/sqlite3.h.

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.47.0"
#define SQLITE_VERSION_NUMBER 3047000
#define SQLITE_SOURCE_ID      "2024-05-30 13:27:29 a47c644fef71f3ab3dc584ea917eaab9a8e5b4c9dcb57bdd29747ba32108e85f"

/*
** 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







|







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.47.0"
#define SQLITE_VERSION_NUMBER 3047000
#define SQLITE_SOURCE_ID      "2024-06-11 18:22:48 33a3f327855b427ae6ba0057218d043a1417bc9d780728f47f23acdd836e1686"

/*
** 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
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
#ifdef SQLITE_OMIT_FLOATING_POINT
# undef double
#endif

#if defined(__wasi__)
# undef SQLITE_WASI
# define SQLITE_WASI 1
# undef SQLITE_OMIT_WAL
# define SQLITE_OMIT_WAL 1/* because it requires shared memory APIs */
# ifndef SQLITE_OMIT_LOAD_EXTENSION
#  define SQLITE_OMIT_LOAD_EXTENSION
# endif
# ifndef SQLITE_THREADSAFE
#  define SQLITE_THREADSAFE 0
# endif
#endif







<
<







10828
10829
10830
10831
10832
10833
10834


10835
10836
10837
10838
10839
10840
10841
#ifdef SQLITE_OMIT_FLOATING_POINT
# undef double
#endif

#if defined(__wasi__)
# undef SQLITE_WASI
# define SQLITE_WASI 1


# ifndef SQLITE_OMIT_LOAD_EXTENSION
#  define SQLITE_OMIT_LOAD_EXTENSION
# endif
# ifndef SQLITE_THREADSAFE
#  define SQLITE_THREADSAFE 0
# endif
#endif