some code change
This commit is contained in:
parent
ac5d09baa9
commit
598843f699
|
@ -306,6 +306,7 @@ typedef enum ENodeType {
|
|||
QUERY_NODE_DESCRIBE_STMT,
|
||||
QUERY_NODE_RESET_QUERY_CACHE_STMT,
|
||||
QUERY_NODE_COMPACT_DATABASE_STMT,
|
||||
QUERY_NODE_COMPACT_VGROUPS_STMT,
|
||||
QUERY_NODE_CREATE_FUNCTION_STMT,
|
||||
QUERY_NODE_DROP_FUNCTION_STMT,
|
||||
QUERY_NODE_CREATE_STREAM_STMT,
|
||||
|
|
|
@ -92,202 +92,202 @@
|
|||
#define TK_TRIM 74
|
||||
#define TK_S3MIGRATE 75
|
||||
#define TK_COMPACT 76
|
||||
#define TK_IF 77
|
||||
#define TK_NOT 78
|
||||
#define TK_EXISTS 79
|
||||
#define TK_BUFFER 80
|
||||
#define TK_CACHEMODEL 81
|
||||
#define TK_CACHESIZE 82
|
||||
#define TK_COMP 83
|
||||
#define TK_DURATION 84
|
||||
#define TK_NK_VARIABLE 85
|
||||
#define TK_MAXROWS 86
|
||||
#define TK_MINROWS 87
|
||||
#define TK_KEEP 88
|
||||
#define TK_PAGES 89
|
||||
#define TK_PAGESIZE 90
|
||||
#define TK_TSDB_PAGESIZE 91
|
||||
#define TK_PRECISION 92
|
||||
#define TK_REPLICA 93
|
||||
#define TK_VGROUPS 94
|
||||
#define TK_SINGLE_STABLE 95
|
||||
#define TK_RETENTIONS 96
|
||||
#define TK_SCHEMALESS 97
|
||||
#define TK_WAL_LEVEL 98
|
||||
#define TK_WAL_FSYNC_PERIOD 99
|
||||
#define TK_WAL_RETENTION_PERIOD 100
|
||||
#define TK_WAL_RETENTION_SIZE 101
|
||||
#define TK_WAL_ROLL_PERIOD 102
|
||||
#define TK_WAL_SEGMENT_SIZE 103
|
||||
#define TK_STT_TRIGGER 104
|
||||
#define TK_TABLE_PREFIX 105
|
||||
#define TK_TABLE_SUFFIX 106
|
||||
#define TK_S3_CHUNKPAGES 107
|
||||
#define TK_S3_KEEPLOCAL 108
|
||||
#define TK_S3_COMPACT 109
|
||||
#define TK_KEEP_TIME_OFFSET 110
|
||||
#define TK_ENCRYPT_ALGORITHM 111
|
||||
#define TK_NK_COLON 112
|
||||
#define TK_BWLIMIT 113
|
||||
#define TK_START 114
|
||||
#define TK_TIMESTAMP 115
|
||||
#define TK_END 116
|
||||
#define TK_TABLE 117
|
||||
#define TK_NK_LP 118
|
||||
#define TK_NK_RP 119
|
||||
#define TK_USING 120
|
||||
#define TK_FILE 121
|
||||
#define TK_STABLE 122
|
||||
#define TK_COLUMN 123
|
||||
#define TK_MODIFY 124
|
||||
#define TK_RENAME 125
|
||||
#define TK_TAG 126
|
||||
#define TK_SET 127
|
||||
#define TK_NK_EQ 128
|
||||
#define TK_TAGS 129
|
||||
#define TK_BOOL 130
|
||||
#define TK_TINYINT 131
|
||||
#define TK_SMALLINT 132
|
||||
#define TK_INT 133
|
||||
#define TK_INTEGER 134
|
||||
#define TK_BIGINT 135
|
||||
#define TK_FLOAT 136
|
||||
#define TK_DOUBLE 137
|
||||
#define TK_BINARY 138
|
||||
#define TK_NCHAR 139
|
||||
#define TK_UNSIGNED 140
|
||||
#define TK_JSON 141
|
||||
#define TK_VARCHAR 142
|
||||
#define TK_MEDIUMBLOB 143
|
||||
#define TK_BLOB 144
|
||||
#define TK_VARBINARY 145
|
||||
#define TK_GEOMETRY 146
|
||||
#define TK_DECIMAL 147
|
||||
#define TK_COMMENT 148
|
||||
#define TK_MAX_DELAY 149
|
||||
#define TK_WATERMARK 150
|
||||
#define TK_ROLLUP 151
|
||||
#define TK_TTL 152
|
||||
#define TK_SMA 153
|
||||
#define TK_DELETE_MARK 154
|
||||
#define TK_FIRST 155
|
||||
#define TK_LAST 156
|
||||
#define TK_SHOW 157
|
||||
#define TK_FULL 158
|
||||
#define TK_PRIVILEGES 159
|
||||
#define TK_DATABASES 160
|
||||
#define TK_TABLES 161
|
||||
#define TK_STABLES 162
|
||||
#define TK_MNODES 163
|
||||
#define TK_QNODES 164
|
||||
#define TK_ARBGROUPS 165
|
||||
#define TK_FUNCTIONS 166
|
||||
#define TK_INDEXES 167
|
||||
#define TK_ACCOUNTS 168
|
||||
#define TK_APPS 169
|
||||
#define TK_CONNECTIONS 170
|
||||
#define TK_LICENCES 171
|
||||
#define TK_GRANTS 172
|
||||
#define TK_LOGS 173
|
||||
#define TK_MACHINES 174
|
||||
#define TK_ENCRYPTIONS 175
|
||||
#define TK_QUERIES 176
|
||||
#define TK_SCORES 177
|
||||
#define TK_TOPICS 178
|
||||
#define TK_VARIABLES 179
|
||||
#define TK_BNODES 180
|
||||
#define TK_SNODES 181
|
||||
#define TK_TRANSACTIONS 182
|
||||
#define TK_DISTRIBUTED 183
|
||||
#define TK_CONSUMERS 184
|
||||
#define TK_SUBSCRIPTIONS 185
|
||||
#define TK_VNODES 186
|
||||
#define TK_ALIVE 187
|
||||
#define TK_VIEWS 188
|
||||
#define TK_VIEW 189
|
||||
#define TK_COMPACTS 190
|
||||
#define TK_NORMAL 191
|
||||
#define TK_CHILD 192
|
||||
#define TK_LIKE 193
|
||||
#define TK_TBNAME 194
|
||||
#define TK_QTAGS 195
|
||||
#define TK_AS 196
|
||||
#define TK_SYSTEM 197
|
||||
#define TK_TSMA 198
|
||||
#define TK_INTERVAL 199
|
||||
#define TK_RECURSIVE 200
|
||||
#define TK_TSMAS 201
|
||||
#define TK_FUNCTION 202
|
||||
#define TK_INDEX 203
|
||||
#define TK_COUNT 204
|
||||
#define TK_LAST_ROW 205
|
||||
#define TK_META 206
|
||||
#define TK_ONLY 207
|
||||
#define TK_TOPIC 208
|
||||
#define TK_CONSUMER 209
|
||||
#define TK_GROUP 210
|
||||
#define TK_DESC 211
|
||||
#define TK_DESCRIBE 212
|
||||
#define TK_RESET 213
|
||||
#define TK_QUERY 214
|
||||
#define TK_CACHE 215
|
||||
#define TK_EXPLAIN 216
|
||||
#define TK_ANALYZE 217
|
||||
#define TK_VERBOSE 218
|
||||
#define TK_NK_BOOL 219
|
||||
#define TK_RATIO 220
|
||||
#define TK_NK_FLOAT 221
|
||||
#define TK_OUTPUTTYPE 222
|
||||
#define TK_AGGREGATE 223
|
||||
#define TK_BUFSIZE 224
|
||||
#define TK_LANGUAGE 225
|
||||
#define TK_REPLACE 226
|
||||
#define TK_STREAM 227
|
||||
#define TK_INTO 228
|
||||
#define TK_PAUSE 229
|
||||
#define TK_RESUME 230
|
||||
#define TK_PRIMARY 231
|
||||
#define TK_KEY 232
|
||||
#define TK_TRIGGER 233
|
||||
#define TK_AT_ONCE 234
|
||||
#define TK_WINDOW_CLOSE 235
|
||||
#define TK_IGNORE 236
|
||||
#define TK_EXPIRED 237
|
||||
#define TK_FILL_HISTORY 238
|
||||
#define TK_SUBTABLE 239
|
||||
#define TK_UNTREATED 240
|
||||
#define TK_KILL 241
|
||||
#define TK_CONNECTION 242
|
||||
#define TK_TRANSACTION 243
|
||||
#define TK_BALANCE 244
|
||||
#define TK_VGROUP 245
|
||||
#define TK_LEADER 246
|
||||
#define TK_MERGE 247
|
||||
#define TK_REDISTRIBUTE 248
|
||||
#define TK_SPLIT 249
|
||||
#define TK_DELETE 250
|
||||
#define TK_INSERT 251
|
||||
#define TK_NK_BIN 252
|
||||
#define TK_NK_HEX 253
|
||||
#define TK_NULL 254
|
||||
#define TK_NK_QUESTION 255
|
||||
#define TK_NK_ALIAS 256
|
||||
#define TK_NK_ARROW 257
|
||||
#define TK_ROWTS 258
|
||||
#define TK_QSTART 259
|
||||
#define TK_QEND 260
|
||||
#define TK_QDURATION 261
|
||||
#define TK_WSTART 262
|
||||
#define TK_WEND 263
|
||||
#define TK_WDURATION 264
|
||||
#define TK_IROWTS 265
|
||||
#define TK_ISFILLED 266
|
||||
#define TK_FLOW 267
|
||||
#define TK_FHIGH 268
|
||||
#define TK_FROWTS 269
|
||||
#define TK_CAST 270
|
||||
#define TK_POSITION 271
|
||||
#define TK_IN 272
|
||||
#define TK_VGROUPS 77
|
||||
#define TK_IN 78
|
||||
#define TK_NK_LP 79
|
||||
#define TK_NK_RP 80
|
||||
#define TK_IF 81
|
||||
#define TK_NOT 82
|
||||
#define TK_EXISTS 83
|
||||
#define TK_BUFFER 84
|
||||
#define TK_CACHEMODEL 85
|
||||
#define TK_CACHESIZE 86
|
||||
#define TK_COMP 87
|
||||
#define TK_DURATION 88
|
||||
#define TK_NK_VARIABLE 89
|
||||
#define TK_MAXROWS 90
|
||||
#define TK_MINROWS 91
|
||||
#define TK_KEEP 92
|
||||
#define TK_PAGES 93
|
||||
#define TK_PAGESIZE 94
|
||||
#define TK_TSDB_PAGESIZE 95
|
||||
#define TK_PRECISION 96
|
||||
#define TK_REPLICA 97
|
||||
#define TK_SINGLE_STABLE 98
|
||||
#define TK_RETENTIONS 99
|
||||
#define TK_SCHEMALESS 100
|
||||
#define TK_WAL_LEVEL 101
|
||||
#define TK_WAL_FSYNC_PERIOD 102
|
||||
#define TK_WAL_RETENTION_PERIOD 103
|
||||
#define TK_WAL_RETENTION_SIZE 104
|
||||
#define TK_WAL_ROLL_PERIOD 105
|
||||
#define TK_WAL_SEGMENT_SIZE 106
|
||||
#define TK_STT_TRIGGER 107
|
||||
#define TK_TABLE_PREFIX 108
|
||||
#define TK_TABLE_SUFFIX 109
|
||||
#define TK_S3_CHUNKPAGES 110
|
||||
#define TK_S3_KEEPLOCAL 111
|
||||
#define TK_S3_COMPACT 112
|
||||
#define TK_KEEP_TIME_OFFSET 113
|
||||
#define TK_ENCRYPT_ALGORITHM 114
|
||||
#define TK_NK_COLON 115
|
||||
#define TK_BWLIMIT 116
|
||||
#define TK_START 117
|
||||
#define TK_TIMESTAMP 118
|
||||
#define TK_END 119
|
||||
#define TK_TABLE 120
|
||||
#define TK_USING 121
|
||||
#define TK_FILE 122
|
||||
#define TK_STABLE 123
|
||||
#define TK_COLUMN 124
|
||||
#define TK_MODIFY 125
|
||||
#define TK_RENAME 126
|
||||
#define TK_TAG 127
|
||||
#define TK_SET 128
|
||||
#define TK_NK_EQ 129
|
||||
#define TK_TAGS 130
|
||||
#define TK_BOOL 131
|
||||
#define TK_TINYINT 132
|
||||
#define TK_SMALLINT 133
|
||||
#define TK_INT 134
|
||||
#define TK_INTEGER 135
|
||||
#define TK_BIGINT 136
|
||||
#define TK_FLOAT 137
|
||||
#define TK_DOUBLE 138
|
||||
#define TK_BINARY 139
|
||||
#define TK_NCHAR 140
|
||||
#define TK_UNSIGNED 141
|
||||
#define TK_JSON 142
|
||||
#define TK_VARCHAR 143
|
||||
#define TK_MEDIUMBLOB 144
|
||||
#define TK_BLOB 145
|
||||
#define TK_VARBINARY 146
|
||||
#define TK_GEOMETRY 147
|
||||
#define TK_DECIMAL 148
|
||||
#define TK_COMMENT 149
|
||||
#define TK_MAX_DELAY 150
|
||||
#define TK_WATERMARK 151
|
||||
#define TK_ROLLUP 152
|
||||
#define TK_TTL 153
|
||||
#define TK_SMA 154
|
||||
#define TK_DELETE_MARK 155
|
||||
#define TK_FIRST 156
|
||||
#define TK_LAST 157
|
||||
#define TK_SHOW 158
|
||||
#define TK_FULL 159
|
||||
#define TK_PRIVILEGES 160
|
||||
#define TK_DATABASES 161
|
||||
#define TK_TABLES 162
|
||||
#define TK_STABLES 163
|
||||
#define TK_MNODES 164
|
||||
#define TK_QNODES 165
|
||||
#define TK_ARBGROUPS 166
|
||||
#define TK_FUNCTIONS 167
|
||||
#define TK_INDEXES 168
|
||||
#define TK_ACCOUNTS 169
|
||||
#define TK_APPS 170
|
||||
#define TK_CONNECTIONS 171
|
||||
#define TK_LICENCES 172
|
||||
#define TK_GRANTS 173
|
||||
#define TK_LOGS 174
|
||||
#define TK_MACHINES 175
|
||||
#define TK_ENCRYPTIONS 176
|
||||
#define TK_QUERIES 177
|
||||
#define TK_SCORES 178
|
||||
#define TK_TOPICS 179
|
||||
#define TK_VARIABLES 180
|
||||
#define TK_BNODES 181
|
||||
#define TK_SNODES 182
|
||||
#define TK_TRANSACTIONS 183
|
||||
#define TK_DISTRIBUTED 184
|
||||
#define TK_CONSUMERS 185
|
||||
#define TK_SUBSCRIPTIONS 186
|
||||
#define TK_VNODES 187
|
||||
#define TK_ALIVE 188
|
||||
#define TK_VIEWS 189
|
||||
#define TK_VIEW 190
|
||||
#define TK_COMPACTS 191
|
||||
#define TK_NORMAL 192
|
||||
#define TK_CHILD 193
|
||||
#define TK_LIKE 194
|
||||
#define TK_TBNAME 195
|
||||
#define TK_QTAGS 196
|
||||
#define TK_AS 197
|
||||
#define TK_SYSTEM 198
|
||||
#define TK_TSMA 199
|
||||
#define TK_INTERVAL 200
|
||||
#define TK_RECURSIVE 201
|
||||
#define TK_TSMAS 202
|
||||
#define TK_FUNCTION 203
|
||||
#define TK_INDEX 204
|
||||
#define TK_COUNT 205
|
||||
#define TK_LAST_ROW 206
|
||||
#define TK_META 207
|
||||
#define TK_ONLY 208
|
||||
#define TK_TOPIC 209
|
||||
#define TK_CONSUMER 210
|
||||
#define TK_GROUP 211
|
||||
#define TK_DESC 212
|
||||
#define TK_DESCRIBE 213
|
||||
#define TK_RESET 214
|
||||
#define TK_QUERY 215
|
||||
#define TK_CACHE 216
|
||||
#define TK_EXPLAIN 217
|
||||
#define TK_ANALYZE 218
|
||||
#define TK_VERBOSE 219
|
||||
#define TK_NK_BOOL 220
|
||||
#define TK_RATIO 221
|
||||
#define TK_NK_FLOAT 222
|
||||
#define TK_OUTPUTTYPE 223
|
||||
#define TK_AGGREGATE 224
|
||||
#define TK_BUFSIZE 225
|
||||
#define TK_LANGUAGE 226
|
||||
#define TK_REPLACE 227
|
||||
#define TK_STREAM 228
|
||||
#define TK_INTO 229
|
||||
#define TK_PAUSE 230
|
||||
#define TK_RESUME 231
|
||||
#define TK_PRIMARY 232
|
||||
#define TK_KEY 233
|
||||
#define TK_TRIGGER 234
|
||||
#define TK_AT_ONCE 235
|
||||
#define TK_WINDOW_CLOSE 236
|
||||
#define TK_IGNORE 237
|
||||
#define TK_EXPIRED 238
|
||||
#define TK_FILL_HISTORY 239
|
||||
#define TK_SUBTABLE 240
|
||||
#define TK_UNTREATED 241
|
||||
#define TK_KILL 242
|
||||
#define TK_CONNECTION 243
|
||||
#define TK_TRANSACTION 244
|
||||
#define TK_BALANCE 245
|
||||
#define TK_VGROUP 246
|
||||
#define TK_LEADER 247
|
||||
#define TK_MERGE 248
|
||||
#define TK_REDISTRIBUTE 249
|
||||
#define TK_SPLIT 250
|
||||
#define TK_DELETE 251
|
||||
#define TK_INSERT 252
|
||||
#define TK_NK_BIN 253
|
||||
#define TK_NK_HEX 254
|
||||
#define TK_NULL 255
|
||||
#define TK_NK_QUESTION 256
|
||||
#define TK_NK_ALIAS 257
|
||||
#define TK_NK_ARROW 258
|
||||
#define TK_ROWTS 259
|
||||
#define TK_QSTART 260
|
||||
#define TK_QEND 261
|
||||
#define TK_QDURATION 262
|
||||
#define TK_WSTART 263
|
||||
#define TK_WEND 264
|
||||
#define TK_WDURATION 265
|
||||
#define TK_IROWTS 266
|
||||
#define TK_ISFILLED 267
|
||||
#define TK_FLOW 268
|
||||
#define TK_FHIGH 269
|
||||
#define TK_FROWTS 270
|
||||
#define TK_CAST 271
|
||||
#define TK_POSITION 272
|
||||
#define TK_FOR 273
|
||||
#define TK_NOW 274
|
||||
#define TK_TODAY 275
|
||||
|
|
|
@ -158,6 +158,13 @@ typedef struct SCompactDatabaseStmt {
|
|||
SNode* pEnd;
|
||||
} SCompactDatabaseStmt;
|
||||
|
||||
typedef struct SCompactVgroupsStmt {
|
||||
ENodeType type;
|
||||
SNodeList* vgidList;
|
||||
SNode* pStart;
|
||||
SNode* pEnd;
|
||||
} SCompactVgroupsStmt;
|
||||
|
||||
typedef struct STableOptions {
|
||||
ENodeType type;
|
||||
bool commentNull;
|
||||
|
|
|
@ -183,6 +183,8 @@ const char* nodesNodeName(ENodeType type) {
|
|||
return "DescribeStmt";
|
||||
case QUERY_NODE_COMPACT_DATABASE_STMT:
|
||||
return "CompactDatabaseStmt";
|
||||
case QUERY_NODE_COMPACT_VGROUPS_STMT:
|
||||
return "CompactVgroupsStmt";
|
||||
case QUERY_NODE_CREATE_STREAM_STMT:
|
||||
return "CreateStreamStmt";
|
||||
case QUERY_NODE_DROP_STREAM_STMT:
|
||||
|
@ -6936,6 +6938,21 @@ static int32_t jsonToCompactDatabaseStmt(const SJson* pJson, void* pObj) {
|
|||
return tjsonGetStringValue(pJson, jkCompactDatabaseStmtDbName, pNode->dbName);
|
||||
}
|
||||
|
||||
static int32_t compactVgroupsStmtToJson(const void* pObj, SJson* pJson) {
|
||||
const SCompactVgroupsStmt* pNode = (const SCompactVgroupsStmt*)pObj;
|
||||
// TODO
|
||||
ASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t jsonToCompactVgroupsStmt(const SJson* pJson, void* pObj) {
|
||||
// TODO
|
||||
ASSERT(0);
|
||||
SCompactVgroupsStmt* pNode = (SCompactVgroupsStmt*)pObj;
|
||||
return 0;
|
||||
// tjsonGetStringValue(pJson, jkCompactDatabaseStmtDbName, pNode->dbName);
|
||||
}
|
||||
|
||||
static const char* jkCreateStreamStmtStreamName = "StreamName";
|
||||
static const char* jkCreateStreamStmtTargetDbName = "TargetDbName";
|
||||
static const char* jkCreateStreamStmtTargetTabName = "TargetTabName";
|
||||
|
@ -7817,6 +7834,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
|
|||
return describeStmtToJson(pObj, pJson);
|
||||
case QUERY_NODE_COMPACT_DATABASE_STMT:
|
||||
return compactDatabaseStmtToJson(pObj, pJson);
|
||||
case QUERY_NODE_COMPACT_VGROUPS_STMT:
|
||||
return compactVgroupsStmtToJson(pObj, pJson);
|
||||
case QUERY_NODE_CREATE_STREAM_STMT:
|
||||
return createStreamStmtToJson(pObj, pJson);
|
||||
case QUERY_NODE_DROP_STREAM_STMT:
|
||||
|
@ -8179,6 +8198,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
|
|||
return jsonToDescribeStmt(pJson, pObj);
|
||||
case QUERY_NODE_COMPACT_DATABASE_STMT:
|
||||
return jsonToCompactDatabaseStmt(pJson, pObj);
|
||||
case QUERY_NODE_COMPACT_VGROUPS_STMT:
|
||||
return jsonToCompactVgroupsStmt(pJson, pObj);
|
||||
case QUERY_NODE_CREATE_STREAM_STMT:
|
||||
return jsonToCreateStreamStmt(pJson, pObj);
|
||||
case QUERY_NODE_DROP_STREAM_STMT:
|
||||
|
|
|
@ -512,6 +512,8 @@ int32_t nodesMakeNode(ENodeType type, SNode** ppNodeOut) {
|
|||
code = makeNode(type, sizeof(SNode), &pNode); break;
|
||||
case QUERY_NODE_COMPACT_DATABASE_STMT:
|
||||
code = makeNode(type, sizeof(SCompactDatabaseStmt), &pNode); break;
|
||||
case QUERY_NODE_COMPACT_VGROUPS_STMT:
|
||||
code = makeNode(type, sizeof(SCompactVgroupsStmt), &pNode); break;
|
||||
case QUERY_NODE_CREATE_FUNCTION_STMT:
|
||||
code = makeNode(type, sizeof(SCreateFunctionStmt), &pNode); break;
|
||||
case QUERY_NODE_DROP_FUNCTION_STMT:
|
||||
|
@ -1239,6 +1241,13 @@ void nodesDestroyNode(SNode* pNode) {
|
|||
nodesDestroyNode(pStmt->pEnd);
|
||||
break;
|
||||
}
|
||||
case QUERY_NODE_COMPACT_VGROUPS_STMT: {
|
||||
SCompactVgroupsStmt* pStmt = (SCompactVgroupsStmt*)pNode;
|
||||
nodesDestroyList(pStmt->vgidList);
|
||||
nodesDestroyNode(pStmt->pStart);
|
||||
nodesDestroyNode(pStmt->pEnd);
|
||||
break;
|
||||
}
|
||||
case QUERY_NODE_CREATE_FUNCTION_STMT: // no pointer field
|
||||
case QUERY_NODE_DROP_FUNCTION_STMT: // no pointer field
|
||||
break;
|
||||
|
|
|
@ -198,6 +198,7 @@ SNode* createFlushDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName);
|
|||
SNode* createTrimDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName, int32_t maxSpeed);
|
||||
SNode* createS3MigrateDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName);
|
||||
SNode* createCompactStmt(SAstCreateContext* pCxt, SToken* pDbName, SNode* pStart, SNode* pEnd);
|
||||
SNode* createCompactVgroupsStmt(SAstCreateContext* pCxt, SNodeList* vgidList, SNode* pStart, SNode* pEnd);
|
||||
SNode* createDefaultTableOptions(SAstCreateContext* pCxt);
|
||||
SNode* createAlterTableOptions(SAstCreateContext* pCxt);
|
||||
SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, void* pVal);
|
||||
|
|
|
@ -229,6 +229,7 @@ cmd ::= FLUSH DATABASE db_name(A).
|
|||
cmd ::= TRIM DATABASE db_name(A) speed_opt(B). { pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &A, B); }
|
||||
cmd ::= S3MIGRATE DATABASE db_name(A). { pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &A); }
|
||||
cmd ::= COMPACT DATABASE db_name(A) start_opt(B) end_opt(C). { pCxt->pRootNode = createCompactStmt(pCxt, &A, B, C); }
|
||||
cmd ::= COMPACT VGROUPS IN NK_LP integer_list(A) NK_RP start_opt(B) end_opt(C). { pCxt->pRootNode = createCompactVgroupsStmt(pCxt, A, B, C); }
|
||||
|
||||
%type not_exists_opt { bool }
|
||||
%destructor not_exists_opt { }
|
||||
|
|
|
@ -2115,6 +2115,21 @@ _err:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SNode* createCompactVgroupsStmt(SAstCreateContext* pCxt, SNodeList* vgidList, SNode* pStart, SNode* pEnd) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
SCompactVgroupsStmt* pStmt = NULL;
|
||||
pCxt->errCode = nodesMakeNode(QUERY_NODE_COMPACT_VGROUPS_STMT, (SNode**)&pStmt);
|
||||
CHECK_MAKE_NODE(pStmt);
|
||||
pStmt->vgidList = vgidList;
|
||||
pStmt->pStart = pStart;
|
||||
pStmt->pEnd = pEnd;
|
||||
return (SNode*)pStmt;
|
||||
_err:
|
||||
nodesDestroyNode(pStart);
|
||||
nodesDestroyNode(pEnd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SNode* createDefaultTableOptions(SAstCreateContext* pCxt) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
STableOptions* pOptions = NULL;
|
||||
|
|
|
@ -858,6 +858,13 @@ static int32_t collectMetaKeyFromCompactDatabase(SCollectMetaKeyCxt* pCxt, SComp
|
|||
return reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache);
|
||||
}
|
||||
|
||||
static int32_t collectMetaKeyFromCompactVgroups(SCollectMetaKeyCxt* pCxt, SCompactVgroupsStmt* pStmt) {
|
||||
// TODO
|
||||
ASSERT(0);
|
||||
return 0;
|
||||
// return reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache);
|
||||
}
|
||||
|
||||
static int32_t collectMetaKeyFromGrant(SCollectMetaKeyCxt* pCxt, SGrantStmt* pStmt) {
|
||||
if ('\0' == pStmt->tabName[0]) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -983,6 +990,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
|
|||
return collectMetaKeyFromDescribe(pCxt, (SDescribeStmt*)pStmt);
|
||||
case QUERY_NODE_COMPACT_DATABASE_STMT:
|
||||
return collectMetaKeyFromCompactDatabase(pCxt, (SCompactDatabaseStmt*)pStmt);
|
||||
case QUERY_NODE_COMPACT_VGROUPS_STMT:
|
||||
return collectMetaKeyFromCompactVgroups(pCxt, (SCompactVgroupsStmt*)pStmt);
|
||||
case QUERY_NODE_CREATE_STREAM_STMT:
|
||||
return collectMetaKeyFromCreateStream(pCxt, (SCreateStreamStmt*)pStmt);
|
||||
case QUERY_NODE_GRANT_STMT:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue