| | @@ -656,11 +656,11 @@ |
| 656 | 656 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 657 | 657 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 658 | 658 | */ |
| 659 | 659 | #define SQLITE_VERSION "3.8.0" |
| 660 | 660 | #define SQLITE_VERSION_NUMBER 3008000 |
| 661 | | -#define SQLITE_SOURCE_ID "2013-08-05 12:31:41 4b8b426f10f8ae13bf553f7adf5ae09383fa0bd4" |
| 661 | +#define SQLITE_SOURCE_ID "2013-08-06 07:45:08 924f7e4d7a8fa2fe9100836663f3733b6e1a9084" |
| 662 | 662 | |
| 663 | 663 | /* |
| 664 | 664 | ** CAPI3REF: Run-Time Library Version Numbers |
| 665 | 665 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 666 | 666 | ** |
| | @@ -8943,155 +8943,155 @@ |
| 8943 | 8943 | */ |
| 8944 | 8944 | /************** Include opcodes.h in the middle of vdbe.h ********************/ |
| 8945 | 8945 | /************** Begin file opcodes.h *****************************************/ |
| 8946 | 8946 | /* Automatically generated. Do not edit */ |
| 8947 | 8947 | /* See the mkopcodeh.awk script for details */ |
| 8948 | | -#define OP_Goto 1 |
| 8949 | | -#define OP_Gosub 2 |
| 8950 | | -#define OP_Return 3 |
| 8951 | | -#define OP_Yield 4 |
| 8952 | | -#define OP_HaltIfNull 5 |
| 8953 | | -#define OP_Halt 6 |
| 8954 | | -#define OP_Integer 7 |
| 8955 | | -#define OP_Int64 8 |
| 8956 | | -#define OP_Real 130 /* same as TK_FLOAT */ |
| 8957 | | -#define OP_String8 94 /* same as TK_STRING */ |
| 8958 | | -#define OP_String 9 |
| 8959 | | -#define OP_Null 10 |
| 8960 | | -#define OP_Blob 11 |
| 8961 | | -#define OP_Variable 12 |
| 8962 | | -#define OP_Move 13 |
| 8963 | | -#define OP_Copy 14 |
| 8964 | | -#define OP_SCopy 15 |
| 8965 | | -#define OP_ResultRow 16 |
| 8966 | | -#define OP_Concat 91 /* same as TK_CONCAT */ |
| 8948 | +#define OP_Function 1 |
| 8949 | +#define OP_Savepoint 2 |
| 8950 | +#define OP_AutoCommit 3 |
| 8951 | +#define OP_Transaction 4 |
| 8952 | +#define OP_SorterNext 5 |
| 8953 | +#define OP_Prev 6 |
| 8954 | +#define OP_Next 7 |
| 8955 | +#define OP_AggStep 8 |
| 8956 | +#define OP_Checkpoint 9 |
| 8957 | +#define OP_JournalMode 10 |
| 8958 | +#define OP_Vacuum 11 |
| 8959 | +#define OP_VFilter 12 |
| 8960 | +#define OP_VUpdate 13 |
| 8961 | +#define OP_Goto 14 |
| 8962 | +#define OP_Gosub 15 |
| 8963 | +#define OP_Return 16 |
| 8964 | +#define OP_Yield 17 |
| 8965 | +#define OP_HaltIfNull 18 |
| 8966 | +#define OP_Not 19 /* same as TK_NOT */ |
| 8967 | +#define OP_Halt 20 |
| 8968 | +#define OP_Integer 21 |
| 8969 | +#define OP_Int64 22 |
| 8970 | +#define OP_String 23 |
| 8971 | +#define OP_Null 24 |
| 8972 | +#define OP_Blob 25 |
| 8973 | +#define OP_Variable 26 |
| 8974 | +#define OP_Move 27 |
| 8975 | +#define OP_Copy 28 |
| 8976 | +#define OP_SCopy 29 |
| 8977 | +#define OP_ResultRow 30 |
| 8978 | +#define OP_CollSeq 31 |
| 8979 | +#define OP_AddImm 32 |
| 8980 | +#define OP_MustBeInt 33 |
| 8981 | +#define OP_RealAffinity 34 |
| 8982 | +#define OP_Permutation 35 |
| 8983 | +#define OP_Compare 36 |
| 8984 | +#define OP_Jump 37 |
| 8985 | +#define OP_Once 38 |
| 8986 | +#define OP_If 39 |
| 8987 | +#define OP_IfNot 40 |
| 8988 | +#define OP_Column 41 |
| 8989 | +#define OP_Affinity 42 |
| 8990 | +#define OP_MakeRecord 43 |
| 8991 | +#define OP_Count 44 |
| 8992 | +#define OP_ReadCookie 45 |
| 8993 | +#define OP_SetCookie 46 |
| 8994 | +#define OP_VerifyCookie 47 |
| 8995 | +#define OP_OpenRead 48 |
| 8996 | +#define OP_OpenWrite 49 |
| 8997 | +#define OP_OpenAutoindex 50 |
| 8998 | +#define OP_OpenEphemeral 51 |
| 8999 | +#define OP_SorterOpen 52 |
| 9000 | +#define OP_OpenPseudo 53 |
| 9001 | +#define OP_Close 54 |
| 9002 | +#define OP_SeekLt 55 |
| 9003 | +#define OP_SeekLe 56 |
| 9004 | +#define OP_SeekGe 57 |
| 9005 | +#define OP_SeekGt 58 |
| 9006 | +#define OP_Seek 59 |
| 9007 | +#define OP_NotFound 60 |
| 9008 | +#define OP_Found 61 |
| 9009 | +#define OP_IsUnique 62 |
| 9010 | +#define OP_NotExists 63 |
| 9011 | +#define OP_Sequence 64 |
| 9012 | +#define OP_NewRowid 65 |
| 9013 | +#define OP_Insert 66 |
| 9014 | +#define OP_InsertInt 67 |
| 9015 | +#define OP_Or 68 /* same as TK_OR */ |
| 9016 | +#define OP_And 69 /* same as TK_AND */ |
| 9017 | +#define OP_Delete 70 |
| 9018 | +#define OP_ResetCount 71 |
| 9019 | +#define OP_SorterCompare 72 |
| 9020 | +#define OP_IsNull 73 /* same as TK_ISNULL */ |
| 9021 | +#define OP_NotNull 74 /* same as TK_NOTNULL */ |
| 9022 | +#define OP_Ne 75 /* same as TK_NE */ |
| 9023 | +#define OP_Eq 76 /* same as TK_EQ */ |
| 9024 | +#define OP_Gt 77 /* same as TK_GT */ |
| 9025 | +#define OP_Le 78 /* same as TK_LE */ |
| 9026 | +#define OP_Lt 79 /* same as TK_LT */ |
| 9027 | +#define OP_Ge 80 /* same as TK_GE */ |
| 9028 | +#define OP_SorterData 81 |
| 9029 | +#define OP_BitAnd 82 /* same as TK_BITAND */ |
| 9030 | +#define OP_BitOr 83 /* same as TK_BITOR */ |
| 9031 | +#define OP_ShiftLeft 84 /* same as TK_LSHIFT */ |
| 9032 | +#define OP_ShiftRight 85 /* same as TK_RSHIFT */ |
| 8967 | 9033 | #define OP_Add 86 /* same as TK_PLUS */ |
| 8968 | 9034 | #define OP_Subtract 87 /* same as TK_MINUS */ |
| 8969 | 9035 | #define OP_Multiply 88 /* same as TK_STAR */ |
| 8970 | 9036 | #define OP_Divide 89 /* same as TK_SLASH */ |
| 8971 | 9037 | #define OP_Remainder 90 /* same as TK_REM */ |
| 8972 | | -#define OP_CollSeq 17 |
| 8973 | | -#define OP_Function 18 |
| 8974 | | -#define OP_BitAnd 82 /* same as TK_BITAND */ |
| 8975 | | -#define OP_BitOr 83 /* same as TK_BITOR */ |
| 8976 | | -#define OP_ShiftLeft 84 /* same as TK_LSHIFT */ |
| 8977 | | -#define OP_ShiftRight 85 /* same as TK_RSHIFT */ |
| 8978 | | -#define OP_AddImm 20 |
| 8979 | | -#define OP_MustBeInt 21 |
| 8980 | | -#define OP_RealAffinity 22 |
| 9038 | +#define OP_Concat 91 /* same as TK_CONCAT */ |
| 9039 | +#define OP_RowKey 92 |
| 9040 | +#define OP_BitNot 93 /* same as TK_BITNOT */ |
| 9041 | +#define OP_String8 94 /* same as TK_STRING */ |
| 9042 | +#define OP_RowData 95 |
| 9043 | +#define OP_Rowid 96 |
| 9044 | +#define OP_NullRow 97 |
| 9045 | +#define OP_Last 98 |
| 9046 | +#define OP_SorterSort 99 |
| 9047 | +#define OP_Sort 100 |
| 9048 | +#define OP_Rewind 101 |
| 9049 | +#define OP_SorterInsert 102 |
| 9050 | +#define OP_IdxInsert 103 |
| 9051 | +#define OP_IdxDelete 104 |
| 9052 | +#define OP_IdxRowid 105 |
| 9053 | +#define OP_IdxLT 106 |
| 9054 | +#define OP_IdxGE 107 |
| 9055 | +#define OP_Destroy 108 |
| 9056 | +#define OP_Clear 109 |
| 9057 | +#define OP_CreateIndex 110 |
| 9058 | +#define OP_CreateTable 111 |
| 9059 | +#define OP_ParseSchema 112 |
| 9060 | +#define OP_LoadAnalysis 113 |
| 9061 | +#define OP_DropTable 114 |
| 9062 | +#define OP_DropIndex 115 |
| 9063 | +#define OP_DropTrigger 116 |
| 9064 | +#define OP_IntegrityCk 117 |
| 9065 | +#define OP_RowSetAdd 118 |
| 9066 | +#define OP_RowSetRead 119 |
| 9067 | +#define OP_RowSetTest 120 |
| 9068 | +#define OP_Program 121 |
| 9069 | +#define OP_Param 122 |
| 9070 | +#define OP_FkCounter 123 |
| 9071 | +#define OP_FkIfZero 124 |
| 9072 | +#define OP_MemMax 125 |
| 9073 | +#define OP_IfPos 126 |
| 9074 | +#define OP_IfNeg 127 |
| 9075 | +#define OP_IfZero 128 |
| 9076 | +#define OP_AggFinal 129 |
| 9077 | +#define OP_Real 130 /* same as TK_FLOAT */ |
| 9078 | +#define OP_IncrVacuum 131 |
| 9079 | +#define OP_Expire 132 |
| 9080 | +#define OP_TableLock 133 |
| 9081 | +#define OP_VBegin 134 |
| 9082 | +#define OP_VCreate 135 |
| 9083 | +#define OP_VDestroy 136 |
| 9084 | +#define OP_VOpen 137 |
| 9085 | +#define OP_VColumn 138 |
| 9086 | +#define OP_VNext 139 |
| 9087 | +#define OP_VRename 140 |
| 8981 | 9088 | #define OP_ToText 141 /* same as TK_TO_TEXT */ |
| 8982 | 9089 | #define OP_ToBlob 142 /* same as TK_TO_BLOB */ |
| 8983 | 9090 | #define OP_ToNumeric 143 /* same as TK_TO_NUMERIC*/ |
| 8984 | 9091 | #define OP_ToInt 144 /* same as TK_TO_INT */ |
| 8985 | 9092 | #define OP_ToReal 145 /* same as TK_TO_REAL */ |
| 8986 | | -#define OP_Eq 76 /* same as TK_EQ */ |
| 8987 | | -#define OP_Ne 75 /* same as TK_NE */ |
| 8988 | | -#define OP_Lt 79 /* same as TK_LT */ |
| 8989 | | -#define OP_Le 78 /* same as TK_LE */ |
| 8990 | | -#define OP_Gt 77 /* same as TK_GT */ |
| 8991 | | -#define OP_Ge 80 /* same as TK_GE */ |
| 8992 | | -#define OP_Permutation 23 |
| 8993 | | -#define OP_Compare 24 |
| 8994 | | -#define OP_Jump 25 |
| 8995 | | -#define OP_And 69 /* same as TK_AND */ |
| 8996 | | -#define OP_Or 68 /* same as TK_OR */ |
| 8997 | | -#define OP_Not 19 /* same as TK_NOT */ |
| 8998 | | -#define OP_BitNot 93 /* same as TK_BITNOT */ |
| 8999 | | -#define OP_Once 26 |
| 9000 | | -#define OP_If 27 |
| 9001 | | -#define OP_IfNot 28 |
| 9002 | | -#define OP_IsNull 73 /* same as TK_ISNULL */ |
| 9003 | | -#define OP_NotNull 74 /* same as TK_NOTNULL */ |
| 9004 | | -#define OP_Column 29 |
| 9005 | | -#define OP_Affinity 30 |
| 9006 | | -#define OP_MakeRecord 31 |
| 9007 | | -#define OP_Count 32 |
| 9008 | | -#define OP_Savepoint 33 |
| 9009 | | -#define OP_AutoCommit 34 |
| 9010 | | -#define OP_Transaction 35 |
| 9011 | | -#define OP_ReadCookie 36 |
| 9012 | | -#define OP_SetCookie 37 |
| 9013 | | -#define OP_VerifyCookie 38 |
| 9014 | | -#define OP_OpenRead 39 |
| 9015 | | -#define OP_OpenWrite 40 |
| 9016 | | -#define OP_OpenAutoindex 41 |
| 9017 | | -#define OP_OpenEphemeral 42 |
| 9018 | | -#define OP_SorterOpen 43 |
| 9019 | | -#define OP_OpenPseudo 44 |
| 9020 | | -#define OP_Close 45 |
| 9021 | | -#define OP_SeekLt 46 |
| 9022 | | -#define OP_SeekLe 47 |
| 9023 | | -#define OP_SeekGe 48 |
| 9024 | | -#define OP_SeekGt 49 |
| 9025 | | -#define OP_Seek 50 |
| 9026 | | -#define OP_NotFound 51 |
| 9027 | | -#define OP_Found 52 |
| 9028 | | -#define OP_IsUnique 53 |
| 9029 | | -#define OP_NotExists 54 |
| 9030 | | -#define OP_Sequence 55 |
| 9031 | | -#define OP_NewRowid 56 |
| 9032 | | -#define OP_Insert 57 |
| 9033 | | -#define OP_InsertInt 58 |
| 9034 | | -#define OP_Delete 59 |
| 9035 | | -#define OP_ResetCount 60 |
| 9036 | | -#define OP_SorterCompare 61 |
| 9037 | | -#define OP_SorterData 62 |
| 9038 | | -#define OP_RowKey 63 |
| 9039 | | -#define OP_RowData 64 |
| 9040 | | -#define OP_Rowid 65 |
| 9041 | | -#define OP_NullRow 66 |
| 9042 | | -#define OP_Last 67 |
| 9043 | | -#define OP_SorterSort 70 |
| 9044 | | -#define OP_Sort 71 |
| 9045 | | -#define OP_Rewind 72 |
| 9046 | | -#define OP_SorterNext 81 |
| 9047 | | -#define OP_Prev 92 |
| 9048 | | -#define OP_Next 95 |
| 9049 | | -#define OP_SorterInsert 96 |
| 9050 | | -#define OP_IdxInsert 97 |
| 9051 | | -#define OP_IdxDelete 98 |
| 9052 | | -#define OP_IdxRowid 99 |
| 9053 | | -#define OP_IdxLT 100 |
| 9054 | | -#define OP_IdxGE 101 |
| 9055 | | -#define OP_Destroy 102 |
| 9056 | | -#define OP_Clear 103 |
| 9057 | | -#define OP_CreateIndex 104 |
| 9058 | | -#define OP_CreateTable 105 |
| 9059 | | -#define OP_ParseSchema 106 |
| 9060 | | -#define OP_LoadAnalysis 107 |
| 9061 | | -#define OP_DropTable 108 |
| 9062 | | -#define OP_DropIndex 109 |
| 9063 | | -#define OP_DropTrigger 110 |
| 9064 | | -#define OP_IntegrityCk 111 |
| 9065 | | -#define OP_RowSetAdd 112 |
| 9066 | | -#define OP_RowSetRead 113 |
| 9067 | | -#define OP_RowSetTest 114 |
| 9068 | | -#define OP_Program 115 |
| 9069 | | -#define OP_Param 116 |
| 9070 | | -#define OP_FkCounter 117 |
| 9071 | | -#define OP_FkIfZero 118 |
| 9072 | | -#define OP_MemMax 119 |
| 9073 | | -#define OP_IfPos 120 |
| 9074 | | -#define OP_IfNeg 121 |
| 9075 | | -#define OP_IfZero 122 |
| 9076 | | -#define OP_AggStep 123 |
| 9077 | | -#define OP_AggFinal 124 |
| 9078 | | -#define OP_Checkpoint 125 |
| 9079 | | -#define OP_JournalMode 126 |
| 9080 | | -#define OP_Vacuum 127 |
| 9081 | | -#define OP_IncrVacuum 128 |
| 9082 | | -#define OP_Expire 129 |
| 9083 | | -#define OP_TableLock 131 |
| 9084 | | -#define OP_VBegin 132 |
| 9085 | | -#define OP_VCreate 133 |
| 9086 | | -#define OP_VDestroy 134 |
| 9087 | | -#define OP_VOpen 135 |
| 9088 | | -#define OP_VFilter 136 |
| 9089 | | -#define OP_VColumn 137 |
| 9090 | | -#define OP_VNext 138 |
| 9091 | | -#define OP_VRename 139 |
| 9092 | | -#define OP_VUpdate 140 |
| 9093 | 9093 | #define OP_Pagecount 146 |
| 9094 | 9094 | #define OP_MaxPgcnt 147 |
| 9095 | 9095 | #define OP_Trace 148 |
| 9096 | 9096 | #define OP_Noop 149 |
| 9097 | 9097 | #define OP_Explain 150 |
| | @@ -9107,28 +9107,28 @@ |
| 9107 | 9107 | #define OPFLG_IN2 0x0008 /* in2: P2 is an input */ |
| 9108 | 9108 | #define OPFLG_IN3 0x0010 /* in3: P3 is an input */ |
| 9109 | 9109 | #define OPFLG_OUT2 0x0020 /* out2: P2 is an output */ |
| 9110 | 9110 | #define OPFLG_OUT3 0x0040 /* out3: P3 is an output */ |
| 9111 | 9111 | #define OPFLG_INITIALIZER {\ |
| 9112 | | -/* 0 */ 0x00, 0x01, 0x01, 0x04, 0x04, 0x10, 0x00, 0x02,\ |
| 9113 | | -/* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x24,\ |
| 9114 | | -/* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\ |
| 9115 | | -/* 24 */ 0x00, 0x01, 0x01, 0x05, 0x05, 0x00, 0x00, 0x00,\ |
| 9116 | | -/* 32 */ 0x02, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00,\ |
| 9117 | | -/* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11,\ |
| 9118 | | -/* 48 */ 0x11, 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02,\ |
| 9119 | | -/* 56 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 9120 | | -/* 64 */ 0x00, 0x02, 0x00, 0x01, 0x4c, 0x4c, 0x01, 0x01,\ |
| 9121 | | -/* 72 */ 0x01, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\ |
| 9122 | | -/* 80 */ 0x15, 0x01, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\ |
| 9123 | | -/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x01,\ |
| 9124 | | -/* 96 */ 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\ |
| 9125 | | -/* 104 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 9126 | | -/* 112 */ 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\ |
| 9127 | | -/* 120 */ 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00,\ |
| 9128 | | -/* 128 */ 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 9129 | | -/* 136 */ 0x01, 0x00, 0x01, 0x00, 0x00, 0x04, 0x04, 0x04,\ |
| 9112 | +/* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,\ |
| 9113 | +/* 8 */ 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x01,\ |
| 9114 | +/* 16 */ 0x04, 0x04, 0x10, 0x24, 0x00, 0x02, 0x02, 0x02,\ |
| 9115 | +/* 24 */ 0x02, 0x02, 0x02, 0x00, 0x00, 0x24, 0x00, 0x00,\ |
| 9116 | +/* 32 */ 0x04, 0x05, 0x04, 0x00, 0x00, 0x01, 0x01, 0x05,\ |
| 9117 | +/* 40 */ 0x05, 0x00, 0x00, 0x00, 0x02, 0x02, 0x10, 0x00,\ |
| 9118 | +/* 48 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,\ |
| 9119 | +/* 56 */ 0x11, 0x11, 0x11, 0x08, 0x11, 0x11, 0x11, 0x11,\ |
| 9120 | +/* 64 */ 0x02, 0x02, 0x00, 0x00, 0x4c, 0x4c, 0x00, 0x00,\ |
| 9121 | +/* 72 */ 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\ |
| 9122 | +/* 80 */ 0x15, 0x00, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\ |
| 9123 | +/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x00, 0x24, 0x02, 0x00,\ |
| 9124 | +/* 96 */ 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x08, 0x08,\ |
| 9125 | +/* 104 */ 0x00, 0x02, 0x01, 0x01, 0x02, 0x00, 0x02, 0x02,\ |
| 9126 | +/* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x45,\ |
| 9127 | +/* 120 */ 0x15, 0x01, 0x02, 0x00, 0x01, 0x08, 0x05, 0x05,\ |
| 9128 | +/* 128 */ 0x05, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00,\ |
| 9129 | +/* 136 */ 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x04, 0x04,\ |
| 9130 | 9130 | /* 144 */ 0x04, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00,} |
| 9131 | 9131 | |
| 9132 | 9132 | /************** End of opcodes.h *********************************************/ |
| 9133 | 9133 | /************** Continuing where we left off in vdbe.h ***********************/ |
| 9134 | 9134 | |
| | @@ -10672,16 +10672,20 @@ |
| 10672 | 10672 | |
| 10673 | 10673 | /* |
| 10674 | 10674 | ** An instance of the following structure is passed as the first |
| 10675 | 10675 | ** argument to sqlite3VdbeKeyCompare and is used to control the |
| 10676 | 10676 | ** comparison of the two index keys. |
| 10677 | +** |
| 10678 | +** Note that aSortOrder[] and aColl[] have nField+1 slots. There |
| 10679 | +** are nField slots for the columns of an index then one extra slot |
| 10680 | +** for the rowid at the end. |
| 10677 | 10681 | */ |
| 10678 | 10682 | struct KeyInfo { |
| 10679 | 10683 | sqlite3 *db; /* The database connection */ |
| 10680 | 10684 | u8 enc; /* Text encoding - one of the SQLITE_UTF* values */ |
| 10681 | | - u16 nField; /* Number of entries in aColl[] */ |
| 10682 | | - u8 *aSortOrder; /* Sort order for each column. May be NULL */ |
| 10685 | + u16 nField; /* Maximum index for aColl[] and aSortOrder[] */ |
| 10686 | + u8 *aSortOrder; /* Sort order for each column. */ |
| 10683 | 10687 | CollSeq *aColl[1]; /* Collating sequence for each term of the key */ |
| 10684 | 10688 | }; |
| 10685 | 10689 | |
| 10686 | 10690 | /* |
| 10687 | 10691 | ** An instance of the following structure holds information about a |
| | @@ -11282,10 +11286,11 @@ |
| 11282 | 11286 | #define SF_HasTypeInfo 0x0020 /* FROM subqueries have Table metadata */ |
| 11283 | 11287 | #define SF_UseSorter 0x0040 /* Sort using a sorter */ |
| 11284 | 11288 | #define SF_Values 0x0080 /* Synthesized from VALUES clause */ |
| 11285 | 11289 | #define SF_Materialize 0x0100 /* Force materialization of views */ |
| 11286 | 11290 | #define SF_NestedFrom 0x0200 /* Part of a parenthesized FROM clause */ |
| 11291 | +#define SF_MaybeConvert 0x0400 /* Need convertCompoundSelectToSubquery() */ |
| 11287 | 11292 | |
| 11288 | 11293 | |
| 11289 | 11294 | /* |
| 11290 | 11295 | ** The results of a select can be distributed in several ways. The |
| 11291 | 11296 | ** "SRT" prefix means "SELECT Result Type". |
| | @@ -11403,10 +11408,11 @@ |
| 11403 | 11408 | u8 nTempInUse; /* Number of aTempReg[] currently checked out */ |
| 11404 | 11409 | u8 nColCache; /* Number of entries in aColCache[] */ |
| 11405 | 11410 | u8 iColCache; /* Next entry in aColCache[] to replace */ |
| 11406 | 11411 | u8 isMultiWrite; /* True if statement may modify/insert multiple rows */ |
| 11407 | 11412 | u8 mayAbort; /* True if statement may throw an ABORT exception */ |
| 11413 | + u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */ |
| 11408 | 11414 | int aTempReg[8]; /* Holding area for temporary registers */ |
| 11409 | 11415 | int nRangeReg; /* Size of the temporary register block */ |
| 11410 | 11416 | int iRangeReg; /* First register in temporary register block */ |
| 11411 | 11417 | int nErr; /* Number of errors seen */ |
| 11412 | 11418 | int nTab; /* Number of previously allocated VDBE cursors */ |
| | @@ -12294,10 +12300,11 @@ |
| 12294 | 12300 | SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*); |
| 12295 | 12301 | SQLITE_PRIVATE void sqlite3MinimumFileFormat(Parse*, int, int); |
| 12296 | 12302 | SQLITE_PRIVATE void sqlite3SchemaClear(void *); |
| 12297 | 12303 | SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *, Btree *); |
| 12298 | 12304 | SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *); |
| 12305 | +SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3*,int); |
| 12299 | 12306 | SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *, Index *); |
| 12300 | 12307 | SQLITE_PRIVATE int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *, |
| 12301 | 12308 | void (*)(sqlite3_context*,int,sqlite3_value **), |
| 12302 | 12309 | void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*), |
| 12303 | 12310 | FuncDestructor *pDestructor |
| | @@ -22693,91 +22700,91 @@ |
| 22693 | 22700 | /* Automatically generated. Do not edit */ |
| 22694 | 22701 | /* See the mkopcodec.awk script for details. */ |
| 22695 | 22702 | #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) |
| 22696 | 22703 | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ |
| 22697 | 22704 | static const char *const azName[] = { "?", |
| 22698 | | - /* 1 */ "Goto", |
| 22699 | | - /* 2 */ "Gosub", |
| 22700 | | - /* 3 */ "Return", |
| 22701 | | - /* 4 */ "Yield", |
| 22702 | | - /* 5 */ "HaltIfNull", |
| 22703 | | - /* 6 */ "Halt", |
| 22704 | | - /* 7 */ "Integer", |
| 22705 | | - /* 8 */ "Int64", |
| 22706 | | - /* 9 */ "String", |
| 22707 | | - /* 10 */ "Null", |
| 22708 | | - /* 11 */ "Blob", |
| 22709 | | - /* 12 */ "Variable", |
| 22710 | | - /* 13 */ "Move", |
| 22711 | | - /* 14 */ "Copy", |
| 22712 | | - /* 15 */ "SCopy", |
| 22713 | | - /* 16 */ "ResultRow", |
| 22714 | | - /* 17 */ "CollSeq", |
| 22715 | | - /* 18 */ "Function", |
| 22705 | + /* 1 */ "Function", |
| 22706 | + /* 2 */ "Savepoint", |
| 22707 | + /* 3 */ "AutoCommit", |
| 22708 | + /* 4 */ "Transaction", |
| 22709 | + /* 5 */ "SorterNext", |
| 22710 | + /* 6 */ "Prev", |
| 22711 | + /* 7 */ "Next", |
| 22712 | + /* 8 */ "AggStep", |
| 22713 | + /* 9 */ "Checkpoint", |
| 22714 | + /* 10 */ "JournalMode", |
| 22715 | + /* 11 */ "Vacuum", |
| 22716 | + /* 12 */ "VFilter", |
| 22717 | + /* 13 */ "VUpdate", |
| 22718 | + /* 14 */ "Goto", |
| 22719 | + /* 15 */ "Gosub", |
| 22720 | + /* 16 */ "Return", |
| 22721 | + /* 17 */ "Yield", |
| 22722 | + /* 18 */ "HaltIfNull", |
| 22716 | 22723 | /* 19 */ "Not", |
| 22717 | | - /* 20 */ "AddImm", |
| 22718 | | - /* 21 */ "MustBeInt", |
| 22719 | | - /* 22 */ "RealAffinity", |
| 22720 | | - /* 23 */ "Permutation", |
| 22721 | | - /* 24 */ "Compare", |
| 22722 | | - /* 25 */ "Jump", |
| 22723 | | - /* 26 */ "Once", |
| 22724 | | - /* 27 */ "If", |
| 22725 | | - /* 28 */ "IfNot", |
| 22726 | | - /* 29 */ "Column", |
| 22727 | | - /* 30 */ "Affinity", |
| 22728 | | - /* 31 */ "MakeRecord", |
| 22729 | | - /* 32 */ "Count", |
| 22730 | | - /* 33 */ "Savepoint", |
| 22731 | | - /* 34 */ "AutoCommit", |
| 22732 | | - /* 35 */ "Transaction", |
| 22733 | | - /* 36 */ "ReadCookie", |
| 22734 | | - /* 37 */ "SetCookie", |
| 22735 | | - /* 38 */ "VerifyCookie", |
| 22736 | | - /* 39 */ "OpenRead", |
| 22737 | | - /* 40 */ "OpenWrite", |
| 22738 | | - /* 41 */ "OpenAutoindex", |
| 22739 | | - /* 42 */ "OpenEphemeral", |
| 22740 | | - /* 43 */ "SorterOpen", |
| 22741 | | - /* 44 */ "OpenPseudo", |
| 22742 | | - /* 45 */ "Close", |
| 22743 | | - /* 46 */ "SeekLt", |
| 22744 | | - /* 47 */ "SeekLe", |
| 22745 | | - /* 48 */ "SeekGe", |
| 22746 | | - /* 49 */ "SeekGt", |
| 22747 | | - /* 50 */ "Seek", |
| 22748 | | - /* 51 */ "NotFound", |
| 22749 | | - /* 52 */ "Found", |
| 22750 | | - /* 53 */ "IsUnique", |
| 22751 | | - /* 54 */ "NotExists", |
| 22752 | | - /* 55 */ "Sequence", |
| 22753 | | - /* 56 */ "NewRowid", |
| 22754 | | - /* 57 */ "Insert", |
| 22755 | | - /* 58 */ "InsertInt", |
| 22756 | | - /* 59 */ "Delete", |
| 22757 | | - /* 60 */ "ResetCount", |
| 22758 | | - /* 61 */ "SorterCompare", |
| 22759 | | - /* 62 */ "SorterData", |
| 22760 | | - /* 63 */ "RowKey", |
| 22761 | | - /* 64 */ "RowData", |
| 22762 | | - /* 65 */ "Rowid", |
| 22763 | | - /* 66 */ "NullRow", |
| 22764 | | - /* 67 */ "Last", |
| 22724 | + /* 20 */ "Halt", |
| 22725 | + /* 21 */ "Integer", |
| 22726 | + /* 22 */ "Int64", |
| 22727 | + /* 23 */ "String", |
| 22728 | + /* 24 */ "Null", |
| 22729 | + /* 25 */ "Blob", |
| 22730 | + /* 26 */ "Variable", |
| 22731 | + /* 27 */ "Move", |
| 22732 | + /* 28 */ "Copy", |
| 22733 | + /* 29 */ "SCopy", |
| 22734 | + /* 30 */ "ResultRow", |
| 22735 | + /* 31 */ "CollSeq", |
| 22736 | + /* 32 */ "AddImm", |
| 22737 | + /* 33 */ "MustBeInt", |
| 22738 | + /* 34 */ "RealAffinity", |
| 22739 | + /* 35 */ "Permutation", |
| 22740 | + /* 36 */ "Compare", |
| 22741 | + /* 37 */ "Jump", |
| 22742 | + /* 38 */ "Once", |
| 22743 | + /* 39 */ "If", |
| 22744 | + /* 40 */ "IfNot", |
| 22745 | + /* 41 */ "Column", |
| 22746 | + /* 42 */ "Affinity", |
| 22747 | + /* 43 */ "MakeRecord", |
| 22748 | + /* 44 */ "Count", |
| 22749 | + /* 45 */ "ReadCookie", |
| 22750 | + /* 46 */ "SetCookie", |
| 22751 | + /* 47 */ "VerifyCookie", |
| 22752 | + /* 48 */ "OpenRead", |
| 22753 | + /* 49 */ "OpenWrite", |
| 22754 | + /* 50 */ "OpenAutoindex", |
| 22755 | + /* 51 */ "OpenEphemeral", |
| 22756 | + /* 52 */ "SorterOpen", |
| 22757 | + /* 53 */ "OpenPseudo", |
| 22758 | + /* 54 */ "Close", |
| 22759 | + /* 55 */ "SeekLt", |
| 22760 | + /* 56 */ "SeekLe", |
| 22761 | + /* 57 */ "SeekGe", |
| 22762 | + /* 58 */ "SeekGt", |
| 22763 | + /* 59 */ "Seek", |
| 22764 | + /* 60 */ "NotFound", |
| 22765 | + /* 61 */ "Found", |
| 22766 | + /* 62 */ "IsUnique", |
| 22767 | + /* 63 */ "NotExists", |
| 22768 | + /* 64 */ "Sequence", |
| 22769 | + /* 65 */ "NewRowid", |
| 22770 | + /* 66 */ "Insert", |
| 22771 | + /* 67 */ "InsertInt", |
| 22765 | 22772 | /* 68 */ "Or", |
| 22766 | 22773 | /* 69 */ "And", |
| 22767 | | - /* 70 */ "SorterSort", |
| 22768 | | - /* 71 */ "Sort", |
| 22769 | | - /* 72 */ "Rewind", |
| 22774 | + /* 70 */ "Delete", |
| 22775 | + /* 71 */ "ResetCount", |
| 22776 | + /* 72 */ "SorterCompare", |
| 22770 | 22777 | /* 73 */ "IsNull", |
| 22771 | 22778 | /* 74 */ "NotNull", |
| 22772 | 22779 | /* 75 */ "Ne", |
| 22773 | 22780 | /* 76 */ "Eq", |
| 22774 | 22781 | /* 77 */ "Gt", |
| 22775 | 22782 | /* 78 */ "Le", |
| 22776 | 22783 | /* 79 */ "Lt", |
| 22777 | 22784 | /* 80 */ "Ge", |
| 22778 | | - /* 81 */ "SorterNext", |
| 22785 | + /* 81 */ "SorterData", |
| 22779 | 22786 | /* 82 */ "BitAnd", |
| 22780 | 22787 | /* 83 */ "BitOr", |
| 22781 | 22788 | /* 84 */ "ShiftLeft", |
| 22782 | 22789 | /* 85 */ "ShiftRight", |
| 22783 | 22790 | /* 86 */ "Add", |
| | @@ -22784,59 +22791,59 @@ |
| 22784 | 22791 | /* 87 */ "Subtract", |
| 22785 | 22792 | /* 88 */ "Multiply", |
| 22786 | 22793 | /* 89 */ "Divide", |
| 22787 | 22794 | /* 90 */ "Remainder", |
| 22788 | 22795 | /* 91 */ "Concat", |
| 22789 | | - /* 92 */ "Prev", |
| 22796 | + /* 92 */ "RowKey", |
| 22790 | 22797 | /* 93 */ "BitNot", |
| 22791 | 22798 | /* 94 */ "String8", |
| 22792 | | - /* 95 */ "Next", |
| 22793 | | - /* 96 */ "SorterInsert", |
| 22794 | | - /* 97 */ "IdxInsert", |
| 22795 | | - /* 98 */ "IdxDelete", |
| 22796 | | - /* 99 */ "IdxRowid", |
| 22797 | | - /* 100 */ "IdxLT", |
| 22798 | | - /* 101 */ "IdxGE", |
| 22799 | | - /* 102 */ "Destroy", |
| 22800 | | - /* 103 */ "Clear", |
| 22801 | | - /* 104 */ "CreateIndex", |
| 22802 | | - /* 105 */ "CreateTable", |
| 22803 | | - /* 106 */ "ParseSchema", |
| 22804 | | - /* 107 */ "LoadAnalysis", |
| 22805 | | - /* 108 */ "DropTable", |
| 22806 | | - /* 109 */ "DropIndex", |
| 22807 | | - /* 110 */ "DropTrigger", |
| 22808 | | - /* 111 */ "IntegrityCk", |
| 22809 | | - /* 112 */ "RowSetAdd", |
| 22810 | | - /* 113 */ "RowSetRead", |
| 22811 | | - /* 114 */ "RowSetTest", |
| 22812 | | - /* 115 */ "Program", |
| 22813 | | - /* 116 */ "Param", |
| 22814 | | - /* 117 */ "FkCounter", |
| 22815 | | - /* 118 */ "FkIfZero", |
| 22816 | | - /* 119 */ "MemMax", |
| 22817 | | - /* 120 */ "IfPos", |
| 22818 | | - /* 121 */ "IfNeg", |
| 22819 | | - /* 122 */ "IfZero", |
| 22820 | | - /* 123 */ "AggStep", |
| 22821 | | - /* 124 */ "AggFinal", |
| 22822 | | - /* 125 */ "Checkpoint", |
| 22823 | | - /* 126 */ "JournalMode", |
| 22824 | | - /* 127 */ "Vacuum", |
| 22825 | | - /* 128 */ "IncrVacuum", |
| 22826 | | - /* 129 */ "Expire", |
| 22799 | + /* 95 */ "RowData", |
| 22800 | + /* 96 */ "Rowid", |
| 22801 | + /* 97 */ "NullRow", |
| 22802 | + /* 98 */ "Last", |
| 22803 | + /* 99 */ "SorterSort", |
| 22804 | + /* 100 */ "Sort", |
| 22805 | + /* 101 */ "Rewind", |
| 22806 | + /* 102 */ "SorterInsert", |
| 22807 | + /* 103 */ "IdxInsert", |
| 22808 | + /* 104 */ "IdxDelete", |
| 22809 | + /* 105 */ "IdxRowid", |
| 22810 | + /* 106 */ "IdxLT", |
| 22811 | + /* 107 */ "IdxGE", |
| 22812 | + /* 108 */ "Destroy", |
| 22813 | + /* 109 */ "Clear", |
| 22814 | + /* 110 */ "CreateIndex", |
| 22815 | + /* 111 */ "CreateTable", |
| 22816 | + /* 112 */ "ParseSchema", |
| 22817 | + /* 113 */ "LoadAnalysis", |
| 22818 | + /* 114 */ "DropTable", |
| 22819 | + /* 115 */ "DropIndex", |
| 22820 | + /* 116 */ "DropTrigger", |
| 22821 | + /* 117 */ "IntegrityCk", |
| 22822 | + /* 118 */ "RowSetAdd", |
| 22823 | + /* 119 */ "RowSetRead", |
| 22824 | + /* 120 */ "RowSetTest", |
| 22825 | + /* 121 */ "Program", |
| 22826 | + /* 122 */ "Param", |
| 22827 | + /* 123 */ "FkCounter", |
| 22828 | + /* 124 */ "FkIfZero", |
| 22829 | + /* 125 */ "MemMax", |
| 22830 | + /* 126 */ "IfPos", |
| 22831 | + /* 127 */ "IfNeg", |
| 22832 | + /* 128 */ "IfZero", |
| 22833 | + /* 129 */ "AggFinal", |
| 22827 | 22834 | /* 130 */ "Real", |
| 22828 | | - /* 131 */ "TableLock", |
| 22829 | | - /* 132 */ "VBegin", |
| 22830 | | - /* 133 */ "VCreate", |
| 22831 | | - /* 134 */ "VDestroy", |
| 22832 | | - /* 135 */ "VOpen", |
| 22833 | | - /* 136 */ "VFilter", |
| 22834 | | - /* 137 */ "VColumn", |
| 22835 | | - /* 138 */ "VNext", |
| 22836 | | - /* 139 */ "VRename", |
| 22837 | | - /* 140 */ "VUpdate", |
| 22835 | + /* 131 */ "IncrVacuum", |
| 22836 | + /* 132 */ "Expire", |
| 22837 | + /* 133 */ "TableLock", |
| 22838 | + /* 134 */ "VBegin", |
| 22839 | + /* 135 */ "VCreate", |
| 22840 | + /* 136 */ "VDestroy", |
| 22841 | + /* 137 */ "VOpen", |
| 22842 | + /* 138 */ "VColumn", |
| 22843 | + /* 139 */ "VNext", |
| 22844 | + /* 140 */ "VRename", |
| 22838 | 22845 | /* 141 */ "ToText", |
| 22839 | 22846 | /* 142 */ "ToBlob", |
| 22840 | 22847 | /* 143 */ "ToNumeric", |
| 22841 | 22848 | /* 144 */ "ToInt", |
| 22842 | 22849 | /* 145 */ "ToReal", |
| | @@ -60361,44 +60368,64 @@ |
| 60361 | 60368 | p->readOnly = 1; |
| 60362 | 60369 | p->bIsReader = 0; |
| 60363 | 60370 | for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){ |
| 60364 | 60371 | u8 opcode = pOp->opcode; |
| 60365 | 60372 | |
| 60366 | | - pOp->opflags = sqlite3OpcodeProperty[opcode]; |
| 60367 | | - if( opcode==OP_Function || opcode==OP_AggStep ){ |
| 60368 | | - if( pOp->p5>nMaxArgs ) nMaxArgs = pOp->p5; |
| 60369 | | - }else if( opcode==OP_Transaction ){ |
| 60370 | | - if( pOp->p2!=0 ) p->readOnly = 0; |
| 60371 | | - p->bIsReader = 1; |
| 60372 | | - }else if( opcode==OP_AutoCommit || opcode==OP_Savepoint ){ |
| 60373 | | - p->bIsReader = 1; |
| 60374 | | - }else if( opcode==OP_Vacuum |
| 60375 | | - || opcode==OP_JournalMode |
| 60373 | + /* NOTE: Be sure to update mkopcodeh.awk when adding or removing |
| 60374 | + ** cases from this switch! */ |
| 60375 | + switch( opcode ){ |
| 60376 | + case OP_Function: |
| 60377 | + case OP_AggStep: { |
| 60378 | + if( pOp->p5>nMaxArgs ) nMaxArgs = pOp->p5; |
| 60379 | + break; |
| 60380 | + } |
| 60381 | + case OP_Transaction: { |
| 60382 | + if( pOp->p2!=0 ) p->readOnly = 0; |
| 60383 | + /* fall thru */ |
| 60384 | + } |
| 60385 | + case OP_AutoCommit: |
| 60386 | + case OP_Savepoint: { |
| 60387 | + p->bIsReader = 1; |
| 60388 | + break; |
| 60389 | + } |
| 60376 | 60390 | #ifndef SQLITE_OMIT_WAL |
| 60377 | | - || opcode==OP_Checkpoint |
| 60391 | + case OP_Checkpoint: |
| 60378 | 60392 | #endif |
| 60379 | | - ){ |
| 60380 | | - p->readOnly = 0; |
| 60381 | | - p->bIsReader = 1; |
| 60393 | + case OP_Vacuum: |
| 60394 | + case OP_JournalMode: { |
| 60395 | + p->readOnly = 0; |
| 60396 | + p->bIsReader = 1; |
| 60397 | + break; |
| 60398 | + } |
| 60382 | 60399 | #ifndef SQLITE_OMIT_VIRTUALTABLE |
| 60383 | | - }else if( opcode==OP_VUpdate ){ |
| 60384 | | - if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2; |
| 60385 | | - }else if( opcode==OP_VFilter ){ |
| 60386 | | - int n; |
| 60387 | | - assert( p->nOp - i >= 3 ); |
| 60388 | | - assert( pOp[-1].opcode==OP_Integer ); |
| 60389 | | - n = pOp[-1].p1; |
| 60390 | | - if( n>nMaxArgs ) nMaxArgs = n; |
| 60391 | | -#endif |
| 60392 | | - }else if( opcode==OP_Next || opcode==OP_SorterNext ){ |
| 60393 | | - pOp->p4.xAdvance = sqlite3BtreeNext; |
| 60394 | | - pOp->p4type = P4_ADVANCE; |
| 60395 | | - }else if( opcode==OP_Prev ){ |
| 60396 | | - pOp->p4.xAdvance = sqlite3BtreePrevious; |
| 60397 | | - pOp->p4type = P4_ADVANCE; |
| 60398 | | - } |
| 60399 | | - |
| 60400 | + case OP_VUpdate: { |
| 60401 | + if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2; |
| 60402 | + break; |
| 60403 | + } |
| 60404 | + case OP_VFilter: { |
| 60405 | + int n; |
| 60406 | + assert( p->nOp - i >= 3 ); |
| 60407 | + assert( pOp[-1].opcode==OP_Integer ); |
| 60408 | + n = pOp[-1].p1; |
| 60409 | + if( n>nMaxArgs ) nMaxArgs = n; |
| 60410 | + break; |
| 60411 | + } |
| 60412 | +#endif |
| 60413 | + case OP_Next: |
| 60414 | + case OP_SorterNext: { |
| 60415 | + pOp->p4.xAdvance = sqlite3BtreeNext; |
| 60416 | + pOp->p4type = P4_ADVANCE; |
| 60417 | + break; |
| 60418 | + } |
| 60419 | + case OP_Prev: { |
| 60420 | + pOp->p4.xAdvance = sqlite3BtreePrevious; |
| 60421 | + pOp->p4type = P4_ADVANCE; |
| 60422 | + break; |
| 60423 | + } |
| 60424 | + } |
| 60425 | + |
| 60426 | + pOp->opflags = sqlite3OpcodeProperty[opcode]; |
| 60400 | 60427 | if( (pOp->opflags & OPFLG_JUMP)!=0 && pOp->p2<0 ){ |
| 60401 | 60428 | assert( -1-pOp->p2<p->nLabel ); |
| 60402 | 60429 | pOp->p2 = aLabel[-1-pOp->p2]; |
| 60403 | 60430 | } |
| 60404 | 60431 | } |
| | @@ -60683,24 +60710,17 @@ |
| 60683 | 60710 | pOp->p4type = P4_INT32; |
| 60684 | 60711 | }else if( zP4==0 ){ |
| 60685 | 60712 | pOp->p4.p = 0; |
| 60686 | 60713 | pOp->p4type = P4_NOTUSED; |
| 60687 | 60714 | }else if( n==P4_KEYINFO ){ |
| 60688 | | - KeyInfo *pKeyInfo; |
| 60689 | | - int nField, nByte; |
| 60690 | | - |
| 60691 | | - nField = ((KeyInfo*)zP4)->nField; |
| 60692 | | - nByte = sizeof(*pKeyInfo) + (nField-1)*sizeof(pKeyInfo->aColl[0]) + nField; |
| 60693 | | - pKeyInfo = sqlite3DbMallocRaw(0, nByte); |
| 60694 | | - pOp->p4.pKeyInfo = pKeyInfo; |
| 60695 | | - if( pKeyInfo ){ |
| 60696 | | - u8 *aSortOrder; |
| 60697 | | - memcpy((char*)pKeyInfo, zP4, nByte - nField); |
| 60698 | | - aSortOrder = pKeyInfo->aSortOrder; |
| 60699 | | - assert( aSortOrder!=0 ); |
| 60700 | | - pKeyInfo->aSortOrder = (unsigned char*)&pKeyInfo->aColl[nField]; |
| 60701 | | - memcpy(pKeyInfo->aSortOrder, aSortOrder, nField); |
| 60715 | + KeyInfo *pOrig, *pNew; |
| 60716 | + |
| 60717 | + pOrig = (KeyInfo*)zP4; |
| 60718 | + pOp->p4.pKeyInfo = pNew = sqlite3KeyInfoAlloc(db, pOrig->nField); |
| 60719 | + if( pNew ){ |
| 60720 | + memcpy(pNew->aColl, pOrig->aColl, pOrig->nField*sizeof(pNew->aColl[0])); |
| 60721 | + memcpy(pNew->aSortOrder, pOrig->aSortOrder, pOrig->nField); |
| 60702 | 60722 | pOp->p4type = P4_KEYINFO; |
| 60703 | 60723 | }else{ |
| 60704 | 60724 | p->db->mallocFailed = 1; |
| 60705 | 60725 | pOp->p4type = P4_NOTUSED; |
| 60706 | 60726 | } |
| | @@ -62947,11 +62967,10 @@ |
| 62947 | 62967 | ){ |
| 62948 | 62968 | u32 d1; /* Offset into aKey[] of next data element */ |
| 62949 | 62969 | u32 idx1; /* Offset into aKey[] of next header element */ |
| 62950 | 62970 | u32 szHdr1; /* Number of bytes in header */ |
| 62951 | 62971 | int i = 0; |
| 62952 | | - int nField; |
| 62953 | 62972 | int rc = 0; |
| 62954 | 62973 | const unsigned char *aKey1 = (const unsigned char *)pKey1; |
| 62955 | 62974 | KeyInfo *pKeyInfo; |
| 62956 | 62975 | Mem mem1; |
| 62957 | 62976 | |
| | @@ -62970,32 +62989,42 @@ |
| 62970 | 62989 | */ |
| 62971 | 62990 | /* mem1.u.i = 0; // not needed, here to silence compiler warning */ |
| 62972 | 62991 | |
| 62973 | 62992 | idx1 = getVarint32(aKey1, szHdr1); |
| 62974 | 62993 | d1 = szHdr1; |
| 62975 | | - nField = pKeyInfo->nField; |
| 62994 | + assert( pKeyInfo->nField+1>=pPKey2->nField ); |
| 62976 | 62995 | assert( pKeyInfo->aSortOrder!=0 ); |
| 62977 | 62996 | while( idx1<szHdr1 && i<pPKey2->nField ){ |
| 62978 | 62997 | u32 serial_type1; |
| 62979 | 62998 | |
| 62980 | 62999 | /* Read the serial types for the next element in each key. */ |
| 62981 | 63000 | idx1 += getVarint32( aKey1+idx1, serial_type1 ); |
| 62982 | | - if( d1+sqlite3VdbeSerialTypeLen(serial_type1)>(u32)nKey1 ) break; |
| 63001 | + |
| 63002 | + /* Verify that there is enough key space remaining to avoid |
| 63003 | + ** a buffer overread. The "d1+serial_type1+2" subexpression will |
| 63004 | + ** always be greater than or equal to the amount of required key space. |
| 63005 | + ** Use that approximation to avoid the more expensive call to |
| 63006 | + ** sqlite3VdbeSerialTypeLen() in the common case. |
| 63007 | + */ |
| 63008 | + if( d1+serial_type1+2>(u32)nKey1 |
| 63009 | + && d1+sqlite3VdbeSerialTypeLen(serial_type1)>(u32)nKey1 |
| 63010 | + ){ |
| 63011 | + break; |
| 63012 | + } |
| 62983 | 63013 | |
| 62984 | 63014 | /* Extract the values to be compared. |
| 62985 | 63015 | */ |
| 62986 | 63016 | d1 += sqlite3VdbeSerialGet(&aKey1[d1], serial_type1, &mem1); |
| 62987 | 63017 | |
| 62988 | 63018 | /* Do the comparison |
| 62989 | 63019 | */ |
| 62990 | | - rc = sqlite3MemCompare(&mem1, &pPKey2->aMem[i], |
| 62991 | | - i<nField ? pKeyInfo->aColl[i] : 0); |
| 63020 | + rc = sqlite3MemCompare(&mem1, &pPKey2->aMem[i], pKeyInfo->aColl[i]); |
| 62992 | 63021 | if( rc!=0 ){ |
| 62993 | 63022 | assert( mem1.zMalloc==0 ); /* See comment below */ |
| 62994 | 63023 | |
| 62995 | 63024 | /* Invert the result if we are using DESC sort order. */ |
| 62996 | | - if( i<nField && pKeyInfo->aSortOrder[i] ){ |
| 63025 | + if( pKeyInfo->aSortOrder[i] ){ |
| 62997 | 63026 | rc = -rc; |
| 62998 | 63027 | } |
| 62999 | 63028 | |
| 63000 | 63029 | /* If the PREFIX_SEARCH flag is set and all fields except the final |
| 63001 | 63030 | ** rowid field were equal, then clear the PREFIX_SEARCH flag and set |
| | @@ -65475,11 +65504,11 @@ |
| 65475 | 65504 | u8 resetSchemaOnFault = 0; /* Reset schema after an error if positive */ |
| 65476 | 65505 | u8 encoding = ENC(db); /* The database encoding */ |
| 65477 | 65506 | int iCompare = 0; /* Result of last OP_Compare operation */ |
| 65478 | 65507 | unsigned nVmStep = 0; /* Number of virtual machine steps */ |
| 65479 | 65508 | #ifndef SQLITE_OMIT_PROGRESS_CALLBACK |
| 65480 | | - unsigned nProgressLimit; /* Invoke xProgress() when nVmStep reaches this */ |
| 65509 | + unsigned nProgressLimit = 0;/* Invoke xProgress() when nVmStep reaches this */ |
| 65481 | 65510 | #endif |
| 65482 | 65511 | Mem *aMem = p->aMem; /* Copy of p->aMem */ |
| 65483 | 65512 | Mem *pIn1 = 0; /* 1st input operand */ |
| 65484 | 65513 | Mem *pIn2 = 0; /* 2nd input operand */ |
| 65485 | 65514 | Mem *pIn3 = 0; /* 3rd input operand */ |
| | @@ -77063,14 +77092,13 @@ |
| 77063 | 77092 | #endif |
| 77064 | 77093 | |
| 77065 | 77094 | switch( pExpr->op ){ |
| 77066 | 77095 | case TK_IN: { |
| 77067 | 77096 | char affinity; /* Affinity of the LHS of the IN */ |
| 77068 | | - KeyInfo keyInfo; /* Keyinfo for the generated table */ |
| 77069 | | - static u8 sortOrder = 0; /* Fake aSortOrder for keyInfo */ |
| 77070 | 77097 | int addr; /* Address of OP_OpenEphemeral instruction */ |
| 77071 | 77098 | Expr *pLeft = pExpr->pLeft; /* the LHS of the IN operator */ |
| 77099 | + KeyInfo *pKeyInfo = 0; /* Key information */ |
| 77072 | 77100 | |
| 77073 | 77101 | if( rMayHaveNull ){ |
| 77074 | 77102 | sqlite3VdbeAddOp2(v, OP_Null, 0, rMayHaveNull); |
| 77075 | 77103 | } |
| 77076 | 77104 | |
| | @@ -77090,13 +77118,11 @@ |
| 77090 | 77118 | ** is used. |
| 77091 | 77119 | */ |
| 77092 | 77120 | pExpr->iTable = pParse->nTab++; |
| 77093 | 77121 | addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, !isRowid); |
| 77094 | 77122 | if( rMayHaveNull==0 ) sqlite3VdbeChangeP5(v, BTREE_UNORDERED); |
| 77095 | | - memset(&keyInfo, 0, sizeof(keyInfo)); |
| 77096 | | - keyInfo.nField = 1; |
| 77097 | | - keyInfo.aSortOrder = &sortOrder; |
| 77123 | + pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, 1); |
| 77098 | 77124 | |
| 77099 | 77125 | if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
| 77100 | 77126 | /* Case 1: expr IN (SELECT ...) |
| 77101 | 77127 | ** |
| 77102 | 77128 | ** Generate code to write the results of the select into the temporary |
| | @@ -77109,15 +77135,16 @@ |
| 77109 | 77135 | sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable); |
| 77110 | 77136 | dest.affSdst = (u8)affinity; |
| 77111 | 77137 | assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable ); |
| 77112 | 77138 | pExpr->x.pSelect->iLimit = 0; |
| 77113 | 77139 | if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){ |
| 77140 | + sqlite3DbFree(pParse->db, pKeyInfo); |
| 77114 | 77141 | return 0; |
| 77115 | 77142 | } |
| 77116 | 77143 | pEList = pExpr->x.pSelect->pEList; |
| 77117 | | - if( ALWAYS(pEList!=0 && pEList->nExpr>0) ){ |
| 77118 | | - keyInfo.aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, |
| 77144 | + if( pKeyInfo && ALWAYS(pEList!=0 && pEList->nExpr>0) ){ |
| 77145 | + pKeyInfo->aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, |
| 77119 | 77146 | pEList->a[0].pExpr); |
| 77120 | 77147 | } |
| 77121 | 77148 | }else if( ALWAYS(pExpr->x.pList!=0) ){ |
| 77122 | 77149 | /* Case 2: expr IN (exprlist) |
| 77123 | 77150 | ** |
| | @@ -77132,12 +77159,13 @@ |
| 77132 | 77159 | int r1, r2, r3; |
| 77133 | 77160 | |
| 77134 | 77161 | if( !affinity ){ |
| 77135 | 77162 | affinity = SQLITE_AFF_NONE; |
| 77136 | 77163 | } |
| 77137 | | - keyInfo.aColl[0] = sqlite3ExprCollSeq(pParse, pExpr->pLeft); |
| 77138 | | - keyInfo.aSortOrder = &sortOrder; |
| 77164 | + if( pKeyInfo ){ |
| 77165 | + pKeyInfo->aColl[0] = sqlite3ExprCollSeq(pParse, pExpr->pLeft); |
| 77166 | + } |
| 77139 | 77167 | |
| 77140 | 77168 | /* Loop through each expression in <exprlist>. */ |
| 77141 | 77169 | r1 = sqlite3GetTempReg(pParse); |
| 77142 | 77170 | r2 = sqlite3GetTempReg(pParse); |
| 77143 | 77171 | sqlite3VdbeAddOp2(v, OP_Null, 0, r2); |
| | @@ -77172,12 +77200,12 @@ |
| 77172 | 77200 | } |
| 77173 | 77201 | } |
| 77174 | 77202 | sqlite3ReleaseTempReg(pParse, r1); |
| 77175 | 77203 | sqlite3ReleaseTempReg(pParse, r2); |
| 77176 | 77204 | } |
| 77177 | | - if( !isRowid ){ |
| 77178 | | - sqlite3VdbeChangeP4(v, addr, (void *)&keyInfo, P4_KEYINFO); |
| 77205 | + if( pKeyInfo ){ |
| 77206 | + sqlite3VdbeChangeP4(v, addr, (void *)pKeyInfo, P4_KEYINFO_HANDOFF); |
| 77179 | 77207 | } |
| 77180 | 77208 | break; |
| 77181 | 77209 | } |
| 77182 | 77210 | |
| 77183 | 77211 | case TK_EXISTS: |
| | @@ -86192,29 +86220,24 @@ |
| 86192 | 86220 | ** the error. |
| 86193 | 86221 | */ |
| 86194 | 86222 | SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){ |
| 86195 | 86223 | int i; |
| 86196 | 86224 | int nCol = pIdx->nColumn; |
| 86197 | | - int nBytes = sizeof(KeyInfo) + (nCol-1)*sizeof(CollSeq*) + nCol; |
| 86198 | | - sqlite3 *db = pParse->db; |
| 86199 | | - KeyInfo *pKey = (KeyInfo *)sqlite3DbMallocZero(db, nBytes); |
| 86200 | | - |
| 86201 | | - if( pKey ){ |
| 86202 | | - pKey->db = pParse->db; |
| 86203 | | - pKey->aSortOrder = (u8 *)&(pKey->aColl[nCol]); |
| 86204 | | - assert( &pKey->aSortOrder[nCol]==&(((u8 *)pKey)[nBytes]) ); |
| 86225 | + KeyInfo *pKey; |
| 86226 | + |
| 86227 | + pKey = sqlite3KeyInfoAlloc(pParse->db, nCol); |
| 86228 | + if( pKey ){ |
| 86205 | 86229 | for(i=0; i<nCol; i++){ |
| 86206 | 86230 | char *zColl = pIdx->azColl[i]; |
| 86207 | 86231 | assert( zColl ); |
| 86208 | 86232 | pKey->aColl[i] = sqlite3LocateCollSeq(pParse, zColl); |
| 86209 | 86233 | pKey->aSortOrder[i] = pIdx->aSortOrder[i]; |
| 86210 | 86234 | } |
| 86211 | | - pKey->nField = (u16)nCol; |
| 86212 | 86235 | } |
| 86213 | 86236 | |
| 86214 | 86237 | if( pParse->nErr ){ |
| 86215 | | - sqlite3DbFree(db, pKey); |
| 86238 | + sqlite3DbFree(pParse->db, pKey); |
| 86216 | 86239 | pKey = 0; |
| 86217 | 86240 | } |
| 86218 | 86241 | return pKey; |
| 86219 | 86242 | } |
| 86220 | 86243 | |
| | @@ -97148,10 +97171,29 @@ |
| 97148 | 97171 | */ |
| 97149 | 97172 | if( pOrderBy==0 && p->iLimit ){ |
| 97150 | 97173 | sqlite3VdbeAddOp3(v, OP_IfZero, p->iLimit, iBreak, -1); |
| 97151 | 97174 | } |
| 97152 | 97175 | } |
| 97176 | + |
| 97177 | +/* |
| 97178 | +** Allocate a KeyInfo object sufficient for an index of N columns. |
| 97179 | +** |
| 97180 | +** Actually, always allocate one extra column for the rowid at the end |
| 97181 | +** of the index. So the KeyInfo returned will have space sufficient for |
| 97182 | +** N+1 columns. |
| 97183 | +*/ |
| 97184 | +SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N){ |
| 97185 | + KeyInfo *p = sqlite3DbMallocZero(db, |
| 97186 | + sizeof(KeyInfo) + (N+1)*(sizeof(CollSeq*)+1)); |
| 97187 | + if( p ){ |
| 97188 | + p->aSortOrder = (u8*)&p->aColl[N+1]; |
| 97189 | + p->nField = (u16)N; |
| 97190 | + p->enc = ENC(db); |
| 97191 | + p->db = db; |
| 97192 | + } |
| 97193 | + return p; |
| 97194 | +} |
| 97153 | 97195 | |
| 97154 | 97196 | /* |
| 97155 | 97197 | ** Given an expression list, generate a KeyInfo structure that records |
| 97156 | 97198 | ** the collating sequence for each expression in that expression list. |
| 97157 | 97199 | ** |
| | @@ -97165,29 +97207,23 @@ |
| 97165 | 97207 | ** function is responsible for seeing that this structure is eventually |
| 97166 | 97208 | ** freed. Add the KeyInfo structure to the P4 field of an opcode using |
| 97167 | 97209 | ** P4_KEYINFO_HANDOFF is the usual way of dealing with this. |
| 97168 | 97210 | */ |
| 97169 | 97211 | static KeyInfo *keyInfoFromExprList(Parse *pParse, ExprList *pList){ |
| 97170 | | - sqlite3 *db = pParse->db; |
| 97171 | 97212 | int nExpr; |
| 97172 | 97213 | KeyInfo *pInfo; |
| 97173 | 97214 | struct ExprList_item *pItem; |
| 97215 | + sqlite3 *db = pParse->db; |
| 97174 | 97216 | int i; |
| 97175 | 97217 | |
| 97176 | 97218 | nExpr = pList->nExpr; |
| 97177 | | - pInfo = sqlite3DbMallocZero(db, sizeof(*pInfo) + nExpr*(sizeof(CollSeq*)+1) ); |
| 97219 | + pInfo = sqlite3KeyInfoAlloc(db, nExpr); |
| 97178 | 97220 | if( pInfo ){ |
| 97179 | | - pInfo->aSortOrder = (u8*)&pInfo->aColl[nExpr]; |
| 97180 | | - pInfo->nField = (u16)nExpr; |
| 97181 | | - pInfo->enc = ENC(db); |
| 97182 | | - pInfo->db = db; |
| 97183 | 97221 | for(i=0, pItem=pList->a; i<nExpr; i++, pItem++){ |
| 97184 | 97222 | CollSeq *pColl; |
| 97185 | 97223 | pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr); |
| 97186 | | - if( !pColl ){ |
| 97187 | | - pColl = db->pDfltColl; |
| 97188 | | - } |
| 97224 | + if( !pColl ) pColl = db->pDfltColl; |
| 97189 | 97225 | pInfo->aColl[i] = pColl; |
| 97190 | 97226 | pInfo->aSortOrder[i] = pItem->sortOrder; |
| 97191 | 97227 | } |
| 97192 | 97228 | } |
| 97193 | 97229 | return pInfo; |
| | @@ -98289,27 +98325,21 @@ |
| 98289 | 98325 | CollSeq **apColl; /* For looping through pKeyInfo->aColl[] */ |
| 98290 | 98326 | int nCol; /* Number of columns in result set */ |
| 98291 | 98327 | |
| 98292 | 98328 | assert( p->pRightmost==p ); |
| 98293 | 98329 | nCol = p->pEList->nExpr; |
| 98294 | | - pKeyInfo = sqlite3DbMallocZero(db, |
| 98295 | | - sizeof(*pKeyInfo)+nCol*(sizeof(CollSeq*) + 1)); |
| 98330 | + pKeyInfo = sqlite3KeyInfoAlloc(db, nCol); |
| 98296 | 98331 | if( !pKeyInfo ){ |
| 98297 | 98332 | rc = SQLITE_NOMEM; |
| 98298 | 98333 | goto multi_select_end; |
| 98299 | 98334 | } |
| 98300 | | - |
| 98301 | | - pKeyInfo->enc = ENC(db); |
| 98302 | | - pKeyInfo->nField = (u16)nCol; |
| 98303 | | - |
| 98304 | 98335 | for(i=0, apColl=pKeyInfo->aColl; i<nCol; i++, apColl++){ |
| 98305 | 98336 | *apColl = multiSelectCollSeq(pParse, p, i); |
| 98306 | 98337 | if( 0==*apColl ){ |
| 98307 | 98338 | *apColl = db->pDfltColl; |
| 98308 | 98339 | } |
| 98309 | 98340 | } |
| 98310 | | - pKeyInfo->aSortOrder = (u8*)apColl; |
| 98311 | 98341 | |
| 98312 | 98342 | for(pLoop=p; pLoop; pLoop=pLoop->pPrior){ |
| 98313 | 98343 | for(i=0; i<2; i++){ |
| 98314 | 98344 | int addr = pLoop->addrOpenEphm[i]; |
| 98315 | 98345 | if( addr<0 ){ |
| | @@ -98674,16 +98704,12 @@ |
| 98674 | 98704 | struct ExprList_item *pItem; |
| 98675 | 98705 | for(i=0, pItem=pOrderBy->a; i<nOrderBy; i++, pItem++){ |
| 98676 | 98706 | assert( pItem->iOrderByCol>0 && pItem->iOrderByCol<=p->pEList->nExpr ); |
| 98677 | 98707 | aPermute[i] = pItem->iOrderByCol - 1; |
| 98678 | 98708 | } |
| 98679 | | - pKeyMerge = |
| 98680 | | - sqlite3DbMallocRaw(db, sizeof(*pKeyMerge)+nOrderBy*(sizeof(CollSeq*)+1)); |
| 98709 | + pKeyMerge = sqlite3KeyInfoAlloc(db, nOrderBy); |
| 98681 | 98710 | if( pKeyMerge ){ |
| 98682 | | - pKeyMerge->aSortOrder = (u8*)&pKeyMerge->aColl[nOrderBy]; |
| 98683 | | - pKeyMerge->nField = (u16)nOrderBy; |
| 98684 | | - pKeyMerge->enc = ENC(db); |
| 98685 | 98711 | for(i=0; i<nOrderBy; i++){ |
| 98686 | 98712 | CollSeq *pColl; |
| 98687 | 98713 | Expr *pTerm = pOrderBy->a[i].pExpr; |
| 98688 | 98714 | if( pTerm->flags & EP_Collate ){ |
| 98689 | 98715 | pColl = sqlite3ExprCollSeq(pParse, pTerm); |
| | @@ -98716,16 +98742,12 @@ |
| 98716 | 98742 | int nExpr = p->pEList->nExpr; |
| 98717 | 98743 | assert( nOrderBy>=nExpr || db->mallocFailed ); |
| 98718 | 98744 | regPrev = pParse->nMem+1; |
| 98719 | 98745 | pParse->nMem += nExpr+1; |
| 98720 | 98746 | sqlite3VdbeAddOp2(v, OP_Integer, 0, regPrev); |
| 98721 | | - pKeyDup = sqlite3DbMallocZero(db, |
| 98722 | | - sizeof(*pKeyDup) + nExpr*(sizeof(CollSeq*)+1) ); |
| 98747 | + pKeyDup = sqlite3KeyInfoAlloc(db, nExpr); |
| 98723 | 98748 | if( pKeyDup ){ |
| 98724 | | - pKeyDup->aSortOrder = (u8*)&pKeyDup->aColl[nExpr]; |
| 98725 | | - pKeyDup->nField = (u16)nExpr; |
| 98726 | | - pKeyDup->enc = ENC(db); |
| 98727 | 98749 | for(i=0; i<nExpr; i++){ |
| 98728 | 98750 | pKeyDup->aColl[i] = multiSelectCollSeq(pParse, p, i); |
| 98729 | 98751 | pKeyDup->aSortOrder[i] = 0; |
| 98730 | 98752 | } |
| 98731 | 98753 | } |
| | @@ -99987,14 +100009,16 @@ |
| 99987 | 100009 | ** and/or pParse->db->mallocFailed. |
| 99988 | 100010 | */ |
| 99989 | 100011 | static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){ |
| 99990 | 100012 | Walker w; |
| 99991 | 100013 | memset(&w, 0, sizeof(w)); |
| 99992 | | - w.xSelectCallback = convertCompoundSelectToSubquery; |
| 99993 | 100014 | w.xExprCallback = exprWalkNoop; |
| 99994 | 100015 | w.pParse = pParse; |
| 99995 | | - sqlite3WalkSelect(&w, pSelect); |
| 100016 | + if( pParse->hasCompound ){ |
| 100017 | + w.xSelectCallback = convertCompoundSelectToSubquery; |
| 100018 | + sqlite3WalkSelect(&w, pSelect); |
| 100019 | + } |
| 99996 | 100020 | w.xSelectCallback = selectExpander; |
| 99997 | 100021 | sqlite3WalkSelect(&w, pSelect); |
| 99998 | 100022 | } |
| 99999 | 100023 | |
| 100000 | 100024 | |
| | @@ -113204,10 +113228,11 @@ |
| 113204 | 113228 | case 114: /* select ::= select multiselect_op oneselect */ |
| 113205 | 113229 | { |
| 113206 | 113230 | if( yymsp[0].minor.yy159 ){ |
| 113207 | 113231 | yymsp[0].minor.yy159->op = (u8)yymsp[-1].minor.yy392; |
| 113208 | 113232 | yymsp[0].minor.yy159->pPrior = yymsp[-2].minor.yy159; |
| 113233 | + if( yymsp[-1].minor.yy392!=TK_ALL ) pParse->hasCompound = 1; |
| 113209 | 113234 | }else{ |
| 113210 | 113235 | sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy159); |
| 113211 | 113236 | } |
| 113212 | 113237 | yygotominor.yy159 = yymsp[0].minor.yy159; |
| 113213 | 113238 | } |
| 113214 | 113239 | |