| | @@ -1156,11 +1156,11 @@ |
| 1156 | 1156 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1157 | 1157 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1158 | 1158 | */ |
| 1159 | 1159 | #define SQLITE_VERSION "3.25.0" |
| 1160 | 1160 | #define SQLITE_VERSION_NUMBER 3025000 |
| 1161 | | -#define SQLITE_SOURCE_ID "2018-07-24 22:02:12 2bd593332da0aade467e7a4ee89e966aa6302f37540a2c5e23671f98a6cb599c" |
| 1161 | +#define SQLITE_SOURCE_ID "2018-08-16 16:24:24 456842924bb33c0af8af29402f06e5f25b6791f698a0d12a080258b20b0cfb61" |
| 1162 | 1162 | |
| 1163 | 1163 | /* |
| 1164 | 1164 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1165 | 1165 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1166 | 1166 | ** |
| | @@ -10031,11 +10031,11 @@ |
| 10031 | 10031 | ** the following statements are false when sqlite3_snapshot_get() is |
| 10032 | 10032 | ** called, SQLITE_ERROR is returned. The final value of *P is undefined |
| 10033 | 10033 | ** in this case. |
| 10034 | 10034 | ** |
| 10035 | 10035 | ** <ul> |
| 10036 | | -** <li> The database handle must be in [autocommit mode]. |
| 10036 | +** <li> The database handle must not be in [autocommit mode]. |
| 10037 | 10037 | ** |
| 10038 | 10038 | ** <li> Schema S of [database connection] D must be a [WAL mode] database. |
| 10039 | 10039 | ** |
| 10040 | 10040 | ** <li> There must not be a write transaction open on schema S of database |
| 10041 | 10041 | ** connection D. |
| | @@ -10066,26 +10066,37 @@ |
| 10066 | 10066 | |
| 10067 | 10067 | /* |
| 10068 | 10068 | ** CAPI3REF: Start a read transaction on an historical snapshot |
| 10069 | 10069 | ** METHOD: sqlite3_snapshot |
| 10070 | 10070 | ** |
| 10071 | | -** ^The [sqlite3_snapshot_open(D,S,P)] interface starts a |
| 10072 | | -** read transaction for schema S of |
| 10073 | | -** [database connection] D such that the read transaction |
| 10074 | | -** refers to historical [snapshot] P, rather than the most |
| 10075 | | -** recent change to the database. |
| 10076 | | -** ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK on success |
| 10077 | | -** or an appropriate [error code] if it fails. |
| 10071 | +** ^The [sqlite3_snapshot_open(D,S,P)] interface either starts a new read |
| 10072 | +** transaction or upgrades an existing one for schema S of |
| 10073 | +** [database connection] D such that the read transaction refers to |
| 10074 | +** historical [snapshot] P, rather than the most recent change to the |
| 10075 | +** database. ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK |
| 10076 | +** on success or an appropriate [error code] if it fails. |
| 10078 | 10077 | ** |
| 10079 | | -** ^In order to succeed, a call to [sqlite3_snapshot_open(D,S,P)] must be |
| 10080 | | -** the first operation following the [BEGIN] that takes the schema S |
| 10081 | | -** out of [autocommit mode]. |
| 10082 | | -** ^In other words, schema S must not currently be in |
| 10083 | | -** a transaction for [sqlite3_snapshot_open(D,S,P)] to work, but the |
| 10084 | | -** database connection D must be out of [autocommit mode]. |
| 10085 | | -** ^A [snapshot] will fail to open if it has been overwritten by a |
| 10086 | | -** [checkpoint]. |
| 10078 | +** ^In order to succeed, the database connection must not be in |
| 10079 | +** [autocommit mode] when [sqlite3_snapshot_open(D,S,P)] is called. If there |
| 10080 | +** is already a read transaction open on schema S, then the database handle |
| 10081 | +** must have no active statements (SELECT statements that have been passed |
| 10082 | +** to sqlite3_step() but not sqlite3_reset() or sqlite3_finalize()). |
| 10083 | +** SQLITE_ERROR is returned if either of these conditions is violated, or |
| 10084 | +** if schema S does not exist, or if the snapshot object is invalid. |
| 10085 | +** |
| 10086 | +** ^A call to sqlite3_snapshot_open() will fail to open if the specified |
| 10087 | +** snapshot has been overwritten by a [checkpoint]. In this case |
| 10088 | +** SQLITE_BUSY_SNAPSHOT is returned. |
| 10089 | +** |
| 10090 | +** If there is already a read transaction open when this function is |
| 10091 | +** invoked, then the same read transaction remains open (on the same |
| 10092 | +** database snapshot) if SQLITE_ERROR, SQLITE_BUSY or SQLITE_BUSY_SNAPSHOT |
| 10093 | +** is returned. If another error code - for example SQLITE_PROTOCOL or an |
| 10094 | +** SQLITE_IOERR error code - is returned, then the final state of the |
| 10095 | +** read transaction is undefined. If SQLITE_OK is returned, then the |
| 10096 | +** read transaction is now open on database snapshot P. |
| 10097 | +** |
| 10087 | 10098 | ** ^(A call to [sqlite3_snapshot_open(D,S,P)] will fail if the |
| 10088 | 10099 | ** database connection D does not know that the database file for |
| 10089 | 10100 | ** schema S is in [WAL mode]. A database connection might not know |
| 10090 | 10101 | ** that the database file is in [WAL mode] if there has been no prior |
| 10091 | 10102 | ** I/O on that database connection, or if the database entered [WAL mode] |
| | @@ -13008,21 +13019,10 @@ |
| 13008 | 13019 | #endif |
| 13009 | 13020 | #if defined(NDEBUG) && defined(SQLITE_DEBUG) |
| 13010 | 13021 | # undef NDEBUG |
| 13011 | 13022 | #endif |
| 13012 | 13023 | |
| 13013 | | -/* SQLITE_DEBUG_COLUMNCACHE is synomous with SQLITE_DEBUG. The |
| 13014 | | -** SQLITE_DEBUG_COLUMNCACHE symbol only exists to provide a convenient |
| 13015 | | -** way to search for all code that deals with verifying correct behavior |
| 13016 | | -** of the column cache. |
| 13017 | | -*/ |
| 13018 | | -#ifdef SQLITE_DEBUG |
| 13019 | | -# define SQLITE_DEBUG_COLUMNCACHE 1 |
| 13020 | | -#else |
| 13021 | | -# undef SQLIT_DEBUG_COLUMNCACHE |
| 13022 | | -#endif |
| 13023 | | - |
| 13024 | 13024 | /* |
| 13025 | 13025 | ** Enable SQLITE_ENABLE_EXPLAIN_COMMENTS if SQLITE_DEBUG is turned on. |
| 13026 | 13026 | */ |
| 13027 | 13027 | #if !defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) && defined(SQLITE_DEBUG) |
| 13028 | 13028 | # define SQLITE_ENABLE_EXPLAIN_COMMENTS 1 |
| | @@ -14720,40 +14720,40 @@ |
| 14720 | 14720 | #define OP_Ge 57 /* jump, same as TK_GE, synopsis: IF r[P3]>=r[P1] */ |
| 14721 | 14721 | #define OP_ElseNotEq 58 /* jump, same as TK_ESCAPE */ |
| 14722 | 14722 | #define OP_IncrVacuum 59 /* jump */ |
| 14723 | 14723 | #define OP_VNext 60 /* jump */ |
| 14724 | 14724 | #define OP_Init 61 /* jump, synopsis: Start at P2 */ |
| 14725 | | -#define OP_Return 62 |
| 14726 | | -#define OP_EndCoroutine 63 |
| 14727 | | -#define OP_HaltIfNull 64 /* synopsis: if r[P3]=null halt */ |
| 14728 | | -#define OP_Halt 65 |
| 14729 | | -#define OP_Integer 66 /* synopsis: r[P2]=P1 */ |
| 14730 | | -#define OP_Int64 67 /* synopsis: r[P2]=P4 */ |
| 14731 | | -#define OP_String 68 /* synopsis: r[P2]='P4' (len=P1) */ |
| 14732 | | -#define OP_Null 69 /* synopsis: r[P2..P3]=NULL */ |
| 14733 | | -#define OP_SoftNull 70 /* synopsis: r[P1]=NULL */ |
| 14734 | | -#define OP_Blob 71 /* synopsis: r[P2]=P4 (len=P1) */ |
| 14735 | | -#define OP_Variable 72 /* synopsis: r[P2]=parameter(P1,P4) */ |
| 14736 | | -#define OP_Move 73 /* synopsis: r[P2@P3]=r[P1@P3] */ |
| 14737 | | -#define OP_Copy 74 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */ |
| 14738 | | -#define OP_SCopy 75 /* synopsis: r[P2]=r[P1] */ |
| 14739 | | -#define OP_IntCopy 76 /* synopsis: r[P2]=r[P1] */ |
| 14740 | | -#define OP_ResultRow 77 /* synopsis: output=r[P1@P2] */ |
| 14741 | | -#define OP_CollSeq 78 |
| 14742 | | -#define OP_AddImm 79 /* synopsis: r[P1]=r[P1]+P2 */ |
| 14743 | | -#define OP_RealAffinity 80 |
| 14744 | | -#define OP_Cast 81 /* synopsis: affinity(r[P1]) */ |
| 14745 | | -#define OP_Permutation 82 |
| 14746 | | -#define OP_Compare 83 /* synopsis: r[P1@P3] <-> r[P2@P3] */ |
| 14747 | | -#define OP_IsTrue 84 /* synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 */ |
| 14748 | | -#define OP_Offset 85 /* synopsis: r[P3] = sqlite_offset(P1) */ |
| 14749 | | -#define OP_Column 86 /* synopsis: r[P3]=PX */ |
| 14750 | | -#define OP_Affinity 87 /* synopsis: affinity(r[P1@P2]) */ |
| 14751 | | -#define OP_MakeRecord 88 /* synopsis: r[P3]=mkrec(r[P1@P2]) */ |
| 14752 | | -#define OP_Count 89 /* synopsis: r[P2]=count() */ |
| 14753 | | -#define OP_ReadCookie 90 |
| 14754 | | -#define OP_SetCookie 91 |
| 14725 | +#define OP_PureFunc0 62 |
| 14726 | +#define OP_Function0 63 /* synopsis: r[P3]=func(r[P2@P5]) */ |
| 14727 | +#define OP_PureFunc 64 |
| 14728 | +#define OP_Function 65 /* synopsis: r[P3]=func(r[P2@P5]) */ |
| 14729 | +#define OP_Return 66 |
| 14730 | +#define OP_EndCoroutine 67 |
| 14731 | +#define OP_HaltIfNull 68 /* synopsis: if r[P3]=null halt */ |
| 14732 | +#define OP_Halt 69 |
| 14733 | +#define OP_Integer 70 /* synopsis: r[P2]=P1 */ |
| 14734 | +#define OP_Int64 71 /* synopsis: r[P2]=P4 */ |
| 14735 | +#define OP_String 72 /* synopsis: r[P2]='P4' (len=P1) */ |
| 14736 | +#define OP_Null 73 /* synopsis: r[P2..P3]=NULL */ |
| 14737 | +#define OP_SoftNull 74 /* synopsis: r[P1]=NULL */ |
| 14738 | +#define OP_Blob 75 /* synopsis: r[P2]=P4 (len=P1) */ |
| 14739 | +#define OP_Variable 76 /* synopsis: r[P2]=parameter(P1,P4) */ |
| 14740 | +#define OP_Move 77 /* synopsis: r[P2@P3]=r[P1@P3] */ |
| 14741 | +#define OP_Copy 78 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */ |
| 14742 | +#define OP_SCopy 79 /* synopsis: r[P2]=r[P1] */ |
| 14743 | +#define OP_IntCopy 80 /* synopsis: r[P2]=r[P1] */ |
| 14744 | +#define OP_ResultRow 81 /* synopsis: output=r[P1@P2] */ |
| 14745 | +#define OP_CollSeq 82 |
| 14746 | +#define OP_AddImm 83 /* synopsis: r[P1]=r[P1]+P2 */ |
| 14747 | +#define OP_RealAffinity 84 |
| 14748 | +#define OP_Cast 85 /* synopsis: affinity(r[P1]) */ |
| 14749 | +#define OP_Permutation 86 |
| 14750 | +#define OP_Compare 87 /* synopsis: r[P1@P3] <-> r[P2@P3] */ |
| 14751 | +#define OP_IsTrue 88 /* synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 */ |
| 14752 | +#define OP_Offset 89 /* synopsis: r[P3] = sqlite_offset(P1) */ |
| 14753 | +#define OP_Column 90 /* synopsis: r[P3]=PX */ |
| 14754 | +#define OP_Affinity 91 /* synopsis: affinity(r[P1@P2]) */ |
| 14755 | 14755 | #define OP_BitAnd 92 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */ |
| 14756 | 14756 | #define OP_BitOr 93 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */ |
| 14757 | 14757 | #define OP_ShiftLeft 94 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */ |
| 14758 | 14758 | #define OP_ShiftRight 95 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */ |
| 14759 | 14759 | #define OP_Add 96 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */ |
| | @@ -14760,84 +14760,82 @@ |
| 14760 | 14760 | #define OP_Subtract 97 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */ |
| 14761 | 14761 | #define OP_Multiply 98 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */ |
| 14762 | 14762 | #define OP_Divide 99 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */ |
| 14763 | 14763 | #define OP_Remainder 100 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */ |
| 14764 | 14764 | #define OP_Concat 101 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */ |
| 14765 | | -#define OP_ReopenIdx 102 /* synopsis: root=P2 iDb=P3 */ |
| 14765 | +#define OP_MakeRecord 102 /* synopsis: r[P3]=mkrec(r[P1@P2]) */ |
| 14766 | 14766 | #define OP_BitNot 103 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */ |
| 14767 | | -#define OP_OpenRead 104 /* synopsis: root=P2 iDb=P3 */ |
| 14768 | | -#define OP_OpenWrite 105 /* synopsis: root=P2 iDb=P3 */ |
| 14767 | +#define OP_Count 104 /* synopsis: r[P2]=count() */ |
| 14768 | +#define OP_ReadCookie 105 |
| 14769 | 14769 | #define OP_String8 106 /* same as TK_STRING, synopsis: r[P2]='P4' */ |
| 14770 | | -#define OP_OpenDup 107 |
| 14771 | | -#define OP_OpenAutoindex 108 /* synopsis: nColumn=P2 */ |
| 14772 | | -#define OP_OpenEphemeral 109 /* synopsis: nColumn=P2 */ |
| 14773 | | -#define OP_SorterOpen 110 |
| 14774 | | -#define OP_SequenceTest 111 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */ |
| 14775 | | -#define OP_OpenPseudo 112 /* synopsis: P3 columns in r[P2] */ |
| 14776 | | -#define OP_Close 113 |
| 14777 | | -#define OP_ColumnsUsed 114 |
| 14778 | | -#define OP_SeekHit 115 /* synopsis: seekHit=P2 */ |
| 14779 | | -#define OP_Sequence 116 /* synopsis: r[P2]=cursor[P1].ctr++ */ |
| 14780 | | -#define OP_NewRowid 117 /* synopsis: r[P2]=rowid */ |
| 14781 | | -#define OP_Insert 118 /* synopsis: intkey=r[P3] data=r[P2] */ |
| 14782 | | -#define OP_InsertInt 119 /* synopsis: intkey=P3 data=r[P2] */ |
| 14783 | | -#define OP_Delete 120 |
| 14784 | | -#define OP_ResetCount 121 |
| 14785 | | -#define OP_SorterCompare 122 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ |
| 14786 | | -#define OP_SorterData 123 /* synopsis: r[P2]=data */ |
| 14787 | | -#define OP_RowData 124 /* synopsis: r[P2]=data */ |
| 14788 | | -#define OP_Rowid 125 /* synopsis: r[P2]=rowid */ |
| 14789 | | -#define OP_NullRow 126 |
| 14790 | | -#define OP_SeekEnd 127 |
| 14791 | | -#define OP_SorterInsert 128 /* synopsis: key=r[P2] */ |
| 14792 | | -#define OP_IdxInsert 129 /* synopsis: key=r[P2] */ |
| 14793 | | -#define OP_IdxDelete 130 /* synopsis: key=r[P2@P3] */ |
| 14794 | | -#define OP_DeferredSeek 131 /* synopsis: Move P3 to P1.rowid if needed */ |
| 14795 | | -#define OP_IdxRowid 132 /* synopsis: r[P2]=rowid */ |
| 14796 | | -#define OP_Destroy 133 |
| 14797 | | -#define OP_Clear 134 |
| 14798 | | -#define OP_ResetSorter 135 |
| 14799 | | -#define OP_CreateBtree 136 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ |
| 14800 | | -#define OP_SqlExec 137 |
| 14801 | | -#define OP_ParseSchema 138 |
| 14802 | | -#define OP_LoadAnalysis 139 |
| 14803 | | -#define OP_DropTable 140 |
| 14770 | +#define OP_SetCookie 107 |
| 14771 | +#define OP_ReopenIdx 108 /* synopsis: root=P2 iDb=P3 */ |
| 14772 | +#define OP_OpenRead 109 /* synopsis: root=P2 iDb=P3 */ |
| 14773 | +#define OP_OpenWrite 110 /* synopsis: root=P2 iDb=P3 */ |
| 14774 | +#define OP_OpenDup 111 |
| 14775 | +#define OP_OpenAutoindex 112 /* synopsis: nColumn=P2 */ |
| 14776 | +#define OP_OpenEphemeral 113 /* synopsis: nColumn=P2 */ |
| 14777 | +#define OP_SorterOpen 114 |
| 14778 | +#define OP_SequenceTest 115 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */ |
| 14779 | +#define OP_OpenPseudo 116 /* synopsis: P3 columns in r[P2] */ |
| 14780 | +#define OP_Close 117 |
| 14781 | +#define OP_ColumnsUsed 118 |
| 14782 | +#define OP_SeekHit 119 /* synopsis: seekHit=P2 */ |
| 14783 | +#define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */ |
| 14784 | +#define OP_NewRowid 121 /* synopsis: r[P2]=rowid */ |
| 14785 | +#define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */ |
| 14786 | +#define OP_InsertInt 123 /* synopsis: intkey=P3 data=r[P2] */ |
| 14787 | +#define OP_Delete 124 |
| 14788 | +#define OP_ResetCount 125 |
| 14789 | +#define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ |
| 14790 | +#define OP_SorterData 127 /* synopsis: r[P2]=data */ |
| 14791 | +#define OP_RowData 128 /* synopsis: r[P2]=data */ |
| 14792 | +#define OP_Rowid 129 /* synopsis: r[P2]=rowid */ |
| 14793 | +#define OP_NullRow 130 |
| 14794 | +#define OP_SeekEnd 131 |
| 14795 | +#define OP_SorterInsert 132 /* synopsis: key=r[P2] */ |
| 14796 | +#define OP_IdxInsert 133 /* synopsis: key=r[P2] */ |
| 14797 | +#define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */ |
| 14798 | +#define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */ |
| 14799 | +#define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */ |
| 14800 | +#define OP_Destroy 137 |
| 14801 | +#define OP_Clear 138 |
| 14802 | +#define OP_ResetSorter 139 |
| 14803 | +#define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ |
| 14804 | 14804 | #define OP_Real 141 /* same as TK_FLOAT, synopsis: r[P2]=P4 */ |
| 14805 | | -#define OP_DropIndex 142 |
| 14806 | | -#define OP_DropTrigger 143 |
| 14807 | | -#define OP_IntegrityCk 144 |
| 14808 | | -#define OP_RowSetAdd 145 /* synopsis: rowset(P1)=r[P2] */ |
| 14809 | | -#define OP_Param 146 |
| 14810 | | -#define OP_FkCounter 147 /* synopsis: fkctr[P1]+=P2 */ |
| 14811 | | -#define OP_MemMax 148 /* synopsis: r[P1]=max(r[P1],r[P2]) */ |
| 14812 | | -#define OP_OffsetLimit 149 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ |
| 14813 | | -#define OP_AggInverse 150 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ |
| 14814 | | -#define OP_AggStep 151 /* synopsis: accum=r[P3] step(r[P2@P5]) */ |
| 14815 | | -#define OP_AggStep1 152 /* synopsis: accum=r[P3] step(r[P2@P5]) */ |
| 14816 | | -#define OP_AggValue 153 /* synopsis: r[P3]=value N=P2 */ |
| 14817 | | -#define OP_AggFinal 154 /* synopsis: accum=r[P1] N=P2 */ |
| 14818 | | -#define OP_Expire 155 |
| 14819 | | -#define OP_TableLock 156 /* synopsis: iDb=P1 root=P2 write=P3 */ |
| 14820 | | -#define OP_VBegin 157 |
| 14821 | | -#define OP_VCreate 158 |
| 14822 | | -#define OP_VDestroy 159 |
| 14823 | | -#define OP_VOpen 160 |
| 14824 | | -#define OP_VColumn 161 /* synopsis: r[P3]=vcolumn(P2) */ |
| 14825 | | -#define OP_VRename 162 |
| 14826 | | -#define OP_Pagecount 163 |
| 14827 | | -#define OP_MaxPgcnt 164 |
| 14828 | | -#define OP_PureFunc0 165 |
| 14829 | | -#define OP_Function0 166 /* synopsis: r[P3]=func(r[P2@P5]) */ |
| 14830 | | -#define OP_PureFunc 167 |
| 14831 | | -#define OP_Function 168 /* synopsis: r[P3]=func(r[P2@P5]) */ |
| 14805 | +#define OP_SqlExec 142 |
| 14806 | +#define OP_ParseSchema 143 |
| 14807 | +#define OP_LoadAnalysis 144 |
| 14808 | +#define OP_DropTable 145 |
| 14809 | +#define OP_DropIndex 146 |
| 14810 | +#define OP_DropTrigger 147 |
| 14811 | +#define OP_IntegrityCk 148 |
| 14812 | +#define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */ |
| 14813 | +#define OP_Param 150 |
| 14814 | +#define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */ |
| 14815 | +#define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */ |
| 14816 | +#define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ |
| 14817 | +#define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ |
| 14818 | +#define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */ |
| 14819 | +#define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */ |
| 14820 | +#define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */ |
| 14821 | +#define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */ |
| 14822 | +#define OP_Expire 159 |
| 14823 | +#define OP_TableLock 160 /* synopsis: iDb=P1 root=P2 write=P3 */ |
| 14824 | +#define OP_VBegin 161 |
| 14825 | +#define OP_VCreate 162 |
| 14826 | +#define OP_VDestroy 163 |
| 14827 | +#define OP_VOpen 164 |
| 14828 | +#define OP_VColumn 165 /* synopsis: r[P3]=vcolumn(P2) */ |
| 14829 | +#define OP_VRename 166 |
| 14830 | +#define OP_Pagecount 167 |
| 14831 | +#define OP_MaxPgcnt 168 |
| 14832 | 14832 | #define OP_Trace 169 |
| 14833 | 14833 | #define OP_CursorHint 170 |
| 14834 | | -#define OP_SetTabCol 171 |
| 14835 | | -#define OP_VerifyTabCol 172 |
| 14836 | | -#define OP_Noop 173 |
| 14837 | | -#define OP_Explain 174 |
| 14838 | | -#define OP_Abortable 175 |
| 14834 | +#define OP_Noop 171 |
| 14835 | +#define OP_Explain 172 |
| 14836 | +#define OP_Abortable 173 |
| 14839 | 14837 | |
| 14840 | 14838 | /* Properties such as "out2" or "jump" that are specified in |
| 14841 | 14839 | ** comments following the "case" for each opcode in the vdbe.c |
| 14842 | 14840 | ** are encoded into bitvectors as follows: |
| 14843 | 14841 | */ |
| | @@ -14853,26 +14851,25 @@ |
| 14853 | 14851 | /* 16 */ 0x01, 0x01, 0x03, 0x12, 0x03, 0x01, 0x09, 0x09,\ |
| 14854 | 14852 | /* 24 */ 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,\ |
| 14855 | 14853 | /* 32 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,\ |
| 14856 | 14854 | /* 40 */ 0x01, 0x23, 0x0b, 0x26, 0x26, 0x01, 0x01, 0x03,\ |
| 14857 | 14855 | /* 48 */ 0x03, 0x03, 0x03, 0x03, 0x0b, 0x0b, 0x0b, 0x0b,\ |
| 14858 | | -/* 56 */ 0x0b, 0x0b, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,\ |
| 14859 | | -/* 64 */ 0x08, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10,\ |
| 14860 | | -/* 72 */ 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x02,\ |
| 14861 | | -/* 80 */ 0x02, 0x02, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00,\ |
| 14862 | | -/* 88 */ 0x00, 0x10, 0x10, 0x00, 0x26, 0x26, 0x26, 0x26,\ |
| 14856 | +/* 56 */ 0x0b, 0x0b, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,\ |
| 14857 | +/* 64 */ 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10, 0x10,\ |
| 14858 | +/* 72 */ 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10,\ |
| 14859 | +/* 80 */ 0x10, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\ |
| 14860 | +/* 88 */ 0x12, 0x20, 0x00, 0x00, 0x26, 0x26, 0x26, 0x26,\ |
| 14863 | 14861 | /* 96 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00, 0x12,\ |
| 14864 | | -/* 104 */ 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 14865 | | -/* 112 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ |
| 14866 | | -/* 120 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,\ |
| 14867 | | -/* 128 */ 0x04, 0x04, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ |
| 14868 | | -/* 136 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,\ |
| 14869 | | -/* 144 */ 0x00, 0x06, 0x10, 0x00, 0x04, 0x1a, 0x00, 0x00,\ |
| 14870 | | -/* 152 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 14871 | | -/* 160 */ 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00,\ |
| 14872 | | -/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 14873 | | -} |
| 14862 | +/* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 14863 | +/* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 14864 | +/* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 14865 | +/* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\ |
| 14866 | +/* 136 */ 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ |
| 14867 | +/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00,\ |
| 14868 | +/* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 14869 | +/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\ |
| 14870 | +/* 168 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,} |
| 14874 | 14871 | |
| 14875 | 14872 | /* The sqlite3P2Values() routine is able to run faster if it knows |
| 14876 | 14873 | ** the value of the largest JUMP opcode. The smaller the maximum |
| 14877 | 14874 | ** JUMP opcode the better, so the mkopcodeh.tcl script that |
| 14878 | 14875 | ** generated this include file strives to group all JUMP opcodes |
| | @@ -14950,13 +14947,10 @@ |
| 14950 | 14947 | SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*); |
| 14951 | 14948 | SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3*,Vdbe*); |
| 14952 | 14949 | SQLITE_PRIVATE void sqlite3VdbeMakeReady(Vdbe*,Parse*); |
| 14953 | 14950 | SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe*); |
| 14954 | 14951 | SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe*, int); |
| 14955 | | -#ifdef SQLITE_COVERAGE_TEST |
| 14956 | | -SQLITE_PRIVATE int sqlite3VdbeLabelHasBeenResolved(Vdbe*,int); |
| 14957 | | -#endif |
| 14958 | 14952 | SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe*); |
| 14959 | 14953 | #ifdef SQLITE_DEBUG |
| 14960 | 14954 | SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *, int); |
| 14961 | 14955 | #endif |
| 14962 | 14956 | SQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe*); |
| | @@ -15283,10 +15277,12 @@ |
| 15283 | 15277 | # endif |
| 15284 | 15278 | # ifdef SQLITE_ENABLE_SNAPSHOT |
| 15285 | 15279 | SQLITE_PRIVATE int sqlite3PagerSnapshotGet(Pager *pPager, sqlite3_snapshot **ppSnapshot); |
| 15286 | 15280 | SQLITE_PRIVATE int sqlite3PagerSnapshotOpen(Pager *pPager, sqlite3_snapshot *pSnapshot); |
| 15287 | 15281 | SQLITE_PRIVATE int sqlite3PagerSnapshotRecover(Pager *pPager); |
| 15282 | +SQLITE_PRIVATE int sqlite3PagerSnapshotCheck(Pager *pPager, sqlite3_snapshot *pSnapshot); |
| 15283 | +SQLITE_PRIVATE void sqlite3PagerSnapshotUnlock(Pager *pPager); |
| 15288 | 15284 | # endif |
| 15289 | 15285 | #else |
| 15290 | 15286 | # define sqlite3PagerUseWal(x,y) 0 |
| 15291 | 15287 | #endif |
| 15292 | 15288 | |
| | @@ -16290,11 +16286,11 @@ |
| 16290 | 16286 | ** Bits of the sqlite3.dbOptFlags field that are used by the |
| 16291 | 16287 | ** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to |
| 16292 | 16288 | ** selectively disable various optimizations. |
| 16293 | 16289 | */ |
| 16294 | 16290 | #define SQLITE_QueryFlattener 0x0001 /* Query flattening */ |
| 16295 | | -#define SQLITE_ColumnCache 0x0002 /* Column cache */ |
| 16291 | + /* 0x0002 available for reuse */ |
| 16296 | 16292 | #define SQLITE_GroupByOrder 0x0004 /* GROUPBY cover of ORDERBY */ |
| 16297 | 16293 | #define SQLITE_FactorOutConst 0x0008 /* Constant factoring */ |
| 16298 | 16294 | #define SQLITE_DistinctOpt 0x0010 /* DISTINCT using indexes */ |
| 16299 | 16295 | #define SQLITE_CoverIdxScan 0x0020 /* Covering index scans */ |
| 16300 | 16296 | #define SQLITE_OrderByIdxJoin 0x0040 /* ORDER BY of joins via index */ |
| | @@ -16305,10 +16301,11 @@ |
| 16305 | 16301 | #define SQLITE_Stat34 0x0800 /* Use STAT3 or STAT4 data */ |
| 16306 | 16302 | /* TH3 expects the Stat34 ^^^^^^ value to be 0x0800. Don't change it */ |
| 16307 | 16303 | #define SQLITE_PushDown 0x1000 /* The push-down optimization */ |
| 16308 | 16304 | #define SQLITE_SimplifyJoin 0x2000 /* Convert LEFT JOIN to JOIN */ |
| 16309 | 16305 | #define SQLITE_SkipScan 0x4000 /* Skip-scans */ |
| 16306 | +#define SQLITE_PropagateConst 0x8000 /* The constant propagation opt */ |
| 16310 | 16307 | #define SQLITE_AllOpts 0xffff /* All optimizations */ |
| 16311 | 16308 | |
| 16312 | 16309 | /* |
| 16313 | 16310 | ** Macros for testing whether or not optimizations are enabled or disabled. |
| 16314 | 16311 | */ |
| | @@ -17199,11 +17196,11 @@ |
| 17199 | 17196 | ** The following are the meanings of bits in the Expr.flags field. |
| 17200 | 17197 | */ |
| 17201 | 17198 | #define EP_FromJoin 0x000001 /* Originates in ON/USING clause of outer join */ |
| 17202 | 17199 | #define EP_Agg 0x000002 /* Contains one or more aggregate functions */ |
| 17203 | 17200 | #define EP_HasFunc 0x000004 /* Contains one or more functions of any kind */ |
| 17204 | | - /* 0x000008 // available for use */ |
| 17201 | +#define EP_FixedCol 0x000008 /* TK_Column with a known fixed value */ |
| 17205 | 17202 | #define EP_Distinct 0x000010 /* Aggregate function with DISTINCT keyword */ |
| 17206 | 17203 | #define EP_VarSelect 0x000020 /* pSelect is correlated, not constant */ |
| 17207 | 17204 | #define EP_DblQuoted 0x000040 /* token.z was originally in "..." */ |
| 17208 | 17205 | #define EP_InfixFunc 0x000080 /* True for an infix function: LIKE, GLOB, etc */ |
| 17209 | 17206 | #define EP_Collate 0x000100 /* Tree contains a TK_COLLATE operator */ |
| | @@ -17688,17 +17685,10 @@ |
| 17688 | 17685 | Table *pTab; /* Table this info block refers to */ |
| 17689 | 17686 | int iDb; /* Index in sqlite3.aDb[] of database holding pTab */ |
| 17690 | 17687 | int regCtr; /* Memory register holding the rowid counter */ |
| 17691 | 17688 | }; |
| 17692 | 17689 | |
| 17693 | | -/* |
| 17694 | | -** Size of the column cache |
| 17695 | | -*/ |
| 17696 | | -#ifndef SQLITE_N_COLCACHE |
| 17697 | | -# define SQLITE_N_COLCACHE 10 |
| 17698 | | -#endif |
| 17699 | | - |
| 17700 | 17690 | /* |
| 17701 | 17691 | ** At least one instance of the following structure is created for each |
| 17702 | 17692 | ** trigger that may be fired while parsing an INSERT, UPDATE or DELETE |
| 17703 | 17693 | ** statement. All such objects are stored in the linked list headed at |
| 17704 | 17694 | ** Parse.pTriggerPrg and deleted once statement compilation has been |
| | @@ -17770,22 +17760,19 @@ |
| 17770 | 17760 | u8 isMultiWrite; /* True if statement may modify/insert multiple rows */ |
| 17771 | 17761 | u8 mayAbort; /* True if statement may throw an ABORT exception */ |
| 17772 | 17762 | u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */ |
| 17773 | 17763 | u8 okConstFactor; /* OK to factor out constants */ |
| 17774 | 17764 | u8 disableLookaside; /* Number of times lookaside has been disabled */ |
| 17775 | | - u8 nColCache; /* Number of entries in aColCache[] */ |
| 17776 | 17765 | int nRangeReg; /* Size of the temporary register block */ |
| 17777 | 17766 | int iRangeReg; /* First register in temporary register block */ |
| 17778 | 17767 | int nErr; /* Number of errors seen */ |
| 17779 | 17768 | int nTab; /* Number of previously allocated VDBE cursors */ |
| 17780 | 17769 | int nMem; /* Number of memory cells used so far */ |
| 17781 | 17770 | int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */ |
| 17782 | 17771 | int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */ |
| 17783 | 17772 | int iSelfTab; /* Table associated with an index on expr, or negative |
| 17784 | 17773 | ** of the base register during check-constraint eval */ |
| 17785 | | - int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */ |
| 17786 | | - int iCacheCnt; /* Counter used to generate aColCache[].lru values */ |
| 17787 | 17774 | int nLabel; /* Number of labels used */ |
| 17788 | 17775 | int *aLabel; /* Space to hold the labels */ |
| 17789 | 17776 | ExprList *pConstExpr;/* Constant expressions */ |
| 17790 | 17777 | Token constraintName;/* Name of the constraint currently being parsed */ |
| 17791 | 17778 | yDbMask writeMask; /* Start a write transaction on these databases */ |
| | @@ -17811,21 +17798,13 @@ |
| 17811 | 17798 | |
| 17812 | 17799 | /************************************************************************** |
| 17813 | 17800 | ** Fields above must be initialized to zero. The fields that follow, |
| 17814 | 17801 | ** down to the beginning of the recursive section, do not need to be |
| 17815 | 17802 | ** initialized as they will be set before being used. The boundary is |
| 17816 | | - ** determined by offsetof(Parse,aColCache). |
| 17803 | + ** determined by offsetof(Parse,aTempReg). |
| 17817 | 17804 | **************************************************************************/ |
| 17818 | 17805 | |
| 17819 | | - struct yColCache { |
| 17820 | | - int iTable; /* Table cursor number */ |
| 17821 | | - i16 iColumn; /* Table column number */ |
| 17822 | | - u8 tempReg; /* iReg is a temp register that needs to be freed */ |
| 17823 | | - int iLevel; /* Nesting level */ |
| 17824 | | - int iReg; /* Reg with value of this column. 0 means none. */ |
| 17825 | | - int lru; /* Least recently used entry has the smallest value */ |
| 17826 | | - } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */ |
| 17827 | 17806 | int aTempReg[8]; /* Holding area for temporary registers */ |
| 17828 | 17807 | Token sNameToken; /* Token with unqualified schema object name */ |
| 17829 | 17808 | |
| 17830 | 17809 | /************************************************************************ |
| 17831 | 17810 | ** Above is constant between recursions. Below is reset before and after |
| | @@ -17863,11 +17842,11 @@ |
| 17863 | 17842 | }; |
| 17864 | 17843 | |
| 17865 | 17844 | /* |
| 17866 | 17845 | ** Sizes and pointers of various parts of the Parse object. |
| 17867 | 17846 | */ |
| 17868 | | -#define PARSE_HDR_SZ offsetof(Parse,aColCache) /* Recursive part w/o aColCache*/ |
| 17847 | +#define PARSE_HDR_SZ offsetof(Parse,aTempReg) /* Recursive part w/o aColCache*/ |
| 17869 | 17848 | #define PARSE_RECURSE_SZ offsetof(Parse,sLastToken) /* Recursive part */ |
| 17870 | 17849 | #define PARSE_TAIL_SZ (sizeof(Parse)-PARSE_RECURSE_SZ) /* Non-recursive part */ |
| 17871 | 17850 | #define PARSE_TAIL(X) (((char*)(X))+PARSE_RECURSE_SZ) /* Pointer to tail */ |
| 17872 | 17851 | |
| 17873 | 17852 | /* |
| | @@ -18157,10 +18136,11 @@ |
| 18157 | 18136 | struct IdxCover *pIdxCover; /* Check for index coverage */ |
| 18158 | 18137 | struct IdxExprTrans *pIdxTrans; /* Convert idxed expr to column */ |
| 18159 | 18138 | ExprList *pGroupBy; /* GROUP BY clause */ |
| 18160 | 18139 | Select *pSelect; /* HAVING to WHERE clause ctx */ |
| 18161 | 18140 | struct WindowRewrite *pRewrite; /* Window rewrite context */ |
| 18141 | + struct WhereConst *pConst; /* WHERE clause constants */ |
| 18162 | 18142 | } u; |
| 18163 | 18143 | }; |
| 18164 | 18144 | |
| 18165 | 18145 | /* Forward declarations */ |
| 18166 | 18146 | SQLITE_PRIVATE int sqlite3WalkExpr(Walker*, Expr*); |
| | @@ -18511,11 +18491,11 @@ |
| 18511 | 18491 | SQLITE_PRIVATE Expr *sqlite3Expr(sqlite3*,int,const char*); |
| 18512 | 18492 | SQLITE_PRIVATE void sqlite3ExprAttachSubtrees(sqlite3*,Expr*,Expr*,Expr*); |
| 18513 | 18493 | SQLITE_PRIVATE Expr *sqlite3PExpr(Parse*, int, Expr*, Expr*); |
| 18514 | 18494 | SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse*, Expr*, Select*); |
| 18515 | 18495 | SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3*,Expr*, Expr*); |
| 18516 | | -SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*); |
| 18496 | +SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*, int); |
| 18517 | 18497 | SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32); |
| 18518 | 18498 | SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*); |
| 18519 | 18499 | SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*); |
| 18520 | 18500 | SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*); |
| 18521 | 18501 | SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int); |
| | @@ -18646,19 +18626,12 @@ |
| 18646 | 18626 | #define ONEPASS_OFF 0 /* Use of ONEPASS not allowed */ |
| 18647 | 18627 | #define ONEPASS_SINGLE 1 /* ONEPASS valid for a single row update */ |
| 18648 | 18628 | #define ONEPASS_MULTI 2 /* ONEPASS is valid for multiple rows */ |
| 18649 | 18629 | SQLITE_PRIVATE void sqlite3ExprCodeLoadIndexColumn(Parse*, Index*, int, int, int); |
| 18650 | 18630 | SQLITE_PRIVATE int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int, u8); |
| 18651 | | -SQLITE_PRIVATE void sqlite3ExprCodeGetColumnToReg(Parse*, Table*, int, int, int); |
| 18652 | 18631 | SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable(Vdbe*, Table*, int, int, int); |
| 18653 | 18632 | SQLITE_PRIVATE void sqlite3ExprCodeMove(Parse*, int, int, int); |
| 18654 | | -SQLITE_PRIVATE void sqlite3ExprCacheStore(Parse*, int, int, int); |
| 18655 | | -SQLITE_PRIVATE void sqlite3ExprCachePush(Parse*); |
| 18656 | | -SQLITE_PRIVATE void sqlite3ExprCachePop(Parse*); |
| 18657 | | -SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse*, int, int); |
| 18658 | | -SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse*); |
| 18659 | | -SQLITE_PRIVATE void sqlite3ExprCacheAffinityChange(Parse*, int, int); |
| 18660 | 18633 | SQLITE_PRIVATE void sqlite3ExprCode(Parse*, Expr*, int); |
| 18661 | 18634 | SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, Expr*, int); |
| 18662 | 18635 | SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse*, Expr*, int); |
| 18663 | 18636 | SQLITE_PRIVATE int sqlite3ExprCodeAtInit(Parse*, Expr*, int); |
| 18664 | 18637 | SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*); |
| | @@ -18890,10 +18863,11 @@ |
| 18890 | 18863 | #endif |
| 18891 | 18864 | |
| 18892 | 18865 | SQLITE_PRIVATE const char *sqlite3ErrStr(int); |
| 18893 | 18866 | SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse); |
| 18894 | 18867 | SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int); |
| 18868 | +SQLITE_PRIVATE int sqlite3IsBinary(const CollSeq*); |
| 18895 | 18869 | SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char*zName); |
| 18896 | 18870 | SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr); |
| 18897 | 18871 | SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, Expr *pExpr); |
| 18898 | 18872 | SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse*,Expr*,Expr*); |
| 18899 | 18873 | SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken(Parse *pParse, Expr*, const Token*, int); |
| | @@ -19853,14 +19827,10 @@ |
| 19853 | 19827 | void (*xDel)(void*);/* Destructor for Mem.z - only valid if MEM_Dyn */ |
| 19854 | 19828 | #ifdef SQLITE_DEBUG |
| 19855 | 19829 | Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */ |
| 19856 | 19830 | u16 mScopyFlags; /* flags value immediately after the shallow copy */ |
| 19857 | 19831 | #endif |
| 19858 | | -#ifdef SQLITE_DEBUG_COLUMNCACHE |
| 19859 | | - u32 iTabColHash; /* Hash of table.column that is origin of this value */ |
| 19860 | | - u32 iPadding; /* sqlite3_value objects must be 8-byte aligned */ |
| 19861 | | -#endif |
| 19862 | 19832 | }; |
| 19863 | 19833 | |
| 19864 | 19834 | /* |
| 19865 | 19835 | ** Size of struct Mem not including the Mem.zMalloc member or anything that |
| 19866 | 19836 | ** follows. |
| | @@ -28513,10 +28483,13 @@ |
| 28513 | 28483 | sqlite3TreeViewLine(pView, "COLUMN(%d)%s", pExpr->iColumn, zFlgs); |
| 28514 | 28484 | }else{ |
| 28515 | 28485 | sqlite3TreeViewLine(pView, "{%d:%d}%s", |
| 28516 | 28486 | pExpr->iTable, pExpr->iColumn, zFlgs); |
| 28517 | 28487 | } |
| 28488 | + if( ExprHasProperty(pExpr, EP_FixedCol) ){ |
| 28489 | + sqlite3TreeViewExpr(pView, pExpr->pLeft, 0); |
| 28490 | + } |
| 28518 | 28491 | break; |
| 28519 | 28492 | } |
| 28520 | 28493 | case TK_INTEGER: { |
| 28521 | 28494 | if( pExpr->flags & EP_IntValue ){ |
| 28522 | 28495 | sqlite3TreeViewLine(pView, "%d", pExpr->u.iValue); |
| | @@ -31741,40 +31714,40 @@ |
| 31741 | 31714 | /* 57 */ "Ge" OpHelp("IF r[P3]>=r[P1]"), |
| 31742 | 31715 | /* 58 */ "ElseNotEq" OpHelp(""), |
| 31743 | 31716 | /* 59 */ "IncrVacuum" OpHelp(""), |
| 31744 | 31717 | /* 60 */ "VNext" OpHelp(""), |
| 31745 | 31718 | /* 61 */ "Init" OpHelp("Start at P2"), |
| 31746 | | - /* 62 */ "Return" OpHelp(""), |
| 31747 | | - /* 63 */ "EndCoroutine" OpHelp(""), |
| 31748 | | - /* 64 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), |
| 31749 | | - /* 65 */ "Halt" OpHelp(""), |
| 31750 | | - /* 66 */ "Integer" OpHelp("r[P2]=P1"), |
| 31751 | | - /* 67 */ "Int64" OpHelp("r[P2]=P4"), |
| 31752 | | - /* 68 */ "String" OpHelp("r[P2]='P4' (len=P1)"), |
| 31753 | | - /* 69 */ "Null" OpHelp("r[P2..P3]=NULL"), |
| 31754 | | - /* 70 */ "SoftNull" OpHelp("r[P1]=NULL"), |
| 31755 | | - /* 71 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), |
| 31756 | | - /* 72 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), |
| 31757 | | - /* 73 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), |
| 31758 | | - /* 74 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), |
| 31759 | | - /* 75 */ "SCopy" OpHelp("r[P2]=r[P1]"), |
| 31760 | | - /* 76 */ "IntCopy" OpHelp("r[P2]=r[P1]"), |
| 31761 | | - /* 77 */ "ResultRow" OpHelp("output=r[P1@P2]"), |
| 31762 | | - /* 78 */ "CollSeq" OpHelp(""), |
| 31763 | | - /* 79 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), |
| 31764 | | - /* 80 */ "RealAffinity" OpHelp(""), |
| 31765 | | - /* 81 */ "Cast" OpHelp("affinity(r[P1])"), |
| 31766 | | - /* 82 */ "Permutation" OpHelp(""), |
| 31767 | | - /* 83 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"), |
| 31768 | | - /* 84 */ "IsTrue" OpHelp("r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4"), |
| 31769 | | - /* 85 */ "Offset" OpHelp("r[P3] = sqlite_offset(P1)"), |
| 31770 | | - /* 86 */ "Column" OpHelp("r[P3]=PX"), |
| 31771 | | - /* 87 */ "Affinity" OpHelp("affinity(r[P1@P2])"), |
| 31772 | | - /* 88 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), |
| 31773 | | - /* 89 */ "Count" OpHelp("r[P2]=count()"), |
| 31774 | | - /* 90 */ "ReadCookie" OpHelp(""), |
| 31775 | | - /* 91 */ "SetCookie" OpHelp(""), |
| 31719 | + /* 62 */ "PureFunc0" OpHelp(""), |
| 31720 | + /* 63 */ "Function0" OpHelp("r[P3]=func(r[P2@P5])"), |
| 31721 | + /* 64 */ "PureFunc" OpHelp(""), |
| 31722 | + /* 65 */ "Function" OpHelp("r[P3]=func(r[P2@P5])"), |
| 31723 | + /* 66 */ "Return" OpHelp(""), |
| 31724 | + /* 67 */ "EndCoroutine" OpHelp(""), |
| 31725 | + /* 68 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), |
| 31726 | + /* 69 */ "Halt" OpHelp(""), |
| 31727 | + /* 70 */ "Integer" OpHelp("r[P2]=P1"), |
| 31728 | + /* 71 */ "Int64" OpHelp("r[P2]=P4"), |
| 31729 | + /* 72 */ "String" OpHelp("r[P2]='P4' (len=P1)"), |
| 31730 | + /* 73 */ "Null" OpHelp("r[P2..P3]=NULL"), |
| 31731 | + /* 74 */ "SoftNull" OpHelp("r[P1]=NULL"), |
| 31732 | + /* 75 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), |
| 31733 | + /* 76 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), |
| 31734 | + /* 77 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), |
| 31735 | + /* 78 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), |
| 31736 | + /* 79 */ "SCopy" OpHelp("r[P2]=r[P1]"), |
| 31737 | + /* 80 */ "IntCopy" OpHelp("r[P2]=r[P1]"), |
| 31738 | + /* 81 */ "ResultRow" OpHelp("output=r[P1@P2]"), |
| 31739 | + /* 82 */ "CollSeq" OpHelp(""), |
| 31740 | + /* 83 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), |
| 31741 | + /* 84 */ "RealAffinity" OpHelp(""), |
| 31742 | + /* 85 */ "Cast" OpHelp("affinity(r[P1])"), |
| 31743 | + /* 86 */ "Permutation" OpHelp(""), |
| 31744 | + /* 87 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"), |
| 31745 | + /* 88 */ "IsTrue" OpHelp("r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4"), |
| 31746 | + /* 89 */ "Offset" OpHelp("r[P3] = sqlite_offset(P1)"), |
| 31747 | + /* 90 */ "Column" OpHelp("r[P3]=PX"), |
| 31748 | + /* 91 */ "Affinity" OpHelp("affinity(r[P1@P2])"), |
| 31776 | 31749 | /* 92 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"), |
| 31777 | 31750 | /* 93 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"), |
| 31778 | 31751 | /* 94 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"), |
| 31779 | 31752 | /* 95 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"), |
| 31780 | 31753 | /* 96 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"), |
| | @@ -31781,84 +31754,82 @@ |
| 31781 | 31754 | /* 97 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"), |
| 31782 | 31755 | /* 98 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"), |
| 31783 | 31756 | /* 99 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"), |
| 31784 | 31757 | /* 100 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"), |
| 31785 | 31758 | /* 101 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"), |
| 31786 | | - /* 102 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), |
| 31759 | + /* 102 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), |
| 31787 | 31760 | /* 103 */ "BitNot" OpHelp("r[P2]= ~r[P1]"), |
| 31788 | | - /* 104 */ "OpenRead" OpHelp("root=P2 iDb=P3"), |
| 31789 | | - /* 105 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), |
| 31761 | + /* 104 */ "Count" OpHelp("r[P2]=count()"), |
| 31762 | + /* 105 */ "ReadCookie" OpHelp(""), |
| 31790 | 31763 | /* 106 */ "String8" OpHelp("r[P2]='P4'"), |
| 31791 | | - /* 107 */ "OpenDup" OpHelp(""), |
| 31792 | | - /* 108 */ "OpenAutoindex" OpHelp("nColumn=P2"), |
| 31793 | | - /* 109 */ "OpenEphemeral" OpHelp("nColumn=P2"), |
| 31794 | | - /* 110 */ "SorterOpen" OpHelp(""), |
| 31795 | | - /* 111 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), |
| 31796 | | - /* 112 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), |
| 31797 | | - /* 113 */ "Close" OpHelp(""), |
| 31798 | | - /* 114 */ "ColumnsUsed" OpHelp(""), |
| 31799 | | - /* 115 */ "SeekHit" OpHelp("seekHit=P2"), |
| 31800 | | - /* 116 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), |
| 31801 | | - /* 117 */ "NewRowid" OpHelp("r[P2]=rowid"), |
| 31802 | | - /* 118 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), |
| 31803 | | - /* 119 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), |
| 31804 | | - /* 120 */ "Delete" OpHelp(""), |
| 31805 | | - /* 121 */ "ResetCount" OpHelp(""), |
| 31806 | | - /* 122 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), |
| 31807 | | - /* 123 */ "SorterData" OpHelp("r[P2]=data"), |
| 31808 | | - /* 124 */ "RowData" OpHelp("r[P2]=data"), |
| 31809 | | - /* 125 */ "Rowid" OpHelp("r[P2]=rowid"), |
| 31810 | | - /* 126 */ "NullRow" OpHelp(""), |
| 31811 | | - /* 127 */ "SeekEnd" OpHelp(""), |
| 31812 | | - /* 128 */ "SorterInsert" OpHelp("key=r[P2]"), |
| 31813 | | - /* 129 */ "IdxInsert" OpHelp("key=r[P2]"), |
| 31814 | | - /* 130 */ "IdxDelete" OpHelp("key=r[P2@P3]"), |
| 31815 | | - /* 131 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), |
| 31816 | | - /* 132 */ "IdxRowid" OpHelp("r[P2]=rowid"), |
| 31817 | | - /* 133 */ "Destroy" OpHelp(""), |
| 31818 | | - /* 134 */ "Clear" OpHelp(""), |
| 31819 | | - /* 135 */ "ResetSorter" OpHelp(""), |
| 31820 | | - /* 136 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), |
| 31821 | | - /* 137 */ "SqlExec" OpHelp(""), |
| 31822 | | - /* 138 */ "ParseSchema" OpHelp(""), |
| 31823 | | - /* 139 */ "LoadAnalysis" OpHelp(""), |
| 31824 | | - /* 140 */ "DropTable" OpHelp(""), |
| 31764 | + /* 107 */ "SetCookie" OpHelp(""), |
| 31765 | + /* 108 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), |
| 31766 | + /* 109 */ "OpenRead" OpHelp("root=P2 iDb=P3"), |
| 31767 | + /* 110 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), |
| 31768 | + /* 111 */ "OpenDup" OpHelp(""), |
| 31769 | + /* 112 */ "OpenAutoindex" OpHelp("nColumn=P2"), |
| 31770 | + /* 113 */ "OpenEphemeral" OpHelp("nColumn=P2"), |
| 31771 | + /* 114 */ "SorterOpen" OpHelp(""), |
| 31772 | + /* 115 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), |
| 31773 | + /* 116 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), |
| 31774 | + /* 117 */ "Close" OpHelp(""), |
| 31775 | + /* 118 */ "ColumnsUsed" OpHelp(""), |
| 31776 | + /* 119 */ "SeekHit" OpHelp("seekHit=P2"), |
| 31777 | + /* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), |
| 31778 | + /* 121 */ "NewRowid" OpHelp("r[P2]=rowid"), |
| 31779 | + /* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), |
| 31780 | + /* 123 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), |
| 31781 | + /* 124 */ "Delete" OpHelp(""), |
| 31782 | + /* 125 */ "ResetCount" OpHelp(""), |
| 31783 | + /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), |
| 31784 | + /* 127 */ "SorterData" OpHelp("r[P2]=data"), |
| 31785 | + /* 128 */ "RowData" OpHelp("r[P2]=data"), |
| 31786 | + /* 129 */ "Rowid" OpHelp("r[P2]=rowid"), |
| 31787 | + /* 130 */ "NullRow" OpHelp(""), |
| 31788 | + /* 131 */ "SeekEnd" OpHelp(""), |
| 31789 | + /* 132 */ "SorterInsert" OpHelp("key=r[P2]"), |
| 31790 | + /* 133 */ "IdxInsert" OpHelp("key=r[P2]"), |
| 31791 | + /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"), |
| 31792 | + /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), |
| 31793 | + /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"), |
| 31794 | + /* 137 */ "Destroy" OpHelp(""), |
| 31795 | + /* 138 */ "Clear" OpHelp(""), |
| 31796 | + /* 139 */ "ResetSorter" OpHelp(""), |
| 31797 | + /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), |
| 31825 | 31798 | /* 141 */ "Real" OpHelp("r[P2]=P4"), |
| 31826 | | - /* 142 */ "DropIndex" OpHelp(""), |
| 31827 | | - /* 143 */ "DropTrigger" OpHelp(""), |
| 31828 | | - /* 144 */ "IntegrityCk" OpHelp(""), |
| 31829 | | - /* 145 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), |
| 31830 | | - /* 146 */ "Param" OpHelp(""), |
| 31831 | | - /* 147 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), |
| 31832 | | - /* 148 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), |
| 31833 | | - /* 149 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), |
| 31834 | | - /* 150 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), |
| 31835 | | - /* 151 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 31836 | | - /* 152 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 31837 | | - /* 153 */ "AggValue" OpHelp("r[P3]=value N=P2"), |
| 31838 | | - /* 154 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), |
| 31839 | | - /* 155 */ "Expire" OpHelp(""), |
| 31840 | | - /* 156 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), |
| 31841 | | - /* 157 */ "VBegin" OpHelp(""), |
| 31842 | | - /* 158 */ "VCreate" OpHelp(""), |
| 31843 | | - /* 159 */ "VDestroy" OpHelp(""), |
| 31844 | | - /* 160 */ "VOpen" OpHelp(""), |
| 31845 | | - /* 161 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), |
| 31846 | | - /* 162 */ "VRename" OpHelp(""), |
| 31847 | | - /* 163 */ "Pagecount" OpHelp(""), |
| 31848 | | - /* 164 */ "MaxPgcnt" OpHelp(""), |
| 31849 | | - /* 165 */ "PureFunc0" OpHelp(""), |
| 31850 | | - /* 166 */ "Function0" OpHelp("r[P3]=func(r[P2@P5])"), |
| 31851 | | - /* 167 */ "PureFunc" OpHelp(""), |
| 31852 | | - /* 168 */ "Function" OpHelp("r[P3]=func(r[P2@P5])"), |
| 31799 | + /* 142 */ "SqlExec" OpHelp(""), |
| 31800 | + /* 143 */ "ParseSchema" OpHelp(""), |
| 31801 | + /* 144 */ "LoadAnalysis" OpHelp(""), |
| 31802 | + /* 145 */ "DropTable" OpHelp(""), |
| 31803 | + /* 146 */ "DropIndex" OpHelp(""), |
| 31804 | + /* 147 */ "DropTrigger" OpHelp(""), |
| 31805 | + /* 148 */ "IntegrityCk" OpHelp(""), |
| 31806 | + /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), |
| 31807 | + /* 150 */ "Param" OpHelp(""), |
| 31808 | + /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), |
| 31809 | + /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), |
| 31810 | + /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), |
| 31811 | + /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), |
| 31812 | + /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 31813 | + /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 31814 | + /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"), |
| 31815 | + /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), |
| 31816 | + /* 159 */ "Expire" OpHelp(""), |
| 31817 | + /* 160 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), |
| 31818 | + /* 161 */ "VBegin" OpHelp(""), |
| 31819 | + /* 162 */ "VCreate" OpHelp(""), |
| 31820 | + /* 163 */ "VDestroy" OpHelp(""), |
| 31821 | + /* 164 */ "VOpen" OpHelp(""), |
| 31822 | + /* 165 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), |
| 31823 | + /* 166 */ "VRename" OpHelp(""), |
| 31824 | + /* 167 */ "Pagecount" OpHelp(""), |
| 31825 | + /* 168 */ "MaxPgcnt" OpHelp(""), |
| 31853 | 31826 | /* 169 */ "Trace" OpHelp(""), |
| 31854 | 31827 | /* 170 */ "CursorHint" OpHelp(""), |
| 31855 | | - /* 171 */ "SetTabCol" OpHelp(""), |
| 31856 | | - /* 172 */ "VerifyTabCol" OpHelp(""), |
| 31857 | | - /* 173 */ "Noop" OpHelp(""), |
| 31858 | | - /* 174 */ "Explain" OpHelp(""), |
| 31859 | | - /* 175 */ "Abortable" OpHelp(""), |
| 31828 | + /* 171 */ "Noop" OpHelp(""), |
| 31829 | + /* 172 */ "Explain" OpHelp(""), |
| 31830 | + /* 173 */ "Abortable" OpHelp(""), |
| 31860 | 31831 | }; |
| 31861 | 31832 | return azName[i]; |
| 31862 | 31833 | } |
| 31863 | 31834 | #endif |
| 31864 | 31835 | |
| | @@ -32764,16 +32735,29 @@ |
| 32764 | 32735 | ** statements. e.g. |
| 32765 | 32736 | ** |
| 32766 | 32737 | ** unixEnterMutex() |
| 32767 | 32738 | ** assert( unixMutexHeld() ); |
| 32768 | 32739 | ** unixEnterLeave() |
| 32740 | +** |
| 32741 | +** To prevent deadlock, the global unixBigLock must must be acquired |
| 32742 | +** before the unixInodeInfo.pLockMutex mutex, if both are held. It is |
| 32743 | +** OK to get the pLockMutex without holding unixBigLock first, but if |
| 32744 | +** that happens, the unixBigLock mutex must not be acquired until after |
| 32745 | +** pLockMutex is released. |
| 32746 | +** |
| 32747 | +** OK: enter(unixBigLock), enter(pLockInfo) |
| 32748 | +** OK: enter(unixBigLock) |
| 32749 | +** OK: enter(pLockInfo) |
| 32750 | +** ERROR: enter(pLockInfo), enter(unixBigLock) |
| 32769 | 32751 | */ |
| 32770 | 32752 | static sqlite3_mutex *unixBigLock = 0; |
| 32771 | 32753 | static void unixEnterMutex(void){ |
| 32754 | + assert( sqlite3_mutex_notheld(unixBigLock) ); /* Not a recursive mutex */ |
| 32772 | 32755 | sqlite3_mutex_enter(unixBigLock); |
| 32773 | 32756 | } |
| 32774 | 32757 | static void unixLeaveMutex(void){ |
| 32758 | + assert( sqlite3_mutex_held(unixBigLock) ); |
| 32775 | 32759 | sqlite3_mutex_leave(unixBigLock); |
| 32776 | 32760 | } |
| 32777 | 32761 | #ifdef SQLITE_DEBUG |
| 32778 | 32762 | static int unixMutexHeld(void) { |
| 32779 | 32763 | return sqlite3_mutex_held(unixBigLock); |
| | @@ -33170,20 +33154,38 @@ |
| 33170 | 33154 | ** each inode opened by each thread. |
| 33171 | 33155 | ** |
| 33172 | 33156 | ** A single inode can have multiple file descriptors, so each unixFile |
| 33173 | 33157 | ** structure contains a pointer to an instance of this object and this |
| 33174 | 33158 | ** object keeps a count of the number of unixFile pointing to it. |
| 33159 | +** |
| 33160 | +** Mutex rules: |
| 33161 | +** |
| 33162 | +** (1) Only the pLockMutex mutex must be held in order to read or write |
| 33163 | +** any of the locking fields: |
| 33164 | +** nShared, nLock, eFileLock, bProcessLock, pUnused |
| 33165 | +** |
| 33166 | +** (2) When nRef>0, then the following fields are unchanging and can |
| 33167 | +** be read (but not written) without holding any mutex: |
| 33168 | +** fileId, pLockMutex |
| 33169 | +** |
| 33170 | +** (3) With the exceptions above, all the fields may only be read |
| 33171 | +** or written while holding the global unixBigLock mutex. |
| 33172 | +** |
| 33173 | +** Deadlock prevention: The global unixBigLock mutex may not |
| 33174 | +** be acquired while holding the pLockMutex mutex. If both unixBigLock |
| 33175 | +** and pLockMutex are needed, then unixBigLock must be acquired first. |
| 33175 | 33176 | */ |
| 33176 | 33177 | struct unixInodeInfo { |
| 33177 | 33178 | struct unixFileId fileId; /* The lookup key */ |
| 33178 | | - int nShared; /* Number of SHARED locks held */ |
| 33179 | | - unsigned char eFileLock; /* One of SHARED_LOCK, RESERVED_LOCK etc. */ |
| 33180 | | - unsigned char bProcessLock; /* An exclusive process lock is held */ |
| 33179 | + sqlite3_mutex *pLockMutex; /* Hold this mutex for... */ |
| 33180 | + int nShared; /* Number of SHARED locks held */ |
| 33181 | + int nLock; /* Number of outstanding file locks */ |
| 33182 | + unsigned char eFileLock; /* One of SHARED_LOCK, RESERVED_LOCK etc. */ |
| 33183 | + unsigned char bProcessLock; /* An exclusive process lock is held */ |
| 33184 | + UnixUnusedFd *pUnused; /* Unused file descriptors to close */ |
| 33181 | 33185 | int nRef; /* Number of pointers to this structure */ |
| 33182 | 33186 | unixShmNode *pShmNode; /* Shared memory associated with this inode */ |
| 33183 | | - int nLock; /* Number of outstanding file locks */ |
| 33184 | | - UnixUnusedFd *pUnused; /* Unused file descriptors to close */ |
| 33185 | 33187 | unixInodeInfo *pNext; /* List of all unixInodeInfo objects */ |
| 33186 | 33188 | unixInodeInfo *pPrev; /* .... doubly linked */ |
| 33187 | 33189 | #if SQLITE_ENABLE_LOCKING_STYLE |
| 33188 | 33190 | unsigned long long sharedByte; /* for AFP simulated shared lock */ |
| 33189 | 33191 | #endif |
| | @@ -33195,11 +33197,25 @@ |
| 33195 | 33197 | |
| 33196 | 33198 | /* |
| 33197 | 33199 | ** A lists of all unixInodeInfo objects. |
| 33198 | 33200 | */ |
| 33199 | 33201 | static unixInodeInfo *inodeList = 0; /* All unixInodeInfo objects */ |
| 33200 | | -static unsigned int nUnusedFd = 0; /* Total unused file descriptors */ |
| 33202 | + |
| 33203 | +#ifdef SQLITE_DEBUG |
| 33204 | +/* |
| 33205 | +** True if the inode mutex is held, or not. Used only within assert() |
| 33206 | +** to help verify correct mutex usage. |
| 33207 | +*/ |
| 33208 | +int unixFileMutexHeld(unixFile *pFile){ |
| 33209 | + assert( pFile->pInode ); |
| 33210 | + return sqlite3_mutex_held(pFile->pInode->pLockMutex); |
| 33211 | +} |
| 33212 | +int unixFileMutexNotheld(unixFile *pFile){ |
| 33213 | + assert( pFile->pInode ); |
| 33214 | + return sqlite3_mutex_notheld(pFile->pInode->pLockMutex); |
| 33215 | +} |
| 33216 | +#endif |
| 33201 | 33217 | |
| 33202 | 33218 | /* |
| 33203 | 33219 | ** |
| 33204 | 33220 | ** This function - unixLogErrorAtLine(), is only ever called via the macro |
| 33205 | 33221 | ** unixLogError(). |
| | @@ -33301,15 +33317,15 @@ |
| 33301 | 33317 | */ |
| 33302 | 33318 | static void closePendingFds(unixFile *pFile){ |
| 33303 | 33319 | unixInodeInfo *pInode = pFile->pInode; |
| 33304 | 33320 | UnixUnusedFd *p; |
| 33305 | 33321 | UnixUnusedFd *pNext; |
| 33322 | + assert( unixFileMutexHeld(pFile) ); |
| 33306 | 33323 | for(p=pInode->pUnused; p; p=pNext){ |
| 33307 | 33324 | pNext = p->pNext; |
| 33308 | 33325 | robust_close(pFile, p->fd, __LINE__); |
| 33309 | 33326 | sqlite3_free(p); |
| 33310 | | - nUnusedFd--; |
| 33311 | 33327 | } |
| 33312 | 33328 | pInode->pUnused = 0; |
| 33313 | 33329 | } |
| 33314 | 33330 | |
| 33315 | 33331 | /* |
| | @@ -33319,15 +33335,18 @@ |
| 33319 | 33335 | ** when this function is called. |
| 33320 | 33336 | */ |
| 33321 | 33337 | static void releaseInodeInfo(unixFile *pFile){ |
| 33322 | 33338 | unixInodeInfo *pInode = pFile->pInode; |
| 33323 | 33339 | assert( unixMutexHeld() ); |
| 33340 | + assert( unixFileMutexNotheld(pFile) ); |
| 33324 | 33341 | if( ALWAYS(pInode) ){ |
| 33325 | 33342 | pInode->nRef--; |
| 33326 | 33343 | if( pInode->nRef==0 ){ |
| 33327 | 33344 | assert( pInode->pShmNode==0 ); |
| 33345 | + sqlite3_mutex_enter(pInode->pLockMutex); |
| 33328 | 33346 | closePendingFds(pFile); |
| 33347 | + sqlite3_mutex_leave(pInode->pLockMutex); |
| 33329 | 33348 | if( pInode->pPrev ){ |
| 33330 | 33349 | assert( pInode->pPrev->pNext==pInode ); |
| 33331 | 33350 | pInode->pPrev->pNext = pInode->pNext; |
| 33332 | 33351 | }else{ |
| 33333 | 33352 | assert( inodeList==pInode ); |
| | @@ -33335,14 +33354,14 @@ |
| 33335 | 33354 | } |
| 33336 | 33355 | if( pInode->pNext ){ |
| 33337 | 33356 | assert( pInode->pNext->pPrev==pInode ); |
| 33338 | 33357 | pInode->pNext->pPrev = pInode->pPrev; |
| 33339 | 33358 | } |
| 33359 | + sqlite3_mutex_free(pInode->pLockMutex); |
| 33340 | 33360 | sqlite3_free(pInode); |
| 33341 | 33361 | } |
| 33342 | 33362 | } |
| 33343 | | - assert( inodeList!=0 || nUnusedFd==0 ); |
| 33344 | 33363 | } |
| 33345 | 33364 | |
| 33346 | 33365 | /* |
| 33347 | 33366 | ** Given a file descriptor, locate the unixInodeInfo object that |
| 33348 | 33367 | ** describes that file descriptor. Create a new one if necessary. The |
| | @@ -33408,11 +33427,10 @@ |
| 33408 | 33427 | #if OS_VXWORKS |
| 33409 | 33428 | fileId.pId = pFile->pId; |
| 33410 | 33429 | #else |
| 33411 | 33430 | fileId.ino = (u64)statbuf.st_ino; |
| 33412 | 33431 | #endif |
| 33413 | | - assert( inodeList!=0 || nUnusedFd==0 ); |
| 33414 | 33432 | pInode = inodeList; |
| 33415 | 33433 | while( pInode && memcmp(&fileId, &pInode->fileId, sizeof(fileId)) ){ |
| 33416 | 33434 | pInode = pInode->pNext; |
| 33417 | 33435 | } |
| 33418 | 33436 | if( pInode==0 ){ |
| | @@ -33420,10 +33438,17 @@ |
| 33420 | 33438 | if( pInode==0 ){ |
| 33421 | 33439 | return SQLITE_NOMEM_BKPT; |
| 33422 | 33440 | } |
| 33423 | 33441 | memset(pInode, 0, sizeof(*pInode)); |
| 33424 | 33442 | memcpy(&pInode->fileId, &fileId, sizeof(fileId)); |
| 33443 | + if( sqlite3GlobalConfig.bCoreMutex ){ |
| 33444 | + pInode->pLockMutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST); |
| 33445 | + if( pInode->pLockMutex==0 ){ |
| 33446 | + sqlite3_free(pInode); |
| 33447 | + return SQLITE_NOMEM_BKPT; |
| 33448 | + } |
| 33449 | + } |
| 33425 | 33450 | pInode->nRef = 1; |
| 33426 | 33451 | pInode->pNext = inodeList; |
| 33427 | 33452 | pInode->pPrev = 0; |
| 33428 | 33453 | if( inodeList ) inodeList->pPrev = pInode; |
| 33429 | 33454 | inodeList = pInode; |
| | @@ -33498,11 +33523,11 @@ |
| 33498 | 33523 | |
| 33499 | 33524 | SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); |
| 33500 | 33525 | |
| 33501 | 33526 | assert( pFile ); |
| 33502 | 33527 | assert( pFile->eFileLock<=SHARED_LOCK ); |
| 33503 | | - unixEnterMutex(); /* Because pFile->pInode is shared across threads */ |
| 33528 | + sqlite3_mutex_enter(pFile->pInode->pLockMutex); |
| 33504 | 33529 | |
| 33505 | 33530 | /* Check if a thread in this process holds such a lock */ |
| 33506 | 33531 | if( pFile->pInode->eFileLock>SHARED_LOCK ){ |
| 33507 | 33532 | reserved = 1; |
| 33508 | 33533 | } |
| | @@ -33523,11 +33548,11 @@ |
| 33523 | 33548 | reserved = 1; |
| 33524 | 33549 | } |
| 33525 | 33550 | } |
| 33526 | 33551 | #endif |
| 33527 | 33552 | |
| 33528 | | - unixLeaveMutex(); |
| 33553 | + sqlite3_mutex_leave(pFile->pInode->pLockMutex); |
| 33529 | 33554 | OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved)); |
| 33530 | 33555 | |
| 33531 | 33556 | *pResOut = reserved; |
| 33532 | 33557 | return rc; |
| 33533 | 33558 | } |
| | @@ -33589,12 +33614,12 @@ |
| 33589 | 33614 | ** to fcntl() fails. In this case, errno is set appropriately (by fcntl()). |
| 33590 | 33615 | */ |
| 33591 | 33616 | static int unixFileLock(unixFile *pFile, struct flock *pLock){ |
| 33592 | 33617 | int rc; |
| 33593 | 33618 | unixInodeInfo *pInode = pFile->pInode; |
| 33594 | | - assert( unixMutexHeld() ); |
| 33595 | 33619 | assert( pInode!=0 ); |
| 33620 | + assert( sqlite3_mutex_held(pInode->pLockMutex) ); |
| 33596 | 33621 | if( (pFile->ctrlFlags & (UNIXFILE_EXCL|UNIXFILE_RDONLY))==UNIXFILE_EXCL ){ |
| 33597 | 33622 | if( pInode->bProcessLock==0 ){ |
| 33598 | 33623 | struct flock lock; |
| 33599 | 33624 | assert( pInode->nLock==0 ); |
| 33600 | 33625 | lock.l_whence = SEEK_SET; |
| | @@ -33709,12 +33734,12 @@ |
| 33709 | 33734 | assert( eFileLock!=PENDING_LOCK ); |
| 33710 | 33735 | assert( eFileLock!=RESERVED_LOCK || pFile->eFileLock==SHARED_LOCK ); |
| 33711 | 33736 | |
| 33712 | 33737 | /* This mutex is needed because pFile->pInode is shared across threads |
| 33713 | 33738 | */ |
| 33714 | | - unixEnterMutex(); |
| 33715 | 33739 | pInode = pFile->pInode; |
| 33740 | + sqlite3_mutex_enter(pInode->pLockMutex); |
| 33716 | 33741 | |
| 33717 | 33742 | /* If some thread using this PID has a lock via a different unixFile* |
| 33718 | 33743 | ** handle that precludes the requested lock, return BUSY. |
| 33719 | 33744 | */ |
| 33720 | 33745 | if( (pFile->eFileLock!=pInode->eFileLock && |
| | @@ -33853,11 +33878,11 @@ |
| 33853 | 33878 | pFile->eFileLock = PENDING_LOCK; |
| 33854 | 33879 | pInode->eFileLock = PENDING_LOCK; |
| 33855 | 33880 | } |
| 33856 | 33881 | |
| 33857 | 33882 | end_lock: |
| 33858 | | - unixLeaveMutex(); |
| 33883 | + sqlite3_mutex_leave(pInode->pLockMutex); |
| 33859 | 33884 | OSTRACE(("LOCK %d %s %s (unix)\n", pFile->h, azFileLock(eFileLock), |
| 33860 | 33885 | rc==SQLITE_OK ? "ok" : "failed")); |
| 33861 | 33886 | return rc; |
| 33862 | 33887 | } |
| 33863 | 33888 | |
| | @@ -33866,15 +33891,15 @@ |
| 33866 | 33891 | ** pUnused list. |
| 33867 | 33892 | */ |
| 33868 | 33893 | static void setPendingFd(unixFile *pFile){ |
| 33869 | 33894 | unixInodeInfo *pInode = pFile->pInode; |
| 33870 | 33895 | UnixUnusedFd *p = pFile->pPreallocatedUnused; |
| 33896 | + assert( unixFileMutexHeld(pFile) ); |
| 33871 | 33897 | p->pNext = pInode->pUnused; |
| 33872 | 33898 | pInode->pUnused = p; |
| 33873 | 33899 | pFile->h = -1; |
| 33874 | 33900 | pFile->pPreallocatedUnused = 0; |
| 33875 | | - nUnusedFd++; |
| 33876 | 33901 | } |
| 33877 | 33902 | |
| 33878 | 33903 | /* |
| 33879 | 33904 | ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock |
| 33880 | 33905 | ** must be either NO_LOCK or SHARED_LOCK. |
| | @@ -33901,12 +33926,12 @@ |
| 33901 | 33926 | |
| 33902 | 33927 | assert( eFileLock<=SHARED_LOCK ); |
| 33903 | 33928 | if( pFile->eFileLock<=eFileLock ){ |
| 33904 | 33929 | return SQLITE_OK; |
| 33905 | 33930 | } |
| 33906 | | - unixEnterMutex(); |
| 33907 | 33931 | pInode = pFile->pInode; |
| 33932 | + sqlite3_mutex_enter(pInode->pLockMutex); |
| 33908 | 33933 | assert( pInode->nShared!=0 ); |
| 33909 | 33934 | if( pFile->eFileLock>SHARED_LOCK ){ |
| 33910 | 33935 | assert( pInode->eFileLock==pFile->eFileLock ); |
| 33911 | 33936 | |
| 33912 | 33937 | #ifdef SQLITE_DEBUG |
| | @@ -34028,18 +34053,18 @@ |
| 34028 | 34053 | ** count reaches zero, close any other file descriptors whose close |
| 34029 | 34054 | ** was deferred because of outstanding locks. |
| 34030 | 34055 | */ |
| 34031 | 34056 | pInode->nLock--; |
| 34032 | 34057 | assert( pInode->nLock>=0 ); |
| 34033 | | - if( pInode->nLock==0 ){ |
| 34034 | | - closePendingFds(pFile); |
| 34035 | | - } |
| 34058 | + if( pInode->nLock==0 ) closePendingFds(pFile); |
| 34036 | 34059 | } |
| 34037 | 34060 | |
| 34038 | 34061 | end_unlock: |
| 34039 | | - unixLeaveMutex(); |
| 34040 | | - if( rc==SQLITE_OK ) pFile->eFileLock = eFileLock; |
| 34062 | + sqlite3_mutex_leave(pInode->pLockMutex); |
| 34063 | + if( rc==SQLITE_OK ){ |
| 34064 | + pFile->eFileLock = eFileLock; |
| 34065 | + } |
| 34041 | 34066 | return rc; |
| 34042 | 34067 | } |
| 34043 | 34068 | |
| 34044 | 34069 | /* |
| 34045 | 34070 | ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock |
| | @@ -34106,26 +34131,32 @@ |
| 34106 | 34131 | ** Close a file. |
| 34107 | 34132 | */ |
| 34108 | 34133 | static int unixClose(sqlite3_file *id){ |
| 34109 | 34134 | int rc = SQLITE_OK; |
| 34110 | 34135 | unixFile *pFile = (unixFile *)id; |
| 34136 | + unixInodeInfo *pInode = pFile->pInode; |
| 34137 | + |
| 34138 | + assert( pInode!=0 ); |
| 34111 | 34139 | verifyDbFile(pFile); |
| 34112 | 34140 | unixUnlock(id, NO_LOCK); |
| 34141 | + assert( unixFileMutexNotheld(pFile) ); |
| 34113 | 34142 | unixEnterMutex(); |
| 34114 | 34143 | |
| 34115 | 34144 | /* unixFile.pInode is always valid here. Otherwise, a different close |
| 34116 | 34145 | ** routine (e.g. nolockClose()) would be called instead. |
| 34117 | 34146 | */ |
| 34118 | 34147 | assert( pFile->pInode->nLock>0 || pFile->pInode->bProcessLock==0 ); |
| 34119 | | - if( ALWAYS(pFile->pInode) && pFile->pInode->nLock ){ |
| 34148 | + sqlite3_mutex_enter(pInode->pLockMutex); |
| 34149 | + if( pInode->nLock ){ |
| 34120 | 34150 | /* If there are outstanding locks, do not actually close the file just |
| 34121 | 34151 | ** yet because that would clear those locks. Instead, add the file |
| 34122 | 34152 | ** descriptor to pInode->pUnused list. It will be automatically closed |
| 34123 | 34153 | ** when the last lock is cleared. |
| 34124 | 34154 | */ |
| 34125 | 34155 | setPendingFd(pFile); |
| 34126 | 34156 | } |
| 34157 | + sqlite3_mutex_leave(pInode->pLockMutex); |
| 34127 | 34158 | releaseInodeInfo(pFile); |
| 34128 | 34159 | rc = closeUnixFile(id); |
| 34129 | 34160 | unixLeaveMutex(); |
| 34130 | 34161 | return rc; |
| 34131 | 34162 | } |
| | @@ -34719,10 +34750,11 @@ |
| 34719 | 34750 | static int semXClose(sqlite3_file *id) { |
| 34720 | 34751 | if( id ){ |
| 34721 | 34752 | unixFile *pFile = (unixFile*)id; |
| 34722 | 34753 | semXUnlock(id, NO_LOCK); |
| 34723 | 34754 | assert( pFile ); |
| 34755 | + assert( unixFileMutexNotheld(pFile) ); |
| 34724 | 34756 | unixEnterMutex(); |
| 34725 | 34757 | releaseInodeInfo(pFile); |
| 34726 | 34758 | unixLeaveMutex(); |
| 34727 | 34759 | closeUnixFile(id); |
| 34728 | 34760 | } |
| | @@ -34833,12 +34865,11 @@ |
| 34833 | 34865 | context = (afpLockingContext *) pFile->lockingContext; |
| 34834 | 34866 | if( context->reserved ){ |
| 34835 | 34867 | *pResOut = 1; |
| 34836 | 34868 | return SQLITE_OK; |
| 34837 | 34869 | } |
| 34838 | | - unixEnterMutex(); /* Because pFile->pInode is shared across threads */ |
| 34839 | | - |
| 34870 | + sqlite3_mutex_enter(pFile->pInode->pLockMutex); |
| 34840 | 34871 | /* Check if a thread in this process holds such a lock */ |
| 34841 | 34872 | if( pFile->pInode->eFileLock>SHARED_LOCK ){ |
| 34842 | 34873 | reserved = 1; |
| 34843 | 34874 | } |
| 34844 | 34875 | |
| | @@ -34858,11 +34889,11 @@ |
| 34858 | 34889 | if( IS_LOCK_ERROR(lrc) ){ |
| 34859 | 34890 | rc=lrc; |
| 34860 | 34891 | } |
| 34861 | 34892 | } |
| 34862 | 34893 | |
| 34863 | | - unixLeaveMutex(); |
| 34894 | + sqlite3_mutex_leave(pFile->pInode->pLockMutex); |
| 34864 | 34895 | OSTRACE(("TEST WR-LOCK %d %d %d (afp)\n", pFile->h, rc, reserved)); |
| 34865 | 34896 | |
| 34866 | 34897 | *pResOut = reserved; |
| 34867 | 34898 | return rc; |
| 34868 | 34899 | } |
| | @@ -34921,12 +34952,12 @@ |
| 34921 | 34952 | assert( eFileLock!=PENDING_LOCK ); |
| 34922 | 34953 | assert( eFileLock!=RESERVED_LOCK || pFile->eFileLock==SHARED_LOCK ); |
| 34923 | 34954 | |
| 34924 | 34955 | /* This mutex is needed because pFile->pInode is shared across threads |
| 34925 | 34956 | */ |
| 34926 | | - unixEnterMutex(); |
| 34927 | 34957 | pInode = pFile->pInode; |
| 34958 | + sqlite3_mutex_enter(pInode->pLockMutex); |
| 34928 | 34959 | |
| 34929 | 34960 | /* If some thread using this PID has a lock via a different unixFile* |
| 34930 | 34961 | ** handle that precludes the requested lock, return BUSY. |
| 34931 | 34962 | */ |
| 34932 | 34963 | if( (pFile->eFileLock!=pInode->eFileLock && |
| | @@ -35058,11 +35089,11 @@ |
| 35058 | 35089 | pFile->eFileLock = PENDING_LOCK; |
| 35059 | 35090 | pInode->eFileLock = PENDING_LOCK; |
| 35060 | 35091 | } |
| 35061 | 35092 | |
| 35062 | 35093 | afp_end_lock: |
| 35063 | | - unixLeaveMutex(); |
| 35094 | + sqlite3_mutex_leave(pInode->pLockMutex); |
| 35064 | 35095 | OSTRACE(("LOCK %d %s %s (afp)\n", pFile->h, azFileLock(eFileLock), |
| 35065 | 35096 | rc==SQLITE_OK ? "ok" : "failed")); |
| 35066 | 35097 | return rc; |
| 35067 | 35098 | } |
| 35068 | 35099 | |
| | @@ -35090,12 +35121,12 @@ |
| 35090 | 35121 | |
| 35091 | 35122 | assert( eFileLock<=SHARED_LOCK ); |
| 35092 | 35123 | if( pFile->eFileLock<=eFileLock ){ |
| 35093 | 35124 | return SQLITE_OK; |
| 35094 | 35125 | } |
| 35095 | | - unixEnterMutex(); |
| 35096 | 35126 | pInode = pFile->pInode; |
| 35127 | + sqlite3_mutex_enter(pInode->pLockMutex); |
| 35097 | 35128 | assert( pInode->nShared!=0 ); |
| 35098 | 35129 | if( pFile->eFileLock>SHARED_LOCK ){ |
| 35099 | 35130 | assert( pInode->eFileLock==pFile->eFileLock ); |
| 35100 | 35131 | SimulateIOErrorBenign(1); |
| 35101 | 35132 | SimulateIOError( h=(-1) ) |
| | @@ -35160,18 +35191,18 @@ |
| 35160 | 35191 | } |
| 35161 | 35192 | } |
| 35162 | 35193 | if( rc==SQLITE_OK ){ |
| 35163 | 35194 | pInode->nLock--; |
| 35164 | 35195 | assert( pInode->nLock>=0 ); |
| 35165 | | - if( pInode->nLock==0 ){ |
| 35166 | | - closePendingFds(pFile); |
| 35167 | | - } |
| 35196 | + if( pInode->nLock==0 ) closePendingFds(pFile); |
| 35168 | 35197 | } |
| 35169 | 35198 | } |
| 35170 | 35199 | |
| 35171 | | - unixLeaveMutex(); |
| 35172 | | - if( rc==SQLITE_OK ) pFile->eFileLock = eFileLock; |
| 35200 | + sqlite3_mutex_leave(pInode->pLockMutex); |
| 35201 | + if( rc==SQLITE_OK ){ |
| 35202 | + pFile->eFileLock = eFileLock; |
| 35203 | + } |
| 35173 | 35204 | return rc; |
| 35174 | 35205 | } |
| 35175 | 35206 | |
| 35176 | 35207 | /* |
| 35177 | 35208 | ** Close a file & cleanup AFP specific locking context |
| | @@ -35179,18 +35210,24 @@ |
| 35179 | 35210 | static int afpClose(sqlite3_file *id) { |
| 35180 | 35211 | int rc = SQLITE_OK; |
| 35181 | 35212 | unixFile *pFile = (unixFile*)id; |
| 35182 | 35213 | assert( id!=0 ); |
| 35183 | 35214 | afpUnlock(id, NO_LOCK); |
| 35215 | + assert( unixFileMutexNotheld(pFile) ); |
| 35184 | 35216 | unixEnterMutex(); |
| 35185 | | - if( pFile->pInode && pFile->pInode->nLock ){ |
| 35186 | | - /* If there are outstanding locks, do not actually close the file just |
| 35187 | | - ** yet because that would clear those locks. Instead, add the file |
| 35188 | | - ** descriptor to pInode->aPending. It will be automatically closed when |
| 35189 | | - ** the last lock is cleared. |
| 35190 | | - */ |
| 35191 | | - setPendingFd(pFile); |
| 35217 | + if( pFile->pInode ){ |
| 35218 | + unixInodeInfo *pInode = pFile->pInode; |
| 35219 | + sqlite3_mutex_enter(pInode->pLockMutex); |
| 35220 | + if( pFile->pInode->nLock ){ |
| 35221 | + /* If there are outstanding locks, do not actually close the file just |
| 35222 | + ** yet because that would clear those locks. Instead, add the file |
| 35223 | + ** descriptor to pInode->aPending. It will be automatically closed when |
| 35224 | + ** the last lock is cleared. |
| 35225 | + */ |
| 35226 | + setPendingFd(pFile); |
| 35227 | + } |
| 35228 | + sqlite3_mutex_leave(pInode->pLockMutex); |
| 35192 | 35229 | } |
| 35193 | 35230 | releaseInodeInfo(pFile); |
| 35194 | 35231 | sqlite3_free(pFile->lockingContext); |
| 35195 | 35232 | rc = closeUnixFile(id); |
| 35196 | 35233 | unixLeaveMutex(); |
| | @@ -36492,10 +36529,11 @@ |
| 36492 | 36529 | assert( pDbFd->pShm==0 ); |
| 36493 | 36530 | |
| 36494 | 36531 | /* Check to see if a unixShmNode object already exists. Reuse an existing |
| 36495 | 36532 | ** one if present. Create a new one if necessary. |
| 36496 | 36533 | */ |
| 36534 | + assert( unixFileMutexNotheld(pDbFd) ); |
| 36497 | 36535 | unixEnterMutex(); |
| 36498 | 36536 | pInode = pDbFd->pInode; |
| 36499 | 36537 | pShmNode = pInode->pShmNode; |
| 36500 | 36538 | if( pShmNode==0 ){ |
| 36501 | 36539 | struct stat sStat; /* fstat() info for database file */ |
| | @@ -36874,10 +36912,11 @@ |
| 36874 | 36912 | static void unixShmBarrier( |
| 36875 | 36913 | sqlite3_file *fd /* Database file holding the shared memory */ |
| 36876 | 36914 | ){ |
| 36877 | 36915 | UNUSED_PARAMETER(fd); |
| 36878 | 36916 | sqlite3MemoryBarrier(); /* compiler-defined memory barrier */ |
| 36917 | + assert( unixFileMutexNotheld((unixFile*)fd) ); |
| 36879 | 36918 | unixEnterMutex(); /* Also mutex, for redundancy */ |
| 36880 | 36919 | unixLeaveMutex(); |
| 36881 | 36920 | } |
| 36882 | 36921 | |
| 36883 | 36922 | /* |
| | @@ -36915,10 +36954,11 @@ |
| 36915 | 36954 | pDbFd->pShm = 0; |
| 36916 | 36955 | sqlite3_mutex_leave(pShmNode->mutex); |
| 36917 | 36956 | |
| 36918 | 36957 | /* If pShmNode->nRef has reached 0, then close the underlying |
| 36919 | 36958 | ** shared-memory file, too */ |
| 36959 | + assert( unixFileMutexNotheld(pDbFd) ); |
| 36920 | 36960 | unixEnterMutex(); |
| 36921 | 36961 | assert( pShmNode->nRef>0 ); |
| 36922 | 36962 | pShmNode->nRef--; |
| 36923 | 36963 | if( pShmNode->nRef==0 ){ |
| 36924 | 36964 | if( deleteFlag && pShmNode->h>=0 ){ |
| | @@ -37241,11 +37281,11 @@ |
| 37241 | 37281 | unixShmMap /* xShmMap method */ |
| 37242 | 37282 | ) |
| 37243 | 37283 | IOMETHODS( |
| 37244 | 37284 | nolockIoFinder, /* Finder function name */ |
| 37245 | 37285 | nolockIoMethods, /* sqlite3_io_methods object name */ |
| 37246 | | - 3, /* shared memory is disabled */ |
| 37286 | + 3, /* shared memory and mmap are enabled */ |
| 37247 | 37287 | nolockClose, /* xClose method */ |
| 37248 | 37288 | nolockLock, /* xLock method */ |
| 37249 | 37289 | nolockUnlock, /* xUnlock method */ |
| 37250 | 37290 | nolockCheckReservedLock, /* xCheckReservedLock method */ |
| 37251 | 37291 | 0 /* xShmMap method */ |
| | @@ -37737,26 +37777,28 @@ |
| 37737 | 37777 | ** ignored and -1 is returned. The caller will try to open a new file |
| 37738 | 37778 | ** descriptor on the same path, fail, and return an error to SQLite. |
| 37739 | 37779 | ** |
| 37740 | 37780 | ** Even if a subsequent open() call does succeed, the consequences of |
| 37741 | 37781 | ** not searching for a reusable file descriptor are not dire. */ |
| 37742 | | - if( nUnusedFd>0 && 0==osStat(zPath, &sStat) ){ |
| 37782 | + if( inodeList!=0 && 0==osStat(zPath, &sStat) ){ |
| 37743 | 37783 | unixInodeInfo *pInode; |
| 37744 | 37784 | |
| 37745 | 37785 | pInode = inodeList; |
| 37746 | 37786 | while( pInode && (pInode->fileId.dev!=sStat.st_dev |
| 37747 | 37787 | || pInode->fileId.ino!=(u64)sStat.st_ino) ){ |
| 37748 | 37788 | pInode = pInode->pNext; |
| 37749 | 37789 | } |
| 37750 | 37790 | if( pInode ){ |
| 37751 | 37791 | UnixUnusedFd **pp; |
| 37792 | + assert( sqlite3_mutex_notheld(pInode->pLockMutex) ); |
| 37793 | + sqlite3_mutex_enter(pInode->pLockMutex); |
| 37752 | 37794 | for(pp=&pInode->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext)); |
| 37753 | 37795 | pUnused = *pp; |
| 37754 | 37796 | if( pUnused ){ |
| 37755 | | - nUnusedFd--; |
| 37756 | 37797 | *pp = pUnused->pNext; |
| 37757 | 37798 | } |
| 37799 | + sqlite3_mutex_leave(pInode->pLockMutex); |
| 37758 | 37800 | } |
| 37759 | 37801 | } |
| 37760 | 37802 | unixLeaveMutex(); |
| 37761 | 37803 | #endif /* if !OS_VXWORKS */ |
| 37762 | 37804 | return pUnused; |
| | @@ -49969,10 +50011,12 @@ |
| 49969 | 50011 | |
| 49970 | 50012 | #ifdef SQLITE_ENABLE_SNAPSHOT |
| 49971 | 50013 | SQLITE_PRIVATE int sqlite3WalSnapshotGet(Wal *pWal, sqlite3_snapshot **ppSnapshot); |
| 49972 | 50014 | SQLITE_PRIVATE void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapshot); |
| 49973 | 50015 | SQLITE_PRIVATE int sqlite3WalSnapshotRecover(Wal *pWal); |
| 50016 | +SQLITE_PRIVATE int sqlite3WalSnapshotCheck(Wal *pWal, sqlite3_snapshot *pSnapshot); |
| 50017 | +SQLITE_PRIVATE void sqlite3WalSnapshotUnlock(Wal *pWal); |
| 49974 | 50018 | #endif |
| 49975 | 50019 | |
| 49976 | 50020 | #ifdef SQLITE_ENABLE_ZIPVFS |
| 49977 | 50021 | /* If the WAL file is not empty, return the number of bytes of content |
| 49978 | 50022 | ** stored in each frame (i.e. the db page-size when the WAL was created). |
| | @@ -57618,10 +57662,42 @@ |
| 57618 | 57662 | }else{ |
| 57619 | 57663 | rc = SQLITE_ERROR; |
| 57620 | 57664 | } |
| 57621 | 57665 | return rc; |
| 57622 | 57666 | } |
| 57667 | + |
| 57668 | +/* |
| 57669 | +** The caller currently has a read transaction open on the database. |
| 57670 | +** If this is not a WAL database, SQLITE_ERROR is returned. Otherwise, |
| 57671 | +** this function takes a SHARED lock on the CHECKPOINTER slot and then |
| 57672 | +** checks if the snapshot passed as the second argument is still |
| 57673 | +** available. If so, SQLITE_OK is returned. |
| 57674 | +** |
| 57675 | +** If the snapshot is not available, SQLITE_ERROR is returned. Or, if |
| 57676 | +** the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error |
| 57677 | +** occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER |
| 57678 | +** lock is released before returning. |
| 57679 | +*/ |
| 57680 | +SQLITE_PRIVATE int sqlite3PagerSnapshotCheck(Pager *pPager, sqlite3_snapshot *pSnapshot){ |
| 57681 | + int rc; |
| 57682 | + if( pPager->pWal ){ |
| 57683 | + rc = sqlite3WalSnapshotCheck(pPager->pWal, pSnapshot); |
| 57684 | + }else{ |
| 57685 | + rc = SQLITE_ERROR; |
| 57686 | + } |
| 57687 | + return rc; |
| 57688 | +} |
| 57689 | + |
| 57690 | +/* |
| 57691 | +** Release a lock obtained by an earlier successful call to |
| 57692 | +** sqlite3PagerSnapshotCheck(). |
| 57693 | +*/ |
| 57694 | +SQLITE_PRIVATE void sqlite3PagerSnapshotUnlock(Pager *pPager){ |
| 57695 | + assert( pPager->pWal ); |
| 57696 | + return sqlite3WalSnapshotUnlock(pPager->pWal); |
| 57697 | +} |
| 57698 | + |
| 57623 | 57699 | #endif /* SQLITE_ENABLE_SNAPSHOT */ |
| 57624 | 57700 | #endif /* !SQLITE_OMIT_WAL */ |
| 57625 | 57701 | |
| 57626 | 57702 | #ifdef SQLITE_ENABLE_ZIPVFS |
| 57627 | 57703 | /* |
| | @@ -59476,11 +59552,10 @@ |
| 59476 | 59552 | } |
| 59477 | 59553 | |
| 59478 | 59554 | if( pIter |
| 59479 | 59555 | && (rc = walBusyLock(pWal, xBusy, pBusyArg, WAL_READ_LOCK(0),1))==SQLITE_OK |
| 59480 | 59556 | ){ |
| 59481 | | - i64 nSize; /* Current size of database file */ |
| 59482 | 59557 | u32 nBackfill = pInfo->nBackfill; |
| 59483 | 59558 | |
| 59484 | 59559 | pInfo->nBackfillAttempted = mxSafeFrame; |
| 59485 | 59560 | |
| 59486 | 59561 | /* Sync the WAL to disk */ |
| | @@ -59489,10 +59564,11 @@ |
| 59489 | 59564 | /* If the database may grow as a result of this checkpoint, hint |
| 59490 | 59565 | ** about the eventual size of the db file to the VFS layer. |
| 59491 | 59566 | */ |
| 59492 | 59567 | if( rc==SQLITE_OK ){ |
| 59493 | 59568 | i64 nReq = ((i64)mxPage * szPage); |
| 59569 | + i64 nSize; /* Current size of database file */ |
| 59494 | 59570 | rc = sqlite3OsFileSize(pWal->pDbFd, &nSize); |
| 59495 | 59571 | if( rc==SQLITE_OK && nSize<nReq ){ |
| 59496 | 59572 | sqlite3OsFileControlHint(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq); |
| 59497 | 59573 | } |
| 59498 | 59574 | } |
| | @@ -61410,10 +61486,47 @@ |
| 61410 | 61486 | if( pHdr1->aSalt[0]>pHdr2->aSalt[0] ) return +1; |
| 61411 | 61487 | if( pHdr1->mxFrame<pHdr2->mxFrame ) return -1; |
| 61412 | 61488 | if( pHdr1->mxFrame>pHdr2->mxFrame ) return +1; |
| 61413 | 61489 | return 0; |
| 61414 | 61490 | } |
| 61491 | + |
| 61492 | +/* |
| 61493 | +** The caller currently has a read transaction open on the database. |
| 61494 | +** This function takes a SHARED lock on the CHECKPOINTER slot and then |
| 61495 | +** checks if the snapshot passed as the second argument is still |
| 61496 | +** available. If so, SQLITE_OK is returned. |
| 61497 | +** |
| 61498 | +** If the snapshot is not available, SQLITE_ERROR is returned. Or, if |
| 61499 | +** the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error |
| 61500 | +** occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER |
| 61501 | +** lock is released before returning. |
| 61502 | +*/ |
| 61503 | +SQLITE_PRIVATE int sqlite3WalSnapshotCheck(Wal *pWal, sqlite3_snapshot *pSnapshot){ |
| 61504 | + int rc; |
| 61505 | + rc = walLockShared(pWal, WAL_CKPT_LOCK); |
| 61506 | + if( rc==SQLITE_OK ){ |
| 61507 | + WalIndexHdr *pNew = (WalIndexHdr*)pSnapshot; |
| 61508 | + if( memcmp(pNew->aSalt, pWal->hdr.aSalt, sizeof(pWal->hdr.aSalt)) |
| 61509 | + || pNew->mxFrame<walCkptInfo(pWal)->nBackfillAttempted |
| 61510 | + ){ |
| 61511 | + rc = SQLITE_BUSY_SNAPSHOT; |
| 61512 | + walUnlockShared(pWal, WAL_CKPT_LOCK); |
| 61513 | + } |
| 61514 | + } |
| 61515 | + return rc; |
| 61516 | +} |
| 61517 | + |
| 61518 | +/* |
| 61519 | +** Release a lock obtained by an earlier successful call to |
| 61520 | +** sqlite3WalSnapshotCheck(). |
| 61521 | +*/ |
| 61522 | +SQLITE_PRIVATE void sqlite3WalSnapshotUnlock(Wal *pWal){ |
| 61523 | + assert( pWal ); |
| 61524 | + walUnlockShared(pWal, WAL_CKPT_LOCK); |
| 61525 | +} |
| 61526 | + |
| 61527 | + |
| 61415 | 61528 | #endif /* SQLITE_ENABLE_SNAPSHOT */ |
| 61416 | 61529 | |
| 61417 | 61530 | #ifdef SQLITE_ENABLE_ZIPVFS |
| 61418 | 61531 | /* |
| 61419 | 61532 | ** If the argument is not NULL, it points to a Wal object that holds a |
| | @@ -74393,13 +74506,10 @@ |
| 74393 | 74506 | pX->flags = MEM_Undefined; |
| 74394 | 74507 | pX->pScopyFrom = 0; |
| 74395 | 74508 | } |
| 74396 | 74509 | } |
| 74397 | 74510 | pMem->pScopyFrom = 0; |
| 74398 | | -#ifdef SQLITE_DEBUG_COLUMN_CACHE |
| 74399 | | - pMem->iTabColHash = 0; |
| 74400 | | -#endif |
| 74401 | 74511 | } |
| 74402 | 74512 | #endif /* SQLITE_DEBUG */ |
| 74403 | 74513 | |
| 74404 | 74514 | |
| 74405 | 74515 | /* |
| | @@ -74416,13 +74526,10 @@ |
| 74416 | 74526 | SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){ |
| 74417 | 74527 | assert( (pFrom->flags & MEM_RowSet)==0 ); |
| 74418 | 74528 | assert( pTo->db==pFrom->db ); |
| 74419 | 74529 | if( VdbeMemDynamic(pTo) ){ vdbeClrCopy(pTo,pFrom,srcType); return; } |
| 74420 | 74530 | memcpy(pTo, pFrom, MEMCELLSIZE); |
| 74421 | | -#ifdef SQLITE_DEBUG_COLUMNCACHE |
| 74422 | | - pTo->iTabColHash = pFrom->iTabColHash; |
| 74423 | | -#endif |
| 74424 | 74531 | if( (pFrom->flags&MEM_Static)==0 ){ |
| 74425 | 74532 | pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Ephem); |
| 74426 | 74533 | assert( srcType==MEM_Ephem || srcType==MEM_Static ); |
| 74427 | 74534 | pTo->flags |= srcType; |
| 74428 | 74535 | } |
| | @@ -74436,13 +74543,10 @@ |
| 74436 | 74543 | int rc = SQLITE_OK; |
| 74437 | 74544 | |
| 74438 | 74545 | assert( (pFrom->flags & MEM_RowSet)==0 ); |
| 74439 | 74546 | if( VdbeMemDynamic(pTo) ) vdbeMemClearExternAndSetNull(pTo); |
| 74440 | 74547 | memcpy(pTo, pFrom, MEMCELLSIZE); |
| 74441 | | -#ifdef SQLITE_DEBUG_COLUMNCACHE |
| 74442 | | - pTo->iTabColHash = pFrom->iTabColHash; |
| 74443 | | -#endif |
| 74444 | 74548 | pTo->flags &= ~MEM_Dyn; |
| 74445 | 74549 | if( pTo->flags&(MEM_Str|MEM_Blob) ){ |
| 74446 | 74550 | if( 0==(pFrom->flags&MEM_Static) ){ |
| 74447 | 74551 | pTo->flags |= MEM_Ephem; |
| 74448 | 74552 | rc = sqlite3VdbeMemMakeWriteable(pTo); |
| | @@ -75547,18 +75651,10 @@ |
| 75547 | 75651 | #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS |
| 75548 | 75652 | pOp->zComment = 0; |
| 75549 | 75653 | #endif |
| 75550 | 75654 | #ifdef SQLITE_DEBUG |
| 75551 | 75655 | if( p->db->flags & SQLITE_VdbeAddopTrace ){ |
| 75552 | | - int jj, kk; |
| 75553 | | - Parse *pParse = p->pParse; |
| 75554 | | - for(jj=kk=0; jj<pParse->nColCache; jj++){ |
| 75555 | | - struct yColCache *x = pParse->aColCache + jj; |
| 75556 | | - printf(" r[%d]={%d:%d}", x->iReg, x->iTable, x->iColumn); |
| 75557 | | - kk++; |
| 75558 | | - } |
| 75559 | | - if( kk ) printf("\n"); |
| 75560 | 75656 | sqlite3VdbePrintOp(0, i, &p->aOp[i]); |
| 75561 | 75657 | test_addop_breakpoint(); |
| 75562 | 75658 | } |
| 75563 | 75659 | #endif |
| 75564 | 75660 | #ifdef VDBE_PROFILE |
| | @@ -75799,23 +75895,10 @@ |
| 75799 | 75895 | assert( p->aLabel[j]==(-1) ); /* Labels may only be resolved once */ |
| 75800 | 75896 | p->aLabel[j] = v->nOp; |
| 75801 | 75897 | } |
| 75802 | 75898 | } |
| 75803 | 75899 | |
| 75804 | | -#ifdef SQLITE_COVERAGE_TEST |
| 75805 | | -/* |
| 75806 | | -** Return TRUE if and only if the label x has already been resolved. |
| 75807 | | -** Return FALSE (zero) if label x is still unresolved. |
| 75808 | | -** |
| 75809 | | -** This routine is only used inside of testcase() macros, and so it |
| 75810 | | -** only exists when measuring test coverage. |
| 75811 | | -*/ |
| 75812 | | -SQLITE_PRIVATE int sqlite3VdbeLabelHasBeenResolved(Vdbe *v, int x){ |
| 75813 | | - return v->pParse->aLabel && v->pParse->aLabel[ADDR(x)]>=0; |
| 75814 | | -} |
| 75815 | | -#endif /* SQLITE_COVERAGE_TEST */ |
| 75816 | | - |
| 75817 | 75900 | /* |
| 75818 | 75901 | ** Mark the VDBE as one that can only be run one time. |
| 75819 | 75902 | */ |
| 75820 | 75903 | SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe *p){ |
| 75821 | 75904 | p->runOnlyOnce = 1; |
| | @@ -77001,13 +77084,10 @@ |
| 77001 | 77084 | p->flags = flags; |
| 77002 | 77085 | p->szMalloc = 0; |
| 77003 | 77086 | #ifdef SQLITE_DEBUG |
| 77004 | 77087 | p->pScopyFrom = 0; |
| 77005 | 77088 | #endif |
| 77006 | | -#ifdef SQLITE_DEBUG_COLUMNCACHE |
| 77007 | | - p->iTabColHash = 0; |
| 77008 | | -#endif |
| 77009 | 77089 | p++; |
| 77010 | 77090 | } |
| 77011 | 77091 | } |
| 77012 | 77092 | |
| 77013 | 77093 | /* |
| | @@ -81187,13 +81267,10 @@ |
| 81187 | 81267 | /* .xDel = */ (void(*)(void*))0, |
| 81188 | 81268 | #ifdef SQLITE_DEBUG |
| 81189 | 81269 | /* .pScopyFrom = */ (Mem*)0, |
| 81190 | 81270 | /* .mScopyFlags= */ 0, |
| 81191 | 81271 | #endif |
| 81192 | | -#ifdef SQLITE_DEBUG_COLUMNCACHE |
| 81193 | | - /* .iTabColHash= */ 0, |
| 81194 | | -#endif |
| 81195 | 81272 | }; |
| 81196 | 81273 | return &nullMem; |
| 81197 | 81274 | } |
| 81198 | 81275 | |
| 81199 | 81276 | /* |
| | @@ -82412,22 +82489,10 @@ |
| 82412 | 82489 | # define memAboutToChange(P,M) sqlite3VdbeMemAboutToChange(P,M) |
| 82413 | 82490 | #else |
| 82414 | 82491 | # define memAboutToChange(P,M) |
| 82415 | 82492 | #endif |
| 82416 | 82493 | |
| 82417 | | -/* |
| 82418 | | -** Given a cursor number and a column for a table or index, compute a |
| 82419 | | -** hash value for use in the Mem.iTabColHash value. The iTabColHash |
| 82420 | | -** column is only used for verification - it is omitted from production |
| 82421 | | -** builds. Collisions are harmless in the sense that the correct answer |
| 82422 | | -** still results. The only harm of collisions is that they can potential |
| 82423 | | -** reduce column-cache error detection during SQLITE_DEBUG builds. |
| 82424 | | -** |
| 82425 | | -** No valid hash should be 0. |
| 82426 | | -*/ |
| 82427 | | -#define TableColumnHash(T,C) (((u32)(T)<<16)^(u32)(C+2)) |
| 82428 | | - |
| 82429 | 82494 | /* |
| 82430 | 82495 | ** The following global variable is incremented every time a cursor |
| 82431 | 82496 | ** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test |
| 82432 | 82497 | ** procedures use this information to make sure that indices are |
| 82433 | 82498 | ** working correctly. This variable has no function other than to |
| | @@ -83773,11 +83838,10 @@ |
| 83773 | 83838 | memAboutToChange(p, pOut); |
| 83774 | 83839 | sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem); |
| 83775 | 83840 | Deephemeralize(pOut); |
| 83776 | 83841 | #ifdef SQLITE_DEBUG |
| 83777 | 83842 | pOut->pScopyFrom = 0; |
| 83778 | | - pOut->iTabColHash = 0; |
| 83779 | 83843 | #endif |
| 83780 | 83844 | REGISTER_TRACE(pOp->p2+pOp->p3-n, pOut); |
| 83781 | 83845 | if( (n--)==0 ) break; |
| 83782 | 83846 | pOut++; |
| 83783 | 83847 | pIn1++; |
| | @@ -84437,11 +84501,16 @@ |
| 84437 | 84501 | affinity = pOp->p5 & SQLITE_AFF_MASK; |
| 84438 | 84502 | if( affinity>=SQLITE_AFF_NUMERIC ){ |
| 84439 | 84503 | if( (flags1 | flags3)&MEM_Str ){ |
| 84440 | 84504 | if( (flags1 & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){ |
| 84441 | 84505 | applyNumericAffinity(pIn1,0); |
| 84442 | | - testcase( flags3!=pIn3->flags ); /* Possible if pIn1==pIn3 */ |
| 84506 | + assert( flags3==pIn3->flags ); |
| 84507 | + /* testcase( flags3!=pIn3->flags ); |
| 84508 | + ** this used to be possible with pIn1==pIn3, but not since |
| 84509 | + ** the column cache was removed. The following assignment |
| 84510 | + ** is essentially a no-op. But, it provides defense-in-depth |
| 84511 | + ** in case our analysis is incorrect, so it is left in. */ |
| 84443 | 84512 | flags3 = pIn3->flags; |
| 84444 | 84513 | } |
| 84445 | 84514 | if( (flags3 & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){ |
| 84446 | 84515 | applyNumericAffinity(pIn3,0); |
| 84447 | 84516 | } |
| | @@ -86357,14 +86426,14 @@ |
| 86357 | 86426 | ** The IdxGE opcode will be skipped if this opcode succeeds, but the |
| 86358 | 86427 | ** IdxGE opcode will be used on subsequent loop iterations. |
| 86359 | 86428 | ** |
| 86360 | 86429 | ** See also: Found, NotFound, SeekGt, SeekGe, SeekLt |
| 86361 | 86430 | */ |
| 86362 | | -case OP_SeekLT: /* jump, in3 */ |
| 86363 | | -case OP_SeekLE: /* jump, in3 */ |
| 86364 | | -case OP_SeekGE: /* jump, in3 */ |
| 86365 | | -case OP_SeekGT: { /* jump, in3 */ |
| 86431 | +case OP_SeekLT: /* jump, in3, group */ |
| 86432 | +case OP_SeekLE: /* jump, in3, group */ |
| 86433 | +case OP_SeekGE: /* jump, in3, group */ |
| 86434 | +case OP_SeekGT: { /* jump, in3, group */ |
| 86366 | 86435 | int res; /* Comparison result */ |
| 86367 | 86436 | int oc; /* Opcode */ |
| 86368 | 86437 | VdbeCursor *pC; /* The cursor to seek */ |
| 86369 | 86438 | UnpackedRecord r; /* The key to seek for */ |
| 86370 | 86439 | int nField; /* Number of columns or fields in the key */ |
| | @@ -86788,17 +86857,25 @@ |
| 86788 | 86857 | int res; |
| 86789 | 86858 | u64 iKey; |
| 86790 | 86859 | |
| 86791 | 86860 | pIn3 = &aMem[pOp->p3]; |
| 86792 | 86861 | if( (pIn3->flags & MEM_Int)==0 ){ |
| 86862 | + /* Make sure pIn3->u.i contains a valid integer representation of |
| 86863 | + ** the key value, but do not change the datatype of the register, as |
| 86864 | + ** other parts of the perpared statement might be depending on the |
| 86865 | + ** current datatype. */ |
| 86866 | + u16 origFlags = pIn3->flags; |
| 86867 | + int isNotInt; |
| 86793 | 86868 | applyAffinity(pIn3, SQLITE_AFF_NUMERIC, encoding); |
| 86794 | | - if( (pIn3->flags & MEM_Int)==0 ) goto jump_to_p2; |
| 86869 | + isNotInt = (pIn3->flags & MEM_Int)==0; |
| 86870 | + pIn3->flags = origFlags; |
| 86871 | + if( isNotInt ) goto jump_to_p2; |
| 86795 | 86872 | } |
| 86796 | 86873 | /* Fall through into OP_NotExists */ |
| 86797 | 86874 | case OP_NotExists: /* jump, in3 */ |
| 86798 | 86875 | pIn3 = &aMem[pOp->p3]; |
| 86799 | | - assert( pIn3->flags & MEM_Int ); |
| 86876 | + assert( (pIn3->flags & MEM_Int)!=0 || pOp->opcode==OP_SeekRowid ); |
| 86800 | 86877 | assert( pOp->p1>=0 && pOp->p1<p->nCursor ); |
| 86801 | 86878 | pC = p->apCsr[pOp->p1]; |
| 86802 | 86879 | assert( pC!=0 ); |
| 86803 | 86880 | #ifdef SQLITE_DEBUG |
| 86804 | 86881 | pC->seekOp = OP_SeekRowid; |
| | @@ -87994,11 +88071,17 @@ |
| 87994 | 88071 | assert( pOp->opcode==OP_IdxGE || pOp->opcode==OP_IdxLT ); |
| 87995 | 88072 | r.default_rc = 0; |
| 87996 | 88073 | } |
| 87997 | 88074 | r.aMem = &aMem[pOp->p3]; |
| 87998 | 88075 | #ifdef SQLITE_DEBUG |
| 87999 | | - { int i; for(i=0; i<r.nField; i++) assert( memIsValid(&r.aMem[i]) ); } |
| 88076 | + { |
| 88077 | + int i; |
| 88078 | + for(i=0; i<r.nField; i++){ |
| 88079 | + assert( memIsValid(&r.aMem[i]) ); |
| 88080 | + REGISTER_TRACE(pOp->p3+i, &aMem[pOp->p3+i]); |
| 88081 | + } |
| 88082 | + } |
| 88000 | 88083 | #endif |
| 88001 | 88084 | res = 0; /* Not needed. Only used to silence a warning. */ |
| 88002 | 88085 | rc = sqlite3VdbeIdxKeyCompare(db, pC, &r, &res); |
| 88003 | 88086 | assert( (OP_IdxLE&1)==(OP_IdxLT&1) && (OP_IdxGE&1)==(OP_IdxGT&1) ); |
| 88004 | 88087 | if( (pOp->opcode&1)==(OP_IdxLT&1) ){ |
| | @@ -89684,12 +89767,12 @@ |
| 89684 | 89767 | ** the sqlite3_context object occurs only once, rather than once for each |
| 89685 | 89768 | ** evaluation of the function. |
| 89686 | 89769 | ** |
| 89687 | 89770 | ** See also: Function0, AggStep, AggFinal |
| 89688 | 89771 | */ |
| 89689 | | -case OP_PureFunc0: |
| 89690 | | -case OP_Function0: { |
| 89772 | +case OP_PureFunc0: /* group */ |
| 89773 | +case OP_Function0: { /* group */ |
| 89691 | 89774 | int n; |
| 89692 | 89775 | sqlite3_context *pCtx; |
| 89693 | 89776 | |
| 89694 | 89777 | assert( pOp->p4type==P4_FUNCDEF ); |
| 89695 | 89778 | n = pOp->p5; |
| | @@ -89709,12 +89792,12 @@ |
| 89709 | 89792 | assert( OP_PureFunc == OP_PureFunc0+2 ); |
| 89710 | 89793 | assert( OP_Function == OP_Function0+2 ); |
| 89711 | 89794 | pOp->opcode += 2; |
| 89712 | 89795 | /* Fall through into OP_Function */ |
| 89713 | 89796 | } |
| 89714 | | -case OP_PureFunc: |
| 89715 | | -case OP_Function: { |
| 89797 | +case OP_PureFunc: /* group */ |
| 89798 | +case OP_Function: { /* group */ |
| 89716 | 89799 | int i; |
| 89717 | 89800 | sqlite3_context *pCtx; |
| 89718 | 89801 | |
| 89719 | 89802 | assert( pOp->p4type==P4_FUNCCTX ); |
| 89720 | 89803 | pCtx = pOp->p4.pCtx; |
| | @@ -89895,38 +89978,10 @@ |
| 89895 | 89978 | */ |
| 89896 | 89979 | case OP_Abortable: { |
| 89897 | 89980 | sqlite3VdbeAssertAbortable(p); |
| 89898 | 89981 | break; |
| 89899 | 89982 | } |
| 89900 | | -#endif |
| 89901 | | - |
| 89902 | | -#ifdef SQLITE_DEBUG_COLUMNCACHE |
| 89903 | | -/* Opcode: SetTabCol P1 P2 P3 * * |
| 89904 | | -** |
| 89905 | | -** Set a flag in register REG[P3] indicating that it holds the value |
| 89906 | | -** of column P2 from the table on cursor P1. This flag is checked |
| 89907 | | -** by a subsequent VerifyTabCol opcode. |
| 89908 | | -** |
| 89909 | | -** This opcode only appears SQLITE_DEBUG builds. It is used to verify |
| 89910 | | -** that the expression table column cache is working correctly. |
| 89911 | | -*/ |
| 89912 | | -case OP_SetTabCol: { |
| 89913 | | - aMem[pOp->p3].iTabColHash = TableColumnHash(pOp->p1,pOp->p2); |
| 89914 | | - break; |
| 89915 | | -} |
| 89916 | | -/* Opcode: VerifyTabCol P1 P2 P3 * * |
| 89917 | | -** |
| 89918 | | -** Verify that register REG[P3] contains the value of column P2 from |
| 89919 | | -** cursor P1. Assert() if this is not the case. |
| 89920 | | -** |
| 89921 | | -** This opcode only appears SQLITE_DEBUG builds. It is used to verify |
| 89922 | | -** that the expression table column cache is working correctly. |
| 89923 | | -*/ |
| 89924 | | -case OP_VerifyTabCol: { |
| 89925 | | - assert( aMem[pOp->p3].iTabColHash == TableColumnHash(pOp->p1,pOp->p2) ); |
| 89926 | | - break; |
| 89927 | | -} |
| 89928 | 89983 | #endif |
| 89929 | 89984 | |
| 89930 | 89985 | /* Opcode: Noop * * * * * |
| 89931 | 89986 | ** |
| 89932 | 89987 | ** Do nothing. This instruction is often useful as a jump |
| | @@ -95712,18 +95767,10 @@ |
| 95712 | 95767 | CollSeq *pColl = 0; |
| 95713 | 95768 | Expr *p = pExpr; |
| 95714 | 95769 | while( p ){ |
| 95715 | 95770 | int op = p->op; |
| 95716 | 95771 | if( p->flags & EP_Generic ) break; |
| 95717 | | - if( op==TK_CAST || op==TK_UPLUS ){ |
| 95718 | | - p = p->pLeft; |
| 95719 | | - continue; |
| 95720 | | - } |
| 95721 | | - if( op==TK_COLLATE || (op==TK_REGISTER && p->op2==TK_COLLATE) ){ |
| 95722 | | - pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken); |
| 95723 | | - break; |
| 95724 | | - } |
| 95725 | 95772 | if( (op==TK_AGG_COLUMN || op==TK_COLUMN |
| 95726 | 95773 | || op==TK_REGISTER || op==TK_TRIGGER) |
| 95727 | 95774 | && p->pTab!=0 |
| 95728 | 95775 | ){ |
| 95729 | 95776 | /* op==TK_REGISTER && p->pTab!=0 happens when pExpr was originally |
| | @@ -95732,10 +95779,18 @@ |
| 95732 | 95779 | if( j>=0 ){ |
| 95733 | 95780 | const char *zColl = p->pTab->aCol[j].zColl; |
| 95734 | 95781 | pColl = sqlite3FindCollSeq(db, ENC(db), zColl, 0); |
| 95735 | 95782 | } |
| 95736 | 95783 | break; |
| 95784 | + } |
| 95785 | + if( op==TK_CAST || op==TK_UPLUS ){ |
| 95786 | + p = p->pLeft; |
| 95787 | + continue; |
| 95788 | + } |
| 95789 | + if( op==TK_COLLATE || (op==TK_REGISTER && p->op2==TK_COLLATE) ){ |
| 95790 | + pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken); |
| 95791 | + break; |
| 95737 | 95792 | } |
| 95738 | 95793 | if( p->flags & EP_Collate ){ |
| 95739 | 95794 | if( p->pLeft && (p->pLeft->flags & EP_Collate)!=0 ){ |
| 95740 | 95795 | p = p->pLeft; |
| 95741 | 95796 | }else{ |
| | @@ -96152,11 +96207,10 @@ |
| 96152 | 96207 | for(i=0; 1 /*Loop exits by "break"*/; i++){ |
| 96153 | 96208 | int regFree1 = 0, regFree2 = 0; |
| 96154 | 96209 | Expr *pL, *pR; |
| 96155 | 96210 | int r1, r2; |
| 96156 | 96211 | assert( i>=0 && i<nLeft ); |
| 96157 | | - if( i>0 ) sqlite3ExprCachePush(pParse); |
| 96158 | 96212 | r1 = exprVectorRegister(pParse, pLeft, i, regLeft, &pL, ®Free1); |
| 96159 | 96213 | r2 = exprVectorRegister(pParse, pRight, i, regRight, &pR, ®Free2); |
| 96160 | 96214 | codeCompare(pParse, pL, pR, opx, r1, r2, dest, p5); |
| 96161 | 96215 | testcase(op==OP_Lt); VdbeCoverageIf(v,op==OP_Lt); |
| 96162 | 96216 | testcase(op==OP_Le); VdbeCoverageIf(v,op==OP_Le); |
| | @@ -96164,11 +96218,10 @@ |
| 96164 | 96218 | testcase(op==OP_Ge); VdbeCoverageIf(v,op==OP_Ge); |
| 96165 | 96219 | testcase(op==OP_Eq); VdbeCoverageIf(v,op==OP_Eq); |
| 96166 | 96220 | testcase(op==OP_Ne); VdbeCoverageIf(v,op==OP_Ne); |
| 96167 | 96221 | sqlite3ReleaseTempReg(pParse, regFree1); |
| 96168 | 96222 | sqlite3ReleaseTempReg(pParse, regFree2); |
| 96169 | | - if( i>0 ) sqlite3ExprCachePop(pParse); |
| 96170 | 96223 | if( i==nLeft-1 ){ |
| 96171 | 96224 | break; |
| 96172 | 96225 | } |
| 96173 | 96226 | if( opx==TK_EQ ){ |
| 96174 | 96227 | sqlite3VdbeAddOp2(v, OP_IfNot, dest, addrDone); VdbeCoverage(v); |
| | @@ -96512,23 +96565,32 @@ |
| 96512 | 96565 | |
| 96513 | 96566 | /* |
| 96514 | 96567 | ** Construct a new expression node for a function with multiple |
| 96515 | 96568 | ** arguments. |
| 96516 | 96569 | */ |
| 96517 | | -SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse *pParse, ExprList *pList, Token *pToken){ |
| 96570 | +SQLITE_PRIVATE Expr *sqlite3ExprFunction( |
| 96571 | + Parse *pParse, /* Parsing context */ |
| 96572 | + ExprList *pList, /* Argument list */ |
| 96573 | + Token *pToken, /* Name of the function */ |
| 96574 | + int eDistinct /* SF_Distinct or SF_ALL or 0 */ |
| 96575 | +){ |
| 96518 | 96576 | Expr *pNew; |
| 96519 | 96577 | sqlite3 *db = pParse->db; |
| 96520 | 96578 | assert( pToken ); |
| 96521 | 96579 | pNew = sqlite3ExprAlloc(db, TK_FUNCTION, pToken, 1); |
| 96522 | 96580 | if( pNew==0 ){ |
| 96523 | 96581 | sqlite3ExprListDelete(db, pList); /* Avoid memory leak when malloc fails */ |
| 96524 | 96582 | return 0; |
| 96525 | 96583 | } |
| 96584 | + if( pList && pList->nExpr > pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ |
| 96585 | + sqlite3ErrorMsg(pParse, "too many arguments on function %T", pToken); |
| 96586 | + } |
| 96526 | 96587 | pNew->x.pList = pList; |
| 96527 | 96588 | ExprSetProperty(pNew, EP_HasFunc); |
| 96528 | 96589 | assert( !ExprHasProperty(pNew, EP_xIsSelect) ); |
| 96529 | 96590 | sqlite3ExprSetHeightAndFlags(pParse, pNew); |
| 96591 | + if( eDistinct==SF_Distinct ) ExprSetProperty(pNew, EP_Distinct); |
| 96530 | 96592 | return pNew; |
| 96531 | 96593 | } |
| 96532 | 96594 | |
| 96533 | 96595 | /* |
| 96534 | 96596 | ** Assign a variable number to an expression that encodes a wildcard |
| | @@ -97410,10 +97472,13 @@ |
| 97410 | 97472 | case TK_AGG_COLUMN: |
| 97411 | 97473 | testcase( pExpr->op==TK_ID ); |
| 97412 | 97474 | testcase( pExpr->op==TK_COLUMN ); |
| 97413 | 97475 | testcase( pExpr->op==TK_AGG_FUNCTION ); |
| 97414 | 97476 | testcase( pExpr->op==TK_AGG_COLUMN ); |
| 97477 | + if( ExprHasProperty(pExpr, EP_FixedCol) && pWalker->eCode!=2 ){ |
| 97478 | + return WRC_Continue; |
| 97479 | + } |
| 97415 | 97480 | if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){ |
| 97416 | 97481 | return WRC_Continue; |
| 97417 | 97482 | } |
| 97418 | 97483 | /* Fall through */ |
| 97419 | 97484 | case TK_IF_NULL_ROW: |
| | @@ -97465,14 +97530,21 @@ |
| 97465 | 97530 | SQLITE_PRIVATE int sqlite3ExprIsConstant(Expr *p){ |
| 97466 | 97531 | return exprIsConst(p, 1, 0); |
| 97467 | 97532 | } |
| 97468 | 97533 | |
| 97469 | 97534 | /* |
| 97470 | | -** Walk an expression tree. Return non-zero if the expression is constant |
| 97471 | | -** that does no originate from the ON or USING clauses of a join. |
| 97472 | | -** Return 0 if it involves variables or function calls or terms from |
| 97473 | | -** an ON or USING clause. |
| 97535 | +** Walk an expression tree. Return non-zero if |
| 97536 | +** |
| 97537 | +** (1) the expression is constant, and |
| 97538 | +** (2) the expression does originate in the ON or USING clause |
| 97539 | +** of a LEFT JOIN, and |
| 97540 | +** (3) the expression does not contain any EP_FixedCol TK_COLUMN |
| 97541 | +** operands created by the constant propagation optimization. |
| 97542 | +** |
| 97543 | +** When this routine returns true, it indicates that the expression |
| 97544 | +** can be added to the pParse->pConstExpr list and evaluated once when |
| 97545 | +** the prepared statement starts up. See sqlite3ExprCodeAtInit(). |
| 97474 | 97546 | */ |
| 97475 | 97547 | SQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr *p){ |
| 97476 | 97548 | return exprIsConst(p, 2, 0); |
| 97477 | 97549 | } |
| 97478 | 97550 | |
| | @@ -97498,11 +97570,11 @@ |
| 97498 | 97570 | ** it constant. */ |
| 97499 | 97571 | for(i=0; i<pGroupBy->nExpr; i++){ |
| 97500 | 97572 | Expr *p = pGroupBy->a[i].pExpr; |
| 97501 | 97573 | if( sqlite3ExprCompare(0, pExpr, p, -1)<2 ){ |
| 97502 | 97574 | CollSeq *pColl = sqlite3ExprNNCollSeq(pWalker->pParse, p); |
| 97503 | | - if( sqlite3_stricmp("BINARY", pColl->zName)==0 ){ |
| 97575 | + if( sqlite3IsBinary(pColl) ){ |
| 97504 | 97576 | return WRC_Prune; |
| 97505 | 97577 | } |
| 97506 | 97578 | } |
| 97507 | 97579 | } |
| 97508 | 97580 | |
| | @@ -97920,11 +97992,12 @@ |
| 97920 | 97992 | int iAddr = sqlite3VdbeAddOp0(v, OP_Once); |
| 97921 | 97993 | VdbeCoverage(v); |
| 97922 | 97994 | |
| 97923 | 97995 | sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead); |
| 97924 | 97996 | eType = IN_INDEX_ROWID; |
| 97925 | | - |
| 97997 | + ExplainQueryPlan((pParse, 0, |
| 97998 | + "USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR",pTab->zName)); |
| 97926 | 97999 | sqlite3VdbeJumpHere(v, iAddr); |
| 97927 | 98000 | }else{ |
| 97928 | 98001 | Index *pIdx; /* Iterator variable */ |
| 97929 | 98002 | int affinity_ok = 1; |
| 97930 | 98003 | int i; |
| | @@ -98179,11 +98252,10 @@ |
| 98179 | 98252 | ){ |
| 98180 | 98253 | int jmpIfDynamic = -1; /* One-time test address */ |
| 98181 | 98254 | int rReg = 0; /* Register storing resulting */ |
| 98182 | 98255 | Vdbe *v = sqlite3GetVdbe(pParse); |
| 98183 | 98256 | if( NEVER(v==0) ) return 0; |
| 98184 | | - sqlite3ExprCachePush(pParse); |
| 98185 | 98257 | |
| 98186 | 98258 | /* The evaluation of the IN/EXISTS/SELECT must be repeated every time it |
| 98187 | 98259 | ** is encountered if any of the following is true: |
| 98188 | 98260 | ** |
| 98189 | 98261 | ** * The right-hand side is a correlated subquery |
| | @@ -98315,11 +98387,10 @@ |
| 98315 | 98387 | sqlite3VdbeCurrentAddr(v)+2); |
| 98316 | 98388 | VdbeCoverage(v); |
| 98317 | 98389 | sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3); |
| 98318 | 98390 | }else{ |
| 98319 | 98391 | sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); |
| 98320 | | - sqlite3ExprCacheAffinityChange(pParse, r3, 1); |
| 98321 | 98392 | sqlite3VdbeAddOp4Int(v, OP_IdxInsert, pExpr->iTable, r2, r3, 1); |
| 98322 | 98393 | } |
| 98323 | 98394 | } |
| 98324 | 98395 | } |
| 98325 | 98396 | sqlite3ReleaseTempReg(pParse, r1); |
| | @@ -98396,11 +98467,10 @@ |
| 98396 | 98467 | } |
| 98397 | 98468 | |
| 98398 | 98469 | if( jmpIfDynamic>=0 ){ |
| 98399 | 98470 | sqlite3VdbeJumpHere(v, jmpIfDynamic); |
| 98400 | 98471 | } |
| 98401 | | - sqlite3ExprCachePop(pParse); |
| 98402 | 98472 | |
| 98403 | 98473 | return rReg; |
| 98404 | 98474 | } |
| 98405 | 98475 | #endif /* SQLITE_OMIT_SUBQUERY */ |
| 98406 | 98476 | |
| | @@ -98515,11 +98585,10 @@ |
| 98515 | 98585 | ** sqlite3FindInIndex() might have reordered the fields of the LHS vector |
| 98516 | 98586 | ** so that the fields are in the same order as an existing index. The |
| 98517 | 98587 | ** aiMap[] array contains a mapping from the original LHS field order to |
| 98518 | 98588 | ** the field order that matches the RHS index. |
| 98519 | 98589 | */ |
| 98520 | | - sqlite3ExprCachePush(pParse); |
| 98521 | 98590 | rLhsOrig = exprCodeVector(pParse, pLeft, &iDummy); |
| 98522 | 98591 | for(i=0; i<nVector && aiMap[i]==i; i++){} /* Are LHS fields reordered? */ |
| 98523 | 98592 | if( i==nVector ){ |
| 98524 | 98593 | /* LHS fields are not reordered */ |
| 98525 | 98594 | rLhs = rLhsOrig; |
| | @@ -98674,11 +98743,10 @@ |
| 98674 | 98743 | /* Jumps here in order to return true. */ |
| 98675 | 98744 | sqlite3VdbeJumpHere(v, addrTruthOp); |
| 98676 | 98745 | |
| 98677 | 98746 | sqlite3ExprCodeIN_finished: |
| 98678 | 98747 | if( rLhs!=rLhsOrig ) sqlite3ReleaseTempReg(pParse, rLhs); |
| 98679 | | - sqlite3ExprCachePop(pParse); |
| 98680 | 98748 | VdbeComment((v, "end IN expr")); |
| 98681 | 98749 | sqlite3ExprCodeIN_oom_error: |
| 98682 | 98750 | sqlite3DbFree(pParse->db, aiMap); |
| 98683 | 98751 | sqlite3DbFree(pParse->db, zAff); |
| 98684 | 98752 | } |
| | @@ -98742,156 +98810,10 @@ |
| 98742 | 98810 | sqlite3VdbeAddOp4Dup8(v, OP_Int64, 0, iMem, 0, (u8*)&value, P4_INT64); |
| 98743 | 98811 | } |
| 98744 | 98812 | } |
| 98745 | 98813 | } |
| 98746 | 98814 | |
| 98747 | | -/* |
| 98748 | | -** Erase column-cache entry number i |
| 98749 | | -*/ |
| 98750 | | -static void cacheEntryClear(Parse *pParse, int i){ |
| 98751 | | - if( pParse->aColCache[i].tempReg ){ |
| 98752 | | - if( pParse->nTempReg<ArraySize(pParse->aTempReg) ){ |
| 98753 | | - pParse->aTempReg[pParse->nTempReg++] = pParse->aColCache[i].iReg; |
| 98754 | | - } |
| 98755 | | - } |
| 98756 | | - pParse->nColCache--; |
| 98757 | | - if( i<pParse->nColCache ){ |
| 98758 | | - pParse->aColCache[i] = pParse->aColCache[pParse->nColCache]; |
| 98759 | | - } |
| 98760 | | -} |
| 98761 | | - |
| 98762 | | - |
| 98763 | | -/* |
| 98764 | | -** Record in the column cache that a particular column from a |
| 98765 | | -** particular table is stored in a particular register. |
| 98766 | | -*/ |
| 98767 | | -SQLITE_PRIVATE void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int iReg){ |
| 98768 | | - int i; |
| 98769 | | - int minLru; |
| 98770 | | - int idxLru; |
| 98771 | | - struct yColCache *p; |
| 98772 | | - |
| 98773 | | - /* Unless an error has occurred, register numbers are always positive. */ |
| 98774 | | - assert( iReg>0 || pParse->nErr || pParse->db->mallocFailed ); |
| 98775 | | - assert( iCol>=-1 && iCol<32768 ); /* Finite column numbers */ |
| 98776 | | - |
| 98777 | | - /* The SQLITE_ColumnCache flag disables the column cache. This is used |
| 98778 | | - ** for testing only - to verify that SQLite always gets the same answer |
| 98779 | | - ** with and without the column cache. |
| 98780 | | - */ |
| 98781 | | - if( OptimizationDisabled(pParse->db, SQLITE_ColumnCache) ) return; |
| 98782 | | - |
| 98783 | | - /* First replace any existing entry. |
| 98784 | | - ** |
| 98785 | | - ** Actually, the way the column cache is currently used, we are guaranteed |
| 98786 | | - ** that the object will never already be in cache. Verify this guarantee. |
| 98787 | | - */ |
| 98788 | | -#ifndef NDEBUG |
| 98789 | | - for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){ |
| 98790 | | - assert( p->iTable!=iTab || p->iColumn!=iCol ); |
| 98791 | | - } |
| 98792 | | -#endif |
| 98793 | | - |
| 98794 | | -#ifdef SQLITE_DEBUG_COLUMNCACHE |
| 98795 | | - /* Add a SetTabCol opcode for run-time verification that the column |
| 98796 | | - ** cache is working correctly. |
| 98797 | | - */ |
| 98798 | | - sqlite3VdbeAddOp3(pParse->pVdbe, OP_SetTabCol, iTab, iCol, iReg); |
| 98799 | | -#endif |
| 98800 | | - |
| 98801 | | - /* If the cache is already full, delete the least recently used entry */ |
| 98802 | | - if( pParse->nColCache>=SQLITE_N_COLCACHE ){ |
| 98803 | | - minLru = 0x7fffffff; |
| 98804 | | - idxLru = -1; |
| 98805 | | - for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){ |
| 98806 | | - if( p->lru<minLru ){ |
| 98807 | | - idxLru = i; |
| 98808 | | - minLru = p->lru; |
| 98809 | | - } |
| 98810 | | - } |
| 98811 | | - p = &pParse->aColCache[idxLru]; |
| 98812 | | - }else{ |
| 98813 | | - p = &pParse->aColCache[pParse->nColCache++]; |
| 98814 | | - } |
| 98815 | | - |
| 98816 | | - /* Add the new entry to the end of the cache */ |
| 98817 | | - p->iLevel = pParse->iCacheLevel; |
| 98818 | | - p->iTable = iTab; |
| 98819 | | - p->iColumn = iCol; |
| 98820 | | - p->iReg = iReg; |
| 98821 | | - p->tempReg = 0; |
| 98822 | | - p->lru = pParse->iCacheCnt++; |
| 98823 | | -} |
| 98824 | | - |
| 98825 | | -/* |
| 98826 | | -** Indicate that registers between iReg..iReg+nReg-1 are being overwritten. |
| 98827 | | -** Purge the range of registers from the column cache. |
| 98828 | | -*/ |
| 98829 | | -SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse *pParse, int iReg, int nReg){ |
| 98830 | | - int i = 0; |
| 98831 | | - while( i<pParse->nColCache ){ |
| 98832 | | - struct yColCache *p = &pParse->aColCache[i]; |
| 98833 | | - if( p->iReg >= iReg && p->iReg < iReg+nReg ){ |
| 98834 | | - cacheEntryClear(pParse, i); |
| 98835 | | - }else{ |
| 98836 | | - i++; |
| 98837 | | - } |
| 98838 | | - } |
| 98839 | | -} |
| 98840 | | - |
| 98841 | | -/* |
| 98842 | | -** Remember the current column cache context. Any new entries added |
| 98843 | | -** added to the column cache after this call are removed when the |
| 98844 | | -** corresponding pop occurs. |
| 98845 | | -*/ |
| 98846 | | -SQLITE_PRIVATE void sqlite3ExprCachePush(Parse *pParse){ |
| 98847 | | - pParse->iCacheLevel++; |
| 98848 | | -#ifdef SQLITE_DEBUG |
| 98849 | | - if( pParse->db->flags & SQLITE_VdbeAddopTrace ){ |
| 98850 | | - printf("PUSH to %d\n", pParse->iCacheLevel); |
| 98851 | | - } |
| 98852 | | -#endif |
| 98853 | | -} |
| 98854 | | - |
| 98855 | | -/* |
| 98856 | | -** Remove from the column cache any entries that were added since the |
| 98857 | | -** the previous sqlite3ExprCachePush operation. In other words, restore |
| 98858 | | -** the cache to the state it was in prior the most recent Push. |
| 98859 | | -*/ |
| 98860 | | -SQLITE_PRIVATE void sqlite3ExprCachePop(Parse *pParse){ |
| 98861 | | - int i = 0; |
| 98862 | | - assert( pParse->iCacheLevel>=1 ); |
| 98863 | | - pParse->iCacheLevel--; |
| 98864 | | -#ifdef SQLITE_DEBUG |
| 98865 | | - if( pParse->db->flags & SQLITE_VdbeAddopTrace ){ |
| 98866 | | - printf("POP to %d\n", pParse->iCacheLevel); |
| 98867 | | - } |
| 98868 | | -#endif |
| 98869 | | - while( i<pParse->nColCache ){ |
| 98870 | | - if( pParse->aColCache[i].iLevel>pParse->iCacheLevel ){ |
| 98871 | | - cacheEntryClear(pParse, i); |
| 98872 | | - }else{ |
| 98873 | | - i++; |
| 98874 | | - } |
| 98875 | | - } |
| 98876 | | -} |
| 98877 | | - |
| 98878 | | -/* |
| 98879 | | -** When a cached column is reused, make sure that its register is |
| 98880 | | -** no longer available as a temp register. ticket #3879: that same |
| 98881 | | -** register might be in the cache in multiple places, so be sure to |
| 98882 | | -** get them all. |
| 98883 | | -*/ |
| 98884 | | -static void sqlite3ExprCachePinRegister(Parse *pParse, int iReg){ |
| 98885 | | - int i; |
| 98886 | | - struct yColCache *p; |
| 98887 | | - for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){ |
| 98888 | | - if( p->iReg==iReg ){ |
| 98889 | | - p->tempReg = 0; |
| 98890 | | - } |
| 98891 | | - } |
| 98892 | | -} |
| 98893 | 98815 | |
| 98894 | 98816 | /* Generate code that will load into register regOut a value that is |
| 98895 | 98817 | ** appropriate for the iIdxCol-th column of index pIdx. |
| 98896 | 98818 | */ |
| 98897 | 98819 | SQLITE_PRIVATE void sqlite3ExprCodeLoadIndexColumn( |
| | @@ -98943,16 +98865,11 @@ |
| 98943 | 98865 | } |
| 98944 | 98866 | } |
| 98945 | 98867 | |
| 98946 | 98868 | /* |
| 98947 | 98869 | ** Generate code that will extract the iColumn-th column from |
| 98948 | | -** table pTab and store the column value in a register. |
| 98949 | | -** |
| 98950 | | -** An effort is made to store the column value in register iReg. This |
| 98951 | | -** is not garanteeed for GetColumn() - the result can be stored in |
| 98952 | | -** any register. But the result is guaranteed to land in register iReg |
| 98953 | | -** for GetColumnToReg(). |
| 98870 | +** table pTab and store the column value in register iReg. |
| 98954 | 98871 | ** |
| 98955 | 98872 | ** There must be an open cursor to pTab in iTable when this routine |
| 98956 | 98873 | ** is called. If iColumn<0 then code is generated that extracts the rowid. |
| 98957 | 98874 | */ |
| 98958 | 98875 | SQLITE_PRIVATE int sqlite3ExprCodeGetColumn( |
| | @@ -98962,102 +98879,26 @@ |
| 98962 | 98879 | int iTable, /* The cursor pointing to the table */ |
| 98963 | 98880 | int iReg, /* Store results here */ |
| 98964 | 98881 | u8 p5 /* P5 value for OP_Column + FLAGS */ |
| 98965 | 98882 | ){ |
| 98966 | 98883 | Vdbe *v = pParse->pVdbe; |
| 98967 | | - int i; |
| 98968 | | - struct yColCache *p; |
| 98969 | | - |
| 98970 | | - for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){ |
| 98971 | | - if( p->iTable==iTable && p->iColumn==iColumn ){ |
| 98972 | | - p->lru = pParse->iCacheCnt++; |
| 98973 | | - sqlite3ExprCachePinRegister(pParse, p->iReg); |
| 98974 | | -#ifdef SQLITE_DEBUG_COLUMNCACHE |
| 98975 | | - sqlite3VdbeAddOp3(v, OP_VerifyTabCol, iTable, iColumn, p->iReg); |
| 98976 | | -#endif |
| 98977 | | - return p->iReg; |
| 98978 | | - } |
| 98979 | | - } |
| 98980 | 98884 | assert( v!=0 ); |
| 98981 | 98885 | sqlite3ExprCodeGetColumnOfTable(v, pTab, iTable, iColumn, iReg); |
| 98982 | 98886 | if( p5 ){ |
| 98983 | 98887 | sqlite3VdbeChangeP5(v, p5); |
| 98984 | | - }else{ |
| 98985 | | - sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); |
| 98986 | 98888 | } |
| 98987 | 98889 | return iReg; |
| 98988 | 98890 | } |
| 98989 | | -SQLITE_PRIVATE void sqlite3ExprCodeGetColumnToReg( |
| 98990 | | - Parse *pParse, /* Parsing and code generating context */ |
| 98991 | | - Table *pTab, /* Description of the table we are reading from */ |
| 98992 | | - int iColumn, /* Index of the table column */ |
| 98993 | | - int iTable, /* The cursor pointing to the table */ |
| 98994 | | - int iReg /* Store results here */ |
| 98995 | | -){ |
| 98996 | | - int r1 = sqlite3ExprCodeGetColumn(pParse, pTab, iColumn, iTable, iReg, 0); |
| 98997 | | - if( r1!=iReg ) sqlite3VdbeAddOp2(pParse->pVdbe, OP_SCopy, r1, iReg); |
| 98998 | | -} |
| 98999 | | - |
| 99000 | | - |
| 99001 | | -/* |
| 99002 | | -** Clear all column cache entries. |
| 99003 | | -*/ |
| 99004 | | -SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){ |
| 99005 | | - int i; |
| 99006 | | - |
| 99007 | | -#ifdef SQLITE_DEBUG |
| 99008 | | - if( pParse->db->flags & SQLITE_VdbeAddopTrace ){ |
| 99009 | | - printf("CLEAR\n"); |
| 99010 | | - } |
| 99011 | | -#endif |
| 99012 | | - for(i=0; i<pParse->nColCache; i++){ |
| 99013 | | - if( pParse->aColCache[i].tempReg |
| 99014 | | - && pParse->nTempReg<ArraySize(pParse->aTempReg) |
| 99015 | | - ){ |
| 99016 | | - pParse->aTempReg[pParse->nTempReg++] = pParse->aColCache[i].iReg; |
| 99017 | | - } |
| 99018 | | - } |
| 99019 | | - pParse->nColCache = 0; |
| 99020 | | -} |
| 99021 | | - |
| 99022 | | -/* |
| 99023 | | -** Record the fact that an affinity change has occurred on iCount |
| 99024 | | -** registers starting with iStart. |
| 99025 | | -*/ |
| 99026 | | -SQLITE_PRIVATE void sqlite3ExprCacheAffinityChange(Parse *pParse, int iStart, int iCount){ |
| 99027 | | - sqlite3ExprCacheRemove(pParse, iStart, iCount); |
| 99028 | | -} |
| 99029 | 98891 | |
| 99030 | 98892 | /* |
| 99031 | 98893 | ** Generate code to move content from registers iFrom...iFrom+nReg-1 |
| 99032 | | -** over to iTo..iTo+nReg-1. Keep the column cache up-to-date. |
| 98894 | +** over to iTo..iTo+nReg-1. |
| 99033 | 98895 | */ |
| 99034 | 98896 | SQLITE_PRIVATE void sqlite3ExprCodeMove(Parse *pParse, int iFrom, int iTo, int nReg){ |
| 99035 | 98897 | assert( iFrom>=iTo+nReg || iFrom+nReg<=iTo ); |
| 99036 | 98898 | sqlite3VdbeAddOp3(pParse->pVdbe, OP_Move, iFrom, iTo, nReg); |
| 99037 | | - sqlite3ExprCacheRemove(pParse, iFrom, nReg); |
| 99038 | | -} |
| 99039 | | - |
| 99040 | | -#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) |
| 99041 | | -/* |
| 99042 | | -** Return true if any register in the range iFrom..iTo (inclusive) |
| 99043 | | -** is used as part of the column cache. |
| 99044 | | -** |
| 99045 | | -** This routine is used within assert() and testcase() macros only |
| 99046 | | -** and does not appear in a normal build. |
| 99047 | | -*/ |
| 99048 | | -static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){ |
| 99049 | | - int i; |
| 99050 | | - struct yColCache *p; |
| 99051 | | - for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){ |
| 99052 | | - int r = p->iReg; |
| 99053 | | - if( r>=iFrom && r<=iTo ) return 1; /*NO_TEST*/ |
| 99054 | | - } |
| 99055 | | - return 0; |
| 99056 | | -} |
| 99057 | | -#endif /* SQLITE_DEBUG || SQLITE_COVERAGE_TEST */ |
| 99058 | | - |
| 98899 | +} |
| 99059 | 98900 | |
| 99060 | 98901 | /* |
| 99061 | 98902 | ** Convert a scalar expression node to a TK_REGISTER referencing |
| 99062 | 98903 | ** register iReg. The caller must ensure that iReg already contains |
| 99063 | 98904 | ** the correct value for the expression. |
| | @@ -99152,10 +98993,32 @@ |
| 99152 | 98993 | } |
| 99153 | 98994 | /* Otherwise, fall thru into the TK_COLUMN case */ |
| 99154 | 98995 | } |
| 99155 | 98996 | case TK_COLUMN: { |
| 99156 | 98997 | int iTab = pExpr->iTable; |
| 98998 | + if( ExprHasProperty(pExpr, EP_FixedCol) ){ |
| 98999 | + /* This COLUMN expression is really a constant due to WHERE clause |
| 99000 | + ** constraints, and that constant is coded by the pExpr->pLeft |
| 99001 | + ** expresssion. However, make sure the constant has the correct |
| 99002 | + ** datatype by applying the Affinity of the table column to the |
| 99003 | + ** constant. |
| 99004 | + */ |
| 99005 | + int iReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft,target); |
| 99006 | + int aff = sqlite3TableColumnAffinity(pExpr->pTab, pExpr->iColumn); |
| 99007 | + if( aff!=SQLITE_AFF_BLOB ){ |
| 99008 | + static const char zAff[] = "B\000C\000D\000E"; |
| 99009 | + assert( SQLITE_AFF_BLOB=='A' ); |
| 99010 | + assert( SQLITE_AFF_TEXT=='B' ); |
| 99011 | + if( iReg!=target ){ |
| 99012 | + sqlite3VdbeAddOp2(v, OP_SCopy, iReg, target); |
| 99013 | + iReg = target; |
| 99014 | + } |
| 99015 | + sqlite3VdbeAddOp4(v, OP_Affinity, iReg, 1, 0, |
| 99016 | + &zAff[(aff-'B')*2], P4_STATIC); |
| 99017 | + } |
| 99018 | + return iReg; |
| 99019 | + } |
| 99157 | 99020 | if( iTab<0 ){ |
| 99158 | 99021 | if( pParse->iSelfTab<0 ){ |
| 99159 | 99022 | /* Generating CHECK constraints or inserting into partial index */ |
| 99160 | 99023 | return pExpr->iColumn - pParse->iSelfTab; |
| 99161 | 99024 | }else{ |
| | @@ -99232,12 +99095,10 @@ |
| 99232 | 99095 | sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target); |
| 99233 | 99096 | inReg = target; |
| 99234 | 99097 | } |
| 99235 | 99098 | sqlite3VdbeAddOp2(v, OP_Cast, target, |
| 99236 | 99099 | sqlite3AffinityType(pExpr->u.zToken, 0)); |
| 99237 | | - testcase( usedAsColumnCache(pParse, inReg, inReg) ); |
| 99238 | | - sqlite3ExprCacheAffinityChange(pParse, inReg, 1); |
| 99239 | 99100 | return inReg; |
| 99240 | 99101 | } |
| 99241 | 99102 | #endif /* SQLITE_OMIT_CAST */ |
| 99242 | 99103 | case TK_IS: |
| 99243 | 99104 | case TK_ISNOT: |
| | @@ -99419,14 +99280,11 @@ |
| 99419 | 99280 | assert( nFarg>=2 ); |
| 99420 | 99281 | sqlite3ExprCode(pParse, pFarg->a[0].pExpr, target); |
| 99421 | 99282 | for(i=1; i<nFarg; i++){ |
| 99422 | 99283 | sqlite3VdbeAddOp2(v, OP_NotNull, target, endCoalesce); |
| 99423 | 99284 | VdbeCoverage(v); |
| 99424 | | - sqlite3ExprCacheRemove(pParse, target, 1); |
| 99425 | | - sqlite3ExprCachePush(pParse); |
| 99426 | 99285 | sqlite3ExprCode(pParse, pFarg->a[i].pExpr, target); |
| 99427 | | - sqlite3ExprCachePop(pParse); |
| 99428 | 99286 | } |
| 99429 | 99287 | sqlite3VdbeResolveLabel(v, endCoalesce); |
| 99430 | 99288 | break; |
| 99431 | 99289 | } |
| 99432 | 99290 | |
| | @@ -99488,14 +99346,12 @@ |
| 99488 | 99346 | pFarg->a[0].pExpr->op2 = |
| 99489 | 99347 | pDef->funcFlags & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG); |
| 99490 | 99348 | } |
| 99491 | 99349 | } |
| 99492 | 99350 | |
| 99493 | | - sqlite3ExprCachePush(pParse); /* Ticket 2ea2425d34be */ |
| 99494 | 99351 | sqlite3ExprCodeExprList(pParse, pFarg, r1, 0, |
| 99495 | 99352 | SQLITE_ECEL_DUP|SQLITE_ECEL_FACTOR); |
| 99496 | | - sqlite3ExprCachePop(pParse); /* Ticket 2ea2425d34be */ |
| 99497 | 99353 | }else{ |
| 99498 | 99354 | r1 = 0; |
| 99499 | 99355 | } |
| 99500 | 99356 | #ifndef SQLITE_OMIT_VIRTUALTABLE |
| 99501 | 99357 | /* Possibly overload the function if the first argument is |
| | @@ -99664,13 +99520,11 @@ |
| 99664 | 99520 | } |
| 99665 | 99521 | |
| 99666 | 99522 | case TK_IF_NULL_ROW: { |
| 99667 | 99523 | int addrINR; |
| 99668 | 99524 | addrINR = sqlite3VdbeAddOp1(v, OP_IfNullRow, pExpr->iTable); |
| 99669 | | - sqlite3ExprCachePush(pParse); |
| 99670 | 99525 | inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); |
| 99671 | | - sqlite3ExprCachePop(pParse); |
| 99672 | 99526 | sqlite3VdbeJumpHere(v, addrINR); |
| 99673 | 99527 | sqlite3VdbeChangeP3(v, addrINR, inReg); |
| 99674 | 99528 | break; |
| 99675 | 99529 | } |
| 99676 | 99530 | |
| | @@ -99703,11 +99557,10 @@ |
| 99703 | 99557 | ExprList *pEList; /* List of WHEN terms */ |
| 99704 | 99558 | struct ExprList_item *aListelem; /* Array of WHEN terms */ |
| 99705 | 99559 | Expr opCompare; /* The X==Ei expression */ |
| 99706 | 99560 | Expr *pX; /* The X expression */ |
| 99707 | 99561 | Expr *pTest = 0; /* X==Ei (form A) or just Ei (form B) */ |
| 99708 | | - VVA_ONLY( int iCacheLevel = pParse->iCacheLevel; ) |
| 99709 | 99562 | |
| 99710 | 99563 | assert( !ExprHasProperty(pExpr, EP_xIsSelect) && pExpr->x.pList ); |
| 99711 | 99564 | assert(pExpr->x.pList->nExpr > 0); |
| 99712 | 99565 | pEList = pExpr->x.pList; |
| 99713 | 99566 | aListelem = pEList->a; |
| | @@ -99727,11 +99580,10 @@ |
| 99727 | 99580 | ** So make sure that the regFree1 register is not reused for other |
| 99728 | 99581 | ** purposes and possibly overwritten. */ |
| 99729 | 99582 | regFree1 = 0; |
| 99730 | 99583 | } |
| 99731 | 99584 | for(i=0; i<nExpr-1; i=i+2){ |
| 99732 | | - sqlite3ExprCachePush(pParse); |
| 99733 | 99585 | if( pX ){ |
| 99734 | 99586 | assert( pTest!=0 ); |
| 99735 | 99587 | opCompare.pRight = aListelem[i].pExpr; |
| 99736 | 99588 | }else{ |
| 99737 | 99589 | pTest = aListelem[i].pExpr; |
| | @@ -99740,22 +99592,17 @@ |
| 99740 | 99592 | testcase( pTest->op==TK_COLUMN ); |
| 99741 | 99593 | sqlite3ExprIfFalse(pParse, pTest, nextCase, SQLITE_JUMPIFNULL); |
| 99742 | 99594 | testcase( aListelem[i+1].pExpr->op==TK_COLUMN ); |
| 99743 | 99595 | sqlite3ExprCode(pParse, aListelem[i+1].pExpr, target); |
| 99744 | 99596 | sqlite3VdbeGoto(v, endLabel); |
| 99745 | | - sqlite3ExprCachePop(pParse); |
| 99746 | 99597 | sqlite3VdbeResolveLabel(v, nextCase); |
| 99747 | 99598 | } |
| 99748 | 99599 | if( (nExpr&1)!=0 ){ |
| 99749 | | - sqlite3ExprCachePush(pParse); |
| 99750 | 99600 | sqlite3ExprCode(pParse, pEList->a[nExpr-1].pExpr, target); |
| 99751 | | - sqlite3ExprCachePop(pParse); |
| 99752 | 99601 | }else{ |
| 99753 | 99602 | sqlite3VdbeAddOp2(v, OP_Null, 0, target); |
| 99754 | 99603 | } |
| 99755 | | - assert( pParse->db->mallocFailed || pParse->nErr>0 |
| 99756 | | - || pParse->iCacheLevel==iCacheLevel ); |
| 99757 | 99604 | sqlite3VdbeResolveLabel(v, endLabel); |
| 99758 | 99605 | break; |
| 99759 | 99606 | } |
| 99760 | 99607 | #ifndef SQLITE_OMIT_TRIGGER |
| 99761 | 99608 | case TK_RAISE: { |
| | @@ -99901,11 +99748,11 @@ |
| 99901 | 99748 | ** results in register target. The results are guaranteed to appear |
| 99902 | 99749 | ** in register target. If the expression is constant, then this routine |
| 99903 | 99750 | ** might choose to code the expression at initialization time. |
| 99904 | 99751 | */ |
| 99905 | 99752 | SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse *pParse, Expr *pExpr, int target){ |
| 99906 | | - if( pParse->okConstFactor && sqlite3ExprIsConstant(pExpr) ){ |
| 99753 | + if( pParse->okConstFactor && sqlite3ExprIsConstantNotJoin(pExpr) ){ |
| 99907 | 99754 | sqlite3ExprCodeAtInit(pParse, pExpr, target); |
| 99908 | 99755 | }else{ |
| 99909 | 99756 | sqlite3ExprCode(pParse, pExpr, target); |
| 99910 | 99757 | } |
| 99911 | 99758 | } |
| | @@ -99983,11 +99830,13 @@ |
| 99983 | 99830 | i--; |
| 99984 | 99831 | n--; |
| 99985 | 99832 | }else{ |
| 99986 | 99833 | sqlite3VdbeAddOp2(v, copyOp, j+srcReg-1, target+i); |
| 99987 | 99834 | } |
| 99988 | | - }else if( (flags & SQLITE_ECEL_FACTOR)!=0 && sqlite3ExprIsConstant(pExpr) ){ |
| 99835 | + }else if( (flags & SQLITE_ECEL_FACTOR)!=0 |
| 99836 | + && sqlite3ExprIsConstantNotJoin(pExpr) |
| 99837 | + ){ |
| 99989 | 99838 | sqlite3ExprCodeAtInit(pParse, pExpr, target+i); |
| 99990 | 99839 | }else{ |
| 99991 | 99840 | int inReg = sqlite3ExprCodeTarget(pParse, pExpr, target+i); |
| 99992 | 99841 | if( inReg!=target+i ){ |
| 99993 | 99842 | VdbeOp *pOp; |
| | @@ -100109,22 +99958,18 @@ |
| 100109 | 99958 | switch( op ){ |
| 100110 | 99959 | case TK_AND: { |
| 100111 | 99960 | int d2 = sqlite3VdbeMakeLabel(v); |
| 100112 | 99961 | testcase( jumpIfNull==0 ); |
| 100113 | 99962 | sqlite3ExprIfFalse(pParse, pExpr->pLeft, d2,jumpIfNull^SQLITE_JUMPIFNULL); |
| 100114 | | - sqlite3ExprCachePush(pParse); |
| 100115 | 99963 | sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); |
| 100116 | 99964 | sqlite3VdbeResolveLabel(v, d2); |
| 100117 | | - sqlite3ExprCachePop(pParse); |
| 100118 | 99965 | break; |
| 100119 | 99966 | } |
| 100120 | 99967 | case TK_OR: { |
| 100121 | 99968 | testcase( jumpIfNull==0 ); |
| 100122 | 99969 | sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); |
| 100123 | | - sqlite3ExprCachePush(pParse); |
| 100124 | 99970 | sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); |
| 100125 | | - sqlite3ExprCachePop(pParse); |
| 100126 | 99971 | break; |
| 100127 | 99972 | } |
| 100128 | 99973 | case TK_NOT: { |
| 100129 | 99974 | testcase( jumpIfNull==0 ); |
| 100130 | 99975 | sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); |
| | @@ -100279,23 +100124,19 @@ |
| 100279 | 100124 | |
| 100280 | 100125 | switch( pExpr->op ){ |
| 100281 | 100126 | case TK_AND: { |
| 100282 | 100127 | testcase( jumpIfNull==0 ); |
| 100283 | 100128 | sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); |
| 100284 | | - sqlite3ExprCachePush(pParse); |
| 100285 | 100129 | sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); |
| 100286 | | - sqlite3ExprCachePop(pParse); |
| 100287 | 100130 | break; |
| 100288 | 100131 | } |
| 100289 | 100132 | case TK_OR: { |
| 100290 | 100133 | int d2 = sqlite3VdbeMakeLabel(v); |
| 100291 | 100134 | testcase( jumpIfNull==0 ); |
| 100292 | 100135 | sqlite3ExprIfTrue(pParse, pExpr->pLeft, d2, jumpIfNull^SQLITE_JUMPIFNULL); |
| 100293 | | - sqlite3ExprCachePush(pParse); |
| 100294 | 100136 | sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); |
| 100295 | 100137 | sqlite3VdbeResolveLabel(v, d2); |
| 100296 | | - sqlite3ExprCachePop(pParse); |
| 100297 | 100138 | break; |
| 100298 | 100139 | } |
| 100299 | 100140 | case TK_NOT: { |
| 100300 | 100141 | testcase( jumpIfNull==0 ); |
| 100301 | 100142 | sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); |
| | @@ -100513,11 +100354,12 @@ |
| 100513 | 100354 | } |
| 100514 | 100355 | } |
| 100515 | 100356 | if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 2; |
| 100516 | 100357 | if( ALWAYS((combinedFlags & EP_TokenOnly)==0) ){ |
| 100517 | 100358 | if( combinedFlags & EP_xIsSelect ) return 2; |
| 100518 | | - if( sqlite3ExprCompare(pParse, pA->pLeft, pB->pLeft, iTab) ) return 2; |
| 100359 | + if( (combinedFlags & EP_FixedCol)==0 |
| 100360 | + && sqlite3ExprCompare(pParse, pA->pLeft, pB->pLeft, iTab) ) return 2; |
| 100519 | 100361 | if( sqlite3ExprCompare(pParse, pA->pRight, pB->pRight, iTab) ) return 2; |
| 100520 | 100362 | if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2; |
| 100521 | 100363 | assert( (combinedFlags & EP_Reduced)==0 ); |
| 100522 | 100364 | if( pA->op!=TK_STRING && pA->op!=TK_TRUEFALSE ){ |
| 100523 | 100365 | if( pA->iColumn!=pB->iColumn ) return 2; |
| | @@ -101058,25 +100900,13 @@ |
| 101058 | 100900 | } |
| 101059 | 100901 | |
| 101060 | 100902 | /* |
| 101061 | 100903 | ** Deallocate a register, making available for reuse for some other |
| 101062 | 100904 | ** purpose. |
| 101063 | | -** |
| 101064 | | -** If a register is currently being used by the column cache, then |
| 101065 | | -** the deallocation is deferred until the column cache line that uses |
| 101066 | | -** the register becomes stale. |
| 101067 | 100905 | */ |
| 101068 | 100906 | SQLITE_PRIVATE void sqlite3ReleaseTempReg(Parse *pParse, int iReg){ |
| 101069 | 100907 | if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){ |
| 101070 | | - int i; |
| 101071 | | - struct yColCache *p; |
| 101072 | | - for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){ |
| 101073 | | - if( p->iReg==iReg ){ |
| 101074 | | - p->tempReg = 1; |
| 101075 | | - return; |
| 101076 | | - } |
| 101077 | | - } |
| 101078 | 100908 | pParse->aTempReg[pParse->nTempReg++] = iReg; |
| 101079 | 100909 | } |
| 101080 | 100910 | } |
| 101081 | 100911 | |
| 101082 | 100912 | /* |
| | @@ -101086,11 +100916,10 @@ |
| 101086 | 100916 | int i, n; |
| 101087 | 100917 | if( nReg==1 ) return sqlite3GetTempReg(pParse); |
| 101088 | 100918 | i = pParse->iRangeReg; |
| 101089 | 100919 | n = pParse->nRangeReg; |
| 101090 | 100920 | if( nReg<=n ){ |
| 101091 | | - assert( !usedAsColumnCache(pParse, i, i+n-1) ); |
| 101092 | 100921 | pParse->iRangeReg += nReg; |
| 101093 | 100922 | pParse->nRangeReg -= nReg; |
| 101094 | 100923 | }else{ |
| 101095 | 100924 | i = pParse->nMem+1; |
| 101096 | 100925 | pParse->nMem += nReg; |
| | @@ -101100,11 +100929,10 @@ |
| 101100 | 100929 | SQLITE_PRIVATE void sqlite3ReleaseTempRange(Parse *pParse, int iReg, int nReg){ |
| 101101 | 100930 | if( nReg==1 ){ |
| 101102 | 100931 | sqlite3ReleaseTempReg(pParse, iReg); |
| 101103 | 100932 | return; |
| 101104 | 100933 | } |
| 101105 | | - sqlite3ExprCacheRemove(pParse, iReg, nReg); |
| 101106 | 100934 | if( nReg>pParse->nRangeReg ){ |
| 101107 | 100935 | pParse->nRangeReg = nReg; |
| 101108 | 100936 | pParse->iRangeReg = iReg; |
| 101109 | 100937 | } |
| 101110 | 100938 | } |
| | @@ -105020,11 +104848,10 @@ |
| 105020 | 104848 | |
| 105021 | 104849 | |
| 105022 | 104850 | /* Get the VDBE program ready for execution |
| 105023 | 104851 | */ |
| 105024 | 104852 | if( v && pParse->nErr==0 && !db->mallocFailed ){ |
| 105025 | | - assert( pParse->iCacheLevel==0 ); /* Disables and re-enables match */ |
| 105026 | 104853 | /* A minimum of one cursor is required if autoincrement is used |
| 105027 | 104854 | * See ticket [a696379c1f08866] */ |
| 105028 | 104855 | if( pParse->pAinc!=0 && pParse->nTab==0 ) pParse->nTab = 1; |
| 105029 | 104856 | sqlite3VdbeMakeReady(v, pParse); |
| 105030 | 104857 | pParse->rc = SQLITE_DONE; |
| | @@ -107457,12 +107284,14 @@ |
| 107457 | 107284 | ** on disk. |
| 107458 | 107285 | */ |
| 107459 | 107286 | v = sqlite3GetVdbe(pParse); |
| 107460 | 107287 | if( v ){ |
| 107461 | 107288 | sqlite3BeginWriteOperation(pParse, 1, iDb); |
| 107462 | | - sqlite3ClearStatTables(pParse, iDb, "tbl", pTab->zName); |
| 107463 | | - sqlite3FkDropTable(pParse, pName, pTab); |
| 107289 | + if( !isView ){ |
| 107290 | + sqlite3ClearStatTables(pParse, iDb, "tbl", pTab->zName); |
| 107291 | + sqlite3FkDropTable(pParse, pName, pTab); |
| 107292 | + } |
| 107464 | 107293 | sqlite3CodeDropTable(pParse, pTab, iDb, isView); |
| 107465 | 107294 | } |
| 107466 | 107295 | |
| 107467 | 107296 | exit_drop_table: |
| 107468 | 107297 | sqlite3SrcListDelete(db, pName); |
| | @@ -110279,13 +110108,12 @@ |
| 110279 | 110108 | sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, |
| 110280 | 110109 | pPk->aiColumn[i], iPk+i); |
| 110281 | 110110 | } |
| 110282 | 110111 | iKey = iPk; |
| 110283 | 110112 | }else{ |
| 110284 | | - iKey = pParse->nMem + 1; |
| 110285 | | - iKey = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iTabCur, iKey, 0); |
| 110286 | | - if( iKey>pParse->nMem ) pParse->nMem = iKey; |
| 110113 | + iKey = ++pParse->nMem; |
| 110114 | + sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, -1, iKey); |
| 110287 | 110115 | } |
| 110288 | 110116 | |
| 110289 | 110117 | if( eOnePass!=ONEPASS_OFF ){ |
| 110290 | 110118 | /* For ONEPASS, no need to store the rowid/primary-key. There is only |
| 110291 | 110119 | ** one, so just keep it in its register(s) and fall through to the |
| | @@ -110714,11 +110542,10 @@ |
| 110714 | 110542 | |
| 110715 | 110543 | if( piPartIdxLabel ){ |
| 110716 | 110544 | if( pIdx->pPartIdxWhere ){ |
| 110717 | 110545 | *piPartIdxLabel = sqlite3VdbeMakeLabel(v); |
| 110718 | 110546 | pParse->iSelfTab = iDataCur + 1; |
| 110719 | | - sqlite3ExprCachePush(pParse); |
| 110720 | 110547 | sqlite3ExprIfFalseDup(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, |
| 110721 | 110548 | SQLITE_JUMPIFNULL); |
| 110722 | 110549 | pParse->iSelfTab = 0; |
| 110723 | 110550 | }else{ |
| 110724 | 110551 | *piPartIdxLabel = 0; |
| | @@ -110761,11 +110588,10 @@ |
| 110761 | 110588 | ** resolve that label. |
| 110762 | 110589 | */ |
| 110763 | 110590 | SQLITE_PRIVATE void sqlite3ResolvePartIdxLabel(Parse *pParse, int iLabel){ |
| 110764 | 110591 | if( iLabel ){ |
| 110765 | 110592 | sqlite3VdbeResolveLabel(pParse->pVdbe, iLabel); |
| 110766 | | - sqlite3ExprCachePop(pParse); |
| 110767 | 110593 | } |
| 110768 | 110594 | } |
| 110769 | 110595 | |
| 110770 | 110596 | /************** End of delete.c **********************************************/ |
| 110771 | 110597 | /************** Begin file func.c ********************************************/ |
| | @@ -113500,15 +113326,16 @@ |
| 113500 | 113326 | ** the table from the database. Triggers are disabled while running this |
| 113501 | 113327 | ** DELETE, but foreign key actions are not. |
| 113502 | 113328 | */ |
| 113503 | 113329 | SQLITE_PRIVATE void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTab){ |
| 113504 | 113330 | sqlite3 *db = pParse->db; |
| 113505 | | - if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) && !pTab->pSelect ){ |
| 113331 | + if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) ){ |
| 113506 | 113332 | int iSkip = 0; |
| 113507 | 113333 | Vdbe *v = sqlite3GetVdbe(pParse); |
| 113508 | 113334 | |
| 113509 | 113335 | assert( v ); /* VDBE has already been allocated */ |
| 113336 | + assert( pTab->pSelect==0 ); /* Not a view */ |
| 113510 | 113337 | if( sqlite3FkReferences(pTab)==0 ){ |
| 113511 | 113338 | /* Search for a deferred foreign key constraint for which this table |
| 113512 | 113339 | ** is the child table. If one cannot be found, return without |
| 113513 | 113340 | ** generating any VDBE code. If one can be found, then jump over |
| 113514 | 113341 | ** the entire DELETE if there are no outstanding deferred constraints |
| | @@ -115399,48 +115226,10 @@ |
| 115399 | 115226 | testcase( w.eCode==CKCNSTRNT_ROWID ); |
| 115400 | 115227 | testcase( w.eCode==(CKCNSTRNT_ROWID|CKCNSTRNT_COLUMN) ); |
| 115401 | 115228 | return !w.eCode; |
| 115402 | 115229 | } |
| 115403 | 115230 | |
| 115404 | | -/* |
| 115405 | | -** An instance of the ConstraintAddr object remembers the byte-code addresses |
| 115406 | | -** for sections of the constraint checks that deal with uniqueness constraints |
| 115407 | | -** on the rowid and on the upsert constraint. |
| 115408 | | -** |
| 115409 | | -** This information is passed into checkReorderConstraintChecks() to insert |
| 115410 | | -** some OP_Goto operations so that the rowid and upsert constraints occur |
| 115411 | | -** in the correct order relative to other constraints. |
| 115412 | | -*/ |
| 115413 | | -typedef struct ConstraintAddr ConstraintAddr; |
| 115414 | | -struct ConstraintAddr { |
| 115415 | | - int ipkTop; /* Subroutine for rowid constraint check */ |
| 115416 | | - int upsertTop; /* Label for upsert constraint check subroutine */ |
| 115417 | | - int upsertTop2; /* Copy of upsertTop not cleared by the call */ |
| 115418 | | - int upsertBtm; /* upsert constraint returns to this label */ |
| 115419 | | - int ipkBtm; /* Return opcode rowid constraint check */ |
| 115420 | | -}; |
| 115421 | | - |
| 115422 | | -/* |
| 115423 | | -** Generate any OP_Goto operations needed to cause constraints to be |
| 115424 | | -** run that haven't already been run. |
| 115425 | | -*/ |
| 115426 | | -static void reorderConstraintChecks(Vdbe *v, ConstraintAddr *p){ |
| 115427 | | - if( p->upsertTop ){ |
| 115428 | | - testcase( sqlite3VdbeLabelHasBeenResolved(v, p->upsertTop) ); |
| 115429 | | - sqlite3VdbeGoto(v, p->upsertTop); |
| 115430 | | - VdbeComment((v, "call upsert subroutine")); |
| 115431 | | - sqlite3VdbeResolveLabel(v, p->upsertBtm); |
| 115432 | | - p->upsertTop = 0; |
| 115433 | | - } |
| 115434 | | - if( p->ipkTop ){ |
| 115435 | | - sqlite3VdbeGoto(v, p->ipkTop); |
| 115436 | | - VdbeComment((v, "call rowid unique-check subroutine")); |
| 115437 | | - sqlite3VdbeJumpHere(v, p->ipkBtm); |
| 115438 | | - p->ipkTop = 0; |
| 115439 | | - } |
| 115440 | | -} |
| 115441 | | - |
| 115442 | 115231 | /* |
| 115443 | 115232 | ** Generate code to do constraint checks prior to an INSERT or an UPDATE |
| 115444 | 115233 | ** on table pTab. |
| 115445 | 115234 | ** |
| 115446 | 115235 | ** The regNewData parameter is the first register in a range that contains |
| | @@ -115546,23 +115335,24 @@ |
| 115546 | 115335 | int nCol; /* Number of columns */ |
| 115547 | 115336 | int onError; /* Conflict resolution strategy */ |
| 115548 | 115337 | int addr1; /* Address of jump instruction */ |
| 115549 | 115338 | int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */ |
| 115550 | 115339 | int nPkField; /* Number of fields in PRIMARY KEY. 1 for ROWID tables */ |
| 115551 | | - ConstraintAddr sAddr;/* Address information for constraint reordering */ |
| 115552 | 115340 | Index *pUpIdx = 0; /* Index to which to apply the upsert */ |
| 115553 | 115341 | u8 isUpdate; /* True if this is an UPDATE operation */ |
| 115554 | 115342 | u8 bAffinityDone = 0; /* True if the OP_Affinity operation has been run */ |
| 115555 | 115343 | int upsertBypass = 0; /* Address of Goto to bypass upsert subroutine */ |
| 115344 | + int upsertJump = 0; /* Address of Goto that jumps into upsert subroutine */ |
| 115345 | + int ipkTop = 0; /* Top of the IPK uniqueness check */ |
| 115346 | + int ipkBottom = 0; /* OP_Goto at the end of the IPK uniqueness check */ |
| 115556 | 115347 | |
| 115557 | 115348 | isUpdate = regOldData!=0; |
| 115558 | 115349 | db = pParse->db; |
| 115559 | 115350 | v = sqlite3GetVdbe(pParse); |
| 115560 | 115351 | assert( v!=0 ); |
| 115561 | 115352 | assert( pTab->pSelect==0 ); /* This table is not a VIEW */ |
| 115562 | 115353 | nCol = pTab->nCol; |
| 115563 | | - memset(&sAddr, 0, sizeof(sAddr)); |
| 115564 | 115354 | |
| 115565 | 115355 | /* pPk is the PRIMARY KEY index for WITHOUT ROWID tables and NULL for |
| 115566 | 115356 | ** normal rowid tables. nPkField is the number of key fields in the |
| 115567 | 115357 | ** pPk index or 1 for a rowid table. In other words, nPkField is the |
| 115568 | 115358 | ** number of fields in the true primary key of the table. */ |
| | @@ -115662,19 +115452,24 @@ |
| 115662 | 115452 | #endif /* !defined(SQLITE_OMIT_CHECK) */ |
| 115663 | 115453 | |
| 115664 | 115454 | /* UNIQUE and PRIMARY KEY constraints should be handled in the following |
| 115665 | 115455 | ** order: |
| 115666 | 115456 | ** |
| 115667 | | - ** (1) OE_Abort, OE_Fail, OE_Rollback, OE_Ignore |
| 115668 | | - ** (2) OE_Update |
| 115457 | + ** (1) OE_Update |
| 115458 | + ** (2) OE_Abort, OE_Fail, OE_Rollback, OE_Ignore |
| 115669 | 115459 | ** (3) OE_Replace |
| 115670 | 115460 | ** |
| 115671 | 115461 | ** OE_Fail and OE_Ignore must happen before any changes are made. |
| 115672 | 115462 | ** OE_Update guarantees that only a single row will change, so it |
| 115673 | 115463 | ** must happen before OE_Replace. Technically, OE_Abort and OE_Rollback |
| 115674 | 115464 | ** could happen in any order, but they are grouped up front for |
| 115675 | 115465 | ** convenience. |
| 115466 | + ** |
| 115467 | + ** 2018-08-14: Ticket https://www.sqlite.org/src/info/908f001483982c43 |
| 115468 | + ** The order of constraints used to have OE_Update as (2) and OE_Abort |
| 115469 | + ** and so forth as (1). But apparently PostgreSQL checks the OE_Update |
| 115470 | + ** constraint before any others, so it had to be moved. |
| 115676 | 115471 | ** |
| 115677 | 115472 | ** Constraint checking code is generated in this order: |
| 115678 | 115473 | ** (A) The rowid constraint |
| 115679 | 115474 | ** (B) Unique index constraints that do not have OE_Replace as their |
| 115680 | 115475 | ** default conflict resolution strategy |
| | @@ -115691,15 +115486,14 @@ |
| 115691 | 115486 | ** Make all unique constraint resolution be OE_Ignore */ |
| 115692 | 115487 | assert( pUpsert->pUpsertSet==0 ); |
| 115693 | 115488 | overrideError = OE_Ignore; |
| 115694 | 115489 | pUpsert = 0; |
| 115695 | 115490 | }else if( (pUpIdx = pUpsert->pUpsertIdx)!=0 ){ |
| 115696 | | - /* If the constraint-target is on some column other than |
| 115697 | | - ** then ROWID, then we might need to move the UPSERT around |
| 115698 | | - ** so that it occurs in the correct order. */ |
| 115699 | | - sAddr.upsertTop = sAddr.upsertTop2 = sqlite3VdbeMakeLabel(v); |
| 115700 | | - sAddr.upsertBtm = sqlite3VdbeMakeLabel(v); |
| 115491 | + /* If the constraint-target uniqueness check must be run first. |
| 115492 | + ** Jump to that uniqueness check now */ |
| 115493 | + upsertJump = sqlite3VdbeAddOp0(v, OP_Goto); |
| 115494 | + VdbeComment((v, "UPSERT constraint goes first")); |
| 115701 | 115495 | } |
| 115702 | 115496 | } |
| 115703 | 115497 | |
| 115704 | 115498 | /* If rowid is changing, make sure the new rowid does not previously |
| 115705 | 115499 | ** exist in the table. |
| | @@ -115727,20 +115521,16 @@ |
| 115727 | 115521 | /* If the response to a rowid conflict is REPLACE but the response |
| 115728 | 115522 | ** to some other UNIQUE constraint is FAIL or IGNORE, then we need |
| 115729 | 115523 | ** to defer the running of the rowid conflict checking until after |
| 115730 | 115524 | ** the UNIQUE constraints have run. |
| 115731 | 115525 | */ |
| 115732 | | - assert( OE_Update>OE_Replace ); |
| 115733 | | - assert( OE_Ignore<OE_Replace ); |
| 115734 | | - assert( OE_Fail<OE_Replace ); |
| 115735 | | - assert( OE_Abort<OE_Replace ); |
| 115736 | | - assert( OE_Rollback<OE_Replace ); |
| 115737 | | - if( onError>=OE_Replace |
| 115738 | | - && (pUpsert || onError!=overrideError) |
| 115739 | | - && pTab->pIndex |
| 115526 | + if( onError==OE_Replace /* IPK rule is REPLACE */ |
| 115527 | + && onError!=overrideError /* Rules for other contraints are different */ |
| 115528 | + && pTab->pIndex /* There exist other constraints */ |
| 115740 | 115529 | ){ |
| 115741 | | - sAddr.ipkTop = sqlite3VdbeAddOp0(v, OP_Goto)+1; |
| 115530 | + ipkTop = sqlite3VdbeAddOp0(v, OP_Goto)+1; |
| 115531 | + VdbeComment((v, "defer IPK REPLACE until last")); |
| 115742 | 115532 | } |
| 115743 | 115533 | |
| 115744 | 115534 | if( isUpdate ){ |
| 115745 | 115535 | /* pkChng!=0 does not mean that the rowid has changed, only that |
| 115746 | 115536 | ** it might have changed. Skip the conflict logic below if the rowid |
| | @@ -115754,11 +115544,10 @@ |
| 115754 | 115544 | ** the following conflict logic if it does not. */ |
| 115755 | 115545 | VdbeNoopComment((v, "uniqueness check for ROWID")); |
| 115756 | 115546 | sqlite3VdbeVerifyAbortable(v, onError); |
| 115757 | 115547 | sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, addrRowidOk, regNewData); |
| 115758 | 115548 | VdbeCoverage(v); |
| 115759 | | - sqlite3ExprCachePush(pParse); |
| 115760 | 115549 | |
| 115761 | 115550 | switch( onError ){ |
| 115762 | 115551 | default: { |
| 115763 | 115552 | onError = OE_Abort; |
| 115764 | 115553 | /* Fall thru into the next case */ |
| | @@ -115831,15 +115620,14 @@ |
| 115831 | 115620 | testcase( onError==OE_Ignore ); |
| 115832 | 115621 | sqlite3VdbeGoto(v, ignoreDest); |
| 115833 | 115622 | break; |
| 115834 | 115623 | } |
| 115835 | 115624 | } |
| 115836 | | - sqlite3ExprCachePop(pParse); |
| 115837 | 115625 | sqlite3VdbeResolveLabel(v, addrRowidOk); |
| 115838 | | - if( sAddr.ipkTop ){ |
| 115839 | | - sAddr.ipkBtm = sqlite3VdbeAddOp0(v, OP_Goto); |
| 115840 | | - sqlite3VdbeJumpHere(v, sAddr.ipkTop-1); |
| 115626 | + if( ipkTop ){ |
| 115627 | + ipkBottom = sqlite3VdbeAddOp0(v, OP_Goto); |
| 115628 | + sqlite3VdbeJumpHere(v, ipkTop-1); |
| 115841 | 115629 | } |
| 115842 | 115630 | } |
| 115843 | 115631 | |
| 115844 | 115632 | /* Test all UNIQUE constraints by creating entries for each UNIQUE |
| 115845 | 115633 | ** index and making sure that duplicate entries do not already exist. |
| | @@ -115853,21 +115641,21 @@ |
| 115853 | 115641 | int regR; /* Range of registers holding conflicting PK */ |
| 115854 | 115642 | int iThisCur; /* Cursor for this UNIQUE index */ |
| 115855 | 115643 | int addrUniqueOk; /* Jump here if the UNIQUE constraint is satisfied */ |
| 115856 | 115644 | |
| 115857 | 115645 | if( aRegIdx[ix]==0 ) continue; /* Skip indices that do not change */ |
| 115858 | | - if( bAffinityDone==0 ){ |
| 115859 | | - sqlite3TableAffinity(v, pTab, regNewData+1); |
| 115860 | | - bAffinityDone = 1; |
| 115861 | | - } |
| 115862 | 115646 | if( pUpIdx==pIdx ){ |
| 115863 | | - addrUniqueOk = sAddr.upsertBtm; |
| 115647 | + addrUniqueOk = upsertJump+1; |
| 115864 | 115648 | upsertBypass = sqlite3VdbeGoto(v, 0); |
| 115865 | 115649 | VdbeComment((v, "Skip upsert subroutine")); |
| 115866 | | - sqlite3VdbeResolveLabel(v, sAddr.upsertTop2); |
| 115650 | + sqlite3VdbeJumpHere(v, upsertJump); |
| 115867 | 115651 | }else{ |
| 115868 | 115652 | addrUniqueOk = sqlite3VdbeMakeLabel(v); |
| 115653 | + } |
| 115654 | + if( bAffinityDone==0 && (pUpIdx==0 || pUpIdx==pIdx) ){ |
| 115655 | + sqlite3TableAffinity(v, pTab, regNewData+1); |
| 115656 | + bAffinityDone = 1; |
| 115869 | 115657 | } |
| 115870 | 115658 | VdbeNoopComment((v, "uniqueness check for %s", pIdx->zName)); |
| 115871 | 115659 | iThisCur = iIdxCur+ix; |
| 115872 | 115660 | |
| 115873 | 115661 | |
| | @@ -115936,19 +115724,10 @@ |
| 115936 | 115724 | }else{ |
| 115937 | 115725 | onError = OE_Update; /* DO UPDATE */ |
| 115938 | 115726 | } |
| 115939 | 115727 | } |
| 115940 | 115728 | |
| 115941 | | - /* Invoke subroutines to handle IPK replace and upsert prior to running |
| 115942 | | - ** the first REPLACE constraint check. */ |
| 115943 | | - if( onError==OE_Replace ){ |
| 115944 | | - testcase( sAddr.ipkTop ); |
| 115945 | | - testcase( sAddr.upsertTop |
| 115946 | | - && sqlite3VdbeLabelHasBeenResolved(v,sAddr.upsertTop) ); |
| 115947 | | - reorderConstraintChecks(v, &sAddr); |
| 115948 | | - } |
| 115949 | | - |
| 115950 | 115729 | /* Collision detection may be omitted if all of the following are true: |
| 115951 | 115730 | ** (1) The conflict resolution algorithm is REPLACE |
| 115952 | 115731 | ** (2) The table is a WITHOUT ROWID table |
| 115953 | 115732 | ** (3) There are no secondary indexes on the table |
| 115954 | 115733 | ** (4) No delete triggers need to be fired if there is a conflict |
| | @@ -115965,11 +115744,10 @@ |
| 115965 | 115744 | sqlite3VdbeResolveLabel(v, addrUniqueOk); |
| 115966 | 115745 | continue; |
| 115967 | 115746 | } |
| 115968 | 115747 | |
| 115969 | 115748 | /* Check to see if the new index entry will be unique */ |
| 115970 | | - sqlite3ExprCachePush(pParse); |
| 115971 | 115749 | sqlite3VdbeVerifyAbortable(v, onError); |
| 115972 | 115750 | sqlite3VdbeAddOp4Int(v, OP_NoConflict, iThisCur, addrUniqueOk, |
| 115973 | 115751 | regIdx, pIdx->nKeyCol); VdbeCoverage(v); |
| 115974 | 115752 | |
| 115975 | 115753 | /* Generate code to handle collisions */ |
| | @@ -116067,23 +115845,25 @@ |
| 116067 | 115845 | seenReplace = 1; |
| 116068 | 115846 | break; |
| 116069 | 115847 | } |
| 116070 | 115848 | } |
| 116071 | 115849 | if( pUpIdx==pIdx ){ |
| 115850 | + sqlite3VdbeGoto(v, upsertJump+1); |
| 116072 | 115851 | sqlite3VdbeJumpHere(v, upsertBypass); |
| 116073 | 115852 | }else{ |
| 116074 | 115853 | sqlite3VdbeResolveLabel(v, addrUniqueOk); |
| 116075 | 115854 | } |
| 116076 | | - sqlite3ExprCachePop(pParse); |
| 116077 | 115855 | if( regR!=regIdx ) sqlite3ReleaseTempRange(pParse, regR, nPkField); |
| 115856 | + } |
| 116078 | 115857 | |
| 115858 | + /* If the IPK constraint is a REPLACE, run it last */ |
| 115859 | + if( ipkTop ){ |
| 115860 | + sqlite3VdbeGoto(v, ipkTop+1); |
| 115861 | + VdbeComment((v, "Do IPK REPLACE")); |
| 115862 | + sqlite3VdbeJumpHere(v, ipkBottom); |
| 116079 | 115863 | } |
| 116080 | | - testcase( sAddr.ipkTop!=0 ); |
| 116081 | | - testcase( sAddr.upsertTop |
| 116082 | | - && sqlite3VdbeLabelHasBeenResolved(v,sAddr.upsertTop) ); |
| 116083 | | - reorderConstraintChecks(v, &sAddr); |
| 116084 | | - |
| 115864 | + |
| 116085 | 115865 | *pbMayReplace = seenReplace; |
| 116086 | 115866 | VdbeModuleComment((v, "END: GenCnstCks(%d)", seenReplace)); |
| 116087 | 115867 | } |
| 116088 | 115868 | |
| 116089 | 115869 | #ifdef SQLITE_ENABLE_NULL_TRIM |
| | @@ -116175,11 +115955,10 @@ |
| 116175 | 115955 | regRec = sqlite3GetTempReg(pParse); |
| 116176 | 115956 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regData, pTab->nCol, regRec); |
| 116177 | 115957 | sqlite3SetMakeRecordP5(v, pTab); |
| 116178 | 115958 | if( !bAffinityDone ){ |
| 116179 | 115959 | sqlite3TableAffinity(v, pTab, 0); |
| 116180 | | - sqlite3ExprCacheAffinityChange(pParse, regData, pTab->nCol); |
| 116181 | 115960 | } |
| 116182 | 115961 | if( pParse->nested ){ |
| 116183 | 115962 | pik_flags = 0; |
| 116184 | 115963 | }else{ |
| 116185 | 115964 | pik_flags = OPFLAG_NCHANGE; |
| | @@ -120462,11 +120241,10 @@ |
| 120462 | 120241 | int iDataCur, iIdxCur; |
| 120463 | 120242 | int r1 = -1; |
| 120464 | 120243 | |
| 120465 | 120244 | if( pTab->tnum<1 ) continue; /* Skip VIEWs or VIRTUAL TABLEs */ |
| 120466 | 120245 | pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); |
| 120467 | | - sqlite3ExprCacheClear(pParse); |
| 120468 | 120246 | sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenRead, 0, |
| 120469 | 120247 | 1, 0, &iDataCur, &iIdxCur); |
| 120470 | 120248 | /* reg[7] counts the number of entries in the table. |
| 120471 | 120249 | ** reg[8+i] counts the number of entries in the i-th index |
| 120472 | 120250 | */ |
| | @@ -120505,11 +120283,10 @@ |
| 120505 | 120283 | int addrCkFault = sqlite3VdbeMakeLabel(v); |
| 120506 | 120284 | int addrCkOk = sqlite3VdbeMakeLabel(v); |
| 120507 | 120285 | char *zErr; |
| 120508 | 120286 | int k; |
| 120509 | 120287 | pParse->iSelfTab = iDataCur + 1; |
| 120510 | | - sqlite3ExprCachePush(pParse); |
| 120511 | 120288 | for(k=pCheck->nExpr-1; k>0; k--){ |
| 120512 | 120289 | sqlite3ExprIfFalse(pParse, pCheck->a[k].pExpr, addrCkFault, 0); |
| 120513 | 120290 | } |
| 120514 | 120291 | sqlite3ExprIfTrue(pParse, pCheck->a[0].pExpr, addrCkOk, |
| 120515 | 120292 | SQLITE_JUMPIFNULL); |
| | @@ -120518,11 +120295,10 @@ |
| 120518 | 120295 | zErr = sqlite3MPrintf(db, "CHECK constraint failed in %s", |
| 120519 | 120296 | pTab->zName); |
| 120520 | 120297 | sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, zErr, P4_DYNAMIC); |
| 120521 | 120298 | integrityCheckResultRow(v); |
| 120522 | 120299 | sqlite3VdbeResolveLabel(v, addrCkOk); |
| 120523 | | - sqlite3ExprCachePop(pParse); |
| 120524 | 120300 | } |
| 120525 | 120301 | sqlite3ExprListDelete(db, pCheck); |
| 120526 | 120302 | } |
| 120527 | 120303 | if( !isQuick ){ /* Omit the remaining tests for quick_check */ |
| 120528 | 120304 | /* Validate index entries for the current row */ |
| | @@ -123463,11 +123239,10 @@ |
| 123463 | 123239 | }else{ |
| 123464 | 123240 | int r1 = sqlite3GetTempReg(pParse); |
| 123465 | 123241 | assert( sqlite3Strlen30(pDest->zAffSdst)==nResultCol ); |
| 123466 | 123242 | sqlite3VdbeAddOp4(v, OP_MakeRecord, regResult, nResultCol, |
| 123467 | 123243 | r1, pDest->zAffSdst, nResultCol); |
| 123468 | | - sqlite3ExprCacheAffinityChange(pParse, regResult, nResultCol); |
| 123469 | 123244 | sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iParm, r1, regResult, nResultCol); |
| 123470 | 123245 | sqlite3ReleaseTempReg(pParse, r1); |
| 123471 | 123246 | } |
| 123472 | 123247 | break; |
| 123473 | 123248 | } |
| | @@ -123507,11 +123282,10 @@ |
| 123507 | 123282 | nPrefixReg); |
| 123508 | 123283 | }else if( eDest==SRT_Coroutine ){ |
| 123509 | 123284 | sqlite3VdbeAddOp1(v, OP_Yield, pDest->iSDParm); |
| 123510 | 123285 | }else{ |
| 123511 | 123286 | sqlite3VdbeAddOp2(v, OP_ResultRow, regResult, nResultCol); |
| 123512 | | - sqlite3ExprCacheAffinityChange(pParse, regResult, nResultCol); |
| 123513 | 123287 | } |
| 123514 | 123288 | break; |
| 123515 | 123289 | } |
| 123516 | 123290 | |
| 123517 | 123291 | #ifndef SQLITE_OMIT_CTE |
| | @@ -123864,11 +123638,10 @@ |
| 123864 | 123638 | #ifndef SQLITE_OMIT_SUBQUERY |
| 123865 | 123639 | case SRT_Set: { |
| 123866 | 123640 | assert( nColumn==sqlite3Strlen30(pDest->zAffSdst) ); |
| 123867 | 123641 | sqlite3VdbeAddOp4(v, OP_MakeRecord, regRow, nColumn, regRowid, |
| 123868 | 123642 | pDest->zAffSdst, nColumn); |
| 123869 | | - sqlite3ExprCacheAffinityChange(pParse, regRow, nColumn); |
| 123870 | 123643 | sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iParm, regRowid, regRow, nColumn); |
| 123871 | 123644 | break; |
| 123872 | 123645 | } |
| 123873 | 123646 | case SRT_Mem: { |
| 123874 | 123647 | /* The LIMIT clause will terminate the loop for us */ |
| | @@ -123879,11 +123652,10 @@ |
| 123879 | 123652 | assert( eDest==SRT_Output || eDest==SRT_Coroutine ); |
| 123880 | 123653 | testcase( eDest==SRT_Output ); |
| 123881 | 123654 | testcase( eDest==SRT_Coroutine ); |
| 123882 | 123655 | if( eDest==SRT_Output ){ |
| 123883 | 123656 | sqlite3VdbeAddOp2(v, OP_ResultRow, pDest->iSdst, nColumn); |
| 123884 | | - sqlite3ExprCacheAffinityChange(pParse, pDest->iSdst, nColumn); |
| 123885 | 123657 | }else{ |
| 123886 | 123658 | sqlite3VdbeAddOp1(v, OP_Yield, pDest->iSDParm); |
| 123887 | 123659 | } |
| 123888 | 123660 | break; |
| 123889 | 123661 | } |
| | @@ -124480,11 +124252,10 @@ |
| 124480 | 124252 | ** "LIMIT -1" always shows all rows. There is some |
| 124481 | 124253 | ** controversy about what the correct behavior should be. |
| 124482 | 124254 | ** The current implementation interprets "LIMIT 0" to mean |
| 124483 | 124255 | ** no rows. |
| 124484 | 124256 | */ |
| 124485 | | - sqlite3ExprCacheClear(pParse); |
| 124486 | 124257 | if( pLimit ){ |
| 124487 | 124258 | assert( pLimit->op==TK_LIMIT ); |
| 124488 | 124259 | assert( pLimit->pLeft!=0 ); |
| 124489 | 124260 | p->iLimit = iLimit = ++pParse->nMem; |
| 124490 | 124261 | v = sqlite3GetVdbe(pParse); |
| | @@ -125266,11 +125037,10 @@ |
| 125266 | 125037 | int r1; |
| 125267 | 125038 | testcase( pIn->nSdst>1 ); |
| 125268 | 125039 | r1 = sqlite3GetTempReg(pParse); |
| 125269 | 125040 | sqlite3VdbeAddOp4(v, OP_MakeRecord, pIn->iSdst, pIn->nSdst, |
| 125270 | 125041 | r1, pDest->zAffSdst, pIn->nSdst); |
| 125271 | | - sqlite3ExprCacheAffinityChange(pParse, pIn->iSdst, pIn->nSdst); |
| 125272 | 125042 | sqlite3VdbeAddOp4Int(v, OP_IdxInsert, pDest->iSDParm, r1, |
| 125273 | 125043 | pIn->iSdst, pIn->nSdst); |
| 125274 | 125044 | sqlite3ReleaseTempReg(pParse, r1); |
| 125275 | 125045 | break; |
| 125276 | 125046 | } |
| | @@ -125309,11 +125079,10 @@ |
| 125309 | 125079 | ** return the next row of result. |
| 125310 | 125080 | */ |
| 125311 | 125081 | default: { |
| 125312 | 125082 | assert( pDest->eDest==SRT_Output ); |
| 125313 | 125083 | sqlite3VdbeAddOp2(v, OP_ResultRow, pIn->iSdst, pIn->nSdst); |
| 125314 | | - sqlite3ExprCacheAffinityChange(pParse, pIn->iSdst, pIn->nSdst); |
| 125315 | 125084 | break; |
| 125316 | 125085 | } |
| 125317 | 125086 | } |
| 125318 | 125087 | |
| 125319 | 125088 | /* Jump to the end of the loop if the LIMIT is reached. |
| | @@ -125764,11 +125533,11 @@ |
| 125764 | 125533 | }else{ |
| 125765 | 125534 | Expr *pNew; |
| 125766 | 125535 | Expr *pCopy = pSubst->pEList->a[pExpr->iColumn].pExpr; |
| 125767 | 125536 | Expr ifNullRow; |
| 125768 | 125537 | assert( pSubst->pEList!=0 && pExpr->iColumn<pSubst->pEList->nExpr ); |
| 125769 | | - assert( pExpr->pLeft==0 && pExpr->pRight==0 ); |
| 125538 | + assert( pExpr->pRight==0 ); |
| 125770 | 125539 | if( sqlite3ExprIsVector(pCopy) ){ |
| 125771 | 125540 | sqlite3VectorErrorMsg(pSubst->pParse, pCopy); |
| 125772 | 125541 | }else{ |
| 125773 | 125542 | sqlite3 *db = pSubst->pParse->db; |
| 125774 | 125543 | if( pSubst->isLeftJoin && pCopy->op!=TK_COLUMN ){ |
| | @@ -126388,11 +126157,172 @@ |
| 126388 | 126157 | |
| 126389 | 126158 | return 1; |
| 126390 | 126159 | } |
| 126391 | 126160 | #endif /* !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) */ |
| 126392 | 126161 | |
| 126162 | +/* |
| 126163 | +** A structure to keep track of all of the column values that fixed to |
| 126164 | +** a known value due to WHERE clause constraints of the form COLUMN=VALUE. |
| 126165 | +*/ |
| 126166 | +typedef struct WhereConst WhereConst; |
| 126167 | +struct WhereConst { |
| 126168 | + Parse *pParse; /* Parsing context */ |
| 126169 | + int nConst; /* Number for COLUMN=CONSTANT terms */ |
| 126170 | + int nChng; /* Number of times a constant is propagated */ |
| 126171 | + Expr **apExpr; /* [i*2] is COLUMN and [i*2+1] is VALUE */ |
| 126172 | +}; |
| 126393 | 126173 | |
| 126174 | +/* |
| 126175 | +** Add a new entry to the pConst object |
| 126176 | +*/ |
| 126177 | +static void constInsert( |
| 126178 | + WhereConst *pConst, |
| 126179 | + Expr *pColumn, |
| 126180 | + Expr *pValue |
| 126181 | +){ |
| 126182 | + |
| 126183 | + pConst->nConst++; |
| 126184 | + pConst->apExpr = sqlite3DbReallocOrFree(pConst->pParse->db, pConst->apExpr, |
| 126185 | + pConst->nConst*2*sizeof(Expr*)); |
| 126186 | + if( pConst->apExpr==0 ){ |
| 126187 | + pConst->nConst = 0; |
| 126188 | + }else{ |
| 126189 | + if( ExprHasProperty(pValue, EP_FixedCol) ) pValue = pValue->pLeft; |
| 126190 | + pConst->apExpr[pConst->nConst*2-2] = pColumn; |
| 126191 | + pConst->apExpr[pConst->nConst*2-1] = pValue; |
| 126192 | + } |
| 126193 | +} |
| 126194 | + |
| 126195 | +/* |
| 126196 | +** Find all terms of COLUMN=VALUE or VALUE=COLUMN in pExpr where VALUE |
| 126197 | +** is a constant expression and where the term must be true because it |
| 126198 | +** is part of the AND-connected terms of the expression. For each term |
| 126199 | +** found, add it to the pConst structure. |
| 126200 | +*/ |
| 126201 | +static void findConstInWhere(WhereConst *pConst, Expr *pExpr){ |
| 126202 | + Expr *pRight, *pLeft; |
| 126203 | + if( pExpr==0 ) return; |
| 126204 | + if( ExprHasProperty(pExpr, EP_FromJoin) ) return; |
| 126205 | + if( pExpr->op==TK_AND ){ |
| 126206 | + findConstInWhere(pConst, pExpr->pRight); |
| 126207 | + findConstInWhere(pConst, pExpr->pLeft); |
| 126208 | + return; |
| 126209 | + } |
| 126210 | + if( pExpr->op!=TK_EQ ) return; |
| 126211 | + pRight = pExpr->pRight; |
| 126212 | + pLeft = pExpr->pLeft; |
| 126213 | + assert( pRight!=0 ); |
| 126214 | + assert( pLeft!=0 ); |
| 126215 | + if( pRight->op==TK_COLUMN |
| 126216 | + && !ExprHasProperty(pRight, EP_FixedCol) |
| 126217 | + && sqlite3ExprIsConstant(pLeft) |
| 126218 | + && sqlite3IsBinary(sqlite3BinaryCompareCollSeq(pConst->pParse,pLeft,pRight)) |
| 126219 | + ){ |
| 126220 | + constInsert(pConst, pRight, pLeft); |
| 126221 | + }else |
| 126222 | + if( pLeft->op==TK_COLUMN |
| 126223 | + && !ExprHasProperty(pLeft, EP_FixedCol) |
| 126224 | + && sqlite3ExprIsConstant(pRight) |
| 126225 | + && sqlite3IsBinary(sqlite3BinaryCompareCollSeq(pConst->pParse,pLeft,pRight)) |
| 126226 | + ){ |
| 126227 | + constInsert(pConst, pLeft, pRight); |
| 126228 | + } |
| 126229 | +} |
| 126230 | + |
| 126231 | +/* |
| 126232 | +** This is a Walker expression callback. pExpr is a candidate expression |
| 126233 | +** to be replaced by a value. If pExpr is equivalent to one of the |
| 126234 | +** columns named in pWalker->u.pConst, then overwrite it with its |
| 126235 | +** corresponding value. |
| 126236 | +*/ |
| 126237 | +static int propagateConstantExprRewrite(Walker *pWalker, Expr *pExpr){ |
| 126238 | + int i; |
| 126239 | + WhereConst *pConst; |
| 126240 | + if( pExpr->op!=TK_COLUMN ) return WRC_Continue; |
| 126241 | + if( ExprHasProperty(pExpr, EP_FixedCol) ) return WRC_Continue; |
| 126242 | + pConst = pWalker->u.pConst; |
| 126243 | + for(i=0; i<pConst->nConst; i++){ |
| 126244 | + Expr *pColumn = pConst->apExpr[i*2]; |
| 126245 | + if( pColumn==pExpr ) continue; |
| 126246 | + if( pColumn->iTable!=pExpr->iTable ) continue; |
| 126247 | + if( pColumn->iColumn!=pExpr->iColumn ) continue; |
| 126248 | + /* A match is found. Add the EP_FixedCol property */ |
| 126249 | + pConst->nChng++; |
| 126250 | + ExprClearProperty(pExpr, EP_Leaf); |
| 126251 | + ExprSetProperty(pExpr, EP_FixedCol); |
| 126252 | + assert( pExpr->pLeft==0 ); |
| 126253 | + pExpr->pLeft = sqlite3ExprDup(pConst->pParse->db, pConst->apExpr[i*2+1], 0); |
| 126254 | + break; |
| 126255 | + } |
| 126256 | + return WRC_Prune; |
| 126257 | +} |
| 126258 | + |
| 126259 | +/* |
| 126260 | +** The WHERE-clause constant propagation optimization. |
| 126261 | +** |
| 126262 | +** If the WHERE clause contains terms of the form COLUMN=CONSTANT or |
| 126263 | +** CONSTANT=COLUMN that must be tree (in other words, if the terms top-level |
| 126264 | +** AND-connected terms that are not part of a ON clause from a LEFT JOIN) |
| 126265 | +** then throughout the query replace all other occurrences of COLUMN |
| 126266 | +** with CONSTANT within the WHERE clause. |
| 126267 | +** |
| 126268 | +** For example, the query: |
| 126269 | +** |
| 126270 | +** SELECT * FROM t1, t2, t3 WHERE t1.a=39 AND t2.b=t1.a AND t3.c=t2.b |
| 126271 | +** |
| 126272 | +** Is transformed into |
| 126273 | +** |
| 126274 | +** SELECT * FROM t1, t2, t3 WHERE t1.a=39 AND t2.b=39 AND t3.c=39 |
| 126275 | +** |
| 126276 | +** Return true if any transformations where made and false if not. |
| 126277 | +** |
| 126278 | +** Implementation note: Constant propagation is tricky due to affinity |
| 126279 | +** and collating sequence interactions. Consider this example: |
| 126280 | +** |
| 126281 | +** CREATE TABLE t1(a INT,b TEXT); |
| 126282 | +** INSERT INTO t1 VALUES(123,'0123'); |
| 126283 | +** SELECT * FROM t1 WHERE a=123 AND b=a; |
| 126284 | +** SELECT * FROM t1 WHERE a=123 AND b=123; |
| 126285 | +** |
| 126286 | +** The two SELECT statements above should return different answers. b=a |
| 126287 | +** is alway true because the comparison uses numeric affinity, but b=123 |
| 126288 | +** is false because it uses text affinity and '0123' is not the same as '123'. |
| 126289 | +** To work around this, the expression tree is not actually changed from |
| 126290 | +** "b=a" to "b=123" but rather the "a" in "b=a" is tagged with EP_FixedCol |
| 126291 | +** and the "123" value is hung off of the pLeft pointer. Code generator |
| 126292 | +** routines know to generate the constant "123" instead of looking up the |
| 126293 | +** column value. Also, to avoid collation problems, this optimization is |
| 126294 | +** only attempted if the "a=123" term uses the default BINARY collation. |
| 126295 | +*/ |
| 126296 | +static int propagateConstants( |
| 126297 | + Parse *pParse, /* The parsing context */ |
| 126298 | + Select *p /* The query in which to propagate constants */ |
| 126299 | +){ |
| 126300 | + WhereConst x; |
| 126301 | + Walker w; |
| 126302 | + int nChng = 0; |
| 126303 | + x.pParse = pParse; |
| 126304 | + do{ |
| 126305 | + x.nConst = 0; |
| 126306 | + x.nChng = 0; |
| 126307 | + x.apExpr = 0; |
| 126308 | + findConstInWhere(&x, p->pWhere); |
| 126309 | + if( x.nConst ){ |
| 126310 | + memset(&w, 0, sizeof(w)); |
| 126311 | + w.pParse = pParse; |
| 126312 | + w.xExprCallback = propagateConstantExprRewrite; |
| 126313 | + w.xSelectCallback = sqlite3SelectWalkNoop; |
| 126314 | + w.xSelectCallback2 = 0; |
| 126315 | + w.walkerDepth = 0; |
| 126316 | + w.u.pConst = &x; |
| 126317 | + sqlite3WalkExpr(&w, p->pWhere); |
| 126318 | + sqlite3DbFree(x.pParse->db, x.apExpr); |
| 126319 | + nChng += x.nChng; |
| 126320 | + } |
| 126321 | + }while( x.nChng ); |
| 126322 | + return nChng; |
| 126323 | +} |
| 126394 | 126324 | |
| 126395 | 126325 | #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) |
| 126396 | 126326 | /* |
| 126397 | 126327 | ** Make copies of relevant WHERE clause terms of the outer query into |
| 126398 | 126328 | ** the WHERE clause of subquery. Example: |
| | @@ -127489,40 +127419,25 @@ |
| 127489 | 127419 | sqlite3VdbeAddOp4(v, OP_CollSeq, regHit, 0, 0, (char *)pColl, P4_COLLSEQ); |
| 127490 | 127420 | } |
| 127491 | 127421 | sqlite3VdbeAddOp3(v, OP_AggStep, 0, regAgg, pF->iMem); |
| 127492 | 127422 | sqlite3VdbeAppendP4(v, pF->pFunc, P4_FUNCDEF); |
| 127493 | 127423 | sqlite3VdbeChangeP5(v, (u8)nArg); |
| 127494 | | - sqlite3ExprCacheAffinityChange(pParse, regAgg, nArg); |
| 127495 | 127424 | sqlite3ReleaseTempRange(pParse, regAgg, nArg); |
| 127496 | 127425 | if( addrNext ){ |
| 127497 | 127426 | sqlite3VdbeResolveLabel(v, addrNext); |
| 127498 | | - sqlite3ExprCacheClear(pParse); |
| 127499 | 127427 | } |
| 127500 | 127428 | } |
| 127501 | | - |
| 127502 | | - /* Before populating the accumulator registers, clear the column cache. |
| 127503 | | - ** Otherwise, if any of the required column values are already present |
| 127504 | | - ** in registers, sqlite3ExprCode() may use OP_SCopy to copy the value |
| 127505 | | - ** to pC->iMem. But by the time the value is used, the original register |
| 127506 | | - ** may have been used, invalidating the underlying buffer holding the |
| 127507 | | - ** text or blob value. See ticket [883034dcb5]. |
| 127508 | | - ** |
| 127509 | | - ** Another solution would be to change the OP_SCopy used to copy cached |
| 127510 | | - ** values to an OP_Copy. |
| 127511 | | - */ |
| 127512 | 127429 | if( regHit==0 && pAggInfo->nAccumulator ){ |
| 127513 | 127430 | regHit = regAcc; |
| 127514 | 127431 | } |
| 127515 | 127432 | if( regHit ){ |
| 127516 | 127433 | addrHitTest = sqlite3VdbeAddOp1(v, OP_If, regHit); VdbeCoverage(v); |
| 127517 | 127434 | } |
| 127518 | | - sqlite3ExprCacheClear(pParse); |
| 127519 | 127435 | for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){ |
| 127520 | 127436 | sqlite3ExprCode(pParse, pC->pExpr, pC->iMem); |
| 127521 | 127437 | } |
| 127522 | 127438 | pAggInfo->directMode = 0; |
| 127523 | | - sqlite3ExprCacheClear(pParse); |
| 127524 | 127439 | if( addrHitTest ){ |
| 127525 | 127440 | sqlite3VdbeJumpHere(v, addrHitTest); |
| 127526 | 127441 | } |
| 127527 | 127442 | } |
| 127528 | 127443 | |
| | @@ -127648,10 +127563,11 @@ |
| 127648 | 127563 | ** SELECT (SELECT count(*) FROM t1)+(SELECT count(*) FROM t2) |
| 127649 | 127564 | ** |
| 127650 | 127565 | ** The transformation only works if all of the following are true: |
| 127651 | 127566 | ** |
| 127652 | 127567 | ** * The subquery is a UNION ALL of two or more terms |
| 127568 | +** * The subquery does not have a LIMIT clause |
| 127653 | 127569 | ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries |
| 127654 | 127570 | ** * The outer query is a simple count(*) |
| 127655 | 127571 | ** |
| 127656 | 127572 | ** Return TRUE if the optimization is undertaken. |
| 127657 | 127573 | */ |
| | @@ -127671,10 +127587,11 @@ |
| 127671 | 127587 | if( pSub==0 ) return 0; /* The FROM is a subquery */ |
| 127672 | 127588 | if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */ |
| 127673 | 127589 | do{ |
| 127674 | 127590 | if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */ |
| 127675 | 127591 | if( pSub->pWhere ) return 0; /* No WHERE clause */ |
| 127592 | + if( pSub->pLimit ) return 0; /* No LIMIT clause */ |
| 127676 | 127593 | if( pSub->selFlags & SF_Aggregate ) return 0; /* Not an aggregate */ |
| 127677 | 127594 | pSub = pSub->pPrior; /* Repeat over compound */ |
| 127678 | 127595 | }while( pSub ); |
| 127679 | 127596 | |
| 127680 | 127597 | /* If we reach this point then it is OK to perform the transformation */ |
| | @@ -127912,10 +127829,39 @@ |
| 127912 | 127829 | #endif |
| 127913 | 127830 | if( p->pNext==0 ) ExplainQueryPlanPop(pParse); |
| 127914 | 127831 | return rc; |
| 127915 | 127832 | } |
| 127916 | 127833 | #endif |
| 127834 | + |
| 127835 | + /* Do the WHERE-clause constant propagation optimization if this is |
| 127836 | + ** a join. No need to speed time on this operation for non-join queries |
| 127837 | + ** as the equivalent optimization will be handled by query planner in |
| 127838 | + ** sqlite3WhereBegin(). |
| 127839 | + */ |
| 127840 | + if( pTabList->nSrc>1 |
| 127841 | + && OptimizationEnabled(db, SQLITE_PropagateConst) |
| 127842 | + && propagateConstants(pParse, p) |
| 127843 | + ){ |
| 127844 | +#if SELECTTRACE_ENABLED |
| 127845 | + if( sqlite3SelectTrace & 0x100 ){ |
| 127846 | + SELECTTRACE(0x100,pParse,p,("After constant propagation:\n")); |
| 127847 | + sqlite3TreeViewSelect(0, p, 0); |
| 127848 | + } |
| 127849 | +#endif |
| 127850 | + }else{ |
| 127851 | + SELECTTRACE(0x100,pParse,p,("Constant propagation not helpful\n")); |
| 127852 | + } |
| 127853 | + |
| 127854 | +#ifdef SQLITE_COUNTOFVIEW_OPTIMIZATION |
| 127855 | + if( OptimizationEnabled(db, SQLITE_QueryFlattener|SQLITE_CountOfView) |
| 127856 | + && countOfViewOptimization(pParse, p) |
| 127857 | + ){ |
| 127858 | + if( db->mallocFailed ) goto select_end; |
| 127859 | + pEList = p->pEList; |
| 127860 | + pTabList = p->pSrc; |
| 127861 | + } |
| 127862 | +#endif |
| 127917 | 127863 | |
| 127918 | 127864 | /* For each term in the FROM clause, do two things: |
| 127919 | 127865 | ** (1) Authorized unreferenced tables |
| 127920 | 127866 | ** (2) Generate code for all sub-queries |
| 127921 | 127867 | */ |
| | @@ -127986,11 +127932,12 @@ |
| 127986 | 127932 | && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor, |
| 127987 | 127933 | (pItem->fg.jointype & JT_OUTER)!=0) |
| 127988 | 127934 | ){ |
| 127989 | 127935 | #if SELECTTRACE_ENABLED |
| 127990 | 127936 | if( sqlite3SelectTrace & 0x100 ){ |
| 127991 | | - SELECTTRACE(0x100,pParse,p,("After WHERE-clause push-down:\n")); |
| 127937 | + SELECTTRACE(0x100,pParse,p, |
| 127938 | + ("After WHERE-clause push-down into subquery %d:\n", pSub->selId)); |
| 127992 | 127939 | sqlite3TreeViewSelect(0, p, 0); |
| 127993 | 127940 | } |
| 127994 | 127941 | #endif |
| 127995 | 127942 | }else{ |
| 127996 | 127943 | SELECTTRACE(0x100,pParse,p,("Push-down not possible\n")); |
| | @@ -128088,20 +128035,10 @@ |
| 128088 | 128035 | #if SELECTTRACE_ENABLED |
| 128089 | 128036 | if( sqlite3SelectTrace & 0x400 ){ |
| 128090 | 128037 | SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n")); |
| 128091 | 128038 | sqlite3TreeViewSelect(0, p, 0); |
| 128092 | 128039 | } |
| 128093 | | -#endif |
| 128094 | | - |
| 128095 | | -#ifdef SQLITE_COUNTOFVIEW_OPTIMIZATION |
| 128096 | | - if( OptimizationEnabled(db, SQLITE_QueryFlattener|SQLITE_CountOfView) |
| 128097 | | - && countOfViewOptimization(pParse, p) |
| 128098 | | - ){ |
| 128099 | | - if( db->mallocFailed ) goto select_end; |
| 128100 | | - pEList = p->pEList; |
| 128101 | | - pTabList = p->pSrc; |
| 128102 | | - } |
| 128103 | 128040 | #endif |
| 128104 | 128041 | |
| 128105 | 128042 | /* If the query is DISTINCT with an ORDER BY but is not an aggregate, and |
| 128106 | 128043 | ** if the select-list is the same as the ORDER BY list, then this query |
| 128107 | 128044 | ** can be rewritten as a GROUP BY. In other words, this: |
| | @@ -128449,19 +128386,18 @@ |
| 128449 | 128386 | nCol++; |
| 128450 | 128387 | j++; |
| 128451 | 128388 | } |
| 128452 | 128389 | } |
| 128453 | 128390 | regBase = sqlite3GetTempRange(pParse, nCol); |
| 128454 | | - sqlite3ExprCacheClear(pParse); |
| 128455 | 128391 | sqlite3ExprCodeExprList(pParse, pGroupBy, regBase, 0, 0); |
| 128456 | 128392 | j = nGroupBy; |
| 128457 | 128393 | for(i=0; i<sAggInfo.nColumn; i++){ |
| 128458 | 128394 | struct AggInfo_col *pCol = &sAggInfo.aCol[i]; |
| 128459 | 128395 | if( pCol->iSorterColumn>=j ){ |
| 128460 | 128396 | int r1 = j + regBase; |
| 128461 | | - sqlite3ExprCodeGetColumnToReg(pParse, |
| 128462 | | - pCol->pTab, pCol->iColumn, pCol->iTable, r1); |
| 128397 | + sqlite3ExprCodeGetColumnOfTable(v, |
| 128398 | + pCol->pTab, pCol->iTable, pCol->iColumn, r1); |
| 128463 | 128399 | j++; |
| 128464 | 128400 | } |
| 128465 | 128401 | } |
| 128466 | 128402 | regRecord = sqlite3GetTempReg(pParse); |
| 128467 | 128403 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regRecord); |
| | @@ -128473,12 +128409,10 @@ |
| 128473 | 128409 | sortOut = sqlite3GetTempReg(pParse); |
| 128474 | 128410 | sqlite3VdbeAddOp3(v, OP_OpenPseudo, sortPTab, sortOut, nCol); |
| 128475 | 128411 | sqlite3VdbeAddOp2(v, OP_SorterSort, sAggInfo.sortingIdx, addrEnd); |
| 128476 | 128412 | VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v); |
| 128477 | 128413 | sAggInfo.useSortingIdx = 1; |
| 128478 | | - sqlite3ExprCacheClear(pParse); |
| 128479 | | - |
| 128480 | 128414 | } |
| 128481 | 128415 | |
| 128482 | 128416 | /* If the index or temporary table used by the GROUP BY sort |
| 128483 | 128417 | ** will naturally deliver rows in the order required by the ORDER BY |
| 128484 | 128418 | ** clause, cancel the ephemeral table open coded earlier. |
| | @@ -128497,11 +128431,10 @@ |
| 128497 | 128431 | ** (b0 is memory location iBMem+0, b1 is iBMem+1, and so forth) |
| 128498 | 128432 | ** Then compare the current GROUP BY terms against the GROUP BY terms |
| 128499 | 128433 | ** from the previous row currently stored in a0, a1, a2... |
| 128500 | 128434 | */ |
| 128501 | 128435 | addrTopOfLoop = sqlite3VdbeCurrentAddr(v); |
| 128502 | | - sqlite3ExprCacheClear(pParse); |
| 128503 | 128436 | if( groupBySort ){ |
| 128504 | 128437 | sqlite3VdbeAddOp3(v, OP_SorterData, sAggInfo.sortingIdx, |
| 128505 | 128438 | sortOut, sortPTab); |
| 128506 | 128439 | } |
| 128507 | 128440 | for(j=0; j<pGroupBy->nExpr; j++){ |
| | @@ -130714,17 +130647,11 @@ |
| 130714 | 130647 | ** if there are one or more BEFORE triggers that use this value via |
| 130715 | 130648 | ** a new.* reference in a trigger program. |
| 130716 | 130649 | */ |
| 130717 | 130650 | testcase( i==31 ); |
| 130718 | 130651 | testcase( i==32 ); |
| 130719 | | - sqlite3ExprCodeGetColumnToReg(pParse, pTab, i, iDataCur, regNew+i); |
| 130720 | | - if( tmask & TRIGGER_BEFORE ){ |
| 130721 | | - /* This value will be recomputed in After-BEFORE-trigger-reload-loop |
| 130722 | | - ** below, so make sure that it is not cached and reused. |
| 130723 | | - ** Ticket d85fffd6ffe856092ed8daefa811b1e399706b28. */ |
| 130724 | | - sqlite3ExprCacheRemove(pParse, regNew+i, 1); |
| 130725 | | - } |
| 130652 | + sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, i, regNew+i); |
| 130726 | 130653 | }else{ |
| 130727 | 130654 | sqlite3VdbeAddOp2(v, OP_Null, 0, regNew+i); |
| 130728 | 130655 | } |
| 130729 | 130656 | } |
| 130730 | 130657 | } |
| | @@ -133848,11 +133775,10 @@ |
| 133848 | 133775 | } |
| 133849 | 133776 | |
| 133850 | 133777 | /* Code the OP_Affinity opcode if there is anything left to do. */ |
| 133851 | 133778 | if( n>0 ){ |
| 133852 | 133779 | sqlite3VdbeAddOp4(v, OP_Affinity, base, n, 0, zAff, n); |
| 133853 | | - sqlite3ExprCacheAffinityChange(pParse, base, n); |
| 133854 | 133780 | } |
| 133855 | 133781 | } |
| 133856 | 133782 | |
| 133857 | 133783 | /* |
| 133858 | 133784 | ** Expression pRight, which is the RHS of a comparison operation, is |
| | @@ -134384,11 +134310,11 @@ |
| 134384 | 134310 | ** an access of the index rather than the original table. |
| 134385 | 134311 | */ |
| 134386 | 134312 | static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){ |
| 134387 | 134313 | int rc = WRC_Continue; |
| 134388 | 134314 | struct CCurHint *pHint = pWalker->u.pCCurHint; |
| 134389 | | - if( pExpr->op==TK_COLUMN ){ |
| 134315 | + if( pExpr->op==TK_COLUMN && !ExprHasProperty(pExpr, EP_FixedCol) ){ |
| 134390 | 134316 | if( pExpr->iTable!=pHint->iTabCur ){ |
| 134391 | 134317 | Vdbe *v = pWalker->pParse->pVdbe; |
| 134392 | 134318 | int reg = ++pWalker->pParse->nMem; /* Register for column value */ |
| 134393 | 134319 | sqlite3ExprCodeGetColumnOfTable( |
| 134394 | 134320 | v, pExpr->pTab, pExpr->iTable, pExpr->iColumn, reg |
| | @@ -134757,11 +134683,10 @@ |
| 134757 | 134683 | int iReg; /* P3 Value for OP_VFilter */ |
| 134758 | 134684 | int addrNotFound; |
| 134759 | 134685 | int nConstraint = pLoop->nLTerm; |
| 134760 | 134686 | int iIn; /* Counter for IN constraints */ |
| 134761 | 134687 | |
| 134762 | | - sqlite3ExprCachePush(pParse); |
| 134763 | 134688 | iReg = sqlite3GetTempRange(pParse, nConstraint+2); |
| 134764 | 134689 | addrNotFound = pLevel->addrBrk; |
| 134765 | 134690 | for(j=0; j<nConstraint; j++){ |
| 134766 | 134691 | int iTarget = iReg+j+2; |
| 134767 | 134692 | pTerm = pLoop->aLTerm[j]; |
| | @@ -134830,11 +134755,10 @@ |
| 134830 | 134755 | ** reuse them later) if (pLoop->wsFlags & WHERE_IN_ABLE)==0. But it seems |
| 134831 | 134756 | ** simpler and safer to simply not reuse the registers. |
| 134832 | 134757 | ** |
| 134833 | 134758 | ** sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); |
| 134834 | 134759 | */ |
| 134835 | | - sqlite3ExprCachePop(pParse); |
| 134836 | 134760 | }else |
| 134837 | 134761 | #endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 134838 | 134762 | |
| 134839 | 134763 | if( (pLoop->wsFlags & WHERE_IPK)!=0 |
| 134840 | 134764 | && (pLoop->wsFlags & (WHERE_COLUMN_IN|WHERE_COLUMN_EQ))!=0 |
| | @@ -134854,13 +134778,10 @@ |
| 134854 | 134778 | iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, 0, bRev, iReleaseReg); |
| 134855 | 134779 | if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg); |
| 134856 | 134780 | addrNxt = pLevel->addrNxt; |
| 134857 | 134781 | sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg); |
| 134858 | 134782 | VdbeCoverage(v); |
| 134859 | | - sqlite3ExprCacheAffinityChange(pParse, iRowidReg, 1); |
| 134860 | | - sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); |
| 134861 | | - VdbeComment((v, "pk")); |
| 134862 | 134783 | pLevel->op = OP_Noop; |
| 134863 | 134784 | }else if( (pLoop->wsFlags & WHERE_IPK)!=0 |
| 134864 | 134785 | && (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0 |
| 134865 | 134786 | ){ |
| 134866 | 134787 | /* Case 3: We have an inequality comparison against the ROWID field. |
| | @@ -134926,11 +134847,10 @@ |
| 134926 | 134847 | VdbeComment((v, "pk")); |
| 134927 | 134848 | VdbeCoverageIf(v, pX->op==TK_GT); |
| 134928 | 134849 | VdbeCoverageIf(v, pX->op==TK_LE); |
| 134929 | 134850 | VdbeCoverageIf(v, pX->op==TK_LT); |
| 134930 | 134851 | VdbeCoverageIf(v, pX->op==TK_GE); |
| 134931 | | - sqlite3ExprCacheAffinityChange(pParse, r1, 1); |
| 134932 | 134852 | sqlite3ReleaseTempReg(pParse, rTemp); |
| 134933 | 134853 | }else{ |
| 134934 | 134854 | sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, addrHalt); |
| 134935 | 134855 | VdbeCoverageIf(v, bRev==0); |
| 134936 | 134856 | VdbeCoverageIf(v, bRev!=0); |
| | @@ -134961,11 +134881,10 @@ |
| 134961 | 134881 | pLevel->p2 = start; |
| 134962 | 134882 | assert( pLevel->p5==0 ); |
| 134963 | 134883 | if( testOp!=OP_Noop ){ |
| 134964 | 134884 | iRowidReg = ++pParse->nMem; |
| 134965 | 134885 | sqlite3VdbeAddOp2(v, OP_Rowid, iCur, iRowidReg); |
| 134966 | | - sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); |
| 134967 | 134886 | sqlite3VdbeAddOp3(v, testOp, memEndValue, addrBrk, iRowidReg); |
| 134968 | 134887 | VdbeCoverageIf(v, testOp==OP_Le); |
| 134969 | 134888 | VdbeCoverageIf(v, testOp==OP_Lt); |
| 134970 | 134889 | VdbeCoverageIf(v, testOp==OP_Ge); |
| 134971 | 134890 | VdbeCoverageIf(v, testOp==OP_Gt); |
| | @@ -135187,11 +135106,10 @@ |
| 135187 | 135106 | ** range (if any). |
| 135188 | 135107 | */ |
| 135189 | 135108 | nConstraint = nEq; |
| 135190 | 135109 | if( pRangeEnd ){ |
| 135191 | 135110 | Expr *pRight = pRangeEnd->pExpr->pRight; |
| 135192 | | - sqlite3ExprCacheRemove(pParse, regBase+nEq, 1); |
| 135193 | 135111 | codeExprOrVector(pParse, pRight, regBase+nEq, nTop); |
| 135194 | 135112 | whereLikeOptimizationStringFixup(v, pLevel, pRangeEnd); |
| 135195 | 135113 | if( (pRangeEnd->wtFlags & TERM_VNULL)==0 |
| 135196 | 135114 | && sqlite3ExprCanBeNull(pRight) |
| 135197 | 135115 | ){ |
| | @@ -135212,11 +135130,10 @@ |
| 135212 | 135130 | }else{ |
| 135213 | 135131 | endEq = 1; |
| 135214 | 135132 | } |
| 135215 | 135133 | }else if( bStopAtNull ){ |
| 135216 | 135134 | sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq); |
| 135217 | | - sqlite3ExprCacheRemove(pParse, regBase+nEq, 1); |
| 135218 | 135135 | endEq = 0; |
| 135219 | 135136 | nConstraint++; |
| 135220 | 135137 | } |
| 135221 | 135138 | sqlite3DbFree(db, zStartAff); |
| 135222 | 135139 | sqlite3DbFree(db, zEndAff); |
| | @@ -135246,11 +135163,10 @@ |
| 135246 | 135163 | (pWInfo->wctrlFlags & WHERE_SEEK_UNIQ_TABLE) |
| 135247 | 135164 | && (pWInfo->eOnePass==ONEPASS_SINGLE) |
| 135248 | 135165 | )){ |
| 135249 | 135166 | iRowidReg = ++pParse->nMem; |
| 135250 | 135167 | sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, iRowidReg); |
| 135251 | | - sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); |
| 135252 | 135168 | sqlite3VdbeAddOp3(v, OP_NotExists, iCur, 0, iRowidReg); |
| 135253 | 135169 | VdbeCoverage(v); |
| 135254 | 135170 | }else{ |
| 135255 | 135171 | codeDeferredSeek(pWInfo, pIdx, iCur, iIdxCur); |
| 135256 | 135172 | } |
| | @@ -135481,27 +135397,27 @@ |
| 135481 | 135397 | ** duplicate rows from prior sub-WHERE clauses, and record the |
| 135482 | 135398 | ** rowid (or PRIMARY KEY) for the current row so that the same |
| 135483 | 135399 | ** row will be skipped in subsequent sub-WHERE clauses. |
| 135484 | 135400 | */ |
| 135485 | 135401 | if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ |
| 135486 | | - int r; |
| 135487 | 135402 | int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); |
| 135488 | 135403 | if( HasRowid(pTab) ){ |
| 135489 | | - r = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, regRowid, 0); |
| 135404 | + sqlite3ExprCodeGetColumnOfTable(v, pTab, iCur, -1, regRowid); |
| 135490 | 135405 | jmp1 = sqlite3VdbeAddOp4Int(v, OP_RowSetTest, regRowset, 0, |
| 135491 | | - r,iSet); |
| 135406 | + regRowid, iSet); |
| 135492 | 135407 | VdbeCoverage(v); |
| 135493 | 135408 | }else{ |
| 135494 | 135409 | Index *pPk = sqlite3PrimaryKeyIndex(pTab); |
| 135495 | 135410 | int nPk = pPk->nKeyCol; |
| 135496 | 135411 | int iPk; |
| 135412 | + int r; |
| 135497 | 135413 | |
| 135498 | 135414 | /* Read the PK into an array of temp registers. */ |
| 135499 | 135415 | r = sqlite3GetTempRange(pParse, nPk); |
| 135500 | 135416 | for(iPk=0; iPk<nPk; iPk++){ |
| 135501 | 135417 | int iCol = pPk->aiColumn[iPk]; |
| 135502 | | - sqlite3ExprCodeGetColumnToReg(pParse, pTab, iCol, iCur, r+iPk); |
| 135418 | + sqlite3ExprCodeGetColumnOfTable(v, pTab, iCur, iCol, r+iPk); |
| 135503 | 135419 | } |
| 135504 | 135420 | |
| 135505 | 135421 | /* Check if the temp table already contains this key. If so, |
| 135506 | 135422 | ** the row has already been included in the result set and |
| 135507 | 135423 | ** can be ignored (by jumping past the Gosub below). Otherwise, |
| | @@ -135730,11 +135646,10 @@ |
| 135730 | 135646 | */ |
| 135731 | 135647 | if( pLevel->iLeftJoin ){ |
| 135732 | 135648 | pLevel->addrFirst = sqlite3VdbeCurrentAddr(v); |
| 135733 | 135649 | sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->iLeftJoin); |
| 135734 | 135650 | VdbeComment((v, "record LEFT JOIN hit")); |
| 135735 | | - sqlite3ExprCacheClear(pParse); |
| 135736 | 135651 | for(pTerm=pWC->a, j=0; j<pWC->nTerm; j++, pTerm++){ |
| 135737 | 135652 | testcase( pTerm->wtFlags & TERM_VIRTUAL ); |
| 135738 | 135653 | testcase( pTerm->wtFlags & TERM_CODED ); |
| 135739 | 135654 | if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
| 135740 | 135655 | if( (pTerm->prereqAll & pLevel->notReady)!=0 ){ |
| | @@ -135946,22 +135861,22 @@ |
| 135946 | 135861 | Expr *pExpr, /* Test this expression */ |
| 135947 | 135862 | Expr **ppPrefix, /* Pointer to TK_STRING expression with pattern prefix */ |
| 135948 | 135863 | int *pisComplete, /* True if the only wildcard is % in the last character */ |
| 135949 | 135864 | int *pnoCase /* True if uppercase is equivalent to lowercase */ |
| 135950 | 135865 | ){ |
| 135951 | | - const u8 *z = 0; /* String on RHS of LIKE operator */ |
| 135866 | + const u8 *z = 0; /* String on RHS of LIKE operator */ |
| 135952 | 135867 | Expr *pRight, *pLeft; /* Right and left size of LIKE operator */ |
| 135953 | 135868 | ExprList *pList; /* List of operands to the LIKE operator */ |
| 135954 | | - int c; /* One character in z[] */ |
| 135869 | + u8 c; /* One character in z[] */ |
| 135955 | 135870 | int cnt; /* Number of non-wildcard prefix characters */ |
| 135956 | | - char wc[4]; /* Wildcard characters */ |
| 135871 | + u8 wc[4]; /* Wildcard characters */ |
| 135957 | 135872 | sqlite3 *db = pParse->db; /* Database connection */ |
| 135958 | 135873 | sqlite3_value *pVal = 0; |
| 135959 | 135874 | int op; /* Opcode of pRight */ |
| 135960 | 135875 | int rc; /* Result code to return */ |
| 135961 | 135876 | |
| 135962 | | - if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){ |
| 135877 | + if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, (char*)wc) ){ |
| 135963 | 135878 | return 0; |
| 135964 | 135879 | } |
| 135965 | 135880 | #ifdef SQLITE_EBCDIC |
| 135966 | 135881 | if( *pnoCase ) return 0; |
| 135967 | 135882 | #endif |
| | @@ -136611,11 +136526,11 @@ |
| 136611 | 136526 | && (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2)) |
| 136612 | 136527 | ){ |
| 136613 | 136528 | return 0; |
| 136614 | 136529 | } |
| 136615 | 136530 | pColl = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, pExpr->pRight); |
| 136616 | | - if( pColl==0 || sqlite3StrICmp(pColl->zName, "BINARY")==0 ) return 1; |
| 136531 | + if( sqlite3IsBinary(pColl) ) return 1; |
| 136617 | 136532 | return sqlite3ExprCollSeqMatch(pParse, pExpr->pLeft, pExpr->pRight); |
| 136618 | 136533 | } |
| 136619 | 136534 | |
| 136620 | 136535 | /* |
| 136621 | 136536 | ** Recursively walk the expressions of a SELECT statement and generate |
| | @@ -136952,11 +136867,11 @@ |
| 136952 | 136867 | if( c=='A'-1 ) isComplete = 0; |
| 136953 | 136868 | c = sqlite3UpperToLower[c]; |
| 136954 | 136869 | } |
| 136955 | 136870 | *pC = c + 1; |
| 136956 | 136871 | } |
| 136957 | | - zCollSeqName = noCase ? "NOCASE" : "BINARY"; |
| 136872 | + zCollSeqName = noCase ? "NOCASE" : sqlite3StrBINARY; |
| 136958 | 136873 | pNewExpr1 = sqlite3ExprDup(db, pLeft, 0); |
| 136959 | 136874 | pNewExpr1 = sqlite3PExpr(pParse, TK_GE, |
| 136960 | 136875 | sqlite3ExprAddCollateString(pParse,pNewExpr1,zCollSeqName), |
| 136961 | 136876 | pStr1); |
| 136962 | 136877 | transferJoinMarkings(pNewExpr1, pExpr); |
| | @@ -137202,11 +137117,11 @@ |
| 137202 | 137117 | ** a bitmask indicating which tables are used in that expression |
| 137203 | 137118 | ** tree. |
| 137204 | 137119 | */ |
| 137205 | 137120 | SQLITE_PRIVATE Bitmask sqlite3WhereExprUsageNN(WhereMaskSet *pMaskSet, Expr *p){ |
| 137206 | 137121 | Bitmask mask; |
| 137207 | | - if( p->op==TK_COLUMN ){ |
| 137122 | + if( p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){ |
| 137208 | 137123 | return sqlite3WhereGetMask(pMaskSet, p->iTable); |
| 137209 | 137124 | }else if( ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){ |
| 137210 | 137125 | assert( p->op!=TK_IF_NULL_ROW ); |
| 137211 | 137126 | return 0; |
| 137212 | 137127 | } |
| | @@ -138100,11 +138015,10 @@ |
| 138100 | 138015 | sqlite3VdbeAddOp2(v, OP_OpenAutoindex, pLevel->iIdxCur, nKeyCol+1); |
| 138101 | 138016 | sqlite3VdbeSetP4KeyInfo(pParse, pIdx); |
| 138102 | 138017 | VdbeComment((v, "for %s", pTable->zName)); |
| 138103 | 138018 | |
| 138104 | 138019 | /* Fill the automatic index with content */ |
| 138105 | | - sqlite3ExprCachePush(pParse); |
| 138106 | 138020 | pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom]; |
| 138107 | 138021 | if( pTabItem->fg.viaCoroutine ){ |
| 138108 | 138022 | int regYield = pTabItem->regReturn; |
| 138109 | 138023 | addrCounter = sqlite3VdbeAddOp2(v, OP_Integer, 0, 0); |
| 138110 | 138024 | sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub); |
| | @@ -138137,11 +138051,10 @@ |
| 138137 | 138051 | sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); VdbeCoverage(v); |
| 138138 | 138052 | } |
| 138139 | 138053 | sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX); |
| 138140 | 138054 | sqlite3VdbeJumpHere(v, addrTop); |
| 138141 | 138055 | sqlite3ReleaseTempReg(pParse, regRecord); |
| 138142 | | - sqlite3ExprCachePop(pParse); |
| 138143 | 138056 | |
| 138144 | 138057 | /* Jump here when skipping the initialization */ |
| 138145 | 138058 | sqlite3VdbeJumpHere(v, addrInit); |
| 138146 | 138059 | |
| 138147 | 138060 | end_auto_index_create: |
| | @@ -140503,11 +140416,11 @@ |
| 140503 | 140416 | int iTerm = pIdxInfo->aConstraint[iCons].iTermOffset; |
| 140504 | 140417 | Expr *pX = pHidden->pWC->a[iTerm].pExpr; |
| 140505 | 140418 | if( pX->pLeft ){ |
| 140506 | 140419 | pC = sqlite3BinaryCompareCollSeq(pHidden->pParse, pX->pLeft, pX->pRight); |
| 140507 | 140420 | } |
| 140508 | | - zRet = (pC ? pC->zName : "BINARY"); |
| 140421 | + zRet = (pC ? pC->zName : sqlite3StrBINARY); |
| 140509 | 140422 | } |
| 140510 | 140423 | return zRet; |
| 140511 | 140424 | } |
| 140512 | 140425 | |
| 140513 | 140426 | /* |
| | @@ -141354,11 +141267,15 @@ |
| 141354 | 141267 | if( aSortCost[isOrdered]==0 ){ |
| 141355 | 141268 | aSortCost[isOrdered] = whereSortingCost( |
| 141356 | 141269 | pWInfo, nRowEst, nOrderBy, isOrdered |
| 141357 | 141270 | ); |
| 141358 | 141271 | } |
| 141359 | | - rCost = sqlite3LogEstAdd(rUnsorted, aSortCost[isOrdered]); |
| 141272 | + /* TUNING: Add a small extra penalty (5) to sorting as an |
| 141273 | + ** extra encouragment to the query planner to select a plan |
| 141274 | + ** where the rows emerge in the correct order without any sorting |
| 141275 | + ** required. */ |
| 141276 | + rCost = sqlite3LogEstAdd(rUnsorted, aSortCost[isOrdered]) + 5; |
| 141360 | 141277 | |
| 141361 | 141278 | WHERETRACE(0x002, |
| 141362 | 141279 | ("---- sort cost=%-3d (%d/%d) increases cost %3d to %-3d\n", |
| 141363 | 141280 | aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy, |
| 141364 | 141281 | rUnsorted, rCost)); |
| | @@ -142371,11 +142288,10 @@ |
| 142371 | 142288 | sqlite3 *db = pParse->db; |
| 142372 | 142289 | |
| 142373 | 142290 | /* Generate loop termination code. |
| 142374 | 142291 | */ |
| 142375 | 142292 | VdbeModuleComment((v, "End WHERE-core")); |
| 142376 | | - sqlite3ExprCacheClear(pParse); |
| 142377 | 142293 | for(i=pWInfo->nLevel-1; i>=0; i--){ |
| 142378 | 142294 | int addr; |
| 142379 | 142295 | pLevel = &pWInfo->a[i]; |
| 142380 | 142296 | pLoop = pLevel->pWLoop; |
| 142381 | 142297 | if( pLevel->op!=OP_Noop ){ |
| | @@ -143536,11 +143452,14 @@ |
| 143536 | 143452 | /* |
| 143537 | 143453 | ** Attach window object pWin to expression p. |
| 143538 | 143454 | */ |
| 143539 | 143455 | SQLITE_PRIVATE void sqlite3WindowAttach(Parse *pParse, Expr *p, Window *pWin){ |
| 143540 | 143456 | if( p ){ |
| 143541 | | - if( pWin ){ |
| 143457 | + /* This routine is only called for the parser. If pWin was not |
| 143458 | + ** allocated due to an OOM, then the parser would fail before ever |
| 143459 | + ** invoking this routine */ |
| 143460 | + if( ALWAYS(pWin) ){ |
| 143542 | 143461 | p->pWin = pWin; |
| 143543 | 143462 | pWin->pOwner = p; |
| 143544 | 143463 | if( p->flags & EP_Distinct ){ |
| 143545 | 143464 | sqlite3ErrorMsg(pParse, |
| 143546 | 143465 | "DISTINCT is not supported for window functions"); |
| | @@ -145095,21 +145014,21 @@ |
| 145095 | 145014 | #define sqlite3ParserCTX_PDECL ,Parse *pParse |
| 145096 | 145015 | #define sqlite3ParserCTX_PARAM ,pParse |
| 145097 | 145016 | #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse; |
| 145098 | 145017 | #define sqlite3ParserCTX_STORE yypParser->pParse=pParse; |
| 145099 | 145018 | #define YYFALLBACK 1 |
| 145100 | | -#define YYNSTATE 516 |
| 145101 | | -#define YYNRULE 365 |
| 145019 | +#define YYNSTATE 518 |
| 145020 | +#define YYNRULE 366 |
| 145102 | 145021 | #define YYNTOKEN 155 |
| 145103 | | -#define YY_MAX_SHIFT 515 |
| 145104 | | -#define YY_MIN_SHIFTREDUCE 750 |
| 145105 | | -#define YY_MAX_SHIFTREDUCE 1114 |
| 145106 | | -#define YY_ERROR_ACTION 1115 |
| 145107 | | -#define YY_ACCEPT_ACTION 1116 |
| 145108 | | -#define YY_NO_ACTION 1117 |
| 145109 | | -#define YY_MIN_REDUCE 1118 |
| 145110 | | -#define YY_MAX_REDUCE 1482 |
| 145022 | +#define YY_MAX_SHIFT 517 |
| 145023 | +#define YY_MIN_SHIFTREDUCE 752 |
| 145024 | +#define YY_MAX_SHIFTREDUCE 1117 |
| 145025 | +#define YY_ERROR_ACTION 1118 |
| 145026 | +#define YY_ACCEPT_ACTION 1119 |
| 145027 | +#define YY_NO_ACTION 1120 |
| 145028 | +#define YY_MIN_REDUCE 1121 |
| 145029 | +#define YY_MAX_REDUCE 1486 |
| 145111 | 145030 | /************* End control #defines *******************************************/ |
| 145112 | 145031 | #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) |
| 145113 | 145032 | |
| 145114 | 145033 | /* Define the yytestcase() macro to be a no-op if is not already defined |
| 145115 | 145034 | ** otherwise. |
| | @@ -145174,391 +145093,391 @@ |
| 145174 | 145093 | ** yy_default[] Default action for each state. |
| 145175 | 145094 | ** |
| 145176 | 145095 | *********** Begin parsing tables **********************************************/ |
| 145177 | 145096 | #define YY_ACTTAB_COUNT (2009) |
| 145178 | 145097 | static const YYACTIONTYPE yy_action[] = { |
| 145179 | | - /* 0 */ 510, 423, 364, 105, 102, 196, 14, 244, 1116, 1, |
| 145180 | | - /* 10 */ 1, 515, 2, 1120, 510, 361, 1247, 362, 271, 366, |
| 145181 | | - /* 20 */ 127, 37, 37, 1378, 105, 102, 196, 1197, 178, 472, |
| 145182 | | - /* 30 */ 1246, 880, 1184, 1163, 423, 37, 37, 1189, 1189, 881, |
| 145183 | | - /* 40 */ 353, 1184, 425, 112, 113, 103, 1092, 1092, 944, 947, |
| 145184 | | - /* 50 */ 937, 937, 110, 110, 111, 111, 111, 111, 278, 249, |
| 145185 | | - /* 60 */ 249, 249, 249, 105, 102, 196, 510, 105, 102, 196, |
| 145186 | | - /* 70 */ 1071, 254, 507, 177, 507, 1187, 1187, 491, 415, 225, |
| 145187 | | - /* 80 */ 193, 105, 102, 196, 510, 205, 906, 65, 65, 318, |
| 145188 | | - /* 90 */ 249, 249, 109, 109, 109, 109, 108, 108, 107, 107, |
| 145189 | | - /* 100 */ 107, 106, 396, 507, 258, 15, 15, 394, 393, 249, |
| 145190 | | - /* 110 */ 249, 1413, 366, 1408, 400, 1096, 1071, 1072, 1073, 377, |
| 145191 | | - /* 120 */ 1098, 178, 507, 493, 492, 1411, 1407, 396, 1097, 292, |
| 145192 | | - /* 130 */ 411, 280, 366, 365, 134, 152, 112, 113, 103, 1092, |
| 145193 | | - /* 140 */ 1092, 944, 947, 937, 937, 110, 110, 111, 111, 111, |
| 145194 | | - /* 150 */ 111, 1450, 1099, 262, 1099, 262, 112, 113, 103, 1092, |
| 145195 | | - /* 160 */ 1092, 944, 947, 937, 937, 110, 110, 111, 111, 111, |
| 145196 | | - /* 170 */ 111, 107, 107, 107, 106, 396, 1049, 486, 1047, 509, |
| 145197 | | - /* 180 */ 73, 270, 500, 416, 293, 109, 109, 109, 109, 108, |
| 145198 | | - /* 190 */ 108, 107, 107, 107, 106, 396, 366, 111, 111, 111, |
| 145199 | | - /* 200 */ 111, 104, 330, 89, 486, 109, 109, 109, 109, 108, |
| 145200 | | - /* 210 */ 108, 107, 107, 107, 106, 396, 111, 111, 111, 111, |
| 145201 | | - /* 220 */ 112, 113, 103, 1092, 1092, 944, 947, 937, 937, 110, |
| 145098 | + /* 0 */ 365, 105, 102, 197, 105, 102, 197, 512, 1119, 1, |
| 145099 | + /* 10 */ 1, 517, 2, 1123, 512, 1187, 1166, 1450, 272, 367, |
| 145100 | + /* 20 */ 127, 1384, 1192, 1192, 1187, 1161, 178, 1200, 64, 64, |
| 145101 | + /* 30 */ 474, 883, 319, 425, 345, 37, 37, 804, 359, 884, |
| 145102 | + /* 40 */ 506, 506, 506, 112, 113, 103, 1095, 1095, 949, 952, |
| 145103 | + /* 50 */ 942, 942, 110, 110, 111, 111, 111, 111, 362, 250, |
| 145104 | + /* 60 */ 250, 512, 250, 250, 494, 512, 306, 512, 456, 512, |
| 145105 | + /* 70 */ 1074, 488, 509, 475, 6, 509, 805, 134, 495, 226, |
| 145106 | + /* 80 */ 194, 425, 37, 37, 512, 206, 64, 64, 64, 64, |
| 145107 | + /* 90 */ 13, 13, 109, 109, 109, 109, 108, 108, 107, 107, |
| 145108 | + /* 100 */ 107, 106, 398, 255, 378, 13, 13, 395, 394, 425, |
| 145109 | + /* 110 */ 250, 250, 367, 473, 402, 1099, 1074, 1075, 1076, 383, |
| 145110 | + /* 120 */ 1101, 387, 494, 509, 494, 1417, 1413, 301, 1100, 304, |
| 145111 | + /* 130 */ 1251, 493, 367, 496, 16, 16, 112, 113, 103, 1095, |
| 145112 | + /* 140 */ 1095, 949, 952, 942, 942, 110, 110, 111, 111, 111, |
| 145113 | + /* 150 */ 111, 259, 1102, 492, 1102, 398, 112, 113, 103, 1095, |
| 145114 | + /* 160 */ 1095, 949, 952, 942, 942, 110, 110, 111, 111, 111, |
| 145115 | + /* 170 */ 111, 129, 1419, 340, 1414, 336, 1054, 489, 1052, 260, |
| 145116 | + /* 180 */ 73, 105, 102, 197, 990, 109, 109, 109, 109, 108, |
| 145117 | + /* 190 */ 108, 107, 107, 107, 106, 398, 367, 111, 111, 111, |
| 145118 | + /* 200 */ 111, 104, 489, 89, 1426, 109, 109, 109, 109, 108, |
| 145119 | + /* 210 */ 108, 107, 107, 107, 106, 398, 111, 111, 111, 111, |
| 145120 | + /* 220 */ 112, 113, 103, 1095, 1095, 949, 952, 942, 942, 110, |
| 145202 | 145121 | /* 230 */ 110, 111, 111, 111, 111, 109, 109, 109, 109, 108, |
| 145203 | | - /* 240 */ 108, 107, 107, 107, 106, 396, 114, 108, 108, 107, |
| 145204 | | - /* 250 */ 107, 107, 106, 396, 109, 109, 109, 109, 108, 108, |
| 145205 | | - /* 260 */ 107, 107, 107, 106, 396, 394, 393, 106, 396, 109, |
| 145206 | | - /* 270 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 396, |
| 145207 | | - /* 280 */ 217, 487, 1400, 453, 450, 449, 510, 1278, 423, 366, |
| 145208 | | - /* 290 */ 503, 503, 503, 448, 74, 1071, 109, 109, 109, 109, |
| 145209 | | - /* 300 */ 108, 108, 107, 107, 107, 106, 396, 37, 37, 1401, |
| 145210 | | - /* 310 */ 1099, 440, 1099, 112, 113, 103, 1092, 1092, 944, 947, |
| 145211 | | - /* 320 */ 937, 937, 110, 110, 111, 111, 111, 111, 1426, 515, |
| 145212 | | - /* 330 */ 2, 1120, 934, 934, 945, 948, 271, 1071, 127, 477, |
| 145213 | | - /* 340 */ 924, 1071, 1072, 1073, 217, 1197, 906, 453, 450, 449, |
| 145214 | | - /* 350 */ 388, 167, 510, 1377, 152, 379, 917, 448, 259, 510, |
| 145215 | | - /* 360 */ 916, 285, 109, 109, 109, 109, 108, 108, 107, 107, |
| 145216 | | - /* 370 */ 107, 106, 396, 15, 15, 429, 846, 249, 249, 224, |
| 145217 | | - /* 380 */ 15, 15, 366, 1071, 1072, 1073, 307, 382, 1071, 292, |
| 145218 | | - /* 390 */ 507, 916, 916, 918, 384, 27, 938, 1411, 484, 408, |
| 145219 | | - /* 400 */ 270, 500, 508, 205, 836, 836, 112, 113, 103, 1092, |
| 145220 | | - /* 410 */ 1092, 944, 947, 937, 937, 110, 110, 111, 111, 111, |
| 145221 | | - /* 420 */ 111, 1430, 282, 1120, 284, 1071, 28, 510, 271, 318, |
| 145222 | | - /* 430 */ 127, 1422, 400, 385, 1071, 1072, 1073, 1197, 159, 235, |
| 145223 | | - /* 440 */ 252, 317, 456, 312, 455, 222, 784, 375, 65, 65, |
| 145224 | | - /* 450 */ 332, 310, 194, 243, 243, 109, 109, 109, 109, 108, |
| 145225 | | - /* 460 */ 108, 107, 107, 107, 106, 396, 507, 257, 510, 249, |
| 145226 | | - /* 470 */ 249, 1071, 1072, 1073, 136, 366, 335, 924, 440, 788, |
| 145227 | | - /* 480 */ 270, 500, 507, 1446, 493, 473, 319, 1071, 429, 65, |
| 145228 | | - /* 490 */ 65, 1158, 784, 917, 283, 205, 510, 916, 440, 112, |
| 145229 | | - /* 500 */ 113, 103, 1092, 1092, 944, 947, 937, 937, 110, 110, |
| 145230 | | - /* 510 */ 111, 111, 111, 111, 279, 1027, 1476, 15, 15, 1476, |
| 145231 | | - /* 520 */ 403, 510, 383, 1071, 400, 493, 1404, 1386, 916, 916, |
| 145232 | | - /* 530 */ 918, 261, 463, 1071, 1072, 1073, 173, 1421, 510, 1071, |
| 145233 | | - /* 540 */ 1343, 510, 45, 45, 168, 990, 990, 437, 109, 109, |
| 145234 | | - /* 550 */ 109, 109, 108, 108, 107, 107, 107, 106, 396, 63, |
| 145235 | | - /* 560 */ 63, 510, 15, 15, 249, 249, 375, 510, 366, 1071, |
| 145236 | | - /* 570 */ 1072, 1073, 781, 5, 401, 355, 488, 507, 464, 3, |
| 145237 | | - /* 580 */ 291, 1071, 65, 65, 1025, 1071, 1072, 1073, 65, 65, |
| 145238 | | - /* 590 */ 350, 1112, 112, 113, 103, 1092, 1092, 944, 947, 937, |
| 145239 | | - /* 600 */ 937, 110, 110, 111, 111, 111, 111, 249, 249, 510, |
| 145240 | | - /* 610 */ 1071, 1042, 867, 395, 395, 395, 1071, 336, 493, 490, |
| 145241 | | - /* 620 */ 507, 1041, 1006, 318, 493, 505, 178, 1071, 1072, 1073, |
| 145242 | | - /* 630 */ 65, 65, 1071, 255, 344, 421, 273, 1007, 358, 290, |
| 145243 | | - /* 640 */ 88, 109, 109, 109, 109, 108, 108, 107, 107, 107, |
| 145244 | | - /* 650 */ 106, 396, 1008, 510, 375, 1071, 1071, 1072, 1073, 1113, |
| 145245 | | - /* 660 */ 510, 366, 1071, 1072, 1073, 1056, 493, 462, 133, 1478, |
| 145246 | | - /* 670 */ 351, 249, 249, 822, 65, 65, 152, 440, 1071, 1072, |
| 145247 | | - /* 680 */ 1073, 65, 65, 823, 507, 112, 113, 103, 1092, 1092, |
| 145248 | | - /* 690 */ 944, 947, 937, 937, 110, 110, 111, 111, 111, 111, |
| 145249 | | - /* 700 */ 274, 1071, 1072, 1073, 407, 866, 471, 1219, 1027, 1477, |
| 145250 | | - /* 710 */ 478, 767, 1477, 406, 1195, 1347, 1138, 392, 465, 1196, |
| 145251 | | - /* 720 */ 987, 256, 270, 500, 987, 445, 1075, 18, 18, 793, |
| 145252 | | - /* 730 */ 406, 405, 1347, 1349, 109, 109, 109, 109, 108, 108, |
| 145253 | | - /* 740 */ 107, 107, 107, 106, 396, 510, 249, 249, 249, 249, |
| 145254 | | - /* 750 */ 249, 249, 221, 510, 366, 251, 435, 246, 925, 507, |
| 145255 | | - /* 760 */ 865, 507, 468, 507, 318, 429, 49, 49, 494, 9, |
| 145256 | | - /* 770 */ 414, 228, 802, 1075, 50, 50, 277, 1025, 112, 113, |
| 145257 | | - /* 780 */ 103, 1092, 1092, 944, 947, 937, 937, 110, 110, 111, |
| 145258 | | - /* 790 */ 111, 111, 111, 1006, 249, 249, 510, 406, 1345, 1347, |
| 145259 | | - /* 800 */ 249, 249, 967, 454, 1141, 372, 1090, 507, 1007, 135, |
| 145260 | | - /* 810 */ 371, 803, 440, 507, 220, 219, 218, 17, 17, 1423, |
| 145261 | | - /* 820 */ 460, 510, 440, 1008, 510, 1232, 310, 109, 109, 109, |
| 145262 | | - /* 830 */ 109, 108, 108, 107, 107, 107, 106, 396, 510, 1336, |
| 145263 | | - /* 840 */ 510, 195, 39, 39, 497, 51, 51, 366, 510, 485, |
| 145264 | | - /* 850 */ 1278, 911, 6, 1090, 1192, 985, 386, 260, 221, 52, |
| 145265 | | - /* 860 */ 52, 53, 53, 1439, 298, 510, 865, 366, 510, 54, |
| 145266 | | - /* 870 */ 54, 112, 113, 103, 1092, 1092, 944, 947, 937, 937, |
| 145267 | | - /* 880 */ 110, 110, 111, 111, 111, 111, 55, 55, 865, 40, |
| 145268 | | - /* 890 */ 40, 112, 113, 103, 1092, 1092, 944, 947, 937, 937, |
| 145269 | | - /* 900 */ 110, 110, 111, 111, 111, 111, 250, 250, 755, 756, |
| 145270 | | - /* 910 */ 757, 510, 95, 510, 93, 510, 371, 510, 380, 507, |
| 145122 | + /* 240 */ 108, 107, 107, 107, 106, 398, 114, 108, 108, 107, |
| 145123 | + /* 250 */ 107, 107, 106, 398, 109, 109, 109, 109, 108, 108, |
| 145124 | + /* 260 */ 107, 107, 107, 106, 398, 152, 396, 396, 396, 109, |
| 145125 | + /* 270 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 398, |
| 145126 | + /* 280 */ 178, 490, 1406, 431, 1032, 1480, 1074, 512, 1480, 367, |
| 145127 | + /* 290 */ 418, 294, 354, 409, 74, 1074, 109, 109, 109, 109, |
| 145128 | + /* 300 */ 108, 108, 107, 107, 107, 106, 398, 1407, 37, 37, |
| 145129 | + /* 310 */ 1425, 271, 503, 112, 113, 103, 1095, 1095, 949, 952, |
| 145130 | + /* 320 */ 942, 942, 110, 110, 111, 111, 111, 111, 1430, 517, |
| 145131 | + /* 330 */ 2, 1123, 1074, 1075, 1076, 427, 272, 1074, 127, 363, |
| 145132 | + /* 340 */ 929, 1074, 1075, 1076, 218, 1200, 909, 455, 452, 451, |
| 145133 | + /* 350 */ 389, 167, 512, 1030, 152, 442, 920, 450, 152, 870, |
| 145134 | + /* 360 */ 919, 286, 109, 109, 109, 109, 108, 108, 107, 107, |
| 145135 | + /* 370 */ 107, 106, 398, 13, 13, 258, 849, 250, 250, 225, |
| 145136 | + /* 380 */ 106, 398, 367, 1074, 1075, 1076, 308, 385, 1074, 293, |
| 145137 | + /* 390 */ 509, 919, 919, 921, 229, 320, 1250, 1383, 1417, 487, |
| 145138 | + /* 400 */ 271, 503, 12, 206, 271, 503, 112, 113, 103, 1095, |
| 145139 | + /* 410 */ 1095, 949, 952, 942, 942, 110, 110, 111, 111, 111, |
| 145140 | + /* 420 */ 111, 1434, 283, 1123, 285, 1074, 1092, 245, 272, 1093, |
| 145141 | + /* 430 */ 127, 384, 402, 386, 1074, 1075, 1076, 1200, 159, 236, |
| 145142 | + /* 440 */ 253, 318, 458, 313, 457, 223, 786, 105, 102, 197, |
| 145143 | + /* 450 */ 510, 311, 838, 838, 442, 109, 109, 109, 109, 108, |
| 145144 | + /* 460 */ 108, 107, 107, 107, 106, 398, 512, 511, 512, 250, |
| 145145 | + /* 470 */ 250, 1074, 1075, 1076, 432, 367, 1093, 929, 1454, 790, |
| 145146 | + /* 480 */ 271, 503, 509, 105, 102, 197, 333, 63, 63, 64, |
| 145147 | + /* 490 */ 64, 27, 786, 920, 284, 206, 1349, 919, 512, 112, |
| 145148 | + /* 500 */ 113, 103, 1095, 1095, 949, 952, 942, 942, 110, 110, |
| 145149 | + /* 510 */ 111, 111, 111, 111, 107, 107, 107, 106, 398, 49, |
| 145150 | + /* 520 */ 49, 512, 28, 1074, 402, 494, 418, 294, 919, 919, |
| 145151 | + /* 530 */ 921, 186, 465, 1074, 464, 995, 995, 439, 512, 1074, |
| 145152 | + /* 540 */ 331, 512, 45, 45, 1078, 339, 173, 168, 109, 109, |
| 145153 | + /* 550 */ 109, 109, 108, 108, 107, 107, 107, 106, 398, 13, |
| 145154 | + /* 560 */ 13, 203, 13, 13, 250, 250, 1190, 1190, 367, 1074, |
| 145155 | + /* 570 */ 1075, 1076, 783, 262, 5, 356, 491, 509, 466, 1074, |
| 145156 | + /* 580 */ 1075, 1076, 395, 394, 1074, 1074, 1075, 1076, 3, 279, |
| 145157 | + /* 590 */ 1074, 1078, 112, 113, 103, 1095, 1095, 949, 952, 942, |
| 145158 | + /* 600 */ 942, 110, 110, 111, 111, 111, 111, 250, 250, 1011, |
| 145159 | + /* 610 */ 218, 1074, 869, 455, 452, 451, 939, 939, 950, 953, |
| 145160 | + /* 620 */ 509, 250, 250, 450, 1012, 1074, 442, 1102, 1204, 1102, |
| 145161 | + /* 630 */ 1074, 1075, 1076, 512, 509, 423, 1074, 1075, 1076, 1013, |
| 145162 | + /* 640 */ 509, 109, 109, 109, 109, 108, 108, 107, 107, 107, |
| 145163 | + /* 650 */ 106, 398, 1047, 512, 50, 50, 512, 1074, 1075, 1076, |
| 145164 | + /* 660 */ 824, 367, 1046, 376, 408, 1059, 1353, 205, 405, 769, |
| 145165 | + /* 670 */ 825, 1074, 1075, 1076, 64, 64, 319, 64, 64, 1297, |
| 145166 | + /* 680 */ 943, 408, 407, 1353, 1355, 112, 113, 103, 1095, 1095, |
| 145167 | + /* 690 */ 949, 952, 942, 942, 110, 110, 111, 111, 111, 111, |
| 145168 | + /* 700 */ 291, 479, 512, 1032, 1481, 512, 431, 1481, 351, 1115, |
| 145169 | + /* 710 */ 480, 992, 909, 482, 463, 992, 132, 178, 33, 447, |
| 145170 | + /* 720 */ 1198, 136, 403, 64, 64, 476, 64, 64, 416, 366, |
| 145171 | + /* 730 */ 280, 1141, 250, 250, 109, 109, 109, 109, 108, 108, |
| 145172 | + /* 740 */ 107, 107, 107, 106, 398, 509, 222, 437, 408, 263, |
| 145173 | + /* 750 */ 1353, 263, 250, 250, 367, 293, 413, 281, 930, 393, |
| 145174 | + /* 760 */ 972, 467, 397, 250, 250, 509, 9, 470, 229, 497, |
| 145175 | + /* 770 */ 351, 1031, 1030, 1482, 352, 371, 509, 1116, 112, 113, |
| 145176 | + /* 780 */ 103, 1095, 1095, 949, 952, 942, 942, 110, 110, 111, |
| 145177 | + /* 790 */ 111, 111, 111, 250, 250, 1011, 512, 1342, 292, 250, |
| 145178 | + /* 800 */ 250, 250, 250, 1093, 372, 247, 509, 442, 868, 319, |
| 145179 | + /* 810 */ 1012, 477, 509, 195, 509, 431, 270, 15, 15, 512, |
| 145180 | + /* 820 */ 311, 512, 95, 512, 93, 1013, 364, 109, 109, 109, |
| 145181 | + /* 830 */ 109, 108, 108, 107, 107, 107, 106, 398, 512, 1116, |
| 145182 | + /* 840 */ 39, 39, 51, 51, 52, 52, 500, 367, 512, 1199, |
| 145183 | + /* 850 */ 1093, 914, 436, 338, 133, 433, 221, 220, 219, 53, |
| 145184 | + /* 860 */ 53, 319, 1392, 757, 758, 759, 512, 367, 88, 54, |
| 145185 | + /* 870 */ 54, 112, 113, 103, 1095, 1095, 949, 952, 942, 942, |
| 145186 | + /* 880 */ 110, 110, 111, 111, 111, 111, 274, 55, 55, 196, |
| 145187 | + /* 890 */ 512, 112, 113, 103, 1095, 1095, 949, 952, 942, 942, |
| 145188 | + /* 900 */ 110, 110, 111, 111, 111, 111, 135, 261, 1144, 373, |
| 145189 | + /* 910 */ 512, 40, 40, 512, 868, 512, 989, 512, 989, 116, |
| 145271 | 145190 | /* 920 */ 109, 109, 109, 109, 108, 108, 107, 107, 107, 106, |
| 145272 | | - /* 930 */ 396, 510, 41, 41, 43, 43, 44, 44, 56, 56, |
| 145191 | + /* 930 */ 398, 41, 41, 512, 43, 43, 44, 44, 56, 56, |
| 145273 | 145192 | /* 940 */ 109, 109, 109, 109, 108, 108, 107, 107, 107, 106, |
| 145274 | | - /* 950 */ 396, 510, 57, 57, 510, 1231, 510, 370, 510, 410, |
| 145275 | | - /* 960 */ 510, 416, 293, 510, 1291, 510, 1290, 510, 190, 195, |
| 145276 | | - /* 970 */ 510, 319, 58, 58, 1391, 16, 16, 59, 59, 118, |
| 145277 | | - /* 980 */ 118, 60, 60, 458, 46, 46, 61, 61, 62, 62, |
| 145278 | | - /* 990 */ 510, 47, 47, 1201, 865, 91, 510, 474, 510, 461, |
| 145279 | | - /* 1000 */ 510, 461, 510, 228, 510, 507, 510, 390, 510, 841, |
| 145280 | | - /* 1010 */ 510, 64, 64, 1449, 840, 366, 811, 140, 140, 141, |
| 145281 | | - /* 1020 */ 141, 69, 69, 48, 48, 119, 119, 66, 66, 120, |
| 145282 | | - /* 1030 */ 120, 121, 121, 510, 434, 366, 510, 431, 1090, 112, |
| 145283 | | - /* 1040 */ 113, 103, 1092, 1092, 944, 947, 937, 937, 110, 110, |
| 145284 | | - /* 1050 */ 111, 111, 111, 111, 117, 117, 510, 139, 139, 112, |
| 145285 | | - /* 1060 */ 113, 103, 1092, 1092, 944, 947, 937, 937, 110, 110, |
| 145286 | | - /* 1070 */ 111, 111, 111, 111, 305, 427, 116, 138, 138, 510, |
| 145287 | | - /* 1080 */ 86, 510, 131, 475, 510, 1090, 350, 1026, 109, 109, |
| 145288 | | - /* 1090 */ 109, 109, 108, 108, 107, 107, 107, 106, 396, 510, |
| 145289 | | - /* 1100 */ 125, 125, 124, 124, 510, 122, 122, 510, 109, 109, |
| 145290 | | - /* 1110 */ 109, 109, 108, 108, 107, 107, 107, 106, 396, 777, |
| 145291 | | - /* 1120 */ 123, 123, 502, 372, 510, 68, 68, 510, 70, 70, |
| 145292 | | - /* 1130 */ 1089, 510, 286, 14, 1278, 300, 1278, 303, 270, 500, |
| 145293 | | - /* 1140 */ 373, 153, 841, 94, 202, 67, 67, 840, 38, 38, |
| 145294 | | - /* 1150 */ 189, 188, 42, 42, 1278, 1113, 248, 193, 269, 880, |
| 145295 | | - /* 1160 */ 132, 428, 33, 366, 418, 1366, 777, 881, 182, 363, |
| 145296 | | - /* 1170 */ 1022, 289, 908, 352, 88, 227, 422, 424, 294, 227, |
| 145297 | | - /* 1180 */ 227, 88, 446, 366, 19, 223, 903, 112, 113, 103, |
| 145298 | | - /* 1190 */ 1092, 1092, 944, 947, 937, 937, 110, 110, 111, 111, |
| 145299 | | - /* 1200 */ 111, 111, 381, 308, 436, 430, 88, 112, 101, 103, |
| 145300 | | - /* 1210 */ 1092, 1092, 944, 947, 937, 937, 110, 110, 111, 111, |
| 145301 | | - /* 1220 */ 111, 111, 391, 417, 791, 801, 800, 808, 809, 970, |
| 145302 | | - /* 1230 */ 874, 974, 223, 227, 920, 185, 109, 109, 109, 109, |
| 145303 | | - /* 1240 */ 108, 108, 107, 107, 107, 106, 396, 984, 838, 984, |
| 145304 | | - /* 1250 */ 204, 96, 983, 1365, 983, 432, 109, 109, 109, 109, |
| 145305 | | - /* 1260 */ 108, 108, 107, 107, 107, 106, 396, 316, 295, 775, |
| 145306 | | - /* 1270 */ 1228, 791, 130, 299, 1167, 302, 366, 315, 974, 1166, |
| 145307 | | - /* 1280 */ 304, 920, 306, 496, 1180, 1164, 1165, 311, 320, 321, |
| 145308 | | - /* 1290 */ 1240, 267, 1277, 1215, 1226, 495, 366, 1283, 1147, 1140, |
| 145309 | | - /* 1300 */ 1129, 113, 103, 1092, 1092, 944, 947, 937, 937, 110, |
| 145310 | | - /* 1310 */ 110, 111, 111, 111, 111, 1128, 441, 241, 183, 1130, |
| 145311 | | - /* 1320 */ 1212, 1433, 103, 1092, 1092, 944, 947, 937, 937, 110, |
| 145312 | | - /* 1330 */ 110, 111, 111, 111, 111, 349, 323, 325, 327, 288, |
| 145313 | | - /* 1340 */ 426, 191, 187, 99, 501, 409, 4, 499, 314, 109, |
| 145314 | | - /* 1350 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 396, |
| 145315 | | - /* 1360 */ 504, 13, 1163, 1262, 451, 1340, 281, 329, 1339, 109, |
| 145316 | | - /* 1370 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 396, |
| 145317 | | - /* 1380 */ 1270, 357, 1436, 397, 230, 342, 1107, 186, 1385, 1383, |
| 145318 | | - /* 1390 */ 1104, 374, 420, 99, 501, 498, 4, 165, 30, 72, |
| 145319 | | - /* 1400 */ 75, 155, 1267, 149, 157, 152, 86, 1259, 412, 160, |
| 145320 | | - /* 1410 */ 504, 413, 161, 162, 924, 163, 444, 207, 356, 31, |
| 145321 | | - /* 1420 */ 97, 97, 8, 354, 1273, 419, 1334, 98, 169, 397, |
| 145322 | | - /* 1430 */ 512, 511, 433, 397, 916, 211, 80, 242, 1354, 439, |
| 145323 | | - /* 1440 */ 297, 213, 174, 301, 442, 498, 1131, 214, 215, 359, |
| 145324 | | - /* 1450 */ 457, 270, 500, 387, 360, 1183, 482, 1182, 1174, 793, |
| 145325 | | - /* 1460 */ 1181, 481, 476, 1154, 924, 916, 916, 918, 919, 25, |
| 145326 | | - /* 1470 */ 97, 97, 1155, 313, 1173, 1153, 265, 98, 1448, 397, |
| 145327 | | - /* 1480 */ 512, 511, 467, 389, 916, 266, 470, 1223, 99, 501, |
| 145328 | | - /* 1490 */ 85, 4, 1224, 229, 480, 489, 332, 331, 322, 181, |
| 145329 | | - /* 1500 */ 1402, 11, 1320, 334, 92, 504, 115, 129, 337, 99, |
| 145330 | | - /* 1510 */ 501, 324, 4, 1222, 1221, 916, 916, 918, 919, 25, |
| 145331 | | - /* 1520 */ 1425, 1060, 399, 326, 328, 253, 504, 1205, 397, 338, |
| 145332 | | - /* 1530 */ 348, 348, 347, 238, 345, 87, 339, 764, 479, 340, |
| 145333 | | - /* 1540 */ 498, 268, 236, 341, 1137, 29, 1066, 237, 513, 397, |
| 145334 | | - /* 1550 */ 198, 482, 276, 240, 514, 239, 483, 1126, 1121, 924, |
| 145335 | | - /* 1560 */ 275, 498, 154, 142, 1370, 97, 97, 368, 369, 143, |
| 145336 | | - /* 1570 */ 1371, 751, 98, 144, 397, 512, 511, 398, 184, 916, |
| 145337 | | - /* 1580 */ 924, 272, 1369, 1368, 128, 197, 97, 97, 845, 1151, |
| 145338 | | - /* 1590 */ 200, 1150, 263, 98, 71, 397, 512, 511, 201, 1148, |
| 145339 | | - /* 1600 */ 916, 146, 402, 126, 982, 980, 900, 156, 199, 203, |
| 145340 | | - /* 1610 */ 916, 916, 918, 919, 25, 145, 158, 825, 996, 206, |
| 145341 | | - /* 1620 */ 287, 99, 501, 164, 4, 147, 376, 904, 378, 76, |
| 145342 | | - /* 1630 */ 166, 916, 916, 918, 919, 25, 77, 78, 504, 79, |
| 145343 | | - /* 1640 */ 148, 999, 367, 208, 209, 995, 137, 270, 500, 20, |
| 145344 | | - /* 1650 */ 210, 296, 227, 1101, 438, 212, 988, 170, 171, 32, |
| 145345 | | - /* 1660 */ 766, 397, 443, 315, 216, 447, 452, 172, 81, 21, |
| 145346 | | - /* 1670 */ 404, 309, 22, 498, 82, 264, 150, 804, 179, 83, |
| 145347 | | - /* 1680 */ 459, 151, 180, 950, 482, 1030, 34, 84, 1031, 481, |
| 145348 | | - /* 1690 */ 466, 35, 924, 192, 469, 245, 247, 873, 97, 97, |
| 145349 | | - /* 1700 */ 175, 226, 96, 868, 1044, 98, 1048, 397, 512, 511, |
| 145350 | | - /* 1710 */ 1060, 399, 916, 23, 253, 10, 1046, 1035, 7, 348, |
| 145351 | | - /* 1720 */ 348, 347, 238, 345, 333, 176, 764, 88, 965, 24, |
| 145352 | | - /* 1730 */ 951, 99, 501, 949, 4, 954, 953, 1005, 1004, 198, |
| 145353 | | - /* 1740 */ 232, 276, 231, 916, 916, 918, 919, 25, 504, 275, |
| 145354 | | - /* 1750 */ 26, 36, 506, 921, 776, 100, 835, 839, 12, 233, |
| 145355 | | - /* 1760 */ 234, 90, 501, 343, 4, 346, 1441, 1440, 1061, 1117, |
| 145356 | | - /* 1770 */ 1117, 397, 1117, 1117, 1117, 1117, 1117, 1117, 504, 200, |
| 145357 | | - /* 1780 */ 1117, 1117, 1117, 498, 1117, 1117, 1117, 201, 1117, 1117, |
| 145358 | | - /* 1790 */ 146, 1117, 1117, 1117, 1117, 1117, 1117, 199, 1117, 1117, |
| 145359 | | - /* 1800 */ 1117, 397, 924, 1117, 1117, 1117, 1117, 1117, 97, 97, |
| 145360 | | - /* 1810 */ 1117, 1117, 1117, 498, 1117, 98, 1117, 397, 512, 511, |
| 145361 | | - /* 1820 */ 1117, 1117, 916, 1117, 1117, 1117, 1117, 1117, 1117, 1117, |
| 145362 | | - /* 1830 */ 1117, 367, 924, 1117, 1117, 1117, 270, 500, 97, 97, |
| 145363 | | - /* 1840 */ 1117, 1117, 1117, 1117, 1117, 98, 1117, 397, 512, 511, |
| 145364 | | - /* 1850 */ 1117, 1117, 916, 916, 916, 918, 919, 25, 1117, 404, |
| 145365 | | - /* 1860 */ 1117, 1117, 1117, 253, 1117, 1117, 1117, 1117, 348, 348, |
| 145366 | | - /* 1870 */ 347, 238, 345, 1117, 1117, 764, 1117, 1117, 1117, 1117, |
| 145367 | | - /* 1880 */ 1117, 1117, 1117, 916, 916, 918, 919, 25, 198, 1117, |
| 145368 | | - /* 1890 */ 276, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 275, 1117, |
| 145369 | | - /* 1900 */ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, |
| 145370 | | - /* 1910 */ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, |
| 145371 | | - /* 1920 */ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 200, 1117, |
| 145372 | | - /* 1930 */ 1117, 1117, 1117, 1117, 1117, 1117, 201, 1117, 1117, 146, |
| 145373 | | - /* 1940 */ 1117, 1117, 1117, 1117, 1117, 1117, 199, 1117, 1117, 1117, |
| 145374 | | - /* 1950 */ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, |
| 145375 | | - /* 1960 */ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, |
| 145376 | | - /* 1970 */ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, |
| 145377 | | - /* 1980 */ 367, 1117, 1117, 1117, 1117, 270, 500, 1117, 1117, 1117, |
| 145378 | | - /* 1990 */ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, |
| 145379 | | - /* 2000 */ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 404, |
| 145193 | + /* 950 */ 398, 512, 376, 512, 57, 57, 512, 795, 512, 376, |
| 145194 | + /* 960 */ 512, 442, 793, 512, 320, 512, 275, 512, 1453, 512, |
| 145195 | + /* 970 */ 1282, 813, 58, 58, 14, 14, 512, 59, 59, 118, |
| 145196 | + /* 980 */ 118, 60, 60, 512, 46, 46, 61, 61, 62, 62, |
| 145197 | + /* 990 */ 47, 47, 512, 190, 189, 91, 512, 140, 140, 512, |
| 145198 | + /* 1000 */ 391, 512, 844, 1195, 141, 141, 512, 843, 512, 793, |
| 145199 | + /* 1010 */ 512, 410, 512, 69, 69, 367, 278, 48, 48, 256, |
| 145200 | + /* 1020 */ 65, 65, 119, 119, 244, 244, 257, 66, 66, 120, |
| 145201 | + /* 1030 */ 120, 121, 121, 117, 117, 367, 512, 509, 380, 112, |
| 145202 | + /* 1040 */ 113, 103, 1095, 1095, 949, 952, 942, 942, 110, 110, |
| 145203 | + /* 1050 */ 111, 111, 111, 111, 512, 868, 512, 139, 139, 112, |
| 145204 | + /* 1060 */ 113, 103, 1095, 1095, 949, 952, 942, 942, 110, 110, |
| 145205 | + /* 1070 */ 111, 111, 111, 111, 1282, 138, 138, 125, 125, 512, |
| 145206 | + /* 1080 */ 12, 512, 1351, 1282, 512, 442, 131, 1282, 109, 109, |
| 145207 | + /* 1090 */ 109, 109, 108, 108, 107, 107, 107, 106, 398, 512, |
| 145208 | + /* 1100 */ 124, 124, 122, 122, 512, 123, 123, 512, 109, 109, |
| 145209 | + /* 1110 */ 109, 109, 108, 108, 107, 107, 107, 106, 398, 512, |
| 145210 | + /* 1120 */ 68, 68, 460, 779, 512, 70, 70, 299, 67, 67, |
| 145211 | + /* 1130 */ 1027, 251, 251, 353, 1282, 191, 196, 1427, 462, 1296, |
| 145212 | + /* 1140 */ 38, 38, 381, 94, 509, 42, 42, 177, 844, 271, |
| 145213 | + /* 1150 */ 503, 382, 417, 843, 420, 438, 505, 373, 374, 153, |
| 145214 | + /* 1160 */ 252, 868, 429, 367, 222, 249, 194, 883, 182, 290, |
| 145215 | + /* 1170 */ 779, 988, 88, 988, 463, 884, 906, 911, 424, 426, |
| 145216 | + /* 1180 */ 228, 228, 228, 367, 17, 803, 802, 112, 113, 103, |
| 145217 | + /* 1190 */ 1095, 1095, 949, 952, 942, 942, 110, 110, 111, 111, |
| 145218 | + /* 1200 */ 111, 111, 392, 295, 810, 811, 88, 112, 101, 103, |
| 145219 | + /* 1210 */ 1095, 1095, 949, 952, 942, 942, 110, 110, 111, 111, |
| 145220 | + /* 1220 */ 111, 111, 372, 419, 448, 309, 979, 224, 88, 975, |
| 145221 | + /* 1230 */ 877, 841, 224, 228, 100, 923, 109, 109, 109, 109, |
| 145222 | + /* 1240 */ 108, 108, 107, 107, 107, 106, 398, 86, 430, 777, |
| 145223 | + /* 1250 */ 842, 1236, 130, 100, 1235, 412, 109, 109, 109, 109, |
| 145224 | + /* 1260 */ 108, 108, 107, 107, 107, 106, 398, 317, 1443, 1397, |
| 145225 | + /* 1270 */ 1170, 287, 1169, 979, 1372, 1371, 367, 316, 434, 296, |
| 145226 | + /* 1280 */ 1232, 1223, 923, 300, 303, 305, 307, 1183, 1168, 1167, |
| 145227 | + /* 1290 */ 312, 321, 322, 1244, 1281, 1219, 367, 268, 1230, 499, |
| 145228 | + /* 1300 */ 498, 113, 103, 1095, 1095, 949, 952, 942, 942, 110, |
| 145229 | + /* 1310 */ 110, 111, 111, 111, 111, 1287, 1150, 443, 242, 184, |
| 145230 | + /* 1320 */ 1216, 1143, 103, 1095, 1095, 949, 952, 942, 942, 110, |
| 145231 | + /* 1330 */ 110, 111, 111, 111, 111, 1132, 1131, 1133, 1437, 350, |
| 145232 | + /* 1340 */ 411, 324, 188, 98, 504, 289, 4, 326, 315, 109, |
| 145233 | + /* 1350 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 398, |
| 145234 | + /* 1360 */ 507, 328, 1266, 1274, 358, 453, 282, 192, 1346, 109, |
| 145235 | + /* 1370 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 398, |
| 145236 | + /* 1380 */ 11, 1166, 1345, 399, 1440, 330, 502, 1110, 231, 428, |
| 145237 | + /* 1390 */ 1391, 343, 187, 98, 504, 501, 4, 1107, 1389, 375, |
| 145238 | + /* 1400 */ 422, 155, 72, 165, 75, 152, 149, 86, 414, 1263, |
| 145239 | + /* 1410 */ 507, 157, 415, 160, 929, 161, 162, 163, 446, 1271, |
| 145240 | + /* 1420 */ 96, 96, 8, 30, 208, 1277, 357, 97, 355, 399, |
| 145241 | + /* 1430 */ 514, 513, 421, 399, 919, 31, 169, 435, 1340, 212, |
| 145242 | + /* 1440 */ 80, 441, 243, 214, 1360, 501, 298, 174, 444, 302, |
| 145243 | + /* 1450 */ 215, 271, 503, 1134, 216, 360, 485, 459, 388, 1186, |
| 145244 | + /* 1460 */ 361, 484, 1185, 795, 929, 919, 919, 921, 922, 24, |
| 145245 | + /* 1470 */ 96, 96, 1184, 1158, 1177, 314, 1157, 97, 1176, 399, |
| 145246 | + /* 1480 */ 514, 513, 469, 1156, 919, 1452, 390, 266, 98, 504, |
| 145247 | + /* 1490 */ 267, 4, 472, 478, 483, 85, 1227, 333, 230, 492, |
| 145248 | + /* 1500 */ 1408, 332, 323, 115, 10, 507, 1228, 181, 335, 98, |
| 145249 | + /* 1510 */ 504, 337, 4, 92, 87, 919, 919, 921, 922, 24, |
| 145250 | + /* 1520 */ 1429, 1063, 401, 1226, 481, 254, 507, 325, 399, 327, |
| 145251 | + /* 1530 */ 349, 349, 348, 239, 346, 1225, 329, 766, 1209, 1326, |
| 145252 | + /* 1540 */ 501, 183, 1208, 341, 269, 342, 237, 1069, 1140, 399, |
| 145253 | + /* 1550 */ 199, 485, 277, 29, 515, 241, 486, 238, 516, 929, |
| 145254 | + /* 1560 */ 276, 501, 240, 1129, 1124, 96, 96, 1376, 142, 154, |
| 145255 | + /* 1570 */ 369, 370, 97, 143, 399, 514, 513, 1377, 128, 919, |
| 145256 | + /* 1580 */ 929, 1375, 144, 753, 400, 1374, 96, 96, 848, 1154, |
| 145257 | + /* 1590 */ 201, 1153, 185, 97, 264, 399, 514, 513, 202, 71, |
| 145258 | + /* 1600 */ 919, 146, 1151, 273, 198, 404, 126, 987, 200, 985, |
| 145259 | + /* 1610 */ 919, 919, 921, 922, 24, 903, 156, 145, 204, 158, |
| 145260 | + /* 1620 */ 827, 98, 504, 288, 4, 207, 1001, 164, 147, 907, |
| 145261 | + /* 1630 */ 377, 919, 919, 921, 922, 24, 379, 148, 507, 166, |
| 145262 | + /* 1640 */ 76, 77, 368, 1004, 78, 79, 209, 271, 503, 210, |
| 145263 | + /* 1650 */ 1000, 137, 18, 297, 211, 228, 440, 1104, 213, 171, |
| 145264 | + /* 1660 */ 32, 399, 768, 993, 170, 316, 445, 217, 449, 806, |
| 145265 | + /* 1670 */ 406, 310, 172, 501, 81, 19, 20, 454, 82, 83, |
| 145266 | + /* 1680 */ 265, 150, 179, 461, 485, 151, 180, 955, 84, 484, |
| 145267 | + /* 1690 */ 1035, 34, 929, 35, 468, 1036, 193, 471, 96, 96, |
| 145268 | + /* 1700 */ 246, 248, 876, 175, 871, 97, 100, 399, 514, 513, |
| 145269 | + /* 1710 */ 1063, 401, 919, 227, 254, 1053, 21, 22, 1049, 349, |
| 145270 | + /* 1720 */ 349, 348, 239, 346, 1040, 176, 766, 334, 1051, 7, |
| 145271 | + /* 1730 */ 88, 98, 504, 970, 4, 233, 23, 956, 954, 199, |
| 145272 | + /* 1740 */ 958, 277, 1010, 919, 919, 921, 922, 24, 507, 276, |
| 145273 | + /* 1750 */ 232, 1009, 959, 25, 36, 508, 924, 778, 99, 26, |
| 145274 | + /* 1760 */ 347, 90, 504, 837, 4, 234, 344, 235, 1445, 1064, |
| 145275 | + /* 1770 */ 1120, 399, 1120, 1444, 1120, 1120, 1120, 1120, 507, 201, |
| 145276 | + /* 1780 */ 1120, 1120, 1120, 501, 1120, 1120, 1120, 202, 1120, 1120, |
| 145277 | + /* 1790 */ 146, 1120, 1120, 1120, 1120, 1120, 1120, 200, 1120, 1120, |
| 145278 | + /* 1800 */ 1120, 399, 929, 1120, 1120, 1120, 1120, 1120, 96, 96, |
| 145279 | + /* 1810 */ 1120, 1120, 1120, 501, 1120, 97, 1120, 399, 514, 513, |
| 145280 | + /* 1820 */ 1120, 1120, 919, 1120, 1120, 1120, 1120, 1120, 1120, 1120, |
| 145281 | + /* 1830 */ 1120, 368, 929, 1120, 1120, 1120, 271, 503, 96, 96, |
| 145282 | + /* 1840 */ 1120, 1120, 1120, 1120, 1120, 97, 1120, 399, 514, 513, |
| 145283 | + /* 1850 */ 1120, 1120, 919, 919, 919, 921, 922, 24, 1120, 406, |
| 145284 | + /* 1860 */ 1120, 1120, 1120, 254, 1120, 1120, 1120, 1120, 349, 349, |
| 145285 | + /* 1870 */ 348, 239, 346, 1120, 1120, 766, 1120, 1120, 1120, 1120, |
| 145286 | + /* 1880 */ 1120, 1120, 1120, 919, 919, 921, 922, 24, 199, 1120, |
| 145287 | + /* 1890 */ 277, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 276, 1120, |
| 145288 | + /* 1900 */ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, |
| 145289 | + /* 1910 */ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, |
| 145290 | + /* 1920 */ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 201, 1120, |
| 145291 | + /* 1930 */ 1120, 1120, 1120, 1120, 1120, 1120, 202, 1120, 1120, 146, |
| 145292 | + /* 1940 */ 1120, 1120, 1120, 1120, 1120, 1120, 200, 1120, 1120, 1120, |
| 145293 | + /* 1950 */ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, |
| 145294 | + /* 1960 */ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, |
| 145295 | + /* 1970 */ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, |
| 145296 | + /* 1980 */ 368, 1120, 1120, 1120, 1120, 271, 503, 1120, 1120, 1120, |
| 145297 | + /* 1990 */ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, |
| 145298 | + /* 2000 */ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 406, |
| 145380 | 145299 | }; |
| 145381 | 145300 | static const YYCODETYPE yy_lookahead[] = { |
| 145382 | | - /* 0 */ 163, 163, 184, 238, 239, 240, 182, 182, 155, 156, |
| 145383 | | - /* 10 */ 157, 158, 159, 160, 163, 184, 187, 184, 165, 19, |
| 145384 | | - /* 20 */ 167, 184, 185, 258, 238, 239, 240, 174, 163, 174, |
| 145385 | | - /* 30 */ 187, 31, 191, 192, 163, 184, 185, 202, 203, 39, |
| 145386 | | - /* 40 */ 175, 200, 163, 43, 44, 45, 46, 47, 48, 49, |
| 145387 | | - /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 174, 206, |
| 145388 | | - /* 60 */ 207, 206, 207, 238, 239, 240, 163, 238, 239, 240, |
| 145389 | | - /* 70 */ 59, 233, 219, 249, 219, 202, 203, 174, 254, 224, |
| 145390 | | - /* 80 */ 225, 238, 239, 240, 163, 232, 73, 184, 185, 163, |
| 145391 | | - /* 90 */ 206, 207, 92, 93, 94, 95, 96, 97, 98, 99, |
| 145392 | | - /* 100 */ 100, 101, 102, 219, 233, 184, 185, 96, 97, 206, |
| 145393 | | - /* 110 */ 207, 274, 19, 276, 261, 104, 105, 106, 107, 198, |
| 145394 | | - /* 120 */ 109, 163, 219, 220, 221, 274, 275, 102, 117, 116, |
| 145395 | | - /* 130 */ 117, 118, 19, 175, 208, 81, 43, 44, 45, 46, |
| 145301 | + /* 0 */ 184, 238, 239, 240, 238, 239, 240, 163, 155, 156, |
| 145302 | + /* 10 */ 157, 158, 159, 160, 163, 191, 192, 183, 165, 19, |
| 145303 | + /* 20 */ 167, 258, 202, 203, 200, 191, 163, 174, 184, 185, |
| 145304 | + /* 30 */ 174, 31, 163, 163, 171, 184, 185, 35, 175, 39, |
| 145305 | + /* 40 */ 179, 180, 181, 43, 44, 45, 46, 47, 48, 49, |
| 145306 | + /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 184, 206, |
| 145307 | + /* 60 */ 207, 163, 206, 207, 220, 163, 16, 163, 66, 163, |
| 145308 | + /* 70 */ 59, 270, 219, 229, 273, 219, 74, 208, 174, 223, |
| 145309 | + /* 80 */ 224, 163, 184, 185, 163, 232, 184, 185, 184, 185, |
| 145310 | + /* 90 */ 184, 185, 92, 93, 94, 95, 96, 97, 98, 99, |
| 145311 | + /* 100 */ 100, 101, 102, 233, 198, 184, 185, 96, 97, 163, |
| 145312 | + /* 110 */ 206, 207, 19, 163, 261, 104, 105, 106, 107, 198, |
| 145313 | + /* 120 */ 109, 119, 220, 219, 220, 274, 275, 77, 117, 79, |
| 145314 | + /* 130 */ 187, 229, 19, 229, 184, 185, 43, 44, 45, 46, |
| 145396 | 145315 | /* 140 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
| 145397 | | - /* 150 */ 57, 197, 141, 195, 143, 197, 43, 44, 45, 46, |
| 145316 | + /* 150 */ 57, 233, 141, 134, 143, 102, 43, 44, 45, 46, |
| 145398 | 145317 | /* 160 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
| 145399 | | - /* 170 */ 57, 98, 99, 100, 101, 102, 83, 163, 85, 163, |
| 145400 | | - /* 180 */ 67, 127, 128, 117, 118, 92, 93, 94, 95, 96, |
| 145318 | + /* 170 */ 57, 152, 274, 216, 276, 218, 83, 163, 85, 233, |
| 145319 | + /* 180 */ 67, 238, 239, 240, 11, 92, 93, 94, 95, 96, |
| 145401 | 145320 | /* 190 */ 97, 98, 99, 100, 101, 102, 19, 54, 55, 56, |
| 145402 | 145321 | /* 200 */ 57, 58, 163, 26, 163, 92, 93, 94, 95, 96, |
| 145403 | 145322 | /* 210 */ 97, 98, 99, 100, 101, 102, 54, 55, 56, 57, |
| 145404 | 145323 | /* 220 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, |
| 145405 | 145324 | /* 230 */ 53, 54, 55, 56, 57, 92, 93, 94, 95, 96, |
| 145406 | 145325 | /* 240 */ 97, 98, 99, 100, 101, 102, 69, 96, 97, 98, |
| 145407 | 145326 | /* 250 */ 99, 100, 101, 102, 92, 93, 94, 95, 96, 97, |
| 145408 | | - /* 260 */ 98, 99, 100, 101, 102, 96, 97, 101, 102, 92, |
| 145327 | + /* 260 */ 98, 99, 100, 101, 102, 81, 179, 180, 181, 92, |
| 145409 | 145328 | /* 270 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, |
| 145410 | | - /* 280 */ 108, 267, 268, 111, 112, 113, 163, 163, 163, 19, |
| 145411 | | - /* 290 */ 179, 180, 181, 121, 24, 59, 92, 93, 94, 95, |
| 145412 | | - /* 300 */ 96, 97, 98, 99, 100, 101, 102, 184, 185, 268, |
| 145413 | | - /* 310 */ 141, 163, 143, 43, 44, 45, 46, 47, 48, 49, |
| 145329 | + /* 280 */ 163, 267, 268, 163, 22, 23, 59, 163, 26, 19, |
| 145330 | + /* 290 */ 117, 118, 175, 109, 24, 59, 92, 93, 94, 95, |
| 145331 | + /* 300 */ 96, 97, 98, 99, 100, 101, 102, 268, 184, 185, |
| 145332 | + /* 310 */ 269, 127, 128, 43, 44, 45, 46, 47, 48, 49, |
| 145414 | 145333 | /* 320 */ 50, 51, 52, 53, 54, 55, 56, 57, 157, 158, |
| 145415 | | - /* 330 */ 159, 160, 46, 47, 48, 49, 165, 59, 167, 163, |
| 145334 | + /* 330 */ 159, 160, 105, 106, 107, 163, 165, 59, 167, 184, |
| 145416 | 145335 | /* 340 */ 90, 105, 106, 107, 108, 174, 73, 111, 112, 113, |
| 145417 | | - /* 350 */ 19, 22, 163, 205, 81, 231, 106, 121, 233, 163, |
| 145336 | + /* 350 */ 19, 22, 163, 91, 81, 163, 106, 121, 81, 132, |
| 145418 | 145337 | /* 360 */ 110, 16, 92, 93, 94, 95, 96, 97, 98, 99, |
| 145419 | | - /* 370 */ 100, 101, 102, 184, 185, 163, 98, 206, 207, 26, |
| 145420 | | - /* 380 */ 184, 185, 19, 105, 106, 107, 23, 198, 59, 116, |
| 145421 | | - /* 390 */ 219, 141, 142, 143, 198, 22, 110, 274, 275, 234, |
| 145422 | | - /* 400 */ 127, 128, 123, 232, 125, 126, 43, 44, 45, 46, |
| 145338 | + /* 370 */ 100, 101, 102, 184, 185, 255, 98, 206, 207, 26, |
| 145339 | + /* 380 */ 101, 102, 19, 105, 106, 107, 23, 198, 59, 116, |
| 145340 | + /* 390 */ 219, 141, 142, 143, 24, 163, 187, 205, 274, 275, |
| 145341 | + /* 400 */ 127, 128, 182, 232, 127, 128, 43, 44, 45, 46, |
| 145423 | 145342 | /* 410 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
| 145424 | | - /* 420 */ 57, 158, 77, 160, 79, 59, 53, 163, 165, 163, |
| 145425 | | - /* 430 */ 167, 163, 261, 102, 105, 106, 107, 174, 72, 108, |
| 145426 | | - /* 440 */ 109, 110, 111, 112, 113, 114, 59, 163, 184, 185, |
| 145427 | | - /* 450 */ 22, 120, 163, 206, 207, 92, 93, 94, 95, 96, |
| 145428 | | - /* 460 */ 97, 98, 99, 100, 101, 102, 219, 255, 163, 206, |
| 145429 | | - /* 470 */ 207, 105, 106, 107, 208, 19, 163, 90, 163, 23, |
| 145430 | | - /* 480 */ 127, 128, 219, 183, 220, 221, 163, 59, 163, 184, |
| 145431 | | - /* 490 */ 185, 191, 105, 106, 149, 232, 163, 110, 163, 43, |
| 145343 | + /* 420 */ 57, 158, 77, 160, 79, 59, 26, 182, 165, 59, |
| 145344 | + /* 430 */ 167, 199, 261, 102, 105, 106, 107, 174, 72, 108, |
| 145345 | + /* 440 */ 109, 110, 111, 112, 113, 114, 59, 238, 239, 240, |
| 145346 | + /* 450 */ 123, 120, 125, 126, 163, 92, 93, 94, 95, 96, |
| 145347 | + /* 460 */ 97, 98, 99, 100, 101, 102, 163, 163, 163, 206, |
| 145348 | + /* 470 */ 207, 105, 106, 107, 254, 19, 106, 90, 197, 23, |
| 145349 | + /* 480 */ 127, 128, 219, 238, 239, 240, 22, 184, 185, 184, |
| 145350 | + /* 490 */ 185, 22, 105, 106, 149, 232, 205, 110, 163, 43, |
| 145432 | 145351 | /* 500 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 145433 | | - /* 510 */ 54, 55, 56, 57, 230, 22, 23, 184, 185, 26, |
| 145434 | | - /* 520 */ 205, 163, 199, 59, 261, 220, 221, 163, 141, 142, |
| 145435 | | - /* 530 */ 143, 198, 174, 105, 106, 107, 72, 269, 163, 59, |
| 145436 | | - /* 540 */ 205, 163, 184, 185, 22, 116, 117, 118, 92, 93, |
| 145352 | + /* 510 */ 54, 55, 56, 57, 98, 99, 100, 101, 102, 184, |
| 145353 | + /* 520 */ 185, 163, 53, 59, 261, 220, 117, 118, 141, 142, |
| 145354 | + /* 530 */ 143, 131, 174, 59, 229, 116, 117, 118, 163, 59, |
| 145355 | + /* 540 */ 163, 163, 184, 185, 59, 242, 72, 22, 92, 93, |
| 145437 | 145356 | /* 550 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 184, |
| 145438 | | - /* 560 */ 185, 163, 184, 185, 206, 207, 163, 163, 19, 105, |
| 145439 | | - /* 570 */ 106, 107, 23, 22, 259, 174, 198, 219, 220, 22, |
| 145440 | | - /* 580 */ 255, 59, 184, 185, 91, 105, 106, 107, 184, 185, |
| 145441 | | - /* 590 */ 22, 23, 43, 44, 45, 46, 47, 48, 49, 50, |
| 145442 | | - /* 600 */ 51, 52, 53, 54, 55, 56, 57, 206, 207, 163, |
| 145443 | | - /* 610 */ 59, 76, 132, 179, 180, 181, 59, 242, 220, 221, |
| 145444 | | - /* 620 */ 219, 86, 12, 163, 220, 221, 163, 105, 106, 107, |
| 145445 | | - /* 630 */ 184, 185, 59, 230, 171, 234, 163, 27, 175, 174, |
| 145446 | | - /* 640 */ 26, 92, 93, 94, 95, 96, 97, 98, 99, 100, |
| 145447 | | - /* 650 */ 101, 102, 42, 163, 163, 59, 105, 106, 107, 91, |
| 145448 | | - /* 660 */ 163, 19, 105, 106, 107, 23, 220, 221, 208, 264, |
| 145449 | | - /* 670 */ 265, 206, 207, 63, 184, 185, 81, 163, 105, 106, |
| 145450 | | - /* 680 */ 107, 184, 185, 73, 219, 43, 44, 45, 46, 47, |
| 145357 | + /* 560 */ 185, 24, 184, 185, 206, 207, 202, 203, 19, 105, |
| 145358 | + /* 570 */ 106, 107, 23, 198, 22, 174, 198, 219, 220, 105, |
| 145359 | + /* 580 */ 106, 107, 96, 97, 59, 105, 106, 107, 22, 174, |
| 145360 | + /* 590 */ 59, 106, 43, 44, 45, 46, 47, 48, 49, 50, |
| 145361 | + /* 600 */ 51, 52, 53, 54, 55, 56, 57, 206, 207, 12, |
| 145362 | + /* 610 */ 108, 59, 132, 111, 112, 113, 46, 47, 48, 49, |
| 145363 | + /* 620 */ 219, 206, 207, 121, 27, 59, 163, 141, 207, 143, |
| 145364 | + /* 630 */ 105, 106, 107, 163, 219, 234, 105, 106, 107, 42, |
| 145365 | + /* 640 */ 219, 92, 93, 94, 95, 96, 97, 98, 99, 100, |
| 145366 | + /* 650 */ 101, 102, 76, 163, 184, 185, 163, 105, 106, 107, |
| 145367 | + /* 660 */ 63, 19, 86, 163, 163, 23, 163, 130, 205, 21, |
| 145368 | + /* 670 */ 73, 105, 106, 107, 184, 185, 163, 184, 185, 237, |
| 145369 | + /* 680 */ 110, 180, 181, 180, 181, 43, 44, 45, 46, 47, |
| 145451 | 145370 | /* 690 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, |
| 145452 | | - /* 700 */ 163, 105, 106, 107, 109, 132, 163, 226, 22, 23, |
| 145453 | | - /* 710 */ 220, 21, 26, 163, 174, 163, 174, 220, 174, 205, |
| 145454 | | - /* 720 */ 29, 230, 127, 128, 33, 19, 59, 184, 185, 115, |
| 145455 | | - /* 730 */ 180, 181, 180, 181, 92, 93, 94, 95, 96, 97, |
| 145456 | | - /* 740 */ 98, 99, 100, 101, 102, 163, 206, 207, 206, 207, |
| 145457 | | - /* 750 */ 206, 207, 46, 163, 19, 22, 65, 23, 23, 219, |
| 145458 | | - /* 760 */ 26, 219, 174, 219, 163, 163, 184, 185, 174, 22, |
| 145459 | | - /* 770 */ 80, 24, 35, 106, 184, 185, 163, 91, 43, 44, |
| 145371 | + /* 700 */ 174, 163, 163, 22, 23, 163, 163, 26, 22, 23, |
| 145372 | + /* 710 */ 220, 29, 73, 220, 272, 33, 22, 163, 24, 19, |
| 145373 | + /* 720 */ 174, 208, 259, 184, 185, 19, 184, 185, 80, 175, |
| 145374 | + /* 730 */ 230, 174, 206, 207, 92, 93, 94, 95, 96, 97, |
| 145375 | + /* 740 */ 98, 99, 100, 101, 102, 219, 46, 65, 247, 195, |
| 145376 | + /* 750 */ 247, 197, 206, 207, 19, 116, 117, 118, 23, 220, |
| 145377 | + /* 760 */ 112, 174, 220, 206, 207, 219, 22, 174, 24, 174, |
| 145378 | + /* 770 */ 22, 23, 91, 264, 265, 168, 219, 91, 43, 44, |
| 145460 | 145379 | /* 780 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 145461 | | - /* 790 */ 55, 56, 57, 12, 206, 207, 163, 247, 163, 247, |
| 145462 | | - /* 800 */ 206, 207, 112, 66, 177, 178, 59, 219, 27, 208, |
| 145463 | | - /* 810 */ 104, 74, 163, 219, 116, 117, 118, 184, 185, 153, |
| 145464 | | - /* 820 */ 154, 163, 163, 42, 163, 163, 120, 92, 93, 94, |
| 145465 | | - /* 830 */ 95, 96, 97, 98, 99, 100, 101, 102, 163, 149, |
| 145466 | | - /* 840 */ 163, 107, 184, 185, 63, 184, 185, 19, 163, 270, |
| 145467 | | - /* 850 */ 163, 23, 273, 106, 205, 11, 119, 255, 46, 184, |
| 145468 | | - /* 860 */ 185, 184, 185, 130, 205, 163, 132, 19, 163, 184, |
| 145380 | + /* 790 */ 55, 56, 57, 206, 207, 12, 163, 149, 255, 206, |
| 145381 | + /* 800 */ 207, 206, 207, 59, 104, 23, 219, 163, 26, 163, |
| 145382 | + /* 810 */ 27, 105, 219, 163, 219, 163, 211, 184, 185, 163, |
| 145383 | + /* 820 */ 120, 163, 146, 163, 148, 42, 221, 92, 93, 94, |
| 145384 | + /* 830 */ 95, 96, 97, 98, 99, 100, 101, 102, 163, 91, |
| 145385 | + /* 840 */ 184, 185, 184, 185, 184, 185, 63, 19, 163, 205, |
| 145386 | + /* 850 */ 106, 23, 245, 163, 208, 248, 116, 117, 118, 184, |
| 145387 | + /* 860 */ 185, 163, 163, 7, 8, 9, 163, 19, 26, 184, |
| 145469 | 145388 | /* 870 */ 185, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 145470 | | - /* 880 */ 52, 53, 54, 55, 56, 57, 184, 185, 26, 184, |
| 145471 | | - /* 890 */ 185, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 145472 | | - /* 900 */ 52, 53, 54, 55, 56, 57, 206, 207, 7, 8, |
| 145473 | | - /* 910 */ 9, 163, 146, 163, 148, 163, 104, 163, 231, 219, |
| 145389 | + /* 880 */ 52, 53, 54, 55, 56, 57, 163, 184, 185, 107, |
| 145390 | + /* 890 */ 163, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 145391 | + /* 900 */ 52, 53, 54, 55, 56, 57, 208, 255, 177, 178, |
| 145392 | + /* 910 */ 163, 184, 185, 163, 132, 163, 141, 163, 143, 22, |
| 145474 | 145393 | /* 920 */ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, |
| 145475 | | - /* 930 */ 102, 163, 184, 185, 184, 185, 184, 185, 184, 185, |
| 145394 | + /* 930 */ 102, 184, 185, 163, 184, 185, 184, 185, 184, 185, |
| 145476 | 145395 | /* 940 */ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, |
| 145477 | | - /* 950 */ 102, 163, 184, 185, 163, 163, 163, 168, 163, 163, |
| 145478 | | - /* 960 */ 163, 117, 118, 163, 237, 163, 237, 163, 26, 107, |
| 145479 | | - /* 970 */ 163, 163, 184, 185, 163, 184, 185, 184, 185, 184, |
| 145480 | | - /* 980 */ 185, 184, 185, 98, 184, 185, 184, 185, 184, 185, |
| 145481 | | - /* 990 */ 163, 184, 185, 207, 132, 147, 163, 19, 163, 272, |
| 145482 | | - /* 1000 */ 163, 272, 163, 24, 163, 219, 163, 199, 163, 124, |
| 145483 | | - /* 1010 */ 163, 184, 185, 23, 129, 19, 26, 184, 185, 184, |
| 145484 | | - /* 1020 */ 185, 184, 185, 184, 185, 184, 185, 184, 185, 184, |
| 145485 | | - /* 1030 */ 185, 184, 185, 163, 245, 19, 163, 248, 59, 43, |
| 145396 | + /* 950 */ 102, 163, 163, 163, 184, 185, 163, 115, 163, 163, |
| 145397 | + /* 960 */ 163, 163, 59, 163, 163, 163, 163, 163, 23, 163, |
| 145398 | + /* 970 */ 163, 26, 184, 185, 184, 185, 163, 184, 185, 184, |
| 145399 | + /* 980 */ 185, 184, 185, 163, 184, 185, 184, 185, 184, 185, |
| 145400 | + /* 990 */ 184, 185, 163, 96, 97, 147, 163, 184, 185, 163, |
| 145401 | + /* 1000 */ 199, 163, 124, 205, 184, 185, 163, 129, 163, 106, |
| 145402 | + /* 1010 */ 163, 234, 163, 184, 185, 19, 163, 184, 185, 230, |
| 145403 | + /* 1020 */ 184, 185, 184, 185, 206, 207, 230, 184, 185, 184, |
| 145404 | + /* 1030 */ 185, 184, 185, 184, 185, 19, 163, 219, 231, 43, |
| 145486 | 145405 | /* 1040 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 145487 | | - /* 1050 */ 54, 55, 56, 57, 184, 185, 163, 184, 185, 43, |
| 145406 | + /* 1050 */ 54, 55, 56, 57, 163, 26, 163, 184, 185, 43, |
| 145488 | 145407 | /* 1060 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 145489 | | - /* 1070 */ 54, 55, 56, 57, 16, 19, 22, 184, 185, 163, |
| 145490 | | - /* 1080 */ 138, 163, 22, 105, 163, 106, 22, 23, 92, 93, |
| 145408 | + /* 1070 */ 54, 55, 56, 57, 163, 184, 185, 184, 185, 163, |
| 145409 | + /* 1080 */ 182, 163, 163, 163, 163, 163, 22, 163, 92, 93, |
| 145491 | 145410 | /* 1090 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 163, |
| 145492 | 145411 | /* 1100 */ 184, 185, 184, 185, 163, 184, 185, 163, 92, 93, |
| 145493 | | - /* 1110 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 59, |
| 145494 | | - /* 1120 */ 184, 185, 177, 178, 163, 184, 185, 163, 184, 185, |
| 145495 | | - /* 1130 */ 26, 163, 163, 182, 163, 77, 163, 79, 127, 128, |
| 145496 | | - /* 1140 */ 262, 263, 124, 147, 24, 184, 185, 129, 184, 185, |
| 145497 | | - /* 1150 */ 96, 97, 184, 185, 163, 91, 224, 225, 211, 31, |
| 145498 | | - /* 1160 */ 22, 105, 24, 19, 118, 163, 106, 39, 24, 222, |
| 145499 | | - /* 1170 */ 23, 23, 23, 26, 26, 26, 23, 23, 23, 26, |
| 145500 | | - /* 1180 */ 26, 26, 23, 19, 22, 26, 140, 43, 44, 45, |
| 145412 | + /* 1110 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 163, |
| 145413 | + /* 1120 */ 184, 185, 98, 59, 163, 184, 185, 205, 184, 185, |
| 145414 | + /* 1130 */ 23, 206, 207, 26, 163, 26, 107, 153, 154, 237, |
| 145415 | + /* 1140 */ 184, 185, 231, 147, 219, 184, 185, 249, 124, 127, |
| 145416 | + /* 1150 */ 128, 231, 254, 129, 118, 231, 177, 178, 262, 263, |
| 145417 | + /* 1160 */ 22, 132, 19, 19, 46, 223, 224, 31, 24, 23, |
| 145418 | + /* 1170 */ 106, 141, 26, 143, 272, 39, 140, 23, 23, 23, |
| 145419 | + /* 1180 */ 26, 26, 26, 19, 22, 109, 110, 43, 44, 45, |
| 145501 | 145420 | /* 1190 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, |
| 145502 | | - /* 1200 */ 56, 57, 231, 23, 231, 254, 26, 43, 44, 45, |
| 145421 | + /* 1200 */ 56, 57, 231, 23, 7, 8, 26, 43, 44, 45, |
| 145503 | 145422 | /* 1210 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, |
| 145504 | | - /* 1220 */ 56, 57, 231, 61, 59, 109, 110, 7, 8, 23, |
| 145505 | | - /* 1230 */ 23, 59, 26, 26, 59, 131, 92, 93, 94, 95, |
| 145506 | | - /* 1240 */ 96, 97, 98, 99, 100, 101, 102, 141, 23, 143, |
| 145507 | | - /* 1250 */ 130, 26, 141, 163, 143, 163, 92, 93, 94, 95, |
| 145508 | | - /* 1260 */ 96, 97, 98, 99, 100, 101, 102, 110, 163, 23, |
| 145509 | | - /* 1270 */ 163, 106, 26, 163, 193, 163, 19, 120, 106, 193, |
| 145510 | | - /* 1280 */ 163, 106, 163, 203, 163, 163, 193, 163, 163, 163, |
| 145511 | | - /* 1290 */ 163, 223, 163, 163, 163, 163, 19, 163, 163, 163, |
| 145423 | + /* 1220 */ 56, 57, 104, 61, 23, 23, 59, 26, 26, 23, |
| 145424 | + /* 1230 */ 23, 23, 26, 26, 26, 59, 92, 93, 94, 95, |
| 145425 | + /* 1240 */ 96, 97, 98, 99, 100, 101, 102, 138, 105, 23, |
| 145426 | + /* 1250 */ 23, 163, 26, 26, 163, 163, 92, 93, 94, 95, |
| 145427 | + /* 1260 */ 96, 97, 98, 99, 100, 101, 102, 110, 130, 163, |
| 145428 | + /* 1270 */ 193, 163, 193, 106, 163, 163, 19, 120, 163, 163, |
| 145429 | + /* 1280 */ 163, 225, 106, 163, 163, 163, 163, 163, 193, 163, |
| 145430 | + /* 1290 */ 163, 163, 163, 163, 163, 163, 19, 222, 163, 203, |
| 145512 | 145431 | /* 1300 */ 163, 44, 45, 46, 47, 48, 49, 50, 51, 52, |
| 145513 | | - /* 1310 */ 53, 54, 55, 56, 57, 163, 251, 250, 209, 163, |
| 145514 | | - /* 1320 */ 223, 163, 45, 46, 47, 48, 49, 50, 51, 52, |
| 145515 | | - /* 1330 */ 53, 54, 55, 56, 57, 161, 223, 223, 223, 256, |
| 145516 | | - /* 1340 */ 256, 196, 182, 19, 20, 227, 22, 244, 187, 92, |
| 145432 | + /* 1310 */ 53, 54, 55, 56, 57, 163, 163, 251, 250, 209, |
| 145433 | + /* 1320 */ 222, 163, 45, 46, 47, 48, 49, 50, 51, 52, |
| 145434 | + /* 1330 */ 53, 54, 55, 56, 57, 163, 163, 163, 163, 161, |
| 145435 | + /* 1340 */ 226, 222, 182, 19, 20, 256, 22, 222, 187, 92, |
| 145517 | 145436 | /* 1350 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, |
| 145518 | | - /* 1360 */ 36, 210, 192, 213, 188, 187, 227, 227, 187, 92, |
| 145437 | + /* 1360 */ 36, 222, 213, 213, 213, 188, 226, 196, 187, 92, |
| 145519 | 145438 | /* 1370 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, |
| 145520 | | - /* 1380 */ 213, 213, 166, 59, 130, 212, 60, 210, 170, 170, |
| 145521 | | - /* 1390 */ 38, 170, 104, 19, 20, 71, 22, 22, 235, 257, |
| 145522 | | - /* 1400 */ 257, 260, 236, 43, 201, 81, 138, 213, 18, 204, |
| 145523 | | - /* 1410 */ 36, 170, 204, 204, 90, 204, 18, 169, 236, 235, |
| 145524 | | - /* 1420 */ 96, 97, 48, 213, 201, 213, 213, 103, 201, 105, |
| 145525 | | - /* 1430 */ 106, 107, 170, 59, 110, 169, 146, 170, 253, 62, |
| 145526 | | - /* 1440 */ 252, 169, 22, 170, 189, 71, 170, 169, 169, 189, |
| 145527 | | - /* 1450 */ 104, 127, 128, 64, 189, 186, 82, 186, 194, 115, |
| 145528 | | - /* 1460 */ 186, 87, 133, 188, 90, 141, 142, 143, 144, 145, |
| 145529 | | - /* 1470 */ 96, 97, 186, 186, 194, 186, 246, 103, 186, 105, |
| 145530 | | - /* 1480 */ 106, 107, 189, 102, 110, 246, 189, 229, 19, 20, |
| 145531 | | - /* 1490 */ 104, 22, 229, 170, 84, 134, 22, 271, 228, 217, |
| 145532 | | - /* 1500 */ 269, 22, 241, 170, 146, 36, 137, 152, 217, 19, |
| 145533 | | - /* 1510 */ 20, 228, 22, 229, 229, 141, 142, 143, 144, 145, |
| 145534 | | - /* 1520 */ 0, 1, 2, 228, 228, 5, 36, 218, 59, 216, |
| 145535 | | - /* 1530 */ 10, 11, 12, 13, 14, 136, 215, 17, 135, 214, |
| 145536 | | - /* 1540 */ 71, 243, 25, 213, 173, 26, 13, 164, 172, 59, |
| 145537 | | - /* 1550 */ 30, 82, 32, 6, 162, 164, 87, 162, 162, 90, |
| 145538 | | - /* 1560 */ 40, 71, 263, 176, 182, 96, 97, 266, 266, 176, |
| 145539 | | - /* 1570 */ 182, 4, 103, 176, 105, 106, 107, 3, 22, 110, |
| 145540 | | - /* 1580 */ 90, 151, 182, 182, 190, 15, 96, 97, 98, 182, |
| 145541 | | - /* 1590 */ 70, 182, 190, 103, 182, 105, 106, 107, 78, 182, |
| 145542 | | - /* 1600 */ 110, 81, 89, 16, 23, 23, 128, 139, 88, 24, |
| 145543 | | - /* 1610 */ 141, 142, 143, 144, 145, 119, 131, 20, 1, 133, |
| 145544 | | - /* 1620 */ 16, 19, 20, 131, 22, 119, 61, 140, 37, 53, |
| 145545 | | - /* 1630 */ 139, 141, 142, 143, 144, 145, 53, 53, 36, 53, |
| 145546 | | - /* 1640 */ 119, 105, 122, 34, 130, 1, 5, 127, 128, 22, |
| 145547 | | - /* 1650 */ 104, 149, 26, 75, 41, 130, 68, 68, 104, 24, |
| 145548 | | - /* 1660 */ 20, 59, 19, 120, 114, 67, 67, 22, 22, 22, |
| 145549 | | - /* 1670 */ 150, 23, 22, 71, 22, 67, 37, 28, 23, 138, |
| 145550 | | - /* 1680 */ 22, 153, 23, 23, 82, 23, 22, 26, 23, 87, |
| 145551 | | - /* 1690 */ 24, 22, 90, 130, 24, 23, 23, 105, 96, 97, |
| 145552 | | - /* 1700 */ 22, 34, 26, 132, 85, 103, 75, 105, 106, 107, |
| 145553 | | - /* 1710 */ 1, 2, 110, 34, 5, 34, 83, 23, 44, 10, |
| 145554 | | - /* 1720 */ 11, 12, 13, 14, 24, 26, 17, 26, 23, 34, |
| 145555 | | - /* 1730 */ 23, 19, 20, 23, 22, 11, 23, 23, 23, 30, |
| 145556 | | - /* 1740 */ 22, 32, 26, 141, 142, 143, 144, 145, 36, 40, |
| 145557 | | - /* 1750 */ 22, 22, 26, 23, 23, 22, 124, 23, 22, 130, |
| 145558 | | - /* 1760 */ 130, 19, 20, 23, 22, 15, 130, 130, 1, 277, |
| 145559 | | - /* 1770 */ 277, 59, 277, 277, 277, 277, 277, 277, 36, 70, |
| 145439 | + /* 1380 */ 210, 192, 187, 59, 166, 226, 244, 60, 130, 256, |
| 145440 | + /* 1390 */ 170, 212, 210, 19, 20, 71, 22, 38, 170, 170, |
| 145441 | + /* 1400 */ 104, 260, 257, 22, 257, 81, 43, 138, 18, 213, |
| 145442 | + /* 1410 */ 36, 201, 170, 204, 90, 204, 204, 204, 18, 236, |
| 145443 | + /* 1420 */ 96, 97, 48, 235, 169, 201, 236, 103, 213, 105, |
| 145444 | + /* 1430 */ 106, 107, 213, 59, 110, 235, 201, 170, 213, 169, |
| 145445 | + /* 1440 */ 146, 62, 170, 169, 253, 71, 252, 22, 189, 170, |
| 145446 | + /* 1450 */ 169, 127, 128, 170, 169, 189, 82, 104, 64, 186, |
| 145447 | + /* 1460 */ 189, 87, 186, 115, 90, 141, 142, 143, 144, 145, |
| 145448 | + /* 1470 */ 96, 97, 186, 186, 194, 186, 188, 103, 194, 105, |
| 145449 | + /* 1480 */ 106, 107, 189, 186, 110, 186, 102, 246, 19, 20, |
| 145450 | + /* 1490 */ 246, 22, 189, 133, 84, 104, 228, 22, 170, 134, |
| 145451 | + /* 1500 */ 269, 271, 227, 137, 22, 36, 228, 216, 216, 19, |
| 145452 | + /* 1510 */ 20, 170, 22, 146, 136, 141, 142, 143, 144, 145, |
| 145453 | + /* 1520 */ 0, 1, 2, 228, 135, 5, 36, 227, 59, 227, |
| 145454 | + /* 1530 */ 10, 11, 12, 13, 14, 228, 227, 17, 217, 241, |
| 145455 | + /* 1540 */ 71, 215, 217, 214, 243, 213, 25, 13, 173, 59, |
| 145456 | + /* 1550 */ 30, 82, 32, 26, 172, 6, 87, 164, 162, 90, |
| 145457 | + /* 1560 */ 40, 71, 164, 162, 162, 96, 97, 182, 176, 263, |
| 145458 | + /* 1570 */ 266, 266, 103, 176, 105, 106, 107, 182, 190, 110, |
| 145459 | + /* 1580 */ 90, 182, 176, 4, 3, 182, 96, 97, 98, 182, |
| 145460 | + /* 1590 */ 70, 182, 22, 103, 190, 105, 106, 107, 78, 182, |
| 145461 | + /* 1600 */ 110, 81, 182, 151, 15, 89, 16, 23, 88, 23, |
| 145462 | + /* 1610 */ 141, 142, 143, 144, 145, 128, 139, 119, 24, 131, |
| 145463 | + /* 1620 */ 20, 19, 20, 16, 22, 133, 1, 131, 119, 140, |
| 145464 | + /* 1630 */ 61, 141, 142, 143, 144, 145, 37, 119, 36, 139, |
| 145465 | + /* 1640 */ 53, 53, 122, 105, 53, 53, 34, 127, 128, 130, |
| 145466 | + /* 1650 */ 1, 5, 22, 149, 104, 26, 41, 75, 130, 104, |
| 145467 | + /* 1660 */ 24, 59, 20, 68, 68, 120, 19, 114, 67, 28, |
| 145468 | + /* 1670 */ 150, 23, 22, 71, 22, 22, 22, 67, 22, 138, |
| 145469 | + /* 1680 */ 67, 37, 23, 22, 82, 153, 23, 23, 26, 87, |
| 145470 | + /* 1690 */ 23, 22, 90, 22, 24, 23, 130, 24, 96, 97, |
| 145471 | + /* 1700 */ 23, 23, 105, 22, 132, 103, 26, 105, 106, 107, |
| 145472 | + /* 1710 */ 1, 2, 110, 34, 5, 75, 34, 34, 85, 10, |
| 145473 | + /* 1720 */ 11, 12, 13, 14, 23, 26, 17, 24, 83, 44, |
| 145474 | + /* 1730 */ 26, 19, 20, 23, 22, 22, 34, 23, 23, 30, |
| 145475 | + /* 1740 */ 23, 32, 23, 141, 142, 143, 144, 145, 36, 40, |
| 145476 | + /* 1750 */ 26, 23, 11, 22, 22, 26, 23, 23, 22, 22, |
| 145477 | + /* 1760 */ 15, 19, 20, 124, 22, 130, 23, 130, 130, 1, |
| 145478 | + /* 1770 */ 277, 59, 277, 130, 277, 277, 277, 277, 36, 70, |
| 145560 | 145479 | /* 1780 */ 277, 277, 277, 71, 277, 277, 277, 78, 277, 277, |
| 145561 | 145480 | /* 1790 */ 81, 277, 277, 277, 277, 277, 277, 88, 277, 277, |
| 145562 | 145481 | /* 1800 */ 277, 59, 90, 277, 277, 277, 277, 277, 96, 97, |
| 145563 | 145482 | /* 1810 */ 277, 277, 277, 71, 277, 103, 277, 105, 106, 107, |
| 145564 | 145483 | /* 1820 */ 277, 277, 110, 277, 277, 277, 277, 277, 277, 277, |
| | @@ -145580,162 +145499,162 @@ |
| 145580 | 145499 | /* 1980 */ 122, 277, 277, 277, 277, 127, 128, 277, 277, 277, |
| 145581 | 145500 | /* 1990 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, |
| 145582 | 145501 | /* 2000 */ 277, 277, 277, 277, 277, 277, 277, 277, 150, 277, |
| 145583 | 145502 | /* 2010 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, |
| 145584 | 145503 | }; |
| 145585 | | -#define YY_SHIFT_COUNT (515) |
| 145504 | +#define YY_SHIFT_COUNT (517) |
| 145586 | 145505 | #define YY_SHIFT_MIN (0) |
| 145587 | 145506 | #define YY_SHIFT_MAX (1858) |
| 145588 | 145507 | static const unsigned short int yy_shift_ofst[] = { |
| 145589 | | - /* 0 */ 1709, 1520, 1858, 1324, 1324, 54, 1374, 1469, 1602, 1712, |
| 145590 | | - /* 10 */ 1712, 1712, 1712, 1712, 273, 0, 0, 113, 1016, 1712, |
| 145508 | + /* 0 */ 1709, 1520, 1858, 1324, 1324, 277, 1374, 1469, 1602, 1712, |
| 145509 | + /* 10 */ 1712, 1712, 273, 0, 0, 113, 1016, 1712, 1712, 1712, |
| 145591 | 145510 | /* 20 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 11, 11, 236, |
| 145592 | | - /* 30 */ 595, 54, 54, 54, 54, 54, 54, 93, 177, 270, |
| 145511 | + /* 30 */ 184, 277, 277, 277, 277, 277, 277, 93, 177, 270, |
| 145593 | 145512 | /* 40 */ 363, 456, 549, 642, 735, 828, 848, 996, 1144, 1016, |
| 145594 | 145513 | /* 50 */ 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, |
| 145595 | 145514 | /* 60 */ 1016, 1016, 1016, 1016, 1016, 1016, 1164, 1016, 1257, 1277, |
| 145596 | 145515 | /* 70 */ 1277, 1490, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, |
| 145597 | 145516 | /* 80 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, |
| 145598 | 145517 | /* 90 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, |
| 145599 | 145518 | /* 100 */ 1712, 1712, 1712, 1742, 1712, 1712, 1712, 1712, 1712, 1712, |
| 145600 | 145519 | /* 110 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 143, 162, 162, |
| 145601 | | - /* 120 */ 162, 162, 162, 204, 151, 73, 596, 690, 706, 596, |
| 145602 | | - /* 130 */ 169, 169, 596, 353, 353, 353, 353, 66, 166, 25, |
| 145603 | | - /* 140 */ 2009, 2009, 331, 331, 331, 329, 366, 329, 329, 610, |
| 145604 | | - /* 150 */ 610, 428, 464, 493, 686, 596, 596, 596, 596, 596, |
| 145605 | | - /* 160 */ 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, |
| 145606 | | - /* 170 */ 596, 596, 596, 596, 596, 596, 596, 844, 667, 666, |
| 145607 | | - /* 180 */ 666, 535, 667, 1011, 2009, 2009, 2009, 387, 250, 250, |
| 145608 | | - /* 190 */ 522, 172, 278, 551, 480, 573, 557, 596, 596, 596, |
| 145609 | | - /* 200 */ 596, 596, 596, 596, 596, 13, 596, 596, 596, 596, |
| 145610 | | - /* 210 */ 596, 596, 596, 596, 596, 596, 596, 596, 737, 737, |
| 145611 | | - /* 220 */ 737, 596, 596, 596, 596, 734, 596, 596, 596, 747, |
| 145612 | | - /* 230 */ 596, 596, 781, 596, 596, 596, 596, 596, 596, 596, |
| 145613 | | - /* 240 */ 596, 429, 691, 279, 979, 979, 979, 979, 862, 279, |
| 145614 | | - /* 250 */ 279, 885, 1054, 901, 942, 978, 978, 1056, 942, 942, |
| 145615 | | - /* 260 */ 1056, 614, 990, 812, 1128, 1128, 1128, 978, 766, 1104, |
| 145616 | | - /* 270 */ 1018, 1138, 1326, 1254, 1254, 1352, 1352, 1254, 1288, 1375, |
| 145617 | | - /* 280 */ 1360, 1268, 1390, 1390, 1390, 1390, 1254, 1398, 1268, 1268, |
| 145618 | | - /* 290 */ 1288, 1375, 1360, 1360, 1268, 1254, 1398, 1290, 1377, 1254, |
| 145619 | | - /* 300 */ 1398, 1420, 1254, 1398, 1254, 1398, 1420, 1346, 1346, 1346, |
| 145620 | | - /* 310 */ 1389, 1420, 1346, 1344, 1346, 1389, 1346, 1346, 1420, 1381, |
| 145621 | | - /* 320 */ 1381, 1420, 1329, 1386, 1329, 1386, 1329, 1386, 1329, 1386, |
| 145622 | | - /* 330 */ 1254, 1361, 1410, 1474, 1479, 1254, 1358, 1369, 1361, 1355, |
| 145623 | | - /* 340 */ 1399, 1403, 1268, 1517, 1519, 1533, 1533, 1547, 1547, 1547, |
| 145624 | | - /* 350 */ 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, |
| 145625 | | - /* 360 */ 2009, 2009, 2009, 2009, 2009, 2009, 286, 345, 568, 1064, |
| 145626 | | - /* 370 */ 1058, 698, 1060, 1147, 373, 1120, 1046, 1148, 1162, 1149, |
| 145627 | | - /* 380 */ 1153, 1154, 1155, 1159, 1180, 1165, 1116, 1220, 1157, 1172, |
| 145628 | | - /* 390 */ 1206, 1207, 1225, 1106, 1111, 1246, 1175, 733, 1567, 1574, |
| 145629 | | - /* 400 */ 1556, 1430, 1570, 1513, 1587, 1581, 1582, 1478, 1468, 1496, |
| 145630 | | - /* 410 */ 1585, 1485, 1597, 1486, 1604, 1617, 1492, 1487, 1506, 1565, |
| 145631 | | - /* 420 */ 1591, 1491, 1576, 1583, 1584, 1586, 1521, 1536, 1609, 1514, |
| 145632 | | - /* 430 */ 1644, 1641, 1627, 1546, 1502, 1588, 1626, 1589, 1578, 1613, |
| 145633 | | - /* 440 */ 1525, 1554, 1635, 1640, 1643, 1543, 1550, 1645, 1598, 1646, |
| 145634 | | - /* 450 */ 1647, 1648, 1650, 1599, 1649, 1652, 1608, 1639, 1655, 1541, |
| 145635 | | - /* 460 */ 1658, 1528, 1659, 1660, 1661, 1662, 1664, 1666, 1665, 1669, |
| 145636 | | - /* 470 */ 1670, 1563, 1672, 1673, 1592, 1667, 1678, 1571, 1676, 1679, |
| 145637 | | - /* 480 */ 1681, 1619, 1631, 1633, 1674, 1694, 1700, 1699, 1701, 1695, |
| 145638 | | - /* 490 */ 1705, 1707, 1710, 1676, 1713, 1714, 1716, 1715, 1718, 1724, |
| 145639 | | - /* 500 */ 1728, 1729, 1730, 1731, 1733, 1734, 1736, 1726, 1632, 1629, |
| 145640 | | - /* 510 */ 1630, 1636, 1637, 1740, 1750, 1767, |
| 145520 | + /* 120 */ 162, 162, 162, 204, 151, 416, 531, 648, 700, 531, |
| 145521 | + /* 130 */ 486, 486, 531, 353, 353, 353, 353, 409, 279, 53, |
| 145522 | + /* 140 */ 2009, 2009, 331, 331, 331, 329, 366, 329, 329, 597, |
| 145523 | + /* 150 */ 597, 464, 474, 262, 681, 531, 531, 531, 531, 531, |
| 145524 | + /* 160 */ 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, |
| 145525 | + /* 170 */ 531, 531, 531, 531, 531, 531, 531, 173, 485, 984, |
| 145526 | + /* 180 */ 984, 576, 485, 19, 1022, 2009, 2009, 2009, 387, 250, |
| 145527 | + /* 190 */ 250, 525, 502, 278, 552, 227, 480, 566, 531, 531, |
| 145528 | + /* 200 */ 531, 531, 531, 531, 531, 531, 639, 531, 531, 531, |
| 145529 | + /* 210 */ 531, 531, 531, 531, 531, 531, 531, 531, 531, 2, |
| 145530 | + /* 220 */ 2, 2, 531, 531, 531, 531, 782, 531, 531, 531, |
| 145531 | + /* 230 */ 744, 531, 531, 783, 531, 531, 531, 531, 531, 531, |
| 145532 | + /* 240 */ 531, 531, 419, 682, 327, 370, 370, 370, 370, 1029, |
| 145533 | + /* 250 */ 327, 327, 1024, 897, 856, 1109, 706, 706, 1143, 1109, |
| 145534 | + /* 260 */ 1109, 1143, 842, 945, 1118, 1136, 1136, 1136, 706, 676, |
| 145535 | + /* 270 */ 400, 878, 694, 1327, 1258, 1258, 1359, 1359, 1258, 1296, |
| 145536 | + /* 280 */ 1381, 1363, 1269, 1390, 1390, 1390, 1390, 1258, 1400, 1269, |
| 145537 | + /* 290 */ 1269, 1296, 1381, 1363, 1363, 1269, 1258, 1400, 1294, 1379, |
| 145538 | + /* 300 */ 1258, 1400, 1425, 1258, 1400, 1258, 1400, 1425, 1353, 1353, |
| 145539 | + /* 310 */ 1353, 1394, 1425, 1353, 1348, 1353, 1394, 1353, 1353, 1425, |
| 145540 | + /* 320 */ 1384, 1384, 1425, 1360, 1391, 1360, 1391, 1360, 1391, 1360, |
| 145541 | + /* 330 */ 1391, 1258, 1365, 1410, 1475, 1366, 1365, 1482, 1258, 1367, |
| 145542 | + /* 340 */ 1366, 1378, 1389, 1269, 1521, 1527, 1534, 1534, 1549, 1549, |
| 145543 | + /* 350 */ 1549, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, |
| 145544 | + /* 360 */ 2009, 2009, 2009, 2009, 2009, 2009, 2009, 570, 345, 686, |
| 145545 | + /* 370 */ 748, 50, 740, 1064, 1107, 469, 537, 1036, 1146, 1162, |
| 145546 | + /* 380 */ 1154, 1155, 1156, 1180, 1201, 1202, 903, 1076, 1197, 1157, |
| 145547 | + /* 390 */ 1167, 1206, 1207, 1208, 775, 1030, 1226, 1227, 1176, 1138, |
| 145548 | + /* 400 */ 1579, 1581, 1570, 1452, 1589, 1516, 1590, 1584, 1586, 1487, |
| 145549 | + /* 410 */ 1477, 1498, 1594, 1488, 1600, 1492, 1607, 1625, 1496, 1489, |
| 145550 | + /* 420 */ 1509, 1569, 1599, 1500, 1587, 1588, 1591, 1592, 1518, 1538, |
| 145551 | + /* 430 */ 1612, 1519, 1649, 1646, 1630, 1550, 1504, 1595, 1629, 1596, |
| 145552 | + /* 440 */ 1582, 1615, 1528, 1555, 1636, 1642, 1647, 1545, 1553, 1650, |
| 145553 | + /* 450 */ 1601, 1652, 1653, 1648, 1654, 1610, 1641, 1656, 1613, 1644, |
| 145554 | + /* 460 */ 1659, 1541, 1661, 1532, 1663, 1664, 1662, 1667, 1669, 1670, |
| 145555 | + /* 470 */ 1672, 1671, 1673, 1566, 1677, 1678, 1597, 1679, 1681, 1572, |
| 145556 | + /* 480 */ 1680, 1682, 1680, 1683, 1633, 1640, 1645, 1685, 1701, 1703, |
| 145557 | + /* 490 */ 1699, 1704, 1702, 1710, 1680, 1714, 1715, 1717, 1719, 1724, |
| 145558 | + /* 500 */ 1728, 1713, 1741, 1731, 1732, 1733, 1734, 1736, 1737, 1729, |
| 145559 | + /* 510 */ 1639, 1635, 1637, 1638, 1643, 1743, 1745, 1768, |
| 145641 | 145560 | }; |
| 145642 | | -#define YY_REDUCE_COUNT (365) |
| 145643 | | -#define YY_REDUCE_MIN (-235) |
| 145644 | | -#define YY_REDUCE_MAX (1417) |
| 145561 | +#define YY_REDUCE_COUNT (366) |
| 145562 | +#define YY_REDUCE_MIN (-237) |
| 145563 | +#define YY_REDUCE_MAX (1420) |
| 145645 | 145564 | static const short yy_reduce_ofst[] = { |
| 145646 | | - /* 0 */ -147, 171, 263, -97, 358, -145, -149, -163, 123, 264, |
| 145647 | | - /* 10 */ 305, 398, 404, 446, 401, -171, -157, -235, -175, -79, |
| 145648 | | - /* 20 */ 189, 196, 333, 490, 378, 375, 497, 550, 552, -42, |
| 145649 | | - /* 30 */ -116, 465, 540, 542, 544, 588, 594, -214, -214, -214, |
| 145650 | | - /* 40 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, |
| 145651 | | - /* 50 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, |
| 145652 | | - /* 60 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, |
| 145653 | | - /* 70 */ -214, 543, 582, 590, 633, 658, 661, 675, 677, 685, |
| 145654 | | - /* 80 */ 702, 705, 748, 750, 752, 754, 768, 788, 791, 793, |
| 145655 | | - /* 90 */ 795, 797, 800, 802, 804, 807, 827, 833, 835, 837, |
| 145656 | | - /* 100 */ 839, 841, 843, 845, 847, 870, 873, 893, 916, 918, |
| 145657 | | - /* 110 */ 921, 936, 941, 944, 961, 964, 968, -214, -214, -214, |
| 145658 | | - /* 120 */ -214, -214, -214, -214, -214, -214, 315, 789, -159, 14, |
| 145659 | | - /* 130 */ 111, 434, 463, 247, 700, 247, 700, -176, -214, -214, |
| 145660 | | - /* 140 */ -214, -214, 300, 300, 300, -162, -74, -129, 125, -165, |
| 145661 | | - /* 150 */ -127, 268, 266, 405, 405, -135, 284, 403, 491, 460, |
| 145662 | | - /* 160 */ 148, 335, 514, 649, 212, 124, 325, 687, 971, 602, |
| 145663 | | - /* 170 */ 973, 659, 323, 601, 808, 991, 41, 951, 627, 727, |
| 145664 | | - /* 180 */ 729, 579, 945, 786, 878, 932, 947, -182, -169, -167, |
| 145665 | | - /* 190 */ -121, -46, 16, 39, 176, 289, 313, 364, 473, 537, |
| 145666 | | - /* 200 */ 613, 635, 662, 792, 796, 165, 811, 969, 1002, 1090, |
| 145667 | | - /* 210 */ 1092, 1105, 1107, 1110, 1112, 1117, 1119, 1121, 1081, 1086, |
| 145668 | | - /* 220 */ 1093, 1122, 1124, 1125, 1126, 481, 1127, 1129, 1130, 1068, |
| 145669 | | - /* 230 */ 1131, 1132, 1080, 1134, 16, 1135, 1136, 1137, 1152, 1156, |
| 145670 | | - /* 240 */ 1158, 1065, 1067, 1109, 1097, 1113, 1114, 1115, 481, 1109, |
| 145671 | | - /* 250 */ 1109, 1151, 1160, 1174, 1150, 1118, 1139, 1083, 1167, 1168, |
| 145672 | | - /* 260 */ 1084, 1176, 1145, 1170, 1161, 1178, 1181, 1140, 1103, 1173, |
| 145673 | | - /* 270 */ 1177, 1216, 1141, 1218, 1219, 1142, 1143, 1221, 1166, 1163, |
| 145674 | | - /* 280 */ 1203, 1194, 1205, 1208, 1209, 1211, 1241, 1248, 1210, 1212, |
| 145675 | | - /* 290 */ 1182, 1184, 1223, 1227, 1213, 1262, 1266, 1185, 1188, 1267, |
| 145676 | | - /* 300 */ 1272, 1255, 1273, 1278, 1276, 1279, 1260, 1269, 1271, 1274, |
| 145677 | | - /* 310 */ 1264, 1265, 1286, 1275, 1287, 1280, 1289, 1292, 1293, 1230, |
| 145678 | | - /* 320 */ 1239, 1297, 1258, 1270, 1263, 1283, 1284, 1295, 1285, 1296, |
| 145679 | | - /* 330 */ 1323, 1282, 1226, 1231, 1261, 1333, 1298, 1309, 1291, 1313, |
| 145680 | | - /* 340 */ 1321, 1325, 1330, 1371, 1376, 1383, 1391, 1392, 1395, 1396, |
| 145681 | | - /* 350 */ 1301, 1302, 1299, 1387, 1382, 1388, 1400, 1401, 1393, 1394, |
| 145682 | | - /* 360 */ 1402, 1407, 1409, 1412, 1417, 1397, |
| 145565 | + /* 0 */ -147, 171, 263, -96, 358, -144, -149, -102, 124, -156, |
| 145566 | + /* 10 */ -98, 305, 401, -57, 209, -237, 245, -94, -79, 189, |
| 145567 | + /* 20 */ 375, 490, 493, 378, 303, 539, 542, 501, 503, 554, |
| 145568 | + /* 30 */ 415, 526, 546, 557, 587, 593, 595, -234, -234, -234, |
| 145569 | + /* 40 */ -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, |
| 145570 | + /* 50 */ -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, |
| 145571 | + /* 60 */ -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, |
| 145572 | + /* 70 */ -234, -50, 335, 470, 633, 656, 658, 660, 675, 685, |
| 145573 | + /* 80 */ 703, 727, 747, 750, 752, 754, 770, 788, 790, 793, |
| 145574 | + /* 90 */ 795, 797, 800, 802, 804, 806, 813, 820, 829, 833, |
| 145575 | + /* 100 */ 836, 838, 843, 845, 847, 849, 873, 891, 893, 916, |
| 145576 | + /* 110 */ 918, 921, 936, 941, 944, 956, 961, -234, -234, -234, |
| 145577 | + /* 120 */ -234, -234, -234, -234, -234, -234, 463, 607, -176, 14, |
| 145578 | + /* 130 */ -139, 87, -137, 818, 925, 818, 925, 898, -234, -234, |
| 145579 | + /* 140 */ -234, -234, -166, -166, -166, -130, -131, -82, -54, -180, |
| 145580 | + /* 150 */ 364, 41, 513, 509, 509, 117, 500, 789, 796, 646, |
| 145581 | + /* 160 */ 192, 291, 644, 798, 120, 807, 543, 911, 920, 652, |
| 145582 | + /* 170 */ 924, 922, 232, 698, 801, 971, 39, 220, 731, 442, |
| 145583 | + /* 180 */ 902, -199, 979, -43, 421, 896, 942, 605, -184, -126, |
| 145584 | + /* 190 */ 155, 172, 281, 304, 377, 538, 650, 690, 699, 723, |
| 145585 | + /* 200 */ 803, 853, 919, 1088, 1091, 1092, 777, 1106, 1108, 1111, |
| 145586 | + /* 210 */ 1112, 1115, 1116, 1117, 1120, 1121, 1122, 1123, 1124, 1077, |
| 145587 | + /* 220 */ 1079, 1095, 1126, 1127, 1128, 1129, 1056, 1130, 1131, 1132, |
| 145588 | + /* 230 */ 1075, 1135, 1137, 1096, 1152, 304, 1153, 1158, 1172, 1173, |
| 145589 | + /* 240 */ 1174, 1175, 1066, 1068, 1110, 1098, 1119, 1125, 1139, 1056, |
| 145590 | + /* 250 */ 1110, 1110, 1170, 1160, 1178, 1149, 1114, 1140, 1089, 1150, |
| 145591 | + /* 260 */ 1151, 1133, 1177, 1171, 1189, 1161, 1181, 1195, 1159, 1142, |
| 145592 | + /* 270 */ 1179, 1182, 1218, 1141, 1220, 1228, 1145, 1147, 1229, 1183, |
| 145593 | + /* 280 */ 1188, 1210, 1196, 1209, 1211, 1212, 1213, 1242, 1255, 1215, |
| 145594 | + /* 290 */ 1219, 1190, 1200, 1224, 1235, 1225, 1267, 1270, 1191, 1194, |
| 145595 | + /* 300 */ 1272, 1274, 1259, 1279, 1281, 1283, 1285, 1266, 1273, 1276, |
| 145596 | + /* 310 */ 1286, 1280, 1271, 1287, 1288, 1289, 1284, 1297, 1299, 1293, |
| 145597 | + /* 320 */ 1241, 1244, 1303, 1268, 1275, 1278, 1300, 1295, 1302, 1307, |
| 145598 | + /* 330 */ 1309, 1328, 1291, 1230, 1231, 1321, 1292, 1298, 1341, 1301, |
| 145599 | + /* 340 */ 1325, 1326, 1329, 1332, 1375, 1382, 1393, 1398, 1396, 1401, |
| 145600 | + /* 350 */ 1402, 1304, 1305, 1306, 1392, 1385, 1395, 1399, 1403, 1397, |
| 145601 | + /* 360 */ 1388, 1404, 1407, 1409, 1417, 1420, 1406, |
| 145683 | 145602 | }; |
| 145684 | 145603 | static const YYACTIONTYPE yy_default[] = { |
| 145685 | | - /* 0 */ 1482, 1482, 1482, 1329, 1115, 1220, 1115, 1115, 1115, 1329, |
| 145686 | | - /* 10 */ 1329, 1329, 1329, 1329, 1115, 1250, 1250, 1380, 1146, 1115, |
| 145687 | | - /* 20 */ 1115, 1115, 1115, 1115, 1115, 1328, 1115, 1115, 1115, 1115, |
| 145688 | | - /* 30 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1256, 1115, |
| 145689 | | - /* 40 */ 1115, 1115, 1115, 1115, 1330, 1331, 1115, 1115, 1115, 1379, |
| 145690 | | - /* 50 */ 1381, 1266, 1265, 1264, 1263, 1362, 1237, 1261, 1254, 1258, |
| 145691 | | - /* 60 */ 1324, 1325, 1323, 1327, 1330, 1331, 1115, 1257, 1295, 1309, |
| 145692 | | - /* 70 */ 1294, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145693 | | - /* 80 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145694 | | - /* 90 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145695 | | - /* 100 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145696 | | - /* 110 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1303, 1308, 1314, |
| 145697 | | - /* 120 */ 1307, 1304, 1297, 1296, 1298, 1299, 1115, 1136, 1185, 1115, |
| 145698 | | - /* 130 */ 1115, 1115, 1115, 1397, 1396, 1115, 1115, 1146, 1300, 1301, |
| 145699 | | - /* 140 */ 1311, 1310, 1387, 1438, 1437, 1115, 1115, 1115, 1115, 1115, |
| 145700 | | - /* 150 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145701 | | - /* 160 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145702 | | - /* 170 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1146, 1142, 1420, |
| 145703 | | - /* 180 */ 1420, 1406, 1142, 1115, 1392, 1220, 1211, 1115, 1115, 1115, |
| 145704 | | - /* 190 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1384, 1382, |
| 145705 | | - /* 200 */ 1115, 1344, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145706 | | - /* 210 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145707 | | - /* 220 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1216, |
| 145708 | | - /* 230 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145709 | | - /* 240 */ 1432, 1115, 1357, 1199, 1216, 1216, 1216, 1216, 1218, 1200, |
| 145710 | | - /* 250 */ 1198, 1210, 1146, 1122, 1260, 1239, 1239, 1471, 1260, 1260, |
| 145711 | | - /* 260 */ 1471, 1160, 1452, 1157, 1250, 1250, 1250, 1239, 1326, 1217, |
| 145712 | | - /* 270 */ 1210, 1115, 1474, 1225, 1225, 1473, 1473, 1225, 1269, 1275, |
| 145713 | | - /* 280 */ 1188, 1260, 1194, 1194, 1194, 1194, 1225, 1133, 1260, 1260, |
| 145714 | | - /* 290 */ 1269, 1275, 1188, 1188, 1260, 1225, 1133, 1361, 1468, 1225, |
| 145715 | | - /* 300 */ 1133, 1337, 1225, 1133, 1225, 1133, 1337, 1186, 1186, 1186, |
| 145716 | | - /* 310 */ 1175, 1337, 1186, 1160, 1186, 1175, 1186, 1186, 1337, 1341, |
| 145717 | | - /* 320 */ 1341, 1337, 1243, 1238, 1243, 1238, 1243, 1238, 1243, 1238, |
| 145718 | | - /* 330 */ 1225, 1244, 1405, 1115, 1332, 1225, 1115, 1255, 1244, 1418, |
| 145719 | | - /* 340 */ 1253, 1251, 1260, 1139, 1178, 1435, 1435, 1431, 1431, 1431, |
| 145720 | | - /* 350 */ 1479, 1479, 1392, 1447, 1146, 1146, 1146, 1146, 1447, 1162, |
| 145721 | | - /* 360 */ 1162, 1146, 1146, 1146, 1146, 1447, 1115, 1115, 1115, 1115, |
| 145722 | | - /* 370 */ 1115, 1115, 1442, 1115, 1346, 1229, 1115, 1115, 1115, 1115, |
| 145723 | | - /* 380 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145724 | | - /* 390 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1280, 1115, 1118, |
| 145725 | | - /* 400 */ 1389, 1115, 1115, 1388, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145726 | | - /* 410 */ 1230, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145727 | | - /* 420 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1470, |
| 145728 | | - /* 430 */ 1115, 1115, 1115, 1115, 1115, 1115, 1360, 1359, 1115, 1115, |
| 145729 | | - /* 440 */ 1227, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145730 | | - /* 450 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145731 | | - /* 460 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145732 | | - /* 470 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1252, 1115, |
| 145733 | | - /* 480 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1419, 1245, 1115, |
| 145734 | | - /* 490 */ 1115, 1115, 1115, 1461, 1115, 1115, 1115, 1115, 1115, 1115, |
| 145735 | | - /* 500 */ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1456, 1202, 1282, |
| 145736 | | - /* 510 */ 1115, 1281, 1285, 1115, 1127, 1115, |
| 145604 | + /* 0 */ 1486, 1486, 1486, 1335, 1118, 1224, 1118, 1118, 1118, 1335, |
| 145605 | + /* 10 */ 1335, 1335, 1118, 1254, 1254, 1386, 1149, 1118, 1118, 1118, |
| 145606 | + /* 20 */ 1118, 1118, 1118, 1118, 1334, 1118, 1118, 1118, 1118, 1118, |
| 145607 | + /* 30 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1260, 1118, |
| 145608 | + /* 40 */ 1118, 1118, 1118, 1118, 1336, 1337, 1118, 1118, 1118, 1385, |
| 145609 | + /* 50 */ 1387, 1270, 1269, 1268, 1267, 1368, 1241, 1265, 1258, 1262, |
| 145610 | + /* 60 */ 1330, 1331, 1329, 1333, 1337, 1336, 1118, 1261, 1301, 1315, |
| 145611 | + /* 70 */ 1300, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145612 | + /* 80 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145613 | + /* 90 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145614 | + /* 100 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145615 | + /* 110 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1309, 1314, 1320, |
| 145616 | + /* 120 */ 1313, 1310, 1303, 1302, 1304, 1305, 1118, 1139, 1188, 1118, |
| 145617 | + /* 130 */ 1118, 1118, 1118, 1403, 1402, 1118, 1118, 1149, 1306, 1307, |
| 145618 | + /* 140 */ 1317, 1316, 1393, 1442, 1441, 1118, 1118, 1118, 1118, 1118, |
| 145619 | + /* 150 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145620 | + /* 160 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145621 | + /* 170 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1149, 1145, 1295, |
| 145622 | + /* 180 */ 1294, 1412, 1145, 1248, 1118, 1398, 1224, 1215, 1118, 1118, |
| 145623 | + /* 190 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1390, |
| 145624 | + /* 200 */ 1388, 1118, 1350, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145625 | + /* 210 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145626 | + /* 220 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145627 | + /* 230 */ 1220, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145628 | + /* 240 */ 1118, 1436, 1118, 1363, 1202, 1220, 1220, 1220, 1220, 1222, |
| 145629 | + /* 250 */ 1203, 1201, 1214, 1149, 1125, 1264, 1243, 1243, 1475, 1264, |
| 145630 | + /* 260 */ 1264, 1475, 1163, 1456, 1160, 1254, 1254, 1254, 1243, 1332, |
| 145631 | + /* 270 */ 1221, 1214, 1118, 1478, 1229, 1229, 1477, 1477, 1229, 1273, |
| 145632 | + /* 280 */ 1279, 1191, 1264, 1197, 1197, 1197, 1197, 1229, 1136, 1264, |
| 145633 | + /* 290 */ 1264, 1273, 1279, 1191, 1191, 1264, 1229, 1136, 1367, 1472, |
| 145634 | + /* 300 */ 1229, 1136, 1343, 1229, 1136, 1229, 1136, 1343, 1189, 1189, |
| 145635 | + /* 310 */ 1189, 1178, 1343, 1189, 1163, 1189, 1178, 1189, 1189, 1343, |
| 145636 | + /* 320 */ 1347, 1347, 1343, 1247, 1242, 1247, 1242, 1247, 1242, 1247, |
| 145637 | + /* 330 */ 1242, 1229, 1248, 1411, 1118, 1259, 1248, 1338, 1229, 1118, |
| 145638 | + /* 340 */ 1259, 1257, 1255, 1264, 1142, 1181, 1439, 1439, 1435, 1435, |
| 145639 | + /* 350 */ 1435, 1483, 1483, 1398, 1451, 1149, 1149, 1149, 1149, 1451, |
| 145640 | + /* 360 */ 1165, 1165, 1149, 1149, 1149, 1149, 1451, 1118, 1118, 1118, |
| 145641 | + /* 370 */ 1118, 1118, 1118, 1446, 1118, 1352, 1233, 1118, 1118, 1118, |
| 145642 | + /* 380 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145643 | + /* 390 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1284, |
| 145644 | + /* 400 */ 1118, 1121, 1395, 1118, 1118, 1394, 1118, 1118, 1118, 1118, |
| 145645 | + /* 410 */ 1118, 1118, 1234, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145646 | + /* 420 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145647 | + /* 430 */ 1118, 1474, 1118, 1118, 1118, 1118, 1118, 1118, 1366, 1365, |
| 145648 | + /* 440 */ 1118, 1118, 1231, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145649 | + /* 450 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145650 | + /* 460 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145651 | + /* 470 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145652 | + /* 480 */ 1256, 1118, 1410, 1118, 1118, 1118, 1118, 1118, 1118, 1118, |
| 145653 | + /* 490 */ 1424, 1249, 1118, 1118, 1465, 1118, 1118, 1118, 1118, 1118, |
| 145654 | + /* 500 */ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1460, |
| 145655 | + /* 510 */ 1205, 1286, 1118, 1285, 1289, 1118, 1130, 1118, |
| 145737 | 145656 | }; |
| 145738 | 145657 | /********** End of lemon-generated parsing tables *****************************/ |
| 145739 | 145658 | |
| 145740 | 145659 | /* The next table maps tokens (terminal symbols) into fallback tokens. |
| 145741 | 145660 | ** If a construct like the following: |
| | @@ -146145,32 +146064,32 @@ |
| 146145 | 146064 | /* 211 */ "selcollist", |
| 146146 | 146065 | /* 212 */ "from", |
| 146147 | 146066 | /* 213 */ "where_opt", |
| 146148 | 146067 | /* 214 */ "groupby_opt", |
| 146149 | 146068 | /* 215 */ "having_opt", |
| 146150 | | - /* 216 */ "windowdefn_opt", |
| 146151 | | - /* 217 */ "orderby_opt", |
| 146152 | | - /* 218 */ "limit_opt", |
| 146069 | + /* 216 */ "orderby_opt", |
| 146070 | + /* 217 */ "limit_opt", |
| 146071 | + /* 218 */ "window_clause", |
| 146153 | 146072 | /* 219 */ "values", |
| 146154 | 146073 | /* 220 */ "nexprlist", |
| 146155 | | - /* 221 */ "exprlist", |
| 146156 | | - /* 222 */ "sclp", |
| 146157 | | - /* 223 */ "as", |
| 146158 | | - /* 224 */ "seltablist", |
| 146159 | | - /* 225 */ "stl_prefix", |
| 146160 | | - /* 226 */ "joinop", |
| 146161 | | - /* 227 */ "indexed_opt", |
| 146162 | | - /* 228 */ "on_opt", |
| 146163 | | - /* 229 */ "using_opt", |
| 146074 | + /* 221 */ "sclp", |
| 146075 | + /* 222 */ "as", |
| 146076 | + /* 223 */ "seltablist", |
| 146077 | + /* 224 */ "stl_prefix", |
| 146078 | + /* 225 */ "joinop", |
| 146079 | + /* 226 */ "indexed_opt", |
| 146080 | + /* 227 */ "on_opt", |
| 146081 | + /* 228 */ "using_opt", |
| 146082 | + /* 229 */ "exprlist", |
| 146164 | 146083 | /* 230 */ "xfullname", |
| 146165 | 146084 | /* 231 */ "idlist", |
| 146166 | 146085 | /* 232 */ "with", |
| 146167 | 146086 | /* 233 */ "setlist", |
| 146168 | 146087 | /* 234 */ "insert_cmd", |
| 146169 | 146088 | /* 235 */ "idlist_opt", |
| 146170 | 146089 | /* 236 */ "upsert", |
| 146171 | | - /* 237 */ "over_opt", |
| 146090 | + /* 237 */ "over_clause", |
| 146172 | 146091 | /* 238 */ "likeop", |
| 146173 | 146092 | /* 239 */ "between_op", |
| 146174 | 146093 | /* 240 */ "in_op", |
| 146175 | 146094 | /* 241 */ "paren_exprlist", |
| 146176 | 146095 | /* 242 */ "case_operand", |
| | @@ -146300,288 +146219,289 @@ |
| 146300 | 146219 | /* 82 */ "select ::= selectnowith", |
| 146301 | 146220 | /* 83 */ "selectnowith ::= selectnowith multiselect_op oneselect", |
| 146302 | 146221 | /* 84 */ "multiselect_op ::= UNION", |
| 146303 | 146222 | /* 85 */ "multiselect_op ::= UNION ALL", |
| 146304 | 146223 | /* 86 */ "multiselect_op ::= EXCEPT|INTERSECT", |
| 146305 | | - /* 87 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt windowdefn_opt orderby_opt limit_opt", |
| 146306 | | - /* 88 */ "values ::= VALUES LP nexprlist RP", |
| 146307 | | - /* 89 */ "values ::= values COMMA LP exprlist RP", |
| 146308 | | - /* 90 */ "distinct ::= DISTINCT", |
| 146309 | | - /* 91 */ "distinct ::= ALL", |
| 146310 | | - /* 92 */ "distinct ::=", |
| 146311 | | - /* 93 */ "sclp ::=", |
| 146312 | | - /* 94 */ "selcollist ::= sclp scanpt expr scanpt as", |
| 146313 | | - /* 95 */ "selcollist ::= sclp scanpt STAR", |
| 146314 | | - /* 96 */ "selcollist ::= sclp scanpt nm DOT STAR", |
| 146315 | | - /* 97 */ "as ::= AS nm", |
| 146316 | | - /* 98 */ "as ::=", |
| 146317 | | - /* 99 */ "from ::=", |
| 146318 | | - /* 100 */ "from ::= FROM seltablist", |
| 146319 | | - /* 101 */ "stl_prefix ::= seltablist joinop", |
| 146320 | | - /* 102 */ "stl_prefix ::=", |
| 146321 | | - /* 103 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", |
| 146322 | | - /* 104 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt", |
| 146323 | | - /* 105 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt", |
| 146324 | | - /* 106 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt", |
| 146325 | | - /* 107 */ "dbnm ::=", |
| 146326 | | - /* 108 */ "dbnm ::= DOT nm", |
| 146327 | | - /* 109 */ "fullname ::= nm", |
| 146328 | | - /* 110 */ "fullname ::= nm DOT nm", |
| 146329 | | - /* 111 */ "xfullname ::= nm", |
| 146330 | | - /* 112 */ "xfullname ::= nm DOT nm", |
| 146331 | | - /* 113 */ "xfullname ::= nm DOT nm AS nm", |
| 146332 | | - /* 114 */ "xfullname ::= nm AS nm", |
| 146333 | | - /* 115 */ "joinop ::= COMMA|JOIN", |
| 146334 | | - /* 116 */ "joinop ::= JOIN_KW JOIN", |
| 146335 | | - /* 117 */ "joinop ::= JOIN_KW nm JOIN", |
| 146336 | | - /* 118 */ "joinop ::= JOIN_KW nm nm JOIN", |
| 146337 | | - /* 119 */ "on_opt ::= ON expr", |
| 146338 | | - /* 120 */ "on_opt ::=", |
| 146339 | | - /* 121 */ "indexed_opt ::=", |
| 146340 | | - /* 122 */ "indexed_opt ::= INDEXED BY nm", |
| 146341 | | - /* 123 */ "indexed_opt ::= NOT INDEXED", |
| 146342 | | - /* 124 */ "using_opt ::= USING LP idlist RP", |
| 146343 | | - /* 125 */ "using_opt ::=", |
| 146344 | | - /* 126 */ "orderby_opt ::=", |
| 146345 | | - /* 127 */ "orderby_opt ::= ORDER BY sortlist", |
| 146346 | | - /* 128 */ "sortlist ::= sortlist COMMA expr sortorder", |
| 146347 | | - /* 129 */ "sortlist ::= expr sortorder", |
| 146348 | | - /* 130 */ "sortorder ::= ASC", |
| 146349 | | - /* 131 */ "sortorder ::= DESC", |
| 146350 | | - /* 132 */ "sortorder ::=", |
| 146351 | | - /* 133 */ "groupby_opt ::=", |
| 146352 | | - /* 134 */ "groupby_opt ::= GROUP BY nexprlist", |
| 146353 | | - /* 135 */ "having_opt ::=", |
| 146354 | | - /* 136 */ "having_opt ::= HAVING expr", |
| 146355 | | - /* 137 */ "limit_opt ::=", |
| 146356 | | - /* 138 */ "limit_opt ::= LIMIT expr", |
| 146357 | | - /* 139 */ "limit_opt ::= LIMIT expr OFFSET expr", |
| 146358 | | - /* 140 */ "limit_opt ::= LIMIT expr COMMA expr", |
| 146359 | | - /* 141 */ "cmd ::= with DELETE FROM xfullname indexed_opt where_opt", |
| 146360 | | - /* 142 */ "where_opt ::=", |
| 146361 | | - /* 143 */ "where_opt ::= WHERE expr", |
| 146362 | | - /* 144 */ "cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt", |
| 146363 | | - /* 145 */ "setlist ::= setlist COMMA nm EQ expr", |
| 146364 | | - /* 146 */ "setlist ::= setlist COMMA LP idlist RP EQ expr", |
| 146365 | | - /* 147 */ "setlist ::= nm EQ expr", |
| 146366 | | - /* 148 */ "setlist ::= LP idlist RP EQ expr", |
| 146367 | | - /* 149 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert", |
| 146368 | | - /* 150 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES", |
| 146369 | | - /* 151 */ "upsert ::=", |
| 146370 | | - /* 152 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt", |
| 146371 | | - /* 153 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING", |
| 146372 | | - /* 154 */ "upsert ::= ON CONFLICT DO NOTHING", |
| 146373 | | - /* 155 */ "insert_cmd ::= INSERT orconf", |
| 146374 | | - /* 156 */ "insert_cmd ::= REPLACE", |
| 146375 | | - /* 157 */ "idlist_opt ::=", |
| 146376 | | - /* 158 */ "idlist_opt ::= LP idlist RP", |
| 146377 | | - /* 159 */ "idlist ::= idlist COMMA nm", |
| 146378 | | - /* 160 */ "idlist ::= nm", |
| 146379 | | - /* 161 */ "expr ::= LP expr RP", |
| 146380 | | - /* 162 */ "expr ::= ID|INDEXED", |
| 146381 | | - /* 163 */ "expr ::= JOIN_KW", |
| 146382 | | - /* 164 */ "expr ::= nm DOT nm", |
| 146383 | | - /* 165 */ "expr ::= nm DOT nm DOT nm", |
| 146384 | | - /* 166 */ "term ::= NULL|FLOAT|BLOB", |
| 146385 | | - /* 167 */ "term ::= STRING", |
| 146386 | | - /* 168 */ "term ::= INTEGER", |
| 146387 | | - /* 169 */ "expr ::= VARIABLE", |
| 146388 | | - /* 170 */ "expr ::= expr COLLATE ID|STRING", |
| 146389 | | - /* 171 */ "expr ::= CAST LP expr AS typetoken RP", |
| 146390 | | - /* 172 */ "expr ::= ID|INDEXED LP distinct exprlist RP over_opt", |
| 146391 | | - /* 173 */ "expr ::= ID|INDEXED LP STAR RP over_opt", |
| 146392 | | - /* 174 */ "term ::= CTIME_KW", |
| 146393 | | - /* 175 */ "expr ::= LP nexprlist COMMA expr RP", |
| 146394 | | - /* 176 */ "expr ::= expr AND expr", |
| 146395 | | - /* 177 */ "expr ::= expr OR expr", |
| 146396 | | - /* 178 */ "expr ::= expr LT|GT|GE|LE expr", |
| 146397 | | - /* 179 */ "expr ::= expr EQ|NE expr", |
| 146398 | | - /* 180 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", |
| 146399 | | - /* 181 */ "expr ::= expr PLUS|MINUS expr", |
| 146400 | | - /* 182 */ "expr ::= expr STAR|SLASH|REM expr", |
| 146401 | | - /* 183 */ "expr ::= expr CONCAT expr", |
| 146402 | | - /* 184 */ "likeop ::= NOT LIKE_KW|MATCH", |
| 146403 | | - /* 185 */ "expr ::= expr likeop expr", |
| 146404 | | - /* 186 */ "expr ::= expr likeop expr ESCAPE expr", |
| 146405 | | - /* 187 */ "expr ::= expr ISNULL|NOTNULL", |
| 146406 | | - /* 188 */ "expr ::= expr NOT NULL", |
| 146407 | | - /* 189 */ "expr ::= expr IS expr", |
| 146408 | | - /* 190 */ "expr ::= expr IS NOT expr", |
| 146409 | | - /* 191 */ "expr ::= NOT expr", |
| 146410 | | - /* 192 */ "expr ::= BITNOT expr", |
| 146411 | | - /* 193 */ "expr ::= PLUS|MINUS expr", |
| 146412 | | - /* 194 */ "between_op ::= BETWEEN", |
| 146413 | | - /* 195 */ "between_op ::= NOT BETWEEN", |
| 146414 | | - /* 196 */ "expr ::= expr between_op expr AND expr", |
| 146415 | | - /* 197 */ "in_op ::= IN", |
| 146416 | | - /* 198 */ "in_op ::= NOT IN", |
| 146417 | | - /* 199 */ "expr ::= expr in_op LP exprlist RP", |
| 146418 | | - /* 200 */ "expr ::= LP select RP", |
| 146419 | | - /* 201 */ "expr ::= expr in_op LP select RP", |
| 146420 | | - /* 202 */ "expr ::= expr in_op nm dbnm paren_exprlist", |
| 146421 | | - /* 203 */ "expr ::= EXISTS LP select RP", |
| 146422 | | - /* 204 */ "expr ::= CASE case_operand case_exprlist case_else END", |
| 146423 | | - /* 205 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", |
| 146424 | | - /* 206 */ "case_exprlist ::= WHEN expr THEN expr", |
| 146425 | | - /* 207 */ "case_else ::= ELSE expr", |
| 146426 | | - /* 208 */ "case_else ::=", |
| 146427 | | - /* 209 */ "case_operand ::= expr", |
| 146428 | | - /* 210 */ "case_operand ::=", |
| 146429 | | - /* 211 */ "exprlist ::=", |
| 146430 | | - /* 212 */ "nexprlist ::= nexprlist COMMA expr", |
| 146431 | | - /* 213 */ "nexprlist ::= expr", |
| 146432 | | - /* 214 */ "paren_exprlist ::=", |
| 146433 | | - /* 215 */ "paren_exprlist ::= LP exprlist RP", |
| 146434 | | - /* 216 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt", |
| 146435 | | - /* 217 */ "uniqueflag ::= UNIQUE", |
| 146436 | | - /* 218 */ "uniqueflag ::=", |
| 146437 | | - /* 219 */ "eidlist_opt ::=", |
| 146438 | | - /* 220 */ "eidlist_opt ::= LP eidlist RP", |
| 146439 | | - /* 221 */ "eidlist ::= eidlist COMMA nm collate sortorder", |
| 146440 | | - /* 222 */ "eidlist ::= nm collate sortorder", |
| 146441 | | - /* 223 */ "collate ::=", |
| 146442 | | - /* 224 */ "collate ::= COLLATE ID|STRING", |
| 146443 | | - /* 225 */ "cmd ::= DROP INDEX ifexists fullname", |
| 146444 | | - /* 226 */ "cmd ::= VACUUM", |
| 146445 | | - /* 227 */ "cmd ::= VACUUM nm", |
| 146446 | | - /* 228 */ "cmd ::= PRAGMA nm dbnm", |
| 146447 | | - /* 229 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", |
| 146448 | | - /* 230 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", |
| 146449 | | - /* 231 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", |
| 146450 | | - /* 232 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", |
| 146451 | | - /* 233 */ "plus_num ::= PLUS INTEGER|FLOAT", |
| 146452 | | - /* 234 */ "minus_num ::= MINUS INTEGER|FLOAT", |
| 146453 | | - /* 235 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", |
| 146454 | | - /* 236 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", |
| 146455 | | - /* 237 */ "trigger_time ::= BEFORE|AFTER", |
| 146456 | | - /* 238 */ "trigger_time ::= INSTEAD OF", |
| 146457 | | - /* 239 */ "trigger_time ::=", |
| 146458 | | - /* 240 */ "trigger_event ::= DELETE|INSERT", |
| 146459 | | - /* 241 */ "trigger_event ::= UPDATE", |
| 146460 | | - /* 242 */ "trigger_event ::= UPDATE OF idlist", |
| 146461 | | - /* 243 */ "when_clause ::=", |
| 146462 | | - /* 244 */ "when_clause ::= WHEN expr", |
| 146463 | | - /* 245 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", |
| 146464 | | - /* 246 */ "trigger_cmd_list ::= trigger_cmd SEMI", |
| 146465 | | - /* 247 */ "trnm ::= nm DOT nm", |
| 146466 | | - /* 248 */ "tridxby ::= INDEXED BY nm", |
| 146467 | | - /* 249 */ "tridxby ::= NOT INDEXED", |
| 146468 | | - /* 250 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt", |
| 146469 | | - /* 251 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt", |
| 146470 | | - /* 252 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt", |
| 146471 | | - /* 253 */ "trigger_cmd ::= scanpt select scanpt", |
| 146472 | | - /* 254 */ "expr ::= RAISE LP IGNORE RP", |
| 146473 | | - /* 255 */ "expr ::= RAISE LP raisetype COMMA nm RP", |
| 146474 | | - /* 256 */ "raisetype ::= ROLLBACK", |
| 146475 | | - /* 257 */ "raisetype ::= ABORT", |
| 146476 | | - /* 258 */ "raisetype ::= FAIL", |
| 146477 | | - /* 259 */ "cmd ::= DROP TRIGGER ifexists fullname", |
| 146478 | | - /* 260 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", |
| 146479 | | - /* 261 */ "cmd ::= DETACH database_kw_opt expr", |
| 146480 | | - /* 262 */ "key_opt ::=", |
| 146481 | | - /* 263 */ "key_opt ::= KEY expr", |
| 146482 | | - /* 264 */ "cmd ::= REINDEX", |
| 146483 | | - /* 265 */ "cmd ::= REINDEX nm dbnm", |
| 146484 | | - /* 266 */ "cmd ::= ANALYZE", |
| 146485 | | - /* 267 */ "cmd ::= ANALYZE nm dbnm", |
| 146486 | | - /* 268 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", |
| 146487 | | - /* 269 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist", |
| 146488 | | - /* 270 */ "add_column_fullname ::= fullname", |
| 146489 | | - /* 271 */ "cmd ::= create_vtab", |
| 146490 | | - /* 272 */ "cmd ::= create_vtab LP vtabarglist RP", |
| 146491 | | - /* 273 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", |
| 146492 | | - /* 274 */ "vtabarg ::=", |
| 146493 | | - /* 275 */ "vtabargtoken ::= ANY", |
| 146494 | | - /* 276 */ "vtabargtoken ::= lp anylist RP", |
| 146495 | | - /* 277 */ "lp ::= LP", |
| 146496 | | - /* 278 */ "with ::= WITH wqlist", |
| 146497 | | - /* 279 */ "with ::= WITH RECURSIVE wqlist", |
| 146498 | | - /* 280 */ "wqlist ::= nm eidlist_opt AS LP select RP", |
| 146499 | | - /* 281 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP", |
| 146500 | | - /* 282 */ "windowdefn_list ::= windowdefn", |
| 146501 | | - /* 283 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn", |
| 146502 | | - /* 284 */ "windowdefn ::= nm AS window", |
| 146503 | | - /* 285 */ "window ::= LP part_opt orderby_opt frame_opt RP", |
| 146504 | | - /* 286 */ "part_opt ::= PARTITION BY exprlist", |
| 146505 | | - /* 287 */ "part_opt ::=", |
| 146506 | | - /* 288 */ "frame_opt ::=", |
| 146507 | | - /* 289 */ "frame_opt ::= range_or_rows frame_bound_s", |
| 146508 | | - /* 290 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e", |
| 146509 | | - /* 291 */ "range_or_rows ::= RANGE", |
| 146510 | | - /* 292 */ "range_or_rows ::= ROWS", |
| 146511 | | - /* 293 */ "frame_bound_s ::= frame_bound", |
| 146512 | | - /* 294 */ "frame_bound_s ::= UNBOUNDED PRECEDING", |
| 146513 | | - /* 295 */ "frame_bound_e ::= frame_bound", |
| 146514 | | - /* 296 */ "frame_bound_e ::= UNBOUNDED FOLLOWING", |
| 146515 | | - /* 297 */ "frame_bound ::= expr PRECEDING", |
| 146516 | | - /* 298 */ "frame_bound ::= CURRENT ROW", |
| 146517 | | - /* 299 */ "frame_bound ::= expr FOLLOWING", |
| 146518 | | - /* 300 */ "windowdefn_opt ::=", |
| 146519 | | - /* 301 */ "windowdefn_opt ::= WINDOW windowdefn_list", |
| 146520 | | - /* 302 */ "over_opt ::=", |
| 146521 | | - /* 303 */ "over_opt ::= filter_opt OVER window", |
| 146522 | | - /* 304 */ "over_opt ::= filter_opt OVER nm", |
| 146523 | | - /* 305 */ "filter_opt ::=", |
| 146524 | | - /* 306 */ "filter_opt ::= FILTER LP WHERE expr RP", |
| 146525 | | - /* 307 */ "input ::= cmdlist", |
| 146526 | | - /* 308 */ "cmdlist ::= cmdlist ecmd", |
| 146527 | | - /* 309 */ "cmdlist ::= ecmd", |
| 146528 | | - /* 310 */ "ecmd ::= SEMI", |
| 146529 | | - /* 311 */ "ecmd ::= cmdx SEMI", |
| 146530 | | - /* 312 */ "ecmd ::= explain cmdx", |
| 146531 | | - /* 313 */ "trans_opt ::=", |
| 146532 | | - /* 314 */ "trans_opt ::= TRANSACTION", |
| 146533 | | - /* 315 */ "trans_opt ::= TRANSACTION nm", |
| 146534 | | - /* 316 */ "savepoint_opt ::= SAVEPOINT", |
| 146535 | | - /* 317 */ "savepoint_opt ::=", |
| 146536 | | - /* 318 */ "cmd ::= create_table create_table_args", |
| 146537 | | - /* 319 */ "columnlist ::= columnlist COMMA columnname carglist", |
| 146538 | | - /* 320 */ "columnlist ::= columnname carglist", |
| 146539 | | - /* 321 */ "nm ::= ID|INDEXED", |
| 146540 | | - /* 322 */ "nm ::= STRING", |
| 146541 | | - /* 323 */ "nm ::= JOIN_KW", |
| 146542 | | - /* 324 */ "typetoken ::= typename", |
| 146543 | | - /* 325 */ "typename ::= ID|STRING", |
| 146544 | | - /* 326 */ "signed ::= plus_num", |
| 146545 | | - /* 327 */ "signed ::= minus_num", |
| 146546 | | - /* 328 */ "carglist ::= carglist ccons", |
| 146547 | | - /* 329 */ "carglist ::=", |
| 146548 | | - /* 330 */ "ccons ::= NULL onconf", |
| 146549 | | - /* 331 */ "conslist_opt ::= COMMA conslist", |
| 146550 | | - /* 332 */ "conslist ::= conslist tconscomma tcons", |
| 146551 | | - /* 333 */ "conslist ::= tcons", |
| 146552 | | - /* 334 */ "tconscomma ::=", |
| 146553 | | - /* 335 */ "defer_subclause_opt ::= defer_subclause", |
| 146554 | | - /* 336 */ "resolvetype ::= raisetype", |
| 146555 | | - /* 337 */ "selectnowith ::= oneselect", |
| 146556 | | - /* 338 */ "oneselect ::= values", |
| 146557 | | - /* 339 */ "sclp ::= selcollist COMMA", |
| 146558 | | - /* 340 */ "as ::= ID|STRING", |
| 146559 | | - /* 341 */ "expr ::= term", |
| 146560 | | - /* 342 */ "likeop ::= LIKE_KW|MATCH", |
| 146561 | | - /* 343 */ "exprlist ::= nexprlist", |
| 146562 | | - /* 344 */ "nmnum ::= plus_num", |
| 146563 | | - /* 345 */ "nmnum ::= nm", |
| 146564 | | - /* 346 */ "nmnum ::= ON", |
| 146565 | | - /* 347 */ "nmnum ::= DELETE", |
| 146566 | | - /* 348 */ "nmnum ::= DEFAULT", |
| 146567 | | - /* 349 */ "plus_num ::= INTEGER|FLOAT", |
| 146568 | | - /* 350 */ "foreach_clause ::=", |
| 146569 | | - /* 351 */ "foreach_clause ::= FOR EACH ROW", |
| 146570 | | - /* 352 */ "trnm ::= nm", |
| 146571 | | - /* 353 */ "tridxby ::=", |
| 146572 | | - /* 354 */ "database_kw_opt ::= DATABASE", |
| 146573 | | - /* 355 */ "database_kw_opt ::=", |
| 146574 | | - /* 356 */ "kwcolumn_opt ::=", |
| 146575 | | - /* 357 */ "kwcolumn_opt ::= COLUMNKW", |
| 146576 | | - /* 358 */ "vtabarglist ::= vtabarg", |
| 146577 | | - /* 359 */ "vtabarglist ::= vtabarglist COMMA vtabarg", |
| 146578 | | - /* 360 */ "vtabarg ::= vtabarg vtabargtoken", |
| 146579 | | - /* 361 */ "anylist ::=", |
| 146580 | | - /* 362 */ "anylist ::= anylist LP anylist RP", |
| 146581 | | - /* 363 */ "anylist ::= anylist ANY", |
| 146582 | | - /* 364 */ "with ::=", |
| 146224 | + /* 87 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", |
| 146225 | + /* 88 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt", |
| 146226 | + /* 89 */ "values ::= VALUES LP nexprlist RP", |
| 146227 | + /* 90 */ "values ::= values COMMA LP nexprlist RP", |
| 146228 | + /* 91 */ "distinct ::= DISTINCT", |
| 146229 | + /* 92 */ "distinct ::= ALL", |
| 146230 | + /* 93 */ "distinct ::=", |
| 146231 | + /* 94 */ "sclp ::=", |
| 146232 | + /* 95 */ "selcollist ::= sclp scanpt expr scanpt as", |
| 146233 | + /* 96 */ "selcollist ::= sclp scanpt STAR", |
| 146234 | + /* 97 */ "selcollist ::= sclp scanpt nm DOT STAR", |
| 146235 | + /* 98 */ "as ::= AS nm", |
| 146236 | + /* 99 */ "as ::=", |
| 146237 | + /* 100 */ "from ::=", |
| 146238 | + /* 101 */ "from ::= FROM seltablist", |
| 146239 | + /* 102 */ "stl_prefix ::= seltablist joinop", |
| 146240 | + /* 103 */ "stl_prefix ::=", |
| 146241 | + /* 104 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", |
| 146242 | + /* 105 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt", |
| 146243 | + /* 106 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt", |
| 146244 | + /* 107 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt", |
| 146245 | + /* 108 */ "dbnm ::=", |
| 146246 | + /* 109 */ "dbnm ::= DOT nm", |
| 146247 | + /* 110 */ "fullname ::= nm", |
| 146248 | + /* 111 */ "fullname ::= nm DOT nm", |
| 146249 | + /* 112 */ "xfullname ::= nm", |
| 146250 | + /* 113 */ "xfullname ::= nm DOT nm", |
| 146251 | + /* 114 */ "xfullname ::= nm DOT nm AS nm", |
| 146252 | + /* 115 */ "xfullname ::= nm AS nm", |
| 146253 | + /* 116 */ "joinop ::= COMMA|JOIN", |
| 146254 | + /* 117 */ "joinop ::= JOIN_KW JOIN", |
| 146255 | + /* 118 */ "joinop ::= JOIN_KW nm JOIN", |
| 146256 | + /* 119 */ "joinop ::= JOIN_KW nm nm JOIN", |
| 146257 | + /* 120 */ "on_opt ::= ON expr", |
| 146258 | + /* 121 */ "on_opt ::=", |
| 146259 | + /* 122 */ "indexed_opt ::=", |
| 146260 | + /* 123 */ "indexed_opt ::= INDEXED BY nm", |
| 146261 | + /* 124 */ "indexed_opt ::= NOT INDEXED", |
| 146262 | + /* 125 */ "using_opt ::= USING LP idlist RP", |
| 146263 | + /* 126 */ "using_opt ::=", |
| 146264 | + /* 127 */ "orderby_opt ::=", |
| 146265 | + /* 128 */ "orderby_opt ::= ORDER BY sortlist", |
| 146266 | + /* 129 */ "sortlist ::= sortlist COMMA expr sortorder", |
| 146267 | + /* 130 */ "sortlist ::= expr sortorder", |
| 146268 | + /* 131 */ "sortorder ::= ASC", |
| 146269 | + /* 132 */ "sortorder ::= DESC", |
| 146270 | + /* 133 */ "sortorder ::=", |
| 146271 | + /* 134 */ "groupby_opt ::=", |
| 146272 | + /* 135 */ "groupby_opt ::= GROUP BY nexprlist", |
| 146273 | + /* 136 */ "having_opt ::=", |
| 146274 | + /* 137 */ "having_opt ::= HAVING expr", |
| 146275 | + /* 138 */ "limit_opt ::=", |
| 146276 | + /* 139 */ "limit_opt ::= LIMIT expr", |
| 146277 | + /* 140 */ "limit_opt ::= LIMIT expr OFFSET expr", |
| 146278 | + /* 141 */ "limit_opt ::= LIMIT expr COMMA expr", |
| 146279 | + /* 142 */ "cmd ::= with DELETE FROM xfullname indexed_opt where_opt", |
| 146280 | + /* 143 */ "where_opt ::=", |
| 146281 | + /* 144 */ "where_opt ::= WHERE expr", |
| 146282 | + /* 145 */ "cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt", |
| 146283 | + /* 146 */ "setlist ::= setlist COMMA nm EQ expr", |
| 146284 | + /* 147 */ "setlist ::= setlist COMMA LP idlist RP EQ expr", |
| 146285 | + /* 148 */ "setlist ::= nm EQ expr", |
| 146286 | + /* 149 */ "setlist ::= LP idlist RP EQ expr", |
| 146287 | + /* 150 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert", |
| 146288 | + /* 151 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES", |
| 146289 | + /* 152 */ "upsert ::=", |
| 146290 | + /* 153 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt", |
| 146291 | + /* 154 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING", |
| 146292 | + /* 155 */ "upsert ::= ON CONFLICT DO NOTHING", |
| 146293 | + /* 156 */ "insert_cmd ::= INSERT orconf", |
| 146294 | + /* 157 */ "insert_cmd ::= REPLACE", |
| 146295 | + /* 158 */ "idlist_opt ::=", |
| 146296 | + /* 159 */ "idlist_opt ::= LP idlist RP", |
| 146297 | + /* 160 */ "idlist ::= idlist COMMA nm", |
| 146298 | + /* 161 */ "idlist ::= nm", |
| 146299 | + /* 162 */ "expr ::= LP expr RP", |
| 146300 | + /* 163 */ "expr ::= ID|INDEXED", |
| 146301 | + /* 164 */ "expr ::= JOIN_KW", |
| 146302 | + /* 165 */ "expr ::= nm DOT nm", |
| 146303 | + /* 166 */ "expr ::= nm DOT nm DOT nm", |
| 146304 | + /* 167 */ "term ::= NULL|FLOAT|BLOB", |
| 146305 | + /* 168 */ "term ::= STRING", |
| 146306 | + /* 169 */ "term ::= INTEGER", |
| 146307 | + /* 170 */ "expr ::= VARIABLE", |
| 146308 | + /* 171 */ "expr ::= expr COLLATE ID|STRING", |
| 146309 | + /* 172 */ "expr ::= CAST LP expr AS typetoken RP", |
| 146310 | + /* 173 */ "expr ::= ID|INDEXED LP distinct exprlist RP", |
| 146311 | + /* 174 */ "expr ::= ID|INDEXED LP STAR RP", |
| 146312 | + /* 175 */ "expr ::= ID|INDEXED LP distinct exprlist RP over_clause", |
| 146313 | + /* 176 */ "expr ::= ID|INDEXED LP STAR RP over_clause", |
| 146314 | + /* 177 */ "term ::= CTIME_KW", |
| 146315 | + /* 178 */ "expr ::= LP nexprlist COMMA expr RP", |
| 146316 | + /* 179 */ "expr ::= expr AND expr", |
| 146317 | + /* 180 */ "expr ::= expr OR expr", |
| 146318 | + /* 181 */ "expr ::= expr LT|GT|GE|LE expr", |
| 146319 | + /* 182 */ "expr ::= expr EQ|NE expr", |
| 146320 | + /* 183 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", |
| 146321 | + /* 184 */ "expr ::= expr PLUS|MINUS expr", |
| 146322 | + /* 185 */ "expr ::= expr STAR|SLASH|REM expr", |
| 146323 | + /* 186 */ "expr ::= expr CONCAT expr", |
| 146324 | + /* 187 */ "likeop ::= NOT LIKE_KW|MATCH", |
| 146325 | + /* 188 */ "expr ::= expr likeop expr", |
| 146326 | + /* 189 */ "expr ::= expr likeop expr ESCAPE expr", |
| 146327 | + /* 190 */ "expr ::= expr ISNULL|NOTNULL", |
| 146328 | + /* 191 */ "expr ::= expr NOT NULL", |
| 146329 | + /* 192 */ "expr ::= expr IS expr", |
| 146330 | + /* 193 */ "expr ::= expr IS NOT expr", |
| 146331 | + /* 194 */ "expr ::= NOT expr", |
| 146332 | + /* 195 */ "expr ::= BITNOT expr", |
| 146333 | + /* 196 */ "expr ::= PLUS|MINUS expr", |
| 146334 | + /* 197 */ "between_op ::= BETWEEN", |
| 146335 | + /* 198 */ "between_op ::= NOT BETWEEN", |
| 146336 | + /* 199 */ "expr ::= expr between_op expr AND expr", |
| 146337 | + /* 200 */ "in_op ::= IN", |
| 146338 | + /* 201 */ "in_op ::= NOT IN", |
| 146339 | + /* 202 */ "expr ::= expr in_op LP exprlist RP", |
| 146340 | + /* 203 */ "expr ::= LP select RP", |
| 146341 | + /* 204 */ "expr ::= expr in_op LP select RP", |
| 146342 | + /* 205 */ "expr ::= expr in_op nm dbnm paren_exprlist", |
| 146343 | + /* 206 */ "expr ::= EXISTS LP select RP", |
| 146344 | + /* 207 */ "expr ::= CASE case_operand case_exprlist case_else END", |
| 146345 | + /* 208 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", |
| 146346 | + /* 209 */ "case_exprlist ::= WHEN expr THEN expr", |
| 146347 | + /* 210 */ "case_else ::= ELSE expr", |
| 146348 | + /* 211 */ "case_else ::=", |
| 146349 | + /* 212 */ "case_operand ::= expr", |
| 146350 | + /* 213 */ "case_operand ::=", |
| 146351 | + /* 214 */ "exprlist ::=", |
| 146352 | + /* 215 */ "nexprlist ::= nexprlist COMMA expr", |
| 146353 | + /* 216 */ "nexprlist ::= expr", |
| 146354 | + /* 217 */ "paren_exprlist ::=", |
| 146355 | + /* 218 */ "paren_exprlist ::= LP exprlist RP", |
| 146356 | + /* 219 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt", |
| 146357 | + /* 220 */ "uniqueflag ::= UNIQUE", |
| 146358 | + /* 221 */ "uniqueflag ::=", |
| 146359 | + /* 222 */ "eidlist_opt ::=", |
| 146360 | + /* 223 */ "eidlist_opt ::= LP eidlist RP", |
| 146361 | + /* 224 */ "eidlist ::= eidlist COMMA nm collate sortorder", |
| 146362 | + /* 225 */ "eidlist ::= nm collate sortorder", |
| 146363 | + /* 226 */ "collate ::=", |
| 146364 | + /* 227 */ "collate ::= COLLATE ID|STRING", |
| 146365 | + /* 228 */ "cmd ::= DROP INDEX ifexists fullname", |
| 146366 | + /* 229 */ "cmd ::= VACUUM", |
| 146367 | + /* 230 */ "cmd ::= VACUUM nm", |
| 146368 | + /* 231 */ "cmd ::= PRAGMA nm dbnm", |
| 146369 | + /* 232 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", |
| 146370 | + /* 233 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", |
| 146371 | + /* 234 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", |
| 146372 | + /* 235 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", |
| 146373 | + /* 236 */ "plus_num ::= PLUS INTEGER|FLOAT", |
| 146374 | + /* 237 */ "minus_num ::= MINUS INTEGER|FLOAT", |
| 146375 | + /* 238 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", |
| 146376 | + /* 239 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", |
| 146377 | + /* 240 */ "trigger_time ::= BEFORE|AFTER", |
| 146378 | + /* 241 */ "trigger_time ::= INSTEAD OF", |
| 146379 | + /* 242 */ "trigger_time ::=", |
| 146380 | + /* 243 */ "trigger_event ::= DELETE|INSERT", |
| 146381 | + /* 244 */ "trigger_event ::= UPDATE", |
| 146382 | + /* 245 */ "trigger_event ::= UPDATE OF idlist", |
| 146383 | + /* 246 */ "when_clause ::=", |
| 146384 | + /* 247 */ "when_clause ::= WHEN expr", |
| 146385 | + /* 248 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", |
| 146386 | + /* 249 */ "trigger_cmd_list ::= trigger_cmd SEMI", |
| 146387 | + /* 250 */ "trnm ::= nm DOT nm", |
| 146388 | + /* 251 */ "tridxby ::= INDEXED BY nm", |
| 146389 | + /* 252 */ "tridxby ::= NOT INDEXED", |
| 146390 | + /* 253 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt", |
| 146391 | + /* 254 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt", |
| 146392 | + /* 255 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt", |
| 146393 | + /* 256 */ "trigger_cmd ::= scanpt select scanpt", |
| 146394 | + /* 257 */ "expr ::= RAISE LP IGNORE RP", |
| 146395 | + /* 258 */ "expr ::= RAISE LP raisetype COMMA nm RP", |
| 146396 | + /* 259 */ "raisetype ::= ROLLBACK", |
| 146397 | + /* 260 */ "raisetype ::= ABORT", |
| 146398 | + /* 261 */ "raisetype ::= FAIL", |
| 146399 | + /* 262 */ "cmd ::= DROP TRIGGER ifexists fullname", |
| 146400 | + /* 263 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", |
| 146401 | + /* 264 */ "cmd ::= DETACH database_kw_opt expr", |
| 146402 | + /* 265 */ "key_opt ::=", |
| 146403 | + /* 266 */ "key_opt ::= KEY expr", |
| 146404 | + /* 267 */ "cmd ::= REINDEX", |
| 146405 | + /* 268 */ "cmd ::= REINDEX nm dbnm", |
| 146406 | + /* 269 */ "cmd ::= ANALYZE", |
| 146407 | + /* 270 */ "cmd ::= ANALYZE nm dbnm", |
| 146408 | + /* 271 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", |
| 146409 | + /* 272 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist", |
| 146410 | + /* 273 */ "add_column_fullname ::= fullname", |
| 146411 | + /* 274 */ "cmd ::= create_vtab", |
| 146412 | + /* 275 */ "cmd ::= create_vtab LP vtabarglist RP", |
| 146413 | + /* 276 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", |
| 146414 | + /* 277 */ "vtabarg ::=", |
| 146415 | + /* 278 */ "vtabargtoken ::= ANY", |
| 146416 | + /* 279 */ "vtabargtoken ::= lp anylist RP", |
| 146417 | + /* 280 */ "lp ::= LP", |
| 146418 | + /* 281 */ "with ::= WITH wqlist", |
| 146419 | + /* 282 */ "with ::= WITH RECURSIVE wqlist", |
| 146420 | + /* 283 */ "wqlist ::= nm eidlist_opt AS LP select RP", |
| 146421 | + /* 284 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP", |
| 146422 | + /* 285 */ "windowdefn_list ::= windowdefn", |
| 146423 | + /* 286 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn", |
| 146424 | + /* 287 */ "windowdefn ::= nm AS window", |
| 146425 | + /* 288 */ "window ::= LP part_opt orderby_opt frame_opt RP", |
| 146426 | + /* 289 */ "part_opt ::= PARTITION BY nexprlist", |
| 146427 | + /* 290 */ "part_opt ::=", |
| 146428 | + /* 291 */ "frame_opt ::=", |
| 146429 | + /* 292 */ "frame_opt ::= range_or_rows frame_bound_s", |
| 146430 | + /* 293 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e", |
| 146431 | + /* 294 */ "range_or_rows ::= RANGE", |
| 146432 | + /* 295 */ "range_or_rows ::= ROWS", |
| 146433 | + /* 296 */ "frame_bound_s ::= frame_bound", |
| 146434 | + /* 297 */ "frame_bound_s ::= UNBOUNDED PRECEDING", |
| 146435 | + /* 298 */ "frame_bound_e ::= frame_bound", |
| 146436 | + /* 299 */ "frame_bound_e ::= UNBOUNDED FOLLOWING", |
| 146437 | + /* 300 */ "frame_bound ::= expr PRECEDING", |
| 146438 | + /* 301 */ "frame_bound ::= CURRENT ROW", |
| 146439 | + /* 302 */ "frame_bound ::= expr FOLLOWING", |
| 146440 | + /* 303 */ "window_clause ::= WINDOW windowdefn_list", |
| 146441 | + /* 304 */ "over_clause ::= filter_opt OVER window", |
| 146442 | + /* 305 */ "over_clause ::= filter_opt OVER nm", |
| 146443 | + /* 306 */ "filter_opt ::=", |
| 146444 | + /* 307 */ "filter_opt ::= FILTER LP WHERE expr RP", |
| 146445 | + /* 308 */ "input ::= cmdlist", |
| 146446 | + /* 309 */ "cmdlist ::= cmdlist ecmd", |
| 146447 | + /* 310 */ "cmdlist ::= ecmd", |
| 146448 | + /* 311 */ "ecmd ::= SEMI", |
| 146449 | + /* 312 */ "ecmd ::= cmdx SEMI", |
| 146450 | + /* 313 */ "ecmd ::= explain cmdx", |
| 146451 | + /* 314 */ "trans_opt ::=", |
| 146452 | + /* 315 */ "trans_opt ::= TRANSACTION", |
| 146453 | + /* 316 */ "trans_opt ::= TRANSACTION nm", |
| 146454 | + /* 317 */ "savepoint_opt ::= SAVEPOINT", |
| 146455 | + /* 318 */ "savepoint_opt ::=", |
| 146456 | + /* 319 */ "cmd ::= create_table create_table_args", |
| 146457 | + /* 320 */ "columnlist ::= columnlist COMMA columnname carglist", |
| 146458 | + /* 321 */ "columnlist ::= columnname carglist", |
| 146459 | + /* 322 */ "nm ::= ID|INDEXED", |
| 146460 | + /* 323 */ "nm ::= STRING", |
| 146461 | + /* 324 */ "nm ::= JOIN_KW", |
| 146462 | + /* 325 */ "typetoken ::= typename", |
| 146463 | + /* 326 */ "typename ::= ID|STRING", |
| 146464 | + /* 327 */ "signed ::= plus_num", |
| 146465 | + /* 328 */ "signed ::= minus_num", |
| 146466 | + /* 329 */ "carglist ::= carglist ccons", |
| 146467 | + /* 330 */ "carglist ::=", |
| 146468 | + /* 331 */ "ccons ::= NULL onconf", |
| 146469 | + /* 332 */ "conslist_opt ::= COMMA conslist", |
| 146470 | + /* 333 */ "conslist ::= conslist tconscomma tcons", |
| 146471 | + /* 334 */ "conslist ::= tcons", |
| 146472 | + /* 335 */ "tconscomma ::=", |
| 146473 | + /* 336 */ "defer_subclause_opt ::= defer_subclause", |
| 146474 | + /* 337 */ "resolvetype ::= raisetype", |
| 146475 | + /* 338 */ "selectnowith ::= oneselect", |
| 146476 | + /* 339 */ "oneselect ::= values", |
| 146477 | + /* 340 */ "sclp ::= selcollist COMMA", |
| 146478 | + /* 341 */ "as ::= ID|STRING", |
| 146479 | + /* 342 */ "expr ::= term", |
| 146480 | + /* 343 */ "likeop ::= LIKE_KW|MATCH", |
| 146481 | + /* 344 */ "exprlist ::= nexprlist", |
| 146482 | + /* 345 */ "nmnum ::= plus_num", |
| 146483 | + /* 346 */ "nmnum ::= nm", |
| 146484 | + /* 347 */ "nmnum ::= ON", |
| 146485 | + /* 348 */ "nmnum ::= DELETE", |
| 146486 | + /* 349 */ "nmnum ::= DEFAULT", |
| 146487 | + /* 350 */ "plus_num ::= INTEGER|FLOAT", |
| 146488 | + /* 351 */ "foreach_clause ::=", |
| 146489 | + /* 352 */ "foreach_clause ::= FOR EACH ROW", |
| 146490 | + /* 353 */ "trnm ::= nm", |
| 146491 | + /* 354 */ "tridxby ::=", |
| 146492 | + /* 355 */ "database_kw_opt ::= DATABASE", |
| 146493 | + /* 356 */ "database_kw_opt ::=", |
| 146494 | + /* 357 */ "kwcolumn_opt ::=", |
| 146495 | + /* 358 */ "kwcolumn_opt ::= COLUMNKW", |
| 146496 | + /* 359 */ "vtabarglist ::= vtabarg", |
| 146497 | + /* 360 */ "vtabarglist ::= vtabarglist COMMA vtabarg", |
| 146498 | + /* 361 */ "vtabarg ::= vtabarg vtabargtoken", |
| 146499 | + /* 362 */ "anylist ::=", |
| 146500 | + /* 363 */ "anylist ::= anylist LP anylist RP", |
| 146501 | + /* 364 */ "anylist ::= anylist ANY", |
| 146502 | + /* 365 */ "with ::=", |
| 146583 | 146503 | }; |
| 146584 | 146504 | #endif /* NDEBUG */ |
| 146585 | 146505 | |
| 146586 | 146506 | |
| 146587 | 146507 | #if YYSTACKDEPTH<=0 |
| | @@ -146715,11 +146635,11 @@ |
| 146715 | 146635 | break; |
| 146716 | 146636 | case 184: /* term */ |
| 146717 | 146637 | case 185: /* expr */ |
| 146718 | 146638 | case 213: /* where_opt */ |
| 146719 | 146639 | case 215: /* having_opt */ |
| 146720 | | - case 228: /* on_opt */ |
| 146640 | + case 227: /* on_opt */ |
| 146721 | 146641 | case 242: /* case_operand */ |
| 146722 | 146642 | case 244: /* case_else */ |
| 146723 | 146643 | case 253: /* when_clause */ |
| 146724 | 146644 | case 258: /* key_opt */ |
| 146725 | 146645 | case 272: /* filter_opt */ |
| | @@ -146730,14 +146650,14 @@ |
| 146730 | 146650 | case 189: /* eidlist_opt */ |
| 146731 | 146651 | case 198: /* sortlist */ |
| 146732 | 146652 | case 199: /* eidlist */ |
| 146733 | 146653 | case 211: /* selcollist */ |
| 146734 | 146654 | case 214: /* groupby_opt */ |
| 146735 | | - case 217: /* orderby_opt */ |
| 146655 | + case 216: /* orderby_opt */ |
| 146736 | 146656 | case 220: /* nexprlist */ |
| 146737 | | - case 221: /* exprlist */ |
| 146738 | | - case 222: /* sclp */ |
| 146657 | + case 221: /* sclp */ |
| 146658 | + case 229: /* exprlist */ |
| 146739 | 146659 | case 233: /* setlist */ |
| 146740 | 146660 | case 241: /* paren_exprlist */ |
| 146741 | 146661 | case 243: /* case_exprlist */ |
| 146742 | 146662 | case 271: /* part_opt */ |
| 146743 | 146663 | { |
| | @@ -146744,12 +146664,12 @@ |
| 146744 | 146664 | sqlite3ExprListDelete(pParse->db, (yypminor->yy420)); |
| 146745 | 146665 | } |
| 146746 | 146666 | break; |
| 146747 | 146667 | case 205: /* fullname */ |
| 146748 | 146668 | case 212: /* from */ |
| 146749 | | - case 224: /* seltablist */ |
| 146750 | | - case 225: /* stl_prefix */ |
| 146669 | + case 223: /* seltablist */ |
| 146670 | + case 224: /* stl_prefix */ |
| 146751 | 146671 | case 230: /* xfullname */ |
| 146752 | 146672 | { |
| 146753 | 146673 | sqlite3SrcListDelete(pParse->db, (yypminor->yy135)); |
| 146754 | 146674 | } |
| 146755 | 146675 | break; |
| | @@ -146756,24 +146676,24 @@ |
| 146756 | 146676 | case 208: /* wqlist */ |
| 146757 | 146677 | { |
| 146758 | 146678 | sqlite3WithDelete(pParse->db, (yypminor->yy449)); |
| 146759 | 146679 | } |
| 146760 | 146680 | break; |
| 146761 | | - case 216: /* windowdefn_opt */ |
| 146681 | + case 218: /* window_clause */ |
| 146762 | 146682 | case 267: /* windowdefn_list */ |
| 146763 | 146683 | { |
| 146764 | 146684 | sqlite3WindowListDelete(pParse->db, (yypminor->yy327)); |
| 146765 | 146685 | } |
| 146766 | 146686 | break; |
| 146767 | | - case 229: /* using_opt */ |
| 146687 | + case 228: /* using_opt */ |
| 146768 | 146688 | case 231: /* idlist */ |
| 146769 | 146689 | case 235: /* idlist_opt */ |
| 146770 | 146690 | { |
| 146771 | 146691 | sqlite3IdListDelete(pParse->db, (yypminor->yy48)); |
| 146772 | 146692 | } |
| 146773 | 146693 | break; |
| 146774 | | - case 237: /* over_opt */ |
| 146694 | + case 237: /* over_clause */ |
| 146775 | 146695 | case 268: /* windowdefn */ |
| 146776 | 146696 | case 269: /* window */ |
| 146777 | 146697 | case 270: /* frame_opt */ |
| 146778 | 146698 | { |
| 146779 | 146699 | sqlite3WindowDelete(pParse->db, (yypminor->yy327)); |
| | @@ -147178,288 +147098,289 @@ |
| 147178 | 147098 | { 174, -1 }, /* (82) select ::= selectnowith */ |
| 147179 | 147099 | { 206, -3 }, /* (83) selectnowith ::= selectnowith multiselect_op oneselect */ |
| 147180 | 147100 | { 209, -1 }, /* (84) multiselect_op ::= UNION */ |
| 147181 | 147101 | { 209, -2 }, /* (85) multiselect_op ::= UNION ALL */ |
| 147182 | 147102 | { 209, -1 }, /* (86) multiselect_op ::= EXCEPT|INTERSECT */ |
| 147183 | | - { 207, -10 }, /* (87) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt windowdefn_opt orderby_opt limit_opt */ |
| 147184 | | - { 219, -4 }, /* (88) values ::= VALUES LP nexprlist RP */ |
| 147185 | | - { 219, -5 }, /* (89) values ::= values COMMA LP exprlist RP */ |
| 147186 | | - { 210, -1 }, /* (90) distinct ::= DISTINCT */ |
| 147187 | | - { 210, -1 }, /* (91) distinct ::= ALL */ |
| 147188 | | - { 210, 0 }, /* (92) distinct ::= */ |
| 147189 | | - { 222, 0 }, /* (93) sclp ::= */ |
| 147190 | | - { 211, -5 }, /* (94) selcollist ::= sclp scanpt expr scanpt as */ |
| 147191 | | - { 211, -3 }, /* (95) selcollist ::= sclp scanpt STAR */ |
| 147192 | | - { 211, -5 }, /* (96) selcollist ::= sclp scanpt nm DOT STAR */ |
| 147193 | | - { 223, -2 }, /* (97) as ::= AS nm */ |
| 147194 | | - { 223, 0 }, /* (98) as ::= */ |
| 147195 | | - { 212, 0 }, /* (99) from ::= */ |
| 147196 | | - { 212, -2 }, /* (100) from ::= FROM seltablist */ |
| 147197 | | - { 225, -2 }, /* (101) stl_prefix ::= seltablist joinop */ |
| 147198 | | - { 225, 0 }, /* (102) stl_prefix ::= */ |
| 147199 | | - { 224, -7 }, /* (103) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 147200 | | - { 224, -9 }, /* (104) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */ |
| 147201 | | - { 224, -7 }, /* (105) seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 147202 | | - { 224, -7 }, /* (106) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 147203 | | - { 170, 0 }, /* (107) dbnm ::= */ |
| 147204 | | - { 170, -2 }, /* (108) dbnm ::= DOT nm */ |
| 147205 | | - { 205, -1 }, /* (109) fullname ::= nm */ |
| 147206 | | - { 205, -3 }, /* (110) fullname ::= nm DOT nm */ |
| 147207 | | - { 230, -1 }, /* (111) xfullname ::= nm */ |
| 147208 | | - { 230, -3 }, /* (112) xfullname ::= nm DOT nm */ |
| 147209 | | - { 230, -5 }, /* (113) xfullname ::= nm DOT nm AS nm */ |
| 147210 | | - { 230, -3 }, /* (114) xfullname ::= nm AS nm */ |
| 147211 | | - { 226, -1 }, /* (115) joinop ::= COMMA|JOIN */ |
| 147212 | | - { 226, -2 }, /* (116) joinop ::= JOIN_KW JOIN */ |
| 147213 | | - { 226, -3 }, /* (117) joinop ::= JOIN_KW nm JOIN */ |
| 147214 | | - { 226, -4 }, /* (118) joinop ::= JOIN_KW nm nm JOIN */ |
| 147215 | | - { 228, -2 }, /* (119) on_opt ::= ON expr */ |
| 147216 | | - { 228, 0 }, /* (120) on_opt ::= */ |
| 147217 | | - { 227, 0 }, /* (121) indexed_opt ::= */ |
| 147218 | | - { 227, -3 }, /* (122) indexed_opt ::= INDEXED BY nm */ |
| 147219 | | - { 227, -2 }, /* (123) indexed_opt ::= NOT INDEXED */ |
| 147220 | | - { 229, -4 }, /* (124) using_opt ::= USING LP idlist RP */ |
| 147221 | | - { 229, 0 }, /* (125) using_opt ::= */ |
| 147222 | | - { 217, 0 }, /* (126) orderby_opt ::= */ |
| 147223 | | - { 217, -3 }, /* (127) orderby_opt ::= ORDER BY sortlist */ |
| 147224 | | - { 198, -4 }, /* (128) sortlist ::= sortlist COMMA expr sortorder */ |
| 147225 | | - { 198, -2 }, /* (129) sortlist ::= expr sortorder */ |
| 147226 | | - { 187, -1 }, /* (130) sortorder ::= ASC */ |
| 147227 | | - { 187, -1 }, /* (131) sortorder ::= DESC */ |
| 147228 | | - { 187, 0 }, /* (132) sortorder ::= */ |
| 147229 | | - { 214, 0 }, /* (133) groupby_opt ::= */ |
| 147230 | | - { 214, -3 }, /* (134) groupby_opt ::= GROUP BY nexprlist */ |
| 147231 | | - { 215, 0 }, /* (135) having_opt ::= */ |
| 147232 | | - { 215, -2 }, /* (136) having_opt ::= HAVING expr */ |
| 147233 | | - { 218, 0 }, /* (137) limit_opt ::= */ |
| 147234 | | - { 218, -2 }, /* (138) limit_opt ::= LIMIT expr */ |
| 147235 | | - { 218, -4 }, /* (139) limit_opt ::= LIMIT expr OFFSET expr */ |
| 147236 | | - { 218, -4 }, /* (140) limit_opt ::= LIMIT expr COMMA expr */ |
| 147237 | | - { 160, -6 }, /* (141) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */ |
| 147238 | | - { 213, 0 }, /* (142) where_opt ::= */ |
| 147239 | | - { 213, -2 }, /* (143) where_opt ::= WHERE expr */ |
| 147240 | | - { 160, -8 }, /* (144) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */ |
| 147241 | | - { 233, -5 }, /* (145) setlist ::= setlist COMMA nm EQ expr */ |
| 147242 | | - { 233, -7 }, /* (146) setlist ::= setlist COMMA LP idlist RP EQ expr */ |
| 147243 | | - { 233, -3 }, /* (147) setlist ::= nm EQ expr */ |
| 147244 | | - { 233, -5 }, /* (148) setlist ::= LP idlist RP EQ expr */ |
| 147245 | | - { 160, -7 }, /* (149) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */ |
| 147246 | | - { 160, -7 }, /* (150) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */ |
| 147247 | | - { 236, 0 }, /* (151) upsert ::= */ |
| 147248 | | - { 236, -11 }, /* (152) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */ |
| 147249 | | - { 236, -8 }, /* (153) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */ |
| 147250 | | - { 236, -4 }, /* (154) upsert ::= ON CONFLICT DO NOTHING */ |
| 147251 | | - { 234, -2 }, /* (155) insert_cmd ::= INSERT orconf */ |
| 147252 | | - { 234, -1 }, /* (156) insert_cmd ::= REPLACE */ |
| 147253 | | - { 235, 0 }, /* (157) idlist_opt ::= */ |
| 147254 | | - { 235, -3 }, /* (158) idlist_opt ::= LP idlist RP */ |
| 147255 | | - { 231, -3 }, /* (159) idlist ::= idlist COMMA nm */ |
| 147256 | | - { 231, -1 }, /* (160) idlist ::= nm */ |
| 147257 | | - { 185, -3 }, /* (161) expr ::= LP expr RP */ |
| 147258 | | - { 185, -1 }, /* (162) expr ::= ID|INDEXED */ |
| 147259 | | - { 185, -1 }, /* (163) expr ::= JOIN_KW */ |
| 147260 | | - { 185, -3 }, /* (164) expr ::= nm DOT nm */ |
| 147261 | | - { 185, -5 }, /* (165) expr ::= nm DOT nm DOT nm */ |
| 147262 | | - { 184, -1 }, /* (166) term ::= NULL|FLOAT|BLOB */ |
| 147263 | | - { 184, -1 }, /* (167) term ::= STRING */ |
| 147264 | | - { 184, -1 }, /* (168) term ::= INTEGER */ |
| 147265 | | - { 185, -1 }, /* (169) expr ::= VARIABLE */ |
| 147266 | | - { 185, -3 }, /* (170) expr ::= expr COLLATE ID|STRING */ |
| 147267 | | - { 185, -6 }, /* (171) expr ::= CAST LP expr AS typetoken RP */ |
| 147268 | | - { 185, -6 }, /* (172) expr ::= ID|INDEXED LP distinct exprlist RP over_opt */ |
| 147269 | | - { 185, -5 }, /* (173) expr ::= ID|INDEXED LP STAR RP over_opt */ |
| 147270 | | - { 184, -1 }, /* (174) term ::= CTIME_KW */ |
| 147271 | | - { 185, -5 }, /* (175) expr ::= LP nexprlist COMMA expr RP */ |
| 147272 | | - { 185, -3 }, /* (176) expr ::= expr AND expr */ |
| 147273 | | - { 185, -3 }, /* (177) expr ::= expr OR expr */ |
| 147274 | | - { 185, -3 }, /* (178) expr ::= expr LT|GT|GE|LE expr */ |
| 147275 | | - { 185, -3 }, /* (179) expr ::= expr EQ|NE expr */ |
| 147276 | | - { 185, -3 }, /* (180) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ |
| 147277 | | - { 185, -3 }, /* (181) expr ::= expr PLUS|MINUS expr */ |
| 147278 | | - { 185, -3 }, /* (182) expr ::= expr STAR|SLASH|REM expr */ |
| 147279 | | - { 185, -3 }, /* (183) expr ::= expr CONCAT expr */ |
| 147280 | | - { 238, -2 }, /* (184) likeop ::= NOT LIKE_KW|MATCH */ |
| 147281 | | - { 185, -3 }, /* (185) expr ::= expr likeop expr */ |
| 147282 | | - { 185, -5 }, /* (186) expr ::= expr likeop expr ESCAPE expr */ |
| 147283 | | - { 185, -2 }, /* (187) expr ::= expr ISNULL|NOTNULL */ |
| 147284 | | - { 185, -3 }, /* (188) expr ::= expr NOT NULL */ |
| 147285 | | - { 185, -3 }, /* (189) expr ::= expr IS expr */ |
| 147286 | | - { 185, -4 }, /* (190) expr ::= expr IS NOT expr */ |
| 147287 | | - { 185, -2 }, /* (191) expr ::= NOT expr */ |
| 147288 | | - { 185, -2 }, /* (192) expr ::= BITNOT expr */ |
| 147289 | | - { 185, -2 }, /* (193) expr ::= PLUS|MINUS expr */ |
| 147290 | | - { 239, -1 }, /* (194) between_op ::= BETWEEN */ |
| 147291 | | - { 239, -2 }, /* (195) between_op ::= NOT BETWEEN */ |
| 147292 | | - { 185, -5 }, /* (196) expr ::= expr between_op expr AND expr */ |
| 147293 | | - { 240, -1 }, /* (197) in_op ::= IN */ |
| 147294 | | - { 240, -2 }, /* (198) in_op ::= NOT IN */ |
| 147295 | | - { 185, -5 }, /* (199) expr ::= expr in_op LP exprlist RP */ |
| 147296 | | - { 185, -3 }, /* (200) expr ::= LP select RP */ |
| 147297 | | - { 185, -5 }, /* (201) expr ::= expr in_op LP select RP */ |
| 147298 | | - { 185, -5 }, /* (202) expr ::= expr in_op nm dbnm paren_exprlist */ |
| 147299 | | - { 185, -4 }, /* (203) expr ::= EXISTS LP select RP */ |
| 147300 | | - { 185, -5 }, /* (204) expr ::= CASE case_operand case_exprlist case_else END */ |
| 147301 | | - { 243, -5 }, /* (205) case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 147302 | | - { 243, -4 }, /* (206) case_exprlist ::= WHEN expr THEN expr */ |
| 147303 | | - { 244, -2 }, /* (207) case_else ::= ELSE expr */ |
| 147304 | | - { 244, 0 }, /* (208) case_else ::= */ |
| 147305 | | - { 242, -1 }, /* (209) case_operand ::= expr */ |
| 147306 | | - { 242, 0 }, /* (210) case_operand ::= */ |
| 147307 | | - { 221, 0 }, /* (211) exprlist ::= */ |
| 147308 | | - { 220, -3 }, /* (212) nexprlist ::= nexprlist COMMA expr */ |
| 147309 | | - { 220, -1 }, /* (213) nexprlist ::= expr */ |
| 147310 | | - { 241, 0 }, /* (214) paren_exprlist ::= */ |
| 147311 | | - { 241, -3 }, /* (215) paren_exprlist ::= LP exprlist RP */ |
| 147312 | | - { 160, -12 }, /* (216) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 147313 | | - { 245, -1 }, /* (217) uniqueflag ::= UNIQUE */ |
| 147314 | | - { 245, 0 }, /* (218) uniqueflag ::= */ |
| 147315 | | - { 189, 0 }, /* (219) eidlist_opt ::= */ |
| 147316 | | - { 189, -3 }, /* (220) eidlist_opt ::= LP eidlist RP */ |
| 147317 | | - { 199, -5 }, /* (221) eidlist ::= eidlist COMMA nm collate sortorder */ |
| 147318 | | - { 199, -3 }, /* (222) eidlist ::= nm collate sortorder */ |
| 147319 | | - { 246, 0 }, /* (223) collate ::= */ |
| 147320 | | - { 246, -2 }, /* (224) collate ::= COLLATE ID|STRING */ |
| 147321 | | - { 160, -4 }, /* (225) cmd ::= DROP INDEX ifexists fullname */ |
| 147322 | | - { 160, -1 }, /* (226) cmd ::= VACUUM */ |
| 147323 | | - { 160, -2 }, /* (227) cmd ::= VACUUM nm */ |
| 147324 | | - { 160, -3 }, /* (228) cmd ::= PRAGMA nm dbnm */ |
| 147325 | | - { 160, -5 }, /* (229) cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 147326 | | - { 160, -6 }, /* (230) cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 147327 | | - { 160, -5 }, /* (231) cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 147328 | | - { 160, -6 }, /* (232) cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 147329 | | - { 180, -2 }, /* (233) plus_num ::= PLUS INTEGER|FLOAT */ |
| 147330 | | - { 181, -2 }, /* (234) minus_num ::= MINUS INTEGER|FLOAT */ |
| 147331 | | - { 160, -5 }, /* (235) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 147332 | | - { 248, -11 }, /* (236) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 147333 | | - { 250, -1 }, /* (237) trigger_time ::= BEFORE|AFTER */ |
| 147334 | | - { 250, -2 }, /* (238) trigger_time ::= INSTEAD OF */ |
| 147335 | | - { 250, 0 }, /* (239) trigger_time ::= */ |
| 147336 | | - { 251, -1 }, /* (240) trigger_event ::= DELETE|INSERT */ |
| 147337 | | - { 251, -1 }, /* (241) trigger_event ::= UPDATE */ |
| 147338 | | - { 251, -3 }, /* (242) trigger_event ::= UPDATE OF idlist */ |
| 147339 | | - { 253, 0 }, /* (243) when_clause ::= */ |
| 147340 | | - { 253, -2 }, /* (244) when_clause ::= WHEN expr */ |
| 147341 | | - { 249, -3 }, /* (245) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 147342 | | - { 249, -2 }, /* (246) trigger_cmd_list ::= trigger_cmd SEMI */ |
| 147343 | | - { 255, -3 }, /* (247) trnm ::= nm DOT nm */ |
| 147344 | | - { 256, -3 }, /* (248) tridxby ::= INDEXED BY nm */ |
| 147345 | | - { 256, -2 }, /* (249) tridxby ::= NOT INDEXED */ |
| 147346 | | - { 254, -8 }, /* (250) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */ |
| 147347 | | - { 254, -8 }, /* (251) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 147348 | | - { 254, -6 }, /* (252) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 147349 | | - { 254, -3 }, /* (253) trigger_cmd ::= scanpt select scanpt */ |
| 147350 | | - { 185, -4 }, /* (254) expr ::= RAISE LP IGNORE RP */ |
| 147351 | | - { 185, -6 }, /* (255) expr ::= RAISE LP raisetype COMMA nm RP */ |
| 147352 | | - { 203, -1 }, /* (256) raisetype ::= ROLLBACK */ |
| 147353 | | - { 203, -1 }, /* (257) raisetype ::= ABORT */ |
| 147354 | | - { 203, -1 }, /* (258) raisetype ::= FAIL */ |
| 147355 | | - { 160, -4 }, /* (259) cmd ::= DROP TRIGGER ifexists fullname */ |
| 147356 | | - { 160, -6 }, /* (260) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 147357 | | - { 160, -3 }, /* (261) cmd ::= DETACH database_kw_opt expr */ |
| 147358 | | - { 258, 0 }, /* (262) key_opt ::= */ |
| 147359 | | - { 258, -2 }, /* (263) key_opt ::= KEY expr */ |
| 147360 | | - { 160, -1 }, /* (264) cmd ::= REINDEX */ |
| 147361 | | - { 160, -3 }, /* (265) cmd ::= REINDEX nm dbnm */ |
| 147362 | | - { 160, -1 }, /* (266) cmd ::= ANALYZE */ |
| 147363 | | - { 160, -3 }, /* (267) cmd ::= ANALYZE nm dbnm */ |
| 147364 | | - { 160, -6 }, /* (268) cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 147365 | | - { 160, -7 }, /* (269) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 147366 | | - { 259, -1 }, /* (270) add_column_fullname ::= fullname */ |
| 147367 | | - { 160, -1 }, /* (271) cmd ::= create_vtab */ |
| 147368 | | - { 160, -4 }, /* (272) cmd ::= create_vtab LP vtabarglist RP */ |
| 147369 | | - { 261, -8 }, /* (273) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 147370 | | - { 263, 0 }, /* (274) vtabarg ::= */ |
| 147371 | | - { 264, -1 }, /* (275) vtabargtoken ::= ANY */ |
| 147372 | | - { 264, -3 }, /* (276) vtabargtoken ::= lp anylist RP */ |
| 147373 | | - { 265, -1 }, /* (277) lp ::= LP */ |
| 147374 | | - { 232, -2 }, /* (278) with ::= WITH wqlist */ |
| 147375 | | - { 232, -3 }, /* (279) with ::= WITH RECURSIVE wqlist */ |
| 147376 | | - { 208, -6 }, /* (280) wqlist ::= nm eidlist_opt AS LP select RP */ |
| 147377 | | - { 208, -8 }, /* (281) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ |
| 147378 | | - { 267, -1 }, /* (282) windowdefn_list ::= windowdefn */ |
| 147379 | | - { 267, -3 }, /* (283) windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 147380 | | - { 268, -3 }, /* (284) windowdefn ::= nm AS window */ |
| 147381 | | - { 269, -5 }, /* (285) window ::= LP part_opt orderby_opt frame_opt RP */ |
| 147382 | | - { 271, -3 }, /* (286) part_opt ::= PARTITION BY exprlist */ |
| 147383 | | - { 271, 0 }, /* (287) part_opt ::= */ |
| 147384 | | - { 270, 0 }, /* (288) frame_opt ::= */ |
| 147385 | | - { 270, -2 }, /* (289) frame_opt ::= range_or_rows frame_bound_s */ |
| 147386 | | - { 270, -5 }, /* (290) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */ |
| 147387 | | - { 273, -1 }, /* (291) range_or_rows ::= RANGE */ |
| 147388 | | - { 273, -1 }, /* (292) range_or_rows ::= ROWS */ |
| 147389 | | - { 275, -1 }, /* (293) frame_bound_s ::= frame_bound */ |
| 147390 | | - { 275, -2 }, /* (294) frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 147391 | | - { 276, -1 }, /* (295) frame_bound_e ::= frame_bound */ |
| 147392 | | - { 276, -2 }, /* (296) frame_bound_e ::= UNBOUNDED FOLLOWING */ |
| 147393 | | - { 274, -2 }, /* (297) frame_bound ::= expr PRECEDING */ |
| 147394 | | - { 274, -2 }, /* (298) frame_bound ::= CURRENT ROW */ |
| 147395 | | - { 274, -2 }, /* (299) frame_bound ::= expr FOLLOWING */ |
| 147396 | | - { 216, 0 }, /* (300) windowdefn_opt ::= */ |
| 147397 | | - { 216, -2 }, /* (301) windowdefn_opt ::= WINDOW windowdefn_list */ |
| 147398 | | - { 237, 0 }, /* (302) over_opt ::= */ |
| 147399 | | - { 237, -3 }, /* (303) over_opt ::= filter_opt OVER window */ |
| 147400 | | - { 237, -3 }, /* (304) over_opt ::= filter_opt OVER nm */ |
| 147401 | | - { 272, 0 }, /* (305) filter_opt ::= */ |
| 147402 | | - { 272, -5 }, /* (306) filter_opt ::= FILTER LP WHERE expr RP */ |
| 147403 | | - { 155, -1 }, /* (307) input ::= cmdlist */ |
| 147404 | | - { 156, -2 }, /* (308) cmdlist ::= cmdlist ecmd */ |
| 147405 | | - { 156, -1 }, /* (309) cmdlist ::= ecmd */ |
| 147406 | | - { 157, -1 }, /* (310) ecmd ::= SEMI */ |
| 147407 | | - { 157, -2 }, /* (311) ecmd ::= cmdx SEMI */ |
| 147408 | | - { 157, -2 }, /* (312) ecmd ::= explain cmdx */ |
| 147409 | | - { 162, 0 }, /* (313) trans_opt ::= */ |
| 147410 | | - { 162, -1 }, /* (314) trans_opt ::= TRANSACTION */ |
| 147411 | | - { 162, -2 }, /* (315) trans_opt ::= TRANSACTION nm */ |
| 147412 | | - { 164, -1 }, /* (316) savepoint_opt ::= SAVEPOINT */ |
| 147413 | | - { 164, 0 }, /* (317) savepoint_opt ::= */ |
| 147414 | | - { 160, -2 }, /* (318) cmd ::= create_table create_table_args */ |
| 147415 | | - { 171, -4 }, /* (319) columnlist ::= columnlist COMMA columnname carglist */ |
| 147416 | | - { 171, -2 }, /* (320) columnlist ::= columnname carglist */ |
| 147417 | | - { 163, -1 }, /* (321) nm ::= ID|INDEXED */ |
| 147418 | | - { 163, -1 }, /* (322) nm ::= STRING */ |
| 147419 | | - { 163, -1 }, /* (323) nm ::= JOIN_KW */ |
| 147420 | | - { 177, -1 }, /* (324) typetoken ::= typename */ |
| 147421 | | - { 178, -1 }, /* (325) typename ::= ID|STRING */ |
| 147422 | | - { 179, -1 }, /* (326) signed ::= plus_num */ |
| 147423 | | - { 179, -1 }, /* (327) signed ::= minus_num */ |
| 147424 | | - { 176, -2 }, /* (328) carglist ::= carglist ccons */ |
| 147425 | | - { 176, 0 }, /* (329) carglist ::= */ |
| 147426 | | - { 183, -2 }, /* (330) ccons ::= NULL onconf */ |
| 147427 | | - { 172, -2 }, /* (331) conslist_opt ::= COMMA conslist */ |
| 147428 | | - { 195, -3 }, /* (332) conslist ::= conslist tconscomma tcons */ |
| 147429 | | - { 195, -1 }, /* (333) conslist ::= tcons */ |
| 147430 | | - { 196, 0 }, /* (334) tconscomma ::= */ |
| 147431 | | - { 200, -1 }, /* (335) defer_subclause_opt ::= defer_subclause */ |
| 147432 | | - { 202, -1 }, /* (336) resolvetype ::= raisetype */ |
| 147433 | | - { 206, -1 }, /* (337) selectnowith ::= oneselect */ |
| 147434 | | - { 207, -1 }, /* (338) oneselect ::= values */ |
| 147435 | | - { 222, -2 }, /* (339) sclp ::= selcollist COMMA */ |
| 147436 | | - { 223, -1 }, /* (340) as ::= ID|STRING */ |
| 147437 | | - { 185, -1 }, /* (341) expr ::= term */ |
| 147438 | | - { 238, -1 }, /* (342) likeop ::= LIKE_KW|MATCH */ |
| 147439 | | - { 221, -1 }, /* (343) exprlist ::= nexprlist */ |
| 147440 | | - { 247, -1 }, /* (344) nmnum ::= plus_num */ |
| 147441 | | - { 247, -1 }, /* (345) nmnum ::= nm */ |
| 147442 | | - { 247, -1 }, /* (346) nmnum ::= ON */ |
| 147443 | | - { 247, -1 }, /* (347) nmnum ::= DELETE */ |
| 147444 | | - { 247, -1 }, /* (348) nmnum ::= DEFAULT */ |
| 147445 | | - { 180, -1 }, /* (349) plus_num ::= INTEGER|FLOAT */ |
| 147446 | | - { 252, 0 }, /* (350) foreach_clause ::= */ |
| 147447 | | - { 252, -3 }, /* (351) foreach_clause ::= FOR EACH ROW */ |
| 147448 | | - { 255, -1 }, /* (352) trnm ::= nm */ |
| 147449 | | - { 256, 0 }, /* (353) tridxby ::= */ |
| 147450 | | - { 257, -1 }, /* (354) database_kw_opt ::= DATABASE */ |
| 147451 | | - { 257, 0 }, /* (355) database_kw_opt ::= */ |
| 147452 | | - { 260, 0 }, /* (356) kwcolumn_opt ::= */ |
| 147453 | | - { 260, -1 }, /* (357) kwcolumn_opt ::= COLUMNKW */ |
| 147454 | | - { 262, -1 }, /* (358) vtabarglist ::= vtabarg */ |
| 147455 | | - { 262, -3 }, /* (359) vtabarglist ::= vtabarglist COMMA vtabarg */ |
| 147456 | | - { 263, -2 }, /* (360) vtabarg ::= vtabarg vtabargtoken */ |
| 147457 | | - { 266, 0 }, /* (361) anylist ::= */ |
| 147458 | | - { 266, -4 }, /* (362) anylist ::= anylist LP anylist RP */ |
| 147459 | | - { 266, -2 }, /* (363) anylist ::= anylist ANY */ |
| 147460 | | - { 232, 0 }, /* (364) with ::= */ |
| 147103 | + { 207, -9 }, /* (87) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 147104 | + { 207, -10 }, /* (88) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */ |
| 147105 | + { 219, -4 }, /* (89) values ::= VALUES LP nexprlist RP */ |
| 147106 | + { 219, -5 }, /* (90) values ::= values COMMA LP nexprlist RP */ |
| 147107 | + { 210, -1 }, /* (91) distinct ::= DISTINCT */ |
| 147108 | + { 210, -1 }, /* (92) distinct ::= ALL */ |
| 147109 | + { 210, 0 }, /* (93) distinct ::= */ |
| 147110 | + { 221, 0 }, /* (94) sclp ::= */ |
| 147111 | + { 211, -5 }, /* (95) selcollist ::= sclp scanpt expr scanpt as */ |
| 147112 | + { 211, -3 }, /* (96) selcollist ::= sclp scanpt STAR */ |
| 147113 | + { 211, -5 }, /* (97) selcollist ::= sclp scanpt nm DOT STAR */ |
| 147114 | + { 222, -2 }, /* (98) as ::= AS nm */ |
| 147115 | + { 222, 0 }, /* (99) as ::= */ |
| 147116 | + { 212, 0 }, /* (100) from ::= */ |
| 147117 | + { 212, -2 }, /* (101) from ::= FROM seltablist */ |
| 147118 | + { 224, -2 }, /* (102) stl_prefix ::= seltablist joinop */ |
| 147119 | + { 224, 0 }, /* (103) stl_prefix ::= */ |
| 147120 | + { 223, -7 }, /* (104) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 147121 | + { 223, -9 }, /* (105) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */ |
| 147122 | + { 223, -7 }, /* (106) seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 147123 | + { 223, -7 }, /* (107) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 147124 | + { 170, 0 }, /* (108) dbnm ::= */ |
| 147125 | + { 170, -2 }, /* (109) dbnm ::= DOT nm */ |
| 147126 | + { 205, -1 }, /* (110) fullname ::= nm */ |
| 147127 | + { 205, -3 }, /* (111) fullname ::= nm DOT nm */ |
| 147128 | + { 230, -1 }, /* (112) xfullname ::= nm */ |
| 147129 | + { 230, -3 }, /* (113) xfullname ::= nm DOT nm */ |
| 147130 | + { 230, -5 }, /* (114) xfullname ::= nm DOT nm AS nm */ |
| 147131 | + { 230, -3 }, /* (115) xfullname ::= nm AS nm */ |
| 147132 | + { 225, -1 }, /* (116) joinop ::= COMMA|JOIN */ |
| 147133 | + { 225, -2 }, /* (117) joinop ::= JOIN_KW JOIN */ |
| 147134 | + { 225, -3 }, /* (118) joinop ::= JOIN_KW nm JOIN */ |
| 147135 | + { 225, -4 }, /* (119) joinop ::= JOIN_KW nm nm JOIN */ |
| 147136 | + { 227, -2 }, /* (120) on_opt ::= ON expr */ |
| 147137 | + { 227, 0 }, /* (121) on_opt ::= */ |
| 147138 | + { 226, 0 }, /* (122) indexed_opt ::= */ |
| 147139 | + { 226, -3 }, /* (123) indexed_opt ::= INDEXED BY nm */ |
| 147140 | + { 226, -2 }, /* (124) indexed_opt ::= NOT INDEXED */ |
| 147141 | + { 228, -4 }, /* (125) using_opt ::= USING LP idlist RP */ |
| 147142 | + { 228, 0 }, /* (126) using_opt ::= */ |
| 147143 | + { 216, 0 }, /* (127) orderby_opt ::= */ |
| 147144 | + { 216, -3 }, /* (128) orderby_opt ::= ORDER BY sortlist */ |
| 147145 | + { 198, -4 }, /* (129) sortlist ::= sortlist COMMA expr sortorder */ |
| 147146 | + { 198, -2 }, /* (130) sortlist ::= expr sortorder */ |
| 147147 | + { 187, -1 }, /* (131) sortorder ::= ASC */ |
| 147148 | + { 187, -1 }, /* (132) sortorder ::= DESC */ |
| 147149 | + { 187, 0 }, /* (133) sortorder ::= */ |
| 147150 | + { 214, 0 }, /* (134) groupby_opt ::= */ |
| 147151 | + { 214, -3 }, /* (135) groupby_opt ::= GROUP BY nexprlist */ |
| 147152 | + { 215, 0 }, /* (136) having_opt ::= */ |
| 147153 | + { 215, -2 }, /* (137) having_opt ::= HAVING expr */ |
| 147154 | + { 217, 0 }, /* (138) limit_opt ::= */ |
| 147155 | + { 217, -2 }, /* (139) limit_opt ::= LIMIT expr */ |
| 147156 | + { 217, -4 }, /* (140) limit_opt ::= LIMIT expr OFFSET expr */ |
| 147157 | + { 217, -4 }, /* (141) limit_opt ::= LIMIT expr COMMA expr */ |
| 147158 | + { 160, -6 }, /* (142) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */ |
| 147159 | + { 213, 0 }, /* (143) where_opt ::= */ |
| 147160 | + { 213, -2 }, /* (144) where_opt ::= WHERE expr */ |
| 147161 | + { 160, -8 }, /* (145) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */ |
| 147162 | + { 233, -5 }, /* (146) setlist ::= setlist COMMA nm EQ expr */ |
| 147163 | + { 233, -7 }, /* (147) setlist ::= setlist COMMA LP idlist RP EQ expr */ |
| 147164 | + { 233, -3 }, /* (148) setlist ::= nm EQ expr */ |
| 147165 | + { 233, -5 }, /* (149) setlist ::= LP idlist RP EQ expr */ |
| 147166 | + { 160, -7 }, /* (150) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */ |
| 147167 | + { 160, -7 }, /* (151) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */ |
| 147168 | + { 236, 0 }, /* (152) upsert ::= */ |
| 147169 | + { 236, -11 }, /* (153) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */ |
| 147170 | + { 236, -8 }, /* (154) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */ |
| 147171 | + { 236, -4 }, /* (155) upsert ::= ON CONFLICT DO NOTHING */ |
| 147172 | + { 234, -2 }, /* (156) insert_cmd ::= INSERT orconf */ |
| 147173 | + { 234, -1 }, /* (157) insert_cmd ::= REPLACE */ |
| 147174 | + { 235, 0 }, /* (158) idlist_opt ::= */ |
| 147175 | + { 235, -3 }, /* (159) idlist_opt ::= LP idlist RP */ |
| 147176 | + { 231, -3 }, /* (160) idlist ::= idlist COMMA nm */ |
| 147177 | + { 231, -1 }, /* (161) idlist ::= nm */ |
| 147178 | + { 185, -3 }, /* (162) expr ::= LP expr RP */ |
| 147179 | + { 185, -1 }, /* (163) expr ::= ID|INDEXED */ |
| 147180 | + { 185, -1 }, /* (164) expr ::= JOIN_KW */ |
| 147181 | + { 185, -3 }, /* (165) expr ::= nm DOT nm */ |
| 147182 | + { 185, -5 }, /* (166) expr ::= nm DOT nm DOT nm */ |
| 147183 | + { 184, -1 }, /* (167) term ::= NULL|FLOAT|BLOB */ |
| 147184 | + { 184, -1 }, /* (168) term ::= STRING */ |
| 147185 | + { 184, -1 }, /* (169) term ::= INTEGER */ |
| 147186 | + { 185, -1 }, /* (170) expr ::= VARIABLE */ |
| 147187 | + { 185, -3 }, /* (171) expr ::= expr COLLATE ID|STRING */ |
| 147188 | + { 185, -6 }, /* (172) expr ::= CAST LP expr AS typetoken RP */ |
| 147189 | + { 185, -5 }, /* (173) expr ::= ID|INDEXED LP distinct exprlist RP */ |
| 147190 | + { 185, -4 }, /* (174) expr ::= ID|INDEXED LP STAR RP */ |
| 147191 | + { 185, -6 }, /* (175) expr ::= ID|INDEXED LP distinct exprlist RP over_clause */ |
| 147192 | + { 185, -5 }, /* (176) expr ::= ID|INDEXED LP STAR RP over_clause */ |
| 147193 | + { 184, -1 }, /* (177) term ::= CTIME_KW */ |
| 147194 | + { 185, -5 }, /* (178) expr ::= LP nexprlist COMMA expr RP */ |
| 147195 | + { 185, -3 }, /* (179) expr ::= expr AND expr */ |
| 147196 | + { 185, -3 }, /* (180) expr ::= expr OR expr */ |
| 147197 | + { 185, -3 }, /* (181) expr ::= expr LT|GT|GE|LE expr */ |
| 147198 | + { 185, -3 }, /* (182) expr ::= expr EQ|NE expr */ |
| 147199 | + { 185, -3 }, /* (183) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ |
| 147200 | + { 185, -3 }, /* (184) expr ::= expr PLUS|MINUS expr */ |
| 147201 | + { 185, -3 }, /* (185) expr ::= expr STAR|SLASH|REM expr */ |
| 147202 | + { 185, -3 }, /* (186) expr ::= expr CONCAT expr */ |
| 147203 | + { 238, -2 }, /* (187) likeop ::= NOT LIKE_KW|MATCH */ |
| 147204 | + { 185, -3 }, /* (188) expr ::= expr likeop expr */ |
| 147205 | + { 185, -5 }, /* (189) expr ::= expr likeop expr ESCAPE expr */ |
| 147206 | + { 185, -2 }, /* (190) expr ::= expr ISNULL|NOTNULL */ |
| 147207 | + { 185, -3 }, /* (191) expr ::= expr NOT NULL */ |
| 147208 | + { 185, -3 }, /* (192) expr ::= expr IS expr */ |
| 147209 | + { 185, -4 }, /* (193) expr ::= expr IS NOT expr */ |
| 147210 | + { 185, -2 }, /* (194) expr ::= NOT expr */ |
| 147211 | + { 185, -2 }, /* (195) expr ::= BITNOT expr */ |
| 147212 | + { 185, -2 }, /* (196) expr ::= PLUS|MINUS expr */ |
| 147213 | + { 239, -1 }, /* (197) between_op ::= BETWEEN */ |
| 147214 | + { 239, -2 }, /* (198) between_op ::= NOT BETWEEN */ |
| 147215 | + { 185, -5 }, /* (199) expr ::= expr between_op expr AND expr */ |
| 147216 | + { 240, -1 }, /* (200) in_op ::= IN */ |
| 147217 | + { 240, -2 }, /* (201) in_op ::= NOT IN */ |
| 147218 | + { 185, -5 }, /* (202) expr ::= expr in_op LP exprlist RP */ |
| 147219 | + { 185, -3 }, /* (203) expr ::= LP select RP */ |
| 147220 | + { 185, -5 }, /* (204) expr ::= expr in_op LP select RP */ |
| 147221 | + { 185, -5 }, /* (205) expr ::= expr in_op nm dbnm paren_exprlist */ |
| 147222 | + { 185, -4 }, /* (206) expr ::= EXISTS LP select RP */ |
| 147223 | + { 185, -5 }, /* (207) expr ::= CASE case_operand case_exprlist case_else END */ |
| 147224 | + { 243, -5 }, /* (208) case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 147225 | + { 243, -4 }, /* (209) case_exprlist ::= WHEN expr THEN expr */ |
| 147226 | + { 244, -2 }, /* (210) case_else ::= ELSE expr */ |
| 147227 | + { 244, 0 }, /* (211) case_else ::= */ |
| 147228 | + { 242, -1 }, /* (212) case_operand ::= expr */ |
| 147229 | + { 242, 0 }, /* (213) case_operand ::= */ |
| 147230 | + { 229, 0 }, /* (214) exprlist ::= */ |
| 147231 | + { 220, -3 }, /* (215) nexprlist ::= nexprlist COMMA expr */ |
| 147232 | + { 220, -1 }, /* (216) nexprlist ::= expr */ |
| 147233 | + { 241, 0 }, /* (217) paren_exprlist ::= */ |
| 147234 | + { 241, -3 }, /* (218) paren_exprlist ::= LP exprlist RP */ |
| 147235 | + { 160, -12 }, /* (219) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 147236 | + { 245, -1 }, /* (220) uniqueflag ::= UNIQUE */ |
| 147237 | + { 245, 0 }, /* (221) uniqueflag ::= */ |
| 147238 | + { 189, 0 }, /* (222) eidlist_opt ::= */ |
| 147239 | + { 189, -3 }, /* (223) eidlist_opt ::= LP eidlist RP */ |
| 147240 | + { 199, -5 }, /* (224) eidlist ::= eidlist COMMA nm collate sortorder */ |
| 147241 | + { 199, -3 }, /* (225) eidlist ::= nm collate sortorder */ |
| 147242 | + { 246, 0 }, /* (226) collate ::= */ |
| 147243 | + { 246, -2 }, /* (227) collate ::= COLLATE ID|STRING */ |
| 147244 | + { 160, -4 }, /* (228) cmd ::= DROP INDEX ifexists fullname */ |
| 147245 | + { 160, -1 }, /* (229) cmd ::= VACUUM */ |
| 147246 | + { 160, -2 }, /* (230) cmd ::= VACUUM nm */ |
| 147247 | + { 160, -3 }, /* (231) cmd ::= PRAGMA nm dbnm */ |
| 147248 | + { 160, -5 }, /* (232) cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 147249 | + { 160, -6 }, /* (233) cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 147250 | + { 160, -5 }, /* (234) cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 147251 | + { 160, -6 }, /* (235) cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 147252 | + { 180, -2 }, /* (236) plus_num ::= PLUS INTEGER|FLOAT */ |
| 147253 | + { 181, -2 }, /* (237) minus_num ::= MINUS INTEGER|FLOAT */ |
| 147254 | + { 160, -5 }, /* (238) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 147255 | + { 248, -11 }, /* (239) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 147256 | + { 250, -1 }, /* (240) trigger_time ::= BEFORE|AFTER */ |
| 147257 | + { 250, -2 }, /* (241) trigger_time ::= INSTEAD OF */ |
| 147258 | + { 250, 0 }, /* (242) trigger_time ::= */ |
| 147259 | + { 251, -1 }, /* (243) trigger_event ::= DELETE|INSERT */ |
| 147260 | + { 251, -1 }, /* (244) trigger_event ::= UPDATE */ |
| 147261 | + { 251, -3 }, /* (245) trigger_event ::= UPDATE OF idlist */ |
| 147262 | + { 253, 0 }, /* (246) when_clause ::= */ |
| 147263 | + { 253, -2 }, /* (247) when_clause ::= WHEN expr */ |
| 147264 | + { 249, -3 }, /* (248) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 147265 | + { 249, -2 }, /* (249) trigger_cmd_list ::= trigger_cmd SEMI */ |
| 147266 | + { 255, -3 }, /* (250) trnm ::= nm DOT nm */ |
| 147267 | + { 256, -3 }, /* (251) tridxby ::= INDEXED BY nm */ |
| 147268 | + { 256, -2 }, /* (252) tridxby ::= NOT INDEXED */ |
| 147269 | + { 254, -8 }, /* (253) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */ |
| 147270 | + { 254, -8 }, /* (254) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 147271 | + { 254, -6 }, /* (255) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 147272 | + { 254, -3 }, /* (256) trigger_cmd ::= scanpt select scanpt */ |
| 147273 | + { 185, -4 }, /* (257) expr ::= RAISE LP IGNORE RP */ |
| 147274 | + { 185, -6 }, /* (258) expr ::= RAISE LP raisetype COMMA nm RP */ |
| 147275 | + { 203, -1 }, /* (259) raisetype ::= ROLLBACK */ |
| 147276 | + { 203, -1 }, /* (260) raisetype ::= ABORT */ |
| 147277 | + { 203, -1 }, /* (261) raisetype ::= FAIL */ |
| 147278 | + { 160, -4 }, /* (262) cmd ::= DROP TRIGGER ifexists fullname */ |
| 147279 | + { 160, -6 }, /* (263) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 147280 | + { 160, -3 }, /* (264) cmd ::= DETACH database_kw_opt expr */ |
| 147281 | + { 258, 0 }, /* (265) key_opt ::= */ |
| 147282 | + { 258, -2 }, /* (266) key_opt ::= KEY expr */ |
| 147283 | + { 160, -1 }, /* (267) cmd ::= REINDEX */ |
| 147284 | + { 160, -3 }, /* (268) cmd ::= REINDEX nm dbnm */ |
| 147285 | + { 160, -1 }, /* (269) cmd ::= ANALYZE */ |
| 147286 | + { 160, -3 }, /* (270) cmd ::= ANALYZE nm dbnm */ |
| 147287 | + { 160, -6 }, /* (271) cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 147288 | + { 160, -7 }, /* (272) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 147289 | + { 259, -1 }, /* (273) add_column_fullname ::= fullname */ |
| 147290 | + { 160, -1 }, /* (274) cmd ::= create_vtab */ |
| 147291 | + { 160, -4 }, /* (275) cmd ::= create_vtab LP vtabarglist RP */ |
| 147292 | + { 261, -8 }, /* (276) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 147293 | + { 263, 0 }, /* (277) vtabarg ::= */ |
| 147294 | + { 264, -1 }, /* (278) vtabargtoken ::= ANY */ |
| 147295 | + { 264, -3 }, /* (279) vtabargtoken ::= lp anylist RP */ |
| 147296 | + { 265, -1 }, /* (280) lp ::= LP */ |
| 147297 | + { 232, -2 }, /* (281) with ::= WITH wqlist */ |
| 147298 | + { 232, -3 }, /* (282) with ::= WITH RECURSIVE wqlist */ |
| 147299 | + { 208, -6 }, /* (283) wqlist ::= nm eidlist_opt AS LP select RP */ |
| 147300 | + { 208, -8 }, /* (284) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ |
| 147301 | + { 267, -1 }, /* (285) windowdefn_list ::= windowdefn */ |
| 147302 | + { 267, -3 }, /* (286) windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 147303 | + { 268, -3 }, /* (287) windowdefn ::= nm AS window */ |
| 147304 | + { 269, -5 }, /* (288) window ::= LP part_opt orderby_opt frame_opt RP */ |
| 147305 | + { 271, -3 }, /* (289) part_opt ::= PARTITION BY nexprlist */ |
| 147306 | + { 271, 0 }, /* (290) part_opt ::= */ |
| 147307 | + { 270, 0 }, /* (291) frame_opt ::= */ |
| 147308 | + { 270, -2 }, /* (292) frame_opt ::= range_or_rows frame_bound_s */ |
| 147309 | + { 270, -5 }, /* (293) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */ |
| 147310 | + { 273, -1 }, /* (294) range_or_rows ::= RANGE */ |
| 147311 | + { 273, -1 }, /* (295) range_or_rows ::= ROWS */ |
| 147312 | + { 275, -1 }, /* (296) frame_bound_s ::= frame_bound */ |
| 147313 | + { 275, -2 }, /* (297) frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 147314 | + { 276, -1 }, /* (298) frame_bound_e ::= frame_bound */ |
| 147315 | + { 276, -2 }, /* (299) frame_bound_e ::= UNBOUNDED FOLLOWING */ |
| 147316 | + { 274, -2 }, /* (300) frame_bound ::= expr PRECEDING */ |
| 147317 | + { 274, -2 }, /* (301) frame_bound ::= CURRENT ROW */ |
| 147318 | + { 274, -2 }, /* (302) frame_bound ::= expr FOLLOWING */ |
| 147319 | + { 218, -2 }, /* (303) window_clause ::= WINDOW windowdefn_list */ |
| 147320 | + { 237, -3 }, /* (304) over_clause ::= filter_opt OVER window */ |
| 147321 | + { 237, -3 }, /* (305) over_clause ::= filter_opt OVER nm */ |
| 147322 | + { 272, 0 }, /* (306) filter_opt ::= */ |
| 147323 | + { 272, -5 }, /* (307) filter_opt ::= FILTER LP WHERE expr RP */ |
| 147324 | + { 155, -1 }, /* (308) input ::= cmdlist */ |
| 147325 | + { 156, -2 }, /* (309) cmdlist ::= cmdlist ecmd */ |
| 147326 | + { 156, -1 }, /* (310) cmdlist ::= ecmd */ |
| 147327 | + { 157, -1 }, /* (311) ecmd ::= SEMI */ |
| 147328 | + { 157, -2 }, /* (312) ecmd ::= cmdx SEMI */ |
| 147329 | + { 157, -2 }, /* (313) ecmd ::= explain cmdx */ |
| 147330 | + { 162, 0 }, /* (314) trans_opt ::= */ |
| 147331 | + { 162, -1 }, /* (315) trans_opt ::= TRANSACTION */ |
| 147332 | + { 162, -2 }, /* (316) trans_opt ::= TRANSACTION nm */ |
| 147333 | + { 164, -1 }, /* (317) savepoint_opt ::= SAVEPOINT */ |
| 147334 | + { 164, 0 }, /* (318) savepoint_opt ::= */ |
| 147335 | + { 160, -2 }, /* (319) cmd ::= create_table create_table_args */ |
| 147336 | + { 171, -4 }, /* (320) columnlist ::= columnlist COMMA columnname carglist */ |
| 147337 | + { 171, -2 }, /* (321) columnlist ::= columnname carglist */ |
| 147338 | + { 163, -1 }, /* (322) nm ::= ID|INDEXED */ |
| 147339 | + { 163, -1 }, /* (323) nm ::= STRING */ |
| 147340 | + { 163, -1 }, /* (324) nm ::= JOIN_KW */ |
| 147341 | + { 177, -1 }, /* (325) typetoken ::= typename */ |
| 147342 | + { 178, -1 }, /* (326) typename ::= ID|STRING */ |
| 147343 | + { 179, -1 }, /* (327) signed ::= plus_num */ |
| 147344 | + { 179, -1 }, /* (328) signed ::= minus_num */ |
| 147345 | + { 176, -2 }, /* (329) carglist ::= carglist ccons */ |
| 147346 | + { 176, 0 }, /* (330) carglist ::= */ |
| 147347 | + { 183, -2 }, /* (331) ccons ::= NULL onconf */ |
| 147348 | + { 172, -2 }, /* (332) conslist_opt ::= COMMA conslist */ |
| 147349 | + { 195, -3 }, /* (333) conslist ::= conslist tconscomma tcons */ |
| 147350 | + { 195, -1 }, /* (334) conslist ::= tcons */ |
| 147351 | + { 196, 0 }, /* (335) tconscomma ::= */ |
| 147352 | + { 200, -1 }, /* (336) defer_subclause_opt ::= defer_subclause */ |
| 147353 | + { 202, -1 }, /* (337) resolvetype ::= raisetype */ |
| 147354 | + { 206, -1 }, /* (338) selectnowith ::= oneselect */ |
| 147355 | + { 207, -1 }, /* (339) oneselect ::= values */ |
| 147356 | + { 221, -2 }, /* (340) sclp ::= selcollist COMMA */ |
| 147357 | + { 222, -1 }, /* (341) as ::= ID|STRING */ |
| 147358 | + { 185, -1 }, /* (342) expr ::= term */ |
| 147359 | + { 238, -1 }, /* (343) likeop ::= LIKE_KW|MATCH */ |
| 147360 | + { 229, -1 }, /* (344) exprlist ::= nexprlist */ |
| 147361 | + { 247, -1 }, /* (345) nmnum ::= plus_num */ |
| 147362 | + { 247, -1 }, /* (346) nmnum ::= nm */ |
| 147363 | + { 247, -1 }, /* (347) nmnum ::= ON */ |
| 147364 | + { 247, -1 }, /* (348) nmnum ::= DELETE */ |
| 147365 | + { 247, -1 }, /* (349) nmnum ::= DEFAULT */ |
| 147366 | + { 180, -1 }, /* (350) plus_num ::= INTEGER|FLOAT */ |
| 147367 | + { 252, 0 }, /* (351) foreach_clause ::= */ |
| 147368 | + { 252, -3 }, /* (352) foreach_clause ::= FOR EACH ROW */ |
| 147369 | + { 255, -1 }, /* (353) trnm ::= nm */ |
| 147370 | + { 256, 0 }, /* (354) tridxby ::= */ |
| 147371 | + { 257, -1 }, /* (355) database_kw_opt ::= DATABASE */ |
| 147372 | + { 257, 0 }, /* (356) database_kw_opt ::= */ |
| 147373 | + { 260, 0 }, /* (357) kwcolumn_opt ::= */ |
| 147374 | + { 260, -1 }, /* (358) kwcolumn_opt ::= COLUMNKW */ |
| 147375 | + { 262, -1 }, /* (359) vtabarglist ::= vtabarg */ |
| 147376 | + { 262, -3 }, /* (360) vtabarglist ::= vtabarglist COMMA vtabarg */ |
| 147377 | + { 263, -2 }, /* (361) vtabarg ::= vtabarg vtabargtoken */ |
| 147378 | + { 266, 0 }, /* (362) anylist ::= */ |
| 147379 | + { 266, -4 }, /* (363) anylist ::= anylist LP anylist RP */ |
| 147380 | + { 266, -2 }, /* (364) anylist ::= anylist ANY */ |
| 147381 | + { 232, 0 }, /* (365) with ::= */ |
| 147461 | 147382 | }; |
| 147462 | 147383 | |
| 147463 | 147384 | static void yy_accept(yyParser*); /* Forward Declaration */ |
| 147464 | 147385 | |
| 147465 | 147386 | /* |
| | @@ -147596,12 +147517,12 @@ |
| 147596 | 147517 | case 21: /* table_options ::= */ yytestcase(yyruleno==21); |
| 147597 | 147518 | case 42: /* autoinc ::= */ yytestcase(yyruleno==42); |
| 147598 | 147519 | case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57); |
| 147599 | 147520 | case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67); |
| 147600 | 147521 | case 76: /* ifexists ::= */ yytestcase(yyruleno==76); |
| 147601 | | - case 92: /* distinct ::= */ yytestcase(yyruleno==92); |
| 147602 | | - case 223: /* collate ::= */ yytestcase(yyruleno==223); |
| 147522 | + case 93: /* distinct ::= */ yytestcase(yyruleno==93); |
| 147523 | + case 226: /* collate ::= */ yytestcase(yyruleno==226); |
| 147603 | 147524 | {yymsp[1].minor.yy70 = 0;} |
| 147604 | 147525 | break; |
| 147605 | 147526 | case 16: /* ifnotexists ::= IF NOT EXISTS */ |
| 147606 | 147527 | {yymsp[-2].minor.yy70 = 1;} |
| 147607 | 147528 | break; |
| | @@ -147633,11 +147554,11 @@ |
| 147633 | 147554 | case 23: /* columnname ::= nm typetoken */ |
| 147634 | 147555 | {sqlite3AddColumn(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} |
| 147635 | 147556 | break; |
| 147636 | 147557 | case 24: /* typetoken ::= */ |
| 147637 | 147558 | case 60: /* conslist_opt ::= */ yytestcase(yyruleno==60); |
| 147638 | | - case 98: /* as ::= */ yytestcase(yyruleno==98); |
| 147559 | + case 99: /* as ::= */ yytestcase(yyruleno==99); |
| 147639 | 147560 | {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;} |
| 147640 | 147561 | break; |
| 147641 | 147562 | case 25: /* typetoken ::= typename LP signed RP */ |
| 147642 | 147563 | { |
| 147643 | 147564 | yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z); |
| | @@ -147744,18 +147665,18 @@ |
| 147744 | 147665 | case 55: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ |
| 147745 | 147666 | {yymsp[-2].minor.yy70 = 0;} |
| 147746 | 147667 | break; |
| 147747 | 147668 | case 56: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ |
| 147748 | 147669 | case 71: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==71); |
| 147749 | | - case 155: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==155); |
| 147670 | + case 156: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==156); |
| 147750 | 147671 | {yymsp[-1].minor.yy70 = yymsp[0].minor.yy70;} |
| 147751 | 147672 | break; |
| 147752 | 147673 | case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ |
| 147753 | 147674 | case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75); |
| 147754 | | - case 195: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==195); |
| 147755 | | - case 198: /* in_op ::= NOT IN */ yytestcase(yyruleno==198); |
| 147756 | | - case 224: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==224); |
| 147675 | + case 198: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==198); |
| 147676 | + case 201: /* in_op ::= NOT IN */ yytestcase(yyruleno==201); |
| 147677 | + case 227: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==227); |
| 147757 | 147678 | {yymsp[-1].minor.yy70 = 1;} |
| 147758 | 147679 | break; |
| 147759 | 147680 | case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ |
| 147760 | 147681 | {yymsp[-1].minor.yy70 = 0;} |
| 147761 | 147682 | break; |
| | @@ -147787,11 +147708,11 @@ |
| 147787 | 147708 | break; |
| 147788 | 147709 | case 72: /* resolvetype ::= IGNORE */ |
| 147789 | 147710 | {yymsp[0].minor.yy70 = OE_Ignore;} |
| 147790 | 147711 | break; |
| 147791 | 147712 | case 73: /* resolvetype ::= REPLACE */ |
| 147792 | | - case 156: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==156); |
| 147713 | + case 157: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==157); |
| 147793 | 147714 | {yymsp[0].minor.yy70 = OE_Replace;} |
| 147794 | 147715 | break; |
| 147795 | 147716 | case 74: /* cmd ::= DROP TABLE ifexists fullname */ |
| 147796 | 147717 | { |
| 147797 | 147718 | sqlite3DropTable(pParse, yymsp[0].minor.yy135, 0, yymsp[-1].minor.yy70); |
| | @@ -147876,28 +147797,31 @@ |
| 147876 | 147797 | {yymsp[0].minor.yy70 = yymsp[0].major; /*A-overwrites-OP*/} |
| 147877 | 147798 | break; |
| 147878 | 147799 | case 85: /* multiselect_op ::= UNION ALL */ |
| 147879 | 147800 | {yymsp[-1].minor.yy70 = TK_ALL;} |
| 147880 | 147801 | break; |
| 147881 | | - case 87: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt windowdefn_opt orderby_opt limit_opt */ |
| 147802 | + case 87: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 147803 | +{ |
| 147804 | + yymsp[-8].minor.yy489 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy420,yymsp[-5].minor.yy135,yymsp[-4].minor.yy18,yymsp[-3].minor.yy420,yymsp[-2].minor.yy18,yymsp[-1].minor.yy420,yymsp[-7].minor.yy70,yymsp[0].minor.yy18); |
| 147805 | +} |
| 147806 | + break; |
| 147807 | + case 88: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */ |
| 147882 | 147808 | { |
| 147883 | 147809 | yymsp[-9].minor.yy489 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy420,yymsp[-6].minor.yy135,yymsp[-5].minor.yy18,yymsp[-4].minor.yy420,yymsp[-3].minor.yy18,yymsp[-1].minor.yy420,yymsp[-8].minor.yy70,yymsp[0].minor.yy18); |
| 147884 | | -#ifndef SQLITE_OMIT_WINDOWFUNC |
| 147885 | 147810 | if( yymsp[-9].minor.yy489 ){ |
| 147886 | 147811 | yymsp[-9].minor.yy489->pWinDefn = yymsp[-2].minor.yy327; |
| 147887 | 147812 | }else{ |
| 147888 | 147813 | sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy327); |
| 147889 | 147814 | } |
| 147890 | | -#endif /* SQLITE_OMIT_WINDOWFUNC */ |
| 147891 | 147815 | } |
| 147892 | 147816 | break; |
| 147893 | | - case 88: /* values ::= VALUES LP nexprlist RP */ |
| 147817 | + case 89: /* values ::= VALUES LP nexprlist RP */ |
| 147894 | 147818 | { |
| 147895 | 147819 | yymsp[-3].minor.yy489 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy420,0,0,0,0,0,SF_Values,0); |
| 147896 | 147820 | } |
| 147897 | 147821 | break; |
| 147898 | | - case 89: /* values ::= values COMMA LP exprlist RP */ |
| 147822 | + case 90: /* values ::= values COMMA LP nexprlist RP */ |
| 147899 | 147823 | { |
| 147900 | 147824 | Select *pRight, *pLeft = yymsp[-4].minor.yy489; |
| 147901 | 147825 | pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy420,0,0,0,0,0,SF_Values|SF_MultiValue,0); |
| 147902 | 147826 | if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue; |
| 147903 | 147827 | if( pRight ){ |
| | @@ -147907,86 +147831,86 @@ |
| 147907 | 147831 | }else{ |
| 147908 | 147832 | yymsp[-4].minor.yy489 = pLeft; |
| 147909 | 147833 | } |
| 147910 | 147834 | } |
| 147911 | 147835 | break; |
| 147912 | | - case 90: /* distinct ::= DISTINCT */ |
| 147836 | + case 91: /* distinct ::= DISTINCT */ |
| 147913 | 147837 | {yymsp[0].minor.yy70 = SF_Distinct;} |
| 147914 | 147838 | break; |
| 147915 | | - case 91: /* distinct ::= ALL */ |
| 147839 | + case 92: /* distinct ::= ALL */ |
| 147916 | 147840 | {yymsp[0].minor.yy70 = SF_All;} |
| 147917 | 147841 | break; |
| 147918 | | - case 93: /* sclp ::= */ |
| 147919 | | - case 126: /* orderby_opt ::= */ yytestcase(yyruleno==126); |
| 147920 | | - case 133: /* groupby_opt ::= */ yytestcase(yyruleno==133); |
| 147921 | | - case 211: /* exprlist ::= */ yytestcase(yyruleno==211); |
| 147922 | | - case 214: /* paren_exprlist ::= */ yytestcase(yyruleno==214); |
| 147923 | | - case 219: /* eidlist_opt ::= */ yytestcase(yyruleno==219); |
| 147842 | + case 94: /* sclp ::= */ |
| 147843 | + case 127: /* orderby_opt ::= */ yytestcase(yyruleno==127); |
| 147844 | + case 134: /* groupby_opt ::= */ yytestcase(yyruleno==134); |
| 147845 | + case 214: /* exprlist ::= */ yytestcase(yyruleno==214); |
| 147846 | + case 217: /* paren_exprlist ::= */ yytestcase(yyruleno==217); |
| 147847 | + case 222: /* eidlist_opt ::= */ yytestcase(yyruleno==222); |
| 147924 | 147848 | {yymsp[1].minor.yy420 = 0;} |
| 147925 | 147849 | break; |
| 147926 | | - case 94: /* selcollist ::= sclp scanpt expr scanpt as */ |
| 147850 | + case 95: /* selcollist ::= sclp scanpt expr scanpt as */ |
| 147927 | 147851 | { |
| 147928 | 147852 | yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy420, yymsp[-2].minor.yy18); |
| 147929 | 147853 | if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy420, &yymsp[0].minor.yy0, 1); |
| 147930 | 147854 | sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy420,yymsp[-3].minor.yy392,yymsp[-1].minor.yy392); |
| 147931 | 147855 | } |
| 147932 | 147856 | break; |
| 147933 | | - case 95: /* selcollist ::= sclp scanpt STAR */ |
| 147857 | + case 96: /* selcollist ::= sclp scanpt STAR */ |
| 147934 | 147858 | { |
| 147935 | 147859 | Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0); |
| 147936 | 147860 | yymsp[-2].minor.yy420 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy420, p); |
| 147937 | 147861 | } |
| 147938 | 147862 | break; |
| 147939 | | - case 96: /* selcollist ::= sclp scanpt nm DOT STAR */ |
| 147863 | + case 97: /* selcollist ::= sclp scanpt nm DOT STAR */ |
| 147940 | 147864 | { |
| 147941 | 147865 | Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0); |
| 147942 | 147866 | Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1); |
| 147943 | 147867 | Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight); |
| 147944 | 147868 | yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy420, pDot); |
| 147945 | 147869 | } |
| 147946 | 147870 | break; |
| 147947 | | - case 97: /* as ::= AS nm */ |
| 147948 | | - case 108: /* dbnm ::= DOT nm */ yytestcase(yyruleno==108); |
| 147949 | | - case 233: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==233); |
| 147950 | | - case 234: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==234); |
| 147871 | + case 98: /* as ::= AS nm */ |
| 147872 | + case 109: /* dbnm ::= DOT nm */ yytestcase(yyruleno==109); |
| 147873 | + case 236: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==236); |
| 147874 | + case 237: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==237); |
| 147951 | 147875 | {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;} |
| 147952 | 147876 | break; |
| 147953 | | - case 99: /* from ::= */ |
| 147877 | + case 100: /* from ::= */ |
| 147954 | 147878 | {yymsp[1].minor.yy135 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy135));} |
| 147955 | 147879 | break; |
| 147956 | | - case 100: /* from ::= FROM seltablist */ |
| 147880 | + case 101: /* from ::= FROM seltablist */ |
| 147957 | 147881 | { |
| 147958 | 147882 | yymsp[-1].minor.yy135 = yymsp[0].minor.yy135; |
| 147959 | 147883 | sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy135); |
| 147960 | 147884 | } |
| 147961 | 147885 | break; |
| 147962 | | - case 101: /* stl_prefix ::= seltablist joinop */ |
| 147886 | + case 102: /* stl_prefix ::= seltablist joinop */ |
| 147963 | 147887 | { |
| 147964 | 147888 | if( ALWAYS(yymsp[-1].minor.yy135 && yymsp[-1].minor.yy135->nSrc>0) ) yymsp[-1].minor.yy135->a[yymsp[-1].minor.yy135->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy70; |
| 147965 | 147889 | } |
| 147966 | 147890 | break; |
| 147967 | | - case 102: /* stl_prefix ::= */ |
| 147891 | + case 103: /* stl_prefix ::= */ |
| 147968 | 147892 | {yymsp[1].minor.yy135 = 0;} |
| 147969 | 147893 | break; |
| 147970 | | - case 103: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 147894 | + case 104: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 147971 | 147895 | { |
| 147972 | 147896 | yymsp[-6].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy135,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy18,yymsp[0].minor.yy48); |
| 147973 | 147897 | sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy135, &yymsp[-2].minor.yy0); |
| 147974 | 147898 | } |
| 147975 | 147899 | break; |
| 147976 | | - case 104: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */ |
| 147900 | + case 105: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */ |
| 147977 | 147901 | { |
| 147978 | 147902 | yymsp[-8].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy135,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy18,yymsp[0].minor.yy48); |
| 147979 | 147903 | sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy135, yymsp[-4].minor.yy420); |
| 147980 | 147904 | } |
| 147981 | 147905 | break; |
| 147982 | | - case 105: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 147906 | + case 106: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 147983 | 147907 | { |
| 147984 | 147908 | yymsp[-6].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy135,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy489,yymsp[-1].minor.yy18,yymsp[0].minor.yy48); |
| 147985 | 147909 | } |
| 147986 | 147910 | break; |
| 147987 | | - case 106: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 147911 | + case 107: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 147988 | 147912 | { |
| 147989 | 147913 | if( yymsp[-6].minor.yy135==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy18==0 && yymsp[0].minor.yy48==0 ){ |
| 147990 | 147914 | yymsp[-6].minor.yy135 = yymsp[-4].minor.yy135; |
| 147991 | 147915 | }else if( yymsp[-4].minor.yy135->nSrc==1 ){ |
| 147992 | 147916 | yymsp[-6].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy135,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy18,yymsp[0].minor.yy48); |
| | @@ -148006,210 +147930,210 @@ |
| 148006 | 147930 | pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy135,0,0,0,0,SF_NestedFrom,0); |
| 148007 | 147931 | yymsp[-6].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy135,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy18,yymsp[0].minor.yy48); |
| 148008 | 147932 | } |
| 148009 | 147933 | } |
| 148010 | 147934 | break; |
| 148011 | | - case 107: /* dbnm ::= */ |
| 148012 | | - case 121: /* indexed_opt ::= */ yytestcase(yyruleno==121); |
| 147935 | + case 108: /* dbnm ::= */ |
| 147936 | + case 122: /* indexed_opt ::= */ yytestcase(yyruleno==122); |
| 148013 | 147937 | {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;} |
| 148014 | 147938 | break; |
| 148015 | | - case 109: /* fullname ::= nm */ |
| 148016 | | - case 111: /* xfullname ::= nm */ yytestcase(yyruleno==111); |
| 147939 | + case 110: /* fullname ::= nm */ |
| 147940 | + case 112: /* xfullname ::= nm */ yytestcase(yyruleno==112); |
| 148017 | 147941 | {yymsp[0].minor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/} |
| 148018 | 147942 | break; |
| 148019 | | - case 110: /* fullname ::= nm DOT nm */ |
| 148020 | | - case 112: /* xfullname ::= nm DOT nm */ yytestcase(yyruleno==112); |
| 147943 | + case 111: /* fullname ::= nm DOT nm */ |
| 147944 | + case 113: /* xfullname ::= nm DOT nm */ yytestcase(yyruleno==113); |
| 148021 | 147945 | {yymsp[-2].minor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/} |
| 148022 | 147946 | break; |
| 148023 | | - case 113: /* xfullname ::= nm DOT nm AS nm */ |
| 147947 | + case 114: /* xfullname ::= nm DOT nm AS nm */ |
| 148024 | 147948 | { |
| 148025 | 147949 | yymsp[-4].minor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/ |
| 148026 | 147950 | if( yymsp[-4].minor.yy135 ) yymsp[-4].minor.yy135->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0); |
| 148027 | 147951 | } |
| 148028 | 147952 | break; |
| 148029 | | - case 114: /* xfullname ::= nm AS nm */ |
| 147953 | + case 115: /* xfullname ::= nm AS nm */ |
| 148030 | 147954 | { |
| 148031 | 147955 | yymsp[-2].minor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/ |
| 148032 | 147956 | if( yymsp[-2].minor.yy135 ) yymsp[-2].minor.yy135->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0); |
| 148033 | 147957 | } |
| 148034 | 147958 | break; |
| 148035 | | - case 115: /* joinop ::= COMMA|JOIN */ |
| 147959 | + case 116: /* joinop ::= COMMA|JOIN */ |
| 148036 | 147960 | { yymsp[0].minor.yy70 = JT_INNER; } |
| 148037 | 147961 | break; |
| 148038 | | - case 116: /* joinop ::= JOIN_KW JOIN */ |
| 147962 | + case 117: /* joinop ::= JOIN_KW JOIN */ |
| 148039 | 147963 | {yymsp[-1].minor.yy70 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/} |
| 148040 | 147964 | break; |
| 148041 | | - case 117: /* joinop ::= JOIN_KW nm JOIN */ |
| 147965 | + case 118: /* joinop ::= JOIN_KW nm JOIN */ |
| 148042 | 147966 | {yymsp[-2].minor.yy70 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/} |
| 148043 | 147967 | break; |
| 148044 | | - case 118: /* joinop ::= JOIN_KW nm nm JOIN */ |
| 147968 | + case 119: /* joinop ::= JOIN_KW nm nm JOIN */ |
| 148045 | 147969 | {yymsp[-3].minor.yy70 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/} |
| 148046 | 147970 | break; |
| 148047 | | - case 119: /* on_opt ::= ON expr */ |
| 148048 | | - case 136: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==136); |
| 148049 | | - case 143: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==143); |
| 148050 | | - case 207: /* case_else ::= ELSE expr */ yytestcase(yyruleno==207); |
| 147971 | + case 120: /* on_opt ::= ON expr */ |
| 147972 | + case 137: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==137); |
| 147973 | + case 144: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==144); |
| 147974 | + case 210: /* case_else ::= ELSE expr */ yytestcase(yyruleno==210); |
| 148051 | 147975 | {yymsp[-1].minor.yy18 = yymsp[0].minor.yy18;} |
| 148052 | 147976 | break; |
| 148053 | | - case 120: /* on_opt ::= */ |
| 148054 | | - case 135: /* having_opt ::= */ yytestcase(yyruleno==135); |
| 148055 | | - case 137: /* limit_opt ::= */ yytestcase(yyruleno==137); |
| 148056 | | - case 142: /* where_opt ::= */ yytestcase(yyruleno==142); |
| 148057 | | - case 208: /* case_else ::= */ yytestcase(yyruleno==208); |
| 148058 | | - case 210: /* case_operand ::= */ yytestcase(yyruleno==210); |
| 147977 | + case 121: /* on_opt ::= */ |
| 147978 | + case 136: /* having_opt ::= */ yytestcase(yyruleno==136); |
| 147979 | + case 138: /* limit_opt ::= */ yytestcase(yyruleno==138); |
| 147980 | + case 143: /* where_opt ::= */ yytestcase(yyruleno==143); |
| 147981 | + case 211: /* case_else ::= */ yytestcase(yyruleno==211); |
| 147982 | + case 213: /* case_operand ::= */ yytestcase(yyruleno==213); |
| 148059 | 147983 | {yymsp[1].minor.yy18 = 0;} |
| 148060 | 147984 | break; |
| 148061 | | - case 122: /* indexed_opt ::= INDEXED BY nm */ |
| 147985 | + case 123: /* indexed_opt ::= INDEXED BY nm */ |
| 148062 | 147986 | {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;} |
| 148063 | 147987 | break; |
| 148064 | | - case 123: /* indexed_opt ::= NOT INDEXED */ |
| 147988 | + case 124: /* indexed_opt ::= NOT INDEXED */ |
| 148065 | 147989 | {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;} |
| 148066 | 147990 | break; |
| 148067 | | - case 124: /* using_opt ::= USING LP idlist RP */ |
| 147991 | + case 125: /* using_opt ::= USING LP idlist RP */ |
| 148068 | 147992 | {yymsp[-3].minor.yy48 = yymsp[-1].minor.yy48;} |
| 148069 | 147993 | break; |
| 148070 | | - case 125: /* using_opt ::= */ |
| 148071 | | - case 157: /* idlist_opt ::= */ yytestcase(yyruleno==157); |
| 147994 | + case 126: /* using_opt ::= */ |
| 147995 | + case 158: /* idlist_opt ::= */ yytestcase(yyruleno==158); |
| 148072 | 147996 | {yymsp[1].minor.yy48 = 0;} |
| 148073 | 147997 | break; |
| 148074 | | - case 127: /* orderby_opt ::= ORDER BY sortlist */ |
| 148075 | | - case 134: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==134); |
| 147998 | + case 128: /* orderby_opt ::= ORDER BY sortlist */ |
| 147999 | + case 135: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==135); |
| 148076 | 148000 | {yymsp[-2].minor.yy420 = yymsp[0].minor.yy420;} |
| 148077 | 148001 | break; |
| 148078 | | - case 128: /* sortlist ::= sortlist COMMA expr sortorder */ |
| 148002 | + case 129: /* sortlist ::= sortlist COMMA expr sortorder */ |
| 148079 | 148003 | { |
| 148080 | 148004 | yymsp[-3].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy420,yymsp[-1].minor.yy18); |
| 148081 | 148005 | sqlite3ExprListSetSortOrder(yymsp[-3].minor.yy420,yymsp[0].minor.yy70); |
| 148082 | 148006 | } |
| 148083 | 148007 | break; |
| 148084 | | - case 129: /* sortlist ::= expr sortorder */ |
| 148008 | + case 130: /* sortlist ::= expr sortorder */ |
| 148085 | 148009 | { |
| 148086 | 148010 | yymsp[-1].minor.yy420 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy18); /*A-overwrites-Y*/ |
| 148087 | 148011 | sqlite3ExprListSetSortOrder(yymsp[-1].minor.yy420,yymsp[0].minor.yy70); |
| 148088 | 148012 | } |
| 148089 | 148013 | break; |
| 148090 | | - case 130: /* sortorder ::= ASC */ |
| 148014 | + case 131: /* sortorder ::= ASC */ |
| 148091 | 148015 | {yymsp[0].minor.yy70 = SQLITE_SO_ASC;} |
| 148092 | 148016 | break; |
| 148093 | | - case 131: /* sortorder ::= DESC */ |
| 148017 | + case 132: /* sortorder ::= DESC */ |
| 148094 | 148018 | {yymsp[0].minor.yy70 = SQLITE_SO_DESC;} |
| 148095 | 148019 | break; |
| 148096 | | - case 132: /* sortorder ::= */ |
| 148020 | + case 133: /* sortorder ::= */ |
| 148097 | 148021 | {yymsp[1].minor.yy70 = SQLITE_SO_UNDEFINED;} |
| 148098 | 148022 | break; |
| 148099 | | - case 138: /* limit_opt ::= LIMIT expr */ |
| 148023 | + case 139: /* limit_opt ::= LIMIT expr */ |
| 148100 | 148024 | {yymsp[-1].minor.yy18 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy18,0);} |
| 148101 | 148025 | break; |
| 148102 | | - case 139: /* limit_opt ::= LIMIT expr OFFSET expr */ |
| 148026 | + case 140: /* limit_opt ::= LIMIT expr OFFSET expr */ |
| 148103 | 148027 | {yymsp[-3].minor.yy18 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy18,yymsp[0].minor.yy18);} |
| 148104 | 148028 | break; |
| 148105 | | - case 140: /* limit_opt ::= LIMIT expr COMMA expr */ |
| 148029 | + case 141: /* limit_opt ::= LIMIT expr COMMA expr */ |
| 148106 | 148030 | {yymsp[-3].minor.yy18 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy18,yymsp[-2].minor.yy18);} |
| 148107 | 148031 | break; |
| 148108 | | - case 141: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt */ |
| 148032 | + case 142: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt */ |
| 148109 | 148033 | { |
| 148110 | 148034 | sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy135, &yymsp[-1].minor.yy0); |
| 148111 | 148035 | sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy135,yymsp[0].minor.yy18,0,0); |
| 148112 | 148036 | } |
| 148113 | 148037 | break; |
| 148114 | | - case 144: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */ |
| 148038 | + case 145: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */ |
| 148115 | 148039 | { |
| 148116 | 148040 | sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy135, &yymsp[-3].minor.yy0); |
| 148117 | 148041 | sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy420,"set list"); |
| 148118 | 148042 | sqlite3Update(pParse,yymsp[-4].minor.yy135,yymsp[-1].minor.yy420,yymsp[0].minor.yy18,yymsp[-5].minor.yy70,0,0,0); |
| 148119 | 148043 | } |
| 148120 | 148044 | break; |
| 148121 | | - case 145: /* setlist ::= setlist COMMA nm EQ expr */ |
| 148045 | + case 146: /* setlist ::= setlist COMMA nm EQ expr */ |
| 148122 | 148046 | { |
| 148123 | 148047 | yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy420, yymsp[0].minor.yy18); |
| 148124 | 148048 | sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy420, &yymsp[-2].minor.yy0, 1); |
| 148125 | 148049 | } |
| 148126 | 148050 | break; |
| 148127 | | - case 146: /* setlist ::= setlist COMMA LP idlist RP EQ expr */ |
| 148051 | + case 147: /* setlist ::= setlist COMMA LP idlist RP EQ expr */ |
| 148128 | 148052 | { |
| 148129 | 148053 | yymsp[-6].minor.yy420 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy420, yymsp[-3].minor.yy48, yymsp[0].minor.yy18); |
| 148130 | 148054 | } |
| 148131 | 148055 | break; |
| 148132 | | - case 147: /* setlist ::= nm EQ expr */ |
| 148056 | + case 148: /* setlist ::= nm EQ expr */ |
| 148133 | 148057 | { |
| 148134 | 148058 | yylhsminor.yy420 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy18); |
| 148135 | 148059 | sqlite3ExprListSetName(pParse, yylhsminor.yy420, &yymsp[-2].minor.yy0, 1); |
| 148136 | 148060 | } |
| 148137 | 148061 | yymsp[-2].minor.yy420 = yylhsminor.yy420; |
| 148138 | 148062 | break; |
| 148139 | | - case 148: /* setlist ::= LP idlist RP EQ expr */ |
| 148063 | + case 149: /* setlist ::= LP idlist RP EQ expr */ |
| 148140 | 148064 | { |
| 148141 | 148065 | yymsp[-4].minor.yy420 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy48, yymsp[0].minor.yy18); |
| 148142 | 148066 | } |
| 148143 | 148067 | break; |
| 148144 | | - case 149: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */ |
| 148068 | + case 150: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */ |
| 148145 | 148069 | { |
| 148146 | 148070 | sqlite3Insert(pParse, yymsp[-3].minor.yy135, yymsp[-1].minor.yy489, yymsp[-2].minor.yy48, yymsp[-5].minor.yy70, yymsp[0].minor.yy340); |
| 148147 | 148071 | } |
| 148148 | 148072 | break; |
| 148149 | | - case 150: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */ |
| 148073 | + case 151: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */ |
| 148150 | 148074 | { |
| 148151 | 148075 | sqlite3Insert(pParse, yymsp[-3].minor.yy135, 0, yymsp[-2].minor.yy48, yymsp[-5].minor.yy70, 0); |
| 148152 | 148076 | } |
| 148153 | 148077 | break; |
| 148154 | | - case 151: /* upsert ::= */ |
| 148078 | + case 152: /* upsert ::= */ |
| 148155 | 148079 | { yymsp[1].minor.yy340 = 0; } |
| 148156 | 148080 | break; |
| 148157 | | - case 152: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */ |
| 148081 | + case 153: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */ |
| 148158 | 148082 | { yymsp[-10].minor.yy340 = sqlite3UpsertNew(pParse->db,yymsp[-7].minor.yy420,yymsp[-5].minor.yy18,yymsp[-1].minor.yy420,yymsp[0].minor.yy18);} |
| 148159 | 148083 | break; |
| 148160 | | - case 153: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */ |
| 148084 | + case 154: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */ |
| 148161 | 148085 | { yymsp[-7].minor.yy340 = sqlite3UpsertNew(pParse->db,yymsp[-4].minor.yy420,yymsp[-2].minor.yy18,0,0); } |
| 148162 | 148086 | break; |
| 148163 | | - case 154: /* upsert ::= ON CONFLICT DO NOTHING */ |
| 148087 | + case 155: /* upsert ::= ON CONFLICT DO NOTHING */ |
| 148164 | 148088 | { yymsp[-3].minor.yy340 = sqlite3UpsertNew(pParse->db,0,0,0,0); } |
| 148165 | 148089 | break; |
| 148166 | | - case 158: /* idlist_opt ::= LP idlist RP */ |
| 148090 | + case 159: /* idlist_opt ::= LP idlist RP */ |
| 148167 | 148091 | {yymsp[-2].minor.yy48 = yymsp[-1].minor.yy48;} |
| 148168 | 148092 | break; |
| 148169 | | - case 159: /* idlist ::= idlist COMMA nm */ |
| 148093 | + case 160: /* idlist ::= idlist COMMA nm */ |
| 148170 | 148094 | {yymsp[-2].minor.yy48 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy48,&yymsp[0].minor.yy0);} |
| 148171 | 148095 | break; |
| 148172 | | - case 160: /* idlist ::= nm */ |
| 148096 | + case 161: /* idlist ::= nm */ |
| 148173 | 148097 | {yymsp[0].minor.yy48 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/} |
| 148174 | 148098 | break; |
| 148175 | | - case 161: /* expr ::= LP expr RP */ |
| 148099 | + case 162: /* expr ::= LP expr RP */ |
| 148176 | 148100 | {yymsp[-2].minor.yy18 = yymsp[-1].minor.yy18;} |
| 148177 | 148101 | break; |
| 148178 | | - case 162: /* expr ::= ID|INDEXED */ |
| 148179 | | - case 163: /* expr ::= JOIN_KW */ yytestcase(yyruleno==163); |
| 148102 | + case 163: /* expr ::= ID|INDEXED */ |
| 148103 | + case 164: /* expr ::= JOIN_KW */ yytestcase(yyruleno==164); |
| 148180 | 148104 | {yymsp[0].minor.yy18=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/} |
| 148181 | 148105 | break; |
| 148182 | | - case 164: /* expr ::= nm DOT nm */ |
| 148106 | + case 165: /* expr ::= nm DOT nm */ |
| 148183 | 148107 | { |
| 148184 | 148108 | Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1); |
| 148185 | 148109 | Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1); |
| 148186 | 148110 | yylhsminor.yy18 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2); |
| 148187 | 148111 | } |
| 148188 | 148112 | yymsp[-2].minor.yy18 = yylhsminor.yy18; |
| 148189 | 148113 | break; |
| 148190 | | - case 165: /* expr ::= nm DOT nm DOT nm */ |
| 148114 | + case 166: /* expr ::= nm DOT nm DOT nm */ |
| 148191 | 148115 | { |
| 148192 | 148116 | Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1); |
| 148193 | 148117 | Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1); |
| 148194 | 148118 | Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1); |
| 148195 | 148119 | Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3); |
| 148196 | 148120 | yylhsminor.yy18 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4); |
| 148197 | 148121 | } |
| 148198 | 148122 | yymsp[-4].minor.yy18 = yylhsminor.yy18; |
| 148199 | 148123 | break; |
| 148200 | | - case 166: /* term ::= NULL|FLOAT|BLOB */ |
| 148201 | | - case 167: /* term ::= STRING */ yytestcase(yyruleno==167); |
| 148124 | + case 167: /* term ::= NULL|FLOAT|BLOB */ |
| 148125 | + case 168: /* term ::= STRING */ yytestcase(yyruleno==168); |
| 148202 | 148126 | {yymsp[0].minor.yy18=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/} |
| 148203 | 148127 | break; |
| 148204 | | - case 168: /* term ::= INTEGER */ |
| 148128 | + case 169: /* term ::= INTEGER */ |
| 148205 | 148129 | { |
| 148206 | 148130 | yylhsminor.yy18 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1); |
| 148207 | 148131 | } |
| 148208 | 148132 | yymsp[0].minor.yy18 = yylhsminor.yy18; |
| 148209 | 148133 | break; |
| 148210 | | - case 169: /* expr ::= VARIABLE */ |
| 148134 | + case 170: /* expr ::= VARIABLE */ |
| 148211 | 148135 | { |
| 148212 | 148136 | if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){ |
| 148213 | 148137 | u32 n = yymsp[0].minor.yy0.n; |
| 148214 | 148138 | yymsp[0].minor.yy18 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0); |
| 148215 | 148139 | sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy18, n); |
| | @@ -148227,48 +148151,54 @@ |
| 148227 | 148151 | if( yymsp[0].minor.yy18 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy18->iTable); |
| 148228 | 148152 | } |
| 148229 | 148153 | } |
| 148230 | 148154 | } |
| 148231 | 148155 | break; |
| 148232 | | - case 170: /* expr ::= expr COLLATE ID|STRING */ |
| 148156 | + case 171: /* expr ::= expr COLLATE ID|STRING */ |
| 148233 | 148157 | { |
| 148234 | 148158 | yymsp[-2].minor.yy18 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy18, &yymsp[0].minor.yy0, 1); |
| 148235 | 148159 | } |
| 148236 | 148160 | break; |
| 148237 | | - case 171: /* expr ::= CAST LP expr AS typetoken RP */ |
| 148161 | + case 172: /* expr ::= CAST LP expr AS typetoken RP */ |
| 148238 | 148162 | { |
| 148239 | 148163 | yymsp[-5].minor.yy18 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1); |
| 148240 | 148164 | sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy18, yymsp[-3].minor.yy18, 0); |
| 148241 | 148165 | } |
| 148242 | 148166 | break; |
| 148243 | | - case 172: /* expr ::= ID|INDEXED LP distinct exprlist RP over_opt */ |
| 148244 | | -{ |
| 148245 | | - if( yymsp[-2].minor.yy420 && yymsp[-2].minor.yy420->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ |
| 148246 | | - sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-5].minor.yy0); |
| 148247 | | - } |
| 148248 | | - yylhsminor.yy18 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy420, &yymsp[-5].minor.yy0); |
| 148249 | | - if( yymsp[-3].minor.yy70==SF_Distinct && yylhsminor.yy18 ){ |
| 148250 | | - yylhsminor.yy18->flags |= EP_Distinct; |
| 148251 | | - } |
| 148167 | + case 173: /* expr ::= ID|INDEXED LP distinct exprlist RP */ |
| 148168 | +{ |
| 148169 | + yylhsminor.yy18 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy420, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy70); |
| 148170 | +} |
| 148171 | + yymsp[-4].minor.yy18 = yylhsminor.yy18; |
| 148172 | + break; |
| 148173 | + case 174: /* expr ::= ID|INDEXED LP STAR RP */ |
| 148174 | +{ |
| 148175 | + yylhsminor.yy18 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0); |
| 148176 | +} |
| 148177 | + yymsp[-3].minor.yy18 = yylhsminor.yy18; |
| 148178 | + break; |
| 148179 | + case 175: /* expr ::= ID|INDEXED LP distinct exprlist RP over_clause */ |
| 148180 | +{ |
| 148181 | + yylhsminor.yy18 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy420, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy70); |
| 148252 | 148182 | sqlite3WindowAttach(pParse, yylhsminor.yy18, yymsp[0].minor.yy327); |
| 148253 | 148183 | } |
| 148254 | 148184 | yymsp[-5].minor.yy18 = yylhsminor.yy18; |
| 148255 | 148185 | break; |
| 148256 | | - case 173: /* expr ::= ID|INDEXED LP STAR RP over_opt */ |
| 148186 | + case 176: /* expr ::= ID|INDEXED LP STAR RP over_clause */ |
| 148257 | 148187 | { |
| 148258 | | - yylhsminor.yy18 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0); |
| 148188 | + yylhsminor.yy18 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0); |
| 148259 | 148189 | sqlite3WindowAttach(pParse, yylhsminor.yy18, yymsp[0].minor.yy327); |
| 148260 | 148190 | } |
| 148261 | 148191 | yymsp[-4].minor.yy18 = yylhsminor.yy18; |
| 148262 | 148192 | break; |
| 148263 | | - case 174: /* term ::= CTIME_KW */ |
| 148193 | + case 177: /* term ::= CTIME_KW */ |
| 148264 | 148194 | { |
| 148265 | | - yylhsminor.yy18 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0); |
| 148195 | + yylhsminor.yy18 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0); |
| 148266 | 148196 | } |
| 148267 | 148197 | yymsp[0].minor.yy18 = yylhsminor.yy18; |
| 148268 | 148198 | break; |
| 148269 | | - case 175: /* expr ::= LP nexprlist COMMA expr RP */ |
| 148199 | + case 178: /* expr ::= LP nexprlist COMMA expr RP */ |
| 148270 | 148200 | { |
| 148271 | 148201 | ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy420, yymsp[-1].minor.yy18); |
| 148272 | 148202 | yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0); |
| 148273 | 148203 | if( yymsp[-4].minor.yy18 ){ |
| 148274 | 148204 | yymsp[-4].minor.yy18->x.pList = pList; |
| | @@ -148275,81 +148205,81 @@ |
| 148275 | 148205 | }else{ |
| 148276 | 148206 | sqlite3ExprListDelete(pParse->db, pList); |
| 148277 | 148207 | } |
| 148278 | 148208 | } |
| 148279 | 148209 | break; |
| 148280 | | - case 176: /* expr ::= expr AND expr */ |
| 148281 | | - case 177: /* expr ::= expr OR expr */ yytestcase(yyruleno==177); |
| 148282 | | - case 178: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==178); |
| 148283 | | - case 179: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==179); |
| 148284 | | - case 180: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==180); |
| 148285 | | - case 181: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==181); |
| 148286 | | - case 182: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==182); |
| 148287 | | - case 183: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==183); |
| 148210 | + case 179: /* expr ::= expr AND expr */ |
| 148211 | + case 180: /* expr ::= expr OR expr */ yytestcase(yyruleno==180); |
| 148212 | + case 181: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==181); |
| 148213 | + case 182: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==182); |
| 148214 | + case 183: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==183); |
| 148215 | + case 184: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==184); |
| 148216 | + case 185: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==185); |
| 148217 | + case 186: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==186); |
| 148288 | 148218 | {yymsp[-2].minor.yy18=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy18,yymsp[0].minor.yy18);} |
| 148289 | 148219 | break; |
| 148290 | | - case 184: /* likeop ::= NOT LIKE_KW|MATCH */ |
| 148220 | + case 187: /* likeop ::= NOT LIKE_KW|MATCH */ |
| 148291 | 148221 | {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/} |
| 148292 | 148222 | break; |
| 148293 | | - case 185: /* expr ::= expr likeop expr */ |
| 148223 | + case 188: /* expr ::= expr likeop expr */ |
| 148294 | 148224 | { |
| 148295 | 148225 | ExprList *pList; |
| 148296 | 148226 | int bNot = yymsp[-1].minor.yy0.n & 0x80000000; |
| 148297 | 148227 | yymsp[-1].minor.yy0.n &= 0x7fffffff; |
| 148298 | 148228 | pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy18); |
| 148299 | 148229 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy18); |
| 148300 | | - yymsp[-2].minor.yy18 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0); |
| 148230 | + yymsp[-2].minor.yy18 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0); |
| 148301 | 148231 | if( bNot ) yymsp[-2].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy18, 0); |
| 148302 | 148232 | if( yymsp[-2].minor.yy18 ) yymsp[-2].minor.yy18->flags |= EP_InfixFunc; |
| 148303 | 148233 | } |
| 148304 | 148234 | break; |
| 148305 | | - case 186: /* expr ::= expr likeop expr ESCAPE expr */ |
| 148235 | + case 189: /* expr ::= expr likeop expr ESCAPE expr */ |
| 148306 | 148236 | { |
| 148307 | 148237 | ExprList *pList; |
| 148308 | 148238 | int bNot = yymsp[-3].minor.yy0.n & 0x80000000; |
| 148309 | 148239 | yymsp[-3].minor.yy0.n &= 0x7fffffff; |
| 148310 | 148240 | pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy18); |
| 148311 | 148241 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy18); |
| 148312 | 148242 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy18); |
| 148313 | | - yymsp[-4].minor.yy18 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0); |
| 148243 | + yymsp[-4].minor.yy18 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0); |
| 148314 | 148244 | if( bNot ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0); |
| 148315 | 148245 | if( yymsp[-4].minor.yy18 ) yymsp[-4].minor.yy18->flags |= EP_InfixFunc; |
| 148316 | 148246 | } |
| 148317 | 148247 | break; |
| 148318 | | - case 187: /* expr ::= expr ISNULL|NOTNULL */ |
| 148248 | + case 190: /* expr ::= expr ISNULL|NOTNULL */ |
| 148319 | 148249 | {yymsp[-1].minor.yy18 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy18,0);} |
| 148320 | 148250 | break; |
| 148321 | | - case 188: /* expr ::= expr NOT NULL */ |
| 148251 | + case 191: /* expr ::= expr NOT NULL */ |
| 148322 | 148252 | {yymsp[-2].minor.yy18 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy18,0);} |
| 148323 | 148253 | break; |
| 148324 | | - case 189: /* expr ::= expr IS expr */ |
| 148254 | + case 192: /* expr ::= expr IS expr */ |
| 148325 | 148255 | { |
| 148326 | 148256 | yymsp[-2].minor.yy18 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy18,yymsp[0].minor.yy18); |
| 148327 | 148257 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy18, yymsp[-2].minor.yy18, TK_ISNULL); |
| 148328 | 148258 | } |
| 148329 | 148259 | break; |
| 148330 | | - case 190: /* expr ::= expr IS NOT expr */ |
| 148260 | + case 193: /* expr ::= expr IS NOT expr */ |
| 148331 | 148261 | { |
| 148332 | 148262 | yymsp[-3].minor.yy18 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy18,yymsp[0].minor.yy18); |
| 148333 | 148263 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy18, yymsp[-3].minor.yy18, TK_NOTNULL); |
| 148334 | 148264 | } |
| 148335 | 148265 | break; |
| 148336 | | - case 191: /* expr ::= NOT expr */ |
| 148337 | | - case 192: /* expr ::= BITNOT expr */ yytestcase(yyruleno==192); |
| 148266 | + case 194: /* expr ::= NOT expr */ |
| 148267 | + case 195: /* expr ::= BITNOT expr */ yytestcase(yyruleno==195); |
| 148338 | 148268 | {yymsp[-1].minor.yy18 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy18, 0);/*A-overwrites-B*/} |
| 148339 | 148269 | break; |
| 148340 | | - case 193: /* expr ::= PLUS|MINUS expr */ |
| 148270 | + case 196: /* expr ::= PLUS|MINUS expr */ |
| 148341 | 148271 | { |
| 148342 | 148272 | yymsp[-1].minor.yy18 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy18, 0); |
| 148343 | 148273 | /*A-overwrites-B*/ |
| 148344 | 148274 | } |
| 148345 | 148275 | break; |
| 148346 | | - case 194: /* between_op ::= BETWEEN */ |
| 148347 | | - case 197: /* in_op ::= IN */ yytestcase(yyruleno==197); |
| 148276 | + case 197: /* between_op ::= BETWEEN */ |
| 148277 | + case 200: /* in_op ::= IN */ yytestcase(yyruleno==200); |
| 148348 | 148278 | {yymsp[0].minor.yy70 = 0;} |
| 148349 | 148279 | break; |
| 148350 | | - case 196: /* expr ::= expr between_op expr AND expr */ |
| 148280 | + case 199: /* expr ::= expr between_op expr AND expr */ |
| 148351 | 148281 | { |
| 148352 | 148282 | ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy18); |
| 148353 | 148283 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy18); |
| 148354 | 148284 | yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy18, 0); |
| 148355 | 148285 | if( yymsp[-4].minor.yy18 ){ |
| | @@ -148358,11 +148288,11 @@ |
| 148358 | 148288 | sqlite3ExprListDelete(pParse->db, pList); |
| 148359 | 148289 | } |
| 148360 | 148290 | if( yymsp[-3].minor.yy70 ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0); |
| 148361 | 148291 | } |
| 148362 | 148292 | break; |
| 148363 | | - case 199: /* expr ::= expr in_op LP exprlist RP */ |
| 148293 | + case 202: /* expr ::= expr in_op LP exprlist RP */ |
| 148364 | 148294 | { |
| 148365 | 148295 | if( yymsp[-1].minor.yy420==0 ){ |
| 148366 | 148296 | /* Expressions of the form |
| 148367 | 148297 | ** |
| 148368 | 148298 | ** expr1 IN () |
| | @@ -148410,41 +148340,41 @@ |
| 148410 | 148340 | } |
| 148411 | 148341 | if( yymsp[-3].minor.yy70 ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0); |
| 148412 | 148342 | } |
| 148413 | 148343 | } |
| 148414 | 148344 | break; |
| 148415 | | - case 200: /* expr ::= LP select RP */ |
| 148345 | + case 203: /* expr ::= LP select RP */ |
| 148416 | 148346 | { |
| 148417 | 148347 | yymsp[-2].minor.yy18 = sqlite3PExpr(pParse, TK_SELECT, 0, 0); |
| 148418 | 148348 | sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy18, yymsp[-1].minor.yy489); |
| 148419 | 148349 | } |
| 148420 | 148350 | break; |
| 148421 | | - case 201: /* expr ::= expr in_op LP select RP */ |
| 148351 | + case 204: /* expr ::= expr in_op LP select RP */ |
| 148422 | 148352 | { |
| 148423 | 148353 | yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy18, 0); |
| 148424 | 148354 | sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy18, yymsp[-1].minor.yy489); |
| 148425 | 148355 | if( yymsp[-3].minor.yy70 ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0); |
| 148426 | 148356 | } |
| 148427 | 148357 | break; |
| 148428 | | - case 202: /* expr ::= expr in_op nm dbnm paren_exprlist */ |
| 148358 | + case 205: /* expr ::= expr in_op nm dbnm paren_exprlist */ |
| 148429 | 148359 | { |
| 148430 | 148360 | SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); |
| 148431 | 148361 | Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0); |
| 148432 | 148362 | if( yymsp[0].minor.yy420 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy420); |
| 148433 | 148363 | yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy18, 0); |
| 148434 | 148364 | sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy18, pSelect); |
| 148435 | 148365 | if( yymsp[-3].minor.yy70 ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0); |
| 148436 | 148366 | } |
| 148437 | 148367 | break; |
| 148438 | | - case 203: /* expr ::= EXISTS LP select RP */ |
| 148368 | + case 206: /* expr ::= EXISTS LP select RP */ |
| 148439 | 148369 | { |
| 148440 | 148370 | Expr *p; |
| 148441 | 148371 | p = yymsp[-3].minor.yy18 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0); |
| 148442 | 148372 | sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy489); |
| 148443 | 148373 | } |
| 148444 | 148374 | break; |
| 148445 | | - case 204: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 148375 | + case 207: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 148446 | 148376 | { |
| 148447 | 148377 | yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy18, 0); |
| 148448 | 148378 | if( yymsp[-4].minor.yy18 ){ |
| 148449 | 148379 | yymsp[-4].minor.yy18->x.pList = yymsp[-1].minor.yy18 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy420,yymsp[-1].minor.yy18) : yymsp[-2].minor.yy420; |
| 148450 | 148380 | sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy18); |
| | @@ -148452,369 +148382,365 @@ |
| 148452 | 148382 | sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy420); |
| 148453 | 148383 | sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy18); |
| 148454 | 148384 | } |
| 148455 | 148385 | } |
| 148456 | 148386 | break; |
| 148457 | | - case 205: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 148387 | + case 208: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 148458 | 148388 | { |
| 148459 | 148389 | yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy420, yymsp[-2].minor.yy18); |
| 148460 | 148390 | yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy420, yymsp[0].minor.yy18); |
| 148461 | 148391 | } |
| 148462 | 148392 | break; |
| 148463 | | - case 206: /* case_exprlist ::= WHEN expr THEN expr */ |
| 148393 | + case 209: /* case_exprlist ::= WHEN expr THEN expr */ |
| 148464 | 148394 | { |
| 148465 | 148395 | yymsp[-3].minor.yy420 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy18); |
| 148466 | 148396 | yymsp[-3].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy420, yymsp[0].minor.yy18); |
| 148467 | 148397 | } |
| 148468 | 148398 | break; |
| 148469 | | - case 209: /* case_operand ::= expr */ |
| 148399 | + case 212: /* case_operand ::= expr */ |
| 148470 | 148400 | {yymsp[0].minor.yy18 = yymsp[0].minor.yy18; /*A-overwrites-X*/} |
| 148471 | 148401 | break; |
| 148472 | | - case 212: /* nexprlist ::= nexprlist COMMA expr */ |
| 148402 | + case 215: /* nexprlist ::= nexprlist COMMA expr */ |
| 148473 | 148403 | {yymsp[-2].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy420,yymsp[0].minor.yy18);} |
| 148474 | 148404 | break; |
| 148475 | | - case 213: /* nexprlist ::= expr */ |
| 148405 | + case 216: /* nexprlist ::= expr */ |
| 148476 | 148406 | {yymsp[0].minor.yy420 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy18); /*A-overwrites-Y*/} |
| 148477 | 148407 | break; |
| 148478 | | - case 215: /* paren_exprlist ::= LP exprlist RP */ |
| 148479 | | - case 220: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==220); |
| 148408 | + case 218: /* paren_exprlist ::= LP exprlist RP */ |
| 148409 | + case 223: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==223); |
| 148480 | 148410 | {yymsp[-2].minor.yy420 = yymsp[-1].minor.yy420;} |
| 148481 | 148411 | break; |
| 148482 | | - case 216: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 148412 | + case 219: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 148483 | 148413 | { |
| 148484 | 148414 | sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, |
| 148485 | 148415 | sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy420, yymsp[-10].minor.yy70, |
| 148486 | 148416 | &yymsp[-11].minor.yy0, yymsp[0].minor.yy18, SQLITE_SO_ASC, yymsp[-8].minor.yy70, SQLITE_IDXTYPE_APPDEF); |
| 148487 | 148417 | } |
| 148488 | 148418 | break; |
| 148489 | | - case 217: /* uniqueflag ::= UNIQUE */ |
| 148490 | | - case 257: /* raisetype ::= ABORT */ yytestcase(yyruleno==257); |
| 148419 | + case 220: /* uniqueflag ::= UNIQUE */ |
| 148420 | + case 260: /* raisetype ::= ABORT */ yytestcase(yyruleno==260); |
| 148491 | 148421 | {yymsp[0].minor.yy70 = OE_Abort;} |
| 148492 | 148422 | break; |
| 148493 | | - case 218: /* uniqueflag ::= */ |
| 148423 | + case 221: /* uniqueflag ::= */ |
| 148494 | 148424 | {yymsp[1].minor.yy70 = OE_None;} |
| 148495 | 148425 | break; |
| 148496 | | - case 221: /* eidlist ::= eidlist COMMA nm collate sortorder */ |
| 148426 | + case 224: /* eidlist ::= eidlist COMMA nm collate sortorder */ |
| 148497 | 148427 | { |
| 148498 | 148428 | yymsp[-4].minor.yy420 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy420, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy70, yymsp[0].minor.yy70); |
| 148499 | 148429 | } |
| 148500 | 148430 | break; |
| 148501 | | - case 222: /* eidlist ::= nm collate sortorder */ |
| 148431 | + case 225: /* eidlist ::= nm collate sortorder */ |
| 148502 | 148432 | { |
| 148503 | 148433 | yymsp[-2].minor.yy420 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy70, yymsp[0].minor.yy70); /*A-overwrites-Y*/ |
| 148504 | 148434 | } |
| 148505 | 148435 | break; |
| 148506 | | - case 225: /* cmd ::= DROP INDEX ifexists fullname */ |
| 148436 | + case 228: /* cmd ::= DROP INDEX ifexists fullname */ |
| 148507 | 148437 | {sqlite3DropIndex(pParse, yymsp[0].minor.yy135, yymsp[-1].minor.yy70);} |
| 148508 | 148438 | break; |
| 148509 | | - case 226: /* cmd ::= VACUUM */ |
| 148439 | + case 229: /* cmd ::= VACUUM */ |
| 148510 | 148440 | {sqlite3Vacuum(pParse,0);} |
| 148511 | 148441 | break; |
| 148512 | | - case 227: /* cmd ::= VACUUM nm */ |
| 148442 | + case 230: /* cmd ::= VACUUM nm */ |
| 148513 | 148443 | {sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);} |
| 148514 | 148444 | break; |
| 148515 | | - case 228: /* cmd ::= PRAGMA nm dbnm */ |
| 148445 | + case 231: /* cmd ::= PRAGMA nm dbnm */ |
| 148516 | 148446 | {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} |
| 148517 | 148447 | break; |
| 148518 | | - case 229: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 148448 | + case 232: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 148519 | 148449 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} |
| 148520 | 148450 | break; |
| 148521 | | - case 230: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 148451 | + case 233: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 148522 | 148452 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} |
| 148523 | 148453 | break; |
| 148524 | | - case 231: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 148454 | + case 234: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 148525 | 148455 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} |
| 148526 | 148456 | break; |
| 148527 | | - case 232: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 148457 | + case 235: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 148528 | 148458 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} |
| 148529 | 148459 | break; |
| 148530 | | - case 235: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 148460 | + case 238: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 148531 | 148461 | { |
| 148532 | 148462 | Token all; |
| 148533 | 148463 | all.z = yymsp[-3].minor.yy0.z; |
| 148534 | 148464 | all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; |
| 148535 | 148465 | sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy207, &all); |
| 148536 | 148466 | } |
| 148537 | 148467 | break; |
| 148538 | | - case 236: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 148468 | + case 239: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 148539 | 148469 | { |
| 148540 | 148470 | sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy70, yymsp[-4].minor.yy34.a, yymsp[-4].minor.yy34.b, yymsp[-2].minor.yy135, yymsp[0].minor.yy18, yymsp[-10].minor.yy70, yymsp[-8].minor.yy70); |
| 148541 | 148471 | yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/ |
| 148542 | 148472 | } |
| 148543 | 148473 | break; |
| 148544 | | - case 237: /* trigger_time ::= BEFORE|AFTER */ |
| 148474 | + case 240: /* trigger_time ::= BEFORE|AFTER */ |
| 148545 | 148475 | { yymsp[0].minor.yy70 = yymsp[0].major; /*A-overwrites-X*/ } |
| 148546 | 148476 | break; |
| 148547 | | - case 238: /* trigger_time ::= INSTEAD OF */ |
| 148477 | + case 241: /* trigger_time ::= INSTEAD OF */ |
| 148548 | 148478 | { yymsp[-1].minor.yy70 = TK_INSTEAD;} |
| 148549 | 148479 | break; |
| 148550 | | - case 239: /* trigger_time ::= */ |
| 148480 | + case 242: /* trigger_time ::= */ |
| 148551 | 148481 | { yymsp[1].minor.yy70 = TK_BEFORE; } |
| 148552 | 148482 | break; |
| 148553 | | - case 240: /* trigger_event ::= DELETE|INSERT */ |
| 148554 | | - case 241: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==241); |
| 148483 | + case 243: /* trigger_event ::= DELETE|INSERT */ |
| 148484 | + case 244: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==244); |
| 148555 | 148485 | {yymsp[0].minor.yy34.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy34.b = 0;} |
| 148556 | 148486 | break; |
| 148557 | | - case 242: /* trigger_event ::= UPDATE OF idlist */ |
| 148487 | + case 245: /* trigger_event ::= UPDATE OF idlist */ |
| 148558 | 148488 | {yymsp[-2].minor.yy34.a = TK_UPDATE; yymsp[-2].minor.yy34.b = yymsp[0].minor.yy48;} |
| 148559 | 148489 | break; |
| 148560 | | - case 243: /* when_clause ::= */ |
| 148561 | | - case 262: /* key_opt ::= */ yytestcase(yyruleno==262); |
| 148562 | | - case 305: /* filter_opt ::= */ yytestcase(yyruleno==305); |
| 148490 | + case 246: /* when_clause ::= */ |
| 148491 | + case 265: /* key_opt ::= */ yytestcase(yyruleno==265); |
| 148492 | + case 306: /* filter_opt ::= */ yytestcase(yyruleno==306); |
| 148563 | 148493 | { yymsp[1].minor.yy18 = 0; } |
| 148564 | 148494 | break; |
| 148565 | | - case 244: /* when_clause ::= WHEN expr */ |
| 148566 | | - case 263: /* key_opt ::= KEY expr */ yytestcase(yyruleno==263); |
| 148495 | + case 247: /* when_clause ::= WHEN expr */ |
| 148496 | + case 266: /* key_opt ::= KEY expr */ yytestcase(yyruleno==266); |
| 148567 | 148497 | { yymsp[-1].minor.yy18 = yymsp[0].minor.yy18; } |
| 148568 | 148498 | break; |
| 148569 | | - case 245: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 148499 | + case 248: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 148570 | 148500 | { |
| 148571 | 148501 | assert( yymsp[-2].minor.yy207!=0 ); |
| 148572 | 148502 | yymsp[-2].minor.yy207->pLast->pNext = yymsp[-1].minor.yy207; |
| 148573 | 148503 | yymsp[-2].minor.yy207->pLast = yymsp[-1].minor.yy207; |
| 148574 | 148504 | } |
| 148575 | 148505 | break; |
| 148576 | | - case 246: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 148506 | + case 249: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 148577 | 148507 | { |
| 148578 | 148508 | assert( yymsp[-1].minor.yy207!=0 ); |
| 148579 | 148509 | yymsp[-1].minor.yy207->pLast = yymsp[-1].minor.yy207; |
| 148580 | 148510 | } |
| 148581 | 148511 | break; |
| 148582 | | - case 247: /* trnm ::= nm DOT nm */ |
| 148512 | + case 250: /* trnm ::= nm DOT nm */ |
| 148583 | 148513 | { |
| 148584 | 148514 | yymsp[-2].minor.yy0 = yymsp[0].minor.yy0; |
| 148585 | 148515 | sqlite3ErrorMsg(pParse, |
| 148586 | 148516 | "qualified table names are not allowed on INSERT, UPDATE, and DELETE " |
| 148587 | 148517 | "statements within triggers"); |
| 148588 | 148518 | } |
| 148589 | 148519 | break; |
| 148590 | | - case 248: /* tridxby ::= INDEXED BY nm */ |
| 148520 | + case 251: /* tridxby ::= INDEXED BY nm */ |
| 148591 | 148521 | { |
| 148592 | 148522 | sqlite3ErrorMsg(pParse, |
| 148593 | 148523 | "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " |
| 148594 | 148524 | "within triggers"); |
| 148595 | 148525 | } |
| 148596 | 148526 | break; |
| 148597 | | - case 249: /* tridxby ::= NOT INDEXED */ |
| 148527 | + case 252: /* tridxby ::= NOT INDEXED */ |
| 148598 | 148528 | { |
| 148599 | 148529 | sqlite3ErrorMsg(pParse, |
| 148600 | 148530 | "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " |
| 148601 | 148531 | "within triggers"); |
| 148602 | 148532 | } |
| 148603 | 148533 | break; |
| 148604 | | - case 250: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */ |
| 148534 | + case 253: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */ |
| 148605 | 148535 | {yylhsminor.yy207 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy420, yymsp[-1].minor.yy18, yymsp[-6].minor.yy70, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy392);} |
| 148606 | 148536 | yymsp[-7].minor.yy207 = yylhsminor.yy207; |
| 148607 | 148537 | break; |
| 148608 | | - case 251: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 148538 | + case 254: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 148609 | 148539 | { |
| 148610 | 148540 | yylhsminor.yy207 = sqlite3TriggerInsertStep(pParse->db,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy48,yymsp[-2].minor.yy489,yymsp[-6].minor.yy70,yymsp[-1].minor.yy340,yymsp[-7].minor.yy392,yymsp[0].minor.yy392);/*yylhsminor.yy207-overwrites-yymsp[-6].minor.yy70*/ |
| 148611 | 148541 | } |
| 148612 | 148542 | yymsp[-7].minor.yy207 = yylhsminor.yy207; |
| 148613 | 148543 | break; |
| 148614 | | - case 252: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 148544 | + case 255: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 148615 | 148545 | {yylhsminor.yy207 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy18, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy392);} |
| 148616 | 148546 | yymsp[-5].minor.yy207 = yylhsminor.yy207; |
| 148617 | 148547 | break; |
| 148618 | | - case 253: /* trigger_cmd ::= scanpt select scanpt */ |
| 148548 | + case 256: /* trigger_cmd ::= scanpt select scanpt */ |
| 148619 | 148549 | {yylhsminor.yy207 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy489, yymsp[-2].minor.yy392, yymsp[0].minor.yy392); /*yylhsminor.yy207-overwrites-yymsp[-1].minor.yy489*/} |
| 148620 | 148550 | yymsp[-2].minor.yy207 = yylhsminor.yy207; |
| 148621 | 148551 | break; |
| 148622 | | - case 254: /* expr ::= RAISE LP IGNORE RP */ |
| 148552 | + case 257: /* expr ::= RAISE LP IGNORE RP */ |
| 148623 | 148553 | { |
| 148624 | 148554 | yymsp[-3].minor.yy18 = sqlite3PExpr(pParse, TK_RAISE, 0, 0); |
| 148625 | 148555 | if( yymsp[-3].minor.yy18 ){ |
| 148626 | 148556 | yymsp[-3].minor.yy18->affinity = OE_Ignore; |
| 148627 | 148557 | } |
| 148628 | 148558 | } |
| 148629 | 148559 | break; |
| 148630 | | - case 255: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 148560 | + case 258: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 148631 | 148561 | { |
| 148632 | 148562 | yymsp[-5].minor.yy18 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1); |
| 148633 | 148563 | if( yymsp[-5].minor.yy18 ) { |
| 148634 | 148564 | yymsp[-5].minor.yy18->affinity = (char)yymsp[-3].minor.yy70; |
| 148635 | 148565 | } |
| 148636 | 148566 | } |
| 148637 | 148567 | break; |
| 148638 | | - case 256: /* raisetype ::= ROLLBACK */ |
| 148568 | + case 259: /* raisetype ::= ROLLBACK */ |
| 148639 | 148569 | {yymsp[0].minor.yy70 = OE_Rollback;} |
| 148640 | 148570 | break; |
| 148641 | | - case 258: /* raisetype ::= FAIL */ |
| 148571 | + case 261: /* raisetype ::= FAIL */ |
| 148642 | 148572 | {yymsp[0].minor.yy70 = OE_Fail;} |
| 148643 | 148573 | break; |
| 148644 | | - case 259: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 148574 | + case 262: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 148645 | 148575 | { |
| 148646 | 148576 | sqlite3DropTrigger(pParse,yymsp[0].minor.yy135,yymsp[-1].minor.yy70); |
| 148647 | 148577 | } |
| 148648 | 148578 | break; |
| 148649 | | - case 260: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 148579 | + case 263: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 148650 | 148580 | { |
| 148651 | 148581 | sqlite3Attach(pParse, yymsp[-3].minor.yy18, yymsp[-1].minor.yy18, yymsp[0].minor.yy18); |
| 148652 | 148582 | } |
| 148653 | 148583 | break; |
| 148654 | | - case 261: /* cmd ::= DETACH database_kw_opt expr */ |
| 148584 | + case 264: /* cmd ::= DETACH database_kw_opt expr */ |
| 148655 | 148585 | { |
| 148656 | 148586 | sqlite3Detach(pParse, yymsp[0].minor.yy18); |
| 148657 | 148587 | } |
| 148658 | 148588 | break; |
| 148659 | | - case 264: /* cmd ::= REINDEX */ |
| 148589 | + case 267: /* cmd ::= REINDEX */ |
| 148660 | 148590 | {sqlite3Reindex(pParse, 0, 0);} |
| 148661 | 148591 | break; |
| 148662 | | - case 265: /* cmd ::= REINDEX nm dbnm */ |
| 148592 | + case 268: /* cmd ::= REINDEX nm dbnm */ |
| 148663 | 148593 | {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 148664 | 148594 | break; |
| 148665 | | - case 266: /* cmd ::= ANALYZE */ |
| 148595 | + case 269: /* cmd ::= ANALYZE */ |
| 148666 | 148596 | {sqlite3Analyze(pParse, 0, 0);} |
| 148667 | 148597 | break; |
| 148668 | | - case 267: /* cmd ::= ANALYZE nm dbnm */ |
| 148598 | + case 270: /* cmd ::= ANALYZE nm dbnm */ |
| 148669 | 148599 | {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 148670 | 148600 | break; |
| 148671 | | - case 268: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 148601 | + case 271: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 148672 | 148602 | { |
| 148673 | 148603 | sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy135,&yymsp[0].minor.yy0); |
| 148674 | 148604 | } |
| 148675 | 148605 | break; |
| 148676 | | - case 269: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 148606 | + case 272: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 148677 | 148607 | { |
| 148678 | 148608 | yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n; |
| 148679 | 148609 | sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0); |
| 148680 | 148610 | } |
| 148681 | 148611 | break; |
| 148682 | | - case 270: /* add_column_fullname ::= fullname */ |
| 148612 | + case 273: /* add_column_fullname ::= fullname */ |
| 148683 | 148613 | { |
| 148684 | 148614 | disableLookaside(pParse); |
| 148685 | 148615 | sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy135); |
| 148686 | 148616 | } |
| 148687 | 148617 | break; |
| 148688 | | - case 271: /* cmd ::= create_vtab */ |
| 148618 | + case 274: /* cmd ::= create_vtab */ |
| 148689 | 148619 | {sqlite3VtabFinishParse(pParse,0);} |
| 148690 | 148620 | break; |
| 148691 | | - case 272: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 148621 | + case 275: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 148692 | 148622 | {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} |
| 148693 | 148623 | break; |
| 148694 | | - case 273: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 148624 | + case 276: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 148695 | 148625 | { |
| 148696 | 148626 | sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy70); |
| 148697 | 148627 | } |
| 148698 | 148628 | break; |
| 148699 | | - case 274: /* vtabarg ::= */ |
| 148629 | + case 277: /* vtabarg ::= */ |
| 148700 | 148630 | {sqlite3VtabArgInit(pParse);} |
| 148701 | 148631 | break; |
| 148702 | | - case 275: /* vtabargtoken ::= ANY */ |
| 148703 | | - case 276: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==276); |
| 148704 | | - case 277: /* lp ::= LP */ yytestcase(yyruleno==277); |
| 148632 | + case 278: /* vtabargtoken ::= ANY */ |
| 148633 | + case 279: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==279); |
| 148634 | + case 280: /* lp ::= LP */ yytestcase(yyruleno==280); |
| 148705 | 148635 | {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} |
| 148706 | 148636 | break; |
| 148707 | | - case 278: /* with ::= WITH wqlist */ |
| 148708 | | - case 279: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==279); |
| 148637 | + case 281: /* with ::= WITH wqlist */ |
| 148638 | + case 282: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==282); |
| 148709 | 148639 | { sqlite3WithPush(pParse, yymsp[0].minor.yy449, 1); } |
| 148710 | 148640 | break; |
| 148711 | | - case 280: /* wqlist ::= nm eidlist_opt AS LP select RP */ |
| 148641 | + case 283: /* wqlist ::= nm eidlist_opt AS LP select RP */ |
| 148712 | 148642 | { |
| 148713 | 148643 | yymsp[-5].minor.yy449 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy420, yymsp[-1].minor.yy489); /*A-overwrites-X*/ |
| 148714 | 148644 | } |
| 148715 | 148645 | break; |
| 148716 | | - case 281: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ |
| 148646 | + case 284: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ |
| 148717 | 148647 | { |
| 148718 | 148648 | yymsp[-7].minor.yy449 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy449, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy420, yymsp[-1].minor.yy489); |
| 148719 | 148649 | } |
| 148720 | 148650 | break; |
| 148721 | | - case 282: /* windowdefn_list ::= windowdefn */ |
| 148651 | + case 285: /* windowdefn_list ::= windowdefn */ |
| 148722 | 148652 | { yylhsminor.yy327 = yymsp[0].minor.yy327; } |
| 148723 | 148653 | yymsp[0].minor.yy327 = yylhsminor.yy327; |
| 148724 | 148654 | break; |
| 148725 | | - case 283: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 148655 | + case 286: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 148726 | 148656 | { |
| 148727 | 148657 | assert( yymsp[0].minor.yy327!=0 ); |
| 148728 | 148658 | yymsp[0].minor.yy327->pNextWin = yymsp[-2].minor.yy327; |
| 148729 | 148659 | yylhsminor.yy327 = yymsp[0].minor.yy327; |
| 148730 | 148660 | } |
| 148731 | 148661 | yymsp[-2].minor.yy327 = yylhsminor.yy327; |
| 148732 | 148662 | break; |
| 148733 | | - case 284: /* windowdefn ::= nm AS window */ |
| 148663 | + case 287: /* windowdefn ::= nm AS window */ |
| 148734 | 148664 | { |
| 148735 | 148665 | if( ALWAYS(yymsp[0].minor.yy327) ){ |
| 148736 | 148666 | yymsp[0].minor.yy327->zName = sqlite3DbStrNDup(pParse->db, yymsp[-2].minor.yy0.z, yymsp[-2].minor.yy0.n); |
| 148737 | 148667 | } |
| 148738 | 148668 | yylhsminor.yy327 = yymsp[0].minor.yy327; |
| 148739 | 148669 | } |
| 148740 | 148670 | yymsp[-2].minor.yy327 = yylhsminor.yy327; |
| 148741 | 148671 | break; |
| 148742 | | - case 285: /* window ::= LP part_opt orderby_opt frame_opt RP */ |
| 148672 | + case 288: /* window ::= LP part_opt orderby_opt frame_opt RP */ |
| 148743 | 148673 | { |
| 148744 | 148674 | yymsp[-4].minor.yy327 = yymsp[-1].minor.yy327; |
| 148745 | 148675 | if( ALWAYS(yymsp[-4].minor.yy327) ){ |
| 148746 | 148676 | yymsp[-4].minor.yy327->pPartition = yymsp[-3].minor.yy420; |
| 148747 | 148677 | yymsp[-4].minor.yy327->pOrderBy = yymsp[-2].minor.yy420; |
| 148748 | 148678 | } |
| 148749 | 148679 | } |
| 148750 | 148680 | break; |
| 148751 | | - case 286: /* part_opt ::= PARTITION BY exprlist */ |
| 148681 | + case 289: /* part_opt ::= PARTITION BY nexprlist */ |
| 148752 | 148682 | { yymsp[-2].minor.yy420 = yymsp[0].minor.yy420; } |
| 148753 | 148683 | break; |
| 148754 | | - case 287: /* part_opt ::= */ |
| 148684 | + case 290: /* part_opt ::= */ |
| 148755 | 148685 | { yymsp[1].minor.yy420 = 0; } |
| 148756 | 148686 | break; |
| 148757 | | - case 288: /* frame_opt ::= */ |
| 148687 | + case 291: /* frame_opt ::= */ |
| 148758 | 148688 | { |
| 148759 | 148689 | yymsp[1].minor.yy327 = sqlite3WindowAlloc(pParse, TK_RANGE, TK_UNBOUNDED, 0, TK_CURRENT, 0); |
| 148760 | 148690 | } |
| 148761 | 148691 | break; |
| 148762 | | - case 289: /* frame_opt ::= range_or_rows frame_bound_s */ |
| 148692 | + case 292: /* frame_opt ::= range_or_rows frame_bound_s */ |
| 148763 | 148693 | { |
| 148764 | 148694 | yylhsminor.yy327 = sqlite3WindowAlloc(pParse, yymsp[-1].minor.yy70, yymsp[0].minor.yy119.eType, yymsp[0].minor.yy119.pExpr, TK_CURRENT, 0); |
| 148765 | 148695 | } |
| 148766 | 148696 | yymsp[-1].minor.yy327 = yylhsminor.yy327; |
| 148767 | 148697 | break; |
| 148768 | | - case 290: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */ |
| 148698 | + case 293: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */ |
| 148769 | 148699 | { |
| 148770 | 148700 | yylhsminor.yy327 = sqlite3WindowAlloc(pParse, yymsp[-4].minor.yy70, yymsp[-2].minor.yy119.eType, yymsp[-2].minor.yy119.pExpr, yymsp[0].minor.yy119.eType, yymsp[0].minor.yy119.pExpr); |
| 148771 | 148701 | } |
| 148772 | 148702 | yymsp[-4].minor.yy327 = yylhsminor.yy327; |
| 148773 | 148703 | break; |
| 148774 | | - case 291: /* range_or_rows ::= RANGE */ |
| 148704 | + case 294: /* range_or_rows ::= RANGE */ |
| 148775 | 148705 | { yymsp[0].minor.yy70 = TK_RANGE; } |
| 148776 | 148706 | break; |
| 148777 | | - case 292: /* range_or_rows ::= ROWS */ |
| 148707 | + case 295: /* range_or_rows ::= ROWS */ |
| 148778 | 148708 | { yymsp[0].minor.yy70 = TK_ROWS; } |
| 148779 | 148709 | break; |
| 148780 | | - case 293: /* frame_bound_s ::= frame_bound */ |
| 148781 | | - case 295: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==295); |
| 148710 | + case 296: /* frame_bound_s ::= frame_bound */ |
| 148711 | + case 298: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==298); |
| 148782 | 148712 | { yylhsminor.yy119 = yymsp[0].minor.yy119; } |
| 148783 | 148713 | yymsp[0].minor.yy119 = yylhsminor.yy119; |
| 148784 | 148714 | break; |
| 148785 | | - case 294: /* frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 148786 | | - case 296: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==296); |
| 148715 | + case 297: /* frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 148716 | + case 299: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==299); |
| 148787 | 148717 | {yymsp[-1].minor.yy119.eType = TK_UNBOUNDED; yymsp[-1].minor.yy119.pExpr = 0;} |
| 148788 | 148718 | break; |
| 148789 | | - case 297: /* frame_bound ::= expr PRECEDING */ |
| 148719 | + case 300: /* frame_bound ::= expr PRECEDING */ |
| 148790 | 148720 | { yylhsminor.yy119.eType = TK_PRECEDING; yylhsminor.yy119.pExpr = yymsp[-1].minor.yy18; } |
| 148791 | 148721 | yymsp[-1].minor.yy119 = yylhsminor.yy119; |
| 148792 | 148722 | break; |
| 148793 | | - case 298: /* frame_bound ::= CURRENT ROW */ |
| 148723 | + case 301: /* frame_bound ::= CURRENT ROW */ |
| 148794 | 148724 | { yymsp[-1].minor.yy119.eType = TK_CURRENT ; yymsp[-1].minor.yy119.pExpr = 0; } |
| 148795 | 148725 | break; |
| 148796 | | - case 299: /* frame_bound ::= expr FOLLOWING */ |
| 148726 | + case 302: /* frame_bound ::= expr FOLLOWING */ |
| 148797 | 148727 | { yylhsminor.yy119.eType = TK_FOLLOWING; yylhsminor.yy119.pExpr = yymsp[-1].minor.yy18; } |
| 148798 | 148728 | yymsp[-1].minor.yy119 = yylhsminor.yy119; |
| 148799 | 148729 | break; |
| 148800 | | - case 300: /* windowdefn_opt ::= */ |
| 148801 | | - case 302: /* over_opt ::= */ yytestcase(yyruleno==302); |
| 148802 | | -{ yymsp[1].minor.yy327 = 0; } |
| 148803 | | - break; |
| 148804 | | - case 301: /* windowdefn_opt ::= WINDOW windowdefn_list */ |
| 148730 | + case 303: /* window_clause ::= WINDOW windowdefn_list */ |
| 148805 | 148731 | { yymsp[-1].minor.yy327 = yymsp[0].minor.yy327; } |
| 148806 | 148732 | break; |
| 148807 | | - case 303: /* over_opt ::= filter_opt OVER window */ |
| 148733 | + case 304: /* over_clause ::= filter_opt OVER window */ |
| 148808 | 148734 | { |
| 148809 | 148735 | yylhsminor.yy327 = yymsp[0].minor.yy327; |
| 148810 | 148736 | assert( yylhsminor.yy327!=0 ); |
| 148811 | 148737 | yylhsminor.yy327->pFilter = yymsp[-2].minor.yy18; |
| 148812 | 148738 | } |
| 148813 | 148739 | yymsp[-2].minor.yy327 = yylhsminor.yy327; |
| 148814 | 148740 | break; |
| 148815 | | - case 304: /* over_opt ::= filter_opt OVER nm */ |
| 148741 | + case 305: /* over_clause ::= filter_opt OVER nm */ |
| 148816 | 148742 | { |
| 148817 | 148743 | yylhsminor.yy327 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window)); |
| 148818 | 148744 | if( yylhsminor.yy327 ){ |
| 148819 | 148745 | yylhsminor.yy327->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n); |
| 148820 | 148746 | yylhsminor.yy327->pFilter = yymsp[-2].minor.yy18; |
| | @@ -148822,72 +148748,72 @@ |
| 148822 | 148748 | sqlite3ExprDelete(pParse->db, yymsp[-2].minor.yy18); |
| 148823 | 148749 | } |
| 148824 | 148750 | } |
| 148825 | 148751 | yymsp[-2].minor.yy327 = yylhsminor.yy327; |
| 148826 | 148752 | break; |
| 148827 | | - case 306: /* filter_opt ::= FILTER LP WHERE expr RP */ |
| 148753 | + case 307: /* filter_opt ::= FILTER LP WHERE expr RP */ |
| 148828 | 148754 | { yymsp[-4].minor.yy18 = yymsp[-1].minor.yy18; } |
| 148829 | 148755 | break; |
| 148830 | 148756 | default: |
| 148831 | | - /* (307) input ::= cmdlist */ yytestcase(yyruleno==307); |
| 148832 | | - /* (308) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==308); |
| 148833 | | - /* (309) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=309); |
| 148834 | | - /* (310) ecmd ::= SEMI */ yytestcase(yyruleno==310); |
| 148835 | | - /* (311) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==311); |
| 148836 | | - /* (312) ecmd ::= explain cmdx */ yytestcase(yyruleno==312); |
| 148837 | | - /* (313) trans_opt ::= */ yytestcase(yyruleno==313); |
| 148838 | | - /* (314) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==314); |
| 148839 | | - /* (315) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==315); |
| 148840 | | - /* (316) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==316); |
| 148841 | | - /* (317) savepoint_opt ::= */ yytestcase(yyruleno==317); |
| 148842 | | - /* (318) cmd ::= create_table create_table_args */ yytestcase(yyruleno==318); |
| 148843 | | - /* (319) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==319); |
| 148844 | | - /* (320) columnlist ::= columnname carglist */ yytestcase(yyruleno==320); |
| 148845 | | - /* (321) nm ::= ID|INDEXED */ yytestcase(yyruleno==321); |
| 148846 | | - /* (322) nm ::= STRING */ yytestcase(yyruleno==322); |
| 148847 | | - /* (323) nm ::= JOIN_KW */ yytestcase(yyruleno==323); |
| 148848 | | - /* (324) typetoken ::= typename */ yytestcase(yyruleno==324); |
| 148849 | | - /* (325) typename ::= ID|STRING */ yytestcase(yyruleno==325); |
| 148850 | | - /* (326) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=326); |
| 148851 | | - /* (327) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=327); |
| 148852 | | - /* (328) carglist ::= carglist ccons */ yytestcase(yyruleno==328); |
| 148853 | | - /* (329) carglist ::= */ yytestcase(yyruleno==329); |
| 148854 | | - /* (330) ccons ::= NULL onconf */ yytestcase(yyruleno==330); |
| 148855 | | - /* (331) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==331); |
| 148856 | | - /* (332) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==332); |
| 148857 | | - /* (333) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=333); |
| 148858 | | - /* (334) tconscomma ::= */ yytestcase(yyruleno==334); |
| 148859 | | - /* (335) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=335); |
| 148860 | | - /* (336) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=336); |
| 148861 | | - /* (337) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=337); |
| 148862 | | - /* (338) oneselect ::= values */ yytestcase(yyruleno==338); |
| 148863 | | - /* (339) sclp ::= selcollist COMMA */ yytestcase(yyruleno==339); |
| 148864 | | - /* (340) as ::= ID|STRING */ yytestcase(yyruleno==340); |
| 148865 | | - /* (341) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=341); |
| 148866 | | - /* (342) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==342); |
| 148867 | | - /* (343) exprlist ::= nexprlist */ yytestcase(yyruleno==343); |
| 148868 | | - /* (344) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=344); |
| 148869 | | - /* (345) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=345); |
| 148870 | | - /* (346) nmnum ::= ON */ yytestcase(yyruleno==346); |
| 148871 | | - /* (347) nmnum ::= DELETE */ yytestcase(yyruleno==347); |
| 148872 | | - /* (348) nmnum ::= DEFAULT */ yytestcase(yyruleno==348); |
| 148873 | | - /* (349) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==349); |
| 148874 | | - /* (350) foreach_clause ::= */ yytestcase(yyruleno==350); |
| 148875 | | - /* (351) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==351); |
| 148876 | | - /* (352) trnm ::= nm */ yytestcase(yyruleno==352); |
| 148877 | | - /* (353) tridxby ::= */ yytestcase(yyruleno==353); |
| 148878 | | - /* (354) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==354); |
| 148879 | | - /* (355) database_kw_opt ::= */ yytestcase(yyruleno==355); |
| 148880 | | - /* (356) kwcolumn_opt ::= */ yytestcase(yyruleno==356); |
| 148881 | | - /* (357) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==357); |
| 148882 | | - /* (358) vtabarglist ::= vtabarg */ yytestcase(yyruleno==358); |
| 148883 | | - /* (359) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==359); |
| 148884 | | - /* (360) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==360); |
| 148885 | | - /* (361) anylist ::= */ yytestcase(yyruleno==361); |
| 148886 | | - /* (362) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==362); |
| 148887 | | - /* (363) anylist ::= anylist ANY */ yytestcase(yyruleno==363); |
| 148888 | | - /* (364) with ::= */ yytestcase(yyruleno==364); |
| 148757 | + /* (308) input ::= cmdlist */ yytestcase(yyruleno==308); |
| 148758 | + /* (309) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==309); |
| 148759 | + /* (310) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=310); |
| 148760 | + /* (311) ecmd ::= SEMI */ yytestcase(yyruleno==311); |
| 148761 | + /* (312) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==312); |
| 148762 | + /* (313) ecmd ::= explain cmdx */ yytestcase(yyruleno==313); |
| 148763 | + /* (314) trans_opt ::= */ yytestcase(yyruleno==314); |
| 148764 | + /* (315) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==315); |
| 148765 | + /* (316) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==316); |
| 148766 | + /* (317) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==317); |
| 148767 | + /* (318) savepoint_opt ::= */ yytestcase(yyruleno==318); |
| 148768 | + /* (319) cmd ::= create_table create_table_args */ yytestcase(yyruleno==319); |
| 148769 | + /* (320) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==320); |
| 148770 | + /* (321) columnlist ::= columnname carglist */ yytestcase(yyruleno==321); |
| 148771 | + /* (322) nm ::= ID|INDEXED */ yytestcase(yyruleno==322); |
| 148772 | + /* (323) nm ::= STRING */ yytestcase(yyruleno==323); |
| 148773 | + /* (324) nm ::= JOIN_KW */ yytestcase(yyruleno==324); |
| 148774 | + /* (325) typetoken ::= typename */ yytestcase(yyruleno==325); |
| 148775 | + /* (326) typename ::= ID|STRING */ yytestcase(yyruleno==326); |
| 148776 | + /* (327) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=327); |
| 148777 | + /* (328) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=328); |
| 148778 | + /* (329) carglist ::= carglist ccons */ yytestcase(yyruleno==329); |
| 148779 | + /* (330) carglist ::= */ yytestcase(yyruleno==330); |
| 148780 | + /* (331) ccons ::= NULL onconf */ yytestcase(yyruleno==331); |
| 148781 | + /* (332) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==332); |
| 148782 | + /* (333) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==333); |
| 148783 | + /* (334) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=334); |
| 148784 | + /* (335) tconscomma ::= */ yytestcase(yyruleno==335); |
| 148785 | + /* (336) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=336); |
| 148786 | + /* (337) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=337); |
| 148787 | + /* (338) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=338); |
| 148788 | + /* (339) oneselect ::= values */ yytestcase(yyruleno==339); |
| 148789 | + /* (340) sclp ::= selcollist COMMA */ yytestcase(yyruleno==340); |
| 148790 | + /* (341) as ::= ID|STRING */ yytestcase(yyruleno==341); |
| 148791 | + /* (342) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=342); |
| 148792 | + /* (343) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==343); |
| 148793 | + /* (344) exprlist ::= nexprlist */ yytestcase(yyruleno==344); |
| 148794 | + /* (345) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=345); |
| 148795 | + /* (346) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=346); |
| 148796 | + /* (347) nmnum ::= ON */ yytestcase(yyruleno==347); |
| 148797 | + /* (348) nmnum ::= DELETE */ yytestcase(yyruleno==348); |
| 148798 | + /* (349) nmnum ::= DEFAULT */ yytestcase(yyruleno==349); |
| 148799 | + /* (350) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==350); |
| 148800 | + /* (351) foreach_clause ::= */ yytestcase(yyruleno==351); |
| 148801 | + /* (352) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==352); |
| 148802 | + /* (353) trnm ::= nm */ yytestcase(yyruleno==353); |
| 148803 | + /* (354) tridxby ::= */ yytestcase(yyruleno==354); |
| 148804 | + /* (355) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==355); |
| 148805 | + /* (356) database_kw_opt ::= */ yytestcase(yyruleno==356); |
| 148806 | + /* (357) kwcolumn_opt ::= */ yytestcase(yyruleno==357); |
| 148807 | + /* (358) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==358); |
| 148808 | + /* (359) vtabarglist ::= vtabarg */ yytestcase(yyruleno==359); |
| 148809 | + /* (360) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==360); |
| 148810 | + /* (361) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==361); |
| 148811 | + /* (362) anylist ::= */ yytestcase(yyruleno==362); |
| 148812 | + /* (363) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==363); |
| 148813 | + /* (364) anylist ::= anylist ANY */ yytestcase(yyruleno==364); |
| 148814 | + /* (365) with ::= */ yytestcase(yyruleno==365); |
| 148889 | 148815 | break; |
| 148890 | 148816 | /********** End reduce actions ************************************************/ |
| 148891 | 148817 | }; |
| 148892 | 148818 | assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) ); |
| 148893 | 148819 | yygoto = yyRuleInfo[yyruleno].lhs; |
| | @@ -151538,10 +151464,19 @@ |
| 151538 | 151464 | rc = nKey1 - nKey2; |
| 151539 | 151465 | } |
| 151540 | 151466 | } |
| 151541 | 151467 | return rc; |
| 151542 | 151468 | } |
| 151469 | + |
| 151470 | +/* |
| 151471 | +** Return true if CollSeq is the default built-in BINARY. |
| 151472 | +*/ |
| 151473 | +SQLITE_PRIVATE int sqlite3IsBinary(const CollSeq *p){ |
| 151474 | + assert( p==0 || p->xCmp!=binCollFunc || p->pUser!=0 |
| 151475 | + || strcmp(p->zName,"BINARY")==0 ); |
| 151476 | + return p==0 || (p->xCmp==binCollFunc && p->pUser==0); |
| 151477 | +} |
| 151543 | 151478 | |
| 151544 | 151479 | /* |
| 151545 | 151480 | ** Another built-in collating sequence: NOCASE. |
| 151546 | 151481 | ** |
| 151547 | 151482 | ** This collating sequence is intended to be used for "case independent |
| | @@ -151660,11 +151595,11 @@ |
| 151660 | 151595 | int i; |
| 151661 | 151596 | HashElem *p; |
| 151662 | 151597 | sqlite3BtreeEnterAll(db); |
| 151663 | 151598 | for(i=0; i<db->nDb; i++){ |
| 151664 | 151599 | Schema *pSchema = db->aDb[i].pSchema; |
| 151665 | | - if( db->aDb[i].pSchema ){ |
| 151600 | + if( pSchema ){ |
| 151666 | 151601 | for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ |
| 151667 | 151602 | Table *pTab = (Table *)sqliteHashData(p); |
| 151668 | 151603 | if( IsVirtual(pTab) ) sqlite3VtabDisconnect(db, pTab); |
| 151669 | 151604 | } |
| 151670 | 151605 | } |
| | @@ -154829,15 +154764,33 @@ |
| 154829 | 154764 | if( db->autoCommit==0 ){ |
| 154830 | 154765 | int iDb; |
| 154831 | 154766 | iDb = sqlite3FindDbName(db, zDb); |
| 154832 | 154767 | if( iDb==0 || iDb>1 ){ |
| 154833 | 154768 | Btree *pBt = db->aDb[iDb].pBt; |
| 154834 | | - if( 0==sqlite3BtreeIsInReadTrans(pBt) ){ |
| 154835 | | - rc = sqlite3PagerSnapshotOpen(sqlite3BtreePager(pBt), pSnapshot); |
| 154769 | + if( sqlite3BtreeIsInTrans(pBt)==0 ){ |
| 154770 | + Pager *pPager = sqlite3BtreePager(pBt); |
| 154771 | + int bUnlock = 0; |
| 154772 | + if( sqlite3BtreeIsInReadTrans(pBt) ){ |
| 154773 | + if( db->nVdbeActive==0 ){ |
| 154774 | + rc = sqlite3PagerSnapshotCheck(pPager, pSnapshot); |
| 154775 | + if( rc==SQLITE_OK ){ |
| 154776 | + bUnlock = 1; |
| 154777 | + rc = sqlite3BtreeCommit(pBt); |
| 154778 | + } |
| 154779 | + } |
| 154780 | + }else{ |
| 154781 | + rc = SQLITE_OK; |
| 154782 | + } |
| 154783 | + if( rc==SQLITE_OK ){ |
| 154784 | + rc = sqlite3PagerSnapshotOpen(pPager, pSnapshot); |
| 154785 | + } |
| 154836 | 154786 | if( rc==SQLITE_OK ){ |
| 154837 | 154787 | rc = sqlite3BtreeBeginTrans(pBt, 0, 0); |
| 154838 | | - sqlite3PagerSnapshotOpen(sqlite3BtreePager(pBt), 0); |
| 154788 | + sqlite3PagerSnapshotOpen(pPager, 0); |
| 154789 | + } |
| 154790 | + if( bUnlock ){ |
| 154791 | + sqlite3PagerSnapshotUnlock(pPager); |
| 154839 | 154792 | } |
| 154840 | 154793 | } |
| 154841 | 154794 | } |
| 154842 | 154795 | } |
| 154843 | 154796 | |
| | @@ -207692,11 +207645,14 @@ |
| 207692 | 207645 | int n = 0; |
| 207693 | 207646 | int i; |
| 207694 | 207647 | for(i=0; i<nChar; i++){ |
| 207695 | 207648 | if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */ |
| 207696 | 207649 | if( (unsigned char)p[n++]>=0xc0 ){ |
| 207697 | | - while( (p[n] & 0xc0)==0x80 ) n++; |
| 207650 | + while( (p[n] & 0xc0)==0x80 ){ |
| 207651 | + n++; |
| 207652 | + if( n>=nByte ) break; |
| 207653 | + } |
| 207698 | 207654 | } |
| 207699 | 207655 | } |
| 207700 | 207656 | return n; |
| 207701 | 207657 | } |
| 207702 | 207658 | |
| | @@ -211572,11 +211528,11 @@ |
| 211572 | 211528 | int nArg, /* Number of args */ |
| 211573 | 211529 | sqlite3_value **apUnused /* Function arguments */ |
| 211574 | 211530 | ){ |
| 211575 | 211531 | assert( nArg==0 ); |
| 211576 | 211532 | UNUSED_PARAM2(nArg, apUnused); |
| 211577 | | - sqlite3_result_text(pCtx, "fts5: 2018-07-24 22:02:12 2bd593332da0aade467e7a4ee89e966aa6302f37540a2c5e23671f98a6cb599c", -1, SQLITE_TRANSIENT); |
| 211533 | + sqlite3_result_text(pCtx, "fts5: 2018-08-16 15:29:40 60045fbf52162f15f2e18a4e392e80fab19bdbce242728b5e62b0894eac49dfd", -1, SQLITE_TRANSIENT); |
| 211578 | 211534 | } |
| 211579 | 211535 | |
| 211580 | 211536 | static int fts5Init(sqlite3 *db){ |
| 211581 | 211537 | static const sqlite3_module fts5Mod = { |
| 211582 | 211538 | /* iVersion */ 2, |
| | @@ -216282,12 +216238,12 @@ |
| 216282 | 216238 | } |
| 216283 | 216239 | #endif /* SQLITE_CORE */ |
| 216284 | 216240 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 216285 | 216241 | |
| 216286 | 216242 | /************** End of stmt.c ************************************************/ |
| 216287 | | -#if __LINE__!=216287 |
| 216243 | +#if __LINE__!=216243 |
| 216288 | 216244 | #undef SQLITE_SOURCE_ID |
| 216289 | | -#define SQLITE_SOURCE_ID "2018-07-24 22:02:12 2bd593332da0aade467e7a4ee89e966aa6302f37540a2c5e23671f98a6cbalt2" |
| 216245 | +#define SQLITE_SOURCE_ID "2018-08-16 16:24:24 456842924bb33c0af8af29402f06e5f25b6791f698a0d12a080258b20b0calt2" |
| 216290 | 216246 | #endif |
| 216291 | 216247 | /* Return the source-id for this library */ |
| 216292 | 216248 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 216293 | 216249 | /************************** End of sqlite3.c ******************************/ |
| 216294 | 216250 | |