diff --git a/include/common/tmsg.h b/include/common/tmsg.h index ed3cf4792a..a410ad390e 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2821,8 +2821,10 @@ typedef struct { char* tagName; int8_t isNull; int8_t tagType; + int8_t tagFree; uint32_t nTagVal; uint8_t* pTagVal; + SArray* pTagArray; // TSDB_ALTER_TABLE_UPDATE_OPTIONS int8_t updateTTL; int32_t newTTL; @@ -3920,11 +3922,11 @@ int32_t tSerializeSMqAskEpReq(void* buf, int32_t bufLen, SMqAskEpReq* pReq); int32_t tDeserializeSMqAskEpReq(void* buf, int32_t bufLen, SMqAskEpReq* pReq); int32_t tSerializeSMqHbReq(void* buf, int32_t bufLen, SMqHbReq* pReq); int32_t tDeserializeSMqHbReq(void* buf, int32_t bufLen, SMqHbReq* pReq); -int32_t tDeatroySMqHbReq(SMqHbReq* pReq); +void tDestroySMqHbReq(SMqHbReq* pReq); int32_t tSerializeSMqHbRsp(void* buf, int32_t bufLen, SMqHbRsp* pRsp); int32_t tDeserializeSMqHbRsp(void* buf, int32_t bufLen, SMqHbRsp* pRsp); -int32_t tDeatroySMqHbRsp(SMqHbRsp* pRsp); +void tDestroySMqHbRsp(SMqHbRsp* pRsp); int32_t tSerializeSMqSeekReq(void* buf, int32_t bufLen, SMqSeekReq* pReq); int32_t tDeserializeSMqSeekReq(void* buf, int32_t bufLen, SMqSeekReq* pReq); diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 286470f965..6aab52c9dc 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -249,140 +249,142 @@ #define TK_SPLIT 231 #define TK_DELETE 232 #define TK_INSERT 233 -#define TK_NULL 234 -#define TK_NK_QUESTION 235 -#define TK_NK_ALIAS 236 -#define TK_NK_ARROW 237 -#define TK_ROWTS 238 -#define TK_QSTART 239 -#define TK_QEND 240 -#define TK_QDURATION 241 -#define TK_WSTART 242 -#define TK_WEND 243 -#define TK_WDURATION 244 -#define TK_IROWTS 245 -#define TK_ISFILLED 246 -#define TK_CAST 247 -#define TK_NOW 248 -#define TK_TODAY 249 -#define TK_TIMEZONE 250 -#define TK_CLIENT_VERSION 251 -#define TK_SERVER_VERSION 252 -#define TK_SERVER_STATUS 253 -#define TK_CURRENT_USER 254 -#define TK_CASE 255 -#define TK_WHEN 256 -#define TK_THEN 257 -#define TK_ELSE 258 -#define TK_BETWEEN 259 -#define TK_IS 260 -#define TK_NK_LT 261 -#define TK_NK_GT 262 -#define TK_NK_LE 263 -#define TK_NK_GE 264 -#define TK_NK_NE 265 -#define TK_MATCH 266 -#define TK_NMATCH 267 -#define TK_CONTAINS 268 -#define TK_IN 269 -#define TK_JOIN 270 -#define TK_INNER 271 -#define TK_LEFT 272 -#define TK_RIGHT 273 -#define TK_OUTER 274 -#define TK_SEMI 275 -#define TK_ANTI 276 -#define TK_ASOF 277 -#define TK_WINDOW 278 -#define TK_WINDOW_OFFSET 279 -#define TK_JLIMIT 280 -#define TK_SELECT 281 -#define TK_NK_HINT 282 -#define TK_DISTINCT 283 -#define TK_WHERE 284 -#define TK_PARTITION 285 -#define TK_BY 286 -#define TK_SESSION 287 -#define TK_STATE_WINDOW 288 -#define TK_EVENT_WINDOW 289 -#define TK_COUNT_WINDOW 290 -#define TK_SLIDING 291 -#define TK_FILL 292 -#define TK_VALUE 293 -#define TK_VALUE_F 294 -#define TK_NONE 295 -#define TK_PREV 296 -#define TK_NULL_F 297 -#define TK_LINEAR 298 -#define TK_NEXT 299 -#define TK_HAVING 300 -#define TK_RANGE 301 -#define TK_EVERY 302 -#define TK_ORDER 303 -#define TK_SLIMIT 304 -#define TK_SOFFSET 305 -#define TK_LIMIT 306 -#define TK_OFFSET 307 -#define TK_ASC 308 -#define TK_NULLS 309 -#define TK_ABORT 310 -#define TK_AFTER 311 -#define TK_ATTACH 312 -#define TK_BEFORE 313 -#define TK_BEGIN 314 -#define TK_BITAND 315 -#define TK_BITNOT 316 -#define TK_BITOR 317 -#define TK_BLOCKS 318 -#define TK_CHANGE 319 -#define TK_COMMA 320 -#define TK_CONCAT 321 -#define TK_CONFLICT 322 -#define TK_COPY 323 -#define TK_DEFERRED 324 -#define TK_DELIMITERS 325 -#define TK_DETACH 326 -#define TK_DIVIDE 327 -#define TK_DOT 328 -#define TK_EACH 329 -#define TK_FAIL 330 -#define TK_FILE 331 -#define TK_FOR 332 -#define TK_GLOB 333 -#define TK_ID 334 -#define TK_IMMEDIATE 335 -#define TK_IMPORT 336 -#define TK_INITIALLY 337 -#define TK_INSTEAD 338 -#define TK_ISNULL 339 -#define TK_KEY 340 -#define TK_MODULES 341 -#define TK_NK_BITNOT 342 -#define TK_NK_SEMI 343 -#define TK_NOTNULL 344 -#define TK_OF 345 -#define TK_PLUS 346 -#define TK_PRIVILEGE 347 -#define TK_RAISE 348 -#define TK_RESTRICT 349 -#define TK_ROW 350 -#define TK_STAR 351 -#define TK_STATEMENT 352 -#define TK_STRICT 353 -#define TK_STRING 354 -#define TK_TIMES 355 -#define TK_VALUES 356 -#define TK_VARIABLE 357 -#define TK_WAL 358 +#define TK_NK_BIN 234 +#define TK_NK_HEX 235 +#define TK_NULL 236 +#define TK_NK_QUESTION 237 +#define TK_NK_ALIAS 238 +#define TK_NK_ARROW 239 +#define TK_ROWTS 240 +#define TK_QSTART 241 +#define TK_QEND 242 +#define TK_QDURATION 243 +#define TK_WSTART 244 +#define TK_WEND 245 +#define TK_WDURATION 246 +#define TK_IROWTS 247 +#define TK_ISFILLED 248 +#define TK_CAST 249 +#define TK_NOW 250 +#define TK_TODAY 251 +#define TK_TIMEZONE 252 +#define TK_CLIENT_VERSION 253 +#define TK_SERVER_VERSION 254 +#define TK_SERVER_STATUS 255 +#define TK_CURRENT_USER 256 +#define TK_CASE 257 +#define TK_WHEN 258 +#define TK_THEN 259 +#define TK_ELSE 260 +#define TK_BETWEEN 261 +#define TK_IS 262 +#define TK_NK_LT 263 +#define TK_NK_GT 264 +#define TK_NK_LE 265 +#define TK_NK_GE 266 +#define TK_NK_NE 267 +#define TK_MATCH 268 +#define TK_NMATCH 269 +#define TK_CONTAINS 270 +#define TK_IN 271 +#define TK_JOIN 272 +#define TK_INNER 273 +#define TK_LEFT 274 +#define TK_RIGHT 275 +#define TK_OUTER 276 +#define TK_SEMI 277 +#define TK_ANTI 278 +#define TK_ASOF 279 +#define TK_WINDOW 280 +#define TK_WINDOW_OFFSET 281 +#define TK_JLIMIT 282 +#define TK_SELECT 283 +#define TK_NK_HINT 284 +#define TK_DISTINCT 285 +#define TK_WHERE 286 +#define TK_PARTITION 287 +#define TK_BY 288 +#define TK_SESSION 289 +#define TK_STATE_WINDOW 290 +#define TK_EVENT_WINDOW 291 +#define TK_COUNT_WINDOW 292 +#define TK_SLIDING 293 +#define TK_FILL 294 +#define TK_VALUE 295 +#define TK_VALUE_F 296 +#define TK_NONE 297 +#define TK_PREV 298 +#define TK_NULL_F 299 +#define TK_LINEAR 300 +#define TK_NEXT 301 +#define TK_HAVING 302 +#define TK_RANGE 303 +#define TK_EVERY 304 +#define TK_ORDER 305 +#define TK_SLIMIT 306 +#define TK_SOFFSET 307 +#define TK_LIMIT 308 +#define TK_OFFSET 309 +#define TK_ASC 310 +#define TK_NULLS 311 +#define TK_ABORT 312 +#define TK_AFTER 313 +#define TK_ATTACH 314 +#define TK_BEFORE 315 +#define TK_BEGIN 316 +#define TK_BITAND 317 +#define TK_BITNOT 318 +#define TK_BITOR 319 +#define TK_BLOCKS 320 +#define TK_CHANGE 321 +#define TK_COMMA 322 +#define TK_CONCAT 323 +#define TK_CONFLICT 324 +#define TK_COPY 325 +#define TK_DEFERRED 326 +#define TK_DELIMITERS 327 +#define TK_DETACH 328 +#define TK_DIVIDE 329 +#define TK_DOT 330 +#define TK_EACH 331 +#define TK_FAIL 332 +#define TK_FILE 333 +#define TK_FOR 334 +#define TK_GLOB 335 +#define TK_ID 336 +#define TK_IMMEDIATE 337 +#define TK_IMPORT 338 +#define TK_INITIALLY 339 +#define TK_INSTEAD 340 +#define TK_ISNULL 341 +#define TK_KEY 342 +#define TK_MODULES 343 +#define TK_NK_BITNOT 344 +#define TK_NK_SEMI 345 +#define TK_NOTNULL 346 +#define TK_OF 347 +#define TK_PLUS 348 +#define TK_PRIVILEGE 349 +#define TK_RAISE 350 +#define TK_RESTRICT 351 +#define TK_ROW 352 +#define TK_STAR 353 +#define TK_STATEMENT 354 +#define TK_STRICT 355 +#define TK_STRING 356 +#define TK_TIMES 357 +#define TK_VALUES 358 +#define TK_VARIABLE 359 +#define TK_WAL 360 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 #define TK_NK_ILLEGAL 602 -#define TK_NK_HEX 603 // hex number 0x123 +// #define TK_NK_HEX 603 // hex number 0x123 #define TK_NK_OCT 604 // oct number -#define TK_NK_BIN 605 // bin format data 0b111 +// #define TK_NK_BIN 605 // bin format data 0b111 #define TK_BATCH_SCAN 606 #define TK_NO_BATCH_SCAN 607 #define TK_SORT_FOR_GROUP 608 diff --git a/include/common/tvariant.h b/include/common/tvariant.h index 66b7302f4e..6f88eba027 100644 --- a/include/common/tvariant.h +++ b/include/common/tvariant.h @@ -44,6 +44,11 @@ int32_t toDoubleEx(const char *z, int32_t n, uint32_t type, double *value); int32_t toInteger(const char *z, int32_t n, int32_t base, int64_t *value); int32_t toUInteger(const char *z, int32_t n, int32_t base, uint64_t *value); +/** + * non floating point integers +*/ +int32_t toIntegerPure(const char *z, int32_t n, int32_t base, int64_t *value); + void taosVariantCreateFromBinary(SVariant *pVar, const char *pz, size_t len, uint32_t type); void taosVariantDestroy(SVariant *pV); diff --git a/include/libs/executor/storageapi.h b/include/libs/executor/storageapi.h index 3433f98d38..04bc839d51 100644 --- a/include/libs/executor/storageapi.h +++ b/include/libs/executor/storageapi.h @@ -36,6 +36,7 @@ extern "C" { #define CACHESCAN_RETRIEVE_LAST_ROW 0x4 #define CACHESCAN_RETRIEVE_LAST 0x8 +#define META_READER_LOCK 0x0 #define META_READER_NOLOCK 0x1 #define STREAM_STATE_BUFF_HASH 1 diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index fb1882e472..c8fc556150 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -779,7 +779,7 @@ int32_t tmqHbCb(void* param, SDataBuf* pMsg, int32_t code) { taosWUnLockLatch(&tmq->lock); taosReleaseRef(tmqMgmt.rsetId, refId); } - tDeatroySMqHbRsp(&rsp); + tDestroySMqHbRsp(&rsp); taosMemoryFree(pMsg->pData); taosMemoryFree(pMsg->pEpSet); } @@ -861,7 +861,7 @@ void tmqSendHbReq(void* param, void* tmrId) { asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo); OVER: - tDeatroySMqHbReq(&req); + tDestroySMqHbReq(&req); taosTmrReset(tmqSendHbReq, DEFAULT_HEARTBEAT_INTERVAL, param, tmqMgmt.timer, &tmq->hbLiveTimer); taosReleaseRef(tmqMgmt.rsetId, refId); } diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 9138d7c983..5b154df8a3 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -6201,9 +6201,8 @@ int32_t tDeserializeSMqAskEpReq(void *buf, int32_t bufLen, SMqAskEpReq *pReq) { return 0; } -int32_t tDeatroySMqHbRsp(SMqHbRsp *pRsp) { +void tDestroySMqHbRsp(SMqHbRsp *pRsp) { taosArrayDestroy(pRsp->topicPrivileges); - return 0; } int32_t tSerializeSMqHbRsp(void *buf, int32_t bufLen, SMqHbRsp *pRsp) { @@ -6250,13 +6249,12 @@ int32_t tDeserializeSMqHbRsp(void *buf, int32_t bufLen, SMqHbRsp *pRsp) { return 0; } -int32_t tDeatroySMqHbReq(SMqHbReq *pReq) { +void tDestroySMqHbReq(SMqHbReq *pReq) { for (int i = 0; i < taosArrayGetSize(pReq->topics); i++) { TopicOffsetRows *vgs = taosArrayGet(pReq->topics, i); if (vgs) taosArrayDestroy(vgs->offsetRows); } taosArrayDestroy(pReq->topics); - return 0; } int32_t tSerializeSMqHbReq(void *buf, int32_t bufLen, SMqHbReq *pReq) { diff --git a/source/common/src/ttypes.c b/source/common/src/ttypes.c index 8827ddc811..57bc875fce 100644 --- a/source/common/src/ttypes.c +++ b/source/common/src/ttypes.c @@ -34,7 +34,7 @@ const int32_t TYPE_BYTES[21] = { INT_BYTES, // TSDB_DATA_TYPE_UINT sizeof(uint64_t), // TSDB_DATA_TYPE_UBIGINT TSDB_MAX_JSON_TAG_LEN, // TSDB_DATA_TYPE_JSON - TSDB_MAX_TAGS_LEN, // TSDB_DATA_TYPE_VARBINARY: placeholder, not implemented + sizeof(VarDataOffsetT), // TSDB_DATA_TYPE_VARBINARY TSDB_MAX_TAGS_LEN, // TSDB_DATA_TYPE_DECIMAL: placeholder, not implemented TSDB_MAX_TAGS_LEN, // TSDB_DATA_TYPE_BLOB: placeholder, not implemented TSDB_MAX_TAGS_LEN, // TSDB_DATA_TYPE_MEDIUMBLOB: placeholder, not implemented diff --git a/source/common/src/tvariant.c b/source/common/src/tvariant.c index dd5e8240b9..ae2c8c0c14 100644 --- a/source/common/src/tvariant.c +++ b/source/common/src/tvariant.c @@ -19,7 +19,7 @@ #include "ttokendef.h" #include "tvariant.h" -int32_t parseBinaryUInteger(const char *z, int32_t n, uint64_t *value) { +static int32_t parseBinaryUInteger(const char *z, int32_t n, uint64_t *value) { // skip head 0b const char *p = z + 2; int32_t l = n - 2; @@ -45,7 +45,7 @@ int32_t parseBinaryUInteger(const char *z, int32_t n, uint64_t *value) { return TSDB_CODE_SUCCESS; } -int32_t parseSignAndUInteger(const char *z, int32_t n, bool *is_neg, uint64_t *value) { +static int32_t parseSignAndUInteger(const char *z, int32_t n, bool *is_neg, uint64_t *value, bool parseFloat) { // parse sign bool has_sign = false; if (z[0] == '-') { @@ -65,8 +65,7 @@ int32_t parseSignAndUInteger(const char *z, int32_t n, bool *is_neg, uint64_t *v } errno = 0; - char *endPtr = NULL; - bool parsed = false; + char *endPtr = NULL; if (z[0] == '0' && n > 2) { if (z[1] == 'b' || z[1] == 'B') { // paring as binary @@ -76,44 +75,87 @@ int32_t parseSignAndUInteger(const char *z, int32_t n, bool *is_neg, uint64_t *v if (z[1] == 'x' || z[1] == 'X') { // parsing as hex *value = taosStr2UInt64(z, &endPtr, 16); - parsed = true; + if (errno == ERANGE || errno == EINVAL || endPtr - z != n) { + return TSDB_CODE_FAILED; + } + return TSDB_CODE_SUCCESS; } } - if (!parsed) { + if (parseFloat) { // parsing as double double val = taosStr2Double(z, &endPtr); + if (errno == ERANGE || errno == EINVAL || endPtr - z != n) { + return TSDB_CODE_FAILED; + } if (val > UINT64_MAX) { + errno = ERANGE; return TSDB_CODE_FAILED; } *value = round(val); - } - - if (errno == ERANGE || errno == EINVAL || endPtr - z != n) { - return TSDB_CODE_FAILED; - } - return TSDB_CODE_SUCCESS; -} - - -int32_t toDoubleEx(const char *z, int32_t n, uint32_t type, double* value) { - if (n == 0) { - *value = 0; return TSDB_CODE_SUCCESS; } + return TSDB_CODE_FAILED; +} + +int32_t toDoubleEx(const char *z, int32_t n, uint32_t type, double *value) { + if (n == 0) { + errno = EINVAL; + return TSDB_CODE_FAILED; + } + errno = 0; - char* endPtr = NULL; - *value = taosStr2Double(z, &endPtr); + char *endPtr = NULL; + *value = taosStr2Double(z, &endPtr); // 0x already converted here + if (errno == ERANGE || errno == EINVAL) return TSDB_CODE_FAILED; + if (endPtr - z == n) return TSDB_CODE_SUCCESS; - if (errno == ERANGE || errno == EINVAL) { - return TSDB_CODE_FAILED; + if (type == TK_NK_BIN || type == TK_NK_STRING) { + bool is_neg = false; + uint64_t uv = 0; + if (TSDB_CODE_SUCCESS == parseSignAndUInteger(z, n, &is_neg, &uv, false)) { + *value = is_neg ? -(double)uv : uv; + return TSDB_CODE_SUCCESS; + } } - if (endPtr - z != n) { - return TSDB_CODE_FAILED; + return TSDB_CODE_FAILED; +} + +int32_t toIntegerPure(const char *z, int32_t n, int32_t base, int64_t *value) { + errno = 0; + + char *endPtr = NULL; + *value = taosStr2Int64(z, &endPtr, base); + if (endPtr - z == n) { + if (errno == ERANGE || errno == EINVAL) { + return TSDB_CODE_FAILED; + } + return TSDB_CODE_SUCCESS; } - return TSDB_CODE_SUCCESS; + + bool is_neg = false; + uint64_t uv = 0; + int32_t code = parseSignAndUInteger(z, n, &is_neg, &uv, false); // support 0b/0x + if (code == TSDB_CODE_SUCCESS) { + if (is_neg) { + if (uv > 1ull + INT64_MAX) { + *value = INT64_MIN; + return TSDB_CODE_FAILED; + } else { + *value = -(int64_t)uv; + } + } else { + if (uv > INT64_MAX) { + *value = INT64_MAX; + return TSDB_CODE_FAILED; + } + *value = uv; + } + } + + return code; } int32_t toIntegerEx(const char *z, int32_t n, uint32_t type, int64_t *value) { @@ -144,8 +186,8 @@ int32_t toIntegerEx(const char *z, int32_t n, uint32_t type, int64_t *value) { } if (n == 0) { - *value = 0; - return TSDB_CODE_SUCCESS; + errno = EINVAL; + return TSDB_CODE_FAILED; } // 1. try to parse as integer @@ -190,7 +232,7 @@ int32_t toIntegerEx(const char *z, int32_t n, uint32_t type, int64_t *value) { // 2. parse as other bool is_neg = false; uint64_t uv = 0; - int32_t code = parseSignAndUInteger(z, n, &is_neg, &uv); + int32_t code = parseSignAndUInteger(z, n, &is_neg, &uv, true); if (code == TSDB_CODE_SUCCESS) { // truncate into int64 if (is_neg) { @@ -198,7 +240,7 @@ int32_t toIntegerEx(const char *z, int32_t n, uint32_t type, int64_t *value) { *value = INT64_MIN; return TSDB_CODE_FAILED; } else { - *value = -uv; + *value = -(int64_t)uv; } } else { if (uv > INT64_MAX) { @@ -216,9 +258,6 @@ int32_t toUIntegerEx(const char *z, int32_t n, uint32_t type, uint64_t *value) { errno = 0; char *endPtr = NULL; const char *p = z; - while (*p == ' ') { - p++; - } switch (type) { case TK_NK_INTEGER: { *value = taosStr2UInt64(p, &endPtr, 10); @@ -246,24 +285,22 @@ int32_t toUIntegerEx(const char *z, int32_t n, uint32_t type, uint64_t *value) { } if (n == 0) { - *value = 0; - return TSDB_CODE_SUCCESS; + errno = EINVAL; + return TSDB_CODE_FAILED; } // 1. parse as integer *value = taosStr2UInt64(p, &endPtr, 10); - if (*p == '-' && *value) { - return TSDB_CODE_FAILED; - } + if (endPtr - z == n) { - if (errno == ERANGE || errno == EINVAL) { + if (errno == ERANGE || errno == EINVAL || (*p == '-' && *value)) { return TSDB_CODE_FAILED; } return TSDB_CODE_SUCCESS; } else if (errno == 0 && *endPtr == '.') { const char *s = endPtr + 1; const char *end = z + n; - bool pure = true; + bool pure = true; while (s < end) { if (*s < '0' || *s > '9') { pure = false; @@ -275,13 +312,16 @@ int32_t toUIntegerEx(const char *z, int32_t n, uint32_t type, uint64_t *value) { if (endPtr + 1 < end && endPtr[1] > '4' && *value < UINT64_MAX) { (*value)++; } + if (*p == '-' && *value) { + return TSDB_CODE_FAILED; + } return TSDB_CODE_SUCCESS; } } - // 2. parse as other + // 2. parse as other bool is_neg = false; - int32_t code = parseSignAndUInteger(z, n, &is_neg, value); + int32_t code = parseSignAndUInteger(z, n, &is_neg, value, true); if (is_neg) { if (TSDB_CODE_SUCCESS == code && 0 == *value) { return TSDB_CODE_SUCCESS; diff --git a/source/dnode/mnode/impl/inc/mndConsumer.h b/source/dnode/mnode/impl/inc/mndConsumer.h index 8c89ddc825..5184ad0eca 100644 --- a/source/dnode/mnode/impl/inc/mndConsumer.h +++ b/source/dnode/mnode/impl/inc/mndConsumer.h @@ -24,27 +24,22 @@ extern "C" { enum { MQ_CONSUMER_STATUS_REBALANCE = 1, -// MQ_CONSUMER_STATUS__MODIFY_IN_REB, // this value is not used anymore MQ_CONSUMER_STATUS_READY, MQ_CONSUMER_STATUS_LOST, -// MQ_CONSUMER_STATUS__LOST_IN_REB, // this value is not used anymore -// MQ_CONSUMER_STATUS__LOST_REBD, -};\ +}; int32_t mndInitConsumer(SMnode *pMnode); void mndCleanupConsumer(SMnode *pMnode); -void mndDropConsumerFromSdb(SMnode *pMnode, int64_t consumerId, SRpcHandleInfo* info); +void mndSendConsumerMsg(SMnode *pMnode, int64_t consumerId, uint16_t msgType, SRpcHandleInfo* info); SMqConsumerObj *mndAcquireConsumer(SMnode *pMnode, int64_t consumerId); void mndReleaseConsumer(SMnode *pMnode, SMqConsumerObj *pConsumer); -SMqConsumerObj *mndCreateConsumer(int64_t consumerId, const char *cgroup); - SSdbRaw *mndConsumerActionEncode(SMqConsumerObj *pConsumer); SSdbRow *mndConsumerActionDecode(SSdbRaw *pRaw); -int32_t mndSetConsumerCommitLogs(SMnode *pMnode, STrans *pTrans, SMqConsumerObj *pConsumer); -int32_t mndSetConsumerDropLogs(SMnode *pMnode, STrans *pTrans, SMqConsumerObj *pConsumer); +int32_t mndSetConsumerCommitLogs(STrans *pTrans, SMqConsumerObj *pConsumer); +int32_t mndSetConsumerDropLogs(STrans *pTrans, SMqConsumerObj *pConsumer); const char *mndConsumerStatusName(int status); diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 4a092057ce..b98ef31d75 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -149,6 +149,7 @@ typedef enum { CONSUMER_REMOVE_REB, // remove after rebalance CONSUMER_UPDATE_REC, // update after recover CONSUMER_UPDATE_SUB, // update after subscribe req + CONSUMER_INSERT_SUB, } ECsmUpdateType; typedef struct { @@ -556,8 +557,9 @@ typedef struct { int32_t resetOffsetCfg; } SMqConsumerObj; -SMqConsumerObj* tNewSMqConsumerObj(int64_t consumerId, char cgroup[TSDB_CGROUP_LEN]); -void tDeleteSMqConsumerObj(SMqConsumerObj* pConsumer, bool isDeleted); +SMqConsumerObj *tNewSMqConsumerObj(int64_t consumerId, char *cgroup, int8_t updateType, char *topic, SCMSubscribeReq *subscribe); +void tClearSMqConsumerObj(SMqConsumerObj* pConsumer); +void tDeleteSMqConsumerObj(SMqConsumerObj* pConsumer); int32_t tEncodeSMqConsumerObj(void** buf, const SMqConsumerObj* pConsumer); void* tDecodeSMqConsumerObj(const void* buf, SMqConsumerObj* pConsumer, int8_t sver); diff --git a/source/dnode/mnode/impl/inc/mndSubscribe.h b/source/dnode/mnode/impl/inc/mndSubscribe.h index 23b3a7d1fe..eb9902a75c 100644 --- a/source/dnode/mnode/impl/inc/mndSubscribe.h +++ b/source/dnode/mnode/impl/inc/mndSubscribe.h @@ -30,7 +30,7 @@ SMqSubscribeObj *mndAcquireSubscribe(SMnode *pMnode, const char *CGroup, const c SMqSubscribeObj *mndAcquireSubscribeByKey(SMnode *pMnode, const char *key); void mndReleaseSubscribe(SMnode *pMnode, SMqSubscribeObj *pSub); -int32_t mndMakeSubscribeKey(char *key, const char *cgroup, const char *topicName); +void mndMakeSubscribeKey(char *key, const char *cgroup, const char *topicName); int32_t mndDropSubByTopic(SMnode *pMnode, STrans *pTrans, const char *topic); int32_t mndSetDropSubCommitLogs(SMnode *pMnode, STrans *pTrans, SMqSubscribeObj *pSub); diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index f60d8035e3..52671f6b66 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -68,25 +68,27 @@ int32_t mndInitConsumer(SMnode *pMnode) { void mndCleanupConsumer(SMnode *pMnode) {} -void mndDropConsumerFromSdb(SMnode *pMnode, int64_t consumerId, SRpcHandleInfo *info) { - SMqConsumerClearMsg *pClearMsg = rpcMallocCont(sizeof(SMqConsumerClearMsg)); - if (pClearMsg == NULL) { +void mndSendConsumerMsg(SMnode *pMnode, int64_t consumerId, uint16_t msgType, SRpcHandleInfo *info) { + void *msg = rpcMallocCont(sizeof(int64_t)); + if (msg == NULL) { mError("consumer:0x%" PRIx64 " failed to clear consumer due to out of memory. alloc size:%d", consumerId, - (int32_t)sizeof(SMqConsumerClearMsg)); + (int32_t)sizeof(int64_t)); return; } - pClearMsg->consumerId = consumerId; + *(int64_t*)msg = consumerId; SRpcMsg rpcMsg = { - .msgType = TDMT_MND_TMQ_LOST_CONSUMER_CLEAR, - .pCont = pClearMsg, - .contLen = sizeof(SMqConsumerClearMsg), + .msgType = msgType, + .pCont = msg, + .contLen = sizeof(int64_t), .info = *info, }; - mInfo("consumer:0x%" PRIx64 " drop from sdb", consumerId); - tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); - return; + mInfo("mndSendConsumerMsg type:%d consumer:0x%" PRIx64, msgType, consumerId); + int32_t code = tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); + if (code != 0){ + mError("consumer:%"PRId64" send consumer msg:%d error:%d", consumerId, msgType, code); + } } static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode *pMnode, const char *pUser, @@ -148,54 +150,62 @@ FAILED: } static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) { + int32_t code = 0; SMnode *pMnode = pMsg->info.node; SMqConsumerRecoverMsg *pRecoverMsg = pMsg->pCont; + SMqConsumerObj *pConsumerNew = NULL; + STrans *pTrans = NULL; SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, pRecoverMsg->consumerId); if (pConsumer == NULL) { mError("cannot find consumer %" PRId64 " when processing consumer recover msg", pRecoverMsg->consumerId); - return -1; + code = -1; + goto END; } mInfo("receive consumer recover msg, consumer:0x%" PRIx64 " status:%d(%s)", pRecoverMsg->consumerId, pConsumer->status, mndConsumerStatusName(pConsumer->status)); if (pConsumer->status != MQ_CONSUMER_STATUS_LOST) { - mndReleaseConsumer(pMnode, pConsumer); terrno = TSDB_CODE_MND_CONSUMER_NOT_READY; - return -1; + code = -1; + goto END; } - SMqConsumerObj *pConsumerNew = tNewSMqConsumerObj(pConsumer->consumerId, pConsumer->cgroup); - pConsumerNew->updateType = CONSUMER_UPDATE_REC; + pConsumerNew = tNewSMqConsumerObj(pConsumer->consumerId, pConsumer->cgroup, CONSUMER_UPDATE_REC, NULL, NULL); + if (pConsumerNew == NULL){ + code = -1; + goto END; + } - mndReleaseConsumer(pMnode, pConsumer); - - STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TOPIC, pMsg, "recover-csm"); + pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TOPIC, pMsg, "recover-csm"); if (pTrans == NULL) { - goto FAIL; + code = -1; + goto END; } - if (validateTopics(pTrans, pConsumer->assignedTopics, pMnode, pMsg->info.conn.user, false) != 0) { - goto FAIL; + code = validateTopics(pTrans, pConsumer->assignedTopics, pMnode, pMsg->info.conn.user, false); + if (code != 0) { + goto END; } - if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) goto FAIL; - if (mndTransPrepare(pMnode, pTrans) != 0) goto FAIL; - - tDeleteSMqConsumerObj(pConsumerNew, true); + code = mndSetConsumerCommitLogs(pTrans, pConsumerNew); + if (code != 0) { + goto END; + } + code = mndTransPrepare(pMnode, pTrans); +END: + mndReleaseConsumer(pMnode, pConsumer); + tDeleteSMqConsumerObj(pConsumerNew); mndTransDrop(pTrans); - return 0; -FAIL: - tDeleteSMqConsumerObj(pConsumerNew, true); - - mndTransDrop(pTrans); - return -1; + return code; } -// todo check the clear process static int32_t mndProcessConsumerClearMsg(SRpcMsg *pMsg) { + int32_t code = 0; SMnode *pMnode = pMsg->info.node; SMqConsumerClearMsg *pClearMsg = pMsg->pCont; + SMqConsumerObj *pConsumerNew = NULL; + STrans *pTrans = NULL; SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, pClearMsg->consumerId); if (pConsumer == NULL) { @@ -206,33 +216,37 @@ static int32_t mndProcessConsumerClearMsg(SRpcMsg *pMsg) { mInfo("consumer:0x%" PRIx64 " needs to be cleared, status %s", pClearMsg->consumerId, mndConsumerStatusName(pConsumer->status)); - SMqConsumerObj *pConsumerNew = tNewSMqConsumerObj(pConsumer->consumerId, pConsumer->cgroup); + pConsumerNew = tNewSMqConsumerObj(pConsumer->consumerId, pConsumer->cgroup, -1, NULL, NULL); + if (pConsumerNew == NULL){ + code = -1; + goto END; + } - mndReleaseConsumer(pMnode, pConsumer); + pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pMsg, "clear-csm"); + if (pTrans == NULL) { + code = -1; + goto END; + } - STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pMsg, "clear-csm"); - if (pTrans == NULL) goto FAIL; // this is the drop action, not the update action - if (mndSetConsumerDropLogs(pMnode, pTrans, pConsumerNew) != 0) goto FAIL; - if (mndTransPrepare(pMnode, pTrans) != 0) goto FAIL; + code = mndSetConsumerDropLogs(pTrans, pConsumerNew); + if (code != 0) { + goto END; + } - tDeleteSMqConsumerObj(pConsumerNew, true); + code = mndTransPrepare(pMnode, pTrans); +END: + mndReleaseConsumer(pMnode, pConsumer); + tDeleteSMqConsumerObj(pConsumerNew); mndTransDrop(pTrans); - return 0; - -FAIL: - tDeleteSMqConsumerObj(pConsumerNew, true); - - mndTransDrop(pTrans); - return -1; + return code; } static int32_t checkPrivilege(SMnode *pMnode, SMqConsumerObj *pConsumer, SMqHbRsp *rsp, char *user) { rsp->topicPrivileges = taosArrayInit(taosArrayGetSize(pConsumer->currentTopics), sizeof(STopicPrivilege)); if (rsp->topicPrivileges == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return terrno; + return TSDB_CODE_OUT_OF_MEMORY; } for (int32_t i = 0; i < taosArrayGetSize(pConsumer->currentTopics); i++) { char *topic = taosArrayGetP(pConsumer->currentTopics, i); @@ -253,6 +267,47 @@ static int32_t checkPrivilege(SMnode *pMnode, SMqConsumerObj *pConsumer, SMqHbRs return 0; } +static void storeOffsetRows(SMnode *pMnode, SMqHbReq *req, SMqConsumerObj *pConsumer){ + for (int i = 0; i < taosArrayGetSize(req->topics); i++) { + TopicOffsetRows *data = taosArrayGet(req->topics, i); + mInfo("heartbeat report offset rows.%s:%s", pConsumer->cgroup, data->topicName); + + SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, data->topicName); + if (pSub == NULL) { + continue; + } + taosWLockLatch(&pSub->lock); + SMqConsumerEp *pConsumerEp = taosHashGet(pSub->consumerHash, &pConsumer->consumerId, sizeof(int64_t)); + if (pConsumerEp) { + taosArrayDestroy(pConsumerEp->offsetRows); + pConsumerEp->offsetRows = data->offsetRows; + data->offsetRows = NULL; + } + taosWUnLockLatch(&pSub->lock); + + mndReleaseSubscribe(pMnode, pSub); + } +} + +static int32_t buildMqHbRsp(SRpcMsg *pMsg, SMqHbRsp *rsp){ + int32_t tlen = tSerializeSMqHbRsp(NULL, 0, rsp); + if (tlen <= 0){ + return TSDB_CODE_OUT_OF_MEMORY; + } + void *buf = rpcMallocCont(tlen); + if (buf == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + if(tSerializeSMqHbRsp(buf, tlen, rsp) != 0){ + rpcFreeCont(buf); + return TSDB_CODE_OUT_OF_MEMORY; + } + pMsg->info.rsp = buf; + pMsg->info.rspLen = tlen; + return 0; +} + static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) { int32_t code = 0; SMnode *pMnode = pMsg->info.node; @@ -261,7 +316,6 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) { SMqConsumerObj *pConsumer = NULL; if (tDeserializeSMqHbReq(pMsg->pCont, pMsg->contLen, &req) < 0) { - terrno = TSDB_CODE_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY; goto end; } @@ -270,7 +324,6 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) { pConsumer = mndAcquireConsumer(pMnode, consumerId); if (pConsumer == NULL) { mError("consumer:0x%" PRIx64 " not exist", consumerId); - terrno = TSDB_CODE_MND_CONSUMER_NOT_EXIST; code = TSDB_CODE_MND_CONSUMER_NOT_EXIST; goto end; } @@ -284,88 +337,152 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) { int32_t status = atomic_load_32(&pConsumer->status); if (status == MQ_CONSUMER_STATUS_LOST) { - mInfo("try to recover consumer:0x%" PRIx64 "", consumerId); - SMqConsumerRecoverMsg *pRecoverMsg = rpcMallocCont(sizeof(SMqConsumerRecoverMsg)); - - pRecoverMsg->consumerId = consumerId; - SRpcMsg pRpcMsg = { - .msgType = TDMT_MND_TMQ_CONSUMER_RECOVER, - .pCont = pRecoverMsg, - .contLen = sizeof(SMqConsumerRecoverMsg), - .info = pMsg->info, - }; - tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &pRpcMsg); + mInfo("try to recover consumer:0x%" PRIx64, consumerId); + mndSendConsumerMsg(pMnode, pConsumer->consumerId, TDMT_MND_TMQ_CONSUMER_RECOVER, &pMsg->info); } - for (int i = 0; i < taosArrayGetSize(req.topics); i++) { - TopicOffsetRows *data = taosArrayGet(req.topics, i); - mInfo("heartbeat report offset rows.%s:%s", pConsumer->cgroup, data->topicName); - - SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, data->topicName); - if (pSub == NULL) { -#ifdef TMQ_DEBUG - ASSERT(0); -#endif - continue; - } - taosWLockLatch(&pSub->lock); - SMqConsumerEp *pConsumerEp = taosHashGet(pSub->consumerHash, &consumerId, sizeof(int64_t)); - if (pConsumerEp) { - taosArrayDestroy(pConsumerEp->offsetRows); - pConsumerEp->offsetRows = data->offsetRows; - data->offsetRows = NULL; - } - taosWUnLockLatch(&pSub->lock); - - mndReleaseSubscribe(pMnode, pSub); - } - - // encode rsp - int32_t tlen = tSerializeSMqHbRsp(NULL, 0, &rsp); - void *buf = rpcMallocCont(tlen); - if (buf == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - code = TSDB_CODE_OUT_OF_MEMORY; - goto end; - } - - tSerializeSMqHbRsp(buf, tlen, &rsp); - pMsg->info.rsp = buf; - pMsg->info.rspLen = tlen; + storeOffsetRows(pMnode, &req, pConsumer); + code = buildMqHbRsp(pMsg, &rsp); end: - tDeatroySMqHbRsp(&rsp); + tDestroySMqHbRsp(&rsp); mndReleaseConsumer(pMnode, pConsumer); - tDeatroySMqHbReq(&req); + tDestroySMqHbReq(&req); return code; } +static int32_t addEpSetInfo(SMnode *pMnode, SMqConsumerObj *pConsumer, int32_t epoch, SMqAskEpRsp *rsp){ + taosRLockLatch(&pConsumer->lock); + + int32_t numOfTopics = taosArrayGetSize(pConsumer->currentTopics); + + rsp->topics = taosArrayInit(numOfTopics, sizeof(SMqSubTopicEp)); + if (rsp->topics == NULL) { + taosRUnLockLatch(&pConsumer->lock); + return TSDB_CODE_OUT_OF_MEMORY; + } + + // handle all topics subscribed by this consumer + for (int32_t i = 0; i < numOfTopics; i++) { + char *topic = taosArrayGetP(pConsumer->currentTopics, i); + SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic); + // txn guarantees pSub is created + if (pSub == NULL) { + continue; + } + taosRLockLatch(&pSub->lock); + + SMqSubTopicEp topicEp = {0}; + strcpy(topicEp.topic, topic); + + // 2.1 fetch topic schema + SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic); + if (pTopic == NULL) { + taosRUnLockLatch(&pSub->lock); + mndReleaseSubscribe(pMnode, pSub); + continue; + } + taosRLockLatch(&pTopic->lock); + tstrncpy(topicEp.db, pTopic->db, TSDB_DB_FNAME_LEN); + topicEp.schema.nCols = pTopic->schema.nCols; + if (topicEp.schema.nCols) { + topicEp.schema.pSchema = taosMemoryCalloc(topicEp.schema.nCols, sizeof(SSchema)); + memcpy(topicEp.schema.pSchema, pTopic->schema.pSchema, topicEp.schema.nCols * sizeof(SSchema)); + } + taosRUnLockLatch(&pTopic->lock); + mndReleaseTopic(pMnode, pTopic); + + // 2.2 iterate all vg assigned to the consumer of that topic + SMqConsumerEp *pConsumerEp = taosHashGet(pSub->consumerHash, &pConsumer->consumerId, sizeof(int64_t)); + int32_t vgNum = taosArrayGetSize(pConsumerEp->vgs); + + // this customer assigned vgroups + topicEp.vgs = taosArrayInit(vgNum, sizeof(SMqSubVgEp)); + if (topicEp.vgs == NULL) { + taosRUnLockLatch(&pConsumer->lock); + taosRUnLockLatch(&pSub->lock); + mndReleaseSubscribe(pMnode, pSub); + return TSDB_CODE_OUT_OF_MEMORY; + } + + for (int32_t j = 0; j < vgNum; j++) { + SMqVgEp *pVgEp = taosArrayGetP(pConsumerEp->vgs, j); + // char offsetKey[TSDB_PARTITION_KEY_LEN]; + // mndMakePartitionKey(offsetKey, pConsumer->cgroup, topic, pVgEp->vgId); + + if (epoch == -1) { + SVgObj *pVgroup = mndAcquireVgroup(pMnode, pVgEp->vgId); + if (pVgroup) { + pVgEp->epSet = mndGetVgroupEpset(pMnode, pVgroup); + mndReleaseVgroup(pMnode, pVgroup); + } + } + // 2.2.1 build vg ep + SMqSubVgEp vgEp = { + .epSet = pVgEp->epSet, + .vgId = pVgEp->vgId, + .offset = -1, + }; + + taosArrayPush(topicEp.vgs, &vgEp); + } + taosArrayPush(rsp->topics, &topicEp); + + taosRUnLockLatch(&pSub->lock); + mndReleaseSubscribe(pMnode, pSub); + } + taosRUnLockLatch(&pConsumer->lock); + return 0; +} + +static int32_t buildAskEpRsp(SRpcMsg *pMsg, SMqAskEpRsp *rsp, int32_t serverEpoch, int64_t consumerId){ + // encode rsp + int32_t tlen = sizeof(SMqRspHead) + tEncodeSMqAskEpRsp(NULL, rsp); + void *buf = rpcMallocCont(tlen); + if (buf == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + SMqRspHead *pHead = buf; + + pHead->mqMsgType = TMQ_MSG_TYPE__EP_RSP; + pHead->epoch = serverEpoch; + pHead->consumerId = consumerId; + pHead->walsver = 0; + pHead->walever = 0; + + void *abuf = POINTER_SHIFT(buf, sizeof(SMqRspHead)); + tEncodeSMqAskEpRsp(&abuf, rsp); + + // send rsp + pMsg->info.rsp = buf; + pMsg->info.rspLen = tlen; + return 0; +} + static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) { SMnode *pMnode = pMsg->info.node; SMqAskEpReq req = {0}; SMqAskEpRsp rsp = {0}; + int32_t code = 0; if (tDeserializeSMqAskEpReq(pMsg->pCont, pMsg->contLen, &req) < 0) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return -1; + return TSDB_CODE_OUT_OF_MEMORY; } int64_t consumerId = req.consumerId; - int32_t epoch = req.epoch; SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, consumerId); if (pConsumer == NULL) { mError("consumer:0x%" PRIx64 " group:%s not exists in sdb", consumerId, req.cgroup); - terrno = TSDB_CODE_MND_CONSUMER_NOT_EXIST; - return -1; + return TSDB_CODE_MND_CONSUMER_NOT_EXIST; } - int32_t ret = strncmp(req.cgroup, pConsumer->cgroup, tListLen(pConsumer->cgroup)); - if (ret != 0) { + if (strncmp(req.cgroup, pConsumer->cgroup, tListLen(pConsumer->cgroup)) != 0) { mError("consumer:0x%" PRIx64 " group:%s not consistent with data in sdb, saved cgroup:%s", consumerId, req.cgroup, pConsumer->cgroup); - terrno = TSDB_CODE_MND_CONSUMER_NOT_EXIST; - goto FAIL; + code = TSDB_CODE_MND_CONSUMER_NOT_EXIST; + goto END; } atomic_store_32(&pConsumer->hbStatus, 0); @@ -374,156 +491,37 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) { int32_t status = atomic_load_32(&pConsumer->status); if (status == MQ_CONSUMER_STATUS_LOST) { - mInfo("try to recover consumer:0x%" PRIx64, consumerId); - SMqConsumerRecoverMsg *pRecoverMsg = rpcMallocCont(sizeof(SMqConsumerRecoverMsg)); - - pRecoverMsg->consumerId = consumerId; - SRpcMsg pRpcMsg = { - .msgType = TDMT_MND_TMQ_CONSUMER_RECOVER, - .pCont = pRecoverMsg, - .contLen = sizeof(SMqConsumerRecoverMsg), - .info = pMsg->info, - }; - - tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &pRpcMsg); + mndSendConsumerMsg(pMnode, pConsumer->consumerId, TDMT_MND_TMQ_CONSUMER_RECOVER, &pMsg->info); } if (status != MQ_CONSUMER_STATUS_READY) { mInfo("consumer:0x%" PRIx64 " not ready, status: %s", consumerId, mndConsumerStatusName(status)); - terrno = TSDB_CODE_MND_CONSUMER_NOT_READY; - goto FAIL; + code = TSDB_CODE_MND_CONSUMER_NOT_READY; + goto END; } + int32_t epoch = req.epoch; int32_t serverEpoch = atomic_load_32(&pConsumer->epoch); // 2. check epoch, only send ep info when epochs do not match if (epoch != serverEpoch) { - taosRLockLatch(&pConsumer->lock); - mInfo("process ask ep, consumer:0x%" PRIx64 "(epoch %d) update with server epoch %d", consumerId, epoch, - serverEpoch); - int32_t numOfTopics = taosArrayGetSize(pConsumer->currentTopics); - - rsp.topics = taosArrayInit(numOfTopics, sizeof(SMqSubTopicEp)); - if (rsp.topics == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - taosRUnLockLatch(&pConsumer->lock); - goto FAIL; + mInfo("process ask ep, consumer:0x%" PRIx64 "(epoch %d) update with server epoch %d", + consumerId, epoch, serverEpoch); + code = addEpSetInfo(pMnode, pConsumer, epoch, &rsp); + if(code != 0){ + goto END; } - - // handle all topics subscribed by this consumer - for (int32_t i = 0; i < numOfTopics; i++) { - char *topic = taosArrayGetP(pConsumer->currentTopics, i); - SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic); - // txn guarantees pSub is created - if (pSub == NULL) { -#ifdef TMQ_DEBUG - ASSERT(0); -#endif - continue; - } - taosRLockLatch(&pSub->lock); - - SMqSubTopicEp topicEp = {0}; - strcpy(topicEp.topic, topic); - - // 2.1 fetch topic schema - SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic); - if (pTopic == NULL) { -#ifdef TMQ_DEBUG - ASSERT(0); -#endif - taosRUnLockLatch(&pSub->lock); - mndReleaseSubscribe(pMnode, pSub); - continue; - } - taosRLockLatch(&pTopic->lock); - tstrncpy(topicEp.db, pTopic->db, TSDB_DB_FNAME_LEN); - topicEp.schema.nCols = pTopic->schema.nCols; - if (topicEp.schema.nCols) { - topicEp.schema.pSchema = taosMemoryCalloc(topicEp.schema.nCols, sizeof(SSchema)); - memcpy(topicEp.schema.pSchema, pTopic->schema.pSchema, topicEp.schema.nCols * sizeof(SSchema)); - } - taosRUnLockLatch(&pTopic->lock); - mndReleaseTopic(pMnode, pTopic); - - // 2.2 iterate all vg assigned to the consumer of that topic - SMqConsumerEp *pConsumerEp = taosHashGet(pSub->consumerHash, &consumerId, sizeof(int64_t)); - int32_t vgNum = taosArrayGetSize(pConsumerEp->vgs); - - // this customer assigned vgroups - topicEp.vgs = taosArrayInit(vgNum, sizeof(SMqSubVgEp)); - if (topicEp.vgs == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - taosRUnLockLatch(&pConsumer->lock); - taosRUnLockLatch(&pSub->lock); - mndReleaseSubscribe(pMnode, pSub); - goto FAIL; - } - - for (int32_t j = 0; j < vgNum; j++) { - SMqVgEp *pVgEp = taosArrayGetP(pConsumerEp->vgs, j); - // char offsetKey[TSDB_PARTITION_KEY_LEN]; - // mndMakePartitionKey(offsetKey, pConsumer->cgroup, topic, pVgEp->vgId); - - if (epoch == -1) { - SVgObj *pVgroup = mndAcquireVgroup(pMnode, pVgEp->vgId); - if (pVgroup) { - pVgEp->epSet = mndGetVgroupEpset(pMnode, pVgroup); - mndReleaseVgroup(pMnode, pVgroup); - } - } - // 2.2.1 build vg ep - SMqSubVgEp vgEp = { - .epSet = pVgEp->epSet, - .vgId = pVgEp->vgId, - .offset = -1, - }; - - taosArrayPush(topicEp.vgs, &vgEp); - } - taosArrayPush(rsp.topics, &topicEp); - - taosRUnLockLatch(&pSub->lock); - mndReleaseSubscribe(pMnode, pSub); - } - taosRUnLockLatch(&pConsumer->lock); } - // encode rsp - int32_t tlen = sizeof(SMqRspHead) + tEncodeSMqAskEpRsp(NULL, &rsp); - void *buf = rpcMallocCont(tlen); - if (buf == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - goto FAIL; - } + code = buildAskEpRsp(pMsg, &rsp, serverEpoch, consumerId); - SMqRspHead *pHead = buf; - - pHead->mqMsgType = TMQ_MSG_TYPE__EP_RSP; - pHead->epoch = serverEpoch; - pHead->consumerId = pConsumer->consumerId; - pHead->walsver = 0; - pHead->walever = 0; - - void *abuf = POINTER_SHIFT(buf, sizeof(SMqRspHead)); - tEncodeSMqAskEpRsp(&abuf, &rsp); - - // release consumer and free memory +END: tDeleteSMqAskEpRsp(&rsp); mndReleaseConsumer(pMnode, pConsumer); - - // send rsp - pMsg->info.rsp = buf; - pMsg->info.rspLen = tlen; - return 0; - -FAIL: - tDeleteSMqAskEpRsp(&rsp); - mndReleaseConsumer(pMnode, pConsumer); - return -1; + return code; } -int32_t mndSetConsumerDropLogs(SMnode *pMnode, STrans *pTrans, SMqConsumerObj *pConsumer) { +int32_t mndSetConsumerDropLogs(STrans *pTrans, SMqConsumerObj *pConsumer) { SSdbRaw *pCommitRaw = mndConsumerActionEncode(pConsumer); if (pCommitRaw == NULL) return -1; if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; @@ -531,7 +529,7 @@ int32_t mndSetConsumerDropLogs(SMnode *pMnode, STrans *pTrans, SMqConsumerObj *p return 0; } -int32_t mndSetConsumerCommitLogs(SMnode *pMnode, STrans *pTrans, SMqConsumerObj *pConsumer) { +int32_t mndSetConsumerCommitLogs(STrans *pTrans, SMqConsumerObj *pConsumer) { SSdbRaw *pCommitRaw = mndConsumerActionEncode(pConsumer); if (pCommitRaw == NULL) return -1; if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; @@ -539,8 +537,6 @@ int32_t mndSetConsumerCommitLogs(SMnode *pMnode, STrans *pTrans, SMqConsumerObj return 0; } -static void *topicNameDup(void *p) { return taosStrdup((char *)p); } - static void freeItem(void *param) { void *pItem = *(void **)param; if (pItem != NULL) { @@ -548,21 +544,52 @@ static void freeItem(void *param) { } } -int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { - SMnode *pMnode = pMsg->info.node; - char *msgStr = pMsg->pCont; - int32_t code = -1; +static int32_t getTopicAddDelete(SMqConsumerObj *pExistedConsumer, SMqConsumerObj *pConsumerNew){ + pConsumerNew->rebNewTopics = taosArrayInit(0, sizeof(void *)); + pConsumerNew->rebRemovedTopics = taosArrayInit(0, sizeof(void *)); + if(pConsumerNew->rebNewTopics == NULL || pConsumerNew->rebRemovedTopics == NULL){ + return TSDB_CODE_OUT_OF_MEMORY; + } + int32_t newTopicNum = taosArrayGetSize(pConsumerNew->assignedTopics); + int32_t oldTopicNum = taosArrayGetSize(pExistedConsumer->currentTopics); - SCMSubscribeReq subscribe = {0}; - tDeserializeSCMSubscribeReq(msgStr, &subscribe); + int32_t i = 0, j = 0; + while (i < oldTopicNum || j < newTopicNum) { + if (i >= oldTopicNum) { + char *newTopicCopy = taosStrdup(taosArrayGetP(pConsumerNew->assignedTopics, j)); + taosArrayPush(pConsumerNew->rebNewTopics, &newTopicCopy); + j++; + continue; + } else if (j >= newTopicNum) { + char *oldTopicCopy = taosStrdup(taosArrayGetP(pExistedConsumer->currentTopics, i)); + taosArrayPush(pConsumerNew->rebRemovedTopics, &oldTopicCopy); + i++; + continue; + } else { + char *oldTopic = taosArrayGetP(pExistedConsumer->currentTopics, i); + char *newTopic = taosArrayGetP(pConsumerNew->assignedTopics, j); + int comp = strcmp(oldTopic, newTopic); + if (comp == 0) { + i++; + j++; + continue; + } else if (comp < 0) { + char *oldTopicCopy = taosStrdup(oldTopic); + taosArrayPush(pConsumerNew->rebRemovedTopics, &oldTopicCopy); + i++; + continue; + } else { + char *newTopicCopy = taosStrdup(newTopic); + taosArrayPush(pConsumerNew->rebNewTopics, &newTopicCopy); + j++; + continue; + } + } + } + return 0; +} - int64_t consumerId = subscribe.consumerId; - char *cgroup = subscribe.cgroup; - SMqConsumerObj *pExistedConsumer = NULL; - SMqConsumerObj *pConsumerNew = NULL; - STrans *pTrans = NULL; - - SArray *pTopicList = subscribe.topicNames; +static int32_t checkAndSortTopic(SMnode *pMnode, SArray *pTopicList){ taosArraySort(pTopicList, taosArrayCompareString); taosArrayRemoveDuplicate(pTopicList, taosArrayCompareString, freeItem); @@ -571,125 +598,102 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { int32_t gNum = mndGetGroupNumByTopic(pMnode, (const char *)taosArrayGetP(pTopicList, i)); if (gNum >= MND_MAX_GROUP_PER_TOPIC) { terrno = TSDB_CODE_TMQ_GROUP_OUT_OF_RANGE; - code = terrno; - goto _over; + return -1; } } + return TSDB_CODE_SUCCESS; +} - // check topic existence - pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "subscribe"); - if (pTrans == NULL) { - goto _over; - } - - code = validateTopics(pTrans, pTopicList, pMnode, pMsg->info.conn.user, subscribe.enableReplay); - if (code != TSDB_CODE_SUCCESS) { - goto _over; - } - +static SMqConsumerObj* buildSubConsumer(SMnode *pMnode, SCMSubscribeReq *subscribe){ + int64_t consumerId = subscribe->consumerId; + char *cgroup = subscribe->cgroup; + SMqConsumerObj *pConsumerNew = NULL; + SMqConsumerObj *pExistedConsumer = NULL; pExistedConsumer = mndAcquireConsumer(pMnode, consumerId); if (pExistedConsumer == NULL) { - mInfo("receive subscribe request from new consumer:0x%" PRIx64 " cgroup:%s, numOfTopics:%d", consumerId, - subscribe.cgroup, (int32_t)taosArrayGetSize(pTopicList)); + mInfo("receive subscribe request from new consumer:0x%" PRIx64 + ",cgroup:%s, numOfTopics:%d", consumerId, + subscribe->cgroup, (int32_t)taosArrayGetSize(subscribe->topicNames)); - pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup); - tstrncpy(pConsumerNew->clientId, subscribe.clientId, tListLen(pConsumerNew->clientId)); - - pConsumerNew->withTbName = subscribe.withTbName; - pConsumerNew->autoCommit = subscribe.autoCommit; - pConsumerNew->autoCommitInterval = subscribe.autoCommitInterval; - pConsumerNew->resetOffsetCfg = subscribe.resetOffsetCfg; - - // pConsumerNew->updateType = CONSUMER_UPDATE_SUB; // use insert logic - taosArrayDestroy(pConsumerNew->assignedTopics); - pConsumerNew->assignedTopics = taosArrayDup(pTopicList, topicNameDup); - - // all subscribed topics should re-balance. - taosArrayDestroy(pConsumerNew->rebNewTopics); - pConsumerNew->rebNewTopics = pTopicList; - subscribe.topicNames = NULL; - - if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) goto _over; - if (mndTransPrepare(pMnode, pTrans) != 0) goto _over; + pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup, CONSUMER_INSERT_SUB, NULL, subscribe); + if (pConsumerNew == NULL) { + goto _over; + } } else { int32_t status = atomic_load_32(&pExistedConsumer->status); mInfo("receive subscribe request from existed consumer:0x%" PRIx64 - " cgroup:%s, current status:%d(%s), subscribe topic num: %d", - consumerId, subscribe.cgroup, status, mndConsumerStatusName(status), newTopicNum); + ",cgroup:%s, current status:%d(%s), subscribe topic num: %d", + consumerId, subscribe->cgroup, status, mndConsumerStatusName(status), + (int32_t)taosArrayGetSize(subscribe->topicNames)); if (status != MQ_CONSUMER_STATUS_READY) { terrno = TSDB_CODE_MND_CONSUMER_NOT_READY; goto _over; } - - pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup); + pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup, CONSUMER_UPDATE_SUB, NULL, subscribe); if (pConsumerNew == NULL) { goto _over; } - // set the update type - pConsumerNew->updateType = CONSUMER_UPDATE_SUB; - taosArrayDestroy(pConsumerNew->assignedTopics); - pConsumerNew->assignedTopics = taosArrayDup(pTopicList, topicNameDup); - - int32_t oldTopicNum = taosArrayGetSize(pExistedConsumer->currentTopics); - - int32_t i = 0, j = 0; - while (i < oldTopicNum || j < newTopicNum) { - if (i >= oldTopicNum) { - char *newTopicCopy = taosStrdup(taosArrayGetP(pTopicList, j)); - taosArrayPush(pConsumerNew->rebNewTopics, &newTopicCopy); - j++; - continue; - } else if (j >= newTopicNum) { - char *oldTopicCopy = taosStrdup(taosArrayGetP(pExistedConsumer->currentTopics, i)); - taosArrayPush(pConsumerNew->rebRemovedTopics, &oldTopicCopy); - i++; - continue; - } else { - char *oldTopic = taosArrayGetP(pExistedConsumer->currentTopics, i); - char *newTopic = taosArrayGetP(pTopicList, j); - int comp = strcmp(oldTopic, newTopic); - if (comp == 0) { - i++; - j++; - continue; - } else if (comp < 0) { - char *oldTopicCopy = taosStrdup(oldTopic); - taosArrayPush(pConsumerNew->rebRemovedTopics, &oldTopicCopy); - i++; - continue; - } else { - char *newTopicCopy = taosStrdup(newTopic); - taosArrayPush(pConsumerNew->rebNewTopics, &newTopicCopy); - j++; - continue; - } - } - } - - // no topics need to be rebalanced - if (taosArrayGetSize(pConsumerNew->rebNewTopics) == 0 && taosArrayGetSize(pConsumerNew->rebRemovedTopics) == 0) { + int32_t code = getTopicAddDelete(pExistedConsumer, pConsumerNew); + if (code != 0){ + terrno = code; goto _over; } + } + mndReleaseConsumer(pMnode, pExistedConsumer); + return pConsumerNew; - if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) goto _over; - if (mndTransPrepare(pMnode, pTrans) != 0) goto _over; +_over: + mndReleaseConsumer(pMnode, pExistedConsumer); + tDeleteSMqConsumerObj(pConsumerNew); + taosArrayDestroyP(subscribe->topicNames, (FDelete)taosMemoryFree); + return NULL; +} + +int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { + SMnode *pMnode = pMsg->info.node; + char *msgStr = pMsg->pCont; + int32_t code = 0; + + SCMSubscribeReq subscribe = {0}; + tDeserializeSCMSubscribeReq(msgStr, &subscribe); + + SMqConsumerObj *pConsumerNew = NULL; + STrans *pTrans = NULL; + + code = checkAndSortTopic(pMnode, subscribe.topicNames); + if(code != TSDB_CODE_SUCCESS){ + goto _over; } + pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "subscribe"); + if (pTrans == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _over; + } + + code = validateTopics(pTrans, subscribe.topicNames, pMnode, pMsg->info.conn.user, subscribe.enableReplay); + if (code != TSDB_CODE_SUCCESS) { + goto _over; + } + + pConsumerNew = buildSubConsumer(pMnode, &subscribe); + if(pConsumerNew == NULL){ + code = -1; + goto _over; + } + code = mndSetConsumerCommitLogs(pTrans, pConsumerNew); + if (code != 0) goto _over; + + code = mndTransPrepare(pMnode, pTrans); + if (code != 0) goto _over; code = TSDB_CODE_ACTION_IN_PROGRESS; _over: mndTransDrop(pTrans); - - if (pExistedConsumer) { - /*taosRUnLockLatch(&pExistedConsumer->lock);*/ - mndReleaseConsumer(pMnode, pExistedConsumer); - } - - tDeleteSMqConsumerObj(pConsumerNew, true); - + tDeleteSMqConsumerObj(pConsumerNew); taosArrayDestroyP(subscribe.topicNames, (FDelete)taosMemoryFree); return code; } @@ -796,7 +800,7 @@ static int32_t mndConsumerActionInsert(SSdb *pSdb, SMqConsumerObj *pConsumer) { static int32_t mndConsumerActionDelete(SSdb *pSdb, SMqConsumerObj *pConsumer) { mInfo("consumer:0x%" PRIx64 " perform delete action, status:(%d)%s", pConsumer->consumerId, pConsumer->status, mndConsumerStatusName(pConsumer->status)); - tDeleteSMqConsumerObj(pConsumer, false); + tClearSMqConsumerObj(pConsumer); return 0; } @@ -812,48 +816,17 @@ static void updateConsumerStatus(SMqConsumerObj *pConsumer) { } } -// remove from new topic -static void removeFromNewTopicList(SMqConsumerObj *pConsumer, const char *pTopic) { - int32_t size = taosArrayGetSize(pConsumer->rebNewTopics); +// remove from topic list +static void removeFromTopicList(SArray *topicList, const char *pTopic, int64_t consumerId, char *type) { + int32_t size = taosArrayGetSize(topicList); for (int32_t i = 0; i < size; i++) { - char *p = taosArrayGetP(pConsumer->rebNewTopics, i); + char *p = taosArrayGetP(topicList, i); if (strcmp(pTopic, p) == 0) { - taosArrayRemove(pConsumer->rebNewTopics, i); + taosArrayRemove(topicList, i); taosMemoryFree(p); - mInfo("consumer:0x%" PRIx64 " remove new topic:%s in the topic list, remain newTopics:%d", pConsumer->consumerId, - pTopic, (int)taosArrayGetSize(pConsumer->rebNewTopics)); - break; - } - } -} - -// remove from removed topic -static void removeFromRemoveTopicList(SMqConsumerObj *pConsumer, const char *pTopic) { - int32_t size = taosArrayGetSize(pConsumer->rebRemovedTopics); - for (int32_t i = 0; i < size; i++) { - char *p = taosArrayGetP(pConsumer->rebRemovedTopics, i); - if (strcmp(pTopic, p) == 0) { - taosArrayRemove(pConsumer->rebRemovedTopics, i); - taosMemoryFree(p); - - mInfo("consumer:0x%" PRIx64 " remove topic:%s in the removed topic list, remain removedTopics:%d", - pConsumer->consumerId, pTopic, (int)taosArrayGetSize(pConsumer->rebRemovedTopics)); - break; - } - } -} - -static void removeFromCurrentTopicList(SMqConsumerObj *pConsumer, const char *pTopic) { - int32_t sz = taosArrayGetSize(pConsumer->currentTopics); - for (int32_t i = 0; i < sz; i++) { - char *topic = taosArrayGetP(pConsumer->currentTopics, i); - if (strcmp(pTopic, topic) == 0) { - taosArrayRemove(pConsumer->currentTopics, i); - taosMemoryFree(topic); - - mInfo("consumer:0x%" PRIx64 " remove topic:%s in the current topic list, remain currentTopics:%d", - pConsumer->consumerId, pTopic, (int)taosArrayGetSize(pConsumer->currentTopics)); + mInfo("[rebalance] consumer:0x%" PRIx64 " remove topic:%s in the %s topic list, remain newTopics:%d", + consumerId, pTopic, type, (int)taosArrayGetSize(topicList)); break; } } @@ -887,60 +860,38 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, pOldConsumer->subscribeTime = taosGetTimestampMs(); pOldConsumer->status = MQ_CONSUMER_STATUS_REBALANCE; - mInfo("consumer:0x%" PRIx64 " sub update, modify existed consumer", pOldConsumer->consumerId); - // } else if (pNewConsumer->updateType == CONSUMER_UPDATE_TIMER_LOST) { - // int32_t sz = taosArrayGetSize(pOldConsumer->currentTopics); - // for (int32_t i = 0; i < sz; i++) { - // char *topic = taosStrdup(taosArrayGetP(pOldConsumer->currentTopics, i)); - // taosArrayPush(pOldConsumer->rebRemovedTopics, &topic); - // } - // - // int32_t prevStatus = pOldConsumer->status; - // pOldConsumer->status = MQ_CONSUMER_STATUS_LOST; - // mInfo("consumer:0x%" PRIx64 " timer update, timer lost. state %s -> %s, reb-time:%" PRId64 ", - // reb-removed-topics:%d", - // pOldConsumer->consumerId, mndConsumerStatusName(prevStatus), - // mndConsumerStatusName(pOldConsumer->status), pOldConsumer->rebalanceTime, - // (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics)); + mInfo("consumer:0x%" PRIx64 " subscribe update, modify existed consumer", pOldConsumer->consumerId); } else if (pNewConsumer->updateType == CONSUMER_UPDATE_REC) { int32_t sz = taosArrayGetSize(pOldConsumer->assignedTopics); for (int32_t i = 0; i < sz; i++) { char *topic = taosStrdup(taosArrayGetP(pOldConsumer->assignedTopics, i)); taosArrayPush(pOldConsumer->rebNewTopics, &topic); } - pOldConsumer->status = MQ_CONSUMER_STATUS_REBALANCE; - mInfo("consumer:0x%" PRIx64 " timer update, timer recover", pOldConsumer->consumerId); + mInfo("consumer:0x%" PRIx64 " recover update", pOldConsumer->consumerId); } else if (pNewConsumer->updateType == CONSUMER_UPDATE_REB) { atomic_add_fetch_32(&pOldConsumer->epoch, 1); pOldConsumer->rebalanceTime = taosGetTimestampMs(); - mInfo("consumer:0x%" PRIx64 " reb update, only rebalance time", pOldConsumer->consumerId); + mInfo("[rebalance] consumer:0x%" PRIx64 " rebalance update, only rebalance time", pOldConsumer->consumerId); } else if (pNewConsumer->updateType == CONSUMER_ADD_REB) { char *pNewTopic = taosStrdup(taosArrayGetP(pNewConsumer->rebNewTopics, 0)); - - // check if exist in current topic - removeFromNewTopicList(pOldConsumer, pNewTopic); - - // add to current topic + removeFromTopicList(pOldConsumer->rebNewTopics, pNewTopic, pOldConsumer->consumerId, "new"); bool existing = existInCurrentTopicList(pOldConsumer, pNewTopic); if (existing) { - mError("consumer:0x%" PRIx64 "new topic:%s should not in currentTopics", pOldConsumer->consumerId, pNewTopic); + mError("[rebalance] consumer:0x%" PRIx64 " add new topic:%s should not in currentTopics", pOldConsumer->consumerId, pNewTopic); taosMemoryFree(pNewTopic); - } else { // added into current topic list + } else { taosArrayPush(pOldConsumer->currentTopics, &pNewTopic); taosArraySort(pOldConsumer->currentTopics, taosArrayCompareString); } - // set status int32_t status = pOldConsumer->status; updateConsumerStatus(pOldConsumer); - - // the re-balance is triggered when the new consumer is launched. pOldConsumer->rebalanceTime = taosGetTimestampMs(); - atomic_add_fetch_32(&pOldConsumer->epoch, 1); - mInfo("consumer:0x%" PRIx64 " reb update add, state (%d)%s -> (%d)%s, new epoch:%d, reb-time:%" PRId64 + + mInfo("[rebalance] consumer:0x%" PRIx64 " rebalance update add, state (%d)%s -> (%d)%s, new epoch:%d, reb-time:%" PRId64 ", current topics:%d, newTopics:%d, removeTopics:%d", pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status, mndConsumerStatusName(pOldConsumer->status), pOldConsumer->epoch, pOldConsumer->rebalanceTime, @@ -948,22 +899,16 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics)); } else if (pNewConsumer->updateType == CONSUMER_REMOVE_REB) { - char *removedTopic = taosArrayGetP(pNewConsumer->rebRemovedTopics, 0); + char *topic = taosArrayGetP(pNewConsumer->rebRemovedTopics, 0); + removeFromTopicList(pOldConsumer->rebRemovedTopics, topic, pOldConsumer->consumerId, "remove"); + removeFromTopicList(pOldConsumer->currentTopics, topic, pOldConsumer->consumerId, "current"); - // remove from removed topic - removeFromRemoveTopicList(pOldConsumer, removedTopic); - - // remove from current topic - removeFromCurrentTopicList(pOldConsumer, removedTopic); - - // set status int32_t status = pOldConsumer->status; updateConsumerStatus(pOldConsumer); - pOldConsumer->rebalanceTime = taosGetTimestampMs(); atomic_add_fetch_32(&pOldConsumer->epoch, 1); - mInfo("consumer:0x%" PRIx64 " reb update remove, state (%d)%s -> (%d)%s, new epoch:%d, reb-time:%" PRId64 + mInfo("[rebalance]consumer:0x%" PRIx64 " rebalance update remove, state (%d)%s -> (%d)%s, new epoch:%d, reb-time:%" PRId64 ", current topics:%d, newTopics:%d, removeTopics:%d", pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status, mndConsumerStatusName(pOldConsumer->status), pOldConsumer->epoch, pOldConsumer->rebalanceTime, diff --git a/source/dnode/mnode/impl/src/mndDef.c b/source/dnode/mnode/impl/src/mndDef.c index 5be641d1c2..3f69c7def3 100644 --- a/source/dnode/mnode/impl/src/mndDef.c +++ b/source/dnode/mnode/impl/src/mndDef.c @@ -249,7 +249,9 @@ void *tDecodeSMqVgEp(const void *buf, SMqVgEp *pVgEp, int8_t sver) { return (void *)buf; } -SMqConsumerObj *tNewSMqConsumerObj(int64_t consumerId, char *cgroup) { +static void *topicNameDup(void *p) { return taosStrdup((char *)p); } + +SMqConsumerObj *tNewSMqConsumerObj(int64_t consumerId, char *cgroup, int8_t updateType, char *topic, SCMSubscribeReq *subscribe) { SMqConsumerObj *pConsumer = taosMemoryCalloc(1, sizeof(SMqConsumerObj)); if (pConsumer == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -264,36 +266,64 @@ SMqConsumerObj *tNewSMqConsumerObj(int64_t consumerId, char *cgroup) { pConsumer->hbStatus = 0; taosInitRWLatch(&pConsumer->lock); + pConsumer->createTime = taosGetTimestampMs(); + pConsumer->updateType = updateType; - pConsumer->currentTopics = taosArrayInit(0, sizeof(void *)); - pConsumer->rebNewTopics = taosArrayInit(0, sizeof(void *)); - pConsumer->rebRemovedTopics = taosArrayInit(0, sizeof(void *)); - pConsumer->assignedTopics = taosArrayInit(0, sizeof(void *)); + if (updateType == CONSUMER_ADD_REB){ + pConsumer->rebNewTopics = taosArrayInit(0, sizeof(void *)); + if(pConsumer->rebNewTopics == NULL){ + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto END; + } - if (pConsumer->currentTopics == NULL || pConsumer->rebNewTopics == NULL || pConsumer->rebRemovedTopics == NULL || - pConsumer->assignedTopics == NULL) { - taosArrayDestroy(pConsumer->currentTopics); - taosArrayDestroy(pConsumer->rebNewTopics); - taosArrayDestroy(pConsumer->rebRemovedTopics); - taosArrayDestroy(pConsumer->assignedTopics); - taosMemoryFree(pConsumer); - return NULL; + char* topicTmp = taosStrdup(topic); + taosArrayPush(pConsumer->rebNewTopics, &topicTmp); + }else if (updateType == CONSUMER_REMOVE_REB) { + pConsumer->rebRemovedTopics = taosArrayInit(0, sizeof(void *)); + if(pConsumer->rebRemovedTopics == NULL){ + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto END; + } + char* topicTmp = taosStrdup(topic); + taosArrayPush(pConsumer->rebRemovedTopics, &topicTmp); + }else if (updateType == CONSUMER_INSERT_SUB){ + tstrncpy(pConsumer->clientId, subscribe->clientId, tListLen(pConsumer->clientId)); + pConsumer->withTbName = subscribe->withTbName; + pConsumer->autoCommit = subscribe->autoCommit; + pConsumer->autoCommitInterval = subscribe->autoCommitInterval; + pConsumer->resetOffsetCfg = subscribe->resetOffsetCfg; + + + pConsumer->rebNewTopics = taosArrayDup(subscribe->topicNames, topicNameDup); + if (pConsumer->rebNewTopics == NULL){ + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto END; + } + pConsumer->assignedTopics = subscribe->topicNames; + subscribe->topicNames = NULL; + }else if (updateType == CONSUMER_UPDATE_SUB){ + pConsumer->assignedTopics = subscribe->topicNames; + subscribe->topicNames = NULL; } - pConsumer->createTime = taosGetTimestampMs(); - return pConsumer; + +END: + tDeleteSMqConsumerObj(pConsumer); + return NULL; } -void tDeleteSMqConsumerObj(SMqConsumerObj *pConsumer, bool delete) { +void tClearSMqConsumerObj(SMqConsumerObj *pConsumer) { if (pConsumer == NULL) return; taosArrayDestroyP(pConsumer->currentTopics, (FDelete)taosMemoryFree); taosArrayDestroyP(pConsumer->rebNewTopics, (FDelete)taosMemoryFree); taosArrayDestroyP(pConsumer->rebRemovedTopics, (FDelete)taosMemoryFree); taosArrayDestroyP(pConsumer->assignedTopics, (FDelete)taosMemoryFree); - if (delete) { - taosMemoryFree(pConsumer); - } +} + +void tDeleteSMqConsumerObj(SMqConsumerObj *pConsumer) { + tClearSMqConsumerObj(pConsumer); + taosMemoryFree(pConsumer); } int32_t tEncodeSMqConsumerObj(void **buf, const SMqConsumerObj *pConsumer) { @@ -548,6 +578,7 @@ SMqSubscribeObj *tCloneSubscribeObj(const SMqSubscribeObj *pSub) { } void tDeleteSubscribeObj(SMqSubscribeObj *pSub) { + if (pSub == NULL) return; void *pIter = NULL; while (1) { pIter = taosHashIterate(pSub->consumerHash, pIter); diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 50e3dd0d03..55317d03af 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -1508,6 +1508,8 @@ static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock } } + pBlock->info.rows = numOfRows; + destroyStreamTaskIter(pIter); taosRUnLockLatch(&pStream->lock); diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c index fbdfd81cdf..a6d7a24323 100644 --- a/source/dnode/mnode/impl/src/mndSubscribe.c +++ b/source/dnode/mnode/impl/src/mndSubscribe.c @@ -41,9 +41,9 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg); static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg); static int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); static void mndCancelGetNextSubscribe(SMnode *pMnode, void *pIter); -static int32_t mndCheckConsumer(SRpcMsg *pMsg, SHashObj* hash); +static void mndCheckConsumer(SRpcMsg *pMsg, SHashObj* hash); -static int32_t mndSetSubCommitLogs(SMnode *pMnode, STrans *pTrans, SMqSubscribeObj *pSub) { +static int32_t mndSetSubCommitLogs(STrans *pTrans, SMqSubscribeObj *pSub) { SSdbRaw *pCommitRaw = mndSubActionEncode(pSub); if (pCommitRaw == NULL) return -1; if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; @@ -223,47 +223,44 @@ static SMqRebInfo *mndGetOrCreateRebSub(SHashObj *pHash, const char *key) { return pRebInfo; } -static void doRemoveLostConsumers(SMqRebOutputObj *pOutput, SHashObj *pHash, const SMqRebInputObj *pInput) { - int32_t numOfRemoved = taosArrayGetSize(pInput->pRebInfo->removedConsumers); - const char *pSubKey = pOutput->pSub->key; +static void pushVgDataToHash(SArray *vgs, SHashObj *pHash, int64_t consumerId, char* key){ + SMqVgEp *pVgEp = *(SMqVgEp **)taosArrayPop(vgs); + SMqRebOutputVg outputVg = {consumerId, -1, pVgEp}; + taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &outputVg, sizeof(SMqRebOutputVg)); + mInfo("[rebalance] sub:%s mq rebalance remove vgId:%d from consumer:0x%" PRIx64, + key, pVgEp->vgId, consumerId); +} +static void processRemovedConsumers(SMqRebOutputObj *pOutput, SHashObj *pHash, const SMqRebInputObj *pInput) { + int32_t numOfRemoved = taosArrayGetSize(pInput->pRebInfo->removedConsumers); int32_t actualRemoved = 0; for (int32_t i = 0; i < numOfRemoved; i++) { uint64_t consumerId = *(uint64_t *)taosArrayGet(pInput->pRebInfo->removedConsumers, i); - SMqConsumerEp *pConsumerEp = taosHashGet(pOutput->pSub->consumerHash, &consumerId, sizeof(int64_t)); - - // consumer exists till now - if (pConsumerEp) { - actualRemoved++; - - int32_t consumerVgNum = taosArrayGetSize(pConsumerEp->vgs); - for (int32_t j = 0; j < consumerVgNum; j++) { - SMqVgEp *pVgEp = taosArrayGetP(pConsumerEp->vgs, j); - - SMqRebOutputVg outputVg = {.oldConsumerId = consumerId, .newConsumerId = -1, .pVgEp = pVgEp}; - taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &outputVg, sizeof(SMqRebOutputVg)); - mInfo("sub:%s mq re-balance remove vgId:%d from consumer:0x%" PRIx64, pSubKey, pVgEp->vgId, consumerId); - } - - taosArrayDestroy(pConsumerEp->vgs); - taosHashRemove(pOutput->pSub->consumerHash, &consumerId, sizeof(int64_t)); - - // put into removed - taosArrayPush(pOutput->removedConsumers, &consumerId); + if (pConsumerEp == NULL) { + continue; } + + int32_t consumerVgNum = taosArrayGetSize(pConsumerEp->vgs); + for (int32_t j = 0; j < consumerVgNum; j++) { + pushVgDataToHash(pConsumerEp->vgs, pHash, consumerId, pOutput->pSub->key); + } + + taosArrayDestroy(pConsumerEp->vgs); + taosHashRemove(pOutput->pSub->consumerHash, &consumerId, sizeof(int64_t)); + taosArrayPush(pOutput->removedConsumers, &consumerId); + actualRemoved++; } if (numOfRemoved != actualRemoved) { - mError("sub:%s mq re-balance removedNum:%d not matched with actual:%d", pSubKey, numOfRemoved, actualRemoved); + mError("[rebalance] sub:%s mq rebalance removedNum:%d not matched with actual:%d", pOutput->pSub->key, numOfRemoved, actualRemoved); } else { - mInfo("sub:%s removed %d consumers", pSubKey, numOfRemoved); + mInfo("[rebalance] sub:%s removed %d consumers", pOutput->pSub->key, numOfRemoved); } } -static void doAddNewConsumers(SMqRebOutputObj *pOutput, const SMqRebInputObj *pInput) { +static void processNewConsumers(SMqRebOutputObj *pOutput, const SMqRebInputObj *pInput) { int32_t numOfNewConsumers = taosArrayGetSize(pInput->pRebInfo->newConsumers); - const char *pSubKey = pOutput->pSub->key; for (int32_t i = 0; i < numOfNewConsumers; i++) { int64_t consumerId = *(int64_t *)taosArrayGet(pInput->pRebInfo->newConsumers, i); @@ -274,24 +271,14 @@ static void doAddNewConsumers(SMqRebOutputObj *pOutput, const SMqRebInputObj *pI taosHashPut(pOutput->pSub->consumerHash, &consumerId, sizeof(int64_t), &newConsumerEp, sizeof(SMqConsumerEp)); taosArrayPush(pOutput->newConsumers, &consumerId); - mInfo("sub:%s mq rebalance add new consumer:0x%" PRIx64, pSubKey, consumerId); + mInfo("[rebalance] sub:%s mq rebalance add new consumer:0x%" PRIx64, pOutput->pSub->key, consumerId); } } -static void addUnassignedVgroups(SMqRebOutputObj *pOutput, SHashObj *pHash) { - const char *pSubKey = pOutput->pSub->key; +static void processUnassignedVgroups(SMqRebOutputObj *pOutput, SHashObj *pHash) { int32_t numOfVgroups = taosArrayGetSize(pOutput->pSub->unassignedVgs); - for (int32_t i = 0; i < numOfVgroups; i++) { - SMqVgEp *pVgEp = *(SMqVgEp **)taosArrayPop(pOutput->pSub->unassignedVgs); - SMqRebOutputVg rebOutput = { - .oldConsumerId = -1, - .newConsumerId = -1, - .pVgEp = pVgEp, - }; - - taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &rebOutput, sizeof(SMqRebOutputVg)); - mInfo("sub:%s mq re-balance addUnassignedVgroups vgId:%d from unassigned", pSubKey, pVgEp->vgId); + pushVgDataToHash(pOutput->pSub->unassignedVgs, pHash, -1, pOutput->pSub->key); } } @@ -307,11 +294,9 @@ static void addUnassignedVgroups(SMqRebOutputObj *pOutput, SHashObj *pHash) { // } //} -static void transferVgroupsForConsumers(SMqRebOutputObj *pOutput, SHashObj *pHash, int32_t minVgCnt, - int32_t imbConsumerNum) { - const char *pSubKey = pOutput->pSub->key; - - int32_t imbCnt = 0; +static void processModifiedConsumers(SMqRebOutputObj *pOutput, SHashObj *pHash, int32_t minVgCnt, + int32_t remainderVgCnt) { + int32_t cnt = 0; void *pIter = NULL; while (1) { @@ -323,36 +308,16 @@ static void transferVgroupsForConsumers(SMqRebOutputObj *pOutput, SHashObj *pHas SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter; int32_t consumerVgNum = taosArrayGetSize(pConsumerEp->vgs); - // all old consumers still existing need to be modified - // TODO optimize: modify only consumer whose vgs changed taosArrayPush(pOutput->modifyConsumers, &pConsumerEp->consumerId); if (consumerVgNum > minVgCnt) { - if (imbCnt < imbConsumerNum) { - // pop until equal minVg + 1 - while (taosArrayGetSize(pConsumerEp->vgs) > minVgCnt + 1) { - SMqVgEp *pVgEp = *(SMqVgEp **)taosArrayPop(pConsumerEp->vgs); - SMqRebOutputVg outputVg = { - .oldConsumerId = pConsumerEp->consumerId, - .newConsumerId = -1, - .pVgEp = pVgEp, - }; - taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &outputVg, sizeof(SMqRebOutputVg)); - mInfo("sub:%s mq rebalance remove vgId:%d from consumer:0x%" PRIx64 ",(first scan)", pSubKey, pVgEp->vgId, - pConsumerEp->consumerId); + if (cnt < remainderVgCnt) { + while (taosArrayGetSize(pConsumerEp->vgs) > minVgCnt + 1) { // pop until equal minVg + 1 + pushVgDataToHash(pConsumerEp->vgs, pHash, pConsumerEp->consumerId, pOutput->pSub->key); } - imbCnt++; + cnt++; } else { - // all the remain consumers should only have the number of vgroups, which is equalled to the value of minVg while (taosArrayGetSize(pConsumerEp->vgs) > minVgCnt) { - SMqVgEp *pVgEp = *(SMqVgEp **)taosArrayPop(pConsumerEp->vgs); - SMqRebOutputVg outputVg = { - .oldConsumerId = pConsumerEp->consumerId, - .newConsumerId = -1, - .pVgEp = pVgEp, - }; - taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &outputVg, sizeof(SMqRebOutputVg)); - mInfo("sub:%s mq rebalance remove vgId:%d from consumer:0x%" PRIx64 ",(first scan)", pSubKey, pVgEp->vgId, - pConsumerEp->consumerId); + pushVgDataToHash(pConsumerEp->vgs, pHash, pConsumerEp->consumerId, pOutput->pSub->key); } } } @@ -404,7 +369,7 @@ static int32_t processRemoveAddVgs(SMnode *pMnode, SMqRebOutputObj *pOutput){ } } if(!find){ - mInfo("processRemoveAddVgs old vgId:%d", pVgEp->vgId); + mInfo("[rebalance] processRemoveAddVgs old vgId:%d", pVgEp->vgId); tDeleteSMqVgEp(pVgEp); taosArrayRemove(pConsumerEp->vgs, j); continue; @@ -415,7 +380,7 @@ static int32_t processRemoveAddVgs(SMnode *pMnode, SMqRebOutputObj *pOutput){ if(taosArrayGetSize(pOutput->pSub->unassignedVgs) == 0 && taosArrayGetSize(newVgs) != 0){ taosArrayAddAll(pOutput->pSub->unassignedVgs, newVgs); - mInfo("processRemoveAddVgs add new vg num:%d", (int)taosArrayGetSize(newVgs)); + mInfo("[rebalance] processRemoveAddVgs add new vg num:%d", (int)taosArrayGetSize(newVgs)); taosArrayDestroy(newVgs); }else{ taosArrayDestroyP(newVgs, (FDelete)tDeleteSMqVgEp); @@ -423,194 +388,229 @@ static int32_t processRemoveAddVgs(SMnode *pMnode, SMqRebOutputObj *pOutput){ return totalVgNum; } -static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqRebOutputObj *pOutput) { - int32_t totalVgNum = processRemoveAddVgs(pMnode, pOutput); - const char *pSubKey = pOutput->pSub->key; - - int32_t numOfRemoved = taosArrayGetSize(pInput->pRebInfo->removedConsumers); - int32_t numOfAdded = taosArrayGetSize(pInput->pRebInfo->newConsumers); - mInfo("sub:%s mq re-balance %d vgroups, existed consumers:%d, added:%d, removed:%d", pSubKey, totalVgNum, - pInput->oldConsumerNum, numOfAdded, numOfRemoved); - - // 1. build temporary hash(vgId -> SMqRebOutputVg) to store vg that need to be assigned - SHashObj *pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK); - - // 2. check and get actual removed consumers, put their vg into pHash - doRemoveLostConsumers(pOutput, pHash, pInput); - - // 3. if previously no consumer, there are vgs not assigned, put these vg into pHash - addUnassignedVgroups(pOutput, pHash); - - // 4. calc vg number of each consumer - int32_t numOfFinal = pInput->oldConsumerNum + numOfAdded - numOfRemoved; - - int32_t minVgCnt = 0; - int32_t imbConsumerNum = 0; - - // calc num - if (numOfFinal) { - minVgCnt = totalVgNum / numOfFinal; - imbConsumerNum = totalVgNum % numOfFinal; - mInfo("sub:%s mq re-balance %d consumers: at least %d vgs each, %d consumers has 1 more vgroups than avg value", - pSubKey, numOfFinal, minVgCnt, imbConsumerNum); - } else { - mInfo("sub:%s no consumer subscribe this topic", pSubKey); - } - - // 5. remove vgroups from consumers who have more vgroups than the threshold value(minVgCnt or minVgCnt + 1), and then another vg into pHash - transferVgroupsForConsumers(pOutput, pHash, minVgCnt, imbConsumerNum); - - // 6. add new consumer into sub - doAddNewConsumers(pOutput, pInput); - - SMqRebOutputVg *pRebVg = NULL; - void *pRemovedIter = NULL; - void *pIter = NULL; - - // 7. extract bgroups from pHash and assign to consumers that do not have enough vgroups - while (1) { - pIter = taosHashIterate(pOutput->pSub->consumerHash, pIter); - if (pIter == NULL) { - break; - } - - SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter; - - // push until equal minVg - while (taosArrayGetSize(pConsumerEp->vgs) < minVgCnt) { - // iter hash and find one vg - pRemovedIter = taosHashIterate(pHash, pRemovedIter); - if (pRemovedIter == NULL) { - mError("sub:%s removed iter is null, never can reach hear", pSubKey); - break; - } - - pRebVg = (SMqRebOutputVg *)pRemovedIter; - pRebVg->newConsumerId = pConsumerEp->consumerId; - taosArrayPush(pConsumerEp->vgs, &pRebVg->pVgEp); - mInfo("mq rebalance: add vgId:%d to consumer:0x%" PRIx64 " for average", pRebVg->pVgEp->vgId, pConsumerEp->consumerId); - } - } - - while (1) { - pIter = taosHashIterate(pOutput->pSub->consumerHash, pIter); - if (pIter == NULL) { - break; - } - SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter; - - if (taosArrayGetSize(pConsumerEp->vgs) == minVgCnt) { - pRemovedIter = taosHashIterate(pHash, pRemovedIter); - if (pRemovedIter == NULL) { - mInfo("sub:%s removed iter is null", pSubKey); - break; - } - - pRebVg = (SMqRebOutputVg *)pRemovedIter; - pRebVg->newConsumerId = pConsumerEp->consumerId; - taosArrayPush(pConsumerEp->vgs, &pRebVg->pVgEp); - mInfo("mq rebalance: add vgId:%d to consumer:0x%" PRIx64 " for average + 1", pRebVg->pVgEp->vgId, pConsumerEp->consumerId); - } - } - - // All assigned vg should be put into pOutput->rebVgs - if(pRemovedIter != NULL){ - mError("sub:%s error pRemovedIter should be NULL", pSubKey); - } - while (1) { - pRemovedIter = taosHashIterate(pHash, pRemovedIter); - if (pRemovedIter == NULL) { - break; - } - - SMqRebOutputVg* pRebOutput = (SMqRebOutputVg *)pRemovedIter; - taosArrayPush(pOutput->rebVgs, pRebOutput); - if(taosHashGetSize(pOutput->pSub->consumerHash) == 0){ // if all consumer is removed - taosArrayPush(pOutput->pSub->unassignedVgs, &pRebOutput->pVgEp); // put all vg into unassigned - } - } - +static void processSubOffsetRows(SMnode *pMnode, const SMqRebInputObj *pInput, SMqRebOutputObj *pOutput){ SMqSubscribeObj *pSub = mndAcquireSubscribeByKey(pMnode, pInput->pRebInfo->key); // put all offset rows - if (pSub) { - taosRLockLatch(&pSub->lock); - if (pOutput->pSub->offsetRows == NULL) { - pOutput->pSub->offsetRows = taosArrayInit(4, sizeof(OffsetRows)); - } - pIter = NULL; - while (1) { - pIter = taosHashIterate(pSub->consumerHash, pIter); - if (pIter == NULL) break; - SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter; - SMqConsumerEp *pConsumerEpNew = taosHashGet(pOutput->pSub->consumerHash, &pConsumerEp->consumerId, sizeof(int64_t)); + if (pSub == NULL) { + return; + } + taosRLockLatch(&pSub->lock); + if (pOutput->pSub->offsetRows == NULL) { + pOutput->pSub->offsetRows = taosArrayInit(4, sizeof(OffsetRows)); + } + void *pIter = NULL; + while (1) { + pIter = taosHashIterate(pSub->consumerHash, pIter); + if (pIter == NULL) break; + SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter; + SMqConsumerEp *pConsumerEpNew = taosHashGet(pOutput->pSub->consumerHash, &pConsumerEp->consumerId, sizeof(int64_t)); - for (int j = 0; j < taosArrayGetSize(pConsumerEp->offsetRows); j++) { - OffsetRows *d1 = taosArrayGet(pConsumerEp->offsetRows, j); - bool jump = false; - for (int i = 0; pConsumerEpNew && i < taosArrayGetSize(pConsumerEpNew->vgs); i++){ - SMqVgEp *pVgEp = taosArrayGetP(pConsumerEpNew->vgs, i); - if(pVgEp->vgId == d1->vgId){ - jump = true; - mInfo("pSub->offsetRows jump, because consumer id:0x%"PRIx64 " and vgId:%d not change", pConsumerEp->consumerId, pVgEp->vgId); - break; - } - } - if(jump) continue; - bool find = false; - for (int i = 0; i < taosArrayGetSize(pOutput->pSub->offsetRows); i++) { - OffsetRows *d2 = taosArrayGet(pOutput->pSub->offsetRows, i); - if (d1->vgId == d2->vgId) { - d2->rows += d1->rows; - d2->offset = d1->offset; - d2->ever = d1->ever; - find = true; - mInfo("pSub->offsetRows add vgId:%d, after:%"PRId64", before:%"PRId64, d2->vgId, d2->rows, d1->rows); - break; - } - } - if(!find){ - taosArrayPush(pOutput->pSub->offsetRows, d1); + for (int j = 0; j < taosArrayGetSize(pConsumerEp->offsetRows); j++) { + OffsetRows *d1 = taosArrayGet(pConsumerEp->offsetRows, j); + bool jump = false; + for (int i = 0; pConsumerEpNew && i < taosArrayGetSize(pConsumerEpNew->vgs); i++){ + SMqVgEp *pVgEp = taosArrayGetP(pConsumerEpNew->vgs, i); + if(pVgEp->vgId == d1->vgId){ + jump = true; + mInfo("pSub->offsetRows jump, because consumer id:0x%"PRIx64 " and vgId:%d not change", pConsumerEp->consumerId, pVgEp->vgId); + break; } } + if(jump) continue; + bool find = false; + for (int i = 0; i < taosArrayGetSize(pOutput->pSub->offsetRows); i++) { + OffsetRows *d2 = taosArrayGet(pOutput->pSub->offsetRows, i); + if (d1->vgId == d2->vgId) { + d2->rows += d1->rows; + d2->offset = d1->offset; + d2->ever = d1->ever; + find = true; + mInfo("pSub->offsetRows add vgId:%d, after:%"PRId64", before:%"PRId64, d2->vgId, d2->rows, d1->rows); + break; + } + } + if(!find){ + taosArrayPush(pOutput->pSub->offsetRows, d1); + } } - taosRUnLockLatch(&pSub->lock); - mndReleaseSubscribe(pMnode, pSub); } + taosRUnLockLatch(&pSub->lock); + mndReleaseSubscribe(pMnode, pSub); +} - // 8. generate logs - mInfo("sub:%s mq re-balance calculation completed, re-balanced vg", pSubKey); +static void printRebalanceLog(SMqRebOutputObj *pOutput){ + mInfo("sub:%s mq re-balance calculation completed, re-balanced vg", pOutput->pSub->key); for (int32_t i = 0; i < taosArrayGetSize(pOutput->rebVgs); i++) { SMqRebOutputVg *pOutputRebVg = taosArrayGet(pOutput->rebVgs, i); - mInfo("sub:%s mq re-balance vgId:%d, moved from consumer:0x%" PRIx64 ", to consumer:0x%" PRIx64, pSubKey, + mInfo("sub:%s mq re-balance vgId:%d, moved from consumer:0x%" PRIx64 ", to consumer:0x%" PRIx64, pOutput->pSub->key, pOutputRebVg->pVgEp->vgId, pOutputRebVg->oldConsumerId, pOutputRebVg->newConsumerId); } - pIter = NULL; + void *pIter = NULL; while (1) { pIter = taosHashIterate(pOutput->pSub->consumerHash, pIter); if (pIter == NULL) break; SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter; int32_t sz = taosArrayGetSize(pConsumerEp->vgs); - mInfo("sub:%s mq re-balance final cfg: consumer:0x%" PRIx64 " has %d vg", pSubKey, pConsumerEp->consumerId, sz); + mInfo("sub:%s mq re-balance final cfg: consumer:0x%" PRIx64 " has %d vg", pOutput->pSub->key, pConsumerEp->consumerId, sz); for (int32_t i = 0; i < sz; i++) { SMqVgEp *pVgEp = taosArrayGetP(pConsumerEp->vgs, i); - mInfo("sub:%s mq re-balance final cfg: vg %d to consumer:0x%" PRIx64, pSubKey, pVgEp->vgId, + mInfo("sub:%s mq re-balance final cfg: vg %d to consumer:0x%" PRIx64, pOutput->pSub->key, pVgEp->vgId, pConsumerEp->consumerId); } } +} - // 9. clear +static void calcVgroupsCnt(const SMqRebInputObj *pInput, int32_t totalVgNum, const char *pSubKey, + int32_t *minVgCnt, int32_t *remainderVgCnt){ + int32_t numOfRemoved = taosArrayGetSize(pInput->pRebInfo->removedConsumers); + int32_t numOfAdded = taosArrayGetSize(pInput->pRebInfo->newConsumers); + int32_t numOfFinal = pInput->oldConsumerNum + numOfAdded - numOfRemoved; + + // calc num + if (numOfFinal != 0) { + *minVgCnt = totalVgNum / numOfFinal; + *remainderVgCnt = totalVgNum % numOfFinal; + } else { + mInfo("[rebalance] sub:%s no consumer subscribe this topic", pSubKey); + } + mInfo("[rebalance] sub:%s mq rebalance %d vgroups, existed consumers:%d, added:%d, removed:%d, minVg:%d remainderVg:%d", + pSubKey, totalVgNum, pInput->oldConsumerNum, numOfAdded, numOfRemoved, *minVgCnt, *remainderVgCnt); +} + +static void assignVgroups(SMqRebOutputObj *pOutput, SHashObj *pHash, int32_t minVgCnt){ + SMqRebOutputVg *pRebVg = NULL; + void *pAssignIter = NULL; + void *pIter = NULL; + + while (1) { + pIter = taosHashIterate(pOutput->pSub->consumerHash, pIter); + if (pIter == NULL) { + break; + } + SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter; + while (taosArrayGetSize(pConsumerEp->vgs) < minVgCnt) { + pAssignIter = taosHashIterate(pHash, pAssignIter); + if (pAssignIter == NULL) { + mError("[rebalance] sub:%s assign iter is NULL, never should reach here", pOutput->pSub->key); + break; + } + + pRebVg = (SMqRebOutputVg *)pAssignIter; + pRebVg->newConsumerId = pConsumerEp->consumerId; + taosArrayPush(pConsumerEp->vgs, &pRebVg->pVgEp); + mInfo("[rebalance] mq rebalance: add vgId:%d to consumer:0x%" PRIx64 " for average", + pRebVg->pVgEp->vgId, pConsumerEp->consumerId); + } + } + + while (1) { + pIter = taosHashIterate(pOutput->pSub->consumerHash, pIter); + if (pIter == NULL) { + break; + } + SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter; + if (taosArrayGetSize(pConsumerEp->vgs) == minVgCnt) { + pAssignIter = taosHashIterate(pHash, pAssignIter); + if (pAssignIter == NULL) { + mInfo("[rebalance] sub:%s assign iter is used up", pOutput->pSub->key); + break; + } + + pRebVg = (SMqRebOutputVg *)pAssignIter; + pRebVg->newConsumerId = pConsumerEp->consumerId; + taosArrayPush(pConsumerEp->vgs, &pRebVg->pVgEp); + mInfo("[rebalance] mq rebalance: add vgId:%d to consumer:0x%" PRIx64 " for average + 1", + pRebVg->pVgEp->vgId, pConsumerEp->consumerId); + } + } + + taosHashCancelIterate(pOutput->pSub->consumerHash, pIter); + if(pAssignIter != NULL){ + mError("[rebalance]sub:%s assign iter is not NULL, never should reach here", pOutput->pSub->key); + } + while (1) { + pAssignIter = taosHashIterate(pHash, pAssignIter); + if (pAssignIter == NULL) { + break; + } + + SMqRebOutputVg* pRebOutput = (SMqRebOutputVg *)pAssignIter; + taosArrayPush(pOutput->rebVgs, pRebOutput); + if(taosHashGetSize(pOutput->pSub->consumerHash) == 0){ // if all consumer is removed + taosArrayPush(pOutput->pSub->unassignedVgs, &pRebOutput->pVgEp); // put all vg into unassigned + } + } +} + +static void mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqRebOutputObj *pOutput) { + int32_t totalVgNum = processRemoveAddVgs(pMnode, pOutput); + const char *pSubKey = pOutput->pSub->key; + int32_t minVgCnt = 0; + int32_t remainderVgCnt = 0; + + SHashObj *pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK); + + processRemovedConsumers(pOutput, pHash, pInput); + processUnassignedVgroups(pOutput, pHash); + calcVgroupsCnt(pInput, totalVgNum, pSubKey, &minVgCnt, &remainderVgCnt); + processModifiedConsumers(pOutput, pHash, minVgCnt, remainderVgCnt); + processNewConsumers(pOutput, pInput); + assignVgroups(pOutput, pHash, minVgCnt); + processSubOffsetRows(pMnode, pInput, pOutput); + printRebalanceLog(pOutput); taosHashCleanup(pHash); +} - return 0; +static int32_t presistConsumerByType(STrans *pTrans, SArray* consumers, int8_t type, char *cgroup, char *topic){ + int32_t code = 0; + SMqConsumerObj *pConsumerNew = NULL; + int32_t consumerNum = taosArrayGetSize(consumers); + for (int32_t i = 0; i < consumerNum; i++) { + int64_t consumerId = *(int64_t *)taosArrayGet(consumers, i); + pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup, type, topic, NULL); + if (pConsumerNew == NULL){ + code = TSDB_CODE_OUT_OF_MEMORY; + goto END; + } + + code = mndSetConsumerCommitLogs(pTrans, pConsumerNew); + if (code != 0) { + goto END; + } + + tDeleteSMqConsumerObj(pConsumerNew); + } + pConsumerNew = NULL; + +END: + tDeleteSMqConsumerObj(pConsumerNew); + return code; +} + +static int32_t mndPresistConsumer(STrans *pTrans, const SMqRebOutputObj *pOutput, char *cgroup, char *topic){ + int32_t code = presistConsumerByType(pTrans, pOutput->modifyConsumers, CONSUMER_UPDATE_REB, cgroup, NULL); + if (code != 0) { + return code; + } + + code = presistConsumerByType(pTrans, pOutput->newConsumers, CONSUMER_ADD_REB, cgroup, topic); + if (code != 0) { + return code; + } + + return presistConsumerByType(pTrans, pOutput->removedConsumers, CONSUMER_REMOVE_REB, cgroup, topic); } static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOutputObj *pOutput) { - struct SSubplan* pPlan = NULL; + struct SSubplan *pPlan = NULL; + int32_t code = 0; + STrans *pTrans = NULL; + if(strcmp(pOutput->pSub->qmsg, "") != 0){ - int32_t code = qStringToSubplan(pOutput->pSub->qmsg, &pPlan); - if (code != TSDB_CODE_SUCCESS) { + code = qStringToSubplan(pOutput->pSub->qmsg, &pPlan); + if (code != 0) { terrno = code; - return -1; + goto END; } } @@ -618,110 +618,51 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu char cgroup[TSDB_CGROUP_LEN] = {0}; mndSplitSubscribeKey(pOutput->pSub->key, topic, cgroup, true); - STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "tmq-reb"); + pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "tmq-reb"); if (pTrans == NULL) { - nodesDestroyNode((SNode*)pPlan); - return -1; + code = TSDB_CODE_OUT_OF_MEMORY; + goto END; } mndTransSetDbName(pTrans, topic, cgroup); - if (mndTransCheckConflict(pMnode, pTrans) != 0) { - mndTransDrop(pTrans); - nodesDestroyNode((SNode*)pPlan); - return -1; + code = mndTransCheckConflict(pMnode, pTrans); + if (code != 0) { + goto END; } - // make txn: // 1. redo action: action to all vg const SArray *rebVgs = pOutput->rebVgs; int32_t vgNum = taosArrayGetSize(rebVgs); for (int32_t i = 0; i < vgNum; i++) { SMqRebOutputVg *pRebVg = taosArrayGet(rebVgs, i); - if (mndPersistSubChangeVgReq(pMnode, pTrans, pOutput->pSub, pRebVg, pPlan) < 0) { - mndTransDrop(pTrans); - nodesDestroyNode((SNode*)pPlan); - return -1; + code = mndPersistSubChangeVgReq(pMnode, pTrans, pOutput->pSub, pRebVg, pPlan); + if (code != 0) { + goto END; } } - nodesDestroyNode((SNode*)pPlan); - // 2. redo log: subscribe and vg assignment - // subscribe - if (mndSetSubCommitLogs(pMnode, pTrans, pOutput->pSub) != 0) { - mndTransDrop(pTrans); - return -1; + // 2. commit log: subscribe and vg assignment + code = mndSetSubCommitLogs(pTrans, pOutput->pSub); + if (code != 0) { + goto END; } // 3. commit log: consumer to update status and epoch - // 3.1 set touched consumer - int32_t consumerNum = taosArrayGetSize(pOutput->modifyConsumers); - for (int32_t i = 0; i < consumerNum; i++) { - int64_t consumerId = *(int64_t *)taosArrayGet(pOutput->modifyConsumers, i); - SMqConsumerObj *pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup); - pConsumerNew->updateType = CONSUMER_UPDATE_REB; - if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) { - tDeleteSMqConsumerObj(pConsumerNew, true); - - mndTransDrop(pTrans); - return -1; - } - - tDeleteSMqConsumerObj(pConsumerNew, true); + code = mndPresistConsumer(pTrans, pOutput, cgroup, topic); + if (code != 0) { + goto END; } - // 3.2 set new consumer - consumerNum = taosArrayGetSize(pOutput->newConsumers); - for (int32_t i = 0; i < consumerNum; i++) { - int64_t consumerId = *(int64_t *)taosArrayGet(pOutput->newConsumers, i); - SMqConsumerObj *pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup); - pConsumerNew->updateType = CONSUMER_ADD_REB; - - char* topicTmp = taosStrdup(topic); - taosArrayPush(pConsumerNew->rebNewTopics, &topicTmp); - if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) { - tDeleteSMqConsumerObj(pConsumerNew, true); - - mndTransDrop(pTrans); - return -1; - } - - tDeleteSMqConsumerObj(pConsumerNew, true); - } - - // 3.3 set removed consumer - consumerNum = taosArrayGetSize(pOutput->removedConsumers); - for (int32_t i = 0; i < consumerNum; i++) { - int64_t consumerId = *(int64_t *)taosArrayGet(pOutput->removedConsumers, i); - - SMqConsumerObj *pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup); - pConsumerNew->updateType = CONSUMER_REMOVE_REB; - - char* topicTmp = taosStrdup(topic); - taosArrayPush(pConsumerNew->rebRemovedTopics, &topicTmp); - if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) { - tDeleteSMqConsumerObj(pConsumerNew, true); - - mndTransDrop(pTrans); - return -1; - } - - tDeleteSMqConsumerObj(pConsumerNew, true); - } - - // 4. TODO commit log: modification log - - // 5. set cb + // 4. set cb mndTransSetCb(pTrans, TRANS_START_FUNC_MQ_REB, TRANS_STOP_FUNC_MQ_REB, NULL, 0); - // 6. execution - if (mndTransPrepare(pMnode, pTrans) != 0) { - mError("failed to prepare trans rebalance since %s", terrstr()); - mndTransDrop(pTrans); - return -1; - } + // 5. execution + code = mndTransPrepare(pMnode, pTrans); +END: + nodesDestroyNode((SNode*)pPlan); mndTransDrop(pTrans); - return 0; + return code; } static void freeRebalanceItem(void *param) { @@ -730,10 +671,55 @@ static void freeRebalanceItem(void *param) { taosArrayDestroy(pInfo->removedConsumers); } -static int32_t mndCheckConsumer(SRpcMsg *pMsg, SHashObj* rebSubHash) { +// type = 0 remove type = 1 add +static void buildRebInfo(SHashObj* rebSubHash, SArray* topicList, int8_t type, char *group, int64_t consumerId){ + int32_t topicNum = taosArrayGetSize(topicList); + for (int32_t i = 0; i < topicNum; i++) { + char key[TSDB_SUBSCRIBE_KEY_LEN]; + char *removedTopic = taosArrayGetP(topicList, i); + mndMakeSubscribeKey(key, group, removedTopic); + SMqRebInfo *pRebSub = mndGetOrCreateRebSub(rebSubHash, key); + if(type == 0) + taosArrayPush(pRebSub->removedConsumers, &consumerId); + else if(type == 1) + taosArrayPush(pRebSub->newConsumers, &consumerId); + } +} + +static void checkForVgroupSplit(SMnode *pMnode, SMqConsumerObj *pConsumer, SHashObj* rebSubHash){ + int32_t newTopicNum = taosArrayGetSize(pConsumer->currentTopics); + for (int32_t i = 0; i < newTopicNum; i++) { + char * topic = taosArrayGetP(pConsumer->currentTopics, i); + SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic); + if (pSub == NULL) { + continue; + } + taosRLockLatch(&pSub->lock); + + // iterate all vg assigned to the consumer of that topic + SMqConsumerEp *pConsumerEp = taosHashGet(pSub->consumerHash, &pConsumer->consumerId, sizeof(int64_t)); + int32_t vgNum = taosArrayGetSize(pConsumerEp->vgs); + + for (int32_t j = 0; j < vgNum; j++) { + SMqVgEp *pVgEp = taosArrayGetP(pConsumerEp->vgs, j); + SVgObj * pVgroup = mndAcquireVgroup(pMnode, pVgEp->vgId); + if (!pVgroup) { + char key[TSDB_SUBSCRIBE_KEY_LEN]; + mndMakeSubscribeKey(key, pConsumer->cgroup, topic); + mndGetOrCreateRebSub(rebSubHash, key); + mInfo("vnode splitted, vgId:%d rebalance will be triggered", pVgEp->vgId); + } + mndReleaseVgroup(pMnode, pVgroup); + } + taosRUnLockLatch(&pSub->lock); + mndReleaseSubscribe(pMnode, pSub); + } +} + +static void mndCheckConsumer(SRpcMsg *pMsg, SHashObj* rebSubHash) { SMnode *pMnode = pMsg->info.node; SSdb *pSdb = pMnode->pSdb; - SMqConsumerObj *pConsumer; + SMqConsumerObj *pConsumer = NULL; void *pIter = NULL; // iterate all consumers, find all modification @@ -746,89 +732,32 @@ static int32_t mndCheckConsumer(SRpcMsg *pMsg, SHashObj* rebSubHash) { int32_t hbStatus = atomic_add_fetch_32(&pConsumer->hbStatus, 1); int32_t status = atomic_load_32(&pConsumer->status); - mDebug("check for consumer:0x%" PRIx64 " status:%d(%s), sub-time:%" PRId64 ", createTime:%" PRId64 ", hbstatus:%d", - pConsumer->consumerId, status, mndConsumerStatusName(status), pConsumer->subscribeTime, pConsumer->createTime, - hbStatus); + mDebug("[rebalance] check for consumer:0x%" PRIx64 " status:%d(%s), sub-time:%" PRId64 ", createTime:%" PRId64 ", hbstatus:%d", + pConsumer->consumerId, status, mndConsumerStatusName(status), pConsumer->subscribeTime, pConsumer->createTime, hbStatus); if (status == MQ_CONSUMER_STATUS_READY) { - if (taosArrayGetSize(pConsumer->assignedTopics) == 0) { // unsubscribe or close - mndDropConsumerFromSdb(pMnode, pConsumer->consumerId, &pMsg->info); + if (taosArrayGetSize(pConsumer->assignedTopics) == 0) {// unsubscribe or close + mndSendConsumerMsg(pMnode, pConsumer->consumerId, TDMT_MND_TMQ_LOST_CONSUMER_CLEAR, &pMsg->info); } else if (hbStatus > MND_CONSUMER_LOST_HB_CNT) { taosRLockLatch(&pConsumer->lock); - int32_t topicNum = taosArrayGetSize(pConsumer->currentTopics); - for (int32_t i = 0; i < topicNum; i++) { - char key[TSDB_SUBSCRIBE_KEY_LEN]; - char *removedTopic = taosArrayGetP(pConsumer->currentTopics, i); - mndMakeSubscribeKey(key, pConsumer->cgroup, removedTopic); - SMqRebInfo *pRebSub = mndGetOrCreateRebSub(rebSubHash, key); - taosArrayPush(pRebSub->removedConsumers, &pConsumer->consumerId); - } + buildRebInfo(rebSubHash, pConsumer->currentTopics, 0, pConsumer->cgroup, pConsumer->consumerId); taosRUnLockLatch(&pConsumer->lock); }else{ - int32_t newTopicNum = taosArrayGetSize(pConsumer->currentTopics); - for (int32_t i = 0; i < newTopicNum; i++) { - char * topic = taosArrayGetP(pConsumer->currentTopics, i); - SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic); - if (pSub == NULL) { - continue; - } - taosRLockLatch(&pSub->lock); - - // 2.2 iterate all vg assigned to the consumer of that topic - SMqConsumerEp *pConsumerEp = taosHashGet(pSub->consumerHash, &pConsumer->consumerId, sizeof(int64_t)); - int32_t vgNum = taosArrayGetSize(pConsumerEp->vgs); - - for (int32_t j = 0; j < vgNum; j++) { - SMqVgEp *pVgEp = taosArrayGetP(pConsumerEp->vgs, j); - SVgObj * pVgroup = mndAcquireVgroup(pMnode, pVgEp->vgId); - if (!pVgroup) { - char key[TSDB_SUBSCRIBE_KEY_LEN]; - mndMakeSubscribeKey(key, pConsumer->cgroup, topic); - mndGetOrCreateRebSub(rebSubHash, key); - mInfo("vnode splitted, vgId:%d rebalance will be triggered", pVgEp->vgId); - } - mndReleaseVgroup(pMnode, pVgroup); - } - taosRUnLockLatch(&pSub->lock); - mndReleaseSubscribe(pMnode, pSub); - } + checkForVgroupSplit(pMnode, pConsumer, rebSubHash); } } else if (status == MQ_CONSUMER_STATUS_LOST) { - if (hbStatus > MND_CONSUMER_LOST_CLEAR_THRESHOLD) { // clear consumer if lost a day - mndDropConsumerFromSdb(pMnode, pConsumer->consumerId, &pMsg->info); + if (hbStatus > MND_CONSUMER_LOST_CLEAR_THRESHOLD) { // clear consumer if lost a day + mndSendConsumerMsg(pMnode, pConsumer->consumerId, TDMT_MND_TMQ_LOST_CONSUMER_CLEAR, &pMsg->info); } } else { taosRLockLatch(&pConsumer->lock); - - int32_t newTopicNum = taosArrayGetSize(pConsumer->rebNewTopics); - for (int32_t i = 0; i < newTopicNum; i++) { - char key[TSDB_SUBSCRIBE_KEY_LEN]; - char *newTopic = taosArrayGetP(pConsumer->rebNewTopics, i); - mndMakeSubscribeKey(key, pConsumer->cgroup, newTopic); - SMqRebInfo *pRebSub = mndGetOrCreateRebSub(rebSubHash, key); - taosArrayPush(pRebSub->newConsumers, &pConsumer->consumerId); - } - - int32_t removedTopicNum = taosArrayGetSize(pConsumer->rebRemovedTopics); - for (int32_t i = 0; i < removedTopicNum; i++) { - char key[TSDB_SUBSCRIBE_KEY_LEN]; - char *removedTopic = taosArrayGetP(pConsumer->rebRemovedTopics, i); - mndMakeSubscribeKey(key, pConsumer->cgroup, removedTopic); - SMqRebInfo *pRebSub = mndGetOrCreateRebSub(rebSubHash, key); - taosArrayPush(pRebSub->removedConsumers, &pConsumer->consumerId); - } - - if (newTopicNum == 0 && removedTopicNum == 0 && taosArrayGetSize(pConsumer->assignedTopics) == 0) { // unsubscribe or close - mndDropConsumerFromSdb(pMnode, pConsumer->consumerId, &pMsg->info); - } - + buildRebInfo(rebSubHash, pConsumer->rebNewTopics, 1, pConsumer->cgroup, pConsumer->consumerId); + buildRebInfo(rebSubHash, pConsumer->rebRemovedTopics, 0, pConsumer->cgroup, pConsumer->consumerId); taosRUnLockLatch(&pConsumer->lock); } mndReleaseConsumer(pMnode, pConsumer); } - - return 0; } bool mndRebTryStart() { @@ -847,31 +776,95 @@ void mndRebCntDec() { mInfo("rebalance cnt sub, value:%d", val); } +static void clearRebOutput(SMqRebOutputObj *rebOutput){ + taosArrayDestroy(rebOutput->newConsumers); + taosArrayDestroy(rebOutput->modifyConsumers); + taosArrayDestroy(rebOutput->removedConsumers); + taosArrayDestroy(rebOutput->rebVgs); + tDeleteSubscribeObj(rebOutput->pSub); + taosMemoryFree(rebOutput->pSub); +} + +static int32_t initRebOutput(SMqRebOutputObj *rebOutput) { + rebOutput->newConsumers = taosArrayInit(0, sizeof(int64_t)); + rebOutput->removedConsumers = taosArrayInit(0, sizeof(int64_t)); + rebOutput->modifyConsumers = taosArrayInit(0, sizeof(int64_t)); + rebOutput->rebVgs = taosArrayInit(0, sizeof(SMqRebOutputVg)); + + if (rebOutput->newConsumers == NULL || rebOutput->removedConsumers == NULL || rebOutput->modifyConsumers == NULL || + rebOutput->rebVgs == NULL) { + clearRebOutput(rebOutput); + return TSDB_CODE_OUT_OF_MEMORY; + } + return 0; +} + +static int32_t buildRebOutput(SMnode *pMnode, SMqRebInputObj *rebInput, SMqRebOutputObj *rebOutput){ + const char *key = rebInput->pRebInfo->key; + SMqSubscribeObj *pSub = mndAcquireSubscribeByKey(pMnode, key); + + if (pSub == NULL) { + // split sub key and extract topic + char topic[TSDB_TOPIC_FNAME_LEN]; + char cgroup[TSDB_CGROUP_LEN]; + mndSplitSubscribeKey(key, topic, cgroup, true); + + SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic); + if (pTopic == NULL) { + mError("[rebalance] mq rebalance %s ignored since topic %s doesn't exist", key, topic); + return -1; + } + + taosRLockLatch(&pTopic->lock); + + rebInput->oldConsumerNum = 0; + rebOutput->pSub = mndCreateSubscription(pMnode, pTopic, key); + + if (rebOutput->pSub == NULL) { + mError("[rebalance] mq rebalance %s failed create sub since %s, ignore", key, terrstr()); + taosRUnLockLatch(&pTopic->lock); + mndReleaseTopic(pMnode, pTopic); + return -1; + } + + memcpy(rebOutput->pSub->dbName, pTopic->db, TSDB_DB_FNAME_LEN); + taosRUnLockLatch(&pTopic->lock); + mndReleaseTopic(pMnode, pTopic); + + mInfo("[rebalance] sub topic:%s has no consumers sub yet", key); + } else { + taosRLockLatch(&pSub->lock); + rebInput->oldConsumerNum = taosHashGetSize(pSub->consumerHash); + rebOutput->pSub = tCloneSubscribeObj(pSub); + taosRUnLockLatch(&pSub->lock); + + mInfo("[rebalance] sub topic:%s has %d consumers sub till now", key, rebInput->oldConsumerNum); + mndReleaseSubscribe(pMnode, pSub); + } + return 0; +} + static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) { - int code = 0; - mInfo("start to process mq timer"); + int code = 0; + void *pIter = NULL; + SMnode *pMnode = pMsg->info.node; + mInfo("[rebalance] start to process mq timer"); if (!mndRebTryStart()) { - mInfo("mq rebalance already in progress, do nothing"); + mInfo("[rebalance] mq rebalance already in progress, do nothing"); return code; } SHashObj *rebSubHash = taosHashInit(64, MurmurHash3_32, true, HASH_NO_LOCK); if (rebSubHash == NULL) { - mError("failed to create rebalance hashmap"); - terrno = TSDB_CODE_OUT_OF_MEMORY; - code = -1; + code = TSDB_CODE_OUT_OF_MEMORY; goto END; } - taosHashSetFreeFp(rebSubHash, freeRebalanceItem); mndCheckConsumer(pMsg, rebSubHash); - mInfo("mq re-balance start, total required re-balanced trans:%d", taosHashGetSize(rebSubHash)); + mInfo("[rebalance] mq re-balance start, total required re-balanced trans:%d", taosHashGetSize(rebSubHash)); - // here we only handle one topic rebalance requirement to ensure the atomic execution of this transaction. - void *pIter = NULL; - SMnode *pMnode = pMsg->info.node; while (1) { pIter = taosHashIterate(rebSubHash, pIter); if (pIter == NULL) { @@ -880,92 +873,30 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) { SMqRebInputObj rebInput = {0}; SMqRebOutputObj rebOutput = {0}; - rebOutput.newConsumers = taosArrayInit(0, sizeof(int64_t)); - rebOutput.removedConsumers = taosArrayInit(0, sizeof(int64_t)); - rebOutput.modifyConsumers = taosArrayInit(0, sizeof(int64_t)); - rebOutput.rebVgs = taosArrayInit(0, sizeof(SMqRebOutputVg)); - - if (rebOutput.newConsumers == NULL || rebOutput.removedConsumers == NULL || rebOutput.modifyConsumers == NULL || - rebOutput.rebVgs == NULL) { - taosArrayDestroy(rebOutput.newConsumers); - taosArrayDestroy(rebOutput.removedConsumers); - taosArrayDestroy(rebOutput.modifyConsumers); - taosArrayDestroy(rebOutput.rebVgs); - - taosHashCancelIterate(rebSubHash, pIter); - terrno = TSDB_CODE_OUT_OF_MEMORY; - mError("mq re-balance failed, due to out of memory"); - code = -1; + code = initRebOutput(&rebOutput); + if (code != 0){ goto END; } - SMqRebInfo *pRebInfo = (SMqRebInfo *)pIter; - SMqSubscribeObj *pSub = mndAcquireSubscribeByKey(pMnode, pRebInfo->key); + rebInput.pRebInfo = (SMqRebInfo*)pIter; - rebInput.pRebInfo = pRebInfo; - - if (pSub == NULL) { - // split sub key and extract topic - char topic[TSDB_TOPIC_FNAME_LEN]; - char cgroup[TSDB_CGROUP_LEN]; - mndSplitSubscribeKey(pRebInfo->key, topic, cgroup, true); - - SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic); - if (pTopic == NULL) { - mError("mq re-balance %s ignored since topic %s doesn't exist", pRebInfo->key, topic); - continue; - } - - taosRLockLatch(&pTopic->lock); - - rebOutput.pSub = mndCreateSubscription(pMnode, pTopic, pRebInfo->key); - - if (rebOutput.pSub == NULL) { - mError("mq rebalance %s failed create sub since %s, ignore", pRebInfo->key, terrstr()); - taosRUnLockLatch(&pTopic->lock); - mndReleaseTopic(pMnode, pTopic); - continue; - } - - memcpy(rebOutput.pSub->dbName, pTopic->db, TSDB_DB_FNAME_LEN); - taosRUnLockLatch(&pTopic->lock); - mndReleaseTopic(pMnode, pTopic); - - rebInput.oldConsumerNum = 0; - mInfo("sub topic:%s has no consumers sub yet", pRebInfo->key); - } else { - taosRLockLatch(&pSub->lock); - rebInput.oldConsumerNum = taosHashGetSize(pSub->consumerHash); - rebOutput.pSub = tCloneSubscribeObj(pSub); - taosRUnLockLatch(&pSub->lock); - - mInfo("sub topic:%s has %d consumers sub till now", pRebInfo->key, rebInput.oldConsumerNum); - mndReleaseSubscribe(pMnode, pSub); + if (buildRebOutput(pMnode, &rebInput, &rebOutput) != 0){ + continue; } - if (mndDoRebalance(pMnode, &rebInput, &rebOutput) < 0) { - mError("mq re-balance internal error"); - } + mndDoRebalance(pMnode, &rebInput, &rebOutput); - // if add more consumer to balanced subscribe, - // possibly no vg is changed - // when each topic is re-balanced, issue an trans to save the results in sdb. - if (mndPersistRebResult(pMnode, pMsg, &rebOutput) < 0) { + if (mndPersistRebResult(pMnode, pMsg, &rebOutput) != 0) { mError("mq re-balance persist output error, possibly vnode splitted or dropped,msg:%s", terrstr()); } - taosArrayDestroy(rebOutput.newConsumers); - taosArrayDestroy(rebOutput.modifyConsumers); - taosArrayDestroy(rebOutput.removedConsumers); - taosArrayDestroy(rebOutput.rebVgs); - tDeleteSubscribeObj(rebOutput.pSub); - taosMemoryFree(rebOutput.pSub); + clearRebOutput(&rebOutput); } - // reset flag - mInfo("mq re-balance completed successfully"); + mInfo("[rebalance] mq re-balance completed successfully, wait trans finish"); END: + taosHashCancelIterate(rebSubHash, pIter); taosHashCleanup(rebSubHash); mndRebCntDec(); @@ -995,6 +926,28 @@ static int32_t sendDeleteSubToVnode(SMqSubscribeObj *pSub, STrans *pTrans){ return 0; } +static int32_t mndDropConsumerByGroup(SMnode *pMnode, STrans *pTrans, char *cgroup, char *topic){ + void *pIter = NULL; + SMqConsumerObj *pConsumer = NULL; + while (1) { + pIter = sdbFetch(pMnode->pSdb, SDB_CONSUMER, pIter, (void **)&pConsumer); + if (pIter == NULL) { + break; + } + + if (strcmp(cgroup, pConsumer->cgroup) == 0 && taosArrayGetSize(pConsumer->currentTopics) == 0) { + int32_t code = mndSetConsumerDropLogs(pTrans, pConsumer); + if (code != 0) { + sdbRelease(pMnode->pSdb, pConsumer); + sdbCancelFetch(pMnode->pSdb, pIter); + return code; + } + } + sdbRelease(pMnode->pSdb, pConsumer); + } + return 0; +} + static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) { SMnode *pMnode = pMsg->info.node; SMDropCgroupReq dropReq = {0}; @@ -1033,41 +986,31 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) { goto end; } + mInfo("trans:%d, used to drop cgroup:%s on topic %s", pTrans->id, dropReq.cgroup, dropReq.topic); mndTransSetDbName(pTrans, dropReq.topic, dropReq.cgroup); code = mndTransCheckConflict(pMnode, pTrans); if (code != 0) { goto end; } - void *pIter = NULL; - SMqConsumerObj *pConsumer; - while (1) { - pIter = sdbFetch(pMnode->pSdb, SDB_CONSUMER, pIter, (void **)&pConsumer); - if (pIter == NULL) { - break; - } - - if (strcmp(dropReq.cgroup, pConsumer->cgroup) == 0) { - mndDropConsumerFromSdb(pMnode, pConsumer->consumerId, &pMsg->info); - } - sdbRelease(pMnode->pSdb, pConsumer); + code = mndDropConsumerByGroup(pMnode, pTrans, dropReq.cgroup, dropReq.topic); + if (code != 0) { + goto end; } - mInfo("trans:%d, used to drop cgroup:%s on topic %s", pTrans->id, dropReq.cgroup, dropReq.topic); - code = sendDeleteSubToVnode(pSub, pTrans); if (code != 0) { goto end; } - if (mndSetDropSubCommitLogs(pMnode, pTrans, pSub) < 0) { + code = mndSetDropSubCommitLogs(pMnode, pTrans, pSub); + if (code != 0) { mError("cgroup %s on topic:%s, failed to drop since %s", dropReq.cgroup, dropReq.topic, terrstr()); - code = -1; goto end; } - if (mndTransPrepare(pMnode, pTrans) < 0) { - code = -1; + code = mndTransPrepare(pMnode, pTrans); + if (code != 0) { goto end; } @@ -1219,12 +1162,11 @@ static int32_t mndSubActionUpdate(SSdb *pSdb, SMqSubscribeObj *pOldSub, SMqSubsc return 0; } -int32_t mndMakeSubscribeKey(char *key, const char *cgroup, const char *topicName) { +void mndMakeSubscribeKey(char *key, const char *cgroup, const char *topicName) { int32_t tlen = strlen(cgroup); memcpy(key, cgroup, tlen); key[tlen] = TMQ_SEPARATOR; strcpy(key + tlen + 1, topicName); - return 0; } SMqSubscribeObj *mndAcquireSubscribe(SMnode *pMnode, const char *cgroup, const char *topicName) { @@ -1294,40 +1236,13 @@ int32_t mndSetDropSubCommitLogs(SMnode *pMnode, STrans *pTrans, SMqSubscribeObj return 0; } -//int32_t mndDropSubByDB(SMnode *pMnode, STrans *pTrans, SDbObj *pDb) { -// int32_t code = 0; -// SSdb *pSdb = pMnode->pSdb; -// -// void *pIter = NULL; -// SMqSubscribeObj *pSub = NULL; -// while (1) { -// pIter = sdbFetch(pSdb, SDB_SUBSCRIBE, pIter, (void **)&pSub); -// if (pIter == NULL) break; -// -// if (pSub->dbUid != pDb->uid) { -// sdbRelease(pSdb, pSub); -// continue; -// } -// -// if (mndSetDropSubCommitLogs(pMnode, pTrans, pSub) < 0) { -// sdbRelease(pSdb, pSub); -// sdbCancelFetch(pSdb, pIter); -// code = -1; -// break; -// } -// -// sdbRelease(pSdb, pSub); -// } -// -// return code; -//} - int32_t mndDropSubByTopic(SMnode *pMnode, STrans *pTrans, const char *topicName) { - SSdb *pSdb = pMnode->pSdb; - + SSdb *pSdb = pMnode->pSdb; + int32_t code = 0; void *pIter = NULL; SMqSubscribeObj *pSub = NULL; while (1) { + sdbRelease(pSdb, pSub); pIter = sdbFetch(pSdb, SDB_SUBSCRIBE, pIter, (void **)&pSub); if (pIter == NULL) break; @@ -1335,33 +1250,31 @@ int32_t mndDropSubByTopic(SMnode *pMnode, STrans *pTrans, const char *topicName) char cgroup[TSDB_CGROUP_LEN] = {0}; mndSplitSubscribeKey(pSub->key, topic, cgroup, true); if (strcmp(topic, topicName) != 0) { - sdbRelease(pSdb, pSub); continue; } // iter all vnode to delete handle if (taosHashGetSize(pSub->consumerHash) != 0) { - sdbRelease(pSdb, pSub); - terrno = TSDB_CODE_MND_IN_REBALANCE; - sdbCancelFetch(pSdb, pIter); - return -1; - } - if (sendDeleteSubToVnode(pSub, pTrans) != 0) { - sdbRelease(pSdb, pSub); - sdbCancelFetch(pSdb, pIter); - return -1; + code = TSDB_CODE_MND_IN_REBALANCE; + goto END; } - if (mndSetDropSubCommitLogs(pMnode, pTrans, pSub) < 0) { - sdbRelease(pSdb, pSub); - sdbCancelFetch(pSdb, pIter); - return -1; + code = sendDeleteSubToVnode(pSub, pTrans); + if (code != 0) { + goto END; } - sdbRelease(pSdb, pSub); + code = mndSetDropSubCommitLogs(pMnode, pTrans, pSub); + if (code != 0) { + goto END; + } } - return 0; +END: + sdbRelease(pSdb, pSub); + sdbCancelFetch(pSdb, pIter); + + return code; } static int32_t buildResult(SSDataBlock *pBlock, int32_t* numOfRows, int64_t consumerId, const char* topic, const char* cgroup, SArray* vgs, SArray *offsetRows){ diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index de543f4256..4a0d58a32e 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -353,6 +353,66 @@ static int32_t extractTopicTbInfo(SNode *pAst, SMqTopicObj *pTopic) { return 0; } +static int32_t sendCheckInfoToVnode(STrans *pTrans, SMnode *pMnode, SMqTopicObj *topicObj){ + STqCheckInfo info; + memcpy(info.topic, topicObj->name, TSDB_TOPIC_FNAME_LEN); + info.ntbUid = topicObj->ntbUid; + info.colIdList = topicObj->ntbColIds; + // broadcast forbid alter info + void *pIter = NULL; + SSdb *pSdb = pMnode->pSdb; + SVgObj *pVgroup = NULL; + int32_t code = 0; + void *buf = NULL; + + while (1) { + // iterate vg + pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); + if (pIter == NULL) break; + if (!mndVgroupInDb(pVgroup, topicObj->dbUid)) { + sdbRelease(pSdb, pVgroup); + continue; + } + + // encoder check alter info + int32_t len; + tEncodeSize(tEncodeSTqCheckInfo, &info, len, code); + if (code != 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto END; + } + buf = taosMemoryCalloc(1, sizeof(SMsgHead) + len); + void *abuf = POINTER_SHIFT(buf, sizeof(SMsgHead)); + SEncoder encoder; + tEncoderInit(&encoder, abuf, len); + code = tEncodeSTqCheckInfo(&encoder, &info); + if (code < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto END; + } + tEncoderClear(&encoder); + ((SMsgHead *)buf)->vgId = htonl(pVgroup->vgId); + // add redo action + STransAction action = {0}; + action.epSet = mndGetVgroupEpset(pMnode, pVgroup); + action.pCont = buf; + action.contLen = sizeof(SMsgHead) + len; + action.msgType = TDMT_VND_TMQ_ADD_CHECKINFO; + code = mndTransAppendRedoAction(pTrans, &action); + if (code != 0) { + goto END; + } + sdbRelease(pSdb, pVgroup); + buf = NULL; + } + +END: + taosMemoryFree(buf); + sdbRelease(pSdb, pVgroup); + sdbCancelFetch(pSdb, pIter); + return code; +} + static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *pCreate, SDbObj *pDb, const char *userName) { mInfo("start to create topic:%s", pCreate->name); @@ -396,13 +456,6 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq * topicObj.withMeta = pCreate->withMeta; if (pCreate->subType == TOPIC_SUB_TYPE__COLUMN) { - if (pCreate->withMeta) { - terrno = TSDB_CODE_MND_INVALID_TOPIC_OPTION; - mError("topic:%s, failed to create since %s", pCreate->name, terrstr()); - code = terrno; - goto _OUT; - } - topicObj.ast = taosStrdup(pCreate->ast); topicObj.astLen = strlen(pCreate->ast) + 1; @@ -474,59 +527,9 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq * (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY); if (topicObj.ntbUid != 0) { - STqCheckInfo info; - memcpy(info.topic, topicObj.name, TSDB_TOPIC_FNAME_LEN); - info.ntbUid = topicObj.ntbUid; - info.colIdList = topicObj.ntbColIds; - // broadcast forbid alter info - void *pIter = NULL; - SSdb *pSdb = pMnode->pSdb; - SVgObj *pVgroup = NULL; - while (1) { - // iterate vg - pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); - if (pIter == NULL) break; - if (!mndVgroupInDb(pVgroup, topicObj.dbUid)) { - sdbRelease(pSdb, pVgroup); - continue; - } - - // encoder check alter info - int32_t len; - tEncodeSize(tEncodeSTqCheckInfo, &info, len, code); - if (code < 0) { - sdbRelease(pSdb, pVgroup); - sdbCancelFetch(pSdb, pIter); - goto _OUT; - } - void *buf = taosMemoryCalloc(1, sizeof(SMsgHead) + len); - void *abuf = POINTER_SHIFT(buf, sizeof(SMsgHead)); - SEncoder encoder; - tEncoderInit(&encoder, abuf, len); - if (tEncodeSTqCheckInfo(&encoder, &info) < 0) { - taosMemoryFree(buf); - sdbRelease(pSdb, pVgroup); - sdbCancelFetch(pSdb, pIter); - code = -1; - goto _OUT; - } - tEncoderClear(&encoder); - ((SMsgHead *)buf)->vgId = htonl(pVgroup->vgId); - // add redo action - STransAction action = {0}; - action.epSet = mndGetVgroupEpset(pMnode, pVgroup); - action.pCont = buf; - action.contLen = sizeof(SMsgHead) + len; - action.msgType = TDMT_VND_TMQ_ADD_CHECKINFO; - if (mndTransAppendRedoAction(pTrans, &action) != 0) { - taosMemoryFree(buf); - sdbRelease(pSdb, pVgroup); - sdbCancelFetch(pSdb, pIter); - code = -1; - goto _OUT; - } - buf = NULL; - sdbRelease(pSdb, pVgroup); + code = sendCheckInfoToVnode(pTrans, pMnode, &topicObj); + if (code != 0){ + goto _OUT; } } @@ -618,7 +621,7 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) { tNameFromString(&topicName, createTopicReq.name, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE); //reuse this function for topic - auditRecord(pReq, pMnode->clusterId, "createTopic", dbname.dbname, topicName.dbname, + auditRecord(pReq, pMnode->clusterId, "createTopic", dbname.dbname, topicName.dbname, createTopicReq.sql, strlen(createTopicReq.sql)); _OVER: @@ -653,9 +656,104 @@ _OVER: return code; } +static bool checkTopic(SArray *topics, char *topicName){ + int32_t sz = taosArrayGetSize(topics); + for (int32_t i = 0; i < sz; i++) { + char *name = taosArrayGetP(topics, i); + if (strcmp(name, topicName) == 0) { + return true; + } + } + return false; +} + +static int32_t mndDropConsumerByTopic(SMnode *pMnode, STrans *pTrans, char *topicName){ + int32_t code = 0; + SSdb *pSdb = pMnode->pSdb; + void *pIter = NULL; + SMqConsumerObj *pConsumer = NULL; + while (1) { + pIter = sdbFetch(pSdb, SDB_CONSUMER, pIter, (void **)&pConsumer); + if (pIter == NULL) { + break; + } + + bool found = checkTopic(pConsumer->assignedTopics, topicName); + if (found){ + if (pConsumer->status == MQ_CONSUMER_STATUS_LOST) { + code = mndSetConsumerDropLogs(pTrans, pConsumer); + if (code != 0) { + goto end; + } + sdbRelease(pSdb, pConsumer); + continue; + } + mError("topic:%s, failed to drop since subscribed by consumer:0x%" PRIx64 ", in consumer group %s", + topicName, pConsumer->consumerId, pConsumer->cgroup); + code = TSDB_CODE_MND_TOPIC_SUBSCRIBED; + goto end; + } + + if (checkTopic(pConsumer->rebNewTopics, topicName) || checkTopic(pConsumer->rebRemovedTopics, topicName)) { + code = TSDB_CODE_MND_TOPIC_SUBSCRIBED; + mError("topic:%s, failed to drop since subscribed by consumer:%" PRId64 ", in consumer group %s (reb new)", + topicName, pConsumer->consumerId, pConsumer->cgroup); + goto end; + } + sdbRelease(pSdb, pConsumer); + } + +end: + sdbRelease(pSdb, pConsumer); + sdbCancelFetch(pSdb, pIter); + return code; +} + +static int32_t mndDropCheckInfoByTopic(SMnode *pMnode, STrans *pTrans, SMqTopicObj *pTopic){ + // broadcast to all vnode + void *pIter = NULL; + SVgObj *pVgroup = NULL; + int32_t code = 0; + SSdb *pSdb = pMnode->pSdb; + void *buf = NULL; + while (1) { + pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); + if (pIter == NULL) break; + if (!mndVgroupInDb(pVgroup, pTopic->dbUid)) { + sdbRelease(pSdb, pVgroup); + continue; + } + + buf = taosMemoryCalloc(1, sizeof(SMsgHead) + TSDB_TOPIC_FNAME_LEN); + if (buf == NULL){ + code = TSDB_CODE_OUT_OF_MEMORY; + goto end; + } + void *abuf = POINTER_SHIFT(buf, sizeof(SMsgHead)); + ((SMsgHead *)buf)->vgId = htonl(pVgroup->vgId); + memcpy(abuf, pTopic->name, TSDB_TOPIC_FNAME_LEN); + + STransAction action = {0}; + action.epSet = mndGetVgroupEpset(pMnode, pVgroup); + action.pCont = buf; + action.contLen = sizeof(SMsgHead) + TSDB_TOPIC_FNAME_LEN; + action.msgType = TDMT_VND_TMQ_DEL_CHECKINFO; + code = mndTransAppendRedoAction(pTrans, &action); + if (code != 0) { + taosMemoryFree(buf); + goto end; + } + sdbRelease(pSdb, pVgroup); + } + +end: + sdbRelease(pSdb, pVgroup); + sdbCancelFetch(pSdb, pIter); + return code; +} + static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { SMnode *pMnode = pReq->info.node; - SSdb *pSdb = pMnode->pSdb; SMDropTopicReq dropReq = {0}; int32_t code = 0; SMqTopicObj *pTopic = NULL; @@ -705,68 +803,9 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { goto end; } - void *pIter = NULL; - SMqConsumerObj *pConsumer; - while (1) { - pIter = sdbFetch(pSdb, SDB_CONSUMER, pIter, (void **)&pConsumer); - if (pIter == NULL) { - break; - } - - bool found = false; - int32_t sz = taosArrayGetSize(pConsumer->assignedTopics); - for (int32_t i = 0; i < sz; i++) { - char *name = taosArrayGetP(pConsumer->assignedTopics, i); - if (strcmp(name, pTopic->name) == 0) { - found = true; - break; - } - } - if (found){ - if (pConsumer->status == MQ_CONSUMER_STATUS_LOST) { - mndDropConsumerFromSdb(pMnode, pConsumer->consumerId, &pReq->info); - mndReleaseConsumer(pMnode, pConsumer); - continue; - } - - mndReleaseConsumer(pMnode, pConsumer); - sdbCancelFetch(pSdb, pIter); - terrno = TSDB_CODE_MND_TOPIC_SUBSCRIBED; - mError("topic:%s, failed to drop since subscribed by consumer:0x%" PRIx64 ", in consumer group %s", - dropReq.name, pConsumer->consumerId, pConsumer->cgroup); - code = -1; - goto end; - } - - sz = taosArrayGetSize(pConsumer->rebNewTopics); - for (int32_t i = 0; i < sz; i++) { - char *name = taosArrayGetP(pConsumer->rebNewTopics, i); - if (strcmp(name, pTopic->name) == 0) { - mndReleaseConsumer(pMnode, pConsumer); - sdbCancelFetch(pSdb, pIter); - terrno = TSDB_CODE_MND_TOPIC_SUBSCRIBED; - mError("topic:%s, failed to drop since subscribed by consumer:%" PRId64 ", in consumer group %s (reb new)", - dropReq.name, pConsumer->consumerId, pConsumer->cgroup); - code = -1; - goto end; - } - } - - sz = taosArrayGetSize(pConsumer->rebRemovedTopics); - for (int32_t i = 0; i < sz; i++) { - char *name = taosArrayGetP(pConsumer->rebRemovedTopics, i); - if (strcmp(name, pTopic->name) == 0) { - mndReleaseConsumer(pMnode, pConsumer); - sdbCancelFetch(pSdb, pIter); - terrno = TSDB_CODE_MND_TOPIC_SUBSCRIBED; - mError("topic:%s, failed to drop since subscribed by consumer:%" PRId64 ", in consumer group %s (reb remove)", - dropReq.name, pConsumer->consumerId, pConsumer->cgroup); - code = -1; - goto end; - } - } - - sdbRelease(pSdb, pConsumer); + code = mndDropConsumerByTopic(pMnode, pTrans, dropReq.name); + if (code != 0) { + goto end; } code = mndDropSubByTopic(pMnode, pTrans, dropReq.name); @@ -776,36 +815,9 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { } if (pTopic->ntbUid != 0) { - // broadcast to all vnode - pIter = NULL; - SVgObj *pVgroup = NULL; - - while (1) { - pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); - if (pIter == NULL) break; - if (!mndVgroupInDb(pVgroup, pTopic->dbUid)) { - sdbRelease(pSdb, pVgroup); - continue; - } - - void *buf = taosMemoryCalloc(1, sizeof(SMsgHead) + TSDB_TOPIC_FNAME_LEN); - void *abuf = POINTER_SHIFT(buf, sizeof(SMsgHead)); - ((SMsgHead *)buf)->vgId = htonl(pVgroup->vgId); - memcpy(abuf, pTopic->name, TSDB_TOPIC_FNAME_LEN); - - STransAction action = {0}; - action.epSet = mndGetVgroupEpset(pMnode, pVgroup); - action.pCont = buf; - action.contLen = sizeof(SMsgHead) + TSDB_TOPIC_FNAME_LEN; - action.msgType = TDMT_VND_TMQ_DEL_CHECKINFO; - code = mndTransAppendRedoAction(pTrans, &action); - if (code != 0) { - taosMemoryFree(buf); - sdbRelease(pSdb, pVgroup); - sdbCancelFetch(pSdb, pIter); - goto end; - } - sdbRelease(pSdb, pVgroup); + code = mndDropCheckInfoByTopic(pMnode, pTrans, pTopic); + if (code != 0) { + goto end; } } @@ -822,7 +834,6 @@ end: SName name = {0}; tNameFromString(&name, dropReq.name, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE); - //reuse this function for topic auditRecord(pReq, pMnode->clusterId, "dropTopic", name.dbname, name.tname, dropReq.sql, dropReq.sqlLen); diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index 2bf73198aa..cc7ae03483 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -143,7 +143,7 @@ tb_uid_t metaGetTableEntryUidByName(SMeta *pMeta, const char *name) { int metaGetTableNameByUid(void *pVnode, uint64_t uid, char *tbName) { int code = 0; SMetaReader mr = {0}; - metaReaderDoInit(&mr, ((SVnode *)pVnode)->pMeta, 0); + metaReaderDoInit(&mr, ((SVnode *)pVnode)->pMeta, META_READER_LOCK); code = metaReaderGetTableEntryByUid(&mr, uid); if (code < 0) { metaReaderClear(&mr); @@ -159,7 +159,7 @@ int metaGetTableNameByUid(void *pVnode, uint64_t uid, char *tbName) { int metaGetTableSzNameByUid(void *meta, uint64_t uid, char *tbName) { int code = 0; SMetaReader mr = {0}; - metaReaderDoInit(&mr, (SMeta *)meta, 0); + metaReaderDoInit(&mr, (SMeta *)meta, META_READER_LOCK); code = metaReaderGetTableEntryByUid(&mr, uid); if (code < 0) { metaReaderClear(&mr); @@ -174,7 +174,7 @@ int metaGetTableSzNameByUid(void *meta, uint64_t uid, char *tbName) { int metaGetTableUidByName(void *pVnode, char *tbName, uint64_t *uid) { int code = 0; SMetaReader mr = {0}; - metaReaderDoInit(&mr, ((SVnode *)pVnode)->pMeta, 0); + metaReaderDoInit(&mr, ((SVnode *)pVnode)->pMeta, META_READER_LOCK); SMetaReader *pReader = &mr; @@ -195,7 +195,7 @@ int metaGetTableUidByName(void *pVnode, char *tbName, uint64_t *uid) { int metaGetTableTypeByName(void *pVnode, char *tbName, ETableType *tbType) { int code = 0; SMetaReader mr = {0}; - metaReaderDoInit(&mr, ((SVnode *)pVnode)->pMeta, 0); + metaReaderDoInit(&mr, ((SVnode *)pVnode)->pMeta, META_READER_LOCK); code = metaGetTableEntryByName(&mr, tbName); if (code == 0) *tbType = mr.me.type; @@ -215,7 +215,7 @@ int metaReadNext(SMetaReader *pReader) { int metaGetTableTtlByUid(void *meta, uint64_t uid, int64_t *ttlDays) { int code = -1; SMetaReader mr = {0}; - metaReaderDoInit(&mr, (SMeta *)meta, 0); + metaReaderDoInit(&mr, (SMeta *)meta, META_READER_LOCK); code = metaReaderGetTableEntryByUid(&mr, uid); if (code < 0) { goto _exit; @@ -275,7 +275,7 @@ void metaPauseTbCursor(SMTbCursor *pTbCur) { } void metaResumeTbCursor(SMTbCursor *pTbCur, int8_t first) { if (pTbCur->paused) { - metaReaderDoInit(&pTbCur->mr, pTbCur->pMeta, 0); + metaReaderDoInit(&pTbCur->mr, pTbCur->pMeta, META_READER_LOCK); tdbTbcOpen(((SMeta *)pTbCur->pMeta)->pUidIdx, (TBC **)&pTbCur->pDbc, NULL); @@ -820,7 +820,7 @@ STSmaWrapper *metaGetSmaInfoByTable(SMeta *pMeta, tb_uid_t uid, bool deepCopy) { } SMetaReader mr = {0}; - metaReaderDoInit(&mr, pMeta, 0); + metaReaderDoInit(&mr, pMeta, META_READER_LOCK); int64_t smaId; int smaIdx = 0; STSma *pTSma = NULL; @@ -875,7 +875,7 @@ _err: STSma *metaGetSmaInfoByIndex(SMeta *pMeta, int64_t indexUid) { STSma *pTSma = NULL; SMetaReader mr = {0}; - metaReaderDoInit(&mr, pMeta, 0); + metaReaderDoInit(&mr, pMeta, META_READER_LOCK); if (metaReaderGetTableEntryByUid(&mr, indexUid) < 0) { metaWarn("vgId:%d, failed to get table entry for smaId:%" PRIi64, TD_VID(pMeta->pVnode), indexUid); metaReaderClear(&mr); diff --git a/source/dnode/vnode/src/meta/metaSma.c b/source/dnode/vnode/src/meta/metaSma.c index 91704f5c7a..c61725e834 100644 --- a/source/dnode/vnode/src/meta/metaSma.c +++ b/source/dnode/vnode/src/meta/metaSma.c @@ -37,7 +37,7 @@ int32_t metaCreateTSma(SMeta *pMeta, int64_t version, SSmaCfg *pCfg) { // validate req // save smaIndex - metaReaderDoInit(&mr, pMeta, 0); + metaReaderDoInit(&mr, pMeta, META_READER_LOCK); if (metaReaderGetTableEntryByUidCache(&mr, pCfg->indexUid) == 0) { #if 1 terrno = TSDB_CODE_TSMA_ALREADY_EXIST; diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 4a978c8f41..3c032f193a 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -819,7 +819,7 @@ int metaCreateTable(SMeta *pMeta, int64_t ver, SVCreateTbReq *pReq, STableMetaRs } // validate req - metaReaderDoInit(&mr, pMeta, 0); + metaReaderDoInit(&mr, pMeta, META_READER_LOCK); if (metaGetTableEntryByName(&mr, pReq->name) == 0) { if (pReq->type == TSDB_CHILD_TABLE && pReq->ctb.suid != mr.me.ctbEntry.suid) { terrno = TSDB_CODE_TDB_TABLE_IN_OTHER_STABLE; diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 621651507e..5441d0c4c1 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -1097,7 +1097,7 @@ static int32_t tdRSmaRestoreQTaskInfoInit(SSma *pSma, int64_t *nTables) { } int64_t nRsmaTables = 0; - metaReaderDoInit(&mr, SMA_META(pSma), 0); + metaReaderDoInit(&mr, SMA_META(pSma), META_READER_LOCK); if (!(uidStore.tbUids = taosArrayInit(1024, sizeof(tb_uid_t)))) { code = TSDB_CODE_OUT_OF_MEMORY; TSDB_CHECK_CODE(code, lino, _exit); diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c index 4c403dc18f..e64de9a423 100644 --- a/source/dnode/vnode/src/tq/tqMeta.c +++ b/source/dnode/vnode/src/tq/tqMeta.c @@ -88,10 +88,6 @@ int32_t tqMetaOpen(STQ* pTq) { return -1; } -// if (tqMetaRestoreHandle(pTq) < 0) { -// return -1; -// } - if (tqMetaRestoreCheckInfo(pTq) < 0) { return -1; } @@ -167,32 +163,30 @@ int32_t tqMetaRestoreCheckInfo(STQ* pTq) { void* pVal = NULL; int vLen = 0; SDecoder decoder; + int32_t code = 0; tdbTbcMoveToFirst(pCur); while (tdbTbcNext(pCur, &pKey, &kLen, &pVal, &vLen) == 0) { STqCheckInfo info; tDecoderInit(&decoder, (uint8_t*)pVal, vLen); - if (tDecodeSTqCheckInfo(&decoder, &info) < 0) { + code = tDecodeSTqCheckInfo(&decoder, &info); + if (code != 0) { terrno = TSDB_CODE_OUT_OF_MEMORY; - tdbFree(pKey); - tdbFree(pVal); - tdbTbcClose(pCur); - return -1; + goto END; } tDecoderClear(&decoder); - if (taosHashPut(pTq->pCheckInfo, info.topic, strlen(info.topic), &info, sizeof(STqCheckInfo)) < 0) { + code = taosHashPut(pTq->pCheckInfo, info.topic, strlen(info.topic), &info, sizeof(STqCheckInfo)); + if (code != 0) { terrno = TSDB_CODE_OUT_OF_MEMORY; - tdbFree(pKey); - tdbFree(pVal); - tdbTbcClose(pCur); - return -1; + goto END; } } +END: tdbFree(pKey); tdbFree(pVal); tdbTbcClose(pCur); - return 0; + return code; } int32_t tqMetaSaveHandle(STQ* pTq, const char* key, const STqHandle* pHandle) { diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index 110cac152d..4d6fb11747 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -115,7 +115,7 @@ bool isValValidForTable(STqHandle* pHandle, SWalCont* pHead) { } SMetaReader mr = {0}; - metaReaderDoInit(&mr, pHandle->execHandle.pTqReader->pVnodeMeta, 0); + metaReaderDoInit(&mr, pHandle->execHandle.pTqReader->pVnodeMeta, META_READER_LOCK); if (metaGetTableEntryByName(&mr, req.tbName) < 0) { metaReaderClear(&mr); @@ -666,20 +666,19 @@ int32_t tqRetrieveDataBlock(STqReader* pReader, SSDataBlock** pRes, const char* int32_t targetIdx = 0; int32_t sourceIdx = 0; while (targetIdx < colActual) { + SColumnInfoData* pColData = taosArrayGet(pBlock->pDataBlock, targetIdx); + if (sourceIdx >= numOfCols) { - tqError("tqRetrieveDataBlock sourceIdx:%d >= numOfCols:%d", sourceIdx, numOfCols); - return -1; + tqError("lostdata tqRetrieveDataBlock sourceIdx:%d >= numOfCols:%d", sourceIdx, numOfCols); + colDataSetNNULL(pColData, 0, numOfRows); + targetIdx++; + continue; } SColData* pCol = taosArrayGet(pCols, sourceIdx); - SColumnInfoData* pColData = taosArrayGet(pBlock->pDataBlock, targetIdx); SColVal colVal; - if (pCol->nVal != numOfRows) { - tqError("tqRetrieveDataBlock pCol->nVal:%d != numOfRows:%d", pCol->nVal, numOfRows); - return -1; - } - + tqTrace("lostdata colActual:%d, sourceIdx:%d, targetIdx:%d, numOfCols:%d, source cid:%d, dst cid:%d", colActual, sourceIdx, targetIdx, numOfCols, pCol->cid, pColData->info.colId); if (pCol->cid < pColData->info.colId) { sourceIdx++; } else if (pCol->cid == pColData->info.colId) { @@ -693,7 +692,7 @@ int32_t tqRetrieveDataBlock(STqReader* pReader, SSDataBlock** pRes, const char* sourceIdx++; targetIdx++; } else { - colDataSetNNULL(pColData, 0, pCol->nVal); + colDataSetNNULL(pColData, 0, numOfRows); targetIdx++; } } @@ -712,9 +711,6 @@ int32_t tqRetrieveDataBlock(STqReader* pReader, SSDataBlock** pRes, const char* SColVal colVal; tRowGet(pRow, pTSchema, sourceIdx, &colVal); if (colVal.cid < pColData->info.colId) { - // tqDebug("colIndex:%d column id:%d in row, ignore, the required colId:%d, total cols in - // schema:%d", - // sourceIdx, colVal.cid, pColData->info.colId, pTSchema->numOfCols); sourceIdx++; continue; } else if (colVal.cid == pColData->info.colId) { diff --git a/source/dnode/vnode/src/tq/tqScan.c b/source/dnode/vnode/src/tq/tqScan.c index 103007eb57..9940164ee2 100644 --- a/source/dnode/vnode/src/tq/tqScan.c +++ b/source/dnode/vnode/src/tq/tqScan.c @@ -47,7 +47,7 @@ static int32_t tqAddBlockSchemaToRsp(const STqExecHandle* pExec, STaosxRsp* pRsp static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, STaosxRsp* pRsp, int32_t n) { SMetaReader mr = {0}; - metaReaderDoInit(&mr, pTq->pVnode->pMeta, 0); + metaReaderDoInit(&mr, pTq->pVnode->pMeta, META_READER_LOCK); // TODO add reference to gurantee success if (metaReaderGetTableEntryByUidCache(&mr, uid) < 0) { diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c index 9ff4e3ba62..5374b9aa78 100644 --- a/source/dnode/vnode/src/tq/tqSink.c +++ b/source/dnode/vnode/src/tq/tqSink.c @@ -612,7 +612,7 @@ int32_t doWaitForDstTableCreated(SVnode* pVnode, SStreamTask* pTask, STableSinkI // wait for the table to be created SMetaReader mr = {0}; - metaReaderDoInit(&mr, pVnode->pMeta, 0); + metaReaderDoInit(&mr, pVnode->pMeta, META_READER_LOCK); int32_t code = metaGetTableEntryByName(&mr, dstTableName); if (code == 0) { // table already exists, check its type and uid @@ -705,7 +705,7 @@ int32_t setDstTableDataUid(SVnode* pVnode, SStreamTask* pTask, SSDataBlock* pDat // those mismatched table uids. Only the FIRST table has the correct table uid, and those remain all have // randomly generated, but false table uid in the WAL. SMetaReader mr = {0}; - metaReaderDoInit(&mr, pVnode->pMeta, 0); + metaReaderDoInit(&mr, pVnode->pMeta, META_READER_LOCK); // table not in cache, let's try the extract it from tsdb meta if (metaGetTableEntryByName(&mr, dstTableName) < 0) { diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 0848fd0076..37f82ef873 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -2014,7 +2014,7 @@ static tb_uid_t getTableSuidByUid(tb_uid_t uid, STsdb *pTsdb) { tb_uid_t suid = 0; SMetaReader mr = {0}; - metaReaderDoInit(&mr, pTsdb->pVnode->pMeta, 0); + metaReaderDoInit(&mr, pTsdb->pVnode->pMeta, META_READER_LOCK); if (metaReaderGetTableEntryByUidCache(&mr, uid) < 0) { metaReaderClear(&mr); // table not esist return 0; diff --git a/source/dnode/vnode/src/tsdb/tsdbRead2.c b/source/dnode/vnode/src/tsdb/tsdbRead2.c index d740f9491c..c0ad32d269 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead2.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead2.c @@ -5036,7 +5036,7 @@ int64_t tsdbGetNumOfRowsInMemTable2(STsdbReader* pReader) { int32_t tsdbGetTableSchema(SMeta* pMeta, int64_t uid, STSchema** pSchema, int64_t* suid) { SMetaReader mr = {0}; - metaReaderDoInit(&mr, pMeta, 0); + metaReaderDoInit(&mr, pMeta, META_READER_LOCK); int32_t code = metaReaderGetTableEntryByUidCache(&mr, uid); if (code != TSDB_CODE_SUCCESS) { terrno = TSDB_CODE_TDB_INVALID_TABLE_ID; diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index 81a136a0e3..849d2c791c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -584,13 +584,30 @@ struct STsdbSnapWriter { // APIs static int32_t tsdbSnapWriteTimeSeriesRow(STsdbSnapWriter* writer, SRowInfo* row) { - int32_t code = 0; - int32_t lino = 0; + int32_t code = 0; + int32_t lino = 0; + TABLEID tbid = {0}; + SMetaInfo info; while (writer->ctx->hasData) { - SRowInfo* row1 = tsdbIterMergerGetData(writer->ctx->dataIterMerger); - if (row1 == NULL) { - writer->ctx->hasData = false; + SRowInfo* row1; + for (;;) { + row1 = tsdbIterMergerGetData(writer->ctx->dataIterMerger); + if (row1 == NULL) { + writer->ctx->hasData = false; + } else if (row1->uid != tbid.uid) { + tbid.suid = row1->suid; + tbid.uid = row1->uid; + if (metaGetInfo(writer->tsdb->pVnode->pMeta, tbid.uid, &info, NULL) != 0) { + code = tsdbIterMergerSkipTableData(writer->ctx->dataIterMerger, &tbid); + TSDB_CHECK_CODE(code, lino, _exit); + continue; + } + } + break; + } + + if (writer->ctx->hasData == false) { break; } diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index d1c811858a..d244d5b6bf 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -63,7 +63,7 @@ int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) { } // query meta - metaReaderDoInit(&mer1, pVnode->pMeta, 0); + metaReaderDoInit(&mer1, pVnode->pMeta, META_READER_LOCK); if (metaGetTableEntryByName(&mer1, infoReq.tbName) < 0) { code = terrno; @@ -179,7 +179,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) { } // query meta - metaReaderDoInit(&mer1, pVnode->pMeta, 0); + metaReaderDoInit(&mer1, pVnode->pMeta, META_READER_LOCK); if (metaGetTableEntryByName(&mer1, cfgReq.tbName) < 0) { code = terrno; @@ -192,7 +192,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) { code = TSDB_CODE_VND_HASH_MISMATCH; goto _exit; } else if (mer1.me.type == TSDB_CHILD_TABLE) { - metaReaderDoInit(&mer2, pVnode->pMeta, 0); + metaReaderDoInit(&mer2, pVnode->pMeta, META_READER_LOCK); if (metaReaderGetTableEntryByUid(&mer2, mer1.me.ctbEntry.suid) < 0) goto _exit; strcpy(cfgRsp.stbName, mer2.me.name); diff --git a/source/libs/executor/CMakeLists.txt b/source/libs/executor/CMakeLists.txt index d2c39aba74..838233346e 100644 --- a/source/libs/executor/CMakeLists.txt +++ b/source/libs/executor/CMakeLists.txt @@ -3,7 +3,7 @@ aux_source_directory(src EXECUTOR_SRC) add_library(executor STATIC ${EXECUTOR_SRC}) target_link_libraries(executor - PRIVATE os util common function parser planner qcom scalar nodes index wal tdb + PRIVATE os util common function parser planner qcom scalar nodes index wal tdb geometry ) target_include_directories( diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index bb89fb587b..9a480359ed 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -308,7 +308,7 @@ int32_t isQualifiedTable(STableKeyInfo* info, SNode* pTagCond, void* metaHandle, int32_t code = TSDB_CODE_SUCCESS; SMetaReader mr = {0}; - pAPI->metaReaderFn.initReader(&mr, metaHandle, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&mr, metaHandle, META_READER_LOCK, &pAPI->metaFn); code = pAPI->metaReaderFn.getEntryGetUidCache(&mr, info->uid); if (TSDB_CODE_SUCCESS != code) { pAPI->metaReaderFn.clearReader(&mr); @@ -1225,7 +1225,7 @@ int32_t getGroupIdFromTagsVal(void* pVnode, uint64_t uid, SNodeList* pGroupNode, SStorageAPI* pAPI) { SMetaReader mr = {0}; - pAPI->metaReaderFn.initReader(&mr, pVnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&mr, pVnode, META_READER_LOCK, &pAPI->metaFn); if (pAPI->metaReaderFn.getEntryGetUidCache(&mr, uid) != 0) { // table not exist pAPI->metaReaderFn.clearReader(&mr); return TSDB_CODE_PAR_TABLE_NOT_EXIST; diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 831fd4e883..26a80cc6b5 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -351,7 +351,7 @@ static SArray* filterUnqualifiedTables(const SStreamScanInfo* pScanInfo, const S // let's discard the tables those are not created according to the queried super table. SMetaReader mr = {0}; - pAPI->metaReaderFn.initReader(&mr, pScanInfo->readHandle.vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&mr, pScanInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); for (int32_t i = 0; i < numOfUids; ++i) { uint64_t* id = (uint64_t*)taosArrayGet(tableIdList, i); diff --git a/source/libs/executor/src/querytask.c b/source/libs/executor/src/querytask.c index 9eb1c8d653..0fff5fa649 100644 --- a/source/libs/executor/src/querytask.c +++ b/source/libs/executor/src/querytask.c @@ -127,7 +127,7 @@ int32_t initQueriedTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNo SStorageAPI* pAPI = &pTaskInfo->storageAPI; - pAPI->metaReaderFn.initReader(&mr, pHandle->vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&mr, pHandle->vnode, META_READER_LOCK, &pAPI->metaFn); int32_t code = pAPI->metaReaderFn.getEntryGetUidCache(&mr, pScanNode->uid); if (code != TSDB_CODE_SUCCESS) { qError("failed to get the table meta, uid:0x%" PRIx64 ", suid:0x%" PRIx64 ", %s", pScanNode->uid, pScanNode->suid, diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 51edfcb42c..a6613e589a 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -505,7 +505,7 @@ int32_t addTagPseudoColumnData(SReadHandle* pHandle, const SExprInfo* pExpr, int // 1. check if it is existed in meta cache if (pCache == NULL) { - pHandle->api.metaReaderFn.initReader(&mr, pHandle->vnode, 0, &pHandle->api.metaFn); + pHandle->api.metaReaderFn.initReader(&mr, pHandle->vnode, META_READER_LOCK, &pHandle->api.metaFn); code = pHandle->api.metaReaderFn.getEntryGetUidCache(&mr, pBlock->info.id.uid); if (code != TSDB_CODE_SUCCESS) { // when encounter the TSDB_CODE_PAR_TABLE_NOT_EXIST error, we proceed. @@ -534,7 +534,7 @@ int32_t addTagPseudoColumnData(SReadHandle* pHandle, const SExprInfo* pExpr, int h = taosLRUCacheLookup(pCache->pTableMetaEntryCache, &pBlock->info.id.uid, sizeof(pBlock->info.id.uid)); if (h == NULL) { - pHandle->api.metaReaderFn.initReader(&mr, pHandle->vnode, 0, &pHandle->api.metaFn); + pHandle->api.metaReaderFn.initReader(&mr, pHandle->vnode, META_READER_LOCK, &pHandle->api.metaFn); code = pHandle->api.metaReaderFn.getEntryGetUidCache(&mr, pBlock->info.id.uid); if (code != TSDB_CODE_SUCCESS) { if (terrno == TSDB_CODE_PAR_TABLE_NOT_EXIST) { @@ -2084,6 +2084,8 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) { blockDataCleanup(pInfo->pRes); STimeWindow defaultWindow = {.skey = INT64_MIN, .ekey = INT64_MAX}; setBlockIntoRes(pInfo, pRes, &defaultWindow, true); + qDebug("doQueueScan after filter get data from log %" PRId64 " rows, version:%" PRId64, pInfo->pRes->info.rows, + pTaskInfo->streamInfo.currentOffset.version); if (pInfo->pRes->info.rows > 0) { return pInfo->pRes; } @@ -3318,7 +3320,7 @@ static SSDataBlock* doTagScanFromMetaEntry(SOperatorInfo* pOperator) { char str[512] = {0}; int32_t count = 0; SMetaReader mr = {0}; - pAPI->metaReaderFn.initReader(&mr, pInfo->readHandle.vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&mr, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); while (pInfo->curPos < size && count < pOperator->resultInfo.capacity) { doTagScanOneTable(pOperator, pRes, count, &mr, &pTaskInfo->storageAPI); diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 0c421bf354..5735ee298b 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -14,6 +14,7 @@ */ #include "executorInt.h" +#include "geosWrapper.h" #include "filter.h" #include "functionMgt.h" #include "querynodes.h" @@ -464,7 +465,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { STR_TO_VARSTR(tableName, pInfo->req.filterTb); SMetaReader smrTable = {0}; - pAPI->metaReaderFn.initReader(&smrTable, pInfo->readHandle.vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&smrTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); int32_t code = pAPI->metaReaderFn.getTableEntryByName(&smrTable, pInfo->req.filterTb); if (code != TSDB_CODE_SUCCESS) { // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly @@ -484,7 +485,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { if (smrTable.me.type == TSDB_CHILD_TABLE) { int64_t suid = smrTable.me.ctbEntry.suid; pAPI->metaReaderFn.clearReader(&smrTable); - pAPI->metaReaderFn.initReader(&smrTable, pInfo->readHandle.vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&smrTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); code = pAPI->metaReaderFn.getTableEntryByUid(&smrTable, suid); if (code != TSDB_CODE_SUCCESS) { // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly @@ -567,7 +568,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { schemaRow = *(SSchemaWrapper**)schema; } else { SMetaReader smrSuperTable = {0}; - pAPI->metaReaderFn.initReader(&smrSuperTable, pInfo->readHandle.vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&smrSuperTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); int code = pAPI->metaReaderFn.getTableEntryByUid(&smrSuperTable, suid); if (code != TSDB_CODE_SUCCESS) { // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly @@ -656,7 +657,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { STR_TO_VARSTR(tableName, condTableName); SMetaReader smrChildTable = {0}; - pAPI->metaReaderFn.initReader(&smrChildTable, pInfo->readHandle.vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&smrChildTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); int32_t code = pAPI->metaReaderFn.getTableEntryByName(&smrChildTable, condTableName); if (code != TSDB_CODE_SUCCESS) { // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly @@ -713,7 +714,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); SMetaReader smrSuperTable = {0}; - pAPI->metaReaderFn.initReader(&smrSuperTable, pInfo->readHandle.vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&smrSuperTable, pInfo->readHandle.vnode, META_READER_NOLOCK, &pAPI->metaFn); uint64_t suid = pInfo->pCur->mr.me.ctbEntry.suid; int32_t code = pAPI->metaReaderFn.getTableEntryByUid(&smrSuperTable, suid); if (code != TSDB_CODE_SUCCESS) { @@ -811,6 +812,8 @@ int32_t convertTagDataToStr(char* str, int type, void* buf, int32_t bufSize, int break; case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: if (bufSize < 0) { return TSDB_CODE_TSC_INVALID_VALUE; } @@ -854,6 +857,30 @@ int32_t convertTagDataToStr(char* str, int type, void* buf, int32_t bufSize, int return TSDB_CODE_SUCCESS; } +static int32_t sysTableGetGeomText(char* iGeom, int32_t nGeom, char** output, int32_t* nOutput) { + int32_t code = 0; + char* outputWKT = NULL; + + if (nGeom == 0) { + if (!(*output = strdup(""))) code = TSDB_CODE_OUT_OF_MEMORY; + *nOutput = 0; + return code; + } + + if (TSDB_CODE_SUCCESS != (code = initCtxAsText()) || + TSDB_CODE_SUCCESS != (code = doAsText(iGeom, nGeom, &outputWKT))) { + qError("geo text for systable failed:%s", getThreadLocalGeosCtx()->errMsg); + *output = NULL; + *nOutput = 0; + return code; + } + + *output = outputWKT; + *nOutput = strlen(outputWKT); + + return code; +} + static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, SMetaReader* smrSuperTable, SMetaReader* smrChildTable, const char* dbname, const char* tableName, int32_t* pNumOfRows, const SSDataBlock* dataBlock) { @@ -889,13 +916,13 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, pColInfoData = taosArrayGet(dataBlock->pDataBlock, 4); char tagTypeStr[VARSTR_HEADER_SIZE + 32]; int tagTypeLen = sprintf(varDataVal(tagTypeStr), "%s", tDataTypes[tagType].name); - if (tagType == TSDB_DATA_TYPE_VARCHAR) { - tagTypeLen += sprintf(varDataVal(tagTypeStr) + tagTypeLen, "(%d)", - (int32_t)((*smrSuperTable).me.stbEntry.schemaTag.pSchema[i].bytes - VARSTR_HEADER_SIZE)); - } else if (tagType == TSDB_DATA_TYPE_NCHAR) { + if (tagType == TSDB_DATA_TYPE_NCHAR) { tagTypeLen += sprintf( varDataVal(tagTypeStr) + tagTypeLen, "(%d)", (int32_t)(((*smrSuperTable).me.stbEntry.schemaTag.pSchema[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); + } else if (IS_VAR_DATA_TYPE(tagType)) { + tagTypeLen += sprintf(varDataVal(tagTypeStr) + tagTypeLen, "(%d)", + (int32_t)((*smrSuperTable).me.stbEntry.schemaTag.pSchema[i].bytes - VARSTR_HEADER_SIZE)); } varDataSetLen(tagTypeStr, tagTypeLen); colDataSetVal(pColInfoData, numOfRows, (char*)tagTypeStr, false); @@ -910,7 +937,13 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, } else { bool exist = tTagGet((STag*)smrChildTable->me.ctbEntry.pTags, &tagVal); if (exist) { - if (IS_VAR_DATA_TYPE(tagType)) { + if (tagType == TSDB_DATA_TYPE_GEOMETRY) { + sysTableGetGeomText(tagVal.pData, tagVal.nData, &tagData, &tagLen); + } else if (tagType == TSDB_DATA_TYPE_VARBINARY) { + if (taosAscii2Hex(tagVal.pData, tagVal.nData, (void**)&tagData, &tagLen) < 0) { + qError("varbinary for systable failed since %s", tstrerror(TSDB_CODE_OUT_OF_MEMORY)); + } + } else if (IS_VAR_DATA_TYPE(tagType)) { tagData = (char*)tagVal.pData; tagLen = tagVal.nData; } else { @@ -940,6 +973,7 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, pColInfoData = taosArrayGet(dataBlock->pDataBlock, 5); colDataSetVal(pColInfoData, numOfRows, tagVarChar, (tagData == NULL) || (tagType == TSDB_DATA_TYPE_JSON && tTagIsJsonNull(tagData))); + if (tagType == TSDB_DATA_TYPE_GEOMETRY || tagType == TSDB_DATA_TYPE_VARBINARY) taosMemoryFreeClear(tagData); taosMemoryFree(tagVarChar); ++numOfRows; } @@ -1129,7 +1163,7 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator) { tb_uid_t* uid = taosArrayGet(pIdx->uids, i); SMetaReader mr = {0}; - pAPI->metaReaderFn.initReader(&mr, pInfo->readHandle.vnode, 0, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&mr, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); ret = pAPI->metaReaderFn.getTableEntryByUid(&mr, *uid); if (ret < 0) { pAPI->metaReaderFn.clearReader(&mr); @@ -2170,7 +2204,7 @@ static int32_t doGetTableRowSize(SReadHandle* pHandle, uint64_t uid, int32_t* ro *rowLen = 0; SMetaReader mr = {0}; - pHandle->api.metaReaderFn.initReader(&mr, pHandle->vnode, 0, &pHandle->api.metaFn); + pHandle->api.metaReaderFn.initReader(&mr, pHandle->vnode, META_READER_LOCK, &pHandle->api.metaFn); int32_t code = pHandle->api.metaReaderFn.getTableEntryByUid(&mr, uid); if (code != TSDB_CODE_SUCCESS) { qError("failed to get table meta, uid:0x%" PRIx64 ", code:%s, %s", uid, tstrerror(terrno), idstr); diff --git a/source/libs/geometry/src/geosWrapper.c b/source/libs/geometry/src/geosWrapper.c index 993178e2b0..ad2d477a13 100644 --- a/source/libs/geometry/src/geosWrapper.c +++ b/source/libs/geometry/src/geosWrapper.c @@ -199,6 +199,7 @@ int32_t doAsText(const unsigned char *inputGeom, size_t size, char **outputWKT) wkt = GEOSWKTWriter_write_r(geosCtx->handle, geosCtx->WKTWriter, geom); if (wkt == NULL) { + code = TSDB_CODE_MSG_DECODE_ERROR; goto _exit; } *outputWKT = wkt; diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 15b4c330d1..925c6e0578 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -108,6 +108,8 @@ SNodeList* addNodeToList(SAstCreateContext* pCxt, SNodeList* pList, SNode* pNode SNode* createColumnNode(SAstCreateContext* pCxt, SToken* pTableAlias, SToken* pColumnName); SNode* createValueNode(SAstCreateContext* pCxt, int32_t dataType, const SToken* pLiteral); +SNode* createRawValueNode(SAstCreateContext* pCxt, int32_t dataType, const SToken* pLiteral, SNode *pNode); +SNode* createRawValueNodeExt(SAstCreateContext* pCxt, int32_t dataType, const SToken* pLiteral, SNode *pLeft, SNode *pRight); SNodeList* createHintNodeList(SAstCreateContext* pCxt, const SToken* pLiteral); SNode* createIdentifierValueNode(SAstCreateContext* pCxt, SToken* pLiteral); SNode* createDurationValueNode(SAstCreateContext* pCxt, const SToken* pLiteral); diff --git a/source/libs/parser/inc/parToken.h b/source/libs/parser/inc/parToken.h index 86bcc18fd5..87e9a82d2b 100644 --- a/source/libs/parser/inc/parToken.h +++ b/source/libs/parser/inc/parToken.h @@ -24,6 +24,15 @@ extern "C" { #include "ttokendef.h" +#define IS_TRUE_STR(s, n) \ + (n == 4 && (*(s) == 't' || *(s) == 'T') && (*((s) + 1) == 'r' || *((s) + 1) == 'R') && \ + (*((s) + 2) == 'u' || *((s) + 2) == 'U') && (*((s) + 3) == 'e' || *((s) + 3) == 'E')) + +#define IS_FALSE_STR(s, n) \ + (n == 5 && (*(s) == 'f' || *(s) == 'F') && (*((s) + 1) == 'a' || *((s) + 1) == 'A') && \ + (*((s) + 2) == 'l' || *((s) + 2) == 'L') && (*((s) + 3) == 's' || *((s) + 3) == 'S') && \ + (*((s) + 4) == 'e' || *((s) + 4) == 'E')) + // used to denote the minimum unite in sql parsing typedef struct SToken { uint32_t n; diff --git a/source/libs/parser/inc/parUtil.h b/source/libs/parser/inc/parUtil.h index c48f2ef05d..7a25e3c4c7 100644 --- a/source/libs/parser/inc/parUtil.h +++ b/source/libs/parser/inc/parUtil.h @@ -23,6 +23,7 @@ extern "C" { #include "catalog.h" #include "os.h" #include "parser.h" +#include "parToken.h" #include "query.h" #define parserFatal(param, ...) qFatal("PARSER: " param, ##__VA_ARGS__) @@ -35,6 +36,45 @@ extern "C" { #define ROWTS_PSEUDO_COLUMN_NAME "_rowts" #define C0_PSEUDO_COLUMN_NAME "_c0" +#define IS_NOW_STR(s, n) \ + ((*(s) == 'n' || *(s) == 'N') && (*((s) + 1) == 'o' || *((s) + 1) == 'O') && \ + (*((s) + 2) == 'w' || *((s) + 2) == 'W') && (n == 3 || (n == 5 && *((s) + 3) == '(' && *((s) + 4) == ')'))) + +#define IS_TODAY_STR(s, n) \ + ((*(s) == 't' || *(s) == 'T') && (*((s) + 1) == 'o' || *((s) + 1) == 'O') && \ + (*((s) + 2) == 'd' || *((s) + 2) == 'D') && (*((s) + 3) == 'a' || *((s) + 3) == 'A') && \ + (*((s) + 4) == 'y' || *((s) + 4) == 'Y') && (n == 5 || (n == 7 && *((s) + 5) == '(' && *((s) + 6) == ')'))) + +#define IS_NULL_STR(s, n) \ + (n == 4 && (*(s) == 'N' || *(s) == 'n') && (*((s) + 1) == 'U' || *((s) + 1) == 'u') && \ + (*((s) + 2) == 'L' || *((s) + 2) == 'l') && (*((s) + 3) == 'L' || *((s) + 3) == 'l')) + +#define NEXT_TOKEN_WITH_PREV(pSql, token) \ + do { \ + int32_t index = 0; \ + token = tStrGetToken(pSql, &index, true, NULL); \ + pSql += index; \ + } while (0) + +#define NEXT_TOKEN_WITH_PREV_EXT(pSql, token, pIgnoreComma) \ + do { \ + int32_t index = 0; \ + token = tStrGetToken(pSql, &index, true, pIgnoreComma); \ + pSql += index; \ + } while (0) + +#define NEXT_TOKEN_KEEP_SQL(pSql, token, index) \ + do { \ + token = tStrGetToken(pSql, &index, false, NULL); \ + } while (0) + +#define NEXT_VALID_TOKEN(pSql, token) \ + do { \ + (token).n = tGetToken(pSql, &(token).type); \ + (token).z = (char*)pSql; \ + pSql += (token).n; \ + } while (TK_NK_SPACE == (token).type) + typedef struct SMsgBuf { int32_t len; char* buf; @@ -90,6 +130,9 @@ int32_t getTableTypeFromTableNode(SNode *pTable); int32_t trimString(const char* src, int32_t len, char* dst, int32_t dlen); int32_t getVnodeSysTableTargetName(int32_t acctId, SNode* pWhere, SName* pName); +int32_t checkAndTrimValue(SToken* pToken, char* tmpTokenBuf, SMsgBuf* pMsgBuf, int8_t type); +int32_t parseTagValue(SMsgBuf* pMsgBuf, const char** pSql, uint8_t precision, SSchema* pTagSchema, SToken* pToken, + SArray* pTagName, SArray* pTagVals, STag** pTag); int32_t buildCatalogReq(const SParseMetaCache* pMetaCache, SCatalogReq* pCatalogReq); int32_t putMetaDataToCache(const SCatalogReq* pCatalogReq, const SMetaData* pMetaData, SParseMetaCache* pMetaCache); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 0ceecaa4f5..3c0671e9cc 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -354,7 +354,7 @@ alter_table_clause(A) ::= alter_table_clause(A) ::= full_table_name(B) RENAME TAG column_name(C) column_name(D). { A = createAlterTableRenameCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &C, &D); } alter_table_clause(A) ::= - full_table_name(B) SET TAG column_name(C) NK_EQ signed_literal(D). { A = createAlterTableSetTag(pCxt, B, &C, D); } + full_table_name(B) SET TAG column_name(C) NK_EQ tags_literal(D). { A = createAlterTableSetTag(pCxt, B, &C, D); } %type multi_create_clause { SNodeList* } %destructor multi_create_clause { nodesDestroyList($$); } @@ -363,7 +363,7 @@ multi_create_clause(A) ::= multi_create_clause(B) create_subtable_clause(C). create_subtable_clause(A) ::= not_exists_opt(B) full_table_name(C) USING full_table_name(D) - specific_cols_opt(E) TAGS NK_LP expression_list(F) NK_RP table_options(G). { A = createCreateSubTableClause(pCxt, B, C, D, E, F, G); } + specific_cols_opt(E) TAGS NK_LP tags_literal_list(F) NK_RP table_options(G). { A = createCreateSubTableClause(pCxt, B, C, D, E, F, G); } %type multi_drop_clause { SNodeList* } %destructor multi_drop_clause { nodesDestroyList($$); } @@ -744,6 +744,76 @@ insert_query(A) ::= INSERT INTO full_table_name(D) NK_LP col_name_list(B) NK_RP query_or_subquery(C). { A = createInsertStmt(pCxt, D, B, C); } insert_query(A) ::= INSERT INTO full_table_name(C) query_or_subquery(B). { A = createInsertStmt(pCxt, C, NULL, B); } +/************************************************ tags_literal *************************************************************/ +tags_literal(A) ::= NK_INTEGER(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &B, NULL); } +tags_literal(A) ::= NK_PLUS(B) NK_INTEGER(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + } +tags_literal(A) ::= NK_MINUS(B) NK_INTEGER(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + } +tags_literal(A) ::= NK_FLOAT(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &B, NULL); } +tags_literal(A) ::= NK_PLUS(B) NK_FLOAT(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + } +tags_literal(A) ::= NK_MINUS(B) NK_FLOAT(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + } + +tags_literal(A) ::= NK_BIN(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &B, NULL); } +tags_literal(A) ::= NK_PLUS(B) NK_BIN(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + } +tags_literal(A) ::= NK_MINUS(B) NK_BIN(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + } +tags_literal(A) ::= NK_HEX(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &B, NULL); } +tags_literal(A) ::= NK_PLUS(B) NK_HEX(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + } +tags_literal(A) ::= NK_MINUS(B) NK_HEX(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + } + +tags_literal(A) ::= NK_STRING(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B, NULL); } +tags_literal(A) ::= NK_BOOL(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &B, NULL); } +tags_literal(A) ::= NULL(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &B, NULL); } + +tags_literal(A) ::= literal_func(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, B); } +tags_literal(A) ::= literal_func(B) NK_PLUS duration_literal(C). { + SToken l = getTokenFromRawExprNode(pCxt, B); + SToken r = getTokenFromRawExprNode(pCxt, C); + l.n = (r.z + r.n) - l.z; + A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, B, C); + } +tags_literal(A) ::= literal_func(B) NK_MINUS duration_literal(C). { + SToken l = getTokenFromRawExprNode(pCxt, B); + SToken r = getTokenFromRawExprNode(pCxt, C); + l.n = (r.z + r.n) - l.z; + A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, B, C); + } + +%type tags_literal_list { SNodeList* } +%destructor tags_literal_list { nodesDestroyList($$); } +tags_literal_list(A) ::= tags_literal(B). { A = createNodeList(pCxt, B); } +tags_literal_list(A) ::= tags_literal_list(B) NK_COMMA tags_literal(C). { A = addNodeToList(pCxt, B, C); } + /************************************************ literal *************************************************************/ literal(A) ::= NK_INTEGER(B). { A = createRawExprNode(pCxt, &B, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &B)); } literal(A) ::= NK_FLOAT(B). { A = createRawExprNode(pCxt, &B, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &B)); } @@ -924,6 +994,7 @@ function_expression(A) ::= literal_func(B). literal_func(A) ::= noarg_func(B) NK_LP NK_RP(C). { A = createRawExprNodeExt(pCxt, &B, &C, createFunctionNode(pCxt, &B, NULL)); } literal_func(A) ::= NOW(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } +literal_func(A) ::= TODAY(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } %type noarg_func { SToken } %destructor noarg_func { } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 9c425bf059..5e4b4f1f3d 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -370,6 +370,80 @@ SNode* createValueNode(SAstCreateContext* pCxt, int32_t dataType, const SToken* return (SNode*)val; } +SNode* createRawValueNode(SAstCreateContext* pCxt, int32_t dataType, const SToken* pLiteral, SNode* pNode) { + CHECK_PARSER_STATUS(pCxt); + SValueNode* val = NULL; + + if (!(val = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE))) { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_OUT_OF_MEMORY, "Out of memory"); + goto _exit; + } + if (pLiteral) { + val->literal = strndup(pLiteral->z, pLiteral->n); + } else if (pNode) { + SRawExprNode* pRawExpr = (SRawExprNode*)pNode; + if (!nodesIsExprNode(pRawExpr->pNode)) { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, pRawExpr->p); + goto _exit; + } + val->literal = strndup(pRawExpr->p, pRawExpr->n); + } else { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTERNAL_ERROR, "Invalid parameters"); + goto _exit; + } + if (!val->literal) { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_OUT_OF_MEMORY, "Out of memory"); + goto _exit; + } + + val->node.resType.type = dataType; + val->node.resType.bytes = IS_VAR_DATA_TYPE(dataType) ? strlen(val->literal) : tDataTypes[dataType].bytes; + if (TSDB_DATA_TYPE_TIMESTAMP == dataType) { + val->node.resType.precision = TSDB_TIME_PRECISION_MILLI; + } +_exit: + nodesDestroyNode(pNode); + if (pCxt->errCode != 0) { + nodesDestroyNode((SNode*)val); + return NULL; + } + return (SNode*)val; +} + +SNode* createRawValueNodeExt(SAstCreateContext* pCxt, int32_t dataType, const SToken* pLiteral, SNode* pLeft, + SNode* pRight) { + CHECK_PARSER_STATUS(pCxt); + SValueNode* val = NULL; + + if (!(val = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE))) { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_OUT_OF_MEMORY, "Out of memory"); + goto _exit; + } + if (pLiteral) { + if (!(val->literal = strndup(pLiteral->z, pLiteral->n))) { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_OUT_OF_MEMORY, "Out of memory"); + goto _exit; + } + } else { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTERNAL_ERROR, "Invalid parameters"); + goto _exit; + } + + val->node.resType.type = dataType; + val->node.resType.bytes = IS_VAR_DATA_TYPE(dataType) ? strlen(val->literal) : tDataTypes[dataType].bytes; + if (TSDB_DATA_TYPE_TIMESTAMP == dataType) { + val->node.resType.precision = TSDB_TIME_PRECISION_MILLI; + } +_exit: + nodesDestroyNode(pLeft); + nodesDestroyNode(pRight); + if (pCxt->errCode != 0) { + nodesDestroyNode((SNode*)val); + return NULL; + } + return (SNode*)val; +} + static bool hasHint(SNodeList* pHintList, EHintOption hint) { if (!pHintList) return false; SNode* pNode; diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 9b34672418..5d268f7bda 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -72,9 +72,7 @@ int32_t parse(SParseContext* pParseCxt, SQuery** pQuery) { cxt.errCode = TSDB_CODE_PAR_SYNTAX_ERROR; goto abort_parse; } - case TK_NK_HEX: - case TK_NK_OCT: - case TK_NK_BIN: { + case TK_NK_OCT: { snprintf(cxt.pQueryCxt->pMsg, cxt.pQueryCxt->msgLen, "unsupported token: \"%s\"", t0.z); cxt.errCode = TSDB_CODE_PAR_SYNTAX_ERROR; goto abort_parse; diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index 7d10d1f2df..5eb0b67884 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -20,32 +20,6 @@ #include "ttime.h" #include "geosWrapper.h" -#define NEXT_TOKEN_WITH_PREV(pSql, token) \ - do { \ - int32_t index = 0; \ - token = tStrGetToken(pSql, &index, true, NULL); \ - pSql += index; \ - } while (0) - -#define NEXT_TOKEN_WITH_PREV_EXT(pSql, token, pIgnoreComma) \ - do { \ - int32_t index = 0; \ - token = tStrGetToken(pSql, &index, true, pIgnoreComma); \ - pSql += index; \ - } while (0) - -#define NEXT_TOKEN_KEEP_SQL(pSql, token, index) \ - do { \ - token = tStrGetToken(pSql, &index, false, NULL); \ - } while (0) - -#define NEXT_VALID_TOKEN(pSql, token) \ - do { \ - (token).n = tGetToken(pSql, &(token).type); \ - (token).z = (char*)pSql; \ - pSql += (token).n; \ - } while (TK_NK_SPACE == (token).type) - typedef struct SInsertParseContext { SParseContext* pComCxt; SMsgBuf msg; @@ -63,13 +37,9 @@ typedef int32_t (*_row_append_fn_t)(SMsgBuf* pMsgBuf, const void* value, int32_t static uint8_t TRUE_VALUE = (uint8_t)TSDB_TRUE; static uint8_t FALSE_VALUE = (uint8_t)TSDB_FALSE; -static bool isNullStr(SToken* pToken) { - return ((pToken->type == TK_NK_STRING) && (strlen(TSDB_DATA_NULL_STR_L) == pToken->n) && - (strncasecmp(TSDB_DATA_NULL_STR_L, pToken->z, pToken->n) == 0)); -} - -static bool isNullValue(int8_t dataType, SToken* pToken) { - return TK_NULL == pToken->type || (!IS_STR_DATA_TYPE(dataType) && isNullStr(pToken)); +static FORCE_INLINE bool isNullValue(int8_t dataType, SToken* pToken) { + return TK_NULL == pToken->type || + (TK_NK_STRING == pToken->type && !IS_STR_DATA_TYPE(dataType) && IS_NULL_STR(pToken->z, pToken->n)); } static FORCE_INLINE int32_t toDouble(SToken* pToken, double* value, char** endPtr) { @@ -268,7 +238,8 @@ static int32_t parseBoundColumns(SInsertParseContext* pCxt, const char** pSql, E return code; } -static int parseTimestampOrInterval(const char** end, SToken* pToken, int16_t timePrec, int64_t* ts, int64_t* interval, SMsgBuf* pMsgBuf, bool* isTs) { +static int parseTimestampOrInterval(const char** end, SToken* pToken, int16_t timePrec, int64_t* ts, int64_t* interval, + SMsgBuf* pMsgBuf, bool* isTs) { if (pToken->type == TK_NOW) { *isTs = true; *ts = taosGetTimestamp(timePrec); @@ -289,7 +260,21 @@ static int parseTimestampOrInterval(const char** end, SToken* pToken, int16_t ti } else { // parse the RFC-3339/ISO-8601 timestamp format string *isTs = true; if (taosParseTime(pToken->z, ts, pToken->n, timePrec, tsDaylight) != TSDB_CODE_SUCCESS) { - return buildSyntaxErrMsg(pMsgBuf, "invalid timestamp format", pToken->z); + if ((pToken->n == 0) || + (pToken->type != TK_NK_STRING && pToken->type != TK_NK_HEX && pToken->type != TK_NK_BIN)) { + return buildSyntaxErrMsg(pMsgBuf, "invalid timestamp format", pToken->z); + } + if (IS_NOW_STR(pToken->z, pToken->n)) { + *isTs = true; + *ts = taosGetTimestamp(timePrec); + } else if (IS_TODAY_STR(pToken->z, pToken->n)) { + *isTs = true; + *ts = taosGetTimestampToday(timePrec); + } else if (TSDB_CODE_SUCCESS == toIntegerPure(pToken->z, pToken->n, 10, ts)) { + *isTs = true; + } else { + return buildSyntaxErrMsg(pMsgBuf, "invalid timestamp format", pToken->z); + } } } @@ -313,10 +298,22 @@ static int parseTime(const char** end, SToken* pToken, int16_t timePrec, int64_t for (int k = pToken->n; pToken->z[k] != '\0'; k++) { if (pToken->z[k] == ' ' || pToken->z[k] == '\t') continue; - if (pToken->z[k] == '(' && pToken->z[k + 1] == ')') { // for insert NOW()/TODAY() - *end = pTokenEnd = &pToken->z[k + 2]; - k++; - continue; + if (pToken->z[k] == '(') { // for insert NOW()/TODAY() + if (pToken->z[k + 1] == ')') { + *end = pTokenEnd = &pToken->z[k + 2]; + ++k; + continue; + } else { + char nc = pToken->z[k + 1]; + while (nc == ' ' || nc == '\t' || nc == '\n' || nc == '\r' || nc == '\f') { + nc = pToken->z[(++k) + 1]; + } + if (nc == ')') { + *end = pTokenEnd = &pToken->z[k + 2]; + ++k; + continue; + } + } } if (pToken->z[k] == ',') { *end = pTokenEnd; @@ -491,10 +488,12 @@ static int32_t parseTagToken(const char** end, SToken* pToken, SSchema* pSchema, switch (pSchema->type) { case TSDB_DATA_TYPE_BOOL: { if ((pToken->type == TK_NK_BOOL || pToken->type == TK_NK_STRING) && (pToken->n != 0)) { - if (strncmp(pToken->z, "true", pToken->n) == 0) { + if (IS_TRUE_STR(pToken->z, pToken->n)) { *(int8_t*)(&val->i64) = TRUE_VALUE; - } else if (strncmp(pToken->z, "false", pToken->n) == 0) { + } else if (IS_FALSE_STR(pToken->z, pToken->n)) { *(int8_t*)(&val->i64) = FALSE_VALUE; + } else if (TSDB_CODE_SUCCESS == toDoubleEx(pToken->z, pToken->n, pToken->type, (double*)&iv)) { + *(int8_t*)(&val->i64) = (*(double*)&iv == 0 ? FALSE_VALUE : TRUE_VALUE); } else { return buildSyntaxErrMsg(pMsgBuf, "invalid bool data", pToken->z); } @@ -502,6 +501,9 @@ static int32_t parseTagToken(const char** end, SToken* pToken, SSchema* pSchema, *(int8_t*)(&val->i64) = ((taosStr2Int64(pToken->z, NULL, 10) == 0) ? FALSE_VALUE : TRUE_VALUE); } else if (pToken->type == TK_NK_FLOAT) { *(int8_t*)(&val->i64) = ((taosStr2Double(pToken->z, NULL) == 0) ? FALSE_VALUE : TRUE_VALUE); + } else if ((pToken->type == TK_NK_HEX || pToken->type == TK_NK_BIN) && + (TSDB_CODE_SUCCESS == toDoubleEx(pToken->z, pToken->n, pToken->type, (double*)&iv))) { + *(int8_t*)(&val->i64) = (*(double*)&iv == 0 ? FALSE_VALUE : TRUE_VALUE); } else { return buildSyntaxErrMsg(pMsgBuf, "invalid bool data", pToken->z); } @@ -709,30 +711,29 @@ static int32_t parseBoundTagsClause(SInsertParseContext* pCxt, SVnodeModifyOpStm return parseBoundColumns(pCxt, &pStmt->pSql, BOUND_TAGS, pStmt->pTableMeta, &pCxt->tags); } -static int32_t parseTagValue(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, const char** ppSql, SSchema* pTagSchema, SToken* pToken, - SArray* pTagName, SArray* pTagVals, STag** pTag) { +int32_t parseTagValue(SMsgBuf* pMsgBuf, const char** pSql, uint8_t precision, SSchema* pTagSchema, SToken* pToken, + SArray* pTagName, SArray* pTagVals, STag** pTag) { bool isNull = isNullValue(pTagSchema->type, pToken); - if (!isNull) { + if (!isNull && pTagName) { taosArrayPush(pTagName, pTagSchema->name); } if (pTagSchema->type == TSDB_DATA_TYPE_JSON) { if (pToken->n > (TSDB_MAX_JSON_TAG_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) { - return buildSyntaxErrMsg(&pCxt->msg, "json string too long than 4095", pToken->z); + return buildSyntaxErrMsg(pMsgBuf, "json string too long than 4095", pToken->z); } if (isNull) { return tTagNew(pTagVals, 1, true, pTag); } else { - return parseJsontoTagData(pToken->z, pTagVals, pTag, &pCxt->msg); + return parseJsontoTagData(pToken->z, pTagVals, pTag, pMsgBuf); } } if (isNull) return 0; STagVal val = {0}; - int32_t code = - parseTagToken(ppSql, pToken, pTagSchema, pStmt->pTableMeta->tableInfo.precision, &val, &pCxt->msg); + int32_t code = parseTagToken(pSql, pToken, pTagSchema, precision, &val, pMsgBuf); if (TSDB_CODE_SUCCESS == code) { taosArrayPush(pTagVals, &val); } @@ -755,7 +756,7 @@ static int32_t buildCreateTbReq(SVnodeModifyOpStmt* pStmt, STag* pTag, SArray* p return TSDB_CODE_SUCCESS; } -static int32_t checkAndTrimValue(SToken* pToken, char* tmpTokenBuf, SMsgBuf* pMsgBuf, int8_t type) { +int32_t checkAndTrimValue(SToken* pToken, char* tmpTokenBuf, SMsgBuf* pMsgBuf, int8_t type) { if ((pToken->type != TK_NOW && pToken->type != TK_TODAY && pToken->type != TK_NK_INTEGER && pToken->type != TK_NK_STRING && pToken->type != TK_NK_FLOAT && pToken->type != TK_NK_BOOL && pToken->type != TK_NULL && pToken->type != TK_NK_HEX && pToken->type != TK_NK_OCT && @@ -911,12 +912,20 @@ static int32_t checkSubtablePrivilege(SArray* pTagVals, SArray* pTagName, SNode* static int32_t parseTagsClauseImpl(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { int32_t code = TSDB_CODE_SUCCESS; SSchema* pSchema = getTableTagSchema(pStmt->pTableMeta); - SArray* pTagVals = taosArrayInit(pCxt->tags.numOfBound, sizeof(STagVal)); - SArray* pTagName = taosArrayInit(8, TSDB_COL_NAME_LEN); + SArray* pTagVals = NULL; + SArray* pTagName = NULL; + uint8_t precision = pStmt->pTableMeta->tableInfo.precision; SToken token; bool isParseBindParam = false; bool isJson = false; STag* pTag = NULL; + + if (!(pTagVals = taosArrayInit(pCxt->tags.numOfBound, sizeof(STagVal))) || + !(pTagName = taosArrayInit(pCxt->tags.numOfBound, TSDB_COL_NAME_LEN))) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + for (int i = 0; TSDB_CODE_SUCCESS == code && i < pCxt->tags.numOfBound; ++i) { NEXT_TOKEN_WITH_PREV(pStmt->pSql, token); @@ -938,11 +947,11 @@ static int32_t parseTagsClauseImpl(SInsertParseContext* pCxt, SVnodeModifyOpStmt SSchema* pTagSchema = &pSchema[pCxt->tags.pColIndex[i]]; isJson = pTagSchema->type == TSDB_DATA_TYPE_JSON; code = checkAndTrimValue(&token, pCxt->tmpTokenBuf, &pCxt->msg, pTagSchema->type); - if (TK_NK_VARIABLE == token.type) { + if (TSDB_CODE_SUCCESS == code && TK_NK_VARIABLE == token.type) { code = buildSyntaxErrMsg(&pCxt->msg, "not expected tags values ", token.z); } if (TSDB_CODE_SUCCESS == code) { - code = parseTagValue(pCxt, pStmt, &pStmt->pSql, pTagSchema, &token, pTagName, pTagVals, &pTag); + code = parseTagValue(&pCxt->msg, &pStmt->pSql, precision, pTagSchema, &token, pTagName, pTagVals, &pTag); } } @@ -959,8 +968,9 @@ static int32_t parseTagsClauseImpl(SInsertParseContext* pCxt, SVnodeModifyOpStmt pTag = NULL; } - for (int i = 0; i < taosArrayGetSize(pTagVals); ++i) { - STagVal* p = (STagVal*)taosArrayGet(pTagVals, i); +_exit: + for (int32_t i = 0; i < TARRAY_SIZE(pTagVals); ++i) { + STagVal* p = (STagVal*)TARRAY_GET_ELEM(pTagVals, i); if (IS_VAR_DATA_TYPE(p->type)) { taosMemoryFreeClear(p->pData); } @@ -1425,10 +1435,12 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, switch (pSchema->type) { case TSDB_DATA_TYPE_BOOL: { if ((pToken->type == TK_NK_BOOL || pToken->type == TK_NK_STRING) && (pToken->n != 0)) { - if (strncmp(pToken->z, "true", pToken->n) == 0) { + if (IS_TRUE_STR(pToken->z, pToken->n)) { pVal->value.val = TRUE_VALUE; - } else if (strncmp(pToken->z, "false", pToken->n) == 0) { + } else if (IS_FALSE_STR(pToken->z, pToken->n)) { pVal->value.val = FALSE_VALUE; + } else if (TSDB_CODE_SUCCESS == toDoubleEx(pToken->z, pToken->n, pToken->type, (double*)&pVal->value.val)) { + *(int8_t*)(&pVal->value.val) = (*(double*)&pVal->value.val == 0 ? FALSE_VALUE : TRUE_VALUE); } else { return buildSyntaxErrMsg(&pCxt->msg, "invalid bool data", pToken->z); } @@ -1436,6 +1448,9 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, pVal->value.val = ((taosStr2Int64(pToken->z, NULL, 10) == 0) ? FALSE_VALUE : TRUE_VALUE); } else if (pToken->type == TK_NK_FLOAT) { pVal->value.val = ((taosStr2Double(pToken->z, NULL) == 0) ? FALSE_VALUE : TRUE_VALUE); + } else if ((pToken->type == TK_NK_HEX || pToken->type == TK_NK_BIN) && + (TSDB_CODE_SUCCESS == toDoubleEx(pToken->z, pToken->n, pToken->type, (double*)&pVal->value.val))) { + *(int8_t*)(&pVal->value.val) = (*(double*)&pVal->value.val == 0 ? FALSE_VALUE : TRUE_VALUE); } else { return buildSyntaxErrMsg(&pCxt->msg, "invalid bool data", pToken->z); } @@ -1510,7 +1525,7 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, break; } case TSDB_DATA_TYPE_FLOAT: { - double dv; + double dv; int32_t code = toDoubleEx(pToken->z, pToken->n, pToken->type, &dv); if (TSDB_CODE_SUCCESS != code) { return buildSyntaxErrMsg(&pCxt->msg, "illegal float data", pToken->z); @@ -1523,7 +1538,7 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, break; } case TSDB_DATA_TYPE_DOUBLE: { - double dv; + double dv; int32_t code = toDoubleEx(pToken->z, pToken->n, pToken->type, &dv); if (TSDB_CODE_SUCCESS != code) { return buildSyntaxErrMsg(&pCxt->msg, "illegal float data", pToken->z); @@ -1549,7 +1564,7 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, } case TSDB_DATA_TYPE_VARBINARY: { int32_t code = parseVarbinary(pToken, &pVal->value.pData, &pVal->value.nData, pSchema->bytes); - if(code != TSDB_CODE_SUCCESS){ + if (code != TSDB_CODE_SUCCESS) { return generateSyntaxErrMsg(&pCxt->msg, code, pSchema->name); } break; @@ -1587,9 +1602,9 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, break; } case TSDB_DATA_TYPE_GEOMETRY: { - int32_t code = TSDB_CODE_FAILED; - unsigned char *output = NULL; - size_t size = 0; + int32_t code = TSDB_CODE_FAILED; + unsigned char* output = NULL; + size_t size = 0; code = parseGeometry(pToken, &output, &size); if (code != TSDB_CODE_SUCCESS) { @@ -1598,13 +1613,11 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, // Too long values will raise the invalid sql error message else if (size + VARSTR_HEADER_SIZE > pSchema->bytes) { code = generateSyntaxErrMsg(&pCxt->msg, TSDB_CODE_PAR_VALUE_TOO_LONG, pSchema->name); - } - else { + } else { pVal->value.pData = taosMemoryMalloc(size); if (NULL == pVal->value.pData) { code = TSDB_CODE_OUT_OF_MEMORY; - } - else { + } else { memcpy(pVal->value.pData, output, size); pVal->value.nData = size; } @@ -1639,18 +1652,14 @@ static int32_t parseValueToken(SInsertParseContext* pCxt, const char** pSql, STo return buildSyntaxErrMsg(&pCxt->msg, "primary timestamp should not be null", pToken->z); } - if (TK_NK_VARIABLE == pToken->type && pSchema->type != TSDB_DATA_TYPE_TIMESTAMP) { - return buildSyntaxErrMsg(&pCxt->msg, "invalid values", pToken->z); - } pVal->flag = CV_FLAG_NULL; return TSDB_CODE_SUCCESS; } - if (TSDB_CODE_SUCCESS == code && IS_NUMERIC_TYPE(pSchema->type) && pToken->n == 0) { - return buildSyntaxErrMsg(&pCxt->msg, "invalid numeric data", pToken->z); - } - if (TSDB_CODE_SUCCESS == code) { + if (pToken->n == 0 && IS_NUMERIC_TYPE(pSchema->type)) { + return buildSyntaxErrMsg(&pCxt->msg, "invalid numeric data", pToken->z); + } code = parseValueTokenImpl(pCxt, pSql, pToken, pSchema, timePrec, pVal); } @@ -1728,18 +1737,19 @@ static int32_t processCtbTagsAfterCtbName(SInsertParseContext* pCxt, SVnodeModif const SToken* tagTokens, SSchema* const* tagSchemas, int numOfTagTokens) { int32_t code = TSDB_CODE_SUCCESS; + uint8_t precision = pStmt->pTableMeta->tableInfo.precision; if (code == TSDB_CODE_SUCCESS && ctbFirst) { for (int32_t i = 0; code == TSDB_CODE_SUCCESS && i < numOfTagTokens; ++i) { SToken* pTagToken = (SToken*)(tagTokens + i); SSchema* pTagSchema = tagSchemas[i]; code = checkAndTrimValue(pTagToken, pCxt->tmpTokenBuf, &pCxt->msg, pTagSchema->type); - if (TK_NK_VARIABLE == pTagToken->type) { + if (code == TSDB_CODE_SUCCESS && TK_NK_VARIABLE == pTagToken->type) { code = buildInvalidOperationMsg(&pCxt->msg, "not expected tag"); } if (code == TSDB_CODE_SUCCESS) { - code = parseTagValue(pCxt, pStmt, NULL, pTagSchema, pTagToken, pStbRowsCxt->aTagNames, pStbRowsCxt->aTagVals, + code = parseTagValue(&pCxt->msg, NULL, precision, pTagSchema, pTagToken, pStbRowsCxt->aTagNames, pStbRowsCxt->aTagVals, &pStbRowsCxt->pTag); } } @@ -1759,11 +1769,12 @@ static int32_t doGetStbRowValues(SInsertParseContext* pCxt, SVnodeModifyOpStmt* const SBoundColInfo* pCols, const SSchema* pSchemas, SToken* tagTokens, SSchema** tagSchemas, int* pNumOfTagTokens, bool* bFoundTbName) { int32_t code = TSDB_CODE_SUCCESS; - SArray* pTagNames = pStbRowsCxt->aTagNames; - SArray* pTagVals = pStbRowsCxt->aTagVals; - bool canParseTagsAfter = !pStbRowsCxt->pTagCond && !pStbRowsCxt->hasTimestampTag; + SArray* pTagNames = pStbRowsCxt->aTagNames; + SArray* pTagVals = pStbRowsCxt->aTagVals; + bool canParseTagsAfter = !pStbRowsCxt->pTagCond && !pStbRowsCxt->hasTimestampTag; int32_t numOfCols = getNumOfColumns(pStbRowsCxt->pStbMeta); int32_t tbnameIdx = getTbnameSchemaIndex(pStbRowsCxt->pStbMeta); + uint8_t precision = getTableInfo(pStbRowsCxt->pStbMeta).precision; for (int i = 0; i < pCols->numOfBound && (code) == TSDB_CODE_SUCCESS; ++i) { const char* pTmpSql = *ppSql; bool ignoreComma = false; @@ -1781,7 +1792,7 @@ static int32_t doGetStbRowValues(SInsertParseContext* pCxt, SVnodeModifyOpStmt* if (pCols->pColIndex[i] < numOfCols) { const SSchema* pSchema = &pSchemas[pCols->pColIndex[i]]; SColVal* pVal = taosArrayGet(pStbRowsCxt->aColVals, pCols->pColIndex[i]); - code = parseValueToken(pCxt, ppSql, pToken, (SSchema*)pSchema, getTableInfo(pStbRowsCxt->pStbMeta).precision, pVal); + code = parseValueToken(pCxt, ppSql, pToken, (SSchema*)pSchema, precision, pVal); if (TK_NK_VARIABLE == pToken->type) { code = buildInvalidOperationMsg(&pCxt->msg, "not expected row value"); } @@ -1793,11 +1804,11 @@ static int32_t doGetStbRowValues(SInsertParseContext* pCxt, SVnodeModifyOpStmt* ++(*pNumOfTagTokens); } else { code = checkAndTrimValue(pToken, pCxt->tmpTokenBuf, &pCxt->msg, pTagSchema->type); - if (TK_NK_VARIABLE == pToken->type) { + if (code == TSDB_CODE_SUCCESS && TK_NK_VARIABLE == pToken->type) { code = buildInvalidOperationMsg(&pCxt->msg, "not expected row value"); } if (code == TSDB_CODE_SUCCESS) { - code = parseTagValue(pCxt, pStmt, ppSql, (SSchema*)pTagSchema, pToken, pTagNames, pTagVals, &pStbRowsCxt->pTag); + code = parseTagValue(&pCxt->msg, ppSql, precision, (SSchema*)pTagSchema, pToken, pTagNames, pTagVals, &pStbRowsCxt->pTag); } } } diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 43559bd28d..2e71b0f49b 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -668,7 +668,7 @@ uint32_t tGetToken(const char* z, uint32_t* tokenId) { *tokenId = TK_NK_ALIAS; // must be alias return i; } - if ((i == 4 && strncasecmp(z, "true", 4) == 0) || (i == 5 && strncasecmp(z, "false", 5) == 0)) { + if (IS_TRUE_STR(z, i) || IS_FALSE_STR(z, i)) { *tokenId = TK_NK_BOOL; return i; } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 413d62ef09..aa8f532ad6 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1638,12 +1638,13 @@ static EDealRes translateNormalValue(STranslateContext* pCxt, SValueNode* pVal, void* data = NULL; uint32_t size = 0; - bool isHexChar = isHex(pVal->literal, strlen(pVal->literal)); + uint32_t vlen = strlen(pVal->literal); + bool isHexChar = isHex(pVal->literal, vlen); if (isHexChar) { - if (!isValidateHex(pVal->literal, strlen(pVal->literal))) { + if (!isValidateHex(pVal->literal, vlen)) { return TSDB_CODE_PAR_INVALID_VARBINARY; } - if (taosHex2Ascii(pVal->literal, strlen(pVal->literal), &data, &size) < 0) { + if (taosHex2Ascii(pVal->literal, vlen, &data, &size) < 0) { return TSDB_CODE_OUT_OF_MEMORY; } } else { @@ -1667,14 +1668,15 @@ static EDealRes translateNormalValue(STranslateContext* pCxt, SValueNode* pVal, } case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_GEOMETRY: { - if (strict && (pVal->node.resType.bytes > targetDt.bytes - VARSTR_HEADER_SIZE)) { - return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, pVal->literal); + int32_t vlen = IS_VAR_DATA_TYPE(pVal->node.resType.type) ? pVal->node.resType.bytes : strlen(pVal->literal); + if (strict && (vlen > targetDt.bytes - VARSTR_HEADER_SIZE)) { + return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_VALUE_TOO_LONG, pVal->literal); } - pVal->datum.p = taosMemoryCalloc(1, targetDt.bytes + 1); + int32_t len = TMIN(targetDt.bytes - VARSTR_HEADER_SIZE, vlen); + pVal->datum.p = taosMemoryCalloc(1, len + VARSTR_HEADER_SIZE + 1); if (NULL == pVal->datum.p) { return generateDealNodeErrMsg(pCxt, TSDB_CODE_OUT_OF_MEMORY); } - int32_t len = TMIN(targetDt.bytes - VARSTR_HEADER_SIZE, pVal->node.resType.bytes); varDataSetLen(pVal->datum.p, len); strncpy(varDataVal(pVal->datum.p), pVal->literal, len); break; @@ -10749,75 +10751,6 @@ static int32_t createCastFuncForTag(STranslateContext* pCxt, SNode* pNode, SData return code; } -static int32_t createTagValFromExpr(STranslateContext* pCxt, SDataType targetDt, SNode* pNode, SValueNode** pVal) { - SNode* pCast = NULL; - int32_t code = createCastFuncForTag(pCxt, pNode, targetDt, &pCast); - SNode* pNew = NULL; - if (TSDB_CODE_SUCCESS == code) { - code = scalarCalculateConstants(pCast, &pNew); - } - if (TSDB_CODE_SUCCESS == code) { - pCast = pNew; - if (QUERY_NODE_VALUE != nodeType(pCast)) { - code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)pNode)->aliasName); - } - } - - if (TSDB_CODE_SUCCESS == code) { - *pVal = (SValueNode*)pCast; - } else { - nodesDestroyNode(pCast); - } - return code; -} - -static int32_t createTagValFromVal(STranslateContext* pCxt, SDataType targetDt, SNode* pNode, SValueNode** pVal) { - SValueNode* pTempVal = (SValueNode*)nodesCloneNode(pNode); - if (NULL == pTempVal) { - return TSDB_CODE_OUT_OF_MEMORY; - } - if (DEAL_RES_ERROR == translateValueImpl(pCxt, pTempVal, targetDt, true)) { - nodesDestroyNode((SNode*)pTempVal); - return pCxt->errCode; - } - *pVal = pTempVal; - return TSDB_CODE_SUCCESS; -} - -static int32_t createTagVal(STranslateContext* pCxt, uint8_t precision, SSchema* pSchema, SNode* pNode, - SValueNode** pVal) { - if (QUERY_NODE_VALUE == nodeType(pNode)) { - return createTagValFromVal(pCxt, schemaToDataType(precision, pSchema), pNode, pVal); - } else { - return createTagValFromExpr(pCxt, schemaToDataType(precision, pSchema), pNode, pVal); - } -} - -static int32_t buildJsonTagVal(STranslateContext* pCxt, SSchema* pTagSchema, SValueNode* pVal, SArray* pTagArray, - STag** ppTag) { - if (pVal->literal && strlen(pVal->literal) > (TSDB_MAX_JSON_TAG_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) { - return buildSyntaxErrMsg(&pCxt->msgBuf, "json string too long than 4095", pVal->literal); - } - - return parseJsontoTagData(pVal->literal, pTagArray, ppTag, &pCxt->msgBuf); -} - -static int32_t buildNormalTagVal(STranslateContext* pCxt, SSchema* pTagSchema, SValueNode* pVal, SArray* pTagArray) { - if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL) { - void* nodeVal = nodesGetValueFromNode(pVal); - STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; - // strcpy(val.colName, pTagSchema->name); - if (IS_VAR_DATA_TYPE(pTagSchema->type)) { - val.pData = varDataVal(nodeVal); - val.nData = varDataLen(nodeVal); - } else { - memcpy(&val.i64, nodeVal, pTagSchema->bytes); - } - taosArrayPush(pTagArray, &val); - } - return TSDB_CODE_SUCCESS; -} - static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableClause* pStmt, STableMeta* pSuperTableMeta, STag** ppTag, SArray* tagName) { int32_t numOfTags = getNumOfTags(pSuperTableMeta); @@ -10833,42 +10766,56 @@ static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableCla int32_t code = TSDB_CODE_SUCCESS; - bool isJson = false; - SNodeList* pVals = NULL; - SNode * pTag = NULL, *pNode = NULL; - FORBOTH(pTag, pStmt->pSpecificTags, pNode, pStmt->pValsOfTags) { - SColumnNode* pCol = (SColumnNode*)pTag; - SSchema* pSchema = getTagSchema(pSuperTableMeta, pCol->colName); - if (NULL == pSchema) { - code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TAG_NAME, pCol->colName); - } - SValueNode* pVal = NULL; + bool isJson = false; + SNode * pTagNode = NULL, *pNode = NULL; + uint8_t precision = pSuperTableMeta->tableInfo.precision; + SToken token; + char tokenBuf[TSDB_MAX_TAGS_LEN]; + const char* tagStr = NULL; + FORBOTH(pTagNode, pStmt->pSpecificTags, pNode, pStmt->pValsOfTags) { + tagStr = ((SValueNode*)pNode)->literal; + NEXT_TOKEN_WITH_PREV(tagStr, token); + + SSchema* pSchema = NULL; if (TSDB_CODE_SUCCESS == code) { - code = createTagVal(pCxt, pSuperTableMeta->tableInfo.precision, pSchema, pNode, &pVal); + if ((pSchema = getTagSchema(pSuperTableMeta, ((SColumnNode*)pTagNode)->colName))) { + code = checkAndTrimValue(&token, tokenBuf, &pCxt->msgBuf, pSchema->type); + if (TSDB_CODE_SUCCESS == code && TK_NK_VARIABLE == token.type) { + code = TSDB_CODE_TSC_SQL_SYNTAX_ERROR; + } + } else { + code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TAG_NAME, ((SColumnNode*)pTagNode)->colName); + } } + if (TSDB_CODE_SUCCESS == code) { if (pSchema->type == TSDB_DATA_TYPE_JSON) { isJson = true; - code = buildJsonTagVal(pCxt, pSchema, pVal, pTagArray, ppTag); - taosArrayPush(tagName, pCol->colName); - } else if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL) { - code = buildNormalTagVal(pCxt, pSchema, pVal, pTagArray); - taosArrayPush(tagName, pCol->colName); + } + code = parseTagValue(&pCxt->msgBuf, &tagStr, precision, pSchema, &token, tagName, pTagArray, ppTag); + } + + if (TSDB_CODE_SUCCESS == code) { + NEXT_VALID_TOKEN(tagStr, token); + if (token.n != 0) { + code = buildSyntaxErrMsg(&pCxt->msgBuf, "not expected tags values", token.z); } } - if (TSDB_CODE_SUCCESS == code) { - code = nodesListMakeAppend(&pVals, (SNode*)pVal); - } + if (TSDB_CODE_SUCCESS != code) { break; } } - if (TSDB_CODE_SUCCESS == code && !isJson) { code = tTagNew(pTagArray, 1, false, ppTag); } - nodesDestroyList(pVals); + for (int i = 0; i < taosArrayGetSize(pTagArray); ++i) { + STagVal* p = (STagVal*)taosArrayGet(pTagArray, i); + if (IS_VAR_DATA_TYPE(p->type)) { + taosMemoryFreeClear(p->pData); + } + } taosArrayDestroy(pTagArray); return code; } @@ -10886,51 +10833,52 @@ static int32_t buildKVRowForAllTags(STranslateContext* pCxt, SCreateSubTableClau int32_t code = TSDB_CODE_SUCCESS; - bool isJson = false; - int32_t index = 0; - SSchema* pTagSchemas = getTableTagSchema(pSuperTableMeta); - SNodeList* pVals = NULL; - SNode* pNode; + bool isJson = false; + SNode* pNode; + uint8_t precision = pSuperTableMeta->tableInfo.precision; + SSchema* pTagSchema = getTableTagSchema(pSuperTableMeta); + SToken token; + char tokenBuf[TSDB_MAX_TAGS_LEN]; + const char* tagStr = NULL; FOREACH(pNode, pStmt->pValsOfTags) { - SValueNode* pVal = NULL; - SSchema* pTagSchema = pTagSchemas + index; - code = createTagVal(pCxt, pSuperTableMeta->tableInfo.precision, pTagSchema, pNode, &pVal); + tagStr = ((SValueNode*)pNode)->literal; + NEXT_TOKEN_WITH_PREV(tagStr, token); + + code = checkAndTrimValue(&token, tokenBuf, &pCxt->msgBuf, pTagSchema->type); + if (TSDB_CODE_SUCCESS == code && TK_NK_VARIABLE == token.type) { + code = buildSyntaxErrMsg(&pCxt->msgBuf, "not expected tags values", token.z); + } + if (TSDB_CODE_SUCCESS == code) { if (pTagSchema->type == TSDB_DATA_TYPE_JSON) { isJson = true; - code = buildJsonTagVal(pCxt, pTagSchema, pVal, pTagArray, ppTag); - if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode((SNode*)pVal); - } - taosArrayPush(tagName, pTagSchema->name); - } else if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL && !pVal->isNull) { - char* tmpVal = nodesGetValueFromNode(pVal); - STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; - // strcpy(val.colName, pTagSchema->name); - if (IS_VAR_DATA_TYPE(pTagSchema->type)) { - val.pData = varDataVal(tmpVal); - val.nData = varDataLen(tmpVal); - } else { - memcpy(&val.i64, tmpVal, pTagSchema->bytes); - } - taosArrayPush(pTagArray, &val); - taosArrayPush(tagName, pTagSchema->name); + } + code = parseTagValue(&pCxt->msgBuf, &tagStr, precision, pTagSchema, &token, tagName, pTagArray, ppTag); + } + + if (TSDB_CODE_SUCCESS == code) { + NEXT_VALID_TOKEN(tagStr, token); + if (token.n != 0) { + code = buildSyntaxErrMsg(&pCxt->msgBuf, "not expected tags values", token.z); } } - if (TSDB_CODE_SUCCESS == code) { - code = nodesListMakeAppend(&pVals, (SNode*)pVal); - } + if (TSDB_CODE_SUCCESS != code) { break; } - ++index; + ++pTagSchema; } if (TSDB_CODE_SUCCESS == code && !isJson) { code = tTagNew(pTagArray, 1, false, ppTag); } - nodesDestroyList(pVals); + for (int32_t i = 0; i < TARRAY_SIZE(pTagArray); ++i) { + STagVal* p = (STagVal*)TARRAY_GET_ELEM(pTagArray, i); + if (IS_VAR_DATA_TYPE(p->type)) { + taosMemoryFreeClear(p->pData); + } + } taosArrayDestroy(pTagArray); return code; } @@ -11191,58 +11139,68 @@ static int32_t buildUpdateTagValReq(STranslateContext* pCxt, SAlterTableStmt* pS return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_ALTER_TABLE, "Invalid tag name: %s", pStmt->colName); } - pReq->tagName = taosStrdup(pStmt->colName); if (NULL == pReq->tagName) { return TSDB_CODE_OUT_OF_MEMORY; } + pReq->pTagArray = taosArrayInit(1, sizeof(STagVal)); + if (NULL == pReq->pTagArray) { + return TSDB_CODE_OUT_OF_MEMORY; + } pReq->colId = pSchema->colId; + pReq->tagType = pSchema->type; - SDataType targetDt = schemaToDataType(pTableMeta->tableInfo.precision, pSchema); + int32_t code = 0; - if (QUERY_NODE_VALUE != pStmt->pVal->node.type) { - SValueNode* pVal = NULL; - pCxt->errCode = createTagValFromExpr(pCxt, targetDt, (SNode*)pStmt->pVal, &pVal); - if (pCxt->errCode) { - return pCxt->errCode; - } - - nodesDestroyNode((SNode*)pStmt->pVal); - pStmt->pVal = pVal; - } else if (DEAL_RES_ERROR == translateValueImpl(pCxt, pStmt->pVal, targetDt, true)) { - return pCxt->errCode; - } - - pReq->tagType = targetDt.type; - if (targetDt.type == TSDB_DATA_TYPE_JSON) { - if (pStmt->pVal->literal && - strlen(pStmt->pVal->literal) > (TSDB_MAX_JSON_TAG_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) { - return buildSyntaxErrMsg(&pCxt->msgBuf, "json string too long than 4095", pStmt->pVal->literal); - } - SArray* pTagVals = taosArrayInit(1, sizeof(STagVal)); - int32_t code = TSDB_CODE_SUCCESS; - STag* pTag = NULL; - code = parseJsontoTagData(pStmt->pVal->literal, pTagVals, &pTag, &pCxt->msgBuf); - taosArrayDestroy(pTagVals); - if (code != TSDB_CODE_SUCCESS) { - return code; - } - pReq->nTagVal = pTag->len; - pReq->pTagVal = (uint8_t*)pTag; - pStmt->pVal->datum.p = (char*)pTag; // for free - } else { - pReq->isNull = pStmt->pVal->isNull; - pReq->nTagVal = pStmt->pVal->node.resType.bytes; - pReq->pTagVal = nodesGetValueFromNode(pStmt->pVal); - - // data and length are seperated for new tag format STagVal - if (IS_VAR_DATA_TYPE(pStmt->pVal->node.resType.type)) { - pReq->nTagVal = varDataLen(pReq->pTagVal); - pReq->pTagVal = varDataVal(pReq->pTagVal); + STag* pTag = NULL; + SToken token; + char tokenBuf[TSDB_MAX_TAGS_LEN]; + const char* tagStr = pStmt->pVal->literal; + NEXT_TOKEN_WITH_PREV(tagStr, token); + if (TSDB_CODE_SUCCESS == code) { + code = checkAndTrimValue(&token, tokenBuf, &pCxt->msgBuf, pSchema->type); + if (TSDB_CODE_SUCCESS == code && TK_NK_VARIABLE == token.type) { + code = buildSyntaxErrMsg(&pCxt->msgBuf, "not expected tags values", token.z); } } - return TSDB_CODE_SUCCESS; + if (TSDB_CODE_SUCCESS == code) { + code = parseTagValue(&pCxt->msgBuf, &tagStr, pTableMeta->tableInfo.precision, pSchema, &token, NULL, + pReq->pTagArray, &pTag); + if (pSchema->type == TSDB_DATA_TYPE_JSON && token.type == TK_NULL && code == TSDB_CODE_SUCCESS) { + pReq->tagFree = true; + } + } + if (TSDB_CODE_SUCCESS == code && tagStr) { + NEXT_VALID_TOKEN(tagStr, token); + if (token.n != 0) { + code = buildSyntaxErrMsg(&pCxt->msgBuf, "not expected tags values", token.z); + } + } + + if (TSDB_CODE_SUCCESS == code) { + if (pSchema->type == TSDB_DATA_TYPE_JSON) { + pReq->nTagVal = pTag->len; + pReq->pTagVal = (uint8_t*)pTag; + pStmt->pVal->datum.p = (char*)pTag; // for free + } else { + STagVal* pTagVal = taosArrayGet(pReq->pTagArray, 0); + if (pTagVal) { + pReq->isNull = false; + if (IS_VAR_DATA_TYPE(pSchema->type)) { + pReq->nTagVal = pTagVal->nData; + pReq->pTagVal = pTagVal->pData; + } else { + pReq->nTagVal = pSchema->bytes; + pReq->pTagVal = (uint8_t*)&pTagVal->i64; + } + } else { + pReq->isNull = true; + } + } + } + + return code; } static int32_t buildAddColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt, STableMeta* pTableMeta, @@ -11466,6 +11424,14 @@ static void destoryAlterTbReq(SVAlterTbReq* pReq) { taosMemoryFree(pReq->colNewName); taosMemoryFree(pReq->tagName); taosMemoryFree(pReq->newComment); + for (int i = 0; i < taosArrayGetSize(pReq->pTagArray); ++i) { + STagVal* p = (STagVal*)taosArrayGet(pReq->pTagArray, i); + if (IS_VAR_DATA_TYPE(p->type)) { + taosMemoryFreeClear(p->pData); + } + } + taosArrayDestroy(pReq->pTagArray); + if(pReq->tagFree) tTagFree((STag*)pReq->pTagVal); } static int32_t rewriteAlterTableImpl(STranslateContext* pCxt, SAlterTableStmt* pStmt, STableMeta* pTableMeta, diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 052296f19a..5ea3049968 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -370,7 +370,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, voi SHashObj* keyHash = NULL; int32_t size = 0; // set json NULL data - if (!json || strtrim((char*)json) == 0 || strcasecmp(json, TSDB_DATA_NULL_STR_L) == 0) { + if (!json || strcasecmp(json, TSDB_DATA_NULL_STR_L) == 0 || strtrim((char*)json) == 0) { retCode = TSDB_CODE_SUCCESS; goto end; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index a9c36e0996..3f1dca8958 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,30 +104,30 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 525 +#define YYNOCODE 529 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SToken yy29; - SAlterOption yy95; - SNodeList* yy124; - EFillMode yy144; - STokenPair yy147; - EJoinType yy162; - EJoinSubType yy354; - int64_t yy459; - EOperatorType yy590; - EOrder yy638; - SShowTablesOption yy667; - int32_t yy760; - SDataType yy784; - EShowKind yy789; - int8_t yy803; - SNode* yy812; - bool yy887; - ENullOrder yy907; + EOrder yy32; + SShowTablesOption yy131; + EJoinType yy148; + STokenPair yy187; + int32_t yy294; + int8_t yy337; + SDataType yy384; + SAlterOption yy511; + bool yy517; + SNodeList* yy608; + SNode* yy614; + ENullOrder yy685; + EFillMode yy720; + EShowKind yy769; + int64_t yy777; + SToken yy803; + EJoinSubType yy832; + EOperatorType yy1034; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -143,18 +143,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 862 -#define YYNRULE 666 -#define YYNRULE_WITH_ACTION 666 -#define YYNTOKEN 359 -#define YY_MAX_SHIFT 861 -#define YY_MIN_SHIFTREDUCE 1279 -#define YY_MAX_SHIFTREDUCE 1944 -#define YY_ERROR_ACTION 1945 -#define YY_ACCEPT_ACTION 1946 -#define YY_NO_ACTION 1947 -#define YY_MIN_REDUCE 1948 -#define YY_MAX_REDUCE 2613 +#define YYNSTATE 869 +#define YYNRULE 687 +#define YYNRULE_WITH_ACTION 687 +#define YYNTOKEN 361 +#define YY_MAX_SHIFT 868 +#define YY_MIN_SHIFTREDUCE 1304 +#define YY_MAX_SHIFTREDUCE 1990 +#define YY_ERROR_ACTION 1991 +#define YY_ACCEPT_ACTION 1992 +#define YY_NO_ACTION 1993 +#define YY_MIN_REDUCE 1994 +#define YY_MAX_REDUCE 2680 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -221,881 +221,919 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3063) +#define YY_ACTTAB_COUNT (3259) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 2276, 572, 480, 473, 573, 1991, 580, 714, 472, 573, - /* 10 */ 1991, 2127, 48, 46, 1866, 2584, 38, 326, 2274, 734, - /* 20 */ 424, 746, 1690, 41, 40, 652, 2209, 47, 45, 44, - /* 30 */ 43, 42, 202, 713, 208, 1775, 2034, 1688, 2585, 715, - /* 40 */ 650, 174, 648, 274, 273, 2396, 577, 539, 537, 2077, - /* 50 */ 372, 2501, 574, 680, 221, 726, 147, 2276, 729, 189, - /* 60 */ 1715, 2584, 41, 40, 1715, 1770, 47, 45, 44, 43, - /* 70 */ 42, 19, 417, 1715, 2589, 2273, 734, 2498, 1696, 2590, - /* 80 */ 208, 390, 2584, 2256, 2585, 715, 2414, 201, 429, 41, - /* 90 */ 40, 2184, 2186, 47, 45, 44, 43, 42, 2362, 2178, - /* 100 */ 763, 2588, 489, 2252, 858, 2585, 2587, 15, 51, 833, - /* 110 */ 832, 831, 830, 436, 63, 829, 828, 152, 823, 822, - /* 120 */ 821, 820, 819, 818, 817, 151, 811, 810, 809, 435, - /* 130 */ 434, 806, 805, 804, 188, 187, 803, 52, 1345, 2395, - /* 140 */ 1344, 704, 2433, 1777, 1778, 114, 2397, 767, 2399, 2400, - /* 150 */ 762, 223, 757, 1971, 242, 143, 2191, 191, 575, 2486, - /* 160 */ 1999, 1970, 1910, 420, 2482, 184, 2494, 725, 244, 139, - /* 170 */ 724, 733, 575, 1346, 1999, 2191, 2589, 2584, 747, 2138, - /* 180 */ 1750, 1760, 388, 209, 2584, 518, 517, 1776, 1779, 1882, - /* 190 */ 2189, 2533, 746, 726, 147, 713, 208, 533, 138, 2372, - /* 200 */ 2585, 715, 1691, 2588, 1689, 615, 2362, 2585, 2586, 1941, - /* 210 */ 1806, 41, 40, 2129, 2362, 47, 45, 44, 43, 42, - /* 220 */ 1589, 1590, 128, 2376, 1751, 127, 126, 125, 124, 123, - /* 230 */ 122, 121, 120, 119, 1694, 1695, 1747, 703, 1749, 1752, - /* 240 */ 1753, 1754, 1755, 1756, 1757, 1758, 1759, 759, 755, 1768, - /* 250 */ 1769, 1771, 1772, 1773, 1774, 2, 48, 46, 2589, 232, - /* 260 */ 714, 370, 1716, 1713, 424, 2414, 1690, 2378, 2584, 592, - /* 270 */ 523, 746, 2396, 542, 382, 1718, 1328, 757, 541, 1775, - /* 280 */ 1748, 1688, 1714, 532, 231, 761, 713, 208, 310, 277, - /* 290 */ 35, 2585, 715, 276, 503, 106, 543, 747, 2138, 1716, - /* 300 */ 1811, 371, 505, 117, 2494, 2495, 1969, 145, 2499, 1770, - /* 310 */ 1319, 310, 483, 2414, 663, 19, 1483, 138, 1804, 1719, - /* 320 */ 2131, 457, 1696, 1940, 620, 2362, 702, 763, 802, 1326, - /* 330 */ 1474, 792, 791, 790, 1478, 789, 1480, 1481, 788, 785, - /* 340 */ 189, 1489, 782, 1491, 1492, 779, 776, 773, 858, 391, - /* 350 */ 2588, 15, 1321, 1324, 1325, 2343, 1690, 1747, 51, 2362, - /* 360 */ 491, 2037, 98, 1934, 2257, 377, 2395, 112, 403, 2433, - /* 370 */ 654, 1688, 362, 2397, 767, 2399, 2400, 762, 760, 757, - /* 380 */ 748, 2451, 1805, 1870, 148, 1609, 1610, 1777, 1778, 1715, - /* 390 */ 2263, 2242, 2130, 530, 529, 528, 527, 522, 521, 520, - /* 400 */ 519, 374, 588, 726, 147, 509, 508, 507, 506, 500, - /* 410 */ 499, 498, 1696, 493, 492, 389, 12, 589, 1715, 484, - /* 420 */ 1577, 1578, 1518, 1519, 1750, 1760, 1596, 2185, 2186, 1608, - /* 430 */ 1611, 1776, 1779, 1718, 634, 633, 632, 308, 858, 661, - /* 440 */ 68, 624, 144, 628, 14, 13, 1691, 627, 1689, 461, - /* 450 */ 433, 432, 626, 631, 398, 397, 63, 1968, 625, 495, - /* 460 */ 2252, 621, 37, 422, 1799, 1800, 1801, 1802, 1803, 1807, - /* 470 */ 1808, 1809, 1810, 590, 2269, 1697, 463, 459, 1694, 1695, - /* 480 */ 1747, 199, 1749, 1752, 1753, 1754, 1755, 1756, 1757, 1758, - /* 490 */ 1759, 759, 755, 1768, 1769, 1771, 1772, 1773, 1774, 2, - /* 500 */ 12, 48, 46, 1348, 1349, 63, 2396, 2501, 225, 424, - /* 510 */ 2362, 1690, 728, 177, 2494, 2495, 1438, 145, 2499, 764, - /* 520 */ 1696, 634, 633, 632, 1775, 699, 1688, 1899, 624, 144, - /* 530 */ 628, 1437, 310, 2497, 627, 1720, 1691, 331, 1689, 626, - /* 540 */ 631, 398, 397, 63, 2396, 625, 1948, 2414, 621, 1751, - /* 550 */ 471, 1818, 470, 1719, 1770, 525, 2252, 729, 793, 2362, - /* 560 */ 19, 763, 1843, 1844, 1845, 1846, 1847, 1696, 1694, 1695, - /* 570 */ 137, 136, 135, 134, 133, 132, 131, 130, 129, 611, - /* 580 */ 610, 2396, 469, 214, 9, 2414, 696, 695, 1897, 1898, - /* 590 */ 1900, 1901, 1902, 858, 764, 308, 15, 2362, 544, 763, - /* 600 */ 2395, 2225, 2396, 2433, 230, 1748, 114, 2397, 767, 2399, - /* 610 */ 2400, 762, 182, 757, 303, 764, 150, 2001, 157, 2457, - /* 620 */ 2486, 1967, 2414, 664, 420, 2482, 705, 700, 693, 689, - /* 630 */ 310, 721, 1777, 1778, 2362, 175, 763, 1960, 2395, 747, - /* 640 */ 2138, 2433, 1700, 2414, 114, 2397, 767, 2399, 2400, 762, - /* 650 */ 717, 757, 747, 2138, 34, 2362, 191, 763, 2486, 212, - /* 660 */ 41, 40, 420, 2482, 47, 45, 44, 43, 42, 1750, - /* 670 */ 1760, 12, 56, 10, 2362, 2395, 1776, 1779, 2433, 310, - /* 680 */ 3, 115, 2397, 767, 2399, 2400, 762, 1345, 757, 1344, - /* 690 */ 2534, 1691, 54, 1689, 1841, 2486, 2395, 582, 2315, 2433, - /* 700 */ 2483, 1841, 114, 2397, 767, 2399, 2400, 762, 1426, 757, - /* 710 */ 111, 2191, 726, 147, 2604, 203, 2486, 310, 404, 108, - /* 720 */ 420, 2482, 1346, 1694, 1695, 1747, 2189, 1749, 1752, 1753, - /* 730 */ 1754, 1755, 1756, 1757, 1758, 1759, 759, 755, 1768, 1769, - /* 740 */ 1771, 1772, 1773, 1774, 2, 48, 46, 1780, 569, 1428, - /* 750 */ 2396, 747, 2138, 424, 619, 1690, 278, 567, 618, 260, - /* 760 */ 563, 559, 516, 764, 95, 2541, 515, 813, 1775, 1720, - /* 770 */ 1688, 477, 41, 40, 514, 183, 47, 45, 44, 43, - /* 780 */ 42, 392, 747, 2138, 609, 605, 601, 597, 2396, 259, - /* 790 */ 2133, 2414, 47, 45, 44, 43, 42, 30, 1770, 613, - /* 800 */ 612, 764, 478, 2362, 1785, 763, 1838, 1839, 1840, 2114, - /* 810 */ 1715, 1696, 2506, 1838, 1839, 1840, 2506, 2506, 2506, 2506, - /* 820 */ 2506, 2191, 178, 2494, 2495, 2396, 145, 2499, 414, 2414, - /* 830 */ 96, 2191, 815, 257, 1658, 1659, 2189, 858, 764, 816, - /* 840 */ 49, 2362, 2099, 763, 2395, 2396, 742, 2433, 630, 629, - /* 850 */ 114, 2397, 767, 2399, 2400, 762, 1863, 757, 764, 749, - /* 860 */ 2554, 2458, 2604, 160, 2486, 2115, 2414, 2078, 420, 2482, - /* 870 */ 2501, 408, 1911, 172, 747, 2138, 1777, 1778, 2362, 802, - /* 880 */ 763, 2141, 2395, 747, 2138, 2433, 2414, 2372, 115, 2397, - /* 890 */ 767, 2399, 2400, 762, 497, 757, 2496, 1891, 2362, 247, - /* 900 */ 763, 2380, 2486, 510, 1841, 722, 2485, 2482, 256, 249, - /* 910 */ 95, 2376, 1892, 1750, 1760, 254, 586, 827, 825, 2395, - /* 920 */ 1776, 1779, 2433, 747, 2138, 363, 2397, 767, 2399, 2400, - /* 930 */ 762, 751, 757, 2458, 246, 1691, 2134, 1689, 55, 2395, - /* 940 */ 747, 2138, 2433, 511, 2123, 114, 2397, 767, 2399, 2400, - /* 950 */ 762, 2191, 757, 1890, 2235, 2378, 421, 2604, 419, 2486, - /* 960 */ 512, 1976, 853, 420, 2482, 757, 2189, 1694, 1695, 1747, - /* 970 */ 1751, 1749, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, - /* 980 */ 759, 755, 1768, 1769, 1771, 1772, 1773, 1774, 2, 48, - /* 990 */ 46, 747, 2138, 317, 318, 2396, 487, 424, 316, 1690, - /* 1000 */ 227, 800, 162, 161, 797, 796, 795, 159, 764, 1442, - /* 1010 */ 691, 591, 1775, 2113, 1688, 2506, 1838, 1839, 1840, 2506, - /* 1020 */ 2506, 2506, 2506, 2506, 1441, 2396, 1748, 41, 40, 747, - /* 1030 */ 2138, 47, 45, 44, 43, 42, 2414, 2372, 764, 622, - /* 1040 */ 2577, 90, 1770, 1949, 89, 1719, 36, 2191, 2362, 2135, - /* 1050 */ 763, 2381, 41, 40, 428, 1696, 47, 45, 44, 43, - /* 1060 */ 42, 2376, 2189, 1423, 128, 1966, 2414, 127, 126, 125, - /* 1070 */ 124, 123, 122, 121, 120, 119, 1943, 1944, 2362, 1326, - /* 1080 */ 763, 858, 1715, 1965, 49, 1964, 641, 149, 2324, 2395, - /* 1090 */ 2457, 546, 2433, 2396, 2346, 114, 2397, 767, 2399, 2400, - /* 1100 */ 762, 653, 757, 1324, 1325, 2378, 764, 2604, 427, 2486, - /* 1110 */ 88, 664, 718, 420, 2482, 757, 169, 275, 2362, 2395, - /* 1120 */ 1777, 1778, 2433, 405, 2140, 114, 2397, 767, 2399, 2400, - /* 1130 */ 762, 2189, 757, 644, 2414, 1862, 2362, 2604, 2362, 2486, - /* 1140 */ 638, 636, 279, 420, 2482, 446, 2362, 272, 763, 800, - /* 1150 */ 162, 161, 797, 796, 795, 159, 794, 1750, 1760, 2182, - /* 1160 */ 747, 2138, 41, 40, 1776, 1779, 47, 45, 44, 43, - /* 1170 */ 42, 800, 162, 161, 797, 796, 795, 159, 2125, 1691, - /* 1180 */ 280, 1689, 747, 2138, 679, 666, 2315, 2395, 72, 2355, - /* 1190 */ 2433, 71, 2191, 179, 2397, 767, 2399, 2400, 762, 2121, - /* 1200 */ 757, 171, 288, 2116, 2142, 396, 395, 2190, 44, 43, - /* 1210 */ 42, 1694, 1695, 1747, 285, 1749, 1752, 1753, 1754, 1755, - /* 1220 */ 1756, 1757, 1758, 1759, 759, 755, 1768, 1769, 1771, 1772, - /* 1230 */ 1773, 1774, 2, 48, 46, 1963, 153, 747, 2138, 680, - /* 1240 */ 656, 424, 655, 1690, 747, 2138, 418, 2584, 798, 758, - /* 1250 */ 1962, 2182, 716, 2605, 172, 2396, 1775, 732, 1688, 747, - /* 1260 */ 2138, 1720, 2140, 76, 321, 2590, 208, 427, 764, 2356, - /* 1270 */ 2585, 715, 708, 747, 2138, 172, 2396, 394, 393, 744, - /* 1280 */ 617, 747, 2138, 2140, 430, 1959, 1770, 623, 2362, 764, - /* 1290 */ 1958, 2518, 172, 745, 747, 2138, 2414, 160, 1748, 1696, - /* 1300 */ 2140, 327, 619, 2362, 799, 99, 618, 2182, 2362, 340, - /* 1310 */ 763, 1421, 2168, 2021, 431, 87, 61, 2414, 173, 680, - /* 1320 */ 754, 1957, 2547, 346, 677, 858, 2019, 2584, 15, 2362, - /* 1330 */ 140, 763, 1956, 1955, 2396, 635, 1637, 1852, 2362, 2010, - /* 1340 */ 344, 74, 86, 2362, 73, 2590, 208, 764, 637, 2395, - /* 1350 */ 2585, 715, 2433, 1954, 373, 176, 2397, 767, 2399, 2400, - /* 1360 */ 762, 639, 757, 2383, 1777, 1778, 240, 554, 552, 549, - /* 1370 */ 2395, 1953, 1653, 2433, 2362, 2414, 114, 2397, 767, 2399, - /* 1380 */ 2400, 762, 2008, 757, 719, 2362, 2362, 2362, 2604, 763, - /* 1390 */ 2486, 1952, 14, 13, 420, 2482, 1951, 265, 289, 1381, - /* 1400 */ 263, 1750, 1760, 2545, 642, 160, 2362, 63, 1776, 1779, - /* 1410 */ 41, 40, 687, 50, 47, 45, 44, 43, 42, 182, - /* 1420 */ 1961, 2385, 1719, 1691, 2362, 1689, 267, 269, 2395, 266, - /* 1430 */ 268, 2433, 1946, 1699, 114, 2397, 767, 2399, 2400, 762, - /* 1440 */ 1382, 757, 100, 659, 2362, 64, 2461, 271, 2486, 2362, - /* 1450 */ 270, 1698, 420, 2482, 304, 1694, 1695, 1747, 697, 1749, - /* 1460 */ 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 759, 755, - /* 1470 */ 1768, 1769, 1771, 1772, 1773, 1774, 2, 665, 296, 807, - /* 1480 */ 1656, 433, 432, 1796, 727, 808, 142, 1886, 1896, 50, - /* 1490 */ 192, 1704, 2002, 680, 84, 83, 476, 160, 730, 220, - /* 1500 */ 2415, 2584, 2396, 1400, 1775, 2075, 1697, 50, 315, 1398, - /* 1510 */ 75, 439, 468, 466, 158, 764, 438, 2074, 2261, 2590, - /* 1520 */ 208, 1992, 160, 369, 2585, 715, 455, 680, 2537, 452, - /* 1530 */ 448, 444, 441, 469, 1770, 2584, 66, 437, 50, 694, - /* 1540 */ 50, 410, 771, 2414, 851, 2262, 406, 1696, 680, 158, - /* 1550 */ 160, 701, 736, 2590, 208, 2362, 2584, 763, 2585, 715, - /* 1560 */ 141, 680, 1998, 2179, 1895, 294, 158, 673, 306, 2584, - /* 1570 */ 2538, 2548, 731, 753, 2590, 208, 709, 301, 2396, 2585, - /* 1580 */ 715, 310, 1606, 319, 204, 739, 710, 2590, 208, 323, - /* 1590 */ 309, 764, 2585, 715, 2100, 5, 2395, 1468, 445, 2433, - /* 1600 */ 1702, 440, 114, 2397, 767, 2399, 2400, 762, 386, 757, - /* 1610 */ 453, 1812, 454, 1761, 2459, 339, 2486, 1496, 1701, 2414, - /* 1620 */ 420, 2482, 1723, 465, 1500, 1507, 464, 215, 216, 467, - /* 1630 */ 218, 2362, 334, 763, 1630, 1505, 1713, 481, 1720, 1714, - /* 1640 */ 488, 163, 229, 490, 494, 501, 496, 535, 524, 513, - /* 1650 */ 2254, 526, 2396, 531, 534, 536, 547, 548, 545, 235, - /* 1660 */ 550, 1721, 237, 234, 551, 764, 553, 555, 570, 571, - /* 1670 */ 4, 1705, 2395, 1700, 578, 2433, 579, 245, 114, 2397, - /* 1680 */ 767, 2399, 2400, 762, 1716, 757, 2396, 581, 583, 92, - /* 1690 */ 750, 248, 2486, 2414, 1722, 584, 420, 2482, 1724, 764, - /* 1700 */ 585, 251, 593, 1708, 1710, 2362, 587, 763, 253, 1725, - /* 1710 */ 93, 2270, 94, 614, 258, 616, 645, 755, 1768, 1769, - /* 1720 */ 1771, 1772, 1773, 1774, 2128, 262, 2124, 2414, 116, 646, - /* 1730 */ 366, 658, 660, 97, 154, 264, 335, 165, 166, 2362, - /* 1740 */ 281, 763, 1717, 2126, 2122, 167, 2395, 168, 2316, 2433, - /* 1750 */ 668, 2333, 115, 2397, 767, 2399, 2400, 762, 2330, 757, - /* 1760 */ 2329, 667, 669, 675, 672, 2396, 2486, 286, 698, 737, - /* 1770 */ 752, 2482, 684, 8, 2525, 707, 2553, 712, 764, 711, - /* 1780 */ 765, 291, 293, 2433, 284, 2552, 115, 2397, 767, 2399, - /* 1790 */ 2400, 762, 674, 757, 2396, 295, 685, 683, 298, 181, - /* 1800 */ 2486, 723, 411, 682, 381, 2482, 2414, 764, 300, 1718, - /* 1810 */ 720, 299, 297, 146, 2505, 2607, 2502, 1860, 2362, 305, - /* 1820 */ 763, 2583, 1858, 2396, 195, 311, 155, 336, 735, 740, - /* 1830 */ 2284, 2283, 2282, 337, 416, 2414, 764, 741, 338, 156, - /* 1840 */ 409, 105, 2139, 302, 62, 2467, 107, 2362, 769, 763, - /* 1850 */ 2183, 1, 329, 210, 341, 1303, 852, 365, 164, 2395, - /* 1860 */ 53, 378, 2433, 855, 2414, 176, 2397, 767, 2399, 2400, - /* 1870 */ 762, 857, 757, 343, 379, 345, 2362, 2354, 763, 350, - /* 1880 */ 364, 354, 2353, 2352, 81, 2347, 442, 443, 2395, 1681, - /* 1890 */ 1682, 2433, 2396, 213, 363, 2397, 767, 2399, 2400, 762, - /* 1900 */ 447, 757, 2345, 449, 450, 764, 451, 1680, 2344, 2342, - /* 1910 */ 387, 456, 681, 2544, 2341, 458, 2340, 2395, 2396, 460, - /* 1920 */ 2433, 2339, 2320, 356, 2397, 767, 2399, 2400, 762, 462, - /* 1930 */ 757, 764, 1669, 2414, 217, 2319, 219, 1633, 82, 2297, - /* 1940 */ 1632, 2296, 2295, 474, 475, 2362, 2294, 763, 2293, 2244, - /* 1950 */ 479, 2241, 1576, 2240, 482, 2234, 485, 486, 2231, 2414, - /* 1960 */ 222, 2230, 2229, 85, 415, 2228, 2233, 2232, 2227, 224, - /* 1970 */ 2226, 2362, 2224, 763, 706, 2223, 2222, 226, 2221, 504, - /* 1980 */ 502, 2219, 2218, 2217, 2216, 2239, 2395, 2215, 2214, 2433, - /* 1990 */ 2213, 2237, 179, 2397, 767, 2399, 2400, 762, 2220, 757, - /* 2000 */ 2212, 2211, 2210, 2208, 2207, 2206, 2205, 2204, 2203, 2202, - /* 2010 */ 2201, 2200, 2395, 228, 91, 2433, 2199, 2238, 363, 2397, - /* 2020 */ 767, 2399, 2400, 762, 2236, 757, 2198, 2197, 2396, 233, - /* 2030 */ 2195, 538, 2194, 540, 1582, 2196, 2193, 2192, 2040, 375, - /* 2040 */ 1439, 761, 1443, 376, 2396, 236, 2039, 2038, 2036, 2033, - /* 2050 */ 1435, 238, 2606, 2032, 2025, 2012, 556, 764, 1987, 2396, - /* 2060 */ 239, 1986, 560, 558, 562, 557, 561, 2318, 564, 2414, - /* 2070 */ 566, 568, 764, 1327, 565, 190, 2314, 2304, 241, 2292, - /* 2080 */ 2291, 2362, 78, 763, 243, 2414, 252, 2268, 2382, 2117, - /* 2090 */ 423, 2035, 200, 576, 79, 2031, 2029, 2362, 250, 763, - /* 2100 */ 2414, 594, 2396, 598, 596, 425, 255, 2027, 602, 2024, - /* 2110 */ 600, 595, 2362, 2007, 763, 764, 599, 604, 606, 2005, - /* 2120 */ 603, 607, 2395, 1374, 662, 2433, 608, 2006, 362, 2397, - /* 2130 */ 767, 2399, 2400, 762, 2004, 757, 1983, 2452, 2395, 2119, - /* 2140 */ 1511, 2433, 861, 2414, 363, 2397, 767, 2399, 2400, 762, - /* 2150 */ 2118, 757, 1512, 2395, 1425, 2362, 2433, 763, 333, 363, - /* 2160 */ 2397, 767, 2399, 2400, 762, 65, 757, 1424, 1422, 2396, - /* 2170 */ 1420, 1411, 1419, 2022, 198, 1418, 261, 1417, 1416, 824, - /* 2180 */ 826, 1413, 764, 849, 845, 841, 837, 399, 330, 1412, - /* 2190 */ 1410, 2020, 400, 2011, 401, 640, 657, 2009, 2396, 2433, - /* 2200 */ 402, 643, 358, 2397, 767, 2399, 2400, 762, 1982, 757, - /* 2210 */ 2414, 764, 1981, 1980, 647, 1979, 649, 1978, 651, 118, - /* 2220 */ 1667, 1663, 2362, 1665, 763, 1662, 2317, 2396, 29, 113, - /* 2230 */ 283, 69, 324, 2313, 2303, 1639, 1641, 2290, 670, 2414, - /* 2240 */ 764, 2289, 2589, 20, 31, 17, 686, 1853, 407, 205, - /* 2250 */ 290, 2362, 688, 763, 57, 58, 1913, 6, 692, 1887, - /* 2260 */ 671, 690, 292, 2395, 743, 1618, 2433, 1617, 2414, 348, - /* 2270 */ 2397, 767, 2399, 2400, 762, 287, 757, 676, 7, 21, - /* 2280 */ 2362, 678, 763, 1643, 22, 194, 33, 170, 1894, 180, - /* 2290 */ 206, 2383, 2395, 1881, 193, 2433, 2396, 32, 347, 2397, - /* 2300 */ 767, 2399, 2400, 762, 1855, 757, 67, 313, 80, 764, - /* 2310 */ 1851, 207, 24, 1933, 312, 1928, 2288, 1927, 412, 1932, - /* 2320 */ 1931, 2395, 2396, 413, 2433, 307, 1934, 349, 2397, 767, - /* 2330 */ 2399, 2400, 762, 282, 757, 764, 185, 2414, 1835, 1834, - /* 2340 */ 60, 2267, 101, 102, 314, 25, 2266, 738, 103, 2362, - /* 2350 */ 196, 763, 1889, 325, 320, 70, 104, 26, 322, 1787, - /* 2360 */ 1786, 108, 11, 2414, 59, 13, 1706, 2436, 186, 1765, - /* 2370 */ 756, 39, 23, 1763, 1762, 2362, 197, 763, 16, 18, - /* 2380 */ 27, 1740, 1732, 1497, 28, 768, 770, 426, 774, 328, - /* 2390 */ 2395, 2396, 1797, 2433, 766, 772, 355, 2397, 767, 2399, - /* 2400 */ 2400, 762, 1494, 757, 764, 775, 777, 2396, 1493, 778, - /* 2410 */ 780, 783, 786, 1490, 1506, 781, 2395, 1484, 784, 2433, - /* 2420 */ 764, 1482, 359, 2397, 767, 2399, 2400, 762, 787, 757, - /* 2430 */ 109, 1502, 2414, 110, 1372, 77, 801, 1407, 1488, 1404, - /* 2440 */ 1487, 1403, 1486, 1485, 2362, 1402, 763, 1401, 2414, 1399, - /* 2450 */ 1397, 1396, 1395, 211, 1433, 812, 1432, 1390, 814, 1393, - /* 2460 */ 2362, 1392, 763, 1391, 1389, 2396, 1388, 1387, 1429, 1427, - /* 2470 */ 1384, 1383, 1378, 1380, 1379, 1377, 2030, 834, 764, 835, - /* 2480 */ 2028, 836, 839, 838, 840, 2395, 2026, 2396, 2433, 842, - /* 2490 */ 2023, 351, 2397, 767, 2399, 2400, 762, 844, 757, 843, - /* 2500 */ 764, 2395, 846, 848, 2433, 847, 2414, 360, 2397, 767, - /* 2510 */ 2399, 2400, 762, 2003, 757, 850, 1977, 1304, 2362, 1316, - /* 2520 */ 763, 854, 2396, 332, 856, 1947, 1692, 342, 2414, 859, - /* 2530 */ 860, 1947, 1947, 1947, 1947, 764, 1947, 1947, 1947, 1947, - /* 2540 */ 2362, 1947, 763, 1947, 1947, 2396, 1947, 1947, 1947, 1947, - /* 2550 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 764, 2395, - /* 2560 */ 1947, 1947, 2433, 2414, 1947, 352, 2397, 767, 2399, 2400, - /* 2570 */ 762, 1947, 757, 1947, 1947, 2362, 1947, 763, 1947, 1947, - /* 2580 */ 1947, 2395, 1947, 1947, 2433, 1947, 2414, 361, 2397, 767, - /* 2590 */ 2399, 2400, 762, 1947, 757, 1947, 1947, 1947, 2362, 1947, - /* 2600 */ 763, 1947, 2396, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2610 */ 1947, 1947, 1947, 1947, 1947, 764, 2395, 1947, 1947, 2433, - /* 2620 */ 1947, 1947, 353, 2397, 767, 2399, 2400, 762, 1947, 757, - /* 2630 */ 1947, 2396, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 2395, - /* 2640 */ 1947, 1947, 2433, 2414, 764, 367, 2397, 767, 2399, 2400, - /* 2650 */ 762, 1947, 757, 1947, 1947, 2362, 1947, 763, 1947, 1947, - /* 2660 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2670 */ 1947, 1947, 2414, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2680 */ 1947, 1947, 1947, 1947, 2362, 1947, 763, 1947, 1947, 1947, - /* 2690 */ 1947, 1947, 1947, 1947, 1947, 1947, 2395, 1947, 2396, 2433, - /* 2700 */ 1947, 1947, 368, 2397, 767, 2399, 2400, 762, 1947, 757, - /* 2710 */ 1947, 764, 1947, 1947, 2396, 1947, 1947, 1947, 1947, 1947, - /* 2720 */ 1947, 1947, 1947, 1947, 1947, 2395, 1947, 764, 2433, 1947, - /* 2730 */ 1947, 2408, 2397, 767, 2399, 2400, 762, 1947, 757, 2414, - /* 2740 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2750 */ 1947, 2362, 1947, 763, 1947, 2414, 1947, 1947, 1947, 1947, - /* 2760 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 2362, 1947, 763, - /* 2770 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2780 */ 1947, 1947, 1947, 2396, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2790 */ 1947, 1947, 2395, 1947, 1947, 2433, 764, 1947, 2407, 2397, - /* 2800 */ 767, 2399, 2400, 762, 1947, 757, 1947, 2396, 2395, 1947, - /* 2810 */ 1947, 2433, 1947, 1947, 2406, 2397, 767, 2399, 2400, 762, - /* 2820 */ 764, 757, 1947, 1947, 2414, 1947, 1947, 1947, 1947, 1947, - /* 2830 */ 1947, 1947, 1947, 1947, 1947, 1947, 2362, 1947, 763, 1947, - /* 2840 */ 1947, 2396, 1947, 1947, 1947, 1947, 1947, 1947, 2414, 1947, - /* 2850 */ 1947, 1947, 1947, 1947, 764, 1947, 1947, 1947, 1947, 1947, - /* 2860 */ 2362, 1947, 763, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2870 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 2395, 1947, 1947, - /* 2880 */ 2433, 1947, 2414, 383, 2397, 767, 2399, 2400, 762, 1947, - /* 2890 */ 757, 1947, 1947, 1947, 2362, 1947, 763, 1947, 1947, 1947, - /* 2900 */ 1947, 2395, 1947, 1947, 2433, 1947, 1947, 384, 2397, 767, - /* 2910 */ 2399, 2400, 762, 1947, 757, 1947, 1947, 1947, 1947, 1947, - /* 2920 */ 1947, 2396, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2930 */ 1947, 1947, 1947, 1947, 764, 2395, 1947, 1947, 2433, 1947, - /* 2940 */ 2396, 380, 2397, 767, 2399, 2400, 762, 1947, 757, 1947, - /* 2950 */ 1947, 1947, 1947, 764, 1947, 2396, 1947, 1947, 1947, 1947, - /* 2960 */ 1947, 1947, 2414, 1947, 1947, 1947, 1947, 1947, 764, 1947, - /* 2970 */ 1947, 1947, 1947, 1947, 2362, 1947, 763, 1947, 1947, 1947, - /* 2980 */ 1947, 2414, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 2990 */ 1947, 1947, 1947, 2362, 1947, 763, 2414, 1947, 1947, 1947, - /* 3000 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 2362, 1947, - /* 3010 */ 763, 1947, 1947, 1947, 1947, 2395, 1947, 1947, 2433, 1947, - /* 3020 */ 1947, 385, 2397, 767, 2399, 2400, 762, 1947, 757, 1947, - /* 3030 */ 1947, 1947, 1947, 1947, 765, 1947, 1947, 2433, 1947, 1947, - /* 3040 */ 358, 2397, 767, 2399, 2400, 762, 1947, 757, 1947, 2395, - /* 3050 */ 1947, 1947, 2433, 1947, 1947, 357, 2397, 767, 2399, 2400, - /* 3060 */ 762, 1947, 757, + /* 0 */ 578, 107, 433, 579, 2037, 586, 2173, 720, 579, 2037, + /* 10 */ 170, 175, 47, 45, 1912, 2651, 595, 410, 2186, 2123, + /* 20 */ 424, 2017, 1735, 40, 39, 2235, 2177, 46, 44, 43, + /* 30 */ 42, 41, 2322, 719, 209, 1821, 2080, 1733, 2652, 721, + /* 40 */ 40, 39, 658, 2462, 46, 44, 43, 42, 41, 486, + /* 50 */ 2320, 757, 583, 732, 148, 9, 735, 656, 580, 654, + /* 60 */ 275, 274, 40, 39, 769, 1816, 46, 44, 43, 42, + /* 70 */ 41, 19, 596, 2315, 2428, 40, 39, 1764, 1741, 46, + /* 80 */ 44, 43, 42, 41, 2480, 40, 39, 29, 1760, 46, + /* 90 */ 44, 43, 42, 41, 545, 543, 2428, 375, 752, 769, + /* 100 */ 1760, 222, 37, 315, 865, 2421, 669, 15, 431, 840, + /* 110 */ 839, 838, 837, 442, 709, 836, 835, 153, 830, 829, + /* 120 */ 828, 827, 826, 825, 824, 152, 818, 817, 816, 441, + /* 130 */ 440, 813, 812, 811, 189, 188, 810, 183, 2461, 304, + /* 140 */ 1956, 2499, 2480, 1823, 1824, 115, 2463, 756, 2465, 2466, + /* 150 */ 751, 50, 774, 1761, 2438, 1344, 176, 192, 2006, 2553, + /* 160 */ 430, 1764, 1957, 420, 2549, 185, 2561, 731, 66, 140, + /* 170 */ 730, 774, 1887, 2656, 1351, 1928, 2656, 2651, 2442, 100, + /* 180 */ 1795, 1805, 435, 210, 2651, 2230, 2232, 1822, 1825, 113, + /* 190 */ 1763, 2600, 62, 770, 2184, 719, 209, 1346, 1349, 1350, + /* 200 */ 2652, 721, 1736, 2655, 1734, 708, 151, 2652, 2654, 1987, + /* 210 */ 1662, 40, 39, 139, 2176, 46, 44, 43, 42, 41, + /* 220 */ 621, 77, 129, 2444, 2447, 128, 127, 126, 125, 124, + /* 230 */ 123, 122, 121, 120, 774, 769, 1739, 1740, 1792, 200, + /* 240 */ 1794, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 748, + /* 250 */ 772, 771, 1815, 1817, 1818, 1819, 1820, 2, 47, 45, + /* 260 */ 1614, 1615, 1370, 373, 1369, 1758, 424, 710, 1735, 439, + /* 270 */ 438, 62, 529, 88, 385, 548, 1634, 1635, 1980, 144, + /* 280 */ 547, 1821, 705, 1733, 2083, 2573, 1884, 1885, 1886, 2573, + /* 290 */ 2573, 2573, 2573, 2573, 1742, 1765, 509, 1371, 549, 770, + /* 300 */ 2184, 40, 39, 374, 511, 46, 44, 43, 42, 41, + /* 310 */ 2016, 1816, 594, 1764, 489, 1451, 1508, 19, 1850, 139, + /* 320 */ 1633, 1636, 50, 204, 1741, 1986, 626, 311, 2175, 2389, + /* 330 */ 1499, 799, 798, 797, 1503, 796, 1505, 1506, 795, 792, + /* 340 */ 2656, 1514, 789, 1516, 1517, 786, 783, 780, 2651, 2438, + /* 350 */ 865, 396, 309, 15, 770, 2184, 1453, 640, 639, 638, + /* 360 */ 770, 2184, 497, 2428, 630, 145, 634, 2655, 311, 2422, + /* 370 */ 633, 2652, 2653, 2442, 213, 632, 637, 403, 402, 1765, + /* 380 */ 55, 631, 1851, 430, 627, 711, 706, 699, 695, 1823, + /* 390 */ 1824, 598, 2309, 2288, 774, 536, 535, 534, 533, 528, + /* 400 */ 527, 526, 525, 379, 1370, 1715, 1369, 515, 514, 513, + /* 410 */ 512, 506, 505, 504, 809, 499, 498, 394, 2444, 2446, + /* 420 */ 421, 490, 1602, 1603, 430, 1937, 1795, 1805, 1621, 774, + /* 430 */ 2655, 770, 2184, 1822, 1825, 774, 640, 639, 638, 1371, + /* 440 */ 1938, 202, 1760, 630, 145, 634, 1760, 311, 1736, 633, + /* 450 */ 1734, 483, 1353, 2224, 632, 637, 403, 402, 1759, 1945, + /* 460 */ 631, 1745, 667, 627, 36, 422, 1845, 1846, 1847, 1848, + /* 470 */ 1849, 1853, 1854, 1855, 1856, 205, 1889, 1890, 1891, 1892, + /* 480 */ 1893, 1936, 1739, 1740, 1792, 1792, 1794, 1797, 1798, 1799, + /* 490 */ 1800, 1801, 1802, 1803, 1804, 748, 772, 771, 1815, 1817, + /* 500 */ 1818, 1819, 1820, 2, 12, 47, 45, 46, 44, 43, + /* 510 */ 42, 41, 174, 424, 2462, 1735, 12, 349, 702, 701, + /* 520 */ 1943, 1944, 1946, 1947, 1948, 3, 1887, 753, 1821, 62, + /* 530 */ 1733, 1765, 190, 33, 347, 75, 1916, 53, 74, 40, + /* 540 */ 39, 2160, 1760, 46, 44, 43, 42, 41, 376, 1995, + /* 550 */ 1764, 685, 2462, 1992, 395, 2480, 2302, 215, 1816, 1994, + /* 560 */ 241, 560, 558, 555, 19, 750, 12, 2428, 10, 752, + /* 570 */ 129, 1741, 1718, 128, 127, 126, 125, 124, 123, 122, + /* 580 */ 121, 120, 2162, 138, 137, 136, 135, 134, 133, 132, + /* 590 */ 131, 130, 243, 2480, 479, 2322, 581, 865, 2045, 478, + /* 600 */ 15, 62, 1721, 1724, 1763, 2428, 1796, 752, 228, 2461, + /* 610 */ 427, 809, 2499, 2319, 757, 154, 115, 2463, 756, 2465, + /* 620 */ 2466, 751, 2568, 774, 770, 2184, 150, 51, 157, 2524, + /* 630 */ 2553, 770, 2184, 445, 420, 2549, 1823, 1824, 444, 63, + /* 640 */ 1884, 1885, 1886, 2015, 484, 686, 190, 2461, 2565, 91, + /* 650 */ 2499, 503, 90, 2651, 365, 2463, 756, 2465, 2466, 751, + /* 660 */ 749, 774, 740, 2518, 1793, 1887, 575, 647, 62, 2271, + /* 670 */ 2303, 2657, 209, 1795, 1805, 573, 2652, 721, 569, 565, + /* 680 */ 1822, 1825, 659, 60, 686, 732, 148, 1761, 85, 84, + /* 690 */ 482, 683, 2651, 221, 1741, 1736, 2428, 1734, 276, 2161, + /* 700 */ 800, 539, 1796, 2231, 2232, 311, 474, 472, 495, 2298, + /* 710 */ 2657, 209, 732, 148, 650, 2652, 721, 372, 89, 2169, + /* 720 */ 461, 644, 642, 458, 454, 450, 447, 475, 273, 1739, + /* 730 */ 1740, 1792, 723, 1794, 1797, 1798, 1799, 1800, 1801, 1802, + /* 740 */ 1803, 1804, 748, 772, 771, 1815, 1817, 1818, 1819, 1820, + /* 750 */ 2, 47, 45, 1826, 2462, 770, 2184, 224, 2237, 424, + /* 760 */ 1793, 1735, 477, 233, 476, 409, 309, 735, 1765, 71, + /* 770 */ 770, 2184, 70, 2235, 1821, 516, 1733, 311, 2573, 1884, + /* 780 */ 1885, 1886, 2573, 2573, 2573, 2573, 2573, 538, 232, 1852, + /* 790 */ 517, 741, 2462, 2525, 475, 2480, 734, 178, 2561, 2562, + /* 800 */ 2370, 146, 2566, 311, 1816, 753, 334, 2428, 35, 752, + /* 810 */ 1543, 1544, 770, 2184, 40, 39, 2237, 1741, 46, 44, + /* 820 */ 43, 42, 41, 393, 118, 2561, 2562, 2568, 146, 2566, + /* 830 */ 522, 2235, 518, 2480, 521, 807, 163, 162, 804, 803, + /* 840 */ 802, 160, 520, 865, 311, 2428, 48, 752, 2048, 2461, + /* 850 */ 2255, 2462, 2499, 2564, 1735, 280, 115, 2463, 756, 2465, + /* 860 */ 2466, 751, 2171, 774, 753, 2568, 2047, 96, 192, 1733, + /* 870 */ 2553, 34, 40, 39, 420, 2549, 46, 44, 43, 42, + /* 880 */ 41, 1857, 1823, 1824, 501, 2298, 2401, 2461, 2159, 463, + /* 890 */ 2499, 2563, 2480, 2180, 116, 2463, 756, 2465, 2466, 751, + /* 900 */ 858, 774, 2601, 720, 2428, 820, 752, 743, 2553, 2525, + /* 910 */ 1741, 2651, 2552, 2549, 43, 42, 41, 245, 628, 1795, + /* 920 */ 1805, 581, 96, 2045, 531, 2298, 1822, 1825, 1714, 719, + /* 930 */ 209, 770, 2184, 226, 2652, 721, 865, 686, 2167, 397, + /* 940 */ 278, 1736, 1448, 1734, 277, 2651, 2461, 149, 2179, 2499, + /* 950 */ 2524, 597, 2188, 115, 2463, 756, 2465, 2466, 751, 2237, + /* 960 */ 774, 732, 148, 2657, 209, 2671, 670, 2553, 2652, 721, + /* 970 */ 822, 420, 2549, 231, 739, 1739, 1740, 1792, 286, 1794, + /* 980 */ 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 748, 772, + /* 990 */ 771, 1815, 1817, 1818, 1819, 1820, 2, 47, 45, 2462, + /* 1000 */ 2237, 1373, 1374, 770, 2184, 424, 2014, 1735, 2013, 524, + /* 1010 */ 523, 1909, 753, 99, 2608, 765, 382, 467, 1463, 408, + /* 1020 */ 1821, 660, 1733, 2181, 807, 163, 162, 804, 803, 802, + /* 1030 */ 160, 1831, 823, 1462, 1736, 2145, 1734, 1760, 2462, 2402, + /* 1040 */ 2480, 588, 2361, 2237, 469, 465, 172, 1351, 670, 747, + /* 1050 */ 1816, 753, 2428, 2621, 752, 2237, 770, 2184, 2236, 2428, + /* 1060 */ 279, 2428, 419, 1741, 14, 13, 617, 616, 1739, 1740, + /* 1070 */ 2235, 1349, 1350, 179, 2561, 2562, 281, 146, 2566, 2480, + /* 1080 */ 807, 163, 162, 804, 803, 802, 160, 770, 2184, 865, + /* 1090 */ 686, 2428, 48, 752, 2461, 1717, 2462, 2499, 2651, 1467, + /* 1100 */ 550, 115, 2463, 756, 2465, 2466, 751, 289, 774, 753, + /* 1110 */ 173, 697, 1760, 2671, 1466, 2553, 2657, 209, 2187, 420, + /* 1120 */ 2549, 2652, 721, 672, 2361, 1720, 1723, 801, 1823, 1824, + /* 1130 */ 2228, 665, 161, 2461, 724, 2012, 2499, 2480, 1683, 1684, + /* 1140 */ 115, 2463, 756, 2465, 2466, 751, 625, 774, 203, 2428, + /* 1150 */ 624, 752, 2671, 2011, 2553, 770, 2184, 2067, 420, 2549, + /* 1160 */ 770, 2184, 428, 770, 2184, 1795, 1805, 2010, 636, 635, + /* 1170 */ 173, 1864, 1822, 1825, 141, 738, 770, 2184, 2186, 641, + /* 1180 */ 323, 552, 686, 767, 401, 400, 87, 1736, 2428, 1734, + /* 1190 */ 2651, 2461, 619, 618, 2499, 671, 768, 1796, 115, 2463, + /* 1200 */ 756, 2465, 2466, 751, 2237, 774, 2428, 54, 2657, 209, + /* 1210 */ 2671, 429, 2553, 2652, 721, 805, 420, 2549, 2228, 2235, + /* 1220 */ 2428, 1739, 1740, 1792, 714, 1794, 1797, 1798, 1799, 1800, + /* 1230 */ 1801, 1802, 1803, 1804, 748, 772, 771, 1815, 1817, 1818, + /* 1240 */ 1819, 1820, 2, 47, 45, 2009, 686, 2462, 2008, 770, + /* 1250 */ 2184, 424, 727, 1735, 2651, 1793, 399, 398, 806, 623, + /* 1260 */ 753, 2228, 2644, 2005, 2237, 746, 1821, 433, 1733, 330, + /* 1270 */ 2392, 434, 2657, 209, 436, 173, 2004, 2652, 721, 2235, + /* 1280 */ 2003, 625, 173, 2186, 2462, 624, 834, 832, 2480, 1898, + /* 1290 */ 2186, 2002, 1908, 2001, 770, 2184, 1816, 753, 2428, 2585, + /* 1300 */ 2428, 2428, 752, 319, 320, 2000, 2281, 343, 318, 1741, + /* 1310 */ 2214, 1999, 266, 1998, 437, 264, 2428, 268, 2462, 736, + /* 1320 */ 267, 452, 662, 1997, 661, 2480, 2124, 2022, 860, 2428, + /* 1330 */ 1793, 753, 161, 2428, 161, 865, 290, 2428, 15, 752, + /* 1340 */ 270, 629, 2461, 269, 2428, 2499, 2428, 2065, 493, 115, + /* 1350 */ 2463, 756, 2465, 2466, 751, 2056, 774, 272, 2428, 2480, + /* 1360 */ 271, 2671, 2054, 2553, 2428, 1446, 2428, 420, 2549, 643, + /* 1370 */ 686, 2428, 693, 752, 1823, 1824, 2428, 645, 2651, 2461, + /* 1380 */ 101, 49, 2499, 49, 648, 193, 115, 2463, 756, 2465, + /* 1390 */ 2466, 751, 2449, 774, 1989, 1990, 2657, 209, 2671, 2007, + /* 1400 */ 2553, 2652, 721, 1406, 420, 2549, 1744, 1678, 725, 1681, + /* 1410 */ 1743, 1795, 1805, 2461, 14, 13, 2499, 161, 1822, 1825, + /* 1420 */ 115, 2463, 756, 2465, 2466, 751, 49, 774, 64, 49, + /* 1430 */ 1842, 112, 2528, 1736, 2553, 1734, 317, 183, 420, 2549, + /* 1440 */ 109, 76, 2614, 159, 1407, 329, 328, 1932, 161, 73, + /* 1450 */ 2451, 778, 305, 703, 159, 297, 1942, 161, 1941, 733, + /* 1460 */ 295, 142, 159, 143, 2481, 2121, 2120, 1739, 1740, 1792, + /* 1470 */ 814, 1794, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, + /* 1480 */ 748, 772, 771, 1815, 1817, 1818, 1819, 1820, 2, 439, + /* 1490 */ 438, 815, 737, 2462, 1425, 2307, 2038, 378, 377, 1749, + /* 1500 */ 2604, 1631, 700, 1858, 1806, 415, 753, 1725, 707, 411, + /* 1510 */ 759, 321, 1821, 443, 1742, 1423, 762, 2462, 325, 2308, + /* 1520 */ 1821, 2044, 1713, 1493, 342, 2225, 1521, 679, 728, 1525, + /* 1530 */ 753, 715, 1532, 2605, 2480, 2615, 1530, 164, 716, 307, + /* 1540 */ 302, 2146, 1816, 310, 5, 451, 2428, 391, 752, 446, + /* 1550 */ 1816, 459, 1768, 460, 470, 1741, 216, 217, 2480, 471, + /* 1560 */ 219, 473, 337, 2462, 1655, 1758, 487, 1759, 494, 230, + /* 1570 */ 2428, 541, 752, 1747, 496, 500, 753, 1746, 502, 507, + /* 1580 */ 519, 745, 530, 537, 2300, 532, 540, 542, 2461, 553, + /* 1590 */ 554, 2499, 551, 236, 235, 115, 2463, 756, 2465, 2466, + /* 1600 */ 751, 556, 774, 557, 2480, 238, 1766, 2526, 559, 2553, + /* 1610 */ 561, 576, 2461, 420, 2549, 2499, 2428, 4, 752, 115, + /* 1620 */ 2463, 756, 2465, 2466, 751, 577, 774, 585, 584, 587, + /* 1630 */ 246, 742, 1761, 2553, 93, 249, 1767, 420, 2549, 589, + /* 1640 */ 590, 1769, 252, 591, 593, 254, 1770, 2316, 94, 2462, + /* 1650 */ 95, 599, 259, 620, 2379, 651, 652, 2376, 2461, 369, + /* 1660 */ 622, 2499, 753, 117, 664, 180, 2463, 756, 2465, 2466, + /* 1670 */ 751, 98, 774, 2174, 263, 666, 155, 2170, 265, 1750, + /* 1680 */ 338, 1745, 166, 167, 2172, 2168, 168, 1726, 169, 1716, + /* 1690 */ 2480, 2375, 282, 1762, 674, 2362, 675, 673, 287, 681, + /* 1700 */ 704, 678, 2428, 680, 752, 285, 8, 760, 690, 713, + /* 1710 */ 689, 2620, 688, 1753, 1755, 691, 717, 2619, 182, 1719, + /* 1720 */ 1722, 1727, 298, 2592, 722, 2672, 718, 772, 771, 1815, + /* 1730 */ 1817, 1818, 1819, 1820, 296, 772, 771, 1815, 1817, 1818, + /* 1740 */ 1819, 1820, 292, 294, 2461, 299, 300, 2499, 416, 729, + /* 1750 */ 303, 116, 2463, 756, 2465, 2466, 751, 2650, 774, 301, + /* 1760 */ 726, 2674, 2572, 2462, 147, 2553, 1763, 2569, 1906, 744, + /* 1770 */ 2549, 1904, 196, 312, 156, 61, 753, 2534, 758, 339, + /* 1780 */ 2330, 340, 2329, 2462, 2328, 426, 763, 764, 158, 1, + /* 1790 */ 341, 2420, 106, 211, 2185, 2419, 753, 306, 2462, 108, + /* 1800 */ 2229, 1328, 344, 332, 2480, 862, 776, 859, 165, 864, + /* 1810 */ 348, 753, 368, 389, 346, 52, 2428, 390, 752, 2400, + /* 1820 */ 2399, 356, 367, 2398, 2480, 82, 357, 2393, 448, 449, + /* 1830 */ 1706, 1707, 214, 453, 2391, 455, 2428, 456, 752, 2480, + /* 1840 */ 457, 1705, 2390, 2388, 392, 462, 2387, 464, 2386, 2385, + /* 1850 */ 466, 2428, 468, 752, 2366, 1694, 218, 2365, 754, 220, + /* 1860 */ 1658, 2499, 1657, 83, 2343, 116, 2463, 756, 2465, 2466, + /* 1870 */ 751, 2342, 774, 2341, 480, 481, 2340, 2339, 2461, 2553, + /* 1880 */ 2290, 2499, 2462, 384, 2549, 177, 2463, 756, 2465, 2466, + /* 1890 */ 751, 2287, 774, 2461, 485, 753, 2499, 488, 2286, 2462, + /* 1900 */ 116, 2463, 756, 2465, 2466, 751, 2280, 774, 1601, 491, + /* 1910 */ 2277, 2276, 753, 492, 2553, 2462, 223, 2275, 2274, 2550, + /* 1920 */ 86, 2279, 2278, 2480, 2273, 2272, 2270, 225, 753, 2269, + /* 1930 */ 2268, 508, 687, 2611, 2267, 2428, 227, 752, 510, 2265, + /* 1940 */ 2480, 2264, 2263, 2262, 2285, 2261, 2260, 2259, 2283, 2266, + /* 1950 */ 2258, 2257, 2428, 2256, 752, 2254, 2480, 2253, 2252, 2251, + /* 1960 */ 2250, 2249, 229, 2248, 92, 2247, 2246, 2245, 2428, 234, + /* 1970 */ 752, 2284, 2282, 2244, 413, 2243, 1607, 2461, 2242, 2241, + /* 1980 */ 2499, 2240, 544, 546, 177, 2463, 756, 2465, 2466, 751, + /* 1990 */ 414, 774, 2239, 2238, 2461, 2086, 2462, 2499, 1464, 1468, + /* 2000 */ 237, 366, 2463, 756, 2465, 2466, 751, 1460, 774, 753, + /* 2010 */ 2461, 2085, 380, 2499, 2462, 2084, 2082, 366, 2463, 756, + /* 2020 */ 2465, 2466, 751, 2079, 774, 562, 564, 753, 566, 239, + /* 2030 */ 2462, 563, 2612, 381, 2078, 2071, 567, 2480, 568, 240, + /* 2040 */ 570, 571, 572, 750, 2058, 574, 2033, 242, 79, 2428, + /* 2050 */ 191, 752, 1352, 2032, 2448, 2480, 201, 244, 582, 2364, + /* 2060 */ 80, 2360, 2350, 2338, 251, 2337, 2314, 2428, 256, 752, + /* 2070 */ 2163, 2480, 253, 1399, 2081, 2077, 600, 601, 602, 2075, + /* 2080 */ 604, 605, 606, 2428, 2073, 752, 608, 610, 609, 2070, + /* 2090 */ 614, 2461, 612, 613, 2499, 2053, 2051, 2462, 359, 2463, + /* 2100 */ 756, 2465, 2466, 751, 2052, 774, 2050, 2029, 2165, 2461, + /* 2110 */ 753, 2164, 2499, 72, 1537, 1536, 180, 2463, 756, 2465, + /* 2120 */ 2466, 751, 1450, 774, 1449, 2461, 262, 1447, 2499, 1445, + /* 2130 */ 2462, 1444, 365, 2463, 756, 2465, 2466, 751, 2480, 774, + /* 2140 */ 1443, 2519, 1442, 753, 1436, 831, 1441, 833, 2068, 712, + /* 2150 */ 2428, 2066, 752, 1438, 1437, 1435, 404, 405, 2057, 406, + /* 2160 */ 2055, 407, 649, 646, 2028, 2027, 2026, 653, 2025, 655, + /* 2170 */ 2024, 2480, 423, 119, 657, 1688, 2673, 1690, 1687, 1692, + /* 2180 */ 28, 2363, 284, 2428, 2359, 752, 1664, 67, 2349, 1666, + /* 2190 */ 2336, 1668, 2461, 676, 56, 2499, 2656, 668, 2335, 366, + /* 2200 */ 2463, 756, 2465, 2466, 751, 425, 774, 57, 20, 677, + /* 2210 */ 1959, 17, 6, 1643, 288, 868, 692, 412, 698, 7, + /* 2220 */ 30, 682, 684, 1642, 696, 2461, 171, 291, 2499, 1933, + /* 2230 */ 694, 336, 366, 2463, 756, 2465, 2466, 751, 21, 774, + /* 2240 */ 22, 195, 32, 206, 293, 207, 2449, 199, 1901, 65, + /* 2250 */ 1940, 261, 181, 2462, 194, 1899, 856, 852, 848, 844, + /* 2260 */ 24, 333, 31, 1974, 1927, 1897, 753, 184, 81, 1973, + /* 2270 */ 208, 417, 1978, 1977, 23, 18, 615, 611, 607, 603, + /* 2280 */ 1979, 260, 1980, 59, 418, 2334, 1881, 308, 186, 2313, + /* 2290 */ 1880, 103, 58, 102, 2480, 25, 1833, 1832, 13, 1751, + /* 2300 */ 1843, 187, 114, 1808, 197, 326, 2428, 38, 752, 1807, + /* 2310 */ 11, 16, 1785, 26, 761, 755, 2312, 104, 1777, 109, + /* 2320 */ 27, 198, 97, 316, 322, 258, 1935, 69, 324, 105, + /* 2330 */ 327, 2504, 2503, 2462, 777, 432, 1810, 766, 773, 781, + /* 2340 */ 68, 784, 787, 790, 793, 1522, 753, 775, 663, 779, + /* 2350 */ 782, 2499, 1519, 1518, 331, 361, 2463, 756, 2465, 2466, + /* 2360 */ 751, 785, 774, 1531, 1515, 788, 1527, 1509, 2462, 1507, + /* 2370 */ 791, 794, 1397, 110, 2480, 111, 1513, 78, 1432, 1512, + /* 2380 */ 314, 753, 808, 1429, 1428, 1511, 2428, 313, 752, 1427, + /* 2390 */ 1426, 248, 2462, 1510, 1424, 1422, 1421, 1420, 1458, 212, + /* 2400 */ 257, 250, 819, 1457, 821, 753, 283, 255, 592, 2480, + /* 2410 */ 1418, 1417, 1416, 1415, 2462, 1414, 1413, 1412, 1454, 1452, + /* 2420 */ 1409, 2428, 1408, 752, 1405, 1404, 247, 753, 2461, 2076, + /* 2430 */ 1403, 2499, 1402, 2480, 841, 351, 2463, 756, 2465, 2466, + /* 2440 */ 751, 842, 774, 843, 2074, 2428, 845, 752, 847, 846, + /* 2450 */ 2072, 849, 851, 850, 2069, 2480, 853, 855, 2049, 2023, + /* 2460 */ 857, 1341, 854, 2461, 1329, 861, 2499, 2428, 335, 752, + /* 2470 */ 350, 2463, 756, 2465, 2466, 751, 863, 774, 1737, 345, + /* 2480 */ 1993, 866, 867, 1993, 1993, 1993, 1993, 2461, 1993, 1993, + /* 2490 */ 2499, 1993, 1993, 2462, 352, 2463, 756, 2465, 2466, 751, + /* 2500 */ 1993, 774, 1993, 1993, 1993, 1993, 753, 1993, 1993, 2461, + /* 2510 */ 1993, 1993, 2499, 1993, 2462, 1993, 358, 2463, 756, 2465, + /* 2520 */ 2466, 751, 1993, 774, 1993, 1993, 1993, 753, 1993, 1993, + /* 2530 */ 1993, 1993, 1993, 1993, 2480, 1993, 1993, 2462, 1993, 1993, + /* 2540 */ 1993, 1993, 1993, 1993, 1993, 1993, 2428, 1993, 752, 1993, + /* 2550 */ 753, 1993, 1993, 1993, 1993, 2480, 1993, 1993, 1993, 1993, + /* 2560 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2428, 1993, 752, + /* 2570 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2480, 1993, + /* 2580 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2461, 1993, + /* 2590 */ 2428, 2499, 752, 1993, 1993, 362, 2463, 756, 2465, 2466, + /* 2600 */ 751, 1993, 774, 1993, 1993, 1993, 1993, 1993, 1993, 2461, + /* 2610 */ 1993, 1993, 2499, 1993, 1993, 1993, 353, 2463, 756, 2465, + /* 2620 */ 2466, 751, 1993, 774, 2462, 1993, 1993, 1993, 1993, 1993, + /* 2630 */ 1993, 1993, 2461, 1993, 1993, 2499, 1993, 753, 1993, 363, + /* 2640 */ 2463, 756, 2465, 2466, 751, 1993, 774, 1993, 1993, 1993, + /* 2650 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2462, + /* 2660 */ 1993, 1993, 1993, 1993, 1993, 2480, 1993, 1993, 1993, 1993, + /* 2670 */ 1993, 1993, 753, 1993, 1993, 1993, 1993, 2428, 1993, 752, + /* 2680 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 2690 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2462, 1993, + /* 2700 */ 2480, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 2710 */ 1993, 753, 2428, 1993, 752, 1993, 1993, 1993, 1993, 2461, + /* 2720 */ 1993, 1993, 2499, 1993, 1993, 1993, 354, 2463, 756, 2465, + /* 2730 */ 2466, 751, 1993, 774, 1993, 1993, 1993, 1993, 1993, 2480, + /* 2740 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 2750 */ 1993, 2428, 1993, 752, 2461, 1993, 2462, 2499, 1993, 1993, + /* 2760 */ 1993, 364, 2463, 756, 2465, 2466, 751, 1993, 774, 753, + /* 2770 */ 1993, 2462, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 2780 */ 1993, 1993, 1993, 1993, 753, 1993, 2462, 1993, 1993, 1993, + /* 2790 */ 1993, 1993, 1993, 2461, 1993, 1993, 2499, 2480, 1993, 753, + /* 2800 */ 355, 2463, 756, 2465, 2466, 751, 1993, 774, 1993, 2428, + /* 2810 */ 1993, 752, 2480, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 2820 */ 1993, 1993, 1993, 1993, 2428, 1993, 752, 2480, 1993, 1993, + /* 2830 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2428, + /* 2840 */ 1993, 752, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 2850 */ 1993, 2461, 1993, 1993, 2499, 2462, 1993, 1993, 370, 2463, + /* 2860 */ 756, 2465, 2466, 751, 1993, 774, 2461, 1993, 753, 2499, + /* 2870 */ 1993, 1993, 1993, 371, 2463, 756, 2465, 2466, 751, 1993, + /* 2880 */ 774, 2461, 1993, 1993, 2499, 2462, 1993, 1993, 2474, 2463, + /* 2890 */ 756, 2465, 2466, 751, 1993, 774, 2480, 1993, 753, 1993, + /* 2900 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2428, 1993, + /* 2910 */ 752, 1993, 1993, 1993, 1993, 2462, 1993, 1993, 1993, 1993, + /* 2920 */ 1993, 1993, 1993, 1993, 1993, 1993, 2480, 1993, 753, 1993, + /* 2930 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2428, 1993, + /* 2940 */ 752, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 2950 */ 2461, 1993, 1993, 2499, 1993, 1993, 2480, 2473, 2463, 756, + /* 2960 */ 2465, 2466, 751, 1993, 774, 1993, 1993, 1993, 2428, 1993, + /* 2970 */ 752, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 2980 */ 2461, 1993, 2462, 2499, 1993, 1993, 1993, 2472, 2463, 756, + /* 2990 */ 2465, 2466, 751, 1993, 774, 753, 1993, 1993, 1993, 1993, + /* 3000 */ 1993, 1993, 2462, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 3010 */ 2461, 1993, 1993, 2499, 1993, 753, 1993, 386, 2463, 756, + /* 3020 */ 2465, 2466, 751, 2480, 774, 1993, 1993, 1993, 1993, 1993, + /* 3030 */ 1993, 1993, 1993, 1993, 1993, 2428, 1993, 752, 1993, 1993, + /* 3040 */ 1993, 1993, 1993, 2480, 1993, 1993, 1993, 1993, 1993, 1993, + /* 3050 */ 1993, 1993, 1993, 1993, 1993, 2428, 1993, 752, 1993, 1993, + /* 3060 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 3070 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2461, 1993, 2462, + /* 3080 */ 2499, 1993, 1993, 1993, 387, 2463, 756, 2465, 2466, 751, + /* 3090 */ 1993, 774, 753, 1993, 1993, 1993, 1993, 2461, 1993, 1993, + /* 3100 */ 2499, 1993, 1993, 1993, 383, 2463, 756, 2465, 2466, 751, + /* 3110 */ 1993, 774, 1993, 1993, 1993, 1993, 2462, 1993, 1993, 1993, + /* 3120 */ 2480, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 753, + /* 3130 */ 1993, 1993, 2428, 1993, 752, 1993, 1993, 1993, 1993, 1993, + /* 3140 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2462, + /* 3150 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2480, 1993, 1993, + /* 3160 */ 1993, 1993, 753, 1993, 1993, 1993, 1993, 1993, 1993, 2428, + /* 3170 */ 1993, 752, 1993, 1993, 2461, 1993, 1993, 2499, 1993, 1993, + /* 3180 */ 1993, 388, 2463, 756, 2465, 2466, 751, 1993, 774, 1993, + /* 3190 */ 2480, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 3200 */ 1993, 1993, 2428, 1993, 752, 1993, 1993, 1993, 1993, 1993, + /* 3210 */ 1993, 754, 1993, 1993, 2499, 1993, 1993, 1993, 361, 2463, + /* 3220 */ 756, 2465, 2466, 751, 1993, 774, 1993, 1993, 1993, 1993, + /* 3230 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 3240 */ 1993, 1993, 1993, 1993, 2461, 1993, 1993, 2499, 1993, 1993, + /* 3250 */ 1993, 360, 2463, 756, 2465, 2466, 751, 1993, 774, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 417, 369, 374, 438, 372, 373, 369, 488, 443, 372, - /* 10 */ 373, 404, 12, 13, 14, 496, 477, 478, 435, 436, - /* 20 */ 20, 20, 22, 8, 9, 21, 0, 12, 13, 14, - /* 30 */ 15, 16, 444, 514, 515, 35, 0, 37, 519, 520, - /* 40 */ 36, 384, 38, 39, 40, 362, 14, 419, 420, 392, - /* 50 */ 422, 461, 20, 488, 426, 374, 375, 417, 375, 403, - /* 60 */ 20, 496, 8, 9, 20, 65, 12, 13, 14, 15, - /* 70 */ 16, 71, 432, 20, 488, 435, 436, 487, 78, 514, - /* 80 */ 515, 425, 496, 427, 519, 520, 403, 402, 413, 8, - /* 90 */ 9, 416, 417, 12, 13, 14, 15, 16, 415, 414, - /* 100 */ 417, 515, 374, 375, 104, 519, 520, 107, 107, 73, - /* 110 */ 74, 75, 76, 77, 107, 79, 80, 81, 82, 83, + /* 0 */ 371, 383, 397, 374, 375, 371, 406, 492, 374, 375, + /* 10 */ 405, 386, 12, 13, 14, 500, 376, 412, 413, 394, + /* 20 */ 20, 364, 22, 8, 9, 420, 408, 12, 13, 14, + /* 30 */ 15, 16, 419, 518, 519, 35, 0, 37, 523, 524, + /* 40 */ 8, 9, 21, 364, 12, 13, 14, 15, 16, 376, + /* 50 */ 437, 438, 14, 376, 377, 42, 377, 36, 20, 38, + /* 60 */ 39, 40, 8, 9, 20, 65, 12, 13, 14, 15, + /* 70 */ 16, 71, 432, 433, 417, 8, 9, 20, 78, 12, + /* 80 */ 13, 14, 15, 16, 405, 8, 9, 33, 20, 12, + /* 90 */ 13, 14, 15, 16, 421, 422, 417, 424, 419, 20, + /* 100 */ 20, 428, 481, 482, 104, 407, 20, 107, 410, 73, + /* 110 */ 74, 75, 76, 77, 377, 79, 80, 81, 82, 83, /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - /* 130 */ 94, 95, 96, 97, 98, 99, 100, 107, 20, 456, - /* 140 */ 22, 20, 459, 143, 144, 462, 463, 464, 465, 466, - /* 150 */ 467, 423, 469, 362, 370, 37, 403, 474, 374, 476, - /* 160 */ 376, 362, 108, 480, 481, 484, 485, 486, 370, 488, - /* 170 */ 489, 418, 374, 55, 376, 403, 488, 496, 374, 375, - /* 180 */ 180, 181, 410, 500, 496, 159, 160, 187, 188, 108, - /* 190 */ 418, 508, 20, 374, 375, 514, 515, 87, 394, 391, - /* 200 */ 519, 520, 202, 515, 204, 401, 415, 519, 520, 194, - /* 210 */ 179, 8, 9, 405, 415, 12, 13, 14, 15, 16, - /* 220 */ 180, 181, 21, 415, 180, 24, 25, 26, 27, 28, - /* 230 */ 29, 30, 31, 32, 234, 235, 236, 375, 238, 239, + /* 130 */ 94, 95, 96, 97, 98, 99, 100, 494, 459, 496, + /* 140 */ 108, 462, 405, 143, 144, 466, 467, 468, 469, 470, + /* 150 */ 471, 107, 473, 20, 393, 4, 363, 478, 365, 480, + /* 160 */ 462, 20, 108, 484, 485, 488, 489, 490, 4, 492, + /* 170 */ 493, 473, 159, 3, 23, 108, 492, 500, 417, 175, + /* 180 */ 180, 181, 415, 504, 500, 418, 419, 187, 188, 383, + /* 190 */ 20, 512, 107, 376, 377, 518, 519, 46, 47, 48, + /* 200 */ 523, 524, 202, 519, 204, 468, 400, 523, 524, 194, + /* 210 */ 206, 8, 9, 396, 408, 12, 13, 14, 15, 16, + /* 220 */ 403, 117, 21, 462, 463, 24, 25, 26, 27, 28, + /* 230 */ 29, 30, 31, 32, 473, 20, 236, 237, 238, 182, /* 240 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - /* 250 */ 250, 251, 252, 253, 254, 255, 12, 13, 3, 149, - /* 260 */ 488, 18, 20, 20, 20, 403, 22, 459, 496, 70, - /* 270 */ 27, 20, 362, 30, 71, 20, 14, 469, 35, 35, - /* 280 */ 236, 37, 20, 173, 174, 375, 514, 515, 281, 138, - /* 290 */ 259, 519, 520, 142, 51, 381, 53, 374, 375, 20, - /* 300 */ 269, 58, 59, 484, 485, 486, 362, 488, 489, 65, - /* 310 */ 4, 281, 69, 403, 20, 71, 104, 394, 115, 20, - /* 320 */ 406, 69, 78, 308, 401, 415, 464, 417, 70, 23, + /* 250 */ 250, 251, 252, 253, 254, 255, 256, 257, 12, 13, + /* 260 */ 180, 181, 20, 18, 22, 20, 20, 20, 22, 12, + /* 270 */ 13, 107, 27, 169, 71, 30, 143, 144, 108, 37, + /* 280 */ 35, 35, 186, 37, 0, 272, 273, 274, 275, 276, + /* 290 */ 277, 278, 279, 280, 37, 238, 51, 55, 53, 376, + /* 300 */ 377, 8, 9, 58, 59, 12, 13, 14, 15, 16, + /* 310 */ 364, 65, 20, 20, 69, 37, 104, 71, 115, 396, + /* 320 */ 187, 188, 107, 182, 78, 310, 403, 283, 407, 0, /* 330 */ 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - /* 340 */ 403, 129, 130, 131, 132, 133, 134, 135, 104, 106, - /* 350 */ 3, 107, 46, 47, 48, 0, 22, 236, 107, 415, - /* 360 */ 117, 0, 211, 108, 427, 214, 456, 381, 217, 459, - /* 370 */ 219, 37, 462, 463, 464, 465, 466, 467, 468, 469, - /* 380 */ 470, 471, 179, 14, 398, 143, 144, 143, 144, 20, - /* 390 */ 147, 148, 406, 150, 151, 152, 153, 154, 155, 156, - /* 400 */ 157, 158, 20, 374, 375, 162, 163, 164, 165, 166, - /* 410 */ 167, 168, 78, 170, 171, 172, 256, 374, 20, 176, - /* 420 */ 177, 178, 143, 144, 180, 181, 183, 416, 417, 187, - /* 430 */ 188, 187, 188, 20, 73, 74, 75, 182, 104, 117, - /* 440 */ 4, 80, 81, 82, 1, 2, 202, 86, 204, 197, - /* 450 */ 12, 13, 91, 92, 93, 94, 107, 362, 97, 374, - /* 460 */ 375, 100, 259, 260, 261, 262, 263, 264, 265, 266, - /* 470 */ 267, 268, 269, 430, 431, 37, 224, 225, 234, 235, - /* 480 */ 236, 182, 238, 239, 240, 241, 242, 243, 244, 245, - /* 490 */ 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - /* 500 */ 256, 12, 13, 56, 57, 107, 362, 461, 423, 20, - /* 510 */ 415, 22, 483, 484, 485, 486, 22, 488, 489, 375, - /* 520 */ 78, 73, 74, 75, 35, 186, 37, 234, 80, 81, - /* 530 */ 82, 37, 281, 487, 86, 236, 202, 34, 204, 91, - /* 540 */ 92, 93, 94, 107, 362, 97, 0, 403, 100, 180, - /* 550 */ 201, 108, 203, 20, 65, 374, 375, 375, 117, 415, - /* 560 */ 71, 417, 274, 275, 276, 277, 278, 78, 234, 235, - /* 570 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 379, - /* 580 */ 380, 362, 233, 228, 42, 403, 293, 294, 295, 296, - /* 590 */ 297, 298, 299, 104, 375, 182, 107, 415, 104, 417, - /* 600 */ 456, 0, 362, 459, 423, 236, 462, 463, 464, 465, - /* 610 */ 466, 467, 490, 469, 492, 375, 472, 377, 474, 475, - /* 620 */ 476, 362, 403, 374, 480, 481, 287, 288, 289, 290, - /* 630 */ 281, 33, 143, 144, 415, 361, 417, 363, 456, 374, - /* 640 */ 375, 459, 204, 403, 462, 463, 464, 465, 466, 467, - /* 650 */ 303, 469, 374, 375, 2, 415, 474, 417, 476, 394, - /* 660 */ 8, 9, 480, 481, 12, 13, 14, 15, 16, 180, - /* 670 */ 181, 256, 394, 258, 415, 456, 187, 188, 459, 281, - /* 680 */ 33, 462, 463, 464, 465, 466, 467, 20, 469, 22, - /* 690 */ 508, 202, 45, 204, 159, 476, 456, 448, 449, 459, - /* 700 */ 481, 159, 462, 463, 464, 465, 466, 467, 37, 469, - /* 710 */ 107, 403, 374, 375, 474, 182, 476, 281, 410, 116, - /* 720 */ 480, 481, 55, 234, 235, 236, 418, 238, 239, 240, - /* 730 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - /* 740 */ 251, 252, 253, 254, 255, 12, 13, 14, 51, 78, - /* 750 */ 362, 374, 375, 20, 136, 22, 137, 60, 140, 35, - /* 760 */ 63, 64, 161, 375, 383, 377, 165, 13, 35, 236, - /* 770 */ 37, 394, 8, 9, 173, 51, 12, 13, 14, 15, - /* 780 */ 16, 400, 374, 375, 60, 61, 62, 63, 362, 65, - /* 790 */ 409, 403, 12, 13, 14, 15, 16, 33, 65, 379, - /* 800 */ 380, 375, 394, 415, 14, 417, 271, 272, 273, 0, - /* 810 */ 20, 78, 270, 271, 272, 273, 274, 275, 276, 277, - /* 820 */ 278, 403, 484, 485, 486, 362, 488, 489, 410, 403, - /* 830 */ 106, 403, 78, 109, 215, 216, 418, 104, 375, 390, - /* 840 */ 107, 415, 393, 417, 456, 362, 418, 459, 388, 389, - /* 850 */ 462, 463, 464, 465, 466, 467, 4, 469, 375, 473, - /* 860 */ 377, 475, 474, 33, 476, 0, 403, 392, 480, 481, - /* 870 */ 461, 408, 108, 403, 374, 375, 143, 144, 415, 70, - /* 880 */ 417, 411, 456, 374, 375, 459, 403, 391, 462, 463, - /* 890 */ 464, 465, 466, 467, 394, 469, 487, 22, 415, 175, - /* 900 */ 417, 405, 476, 394, 159, 307, 480, 481, 184, 185, - /* 910 */ 383, 415, 37, 180, 181, 191, 192, 388, 389, 456, - /* 920 */ 187, 188, 459, 374, 375, 462, 463, 464, 465, 466, - /* 930 */ 467, 473, 469, 475, 210, 202, 409, 204, 108, 456, - /* 940 */ 374, 375, 459, 394, 404, 462, 463, 464, 465, 466, - /* 950 */ 467, 403, 469, 78, 0, 459, 460, 474, 410, 476, - /* 960 */ 394, 365, 366, 480, 481, 469, 418, 234, 235, 236, - /* 970 */ 180, 238, 239, 240, 241, 242, 243, 244, 245, 246, - /* 980 */ 247, 248, 249, 250, 251, 252, 253, 254, 255, 12, - /* 990 */ 13, 374, 375, 137, 138, 362, 42, 20, 142, 22, - /* 1000 */ 65, 136, 137, 138, 139, 140, 141, 142, 375, 22, - /* 1010 */ 377, 394, 35, 0, 37, 270, 271, 272, 273, 274, - /* 1020 */ 275, 276, 277, 278, 37, 362, 236, 8, 9, 374, - /* 1030 */ 375, 12, 13, 14, 15, 16, 403, 391, 375, 13, - /* 1040 */ 377, 106, 65, 0, 109, 20, 2, 403, 415, 394, - /* 1050 */ 417, 405, 8, 9, 410, 78, 12, 13, 14, 15, - /* 1060 */ 16, 415, 418, 37, 21, 362, 403, 24, 25, 26, - /* 1070 */ 27, 28, 29, 30, 31, 32, 143, 144, 415, 23, - /* 1080 */ 417, 104, 20, 362, 107, 362, 4, 472, 399, 456, - /* 1090 */ 475, 104, 459, 362, 0, 462, 463, 464, 465, 466, - /* 1100 */ 467, 19, 469, 47, 48, 459, 375, 474, 395, 476, - /* 1110 */ 175, 374, 33, 480, 481, 469, 403, 35, 415, 456, - /* 1120 */ 143, 144, 459, 410, 411, 462, 463, 464, 465, 466, - /* 1130 */ 467, 418, 469, 51, 403, 283, 415, 474, 415, 476, - /* 1140 */ 58, 59, 453, 480, 481, 51, 415, 65, 417, 136, - /* 1150 */ 137, 138, 139, 140, 141, 142, 412, 180, 181, 415, - /* 1160 */ 374, 375, 8, 9, 187, 188, 12, 13, 14, 15, - /* 1170 */ 16, 136, 137, 138, 139, 140, 141, 142, 404, 202, - /* 1180 */ 394, 204, 374, 375, 50, 448, 449, 456, 106, 438, - /* 1190 */ 459, 109, 403, 462, 463, 464, 465, 466, 467, 404, - /* 1200 */ 469, 182, 394, 0, 404, 39, 40, 418, 14, 15, - /* 1210 */ 16, 234, 235, 236, 404, 238, 239, 240, 241, 242, - /* 1220 */ 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - /* 1230 */ 253, 254, 255, 12, 13, 362, 33, 374, 375, 488, - /* 1240 */ 218, 20, 220, 22, 374, 375, 395, 496, 412, 404, - /* 1250 */ 362, 415, 521, 522, 403, 362, 35, 394, 37, 374, - /* 1260 */ 375, 236, 411, 117, 394, 514, 515, 395, 375, 438, - /* 1270 */ 519, 520, 13, 374, 375, 403, 362, 111, 112, 394, - /* 1280 */ 114, 374, 375, 411, 395, 362, 65, 13, 415, 375, - /* 1290 */ 362, 377, 403, 394, 374, 375, 403, 33, 236, 78, - /* 1300 */ 411, 394, 136, 415, 412, 175, 140, 415, 415, 396, - /* 1310 */ 417, 37, 399, 0, 394, 169, 182, 403, 18, 488, - /* 1320 */ 71, 362, 428, 23, 190, 104, 0, 496, 107, 415, - /* 1330 */ 33, 417, 362, 362, 362, 22, 206, 78, 415, 0, - /* 1340 */ 40, 41, 45, 415, 44, 514, 515, 375, 22, 456, - /* 1350 */ 519, 520, 459, 362, 54, 462, 463, 464, 465, 466, - /* 1360 */ 467, 22, 469, 49, 143, 144, 66, 67, 68, 69, - /* 1370 */ 456, 362, 108, 459, 415, 403, 462, 463, 464, 465, - /* 1380 */ 466, 467, 0, 469, 305, 415, 415, 415, 474, 417, - /* 1390 */ 476, 362, 1, 2, 480, 481, 362, 110, 65, 37, - /* 1400 */ 113, 180, 181, 510, 22, 33, 415, 107, 187, 188, - /* 1410 */ 8, 9, 33, 33, 12, 13, 14, 15, 16, 490, - /* 1420 */ 363, 107, 20, 202, 415, 204, 110, 110, 456, 113, - /* 1430 */ 113, 459, 359, 37, 462, 463, 464, 465, 466, 467, - /* 1440 */ 78, 469, 109, 438, 415, 145, 474, 110, 476, 415, - /* 1450 */ 113, 37, 480, 481, 523, 234, 235, 236, 512, 238, - /* 1460 */ 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - /* 1470 */ 249, 250, 251, 252, 253, 254, 255, 438, 505, 13, - /* 1480 */ 108, 12, 13, 234, 491, 13, 378, 108, 108, 33, - /* 1490 */ 33, 22, 0, 488, 194, 195, 196, 33, 438, 199, - /* 1500 */ 403, 496, 362, 37, 35, 391, 37, 33, 33, 37, - /* 1510 */ 33, 438, 212, 213, 33, 375, 443, 391, 428, 514, - /* 1520 */ 515, 373, 33, 223, 519, 520, 226, 488, 428, 229, - /* 1530 */ 230, 231, 232, 233, 65, 496, 33, 378, 33, 511, - /* 1540 */ 33, 511, 33, 403, 52, 428, 437, 78, 488, 33, - /* 1550 */ 33, 511, 511, 514, 515, 415, 496, 417, 519, 520, - /* 1560 */ 33, 488, 375, 414, 108, 108, 33, 445, 516, 496, - /* 1570 */ 428, 428, 108, 104, 514, 515, 495, 482, 362, 519, - /* 1580 */ 520, 281, 108, 108, 182, 108, 495, 514, 515, 108, - /* 1590 */ 498, 375, 519, 520, 393, 284, 456, 108, 51, 459, - /* 1600 */ 204, 439, 462, 463, 464, 465, 466, 467, 458, 469, - /* 1610 */ 42, 108, 457, 108, 474, 108, 476, 108, 204, 403, - /* 1620 */ 480, 481, 20, 450, 108, 108, 217, 455, 383, 450, - /* 1630 */ 383, 415, 441, 417, 200, 108, 20, 374, 236, 20, - /* 1640 */ 375, 108, 45, 424, 375, 421, 424, 179, 375, 374, - /* 1650 */ 374, 424, 362, 421, 421, 421, 105, 387, 103, 374, - /* 1660 */ 102, 20, 374, 386, 385, 375, 374, 374, 367, 371, - /* 1670 */ 50, 202, 456, 204, 367, 459, 371, 383, 462, 463, - /* 1680 */ 464, 465, 466, 467, 20, 469, 362, 450, 417, 383, - /* 1690 */ 474, 383, 476, 403, 20, 376, 480, 481, 20, 375, - /* 1700 */ 440, 383, 374, 234, 235, 415, 376, 417, 383, 20, - /* 1710 */ 383, 431, 383, 367, 383, 403, 365, 248, 249, 250, - /* 1720 */ 251, 252, 253, 254, 403, 403, 403, 403, 374, 365, - /* 1730 */ 367, 221, 454, 107, 452, 403, 450, 403, 403, 415, - /* 1740 */ 381, 417, 20, 403, 403, 403, 456, 403, 449, 459, - /* 1750 */ 208, 415, 462, 463, 464, 465, 466, 467, 415, 469, - /* 1760 */ 415, 207, 447, 374, 417, 362, 476, 381, 292, 291, - /* 1770 */ 480, 481, 415, 300, 507, 193, 504, 280, 375, 279, - /* 1780 */ 456, 433, 433, 459, 446, 504, 462, 463, 464, 465, - /* 1790 */ 466, 467, 439, 469, 362, 506, 302, 301, 502, 504, - /* 1800 */ 476, 306, 309, 285, 480, 481, 403, 375, 439, 20, - /* 1810 */ 304, 501, 503, 375, 494, 524, 461, 117, 415, 517, - /* 1820 */ 417, 518, 282, 362, 376, 381, 381, 433, 415, 185, - /* 1830 */ 415, 415, 415, 433, 415, 403, 375, 429, 399, 381, - /* 1840 */ 408, 381, 375, 493, 107, 479, 107, 415, 407, 417, - /* 1850 */ 415, 499, 381, 497, 374, 22, 38, 451, 368, 456, - /* 1860 */ 442, 434, 459, 364, 403, 462, 463, 464, 465, 466, - /* 1870 */ 467, 367, 469, 382, 434, 360, 415, 0, 417, 397, - /* 1880 */ 397, 397, 0, 0, 45, 0, 37, 227, 456, 37, - /* 1890 */ 37, 459, 362, 37, 462, 463, 464, 465, 466, 467, - /* 1900 */ 227, 469, 0, 37, 37, 375, 227, 37, 0, 0, - /* 1910 */ 227, 37, 509, 510, 0, 37, 0, 456, 362, 22, - /* 1920 */ 459, 0, 0, 462, 463, 464, 465, 466, 467, 37, - /* 1930 */ 469, 375, 222, 403, 210, 0, 210, 204, 211, 0, - /* 1940 */ 202, 0, 0, 198, 197, 415, 0, 417, 0, 148, - /* 1950 */ 49, 0, 49, 0, 37, 0, 37, 51, 0, 403, - /* 1960 */ 49, 0, 0, 45, 408, 0, 0, 0, 0, 49, - /* 1970 */ 0, 415, 0, 417, 513, 0, 0, 165, 0, 165, - /* 1980 */ 37, 0, 0, 0, 0, 0, 456, 0, 0, 459, - /* 1990 */ 0, 0, 462, 463, 464, 465, 466, 467, 0, 469, - /* 2000 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* 2010 */ 0, 0, 456, 49, 45, 459, 0, 0, 462, 463, - /* 2020 */ 464, 465, 466, 467, 0, 469, 0, 0, 362, 148, - /* 2030 */ 0, 147, 0, 146, 22, 0, 0, 0, 0, 50, - /* 2040 */ 22, 375, 22, 50, 362, 65, 0, 0, 0, 0, - /* 2050 */ 37, 65, 522, 0, 0, 0, 37, 375, 0, 362, - /* 2060 */ 65, 0, 37, 42, 42, 51, 51, 0, 37, 403, - /* 2070 */ 42, 37, 375, 14, 51, 33, 0, 0, 45, 0, - /* 2080 */ 0, 415, 42, 417, 43, 403, 193, 0, 49, 0, - /* 2090 */ 408, 0, 49, 49, 42, 0, 0, 415, 42, 417, - /* 2100 */ 403, 37, 362, 37, 42, 408, 49, 0, 37, 0, - /* 2110 */ 42, 51, 415, 0, 417, 375, 51, 42, 37, 0, - /* 2120 */ 51, 51, 456, 72, 1, 459, 42, 0, 462, 463, - /* 2130 */ 464, 465, 466, 467, 0, 469, 0, 471, 456, 0, - /* 2140 */ 22, 459, 19, 403, 462, 463, 464, 465, 466, 467, - /* 2150 */ 0, 469, 37, 456, 37, 415, 459, 417, 35, 462, - /* 2160 */ 463, 464, 465, 466, 467, 115, 469, 37, 37, 362, - /* 2170 */ 37, 22, 37, 0, 51, 37, 113, 37, 37, 33, - /* 2180 */ 33, 37, 375, 60, 61, 62, 63, 22, 65, 37, - /* 2190 */ 37, 0, 22, 0, 22, 53, 456, 0, 362, 459, - /* 2200 */ 22, 37, 462, 463, 464, 465, 466, 467, 0, 469, - /* 2210 */ 403, 375, 0, 0, 37, 0, 37, 0, 22, 20, - /* 2220 */ 108, 37, 415, 37, 417, 37, 0, 362, 107, 106, - /* 2230 */ 49, 107, 109, 0, 0, 37, 22, 0, 22, 403, - /* 2240 */ 375, 0, 3, 33, 107, 286, 37, 78, 37, 49, - /* 2250 */ 107, 415, 107, 417, 182, 182, 108, 50, 103, 108, - /* 2260 */ 182, 105, 108, 456, 141, 182, 459, 182, 403, 462, - /* 2270 */ 463, 464, 465, 466, 467, 185, 469, 189, 50, 33, - /* 2280 */ 415, 189, 417, 209, 33, 33, 33, 205, 108, 107, - /* 2290 */ 33, 49, 456, 108, 107, 459, 362, 107, 462, 463, - /* 2300 */ 464, 465, 466, 467, 37, 469, 3, 184, 107, 375, - /* 2310 */ 108, 107, 33, 108, 191, 37, 0, 37, 37, 37, - /* 2320 */ 37, 456, 362, 37, 459, 49, 108, 462, 463, 464, - /* 2330 */ 465, 466, 467, 210, 469, 375, 49, 403, 108, 108, - /* 2340 */ 33, 0, 107, 42, 108, 107, 0, 186, 42, 415, - /* 2350 */ 107, 417, 108, 49, 107, 107, 107, 33, 184, 105, - /* 2360 */ 105, 116, 257, 403, 270, 2, 22, 107, 49, 108, - /* 2370 */ 107, 107, 286, 108, 108, 415, 49, 417, 107, 286, - /* 2380 */ 107, 22, 108, 108, 107, 117, 37, 37, 37, 33, - /* 2390 */ 456, 362, 234, 459, 237, 107, 462, 463, 464, 465, - /* 2400 */ 466, 467, 108, 469, 375, 107, 37, 362, 108, 107, - /* 2410 */ 37, 37, 37, 108, 37, 107, 456, 108, 107, 459, - /* 2420 */ 375, 108, 462, 463, 464, 465, 466, 467, 107, 469, - /* 2430 */ 107, 22, 403, 107, 72, 107, 71, 37, 128, 37, - /* 2440 */ 128, 37, 128, 128, 415, 37, 417, 37, 403, 37, - /* 2450 */ 37, 37, 37, 33, 78, 101, 78, 22, 101, 37, - /* 2460 */ 415, 37, 417, 37, 37, 362, 37, 37, 78, 37, - /* 2470 */ 37, 37, 22, 37, 37, 37, 0, 37, 375, 51, - /* 2480 */ 0, 42, 51, 37, 42, 456, 0, 362, 459, 37, - /* 2490 */ 0, 462, 463, 464, 465, 466, 467, 42, 469, 51, - /* 2500 */ 375, 456, 37, 42, 459, 51, 403, 462, 463, 464, - /* 2510 */ 465, 466, 467, 0, 469, 37, 0, 22, 415, 37, - /* 2520 */ 417, 33, 362, 22, 21, 525, 22, 22, 403, 21, - /* 2530 */ 20, 525, 525, 525, 525, 375, 525, 525, 525, 525, - /* 2540 */ 415, 525, 417, 525, 525, 362, 525, 525, 525, 525, - /* 2550 */ 525, 525, 525, 525, 525, 525, 525, 525, 375, 456, - /* 2560 */ 525, 525, 459, 403, 525, 462, 463, 464, 465, 466, - /* 2570 */ 467, 525, 469, 525, 525, 415, 525, 417, 525, 525, - /* 2580 */ 525, 456, 525, 525, 459, 525, 403, 462, 463, 464, - /* 2590 */ 465, 466, 467, 525, 469, 525, 525, 525, 415, 525, - /* 2600 */ 417, 525, 362, 525, 525, 525, 525, 525, 525, 525, - /* 2610 */ 525, 525, 525, 525, 525, 375, 456, 525, 525, 459, - /* 2620 */ 525, 525, 462, 463, 464, 465, 466, 467, 525, 469, - /* 2630 */ 525, 362, 525, 525, 525, 525, 525, 525, 525, 456, - /* 2640 */ 525, 525, 459, 403, 375, 462, 463, 464, 465, 466, - /* 2650 */ 467, 525, 469, 525, 525, 415, 525, 417, 525, 525, - /* 2660 */ 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, - /* 2670 */ 525, 525, 403, 525, 525, 525, 525, 525, 525, 525, - /* 2680 */ 525, 525, 525, 525, 415, 525, 417, 525, 525, 525, - /* 2690 */ 525, 525, 525, 525, 525, 525, 456, 525, 362, 459, - /* 2700 */ 525, 525, 462, 463, 464, 465, 466, 467, 525, 469, - /* 2710 */ 525, 375, 525, 525, 362, 525, 525, 525, 525, 525, - /* 2720 */ 525, 525, 525, 525, 525, 456, 525, 375, 459, 525, - /* 2730 */ 525, 462, 463, 464, 465, 466, 467, 525, 469, 403, - /* 2740 */ 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, - /* 2750 */ 525, 415, 525, 417, 525, 403, 525, 525, 525, 525, - /* 2760 */ 525, 525, 525, 525, 525, 525, 525, 415, 525, 417, - /* 2770 */ 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, - /* 2780 */ 525, 525, 525, 362, 525, 525, 525, 525, 525, 525, - /* 2790 */ 525, 525, 456, 525, 525, 459, 375, 525, 462, 463, - /* 2800 */ 464, 465, 466, 467, 525, 469, 525, 362, 456, 525, - /* 2810 */ 525, 459, 525, 525, 462, 463, 464, 465, 466, 467, - /* 2820 */ 375, 469, 525, 525, 403, 525, 525, 525, 525, 525, - /* 2830 */ 525, 525, 525, 525, 525, 525, 415, 525, 417, 525, - /* 2840 */ 525, 362, 525, 525, 525, 525, 525, 525, 403, 525, - /* 2850 */ 525, 525, 525, 525, 375, 525, 525, 525, 525, 525, - /* 2860 */ 415, 525, 417, 525, 525, 525, 525, 525, 525, 525, - /* 2870 */ 525, 525, 525, 525, 525, 525, 525, 456, 525, 525, - /* 2880 */ 459, 525, 403, 462, 463, 464, 465, 466, 467, 525, - /* 2890 */ 469, 525, 525, 525, 415, 525, 417, 525, 525, 525, - /* 2900 */ 525, 456, 525, 525, 459, 525, 525, 462, 463, 464, - /* 2910 */ 465, 466, 467, 525, 469, 525, 525, 525, 525, 525, - /* 2920 */ 525, 362, 525, 525, 525, 525, 525, 525, 525, 525, - /* 2930 */ 525, 525, 525, 525, 375, 456, 525, 525, 459, 525, - /* 2940 */ 362, 462, 463, 464, 465, 466, 467, 525, 469, 525, - /* 2950 */ 525, 525, 525, 375, 525, 362, 525, 525, 525, 525, - /* 2960 */ 525, 525, 403, 525, 525, 525, 525, 525, 375, 525, - /* 2970 */ 525, 525, 525, 525, 415, 525, 417, 525, 525, 525, - /* 2980 */ 525, 403, 525, 525, 525, 525, 525, 525, 525, 525, - /* 2990 */ 525, 525, 525, 415, 525, 417, 403, 525, 525, 525, - /* 3000 */ 525, 525, 525, 525, 525, 525, 525, 525, 415, 525, - /* 3010 */ 417, 525, 525, 525, 525, 456, 525, 525, 459, 525, - /* 3020 */ 525, 462, 463, 464, 465, 466, 467, 525, 469, 525, - /* 3030 */ 525, 525, 525, 525, 456, 525, 525, 459, 525, 525, - /* 3040 */ 462, 463, 464, 465, 466, 467, 525, 469, 525, 456, - /* 3050 */ 525, 525, 459, 525, 525, 462, 463, 464, 465, 466, - /* 3060 */ 467, 525, 469, 359, 359, 359, 359, 359, 359, 359, - /* 3070 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3080 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3090 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3100 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3110 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3120 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3130 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3140 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3150 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3160 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3170 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3180 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3190 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3200 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3210 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3220 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3230 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3240 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3250 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3260 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3270 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3280 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3290 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3300 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3310 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3320 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3330 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3340 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3350 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3360 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3370 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3380 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3390 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3400 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3410 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 3420 */ 359, 359, + /* 340 */ 492, 129, 130, 131, 132, 133, 134, 135, 500, 393, + /* 350 */ 104, 106, 182, 107, 376, 377, 78, 73, 74, 75, + /* 360 */ 376, 377, 117, 417, 80, 81, 82, 519, 283, 407, + /* 370 */ 86, 523, 524, 417, 396, 91, 92, 93, 94, 238, + /* 380 */ 396, 97, 179, 462, 100, 289, 290, 291, 292, 143, + /* 390 */ 144, 70, 147, 148, 473, 150, 151, 152, 153, 154, + /* 400 */ 155, 156, 157, 158, 20, 37, 22, 162, 163, 164, + /* 410 */ 165, 166, 167, 168, 70, 170, 171, 172, 462, 463, + /* 420 */ 464, 176, 177, 178, 462, 22, 180, 181, 183, 473, + /* 430 */ 3, 376, 377, 187, 188, 473, 73, 74, 75, 55, + /* 440 */ 37, 404, 20, 80, 81, 82, 20, 283, 202, 86, + /* 450 */ 204, 396, 14, 416, 91, 92, 93, 94, 20, 236, + /* 460 */ 97, 204, 117, 100, 261, 262, 263, 264, 265, 266, + /* 470 */ 267, 268, 269, 270, 271, 182, 276, 277, 278, 279, + /* 480 */ 280, 78, 236, 237, 238, 238, 240, 241, 242, 243, + /* 490 */ 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + /* 500 */ 254, 255, 256, 257, 258, 12, 13, 12, 13, 14, + /* 510 */ 15, 16, 18, 20, 364, 22, 258, 23, 295, 296, + /* 520 */ 297, 298, 299, 300, 301, 33, 159, 377, 35, 107, + /* 530 */ 37, 238, 405, 2, 40, 41, 14, 45, 44, 8, + /* 540 */ 9, 0, 20, 12, 13, 14, 15, 16, 54, 0, + /* 550 */ 20, 50, 364, 361, 427, 405, 429, 228, 65, 0, + /* 560 */ 66, 67, 68, 69, 71, 377, 258, 417, 260, 419, + /* 570 */ 21, 78, 204, 24, 25, 26, 27, 28, 29, 30, + /* 580 */ 31, 32, 0, 24, 25, 26, 27, 28, 29, 30, + /* 590 */ 31, 32, 372, 405, 441, 419, 376, 104, 378, 446, + /* 600 */ 107, 107, 234, 235, 20, 417, 180, 419, 65, 459, + /* 610 */ 434, 70, 462, 437, 438, 33, 466, 467, 468, 469, + /* 620 */ 470, 471, 465, 473, 376, 377, 476, 107, 478, 479, + /* 630 */ 480, 376, 377, 441, 484, 485, 143, 144, 446, 145, + /* 640 */ 273, 274, 275, 364, 396, 492, 405, 459, 491, 106, + /* 650 */ 462, 396, 109, 500, 466, 467, 468, 469, 470, 471, + /* 660 */ 472, 473, 474, 475, 238, 159, 51, 4, 107, 0, + /* 670 */ 429, 518, 519, 180, 181, 60, 523, 524, 63, 64, + /* 680 */ 187, 188, 19, 182, 492, 376, 377, 20, 194, 195, + /* 690 */ 196, 190, 500, 199, 78, 202, 417, 204, 35, 0, + /* 700 */ 117, 87, 180, 418, 419, 283, 212, 213, 376, 377, + /* 710 */ 518, 519, 376, 377, 51, 523, 524, 223, 175, 406, + /* 720 */ 226, 58, 59, 229, 230, 231, 232, 233, 65, 236, + /* 730 */ 237, 238, 305, 240, 241, 242, 243, 244, 245, 246, + /* 740 */ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + /* 750 */ 257, 12, 13, 14, 364, 376, 377, 425, 405, 20, + /* 760 */ 238, 22, 201, 149, 203, 412, 182, 377, 238, 106, + /* 770 */ 376, 377, 109, 420, 35, 396, 37, 283, 272, 273, + /* 780 */ 274, 275, 276, 277, 278, 279, 280, 173, 174, 179, + /* 790 */ 396, 477, 364, 479, 233, 405, 487, 488, 489, 490, + /* 800 */ 401, 492, 493, 283, 65, 377, 34, 417, 2, 419, + /* 810 */ 143, 144, 376, 377, 8, 9, 405, 78, 12, 13, + /* 820 */ 14, 15, 16, 412, 488, 489, 490, 465, 492, 493, + /* 830 */ 161, 420, 396, 405, 165, 136, 137, 138, 139, 140, + /* 840 */ 141, 142, 173, 104, 283, 417, 107, 419, 0, 459, + /* 850 */ 0, 364, 462, 491, 22, 456, 466, 467, 468, 469, + /* 860 */ 470, 471, 406, 473, 377, 465, 379, 385, 478, 37, + /* 870 */ 480, 261, 8, 9, 484, 485, 12, 13, 14, 15, + /* 880 */ 16, 271, 143, 144, 376, 377, 441, 459, 0, 69, + /* 890 */ 462, 491, 405, 411, 466, 467, 468, 469, 470, 471, + /* 900 */ 52, 473, 512, 492, 417, 13, 419, 477, 480, 479, + /* 910 */ 78, 500, 484, 485, 14, 15, 16, 372, 13, 180, + /* 920 */ 181, 376, 385, 378, 376, 377, 187, 188, 37, 518, + /* 930 */ 519, 376, 377, 425, 523, 524, 104, 492, 406, 402, + /* 940 */ 138, 202, 37, 204, 142, 500, 459, 476, 411, 462, + /* 950 */ 479, 396, 406, 466, 467, 468, 469, 470, 471, 405, + /* 960 */ 473, 376, 377, 518, 519, 478, 376, 480, 523, 524, + /* 970 */ 78, 484, 485, 425, 420, 236, 237, 238, 406, 240, + /* 980 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + /* 990 */ 251, 252, 253, 254, 255, 256, 257, 12, 13, 364, + /* 1000 */ 405, 56, 57, 376, 377, 20, 364, 22, 364, 159, + /* 1010 */ 160, 4, 377, 211, 379, 420, 214, 197, 22, 217, + /* 1020 */ 35, 219, 37, 396, 136, 137, 138, 139, 140, 141, + /* 1030 */ 142, 14, 392, 37, 202, 395, 204, 20, 364, 441, + /* 1040 */ 405, 451, 452, 405, 224, 225, 182, 23, 376, 406, + /* 1050 */ 65, 377, 417, 379, 419, 405, 376, 377, 420, 417, + /* 1060 */ 137, 417, 412, 78, 1, 2, 381, 382, 236, 237, + /* 1070 */ 420, 47, 48, 488, 489, 490, 396, 492, 493, 405, + /* 1080 */ 136, 137, 138, 139, 140, 141, 142, 376, 377, 104, + /* 1090 */ 492, 417, 107, 419, 459, 204, 364, 462, 500, 22, + /* 1100 */ 104, 466, 467, 468, 469, 470, 471, 396, 473, 377, + /* 1110 */ 405, 379, 20, 478, 37, 480, 518, 519, 413, 484, + /* 1120 */ 485, 523, 524, 451, 452, 234, 235, 414, 143, 144, + /* 1130 */ 417, 441, 33, 459, 33, 364, 462, 405, 215, 216, + /* 1140 */ 466, 467, 468, 469, 470, 471, 136, 473, 447, 417, + /* 1150 */ 140, 419, 478, 364, 480, 376, 377, 0, 484, 485, + /* 1160 */ 376, 377, 397, 376, 377, 180, 181, 364, 390, 391, + /* 1170 */ 405, 108, 187, 188, 33, 396, 376, 377, 413, 22, + /* 1180 */ 396, 104, 492, 396, 39, 40, 45, 202, 417, 204, + /* 1190 */ 500, 459, 381, 382, 462, 441, 396, 180, 466, 467, + /* 1200 */ 468, 469, 470, 471, 405, 473, 417, 108, 518, 519, + /* 1210 */ 478, 412, 480, 523, 524, 414, 484, 485, 417, 420, + /* 1220 */ 417, 236, 237, 238, 13, 240, 241, 242, 243, 244, + /* 1230 */ 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + /* 1240 */ 255, 256, 257, 12, 13, 364, 492, 364, 364, 376, + /* 1250 */ 377, 20, 33, 22, 500, 238, 111, 112, 414, 114, + /* 1260 */ 377, 417, 379, 364, 405, 71, 35, 397, 37, 396, + /* 1270 */ 0, 412, 518, 519, 397, 405, 364, 523, 524, 420, + /* 1280 */ 364, 136, 405, 413, 364, 140, 390, 391, 405, 78, + /* 1290 */ 413, 364, 285, 364, 376, 377, 65, 377, 417, 379, + /* 1300 */ 417, 417, 419, 137, 138, 364, 0, 398, 142, 78, + /* 1310 */ 401, 364, 110, 364, 396, 113, 417, 110, 364, 441, + /* 1320 */ 113, 51, 218, 364, 220, 405, 394, 367, 368, 417, + /* 1330 */ 238, 377, 33, 417, 33, 104, 65, 417, 107, 419, + /* 1340 */ 110, 13, 459, 113, 417, 462, 417, 0, 42, 466, + /* 1350 */ 467, 468, 469, 470, 471, 0, 473, 110, 417, 405, + /* 1360 */ 113, 478, 0, 480, 417, 37, 417, 484, 485, 22, + /* 1370 */ 492, 417, 33, 419, 143, 144, 417, 22, 500, 459, + /* 1380 */ 109, 33, 462, 33, 22, 33, 466, 467, 468, 469, + /* 1390 */ 470, 471, 49, 473, 143, 144, 518, 519, 478, 365, + /* 1400 */ 480, 523, 524, 37, 484, 485, 37, 108, 307, 108, + /* 1410 */ 37, 180, 181, 459, 1, 2, 462, 33, 187, 188, + /* 1420 */ 466, 467, 468, 469, 470, 471, 33, 473, 33, 33, + /* 1430 */ 236, 107, 478, 202, 480, 204, 33, 494, 484, 485, + /* 1440 */ 116, 33, 430, 33, 78, 12, 13, 108, 33, 33, + /* 1450 */ 107, 33, 527, 516, 33, 509, 108, 33, 108, 495, + /* 1460 */ 108, 33, 33, 380, 405, 393, 393, 236, 237, 238, + /* 1470 */ 13, 240, 241, 242, 243, 244, 245, 246, 247, 248, + /* 1480 */ 249, 250, 251, 252, 253, 254, 255, 256, 257, 12, + /* 1490 */ 13, 13, 108, 364, 37, 430, 375, 12, 13, 22, + /* 1500 */ 430, 108, 515, 108, 108, 515, 377, 22, 515, 440, + /* 1510 */ 515, 108, 35, 380, 37, 37, 108, 364, 108, 430, + /* 1520 */ 35, 377, 37, 108, 108, 416, 108, 448, 309, 108, + /* 1530 */ 377, 499, 108, 430, 405, 430, 108, 108, 499, 520, + /* 1540 */ 486, 395, 65, 502, 286, 51, 417, 461, 419, 442, + /* 1550 */ 65, 42, 20, 460, 217, 78, 458, 385, 405, 453, + /* 1560 */ 385, 453, 444, 364, 200, 20, 376, 20, 377, 45, + /* 1570 */ 417, 179, 419, 204, 426, 377, 377, 204, 426, 423, + /* 1580 */ 376, 104, 377, 423, 376, 426, 423, 423, 459, 105, + /* 1590 */ 389, 462, 103, 376, 388, 466, 467, 468, 469, 470, + /* 1600 */ 471, 102, 473, 387, 405, 376, 20, 478, 376, 480, + /* 1610 */ 376, 369, 459, 484, 485, 462, 417, 50, 419, 466, + /* 1620 */ 467, 468, 469, 470, 471, 373, 473, 373, 369, 453, + /* 1630 */ 385, 478, 20, 480, 385, 385, 20, 484, 485, 419, + /* 1640 */ 378, 20, 385, 443, 378, 385, 20, 433, 385, 364, + /* 1650 */ 385, 376, 385, 369, 417, 367, 367, 417, 459, 369, + /* 1660 */ 405, 462, 377, 376, 221, 466, 467, 468, 469, 470, + /* 1670 */ 471, 107, 473, 405, 405, 457, 455, 405, 405, 202, + /* 1680 */ 453, 204, 405, 405, 405, 405, 405, 202, 405, 204, + /* 1690 */ 405, 417, 383, 20, 208, 452, 450, 207, 383, 376, + /* 1700 */ 294, 419, 417, 442, 419, 449, 302, 293, 417, 193, + /* 1710 */ 303, 508, 287, 236, 237, 304, 281, 508, 508, 234, + /* 1720 */ 235, 236, 507, 511, 525, 526, 282, 250, 251, 252, + /* 1730 */ 253, 254, 255, 256, 510, 250, 251, 252, 253, 254, + /* 1740 */ 255, 256, 435, 435, 459, 506, 505, 462, 311, 308, + /* 1750 */ 497, 466, 467, 468, 469, 470, 471, 522, 473, 442, + /* 1760 */ 306, 528, 498, 364, 377, 480, 20, 465, 117, 484, + /* 1770 */ 485, 284, 378, 383, 383, 107, 377, 483, 417, 435, + /* 1780 */ 417, 435, 417, 364, 417, 417, 185, 431, 383, 503, + /* 1790 */ 401, 417, 383, 501, 377, 417, 377, 521, 364, 107, + /* 1800 */ 417, 22, 376, 383, 405, 366, 409, 38, 370, 369, + /* 1810 */ 362, 377, 454, 436, 384, 445, 417, 436, 419, 0, + /* 1820 */ 0, 399, 399, 0, 405, 45, 399, 0, 37, 227, + /* 1830 */ 37, 37, 37, 227, 0, 37, 417, 37, 419, 405, + /* 1840 */ 227, 37, 0, 0, 227, 37, 0, 37, 0, 0, + /* 1850 */ 22, 417, 37, 419, 0, 222, 210, 0, 459, 210, + /* 1860 */ 204, 462, 202, 211, 0, 466, 467, 468, 469, 470, + /* 1870 */ 471, 0, 473, 0, 198, 197, 0, 0, 459, 480, + /* 1880 */ 148, 462, 364, 484, 485, 466, 467, 468, 469, 470, + /* 1890 */ 471, 0, 473, 459, 49, 377, 462, 37, 0, 364, + /* 1900 */ 466, 467, 468, 469, 470, 471, 0, 473, 49, 37, + /* 1910 */ 0, 0, 377, 51, 480, 364, 49, 0, 0, 485, + /* 1920 */ 45, 0, 0, 405, 0, 0, 0, 49, 377, 0, + /* 1930 */ 0, 37, 513, 514, 0, 417, 165, 419, 165, 0, + /* 1940 */ 405, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* 1950 */ 0, 0, 417, 0, 419, 0, 405, 0, 0, 0, + /* 1960 */ 0, 0, 49, 0, 45, 0, 0, 0, 417, 148, + /* 1970 */ 419, 0, 0, 0, 439, 0, 22, 459, 0, 0, + /* 1980 */ 462, 0, 147, 146, 466, 467, 468, 469, 470, 471, + /* 1990 */ 439, 473, 0, 0, 459, 0, 364, 462, 22, 22, + /* 2000 */ 65, 466, 467, 468, 469, 470, 471, 37, 473, 377, + /* 2010 */ 459, 0, 50, 462, 364, 0, 0, 466, 467, 468, + /* 2020 */ 469, 470, 471, 0, 473, 37, 42, 377, 37, 65, + /* 2030 */ 364, 51, 514, 50, 0, 0, 51, 405, 42, 65, + /* 2040 */ 37, 51, 42, 377, 0, 37, 0, 45, 42, 417, + /* 2050 */ 33, 419, 14, 0, 49, 405, 49, 43, 49, 0, + /* 2060 */ 42, 0, 0, 0, 42, 0, 0, 417, 49, 419, + /* 2070 */ 0, 405, 193, 72, 0, 0, 37, 51, 42, 0, + /* 2080 */ 37, 51, 42, 417, 0, 419, 37, 42, 51, 0, + /* 2090 */ 42, 459, 37, 51, 462, 0, 0, 364, 466, 467, + /* 2100 */ 468, 469, 470, 471, 0, 473, 0, 0, 0, 459, + /* 2110 */ 377, 0, 462, 115, 37, 22, 466, 467, 468, 469, + /* 2120 */ 470, 471, 37, 473, 37, 459, 113, 37, 462, 37, + /* 2130 */ 364, 37, 466, 467, 468, 469, 470, 471, 405, 473, + /* 2140 */ 37, 475, 37, 377, 22, 33, 37, 33, 0, 517, + /* 2150 */ 417, 0, 419, 37, 37, 37, 22, 22, 0, 22, + /* 2160 */ 0, 22, 37, 53, 0, 0, 0, 37, 0, 37, + /* 2170 */ 0, 405, 439, 20, 22, 37, 526, 37, 37, 108, + /* 2180 */ 107, 0, 49, 417, 0, 419, 37, 107, 0, 22, + /* 2190 */ 0, 209, 459, 22, 182, 462, 3, 1, 0, 466, + /* 2200 */ 467, 468, 469, 470, 471, 439, 473, 182, 33, 182, + /* 2210 */ 108, 288, 50, 182, 185, 19, 37, 37, 103, 50, + /* 2220 */ 107, 189, 189, 182, 105, 459, 205, 107, 462, 108, + /* 2230 */ 107, 35, 466, 467, 468, 469, 470, 471, 33, 473, + /* 2240 */ 33, 33, 33, 49, 108, 33, 49, 51, 37, 3, + /* 2250 */ 108, 35, 107, 364, 107, 78, 60, 61, 62, 63, + /* 2260 */ 33, 65, 107, 37, 108, 108, 377, 51, 107, 37, + /* 2270 */ 107, 37, 37, 37, 288, 288, 60, 61, 62, 63, + /* 2280 */ 108, 65, 108, 33, 37, 0, 108, 49, 49, 0, + /* 2290 */ 108, 42, 272, 107, 405, 33, 105, 105, 2, 22, + /* 2300 */ 236, 49, 106, 108, 49, 109, 417, 107, 419, 108, + /* 2310 */ 259, 107, 22, 107, 186, 239, 0, 42, 108, 116, + /* 2320 */ 107, 107, 106, 108, 107, 109, 108, 107, 184, 107, + /* 2330 */ 49, 107, 107, 364, 37, 37, 108, 141, 107, 37, + /* 2340 */ 107, 37, 37, 37, 37, 108, 377, 117, 459, 107, + /* 2350 */ 107, 462, 108, 108, 33, 466, 467, 468, 469, 470, + /* 2360 */ 471, 107, 473, 37, 108, 107, 22, 108, 364, 108, + /* 2370 */ 107, 107, 72, 107, 405, 107, 128, 107, 37, 128, + /* 2380 */ 184, 377, 71, 37, 37, 128, 417, 191, 419, 37, + /* 2390 */ 37, 175, 364, 128, 37, 37, 37, 37, 78, 33, + /* 2400 */ 184, 185, 101, 78, 101, 377, 210, 191, 192, 405, + /* 2410 */ 37, 37, 37, 22, 364, 37, 37, 37, 78, 37, + /* 2420 */ 37, 417, 37, 419, 37, 37, 210, 377, 459, 0, + /* 2430 */ 22, 462, 37, 405, 37, 466, 467, 468, 469, 470, + /* 2440 */ 471, 51, 473, 42, 0, 417, 37, 419, 42, 51, + /* 2450 */ 0, 37, 42, 51, 0, 405, 37, 42, 0, 0, + /* 2460 */ 37, 37, 51, 459, 22, 33, 462, 417, 22, 419, + /* 2470 */ 466, 467, 468, 469, 470, 471, 21, 473, 22, 22, + /* 2480 */ 529, 21, 20, 529, 529, 529, 529, 459, 529, 529, + /* 2490 */ 462, 529, 529, 364, 466, 467, 468, 469, 470, 471, + /* 2500 */ 529, 473, 529, 529, 529, 529, 377, 529, 529, 459, + /* 2510 */ 529, 529, 462, 529, 364, 529, 466, 467, 468, 469, + /* 2520 */ 470, 471, 529, 473, 529, 529, 529, 377, 529, 529, + /* 2530 */ 529, 529, 529, 529, 405, 529, 529, 364, 529, 529, + /* 2540 */ 529, 529, 529, 529, 529, 529, 417, 529, 419, 529, + /* 2550 */ 377, 529, 529, 529, 529, 405, 529, 529, 529, 529, + /* 2560 */ 529, 529, 529, 529, 529, 529, 529, 417, 529, 419, + /* 2570 */ 529, 529, 529, 529, 529, 529, 529, 529, 405, 529, + /* 2580 */ 529, 529, 529, 529, 529, 529, 529, 529, 459, 529, + /* 2590 */ 417, 462, 419, 529, 529, 466, 467, 468, 469, 470, + /* 2600 */ 471, 529, 473, 529, 529, 529, 529, 529, 529, 459, + /* 2610 */ 529, 529, 462, 529, 529, 529, 466, 467, 468, 469, + /* 2620 */ 470, 471, 529, 473, 364, 529, 529, 529, 529, 529, + /* 2630 */ 529, 529, 459, 529, 529, 462, 529, 377, 529, 466, + /* 2640 */ 467, 468, 469, 470, 471, 529, 473, 529, 529, 529, + /* 2650 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 364, + /* 2660 */ 529, 529, 529, 529, 529, 405, 529, 529, 529, 529, + /* 2670 */ 529, 529, 377, 529, 529, 529, 529, 417, 529, 419, + /* 2680 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 2690 */ 529, 529, 529, 529, 529, 529, 529, 529, 364, 529, + /* 2700 */ 405, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 2710 */ 529, 377, 417, 529, 419, 529, 529, 529, 529, 459, + /* 2720 */ 529, 529, 462, 529, 529, 529, 466, 467, 468, 469, + /* 2730 */ 470, 471, 529, 473, 529, 529, 529, 529, 529, 405, + /* 2740 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 2750 */ 529, 417, 529, 419, 459, 529, 364, 462, 529, 529, + /* 2760 */ 529, 466, 467, 468, 469, 470, 471, 529, 473, 377, + /* 2770 */ 529, 364, 529, 529, 529, 529, 529, 529, 529, 529, + /* 2780 */ 529, 529, 529, 529, 377, 529, 364, 529, 529, 529, + /* 2790 */ 529, 529, 529, 459, 529, 529, 462, 405, 529, 377, + /* 2800 */ 466, 467, 468, 469, 470, 471, 529, 473, 529, 417, + /* 2810 */ 529, 419, 405, 529, 529, 529, 529, 529, 529, 529, + /* 2820 */ 529, 529, 529, 529, 417, 529, 419, 405, 529, 529, + /* 2830 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 417, + /* 2840 */ 529, 419, 529, 529, 529, 529, 529, 529, 529, 529, + /* 2850 */ 529, 459, 529, 529, 462, 364, 529, 529, 466, 467, + /* 2860 */ 468, 469, 470, 471, 529, 473, 459, 529, 377, 462, + /* 2870 */ 529, 529, 529, 466, 467, 468, 469, 470, 471, 529, + /* 2880 */ 473, 459, 529, 529, 462, 364, 529, 529, 466, 467, + /* 2890 */ 468, 469, 470, 471, 529, 473, 405, 529, 377, 529, + /* 2900 */ 529, 529, 529, 529, 529, 529, 529, 529, 417, 529, + /* 2910 */ 419, 529, 529, 529, 529, 364, 529, 529, 529, 529, + /* 2920 */ 529, 529, 529, 529, 529, 529, 405, 529, 377, 529, + /* 2930 */ 529, 529, 529, 529, 529, 529, 529, 529, 417, 529, + /* 2940 */ 419, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 2950 */ 459, 529, 529, 462, 529, 529, 405, 466, 467, 468, + /* 2960 */ 469, 470, 471, 529, 473, 529, 529, 529, 417, 529, + /* 2970 */ 419, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 2980 */ 459, 529, 364, 462, 529, 529, 529, 466, 467, 468, + /* 2990 */ 469, 470, 471, 529, 473, 377, 529, 529, 529, 529, + /* 3000 */ 529, 529, 364, 529, 529, 529, 529, 529, 529, 529, + /* 3010 */ 459, 529, 529, 462, 529, 377, 529, 466, 467, 468, + /* 3020 */ 469, 470, 471, 405, 473, 529, 529, 529, 529, 529, + /* 3030 */ 529, 529, 529, 529, 529, 417, 529, 419, 529, 529, + /* 3040 */ 529, 529, 529, 405, 529, 529, 529, 529, 529, 529, + /* 3050 */ 529, 529, 529, 529, 529, 417, 529, 419, 529, 529, + /* 3060 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 3070 */ 529, 529, 529, 529, 529, 529, 529, 459, 529, 364, + /* 3080 */ 462, 529, 529, 529, 466, 467, 468, 469, 470, 471, + /* 3090 */ 529, 473, 377, 529, 529, 529, 529, 459, 529, 529, + /* 3100 */ 462, 529, 529, 529, 466, 467, 468, 469, 470, 471, + /* 3110 */ 529, 473, 529, 529, 529, 529, 364, 529, 529, 529, + /* 3120 */ 405, 529, 529, 529, 529, 529, 529, 529, 529, 377, + /* 3130 */ 529, 529, 417, 529, 419, 529, 529, 529, 529, 529, + /* 3140 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 364, + /* 3150 */ 529, 529, 529, 529, 529, 529, 529, 405, 529, 529, + /* 3160 */ 529, 529, 377, 529, 529, 529, 529, 529, 529, 417, + /* 3170 */ 529, 419, 529, 529, 459, 529, 529, 462, 529, 529, + /* 3180 */ 529, 466, 467, 468, 469, 470, 471, 529, 473, 529, + /* 3190 */ 405, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 3200 */ 529, 529, 417, 529, 419, 529, 529, 529, 529, 529, + /* 3210 */ 529, 459, 529, 529, 462, 529, 529, 529, 466, 467, + /* 3220 */ 468, 469, 470, 471, 529, 473, 529, 529, 529, 529, + /* 3230 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 3240 */ 529, 529, 529, 529, 459, 529, 529, 462, 529, 529, + /* 3250 */ 529, 466, 467, 468, 469, 470, 471, 529, 473, 361, + /* 3260 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3270 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3280 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3290 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3300 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3310 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3320 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3330 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3340 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3350 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3360 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3370 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3380 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3390 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3400 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3410 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3420 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3430 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3440 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3450 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3460 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3470 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3480 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3490 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3500 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3510 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3520 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3530 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3540 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3550 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3560 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3570 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3580 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3590 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3600 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 3610 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, }; -#define YY_SHIFT_COUNT (861) +#define YY_SHIFT_COUNT (868) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2516) +#define YY_SHIFT_MAX (2462) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 1300, 0, 244, 0, 489, 489, 489, 489, 489, 489, - /* 10 */ 489, 489, 489, 489, 489, 489, 733, 977, 977, 1221, - /* 20 */ 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, - /* 30 */ 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, - /* 40 */ 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, - /* 50 */ 977, 251, 398, 349, 1, 7, 30, 7, 7, 1, - /* 60 */ 1, 7, 1469, 7, 243, 1469, 1469, 436, 7, 53, - /* 70 */ 242, 172, 172, 306, 306, 242, 40, 279, 32, 32, - /* 80 */ 121, 172, 172, 172, 172, 172, 172, 172, 172, 172, - /* 90 */ 172, 172, 294, 382, 172, 172, 199, 53, 172, 294, - /* 100 */ 172, 53, 172, 172, 53, 172, 172, 53, 172, 53, - /* 110 */ 53, 53, 172, 258, 203, 203, 448, 542, 201, 334, - /* 120 */ 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, - /* 130 */ 334, 334, 334, 334, 334, 334, 334, 334, 1166, 255, - /* 140 */ 40, 279, 447, 447, 671, 413, 413, 413, 809, 415, - /* 150 */ 415, 754, 671, 199, 322, 53, 53, 160, 53, 442, - /* 160 */ 53, 442, 442, 441, 503, 212, 212, 212, 212, 212, - /* 170 */ 212, 212, 212, 2123, 361, 1043, 1402, 745, 745, 15, - /* 180 */ 293, 339, 288, 118, 535, 369, 790, 438, 438, 299, - /* 190 */ 1056, 533, 875, 875, 875, 1134, 875, 44, 667, 1025, - /* 200 */ 262, 618, 1130, 1025, 1025, 1062, 1259, 1259, 347, 647, - /* 210 */ 852, 754, 1311, 1547, 1568, 1602, 1409, 199, 1602, 199, - /* 220 */ 1434, 1616, 1619, 1597, 1619, 1597, 1468, 1616, 1619, 1616, - /* 230 */ 1597, 1468, 1468, 1468, 1551, 1555, 1616, 1558, 1616, 1616, - /* 240 */ 1616, 1641, 1620, 1641, 1620, 1602, 199, 199, 1664, 199, - /* 250 */ 1674, 1678, 199, 1674, 199, 1689, 199, 199, 1616, 199, - /* 260 */ 1641, 53, 53, 53, 53, 53, 53, 53, 53, 53, - /* 270 */ 53, 53, 1616, 503, 503, 1641, 442, 442, 442, 1510, - /* 280 */ 1626, 1602, 258, 1722, 1542, 1554, 1664, 258, 1311, 1616, - /* 290 */ 442, 1476, 1478, 1476, 1478, 1473, 1582, 1476, 1494, 1496, - /* 300 */ 1518, 1311, 1497, 1500, 1493, 1495, 1506, 1619, 1789, 1700, - /* 310 */ 1540, 1674, 258, 258, 1478, 442, 442, 442, 442, 1478, - /* 320 */ 442, 1644, 258, 441, 258, 1619, 1737, 1739, 442, 1616, - /* 330 */ 258, 1833, 1818, 1641, 3063, 3063, 3063, 3063, 3063, 3063, - /* 340 */ 3063, 3063, 3063, 36, 724, 546, 1082, 764, 54, 81, - /* 350 */ 865, 652, 1044, 1019, 1013, 1154, 1154, 1154, 1154, 1154, - /* 360 */ 1154, 1154, 1154, 1154, 1035, 151, 4, 780, 780, 252, - /* 370 */ 935, 601, 110, 697, 26, 494, 987, 619, 856, 856, - /* 380 */ 1194, 443, 31, 1194, 1194, 1194, 1094, 355, 830, 954, - /* 390 */ 1297, 1146, 1203, 1287, 1316, 1317, 1337, 1026, 1274, 1313, - /* 400 */ 1326, 1339, 1382, 1022, 1264, 1372, 1333, 1379, 1380, 1456, - /* 410 */ 1457, 933, 1079, 598, 1464, 1474, 1475, 1477, 1481, 1489, - /* 420 */ 1391, 1503, 1249, 1505, 1314, 1507, 1509, 1516, 1517, 1527, - /* 430 */ 1533, 603, 1396, 1414, 1466, 1472, 1362, 1492, 1877, 1882, - /* 440 */ 1883, 1839, 1885, 1849, 1660, 1852, 1853, 1856, 1673, 1902, - /* 450 */ 1866, 1867, 1679, 1870, 1908, 1683, 1909, 1874, 1914, 1878, - /* 460 */ 1916, 1897, 1921, 1892, 1710, 1922, 1724, 1935, 1726, 1727, - /* 470 */ 1733, 1738, 1939, 1941, 1942, 1745, 1747, 1946, 1948, 1801, - /* 480 */ 1901, 1903, 1951, 1917, 1953, 1955, 1919, 1906, 1958, 1911, - /* 490 */ 1961, 1918, 1962, 1965, 1966, 1920, 1967, 1968, 1970, 1972, - /* 500 */ 1975, 1976, 1812, 1943, 1978, 1814, 1981, 1982, 1983, 1984, - /* 510 */ 1985, 1987, 1988, 1990, 1991, 1998, 2000, 2001, 2002, 2003, - /* 520 */ 2004, 2005, 2006, 2007, 2008, 1964, 2009, 1969, 2010, 2011, - /* 530 */ 2016, 2017, 2024, 2026, 2027, 2012, 2035, 1881, 2030, 1884, - /* 540 */ 2032, 1887, 2036, 2037, 2018, 1989, 2020, 1993, 2038, 1980, - /* 550 */ 2013, 2046, 1986, 2047, 1995, 2048, 2049, 2019, 2014, 2021, - /* 560 */ 2053, 2025, 2015, 2022, 2054, 2031, 2023, 2028, 2055, 2034, - /* 570 */ 2058, 2033, 2040, 2042, 2039, 2043, 2059, 2044, 2061, 2041, - /* 580 */ 2052, 2067, 2076, 2077, 2079, 2056, 1893, 2080, 2039, 2057, - /* 590 */ 2087, 2089, 2051, 2091, 2095, 2064, 2060, 2062, 2096, 2066, - /* 600 */ 2065, 2068, 2107, 2071, 2069, 2075, 2109, 2081, 2070, 2084, - /* 610 */ 2113, 2119, 2127, 2134, 2136, 2139, 2050, 2063, 2115, 2118, - /* 620 */ 2150, 2117, 2130, 2131, 2133, 2135, 2138, 2140, 2141, 2146, - /* 630 */ 2147, 2144, 2152, 2149, 2153, 2173, 2165, 2191, 2170, 2193, - /* 640 */ 2172, 2142, 2197, 2178, 2164, 2208, 2212, 2213, 2177, 2215, - /* 650 */ 2179, 2217, 2196, 2199, 2184, 2186, 2188, 2112, 2121, 2226, - /* 660 */ 2072, 2124, 2074, 2039, 2181, 2233, 2073, 2198, 2214, 2234, - /* 670 */ 2082, 2216, 2078, 2090, 2237, 2241, 2083, 2088, 2085, 2092, - /* 680 */ 2239, 2210, 1959, 2137, 2148, 2143, 2151, 2209, 2211, 2145, - /* 690 */ 2207, 2156, 2228, 2155, 2154, 2246, 2251, 2180, 2182, 2187, - /* 700 */ 2190, 2185, 2252, 2200, 2242, 2201, 2253, 2086, 2169, 2202, - /* 710 */ 2257, 2204, 2267, 2205, 2218, 2303, 2279, 2093, 2278, 2280, - /* 720 */ 2281, 2282, 2283, 2286, 2230, 2231, 2276, 2094, 2307, 2287, - /* 730 */ 2316, 2341, 2235, 2301, 2238, 2236, 2244, 2243, 2247, 2161, - /* 740 */ 2248, 2346, 2306, 2174, 2249, 2245, 2039, 2304, 2324, 2254, - /* 750 */ 2105, 2255, 2363, 2344, 2158, 2260, 2261, 2263, 2265, 2264, - /* 760 */ 2266, 2319, 2271, 2273, 2327, 2274, 2359, 2157, 2277, 2268, - /* 770 */ 2275, 2349, 2350, 2288, 2294, 2351, 2298, 2300, 2369, 2302, - /* 780 */ 2305, 2373, 2308, 2309, 2374, 2311, 2313, 2375, 2321, 2310, - /* 790 */ 2312, 2314, 2315, 2323, 2356, 2326, 2377, 2328, 2356, 2356, - /* 800 */ 2409, 2362, 2365, 2400, 2402, 2404, 2408, 2410, 2412, 2413, - /* 810 */ 2414, 2415, 2376, 2354, 2378, 2357, 2420, 2422, 2424, 2426, - /* 820 */ 2435, 2427, 2429, 2430, 2390, 2146, 2432, 2147, 2433, 2434, - /* 830 */ 2436, 2437, 2450, 2438, 2476, 2440, 2428, 2439, 2480, 2446, - /* 840 */ 2431, 2442, 2486, 2452, 2448, 2455, 2490, 2465, 2454, 2461, - /* 850 */ 2513, 2478, 2482, 2516, 2495, 2488, 2501, 2503, 2504, 2505, - /* 860 */ 2508, 2510, + /* 0 */ 494, 0, 246, 0, 493, 493, 493, 493, 493, 493, + /* 10 */ 493, 493, 493, 493, 493, 493, 739, 985, 985, 1231, + /* 20 */ 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, + /* 30 */ 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, + /* 40 */ 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, + /* 50 */ 44, 422, 561, 215, 85, 520, 85, 85, 215, 215, + /* 60 */ 85, 1477, 85, 245, 1477, 164, 85, 68, 1485, 133, + /* 70 */ 79, 79, 1485, 1485, 151, 151, 133, 80, 667, 38, + /* 80 */ 38, 247, 79, 79, 79, 79, 79, 79, 79, 79, + /* 90 */ 79, 79, 79, 86, 292, 79, 79, 321, 68, 79, + /* 100 */ 86, 79, 68, 79, 79, 68, 79, 79, 68, 79, + /* 110 */ 68, 68, 68, 79, 344, 203, 203, 363, 13, 201, + /* 120 */ 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, + /* 130 */ 832, 832, 832, 832, 832, 832, 832, 832, 832, 1145, + /* 140 */ 170, 80, 667, 945, 945, 278, 584, 584, 584, 308, + /* 150 */ 308, 541, 892, 278, 321, 345, 68, 258, 68, 68, + /* 160 */ 616, 68, 616, 616, 583, 772, 212, 212, 212, 212, + /* 170 */ 212, 212, 212, 212, 2196, 284, 549, 293, 506, 506, + /* 180 */ 15, 223, 96, 200, 242, 367, 522, 1017, 257, 257, + /* 190 */ 57, 1024, 141, 403, 403, 403, 501, 426, 403, 384, + /* 200 */ 530, 438, 1010, 4, 530, 530, 1092, 1211, 1211, 427, + /* 210 */ 492, 1007, 892, 1258, 1494, 1509, 1532, 1337, 321, 1532, + /* 220 */ 321, 1364, 1545, 1547, 1524, 1547, 1524, 1392, 1545, 1547, + /* 230 */ 1545, 1524, 1392, 1392, 1392, 1484, 1489, 1545, 1499, 1545, + /* 240 */ 1545, 1545, 1586, 1567, 1586, 1567, 1532, 321, 321, 1612, + /* 250 */ 321, 1616, 1621, 321, 1616, 321, 1626, 321, 321, 1545, + /* 260 */ 321, 1586, 68, 68, 68, 68, 68, 68, 68, 68, + /* 270 */ 68, 68, 68, 1545, 772, 772, 1586, 616, 616, 616, + /* 280 */ 1443, 1564, 1532, 344, 1673, 1486, 1490, 1612, 344, 1258, + /* 290 */ 1545, 616, 1406, 1414, 1406, 1414, 1404, 1516, 1406, 1411, + /* 300 */ 1407, 1425, 1258, 1444, 1435, 1437, 1441, 1454, 1547, 1746, + /* 310 */ 1651, 1487, 1616, 344, 344, 1668, 1414, 616, 616, 616, + /* 320 */ 616, 1414, 616, 1601, 344, 583, 344, 1547, 616, 616, + /* 330 */ 1692, 616, 1545, 344, 1779, 1769, 1586, 3259, 3259, 3259, + /* 340 */ 3259, 3259, 3259, 3259, 3259, 3259, 36, 2216, 559, 663, + /* 350 */ 54, 32, 67, 531, 806, 864, 699, 888, 77, 77, + /* 360 */ 77, 77, 77, 77, 77, 77, 77, 944, 802, 21, + /* 370 */ 495, 495, 820, 543, 669, 614, 615, 368, 891, 850, + /* 380 */ 996, 1077, 923, 900, 1063, 610, 900, 900, 900, 1166, + /* 390 */ 1166, 1270, 329, 1099, 1306, 1141, 104, 582, 1202, 1207, + /* 400 */ 1230, 1247, 905, 1328, 1157, 1347, 1355, 1362, 1104, 1299, + /* 410 */ 1301, 1271, 1339, 1348, 1350, 1352, 1251, 1101, 1219, 1384, + /* 420 */ 1413, 1395, 1194, 1396, 1343, 1393, 1403, 1408, 1410, 1415, + /* 430 */ 1433, 1416, 1418, 1421, 1424, 1428, 1429, 1324, 1369, 1373, + /* 440 */ 1457, 1478, 1366, 848, 1819, 1820, 1823, 1780, 1827, 1791, + /* 450 */ 1602, 1793, 1794, 1795, 1606, 1834, 1798, 1800, 1613, 1804, + /* 460 */ 1842, 1617, 1843, 1808, 1846, 1810, 1848, 1828, 1849, 1815, + /* 470 */ 1633, 1854, 1646, 1857, 1649, 1652, 1656, 1660, 1864, 1871, + /* 480 */ 1873, 1676, 1678, 1876, 1877, 1732, 1845, 1859, 1891, 1860, + /* 490 */ 1898, 1906, 1872, 1862, 1910, 1867, 1911, 1875, 1917, 1918, + /* 500 */ 1921, 1878, 1922, 1924, 1925, 1926, 1929, 1930, 1771, 1894, + /* 510 */ 1934, 1773, 1939, 1941, 1942, 1943, 1944, 1945, 1946, 1947, + /* 520 */ 1948, 1949, 1950, 1951, 1953, 1955, 1957, 1958, 1959, 1960, + /* 530 */ 1961, 1913, 1963, 1919, 1965, 1966, 1967, 1971, 1972, 1973, + /* 540 */ 1975, 1954, 1978, 1821, 1979, 1835, 1981, 1837, 1992, 1993, + /* 550 */ 1976, 1962, 1977, 1983, 1995, 1935, 1970, 2011, 1964, 2015, + /* 560 */ 1974, 2016, 2023, 1988, 1980, 1984, 2034, 1991, 1985, 1996, + /* 570 */ 2035, 2003, 1990, 2000, 2044, 2008, 2046, 2002, 2006, 2017, + /* 580 */ 2005, 2007, 2038, 2009, 2053, 2014, 2018, 2059, 2061, 2062, + /* 590 */ 2063, 2022, 1879, 2065, 2005, 2019, 2066, 2070, 2001, 2074, + /* 600 */ 2075, 2039, 2026, 2036, 2079, 2043, 2030, 2040, 2084, 2049, + /* 610 */ 2037, 2045, 2089, 2055, 2042, 2048, 2095, 2096, 2104, 2106, + /* 620 */ 2107, 2108, 1998, 2013, 2077, 2093, 2111, 2085, 2087, 2090, + /* 630 */ 2092, 2094, 2103, 2105, 2109, 2112, 2114, 2116, 2117, 2122, + /* 640 */ 2118, 2148, 2134, 2151, 2135, 2158, 2137, 2110, 2160, 2139, + /* 650 */ 2125, 2164, 2165, 2166, 2130, 2168, 2132, 2170, 2152, 2153, + /* 660 */ 2138, 2140, 2141, 2071, 2073, 2181, 2012, 2080, 1982, 2005, + /* 670 */ 2133, 2184, 2025, 2149, 2167, 2188, 2021, 2171, 2027, 2029, + /* 680 */ 2190, 2198, 2031, 2032, 2041, 2033, 2193, 2175, 1923, 2113, + /* 690 */ 2102, 2120, 2121, 2179, 2180, 2123, 2162, 2119, 2169, 2115, + /* 700 */ 2136, 2205, 2207, 2142, 2145, 2147, 2155, 2156, 2208, 2194, + /* 710 */ 2197, 2161, 2209, 1986, 2177, 2157, 2212, 2163, 2211, 2172, + /* 720 */ 2174, 2246, 2227, 1987, 2226, 2232, 2234, 2235, 2236, 2247, + /* 730 */ 2178, 2182, 2238, 2020, 2250, 2239, 2285, 2289, 2186, 2249, + /* 740 */ 2262, 2191, 2051, 2192, 2296, 2277, 2064, 2195, 2200, 2201, + /* 750 */ 2252, 2204, 2206, 2255, 2210, 2290, 2076, 2213, 2215, 2218, + /* 760 */ 2214, 2217, 2128, 2220, 2316, 2275, 2144, 2222, 2203, 2005, + /* 770 */ 2281, 2224, 2225, 2228, 2231, 2233, 2230, 2237, 2297, 2298, + /* 780 */ 2242, 2244, 2302, 2243, 2245, 2304, 2254, 2256, 2305, 2258, + /* 790 */ 2259, 2306, 2263, 2261, 2307, 2264, 2248, 2251, 2257, 2265, + /* 800 */ 2266, 2321, 2268, 2326, 2270, 2321, 2321, 2344, 2300, 2311, + /* 810 */ 2341, 2346, 2347, 2352, 2353, 2357, 2358, 2359, 2360, 2320, + /* 820 */ 2301, 2325, 2303, 2366, 2373, 2374, 2375, 2391, 2378, 2379, + /* 830 */ 2380, 2340, 2112, 2382, 2114, 2383, 2385, 2387, 2388, 2408, + /* 840 */ 2395, 2429, 2397, 2390, 2401, 2444, 2409, 2398, 2406, 2450, + /* 850 */ 2414, 2402, 2410, 2454, 2419, 2411, 2415, 2458, 2423, 2424, + /* 860 */ 2459, 2442, 2432, 2446, 2455, 2456, 2457, 2460, 2462, }; -#define YY_REDUCE_COUNT (342) -#define YY_REDUCE_MIN (-481) -#define YY_REDUCE_MAX (2593) +#define YY_REDUCE_COUNT (345) +#define YY_REDUCE_MIN (-485) +#define YY_REDUCE_MAX (2785) static const short yy_reduce_ofst[] = { - /* 0 */ 1073, -317, 144, 182, 240, 388, 483, 633, 663, 914, - /* 10 */ 972, 1140, 1216, 426, 1290, 1324, -90, 1403, 731, 219, - /* 20 */ 893, 463, 1432, 1461, 1530, 1556, 1666, 1682, 1697, 1740, - /* 30 */ 1807, 1836, 1865, 1934, 1960, 2029, 2045, 2103, 2125, 2160, - /* 40 */ 2183, 2240, 2269, 2336, 2352, 2421, 2445, 2479, 2559, 2578, - /* 50 */ 2593, -319, -228, -435, 29, 751, 831, 1005, 1039, -181, - /* 60 */ 338, 1060, 496, -481, -372, -192, 646, -414, -312, 713, - /* 70 */ -360, -196, -77, -368, -363, -417, -344, -325, -216, -202, - /* 80 */ -138, 265, 278, 377, 408, -272, 85, 500, 509, 549, - /* 90 */ 566, 181, 249, 43, 617, 655, 381, 308, 786, 737, - /* 100 */ 808, 418, 863, 870, 851, 885, 899, 548, 907, 872, - /* 110 */ 644, 889, 920, -14, -461, -461, -343, 122, 274, -209, - /* 120 */ -201, -56, 95, 259, 703, 721, 723, 873, 888, 923, - /* 130 */ 928, 959, 970, 971, 991, 1009, 1029, 1034, -315, -410, - /* 140 */ -63, 11, 200, 420, 460, -410, 46, 409, -86, 386, - /* 150 */ 458, 449, 529, 527, 689, -247, 428, 615, 470, 744, - /* 160 */ 789, 836, 892, 913, 596, -393, 540, 774, 795, 800, - /* 170 */ 810, 845, 800, -412, 475, 1057, 894, 929, 929, 931, - /* 180 */ 946, 973, 993, 1108, 929, 1097, 1097, 1114, 1126, 1090, - /* 190 */ 1148, 1100, 1028, 1030, 1040, 1109, 1041, 1097, 1159, 1117, - /* 200 */ 1187, 1149, 1122, 1142, 1143, 1097, 1081, 1091, 1052, 1095, - /* 210 */ 1092, 1201, 1162, 1150, 1155, 1173, 1172, 1245, 1179, 1247, - /* 220 */ 1191, 1263, 1265, 1219, 1269, 1222, 1224, 1275, 1273, 1276, - /* 230 */ 1227, 1232, 1233, 1234, 1270, 1277, 1285, 1279, 1288, 1292, - /* 240 */ 1293, 1301, 1298, 1307, 1305, 1237, 1294, 1306, 1271, 1308, - /* 250 */ 1319, 1260, 1318, 1330, 1325, 1280, 1327, 1329, 1328, 1331, - /* 260 */ 1346, 1312, 1321, 1322, 1323, 1332, 1334, 1335, 1340, 1341, - /* 270 */ 1342, 1344, 1354, 1351, 1364, 1363, 1336, 1343, 1345, 1278, - /* 280 */ 1282, 1286, 1359, 1299, 1315, 1338, 1347, 1386, 1353, 1389, - /* 290 */ 1357, 1272, 1348, 1281, 1349, 1267, 1289, 1295, 1309, 1296, - /* 300 */ 1310, 1369, 1320, 1350, 1291, 1303, 1302, 1438, 1355, 1352, - /* 310 */ 1356, 1448, 1444, 1445, 1394, 1413, 1415, 1416, 1417, 1400, - /* 320 */ 1419, 1408, 1458, 1439, 1460, 1467, 1366, 1441, 1435, 1480, - /* 330 */ 1471, 1499, 1490, 1504, 1418, 1406, 1427, 1440, 1482, 1483, - /* 340 */ 1484, 1491, 1515, + /* 0 */ 192, -321, 150, 390, 487, 635, 674, 732, 883, 920, + /* 10 */ 954, 1129, 1153, 428, 1285, 1399, 188, 1419, 1199, 1434, + /* 20 */ 1518, 1535, 1551, 1632, 1650, 1666, 1733, 1766, 1889, 1969, + /* 30 */ 2004, 2028, 2050, 2129, 2150, 2173, 2260, 2295, 2334, 2392, + /* 40 */ 2407, 2422, 2491, 2521, 2551, 2618, 2638, 2715, 2752, 2785, + /* 50 */ -323, 411, 153, 309, 445, 598, 690, 754, 336, 585, + /* 60 */ 878, -44, -485, -327, -239, -316, -152, -395, -302, 176, + /* 70 */ -183, -77, -79, -38, -371, -366, -387, 127, -233, 220, + /* 80 */ 545, -263, -22, -16, 55, 248, 332, 508, 255, 379, + /* 90 */ 394, 436, 548, 590, -360, 555, 627, 537, 353, 680, + /* 100 */ 672, 711, 650, 779, 784, 765, 787, 800, 799, 873, + /* 110 */ 870, 859, 877, 918, -194, -379, -379, -375, -357, -207, + /* 120 */ -343, -54, 279, 642, 644, 771, 789, 803, 881, 884, + /* 130 */ 899, 912, 916, 927, 929, 941, 947, 949, 959, 37, + /* 140 */ 157, 241, 285, 685, 811, 778, 157, 362, 400, 314, + /* 150 */ 430, -382, 640, 896, 482, 399, 554, 471, 595, 705, + /* 160 */ 713, 638, 801, 844, 909, 960, -400, 313, 456, 532, + /* 170 */ 546, 572, 643, 546, 701, 932, 1034, 1012, 943, 943, + /* 180 */ 925, 937, 946, 964, 1083, 943, 1059, 1059, 1072, 1073, + /* 190 */ 1065, 1121, 1070, 987, 990, 993, 1069, 1059, 995, 1133, + /* 200 */ 1089, 1144, 1109, 1079, 1103, 1105, 1059, 1032, 1039, 1019, + /* 210 */ 1054, 1041, 1146, 1107, 1086, 1093, 1106, 1098, 1172, 1108, + /* 220 */ 1175, 1118, 1190, 1191, 1148, 1198, 1152, 1156, 1204, 1205, + /* 230 */ 1208, 1159, 1160, 1163, 1164, 1201, 1206, 1217, 1216, 1229, + /* 240 */ 1232, 1234, 1242, 1252, 1259, 1254, 1176, 1245, 1249, 1220, + /* 250 */ 1250, 1262, 1200, 1257, 1266, 1260, 1214, 1263, 1265, 1275, + /* 260 */ 1267, 1284, 1255, 1268, 1269, 1272, 1273, 1277, 1278, 1279, + /* 270 */ 1280, 1281, 1283, 1287, 1288, 1289, 1290, 1237, 1240, 1274, + /* 280 */ 1218, 1221, 1227, 1309, 1243, 1246, 1256, 1282, 1315, 1261, + /* 290 */ 1323, 1291, 1203, 1307, 1209, 1308, 1212, 1224, 1210, 1215, + /* 300 */ 1239, 1241, 1317, 1264, 1253, 1233, 1235, 1276, 1387, 1302, + /* 310 */ 1286, 1292, 1394, 1390, 1391, 1294, 1344, 1361, 1363, 1365, + /* 320 */ 1367, 1346, 1368, 1356, 1405, 1389, 1409, 1417, 1374, 1378, + /* 330 */ 1397, 1383, 1426, 1420, 1439, 1438, 1440, 1370, 1358, 1377, + /* 340 */ 1381, 1422, 1423, 1427, 1430, 1448, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 10 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 20 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 30 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 40 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 50 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 60 */ 1945, 2285, 1945, 1945, 2248, 1945, 1945, 1945, 1945, 1945, - /* 70 */ 1945, 1945, 1945, 1945, 1945, 1945, 2255, 1945, 1945, 1945, - /* 80 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 90 */ 1945, 1945, 1945, 1945, 1945, 1945, 2044, 1945, 1945, 1945, - /* 100 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 110 */ 1945, 1945, 1945, 2042, 2488, 1945, 1945, 2517, 1945, 1945, - /* 120 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 130 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 2500, - /* 140 */ 1945, 1945, 2016, 2016, 1945, 2500, 2500, 2500, 2042, 2460, - /* 150 */ 2460, 1945, 1945, 2044, 2323, 1945, 1945, 1945, 1945, 1945, - /* 160 */ 1945, 1945, 1945, 2167, 1975, 1945, 1945, 1945, 1945, 2191, - /* 170 */ 1945, 1945, 1945, 2311, 1945, 1945, 2546, 2492, 2493, 2608, - /* 180 */ 1945, 2549, 2511, 1945, 2506, 1945, 1945, 1945, 1945, 2260, - /* 190 */ 1945, 2536, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 200 */ 1945, 2120, 2305, 1945, 1945, 1945, 1945, 1945, 2592, 2490, - /* 210 */ 2530, 1945, 2540, 1945, 2348, 1945, 2337, 2044, 1945, 2044, - /* 220 */ 2298, 2243, 1945, 2253, 1945, 2253, 2250, 1945, 1945, 1945, - /* 230 */ 2253, 2250, 2250, 2250, 2109, 2105, 1945, 2103, 1945, 1945, - /* 240 */ 1945, 1945, 2000, 1945, 2000, 1945, 2044, 2044, 1945, 2044, - /* 250 */ 1945, 1945, 2044, 1945, 2044, 1945, 2044, 2044, 1945, 2044, - /* 260 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 270 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 2335, - /* 280 */ 2321, 1945, 2042, 1945, 2309, 2307, 1945, 2042, 2540, 1945, - /* 290 */ 1945, 2562, 2557, 2562, 2557, 2576, 2572, 2562, 2581, 2578, - /* 300 */ 2542, 2540, 2523, 2519, 2611, 2598, 2594, 1945, 1945, 2528, - /* 310 */ 2526, 1945, 2042, 2042, 2557, 1945, 1945, 1945, 1945, 2557, - /* 320 */ 1945, 1945, 2042, 1945, 2042, 1945, 1945, 2136, 1945, 1945, - /* 330 */ 2042, 1945, 1984, 1945, 2300, 2326, 2281, 2281, 2170, 2170, - /* 340 */ 2170, 2045, 1950, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 350 */ 1945, 1945, 1945, 1945, 1945, 2575, 2574, 2413, 1945, 2464, - /* 360 */ 2463, 2462, 2453, 2412, 2132, 1945, 1945, 2411, 2410, 1945, - /* 370 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 2272, 2271, - /* 380 */ 2404, 1945, 1945, 2405, 2403, 2402, 1945, 1945, 1945, 1945, - /* 390 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 400 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 410 */ 1945, 1945, 2595, 2599, 1945, 1945, 1945, 1945, 1945, 1945, - /* 420 */ 2489, 1945, 1945, 1945, 2384, 1945, 1945, 1945, 1945, 1945, - /* 430 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 440 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 450 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 460 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 470 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 2249, - /* 480 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 490 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 500 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 510 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 520 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 530 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 540 */ 1945, 2264, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 550 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 560 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 570 */ 1945, 1945, 1945, 1989, 2391, 1945, 1945, 1945, 1945, 1945, - /* 580 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 2394, 1945, - /* 590 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 600 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 610 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 620 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 2084, - /* 630 */ 2083, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 640 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 650 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 2395, 1945, 1945, - /* 660 */ 1945, 1945, 1945, 2386, 1945, 1945, 1945, 1945, 1945, 1945, - /* 670 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 680 */ 2591, 2543, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 690 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 700 */ 1945, 1945, 1945, 1945, 2384, 1945, 2573, 1945, 1945, 1945, - /* 710 */ 1945, 1945, 1945, 1945, 2589, 1945, 2593, 1945, 1945, 1945, - /* 720 */ 1945, 1945, 1945, 1945, 2499, 2495, 1945, 1945, 2491, 1945, - /* 730 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 740 */ 1945, 1945, 1945, 1945, 1945, 1945, 2383, 1945, 2450, 1945, - /* 750 */ 1945, 1945, 2484, 1945, 1945, 2435, 1945, 1945, 1945, 1945, - /* 760 */ 1945, 1945, 1945, 1945, 1945, 2395, 1945, 2398, 1945, 1945, - /* 770 */ 1945, 1945, 1945, 2164, 1945, 1945, 1945, 1945, 1945, 1945, - /* 780 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 2148, - /* 790 */ 2146, 2145, 2144, 1945, 2177, 1945, 1945, 1945, 2173, 2172, - /* 800 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 810 */ 1945, 1945, 1945, 1945, 1945, 1945, 2063, 1945, 1945, 1945, - /* 820 */ 1945, 1945, 1945, 1945, 1945, 2055, 1945, 2054, 1945, 1945, - /* 830 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 840 */ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945, - /* 850 */ 1945, 1945, 1945, 1945, 1945, 1974, 1945, 1945, 1945, 1945, - /* 860 */ 1945, 1945, + /* 0 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 10 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 20 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 30 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 40 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 50 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 60 */ 2331, 1991, 1991, 2294, 1991, 1991, 1991, 1991, 1991, 1991, + /* 70 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2301, 1991, 1991, + /* 80 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 90 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2090, 1991, 1991, + /* 100 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 110 */ 1991, 1991, 1991, 1991, 2088, 2555, 1991, 1991, 2584, 1991, + /* 120 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 130 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 140 */ 2567, 1991, 1991, 2062, 2062, 1991, 2567, 2567, 2567, 2527, + /* 150 */ 2527, 2088, 1991, 1991, 2090, 2369, 1991, 1991, 1991, 1991, + /* 160 */ 1991, 1991, 1991, 1991, 2213, 2021, 1991, 1991, 1991, 1991, + /* 170 */ 2237, 1991, 1991, 1991, 2357, 1991, 1991, 2613, 2559, 2560, + /* 180 */ 2675, 1991, 2616, 2578, 1991, 2573, 1991, 1991, 1991, 1991, + /* 190 */ 2306, 1991, 2603, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 200 */ 1991, 1991, 2166, 2351, 1991, 1991, 1991, 1991, 1991, 2659, + /* 210 */ 2557, 2597, 1991, 2607, 1991, 2394, 1991, 2383, 2090, 1991, + /* 220 */ 2090, 2344, 2289, 1991, 2299, 1991, 2299, 2296, 1991, 1991, + /* 230 */ 1991, 2299, 2296, 2296, 2296, 2155, 2151, 1991, 2149, 1991, + /* 240 */ 1991, 1991, 1991, 2046, 1991, 2046, 1991, 2090, 2090, 1991, + /* 250 */ 2090, 1991, 1991, 2090, 1991, 2090, 1991, 2090, 2090, 1991, + /* 260 */ 2090, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 270 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 280 */ 2381, 2367, 1991, 2088, 1991, 2355, 2353, 1991, 2088, 2607, + /* 290 */ 1991, 1991, 2629, 2624, 2629, 2624, 2643, 2639, 2629, 2648, + /* 300 */ 2645, 2609, 2607, 2590, 2586, 2678, 2665, 2661, 1991, 1991, + /* 310 */ 2595, 2593, 1991, 2088, 2088, 1991, 2624, 1991, 1991, 1991, + /* 320 */ 1991, 2624, 1991, 1991, 2088, 1991, 2088, 1991, 1991, 1991, + /* 330 */ 2182, 1991, 1991, 2088, 1991, 2030, 1991, 2346, 2372, 2327, + /* 340 */ 2327, 2216, 2216, 2216, 2091, 1996, 1991, 1991, 1991, 1991, + /* 350 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2642, 2641, + /* 360 */ 2479, 1991, 2531, 2530, 2529, 2520, 2478, 2178, 1991, 1991, + /* 370 */ 2477, 2476, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 380 */ 1991, 1991, 1991, 2470, 1991, 1991, 2471, 2469, 2468, 2318, + /* 390 */ 2317, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 400 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 410 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2662, 2666, 1991, + /* 420 */ 2556, 1991, 1991, 1991, 2450, 1991, 1991, 1991, 1991, 1991, + /* 430 */ 2418, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 440 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 450 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 460 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 470 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 480 */ 1991, 1991, 1991, 1991, 1991, 2295, 1991, 1991, 1991, 1991, + /* 490 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 500 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 510 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 520 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 530 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 540 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2310, 1991, 1991, + /* 550 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 560 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 570 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2035, + /* 580 */ 2457, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 590 */ 1991, 1991, 1991, 1991, 2460, 1991, 1991, 1991, 1991, 1991, + /* 600 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 610 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 620 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 630 */ 1991, 1991, 1991, 1991, 1991, 2130, 2129, 1991, 1991, 1991, + /* 640 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 650 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 660 */ 1991, 1991, 1991, 2461, 1991, 1991, 1991, 1991, 1991, 2452, + /* 670 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 680 */ 1991, 1991, 1991, 1991, 1991, 1991, 2658, 2610, 1991, 1991, + /* 690 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 700 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 710 */ 2450, 1991, 2640, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 720 */ 2656, 1991, 2660, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 730 */ 2566, 2562, 1991, 1991, 2558, 1991, 1991, 1991, 1991, 1991, + /* 740 */ 2517, 1991, 1991, 1991, 2551, 1991, 1991, 1991, 1991, 1991, + /* 750 */ 1991, 1991, 1991, 1991, 2461, 1991, 2464, 1991, 1991, 1991, + /* 760 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2449, + /* 770 */ 1991, 2502, 2501, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 780 */ 2210, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 790 */ 1991, 1991, 1991, 1991, 1991, 1991, 2194, 2192, 2191, 2190, + /* 800 */ 1991, 2223, 1991, 1991, 1991, 2219, 2218, 1991, 1991, 1991, + /* 810 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 820 */ 1991, 1991, 1991, 2109, 1991, 1991, 1991, 1991, 1991, 1991, + /* 830 */ 1991, 1991, 2101, 1991, 2100, 1991, 1991, 1991, 1991, 1991, + /* 840 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 850 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, + /* 860 */ 1991, 1991, 2020, 1991, 1991, 1991, 1991, 1991, 1991, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1220,7 +1258,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 310, /* END => ABORT */ + 312, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1290,7 +1328,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 310, /* VIEW => ABORT */ + 312, /* VIEW => ABORT */ 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ @@ -1349,6 +1387,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* SPLIT => nothing */ 0, /* DELETE => nothing */ 0, /* INSERT => nothing */ + 0, /* NK_BIN => nothing */ + 0, /* NK_HEX => nothing */ 0, /* NULL => nothing */ 0, /* NK_QUESTION => nothing */ 0, /* NK_ALIAS => nothing */ @@ -1390,7 +1430,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* LEFT => nothing */ 0, /* RIGHT => nothing */ 0, /* OUTER => nothing */ - 310, /* SEMI => ABORT */ + 312, /* SEMI => ABORT */ 0, /* ANTI => nothing */ 0, /* ASOF => nothing */ 0, /* WINDOW => nothing */ @@ -1426,54 +1466,54 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 310, /* AFTER => ABORT */ - 310, /* ATTACH => ABORT */ - 310, /* BEFORE => ABORT */ - 310, /* BEGIN => ABORT */ - 310, /* BITAND => ABORT */ - 310, /* BITNOT => ABORT */ - 310, /* BITOR => ABORT */ - 310, /* BLOCKS => ABORT */ - 310, /* CHANGE => ABORT */ - 310, /* COMMA => ABORT */ - 310, /* CONCAT => ABORT */ - 310, /* CONFLICT => ABORT */ - 310, /* COPY => ABORT */ - 310, /* DEFERRED => ABORT */ - 310, /* DELIMITERS => ABORT */ - 310, /* DETACH => ABORT */ - 310, /* DIVIDE => ABORT */ - 310, /* DOT => ABORT */ - 310, /* EACH => ABORT */ - 310, /* FAIL => ABORT */ - 310, /* FILE => ABORT */ - 310, /* FOR => ABORT */ - 310, /* GLOB => ABORT */ - 310, /* ID => ABORT */ - 310, /* IMMEDIATE => ABORT */ - 310, /* IMPORT => ABORT */ - 310, /* INITIALLY => ABORT */ - 310, /* INSTEAD => ABORT */ - 310, /* ISNULL => ABORT */ - 310, /* KEY => ABORT */ - 310, /* MODULES => ABORT */ - 310, /* NK_BITNOT => ABORT */ - 310, /* NK_SEMI => ABORT */ - 310, /* NOTNULL => ABORT */ - 310, /* OF => ABORT */ - 310, /* PLUS => ABORT */ - 310, /* PRIVILEGE => ABORT */ - 310, /* RAISE => ABORT */ - 310, /* RESTRICT => ABORT */ - 310, /* ROW => ABORT */ - 310, /* STAR => ABORT */ - 310, /* STATEMENT => ABORT */ - 310, /* STRICT => ABORT */ - 310, /* STRING => ABORT */ - 310, /* TIMES => ABORT */ - 310, /* VALUES => ABORT */ - 310, /* VARIABLE => ABORT */ - 310, /* WAL => ABORT */ + 312, /* AFTER => ABORT */ + 312, /* ATTACH => ABORT */ + 312, /* BEFORE => ABORT */ + 312, /* BEGIN => ABORT */ + 312, /* BITAND => ABORT */ + 312, /* BITNOT => ABORT */ + 312, /* BITOR => ABORT */ + 312, /* BLOCKS => ABORT */ + 312, /* CHANGE => ABORT */ + 312, /* COMMA => ABORT */ + 312, /* CONCAT => ABORT */ + 312, /* CONFLICT => ABORT */ + 312, /* COPY => ABORT */ + 312, /* DEFERRED => ABORT */ + 312, /* DELIMITERS => ABORT */ + 312, /* DETACH => ABORT */ + 312, /* DIVIDE => ABORT */ + 312, /* DOT => ABORT */ + 312, /* EACH => ABORT */ + 312, /* FAIL => ABORT */ + 312, /* FILE => ABORT */ + 312, /* FOR => ABORT */ + 312, /* GLOB => ABORT */ + 312, /* ID => ABORT */ + 312, /* IMMEDIATE => ABORT */ + 312, /* IMPORT => ABORT */ + 312, /* INITIALLY => ABORT */ + 312, /* INSTEAD => ABORT */ + 312, /* ISNULL => ABORT */ + 312, /* KEY => ABORT */ + 312, /* MODULES => ABORT */ + 312, /* NK_BITNOT => ABORT */ + 312, /* NK_SEMI => ABORT */ + 312, /* NOTNULL => ABORT */ + 312, /* OF => ABORT */ + 312, /* PLUS => ABORT */ + 312, /* PRIVILEGE => ABORT */ + 312, /* RAISE => ABORT */ + 312, /* RESTRICT => ABORT */ + 312, /* ROW => ABORT */ + 312, /* STAR => ABORT */ + 312, /* STATEMENT => ABORT */ + 312, /* STRICT => ABORT */ + 312, /* STRING => ABORT */ + 312, /* TIMES => ABORT */ + 312, /* VALUES => ABORT */ + 312, /* VARIABLE => ABORT */ + 312, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1795,297 +1835,301 @@ static const char *const yyTokenName[] = { /* 231 */ "SPLIT", /* 232 */ "DELETE", /* 233 */ "INSERT", - /* 234 */ "NULL", - /* 235 */ "NK_QUESTION", - /* 236 */ "NK_ALIAS", - /* 237 */ "NK_ARROW", - /* 238 */ "ROWTS", - /* 239 */ "QSTART", - /* 240 */ "QEND", - /* 241 */ "QDURATION", - /* 242 */ "WSTART", - /* 243 */ "WEND", - /* 244 */ "WDURATION", - /* 245 */ "IROWTS", - /* 246 */ "ISFILLED", - /* 247 */ "CAST", - /* 248 */ "NOW", - /* 249 */ "TODAY", - /* 250 */ "TIMEZONE", - /* 251 */ "CLIENT_VERSION", - /* 252 */ "SERVER_VERSION", - /* 253 */ "SERVER_STATUS", - /* 254 */ "CURRENT_USER", - /* 255 */ "CASE", - /* 256 */ "WHEN", - /* 257 */ "THEN", - /* 258 */ "ELSE", - /* 259 */ "BETWEEN", - /* 260 */ "IS", - /* 261 */ "NK_LT", - /* 262 */ "NK_GT", - /* 263 */ "NK_LE", - /* 264 */ "NK_GE", - /* 265 */ "NK_NE", - /* 266 */ "MATCH", - /* 267 */ "NMATCH", - /* 268 */ "CONTAINS", - /* 269 */ "IN", - /* 270 */ "JOIN", - /* 271 */ "INNER", - /* 272 */ "LEFT", - /* 273 */ "RIGHT", - /* 274 */ "OUTER", - /* 275 */ "SEMI", - /* 276 */ "ANTI", - /* 277 */ "ASOF", - /* 278 */ "WINDOW", - /* 279 */ "WINDOW_OFFSET", - /* 280 */ "JLIMIT", - /* 281 */ "SELECT", - /* 282 */ "NK_HINT", - /* 283 */ "DISTINCT", - /* 284 */ "WHERE", - /* 285 */ "PARTITION", - /* 286 */ "BY", - /* 287 */ "SESSION", - /* 288 */ "STATE_WINDOW", - /* 289 */ "EVENT_WINDOW", - /* 290 */ "COUNT_WINDOW", - /* 291 */ "SLIDING", - /* 292 */ "FILL", - /* 293 */ "VALUE", - /* 294 */ "VALUE_F", - /* 295 */ "NONE", - /* 296 */ "PREV", - /* 297 */ "NULL_F", - /* 298 */ "LINEAR", - /* 299 */ "NEXT", - /* 300 */ "HAVING", - /* 301 */ "RANGE", - /* 302 */ "EVERY", - /* 303 */ "ORDER", - /* 304 */ "SLIMIT", - /* 305 */ "SOFFSET", - /* 306 */ "LIMIT", - /* 307 */ "OFFSET", - /* 308 */ "ASC", - /* 309 */ "NULLS", - /* 310 */ "ABORT", - /* 311 */ "AFTER", - /* 312 */ "ATTACH", - /* 313 */ "BEFORE", - /* 314 */ "BEGIN", - /* 315 */ "BITAND", - /* 316 */ "BITNOT", - /* 317 */ "BITOR", - /* 318 */ "BLOCKS", - /* 319 */ "CHANGE", - /* 320 */ "COMMA", - /* 321 */ "CONCAT", - /* 322 */ "CONFLICT", - /* 323 */ "COPY", - /* 324 */ "DEFERRED", - /* 325 */ "DELIMITERS", - /* 326 */ "DETACH", - /* 327 */ "DIVIDE", - /* 328 */ "DOT", - /* 329 */ "EACH", - /* 330 */ "FAIL", - /* 331 */ "FILE", - /* 332 */ "FOR", - /* 333 */ "GLOB", - /* 334 */ "ID", - /* 335 */ "IMMEDIATE", - /* 336 */ "IMPORT", - /* 337 */ "INITIALLY", - /* 338 */ "INSTEAD", - /* 339 */ "ISNULL", - /* 340 */ "KEY", - /* 341 */ "MODULES", - /* 342 */ "NK_BITNOT", - /* 343 */ "NK_SEMI", - /* 344 */ "NOTNULL", - /* 345 */ "OF", - /* 346 */ "PLUS", - /* 347 */ "PRIVILEGE", - /* 348 */ "RAISE", - /* 349 */ "RESTRICT", - /* 350 */ "ROW", - /* 351 */ "STAR", - /* 352 */ "STATEMENT", - /* 353 */ "STRICT", - /* 354 */ "STRING", - /* 355 */ "TIMES", - /* 356 */ "VALUES", - /* 357 */ "VARIABLE", - /* 358 */ "WAL", - /* 359 */ "cmd", - /* 360 */ "account_options", - /* 361 */ "alter_account_options", - /* 362 */ "literal", - /* 363 */ "alter_account_option", - /* 364 */ "ip_range_list", - /* 365 */ "white_list", - /* 366 */ "white_list_opt", - /* 367 */ "user_name", - /* 368 */ "sysinfo_opt", - /* 369 */ "privileges", - /* 370 */ "priv_level", - /* 371 */ "with_opt", - /* 372 */ "priv_type_list", - /* 373 */ "priv_type", - /* 374 */ "db_name", - /* 375 */ "table_name", - /* 376 */ "topic_name", - /* 377 */ "search_condition", - /* 378 */ "dnode_endpoint", - /* 379 */ "force_opt", - /* 380 */ "unsafe_opt", - /* 381 */ "not_exists_opt", - /* 382 */ "db_options", - /* 383 */ "exists_opt", - /* 384 */ "alter_db_options", - /* 385 */ "speed_opt", - /* 386 */ "start_opt", - /* 387 */ "end_opt", - /* 388 */ "integer_list", - /* 389 */ "variable_list", - /* 390 */ "retention_list", - /* 391 */ "signed", - /* 392 */ "alter_db_option", - /* 393 */ "retention", - /* 394 */ "full_table_name", - /* 395 */ "column_def_list", - /* 396 */ "tags_def_opt", - /* 397 */ "table_options", - /* 398 */ "multi_create_clause", - /* 399 */ "tags_def", - /* 400 */ "multi_drop_clause", - /* 401 */ "alter_table_clause", - /* 402 */ "alter_table_options", - /* 403 */ "column_name", - /* 404 */ "type_name", - /* 405 */ "signed_literal", - /* 406 */ "create_subtable_clause", - /* 407 */ "specific_cols_opt", - /* 408 */ "expression_list", - /* 409 */ "drop_table_clause", - /* 410 */ "col_name_list", - /* 411 */ "column_def", - /* 412 */ "duration_list", - /* 413 */ "rollup_func_list", - /* 414 */ "alter_table_option", - /* 415 */ "duration_literal", - /* 416 */ "rollup_func_name", - /* 417 */ "function_name", - /* 418 */ "col_name", - /* 419 */ "db_kind_opt", - /* 420 */ "table_kind_db_name_cond_opt", - /* 421 */ "like_pattern_opt", - /* 422 */ "db_name_cond_opt", - /* 423 */ "table_name_cond", - /* 424 */ "from_db_opt", - /* 425 */ "tag_list_opt", - /* 426 */ "table_kind", - /* 427 */ "tag_item", - /* 428 */ "column_alias", - /* 429 */ "index_options", - /* 430 */ "full_index_name", - /* 431 */ "index_name", - /* 432 */ "func_list", - /* 433 */ "sliding_opt", - /* 434 */ "sma_stream_opt", - /* 435 */ "func", - /* 436 */ "sma_func_name", - /* 437 */ "with_meta", - /* 438 */ "query_or_subquery", - /* 439 */ "where_clause_opt", - /* 440 */ "cgroup_name", - /* 441 */ "analyze_opt", - /* 442 */ "explain_options", - /* 443 */ "insert_query", - /* 444 */ "or_replace_opt", - /* 445 */ "agg_func_opt", - /* 446 */ "bufsize_opt", - /* 447 */ "language_opt", - /* 448 */ "full_view_name", - /* 449 */ "view_name", - /* 450 */ "stream_name", - /* 451 */ "stream_options", - /* 452 */ "col_list_opt", - /* 453 */ "tag_def_or_ref_opt", - /* 454 */ "subtable_opt", - /* 455 */ "ignore_opt", - /* 456 */ "expression", - /* 457 */ "on_vgroup_id", - /* 458 */ "dnode_list", - /* 459 */ "literal_func", - /* 460 */ "literal_list", - /* 461 */ "table_alias", - /* 462 */ "expr_or_subquery", - /* 463 */ "pseudo_column", - /* 464 */ "column_reference", - /* 465 */ "function_expression", - /* 466 */ "case_when_expression", - /* 467 */ "star_func", - /* 468 */ "star_func_para_list", - /* 469 */ "noarg_func", - /* 470 */ "other_para_list", - /* 471 */ "star_func_para", - /* 472 */ "when_then_list", - /* 473 */ "case_when_else_opt", - /* 474 */ "common_expression", - /* 475 */ "when_then_expr", - /* 476 */ "predicate", - /* 477 */ "compare_op", - /* 478 */ "in_op", - /* 479 */ "in_predicate_value", - /* 480 */ "boolean_value_expression", - /* 481 */ "boolean_primary", - /* 482 */ "from_clause_opt", - /* 483 */ "table_reference_list", - /* 484 */ "table_reference", - /* 485 */ "table_primary", - /* 486 */ "joined_table", - /* 487 */ "alias_opt", - /* 488 */ "subquery", - /* 489 */ "parenthesized_joined_table", - /* 490 */ "join_type", - /* 491 */ "join_subtype", - /* 492 */ "join_on_clause_opt", - /* 493 */ "window_offset_clause_opt", - /* 494 */ "jlimit_clause_opt", - /* 495 */ "window_offset_literal", - /* 496 */ "query_specification", - /* 497 */ "hint_list", - /* 498 */ "set_quantifier_opt", - /* 499 */ "tag_mode_opt", - /* 500 */ "select_list", - /* 501 */ "partition_by_clause_opt", - /* 502 */ "range_opt", - /* 503 */ "every_opt", - /* 504 */ "fill_opt", - /* 505 */ "twindow_clause_opt", - /* 506 */ "group_by_clause_opt", - /* 507 */ "having_clause_opt", - /* 508 */ "select_item", - /* 509 */ "partition_list", - /* 510 */ "partition_item", - /* 511 */ "interval_sliding_duration_literal", - /* 512 */ "fill_mode", - /* 513 */ "group_by_list", - /* 514 */ "query_expression", - /* 515 */ "query_simple", - /* 516 */ "order_by_clause_opt", - /* 517 */ "slimit_clause_opt", - /* 518 */ "limit_clause_opt", - /* 519 */ "union_query_expression", - /* 520 */ "query_simple_or_subquery", - /* 521 */ "sort_specification_list", - /* 522 */ "sort_specification", - /* 523 */ "ordering_specification_opt", - /* 524 */ "null_ordering_opt", + /* 234 */ "NK_BIN", + /* 235 */ "NK_HEX", + /* 236 */ "NULL", + /* 237 */ "NK_QUESTION", + /* 238 */ "NK_ALIAS", + /* 239 */ "NK_ARROW", + /* 240 */ "ROWTS", + /* 241 */ "QSTART", + /* 242 */ "QEND", + /* 243 */ "QDURATION", + /* 244 */ "WSTART", + /* 245 */ "WEND", + /* 246 */ "WDURATION", + /* 247 */ "IROWTS", + /* 248 */ "ISFILLED", + /* 249 */ "CAST", + /* 250 */ "NOW", + /* 251 */ "TODAY", + /* 252 */ "TIMEZONE", + /* 253 */ "CLIENT_VERSION", + /* 254 */ "SERVER_VERSION", + /* 255 */ "SERVER_STATUS", + /* 256 */ "CURRENT_USER", + /* 257 */ "CASE", + /* 258 */ "WHEN", + /* 259 */ "THEN", + /* 260 */ "ELSE", + /* 261 */ "BETWEEN", + /* 262 */ "IS", + /* 263 */ "NK_LT", + /* 264 */ "NK_GT", + /* 265 */ "NK_LE", + /* 266 */ "NK_GE", + /* 267 */ "NK_NE", + /* 268 */ "MATCH", + /* 269 */ "NMATCH", + /* 270 */ "CONTAINS", + /* 271 */ "IN", + /* 272 */ "JOIN", + /* 273 */ "INNER", + /* 274 */ "LEFT", + /* 275 */ "RIGHT", + /* 276 */ "OUTER", + /* 277 */ "SEMI", + /* 278 */ "ANTI", + /* 279 */ "ASOF", + /* 280 */ "WINDOW", + /* 281 */ "WINDOW_OFFSET", + /* 282 */ "JLIMIT", + /* 283 */ "SELECT", + /* 284 */ "NK_HINT", + /* 285 */ "DISTINCT", + /* 286 */ "WHERE", + /* 287 */ "PARTITION", + /* 288 */ "BY", + /* 289 */ "SESSION", + /* 290 */ "STATE_WINDOW", + /* 291 */ "EVENT_WINDOW", + /* 292 */ "COUNT_WINDOW", + /* 293 */ "SLIDING", + /* 294 */ "FILL", + /* 295 */ "VALUE", + /* 296 */ "VALUE_F", + /* 297 */ "NONE", + /* 298 */ "PREV", + /* 299 */ "NULL_F", + /* 300 */ "LINEAR", + /* 301 */ "NEXT", + /* 302 */ "HAVING", + /* 303 */ "RANGE", + /* 304 */ "EVERY", + /* 305 */ "ORDER", + /* 306 */ "SLIMIT", + /* 307 */ "SOFFSET", + /* 308 */ "LIMIT", + /* 309 */ "OFFSET", + /* 310 */ "ASC", + /* 311 */ "NULLS", + /* 312 */ "ABORT", + /* 313 */ "AFTER", + /* 314 */ "ATTACH", + /* 315 */ "BEFORE", + /* 316 */ "BEGIN", + /* 317 */ "BITAND", + /* 318 */ "BITNOT", + /* 319 */ "BITOR", + /* 320 */ "BLOCKS", + /* 321 */ "CHANGE", + /* 322 */ "COMMA", + /* 323 */ "CONCAT", + /* 324 */ "CONFLICT", + /* 325 */ "COPY", + /* 326 */ "DEFERRED", + /* 327 */ "DELIMITERS", + /* 328 */ "DETACH", + /* 329 */ "DIVIDE", + /* 330 */ "DOT", + /* 331 */ "EACH", + /* 332 */ "FAIL", + /* 333 */ "FILE", + /* 334 */ "FOR", + /* 335 */ "GLOB", + /* 336 */ "ID", + /* 337 */ "IMMEDIATE", + /* 338 */ "IMPORT", + /* 339 */ "INITIALLY", + /* 340 */ "INSTEAD", + /* 341 */ "ISNULL", + /* 342 */ "KEY", + /* 343 */ "MODULES", + /* 344 */ "NK_BITNOT", + /* 345 */ "NK_SEMI", + /* 346 */ "NOTNULL", + /* 347 */ "OF", + /* 348 */ "PLUS", + /* 349 */ "PRIVILEGE", + /* 350 */ "RAISE", + /* 351 */ "RESTRICT", + /* 352 */ "ROW", + /* 353 */ "STAR", + /* 354 */ "STATEMENT", + /* 355 */ "STRICT", + /* 356 */ "STRING", + /* 357 */ "TIMES", + /* 358 */ "VALUES", + /* 359 */ "VARIABLE", + /* 360 */ "WAL", + /* 361 */ "cmd", + /* 362 */ "account_options", + /* 363 */ "alter_account_options", + /* 364 */ "literal", + /* 365 */ "alter_account_option", + /* 366 */ "ip_range_list", + /* 367 */ "white_list", + /* 368 */ "white_list_opt", + /* 369 */ "user_name", + /* 370 */ "sysinfo_opt", + /* 371 */ "privileges", + /* 372 */ "priv_level", + /* 373 */ "with_opt", + /* 374 */ "priv_type_list", + /* 375 */ "priv_type", + /* 376 */ "db_name", + /* 377 */ "table_name", + /* 378 */ "topic_name", + /* 379 */ "search_condition", + /* 380 */ "dnode_endpoint", + /* 381 */ "force_opt", + /* 382 */ "unsafe_opt", + /* 383 */ "not_exists_opt", + /* 384 */ "db_options", + /* 385 */ "exists_opt", + /* 386 */ "alter_db_options", + /* 387 */ "speed_opt", + /* 388 */ "start_opt", + /* 389 */ "end_opt", + /* 390 */ "integer_list", + /* 391 */ "variable_list", + /* 392 */ "retention_list", + /* 393 */ "signed", + /* 394 */ "alter_db_option", + /* 395 */ "retention", + /* 396 */ "full_table_name", + /* 397 */ "column_def_list", + /* 398 */ "tags_def_opt", + /* 399 */ "table_options", + /* 400 */ "multi_create_clause", + /* 401 */ "tags_def", + /* 402 */ "multi_drop_clause", + /* 403 */ "alter_table_clause", + /* 404 */ "alter_table_options", + /* 405 */ "column_name", + /* 406 */ "type_name", + /* 407 */ "tags_literal", + /* 408 */ "create_subtable_clause", + /* 409 */ "specific_cols_opt", + /* 410 */ "tags_literal_list", + /* 411 */ "drop_table_clause", + /* 412 */ "col_name_list", + /* 413 */ "column_def", + /* 414 */ "duration_list", + /* 415 */ "rollup_func_list", + /* 416 */ "alter_table_option", + /* 417 */ "duration_literal", + /* 418 */ "rollup_func_name", + /* 419 */ "function_name", + /* 420 */ "col_name", + /* 421 */ "db_kind_opt", + /* 422 */ "table_kind_db_name_cond_opt", + /* 423 */ "like_pattern_opt", + /* 424 */ "db_name_cond_opt", + /* 425 */ "table_name_cond", + /* 426 */ "from_db_opt", + /* 427 */ "tag_list_opt", + /* 428 */ "table_kind", + /* 429 */ "tag_item", + /* 430 */ "column_alias", + /* 431 */ "index_options", + /* 432 */ "full_index_name", + /* 433 */ "index_name", + /* 434 */ "func_list", + /* 435 */ "sliding_opt", + /* 436 */ "sma_stream_opt", + /* 437 */ "func", + /* 438 */ "sma_func_name", + /* 439 */ "expression_list", + /* 440 */ "with_meta", + /* 441 */ "query_or_subquery", + /* 442 */ "where_clause_opt", + /* 443 */ "cgroup_name", + /* 444 */ "analyze_opt", + /* 445 */ "explain_options", + /* 446 */ "insert_query", + /* 447 */ "or_replace_opt", + /* 448 */ "agg_func_opt", + /* 449 */ "bufsize_opt", + /* 450 */ "language_opt", + /* 451 */ "full_view_name", + /* 452 */ "view_name", + /* 453 */ "stream_name", + /* 454 */ "stream_options", + /* 455 */ "col_list_opt", + /* 456 */ "tag_def_or_ref_opt", + /* 457 */ "subtable_opt", + /* 458 */ "ignore_opt", + /* 459 */ "expression", + /* 460 */ "on_vgroup_id", + /* 461 */ "dnode_list", + /* 462 */ "literal_func", + /* 463 */ "signed_literal", + /* 464 */ "literal_list", + /* 465 */ "table_alias", + /* 466 */ "expr_or_subquery", + /* 467 */ "pseudo_column", + /* 468 */ "column_reference", + /* 469 */ "function_expression", + /* 470 */ "case_when_expression", + /* 471 */ "star_func", + /* 472 */ "star_func_para_list", + /* 473 */ "noarg_func", + /* 474 */ "other_para_list", + /* 475 */ "star_func_para", + /* 476 */ "when_then_list", + /* 477 */ "case_when_else_opt", + /* 478 */ "common_expression", + /* 479 */ "when_then_expr", + /* 480 */ "predicate", + /* 481 */ "compare_op", + /* 482 */ "in_op", + /* 483 */ "in_predicate_value", + /* 484 */ "boolean_value_expression", + /* 485 */ "boolean_primary", + /* 486 */ "from_clause_opt", + /* 487 */ "table_reference_list", + /* 488 */ "table_reference", + /* 489 */ "table_primary", + /* 490 */ "joined_table", + /* 491 */ "alias_opt", + /* 492 */ "subquery", + /* 493 */ "parenthesized_joined_table", + /* 494 */ "join_type", + /* 495 */ "join_subtype", + /* 496 */ "join_on_clause_opt", + /* 497 */ "window_offset_clause_opt", + /* 498 */ "jlimit_clause_opt", + /* 499 */ "window_offset_literal", + /* 500 */ "query_specification", + /* 501 */ "hint_list", + /* 502 */ "set_quantifier_opt", + /* 503 */ "tag_mode_opt", + /* 504 */ "select_list", + /* 505 */ "partition_by_clause_opt", + /* 506 */ "range_opt", + /* 507 */ "every_opt", + /* 508 */ "fill_opt", + /* 509 */ "twindow_clause_opt", + /* 510 */ "group_by_clause_opt", + /* 511 */ "having_clause_opt", + /* 512 */ "select_item", + /* 513 */ "partition_list", + /* 514 */ "partition_item", + /* 515 */ "interval_sliding_duration_literal", + /* 516 */ "fill_mode", + /* 517 */ "group_by_list", + /* 518 */ "query_expression", + /* 519 */ "query_simple", + /* 520 */ "order_by_clause_opt", + /* 521 */ "slimit_clause_opt", + /* 522 */ "limit_clause_opt", + /* 523 */ "union_query_expression", + /* 524 */ "query_simple_or_subquery", + /* 525 */ "sort_specification_list", + /* 526 */ "sort_specification", + /* 527 */ "ordering_specification_opt", + /* 528 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2274,10 +2318,10 @@ static const char *const yyRuleName[] = { /* 178 */ "alter_table_clause ::= full_table_name DROP TAG column_name", /* 179 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", /* 180 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 181 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", + /* 181 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", /* 182 */ "multi_create_clause ::= create_subtable_clause", /* 183 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 184 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", + /* 184 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options", /* 185 */ "multi_drop_clause ::= drop_table_clause", /* 186 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", /* 187 */ "drop_table_clause ::= exists_opt full_table_name", @@ -2502,263 +2546,284 @@ static const char *const yyRuleName[] = { /* 406 */ "cmd ::= insert_query", /* 407 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", /* 408 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 409 */ "literal ::= NK_INTEGER", - /* 410 */ "literal ::= NK_FLOAT", - /* 411 */ "literal ::= NK_STRING", - /* 412 */ "literal ::= NK_BOOL", - /* 413 */ "literal ::= TIMESTAMP NK_STRING", - /* 414 */ "literal ::= duration_literal", - /* 415 */ "literal ::= NULL", - /* 416 */ "literal ::= NK_QUESTION", - /* 417 */ "duration_literal ::= NK_VARIABLE", - /* 418 */ "signed ::= NK_INTEGER", - /* 419 */ "signed ::= NK_PLUS NK_INTEGER", - /* 420 */ "signed ::= NK_MINUS NK_INTEGER", - /* 421 */ "signed ::= NK_FLOAT", - /* 422 */ "signed ::= NK_PLUS NK_FLOAT", - /* 423 */ "signed ::= NK_MINUS NK_FLOAT", - /* 424 */ "signed_literal ::= signed", - /* 425 */ "signed_literal ::= NK_STRING", - /* 426 */ "signed_literal ::= NK_BOOL", - /* 427 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 428 */ "signed_literal ::= duration_literal", - /* 429 */ "signed_literal ::= NULL", - /* 430 */ "signed_literal ::= literal_func", - /* 431 */ "signed_literal ::= NK_QUESTION", - /* 432 */ "literal_list ::= signed_literal", - /* 433 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 434 */ "db_name ::= NK_ID", - /* 435 */ "table_name ::= NK_ID", - /* 436 */ "column_name ::= NK_ID", - /* 437 */ "function_name ::= NK_ID", - /* 438 */ "view_name ::= NK_ID", - /* 439 */ "table_alias ::= NK_ID", - /* 440 */ "column_alias ::= NK_ID", - /* 441 */ "column_alias ::= NK_ALIAS", - /* 442 */ "user_name ::= NK_ID", - /* 443 */ "topic_name ::= NK_ID", - /* 444 */ "stream_name ::= NK_ID", - /* 445 */ "cgroup_name ::= NK_ID", - /* 446 */ "index_name ::= NK_ID", - /* 447 */ "expr_or_subquery ::= expression", - /* 448 */ "expression ::= literal", - /* 449 */ "expression ::= pseudo_column", - /* 450 */ "expression ::= column_reference", - /* 451 */ "expression ::= function_expression", - /* 452 */ "expression ::= case_when_expression", - /* 453 */ "expression ::= NK_LP expression NK_RP", - /* 454 */ "expression ::= NK_PLUS expr_or_subquery", - /* 455 */ "expression ::= NK_MINUS expr_or_subquery", - /* 456 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 457 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 458 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 459 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 460 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 461 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 462 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 463 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 464 */ "expression_list ::= expr_or_subquery", - /* 465 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 466 */ "column_reference ::= column_name", - /* 467 */ "column_reference ::= table_name NK_DOT column_name", - /* 468 */ "column_reference ::= NK_ALIAS", - /* 469 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 470 */ "pseudo_column ::= ROWTS", - /* 471 */ "pseudo_column ::= TBNAME", - /* 472 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 473 */ "pseudo_column ::= QSTART", - /* 474 */ "pseudo_column ::= QEND", - /* 475 */ "pseudo_column ::= QDURATION", - /* 476 */ "pseudo_column ::= WSTART", - /* 477 */ "pseudo_column ::= WEND", - /* 478 */ "pseudo_column ::= WDURATION", - /* 479 */ "pseudo_column ::= IROWTS", - /* 480 */ "pseudo_column ::= ISFILLED", - /* 481 */ "pseudo_column ::= QTAGS", - /* 482 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 483 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 484 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 485 */ "function_expression ::= literal_func", - /* 486 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 487 */ "literal_func ::= NOW", - /* 488 */ "noarg_func ::= NOW", - /* 489 */ "noarg_func ::= TODAY", - /* 490 */ "noarg_func ::= TIMEZONE", - /* 491 */ "noarg_func ::= DATABASE", - /* 492 */ "noarg_func ::= CLIENT_VERSION", - /* 493 */ "noarg_func ::= SERVER_VERSION", - /* 494 */ "noarg_func ::= SERVER_STATUS", - /* 495 */ "noarg_func ::= CURRENT_USER", - /* 496 */ "noarg_func ::= USER", - /* 497 */ "star_func ::= COUNT", - /* 498 */ "star_func ::= FIRST", - /* 499 */ "star_func ::= LAST", - /* 500 */ "star_func ::= LAST_ROW", - /* 501 */ "star_func_para_list ::= NK_STAR", - /* 502 */ "star_func_para_list ::= other_para_list", - /* 503 */ "other_para_list ::= star_func_para", - /* 504 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 505 */ "star_func_para ::= expr_or_subquery", - /* 506 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 507 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 508 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 509 */ "when_then_list ::= when_then_expr", - /* 510 */ "when_then_list ::= when_then_list when_then_expr", - /* 511 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 512 */ "case_when_else_opt ::=", - /* 513 */ "case_when_else_opt ::= ELSE common_expression", - /* 514 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 515 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 516 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 517 */ "predicate ::= expr_or_subquery IS NULL", - /* 518 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 519 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 520 */ "compare_op ::= NK_LT", - /* 521 */ "compare_op ::= NK_GT", - /* 522 */ "compare_op ::= NK_LE", - /* 523 */ "compare_op ::= NK_GE", - /* 524 */ "compare_op ::= NK_NE", - /* 525 */ "compare_op ::= NK_EQ", - /* 526 */ "compare_op ::= LIKE", - /* 527 */ "compare_op ::= NOT LIKE", - /* 528 */ "compare_op ::= MATCH", - /* 529 */ "compare_op ::= NMATCH", - /* 530 */ "compare_op ::= CONTAINS", - /* 531 */ "in_op ::= IN", - /* 532 */ "in_op ::= NOT IN", - /* 533 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 534 */ "boolean_value_expression ::= boolean_primary", - /* 535 */ "boolean_value_expression ::= NOT boolean_primary", - /* 536 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 537 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 538 */ "boolean_primary ::= predicate", - /* 539 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 540 */ "common_expression ::= expr_or_subquery", - /* 541 */ "common_expression ::= boolean_value_expression", - /* 542 */ "from_clause_opt ::=", - /* 543 */ "from_clause_opt ::= FROM table_reference_list", - /* 544 */ "table_reference_list ::= table_reference", - /* 545 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 546 */ "table_reference ::= table_primary", - /* 547 */ "table_reference ::= joined_table", - /* 548 */ "table_primary ::= table_name alias_opt", - /* 549 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 550 */ "table_primary ::= subquery alias_opt", - /* 551 */ "table_primary ::= parenthesized_joined_table", - /* 552 */ "alias_opt ::=", - /* 553 */ "alias_opt ::= table_alias", - /* 554 */ "alias_opt ::= AS table_alias", - /* 555 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 556 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 557 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", - /* 558 */ "join_type ::=", - /* 559 */ "join_type ::= INNER", - /* 560 */ "join_type ::= LEFT", - /* 561 */ "join_type ::= RIGHT", - /* 562 */ "join_type ::= FULL", - /* 563 */ "join_subtype ::=", - /* 564 */ "join_subtype ::= OUTER", - /* 565 */ "join_subtype ::= SEMI", - /* 566 */ "join_subtype ::= ANTI", - /* 567 */ "join_subtype ::= ASOF", - /* 568 */ "join_subtype ::= WINDOW", - /* 569 */ "join_on_clause_opt ::=", - /* 570 */ "join_on_clause_opt ::= ON search_condition", - /* 571 */ "window_offset_clause_opt ::=", - /* 572 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", - /* 573 */ "window_offset_literal ::= NK_VARIABLE", - /* 574 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", - /* 575 */ "jlimit_clause_opt ::=", - /* 576 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", - /* 577 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 578 */ "hint_list ::=", - /* 579 */ "hint_list ::= NK_HINT", - /* 580 */ "tag_mode_opt ::=", - /* 581 */ "tag_mode_opt ::= TAGS", - /* 582 */ "set_quantifier_opt ::=", - /* 583 */ "set_quantifier_opt ::= DISTINCT", - /* 584 */ "set_quantifier_opt ::= ALL", - /* 585 */ "select_list ::= select_item", - /* 586 */ "select_list ::= select_list NK_COMMA select_item", - /* 587 */ "select_item ::= NK_STAR", - /* 588 */ "select_item ::= common_expression", - /* 589 */ "select_item ::= common_expression column_alias", - /* 590 */ "select_item ::= common_expression AS column_alias", - /* 591 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 592 */ "where_clause_opt ::=", - /* 593 */ "where_clause_opt ::= WHERE search_condition", - /* 594 */ "partition_by_clause_opt ::=", - /* 595 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 596 */ "partition_list ::= partition_item", - /* 597 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 598 */ "partition_item ::= expr_or_subquery", - /* 599 */ "partition_item ::= expr_or_subquery column_alias", - /* 600 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 601 */ "twindow_clause_opt ::=", - /* 602 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 603 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 604 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 605 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 606 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 607 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 608 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 609 */ "sliding_opt ::=", - /* 610 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 611 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 612 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 613 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 614 */ "fill_opt ::=", - /* 615 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 616 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 617 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 618 */ "fill_mode ::= NONE", - /* 619 */ "fill_mode ::= PREV", - /* 620 */ "fill_mode ::= NULL", - /* 621 */ "fill_mode ::= NULL_F", - /* 622 */ "fill_mode ::= LINEAR", - /* 623 */ "fill_mode ::= NEXT", - /* 624 */ "group_by_clause_opt ::=", - /* 625 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 626 */ "group_by_list ::= expr_or_subquery", - /* 627 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 628 */ "having_clause_opt ::=", - /* 629 */ "having_clause_opt ::= HAVING search_condition", - /* 630 */ "range_opt ::=", - /* 631 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 632 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 633 */ "every_opt ::=", - /* 634 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 635 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 636 */ "query_simple ::= query_specification", - /* 637 */ "query_simple ::= union_query_expression", - /* 638 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 639 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 640 */ "query_simple_or_subquery ::= query_simple", - /* 641 */ "query_simple_or_subquery ::= subquery", - /* 642 */ "query_or_subquery ::= query_expression", - /* 643 */ "query_or_subquery ::= subquery", - /* 644 */ "order_by_clause_opt ::=", - /* 645 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 646 */ "slimit_clause_opt ::=", - /* 647 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 648 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 649 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 650 */ "limit_clause_opt ::=", - /* 651 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 652 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 653 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 654 */ "subquery ::= NK_LP query_expression NK_RP", - /* 655 */ "subquery ::= NK_LP subquery NK_RP", - /* 656 */ "search_condition ::= common_expression", - /* 657 */ "sort_specification_list ::= sort_specification", - /* 658 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 659 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 660 */ "ordering_specification_opt ::=", - /* 661 */ "ordering_specification_opt ::= ASC", - /* 662 */ "ordering_specification_opt ::= DESC", - /* 663 */ "null_ordering_opt ::=", - /* 664 */ "null_ordering_opt ::= NULLS FIRST", - /* 665 */ "null_ordering_opt ::= NULLS LAST", + /* 409 */ "tags_literal ::= NK_INTEGER", + /* 410 */ "tags_literal ::= NK_PLUS NK_INTEGER", + /* 411 */ "tags_literal ::= NK_MINUS NK_INTEGER", + /* 412 */ "tags_literal ::= NK_FLOAT", + /* 413 */ "tags_literal ::= NK_PLUS NK_FLOAT", + /* 414 */ "tags_literal ::= NK_MINUS NK_FLOAT", + /* 415 */ "tags_literal ::= NK_BIN", + /* 416 */ "tags_literal ::= NK_PLUS NK_BIN", + /* 417 */ "tags_literal ::= NK_MINUS NK_BIN", + /* 418 */ "tags_literal ::= NK_HEX", + /* 419 */ "tags_literal ::= NK_PLUS NK_HEX", + /* 420 */ "tags_literal ::= NK_MINUS NK_HEX", + /* 421 */ "tags_literal ::= NK_STRING", + /* 422 */ "tags_literal ::= NK_BOOL", + /* 423 */ "tags_literal ::= NULL", + /* 424 */ "tags_literal ::= literal_func", + /* 425 */ "tags_literal ::= literal_func NK_PLUS duration_literal", + /* 426 */ "tags_literal ::= literal_func NK_MINUS duration_literal", + /* 427 */ "tags_literal_list ::= tags_literal", + /* 428 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", + /* 429 */ "literal ::= NK_INTEGER", + /* 430 */ "literal ::= NK_FLOAT", + /* 431 */ "literal ::= NK_STRING", + /* 432 */ "literal ::= NK_BOOL", + /* 433 */ "literal ::= TIMESTAMP NK_STRING", + /* 434 */ "literal ::= duration_literal", + /* 435 */ "literal ::= NULL", + /* 436 */ "literal ::= NK_QUESTION", + /* 437 */ "duration_literal ::= NK_VARIABLE", + /* 438 */ "signed ::= NK_INTEGER", + /* 439 */ "signed ::= NK_PLUS NK_INTEGER", + /* 440 */ "signed ::= NK_MINUS NK_INTEGER", + /* 441 */ "signed ::= NK_FLOAT", + /* 442 */ "signed ::= NK_PLUS NK_FLOAT", + /* 443 */ "signed ::= NK_MINUS NK_FLOAT", + /* 444 */ "signed_literal ::= signed", + /* 445 */ "signed_literal ::= NK_STRING", + /* 446 */ "signed_literal ::= NK_BOOL", + /* 447 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 448 */ "signed_literal ::= duration_literal", + /* 449 */ "signed_literal ::= NULL", + /* 450 */ "signed_literal ::= literal_func", + /* 451 */ "signed_literal ::= NK_QUESTION", + /* 452 */ "literal_list ::= signed_literal", + /* 453 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 454 */ "db_name ::= NK_ID", + /* 455 */ "table_name ::= NK_ID", + /* 456 */ "column_name ::= NK_ID", + /* 457 */ "function_name ::= NK_ID", + /* 458 */ "view_name ::= NK_ID", + /* 459 */ "table_alias ::= NK_ID", + /* 460 */ "column_alias ::= NK_ID", + /* 461 */ "column_alias ::= NK_ALIAS", + /* 462 */ "user_name ::= NK_ID", + /* 463 */ "topic_name ::= NK_ID", + /* 464 */ "stream_name ::= NK_ID", + /* 465 */ "cgroup_name ::= NK_ID", + /* 466 */ "index_name ::= NK_ID", + /* 467 */ "expr_or_subquery ::= expression", + /* 468 */ "expression ::= literal", + /* 469 */ "expression ::= pseudo_column", + /* 470 */ "expression ::= column_reference", + /* 471 */ "expression ::= function_expression", + /* 472 */ "expression ::= case_when_expression", + /* 473 */ "expression ::= NK_LP expression NK_RP", + /* 474 */ "expression ::= NK_PLUS expr_or_subquery", + /* 475 */ "expression ::= NK_MINUS expr_or_subquery", + /* 476 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 477 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 478 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 479 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 480 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 481 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 482 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 483 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 484 */ "expression_list ::= expr_or_subquery", + /* 485 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 486 */ "column_reference ::= column_name", + /* 487 */ "column_reference ::= table_name NK_DOT column_name", + /* 488 */ "column_reference ::= NK_ALIAS", + /* 489 */ "column_reference ::= table_name NK_DOT NK_ALIAS", + /* 490 */ "pseudo_column ::= ROWTS", + /* 491 */ "pseudo_column ::= TBNAME", + /* 492 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 493 */ "pseudo_column ::= QSTART", + /* 494 */ "pseudo_column ::= QEND", + /* 495 */ "pseudo_column ::= QDURATION", + /* 496 */ "pseudo_column ::= WSTART", + /* 497 */ "pseudo_column ::= WEND", + /* 498 */ "pseudo_column ::= WDURATION", + /* 499 */ "pseudo_column ::= IROWTS", + /* 500 */ "pseudo_column ::= ISFILLED", + /* 501 */ "pseudo_column ::= QTAGS", + /* 502 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 503 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 504 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 505 */ "function_expression ::= literal_func", + /* 506 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 507 */ "literal_func ::= NOW", + /* 508 */ "literal_func ::= TODAY", + /* 509 */ "noarg_func ::= NOW", + /* 510 */ "noarg_func ::= TODAY", + /* 511 */ "noarg_func ::= TIMEZONE", + /* 512 */ "noarg_func ::= DATABASE", + /* 513 */ "noarg_func ::= CLIENT_VERSION", + /* 514 */ "noarg_func ::= SERVER_VERSION", + /* 515 */ "noarg_func ::= SERVER_STATUS", + /* 516 */ "noarg_func ::= CURRENT_USER", + /* 517 */ "noarg_func ::= USER", + /* 518 */ "star_func ::= COUNT", + /* 519 */ "star_func ::= FIRST", + /* 520 */ "star_func ::= LAST", + /* 521 */ "star_func ::= LAST_ROW", + /* 522 */ "star_func_para_list ::= NK_STAR", + /* 523 */ "star_func_para_list ::= other_para_list", + /* 524 */ "other_para_list ::= star_func_para", + /* 525 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 526 */ "star_func_para ::= expr_or_subquery", + /* 527 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 528 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 529 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 530 */ "when_then_list ::= when_then_expr", + /* 531 */ "when_then_list ::= when_then_list when_then_expr", + /* 532 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 533 */ "case_when_else_opt ::=", + /* 534 */ "case_when_else_opt ::= ELSE common_expression", + /* 535 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 536 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 537 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 538 */ "predicate ::= expr_or_subquery IS NULL", + /* 539 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 540 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 541 */ "compare_op ::= NK_LT", + /* 542 */ "compare_op ::= NK_GT", + /* 543 */ "compare_op ::= NK_LE", + /* 544 */ "compare_op ::= NK_GE", + /* 545 */ "compare_op ::= NK_NE", + /* 546 */ "compare_op ::= NK_EQ", + /* 547 */ "compare_op ::= LIKE", + /* 548 */ "compare_op ::= NOT LIKE", + /* 549 */ "compare_op ::= MATCH", + /* 550 */ "compare_op ::= NMATCH", + /* 551 */ "compare_op ::= CONTAINS", + /* 552 */ "in_op ::= IN", + /* 553 */ "in_op ::= NOT IN", + /* 554 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 555 */ "boolean_value_expression ::= boolean_primary", + /* 556 */ "boolean_value_expression ::= NOT boolean_primary", + /* 557 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 558 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 559 */ "boolean_primary ::= predicate", + /* 560 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 561 */ "common_expression ::= expr_or_subquery", + /* 562 */ "common_expression ::= boolean_value_expression", + /* 563 */ "from_clause_opt ::=", + /* 564 */ "from_clause_opt ::= FROM table_reference_list", + /* 565 */ "table_reference_list ::= table_reference", + /* 566 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 567 */ "table_reference ::= table_primary", + /* 568 */ "table_reference ::= joined_table", + /* 569 */ "table_primary ::= table_name alias_opt", + /* 570 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 571 */ "table_primary ::= subquery alias_opt", + /* 572 */ "table_primary ::= parenthesized_joined_table", + /* 573 */ "alias_opt ::=", + /* 574 */ "alias_opt ::= table_alias", + /* 575 */ "alias_opt ::= AS table_alias", + /* 576 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 577 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 578 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", + /* 579 */ "join_type ::=", + /* 580 */ "join_type ::= INNER", + /* 581 */ "join_type ::= LEFT", + /* 582 */ "join_type ::= RIGHT", + /* 583 */ "join_type ::= FULL", + /* 584 */ "join_subtype ::=", + /* 585 */ "join_subtype ::= OUTER", + /* 586 */ "join_subtype ::= SEMI", + /* 587 */ "join_subtype ::= ANTI", + /* 588 */ "join_subtype ::= ASOF", + /* 589 */ "join_subtype ::= WINDOW", + /* 590 */ "join_on_clause_opt ::=", + /* 591 */ "join_on_clause_opt ::= ON search_condition", + /* 592 */ "window_offset_clause_opt ::=", + /* 593 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", + /* 594 */ "window_offset_literal ::= NK_VARIABLE", + /* 595 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", + /* 596 */ "jlimit_clause_opt ::=", + /* 597 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", + /* 598 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 599 */ "hint_list ::=", + /* 600 */ "hint_list ::= NK_HINT", + /* 601 */ "tag_mode_opt ::=", + /* 602 */ "tag_mode_opt ::= TAGS", + /* 603 */ "set_quantifier_opt ::=", + /* 604 */ "set_quantifier_opt ::= DISTINCT", + /* 605 */ "set_quantifier_opt ::= ALL", + /* 606 */ "select_list ::= select_item", + /* 607 */ "select_list ::= select_list NK_COMMA select_item", + /* 608 */ "select_item ::= NK_STAR", + /* 609 */ "select_item ::= common_expression", + /* 610 */ "select_item ::= common_expression column_alias", + /* 611 */ "select_item ::= common_expression AS column_alias", + /* 612 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 613 */ "where_clause_opt ::=", + /* 614 */ "where_clause_opt ::= WHERE search_condition", + /* 615 */ "partition_by_clause_opt ::=", + /* 616 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 617 */ "partition_list ::= partition_item", + /* 618 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 619 */ "partition_item ::= expr_or_subquery", + /* 620 */ "partition_item ::= expr_or_subquery column_alias", + /* 621 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 622 */ "twindow_clause_opt ::=", + /* 623 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 624 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 625 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 626 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 627 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 628 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 629 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 630 */ "sliding_opt ::=", + /* 631 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 632 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 633 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 634 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 635 */ "fill_opt ::=", + /* 636 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 637 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 638 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 639 */ "fill_mode ::= NONE", + /* 640 */ "fill_mode ::= PREV", + /* 641 */ "fill_mode ::= NULL", + /* 642 */ "fill_mode ::= NULL_F", + /* 643 */ "fill_mode ::= LINEAR", + /* 644 */ "fill_mode ::= NEXT", + /* 645 */ "group_by_clause_opt ::=", + /* 646 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 647 */ "group_by_list ::= expr_or_subquery", + /* 648 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 649 */ "having_clause_opt ::=", + /* 650 */ "having_clause_opt ::= HAVING search_condition", + /* 651 */ "range_opt ::=", + /* 652 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 653 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 654 */ "every_opt ::=", + /* 655 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 656 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 657 */ "query_simple ::= query_specification", + /* 658 */ "query_simple ::= union_query_expression", + /* 659 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 660 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 661 */ "query_simple_or_subquery ::= query_simple", + /* 662 */ "query_simple_or_subquery ::= subquery", + /* 663 */ "query_or_subquery ::= query_expression", + /* 664 */ "query_or_subquery ::= subquery", + /* 665 */ "order_by_clause_opt ::=", + /* 666 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 667 */ "slimit_clause_opt ::=", + /* 668 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 669 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 670 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 671 */ "limit_clause_opt ::=", + /* 672 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 673 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 674 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 675 */ "subquery ::= NK_LP query_expression NK_RP", + /* 676 */ "subquery ::= NK_LP subquery NK_RP", + /* 677 */ "search_condition ::= common_expression", + /* 678 */ "sort_specification_list ::= sort_specification", + /* 679 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 680 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 681 */ "ordering_specification_opt ::=", + /* 682 */ "ordering_specification_opt ::= ASC", + /* 683 */ "ordering_specification_opt ::= DESC", + /* 684 */ "null_ordering_opt ::=", + /* 685 */ "null_ordering_opt ::= NULLS FIRST", + /* 686 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2885,240 +2950,242 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 359: /* cmd */ - case 362: /* literal */ - case 371: /* with_opt */ - case 377: /* search_condition */ - case 382: /* db_options */ - case 384: /* alter_db_options */ - case 386: /* start_opt */ - case 387: /* end_opt */ - case 391: /* signed */ - case 393: /* retention */ - case 394: /* full_table_name */ - case 397: /* table_options */ - case 401: /* alter_table_clause */ - case 402: /* alter_table_options */ - case 405: /* signed_literal */ - case 406: /* create_subtable_clause */ - case 409: /* drop_table_clause */ - case 411: /* column_def */ - case 415: /* duration_literal */ - case 416: /* rollup_func_name */ - case 418: /* col_name */ - case 421: /* like_pattern_opt */ - case 422: /* db_name_cond_opt */ - case 423: /* table_name_cond */ - case 424: /* from_db_opt */ - case 427: /* tag_item */ - case 429: /* index_options */ - case 430: /* full_index_name */ - case 433: /* sliding_opt */ - case 434: /* sma_stream_opt */ - case 435: /* func */ - case 438: /* query_or_subquery */ - case 439: /* where_clause_opt */ - case 442: /* explain_options */ - case 443: /* insert_query */ - case 448: /* full_view_name */ - case 451: /* stream_options */ - case 454: /* subtable_opt */ - case 456: /* expression */ - case 459: /* literal_func */ - case 462: /* expr_or_subquery */ - case 463: /* pseudo_column */ - case 464: /* column_reference */ - case 465: /* function_expression */ - case 466: /* case_when_expression */ - case 471: /* star_func_para */ - case 473: /* case_when_else_opt */ - case 474: /* common_expression */ - case 475: /* when_then_expr */ - case 476: /* predicate */ - case 479: /* in_predicate_value */ - case 480: /* boolean_value_expression */ - case 481: /* boolean_primary */ - case 482: /* from_clause_opt */ - case 483: /* table_reference_list */ - case 484: /* table_reference */ - case 485: /* table_primary */ - case 486: /* joined_table */ - case 488: /* subquery */ - case 489: /* parenthesized_joined_table */ - case 492: /* join_on_clause_opt */ - case 493: /* window_offset_clause_opt */ - case 494: /* jlimit_clause_opt */ - case 495: /* window_offset_literal */ - case 496: /* query_specification */ - case 502: /* range_opt */ - case 503: /* every_opt */ - case 504: /* fill_opt */ - case 505: /* twindow_clause_opt */ - case 507: /* having_clause_opt */ - case 508: /* select_item */ - case 510: /* partition_item */ - case 511: /* interval_sliding_duration_literal */ - case 514: /* query_expression */ - case 515: /* query_simple */ - case 517: /* slimit_clause_opt */ - case 518: /* limit_clause_opt */ - case 519: /* union_query_expression */ - case 520: /* query_simple_or_subquery */ - case 522: /* sort_specification */ + case 361: /* cmd */ + case 364: /* literal */ + case 373: /* with_opt */ + case 379: /* search_condition */ + case 384: /* db_options */ + case 386: /* alter_db_options */ + case 388: /* start_opt */ + case 389: /* end_opt */ + case 393: /* signed */ + case 395: /* retention */ + case 396: /* full_table_name */ + case 399: /* table_options */ + case 403: /* alter_table_clause */ + case 404: /* alter_table_options */ + case 407: /* tags_literal */ + case 408: /* create_subtable_clause */ + case 411: /* drop_table_clause */ + case 413: /* column_def */ + case 417: /* duration_literal */ + case 418: /* rollup_func_name */ + case 420: /* col_name */ + case 423: /* like_pattern_opt */ + case 424: /* db_name_cond_opt */ + case 425: /* table_name_cond */ + case 426: /* from_db_opt */ + case 429: /* tag_item */ + case 431: /* index_options */ + case 432: /* full_index_name */ + case 435: /* sliding_opt */ + case 436: /* sma_stream_opt */ + case 437: /* func */ + case 441: /* query_or_subquery */ + case 442: /* where_clause_opt */ + case 445: /* explain_options */ + case 446: /* insert_query */ + case 451: /* full_view_name */ + case 454: /* stream_options */ + case 457: /* subtable_opt */ + case 459: /* expression */ + case 462: /* literal_func */ + case 463: /* signed_literal */ + case 466: /* expr_or_subquery */ + case 467: /* pseudo_column */ + case 468: /* column_reference */ + case 469: /* function_expression */ + case 470: /* case_when_expression */ + case 475: /* star_func_para */ + case 477: /* case_when_else_opt */ + case 478: /* common_expression */ + case 479: /* when_then_expr */ + case 480: /* predicate */ + case 483: /* in_predicate_value */ + case 484: /* boolean_value_expression */ + case 485: /* boolean_primary */ + case 486: /* from_clause_opt */ + case 487: /* table_reference_list */ + case 488: /* table_reference */ + case 489: /* table_primary */ + case 490: /* joined_table */ + case 492: /* subquery */ + case 493: /* parenthesized_joined_table */ + case 496: /* join_on_clause_opt */ + case 497: /* window_offset_clause_opt */ + case 498: /* jlimit_clause_opt */ + case 499: /* window_offset_literal */ + case 500: /* query_specification */ + case 506: /* range_opt */ + case 507: /* every_opt */ + case 508: /* fill_opt */ + case 509: /* twindow_clause_opt */ + case 511: /* having_clause_opt */ + case 512: /* select_item */ + case 514: /* partition_item */ + case 515: /* interval_sliding_duration_literal */ + case 518: /* query_expression */ + case 519: /* query_simple */ + case 521: /* slimit_clause_opt */ + case 522: /* limit_clause_opt */ + case 523: /* union_query_expression */ + case 524: /* query_simple_or_subquery */ + case 526: /* sort_specification */ { - nodesDestroyNode((yypminor->yy812)); + nodesDestroyNode((yypminor->yy614)); } break; - case 360: /* account_options */ - case 361: /* alter_account_options */ - case 363: /* alter_account_option */ - case 385: /* speed_opt */ - case 437: /* with_meta */ - case 446: /* bufsize_opt */ + case 362: /* account_options */ + case 363: /* alter_account_options */ + case 365: /* alter_account_option */ + case 387: /* speed_opt */ + case 440: /* with_meta */ + case 449: /* bufsize_opt */ { } break; - case 364: /* ip_range_list */ - case 365: /* white_list */ - case 366: /* white_list_opt */ - case 388: /* integer_list */ - case 389: /* variable_list */ - case 390: /* retention_list */ - case 395: /* column_def_list */ - case 396: /* tags_def_opt */ - case 398: /* multi_create_clause */ - case 399: /* tags_def */ - case 400: /* multi_drop_clause */ - case 407: /* specific_cols_opt */ - case 408: /* expression_list */ - case 410: /* col_name_list */ - case 412: /* duration_list */ - case 413: /* rollup_func_list */ - case 425: /* tag_list_opt */ - case 432: /* func_list */ - case 452: /* col_list_opt */ - case 453: /* tag_def_or_ref_opt */ - case 458: /* dnode_list */ - case 460: /* literal_list */ - case 468: /* star_func_para_list */ - case 470: /* other_para_list */ - case 472: /* when_then_list */ - case 497: /* hint_list */ - case 500: /* select_list */ - case 501: /* partition_by_clause_opt */ - case 506: /* group_by_clause_opt */ - case 509: /* partition_list */ - case 513: /* group_by_list */ - case 516: /* order_by_clause_opt */ - case 521: /* sort_specification_list */ + case 366: /* ip_range_list */ + case 367: /* white_list */ + case 368: /* white_list_opt */ + case 390: /* integer_list */ + case 391: /* variable_list */ + case 392: /* retention_list */ + case 397: /* column_def_list */ + case 398: /* tags_def_opt */ + case 400: /* multi_create_clause */ + case 401: /* tags_def */ + case 402: /* multi_drop_clause */ + case 409: /* specific_cols_opt */ + case 410: /* tags_literal_list */ + case 412: /* col_name_list */ + case 414: /* duration_list */ + case 415: /* rollup_func_list */ + case 427: /* tag_list_opt */ + case 434: /* func_list */ + case 439: /* expression_list */ + case 455: /* col_list_opt */ + case 456: /* tag_def_or_ref_opt */ + case 461: /* dnode_list */ + case 464: /* literal_list */ + case 472: /* star_func_para_list */ + case 474: /* other_para_list */ + case 476: /* when_then_list */ + case 501: /* hint_list */ + case 504: /* select_list */ + case 505: /* partition_by_clause_opt */ + case 510: /* group_by_clause_opt */ + case 513: /* partition_list */ + case 517: /* group_by_list */ + case 520: /* order_by_clause_opt */ + case 525: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy124)); + nodesDestroyList((yypminor->yy608)); } break; - case 367: /* user_name */ - case 374: /* db_name */ - case 375: /* table_name */ - case 376: /* topic_name */ - case 378: /* dnode_endpoint */ - case 403: /* column_name */ - case 417: /* function_name */ - case 428: /* column_alias */ - case 431: /* index_name */ - case 436: /* sma_func_name */ - case 440: /* cgroup_name */ - case 447: /* language_opt */ - case 449: /* view_name */ - case 450: /* stream_name */ - case 457: /* on_vgroup_id */ - case 461: /* table_alias */ - case 467: /* star_func */ - case 469: /* noarg_func */ - case 487: /* alias_opt */ + case 369: /* user_name */ + case 376: /* db_name */ + case 377: /* table_name */ + case 378: /* topic_name */ + case 380: /* dnode_endpoint */ + case 405: /* column_name */ + case 419: /* function_name */ + case 430: /* column_alias */ + case 433: /* index_name */ + case 438: /* sma_func_name */ + case 443: /* cgroup_name */ + case 450: /* language_opt */ + case 452: /* view_name */ + case 453: /* stream_name */ + case 460: /* on_vgroup_id */ + case 465: /* table_alias */ + case 471: /* star_func */ + case 473: /* noarg_func */ + case 491: /* alias_opt */ { } break; - case 368: /* sysinfo_opt */ + case 370: /* sysinfo_opt */ { } break; - case 369: /* privileges */ - case 372: /* priv_type_list */ - case 373: /* priv_type */ + case 371: /* privileges */ + case 374: /* priv_type_list */ + case 375: /* priv_type */ { } break; - case 370: /* priv_level */ + case 372: /* priv_level */ { } break; - case 379: /* force_opt */ - case 380: /* unsafe_opt */ - case 381: /* not_exists_opt */ - case 383: /* exists_opt */ - case 441: /* analyze_opt */ - case 444: /* or_replace_opt */ - case 445: /* agg_func_opt */ - case 455: /* ignore_opt */ - case 498: /* set_quantifier_opt */ - case 499: /* tag_mode_opt */ + case 381: /* force_opt */ + case 382: /* unsafe_opt */ + case 383: /* not_exists_opt */ + case 385: /* exists_opt */ + case 444: /* analyze_opt */ + case 447: /* or_replace_opt */ + case 448: /* agg_func_opt */ + case 458: /* ignore_opt */ + case 502: /* set_quantifier_opt */ + case 503: /* tag_mode_opt */ { } break; - case 392: /* alter_db_option */ - case 414: /* alter_table_option */ + case 394: /* alter_db_option */ + case 416: /* alter_table_option */ { } break; - case 404: /* type_name */ + case 406: /* type_name */ { } break; - case 419: /* db_kind_opt */ - case 426: /* table_kind */ + case 421: /* db_kind_opt */ + case 428: /* table_kind */ { } break; - case 420: /* table_kind_db_name_cond_opt */ + case 422: /* table_kind_db_name_cond_opt */ { } break; - case 477: /* compare_op */ - case 478: /* in_op */ + case 481: /* compare_op */ + case 482: /* in_op */ { } break; - case 490: /* join_type */ + case 494: /* join_type */ { } break; - case 491: /* join_subtype */ + case 495: /* join_subtype */ { } break; - case 512: /* fill_mode */ + case 516: /* fill_mode */ { } break; - case 523: /* ordering_specification_opt */ + case 527: /* ordering_specification_opt */ { } break; - case 524: /* null_ordering_opt */ + case 528: /* null_ordering_opt */ { } @@ -3409,672 +3476,693 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 359, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 359, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 360, /* (2) account_options ::= */ - 360, /* (3) account_options ::= account_options PPS literal */ - 360, /* (4) account_options ::= account_options TSERIES literal */ - 360, /* (5) account_options ::= account_options STORAGE literal */ - 360, /* (6) account_options ::= account_options STREAMS literal */ - 360, /* (7) account_options ::= account_options QTIME literal */ - 360, /* (8) account_options ::= account_options DBS literal */ - 360, /* (9) account_options ::= account_options USERS literal */ - 360, /* (10) account_options ::= account_options CONNS literal */ - 360, /* (11) account_options ::= account_options STATE literal */ - 361, /* (12) alter_account_options ::= alter_account_option */ - 361, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 363, /* (14) alter_account_option ::= PASS literal */ - 363, /* (15) alter_account_option ::= PPS literal */ - 363, /* (16) alter_account_option ::= TSERIES literal */ - 363, /* (17) alter_account_option ::= STORAGE literal */ - 363, /* (18) alter_account_option ::= STREAMS literal */ - 363, /* (19) alter_account_option ::= QTIME literal */ - 363, /* (20) alter_account_option ::= DBS literal */ - 363, /* (21) alter_account_option ::= USERS literal */ - 363, /* (22) alter_account_option ::= CONNS literal */ - 363, /* (23) alter_account_option ::= STATE literal */ - 364, /* (24) ip_range_list ::= NK_STRING */ - 364, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 365, /* (26) white_list ::= HOST ip_range_list */ - 366, /* (27) white_list_opt ::= */ - 366, /* (28) white_list_opt ::= white_list */ - 359, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ - 359, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ - 359, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 359, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 359, /* (33) cmd ::= ALTER USER user_name ADD white_list */ - 359, /* (34) cmd ::= ALTER USER user_name DROP white_list */ - 359, /* (35) cmd ::= DROP USER user_name */ - 368, /* (36) sysinfo_opt ::= */ - 368, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 359, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 359, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 369, /* (40) privileges ::= ALL */ - 369, /* (41) privileges ::= priv_type_list */ - 369, /* (42) privileges ::= SUBSCRIBE */ - 372, /* (43) priv_type_list ::= priv_type */ - 372, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 373, /* (45) priv_type ::= READ */ - 373, /* (46) priv_type ::= WRITE */ - 373, /* (47) priv_type ::= ALTER */ - 370, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 370, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ - 370, /* (50) priv_level ::= db_name NK_DOT table_name */ - 370, /* (51) priv_level ::= topic_name */ - 371, /* (52) with_opt ::= */ - 371, /* (53) with_opt ::= WITH search_condition */ - 359, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ - 359, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 359, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 359, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 359, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 359, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 359, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 359, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 359, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ - 359, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 359, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ - 378, /* (65) dnode_endpoint ::= NK_STRING */ - 378, /* (66) dnode_endpoint ::= NK_ID */ - 378, /* (67) dnode_endpoint ::= NK_IPTOKEN */ - 379, /* (68) force_opt ::= */ - 379, /* (69) force_opt ::= FORCE */ - 380, /* (70) unsafe_opt ::= UNSAFE */ - 359, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ - 359, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 359, /* (73) cmd ::= ALTER LOCAL NK_STRING */ - 359, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 359, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 359, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 359, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 359, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 359, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 359, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 359, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 359, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 359, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 359, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 359, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 359, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 359, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ - 359, /* (88) cmd ::= USE db_name */ - 359, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ - 359, /* (90) cmd ::= FLUSH DATABASE db_name */ - 359, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ - 359, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 381, /* (93) not_exists_opt ::= IF NOT EXISTS */ - 381, /* (94) not_exists_opt ::= */ - 383, /* (95) exists_opt ::= IF EXISTS */ - 383, /* (96) exists_opt ::= */ - 382, /* (97) db_options ::= */ - 382, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ - 382, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ - 382, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ - 382, /* (101) db_options ::= db_options COMP NK_INTEGER */ - 382, /* (102) db_options ::= db_options DURATION NK_INTEGER */ - 382, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ - 382, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ - 382, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ - 382, /* (106) db_options ::= db_options KEEP integer_list */ - 382, /* (107) db_options ::= db_options KEEP variable_list */ - 382, /* (108) db_options ::= db_options PAGES NK_INTEGER */ - 382, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ - 382, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 382, /* (111) db_options ::= db_options PRECISION NK_STRING */ - 382, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ - 382, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ - 382, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 382, /* (115) db_options ::= db_options RETENTIONS retention_list */ - 382, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 382, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 382, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 382, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 382, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 382, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 382, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 382, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 382, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 382, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 382, /* (126) db_options ::= db_options TABLE_PREFIX signed */ - 382, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ - 382, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 384, /* (129) alter_db_options ::= alter_db_option */ - 384, /* (130) alter_db_options ::= alter_db_options alter_db_option */ - 392, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ - 392, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ - 392, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ - 392, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 392, /* (135) alter_db_option ::= KEEP integer_list */ - 392, /* (136) alter_db_option ::= KEEP variable_list */ - 392, /* (137) alter_db_option ::= PAGES NK_INTEGER */ - 392, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ - 392, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 392, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 392, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ - 392, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 392, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 392, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 392, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 392, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 388, /* (147) integer_list ::= NK_INTEGER */ - 388, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 389, /* (149) variable_list ::= NK_VARIABLE */ - 389, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 390, /* (151) retention_list ::= retention */ - 390, /* (152) retention_list ::= retention_list NK_COMMA retention */ - 393, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 393, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 385, /* (155) speed_opt ::= */ - 385, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ - 386, /* (157) start_opt ::= */ - 386, /* (158) start_opt ::= START WITH NK_INTEGER */ - 386, /* (159) start_opt ::= START WITH NK_STRING */ - 386, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 387, /* (161) end_opt ::= */ - 387, /* (162) end_opt ::= END WITH NK_INTEGER */ - 387, /* (163) end_opt ::= END WITH NK_STRING */ - 387, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 359, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 359, /* (166) cmd ::= CREATE TABLE multi_create_clause */ - 359, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 359, /* (168) cmd ::= DROP TABLE multi_drop_clause */ - 359, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ - 359, /* (170) cmd ::= ALTER TABLE alter_table_clause */ - 359, /* (171) cmd ::= ALTER STABLE alter_table_clause */ - 401, /* (172) alter_table_clause ::= full_table_name alter_table_options */ - 401, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - 401, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 401, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 401, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 401, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 401, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ - 401, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 401, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 401, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - 398, /* (182) multi_create_clause ::= create_subtable_clause */ - 398, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 406, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - 400, /* (185) multi_drop_clause ::= drop_table_clause */ - 400, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 409, /* (187) drop_table_clause ::= exists_opt full_table_name */ - 407, /* (188) specific_cols_opt ::= */ - 407, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 394, /* (190) full_table_name ::= table_name */ - 394, /* (191) full_table_name ::= db_name NK_DOT table_name */ - 395, /* (192) column_def_list ::= column_def */ - 395, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ - 411, /* (194) column_def ::= column_name type_name */ - 404, /* (195) type_name ::= BOOL */ - 404, /* (196) type_name ::= TINYINT */ - 404, /* (197) type_name ::= SMALLINT */ - 404, /* (198) type_name ::= INT */ - 404, /* (199) type_name ::= INTEGER */ - 404, /* (200) type_name ::= BIGINT */ - 404, /* (201) type_name ::= FLOAT */ - 404, /* (202) type_name ::= DOUBLE */ - 404, /* (203) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 404, /* (204) type_name ::= TIMESTAMP */ - 404, /* (205) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 404, /* (206) type_name ::= TINYINT UNSIGNED */ - 404, /* (207) type_name ::= SMALLINT UNSIGNED */ - 404, /* (208) type_name ::= INT UNSIGNED */ - 404, /* (209) type_name ::= BIGINT UNSIGNED */ - 404, /* (210) type_name ::= JSON */ - 404, /* (211) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 404, /* (212) type_name ::= MEDIUMBLOB */ - 404, /* (213) type_name ::= BLOB */ - 404, /* (214) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 404, /* (215) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 404, /* (216) type_name ::= DECIMAL */ - 404, /* (217) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 404, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 396, /* (219) tags_def_opt ::= */ - 396, /* (220) tags_def_opt ::= tags_def */ - 399, /* (221) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 397, /* (222) table_options ::= */ - 397, /* (223) table_options ::= table_options COMMENT NK_STRING */ - 397, /* (224) table_options ::= table_options MAX_DELAY duration_list */ - 397, /* (225) table_options ::= table_options WATERMARK duration_list */ - 397, /* (226) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 397, /* (227) table_options ::= table_options TTL NK_INTEGER */ - 397, /* (228) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 397, /* (229) table_options ::= table_options DELETE_MARK duration_list */ - 402, /* (230) alter_table_options ::= alter_table_option */ - 402, /* (231) alter_table_options ::= alter_table_options alter_table_option */ - 414, /* (232) alter_table_option ::= COMMENT NK_STRING */ - 414, /* (233) alter_table_option ::= TTL NK_INTEGER */ - 412, /* (234) duration_list ::= duration_literal */ - 412, /* (235) duration_list ::= duration_list NK_COMMA duration_literal */ - 413, /* (236) rollup_func_list ::= rollup_func_name */ - 413, /* (237) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 416, /* (238) rollup_func_name ::= function_name */ - 416, /* (239) rollup_func_name ::= FIRST */ - 416, /* (240) rollup_func_name ::= LAST */ - 410, /* (241) col_name_list ::= col_name */ - 410, /* (242) col_name_list ::= col_name_list NK_COMMA col_name */ - 418, /* (243) col_name ::= column_name */ - 359, /* (244) cmd ::= SHOW DNODES */ - 359, /* (245) cmd ::= SHOW USERS */ - 359, /* (246) cmd ::= SHOW USER PRIVILEGES */ - 359, /* (247) cmd ::= SHOW db_kind_opt DATABASES */ - 359, /* (248) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 359, /* (249) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 359, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 359, /* (251) cmd ::= SHOW MNODES */ - 359, /* (252) cmd ::= SHOW QNODES */ - 359, /* (253) cmd ::= SHOW FUNCTIONS */ - 359, /* (254) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 359, /* (255) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 359, /* (256) cmd ::= SHOW STREAMS */ - 359, /* (257) cmd ::= SHOW ACCOUNTS */ - 359, /* (258) cmd ::= SHOW APPS */ - 359, /* (259) cmd ::= SHOW CONNECTIONS */ - 359, /* (260) cmd ::= SHOW LICENCES */ - 359, /* (261) cmd ::= SHOW GRANTS */ - 359, /* (262) cmd ::= SHOW GRANTS FULL */ - 359, /* (263) cmd ::= SHOW GRANTS LOGS */ - 359, /* (264) cmd ::= SHOW CLUSTER MACHINES */ - 359, /* (265) cmd ::= SHOW CREATE DATABASE db_name */ - 359, /* (266) cmd ::= SHOW CREATE TABLE full_table_name */ - 359, /* (267) cmd ::= SHOW CREATE STABLE full_table_name */ - 359, /* (268) cmd ::= SHOW QUERIES */ - 359, /* (269) cmd ::= SHOW SCORES */ - 359, /* (270) cmd ::= SHOW TOPICS */ - 359, /* (271) cmd ::= SHOW VARIABLES */ - 359, /* (272) cmd ::= SHOW CLUSTER VARIABLES */ - 359, /* (273) cmd ::= SHOW LOCAL VARIABLES */ - 359, /* (274) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 359, /* (275) cmd ::= SHOW BNODES */ - 359, /* (276) cmd ::= SHOW SNODES */ - 359, /* (277) cmd ::= SHOW CLUSTER */ - 359, /* (278) cmd ::= SHOW TRANSACTIONS */ - 359, /* (279) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 359, /* (280) cmd ::= SHOW CONSUMERS */ - 359, /* (281) cmd ::= SHOW SUBSCRIPTIONS */ - 359, /* (282) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 359, /* (283) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 359, /* (284) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 359, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 359, /* (286) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 359, /* (287) cmd ::= SHOW VNODES */ - 359, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */ - 359, /* (289) cmd ::= SHOW CLUSTER ALIVE */ - 359, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 359, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */ - 359, /* (292) cmd ::= SHOW COMPACTS */ - 359, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */ - 420, /* (294) table_kind_db_name_cond_opt ::= */ - 420, /* (295) table_kind_db_name_cond_opt ::= table_kind */ - 420, /* (296) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 420, /* (297) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 426, /* (298) table_kind ::= NORMAL */ - 426, /* (299) table_kind ::= CHILD */ - 422, /* (300) db_name_cond_opt ::= */ - 422, /* (301) db_name_cond_opt ::= db_name NK_DOT */ - 421, /* (302) like_pattern_opt ::= */ - 421, /* (303) like_pattern_opt ::= LIKE NK_STRING */ - 423, /* (304) table_name_cond ::= table_name */ - 424, /* (305) from_db_opt ::= */ - 424, /* (306) from_db_opt ::= FROM db_name */ - 425, /* (307) tag_list_opt ::= */ - 425, /* (308) tag_list_opt ::= tag_item */ - 425, /* (309) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 427, /* (310) tag_item ::= TBNAME */ - 427, /* (311) tag_item ::= QTAGS */ - 427, /* (312) tag_item ::= column_name */ - 427, /* (313) tag_item ::= column_name column_alias */ - 427, /* (314) tag_item ::= column_name AS column_alias */ - 419, /* (315) db_kind_opt ::= */ - 419, /* (316) db_kind_opt ::= USER */ - 419, /* (317) db_kind_opt ::= SYSTEM */ - 359, /* (318) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 359, /* (319) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 359, /* (320) cmd ::= DROP INDEX exists_opt full_index_name */ - 430, /* (321) full_index_name ::= index_name */ - 430, /* (322) full_index_name ::= db_name NK_DOT index_name */ - 429, /* (323) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 429, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - 432, /* (325) func_list ::= func */ - 432, /* (326) func_list ::= func_list NK_COMMA func */ - 435, /* (327) func ::= sma_func_name NK_LP expression_list NK_RP */ - 436, /* (328) sma_func_name ::= function_name */ - 436, /* (329) sma_func_name ::= COUNT */ - 436, /* (330) sma_func_name ::= FIRST */ - 436, /* (331) sma_func_name ::= LAST */ - 436, /* (332) sma_func_name ::= LAST_ROW */ - 434, /* (333) sma_stream_opt ::= */ - 434, /* (334) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 434, /* (335) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 434, /* (336) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 437, /* (337) with_meta ::= AS */ - 437, /* (338) with_meta ::= WITH META AS */ - 437, /* (339) with_meta ::= ONLY META AS */ - 359, /* (340) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 359, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 359, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 359, /* (343) cmd ::= DROP TOPIC exists_opt topic_name */ - 359, /* (344) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 359, /* (345) cmd ::= DESC full_table_name */ - 359, /* (346) cmd ::= DESCRIBE full_table_name */ - 359, /* (347) cmd ::= RESET QUERY CACHE */ - 359, /* (348) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 359, /* (349) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 441, /* (350) analyze_opt ::= */ - 441, /* (351) analyze_opt ::= ANALYZE */ - 442, /* (352) explain_options ::= */ - 442, /* (353) explain_options ::= explain_options VERBOSE NK_BOOL */ - 442, /* (354) explain_options ::= explain_options RATIO NK_FLOAT */ - 359, /* (355) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 359, /* (356) cmd ::= DROP FUNCTION exists_opt function_name */ - 445, /* (357) agg_func_opt ::= */ - 445, /* (358) agg_func_opt ::= AGGREGATE */ - 446, /* (359) bufsize_opt ::= */ - 446, /* (360) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 447, /* (361) language_opt ::= */ - 447, /* (362) language_opt ::= LANGUAGE NK_STRING */ - 444, /* (363) or_replace_opt ::= */ - 444, /* (364) or_replace_opt ::= OR REPLACE */ - 359, /* (365) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 359, /* (366) cmd ::= DROP VIEW exists_opt full_view_name */ - 448, /* (367) full_view_name ::= view_name */ - 448, /* (368) full_view_name ::= db_name NK_DOT view_name */ - 359, /* (369) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - 359, /* (370) cmd ::= DROP STREAM exists_opt stream_name */ - 359, /* (371) cmd ::= PAUSE STREAM exists_opt stream_name */ - 359, /* (372) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 452, /* (373) col_list_opt ::= */ - 452, /* (374) col_list_opt ::= NK_LP col_name_list NK_RP */ - 453, /* (375) tag_def_or_ref_opt ::= */ - 453, /* (376) tag_def_or_ref_opt ::= tags_def */ - 453, /* (377) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 451, /* (378) stream_options ::= */ - 451, /* (379) stream_options ::= stream_options TRIGGER AT_ONCE */ - 451, /* (380) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 451, /* (381) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 451, /* (382) stream_options ::= stream_options WATERMARK duration_literal */ - 451, /* (383) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 451, /* (384) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 451, /* (385) stream_options ::= stream_options DELETE_MARK duration_literal */ - 451, /* (386) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 454, /* (387) subtable_opt ::= */ - 454, /* (388) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 455, /* (389) ignore_opt ::= */ - 455, /* (390) ignore_opt ::= IGNORE UNTREATED */ - 359, /* (391) cmd ::= KILL CONNECTION NK_INTEGER */ - 359, /* (392) cmd ::= KILL QUERY NK_STRING */ - 359, /* (393) cmd ::= KILL TRANSACTION NK_INTEGER */ - 359, /* (394) cmd ::= KILL COMPACT NK_INTEGER */ - 359, /* (395) cmd ::= BALANCE VGROUP */ - 359, /* (396) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 359, /* (397) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 359, /* (398) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 359, /* (399) cmd ::= SPLIT VGROUP NK_INTEGER */ - 457, /* (400) on_vgroup_id ::= */ - 457, /* (401) on_vgroup_id ::= ON NK_INTEGER */ - 458, /* (402) dnode_list ::= DNODE NK_INTEGER */ - 458, /* (403) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 359, /* (404) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 359, /* (405) cmd ::= query_or_subquery */ - 359, /* (406) cmd ::= insert_query */ - 443, /* (407) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 443, /* (408) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 362, /* (409) literal ::= NK_INTEGER */ - 362, /* (410) literal ::= NK_FLOAT */ - 362, /* (411) literal ::= NK_STRING */ - 362, /* (412) literal ::= NK_BOOL */ - 362, /* (413) literal ::= TIMESTAMP NK_STRING */ - 362, /* (414) literal ::= duration_literal */ - 362, /* (415) literal ::= NULL */ - 362, /* (416) literal ::= NK_QUESTION */ - 415, /* (417) duration_literal ::= NK_VARIABLE */ - 391, /* (418) signed ::= NK_INTEGER */ - 391, /* (419) signed ::= NK_PLUS NK_INTEGER */ - 391, /* (420) signed ::= NK_MINUS NK_INTEGER */ - 391, /* (421) signed ::= NK_FLOAT */ - 391, /* (422) signed ::= NK_PLUS NK_FLOAT */ - 391, /* (423) signed ::= NK_MINUS NK_FLOAT */ - 405, /* (424) signed_literal ::= signed */ - 405, /* (425) signed_literal ::= NK_STRING */ - 405, /* (426) signed_literal ::= NK_BOOL */ - 405, /* (427) signed_literal ::= TIMESTAMP NK_STRING */ - 405, /* (428) signed_literal ::= duration_literal */ - 405, /* (429) signed_literal ::= NULL */ - 405, /* (430) signed_literal ::= literal_func */ - 405, /* (431) signed_literal ::= NK_QUESTION */ - 460, /* (432) literal_list ::= signed_literal */ - 460, /* (433) literal_list ::= literal_list NK_COMMA signed_literal */ - 374, /* (434) db_name ::= NK_ID */ - 375, /* (435) table_name ::= NK_ID */ - 403, /* (436) column_name ::= NK_ID */ - 417, /* (437) function_name ::= NK_ID */ - 449, /* (438) view_name ::= NK_ID */ - 461, /* (439) table_alias ::= NK_ID */ - 428, /* (440) column_alias ::= NK_ID */ - 428, /* (441) column_alias ::= NK_ALIAS */ - 367, /* (442) user_name ::= NK_ID */ - 376, /* (443) topic_name ::= NK_ID */ - 450, /* (444) stream_name ::= NK_ID */ - 440, /* (445) cgroup_name ::= NK_ID */ - 431, /* (446) index_name ::= NK_ID */ - 462, /* (447) expr_or_subquery ::= expression */ - 456, /* (448) expression ::= literal */ - 456, /* (449) expression ::= pseudo_column */ - 456, /* (450) expression ::= column_reference */ - 456, /* (451) expression ::= function_expression */ - 456, /* (452) expression ::= case_when_expression */ - 456, /* (453) expression ::= NK_LP expression NK_RP */ - 456, /* (454) expression ::= NK_PLUS expr_or_subquery */ - 456, /* (455) expression ::= NK_MINUS expr_or_subquery */ - 456, /* (456) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 456, /* (457) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 456, /* (458) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 456, /* (459) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 456, /* (460) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 456, /* (461) expression ::= column_reference NK_ARROW NK_STRING */ - 456, /* (462) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 456, /* (463) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 408, /* (464) expression_list ::= expr_or_subquery */ - 408, /* (465) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 464, /* (466) column_reference ::= column_name */ - 464, /* (467) column_reference ::= table_name NK_DOT column_name */ - 464, /* (468) column_reference ::= NK_ALIAS */ - 464, /* (469) column_reference ::= table_name NK_DOT NK_ALIAS */ - 463, /* (470) pseudo_column ::= ROWTS */ - 463, /* (471) pseudo_column ::= TBNAME */ - 463, /* (472) pseudo_column ::= table_name NK_DOT TBNAME */ - 463, /* (473) pseudo_column ::= QSTART */ - 463, /* (474) pseudo_column ::= QEND */ - 463, /* (475) pseudo_column ::= QDURATION */ - 463, /* (476) pseudo_column ::= WSTART */ - 463, /* (477) pseudo_column ::= WEND */ - 463, /* (478) pseudo_column ::= WDURATION */ - 463, /* (479) pseudo_column ::= IROWTS */ - 463, /* (480) pseudo_column ::= ISFILLED */ - 463, /* (481) pseudo_column ::= QTAGS */ - 465, /* (482) function_expression ::= function_name NK_LP expression_list NK_RP */ - 465, /* (483) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 465, /* (484) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 465, /* (485) function_expression ::= literal_func */ - 459, /* (486) literal_func ::= noarg_func NK_LP NK_RP */ - 459, /* (487) literal_func ::= NOW */ - 469, /* (488) noarg_func ::= NOW */ - 469, /* (489) noarg_func ::= TODAY */ - 469, /* (490) noarg_func ::= TIMEZONE */ - 469, /* (491) noarg_func ::= DATABASE */ - 469, /* (492) noarg_func ::= CLIENT_VERSION */ - 469, /* (493) noarg_func ::= SERVER_VERSION */ - 469, /* (494) noarg_func ::= SERVER_STATUS */ - 469, /* (495) noarg_func ::= CURRENT_USER */ - 469, /* (496) noarg_func ::= USER */ - 467, /* (497) star_func ::= COUNT */ - 467, /* (498) star_func ::= FIRST */ - 467, /* (499) star_func ::= LAST */ - 467, /* (500) star_func ::= LAST_ROW */ - 468, /* (501) star_func_para_list ::= NK_STAR */ - 468, /* (502) star_func_para_list ::= other_para_list */ - 470, /* (503) other_para_list ::= star_func_para */ - 470, /* (504) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 471, /* (505) star_func_para ::= expr_or_subquery */ - 471, /* (506) star_func_para ::= table_name NK_DOT NK_STAR */ - 466, /* (507) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 466, /* (508) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 472, /* (509) when_then_list ::= when_then_expr */ - 472, /* (510) when_then_list ::= when_then_list when_then_expr */ - 475, /* (511) when_then_expr ::= WHEN common_expression THEN common_expression */ - 473, /* (512) case_when_else_opt ::= */ - 473, /* (513) case_when_else_opt ::= ELSE common_expression */ - 476, /* (514) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 476, /* (515) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 476, /* (516) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 476, /* (517) predicate ::= expr_or_subquery IS NULL */ - 476, /* (518) predicate ::= expr_or_subquery IS NOT NULL */ - 476, /* (519) predicate ::= expr_or_subquery in_op in_predicate_value */ - 477, /* (520) compare_op ::= NK_LT */ - 477, /* (521) compare_op ::= NK_GT */ - 477, /* (522) compare_op ::= NK_LE */ - 477, /* (523) compare_op ::= NK_GE */ - 477, /* (524) compare_op ::= NK_NE */ - 477, /* (525) compare_op ::= NK_EQ */ - 477, /* (526) compare_op ::= LIKE */ - 477, /* (527) compare_op ::= NOT LIKE */ - 477, /* (528) compare_op ::= MATCH */ - 477, /* (529) compare_op ::= NMATCH */ - 477, /* (530) compare_op ::= CONTAINS */ - 478, /* (531) in_op ::= IN */ - 478, /* (532) in_op ::= NOT IN */ - 479, /* (533) in_predicate_value ::= NK_LP literal_list NK_RP */ - 480, /* (534) boolean_value_expression ::= boolean_primary */ - 480, /* (535) boolean_value_expression ::= NOT boolean_primary */ - 480, /* (536) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 480, /* (537) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 481, /* (538) boolean_primary ::= predicate */ - 481, /* (539) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 474, /* (540) common_expression ::= expr_or_subquery */ - 474, /* (541) common_expression ::= boolean_value_expression */ - 482, /* (542) from_clause_opt ::= */ - 482, /* (543) from_clause_opt ::= FROM table_reference_list */ - 483, /* (544) table_reference_list ::= table_reference */ - 483, /* (545) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 484, /* (546) table_reference ::= table_primary */ - 484, /* (547) table_reference ::= joined_table */ - 485, /* (548) table_primary ::= table_name alias_opt */ - 485, /* (549) table_primary ::= db_name NK_DOT table_name alias_opt */ - 485, /* (550) table_primary ::= subquery alias_opt */ - 485, /* (551) table_primary ::= parenthesized_joined_table */ - 487, /* (552) alias_opt ::= */ - 487, /* (553) alias_opt ::= table_alias */ - 487, /* (554) alias_opt ::= AS table_alias */ - 489, /* (555) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 489, /* (556) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 486, /* (557) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 490, /* (558) join_type ::= */ - 490, /* (559) join_type ::= INNER */ - 490, /* (560) join_type ::= LEFT */ - 490, /* (561) join_type ::= RIGHT */ - 490, /* (562) join_type ::= FULL */ - 491, /* (563) join_subtype ::= */ - 491, /* (564) join_subtype ::= OUTER */ - 491, /* (565) join_subtype ::= SEMI */ - 491, /* (566) join_subtype ::= ANTI */ - 491, /* (567) join_subtype ::= ASOF */ - 491, /* (568) join_subtype ::= WINDOW */ - 492, /* (569) join_on_clause_opt ::= */ - 492, /* (570) join_on_clause_opt ::= ON search_condition */ - 493, /* (571) window_offset_clause_opt ::= */ - 493, /* (572) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - 495, /* (573) window_offset_literal ::= NK_VARIABLE */ - 495, /* (574) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 494, /* (575) jlimit_clause_opt ::= */ - 494, /* (576) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - 496, /* (577) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 497, /* (578) hint_list ::= */ - 497, /* (579) hint_list ::= NK_HINT */ - 499, /* (580) tag_mode_opt ::= */ - 499, /* (581) tag_mode_opt ::= TAGS */ - 498, /* (582) set_quantifier_opt ::= */ - 498, /* (583) set_quantifier_opt ::= DISTINCT */ - 498, /* (584) set_quantifier_opt ::= ALL */ - 500, /* (585) select_list ::= select_item */ - 500, /* (586) select_list ::= select_list NK_COMMA select_item */ - 508, /* (587) select_item ::= NK_STAR */ - 508, /* (588) select_item ::= common_expression */ - 508, /* (589) select_item ::= common_expression column_alias */ - 508, /* (590) select_item ::= common_expression AS column_alias */ - 508, /* (591) select_item ::= table_name NK_DOT NK_STAR */ - 439, /* (592) where_clause_opt ::= */ - 439, /* (593) where_clause_opt ::= WHERE search_condition */ - 501, /* (594) partition_by_clause_opt ::= */ - 501, /* (595) partition_by_clause_opt ::= PARTITION BY partition_list */ - 509, /* (596) partition_list ::= partition_item */ - 509, /* (597) partition_list ::= partition_list NK_COMMA partition_item */ - 510, /* (598) partition_item ::= expr_or_subquery */ - 510, /* (599) partition_item ::= expr_or_subquery column_alias */ - 510, /* (600) partition_item ::= expr_or_subquery AS column_alias */ - 505, /* (601) twindow_clause_opt ::= */ - 505, /* (602) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 505, /* (603) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 505, /* (604) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 505, /* (605) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 505, /* (606) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 505, /* (607) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 505, /* (608) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 433, /* (609) sliding_opt ::= */ - 433, /* (610) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 511, /* (611) interval_sliding_duration_literal ::= NK_VARIABLE */ - 511, /* (612) interval_sliding_duration_literal ::= NK_STRING */ - 511, /* (613) interval_sliding_duration_literal ::= NK_INTEGER */ - 504, /* (614) fill_opt ::= */ - 504, /* (615) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 504, /* (616) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 504, /* (617) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 512, /* (618) fill_mode ::= NONE */ - 512, /* (619) fill_mode ::= PREV */ - 512, /* (620) fill_mode ::= NULL */ - 512, /* (621) fill_mode ::= NULL_F */ - 512, /* (622) fill_mode ::= LINEAR */ - 512, /* (623) fill_mode ::= NEXT */ - 506, /* (624) group_by_clause_opt ::= */ - 506, /* (625) group_by_clause_opt ::= GROUP BY group_by_list */ - 513, /* (626) group_by_list ::= expr_or_subquery */ - 513, /* (627) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 507, /* (628) having_clause_opt ::= */ - 507, /* (629) having_clause_opt ::= HAVING search_condition */ - 502, /* (630) range_opt ::= */ - 502, /* (631) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 502, /* (632) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 503, /* (633) every_opt ::= */ - 503, /* (634) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 514, /* (635) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 515, /* (636) query_simple ::= query_specification */ - 515, /* (637) query_simple ::= union_query_expression */ - 519, /* (638) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 519, /* (639) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 520, /* (640) query_simple_or_subquery ::= query_simple */ - 520, /* (641) query_simple_or_subquery ::= subquery */ - 438, /* (642) query_or_subquery ::= query_expression */ - 438, /* (643) query_or_subquery ::= subquery */ - 516, /* (644) order_by_clause_opt ::= */ - 516, /* (645) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 517, /* (646) slimit_clause_opt ::= */ - 517, /* (647) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 517, /* (648) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 517, /* (649) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 518, /* (650) limit_clause_opt ::= */ - 518, /* (651) limit_clause_opt ::= LIMIT NK_INTEGER */ - 518, /* (652) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 518, /* (653) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 488, /* (654) subquery ::= NK_LP query_expression NK_RP */ - 488, /* (655) subquery ::= NK_LP subquery NK_RP */ - 377, /* (656) search_condition ::= common_expression */ - 521, /* (657) sort_specification_list ::= sort_specification */ - 521, /* (658) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 522, /* (659) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 523, /* (660) ordering_specification_opt ::= */ - 523, /* (661) ordering_specification_opt ::= ASC */ - 523, /* (662) ordering_specification_opt ::= DESC */ - 524, /* (663) null_ordering_opt ::= */ - 524, /* (664) null_ordering_opt ::= NULLS FIRST */ - 524, /* (665) null_ordering_opt ::= NULLS LAST */ + 361, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 361, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 362, /* (2) account_options ::= */ + 362, /* (3) account_options ::= account_options PPS literal */ + 362, /* (4) account_options ::= account_options TSERIES literal */ + 362, /* (5) account_options ::= account_options STORAGE literal */ + 362, /* (6) account_options ::= account_options STREAMS literal */ + 362, /* (7) account_options ::= account_options QTIME literal */ + 362, /* (8) account_options ::= account_options DBS literal */ + 362, /* (9) account_options ::= account_options USERS literal */ + 362, /* (10) account_options ::= account_options CONNS literal */ + 362, /* (11) account_options ::= account_options STATE literal */ + 363, /* (12) alter_account_options ::= alter_account_option */ + 363, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 365, /* (14) alter_account_option ::= PASS literal */ + 365, /* (15) alter_account_option ::= PPS literal */ + 365, /* (16) alter_account_option ::= TSERIES literal */ + 365, /* (17) alter_account_option ::= STORAGE literal */ + 365, /* (18) alter_account_option ::= STREAMS literal */ + 365, /* (19) alter_account_option ::= QTIME literal */ + 365, /* (20) alter_account_option ::= DBS literal */ + 365, /* (21) alter_account_option ::= USERS literal */ + 365, /* (22) alter_account_option ::= CONNS literal */ + 365, /* (23) alter_account_option ::= STATE literal */ + 366, /* (24) ip_range_list ::= NK_STRING */ + 366, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 367, /* (26) white_list ::= HOST ip_range_list */ + 368, /* (27) white_list_opt ::= */ + 368, /* (28) white_list_opt ::= white_list */ + 361, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ + 361, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ + 361, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 361, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 361, /* (33) cmd ::= ALTER USER user_name ADD white_list */ + 361, /* (34) cmd ::= ALTER USER user_name DROP white_list */ + 361, /* (35) cmd ::= DROP USER user_name */ + 370, /* (36) sysinfo_opt ::= */ + 370, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 361, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 361, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 371, /* (40) privileges ::= ALL */ + 371, /* (41) privileges ::= priv_type_list */ + 371, /* (42) privileges ::= SUBSCRIBE */ + 374, /* (43) priv_type_list ::= priv_type */ + 374, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 375, /* (45) priv_type ::= READ */ + 375, /* (46) priv_type ::= WRITE */ + 375, /* (47) priv_type ::= ALTER */ + 372, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 372, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ + 372, /* (50) priv_level ::= db_name NK_DOT table_name */ + 372, /* (51) priv_level ::= topic_name */ + 373, /* (52) with_opt ::= */ + 373, /* (53) with_opt ::= WITH search_condition */ + 361, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ + 361, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 361, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 361, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 361, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 361, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 361, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 361, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 361, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ + 361, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 361, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ + 380, /* (65) dnode_endpoint ::= NK_STRING */ + 380, /* (66) dnode_endpoint ::= NK_ID */ + 380, /* (67) dnode_endpoint ::= NK_IPTOKEN */ + 381, /* (68) force_opt ::= */ + 381, /* (69) force_opt ::= FORCE */ + 382, /* (70) unsafe_opt ::= UNSAFE */ + 361, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ + 361, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + 361, /* (73) cmd ::= ALTER LOCAL NK_STRING */ + 361, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 361, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 361, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 361, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 361, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 361, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 361, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 361, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 361, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 361, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 361, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 361, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 361, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 361, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ + 361, /* (88) cmd ::= USE db_name */ + 361, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ + 361, /* (90) cmd ::= FLUSH DATABASE db_name */ + 361, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ + 361, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 383, /* (93) not_exists_opt ::= IF NOT EXISTS */ + 383, /* (94) not_exists_opt ::= */ + 385, /* (95) exists_opt ::= IF EXISTS */ + 385, /* (96) exists_opt ::= */ + 384, /* (97) db_options ::= */ + 384, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ + 384, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ + 384, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ + 384, /* (101) db_options ::= db_options COMP NK_INTEGER */ + 384, /* (102) db_options ::= db_options DURATION NK_INTEGER */ + 384, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ + 384, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ + 384, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ + 384, /* (106) db_options ::= db_options KEEP integer_list */ + 384, /* (107) db_options ::= db_options KEEP variable_list */ + 384, /* (108) db_options ::= db_options PAGES NK_INTEGER */ + 384, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ + 384, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 384, /* (111) db_options ::= db_options PRECISION NK_STRING */ + 384, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ + 384, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ + 384, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 384, /* (115) db_options ::= db_options RETENTIONS retention_list */ + 384, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 384, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 384, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 384, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 384, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 384, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 384, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 384, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 384, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 384, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 384, /* (126) db_options ::= db_options TABLE_PREFIX signed */ + 384, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ + 384, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 386, /* (129) alter_db_options ::= alter_db_option */ + 386, /* (130) alter_db_options ::= alter_db_options alter_db_option */ + 394, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ + 394, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ + 394, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ + 394, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 394, /* (135) alter_db_option ::= KEEP integer_list */ + 394, /* (136) alter_db_option ::= KEEP variable_list */ + 394, /* (137) alter_db_option ::= PAGES NK_INTEGER */ + 394, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ + 394, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 394, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 394, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ + 394, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 394, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 394, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 394, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 394, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 390, /* (147) integer_list ::= NK_INTEGER */ + 390, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 391, /* (149) variable_list ::= NK_VARIABLE */ + 391, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 392, /* (151) retention_list ::= retention */ + 392, /* (152) retention_list ::= retention_list NK_COMMA retention */ + 395, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 395, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 387, /* (155) speed_opt ::= */ + 387, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ + 388, /* (157) start_opt ::= */ + 388, /* (158) start_opt ::= START WITH NK_INTEGER */ + 388, /* (159) start_opt ::= START WITH NK_STRING */ + 388, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 389, /* (161) end_opt ::= */ + 389, /* (162) end_opt ::= END WITH NK_INTEGER */ + 389, /* (163) end_opt ::= END WITH NK_STRING */ + 389, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 361, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 361, /* (166) cmd ::= CREATE TABLE multi_create_clause */ + 361, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 361, /* (168) cmd ::= DROP TABLE multi_drop_clause */ + 361, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ + 361, /* (170) cmd ::= ALTER TABLE alter_table_clause */ + 361, /* (171) cmd ::= ALTER STABLE alter_table_clause */ + 403, /* (172) alter_table_clause ::= full_table_name alter_table_options */ + 403, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + 403, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 403, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 403, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 403, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 403, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ + 403, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 403, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 403, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + 400, /* (182) multi_create_clause ::= create_subtable_clause */ + 400, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 408, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + 402, /* (185) multi_drop_clause ::= drop_table_clause */ + 402, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 411, /* (187) drop_table_clause ::= exists_opt full_table_name */ + 409, /* (188) specific_cols_opt ::= */ + 409, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 396, /* (190) full_table_name ::= table_name */ + 396, /* (191) full_table_name ::= db_name NK_DOT table_name */ + 397, /* (192) column_def_list ::= column_def */ + 397, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ + 413, /* (194) column_def ::= column_name type_name */ + 406, /* (195) type_name ::= BOOL */ + 406, /* (196) type_name ::= TINYINT */ + 406, /* (197) type_name ::= SMALLINT */ + 406, /* (198) type_name ::= INT */ + 406, /* (199) type_name ::= INTEGER */ + 406, /* (200) type_name ::= BIGINT */ + 406, /* (201) type_name ::= FLOAT */ + 406, /* (202) type_name ::= DOUBLE */ + 406, /* (203) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 406, /* (204) type_name ::= TIMESTAMP */ + 406, /* (205) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 406, /* (206) type_name ::= TINYINT UNSIGNED */ + 406, /* (207) type_name ::= SMALLINT UNSIGNED */ + 406, /* (208) type_name ::= INT UNSIGNED */ + 406, /* (209) type_name ::= BIGINT UNSIGNED */ + 406, /* (210) type_name ::= JSON */ + 406, /* (211) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 406, /* (212) type_name ::= MEDIUMBLOB */ + 406, /* (213) type_name ::= BLOB */ + 406, /* (214) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 406, /* (215) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 406, /* (216) type_name ::= DECIMAL */ + 406, /* (217) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 406, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 398, /* (219) tags_def_opt ::= */ + 398, /* (220) tags_def_opt ::= tags_def */ + 401, /* (221) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 399, /* (222) table_options ::= */ + 399, /* (223) table_options ::= table_options COMMENT NK_STRING */ + 399, /* (224) table_options ::= table_options MAX_DELAY duration_list */ + 399, /* (225) table_options ::= table_options WATERMARK duration_list */ + 399, /* (226) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 399, /* (227) table_options ::= table_options TTL NK_INTEGER */ + 399, /* (228) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 399, /* (229) table_options ::= table_options DELETE_MARK duration_list */ + 404, /* (230) alter_table_options ::= alter_table_option */ + 404, /* (231) alter_table_options ::= alter_table_options alter_table_option */ + 416, /* (232) alter_table_option ::= COMMENT NK_STRING */ + 416, /* (233) alter_table_option ::= TTL NK_INTEGER */ + 414, /* (234) duration_list ::= duration_literal */ + 414, /* (235) duration_list ::= duration_list NK_COMMA duration_literal */ + 415, /* (236) rollup_func_list ::= rollup_func_name */ + 415, /* (237) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 418, /* (238) rollup_func_name ::= function_name */ + 418, /* (239) rollup_func_name ::= FIRST */ + 418, /* (240) rollup_func_name ::= LAST */ + 412, /* (241) col_name_list ::= col_name */ + 412, /* (242) col_name_list ::= col_name_list NK_COMMA col_name */ + 420, /* (243) col_name ::= column_name */ + 361, /* (244) cmd ::= SHOW DNODES */ + 361, /* (245) cmd ::= SHOW USERS */ + 361, /* (246) cmd ::= SHOW USER PRIVILEGES */ + 361, /* (247) cmd ::= SHOW db_kind_opt DATABASES */ + 361, /* (248) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 361, /* (249) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 361, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 361, /* (251) cmd ::= SHOW MNODES */ + 361, /* (252) cmd ::= SHOW QNODES */ + 361, /* (253) cmd ::= SHOW FUNCTIONS */ + 361, /* (254) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 361, /* (255) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 361, /* (256) cmd ::= SHOW STREAMS */ + 361, /* (257) cmd ::= SHOW ACCOUNTS */ + 361, /* (258) cmd ::= SHOW APPS */ + 361, /* (259) cmd ::= SHOW CONNECTIONS */ + 361, /* (260) cmd ::= SHOW LICENCES */ + 361, /* (261) cmd ::= SHOW GRANTS */ + 361, /* (262) cmd ::= SHOW GRANTS FULL */ + 361, /* (263) cmd ::= SHOW GRANTS LOGS */ + 361, /* (264) cmd ::= SHOW CLUSTER MACHINES */ + 361, /* (265) cmd ::= SHOW CREATE DATABASE db_name */ + 361, /* (266) cmd ::= SHOW CREATE TABLE full_table_name */ + 361, /* (267) cmd ::= SHOW CREATE STABLE full_table_name */ + 361, /* (268) cmd ::= SHOW QUERIES */ + 361, /* (269) cmd ::= SHOW SCORES */ + 361, /* (270) cmd ::= SHOW TOPICS */ + 361, /* (271) cmd ::= SHOW VARIABLES */ + 361, /* (272) cmd ::= SHOW CLUSTER VARIABLES */ + 361, /* (273) cmd ::= SHOW LOCAL VARIABLES */ + 361, /* (274) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 361, /* (275) cmd ::= SHOW BNODES */ + 361, /* (276) cmd ::= SHOW SNODES */ + 361, /* (277) cmd ::= SHOW CLUSTER */ + 361, /* (278) cmd ::= SHOW TRANSACTIONS */ + 361, /* (279) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 361, /* (280) cmd ::= SHOW CONSUMERS */ + 361, /* (281) cmd ::= SHOW SUBSCRIPTIONS */ + 361, /* (282) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 361, /* (283) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 361, /* (284) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 361, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 361, /* (286) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 361, /* (287) cmd ::= SHOW VNODES */ + 361, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */ + 361, /* (289) cmd ::= SHOW CLUSTER ALIVE */ + 361, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 361, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */ + 361, /* (292) cmd ::= SHOW COMPACTS */ + 361, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */ + 422, /* (294) table_kind_db_name_cond_opt ::= */ + 422, /* (295) table_kind_db_name_cond_opt ::= table_kind */ + 422, /* (296) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 422, /* (297) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 428, /* (298) table_kind ::= NORMAL */ + 428, /* (299) table_kind ::= CHILD */ + 424, /* (300) db_name_cond_opt ::= */ + 424, /* (301) db_name_cond_opt ::= db_name NK_DOT */ + 423, /* (302) like_pattern_opt ::= */ + 423, /* (303) like_pattern_opt ::= LIKE NK_STRING */ + 425, /* (304) table_name_cond ::= table_name */ + 426, /* (305) from_db_opt ::= */ + 426, /* (306) from_db_opt ::= FROM db_name */ + 427, /* (307) tag_list_opt ::= */ + 427, /* (308) tag_list_opt ::= tag_item */ + 427, /* (309) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 429, /* (310) tag_item ::= TBNAME */ + 429, /* (311) tag_item ::= QTAGS */ + 429, /* (312) tag_item ::= column_name */ + 429, /* (313) tag_item ::= column_name column_alias */ + 429, /* (314) tag_item ::= column_name AS column_alias */ + 421, /* (315) db_kind_opt ::= */ + 421, /* (316) db_kind_opt ::= USER */ + 421, /* (317) db_kind_opt ::= SYSTEM */ + 361, /* (318) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 361, /* (319) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 361, /* (320) cmd ::= DROP INDEX exists_opt full_index_name */ + 432, /* (321) full_index_name ::= index_name */ + 432, /* (322) full_index_name ::= db_name NK_DOT index_name */ + 431, /* (323) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 431, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + 434, /* (325) func_list ::= func */ + 434, /* (326) func_list ::= func_list NK_COMMA func */ + 437, /* (327) func ::= sma_func_name NK_LP expression_list NK_RP */ + 438, /* (328) sma_func_name ::= function_name */ + 438, /* (329) sma_func_name ::= COUNT */ + 438, /* (330) sma_func_name ::= FIRST */ + 438, /* (331) sma_func_name ::= LAST */ + 438, /* (332) sma_func_name ::= LAST_ROW */ + 436, /* (333) sma_stream_opt ::= */ + 436, /* (334) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 436, /* (335) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 436, /* (336) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 440, /* (337) with_meta ::= AS */ + 440, /* (338) with_meta ::= WITH META AS */ + 440, /* (339) with_meta ::= ONLY META AS */ + 361, /* (340) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 361, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 361, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 361, /* (343) cmd ::= DROP TOPIC exists_opt topic_name */ + 361, /* (344) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 361, /* (345) cmd ::= DESC full_table_name */ + 361, /* (346) cmd ::= DESCRIBE full_table_name */ + 361, /* (347) cmd ::= RESET QUERY CACHE */ + 361, /* (348) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 361, /* (349) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 444, /* (350) analyze_opt ::= */ + 444, /* (351) analyze_opt ::= ANALYZE */ + 445, /* (352) explain_options ::= */ + 445, /* (353) explain_options ::= explain_options VERBOSE NK_BOOL */ + 445, /* (354) explain_options ::= explain_options RATIO NK_FLOAT */ + 361, /* (355) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 361, /* (356) cmd ::= DROP FUNCTION exists_opt function_name */ + 448, /* (357) agg_func_opt ::= */ + 448, /* (358) agg_func_opt ::= AGGREGATE */ + 449, /* (359) bufsize_opt ::= */ + 449, /* (360) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 450, /* (361) language_opt ::= */ + 450, /* (362) language_opt ::= LANGUAGE NK_STRING */ + 447, /* (363) or_replace_opt ::= */ + 447, /* (364) or_replace_opt ::= OR REPLACE */ + 361, /* (365) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 361, /* (366) cmd ::= DROP VIEW exists_opt full_view_name */ + 451, /* (367) full_view_name ::= view_name */ + 451, /* (368) full_view_name ::= db_name NK_DOT view_name */ + 361, /* (369) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + 361, /* (370) cmd ::= DROP STREAM exists_opt stream_name */ + 361, /* (371) cmd ::= PAUSE STREAM exists_opt stream_name */ + 361, /* (372) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 455, /* (373) col_list_opt ::= */ + 455, /* (374) col_list_opt ::= NK_LP col_name_list NK_RP */ + 456, /* (375) tag_def_or_ref_opt ::= */ + 456, /* (376) tag_def_or_ref_opt ::= tags_def */ + 456, /* (377) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 454, /* (378) stream_options ::= */ + 454, /* (379) stream_options ::= stream_options TRIGGER AT_ONCE */ + 454, /* (380) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 454, /* (381) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 454, /* (382) stream_options ::= stream_options WATERMARK duration_literal */ + 454, /* (383) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 454, /* (384) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 454, /* (385) stream_options ::= stream_options DELETE_MARK duration_literal */ + 454, /* (386) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 457, /* (387) subtable_opt ::= */ + 457, /* (388) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 458, /* (389) ignore_opt ::= */ + 458, /* (390) ignore_opt ::= IGNORE UNTREATED */ + 361, /* (391) cmd ::= KILL CONNECTION NK_INTEGER */ + 361, /* (392) cmd ::= KILL QUERY NK_STRING */ + 361, /* (393) cmd ::= KILL TRANSACTION NK_INTEGER */ + 361, /* (394) cmd ::= KILL COMPACT NK_INTEGER */ + 361, /* (395) cmd ::= BALANCE VGROUP */ + 361, /* (396) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 361, /* (397) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 361, /* (398) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 361, /* (399) cmd ::= SPLIT VGROUP NK_INTEGER */ + 460, /* (400) on_vgroup_id ::= */ + 460, /* (401) on_vgroup_id ::= ON NK_INTEGER */ + 461, /* (402) dnode_list ::= DNODE NK_INTEGER */ + 461, /* (403) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 361, /* (404) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 361, /* (405) cmd ::= query_or_subquery */ + 361, /* (406) cmd ::= insert_query */ + 446, /* (407) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 446, /* (408) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 407, /* (409) tags_literal ::= NK_INTEGER */ + 407, /* (410) tags_literal ::= NK_PLUS NK_INTEGER */ + 407, /* (411) tags_literal ::= NK_MINUS NK_INTEGER */ + 407, /* (412) tags_literal ::= NK_FLOAT */ + 407, /* (413) tags_literal ::= NK_PLUS NK_FLOAT */ + 407, /* (414) tags_literal ::= NK_MINUS NK_FLOAT */ + 407, /* (415) tags_literal ::= NK_BIN */ + 407, /* (416) tags_literal ::= NK_PLUS NK_BIN */ + 407, /* (417) tags_literal ::= NK_MINUS NK_BIN */ + 407, /* (418) tags_literal ::= NK_HEX */ + 407, /* (419) tags_literal ::= NK_PLUS NK_HEX */ + 407, /* (420) tags_literal ::= NK_MINUS NK_HEX */ + 407, /* (421) tags_literal ::= NK_STRING */ + 407, /* (422) tags_literal ::= NK_BOOL */ + 407, /* (423) tags_literal ::= NULL */ + 407, /* (424) tags_literal ::= literal_func */ + 407, /* (425) tags_literal ::= literal_func NK_PLUS duration_literal */ + 407, /* (426) tags_literal ::= literal_func NK_MINUS duration_literal */ + 410, /* (427) tags_literal_list ::= tags_literal */ + 410, /* (428) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + 364, /* (429) literal ::= NK_INTEGER */ + 364, /* (430) literal ::= NK_FLOAT */ + 364, /* (431) literal ::= NK_STRING */ + 364, /* (432) literal ::= NK_BOOL */ + 364, /* (433) literal ::= TIMESTAMP NK_STRING */ + 364, /* (434) literal ::= duration_literal */ + 364, /* (435) literal ::= NULL */ + 364, /* (436) literal ::= NK_QUESTION */ + 417, /* (437) duration_literal ::= NK_VARIABLE */ + 393, /* (438) signed ::= NK_INTEGER */ + 393, /* (439) signed ::= NK_PLUS NK_INTEGER */ + 393, /* (440) signed ::= NK_MINUS NK_INTEGER */ + 393, /* (441) signed ::= NK_FLOAT */ + 393, /* (442) signed ::= NK_PLUS NK_FLOAT */ + 393, /* (443) signed ::= NK_MINUS NK_FLOAT */ + 463, /* (444) signed_literal ::= signed */ + 463, /* (445) signed_literal ::= NK_STRING */ + 463, /* (446) signed_literal ::= NK_BOOL */ + 463, /* (447) signed_literal ::= TIMESTAMP NK_STRING */ + 463, /* (448) signed_literal ::= duration_literal */ + 463, /* (449) signed_literal ::= NULL */ + 463, /* (450) signed_literal ::= literal_func */ + 463, /* (451) signed_literal ::= NK_QUESTION */ + 464, /* (452) literal_list ::= signed_literal */ + 464, /* (453) literal_list ::= literal_list NK_COMMA signed_literal */ + 376, /* (454) db_name ::= NK_ID */ + 377, /* (455) table_name ::= NK_ID */ + 405, /* (456) column_name ::= NK_ID */ + 419, /* (457) function_name ::= NK_ID */ + 452, /* (458) view_name ::= NK_ID */ + 465, /* (459) table_alias ::= NK_ID */ + 430, /* (460) column_alias ::= NK_ID */ + 430, /* (461) column_alias ::= NK_ALIAS */ + 369, /* (462) user_name ::= NK_ID */ + 378, /* (463) topic_name ::= NK_ID */ + 453, /* (464) stream_name ::= NK_ID */ + 443, /* (465) cgroup_name ::= NK_ID */ + 433, /* (466) index_name ::= NK_ID */ + 466, /* (467) expr_or_subquery ::= expression */ + 459, /* (468) expression ::= literal */ + 459, /* (469) expression ::= pseudo_column */ + 459, /* (470) expression ::= column_reference */ + 459, /* (471) expression ::= function_expression */ + 459, /* (472) expression ::= case_when_expression */ + 459, /* (473) expression ::= NK_LP expression NK_RP */ + 459, /* (474) expression ::= NK_PLUS expr_or_subquery */ + 459, /* (475) expression ::= NK_MINUS expr_or_subquery */ + 459, /* (476) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 459, /* (477) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 459, /* (478) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 459, /* (479) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 459, /* (480) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 459, /* (481) expression ::= column_reference NK_ARROW NK_STRING */ + 459, /* (482) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 459, /* (483) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 439, /* (484) expression_list ::= expr_or_subquery */ + 439, /* (485) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 468, /* (486) column_reference ::= column_name */ + 468, /* (487) column_reference ::= table_name NK_DOT column_name */ + 468, /* (488) column_reference ::= NK_ALIAS */ + 468, /* (489) column_reference ::= table_name NK_DOT NK_ALIAS */ + 467, /* (490) pseudo_column ::= ROWTS */ + 467, /* (491) pseudo_column ::= TBNAME */ + 467, /* (492) pseudo_column ::= table_name NK_DOT TBNAME */ + 467, /* (493) pseudo_column ::= QSTART */ + 467, /* (494) pseudo_column ::= QEND */ + 467, /* (495) pseudo_column ::= QDURATION */ + 467, /* (496) pseudo_column ::= WSTART */ + 467, /* (497) pseudo_column ::= WEND */ + 467, /* (498) pseudo_column ::= WDURATION */ + 467, /* (499) pseudo_column ::= IROWTS */ + 467, /* (500) pseudo_column ::= ISFILLED */ + 467, /* (501) pseudo_column ::= QTAGS */ + 469, /* (502) function_expression ::= function_name NK_LP expression_list NK_RP */ + 469, /* (503) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 469, /* (504) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 469, /* (505) function_expression ::= literal_func */ + 462, /* (506) literal_func ::= noarg_func NK_LP NK_RP */ + 462, /* (507) literal_func ::= NOW */ + 462, /* (508) literal_func ::= TODAY */ + 473, /* (509) noarg_func ::= NOW */ + 473, /* (510) noarg_func ::= TODAY */ + 473, /* (511) noarg_func ::= TIMEZONE */ + 473, /* (512) noarg_func ::= DATABASE */ + 473, /* (513) noarg_func ::= CLIENT_VERSION */ + 473, /* (514) noarg_func ::= SERVER_VERSION */ + 473, /* (515) noarg_func ::= SERVER_STATUS */ + 473, /* (516) noarg_func ::= CURRENT_USER */ + 473, /* (517) noarg_func ::= USER */ + 471, /* (518) star_func ::= COUNT */ + 471, /* (519) star_func ::= FIRST */ + 471, /* (520) star_func ::= LAST */ + 471, /* (521) star_func ::= LAST_ROW */ + 472, /* (522) star_func_para_list ::= NK_STAR */ + 472, /* (523) star_func_para_list ::= other_para_list */ + 474, /* (524) other_para_list ::= star_func_para */ + 474, /* (525) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 475, /* (526) star_func_para ::= expr_or_subquery */ + 475, /* (527) star_func_para ::= table_name NK_DOT NK_STAR */ + 470, /* (528) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 470, /* (529) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 476, /* (530) when_then_list ::= when_then_expr */ + 476, /* (531) when_then_list ::= when_then_list when_then_expr */ + 479, /* (532) when_then_expr ::= WHEN common_expression THEN common_expression */ + 477, /* (533) case_when_else_opt ::= */ + 477, /* (534) case_when_else_opt ::= ELSE common_expression */ + 480, /* (535) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 480, /* (536) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 480, /* (537) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 480, /* (538) predicate ::= expr_or_subquery IS NULL */ + 480, /* (539) predicate ::= expr_or_subquery IS NOT NULL */ + 480, /* (540) predicate ::= expr_or_subquery in_op in_predicate_value */ + 481, /* (541) compare_op ::= NK_LT */ + 481, /* (542) compare_op ::= NK_GT */ + 481, /* (543) compare_op ::= NK_LE */ + 481, /* (544) compare_op ::= NK_GE */ + 481, /* (545) compare_op ::= NK_NE */ + 481, /* (546) compare_op ::= NK_EQ */ + 481, /* (547) compare_op ::= LIKE */ + 481, /* (548) compare_op ::= NOT LIKE */ + 481, /* (549) compare_op ::= MATCH */ + 481, /* (550) compare_op ::= NMATCH */ + 481, /* (551) compare_op ::= CONTAINS */ + 482, /* (552) in_op ::= IN */ + 482, /* (553) in_op ::= NOT IN */ + 483, /* (554) in_predicate_value ::= NK_LP literal_list NK_RP */ + 484, /* (555) boolean_value_expression ::= boolean_primary */ + 484, /* (556) boolean_value_expression ::= NOT boolean_primary */ + 484, /* (557) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 484, /* (558) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 485, /* (559) boolean_primary ::= predicate */ + 485, /* (560) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 478, /* (561) common_expression ::= expr_or_subquery */ + 478, /* (562) common_expression ::= boolean_value_expression */ + 486, /* (563) from_clause_opt ::= */ + 486, /* (564) from_clause_opt ::= FROM table_reference_list */ + 487, /* (565) table_reference_list ::= table_reference */ + 487, /* (566) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 488, /* (567) table_reference ::= table_primary */ + 488, /* (568) table_reference ::= joined_table */ + 489, /* (569) table_primary ::= table_name alias_opt */ + 489, /* (570) table_primary ::= db_name NK_DOT table_name alias_opt */ + 489, /* (571) table_primary ::= subquery alias_opt */ + 489, /* (572) table_primary ::= parenthesized_joined_table */ + 491, /* (573) alias_opt ::= */ + 491, /* (574) alias_opt ::= table_alias */ + 491, /* (575) alias_opt ::= AS table_alias */ + 493, /* (576) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 493, /* (577) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 490, /* (578) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 494, /* (579) join_type ::= */ + 494, /* (580) join_type ::= INNER */ + 494, /* (581) join_type ::= LEFT */ + 494, /* (582) join_type ::= RIGHT */ + 494, /* (583) join_type ::= FULL */ + 495, /* (584) join_subtype ::= */ + 495, /* (585) join_subtype ::= OUTER */ + 495, /* (586) join_subtype ::= SEMI */ + 495, /* (587) join_subtype ::= ANTI */ + 495, /* (588) join_subtype ::= ASOF */ + 495, /* (589) join_subtype ::= WINDOW */ + 496, /* (590) join_on_clause_opt ::= */ + 496, /* (591) join_on_clause_opt ::= ON search_condition */ + 497, /* (592) window_offset_clause_opt ::= */ + 497, /* (593) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + 499, /* (594) window_offset_literal ::= NK_VARIABLE */ + 499, /* (595) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 498, /* (596) jlimit_clause_opt ::= */ + 498, /* (597) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + 500, /* (598) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 501, /* (599) hint_list ::= */ + 501, /* (600) hint_list ::= NK_HINT */ + 503, /* (601) tag_mode_opt ::= */ + 503, /* (602) tag_mode_opt ::= TAGS */ + 502, /* (603) set_quantifier_opt ::= */ + 502, /* (604) set_quantifier_opt ::= DISTINCT */ + 502, /* (605) set_quantifier_opt ::= ALL */ + 504, /* (606) select_list ::= select_item */ + 504, /* (607) select_list ::= select_list NK_COMMA select_item */ + 512, /* (608) select_item ::= NK_STAR */ + 512, /* (609) select_item ::= common_expression */ + 512, /* (610) select_item ::= common_expression column_alias */ + 512, /* (611) select_item ::= common_expression AS column_alias */ + 512, /* (612) select_item ::= table_name NK_DOT NK_STAR */ + 442, /* (613) where_clause_opt ::= */ + 442, /* (614) where_clause_opt ::= WHERE search_condition */ + 505, /* (615) partition_by_clause_opt ::= */ + 505, /* (616) partition_by_clause_opt ::= PARTITION BY partition_list */ + 513, /* (617) partition_list ::= partition_item */ + 513, /* (618) partition_list ::= partition_list NK_COMMA partition_item */ + 514, /* (619) partition_item ::= expr_or_subquery */ + 514, /* (620) partition_item ::= expr_or_subquery column_alias */ + 514, /* (621) partition_item ::= expr_or_subquery AS column_alias */ + 509, /* (622) twindow_clause_opt ::= */ + 509, /* (623) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 509, /* (624) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 509, /* (625) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 509, /* (626) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 509, /* (627) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 509, /* (628) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 509, /* (629) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 435, /* (630) sliding_opt ::= */ + 435, /* (631) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 515, /* (632) interval_sliding_duration_literal ::= NK_VARIABLE */ + 515, /* (633) interval_sliding_duration_literal ::= NK_STRING */ + 515, /* (634) interval_sliding_duration_literal ::= NK_INTEGER */ + 508, /* (635) fill_opt ::= */ + 508, /* (636) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 508, /* (637) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 508, /* (638) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 516, /* (639) fill_mode ::= NONE */ + 516, /* (640) fill_mode ::= PREV */ + 516, /* (641) fill_mode ::= NULL */ + 516, /* (642) fill_mode ::= NULL_F */ + 516, /* (643) fill_mode ::= LINEAR */ + 516, /* (644) fill_mode ::= NEXT */ + 510, /* (645) group_by_clause_opt ::= */ + 510, /* (646) group_by_clause_opt ::= GROUP BY group_by_list */ + 517, /* (647) group_by_list ::= expr_or_subquery */ + 517, /* (648) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 511, /* (649) having_clause_opt ::= */ + 511, /* (650) having_clause_opt ::= HAVING search_condition */ + 506, /* (651) range_opt ::= */ + 506, /* (652) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 506, /* (653) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 507, /* (654) every_opt ::= */ + 507, /* (655) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 518, /* (656) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 519, /* (657) query_simple ::= query_specification */ + 519, /* (658) query_simple ::= union_query_expression */ + 523, /* (659) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 523, /* (660) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 524, /* (661) query_simple_or_subquery ::= query_simple */ + 524, /* (662) query_simple_or_subquery ::= subquery */ + 441, /* (663) query_or_subquery ::= query_expression */ + 441, /* (664) query_or_subquery ::= subquery */ + 520, /* (665) order_by_clause_opt ::= */ + 520, /* (666) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 521, /* (667) slimit_clause_opt ::= */ + 521, /* (668) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 521, /* (669) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 521, /* (670) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 522, /* (671) limit_clause_opt ::= */ + 522, /* (672) limit_clause_opt ::= LIMIT NK_INTEGER */ + 522, /* (673) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 522, /* (674) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 492, /* (675) subquery ::= NK_LP query_expression NK_RP */ + 492, /* (676) subquery ::= NK_LP subquery NK_RP */ + 379, /* (677) search_condition ::= common_expression */ + 525, /* (678) sort_specification_list ::= sort_specification */ + 525, /* (679) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 526, /* (680) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 527, /* (681) ordering_specification_opt ::= */ + 527, /* (682) ordering_specification_opt ::= ASC */ + 527, /* (683) ordering_specification_opt ::= DESC */ + 528, /* (684) null_ordering_opt ::= */ + 528, /* (685) null_ordering_opt ::= NULLS FIRST */ + 528, /* (686) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4261,10 +4349,10 @@ static const signed char yyRuleInfoNRhs[] = { -4, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ -5, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -5, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - -6, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + -6, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ -1, /* (182) multi_create_clause ::= create_subtable_clause */ -2, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ - -10, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + -10, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ -1, /* (185) multi_drop_clause ::= drop_table_clause */ -3, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ -2, /* (187) drop_table_clause ::= exists_opt full_table_name */ @@ -4489,263 +4577,284 @@ static const signed char yyRuleInfoNRhs[] = { -1, /* (406) cmd ::= insert_query */ -7, /* (407) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -4, /* (408) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (409) literal ::= NK_INTEGER */ - -1, /* (410) literal ::= NK_FLOAT */ - -1, /* (411) literal ::= NK_STRING */ - -1, /* (412) literal ::= NK_BOOL */ - -2, /* (413) literal ::= TIMESTAMP NK_STRING */ - -1, /* (414) literal ::= duration_literal */ - -1, /* (415) literal ::= NULL */ - -1, /* (416) literal ::= NK_QUESTION */ - -1, /* (417) duration_literal ::= NK_VARIABLE */ - -1, /* (418) signed ::= NK_INTEGER */ - -2, /* (419) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (420) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (421) signed ::= NK_FLOAT */ - -2, /* (422) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (423) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (424) signed_literal ::= signed */ - -1, /* (425) signed_literal ::= NK_STRING */ - -1, /* (426) signed_literal ::= NK_BOOL */ - -2, /* (427) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (428) signed_literal ::= duration_literal */ - -1, /* (429) signed_literal ::= NULL */ - -1, /* (430) signed_literal ::= literal_func */ - -1, /* (431) signed_literal ::= NK_QUESTION */ - -1, /* (432) literal_list ::= signed_literal */ - -3, /* (433) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (434) db_name ::= NK_ID */ - -1, /* (435) table_name ::= NK_ID */ - -1, /* (436) column_name ::= NK_ID */ - -1, /* (437) function_name ::= NK_ID */ - -1, /* (438) view_name ::= NK_ID */ - -1, /* (439) table_alias ::= NK_ID */ - -1, /* (440) column_alias ::= NK_ID */ - -1, /* (441) column_alias ::= NK_ALIAS */ - -1, /* (442) user_name ::= NK_ID */ - -1, /* (443) topic_name ::= NK_ID */ - -1, /* (444) stream_name ::= NK_ID */ - -1, /* (445) cgroup_name ::= NK_ID */ - -1, /* (446) index_name ::= NK_ID */ - -1, /* (447) expr_or_subquery ::= expression */ - -1, /* (448) expression ::= literal */ - -1, /* (449) expression ::= pseudo_column */ - -1, /* (450) expression ::= column_reference */ - -1, /* (451) expression ::= function_expression */ - -1, /* (452) expression ::= case_when_expression */ - -3, /* (453) expression ::= NK_LP expression NK_RP */ - -2, /* (454) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (455) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (456) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (457) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (458) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (459) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (460) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (461) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (462) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (463) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (464) expression_list ::= expr_or_subquery */ - -3, /* (465) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (466) column_reference ::= column_name */ - -3, /* (467) column_reference ::= table_name NK_DOT column_name */ - -1, /* (468) column_reference ::= NK_ALIAS */ - -3, /* (469) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (470) pseudo_column ::= ROWTS */ - -1, /* (471) pseudo_column ::= TBNAME */ - -3, /* (472) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (473) pseudo_column ::= QSTART */ - -1, /* (474) pseudo_column ::= QEND */ - -1, /* (475) pseudo_column ::= QDURATION */ - -1, /* (476) pseudo_column ::= WSTART */ - -1, /* (477) pseudo_column ::= WEND */ - -1, /* (478) pseudo_column ::= WDURATION */ - -1, /* (479) pseudo_column ::= IROWTS */ - -1, /* (480) pseudo_column ::= ISFILLED */ - -1, /* (481) pseudo_column ::= QTAGS */ - -4, /* (482) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (483) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (484) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -1, /* (485) function_expression ::= literal_func */ - -3, /* (486) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (487) literal_func ::= NOW */ - -1, /* (488) noarg_func ::= NOW */ - -1, /* (489) noarg_func ::= TODAY */ - -1, /* (490) noarg_func ::= TIMEZONE */ - -1, /* (491) noarg_func ::= DATABASE */ - -1, /* (492) noarg_func ::= CLIENT_VERSION */ - -1, /* (493) noarg_func ::= SERVER_VERSION */ - -1, /* (494) noarg_func ::= SERVER_STATUS */ - -1, /* (495) noarg_func ::= CURRENT_USER */ - -1, /* (496) noarg_func ::= USER */ - -1, /* (497) star_func ::= COUNT */ - -1, /* (498) star_func ::= FIRST */ - -1, /* (499) star_func ::= LAST */ - -1, /* (500) star_func ::= LAST_ROW */ - -1, /* (501) star_func_para_list ::= NK_STAR */ - -1, /* (502) star_func_para_list ::= other_para_list */ - -1, /* (503) other_para_list ::= star_func_para */ - -3, /* (504) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (505) star_func_para ::= expr_or_subquery */ - -3, /* (506) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (507) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (508) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (509) when_then_list ::= when_then_expr */ - -2, /* (510) when_then_list ::= when_then_list when_then_expr */ - -4, /* (511) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (512) case_when_else_opt ::= */ - -2, /* (513) case_when_else_opt ::= ELSE common_expression */ - -3, /* (514) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (515) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (516) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (517) predicate ::= expr_or_subquery IS NULL */ - -4, /* (518) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (519) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (520) compare_op ::= NK_LT */ - -1, /* (521) compare_op ::= NK_GT */ - -1, /* (522) compare_op ::= NK_LE */ - -1, /* (523) compare_op ::= NK_GE */ - -1, /* (524) compare_op ::= NK_NE */ - -1, /* (525) compare_op ::= NK_EQ */ - -1, /* (526) compare_op ::= LIKE */ - -2, /* (527) compare_op ::= NOT LIKE */ - -1, /* (528) compare_op ::= MATCH */ - -1, /* (529) compare_op ::= NMATCH */ - -1, /* (530) compare_op ::= CONTAINS */ - -1, /* (531) in_op ::= IN */ - -2, /* (532) in_op ::= NOT IN */ - -3, /* (533) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (534) boolean_value_expression ::= boolean_primary */ - -2, /* (535) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (536) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (537) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (538) boolean_primary ::= predicate */ - -3, /* (539) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (540) common_expression ::= expr_or_subquery */ - -1, /* (541) common_expression ::= boolean_value_expression */ - 0, /* (542) from_clause_opt ::= */ - -2, /* (543) from_clause_opt ::= FROM table_reference_list */ - -1, /* (544) table_reference_list ::= table_reference */ - -3, /* (545) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (546) table_reference ::= table_primary */ - -1, /* (547) table_reference ::= joined_table */ - -2, /* (548) table_primary ::= table_name alias_opt */ - -4, /* (549) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (550) table_primary ::= subquery alias_opt */ - -1, /* (551) table_primary ::= parenthesized_joined_table */ - 0, /* (552) alias_opt ::= */ - -1, /* (553) alias_opt ::= table_alias */ - -2, /* (554) alias_opt ::= AS table_alias */ - -3, /* (555) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (556) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -8, /* (557) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 0, /* (558) join_type ::= */ - -1, /* (559) join_type ::= INNER */ - -1, /* (560) join_type ::= LEFT */ - -1, /* (561) join_type ::= RIGHT */ - -1, /* (562) join_type ::= FULL */ - 0, /* (563) join_subtype ::= */ - -1, /* (564) join_subtype ::= OUTER */ - -1, /* (565) join_subtype ::= SEMI */ - -1, /* (566) join_subtype ::= ANTI */ - -1, /* (567) join_subtype ::= ASOF */ - -1, /* (568) join_subtype ::= WINDOW */ - 0, /* (569) join_on_clause_opt ::= */ - -2, /* (570) join_on_clause_opt ::= ON search_condition */ - 0, /* (571) window_offset_clause_opt ::= */ - -6, /* (572) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - -1, /* (573) window_offset_literal ::= NK_VARIABLE */ - -2, /* (574) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 0, /* (575) jlimit_clause_opt ::= */ - -2, /* (576) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - -14, /* (577) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (578) hint_list ::= */ - -1, /* (579) hint_list ::= NK_HINT */ - 0, /* (580) tag_mode_opt ::= */ - -1, /* (581) tag_mode_opt ::= TAGS */ - 0, /* (582) set_quantifier_opt ::= */ - -1, /* (583) set_quantifier_opt ::= DISTINCT */ - -1, /* (584) set_quantifier_opt ::= ALL */ - -1, /* (585) select_list ::= select_item */ - -3, /* (586) select_list ::= select_list NK_COMMA select_item */ - -1, /* (587) select_item ::= NK_STAR */ - -1, /* (588) select_item ::= common_expression */ - -2, /* (589) select_item ::= common_expression column_alias */ - -3, /* (590) select_item ::= common_expression AS column_alias */ - -3, /* (591) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (592) where_clause_opt ::= */ - -2, /* (593) where_clause_opt ::= WHERE search_condition */ - 0, /* (594) partition_by_clause_opt ::= */ - -3, /* (595) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (596) partition_list ::= partition_item */ - -3, /* (597) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (598) partition_item ::= expr_or_subquery */ - -2, /* (599) partition_item ::= expr_or_subquery column_alias */ - -3, /* (600) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (601) twindow_clause_opt ::= */ - -6, /* (602) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (603) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (604) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (605) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (606) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (607) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (608) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (609) sliding_opt ::= */ - -4, /* (610) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (611) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (612) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (613) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (614) fill_opt ::= */ - -4, /* (615) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (616) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (617) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (618) fill_mode ::= NONE */ - -1, /* (619) fill_mode ::= PREV */ - -1, /* (620) fill_mode ::= NULL */ - -1, /* (621) fill_mode ::= NULL_F */ - -1, /* (622) fill_mode ::= LINEAR */ - -1, /* (623) fill_mode ::= NEXT */ - 0, /* (624) group_by_clause_opt ::= */ - -3, /* (625) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (626) group_by_list ::= expr_or_subquery */ - -3, /* (627) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (628) having_clause_opt ::= */ - -2, /* (629) having_clause_opt ::= HAVING search_condition */ - 0, /* (630) range_opt ::= */ - -6, /* (631) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (632) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (633) every_opt ::= */ - -4, /* (634) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (635) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (636) query_simple ::= query_specification */ - -1, /* (637) query_simple ::= union_query_expression */ - -4, /* (638) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (639) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (640) query_simple_or_subquery ::= query_simple */ - -1, /* (641) query_simple_or_subquery ::= subquery */ - -1, /* (642) query_or_subquery ::= query_expression */ - -1, /* (643) query_or_subquery ::= subquery */ - 0, /* (644) order_by_clause_opt ::= */ - -3, /* (645) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (646) slimit_clause_opt ::= */ - -2, /* (647) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (648) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (649) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (650) limit_clause_opt ::= */ - -2, /* (651) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (652) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (653) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (654) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (655) subquery ::= NK_LP subquery NK_RP */ - -1, /* (656) search_condition ::= common_expression */ - -1, /* (657) sort_specification_list ::= sort_specification */ - -3, /* (658) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (659) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (660) ordering_specification_opt ::= */ - -1, /* (661) ordering_specification_opt ::= ASC */ - -1, /* (662) ordering_specification_opt ::= DESC */ - 0, /* (663) null_ordering_opt ::= */ - -2, /* (664) null_ordering_opt ::= NULLS FIRST */ - -2, /* (665) null_ordering_opt ::= NULLS LAST */ + -1, /* (409) tags_literal ::= NK_INTEGER */ + -2, /* (410) tags_literal ::= NK_PLUS NK_INTEGER */ + -2, /* (411) tags_literal ::= NK_MINUS NK_INTEGER */ + -1, /* (412) tags_literal ::= NK_FLOAT */ + -2, /* (413) tags_literal ::= NK_PLUS NK_FLOAT */ + -2, /* (414) tags_literal ::= NK_MINUS NK_FLOAT */ + -1, /* (415) tags_literal ::= NK_BIN */ + -2, /* (416) tags_literal ::= NK_PLUS NK_BIN */ + -2, /* (417) tags_literal ::= NK_MINUS NK_BIN */ + -1, /* (418) tags_literal ::= NK_HEX */ + -2, /* (419) tags_literal ::= NK_PLUS NK_HEX */ + -2, /* (420) tags_literal ::= NK_MINUS NK_HEX */ + -1, /* (421) tags_literal ::= NK_STRING */ + -1, /* (422) tags_literal ::= NK_BOOL */ + -1, /* (423) tags_literal ::= NULL */ + -1, /* (424) tags_literal ::= literal_func */ + -3, /* (425) tags_literal ::= literal_func NK_PLUS duration_literal */ + -3, /* (426) tags_literal ::= literal_func NK_MINUS duration_literal */ + -1, /* (427) tags_literal_list ::= tags_literal */ + -3, /* (428) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + -1, /* (429) literal ::= NK_INTEGER */ + -1, /* (430) literal ::= NK_FLOAT */ + -1, /* (431) literal ::= NK_STRING */ + -1, /* (432) literal ::= NK_BOOL */ + -2, /* (433) literal ::= TIMESTAMP NK_STRING */ + -1, /* (434) literal ::= duration_literal */ + -1, /* (435) literal ::= NULL */ + -1, /* (436) literal ::= NK_QUESTION */ + -1, /* (437) duration_literal ::= NK_VARIABLE */ + -1, /* (438) signed ::= NK_INTEGER */ + -2, /* (439) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (440) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (441) signed ::= NK_FLOAT */ + -2, /* (442) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (443) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (444) signed_literal ::= signed */ + -1, /* (445) signed_literal ::= NK_STRING */ + -1, /* (446) signed_literal ::= NK_BOOL */ + -2, /* (447) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (448) signed_literal ::= duration_literal */ + -1, /* (449) signed_literal ::= NULL */ + -1, /* (450) signed_literal ::= literal_func */ + -1, /* (451) signed_literal ::= NK_QUESTION */ + -1, /* (452) literal_list ::= signed_literal */ + -3, /* (453) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (454) db_name ::= NK_ID */ + -1, /* (455) table_name ::= NK_ID */ + -1, /* (456) column_name ::= NK_ID */ + -1, /* (457) function_name ::= NK_ID */ + -1, /* (458) view_name ::= NK_ID */ + -1, /* (459) table_alias ::= NK_ID */ + -1, /* (460) column_alias ::= NK_ID */ + -1, /* (461) column_alias ::= NK_ALIAS */ + -1, /* (462) user_name ::= NK_ID */ + -1, /* (463) topic_name ::= NK_ID */ + -1, /* (464) stream_name ::= NK_ID */ + -1, /* (465) cgroup_name ::= NK_ID */ + -1, /* (466) index_name ::= NK_ID */ + -1, /* (467) expr_or_subquery ::= expression */ + -1, /* (468) expression ::= literal */ + -1, /* (469) expression ::= pseudo_column */ + -1, /* (470) expression ::= column_reference */ + -1, /* (471) expression ::= function_expression */ + -1, /* (472) expression ::= case_when_expression */ + -3, /* (473) expression ::= NK_LP expression NK_RP */ + -2, /* (474) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (475) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (476) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (477) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (478) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (479) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (480) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (481) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (482) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (483) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (484) expression_list ::= expr_or_subquery */ + -3, /* (485) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (486) column_reference ::= column_name */ + -3, /* (487) column_reference ::= table_name NK_DOT column_name */ + -1, /* (488) column_reference ::= NK_ALIAS */ + -3, /* (489) column_reference ::= table_name NK_DOT NK_ALIAS */ + -1, /* (490) pseudo_column ::= ROWTS */ + -1, /* (491) pseudo_column ::= TBNAME */ + -3, /* (492) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (493) pseudo_column ::= QSTART */ + -1, /* (494) pseudo_column ::= QEND */ + -1, /* (495) pseudo_column ::= QDURATION */ + -1, /* (496) pseudo_column ::= WSTART */ + -1, /* (497) pseudo_column ::= WEND */ + -1, /* (498) pseudo_column ::= WDURATION */ + -1, /* (499) pseudo_column ::= IROWTS */ + -1, /* (500) pseudo_column ::= ISFILLED */ + -1, /* (501) pseudo_column ::= QTAGS */ + -4, /* (502) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (503) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (504) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -1, /* (505) function_expression ::= literal_func */ + -3, /* (506) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (507) literal_func ::= NOW */ + -1, /* (508) literal_func ::= TODAY */ + -1, /* (509) noarg_func ::= NOW */ + -1, /* (510) noarg_func ::= TODAY */ + -1, /* (511) noarg_func ::= TIMEZONE */ + -1, /* (512) noarg_func ::= DATABASE */ + -1, /* (513) noarg_func ::= CLIENT_VERSION */ + -1, /* (514) noarg_func ::= SERVER_VERSION */ + -1, /* (515) noarg_func ::= SERVER_STATUS */ + -1, /* (516) noarg_func ::= CURRENT_USER */ + -1, /* (517) noarg_func ::= USER */ + -1, /* (518) star_func ::= COUNT */ + -1, /* (519) star_func ::= FIRST */ + -1, /* (520) star_func ::= LAST */ + -1, /* (521) star_func ::= LAST_ROW */ + -1, /* (522) star_func_para_list ::= NK_STAR */ + -1, /* (523) star_func_para_list ::= other_para_list */ + -1, /* (524) other_para_list ::= star_func_para */ + -3, /* (525) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (526) star_func_para ::= expr_or_subquery */ + -3, /* (527) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (528) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (529) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (530) when_then_list ::= when_then_expr */ + -2, /* (531) when_then_list ::= when_then_list when_then_expr */ + -4, /* (532) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (533) case_when_else_opt ::= */ + -2, /* (534) case_when_else_opt ::= ELSE common_expression */ + -3, /* (535) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (536) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (537) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (538) predicate ::= expr_or_subquery IS NULL */ + -4, /* (539) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (540) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (541) compare_op ::= NK_LT */ + -1, /* (542) compare_op ::= NK_GT */ + -1, /* (543) compare_op ::= NK_LE */ + -1, /* (544) compare_op ::= NK_GE */ + -1, /* (545) compare_op ::= NK_NE */ + -1, /* (546) compare_op ::= NK_EQ */ + -1, /* (547) compare_op ::= LIKE */ + -2, /* (548) compare_op ::= NOT LIKE */ + -1, /* (549) compare_op ::= MATCH */ + -1, /* (550) compare_op ::= NMATCH */ + -1, /* (551) compare_op ::= CONTAINS */ + -1, /* (552) in_op ::= IN */ + -2, /* (553) in_op ::= NOT IN */ + -3, /* (554) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (555) boolean_value_expression ::= boolean_primary */ + -2, /* (556) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (557) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (558) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (559) boolean_primary ::= predicate */ + -3, /* (560) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (561) common_expression ::= expr_or_subquery */ + -1, /* (562) common_expression ::= boolean_value_expression */ + 0, /* (563) from_clause_opt ::= */ + -2, /* (564) from_clause_opt ::= FROM table_reference_list */ + -1, /* (565) table_reference_list ::= table_reference */ + -3, /* (566) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (567) table_reference ::= table_primary */ + -1, /* (568) table_reference ::= joined_table */ + -2, /* (569) table_primary ::= table_name alias_opt */ + -4, /* (570) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (571) table_primary ::= subquery alias_opt */ + -1, /* (572) table_primary ::= parenthesized_joined_table */ + 0, /* (573) alias_opt ::= */ + -1, /* (574) alias_opt ::= table_alias */ + -2, /* (575) alias_opt ::= AS table_alias */ + -3, /* (576) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (577) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -8, /* (578) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 0, /* (579) join_type ::= */ + -1, /* (580) join_type ::= INNER */ + -1, /* (581) join_type ::= LEFT */ + -1, /* (582) join_type ::= RIGHT */ + -1, /* (583) join_type ::= FULL */ + 0, /* (584) join_subtype ::= */ + -1, /* (585) join_subtype ::= OUTER */ + -1, /* (586) join_subtype ::= SEMI */ + -1, /* (587) join_subtype ::= ANTI */ + -1, /* (588) join_subtype ::= ASOF */ + -1, /* (589) join_subtype ::= WINDOW */ + 0, /* (590) join_on_clause_opt ::= */ + -2, /* (591) join_on_clause_opt ::= ON search_condition */ + 0, /* (592) window_offset_clause_opt ::= */ + -6, /* (593) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + -1, /* (594) window_offset_literal ::= NK_VARIABLE */ + -2, /* (595) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 0, /* (596) jlimit_clause_opt ::= */ + -2, /* (597) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + -14, /* (598) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (599) hint_list ::= */ + -1, /* (600) hint_list ::= NK_HINT */ + 0, /* (601) tag_mode_opt ::= */ + -1, /* (602) tag_mode_opt ::= TAGS */ + 0, /* (603) set_quantifier_opt ::= */ + -1, /* (604) set_quantifier_opt ::= DISTINCT */ + -1, /* (605) set_quantifier_opt ::= ALL */ + -1, /* (606) select_list ::= select_item */ + -3, /* (607) select_list ::= select_list NK_COMMA select_item */ + -1, /* (608) select_item ::= NK_STAR */ + -1, /* (609) select_item ::= common_expression */ + -2, /* (610) select_item ::= common_expression column_alias */ + -3, /* (611) select_item ::= common_expression AS column_alias */ + -3, /* (612) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (613) where_clause_opt ::= */ + -2, /* (614) where_clause_opt ::= WHERE search_condition */ + 0, /* (615) partition_by_clause_opt ::= */ + -3, /* (616) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (617) partition_list ::= partition_item */ + -3, /* (618) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (619) partition_item ::= expr_or_subquery */ + -2, /* (620) partition_item ::= expr_or_subquery column_alias */ + -3, /* (621) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (622) twindow_clause_opt ::= */ + -6, /* (623) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (624) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (625) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (626) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (627) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + -4, /* (628) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (629) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (630) sliding_opt ::= */ + -4, /* (631) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (632) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (633) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (634) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (635) fill_opt ::= */ + -4, /* (636) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (637) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (638) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (639) fill_mode ::= NONE */ + -1, /* (640) fill_mode ::= PREV */ + -1, /* (641) fill_mode ::= NULL */ + -1, /* (642) fill_mode ::= NULL_F */ + -1, /* (643) fill_mode ::= LINEAR */ + -1, /* (644) fill_mode ::= NEXT */ + 0, /* (645) group_by_clause_opt ::= */ + -3, /* (646) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (647) group_by_list ::= expr_or_subquery */ + -3, /* (648) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (649) having_clause_opt ::= */ + -2, /* (650) having_clause_opt ::= HAVING search_condition */ + 0, /* (651) range_opt ::= */ + -6, /* (652) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (653) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (654) every_opt ::= */ + -4, /* (655) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (656) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (657) query_simple ::= query_specification */ + -1, /* (658) query_simple ::= union_query_expression */ + -4, /* (659) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (660) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (661) query_simple_or_subquery ::= query_simple */ + -1, /* (662) query_simple_or_subquery ::= subquery */ + -1, /* (663) query_or_subquery ::= query_expression */ + -1, /* (664) query_or_subquery ::= subquery */ + 0, /* (665) order_by_clause_opt ::= */ + -3, /* (666) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (667) slimit_clause_opt ::= */ + -2, /* (668) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (669) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (670) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (671) limit_clause_opt ::= */ + -2, /* (672) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (673) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (674) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (675) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (676) subquery ::= NK_LP subquery NK_RP */ + -1, /* (677) search_condition ::= common_expression */ + -1, /* (678) sort_specification_list ::= sort_specification */ + -3, /* (679) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (680) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (681) ordering_specification_opt ::= */ + -1, /* (682) ordering_specification_opt ::= ASC */ + -1, /* (683) ordering_specification_opt ::= DESC */ + 0, /* (684) null_ordering_opt ::= */ + -2, /* (685) null_ordering_opt ::= NULLS FIRST */ + -2, /* (686) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4837,11 +4946,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,360,&yymsp[0].minor); + yy_destructor(yypParser,362,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,361,&yymsp[0].minor); + yy_destructor(yypParser,363,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -4855,20 +4964,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10); case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11); -{ yy_destructor(yypParser,360,&yymsp[-2].minor); +{ yy_destructor(yypParser,362,&yymsp[-2].minor); { } - yy_destructor(yypParser,362,&yymsp[0].minor); + yy_destructor(yypParser,364,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,363,&yymsp[0].minor); +{ yy_destructor(yypParser,365,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,361,&yymsp[-1].minor); +{ yy_destructor(yypParser,363,&yymsp[-1].minor); { } - yy_destructor(yypParser,363,&yymsp[0].minor); + yy_destructor(yypParser,365,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -4882,18 +4991,18 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,362,&yymsp[0].minor); + yy_destructor(yypParser,364,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy124 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy124 = yylhsminor.yy124; +{ yylhsminor.yy608 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy608 = yylhsminor.yy608; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy124 = addNodeToList(pCxt, yymsp[-2].minor.yy124, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy124 = yylhsminor.yy124; +{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy608 = yylhsminor.yy608; break; case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy124 = yymsp[0].minor.yy124; } +{ yymsp[-1].minor.yy608 = yymsp[0].minor.yy608; } break; case 27: /* white_list_opt ::= */ case 188: /* specific_cols_opt ::= */ yytestcase(yyruleno==188); @@ -4901,139 +5010,139 @@ static YYACTIONTYPE yy_reduce( case 307: /* tag_list_opt ::= */ yytestcase(yyruleno==307); case 373: /* col_list_opt ::= */ yytestcase(yyruleno==373); case 375: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==375); - case 594: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==594); - case 624: /* group_by_clause_opt ::= */ yytestcase(yyruleno==624); - case 644: /* order_by_clause_opt ::= */ yytestcase(yyruleno==644); -{ yymsp[1].minor.yy124 = NULL; } + case 615: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==615); + case 645: /* group_by_clause_opt ::= */ yytestcase(yyruleno==645); + case 665: /* order_by_clause_opt ::= */ yytestcase(yyruleno==665); +{ yymsp[1].minor.yy608 = NULL; } break; case 28: /* white_list_opt ::= white_list */ case 220: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==220); case 376: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==376); - case 502: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==502); -{ yylhsminor.yy124 = yymsp[0].minor.yy124; } - yymsp[0].minor.yy124 = yylhsminor.yy124; + case 523: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==523); +{ yylhsminor.yy608 = yymsp[0].minor.yy608; } + yymsp[0].minor.yy608 = yylhsminor.yy608; break; case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy29, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy803); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy124); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy803, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy337); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy608); } break; case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 33: /* cmd ::= ALTER USER user_name ADD white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy124); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy608); } break; case 34: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy124); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy608); } break; case 35: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy803); } break; case 36: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy803 = 1; } +{ yymsp[1].minor.yy337 = 1; } break; case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy803 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy337 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 38: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy459, &yymsp[-3].minor.yy147, &yymsp[0].minor.yy29, yymsp[-2].minor.yy812); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy777, &yymsp[-3].minor.yy187, &yymsp[0].minor.yy803, yymsp[-2].minor.yy614); } break; case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy459, &yymsp[-3].minor.yy147, &yymsp[0].minor.yy29, yymsp[-2].minor.yy812); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy777, &yymsp[-3].minor.yy187, &yymsp[0].minor.yy803, yymsp[-2].minor.yy614); } break; case 40: /* privileges ::= ALL */ -{ yymsp[0].minor.yy459 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_ALL; } break; case 41: /* privileges ::= priv_type_list */ case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43); -{ yylhsminor.yy459 = yymsp[0].minor.yy459; } - yymsp[0].minor.yy459 = yylhsminor.yy459; +{ yylhsminor.yy777 = yymsp[0].minor.yy777; } + yymsp[0].minor.yy777 = yylhsminor.yy777; break; case 42: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy459 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy459 = yymsp[-2].minor.yy459 | yymsp[0].minor.yy459; } - yymsp[-2].minor.yy459 = yylhsminor.yy459; +{ yylhsminor.yy777 = yymsp[-2].minor.yy777 | yymsp[0].minor.yy777; } + yymsp[-2].minor.yy777 = yylhsminor.yy777; break; case 45: /* priv_type ::= READ */ -{ yymsp[0].minor.yy459 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_READ; } break; case 46: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy459 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_WRITE; } break; case 47: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy459 = PRIVILEGE_TYPE_ALTER; } +{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_ALTER; } break; case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy147.first = yymsp[-2].minor.yy0; yylhsminor.yy147.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy147 = yylhsminor.yy147; +{ yylhsminor.yy187.first = yymsp[-2].minor.yy0; yylhsminor.yy187.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy187 = yylhsminor.yy187; break; case 49: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy147.first = yymsp[-2].minor.yy29; yylhsminor.yy147.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy147 = yylhsminor.yy147; +{ yylhsminor.yy187.first = yymsp[-2].minor.yy803; yylhsminor.yy187.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy187 = yylhsminor.yy187; break; case 50: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy147.first = yymsp[-2].minor.yy29; yylhsminor.yy147.second = yymsp[0].minor.yy29; } - yymsp[-2].minor.yy147 = yylhsminor.yy147; +{ yylhsminor.yy187.first = yymsp[-2].minor.yy803; yylhsminor.yy187.second = yymsp[0].minor.yy803; } + yymsp[-2].minor.yy187 = yylhsminor.yy187; break; case 51: /* priv_level ::= topic_name */ -{ yylhsminor.yy147.first = yymsp[0].minor.yy29; yylhsminor.yy147.second = nil_token; } - yymsp[0].minor.yy147 = yylhsminor.yy147; +{ yylhsminor.yy187.first = yymsp[0].minor.yy803; yylhsminor.yy187.second = nil_token; } + yymsp[0].minor.yy187 = yylhsminor.yy187; break; case 52: /* with_opt ::= */ case 157: /* start_opt ::= */ yytestcase(yyruleno==157); case 161: /* end_opt ::= */ yytestcase(yyruleno==161); case 302: /* like_pattern_opt ::= */ yytestcase(yyruleno==302); case 387: /* subtable_opt ::= */ yytestcase(yyruleno==387); - case 512: /* case_when_else_opt ::= */ yytestcase(yyruleno==512); - case 542: /* from_clause_opt ::= */ yytestcase(yyruleno==542); - case 569: /* join_on_clause_opt ::= */ yytestcase(yyruleno==569); - case 571: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==571); - case 575: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==575); - case 592: /* where_clause_opt ::= */ yytestcase(yyruleno==592); - case 601: /* twindow_clause_opt ::= */ yytestcase(yyruleno==601); - case 609: /* sliding_opt ::= */ yytestcase(yyruleno==609); - case 614: /* fill_opt ::= */ yytestcase(yyruleno==614); - case 628: /* having_clause_opt ::= */ yytestcase(yyruleno==628); - case 630: /* range_opt ::= */ yytestcase(yyruleno==630); - case 633: /* every_opt ::= */ yytestcase(yyruleno==633); - case 646: /* slimit_clause_opt ::= */ yytestcase(yyruleno==646); - case 650: /* limit_clause_opt ::= */ yytestcase(yyruleno==650); -{ yymsp[1].minor.yy812 = NULL; } + case 533: /* case_when_else_opt ::= */ yytestcase(yyruleno==533); + case 563: /* from_clause_opt ::= */ yytestcase(yyruleno==563); + case 590: /* join_on_clause_opt ::= */ yytestcase(yyruleno==590); + case 592: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==592); + case 596: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==596); + case 613: /* where_clause_opt ::= */ yytestcase(yyruleno==613); + case 622: /* twindow_clause_opt ::= */ yytestcase(yyruleno==622); + case 630: /* sliding_opt ::= */ yytestcase(yyruleno==630); + case 635: /* fill_opt ::= */ yytestcase(yyruleno==635); + case 649: /* having_clause_opt ::= */ yytestcase(yyruleno==649); + case 651: /* range_opt ::= */ yytestcase(yyruleno==651); + case 654: /* every_opt ::= */ yytestcase(yyruleno==654); + case 667: /* slimit_clause_opt ::= */ yytestcase(yyruleno==667); + case 671: /* limit_clause_opt ::= */ yytestcase(yyruleno==671); +{ yymsp[1].minor.yy614 = NULL; } break; case 53: /* with_opt ::= WITH search_condition */ - case 543: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==543); - case 570: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==570); - case 593: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==593); - case 629: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==629); -{ yymsp[-1].minor.yy812 = yymsp[0].minor.yy812; } + case 564: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==564); + case 591: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==591); + case 614: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==614); + case 650: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==650); +{ yymsp[-1].minor.yy614 = yymsp[0].minor.yy614; } break; case 54: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy29, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy803, NULL); } break; case 55: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0); } break; case 56: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy887, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy517, false); } break; case 57: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy29, yymsp[0].minor.yy887, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy803, yymsp[0].minor.yy517, false); } break; case 58: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy887); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy517); } break; case 59: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy29, false, yymsp[0].minor.yy887); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy803, false, yymsp[0].minor.yy517); } break; case 60: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -5057,34 +5166,34 @@ static YYACTIONTYPE yy_reduce( case 330: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==330); case 331: /* sma_func_name ::= LAST */ yytestcase(yyruleno==331); case 332: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==332); - case 434: /* db_name ::= NK_ID */ yytestcase(yyruleno==434); - case 435: /* table_name ::= NK_ID */ yytestcase(yyruleno==435); - case 436: /* column_name ::= NK_ID */ yytestcase(yyruleno==436); - case 437: /* function_name ::= NK_ID */ yytestcase(yyruleno==437); - case 438: /* view_name ::= NK_ID */ yytestcase(yyruleno==438); - case 439: /* table_alias ::= NK_ID */ yytestcase(yyruleno==439); - case 440: /* column_alias ::= NK_ID */ yytestcase(yyruleno==440); - case 441: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==441); - case 442: /* user_name ::= NK_ID */ yytestcase(yyruleno==442); - case 443: /* topic_name ::= NK_ID */ yytestcase(yyruleno==443); - case 444: /* stream_name ::= NK_ID */ yytestcase(yyruleno==444); - case 445: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==445); - case 446: /* index_name ::= NK_ID */ yytestcase(yyruleno==446); - case 488: /* noarg_func ::= NOW */ yytestcase(yyruleno==488); - case 489: /* noarg_func ::= TODAY */ yytestcase(yyruleno==489); - case 490: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==490); - case 491: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==491); - case 492: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==492); - case 493: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==493); - case 494: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==494); - case 495: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==495); - case 496: /* noarg_func ::= USER */ yytestcase(yyruleno==496); - case 497: /* star_func ::= COUNT */ yytestcase(yyruleno==497); - case 498: /* star_func ::= FIRST */ yytestcase(yyruleno==498); - case 499: /* star_func ::= LAST */ yytestcase(yyruleno==499); - case 500: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==500); -{ yylhsminor.yy29 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy29 = yylhsminor.yy29; + case 454: /* db_name ::= NK_ID */ yytestcase(yyruleno==454); + case 455: /* table_name ::= NK_ID */ yytestcase(yyruleno==455); + case 456: /* column_name ::= NK_ID */ yytestcase(yyruleno==456); + case 457: /* function_name ::= NK_ID */ yytestcase(yyruleno==457); + case 458: /* view_name ::= NK_ID */ yytestcase(yyruleno==458); + case 459: /* table_alias ::= NK_ID */ yytestcase(yyruleno==459); + case 460: /* column_alias ::= NK_ID */ yytestcase(yyruleno==460); + case 461: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==461); + case 462: /* user_name ::= NK_ID */ yytestcase(yyruleno==462); + case 463: /* topic_name ::= NK_ID */ yytestcase(yyruleno==463); + case 464: /* stream_name ::= NK_ID */ yytestcase(yyruleno==464); + case 465: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==465); + case 466: /* index_name ::= NK_ID */ yytestcase(yyruleno==466); + case 509: /* noarg_func ::= NOW */ yytestcase(yyruleno==509); + case 510: /* noarg_func ::= TODAY */ yytestcase(yyruleno==510); + case 511: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==511); + case 512: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==512); + case 513: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==513); + case 514: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==514); + case 515: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==515); + case 516: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==516); + case 517: /* noarg_func ::= USER */ yytestcase(yyruleno==517); + case 518: /* star_func ::= COUNT */ yytestcase(yyruleno==518); + case 519: /* star_func ::= FIRST */ yytestcase(yyruleno==519); + case 520: /* star_func ::= LAST */ yytestcase(yyruleno==520); + case 521: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==521); +{ yylhsminor.yy803 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy803 = yylhsminor.yy803; break; case 68: /* force_opt ::= */ case 94: /* not_exists_opt ::= */ yytestcase(yyruleno==94); @@ -5093,17 +5202,17 @@ static YYACTIONTYPE yy_reduce( case 357: /* agg_func_opt ::= */ yytestcase(yyruleno==357); case 363: /* or_replace_opt ::= */ yytestcase(yyruleno==363); case 389: /* ignore_opt ::= */ yytestcase(yyruleno==389); - case 580: /* tag_mode_opt ::= */ yytestcase(yyruleno==580); - case 582: /* set_quantifier_opt ::= */ yytestcase(yyruleno==582); -{ yymsp[1].minor.yy887 = false; } + case 601: /* tag_mode_opt ::= */ yytestcase(yyruleno==601); + case 603: /* set_quantifier_opt ::= */ yytestcase(yyruleno==603); +{ yymsp[1].minor.yy517 = false; } break; case 69: /* force_opt ::= FORCE */ case 70: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==70); case 351: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==351); case 358: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==358); - case 581: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==581); - case 583: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==583); -{ yymsp[0].minor.yy887 = true; } + case 602: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==602); + case 604: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==604); +{ yymsp[0].minor.yy517 = true; } break; case 71: /* cmd ::= ALTER CLUSTER NK_STRING */ { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -5151,241 +5260,241 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } break; case 86: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy887, &yymsp[-1].minor.yy29, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy517, &yymsp[-1].minor.yy803, yymsp[0].minor.yy614); } break; case 87: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy887, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } break; case 88: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy803); } break; case 89: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy29, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy803, yymsp[0].minor.yy614); } break; case 90: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy803); } break; case 91: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy29, yymsp[0].minor.yy760); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy803, yymsp[0].minor.yy294); } break; case 92: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy29, yymsp[-1].minor.yy812, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy803, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } break; case 93: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy887 = true; } +{ yymsp[-2].minor.yy517 = true; } break; case 95: /* exists_opt ::= IF EXISTS */ case 364: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==364); case 390: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==390); -{ yymsp[-1].minor.yy887 = true; } +{ yymsp[-1].minor.yy517 = true; } break; case 97: /* db_options ::= */ -{ yymsp[1].minor.yy812 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy614 = createDefaultDatabaseOptions(pCxt); } break; case 98: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 99: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 100: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 101: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 102: /* db_options ::= db_options DURATION NK_INTEGER */ case 103: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==103); -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 104: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 105: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 106: /* db_options ::= db_options KEEP integer_list */ case 107: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==107); -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_KEEP, yymsp[0].minor.yy124); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_KEEP, yymsp[0].minor.yy608); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 108: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 109: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 110: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 111: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 112: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 113: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 114: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 115: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_RETENTIONS, yymsp[0].minor.yy124); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_RETENTIONS, yymsp[0].minor.yy608); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 116: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 117: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 118: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 119: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 120: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-3].minor.yy812, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-3].minor.yy614, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; case 121: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 122: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-3].minor.yy812, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-3].minor.yy614, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; case 123: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 124: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 125: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 126: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy812); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy614); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 127: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy812); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy614); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 128: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy812 = setDatabaseOption(pCxt, yymsp[-2].minor.yy812, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 129: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy812 = createAlterDatabaseOptions(pCxt); yylhsminor.yy812 = setAlterDatabaseOption(pCxt, yylhsminor.yy812, &yymsp[0].minor.yy95); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterDatabaseOptions(pCxt); yylhsminor.yy614 = setAlterDatabaseOption(pCxt, yylhsminor.yy614, &yymsp[0].minor.yy511); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 130: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy812 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy812, &yymsp[0].minor.yy95); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy614, &yymsp[0].minor.yy511); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; case 131: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 132: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 133: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 134: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 135: /* alter_db_option ::= KEEP integer_list */ case 136: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==136); -{ yymsp[-1].minor.yy95.type = DB_OPTION_KEEP; yymsp[-1].minor.yy95.pList = yymsp[0].minor.yy124; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_KEEP; yymsp[-1].minor.yy511.pList = yymsp[0].minor.yy608; } break; case 137: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_PAGES; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_PAGES; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 138: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 139: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_WAL; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_WAL; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 140: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 141: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 142: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 143: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy95.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy95.val = t; + yymsp[-2].minor.yy511.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy511.val = t; } break; case 144: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 145: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy95.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy95.val = t; + yymsp[-2].minor.yy511.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy511.val = t; } break; case 146: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 147: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy124 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy124 = yylhsminor.yy124; +{ yylhsminor.yy608 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy608 = yylhsminor.yy608; break; case 148: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ case 403: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==403); -{ yylhsminor.yy124 = addNodeToList(pCxt, yymsp[-2].minor.yy124, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy124 = yylhsminor.yy124; +{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy608 = yylhsminor.yy608; break; case 149: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy124 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy124 = yylhsminor.yy124; +{ yylhsminor.yy608 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy608 = yylhsminor.yy608; break; case 150: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy124 = addNodeToList(pCxt, yymsp[-2].minor.yy124, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy124 = yylhsminor.yy124; +{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy608 = yylhsminor.yy608; break; case 151: /* retention_list ::= retention */ case 182: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==182); @@ -5395,14 +5504,15 @@ static YYACTIONTYPE yy_reduce( case 241: /* col_name_list ::= col_name */ yytestcase(yyruleno==241); case 308: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==308); case 325: /* func_list ::= func */ yytestcase(yyruleno==325); - case 432: /* literal_list ::= signed_literal */ yytestcase(yyruleno==432); - case 503: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==503); - case 509: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==509); - case 585: /* select_list ::= select_item */ yytestcase(yyruleno==585); - case 596: /* partition_list ::= partition_item */ yytestcase(yyruleno==596); - case 657: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==657); -{ yylhsminor.yy124 = createNodeList(pCxt, yymsp[0].minor.yy812); } - yymsp[0].minor.yy124 = yylhsminor.yy124; + case 427: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==427); + case 452: /* literal_list ::= signed_literal */ yytestcase(yyruleno==452); + case 524: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==524); + case 530: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==530); + case 606: /* select_list ::= select_item */ yytestcase(yyruleno==606); + case 617: /* partition_list ::= partition_item */ yytestcase(yyruleno==617); + case 678: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==678); +{ yylhsminor.yy608 = createNodeList(pCxt, yymsp[0].minor.yy614); } + yymsp[0].minor.yy608 = yylhsminor.yy608; break; case 152: /* retention_list ::= retention_list NK_COMMA retention */ case 186: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==186); @@ -5411,272 +5521,273 @@ static YYACTIONTYPE yy_reduce( case 242: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==242); case 309: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==309); case 326: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==326); - case 433: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==433); - case 504: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==504); - case 586: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==586); - case 597: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==597); - case 658: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==658); -{ yylhsminor.yy124 = addNodeToList(pCxt, yymsp[-2].minor.yy124, yymsp[0].minor.yy812); } - yymsp[-2].minor.yy124 = yylhsminor.yy124; + case 428: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==428); + case 453: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==453); + case 525: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==525); + case 607: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==607); + case 618: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==618); + case 679: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==679); +{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, yymsp[0].minor.yy614); } + yymsp[-2].minor.yy608 = yylhsminor.yy608; break; case 153: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ case 154: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==154); -{ yylhsminor.yy812 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 155: /* speed_opt ::= */ case 359: /* bufsize_opt ::= */ yytestcase(yyruleno==359); -{ yymsp[1].minor.yy760 = 0; } +{ yymsp[1].minor.yy294 = 0; } break; case 156: /* speed_opt ::= BWLIMIT NK_INTEGER */ case 360: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==360); -{ yymsp[-1].minor.yy760 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy294 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 158: /* start_opt ::= START WITH NK_INTEGER */ case 162: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==162); -{ yymsp[-2].minor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; case 159: /* start_opt ::= START WITH NK_STRING */ case 163: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==163); -{ yymsp[-2].minor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 160: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 164: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==164); -{ yymsp[-3].minor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-3].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 165: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 167: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==167); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy887, yymsp[-5].minor.yy812, yymsp[-3].minor.yy124, yymsp[-1].minor.yy124, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy517, yymsp[-5].minor.yy614, yymsp[-3].minor.yy608, yymsp[-1].minor.yy608, yymsp[0].minor.yy614); } break; case 166: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy124); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy608); } break; case 168: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy124); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy608); } break; case 169: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy887, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy517, yymsp[0].minor.yy614); } break; case 170: /* cmd ::= ALTER TABLE alter_table_clause */ case 405: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==405); case 406: /* cmd ::= insert_query */ yytestcase(yyruleno==406); -{ pCxt->pRootNode = yymsp[0].minor.yy812; } +{ pCxt->pRootNode = yymsp[0].minor.yy614; } break; case 171: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy812); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy614); } break; case 172: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy812 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy812, yymsp[0].minor.yy812); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; case 173: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy812 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy812, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy29, yymsp[0].minor.yy784); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; case 174: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy812 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy812, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy29); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy614, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy803); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; case 175: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy812 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy812, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy29, yymsp[0].minor.yy784); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; case 176: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy812 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy812, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy803, &yymsp[0].minor.yy803); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; case 177: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy812 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy812, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy29, yymsp[0].minor.yy784); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; case 178: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy812 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy812, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy29); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy614, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy803); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; case 179: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy812 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy812, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy29, yymsp[0].minor.yy784); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; case 180: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy812 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy812, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy803, &yymsp[0].minor.yy803); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; - case 181: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy812 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy812, &yymsp[-2].minor.yy29, yymsp[0].minor.yy812); } - yymsp[-5].minor.yy812 = yylhsminor.yy812; + case 181: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ +{ yylhsminor.yy614 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy614, &yymsp[-2].minor.yy803, yymsp[0].minor.yy614); } + yymsp[-5].minor.yy614 = yylhsminor.yy614; break; case 183: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 510: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==510); -{ yylhsminor.yy124 = addNodeToList(pCxt, yymsp[-1].minor.yy124, yymsp[0].minor.yy812); } - yymsp[-1].minor.yy124 = yylhsminor.yy124; + case 531: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==531); +{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-1].minor.yy608, yymsp[0].minor.yy614); } + yymsp[-1].minor.yy608 = yylhsminor.yy608; break; - case 184: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy812 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy887, yymsp[-8].minor.yy812, yymsp[-6].minor.yy812, yymsp[-5].minor.yy124, yymsp[-2].minor.yy124, yymsp[0].minor.yy812); } - yymsp[-9].minor.yy812 = yylhsminor.yy812; + case 184: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ +{ yylhsminor.yy614 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy517, yymsp[-8].minor.yy614, yymsp[-6].minor.yy614, yymsp[-5].minor.yy608, yymsp[-2].minor.yy608, yymsp[0].minor.yy614); } + yymsp[-9].minor.yy614 = yylhsminor.yy614; break; case 187: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy812 = createDropTableClause(pCxt, yymsp[-1].minor.yy887, yymsp[0].minor.yy812); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createDropTableClause(pCxt, yymsp[-1].minor.yy517, yymsp[0].minor.yy614); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; case 189: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ case 374: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==374); -{ yymsp[-2].minor.yy124 = yymsp[-1].minor.yy124; } +{ yymsp[-2].minor.yy608 = yymsp[-1].minor.yy608; } break; case 190: /* full_table_name ::= table_name */ -{ yylhsminor.yy812 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy29, NULL); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy803, NULL); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 191: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy812 = createRealTableNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29, NULL); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createRealTableNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803, NULL); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 194: /* column_def ::= column_name type_name */ -{ yylhsminor.yy812 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy29, yymsp[0].minor.yy784, NULL); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384, NULL); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; case 195: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 196: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 197: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 198: /* type_name ::= INT */ case 199: /* type_name ::= INTEGER */ yytestcase(yyruleno==199); -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_INT); } break; case 200: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 201: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 202: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 203: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy384 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 204: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 205: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy384 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 206: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy784 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy384 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 207: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy784 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy384 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 208: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy784 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy384 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 209: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy784 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy384 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 210: /* type_name ::= JSON */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 211: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy384 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 212: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 213: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 214: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy384 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 215: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy384 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } break; case 216: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 217: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy784 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy384 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 218: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy784 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy384 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 221: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ case 377: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==377); -{ yymsp[-3].minor.yy124 = yymsp[-1].minor.yy124; } +{ yymsp[-3].minor.yy608 = yymsp[-1].minor.yy608; } break; case 222: /* table_options ::= */ -{ yymsp[1].minor.yy812 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy614 = createDefaultTableOptions(pCxt); } break; case 223: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy812 = setTableOption(pCxt, yymsp[-2].minor.yy812, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 224: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy812 = setTableOption(pCxt, yymsp[-2].minor.yy812, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy124); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy608); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 225: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy812 = setTableOption(pCxt, yymsp[-2].minor.yy812, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy124); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy608); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 226: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy812 = setTableOption(pCxt, yymsp[-4].minor.yy812, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy124); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-4].minor.yy614, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy608); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; case 227: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy812 = setTableOption(pCxt, yymsp[-2].minor.yy812, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 228: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy812 = setTableOption(pCxt, yymsp[-4].minor.yy812, TABLE_OPTION_SMA, yymsp[-1].minor.yy124); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-4].minor.yy614, TABLE_OPTION_SMA, yymsp[-1].minor.yy608); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; case 229: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy812 = setTableOption(pCxt, yymsp[-2].minor.yy812, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy124); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy608); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 230: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy812 = createAlterTableOptions(pCxt); yylhsminor.yy812 = setTableOption(pCxt, yylhsminor.yy812, yymsp[0].minor.yy95.type, &yymsp[0].minor.yy95.val); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createAlterTableOptions(pCxt); yylhsminor.yy614 = setTableOption(pCxt, yylhsminor.yy614, yymsp[0].minor.yy511.type, &yymsp[0].minor.yy511.val); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 231: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy812 = setTableOption(pCxt, yymsp[-1].minor.yy812, yymsp[0].minor.yy95.type, &yymsp[0].minor.yy95.val); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-1].minor.yy614, yymsp[0].minor.yy511.type, &yymsp[0].minor.yy511.val); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; case 232: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy95.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 233: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy95.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy511.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } break; case 234: /* duration_list ::= duration_literal */ - case 464: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==464); -{ yylhsminor.yy124 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy812)); } - yymsp[0].minor.yy124 = yylhsminor.yy124; + case 484: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==484); +{ yylhsminor.yy608 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } + yymsp[0].minor.yy608 = yylhsminor.yy608; break; case 235: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 465: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==465); -{ yylhsminor.yy124 = addNodeToList(pCxt, yymsp[-2].minor.yy124, releaseRawExprNode(pCxt, yymsp[0].minor.yy812)); } - yymsp[-2].minor.yy124 = yylhsminor.yy124; + case 485: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==485); +{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } + yymsp[-2].minor.yy608 = yylhsminor.yy608; break; case 238: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy812 = createFunctionNode(pCxt, &yymsp[0].minor.yy29, NULL); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createFunctionNode(pCxt, &yymsp[0].minor.yy803, NULL); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 239: /* rollup_func_name ::= FIRST */ case 240: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==240); case 311: /* tag_item ::= QTAGS */ yytestcase(yyruleno==311); -{ yylhsminor.yy812 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 243: /* col_name ::= column_name */ case 312: /* tag_item ::= column_name */ yytestcase(yyruleno==312); -{ yylhsminor.yy812 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy29); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy803); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 244: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -5690,19 +5801,19 @@ static YYACTIONTYPE yy_reduce( case 247: /* cmd ::= SHOW db_kind_opt DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy789); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy769); } break; case 248: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy667, yymsp[0].minor.yy812, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy131, yymsp[0].minor.yy614, OP_TYPE_LIKE); } break; case 249: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy812, yymsp[0].minor.yy812, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy614, yymsp[0].minor.yy614, OP_TYPE_LIKE); } break; case 250: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy812, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy614, NULL, OP_TYPE_LIKE); } break; case 251: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -5714,10 +5825,10 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 254: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy812, yymsp[-1].minor.yy812, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy614, yymsp[-1].minor.yy614, OP_TYPE_EQUAL); } break; case 255: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy29), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy29), OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy803), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803), OP_TYPE_EQUAL); } break; case 256: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -5745,13 +5856,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } break; case 265: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy803); } break; case 266: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy614); } break; case 267: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy614); } break; case 268: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -5770,7 +5881,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; case 274: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy614); } break; case 275: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } @@ -5785,7 +5896,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 279: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy614); } break; case 280: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -5794,16 +5905,16 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; case 282: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy812, yymsp[-1].minor.yy812, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy614, yymsp[-1].minor.yy614, OP_TYPE_EQUAL); } break; case 283: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy29), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy29), OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy803), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803), OP_TYPE_EQUAL); } break; case 284: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy812, yymsp[0].minor.yy812, yymsp[-3].minor.yy124); } +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy614, yymsp[0].minor.yy614, yymsp[-3].minor.yy608); } break; case 285: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy29), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy29), yymsp[-4].minor.yy124); } +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy803), yymsp[-4].minor.yy608); } break; case 286: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } @@ -5812,16 +5923,16 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } break; case 288: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy812, QUERY_NODE_SHOW_DB_ALIVE_STMT); } +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy614, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; case 289: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; case 290: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy812, yymsp[0].minor.yy812, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy614, yymsp[0].minor.yy614, OP_TYPE_LIKE); } break; case 291: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy614); } break; case 292: /* cmd ::= SHOW COMPACTS */ { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } @@ -5830,232 +5941,232 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; case 294: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy667.kind = SHOW_KIND_ALL; yymsp[1].minor.yy667.dbName = nil_token; } +{ yymsp[1].minor.yy131.kind = SHOW_KIND_ALL; yymsp[1].minor.yy131.dbName = nil_token; } break; case 295: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy667.kind = yymsp[0].minor.yy789; yylhsminor.yy667.dbName = nil_token; } - yymsp[0].minor.yy667 = yylhsminor.yy667; +{ yylhsminor.yy131.kind = yymsp[0].minor.yy769; yylhsminor.yy131.dbName = nil_token; } + yymsp[0].minor.yy131 = yylhsminor.yy131; break; case 296: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy667.kind = SHOW_KIND_ALL; yylhsminor.yy667.dbName = yymsp[-1].minor.yy29; } - yymsp[-1].minor.yy667 = yylhsminor.yy667; +{ yylhsminor.yy131.kind = SHOW_KIND_ALL; yylhsminor.yy131.dbName = yymsp[-1].minor.yy803; } + yymsp[-1].minor.yy131 = yylhsminor.yy131; break; case 297: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy667.kind = yymsp[-2].minor.yy789; yylhsminor.yy667.dbName = yymsp[-1].minor.yy29; } - yymsp[-2].minor.yy667 = yylhsminor.yy667; +{ yylhsminor.yy131.kind = yymsp[-2].minor.yy769; yylhsminor.yy131.dbName = yymsp[-1].minor.yy803; } + yymsp[-2].minor.yy131 = yylhsminor.yy131; break; case 298: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy789 = SHOW_KIND_TABLES_NORMAL; } +{ yymsp[0].minor.yy769 = SHOW_KIND_TABLES_NORMAL; } break; case 299: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy789 = SHOW_KIND_TABLES_CHILD; } +{ yymsp[0].minor.yy769 = SHOW_KIND_TABLES_CHILD; } break; case 300: /* db_name_cond_opt ::= */ case 305: /* from_db_opt ::= */ yytestcase(yyruleno==305); -{ yymsp[1].minor.yy812 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy614 = createDefaultDatabaseCondValue(pCxt); } break; case 301: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy812 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy29); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy803); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; case 303: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 304: /* table_name_cond ::= table_name */ -{ yylhsminor.yy812 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy29); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 306: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy812 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy29); } +{ yymsp[-1].minor.yy614 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803); } break; case 310: /* tag_item ::= TBNAME */ -{ yylhsminor.yy812 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 313: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy812 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy29), &yymsp[0].minor.yy29); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy803), &yymsp[0].minor.yy803); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; case 314: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy812 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy29), &yymsp[0].minor.yy29); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy803), &yymsp[0].minor.yy803); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 315: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy789 = SHOW_KIND_ALL; } +{ yymsp[1].minor.yy769 = SHOW_KIND_ALL; } break; case 316: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy789 = SHOW_KIND_DATABASES_USER; } +{ yymsp[0].minor.yy769 = SHOW_KIND_DATABASES_USER; } break; case 317: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy789 = SHOW_KIND_DATABASES_SYSTEM; } +{ yymsp[0].minor.yy769 = SHOW_KIND_DATABASES_SYSTEM; } break; case 318: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy887, yymsp[-3].minor.yy812, yymsp[-1].minor.yy812, NULL, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy517, yymsp[-3].minor.yy614, yymsp[-1].minor.yy614, NULL, yymsp[0].minor.yy614); } break; case 319: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy887, yymsp[-5].minor.yy812, yymsp[-3].minor.yy812, yymsp[-1].minor.yy124, NULL); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy517, yymsp[-5].minor.yy614, yymsp[-3].minor.yy614, yymsp[-1].minor.yy608, NULL); } break; case 320: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy887, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy517, yymsp[0].minor.yy614); } break; case 321: /* full_index_name ::= index_name */ -{ yylhsminor.yy812 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy29); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy803); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 322: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy812 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 323: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy812 = createIndexOption(pCxt, yymsp[-7].minor.yy124, releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), NULL, yymsp[-1].minor.yy812, yymsp[0].minor.yy812); } +{ yymsp[-9].minor.yy614 = createIndexOption(pCxt, yymsp[-7].minor.yy608, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), NULL, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } break; case 324: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy812 = createIndexOption(pCxt, yymsp[-9].minor.yy124, releaseRawExprNode(pCxt, yymsp[-5].minor.yy812), releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), yymsp[-1].minor.yy812, yymsp[0].minor.yy812); } +{ yymsp[-11].minor.yy614 = createIndexOption(pCxt, yymsp[-9].minor.yy608, releaseRawExprNode(pCxt, yymsp[-5].minor.yy614), releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } break; case 327: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy812 = createFunctionNode(pCxt, &yymsp[-3].minor.yy29, yymsp[-1].minor.yy124); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createFunctionNode(pCxt, &yymsp[-3].minor.yy803, yymsp[-1].minor.yy608); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; case 328: /* sma_func_name ::= function_name */ - case 553: /* alias_opt ::= table_alias */ yytestcase(yyruleno==553); -{ yylhsminor.yy29 = yymsp[0].minor.yy29; } - yymsp[0].minor.yy29 = yylhsminor.yy29; + case 574: /* alias_opt ::= table_alias */ yytestcase(yyruleno==574); +{ yylhsminor.yy803 = yymsp[0].minor.yy803; } + yymsp[0].minor.yy803 = yylhsminor.yy803; break; case 333: /* sma_stream_opt ::= */ case 378: /* stream_options ::= */ yytestcase(yyruleno==378); -{ yymsp[1].minor.yy812 = createStreamOptions(pCxt); } +{ yymsp[1].minor.yy614 = createStreamOptions(pCxt); } break; case 334: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy812)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy812); yylhsminor.yy812 = yymsp[-2].minor.yy812; } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ ((SStreamOptions*)yymsp[-2].minor.yy614)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); yylhsminor.yy614 = yymsp[-2].minor.yy614; } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 335: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy812)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy812); yylhsminor.yy812 = yymsp[-2].minor.yy812; } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ ((SStreamOptions*)yymsp[-2].minor.yy614)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); yylhsminor.yy614 = yymsp[-2].minor.yy614; } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 336: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy812)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy812); yylhsminor.yy812 = yymsp[-2].minor.yy812; } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ ((SStreamOptions*)yymsp[-2].minor.yy614)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); yylhsminor.yy614 = yymsp[-2].minor.yy614; } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 337: /* with_meta ::= AS */ -{ yymsp[0].minor.yy760 = 0; } +{ yymsp[0].minor.yy294 = 0; } break; case 338: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy760 = 1; } +{ yymsp[-2].minor.yy294 = 1; } break; case 339: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy760 = 2; } +{ yymsp[-2].minor.yy294 = 2; } break; case 340: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy887, &yymsp[-2].minor.yy29, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy517, &yymsp[-2].minor.yy803, yymsp[0].minor.yy614); } break; case 341: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy887, &yymsp[-3].minor.yy29, &yymsp[0].minor.yy29, yymsp[-2].minor.yy760); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy517, &yymsp[-3].minor.yy803, &yymsp[0].minor.yy803, yymsp[-2].minor.yy294); } break; case 342: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy887, &yymsp[-4].minor.yy29, yymsp[-1].minor.yy812, yymsp[-3].minor.yy760, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy517, &yymsp[-4].minor.yy803, yymsp[-1].minor.yy614, yymsp[-3].minor.yy294, yymsp[0].minor.yy614); } break; case 343: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy887, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } break; case 344: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy887, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy517, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803); } break; case 345: /* cmd ::= DESC full_table_name */ case 346: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==346); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy614); } break; case 347: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; case 348: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ case 349: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==349); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy887, yymsp[-1].minor.yy812, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy517, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } break; case 352: /* explain_options ::= */ -{ yymsp[1].minor.yy812 = createDefaultExplainOptions(pCxt); } +{ yymsp[1].minor.yy614 = createDefaultExplainOptions(pCxt); } break; case 353: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy812 = setExplainVerbose(pCxt, yymsp[-2].minor.yy812, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setExplainVerbose(pCxt, yymsp[-2].minor.yy614, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 354: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy812 = setExplainRatio(pCxt, yymsp[-2].minor.yy812, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setExplainRatio(pCxt, yymsp[-2].minor.yy614, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 355: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy887, yymsp[-9].minor.yy887, &yymsp[-6].minor.yy29, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy784, yymsp[-1].minor.yy760, &yymsp[0].minor.yy29, yymsp[-10].minor.yy887); } +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy517, yymsp[-9].minor.yy517, &yymsp[-6].minor.yy803, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy384, yymsp[-1].minor.yy294, &yymsp[0].minor.yy803, yymsp[-10].minor.yy517); } break; case 356: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy887, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } break; case 361: /* language_opt ::= */ case 400: /* on_vgroup_id ::= */ yytestcase(yyruleno==400); -{ yymsp[1].minor.yy29 = nil_token; } +{ yymsp[1].minor.yy803 = nil_token; } break; case 362: /* language_opt ::= LANGUAGE NK_STRING */ case 401: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==401); -{ yymsp[-1].minor.yy29 = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy803 = yymsp[0].minor.yy0; } break; case 365: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy887, yymsp[-2].minor.yy812, &yymsp[-1].minor.yy0, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy517, yymsp[-2].minor.yy614, &yymsp[-1].minor.yy0, yymsp[0].minor.yy614); } break; case 366: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy887, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy517, yymsp[0].minor.yy614); } break; case 367: /* full_view_name ::= view_name */ -{ yylhsminor.yy812 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy29); } - yymsp[0].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy803); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; case 368: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy812 = createViewNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = createViewNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 369: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy887, &yymsp[-8].minor.yy29, yymsp[-5].minor.yy812, yymsp[-7].minor.yy812, yymsp[-3].minor.yy124, yymsp[-2].minor.yy812, yymsp[0].minor.yy812, yymsp[-4].minor.yy124); } +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy517, &yymsp[-8].minor.yy803, yymsp[-5].minor.yy614, yymsp[-7].minor.yy614, yymsp[-3].minor.yy608, yymsp[-2].minor.yy614, yymsp[0].minor.yy614, yymsp[-4].minor.yy608); } break; case 370: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy887, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } break; case 371: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy887, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } break; case 372: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy887, yymsp[-1].minor.yy887, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy517, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } break; case 379: /* stream_options ::= stream_options TRIGGER AT_ONCE */ case 380: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==380); -{ yylhsminor.yy812 = setStreamOptions(pCxt, yymsp[-2].minor.yy812, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-2].minor.yy614, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 381: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy812 = setStreamOptions(pCxt, yymsp[-3].minor.yy812, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy812)); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-3].minor.yy614, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; case 382: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy812 = setStreamOptions(pCxt, yymsp[-2].minor.yy812, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy812)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-2].minor.yy614, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 383: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy812 = setStreamOptions(pCxt, yymsp[-3].minor.yy812, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-3].minor.yy614, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; case 384: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy812 = setStreamOptions(pCxt, yymsp[-2].minor.yy812, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-2].minor.yy614, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 385: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy812 = setStreamOptions(pCxt, yymsp[-2].minor.yy812, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy812)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-2].minor.yy614, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; case 386: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy812 = setStreamOptions(pCxt, yymsp[-3].minor.yy812, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; +{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-3].minor.yy614, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; case 388: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 610: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==610); - case 634: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==634); -{ yymsp[-3].minor.yy812 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy812); } + case 631: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==631); + case 655: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==655); +{ yymsp[-3].minor.yy614 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy614); } break; case 391: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } @@ -6073,651 +6184,710 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; case 396: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy29); } +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy803); } break; case 397: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; case 398: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy124); } +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy608); } break; case 399: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; case 402: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy124 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +{ yymsp[-1].minor.yy608 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; case 404: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy812, yymsp[0].minor.yy812); } +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } break; case 407: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy812 = createInsertStmt(pCxt, yymsp[-4].minor.yy812, yymsp[-2].minor.yy124, yymsp[0].minor.yy812); } +{ yymsp[-6].minor.yy614 = createInsertStmt(pCxt, yymsp[-4].minor.yy614, yymsp[-2].minor.yy608, yymsp[0].minor.yy614); } break; case 408: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy812 = createInsertStmt(pCxt, yymsp[-1].minor.yy812, NULL, yymsp[0].minor.yy812); } +{ yymsp[-3].minor.yy614 = createInsertStmt(pCxt, yymsp[-1].minor.yy614, NULL, yymsp[0].minor.yy614); } break; - case 409: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; + case 409: /* tags_literal ::= NK_INTEGER */ + case 415: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==415); + case 418: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==418); +{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; - case 410: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 411: /* literal ::= NK_STRING */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 412: /* literal ::= NK_BOOL */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 413: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; - break; - case 414: /* literal ::= duration_literal */ - case 424: /* signed_literal ::= signed */ yytestcase(yyruleno==424); - case 447: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==447); - case 448: /* expression ::= literal */ yytestcase(yyruleno==448); - case 450: /* expression ::= column_reference */ yytestcase(yyruleno==450); - case 451: /* expression ::= function_expression */ yytestcase(yyruleno==451); - case 452: /* expression ::= case_when_expression */ yytestcase(yyruleno==452); - case 485: /* function_expression ::= literal_func */ yytestcase(yyruleno==485); - case 534: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==534); - case 538: /* boolean_primary ::= predicate */ yytestcase(yyruleno==538); - case 540: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==540); - case 541: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==541); - case 544: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==544); - case 546: /* table_reference ::= table_primary */ yytestcase(yyruleno==546); - case 547: /* table_reference ::= joined_table */ yytestcase(yyruleno==547); - case 551: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==551); - case 636: /* query_simple ::= query_specification */ yytestcase(yyruleno==636); - case 637: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==637); - case 640: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==640); - case 642: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==642); -{ yylhsminor.yy812 = yymsp[0].minor.yy812; } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 415: /* literal ::= NULL */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 416: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 417: /* duration_literal ::= NK_VARIABLE */ - case 611: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==611); - case 612: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==612); - case 613: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==613); -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 418: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 419: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - break; - case 420: /* signed ::= NK_MINUS NK_INTEGER */ + case 410: /* tags_literal ::= NK_PLUS NK_INTEGER */ + case 411: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==411); + case 416: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==416); + case 417: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==417); + case 419: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==419); + case 420: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==420); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; - case 421: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy812 = yylhsminor.yy812; + case 412: /* tags_literal ::= NK_FLOAT */ +{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; - case 422: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - break; - case 423: /* signed ::= NK_MINUS NK_FLOAT */ + case 413: /* tags_literal ::= NK_PLUS NK_FLOAT */ + case 414: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==414); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; - case 425: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy812 = yylhsminor.yy812; + case 421: /* tags_literal ::= NK_STRING */ +{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; - case 426: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy812 = yylhsminor.yy812; + case 422: /* tags_literal ::= NK_BOOL */ +{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; - case 427: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 423: /* tags_literal ::= NULL */ +{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; - case 428: /* signed_literal ::= duration_literal */ - case 430: /* signed_literal ::= literal_func */ yytestcase(yyruleno==430); - case 505: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==505); - case 588: /* select_item ::= common_expression */ yytestcase(yyruleno==588); - case 598: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==598); - case 641: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==641); - case 643: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==643); - case 656: /* search_condition ::= common_expression */ yytestcase(yyruleno==656); -{ yylhsminor.yy812 = releaseRawExprNode(pCxt, yymsp[0].minor.yy812); } - yymsp[0].minor.yy812 = yylhsminor.yy812; + case 424: /* tags_literal ::= literal_func */ +{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy614); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; - case 429: /* signed_literal ::= NULL */ -{ yylhsminor.yy812 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 431: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy812 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 449: /* expression ::= pseudo_column */ -{ yylhsminor.yy812 = yymsp[0].minor.yy812; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy812, true); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 453: /* expression ::= NK_LP expression NK_RP */ - case 539: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==539); - case 655: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==655); -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy812)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; - break; - case 454: /* expression ::= NK_PLUS expr_or_subquery */ + case 425: /* tags_literal ::= literal_func NK_PLUS duration_literal */ + case 426: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==426); { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy812)); + SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + l.n = (r.z + r.n) - l.z; + yylhsminor.yy614 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy614, yymsp[0].minor.yy614); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 455: /* expression ::= NK_MINUS expr_or_subquery */ + case 429: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 430: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 431: /* literal ::= NK_STRING */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 432: /* literal ::= NK_BOOL */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 433: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; + break; + case 434: /* literal ::= duration_literal */ + case 444: /* signed_literal ::= signed */ yytestcase(yyruleno==444); + case 467: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==467); + case 468: /* expression ::= literal */ yytestcase(yyruleno==468); + case 470: /* expression ::= column_reference */ yytestcase(yyruleno==470); + case 471: /* expression ::= function_expression */ yytestcase(yyruleno==471); + case 472: /* expression ::= case_when_expression */ yytestcase(yyruleno==472); + case 505: /* function_expression ::= literal_func */ yytestcase(yyruleno==505); + case 555: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==555); + case 559: /* boolean_primary ::= predicate */ yytestcase(yyruleno==559); + case 561: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==561); + case 562: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==562); + case 565: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==565); + case 567: /* table_reference ::= table_primary */ yytestcase(yyruleno==567); + case 568: /* table_reference ::= joined_table */ yytestcase(yyruleno==568); + case 572: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==572); + case 657: /* query_simple ::= query_specification */ yytestcase(yyruleno==657); + case 658: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==658); + case 661: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==661); + case 663: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==663); +{ yylhsminor.yy614 = yymsp[0].minor.yy614; } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 435: /* literal ::= NULL */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 436: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 437: /* duration_literal ::= NK_VARIABLE */ + case 632: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==632); + case 633: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==633); + case 634: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==634); +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 438: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 439: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + break; + case 440: /* signed ::= NK_MINUS NK_INTEGER */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy812), NULL)); + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; - case 456: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 441: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 442: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + break; + case 443: /* signed ::= NK_MINUS NK_FLOAT */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; - case 457: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 445: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 446: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 447: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 448: /* signed_literal ::= duration_literal */ + case 450: /* signed_literal ::= literal_func */ yytestcase(yyruleno==450); + case 526: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==526); + case 609: /* select_item ::= common_expression */ yytestcase(yyruleno==609); + case 619: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==619); + case 662: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==662); + case 664: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==664); + case 677: /* search_condition ::= common_expression */ yytestcase(yyruleno==677); +{ yylhsminor.yy614 = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 449: /* signed_literal ::= NULL */ +{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 451: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy614 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 469: /* expression ::= pseudo_column */ +{ yylhsminor.yy614 = yymsp[0].minor.yy614; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy614, true); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 473: /* expression ::= NK_LP expression NK_RP */ + case 560: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==560); + case 676: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==676); +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 474: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; - case 458: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 475: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy614), NULL)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; - case 459: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 476: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 460: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 477: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 461: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 478: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 462: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 479: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 463: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 480: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 466: /* column_reference ::= column_name */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy29, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy29)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 467: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29, createColumnNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; - break; - case 468: /* column_reference ::= NK_ALIAS */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 469: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; - break; - case 470: /* pseudo_column ::= ROWTS */ - case 471: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==471); - case 473: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==473); - case 474: /* pseudo_column ::= QEND */ yytestcase(yyruleno==474); - case 475: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==475); - case 476: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==476); - case 477: /* pseudo_column ::= WEND */ yytestcase(yyruleno==477); - case 478: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==478); - case 479: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==479); - case 480: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==480); - case 481: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==481); - case 487: /* literal_func ::= NOW */ yytestcase(yyruleno==487); -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; - break; - case 472: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy29)))); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; - break; - case 482: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 483: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==483); -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy29, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy29, yymsp[-1].minor.yy124)); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; - break; - case 484: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), yymsp[-1].minor.yy784)); } - yymsp[-5].minor.yy812 = yylhsminor.yy812; - break; - case 486: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy29, NULL)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; - break; - case 501: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy124 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy124 = yylhsminor.yy124; - break; - case 506: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 591: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==591); -{ yylhsminor.yy812 = createColumnNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; - break; - case 507: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy124, yymsp[-1].minor.yy812)); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; - break; - case 508: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), yymsp[-2].minor.yy124, yymsp[-1].minor.yy812)); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; - break; - case 511: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy812 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812)); } - break; - case 513: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy812 = releaseRawExprNode(pCxt, yymsp[0].minor.yy812); } - break; - case 514: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 519: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==519); + case 481: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy590, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 515: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 482: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy812), releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-4].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 516: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 483: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy812), releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-5].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 517: /* predicate ::= expr_or_subquery IS NULL */ + case 486: /* column_reference ::= column_name */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy803, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy803)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 487: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803, createColumnNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803)); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 488: /* column_reference ::= NK_ALIAS */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 489: /* column_reference ::= table_name NK_DOT NK_ALIAS */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 490: /* pseudo_column ::= ROWTS */ + case 491: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==491); + case 493: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==493); + case 494: /* pseudo_column ::= QEND */ yytestcase(yyruleno==494); + case 495: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==495); + case 496: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==496); + case 497: /* pseudo_column ::= WEND */ yytestcase(yyruleno==497); + case 498: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==498); + case 499: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==499); + case 500: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==500); + case 501: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==501); + case 507: /* literal_func ::= NOW */ yytestcase(yyruleno==507); + case 508: /* literal_func ::= TODAY */ yytestcase(yyruleno==508); +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; + break; + case 492: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy803)))); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 502: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 503: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==503); +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy803, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy803, yymsp[-1].minor.yy608)); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; + break; + case 504: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), yymsp[-1].minor.yy384)); } + yymsp[-5].minor.yy614 = yylhsminor.yy614; + break; + case 506: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy803, NULL)); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 522: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy608 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy608 = yylhsminor.yy608; + break; + case 527: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 612: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==612); +{ yylhsminor.yy614 = createColumnNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 528: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy608, yymsp[-1].minor.yy614)); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; + break; + case 529: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), yymsp[-2].minor.yy608, yymsp[-1].minor.yy614)); } + yymsp[-4].minor.yy614 = yylhsminor.yy614; + break; + case 532: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy614 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } + break; + case 534: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy614 = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); } + break; + case 535: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 540: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==540); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy1034, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 518: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 536: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy614), releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; + yymsp[-4].minor.yy614 = yylhsminor.yy614; break; - case 520: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy590 = OP_TYPE_LOWER_THAN; } - break; - case 521: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy590 = OP_TYPE_GREATER_THAN; } - break; - case 522: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy590 = OP_TYPE_LOWER_EQUAL; } - break; - case 523: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy590 = OP_TYPE_GREATER_EQUAL; } - break; - case 524: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy590 = OP_TYPE_NOT_EQUAL; } - break; - case 525: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy590 = OP_TYPE_EQUAL; } - break; - case 526: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy590 = OP_TYPE_LIKE; } - break; - case 527: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy590 = OP_TYPE_NOT_LIKE; } - break; - case 528: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy590 = OP_TYPE_MATCH; } - break; - case 529: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy590 = OP_TYPE_NMATCH; } - break; - case 530: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy590 = OP_TYPE_JSON_CONTAINS; } - break; - case 531: /* in_op ::= IN */ -{ yymsp[0].minor.yy590 = OP_TYPE_IN; } - break; - case 532: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy590 = OP_TYPE_NOT_IN; } - break; - case 533: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy124)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; - break; - case 535: /* boolean_value_expression ::= NOT boolean_primary */ + case 537: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy812), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy614), releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + yymsp[-5].minor.yy614 = yylhsminor.yy614; break; - case 536: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 538: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), NULL)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 537: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 539: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy812); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy812); - yylhsminor.yy812 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), NULL)); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; - case 545: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy812 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy812, yymsp[0].minor.yy812, NULL); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + case 541: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy1034 = OP_TYPE_LOWER_THAN; } break; - case 548: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy812 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + case 542: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy1034 = OP_TYPE_GREATER_THAN; } break; - case 549: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy812 = createRealTableNode(pCxt, &yymsp[-3].minor.yy29, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; + case 543: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy1034 = OP_TYPE_LOWER_EQUAL; } break; - case 550: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy812 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy812), &yymsp[0].minor.yy29); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + case 544: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy1034 = OP_TYPE_GREATER_EQUAL; } break; - case 552: /* alias_opt ::= */ -{ yymsp[1].minor.yy29 = nil_token; } + case 545: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy1034 = OP_TYPE_NOT_EQUAL; } break; - case 554: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy29 = yymsp[0].minor.yy29; } + case 546: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy1034 = OP_TYPE_EQUAL; } break; - case 555: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 556: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==556); -{ yymsp[-2].minor.yy812 = yymsp[-1].minor.yy812; } + case 547: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy1034 = OP_TYPE_LIKE; } break; - case 557: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + case 548: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy1034 = OP_TYPE_NOT_LIKE; } + break; + case 549: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy1034 = OP_TYPE_MATCH; } + break; + case 550: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy1034 = OP_TYPE_NMATCH; } + break; + case 551: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy1034 = OP_TYPE_JSON_CONTAINS; } + break; + case 552: /* in_op ::= IN */ +{ yymsp[0].minor.yy1034 = OP_TYPE_IN; } + break; + case 553: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy1034 = OP_TYPE_NOT_IN; } + break; + case 554: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy608)); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 556: /* boolean_value_expression ::= NOT boolean_primary */ +{ + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy614), NULL)); + } + yymsp[-1].minor.yy614 = yylhsminor.yy614; + break; + case 557: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 558: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 566: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy614 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy614, yymsp[0].minor.yy614, NULL); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; + break; + case 569: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy614 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy803, &yymsp[0].minor.yy803); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; + break; + case 570: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy614 = createRealTableNode(pCxt, &yymsp[-3].minor.yy803, &yymsp[-1].minor.yy803, &yymsp[0].minor.yy803); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; + break; + case 571: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy614 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614), &yymsp[0].minor.yy803); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; + break; + case 573: /* alias_opt ::= */ +{ yymsp[1].minor.yy803 = nil_token; } + break; + case 575: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy803 = yymsp[0].minor.yy803; } + break; + case 576: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 577: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==577); +{ yymsp[-2].minor.yy614 = yymsp[-1].minor.yy614; } + break; + case 578: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ { - yylhsminor.yy812 = createJoinTableNode(pCxt, yymsp[-6].minor.yy162, yymsp[-5].minor.yy354, yymsp[-7].minor.yy812, yymsp[-3].minor.yy812, yymsp[-2].minor.yy812); - yylhsminor.yy812 = addWindowOffsetClause(pCxt, yylhsminor.yy812, yymsp[-1].minor.yy812); - yylhsminor.yy812 = addJLimitClause(pCxt, yylhsminor.yy812, yymsp[0].minor.yy812); + yylhsminor.yy614 = createJoinTableNode(pCxt, yymsp[-6].minor.yy148, yymsp[-5].minor.yy832, yymsp[-7].minor.yy614, yymsp[-3].minor.yy614, yymsp[-2].minor.yy614); + yylhsminor.yy614 = addWindowOffsetClause(pCxt, yylhsminor.yy614, yymsp[-1].minor.yy614); + yylhsminor.yy614 = addJLimitClause(pCxt, yylhsminor.yy614, yymsp[0].minor.yy614); } - yymsp[-7].minor.yy812 = yylhsminor.yy812; + yymsp[-7].minor.yy614 = yylhsminor.yy614; break; - case 558: /* join_type ::= */ -{ yymsp[1].minor.yy162 = JOIN_TYPE_INNER; } + case 579: /* join_type ::= */ +{ yymsp[1].minor.yy148 = JOIN_TYPE_INNER; } break; - case 559: /* join_type ::= INNER */ -{ yymsp[0].minor.yy162 = JOIN_TYPE_INNER; } + case 580: /* join_type ::= INNER */ +{ yymsp[0].minor.yy148 = JOIN_TYPE_INNER; } break; - case 560: /* join_type ::= LEFT */ -{ yymsp[0].minor.yy162 = JOIN_TYPE_LEFT; } + case 581: /* join_type ::= LEFT */ +{ yymsp[0].minor.yy148 = JOIN_TYPE_LEFT; } break; - case 561: /* join_type ::= RIGHT */ -{ yymsp[0].minor.yy162 = JOIN_TYPE_RIGHT; } + case 582: /* join_type ::= RIGHT */ +{ yymsp[0].minor.yy148 = JOIN_TYPE_RIGHT; } break; - case 562: /* join_type ::= FULL */ -{ yymsp[0].minor.yy162 = JOIN_TYPE_FULL; } + case 583: /* join_type ::= FULL */ +{ yymsp[0].minor.yy148 = JOIN_TYPE_FULL; } break; - case 563: /* join_subtype ::= */ -{ yymsp[1].minor.yy354 = JOIN_STYPE_NONE; } + case 584: /* join_subtype ::= */ +{ yymsp[1].minor.yy832 = JOIN_STYPE_NONE; } break; - case 564: /* join_subtype ::= OUTER */ -{ yymsp[0].minor.yy354 = JOIN_STYPE_OUTER; } + case 585: /* join_subtype ::= OUTER */ +{ yymsp[0].minor.yy832 = JOIN_STYPE_OUTER; } break; - case 565: /* join_subtype ::= SEMI */ -{ yymsp[0].minor.yy354 = JOIN_STYPE_SEMI; } + case 586: /* join_subtype ::= SEMI */ +{ yymsp[0].minor.yy832 = JOIN_STYPE_SEMI; } break; - case 566: /* join_subtype ::= ANTI */ -{ yymsp[0].minor.yy354 = JOIN_STYPE_ANTI; } + case 587: /* join_subtype ::= ANTI */ +{ yymsp[0].minor.yy832 = JOIN_STYPE_ANTI; } break; - case 567: /* join_subtype ::= ASOF */ -{ yymsp[0].minor.yy354 = JOIN_STYPE_ASOF; } + case 588: /* join_subtype ::= ASOF */ +{ yymsp[0].minor.yy832 = JOIN_STYPE_ASOF; } break; - case 568: /* join_subtype ::= WINDOW */ -{ yymsp[0].minor.yy354 = JOIN_STYPE_WIN; } + case 589: /* join_subtype ::= WINDOW */ +{ yymsp[0].minor.yy832 = JOIN_STYPE_WIN; } break; - case 572: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ -{ yymsp[-5].minor.yy812 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), releaseRawExprNode(pCxt, yymsp[-1].minor.yy812)); } + case 593: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ +{ yymsp[-5].minor.yy614 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } break; - case 573: /* window_offset_literal ::= NK_VARIABLE */ -{ yylhsminor.yy812 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy812 = yylhsminor.yy812; + case 594: /* window_offset_literal ::= NK_VARIABLE */ +{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; - case 574: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ + case 595: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy812 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); + yylhsminor.yy614 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; - case 576: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - case 647: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==647); - case 651: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==651); -{ yymsp[-1].minor.yy812 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 597: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + case 668: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==668); + case 672: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==672); +{ yymsp[-1].minor.yy614 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 577: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 598: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-13].minor.yy812 = createSelectStmt(pCxt, yymsp[-11].minor.yy887, yymsp[-9].minor.yy124, yymsp[-8].minor.yy812, yymsp[-12].minor.yy124); - yymsp[-13].minor.yy812 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy812, yymsp[-10].minor.yy887); - yymsp[-13].minor.yy812 = addWhereClause(pCxt, yymsp[-13].minor.yy812, yymsp[-7].minor.yy812); - yymsp[-13].minor.yy812 = addPartitionByClause(pCxt, yymsp[-13].minor.yy812, yymsp[-6].minor.yy124); - yymsp[-13].minor.yy812 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy812, yymsp[-2].minor.yy812); - yymsp[-13].minor.yy812 = addGroupByClause(pCxt, yymsp[-13].minor.yy812, yymsp[-1].minor.yy124); - yymsp[-13].minor.yy812 = addHavingClause(pCxt, yymsp[-13].minor.yy812, yymsp[0].minor.yy812); - yymsp[-13].minor.yy812 = addRangeClause(pCxt, yymsp[-13].minor.yy812, yymsp[-5].minor.yy812); - yymsp[-13].minor.yy812 = addEveryClause(pCxt, yymsp[-13].minor.yy812, yymsp[-4].minor.yy812); - yymsp[-13].minor.yy812 = addFillClause(pCxt, yymsp[-13].minor.yy812, yymsp[-3].minor.yy812); + yymsp[-13].minor.yy614 = createSelectStmt(pCxt, yymsp[-11].minor.yy517, yymsp[-9].minor.yy608, yymsp[-8].minor.yy614, yymsp[-12].minor.yy608); + yymsp[-13].minor.yy614 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy614, yymsp[-10].minor.yy517); + yymsp[-13].minor.yy614 = addWhereClause(pCxt, yymsp[-13].minor.yy614, yymsp[-7].minor.yy614); + yymsp[-13].minor.yy614 = addPartitionByClause(pCxt, yymsp[-13].minor.yy614, yymsp[-6].minor.yy608); + yymsp[-13].minor.yy614 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy614, yymsp[-2].minor.yy614); + yymsp[-13].minor.yy614 = addGroupByClause(pCxt, yymsp[-13].minor.yy614, yymsp[-1].minor.yy608); + yymsp[-13].minor.yy614 = addHavingClause(pCxt, yymsp[-13].minor.yy614, yymsp[0].minor.yy614); + yymsp[-13].minor.yy614 = addRangeClause(pCxt, yymsp[-13].minor.yy614, yymsp[-5].minor.yy614); + yymsp[-13].minor.yy614 = addEveryClause(pCxt, yymsp[-13].minor.yy614, yymsp[-4].minor.yy614); + yymsp[-13].minor.yy614 = addFillClause(pCxt, yymsp[-13].minor.yy614, yymsp[-3].minor.yy614); } break; - case 578: /* hint_list ::= */ -{ yymsp[1].minor.yy124 = createHintNodeList(pCxt, NULL); } + case 599: /* hint_list ::= */ +{ yymsp[1].minor.yy608 = createHintNodeList(pCxt, NULL); } break; - case 579: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy124 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy124 = yylhsminor.yy124; + case 600: /* hint_list ::= NK_HINT */ +{ yylhsminor.yy608 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy608 = yylhsminor.yy608; break; - case 584: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy887 = false; } + case 605: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy517 = false; } break; - case 587: /* select_item ::= NK_STAR */ -{ yylhsminor.yy812 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy812 = yylhsminor.yy812; + case 608: /* select_item ::= NK_STAR */ +{ yylhsminor.yy614 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy614 = yylhsminor.yy614; break; - case 589: /* select_item ::= common_expression column_alias */ - case 599: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==599); -{ yylhsminor.yy812 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy812), &yymsp[0].minor.yy29); } - yymsp[-1].minor.yy812 = yylhsminor.yy812; + case 610: /* select_item ::= common_expression column_alias */ + case 620: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==620); +{ yylhsminor.yy614 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614), &yymsp[0].minor.yy803); } + yymsp[-1].minor.yy614 = yylhsminor.yy614; break; - case 590: /* select_item ::= common_expression AS column_alias */ - case 600: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==600); -{ yylhsminor.yy812 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), &yymsp[0].minor.yy29); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + case 611: /* select_item ::= common_expression AS column_alias */ + case 621: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==621); +{ yylhsminor.yy614 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), &yymsp[0].minor.yy803); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 595: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 625: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==625); - case 645: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==645); -{ yymsp[-2].minor.yy124 = yymsp[0].minor.yy124; } + case 616: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 646: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==646); + case 666: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==666); +{ yymsp[-2].minor.yy608 = yymsp[0].minor.yy608; } break; - case 602: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -{ yymsp[-5].minor.yy812 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), releaseRawExprNode(pCxt, yymsp[-1].minor.yy812)); } + case 623: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +{ yymsp[-5].minor.yy614 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } break; - case 603: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy812 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy812)); } + case 624: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy614 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } break; - case 604: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy812 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), NULL, yymsp[-1].minor.yy812, yymsp[0].minor.yy812); } + case 625: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy614 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), NULL, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } break; - case 605: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy812 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy812), releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), yymsp[-1].minor.yy812, yymsp[0].minor.yy812); } + case 626: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy614 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy614), releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } break; - case 606: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy812 = createEventWindowNode(pCxt, yymsp[-3].minor.yy812, yymsp[0].minor.yy812); } + case 627: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy614 = createEventWindowNode(pCxt, yymsp[-3].minor.yy614, yymsp[0].minor.yy614); } break; - case 607: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy812 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } + case 628: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy614 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 608: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy812 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } + case 629: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy614 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 615: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy812 = createFillNode(pCxt, yymsp[-1].minor.yy144, NULL); } + case 636: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy614 = createFillNode(pCxt, yymsp[-1].minor.yy720, NULL); } break; - case 616: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy812 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy124)); } + case 637: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy614 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy608)); } break; - case 617: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy812 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy124)); } + case 638: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy614 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy608)); } break; - case 618: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy144 = FILL_MODE_NONE; } + case 639: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy720 = FILL_MODE_NONE; } break; - case 619: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy144 = FILL_MODE_PREV; } + case 640: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy720 = FILL_MODE_PREV; } break; - case 620: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy144 = FILL_MODE_NULL; } + case 641: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy720 = FILL_MODE_NULL; } break; - case 621: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy144 = FILL_MODE_NULL_F; } + case 642: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy720 = FILL_MODE_NULL_F; } break; - case 622: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy144 = FILL_MODE_LINEAR; } + case 643: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy720 = FILL_MODE_LINEAR; } break; - case 623: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy144 = FILL_MODE_NEXT; } + case 644: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy720 = FILL_MODE_NEXT; } break; - case 626: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy124 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); } - yymsp[0].minor.yy124 = yylhsminor.yy124; + case 647: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy608 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } + yymsp[0].minor.yy608 = yylhsminor.yy608; break; - case 627: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy124 = addNodeToList(pCxt, yymsp[-2].minor.yy124, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy812))); } - yymsp[-2].minor.yy124 = yylhsminor.yy124; + case 648: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } + yymsp[-2].minor.yy608 = yylhsminor.yy608; break; - case 631: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy812 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy812), releaseRawExprNode(pCxt, yymsp[-1].minor.yy812)); } + case 652: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy614 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } break; - case 632: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy812 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy812)); } + case 653: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy614 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } break; - case 635: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 656: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy812 = addOrderByClause(pCxt, yymsp[-3].minor.yy812, yymsp[-2].minor.yy124); - yylhsminor.yy812 = addSlimitClause(pCxt, yylhsminor.yy812, yymsp[-1].minor.yy812); - yylhsminor.yy812 = addLimitClause(pCxt, yylhsminor.yy812, yymsp[0].minor.yy812); + yylhsminor.yy614 = addOrderByClause(pCxt, yymsp[-3].minor.yy614, yymsp[-2].minor.yy608); + yylhsminor.yy614 = addSlimitClause(pCxt, yylhsminor.yy614, yymsp[-1].minor.yy614); + yylhsminor.yy614 = addLimitClause(pCxt, yylhsminor.yy614, yymsp[0].minor.yy614); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; - case 638: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy812 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy812, yymsp[0].minor.yy812); } - yymsp[-3].minor.yy812 = yylhsminor.yy812; + case 659: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy614 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy614, yymsp[0].minor.yy614); } + yymsp[-3].minor.yy614 = yylhsminor.yy614; break; - case 639: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy812 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy812, yymsp[0].minor.yy812); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + case 660: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy614 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy614, yymsp[0].minor.yy614); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 648: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 652: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==652); -{ yymsp[-3].minor.yy812 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 669: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 673: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==673); +{ yymsp[-3].minor.yy614 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 649: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 653: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==653); -{ yymsp[-3].minor.yy812 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 670: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 674: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==674); +{ yymsp[-3].minor.yy614 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 654: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy812 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy812); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + case 675: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy614); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 659: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy812 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy812), yymsp[-1].minor.yy638, yymsp[0].minor.yy907); } - yymsp[-2].minor.yy812 = yylhsminor.yy812; + case 680: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy614 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), yymsp[-1].minor.yy32, yymsp[0].minor.yy685); } + yymsp[-2].minor.yy614 = yylhsminor.yy614; break; - case 660: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy638 = ORDER_ASC; } + case 681: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy32 = ORDER_ASC; } break; - case 661: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy638 = ORDER_ASC; } + case 682: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy32 = ORDER_ASC; } break; - case 662: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy638 = ORDER_DESC; } + case 683: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy32 = ORDER_DESC; } break; - case 663: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy907 = NULL_ORDER_DEFAULT; } + case 684: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy685 = NULL_ORDER_DEFAULT; } break; - case 664: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy907 = NULL_ORDER_FIRST; } + case 685: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy685 = NULL_ORDER_FIRST; } break; - case 665: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy907 = NULL_ORDER_LAST; } + case 686: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy685 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parAlterToBalanceTest.cpp b/source/libs/parser/test/parAlterToBalanceTest.cpp index 1cf132a632..bac5574f18 100644 --- a/source/libs/parser/test/parAlterToBalanceTest.cpp +++ b/source/libs/parser/test/parAlterToBalanceTest.cpp @@ -784,7 +784,7 @@ TEST_F(ParserInitialATest, alterTableSemanticCheck) { run("ALTER TABLE st1s1 DROP TAG tag1", TSDB_CODE_PAR_INVALID_ALTER_TABLE); run("ALTER TABLE st1s1 MODIFY TAG tag2 VARCHAR(30)", TSDB_CODE_PAR_INVALID_ALTER_TABLE); run("ALTER TABLE st1s1 RENAME TAG tag1 tag11", TSDB_CODE_PAR_INVALID_ALTER_TABLE); - run("ALTER TABLE st1s1 SET TAG tag2 = '123456789012345678901'", TSDB_CODE_PAR_WRONG_VALUE_TYPE); + run("ALTER TABLE st1s1 SET TAG tag2 = '123456789012345678901'", TSDB_CODE_PAR_VALUE_TOO_LONG); } /* diff --git a/source/os/src/osString.c b/source/os/src/osString.c index 9119c1d470..8c6c0e0d7c 100644 --- a/source/os/src/osString.c +++ b/source/os/src/osString.c @@ -485,7 +485,7 @@ bool isHex(const char* z, uint32_t n){ } bool isValidateHex(const char* z, uint32_t n){ - if(n % 2 != 0) return false; + if((n & 1) != 0) return false; for(size_t i = HEX_PREFIX_LEN; i < n; i++){ if(isxdigit(z[i]) == 0){ return false; @@ -494,13 +494,16 @@ bool isValidateHex(const char* z, uint32_t n){ return true; } -int32_t taosHex2Ascii(const char *z, uint32_t n, void** data, uint32_t* size){ - n -= HEX_PREFIX_LEN; // remove 0x +int32_t taosHex2Ascii(const char *z, uint32_t n, void **data, uint32_t *size) { + n -= HEX_PREFIX_LEN; // remove 0x z += HEX_PREFIX_LEN; *size = n / HEX_PREFIX_LEN; - if(*size == 0) return 0; - uint8_t* tmp = (uint8_t*)taosMemoryCalloc(*size, 1); - if(tmp == NULL) return -1; + if (*size == 0) { + if (!(*data = taosStrdup(""))) return -1; + return 0; + } + uint8_t *tmp = (uint8_t *)taosMemoryCalloc(*size, 1); + if (tmp == NULL) return -1; int8_t num = 0; uint8_t *byte = tmp + *size - 1; diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 25b887b86d..75685c8bf8 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -615,7 +615,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_PAR_GET_META_ERROR, "Fail to get table i TAOS_DEFINE_ERROR(TSDB_CODE_PAR_NOT_UNIQUE_TABLE_ALIAS, "Not unique table/alias") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_SYSTABLE_NOT_ALLOWED_FUNC, "System table not allowed") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_SYSTABLE_NOT_ALLOWED, "System table not allowed") -TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_VARBINARY, "Invalidate varbinary value") +TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_VARBINARY, "Invalid varbinary value") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_IP_RANGE, "Invalid IPV4 address ranges") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INTERNAL_ERROR, "Parser internal error") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_STREAM_QUERY, "Invalid stream query") diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index a2348bdedd..851fe2679b 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -229,6 +229,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_taosx.py +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_ts4563.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_replay.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqSeekAndCommit.py ,,n,system-test,python3 ./test.py -f 7-tmq/tmq_offset.py @@ -327,6 +328,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/db_tb_name_check.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/InsertFuturets.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/insert_wide_column.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/insert_column_value.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/rowlength64k_benchmark.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/rowlength64k.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/rowlength64k.py -R @@ -1056,6 +1058,13 @@ ,,y,script,./test.sh -f tsim/parser/columnValue_smallint.sim ,,y,script,./test.sh -f tsim/parser/columnValue_tinyint.sim ,,y,script,./test.sh -f tsim/parser/columnValue_unsign.sim +,,y,script,./test.sh -f tsim/parser/columnValue_uint.sim +,,y,script,./test.sh -f tsim/parser/columnValue_timestamp.sim +,,y,script,./test.sh -f tsim/parser/columnValue_varchar.sim +,,y,script,./test.sh -f tsim/parser/columnValue_nchar.sim +,,y,script,./test.sh -f tsim/parser/columnValue_varbinary.sim +,,y,script,./test.sh -f tsim/parser/columnValue_json.sim +,,y,script,./test.sh -f tsim/parser/columnValue_geometry.sim ,,y,script,./test.sh -f tsim/parser/condition.sim ,,y,script,./test.sh -f tsim/parser/condition_scl.sim ,,y,script,./test.sh -f tsim/parser/constCol.sim diff --git a/tests/script/tsim/parser/columnValue_bigint.sim b/tests/script/tsim/parser/columnValue_bigint.sim index 056855eea2..e4d1a6b6e3 100644 --- a/tests/script/tsim/parser/columnValue_bigint.sim +++ b/tests/script/tsim/parser/columnValue_bigint.sim @@ -28,10 +28,26 @@ if $data05 != NULL then return -1 endi -sql_error create table st_bigint_2 using mt_bigint tags ('NULL') -sql_error create table st_bigint_3 using mt_bigint tags ('NULL') -sql_error create table st_bigint_4 using mt_bigint tags ("NULL") -sql_error create table st_bigint_5 using mt_bigint tags ("NULL") +sql create table st_bigint_2 using mt_bigint tags ('NULL') +sql show tags from st_bigint_2 +if $data05 != NULL then + return -1 +endi +sql create table st_bigint_3 using mt_bigint tags ('NULL') +sql show tags from st_bigint_3 +if $data05 != NULL then + return -1 +endi +sql create table st_bigint_4 using mt_bigint tags ("NULL") +sql show tags from st_bigint_4 +if $data05 != NULL then + return -1 +endi +sql create table st_bigint_5 using mt_bigint tags ("NULL") +sql show tags from st_bigint_5 +if $data05 != NULL then + return -1 +endi sql create table st_bigint_6 using mt_bigint tags (-9223372036854775807) sql show tags from st_bigint_6 @@ -97,6 +113,39 @@ if $data01 != NULL then return -1 endi +sql insert into st_bigint_2 values (now, NULL) +sql select * from st_bigint_2 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +sql insert into st_bigint_3 values (now, NULL) +sql select * from st_bigint_3 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +sql insert into st_bigint_4 values (now, NULL) +sql select * from st_bigint_4 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +sql insert into st_bigint_5 values (now, NULL) +sql select * from st_bigint_5 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi + sql insert into st_bigint_6 values (now, 9223372036854775807) sql select * from st_bigint_6 if $rows != 1 then @@ -348,7 +397,7 @@ sql_error create table st_bigint_e0 using mt_bigint tags ("123abc") sql_error create table st_bigint_e0 using mt_bigint tags (abc) sql_error create table st_bigint_e0 using mt_bigint tags ("abc") sql_error create table st_bigint_e0 using mt_bigint tags (" ") -sql create table st_bigint_e0_error using mt_bigint tags ('') +sql_error create table st_bigint_e0_error using mt_bigint tags ('') sql create table st_bigint_e0 using mt_bigint tags (123) sql create table st_bigint_e1 using mt_bigint tags (123) @@ -401,7 +450,7 @@ sql_error insert into st_bigint_e20 using mt_bigint tags ("123abc") values (now, sql_error insert into st_bigint_e22 using mt_bigint tags (abc) values (now, -033) sql_error insert into st_bigint_e23 using mt_bigint tags ("abc") values (now, -033) sql_error insert into st_bigint_e24 using mt_bigint tags (" ") values (now, -033) -sql insert into st_bigint_e25 using mt_bigint tags ('') values (now, -033) +sql_error insert into st_bigint_e25 using mt_bigint tags ('') values (now, -033) sql insert into st_bigint_e13 using mt_bigint tags (033) values (now, 00062) sql insert into st_bigint_e14 using mt_bigint tags (033) values (now, 00062) @@ -417,15 +466,17 @@ sql insert into st_bigint_e23 using mt_bigint tags (033) values (now, 00062) sql insert into st_bigint_e24 using mt_bigint tags (033) values (now, 00062) sql insert into st_bigint_e25 using mt_bigint tags (033) values (now, 00062) -#sql alter table st_bigint_e13 set tag tagname=9223372036854775808 -#sql_error alter table st_bigint_e14 set tag tagname=-9223372036854775808 -#sql alter table st_bigint_e15 set tag tagname=92233720368547758080 -#sql_error alter table st_bigint_e16 set tag tagname=-92233720368547758080 -#sql_error alter table st_bigint_e19 set tag tagname=123abc -#sql_error alter table st_bigint_e20 set tag tagname="123abc" -#sql_error alter table st_bigint_e22 set tag tagname=abc -#sql_error alter table st_bigint_e23 set tag tagname="abc" -#sql_error alter table st_bigint_e24 set tag tagname=" " -#sql_error alter table st_bigint_e25 set tag tagname='' +sql_error alter table st_bigint_e13 set tag tagname=9223372036854775808 +sql alter table st_bigint_e13 set tag tagname=9223372036854775807 +sql_error alter table st_bigint_e14 set tag tagname=-9223372036854775809 +sql alter table st_bigint_e14 set tag tagname=-9223372036854775808 +sql_error alter table st_bigint_e15 set tag tagname=92233720368547758080 +sql_error alter table st_bigint_e16 set tag tagname=-92233720368547758080 +sql_error alter table st_bigint_e19 set tag tagname=123abc +sql_error alter table st_bigint_e20 set tag tagname="123abc" +sql_error alter table st_bigint_e22 set tag tagname=abc +sql_error alter table st_bigint_e23 set tag tagname="abc" +sql_error alter table st_bigint_e24 set tag tagname=" " +sql_error alter table st_bigint_e25 set tag tagname='' system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_bool.sim b/tests/script/tsim/parser/columnValue_bool.sim index 2553e6805a..db89db4256 100644 --- a/tests/script/tsim/parser/columnValue_bool.sim +++ b/tests/script/tsim/parser/columnValue_bool.sim @@ -31,26 +31,26 @@ if $data05 != NULL then endi sql create table st_bool_2 using mt_bool tags ('NULL') sql show tags from st_bool_2 -if $data05 != false then - print ==3== expect: false, actually: $data05 +if $data05 != NULL then + print ==3== expect: NULL, actually: $data05 return -1 endi sql create table st_bool_3 using mt_bool tags ('NULL') sql show tags from st_bool_3 -if $data05 != false then - print ==4== expect: false, actually: $data05 +if $data05 != NULL then + print ==4== expect: NULL, actually: $data05 return -1 endi sql create table st_bool_4 using mt_bool tags ("NULL") sql show tags from st_bool_4 -if $data05 != false then - print ==5== expect: false, actually: $data05 +if $data05 != NULL then + print ==5== expect: NULL, actually: $data05 return -1 endi sql create table st_bool_5 using mt_bool tags ("NULL") sql show tags from st_bool_5 -if $data05 != false then - print ==6== expect: false, actually: $data05 +if $data05 != NULL then + print ==6== expect: NULL, actually: $data05 return -1 endi sql create table st_bool_6 using mt_bool tags ("true") @@ -113,16 +113,94 @@ if $data05 != true then print ==16== expect: 1, actually: $data00 return -1 endi -sql create table st_bool_15_0 using mt_bool tags (+300) -sql show tags from st_bool_15_0 +sql create table st_bool_16 using mt_bool tags (+300) +sql show tags from st_bool_16 if $data05 != true then - print ==16== expect: 1, actually: $data00 return -1 endi -sql create table st_bool_15_1 using mt_bool tags (-8.03) -sql show tags from st_bool_15_1 +sql create table st_bool_17 using mt_bool tags (-8.03) +sql show tags from st_bool_17 if $data05 != true then - print ==16== expect: 1, actually: $data00 + return -1 +endi +sql create table st_bool_18 using mt_bool tags ("-8.03") +sql show tags from st_bool_18 +if $data05 != true then + return -1 +endi +sql create table st_bool_19 using mt_bool tags ("+300") +sql show tags from st_bool_19 +if $data05 != true then + return -1 +endi +sql create table st_bool_20 using mt_bool tags ("-8e+2") +sql show tags from st_bool_20 +if $data05 != true then + return -1 +endi +sql create table st_bool_21 using mt_bool tags ("0x01") +sql show tags from st_bool_21 +if $data05 != true then + return -1 +endi +sql create table st_bool_22 using mt_bool tags ("0b01") +sql show tags from st_bool_22 +if $data05 != true then + return -1 +endi +sql create table st_bool_23 using mt_bool tags ("+0x01") +sql show tags from st_bool_23 +if $data05 != true then + return -1 +endi +sql create table st_bool_24 using mt_bool tags ("-0b00") +sql show tags from st_bool_24 +if $data05 != false then + return -1 +endi +sql create table st_bool_26 using mt_bool tags ("-0.11e-30") +sql show tags from st_bool_26 +if $data05 != true then + return -1 +endi +sql create table st_bool_27 using mt_bool tags ("-1.0e-307") +sql show tags from st_bool_27 +if $data05 != true then + return -1 +endi +sql create table st_bool_28 using mt_bool tags ( -1e-1 ) +sql show tags from st_bool_28 +if $data05 != true then + return -1 +endi +sql create table st_bool_29 using mt_bool tags (-0.11e-30) +sql show tags from st_bool_29 +if $data05 != true then + return -1 +endi +sql create table st_bool_30 using mt_bool tags (-1.1e-307) +sql show tags from st_bool_30 +if $data05 != true then + return -1 +endi +sql create table st_bool_31 using mt_bool tags ( 0x01) +sql show tags from st_bool_31 +if $data05 != true then + return -1 +endi +sql create table st_bool_32 using mt_bool tags (0b01 ) +sql show tags from st_bool_32 +if $data05 != true then + return -1 +endi +sql create table st_bool_33 using mt_bool tags (+0x01) +sql show tags from st_bool_33 +if $data05 != true then + return -1 +endi +sql create table st_bool_34 using mt_bool tags ( -0b00 ) +sql show tags from st_bool_34 +if $data05 != false then return -1 endi @@ -271,8 +349,8 @@ if $data01 != 1 then print ==32== expect: true, actually: $data01 return -1 endi -sql insert into st_bool_15_0 values (now, +300) -sql select * from st_bool_15_0 +sql insert into st_bool_16 values (now, +300) +sql select * from st_bool_16 if $rows != 1 then return -1 endi @@ -280,8 +358,8 @@ if $data01 != 1 then print ==32== expect: true, actually: $data01 return -1 endi -sql insert into st_bool_15_1 values (now, -3.15) -sql select * from st_bool_15_1 +sql insert into st_bool_17 values (now, -3.15) +sql select * from st_bool_17 if $rows != 1 then return -1 endi @@ -289,304 +367,529 @@ if $data01 != 1 then print ==32== expect: true, actually: $data01 return -1 endi +sql insert into st_bool_18 values(now,"-8.03") +sql select * from st_bool_18 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_19 values(now,"+300") +sql select * from st_bool_19 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_20 values(now,"-8e+2") +sql select * from st_bool_20 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_21 values(now,"0x01") +sql select * from st_bool_21 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_22 values(now,"0b01") +sql select * from st_bool_22 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_23 values(now,"+0x01") +sql select * from st_bool_23 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_24 values(now,"-0b00") +sql select * from st_bool_24 +if $data01 != 0 then + return -1 +endi +sql insert into st_bool_26 values(now,"-0.11e-30") +sql select * from st_bool_26 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_27 values(now,"-1.0e-307") +sql select * from st_bool_27 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_28 values(now, -1e-1 ) +sql select * from st_bool_28 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_29 values(now,-0.11e-30) +sql select * from st_bool_29 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_30 values(now,-1.1e-307) +sql select * from st_bool_30 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_31 values(now, 0x01) +sql select * from st_bool_31 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_32 values(now,0b01 ) +sql select * from st_bool_32 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_33 values(now,+0x01) +sql select * from st_bool_33 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_34 values(now, -0b00 ) +sql select * from st_bool_34 +if $data01 != 0 then + return -1 +endi ## case 02: dynamic create table for test tag values -sql insert into st_bool_16 using mt_bool tags (NULL) values (now, NULL) -sql show create table st_bool_16 -sql show tags from st_bool_16 +sql insert into st_bool_116 using mt_bool tags (NULL) values (now, NULL) +sql show create table st_bool_116 +sql show tags from st_bool_116 if $data05 != NULL then print ==33== expect: NULL, actually: $data00 return -1 endi -sql select * from st_bool_16 +sql select * from st_bool_116 if $data01 != NULL then print ==34== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_17 using mt_bool tags (NULL) values (now, NULL) -sql show tags from st_bool_17 +sql insert into st_bool_117 using mt_bool tags (NULL) values (now, NULL) +sql show tags from st_bool_117 if $data05 != NULL then print ==35== expect: NULL, actually: $data00 return -1 endi -sql select * from st_bool_17 +sql select * from st_bool_117 if $data01 != NULL then print ==36== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_18 using mt_bool tags ('NULL') values (now, 'NULL') -sql show tags from st_bool_18 +sql insert into st_bool_118 using mt_bool tags ('NULL') values (now, 'NULL') +sql show tags from st_bool_118 if $data05 != NULL then print ==37== expect: NULL, actually: $data00 return -1 endi -sql select * from st_bool_18 +sql select * from st_bool_118 if $data01 != NULL then print ==38== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_19 using mt_bool tags ('NULL') values (now, 'NULL') -sql show tags from st_bool_19 +sql insert into st_bool_119 using mt_bool tags ('NULL') values (now, 'NULL') +sql show tags from st_bool_119 if $data05 != NULL then print ==39== expect: NULL, actually: $data00 return -1 endi -sql select * from st_bool_19 +sql select * from st_bool_119 if $data01 != NULL then print ==40== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_20 using mt_bool tags ("NULL") values (now, "NULL") -sql show tags from st_bool_20 +sql insert into st_bool_120 using mt_bool tags ("NULL") values (now, "NULL") +sql show tags from st_bool_120 if $data05 != NULL then print ==41== expect: NULL, actually: $data00 return -1 endi -sql select * from st_bool_20 +sql select * from st_bool_120 if $data01 != NULL then print ==42== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_21 using mt_bool tags ("NULL") values (now, "NULL") -sql show tags from st_bool_21 +sql insert into st_bool_121 using mt_bool tags ("NULL") values (now, "NULL") +sql show tags from st_bool_121 if $data05 != NULL then print ==43== expect: NULL, actually: $data00 return -1 endi -sql select * from st_bool_21 +sql select * from st_bool_121 if $data01 != NULL then print ==44== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_22 using mt_bool tags ("true") values (now, "true") -sql show tags from st_bool_22 +sql insert into st_bool_122 using mt_bool tags ("true") values (now, "true") +sql show tags from st_bool_122 if $data05 != true then print ==45== expect: 1, actually: $data00 return -1 endi -sql select * from st_bool_22 +sql select * from st_bool_122 if $data01 != 1 then print ==46== expect: 1, actually: $data01 return -1 endi -sql insert into st_bool_23 using mt_bool tags ('true') values (now, 'true') -sql show tags from st_bool_23 +sql insert into st_bool_123 using mt_bool tags ('true') values (now, 'true') +sql show tags from st_bool_123 if $data05 != true then print ==47== expect: 1, actually: $data00 return -1 endi -sql select * from st_bool_23 +sql select * from st_bool_123 if $data01 != 1 then print ==48== expect: 1, actually: $data01 return -1 endi -sql insert into st_bool_24 using mt_bool tags (true) values (now, true) -sql show tags from st_bool_24 +sql insert into st_bool_124 using mt_bool tags (true) values (now, true) +sql show tags from st_bool_124 if $data05 != true then print ==49== expect: 1, actually: $data00 return -1 endi -sql select * from st_bool_24 +sql select * from st_bool_124 if $data01 != 1 then print ==50== expect: 1, actually: $data01 return -1 endi -sql insert into st_bool_25 using mt_bool tags ("false") values (now, "false") -sql show tags from st_bool_25 +sql insert into st_bool_125 using mt_bool tags ("false") values (now, "false") +sql show tags from st_bool_125 if $data05 != false then print ==51== expect: 0, actually: $data00 return -1 endi -sql select * from st_bool_25 +sql select * from st_bool_125 if $data01 != 0 then print ==52== expect: 0, actually: $data01 return -1 endi -sql insert into st_bool_26 using mt_bool tags ('false') values (now, 'false') -sql show tags from st_bool_26 +sql insert into st_bool_126 using mt_bool tags ('false') values (now, 'false') +sql show tags from st_bool_126 if $data05 != false then print ==53== expect: 0, actually: $data00 return -1 endi -sql select * from st_bool_26 +sql select * from st_bool_126 if $data01 != 0 then print ==54== expect: 0, actually: $data01 return -1 endi -sql insert into st_bool_27 using mt_bool tags (false) values (now, false) -sql show tags from st_bool_27 +sql insert into st_bool_127 using mt_bool tags (false) values (now, false) +sql show tags from st_bool_127 if $data05 != false then print ==55== expect: 0, actually: $data00 return -1 endi -sql select * from st_bool_27 +sql select * from st_bool_127 if $data01 != 0 then print ==56== expect: 0, actually: $data01 return -1 endi -sql insert into st_bool_28 using mt_bool tags (0) values (now, 0) -sql show tags from st_bool_28 +sql insert into st_bool_128 using mt_bool tags (0) values (now, 0) +sql show tags from st_bool_128 if $data05 != false then print ==57== expect: 0, actually: $data00 return -1 endi -sql select * from st_bool_28 +sql select * from st_bool_128 if $data01 != 0 then print ==58== expect: 0, actually: $data01 return -1 endi -sql insert into st_bool_29 using mt_bool tags (1) values (now, 1) -sql show tags from st_bool_29 +sql insert into st_bool_129 using mt_bool tags (1) values (now, 1) +sql show tags from st_bool_129 if $data05 != true then print ==59== expect: 1, actually: $data00 return -1 endi -sql select * from st_bool_29 +sql select * from st_bool_129 if $data01 != 1 then print ==60== expect: 1, actually: $data01 return -1 endi -sql insert into st_bool_30 using mt_bool tags (6.9) values (now, 6.9) -sql show tags from st_bool_30 +sql insert into st_bool_130 using mt_bool tags (6.9) values (now, 6.9) +sql show tags from st_bool_130 if $data05 != true then print ==61== expect: 1, actually: $data00 return -1 endi -sql select * from st_bool_30 +sql select * from st_bool_130 if $data01 != 1 then print ==62== expect: 1, actually: $data01 return -1 endi -sql insert into st_bool_31 using mt_bool tags (-3) values (now, -3) -sql show tags from st_bool_31 +sql insert into st_bool_131 using mt_bool tags (-3) values (now, -3) +sql show tags from st_bool_131 if $data05 != true then print ==63== expect: 1, actually: $data00 return -1 endi -sql select * from st_bool_31 +sql select * from st_bool_131 if $data01 != 1 then print ==64== expect: 1, actually: $data01 return -1 endi -sql insert into st_bool_32 using mt_bool tags (+300) values (now, +300) -sql show tags from st_bool_32 +sql insert into st_bool_132 using mt_bool tags (+300) values (now, +300) +sql show tags from st_bool_132 if $data05 != true then print ==63== expect: 1, actually: $data00 return -1 endi -sql select * from st_bool_32 +sql select * from st_bool_132 if $data01 != 1 then print ==64== expect: 1, actually: $data01 return -1 endi -sql insert into st_bool_33 using mt_bool tags (+30.890) values (now, +30.890) -sql show tags from st_bool_33 +sql insert into st_bool_133 using mt_bool tags (+30.890) values (now, +30.890) +sql show tags from st_bool_133 if $data05 != true then print ==63== expect: 1, actually: $data00 return -1 endi -sql select * from st_bool_33 +sql select * from st_bool_133 if $data01 != 1 then print ==64== expect: 1, actually: $data01 return -1 endi - - - - - +sql insert into st_bool_218 using mt_bool tags ("-8.03") values (now,"-8.03") +sql show tags from st_bool_218 +if $data05 != true then + return -1 +endi +sql select * from st_bool_218 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_219 using mt_bool tags ("+300") values (now,"+300") +sql show tags from st_bool_219 +if $data05 != true then + return -1 +endi +sql select * from st_bool_219 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_220 using mt_bool tags ("-8e+2") values (now,"-8e+2") +sql show tags from st_bool_220 +if $data05 != true then + return -1 +endi +sql select * from st_bool_220 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_221 using mt_bool tags ("0x01") values (now,"0x01") +sql show tags from st_bool_221 +if $data05 != true then + return -1 +endi +sql select * from st_bool_221 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_222 using mt_bool tags ("0b01") values (now,"0b01") +sql show tags from st_bool_222 +if $data05 != true then + return -1 +endi +sql select * from st_bool_222 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_223 using mt_bool tags ("+0x01") values (now,"+0x01") +sql show tags from st_bool_223 +if $data05 != true then + return -1 +endi +sql select * from st_bool_223 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_224 using mt_bool tags ("-0b00") values (now,"-0b00") +sql show tags from st_bool_224 +if $data05 != false then + return -1 +endi +sql select * from st_bool_224 +if $data01 != 0 then + return -1 +endi +sql insert into st_bool_226 using mt_bool tags ("-0.11e-30") values (now,"-0.11e-30") +sql show tags from st_bool_226 +if $data05 != true then + return -1 +endi +sql select * from st_bool_226 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_227 using mt_bool tags ("-1.0e-307") values (now,"-1.0e-307") +sql show tags from st_bool_227 +if $data05 != true then + return -1 +endi +sql select * from st_bool_227 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_228 using mt_bool tags ( -1e-1 ) values (now, -1e-1 ) +sql show tags from st_bool_228 +if $data05 != true then + return -1 +endi +sql select * from st_bool_228 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_229 using mt_bool tags (-0.11e-30) values (now,-0.11e-30) +sql show tags from st_bool_229 +if $data05 != true then + return -1 +endi +sql select * from st_bool_229 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_230 using mt_bool tags (-1.1e-307) values (now,-1.1e-307) +sql show tags from st_bool_230 +if $data05 != true then + return -1 +endi +sql select * from st_bool_230 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_231 using mt_bool tags ( 0x01) values (now, 0x01) +sql show tags from st_bool_231 +if $data05 != true then + return -1 +endi +sql select * from st_bool_231 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_232 using mt_bool tags (0b01 ) values (now, 0b01) +sql show tags from st_bool_232 +if $data05 != true then + return -1 +endi +sql select * from st_bool_232 +if $data01 != 1 then + return -1 +endi +sql insert into st_bool_233 using mt_bool tags (+0x01) values (now,+0x01) +sql show tags from st_bool_233 +if $data05 != true then + return -1 +endi +sql insert into st_bool_234 using mt_bool tags ( -0b00 ) values (now, -0b00) +sql show tags from st_bool_234 +if $data05 != false then + return -1 +endi +sql select * from st_bool_234 +if $data01 != 0 then + return -1 +endi ## case 03: alter tag values -#sql alter table st_bool_0 set tag tagname=true -#sql show tags from st_bool_0 -#if $data00 != true then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname=NULL -#sql show tags from st_bool_0 -#if $data00 != NULL then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname=false -#sql show tags from st_bool_0 -#if $data00 != false then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname=NULL -#sql show tags from st_bool_0 -#if $data00 != NULL then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname='true' -#sql show tags from st_bool_0 -#if $data00 != true then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname='NULL' -#sql show tags from st_bool_0 -#if $data00 != NULL then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname='false' -#sql show tags from st_bool_0 -#if $data00 != false then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname='NULL' -#sql show tags from st_bool_0 -#if $data00 != NULL then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname="true" -#sql show tags from st_bool_0 -#if $data00 != true then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname="NULL" -#sql show tags from st_bool_0 -#if $data00 != NULL then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname="false" -#sql show tags from st_bool_0 -#if $data00 != false then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname="NULL" -#sql show tags from st_bool_0 -#if $data00 != NULL then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname=1 -#sql show tags from st_bool_0 -#if $data00 != true then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname=0 -#sql show tags from st_bool_0 -#if $data00 != false then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname=6.9 -#sql show tags from st_bool_0 -#if $data00 != true then -# return -1 -#endi -#sql alter table st_bool_0 set tag tagname=-3 -#sql show tags from st_bool_0 -#if $data00 != true then -# return -1 -#endi +sql alter table st_bool_16 set tag tagname=+300 +sql show tags from st_bool_16 +if $data05 != true then + return -1 +endi +sql alter table st_bool_17 set tag tagname=-8.03 +sql show tags from st_bool_17 +if $data05 != true then + return -1 +endi +sql alter table st_bool_18 set tag tagname="-8.03" +sql show tags from st_bool_18 +if $data05 != true then + return -1 +endi +sql alter table st_bool_19 set tag tagname="+300" +sql show tags from st_bool_19 +if $data05 != true then + return -1 +endi +sql alter table st_bool_20 set tag tagname="-8e+2" +sql show tags from st_bool_20 +if $data05 != true then + return -1 +endi +sql alter table st_bool_21 set tag tagname="0x01" +sql show tags from st_bool_21 +if $data05 != true then + return -1 +endi +sql alter table st_bool_22 set tag tagname="0b01" +sql show tags from st_bool_22 +if $data05 != true then + return -1 +endi +sql alter table st_bool_23 set tag tagname="+0x01" +sql show tags from st_bool_23 +if $data05 != true then + return -1 +endi +sql alter table st_bool_24 set tag tagname="-0b00" +sql show tags from st_bool_24 +if $data05 != false then + return -1 +endi +sql alter table st_bool_26 set tag tagname="-0.11e-30" +sql show tags from st_bool_26 +if $data05 != true then + return -1 +endi +sql alter table st_bool_27 set tag tagname="-1.0e-307" +sql show tags from st_bool_27 +if $data05 != true then + return -1 +endi +sql alter table st_bool_28 set tag tagname= -1e-1 +sql show tags from st_bool_28 +if $data05 != true then + return -1 +endi +sql alter table st_bool_29 set tag tagname=-0.11e-30 +sql show tags from st_bool_29 +if $data05 != true then + return -1 +endi +sql alter table st_bool_30 set tag tagname=-1.1e-307 +sql show tags from st_bool_30 +if $data05 != true then + return -1 +endi +sql alter table st_bool_31 set tag tagname= 0x01 +sql show tags from st_bool_31 +if $data05 != true then + return -1 +endi +sql alter table st_bool_32 set tag tagname=0b01 +sql show tags from st_bool_32 +if $data05 != true then + return -1 +endi +sql alter table st_bool_33 set tag tagname=+0x01 +sql show tags from st_bool_33 +if $data05 != true then + return -1 +endi +sql alter table st_bool_34 set tag tagname= -0b00 +sql show tags from st_bool_34 +if $data05 != false then + return -1 +endi # case 04: illegal input sql_error create table st_bool_e0 using mt_bool tags (123abc) -sql create table st_bool_e1 using mt_bool tags ("123abc") +sql_error create table st_bool_e1 using mt_bool tags ("123abc") sql create table st_bool_e2 using mt_bool tags ("123") sql_error create table st_bool_e3 using mt_bool tags (abc) -sql create table st_bool_e4 using mt_bool tags ("abc") -sql create table st_bool_e5 using mt_bool tags (" ") -sql create table st_bool_e6 using mt_bool tags ('') +sql_error create table st_bool_e4 using mt_bool tags ("abc") +sql_error create table st_bool_e5 using mt_bool tags (" ") +sql_error create table st_bool_e6 using mt_bool tags ('') sql create table st_bool_f0 using mt_bool tags (true) sql create table st_bool_f1 using mt_bool tags (true) @@ -598,7 +901,7 @@ sql create table st_bool_f6 using mt_bool tags (true) sql_error insert into st_bool_g0 values (now, 123abc) sql_error insert into st_bool_g1 values (now, "123abc") -sql_error insert into st_bool_g2 values (now, "123") +sql insert into st_bool_f2 values (now, "123") sql_error insert into st_bool_g3 values (now, abc) sql_error insert into st_bool_g4 values (now, "abc") sql_error insert into st_bool_g5 values (now, " ") @@ -606,7 +909,7 @@ sql_error insert into st_bool_g6 values (now, '') sql_error insert into st_bool_h0 using mt_bool tags (123abc) values (now, 1) sql_error insert into st_bool_h1 using mt_bool tags ("123abc") values (now, 1) -sql_error insert into st_bool_h2 using mt_bool tags ("123") values (now, 1) +sql insert into st_bool_h2 using mt_bool tags ("123") values (now, 1) sql_error insert into st_bool_h3 using mt_bool tags (abc) values (now, 1) sql_error insert into st_bool_h4 using mt_bool tags ("abc") values (now, 1) sql_error insert into st_bool_h5 using mt_bool tags (" ") values (now, 1) @@ -614,7 +917,7 @@ sql_error insert into st_bool_h6 using mt_bool tags ('') values (now, 1) sql_error insert into st_bool_h0 using mt_bool tags (1) values (now, 123abc) sql_error insert into st_bool_h1 using mt_bool tags (1) values (now, "123abc") -sql_error insert into st_bool_h2 using mt_bool tags (1) values (now, "123") +sql insert into st_bool_h2 using mt_bool tags (1) values (now, "123") sql_error insert into st_bool_h3 using mt_bool tags (1) values (now, abc) sql_error insert into st_bool_h4 using mt_bool tags (1) values (now, "abc") sql_error insert into st_bool_h5 using mt_bool tags (1) values (now, " ") @@ -629,11 +932,11 @@ sql insert into st_bool_i5 using mt_bool tags (1) values (now, 1) sql insert into st_bool_i6 using mt_bool tags (1) values (now, 1) sql_error alter table st_bool_i0 set tag tagname=123abc -sql alter table st_bool_i1 set tag tagname="123abc" -sql alter table st_bool_i2 set tag tagname="123" +sql_error alter table st_bool_i1 set tag tagname="123abc" +sql alter table st_bool_i2 set tag tagname="123" sql_error alter table st_bool_i3 set tag tagname=abc -sql alter table st_bool_i4 set tag tagname="abc" -sql alter table st_bool_i5 set tag tagname=" " -sql alter table st_bool_i6 set tag tagname='' +sql_error alter table st_bool_i4 set tag tagname="abc" +sql_error alter table st_bool_i5 set tag tagname=" " +sql_error alter table st_bool_i6 set tag tagname='' system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_double.sim b/tests/script/tsim/parser/columnValue_double.sim index bfcf338fac..2b1178106f 100644 --- a/tests/script/tsim/parser/columnValue_double.sim +++ b/tests/script/tsim/parser/columnValue_double.sim @@ -28,22 +28,22 @@ if $data05 != NULL then endi sql create table st_double_2 using mt_double tags ('NULL') sql show tags from st_double_2 -if $data05 != 0.000000000 then +if $data05 != NULL then return -1 endi sql create table st_double_3 using mt_double tags ('NULL') sql show tags from st_double_3 -if $data05 != 0.000000000 then +if $data05 != NULL then return -1 endi sql create table st_double_4 using mt_double tags ("NULL") sql show tags from st_double_4 -if $data05 != 0.000000000 then +if $data05 != NULL then return -1 endi sql create table st_double_5 using mt_double tags ("NULL") sql show tags from st_double_5 -if $data05 != 0.000000000 then +if $data05 != NULL then return -1 endi sql create table st_double_6 using mt_double tags (-123.321) @@ -148,6 +148,46 @@ sql show tags from st_double_16_0 #if $data05 != 0.001500000 then # return -1 #endi +sql create table st_double_100 using mt_double tags ("0x01") +sql show tags from st_double_100 +if $data05 != 1.000000000 then + return -1 +endi +sql create table st_double_101 using mt_double tags ("0b01") +sql show tags from st_double_101 +if $data05 != 1.000000000 then + return -1 +endi +sql create table st_double_102 using mt_double tags ("+0x01") +sql show tags from st_double_102 +if $data05 != 1.000000000 then + return -1 +endi +sql create table st_double_103 using mt_double tags ("-0b01") +sql show tags from st_double_103 +if $data05 != -1.000000000 then + return -1 +endi +sql create table st_double_200 using mt_double tags ( 0x01) +sql show tags from st_double_200 +if $data05 != 1.000000000 then + return -1 +endi +sql create table st_double_201 using mt_double tags (0b01 ) +sql show tags from st_double_201 +if $data05 != 1.000000000 then + return -1 +endi +sql create table st_double_202 using mt_double tags (+0x01) +sql show tags from st_double_202 +if $data05 != 1.000000000 then + return -1 +endi +sql create table st_double_203 using mt_double tags ( -0b01 ) +sql show tags from st_double_203 +if $data05 != -1.000000000 then + return -1 +endi ## case 01: insert values for test column values sql insert into st_double_0 values (now, NULL ) @@ -274,6 +314,70 @@ endi #if $data01 != -56 then # return -1 #endi +sql insert into st_double_100 values(now, "0x01") +sql select * from st_double_100 +if $rows != 1 then + return -1 +endi +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_101 values(now, "0b01") +sql select * from st_double_101 +if $rows != 1 then + return -1 +endi +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_102 values(now, "+0x01") +sql select * from st_double_102 +if $rows != 1 then + return -1 +endi +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_103 values(now, "-0b01") +sql select * from st_double_103 +if $rows != 1 then + return -1 +endi +if $data01 != -1.000000000 then + return -1 +endi +sql insert into st_double_200 values(now, 0x01) +sql select * from st_double_200 +if $rows != 1 then + return -1 +endi +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_201 values(now, 0b01 ) +sql select * from st_double_201 +if $rows != 1 then + return -1 +endi +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_202 values(now, +0x01) +sql select * from st_double_202 +if $rows != 1 then + return -1 +endi +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_203 values(now, -0b01 ) +sql select * from st_double_203 +if $rows != 1 then + return -1 +endi +if $data01 != -1.000000000 then + return -1 +endi ## case 02: dynamic create table for test tag values sql insert into st_double_16 using mt_double tags (NULL ) values (now, NULL ) @@ -394,6 +498,78 @@ sql select * from st_double_28 #if $data01 != -56 then # return -1 #endi +sql insert into st_double_100 using mt_double tags ("0x01") values (now, "0x01") +sql show tags from st_double_100 +if $data05 != 1.000000000 then + return -1 +endi +sql select * from st_double_100 +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_101 using mt_double tags ("0b01") values (now, "0b01") +sql show tags from st_double_101 +if $data05 != 1.000000000 then + return -1 +endi +sql select * from st_double_101 +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_102 using mt_double tags ("+0x01") values (now, "+0x01") +sql show tags from st_double_102 +if $data05 != 1.000000000 then + return -1 +endi +sql select * from st_double_102 +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_103 using mt_double tags ("-0b01") values (now, "-0b01") +sql show tags from st_double_103 +if $data05 != -1.000000000 then + return -1 +endi +sql select * from st_double_103 +if $data01 != -1.000000000 then + return -1 +endi +sql insert into st_double_200 using mt_double tags ( 0x01) values (now, 0x01) +sql show tags from st_double_200 +if $data05 != 1.000000000 then + return -1 +endi +sql select * from st_double_200 +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_201 using mt_double tags (0b01 ) values (now, 0b01) +sql show tags from st_double_201 +if $data05 != 1.000000000 then + return -1 +endi +sql select * from st_double_201 +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_202 using mt_double tags (+0x01) values (now, +0x01) +sql show tags from st_double_202 +if $data05 != 1.000000000 then + return -1 +endi +sql select * from st_double_202 +if $data01 != 1.000000000 then + return -1 +endi +sql insert into st_double_203 using mt_double tags ( -0b01 ) values (now, -0b01) +sql show tags from st_double_203 +if $data05 != -1.000000000 then + return -1 +endi +sql select * from st_double_203 +if $data01 != -1.000000000 then + return -1 +endi ### case 03: alter tag values #sql alter table st_double_0 set tag tagname=1.7976931348623157e+308 @@ -436,6 +612,46 @@ sql select * from st_double_28 ##if $data05 != -63 then ## return -1 ##endi +sql alter table st_double_100 set tag tagname="0x01" +sql show tags from st_double_100 +if $data05 != 1.000000000 then + return -1 +endi +sql alter table st_double_101 set tag tagname="0b01" +sql show tags from st_double_101 +if $data05 != 1.000000000 then + return -1 +endi +sql alter table st_double_102 set tag tagname="+0x01" +sql show tags from st_double_102 +if $data05 != 1.000000000 then + return -1 +endi +sql alter table st_double_103 set tag tagname="-0b01" +sql show tags from st_double_103 +if $data05 != -1.000000000 then + return -1 +endi +sql alter table st_double_200 set tag tagname= 0x01 +sql show tags from st_double_200 +if $data05 != 1.000000000 then + return -1 +endi +sql alter table st_double_201 set tag tagname=0b01 +sql show tags from st_double_201 +if $data05 != 1.000000000 then + return -1 +endi +sql alter table st_double_202 set tag tagname=+0x01 +sql show tags from st_double_202 +if $data05 != 1.000000000 then + return -1 +endi +sql alter table st_double_203 set tag tagname= -0b01 +sql show tags from st_double_203 +if $data05 != -1.000000000 then + return -1 +endi ## case 04: illegal input sql_error create table st_double_e0 using mt_double tags (1.8976931348623157e+308) @@ -445,11 +661,11 @@ sql_error create table st_double_e0 using mt_double tags (-31.7976931348623157e+ #sql_error create table st_double_e0 using mt_double tags (12.80) truncate integer part #sql_error create table st_double_e0 using mt_double tags (-11.80) sql_error create table st_double_e0 using mt_double tags (123abc) -sql create table st_double_e0_1 using mt_double tags ("123abc") +sql_error create table st_double_e0_1 using mt_double tags ("123abc") sql_error create table st_double_e0 using mt_double tags (abc) -sql create table st_double_e0_2 using mt_double tags ("abc") -sql create table st_double_e0_3 using mt_double tags (" ") -sql create table st_double_e0_4 using mt_double tags ('') +sql_error create table st_double_e0_2 using mt_double tags ("abc") +sql_error create table st_double_e0_3 using mt_double tags (" ") +sql_error create table st_double_e0_4 using mt_double tags ('') sql create table st_double_e0 using mt_double tags (123) sql create table st_double_e1 using mt_double tags (123) @@ -502,7 +718,8 @@ sql_error insert into st_double_e20 using mt_double tags ("123abc") values (now, sql_error insert into st_double_e22 using mt_double tags (abc) values (now, -033) sql_error insert into st_double_e23 using mt_double tags ("abc") values (now, -033) sql_error insert into st_double_e24 using mt_double tags (" ") values (now, -033) -sql insert into st_double_e25 using mt_double tags ('') values (now, -033) +sql_error insert into st_double_e25 using mt_double tags ('') values (now, -033) +sql insert into st_double_e20 using mt_double tags ("123") values (now, -033) sql insert into st_double_e13 using mt_double tags (033) values (now, 00062) sql insert into st_double_e14 using mt_double tags (033) values (now, 00062) @@ -523,10 +740,11 @@ sql_error alter table st_double_e14 set tag tagname=-1.8976931348623157e+308 sql_error alter table st_double_e15 set tag tagname=131.7976931348623157e+308 sql_error alter table st_double_e16 set tag tagname=-131.7976931348623157e+308 sql_error alter table st_double_e19 set tag tagname=123abc -sql alter table st_double_e20 set tag tagname="123abc" +sql_error alter table st_double_e20 set tag tagname="123abc" sql_error alter table st_double_e22 set tag tagname=abc -sql alter table st_double_e23 set tag tagname="abc" -sql alter table st_double_e24 set tag tagname=" " -sql alter table st_double_e25 set tag tagname='' +sql_error alter table st_double_e23 set tag tagname="abc" +sql_error alter table st_double_e24 set tag tagname=" " +sql_error alter table st_double_e25 set tag tagname='' +sql alter table st_double_e25 set tag tagname='123' system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_float.sim b/tests/script/tsim/parser/columnValue_float.sim index 4dcda33224..facb2f1b79 100644 --- a/tests/script/tsim/parser/columnValue_float.sim +++ b/tests/script/tsim/parser/columnValue_float.sim @@ -29,22 +29,22 @@ if $data05 != NULL then endi sql create table st_float_2 using mt_float tags ('NULL') sql show tags from st_float_2 -if $data05 != 0.00000 then +if $data05 != NULL then return -1 endi sql create table st_float_3 using mt_float tags ('NULL') sql show tags from st_float_3 -if $data05 != 0.00000 then +if $data05 != NULL then return -1 endi sql create table st_float_4 using mt_float tags ("NULL") sql show tags from st_float_4 -if $data05 != 0.00000 then +if $data05 != NULL then return -1 endi sql create table st_float_5 using mt_float tags ("NULL") sql show tags from st_float_5 -if $data05 != 0.00000 then +if $data05 != NULL then return -1 endi sql create table st_float_6 using mt_float tags (-123.321) @@ -156,16 +156,62 @@ if $data05 != 0.00150 then print expect 0.00150, actual: $data05 return -1 endi -#sql create table st_float_15_0 using mt_float tags (3.40282347e+38) -#sql show tags from st_float_15_0 -#if $data05 != 0.001500 then -# return -1 -#endi -#sql create table st_float_16_0 using mt_float tags (-3.40282347e+38) -#sql show tags from st_float_16_0 -#if $data05 != 0.001500 then -# return -1 -#endi +sql create table st_float_15_0 using mt_float tags (3.40282346638528859811704183484516925e+38) +sql show tags from st_float_15_0 +if $data05 < 340282346638528859811704183484516925000 then + return -1 +endi +if $data05 > 340282346638528859811704183484516925900 then + return -1 +endi +sql create table st_float_16_0 using mt_float tags (-3.40282346638528859811704183484516925e+38) +sql show tags from st_float_16_0 +if $data05 < -340282346638528859811704183484516925900 then + return -1 +endi +if $data05 > -340282346638528859811704183484516925000 then + return -1 +endi +sql create table st_float_100 using mt_float tags ("0x01") +sql show tags from st_float_100 +if $data05 != 1.00000 then + return -1 +endi +sql create table st_float_101 using mt_float tags ("0b01") +sql show tags from st_float_101 +if $data05 != 1.00000 then + return -1 +endi +sql create table st_float_102 using mt_float tags ("+0x01") +sql show tags from st_float_102 +if $data05 != 1.00000 then + return -1 +endi +sql create table st_float_103 using mt_float tags ("-0b01") +sql show tags from st_float_103 +if $data05 != -1.00000 then + return -1 +endi +sql create table st_float_200 using mt_float tags ( 0x01) +sql show tags from st_float_200 +if $data05 != 1.00000 then + return -1 +endi +sql create table st_float_201 using mt_float tags (0b01 ) +sql show tags from st_float_201 +if $data05 != 1.00000 then + return -1 +endi +sql create table st_float_202 using mt_float tags (+0x01) +sql show tags from st_float_202 +if $data05 != 1.00000 then + return -1 +endi +sql create table st_float_203 using mt_float tags ( -0b01 ) +sql show tags from st_float_203 +if $data05 != -1.00000 then + return -1 +endi ## case 01: insert values for test column values sql insert into st_float_0 values (now, NULL) @@ -216,6 +262,70 @@ endi if $data01 != NULL then return -1 endi +sql insert into st_float_100 values(now, "0x01") +sql select * from st_float_100 +if $rows != 1 then + return -1 +endi +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_101 values(now, "0b01") +sql select * from st_float_101 +if $rows != 1 then + return -1 +endi +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_102 values(now, "+0x01") +sql select * from st_float_102 +if $rows != 1 then + return -1 +endi +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_103 values(now, "-0b01") +sql select * from st_float_103 +if $rows != 1 then + return -1 +endi +if $data01 != -1.00000 then + return -1 +endi +sql insert into st_float_200 values(now, 0x01) +sql select * from st_float_200 +if $rows != 1 then + return -1 +endi +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_201 values(now, 0b01 ) +sql select * from st_float_201 +if $rows != 1 then + return -1 +endi +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_202 values(now, +0x01) +sql select * from st_float_202 +if $rows != 1 then + return -1 +endi +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_203 values(now, -0b01 ) +sql select * from st_float_203 +if $rows != 1 then + return -1 +endi +if $data01 != -1.00000 then + return -1 +endi sql_error insert into st_float_6 values (now, 3.40282347e+38) sql_error insert into st_float_6 values (now, -3.40282347e+38) @@ -425,6 +535,78 @@ sql select * from st_float_28 if $data01 != -5.60000 then return -1 endi +sql insert into st_float_100 using mt_float tags ("0x01") values (now, "0x01") +sql show tags from st_float_100 +if $data05 != 1.00000 then + return -1 +endi +sql select * from st_float_100 +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_101 using mt_float tags ("0b01") values (now, "0b01") +sql show tags from st_float_101 +if $data05 != 1.00000 then + return -1 +endi +sql select * from st_float_101 +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_102 using mt_float tags ("+0x01") values (now, "+0x01") +sql show tags from st_float_102 +if $data05 != 1.00000 then + return -1 +endi +sql select * from st_float_102 +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_103 using mt_float tags ("-0b01") values (now, "-0b01") +sql show tags from st_float_103 +if $data05 != -1.00000 then + return -1 +endi +sql select * from st_float_103 +if $data01 != -1.00000 then + return -1 +endi +sql insert into st_float_200 using mt_float tags ( 0x01) values (now, 0x01) +sql show tags from st_float_200 +if $data05 != 1.00000 then + return -1 +endi +sql select * from st_float_200 +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_201 using mt_float tags (0b01 ) values (now, 0b01) +sql show tags from st_float_201 +if $data05 != 1.00000 then + return -1 +endi +sql select * from st_float_201 +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_202 using mt_float tags (+0x01) values (now, +0x01) +sql show tags from st_float_202 +if $data05 != 1.00000 then + return -1 +endi +sql select * from st_float_202 +if $data01 != 1.00000 then + return -1 +endi +sql insert into st_float_203 using mt_float tags ( -0b01 ) values (now, -0b01) +sql show tags from st_float_203 +if $data05 != -1.00000 then + return -1 +endi +sql select * from st_float_203 +if $data01 != -1.00000 then + return -1 +endi ### case 03: alter tag values sql alter table st_float_0 set tag tagname=340282346638528859811704183484516925440.00000 @@ -468,6 +650,46 @@ sql show tags from st_float_0 if $data05 != -63.58200 then return -1 endi +sql alter table st_float_100 set tag tagname="0x01" +sql show tags from st_float_100 +if $data05 != 1.00000 then + return -1 +endi +sql alter table st_float_101 set tag tagname="0b01" +sql show tags from st_float_101 +if $data05 != 1.00000 then + return -1 +endi +sql alter table st_float_102 set tag tagname="+0x01" +sql show tags from st_float_102 +if $data05 != 1.00000 then + return -1 +endi +sql alter table st_float_103 set tag tagname="-0b01" +sql show tags from st_float_103 +if $data05 != -1.00000 then + return -1 +endi +sql alter table st_float_200 set tag tagname= 0x01 +sql show tags from st_float_200 +if $data05 != 1.00000 then + return -1 +endi +sql alter table st_float_201 set tag tagname=0b01 +sql show tags from st_float_201 +if $data05 != 1.00000 then + return -1 +endi +sql alter table st_float_202 set tag tagname=+0x01 +sql show tags from st_float_202 +if $data05 != 1.00000 then + return -1 +endi +sql alter table st_float_203 set tag tagname= -0b01 +sql show tags from st_float_203 +if $data05 != -1.00000 then + return -1 +endi ## case 04: illegal input sql_error create table st_float_e0 using mt_float tags (3.50282347e+38) @@ -477,11 +699,11 @@ sql_error create table st_float_e0 using mt_float tags (-333.40282347e+38) #sql_error create table st_float_e0 using mt_float tags (12.80) truncate integer part #sql_error create table st_float_e0 using mt_float tags (-11.80) sql_error create table st_float_e0 using mt_float tags (123abc) -sql create table st_float_e0_1 using mt_float tags ("123abc") +sql_error create table st_float_e0_1 using mt_float tags ("123abc") sql_error create table st_float_e0 using mt_float tags (abc) -sql create table st_float_e0_2 using mt_float tags ("abc") -sql create table st_float_e0_3 using mt_float tags (" ") -sql create table st_float_e0_4 using mt_float tags ('') +sql_error create table st_float_e0_2 using mt_float tags ("abc") +sql_error create table st_float_e0_3 using mt_float tags (" ") +sql_error create table st_float_e0_4 using mt_float tags ('') sql create table st_float_e0 using mt_float tags (123) sql create table st_float_e1 using mt_float tags (123) @@ -534,7 +756,7 @@ sql_error insert into st_float_e20 using mt_float tags ("123abc") values (now, - sql_error insert into st_float_e22 using mt_float tags (abc) values (now, -033) sql_error insert into st_float_e23 using mt_float tags ("abc") values (now, -033) sql_error insert into st_float_e24 using mt_float tags (" ") values (now, -033) -sql insert into st_float_e25_3 using mt_float tags ('') values (now, -033) +sql_error insert into st_float_e25_3 using mt_float tags ('') values (now, -033) sql insert into st_float_e13 using mt_float tags (033) values (now, 00062) sql insert into st_float_e14 using mt_float tags (033) values (now, 00062) @@ -555,10 +777,10 @@ sql_error alter table st_float_e14 set tag tagname=-3.50282347e+38 sql_error alter table st_float_e15 set tag tagname=13.40282347e+38 sql_error alter table st_float_e16 set tag tagname=-13.40282347e+38 sql_error alter table st_float_e19 set tag tagname=123abc -sql alter table st_float_e20 set tag tagname="123abc" +sql_error alter table st_float_e20 set tag tagname="123abc" sql_error alter table st_float_e22 set tag tagname=abc -sql alter table st_float_e23 set tag tagname="abc" -sql alter table st_float_e24 set tag tagname=" " -sql alter table st_float_e25 set tag tagname='' +sql_error alter table st_float_e23 set tag tagname="abc" +sql_error alter table st_float_e24 set tag tagname=" " +sql_error alter table st_float_e25 set tag tagname='' system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_geometry.sim b/tests/script/tsim/parser/columnValue_geometry.sim new file mode 100644 index 0000000000..6b3c3a4390 --- /dev/null +++ b/tests/script/tsim/parser/columnValue_geometry.sim @@ -0,0 +1,277 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ========== columnValues.sim + +sql drop database if exists db +sql create database db +sql use db + +#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value + +######## case 0: geometry +print ========== geometry +sql create table mt_geometry (ts timestamp, c geometry(128)) tags(tagname geometry(128)) + +## case 00: static create table for test tag values +sql create table st_geometry_0 using mt_geometry tags(NULL) +sql show tags from st_geometry_0 +if $data05 != NULL then + return -1 +endi +sql create table st_geometry_1 using mt_geometry tags(NULL) +sql show tags from st_geometry_1 +if $data05 != NULL then + return -1 +endi +sql create table st_geometry_2 using mt_geometry tags('NULL') +sql show tags from st_geometry_2 +if $data05 != NULL then + return -1 +endi +sql create table st_geometry_3 using mt_geometry tags('NULL') +sql show tags from st_geometry_3 +if $data05 != NULL then + return -1 +endi +sql create table st_geometry_4 using mt_geometry tags("NULL") +sql show tags from st_geometry_4 +if $data05 != NULL then + return -1 +endi +sql create table st_geometry_5 using mt_geometry tags("NULL") +sql show tags from st_geometry_5 +if $data05 != NULL then + return -1 +endi +sql create table st_geometry_6 using mt_geometry tags("POINT(1.0 1.0)") +sql show tags from st_geometry_6 +if $data05 != @POINT (1.000000 1.000000)@ then + print $data05 + return -1 +endi +sql create table st_geometry_7 using mt_geometry tags(" LINESTRING(1.0 1.0, 2.0 2.0)") +sql show tags from st_geometry_7 +if $data05 != @LINESTRING (1.000000 1.000000, 2.000000 2.000000)@ then + print $data05 + return -1 +endi +sql create table st_geometry_8 using mt_geometry tags("POLYGON((1.0 1.0, -2.0 +2.0, 1.0 1.0))") +sql show tags from st_geometry_8 +if $data05 != @POLYGON ((1.000000 1.000000, -2.000000 2.000000, 1.000000 1.000000))@ then + print $data05 + return -1 +endi + +## case 01: insert values for test column values +sql insert into st_geometry_0 values(now, NULL) +sql select *from st_geometry_0 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_1 values(now, NULL) +sql select *from st_geometry_1 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_2 values(now, 'NULL') +sql select *from st_geometry_2 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_3 values(now, 'NULL') +sql select *from st_geometry_3 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_4 values(now, "NULL") +sql select *from st_geometry_4 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_5 values(now, "NULL") +sql select *from st_geometry_5 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_6 values(now, "POINT(1.0 1.0)") +sql select *from st_geometry_6 +if $data01 != @POINT (1.000000 1.000000)@ then +# return -1 +endi +sql insert into st_geometry_7 values(now, " LINESTRING(1.0 1.0, 2.0 2.0)") +sql select *from st_geometry_7 +if $data01 != @LINESTRING (1.000000 1.000000, 2.000000 2.000000)@ then +# return -1 +endi +sql insert into st_geometry_8 values(now, "POLYGON((1.0 1.0, -2.0 +2.0, 1.0 1.0))") +sql select *from st_geometry_8 +if $data01 != @POLYGON ((1.000000 1.000000, -2.000000 2.000000, 1.000000 1.000000))@ then +# return -1 +endi + +## case 02: dynamic create table for test tag values +sql insert into st_geometry_100 using mt_geometry tags(NULL) values(now, NULL) +sql show tags from st_geometry_100 +if $data05 != NULL then + return -1 +endi +sql select *from st_geometry_100 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_101 using mt_geometry tags(NULL) values(now, NULL) +sql show tags from st_geometry_101 +if $data05 != NULL then + return -1 +endi +sql select *from st_geometry_100 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_102 using mt_geometry tags('NULL') values(now, 'NULL') +sql show tags from st_geometry_102 +if $data05 != NULL then + return -1 +endi +sql select *from st_geometry_100 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_103 using mt_geometry tags('NULL') values(now, 'NULL') +sql show tags from st_geometry_103 +if $data05 != NULL then + return -1 +endi +sql select *from st_geometry_100 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_104 using mt_geometry tags("NULL") values(now, "NULL") +sql show tags from st_geometry_104 +if $data05 != NULL then + return -1 +endi +sql select *from st_geometry_100 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_105 using mt_geometry tags("NULL") values(now, "NULL") +sql show tags from st_geometry_105 +if $data05 != NULL then + return -1 +endi +sql select *from st_geometry_100 +if $data01 != NULL then + return -1 +endi +sql insert into st_geometry_106 using mt_geometry tags("POINT(1.0 1.0)") values(now, "POINT(1.0 1.0)") +sql show tags from st_geometry_106 +if $data05 != @POINT (1.000000 1.000000)@ then + return -1 +endi +sql select *from st_geometry_106 +if $data01 != @POINT (1.000000 1.000000)@ then +# return -1 +endi +sql insert into st_geometry_107 using mt_geometry tags(" LINESTRING(1.0 1.0, 2.0 2.0)") values(now, "LINESTRING(1.0 1.0, 2.0 2.0)") +sql show tags from st_geometry_107 +if $data05 != @LINESTRING (1.000000 1.000000, 2.000000 2.000000)@ then + return -1 +endi +sql select *from st_geometry_107 +if $data01 != @LINESTRING (1.000000 1.000000, 2.000000 2.000000)@ then +# return -1 +endi +sql insert into st_geometry_108 using mt_geometry tags("POLYGON((1.0 1.0, -2.0 +2.0, 1.0 1.0))") values(now, "POLYGON((1.0 1.0, -2.0 +2.0, 1.0 1.0))") +sql show tags from st_geometry_108 +if $data05 != @POLYGON ((1.000000 1.000000, -2.000000 2.000000, 1.000000 1.000000))@ then + return -1 +endi +sql select *from st_geometry_108 +if $data01 != @POLYGON ((1.000000 1.000000, -2.000000 2.000000, 1.000000 1.000000))@ then +# return -1 +endi + +## case 03: alter tag values +sql alter table st_geometry_0 set tag tagname=NULL +sql show tags from st_geometry_0 +if $data05 != NULL then + return -1 +endi +sql alter table st_geometry_1 set tag tagname=NULL +sql show tags from st_geometry_1 +if $data05 != NULL then + return -1 +endi +sql alter table st_geometry_2 set tag tagname='NULL' +sql show tags from st_geometry_2 +if $data05 != NULL then + return -1 +endi +sql alter table st_geometry_3 set tag tagname='NULL' +sql show tags from st_geometry_3 +if $data05 != NULL then + return -1 +endi +sql alter table st_geometry_4 set tag tagname="NULL" +sql show tags from st_geometry_4 +if $data05 != NULL then + return -1 +endi +sql alter table st_geometry_5 set tag tagname="NULL" +sql show tags from st_geometry_5 +if $data05 != NULL then + return -1 +endi +sql alter table st_geometry_6 set tag tagname="POINT(1.0 1.0)" +sql show tags from st_geometry_6 +if $data05 != @POINT (1.000000 1.000000)@ then + return -1 +endi +sql alter table st_geometry_7 set tag tagname=" LINESTRING(1.0 1.0, 2.0 2.0)" +sql show tags from st_geometry_7 +if $data05 != @LINESTRING (1.000000 1.000000, 2.000000 2.000000)@ then + return -1 +endi +sql alter table st_geometry_8 set tag tagname="POLYGON((1.0 1.0, -2.0 +2.0, 1.0 1.0))" +sql show tags from st_geometry_8 +if $data05 != @POLYGON ((1.000000 1.000000, -2.000000 2.000000, 1.000000 1.000000))@ then + return -1 +endi + +# case 04: illegal input +sql_error create table st_geometry_206 using mt_geometry tags(+0123) +sql_error create table st_geometry_207 using mt_geometry tags(-01.23) +sql_error create table st_geometry_208 using mt_geometry tags(+0x01) +sql_error create table st_geometry_209 using mt_geometry tags(-0b01) +sql_error create table st_geometry_2010 using mt_geometry tags(-0.1e-10) +sql_error create table st_geometry_2011 using mt_geometry tags(+0.1E+2) +sql_error create table st_geometry_2012 using mt_geometry tags(tRue) +sql_error create table st_geometry_2013 using mt_geometry tags(FalsE) +sql_error create table st_geometry_2014 using mt_geometry tags(noW) +sql_error create table st_geometry_2015 using mt_geometry tags(toDay) +sql_error insert into st_geometry_206 using mt_geometry tags(+0123) values(now, NULL); +sql_error insert into st_geometry_207 using mt_geometry tags(-01.23) values(now, NULL); +sql_error insert into st_geometry_208 using mt_geometry tags(+0x01) values(now, NULL); +sql_error insert into st_geometry_209 using mt_geometry tags(-0b01) values(now, NULL); +sql_error insert into st_geometry_2010 using mt_geometry tags(-0.1e-10) values(now, NULL); +sql_error insert into st_geometry_2011 using mt_geometry tags(+0.1E+2) values(now, NULL); +sql_error insert into st_geometry_2012 using mt_geometry tags(tRue) values(now, NULL); +sql_error insert into st_geometry_2013 using mt_geometry tags(FalsE) values(now, NULL); +sql_error insert into st_geometry_2014 using mt_geometry tags(noW) values(now, NULL); +sql_error insert into st_geometry_2015 using mt_geometry tags(toDay) values(now, NULL); +sql_error insert into st_geometry_106 using mt_varbinary tags(NULL) values(now(), +0123) +sql_error insert into st_geometry_107 using mt_varbinary tags(NULL) values(now(), -01.23) +sql_error insert into st_geometry_108 using mt_varbinary tags(NULL) values(now(), +0x01) +sql_error insert into st_geometry_109 using mt_varbinary tags(NULL) values(now(), -0b01) +sql_error insert into st_geometry_1010 using mt_varbinary tags(NULL) values(now(), -0.1e-10) +sql_error insert into st_geometry_1011 using mt_varbinary tags(NULL) values(now(), +0.1E+2) +sql_error insert into st_geometry_1012 using mt_varbinary tags(NULL) values(now(), tRue) +sql_error insert into st_geometry_1013 using mt_varbinary tags(NULL) values(now(), FalsE) +sql_error insert into st_geometry_1014 using mt_varbinary tags(NULL) values(now(), noW) +sql_error insert into st_geometry_1015 using mt_varbinary tags(NULL) values(now(), toDay) + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_int.sim b/tests/script/tsim/parser/columnValue_int.sim index e68ae6f13f..f03a576ae3 100644 --- a/tests/script/tsim/parser/columnValue_int.sim +++ b/tests/script/tsim/parser/columnValue_int.sim @@ -28,10 +28,26 @@ if $data05 != NULL then return -1 endi -sql_error create table st_int_2 using mt_int tags ('NULL') -sql_error create table st_int_3 using mt_int tags ('NULL') -sql_error create table st_int_4 using mt_int tags ("NULL") -sql_error create table st_int_5 using mt_int tags ("NULL") +sql create table st_int_2 using mt_int tags ('NULL') +sql show tags from st_int_2 +if $data05 != NULL then + return -1 +endi +sql create table st_int_3 using mt_int tags ('NULL') +sql show tags from st_int_3 +if $data05 != NULL then + return -1 +endi +sql create table st_int_4 using mt_int tags ("NULL") +sql show tags from st_int_4 +if $data05 != NULL then + return -1 +endi +sql create table st_int_5 using mt_int tags ("NULL") +sql show tags from st_int_5 +if $data05 != NULL then + return -1 +endi sql create table st_int_6 using mt_int tags (-2147483647) sql show tags from st_int_6 @@ -78,6 +94,103 @@ sql show tags from st_int_14 if $data05 != -78 then return -1 endi +sql create table st_int_100 using mt_int tags ("0x01") +sql show tags from st_int_100 +if $data05 != 1 then + return -1 +endi +sql create table st_int_101 using mt_int tags ("0b01") +sql show tags from st_int_101 +if $data05 != 1 then + return -1 +endi +sql create table st_int_102 using mt_int tags ("+0x01") +sql show tags from st_int_102 +if $data05 != 1 then + return -1 +endi +sql create table st_int_103 using mt_int tags ("-0b01") +sql show tags from st_int_103 +if $data05 != -1 then + return -1 +endi +sql create table st_int_104 using mt_int tags ("-123.1") +sql show tags from st_int_104 +if $data05 != -123 then + return -1 +endi +sql create table st_int_105 using mt_int tags ("+123.5") +sql show tags from st_int_105 +if $data05 != 124 then + return -1 +endi +sql create table st_int_106 using mt_int tags ("-1e-1") +sql show tags from st_int_106 +if $data05 != 0 then + return -1 +endi +sql create table st_int_107 using mt_int tags ("+0.1235e3") +sql show tags from st_int_107 +if $data05 != 124 then + print $data05 != 124 + return -1 +endi +sql create table st_int_108 using mt_int tags ("-0.11e-30") +sql show tags from st_int_108 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql create table st_int_109 using mt_int tags ("-1.1e-307") +sql show tags from st_int_109 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql create table st_int_110 using mt_int tags ( -1e-1 ) +sql show tags from st_int_110 +if $data05 != 0 then + return -1 +endi +sql create table st_int_111 using mt_int tags ( +0.1235e3 ) +sql show tags from st_int_111 +if $data05 != 124 then + print $data05 != 124 + return -1 +endi +sql create table st_int_112 using mt_int tags (-0.11e-30) +sql show tags from st_int_112 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql create table st_int_113 using mt_int tags (-1.1e-307) +sql show tags from st_int_113 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql create table st_int_200 using mt_int tags ( 0x01) +sql show tags from st_int_200 +if $data05 != 1 then + return -1 +endi +sql create table st_int_201 using mt_int tags (0b01 ) +sql show tags from st_int_201 +if $data05 != 1 then + return -1 +endi +sql create table st_int_202 using mt_int tags (+0x01) +sql show tags from st_int_202 +if $data05 != 1 then + return -1 +endi + +sql create table st_int_203 using mt_int tags ( -0b01 ) +sql show tags from st_int_203 +if $data05 != -1 then + return -1 +endi ## case 01: insert values for test column values sql insert into st_int_0 values (now, NULL) @@ -171,6 +284,122 @@ if $data01 != -56 then return -1 endi +sql insert into st_int_100 values (now, "0x01") +sql select * from st_int_100 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_int_101 values (now, "0b01") +sql select * from st_int_101 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_int_102 values (now, "+0x01") +sql select * from st_int_102 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_int_103 values (now, "-0b01") +sql select * from st_int_103 +if $data01 != -1 then + return -1 +endi +sql insert into st_int_104 values (now, "-123.1") +sql select * from st_int_104 +if $data01 != -123 then + return -1 +endi +sql insert into st_int_105 values (now, "+123.5") +sql select * from st_int_105 +if $data01 != 124 then + return -1 +endi +sql insert into st_int_106 values (now, "-1e-1") +sql select * from st_int_106 +if $data01 != 0 then + return -1 +endi +sql insert into st_int_107 values (now, "+0.1235e3") +sql select * from st_int_107 +if $data01 != 124 then + print $data05 != 124 + return -1 +endi +sql insert into st_int_108 values (now, "-0.11e-30") +sql select * from st_int_108 +if $data01 != 0 then + print $data05 != 0 + return -1 +endi +sql insert into st_int_109 values (now, "-1.1e-307") +sql select * from st_int_109 +if $data01 != 0 then + print $data05 != 0 + return -1 +endi +sql insert into st_int_110 values (now, -1e-1 ) +sql select * from st_int_110 +if $data01 != 0 then + return -1 +endi +sql insert into st_int_111 values (now, +0.1235e3 ) +sql select * from st_int_111 +if $data01 != 124 then + print $data05 != 124 + return -1 +endi +sql insert into st_int_112 values (now, -0.11e-30) +sql select * from st_int_112 +if $data01 != 0 then + print $data05 != 0 + return -1 +endi +sql insert into st_int_113 values (now, -1.1e-307) +sql select * from st_int_113 +if $data01 != 0 then + print $data05 != 0 + return -1 +endi +sql insert into st_int_200 values (now, 0x01) +sql select * from st_int_200 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_int_201 values (now, 0b01 ) +sql select * from st_int_201 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_int_202 values (now, +0x01) +sql select * from st_int_202 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi + +sql insert into st_int_203 values (now, -0b01 ) +sql select * from st_int_203 +if $data01 != -1 then + return -1 +endi + ## case 02: dynamic create table for test tag values sql insert into st_int_16 using mt_int tags (NULL) values (now, NULL) sql show create table st_int_16 @@ -291,52 +520,308 @@ sql select * from st_int_28 if $data01 != -56 then return -1 endi +sql insert into st_int_1100 using mt_int tags ("0x01") values(now, "0x01"); +sql show tags from st_int_1100 +if $data05 != 1 then + return -1 +endi +sql select * from st_int_1100 +if $data01 != 1 then + return -1 +endi +sql insert into st_int_1101 using mt_int tags ("0b01") values(now, "0b01"); +sql show tags from st_int_1101 +if $data05 != 1 then + return -1 +endi +sql select * from st_int_1101 +if $data01 != 1 then + return -1 +endi +sql insert into st_int_1102 using mt_int tags ("+0x01") values(now, "+0x01"); +sql show tags from st_int_1102 +if $data05 != 1 then + return -1 +endi +sql select * from st_int_1102 +if $data01 != 1 then + return -1 +endi +sql insert into st_int_1103 using mt_int tags ("-0b01") values(now, "-0b01"); +sql show tags from st_int_1103 +if $data05 != -1 then + return -1 +endi +sql select * from st_int_1103 +if $data01 != -1 then + return -1 +endi +sql insert into st_int_1104 using mt_int tags ("-123.1") values(now, "-123.1"); +sql show tags from st_int_1104 +if $data05 != -123 then + return -1 +endi +sql select * from st_int_1104 +if $data01 != -123 then + return -1 +endi +sql insert into st_int_1105 using mt_int tags ("+123.5") values(now, "+123.5"); +sql show tags from st_int_1105 +if $data05 != 124 then + return -1 +endi +sql select * from st_int_1105 +if $data01 != 124 then + return -1 +endi +sql insert into st_int_1106 using mt_int tags ("-1e-1") values(now, "-1e-1"); +sql show tags from st_int_1106 +if $data05 != 0 then + return -1 +endi +sql select * from st_int_1106 +if $data01 != 0 then + return -1 +endi +sql insert into st_int_1107 using mt_int tags ("+0.1235e3") values(now, "+0.1235e3"); +sql show tags from st_int_1107 +if $data05 != 124 then + return -1 +endi +sql insert into st_int_1108 using mt_int tags ("-0.11e-30") values(now, "-0.11e-30"); +sql show tags from st_int_1108 +if $data05 != 0 then + return -1 +endi +sql select * from st_int_1108 +if $data01 != 0 then + return -1 +endi +sql insert into st_int_1109 using mt_int tags ("-1.1e-307") values(now, "-1.1e-307"); +sql show tags from st_int_1109 +if $data05 != 0 then + return -1 +endi +sql select * from st_int_1109 +if $data01 != 0 then + return -1 +endi +sql insert into st_int_1110 using mt_int tags ( -1e-1 ) values(now, -1e-1); +sql show tags from st_int_1110 +if $data05 != 0 then + return -1 +endi +sql select * from st_int_1110 +if $data01 != 0 then + return -1 +endi +sql insert into st_int_1111 using mt_int tags ( +0.1235e3 ) values(now, +0.1235e3); +sql show tags from st_int_1111 +if $data05 != 124 then + return -1 +endi +sql select * from st_int_1111 +if $data01 != 124 then + return -1 +endi +sql insert into st_int_1112 using mt_int tags (-0.11e-30) values(now, -0.11e-30); +sql show tags from st_int_1112 +if $data05 != 0 then + return -1 +endi +sql select * from st_int_1112 +if $data01 != 0 then + return -1 +endi +sql insert into st_int_1113 using mt_int tags (-1.1e-307) values(now, -1.1e-307); +sql show tags from st_int_1113 +if $data05 != 0 then + return -1 +endi +sql select * from st_int_1113 +if $data01 != 0 then + return -1 +endi +sql insert into st_int_1200 using mt_int tags ( 0x01) values(now, 0x01); +sql show tags from st_int_1200 +if $data05 != 1 then + return -1 +endi +sql select * from st_int_1200 +if $data01 != 1 then + return -1 +endi +sql insert into st_int_1201 using mt_int tags (0b01 ) values(now, 0b01); +sql show tags from st_int_1201 +if $data05 != 1 then + return -1 +endi +sql select * from st_int_1201 +if $data01 != 1 then + return -1 +endi +sql insert into st_int_1202 using mt_int tags (+0x01) values(now, +0x01); +sql show tags from st_int_1202 +if $data05 != 1 then + return -1 +endi +sql select * from st_int_1202 +if $data01 != 1 then + return -1 +endi + +sql insert into st_int_1203 using mt_int tags ( -0b01 ) values(now, -0b01); +sql show tags from st_int_1203 +if $data05 != -1 then + return -1 +endi +sql select * from st_int_1203 +if $data01 != -1 then + return -1 +endi ### case 03: alter tag values -#sql alter table st_int_0 set tag tagname=2147483647 -#sql show tags from st_int_0 -#if $data05 != 2147483647 then -# return -1 -#endi -#sql alter table st_int_0 set tag tagname=-2147483647 -#sql show tags from st_int_0 -#if $data05 != -2147483647 then -# return -1 -#endi -#sql alter table st_int_0 set tag tagname=+100 -#sql show tags from st_int_0 -#if $data05 != 100 then -# return -1 -#endi -#sql alter table st_int_0 set tag tagname=-33 -#sql show tags from st_int_0 -#if $data05 != -33 then -# return -1 -#endi -#sql alter table st_int_0 set tag tagname='+98' -#sql show tags from st_int_0 -#if $data05 != 98 then -# return -1 -#endi -#sql alter table st_int_0 set tag tagname='-076' -#sql show tags from st_int_0 -#if $data05 != -76 then -# return -1 -#endi -#sql alter table st_int_0 set tag tagname=+0012 -#sql show tags from st_int_0 -#if $data05 != 12 then -# return -1 -#endi -#sql alter table st_int_0 set tag tagname=-00063 -#sql show tags from st_int_0 -#if $data05 != -63 then -# return -1 -#endi +sql alter table st_int_0 set tag tagname=2147483647 +sql show tags from st_int_0 +if $data05 != 2147483647 then + return -1 +endi +sql alter table st_int_0 set tag tagname=-2147483647 +sql show tags from st_int_0 +if $data05 != -2147483647 then + return -1 +endi +sql alter table st_int_0 set tag tagname=+100 +sql show tags from st_int_0 +if $data05 != 100 then + return -1 +endi +sql alter table st_int_0 set tag tagname=-33 +sql show tags from st_int_0 +if $data05 != -33 then + return -1 +endi +sql alter table st_int_0 set tag tagname='+98' +sql show tags from st_int_0 +if $data05 != 98 then + return -1 +endi +sql alter table st_int_0 set tag tagname='-076' +sql show tags from st_int_0 +if $data05 != -76 then + return -1 +endi +sql alter table st_int_0 set tag tagname=+0012 +sql show tags from st_int_0 +if $data05 != 12 then + return -1 +endi +sql alter table st_int_0 set tag tagname=-00063 +sql show tags from st_int_0 +if $data05 != -63 then + return -1 +endi +sql alter table st_int_100 set tag tagname="0x01" +sql show tags from st_int_100 +if $data05 != 1 then + return -1 +endi +sql alter table st_int_101 set tag tagname="0b01" +sql show tags from st_int_101 +if $data05 != 1 then + return -1 +endi +sql alter table st_int_102 set tag tagname="+0x01" +sql show tags from st_int_102 +if $data05 != 1 then + return -1 +endi +sql alter table st_int_103 set tag tagname="-0b01" +sql show tags from st_int_103 +if $data05 != -1 then + return -1 +endi +sql alter table st_int_104 set tag tagname="-123.1" +sql show tags from st_int_104 +if $data05 != -123 then + return -1 +endi +sql alter table st_int_105 set tag tagname="+123.5" +sql show tags from st_int_105 +if $data05 != 124 then + return -1 +endi +sql alter table st_int_106 set tag tagname="-1e-1" +sql show tags from st_int_106 +if $data05 != 0 then + return -1 +endi +sql alter table st_int_107 set tag tagname="+0.1235e3" +sql show tags from st_int_107 +if $data05 != 124 then + print $data05 != 124 + return -1 +endi +sql alter table st_int_108 set tag tagname="-0.11e-30" +sql show tags from st_int_108 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql alter table st_int_109 set tag tagname="-1.1e-307" +sql show tags from st_int_109 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql alter table st_int_110 set tag tagname= -1e-1 +sql show tags from st_int_110 +if $data05 != 0 then + return -1 +endi +sql alter table st_int_111 set tag tagname= +0.1235e3 +sql show tags from st_int_111 +if $data05 != 124 then + print $data05 != 124 + return -1 +endi +sql alter table st_int_112 set tag tagname=-0.11e-30 +sql show tags from st_int_112 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql alter table st_int_113 set tag tagname=-1.1e-307 +sql show tags from st_int_113 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql alter table st_int_200 set tag tagname= 0x01 +sql show tags from st_int_200 +if $data05 != 1 then + return -1 +endi +sql alter table st_int_201 set tag tagname=0b01 +sql show tags from st_int_201 +if $data05 != 1 then + return -1 +endi +sql alter table st_int_202 set tag tagname=+0x01 +sql show tags from st_int_202 +if $data05 != 1 then + return -1 +endi +sql alter table st_int_203 set tag tagname= -0b01 +sql show tags from st_int_203 +if $data05 != -1 then + return -1 +endi ## case 04: illegal input sql_error create table st_int_e0 using mt_int tags (2147483648) sql create table st_int_e0_err1 using mt_int tags (-2147483648) +sql_error create table st_int_e0_err2 using mt_int tags (-2147483649) sql_error create table st_int_e0 using mt_int tags (214748364800) sql_error create table st_int_e0 using mt_int tags (-214748364800) #sql_error create table st_int_e0 using mt_int tags (12.80) truncate integer part @@ -346,7 +831,7 @@ sql_error create table st_int_e0 using mt_int tags ("123abc") sql_error create table st_int_e0 using mt_int tags (abc) sql_error create table st_int_e0 using mt_int tags ("abc") sql_error create table st_int_e0 using mt_int tags (" ") -sql create table st_int_e0_err2 using mt_int tags ('') +sql_error create table st_int_e0_err2 using mt_int tags ('') sql create table st_int_e0 using mt_int tags (123) sql create table st_int_e1 using mt_int tags (123) @@ -399,7 +884,10 @@ sql_error insert into st_int_e20 using mt_int tags ("123abc") values (now, -033) sql_error insert into st_int_e22 using mt_int tags (abc) values (now, -033) sql_error insert into st_int_e23 using mt_int tags ("abc") values (now, -033) sql_error insert into st_int_e24 using mt_int tags (" ") values (now, -033) -sql insert into st_int_e25_1 using mt_int tags ('') values (now, -033) +sql_error insert into st_int_e25_1 using mt_int tags ('') values (now, -033) +sql insert into st_int_e26_1 using mt_int tags ('123') values (now, -033) +sql insert into st_int_e27_1 using mt_int tags ('12.80') values (now, -033) +sql insert into st_int_e28_1 using mt_int tags ('-11.80') values (now, -033) sql insert into st_int_e13 using mt_int tags (033) values (now, 00062) sql insert into st_int_e14 using mt_int tags (033) values (now, 00062) @@ -415,8 +903,10 @@ sql insert into st_int_e23 using mt_int tags (033) values (now, 00062) sql insert into st_int_e24 using mt_int tags (033) values (now, 00062) sql insert into st_int_e25 using mt_int tags (033) values (now, 00062) +sql alter table st_int_e13 set tag tagname=2147483647 sql_error alter table st_int_e13 set tag tagname=2147483648 sql alter table st_int_e14 set tag tagname=-2147483648 +sql_error alter table st_int_e14 set tag tagname=2147483649 sql_error alter table st_int_e15 set tag tagname=12147483648 sql_error alter table st_int_e16 set tag tagname=-3147483648 sql_error alter table st_int_e19 set tag tagname=123abc @@ -424,6 +914,9 @@ sql_error alter table st_int_e20 set tag tagname="123abc" sql_error alter table st_int_e22 set tag tagname=abc sql_error alter table st_int_e23 set tag tagname="abc" sql_error alter table st_int_e24 set tag tagname=" " -sql alter table st_int_e25 set tag tagname='' +sql_error alter table st_int_e25 set tag tagname='' +sql alter table st_int_e26_1 set tag tagname='123' +sql alter table st_int_e27_1 set tag tagname='12.80' +sql alter table st_int_e28_1 set tag tagname='-11.80' system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_json.sim b/tests/script/tsim/parser/columnValue_json.sim new file mode 100644 index 0000000000..002f71b290 --- /dev/null +++ b/tests/script/tsim/parser/columnValue_json.sim @@ -0,0 +1,220 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ========== columnValues.sim + +sql drop database if exists db +sql create database db +sql use db + +#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value + +######## case 0: json +print ========== json +sql create table mt_json (ts timestamp, c varchar(50)) tags(tagname json) + +## case 00: static create table for test tag values +sql create table st_json_0 using mt_json tags(NULL) +sql show tags from st_json_0 +if $data05 != NULL then + return -1 +endi +sql create table st_json_1 using mt_json tags(NULL) +sql show tags from st_json_1 +if $data05 != NULL then + return -1 +endi +sql create table st_json_2 using mt_json tags('NULL') +sql show tags from st_json_2 +if $data05 != NULL then + return -1 +endi +sql create table st_json_3 using mt_json tags('NULL') +sql show tags from st_json_3 +if $data05 != NULL then + return -1 +endi +sql create table st_json_4 using mt_json tags("NULL") +sql show tags from st_json_4 +if $data05 != NULL then + return -1 +endi +sql create table st_json_5 using mt_json tags("NULL") +sql show tags from st_json_5 +if $data05 != NULL then + return -1 +endi +sql create table st_json_6 using mt_json tags("") +sql show tags from st_json_6 +if $data05 != NULL then + return -1 +endi +sql create table st_json_7 using mt_json tags(" ") +sql show tags from st_json_7 +if $data05 != NULL then + return -1 +endi +sql create table st_json_8 using mt_json tags("{\"k1\":\"v1\",\"k2\":\"v2\"}") +sql show tags from st_json_8 +if $data05 != {"k1":"v1","k2":"v2"} then + return -1 +endi + +## case 01: insert values for test column values + +## case 02: dynamic create table for test tag values +sql insert into st_json_100 using mt_json tags(NULL) values(now,NULL) +sql show tags from st_json_100 +if $data05 != NULL then + return -1 +endi +sql select * from st_json_100 +if $data01 != NULL then + return -1 +endi +sql insert into st_json_101 using mt_json tags(NULL) values(now,NULL) +sql show tags from st_json_101 +if $data05 != NULL then + return -1 +endi +sql select * from st_json_101 +if $data01 != NULL then + return -1 +endi +sql insert into st_json_102 using mt_json tags('NULL') values(now,'NULL') +sql show tags from st_json_102 +if $data05 != NULL then + return -1 +endi +sql select * from st_json_102 +if $data01 != NULL then + return -1 +endi +sql insert into st_json_103 using mt_json tags('NULL') values(now,'NULL') +sql show tags from st_json_103 +if $data05 != NULL then + return -1 +endi +sql select * from st_json_103 +if $data01 != NULL then + return -1 +endi +sql insert into st_json_104 using mt_json tags("NULL") values(now,"NULL") +sql show tags from st_json_104 +if $data05 != NULL then + return -1 +endi +sql select * from st_json_104 +if $data01 != NULL then + return -1 +endi +sql insert into st_json_105 using mt_json tags("NULL") values(now,"NULL") +sql show tags from st_json_105 +if $data05 != NULL then + return -1 +endi +sql select * from st_json_105 +if $data01 != NULL then + return -1 +endi +sql insert into st_json_106 using mt_json tags("") values(now,"vc") +sql show tags from st_json_106 +if $data05 != NULL then + return -1 +endi +sql select * from st_json_106 +if $data01 != vc then + return -1 +endi +sql insert into st_json_107 using mt_json tags(" ") values(now,"vc") +sql show tags from st_json_107 +if $data05 != NULL then + return -1 +endi +sql select * from st_json_107 +if $data01 != vc then + return -1 +endi +sql insert into st_json_108 using mt_json tags("{\"k1\":\"v1\",\"k2\":\"v2\"} ") values(now,"vc") +sql show tags from st_json_108 +if $data05 != {"k1":"v1","k2":"v2"} then + return -1 +endi +sql select * from st_json_108 +if $data01 != vc then + return -1 +endi + +## case 03: alter tag values +sql alter table st_json_100 set tag tagname=NULL +sql show tags from st_json_100 +if $data05 != NULL then + return -1 +endi +sql alter table st_json_101 set tag tagname=NULL +sql show tags from st_json_101 +if $data05 != NULL then + return -1 +endi +sql alter table st_json_102 set tag tagname='NULL' +sql show tags from st_json_102 +if $data05 != NULL then + return -1 +endi +sql alter table st_json_103 set tag tagname='NULL' +sql show tags from st_json_103 +if $data05 != NULL then + return -1 +endi +sql alter table st_json_104 set tag tagname="NULL" +sql show tags from st_json_104 +if $data05 != NULL then + return -1 +endi +sql alter table st_json_105 set tag tagname="NULL" +sql show tags from st_json_105 +if $data05 != NULL then + return -1 +endi +sql alter table st_json_106 set tag tagname="" +sql show tags from st_json_106 +if $data05 != NULL then + return -1 +endi +sql alter table st_json_107 set tag tagname=" " +sql show tags from st_json_107 +if $data05 != NULL then + return -1 +endi +sql alter table st_json_108 set tag tagname="{\"k1\":\"v1\",\"k2\":\"v2\"}" +sql show tags from st_json_108 +if $data05 != {"k1":"v1","k2":"v2"} then + return -1 +endi + + +# case 04: illegal input +sql_error create table st_json_206 using mt_json tags(+0123) +sql_error create table st_json_207 using mt_json tags(-01.23) +sql_error create table st_json_208 using mt_json tags(+0x01) +sql_error create table st_json_209 using mt_json tags(-0b01) +sql_error create table st_json_2010 using mt_json tags(-0.1e-10) +sql_error create table st_json_2011 using mt_json tags(+0.1E+2) +sql_error create table st_json_2012 using mt_json tags(tRue) +sql_error create table st_json_2013 using mt_json tags(FalsE) +sql_error create table st_json_2014 using mt_json tags(noW) +sql_error create table st_json_2015 using mt_json tags(toDay) +sql_error insert into st_json_206 using mt_json tags(+0123) values(now, NULL); +sql_error insert into st_json_207 using mt_json tags(-01.23) values(now, NULL); +sql_error insert into st_json_208 using mt_json tags(+0x01) values(now, NULL); +sql_error insert into st_json_209 using mt_json tags(-0b01) values(now, NULL); +sql_error insert into st_json_2010 using mt_json tags(-0.1e-10) values(now, NULL); +sql_error insert into st_json_2011 using mt_json tags(+0.1E+2) values(now, NULL); +sql_error insert into st_json_2012 using mt_json tags(tRue) values(now, NULL); +sql_error insert into st_json_2013 using mt_json tags(FalsE) values(now, NULL); +sql_error insert into st_json_2014 using mt_json tags(noW) values(now, NULL); +sql_error insert into st_json_2015 using mt_json tags(toDay) values(now, NULL); + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_nchar.sim b/tests/script/tsim/parser/columnValue_nchar.sim new file mode 100644 index 0000000000..0b5de82d57 --- /dev/null +++ b/tests/script/tsim/parser/columnValue_nchar.sim @@ -0,0 +1,415 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ========== columnValues.sim + +sql drop database if exists db +sql create database db +sql use db + +#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value + +######## case 0: nchar +print ========== nchar +sql create table mt_nchar (ts timestamp, c nchar(50)) tags (tagname nchar(50)) + +## case 00: static create table for test tag values +sql create table st_nchar_0 using mt_nchar tags (NULL) +sql show create table st_nchar_0 +sql show tags from st_nchar_0 +if $data05 != NULL then + return -1 +endi +sql create table st_nchar_1 using mt_nchar tags (NULL) +sql show tags from st_nchar_1 +if $data05 != NULL then + return -1 +endi +sql create table st_nchar_2 using mt_nchar tags ('NULL') +sql show tags from st_nchar_2 +if $data05 != NULL then + return -1 +endi +sql create table st_nchar_3 using mt_nchar tags ('NULL') +sql show tags from st_nchar_3 +if $data05 != NULL then + return -1 +endi +sql create table st_nchar_4 using mt_nchar tags ("NULL") +sql show tags from st_nchar_4 +if $data05 != NULL then + return -1 +endi +sql create table st_nchar_5 using mt_nchar tags ("NULL") +sql show tags from st_nchar_5 +if $data05 != NULL then + return -1 +endi +sql create table st_nchar_6 using mt_nchar tags (+0123) +sql show tags from st_nchar_6 +if $data05 != +0123 then + return -1 +endi +sql create table st_nchar_7 using mt_nchar tags (-01.23) +sql show tags from st_nchar_7 +if $data05 != -01.23 then + return -1 +endi +sql create table st_nchar_8 using mt_nchar tags (+0x01) +sql show tags from st_nchar_8 +if $data05 != +0x01 then + return -1 +endi +sql create table st_nchar_9 using mt_nchar tags (-0b01) +sql show tags from st_nchar_9 +if $data05 != -0b01 then + return -1 +endi +sql create table st_nchar_10 using mt_nchar tags (-0.1e-10) +sql show tags from st_nchar_10 +if $data05 != -0.1e-10 then + return -1 +endi +sql create table st_nchar_11 using mt_nchar tags (+0.1E+2) +sql show tags from st_nchar_11 +if $data05 != +0.1e+2 then + return -1 +endi +sql create table st_nchar_12 using mt_nchar tags (tRue) +sql show tags from st_nchar_12 +if $data05 != true then + return -1 +endi +sql create table st_nchar_13 using mt_nchar tags (FalsE) +sql show tags from st_nchar_13 +if $data05 != false then + return -1 +endi +sql create table st_nchar_14 using mt_nchar tags (noW) +sql show tags from st_nchar_14 +if $data05 != now then + return -1 +endi +sql create table st_nchar_15 using mt_nchar tags (toDay) +sql show tags from st_nchar_15 +if $data05 != today then + return -1 +endi + +## case 01: insert values for test column values +sql insert into st_nchar_0 values(now, NULL) +sql select * from st_nchar_0 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_1 values(now, NULL) +sql select * from st_nchar_1 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_2 values(now, 'NULL') +sql select * from st_nchar_2 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_3 values(now, 'NULL') +sql select * from st_nchar_3 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_4 values(now, "NULL") +sql select * from st_nchar_4 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_5 values(now, "NULL") +sql select * from st_nchar_5 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_6 values(now, +0123) +sql select * from st_nchar_6 +if $data01 != +0123 then + return -1 +endi +sql insert into st_nchar_7 values(now, -01.23) +sql select * from st_nchar_7 +if $data01 != -01.23 then + return -1 +endi +sql insert into st_nchar_8 values(now, +0x01) +sql select * from st_nchar_8 +if $data01 != +0x01 then + return -1 +endi +sql insert into st_nchar_9 values(now, -0b01) +sql select * from st_nchar_9 +if $data01 != -0b01 then + return -1 +endi +sql insert into st_nchar_10 values(now, -0.1e-10) +sql select * from st_nchar_10 +if $data01 != -0.1e-10 then + return -1 +endi +sql insert into st_nchar_11 values(now, +0.1E+2) +sql select * from st_nchar_11 +if $data01 != +0.1e+2 then + return -1 +endi +sql insert into st_nchar_12 values(now, tRue) +sql select * from st_nchar_12 +if $data01 != true then + return -1 +endi +sql insert into st_nchar_13 values(now, FalsE) +sql select * from st_nchar_13 +if $data01 != false then + return -1 +endi +sql insert into st_nchar_14 values(now, noW) +sql select * from st_nchar_14 +if $data01 != now then + return -1 +endi +sql insert into st_nchar_15 values(now, toDay) +sql select * from st_nchar_15 +if $data01 != today then + return -1 +endi + +## case 02: dynamic create table for test tag values +sql insert into st_nchar_0 using mt_nchar tags (NULL) values(now, NULL) +sql show tags from st_nchar_0 +if $data05 != NULL then + return -1 +endi +sql select * from st_nchar_0 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_1 using mt_nchar tags (NULL) values(now, NULL) +sql show tags from st_nchar_1 +if $data05 != NULL then + return -1 +endi +sql select * from st_nchar_1 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_2 using mt_nchar tags ('NULL') values(now, 'NULL') +sql show tags from st_nchar_2 +if $data05 != NULL then + return -1 +endi +sql select * from st_nchar_2 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_3 using mt_nchar tags ('NULL') values(now, 'NULL') +sql show tags from st_nchar_3 +if $data05 != NULL then + return -1 +endi +sql select * from st_nchar_3 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_4 using mt_nchar tags ("NULL") values(now, "NULL") +sql show tags from st_nchar_4 +if $data05 != NULL then + return -1 +endi +sql select * from st_nchar_4 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_5 using mt_nchar tags ("NULL") values(now, "NULL") +sql show tags from st_nchar_5 +if $data05 != NULL then + return -1 +endi +sql select * from st_nchar_5 +if $data01 != NULL then + return -1 +endi +sql insert into st_nchar_6 using mt_nchar tags (+0123) values(now, +0123) +sql show tags from st_nchar_6 +if $data05 != +0123 then + return -1 +endi +sql select * from st_nchar_6 +if $data01 != +0123 then + return -1 +endi +sql insert into st_nchar_7 using mt_nchar tags (-01.23) values(now, -01.23) +sql show tags from st_nchar_7 +if $data05 != -01.23 then + return -1 +endi +sql select * from st_nchar_7 +if $data01 != -01.23 then + return -1 +endi +sql insert into st_nchar_8 using mt_nchar tags (+0x01) values(now, +0x01) +sql show tags from st_nchar_8 +if $data05 != +0x01 then + return -1 +endi +sql select * from st_nchar_8 +if $data01 != +0x01 then + return -1 +endi +sql insert into st_nchar_9 using mt_nchar tags (-0b01) values(now, -0b01) +sql show tags from st_nchar_9 +if $data05 != -0b01 then + return -1 +endi +sql select * from st_nchar_9 +if $data01 != -0b01 then + return -1 +endi +sql insert into st_nchar_10 using mt_nchar tags (-0.1e-10) values(now, -0.1e-10) +sql show tags from st_nchar_10 +if $data05 != -0.1e-10 then + return -1 +endi +sql select * from st_nchar_10 +if $data01 != -0.1e-10 then + return -1 +endi +sql insert into st_nchar_11 using mt_nchar tags (+0.1E+2) values(now, +0.1E+2) +sql show tags from st_nchar_11 +if $data05 != +0.1e+2 then + return -1 +endi +sql select * from st_nchar_11 +if $data01 != +0.1e+2 then + return -1 +endi +sql insert into st_nchar_12 using mt_nchar tags (tRue) values(now, tRue) +sql show tags from st_nchar_12 +if $data05 != true then + return -1 +endi +sql select * from st_nchar_12 +if $data01 != true then + return -1 +endi +sql insert into st_nchar_13 using mt_nchar tags (FalsE) values(now, FalsE) +sql show tags from st_nchar_13 +if $data05 != false then + return -1 +endi +sql select * from st_nchar_13 +if $data01 != false then + return -1 +endi +sql insert into st_nchar_14 using mt_nchar tags (noW) values(now, noW) +sql show tags from st_nchar_14 +if $data05 != now then + return -1 +endi +sql select * from st_nchar_14 +if $data01 != now then + return -1 +endi +sql insert into st_nchar_15 using mt_nchar tags (toDay) values(now, toDay) +sql show tags from st_nchar_15 +if $data05 != today then + return -1 +endi +sql select * from st_nchar_15 +if $data01 != today then + return -1 +endi + +## case 03: alter tag values +sql alter table st_nchar_0 set tag tagname=NULL +sql show tags from st_nchar_0 +if $data05 != NULL then + return -1 +endi +sql alter table st_nchar_1 set tag tagname=NULL +sql show tags from st_nchar_1 +if $data05 != NULL then + return -1 +endi +sql alter table st_nchar_2 set tag tagname='NULL' +sql show tags from st_nchar_2 +if $data05 != NULL then + return -1 +endi +sql alter table st_nchar_3 set tag tagname='NULL' +sql show tags from st_nchar_3 +if $data05 != NULL then + return -1 +endi +sql alter table st_nchar_4 set tag tagname="NULL" +sql show tags from st_nchar_4 +if $data05 != NULL then + return -1 +endi +sql alter table st_nchar_5 set tag tagname="NULL" +sql show tags from st_nchar_5 +if $data05 != NULL then + return -1 +endi +sql alter table st_nchar_6 set tag tagname=+0123 +sql show tags from st_nchar_6 +if $data05 != +0123 then + return -1 +endi +sql alter table st_nchar_7 set tag tagname=-01.23 +sql show tags from st_nchar_7 +if $data05 != -01.23 then + return -1 +endi +sql alter table st_nchar_8 set tag tagname=+0x01 +sql show tags from st_nchar_8 +if $data05 != +0x01 then + return -1 +endi +sql alter table st_nchar_9 set tag tagname=-0b01 +sql show tags from st_nchar_9 +if $data05 != -0b01 then + return -1 +endi +sql alter table st_nchar_10 set tag tagname=-0.1e-10 +sql show tags from st_nchar_10 +if $data05 != -0.1e-10 then + return -1 +endi +sql alter table st_nchar_11 set tag tagname=+0.1E+2 +sql show tags from st_nchar_11 +if $data05 != +0.1e+2 then + return -1 +endi +sql alter table st_nchar_12 set tag tagname=tRue +sql show tags from st_nchar_12 +if $data05 != true then + return -1 +endi +sql alter table st_nchar_13 set tag tagname=FalsE +sql show tags from st_nchar_13 +if $data05 != false then + return -1 +endi +sql alter table st_nchar_14 set tag tagname=noW +sql show tags from st_nchar_14 +if $data05 != now then + return -1 +endi +sql alter table st_nchar_15 set tag tagname=toDay +sql show tags from st_nchar_15 +if $data05 != today then + return -1 +endi + + +# case 04: illegal input + + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_smallint.sim b/tests/script/tsim/parser/columnValue_smallint.sim index f9be6ebd52..8b9be73ca0 100644 --- a/tests/script/tsim/parser/columnValue_smallint.sim +++ b/tests/script/tsim/parser/columnValue_smallint.sim @@ -31,10 +31,27 @@ if $data05 != NULL then return -1 endi -sql_error create table st_smallint_2 using mt_smallint tags ('NULL') -sql_error create table st_smallint_3 using mt_smallint tags ('NULL') -sql_error create table st_smallint_4 using mt_smallint tags ("NULL") -sql_error create table st_smallint_5 using mt_smallint tags ("NULL") + +sql create table st_smallint_2 using mt_smallint tags ('NULL') +sql show tags from st_smallint_2 +if $data05 != NULL then + return -1 +endi +sql create table st_smallint_3 using mt_smallint tags ('NULL') +sql show tags from st_smallint_3 +if $data05 != NULL then + return -1 +endi +sql create table st_smallint_4 using mt_smallint tags ("NULL") +sql show tags from st_smallint_4 +if $data05 != NULL then + return -1 +endi +sql create table st_smallint_5 using mt_smallint tags ("NULL") +sql show tags from st_smallint_5 +if $data05 != NULL then + return -1 +endi sql create table st_smallint_6 using mt_smallint tags (-32767) sql show tags from st_smallint_6 @@ -349,7 +366,8 @@ sql_error create table st_smallint_e0 using mt_smallint tags ("123abc") sql_error create table st_smallint_e0 using mt_smallint tags (abc) sql_error create table st_smallint_e0 using mt_smallint tags ("abc") sql_error create table st_smallint_e0 using mt_smallint tags (" ") -sql create table st_smallint_e0_1 using mt_smallint tags ('') +sql_error create table st_smallint_e0_1 using mt_smallint tags ('') +sql create table st_smallint_e0_2 using mt_smallint tags ('123') sql create table st_smallint_e0 using mt_smallint tags (123) sql create table st_smallint_e1 using mt_smallint tags (123) @@ -402,7 +420,8 @@ sql_error insert into st_smallint_e20 using mt_smallint tags ("123abc") values ( sql_error insert into st_smallint_e22 using mt_smallint tags (abc) values (now, -033) sql_error insert into st_smallint_e23 using mt_smallint tags ("abc") values (now, -033) sql_error insert into st_smallint_e24 using mt_smallint tags (" ") values (now, -033) -sql insert into st_smallint_e25 using mt_smallint tags ('') values (now, -033) +sql_error insert into st_smallint_e25 using mt_smallint tags ('') values (now, -033) +sql insert into st_smallint_e26 using mt_smallint tags ('123') values (now, -033) sql insert into st_smallint_e13 using mt_smallint tags (033) values (now, 00062) sql insert into st_smallint_e14 using mt_smallint tags (033) values (now, 00062) @@ -427,6 +446,7 @@ sql_error alter table st_smallint_e20 set tag tagname="123abc" sql_error alter table st_smallint_e22 set tag tagname=abc sql_error alter table st_smallint_e23 set tag tagname="abc" sql_error alter table st_smallint_e24 set tag tagname=" " -sql alter table st_smallint_e25 set tag tagname='' +sql_error alter table st_smallint_e25 set tag tagname='' +sql alter table st_smallint_e26 set tag tagname='123' system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_timestamp.sim b/tests/script/tsim/parser/columnValue_timestamp.sim new file mode 100644 index 0000000000..1f457dbd7c --- /dev/null +++ b/tests/script/tsim/parser/columnValue_timestamp.sim @@ -0,0 +1,594 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ========== columnValues.sim + +sql drop database if exists db +sql create database db +sql use db + +#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value + +######## case 0: timestamp +print ========== timestamp +sql create table mt_timestamp (ts timestamp, c timestamp) tags (tagname timestamp) + +## case 00: static create table for test tag values +sql create table st_timestamp_0 using mt_timestamp tags (NULL) +sql show create table st_timestamp_0 +sql show tags from st_timestamp_0 +if $data05 != NULL then + return -1 +endi +sql create table st_timestamp_1 using mt_timestamp tags (NULL) +sql show tags from st_timestamp_1 +if $data05 != NULL then + return -1 +endi +sql create table st_timestamp_2 using mt_timestamp tags ('NULL') +sql show tags from st_timestamp_2 +if $data05 != NULL then + return -1 +endi +sql create table st_timestamp_3 using mt_timestamp tags ('NULL') +sql show tags from st_timestamp_3 +if $data05 != NULL then + return -1 +endi +sql create table st_timestamp_4 using mt_timestamp tags ("NULL") +sql show tags from st_timestamp_4 +if $data05 != NULL then + return -1 +endi +sql create table st_timestamp_5 using mt_timestamp tags ("NULL") +sql show tags from st_timestamp_5 +if $data05 != NULL then + return -1 +endi +sql create table st_timestamp_6 using mt_timestamp tags (-2147483647) +sql show tags from st_timestamp_6 +if $data05 != -2147483647 then + return -1 +endi +sql create table st_timestamp_7 using mt_timestamp tags (2147483647) +sql show tags from st_timestamp_7 +if $data05 != 2147483647 then + return -1 +endi +sql create table st_timestamp_8 using mt_timestamp tags (37) +sql show tags from st_timestamp_8 +if $data05 != 37 then + return -1 +endi +sql create table st_timestamp_9 using mt_timestamp tags (-100) +sql show tags from st_timestamp_9 +if $data05 != -100 then + return -1 +endi +sql create table st_timestamp_10 using mt_timestamp tags (+113) +sql show tags from st_timestamp_10 +if $data05 != 113 then + return -1 +endi +sql create table st_timestamp_11 using mt_timestamp tags ('-100') +sql show tags from st_timestamp_11 +if $data05 != -100 then + return -1 +endi +sql create table st_timestamp_12 using mt_timestamp tags ("-0") +sql show tags from st_timestamp_12 +if $data05 != 0 then + return -1 +endi +sql create table st_timestamp_13 using mt_timestamp tags (+0078) +sql show tags from st_timestamp_13 +if $data05 != 78 then + return -1 +endi +sql create table st_timestamp_14 using mt_timestamp tags (-00078) +sql show tags from st_timestamp_14 +if $data05 != -78 then + return -1 +endi +sql create table st_timestamp_15 using mt_timestamp tags ("0x01") +sql show tags from st_timestamp_15 +if $data05 != 1 then + return -1 +endi +sql create table st_timestamp_16 using mt_timestamp tags ("0b01") +sql show tags from st_timestamp_16 +if $data05 != 1 then + return -1 +endi +sql create table st_timestamp_17 using mt_timestamp tags ("+0x01") +sql show tags from st_timestamp_17 +if $data05 != 1 then + return -1 +endi +sql create table st_timestamp_18 using mt_timestamp tags ("-0b01") +sql show tags from st_timestamp_18 +if $data05 != -1 then + return -1 +endi +sql create table st_timestamp_19 using mt_timestamp tags ( 0x01) +sql show tags from st_timestamp_19 +if $data05 != 1 then + return -1 +endi +sql create table st_timestamp_20 using mt_timestamp tags (0b01 ) +sql show tags from st_timestamp_20 +if $data05 != 1 then + return -1 +endi +sql create table st_timestamp_21 using mt_timestamp tags (+0x01) +sql show tags from st_timestamp_21 +if $data05 != 1 then + return -1 +endi +sql create table st_timestamp_22 using mt_timestamp tags ( -0b01 ) +sql show tags from st_timestamp_22 +if $data05 != -1 then + return -1 +endi + +## case 01: insert values for test column values +sql insert into st_timestamp_0 values(now,NULL) +sql select * from st_timestamp_0 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_1 values(now,NULL) +sql select * from st_timestamp_1 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_2 values(now,'NULL') +sql select * from st_timestamp_2 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_3 values(now,'NULL') +sql select * from st_timestamp_3 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_4 values(now,"NULL") +sql select * from st_timestamp_4 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_5 values(now,"NULL") +sql select * from st_timestamp_5 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_6 values(now,-2147483647) +sql select ts, cast(c as bigint) from st_timestamp_6 +if $data01 != -2147483647 then + return -1 +endi +sql insert into st_timestamp_7 values(now,2147483647) +sql select ts, cast(c as bigint) from st_timestamp_7 +if $data01 != 2147483647 then + return -1 +endi +sql insert into st_timestamp_8 values(now,37) +sql select ts, cast(c as bigint) from st_timestamp_8 +if $data01 != 37 then + return -1 +endi +sql insert into st_timestamp_9 values(now,-100) +sql select ts, cast(c as bigint) from st_timestamp_9 +if $data01 != -100 then + return -1 +endi +sql insert into st_timestamp_10 values(now,+113) +sql select ts, cast(c as bigint) from st_timestamp_10 +if $data01 != 113 then + return -1 +endi +sql insert into st_timestamp_11 values(now,'-100') +sql select ts, cast(c as bigint) from st_timestamp_11 +if $data01 != -100 then + return -1 +endi +sql insert into st_timestamp_12 values(now,"-0") +sql select ts, cast(c as bigint) from st_timestamp_12 +if $data01 != 0 then + return -1 +endi +sql insert into st_timestamp_13 values(now,+0078) +sql select ts, cast(c as bigint) from st_timestamp_13 +if $data01 != 78 then + return -1 +endi +sql insert into st_timestamp_14 values(now,-00078) +sql select ts, cast(c as bigint) from st_timestamp_14 +if $data01 != -78 then + return -1 +endi +sql insert into st_timestamp_15 values(now,"0x01") +sql select ts, cast(c as bigint) from st_timestamp_15 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_16 values(now,"0b01") +sql select ts, cast(c as bigint) from st_timestamp_16 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_17 values(now,"+0x01") +sql select ts, cast(c as bigint) from st_timestamp_17 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_18 values(now,"-0b01") +sql select ts, cast(c as bigint) from st_timestamp_18 +if $data01 != -1 then + return -1 +endi +sql insert into st_timestamp_19 values(now, 0x01) +sql select ts, cast(c as bigint) from st_timestamp_19 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_20 values(now,0b01 ) +sql select ts, cast(c as bigint) from st_timestamp_20 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_21 values(now,+0x01) +sql select ts, cast(c as bigint) from st_timestamp_21 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_22 values(now, -0b01 ) +sql select ts, cast(c as bigint) from st_timestamp_22 +if $data01 != -1 then + return -1 +endi + +## case 02: dynamic create table for test tag values +sql insert into st_timestamp_100 using mt_timestamp tags(NULL) values(now, NULL) +sql show tags from st_timestamp_100 +if $data05 != NULL then + return -1 +endi +sql select * from st_timestamp_100 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_101 using mt_timestamp tags(NULL) values(now, NULL) +sql show tags from st_timestamp_101 +if $data05 != NULL then + return -1 +endi +sql select * from st_timestamp_101 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_102 using mt_timestamp tags('NULL') values(now, 'NULL') +sql show tags from st_timestamp_102 +if $data05 != NULL then + return -1 +endi +sql select * from st_timestamp_102 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_103 using mt_timestamp tags('NULL') values(now, 'NULL') +sql show tags from st_timestamp_103 +if $data05 != NULL then + return -1 +endi +sql select * from st_timestamp_103 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_104 using mt_timestamp tags("NULL") values(now, "NULL") +sql show tags from st_timestamp_104 +if $data05 != NULL then + return -1 +endi +sql select * from st_timestamp_104 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_105 using mt_timestamp tags("NULL") values(now, "NULL") +sql show tags from st_timestamp_105 +if $data05 != NULL then + return -1 +endi +sql select * from st_timestamp_105 +if $data01 != NULL then + return -1 +endi +sql insert into st_timestamp_106 using mt_timestamp tags(-2147483647) values(now, -2147483647) +sql show tags from st_timestamp_106 +if $data05 != -2147483647 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_106 +if $data01 != -2147483647 then + return -1 +endi +sql insert into st_timestamp_107 using mt_timestamp tags(2147483647) values(now, 2147483647) +sql show tags from st_timestamp_107 +if $data05 != 2147483647 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_107 +if $data01 != 2147483647 then + return -1 +endi +sql insert into st_timestamp_108 using mt_timestamp tags(37) values(now, 37) +sql show tags from st_timestamp_108 +if $data05 != 37 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_108 +if $data01 != 37 then + return -1 +endi +sql insert into st_timestamp_109 using mt_timestamp tags(-100) values(now, -100) +sql show tags from st_timestamp_109 +if $data05 != -100 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_109 +if $data01 != -100 then + return -1 +endi +sql insert into st_timestamp_1010 using mt_timestamp tags(+113) values(now, +113) +sql show tags from st_timestamp_1010 +if $data05 != 113 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1010 +if $data01 != 113 then + return -1 +endi +sql insert into st_timestamp_1011 using mt_timestamp tags('-100') values(now, '-100') +sql show tags from st_timestamp_1011 +if $data05 != -100 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1011 +if $data01 != -100 then + return -1 +endi +sql insert into st_timestamp_1012 using mt_timestamp tags("-0") values(now, "-0") +sql show tags from st_timestamp_1012 +if $data05 != 0 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1012 +if $data01 != 0 then + return -1 +endi +sql insert into st_timestamp_1013 using mt_timestamp tags(+0078) values(now, +0078) +sql show tags from st_timestamp_1013 +if $data05 != 78 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1013 +if $data01 != 78 then + return -1 +endi +sql insert into st_timestamp_1014 using mt_timestamp tags(-00078) values(now, -00078) +sql show tags from st_timestamp_1014 +if $data05 != -78 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1014 +if $data01 != -78 then + return -1 +endi +sql insert into st_timestamp_1015 using mt_timestamp tags("0x01") values(now, "0x01") +sql show tags from st_timestamp_1015 +if $data05 != 1 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1015 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_1016 using mt_timestamp tags("0b01") values(now, "0b01") +sql show tags from st_timestamp_1016 +if $data05 != 1 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1016 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_1017 using mt_timestamp tags("+0x01") values(now, "+0x01") +sql show tags from st_timestamp_1017 +if $data05 != 1 then + return -1 +endi +sql insert into st_timestamp_1018 using mt_timestamp tags("-0b01") values(now, "-0b01") +sql show tags from st_timestamp_1018 +if $data05 != -1 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1018 +if $data01 != -1 then + return -1 +endi +sql insert into st_timestamp_1019 using mt_timestamp tags( 0x01) values(now, 0x01) +sql show tags from st_timestamp_1019 +if $data05 != 1 then + return -1 +endi +sql insert into st_timestamp_1020 using mt_timestamp tags(0b01 ) values(now, 0b01 ) +sql show tags from st_timestamp_1020 +if $data05 != 1 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1020 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_1021 using mt_timestamp tags(+0x01) values(now, +0x01) +sql show tags from st_timestamp_1021 +if $data05 != 1 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1021 +if $data01 != 1 then + return -1 +endi +sql insert into st_timestamp_1022 using mt_timestamp tags( -0b01 ) values(now, -0b01) +sql show tags from st_timestamp_1022 +if $data05 != -1 then + return -1 +endi +sql select ts, cast(c as bigint) from st_timestamp_1022 +if $data01 != -1 then + return -1 +endi + +### case 03: alter tag values +sql alter table st_timestamp_0 set tag tagname=NULL +sql show tags from st_timestamp_0 +if $data05 != NULL then + return -1 +endi +sql alter table st_timestamp_1 set tag tagname=NULL +sql show tags from st_timestamp_1 +if $data05 != NULL then + return -1 +endi +sql alter table st_timestamp_2 set tag tagname='NULL' +sql show tags from st_timestamp_2 +if $data05 != NULL then + return -1 +endi +sql alter table st_timestamp_3 set tag tagname='NULL' +sql show tags from st_timestamp_3 +if $data05 != NULL then + return -1 +endi +sql alter table st_timestamp_4 set tag tagname="NULL" +sql show tags from st_timestamp_4 +if $data05 != NULL then + return -1 +endi +sql alter table st_timestamp_5 set tag tagname="NULL" +sql show tags from st_timestamp_5 +if $data05 != NULL then + return -1 +endi +sql alter table st_timestamp_6 set tag tagname=-2147483647 +sql show tags from st_timestamp_6 +if $data05 != -2147483647 then + return -1 +endi +sql alter table st_timestamp_7 set tag tagname=2147483647 +sql show tags from st_timestamp_7 +if $data05 != 2147483647 then + return -1 +endi +sql alter table st_timestamp_8 set tag tagname=37 +sql show tags from st_timestamp_8 +if $data05 != 37 then + return -1 +endi +sql alter table st_timestamp_9 set tag tagname=-100 +sql show tags from st_timestamp_9 +if $data05 != -100 then + return -1 +endi +sql alter table st_timestamp_10 set tag tagname=+113 +sql show tags from st_timestamp_10 +if $data05 != 113 then + return -1 +endi +sql alter table st_timestamp_11 set tag tagname='-100' +sql show tags from st_timestamp_11 +if $data05 != -100 then + return -1 +endi +sql alter table st_timestamp_12 set tag tagname="-0" +sql show tags from st_timestamp_12 +if $data05 != 0 then + return -1 +endi +sql alter table st_timestamp_13 set tag tagname=+0078 +sql show tags from st_timestamp_13 +if $data05 != 78 then + return -1 +endi +sql alter table st_timestamp_14 set tag tagname=-00078 +sql show tags from st_timestamp_14 +if $data05 != -78 then + return -1 +endi +sql alter table st_timestamp_15 set tag tagname="0x01" +sql show tags from st_timestamp_15 +if $data05 != 1 then + return -1 +endi +sql alter table st_timestamp_16 set tag tagname="0b01" +sql show tags from st_timestamp_16 +if $data05 != 1 then + return -1 +endi +sql alter table st_timestamp_17 set tag tagname="+0x01" +sql show tags from st_timestamp_17 +if $data05 != 1 then + return -1 +endi +sql alter table st_timestamp_18 set tag tagname="-0b01" +sql show tags from st_timestamp_18 +if $data05 != -1 then + return -1 +endi +sql alter table st_timestamp_19 set tag tagname= 0x01 +sql show tags from st_timestamp_19 +if $data05 != 1 then + return -1 +endi +sql alter table st_timestamp_20 set tag tagname=0b01 +sql show tags from st_timestamp_20 +if $data05 != 1 then + return -1 +endi +sql alter table st_timestamp_21 set tag tagname=+0x01 +sql show tags from st_timestamp_21 +if $data05 != 1 then + return -1 +endi +sql alter table st_timestamp_22 set tag tagname= -0b01 +sql show tags from st_timestamp_22 +if $data05 != -1 then + return -1 +endi + +## case 04: illegal input +sql_error create table st_timestamp_e0 using mt_timestamp tags (123abc) +sql_error create table st_timestamp_e0 using mt_timestamp tags ("123abc") +sql_error create table st_timestamp_e0 using mt_timestamp tags (abc) +sql_error create table st_timestamp_e0 using mt_timestamp tags ("abc") +sql_error create table st_timestamp_e0 using mt_timestamp tags (" ") +sql_error create table st_timestamp_e0 using mt_timestamp tags ('') +sql_error create table st_timestamp_104 using mt_timestamp tags ("-123.1") +sql_error create table st_timestamp_105 using mt_timestamp tags ("+123.5") +sql_error create table st_timestamp_106 using mt_timestamp tags ("-1e-1") +sql_error create table st_timestamp_107 using mt_timestamp tags ("+0.1235e3") +sql_error create table st_timestamp_108 using mt_timestamp tags ("-0.11e-30") +sql_error create table st_timestamp_109 using mt_timestamp tags ("-1.1e-307") +sql_error create table st_timestamp_110 using mt_timestamp tags ( -1e-1 ) +sql_error create table st_timestamp_111 using mt_timestamp tags ( +0.1235e3 ) +sql_error create table st_timestamp_112 using mt_timestamp tags (-0.11e-30) +sql_error create table st_timestamp_113 using mt_timestamp tags (-1.1e-307) +sql create table st_timestamp_114 using mt_timestamp tags (9223372036854775807) +sql_error create table st_timestamp_115 using mt_timestamp tags (9223372036854775808) +sql create table st_timestamp_116 using mt_timestamp tags (-9223372036854775808) +sql_error create table st_timestamp_117 using mt_timestamp tags (-9223372036854775809) +sql_error insert into st_timestamp_118 using mt_timestamp tags(9223372036854775807) values(9223372036854775807, 9223372036854775807) + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_tinyint.sim b/tests/script/tsim/parser/columnValue_tinyint.sim index 7d0f10a30d..5076280872 100644 --- a/tests/script/tsim/parser/columnValue_tinyint.sim +++ b/tests/script/tsim/parser/columnValue_tinyint.sim @@ -29,10 +29,26 @@ if $data05 != NULL then return -1 endi -sql_error create table st_tinyint_2 using mt_tinyint tags ('NULL') -sql_error create table st_tinyint_3 using mt_tinyint tags ('NULL') -sql_error create table st_tinyint_4 using mt_tinyint tags ("NULL") -sql_error create table st_tinyint_5 using mt_tinyint tags ("NULL") +sql create table st_tinyint_2 using mt_tinyint tags ('NULL') +sql show tags from st_tinyint_2 +if $data05 != NULL then + return -1 +endi +sql create table st_tinyint_3 using mt_tinyint tags ('NULL') +sql show tags from st_tinyint_3 +if $data05 != NULL then + return -1 +endi +sql create table st_tinyint_4 using mt_tinyint tags ("NULL") +sql show tags from st_tinyint_4 +if $data05 != NULL then + return -1 +endi +sql create table st_tinyint_5 using mt_tinyint tags ("NULL") +sql show tags from st_tinyint_5 +if $data05 != NULL then + return -1 +endi sql create table st_tinyint_6 using mt_tinyint tags (-127) sql show tags from st_tinyint_6 @@ -97,6 +113,40 @@ endi if $data01 != NULL then return -1 endi + +sql insert into st_tinyint_2 values (now, NULL) +sql select * from st_tinyint_2 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +sql insert into st_tinyint_3 values (now, NULL) +sql select * from st_tinyint_3 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +sql insert into st_tinyint_4 values (now, NULL) +sql select * from st_tinyint_4 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +sql insert into st_tinyint_5 values (now, NULL) +sql select * from st_tinyint_5 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi + sql insert into st_tinyint_6 values (now, 127) sql select * from st_tinyint_6 if $rows != 1 then @@ -347,7 +397,7 @@ sql_error create table st_tinyint_e0 using mt_tinyint tags ("123abc") sql_error create table st_tinyint_e0 using mt_tinyint tags (abc) sql_error create table st_tinyint_e0 using mt_tinyint tags ("abc") sql_error create table st_tinyint_e0 using mt_tinyint tags (" ") -sql create table st_tinyint_e0_2 using mt_tinyint tags ('') +sql_error create table st_tinyint_e0_2 using mt_tinyint tags ('') sql create table st_tinyint_e0 using mt_tinyint tags (123) sql create table st_tinyint_e1 using mt_tinyint tags (123) @@ -400,7 +450,7 @@ sql_error insert into st_tinyint_e20 using mt_tinyint tags ("123abc") values (no sql_error insert into st_tinyint_e22 using mt_tinyint tags (abc) values (now, -033) sql_error insert into st_tinyint_e23 using mt_tinyint tags ("abc") values (now, -033) sql_error insert into st_tinyint_e24 using mt_tinyint tags (" ") values (now, -033) -sql insert into st_tinyint_e25 using mt_tinyint tags ('') values (now, -033) +sql_error insert into st_tinyint_e25 using mt_tinyint tags ('') values (now, -033) sql insert into st_tinyint_e13 using mt_tinyint tags (033) values (now, 00062) sql insert into st_tinyint_e14 using mt_tinyint tags (033) values (now, 00062) @@ -425,6 +475,6 @@ sql_error alter table st_tinyint_e20 set tag tagname="123abc" sql_error alter table st_tinyint_e22 set tag tagname=abc sql_error alter table st_tinyint_e23 set tag tagname="abc" sql_error alter table st_tinyint_e24 set tag tagname=" " -sql alter table st_tinyint_e25 set tag tagname='' +sql_error alter table st_tinyint_e25 set tag tagname='' system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_uint.sim b/tests/script/tsim/parser/columnValue_uint.sim new file mode 100644 index 0000000000..a2707bbf17 --- /dev/null +++ b/tests/script/tsim/parser/columnValue_uint.sim @@ -0,0 +1,904 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ========== columnValues.sim + +sql drop database if exists db +sql create database db +sql use db + +#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value + +######## case 0: uint +print ========== uint +sql create table mt_uint (ts timestamp, c int unsigned) tags (tagname int unsigned) + +## case 00: static create table for test tag values +sql create table st_uint_0 using mt_uint tags (NULL) +sql show create table st_uint_0 +sql show tags from st_uint_0 +if $data05 != NULL then + return -1 +endi +sql create table st_uint_1 using mt_uint tags (NULL) +sql show tags from st_uint_1 +if $data05 != NULL then + return -1 +endi + +sql create table st_uint_2 using mt_uint tags ('NULL') +sql show tags from st_uint_2 +if $data05 != NULL then + return -1 +endi +sql create table st_uint_3 using mt_uint tags ('NULL') +sql show tags from st_uint_3 +if $data05 != NULL then + return -1 +endi +sql create table st_uint_4 using mt_uint tags ("NULL") +sql show tags from st_uint_4 +if $data05 != NULL then + return -1 +endi +sql create table st_uint_5 using mt_uint tags ("-0") +sql show tags from st_uint_5 +if $data05 != 0 then + return -1 +endi +sql create table st_uint_6 using mt_uint tags (-0 ) +sql show tags from st_uint_6 +if $data05 != 0 then + return -1 +endi +sql create table st_uint_7 using mt_uint tags (2147483647) +sql show tags from st_uint_7 +if $data05 != 2147483647 then + return -1 +endi +sql create table st_uint_8 using mt_uint tags (37) +sql show tags from st_uint_8 +if $data05 != 37 then + return -1 +endi +sql create table st_uint_9 using mt_uint tags (098) +sql show tags from st_uint_9 +if $data05 != 98 then + return -1 +endi +sql create table st_uint_10 using mt_uint tags (+113) +sql show tags from st_uint_10 +if $data05 != 113 then + return -1 +endi +sql create table st_uint_11 using mt_uint tags (+000.000) +sql show tags from st_uint_11 +if $data05 != 0 then + return -1 +endi +sql create table st_uint_12 using mt_uint tags ("+78") +sql show tags from st_uint_12 +if $data05 != 78 then + return -1 +endi +sql create table st_uint_13 using mt_uint tags (+0078) +sql show tags from st_uint_13 +if $data05 != 78 then + return -1 +endi +sql create table st_uint_14 using mt_uint tags (00078) +sql show tags from st_uint_14 +if $data05 != 78 then + return -1 +endi +sql create table st_uint_100 using mt_uint tags ("0x01") +sql show tags from st_uint_100 +if $data05 != 1 then + return -1 +endi +sql create table st_uint_101 using mt_uint tags ("0b01") +sql show tags from st_uint_101 +if $data05 != 1 then + return -1 +endi +sql create table st_uint_102 using mt_uint tags ("+0x01") +sql show tags from st_uint_102 +if $data05 != 1 then + return -1 +endi +sql create table st_uint_103 using mt_uint tags ("-0b00") +sql show tags from st_uint_103 +if $data05 != 0 then + return -1 +endi +sql create table st_uint_104 using mt_uint tags ("123.1") +sql show tags from st_uint_104 +if $data05 != 123 then + return -1 +endi +sql create table st_uint_105 using mt_uint tags ("+123.5") +sql show tags from st_uint_105 +if $data05 != 124 then + return -1 +endi +sql create table st_uint_106 using mt_uint tags ("-1e-1") +sql show tags from st_uint_106 +if $data05 != 0 then + return -1 +endi +sql create table st_uint_107 using mt_uint tags ("+0.1235e3") +sql show tags from st_uint_107 +if $data05 != 124 then + print $data05 != 124 + return -1 +endi +sql create table st_uint_108 using mt_uint tags ("-0.11e-30") +sql show tags from st_uint_108 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql create table st_uint_109 using mt_uint tags ("-1.1e-307") +sql show tags from st_uint_109 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql create table st_uint_110 using mt_uint tags ( -1e-1 ) +sql show tags from st_uint_110 +if $data05 != 0 then + return -1 +endi +sql create table st_uint_111 using mt_uint tags ( +0.1235e3 ) +sql show tags from st_uint_111 +if $data05 != 124 then + print $data05 != 124 + return -1 +endi +sql create table st_uint_112 using mt_uint tags (-0.11e-30) +sql show tags from st_uint_112 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql create table st_uint_113 using mt_uint tags (-1.1e-307) +sql show tags from st_uint_113 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql create table st_uint_200 using mt_uint tags ( 0x01) +sql show tags from st_uint_200 +if $data05 != 1 then + return -1 +endi +sql create table st_uint_201 using mt_uint tags (0b01 ) +sql show tags from st_uint_201 +if $data05 != 1 then + return -1 +endi +sql create table st_uint_202 using mt_uint tags (+0x01) +sql show tags from st_uint_202 +if $data05 != 1 then + return -1 +endi +sql create table st_uint_203 using mt_uint tags ( -0b00 ) +sql show tags from st_uint_203 +if $data05 != 0 then + return -1 +endi + +## case 01: insert values for test column values +sql insert into st_uint_0 values (now, NULL) +sql select * from st_uint_0 +if $rows != 1 then + return -1 +endi +if $data01 != NULL then + return -1 +endi +sql insert into st_uint_1 values (now, "-0") +sql select * from st_uint_1 +if $rows != 1 then + return -1 +endi +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_6 values (now, 2147483647) +sql select * from st_uint_6 +if $rows != 1 then + return -1 +endi +if $data01 != 2147483647 then + return -1 +endi +sql insert into st_uint_7 values (now, -0) +sql select * from st_uint_7 +if $rows != 1 then + return -1 +endi +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_8 values (now, +100) +sql select * from st_uint_8 +if $rows != 1 then + return -1 +endi +if $data01 != 100 then + return -1 +endi +sql insert into st_uint_9 values (now, "098") +sql select * from st_uint_9 +if $rows != 1 then + return -1 +endi +if $data01 != 98 then + return -1 +endi +sql insert into st_uint_10 values (now, '0') +sql select * from st_uint_10 +if $rows != 1 then + return -1 +endi +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_11 values (now, +000.000) +sql select * from st_uint_11 +if $rows != 1 then + return -1 +endi +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_12 values (now, "+056") +sql select * from st_uint_12 +if $rows != 1 then + return -1 +endi +if $data01 != 56 then + return -1 +endi + +sql insert into st_uint_13 values (now, +056) +sql select * from st_uint_13 +if $rows != 1 then + return -1 +endi +if $data01 != 56 then + return -1 +endi + +sql insert into st_uint_14 values (now, 056) +sql select * from st_uint_14 +if $rows != 1 then + return -1 +endi +if $data01 != 56 then + return -1 +endi + +sql insert into st_uint_100 values (now, "0x01") +sql select * from st_uint_100 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_101 values (now, "0b01") +sql select * from st_uint_101 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_102 values (now, "+0x01") +sql select * from st_uint_102 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_103 values (now, "-0b00") +sql select * from st_uint_103 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_104 values (now, "123.1") +sql select * from st_uint_104 +if $data01 != 123 then + return -1 +endi +sql insert into st_uint_105 values (now, "+123.5") +sql select * from st_uint_105 +if $data01 != 124 then + return -1 +endi +sql insert into st_uint_106 values (now, "-1e-1") +sql select * from st_uint_106 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_107 values (now, "+0.1235e3") +sql select * from st_uint_107 +if $data01 != 124 then + print $data05 != 124 + return -1 +endi +sql insert into st_uint_108 values (now, "-0.11e-30") +sql select * from st_uint_108 +if $data01 != 0 then + print $data05 != 0 + return -1 +endi +sql insert into st_uint_109 values (now, "-1.1e-307") +sql select * from st_uint_109 +if $data01 != 0 then + print $data05 != 0 + return -1 +endi +sql insert into st_uint_110 values (now, -1e-1 ) +sql select * from st_uint_110 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_111 values (now, +0.1235e3 ) +sql select * from st_uint_111 +if $data01 != 124 then + print $data05 != 124 + return -1 +endi +sql insert into st_uint_112 values (now, -0.11e-30) +sql select * from st_uint_112 +if $data01 != 0 then + print $data05 != 0 + return -1 +endi +sql insert into st_uint_113 values (now, -1.1e-307) +sql select * from st_uint_113 +if $data01 != 0 then + print $data05 != 0 + return -1 +endi +sql insert into st_uint_200 values (now, 0x01) +sql select * from st_uint_200 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_201 values (now, 0b01 ) +sql select * from st_uint_201 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_202 values (now, +0x01) +sql select * from st_uint_202 +if $rows != 1 then + return -1 +endi +if $data01 != 1 then + return -1 +endi + +sql insert into st_uint_203 values (now, -0b00 ) +sql select * from st_uint_203 +if $data01 != 0 then + return -1 +endi + +## case 02: dynamic create table for test tag values +sql insert into st_uint_16 using mt_uint tags (NULL) values (now, NULL) +sql show create table st_uint_16 +sql show tags from st_uint_16 +if $data05 != NULL then + return -1 +endi +sql select * from st_uint_16 +if $data01 != NULL then + return -1 +endi + +sql insert into st_uint_17 using mt_uint tags (NULL) values (now, NULL) +sql show tags from st_uint_17 +if $data05 != NULL then + return -1 +endi +sql select * from st_uint_17 +if $data01 != NULL then + return -1 +endi +sql insert into st_uint_18 using mt_uint tags ('NULL') values (now, 'NULL') +sql show tags from st_uint_18 +if $data05 != NULL then + return -1 +endi +sql select * from st_uint_18 +if $data01 != NULL then + return -1 +endi +sql insert into st_uint_19 using mt_uint tags ('NULL') values (now, 'NULL') +sql show tags from st_uint_19 +if $data05 != NULL then + return -1 +endi +sql select * from st_uint_19 +if $data01 != NULL then + return -1 +endi +sql insert into st_uint_20 using mt_uint tags ("NULL") values (now, "NULL") +sql show tags from st_uint_20 +if $data05 != NULL then + return -1 +endi +sql select * from st_uint_20 +if $data01 != NULL then + return -1 +endi +sql insert into st_uint_21 using mt_uint tags ("-0") values (now, "-0") +sql show tags from st_uint_21 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_21 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_22 using mt_uint tags (2147483647) values (now, 2147483647) +sql show tags from st_uint_22 +if $data05 != 2147483647 then + return -1 +endi +sql select * from st_uint_22 +if $data01 != 2147483647 then + return -1 +endi +sql insert into st_uint_23 using mt_uint tags (-0) values (now, -0) +sql show tags from st_uint_23 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_23 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_24 using mt_uint tags (10) values (now, 10) +sql show tags from st_uint_24 +if $data05 != 10 then + return -1 +endi +sql select * from st_uint_24 +if $data01 != 10 then + return -1 +endi +sql insert into st_uint_25 using mt_uint tags ("-0") values (now, "-0") +sql show tags from st_uint_25 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_25 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_26 using mt_uint tags ('123') values (now, '123') +sql show tags from st_uint_26 +if $data05 != 123 then + return -1 +endi +sql select * from st_uint_26 +if $data01 != 123 then + return -1 +endi +sql insert into st_uint_27 using mt_uint tags (+056) values (now, +00056) +sql show tags from st_uint_27 +if $data05 != 56 then + return -1 +endi +sql select * from st_uint_27 +if $data01 != 56 then + return -1 +endi +sql insert into st_uint_28 using mt_uint tags (056) values (now, 0056) +sql show tags from st_uint_28 +if $data05 != 56 then + return -1 +endi +sql select * from st_uint_28 +if $data01 != 56 then + return -1 +endi +sql insert into st_uint_1100 using mt_uint tags ("0x01") values(now, "0x01"); +sql show tags from st_uint_1100 +if $data05 != 1 then + return -1 +endi +sql select * from st_uint_1100 +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_1101 using mt_uint tags ("0b01") values(now, "0b01"); +sql show tags from st_uint_1101 +if $data05 != 1 then + return -1 +endi +sql select * from st_uint_1101 +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_1102 using mt_uint tags ("+0x01") values(now, "+0x01"); +sql show tags from st_uint_1102 +if $data05 != 1 then + return -1 +endi +sql select * from st_uint_1102 +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_1103 using mt_uint tags ("-0b00") values(now, "-0b000"); +sql show tags from st_uint_1103 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_1103 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_1104 using mt_uint tags ("123.1") values(now, "123.1"); +sql show tags from st_uint_1104 +if $data05 != 123 then + return -1 +endi +sql select * from st_uint_1104 +if $data01 != 123 then + return -1 +endi +sql insert into st_uint_1105 using mt_uint tags ("+123.5") values(now, "+123.5"); +sql show tags from st_uint_1105 +if $data05 != 124 then + return -1 +endi +sql select * from st_uint_1105 +if $data01 != 124 then + return -1 +endi +sql insert into st_uint_1106 using mt_uint tags ("-1e-1") values(now, "-1e-1"); +sql show tags from st_uint_1106 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_1106 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_1107 using mt_uint tags ("+0.1235e3") values(now, "+0.1235e3"); +sql show tags from st_uint_1107 +if $data05 != 124 then + return -1 +endi +sql insert into st_uint_1108 using mt_uint tags ("-0.11e-30") values(now, "-0.11e-30"); +sql show tags from st_uint_1108 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_1108 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_1109 using mt_uint tags ("-1.1e-307") values(now, "-1.1e-307"); +sql show tags from st_uint_1109 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_1109 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_1110 using mt_uint tags ( -1e-1 ) values(now, -1e-1); +sql show tags from st_uint_1110 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_1110 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_1111 using mt_uint tags ( +0.1235e3 ) values(now, +0.1235e3); +sql show tags from st_uint_1111 +if $data05 != 124 then + return -1 +endi +sql select * from st_uint_1111 +if $data01 != 124 then + return -1 +endi +sql insert into st_uint_1112 using mt_uint tags (-0.11e-30) values(now, -0.11e-30); +sql show tags from st_uint_1112 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_1112 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_1113 using mt_uint tags (-1.1e-307) values(now, -1.1e-307); +sql show tags from st_uint_1113 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_1113 +if $data01 != 0 then + return -1 +endi +sql insert into st_uint_1200 using mt_uint tags ( 0x01) values(now, 0x01); +sql show tags from st_uint_1200 +if $data05 != 1 then + return -1 +endi +sql select * from st_uint_1200 +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_1201 using mt_uint tags (0b01 ) values(now, 0b01); +sql show tags from st_uint_1201 +if $data05 != 1 then + return -1 +endi +sql select * from st_uint_1201 +if $data01 != 1 then + return -1 +endi +sql insert into st_uint_1202 using mt_uint tags (+0x01) values(now, +0x01); +sql show tags from st_uint_1202 +if $data05 != 1 then + return -1 +endi +sql select * from st_uint_1202 +if $data01 != 1 then + return -1 +endi + +sql insert into st_uint_1203 using mt_uint tags ( 0b000000 ) values(now, -0b0000); +sql show tags from st_uint_1203 +if $data05 != 0 then + return -1 +endi +sql select * from st_uint_1203 +if $data01 != 0 then + return -1 +endi + +### case 03: alter tag values +sql alter table st_uint_0 set tag tagname=2147483647 +sql show tags from st_uint_0 +if $data05 != 2147483647 then + return -1 +endi +sql alter table st_uint_0 set tag tagname=-0 +sql show tags from st_uint_0 +if $data05 != 0 then + return -1 +endi +sql alter table st_uint_0 set tag tagname=+100 +sql show tags from st_uint_0 +if $data05 != 100 then + return -1 +endi +sql alter table st_uint_0 set tag tagname=+33.333 +sql show tags from st_uint_0 +if $data05 != 33 then + return -1 +endi +sql alter table st_uint_0 set tag tagname='+98' +sql show tags from st_uint_0 +if $data05 != 98 then + return -1 +endi +sql alter table st_uint_0 set tag tagname='076' +sql show tags from st_uint_0 +if $data05 != 76 then + return -1 +endi +sql alter table st_uint_0 set tag tagname=+0012 +sql show tags from st_uint_0 +if $data05 != 12 then + return -1 +endi +sql alter table st_uint_0 set tag tagname=00063 +sql show tags from st_uint_0 +if $data05 != 63 then + return -1 +endi +sql alter table st_uint_100 set tag tagname="0x01" +sql show tags from st_uint_100 +if $data05 != 1 then + return -1 +endi +sql alter table st_uint_101 set tag tagname="0b01" +sql show tags from st_uint_101 +if $data05 != 1 then + return -1 +endi +sql alter table st_uint_102 set tag tagname="+0x01" +sql show tags from st_uint_102 +if $data05 != 1 then + return -1 +endi +sql alter table st_uint_103 set tag tagname="-0b00" +sql show tags from st_uint_103 +if $data05 != 0 then + return -1 +endi +sql alter table st_uint_104 set tag tagname="123.1" +sql show tags from st_uint_104 +if $data05 != 123 then + return -1 +endi +sql alter table st_uint_105 set tag tagname="+123.5" +sql show tags from st_uint_105 +if $data05 != 124 then + return -1 +endi +sql alter table st_uint_106 set tag tagname="-1e-1" +sql show tags from st_uint_106 +if $data05 != 0 then + return -1 +endi +sql alter table st_uint_107 set tag tagname="+0.1235e3" +sql show tags from st_uint_107 +if $data05 != 124 then + print $data05 != 124 + return -1 +endi +sql alter table st_uint_108 set tag tagname="-0.11e-30" +sql show tags from st_uint_108 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql alter table st_uint_109 set tag tagname="-1.1e-307" +sql show tags from st_uint_109 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql alter table st_uint_110 set tag tagname= -1e-1 +sql show tags from st_uint_110 +if $data05 != 0 then + return -1 +endi +sql alter table st_uint_111 set tag tagname= +0.1235e3 +sql show tags from st_uint_111 +if $data05 != 124 then + print $data05 != 124 + return -1 +endi +sql alter table st_uint_112 set tag tagname=-0.11e-30 +sql show tags from st_uint_112 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql alter table st_uint_113 set tag tagname=-1.1e-307 +sql show tags from st_uint_113 +if $data05 != 0 then + print $data05 != 0 + return -1 +endi +sql alter table st_uint_200 set tag tagname= 0x01 +sql show tags from st_uint_200 +if $data05 != 1 then + return -1 +endi +sql alter table st_uint_201 set tag tagname=0b00 +sql show tags from st_uint_201 +if $data05 != 0 then + return -1 +endi +sql alter table st_uint_202 set tag tagname=+0x01 +sql show tags from st_uint_202 +if $data05 != 1 then + return -1 +endi +sql alter table st_uint_203 set tag tagname= -0b0 +sql show tags from st_uint_203 +if $data05 != 0 then + return -1 +endi + +## case 04: illegal input +sql_error create table st_uint_e0_err0 using mt_uint tags (4294967296) +sql_error create table st_uint_e0_err1 using mt_uint tags (-4294967297) +sql_error create table st_uint_e0_err2 using mt_uint tags (-214748364800) +sql_error create table st_uint_e0_err3 using mt_uint tags (123abc) +sql_error create table st_uint_e0_err4 using mt_uint tags ("123abc") +sql_error create table st_uint_e0_err5 using mt_uint tags (abc) +sql_error create table st_uint_e0_err6 using mt_uint tags ("abc") +sql_error create table st_uint_e0_err7 using mt_uint tags (" ") +sql_error create table st_uint_e0_err8 using mt_uint tags ('') + +sql create table st_uint_e0 using mt_uint tags (123) +sql create table st_uint_e1 using mt_uint tags (123) +sql create table st_uint_e2 using mt_uint tags (123) +sql create table st_uint_e3 using mt_uint tags (123) +sql create table st_uint_e4 using mt_uint tags (123) +sql create table st_uint_e5 using mt_uint tags (123) +sql create table st_uint_e6 using mt_uint tags (123) +sql create table st_uint_e7 using mt_uint tags (123) +sql create table st_uint_e8 using mt_uint tags (123) +sql create table st_uint_e9 using mt_uint tags (123) +sql create table st_uint_e10 using mt_uint tags (123) +sql create table st_uint_e11 using mt_uint tags (123) +sql create table st_uint_e12 using mt_uint tags (123) + +sql_error insert into st_uint_e0 values (now, 4294967296) +sql_error insert into st_uint_e1 values (now, -4294967297) +sql_error insert into st_uint_e3 values (now, -21474836481) +sql_error insert into st_uint_e6 values (now, 123abc) +sql_error insert into st_uint_e7 values (now, "123abc") +sql_error insert into st_uint_e9 values (now, abc) +sql_error insert into st_uint_e10 values (now, "abc") +sql_error insert into st_uint_e11 values (now, " ") +sql_error insert into st_uint_e12 values (now, '') + +sql_error insert into st_uint_e13 using mt_uint tags (033) values (now, 4294967296) +sql_error insert into st_uint_e14 using mt_uint tags (033) values (now, -4294967297) +sql_error insert into st_uint_e16 using mt_uint tags (033) values (now, -21474836481) +sql_error insert into st_uint_e19 using mt_uint tags (033) values (now, 123abc) +sql_error insert into st_uint_e20 using mt_uint tags (033) values (now, "123abc") +sql_error insert into st_uint_e22 using mt_uint tags (033) values (now, abc) +sql_error insert into st_uint_e23 using mt_uint tags (033) values (now, "abc") +sql_error insert into st_uint_e24 using mt_uint tags (033) values (now, " ") +sql_error insert into st_uint_e25 using mt_uint tags (033) values (now, '') + +sql_error insert into st_uint_e13 using mt_uint tags (21474294967296483648) values (now, -033) +sql_error insert into st_uint_e14_1 using mt_uint tags (-2147483648) values (now, -033) +sql_error insert into st_uint_e16 using mt_uint tags (-2147483649) values (now, -033) +sql_error insert into st_uint_e19 using mt_uint tags (123abc) values (now, -033) +sql_error insert into st_uint_e20 using mt_uint tags ("123abc") values (now, -033) +sql_error insert into st_uint_e22 using mt_uint tags (abc) values (now, -033) +sql_error insert into st_uint_e23 using mt_uint tags ("abc") values (now, -033) +sql_error insert into st_uint_e24 using mt_uint tags (" ") values (now, -033) +sql_error insert into st_uint_e25_1 using mt_uint tags ('') values (now, -033) +sql insert into st_uint_e26_1 using mt_uint tags ('123') values (now, 033) +sql insert into st_uint_e27_1 using mt_uint tags ('12.80') values (now, 033) +sql_error insert into st_uint_e28_1 using mt_uint tags ('-11.80') values (now, 033) + +sql insert into st_uint_e13 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e14 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e15 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e16 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e17 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e18 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e19 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e20 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e21 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e22 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e23 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e24 using mt_uint tags (033) values (now, 00062) +sql insert into st_uint_e25 using mt_uint tags (033) values (now, 00062) + +sql_error alter table st_uint_e13 set tag tagname=4294967296 +sql_error alter table st_uint_e14 set tag tagname=-4294967297 +sql_error alter table st_uint_e16 set tag tagname=-3147483648 +sql_error alter table st_uint_e19 set tag tagname=123abc +sql_error alter table st_uint_e20 set tag tagname="123abc" +sql_error alter table st_uint_e22 set tag tagname=abc +sql_error alter table st_uint_e23 set tag tagname="abc" +sql_error alter table st_uint_e24 set tag tagname=" " +sql_error alter table st_uint_e25 set tag tagname='' +sql alter table st_uint_e26_1 set tag tagname='123' +sql alter table st_uint_e27_1 set tag tagname='12.80' +sql_error alter table st_uint_e28_1 set tag tagname='-11.80' + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_varbinary.sim b/tests/script/tsim/parser/columnValue_varbinary.sim new file mode 100644 index 0000000000..1db1054646 --- /dev/null +++ b/tests/script/tsim/parser/columnValue_varbinary.sim @@ -0,0 +1,323 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ========== columnValues.sim + +sql drop database if exists db +sql create database db +sql use db + +#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value + +######## case 0: varbinary +print ========== varbinary +sql create table mt_varbinary (ts timestamp, c varbinary(50)) tags(tagname varbinary(50)) + +## case 00: static create table for test tag values +sql create table st_varbinary_0 using mt_varbinary tags(NULL) +sql show tags from st_varbinary_0 +if $data05 != NULL then + return -1 +endi +sql create table st_varbinary_1 using mt_varbinary tags(NULL) +sql show tags from st_varbinary_1 +if $data05 != NULL then + return -1 +endi +sql create table st_varbinary_2 using mt_varbinary tags('NULL') +sql show tags from st_varbinary_2 +if $data05 != \x4E554C4C then + return -1 +endi +sql create table st_varbinary_3 using mt_varbinary tags('NULL') +sql show tags from st_varbinary_3 +if $data05 != \x4E554C4C then + return -1 +endi +sql create table st_varbinary_4 using mt_varbinary tags("NULL") +sql show tags from st_varbinary_4 +if $data05 != \x4E554C4C then + return -1 +endi +sql create table st_varbinary_5 using mt_varbinary tags("NULL") +sql show tags from st_varbinary_5 +if $data05 != \x4E554C4C then + return -1 +endi +sql create table st_varbinary_6 using mt_varbinary tags("") +sql show tags from st_varbinary_6 +if $data05 != \x then + return -1 +endi +sql create table st_varbinary_7 using mt_varbinary tags(" ") +sql show tags from st_varbinary_7 +if $data05 != \x20 then + return -1 +endi +sql create table st_varbinary_8 using mt_varbinary tags("\x") +sql show tags from st_varbinary_8 +if $data05 != \x then + return -1 +endi +sql create table st_varbinary_9 using mt_varbinary tags("\xaB") +sql show tags from st_varbinary_9 +if $data05 != \xAB then + return -1 +endi +sql create table st_varbinary_10 using mt_varbinary tags("aB") +sql show tags from st_varbinary_10 +if $data05 != \x6142 then + return -1 +endi + + +## case 01: insert values for test column values +sql insert into st_varbinary_0 values(now, NULL) +sql select * from st_varbinary_0 +if $data01 != NULL then + return -1 +endi +sql insert into st_varbinary_1 values(now, NULL) +sql select * from st_varbinary_1 +if $data01 != NULL then + return -1 +endi +sql insert into st_varbinary_2 values(now, 'NULL') +sql select * from st_varbinary_2 +if $data01 != \x4E554C4C then +# return -1 +endi +sql insert into st_varbinary_3 values(now, 'NULL') +sql select * from st_varbinary_3 +if $data01 != \x4E554C4C then +# return -1 +endi +sql insert into st_varbinary_4 values(now, "NULL") +sql select * from st_varbinary_4 +if $data01 != \x4E554C4C then +# return -1 +endi +sql insert into st_varbinary_5 values(now, "NULL") +sql select * from st_varbinary_5 +if $data01 != \x4E554C4C then +# return -1 +endi +sql insert into st_varbinary_6 values(now, "") +sql select * from st_varbinary_6 +if $data01 != \x then +# return -1 +endi +sql insert into st_varbinary_7 values(now, " ") +sql select * from st_varbinary_7 +if $data01 != \x20 then +# return -1 +endi +sql insert into st_varbinary_8 values(now, "\x") +sql select * from st_varbinary_8 +if $data01 != \x then +# return -1 +endi +sql insert into st_varbinary_9 values(now, "\xaB") +sql select * from st_varbinary_9 +if $data01 != \xAB then +# return -1 +endi +sql insert into st_varbinary_10 values(now, "aB") +sql select * from st_varbinary_10 +if $data01 != \x6142 then +# return -1 +endi + +## case 02: dynamic create table for test tag values +sql insert into st_varbinary_100 using mt_varbinary tags(NULL) values(now,NULL) +sql show tags from st_varbinary_100 +if $data05 != NULL then + return -1 +endi +sql select * from st_varbinary_100 +if $data01 != NULL then +# return -1 +endi +sql insert into st_varbinary_101 using mt_varbinary tags(NULL) values(now,NULL) +sql show tags from st_varbinary_101 +if $data05 != NULL then + return -1 +endi +sql select * from st_varbinary_101 +if $data01 != NULL then +# return -1 +endi +sql insert into st_varbinary_102 using mt_varbinary tags('NULL') values(now,'NULL') +sql show tags from st_varbinary_102 +if $data05 != \x4E554C4C then + return -1 +endi +sql select * from st_varbinary_102 +if $data01 != \x4E554C4C then +# return -1 +endi +sql insert into st_varbinary_103 using mt_varbinary tags('NULL') values(now,'NULL') +sql show tags from st_varbinary_103 +if $data05 != \x4E554C4C then + return -1 +endi +sql select * from st_varbinary_103 +if $data01 != \x4E554C4C then +# return -1 +endi +sql insert into st_varbinary_104 using mt_varbinary tags("NULL") values(now,"NULL") +sql show tags from st_varbinary_104 +if $data05 != \x4E554C4C then + return -1 +endi +sql select * from st_varbinary_104 +if $data01 != \x4E554C4C then +# return -1 +endi +sql insert into st_varbinary_105 using mt_varbinary tags("NULL") values(now,"NULL") +sql show tags from st_varbinary_105 +if $data05 != \x4E554C4C then + return -1 +endi +sql select * from st_varbinary_105 +if $data01 != \x4E554C4C then +# return -1 +endi +sql insert into st_varbinary_106 using mt_varbinary tags("") values(now,"") +sql show tags from st_varbinary_106 +if $data05 != \x then + return -1 +endi +sql select * from st_varbinary_106 +if $data01 != \x then +# return -1 +endi +sql insert into st_varbinary_107 using mt_varbinary tags(" ") values(now," ") +sql show tags from st_varbinary_107 +if $data05 != \x20 then + return -1 +endi +sql select * from st_varbinary_107 +if $data01 != \x20 then +# return -1 +endi +sql insert into st_varbinary_108 using mt_varbinary tags("\x") values(now,"\x") +sql show tags from st_varbinary_108 +if $data05 != \x then + return -1 +endi +sql select * from st_varbinary_108 +if $data01 != \x then +# return -1 +endi +sql insert into st_varbinary_109 using mt_varbinary tags("\xaB") values(now,"\xaB") +sql show tags from st_varbinary_109 +if $data05 != \xAB then + return -1 +endi +sql select * from st_varbinary_109 +if $data01 != \xAB then +# return -1 +endi +sql insert into st_varbinary_1010 using mt_varbinary tags("aB") values(now,"aB") +sql show tags from st_varbinary_1010 +if $data05 != \x6142 then + return -1 +endi +sql select * from st_varbinary_1010 +if $data01 != \x6142 then +# return -1 +endi + +## case 03: alter tag values +sql alter table st_varbinary_100 set tag tagname=NULL +sql show tags from st_varbinary_100 +if $data05 != NULL then + return -1 +endi +sql alter table st_varbinary_101 set tag tagname=NULL +sql show tags from st_varbinary_101 +if $data05 != NULL then + return -1 +endi +sql alter table st_varbinary_102 set tag tagname='NULL' +sql show tags from st_varbinary_102 +if $data05 != \x4E554C4C then + return -1 +endi +sql alter table st_varbinary_103 set tag tagname='NULL' +sql show tags from st_varbinary_103 +if $data05 != \x4E554C4C then + return -1 +endi +sql alter table st_varbinary_104 set tag tagname="NULL" +sql show tags from st_varbinary_104 +if $data05 != \x4E554C4C then + return -1 +endi +sql alter table st_varbinary_105 set tag tagname="NULL" +sql show tags from st_varbinary_105 +if $data05 != \x4E554C4C then + return -1 +endi +sql alter table st_varbinary_106 set tag tagname="" +sql show tags from st_varbinary_106 +if $data05 != \x then + return -1 +endi +sql alter table st_varbinary_107 set tag tagname=" " +sql show tags from st_varbinary_107 +if $data05 != \x20 then + return -1 +endi +sql alter table st_varbinary_108 set tag tagname="\x" +sql show tags from st_varbinary_108 +if $data05 != \x then + return -1 +endi +sql alter table st_varbinary_109 set tag tagname="\xaB" +sql show tags from st_varbinary_109 +if $data05 != \xAB then + return -1 +endi +sql alter table st_varbinary_1010 set tag tagname="aB" +sql show tags from st_varbinary_1010 +if $data05 != \x6142 then + return -1 +endi + +# case 04: illegal input +sql_error create table st_varbinary_106 using mt_varbinary tags(+0123) +sql_error create table st_varbinary_107 using mt_varbinary tags(-01.23) +sql_error create table st_varbinary_108 using mt_varbinary tags(+0x01) +sql_error create table st_varbinary_109 using mt_varbinary tags(-0b01) +sql_error create table st_varbinary_1010 using mt_varbinary tags(-0.1e-10) +sql_error create table st_varbinary_1011 using mt_varbinary tags(+0.1E+2) +sql_error create table st_varbinary_1012 using mt_varbinary tags(tRue) +sql_error create table st_varbinary_1013 using mt_varbinary tags(FalsE) +sql_error create table st_varbinary_1014 using mt_varbinary tags(noW) +sql_error create table st_varbinary_1015 using mt_varbinary tags(toDay) +sql_error insert into st_varbinary_106 using mt_varbinary tags(+0123) values(now, NULL); +sql_error insert into st_varbinary_107 using mt_varbinary tags(-01.23) values(now, NULL); +sql_error insert into st_varbinary_108 using mt_varbinary tags(+0x01) values(now, NULL); +sql_error insert into st_varbinary_109 using mt_varbinary tags(-0b01) values(now, NULL); +sql_error insert into st_varbinary_1010 using mt_varbinary tags(-0.1e-10) values(now, NULL); +sql_error insert into st_varbinary_1011 using mt_varbinary tags(+0.1E+2) values(now, NULL); +sql_error insert into st_varbinary_1012 using mt_varbinary tags(tRue) values(now, NULL); +sql_error insert into st_varbinary_1013 using mt_varbinary tags(FalsE) values(now, NULL); +sql_error insert into st_varbinary_1014 using mt_varbinary tags(noW) values(now, NULL); +sql_error insert into st_varbinary_1015 using mt_varbinary tags(toDay) values(now, NULL); +sql_error insert into st_varbinary_106 using mt_varbinary tags(NULL) values(now(), +0123) +sql_error insert into st_varbinary_107 using mt_varbinary tags(NULL) values(now(), -01.23) +sql_error insert into st_varbinary_108 using mt_varbinary tags(NULL) values(now(), +0x01) +sql_error insert into st_varbinary_109 using mt_varbinary tags(NULL) values(now(), -0b01) +sql_error insert into st_varbinary_1010 using mt_varbinary tags(NULL) values(now(), -0.1e-10) +sql_error insert into st_varbinary_1011 using mt_varbinary tags(NULL) values(now(), +0.1E+2) +sql_error insert into st_varbinary_1012 using mt_varbinary tags(NULL) values(now(), tRue) +sql_error insert into st_varbinary_1013 using mt_varbinary tags(NULL) values(now(), FalsE) +sql_error insert into st_varbinary_1014 using mt_varbinary tags(NULL) values(now(), noW) +sql_error insert into st_varbinary_1015 using mt_varbinary tags(NULL) values(now(), toDay) + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/columnValue_varchar.sim b/tests/script/tsim/parser/columnValue_varchar.sim new file mode 100644 index 0000000000..5edfe5ed24 --- /dev/null +++ b/tests/script/tsim/parser/columnValue_varchar.sim @@ -0,0 +1,415 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ========== columnValues.sim + +sql drop database if exists db +sql create database db +sql use db + +#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value + +######## case 0: varchar +print ========== varchar +sql create table mt_varchar (ts timestamp, c varchar(50)) tags (tagname varchar(50)) + +## case 00: static create table for test tag values +sql create table st_varchar_0 using mt_varchar tags (NULL) +sql show create table st_varchar_0 +sql show tags from st_varchar_0 +if $data05 != NULL then + return -1 +endi +sql create table st_varchar_1 using mt_varchar tags (NULL) +sql show tags from st_varchar_1 +if $data05 != NULL then + return -1 +endi +sql create table st_varchar_2 using mt_varchar tags ('NULL') +sql show tags from st_varchar_2 +if $data05 != NULL then + return -1 +endi +sql create table st_varchar_3 using mt_varchar tags ('NULL') +sql show tags from st_varchar_3 +if $data05 != NULL then + return -1 +endi +sql create table st_varchar_4 using mt_varchar tags ("NULL") +sql show tags from st_varchar_4 +if $data05 != NULL then + return -1 +endi +sql create table st_varchar_5 using mt_varchar tags ("NULL") +sql show tags from st_varchar_5 +if $data05 != NULL then + return -1 +endi +sql create table st_varchar_6 using mt_varchar tags (+0123) +sql show tags from st_varchar_6 +if $data05 != +0123 then + return -1 +endi +sql create table st_varchar_7 using mt_varchar tags (-01.23) +sql show tags from st_varchar_7 +if $data05 != -01.23 then + return -1 +endi +sql create table st_varchar_8 using mt_varchar tags (+0x01) +sql show tags from st_varchar_8 +if $data05 != +0x01 then + return -1 +endi +sql create table st_varchar_9 using mt_varchar tags (-0b01) +sql show tags from st_varchar_9 +if $data05 != -0b01 then + return -1 +endi +sql create table st_varchar_10 using mt_varchar tags (-0.1e-10) +sql show tags from st_varchar_10 +if $data05 != -0.1e-10 then + return -1 +endi +sql create table st_varchar_11 using mt_varchar tags (+0.1E+2) +sql show tags from st_varchar_11 +if $data05 != +0.1e+2 then + return -1 +endi +sql create table st_varchar_12 using mt_varchar tags (tRue) +sql show tags from st_varchar_12 +if $data05 != true then + return -1 +endi +sql create table st_varchar_13 using mt_varchar tags (FalsE) +sql show tags from st_varchar_13 +if $data05 != false then + return -1 +endi +sql create table st_varchar_14 using mt_varchar tags (noW) +sql show tags from st_varchar_14 +if $data05 != now then + return -1 +endi +sql create table st_varchar_15 using mt_varchar tags (toDay) +sql show tags from st_varchar_15 +if $data05 != today then + return -1 +endi + +## case 01: insert values for test column values +sql insert into st_varchar_0 values(now, NULL) +sql select * from st_varchar_0 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_1 values(now, NULL) +sql select * from st_varchar_1 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_2 values(now, 'NULL') +sql select * from st_varchar_2 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_3 values(now, 'NULL') +sql select * from st_varchar_3 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_4 values(now, "NULL") +sql select * from st_varchar_4 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_5 values(now, "NULL") +sql select * from st_varchar_5 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_6 values(now, +0123) +sql select * from st_varchar_6 +if $data01 != +0123 then + return -1 +endi +sql insert into st_varchar_7 values(now, -01.23) +sql select * from st_varchar_7 +if $data01 != -01.23 then + return -1 +endi +sql insert into st_varchar_8 values(now, +0x01) +sql select * from st_varchar_8 +if $data01 != +0x01 then + return -1 +endi +sql insert into st_varchar_9 values(now, -0b01) +sql select * from st_varchar_9 +if $data01 != -0b01 then + return -1 +endi +sql insert into st_varchar_10 values(now, -0.1e-10) +sql select * from st_varchar_10 +if $data01 != -0.1e-10 then + return -1 +endi +sql insert into st_varchar_11 values(now, +0.1E+2) +sql select * from st_varchar_11 +if $data01 != +0.1e+2 then + return -1 +endi +sql insert into st_varchar_12 values(now, tRue) +sql select * from st_varchar_12 +if $data01 != true then + return -1 +endi +sql insert into st_varchar_13 values(now, FalsE) +sql select * from st_varchar_13 +if $data01 != false then + return -1 +endi +sql insert into st_varchar_14 values(now, noW) +sql select * from st_varchar_14 +if $data01 != now then + return -1 +endi +sql insert into st_varchar_15 values(now, toDay) +sql select * from st_varchar_15 +if $data01 != today then + return -1 +endi + +## case 02: dynamic create table for test tag values +sql insert into st_varchar_0 using mt_varchar tags (NULL) values(now, NULL) +sql show tags from st_varchar_0 +if $data05 != NULL then + return -1 +endi +sql select * from st_varchar_0 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_1 using mt_varchar tags (NULL) values(now, NULL) +sql show tags from st_varchar_1 +if $data05 != NULL then + return -1 +endi +sql select * from st_varchar_1 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_2 using mt_varchar tags ('NULL') values(now, 'NULL') +sql show tags from st_varchar_2 +if $data05 != NULL then + return -1 +endi +sql select * from st_varchar_2 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_3 using mt_varchar tags ('NULL') values(now, 'NULL') +sql show tags from st_varchar_3 +if $data05 != NULL then + return -1 +endi +sql select * from st_varchar_3 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_4 using mt_varchar tags ("NULL") values(now, "NULL") +sql show tags from st_varchar_4 +if $data05 != NULL then + return -1 +endi +sql select * from st_varchar_4 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_5 using mt_varchar tags ("NULL") values(now, "NULL") +sql show tags from st_varchar_5 +if $data05 != NULL then + return -1 +endi +sql select * from st_varchar_5 +if $data01 != NULL then + return -1 +endi +sql insert into st_varchar_6 using mt_varchar tags (+0123) values(now, +0123) +sql show tags from st_varchar_6 +if $data05 != +0123 then + return -1 +endi +sql select * from st_varchar_6 +if $data01 != +0123 then + return -1 +endi +sql insert into st_varchar_7 using mt_varchar tags (-01.23) values(now, -01.23) +sql show tags from st_varchar_7 +if $data05 != -01.23 then + return -1 +endi +sql select * from st_varchar_7 +if $data01 != -01.23 then + return -1 +endi +sql insert into st_varchar_8 using mt_varchar tags (+0x01) values(now, +0x01) +sql show tags from st_varchar_8 +if $data05 != +0x01 then + return -1 +endi +sql select * from st_varchar_8 +if $data01 != +0x01 then + return -1 +endi +sql insert into st_varchar_9 using mt_varchar tags (-0b01) values(now, -0b01) +sql show tags from st_varchar_9 +if $data05 != -0b01 then + return -1 +endi +sql select * from st_varchar_9 +if $data01 != -0b01 then + return -1 +endi +sql insert into st_varchar_10 using mt_varchar tags (-0.1e-10) values(now, -0.1e-10) +sql show tags from st_varchar_10 +if $data05 != -0.1e-10 then + return -1 +endi +sql select * from st_varchar_10 +if $data01 != -0.1e-10 then + return -1 +endi +sql insert into st_varchar_11 using mt_varchar tags (+0.1E+2) values(now, +0.1E+2) +sql show tags from st_varchar_11 +if $data05 != +0.1e+2 then + return -1 +endi +sql select * from st_varchar_11 +if $data01 != +0.1e+2 then + return -1 +endi +sql insert into st_varchar_12 using mt_varchar tags (tRue) values(now, tRue) +sql show tags from st_varchar_12 +if $data05 != true then + return -1 +endi +sql select * from st_varchar_12 +if $data01 != true then + return -1 +endi +sql insert into st_varchar_13 using mt_varchar tags (FalsE) values(now, FalsE) +sql show tags from st_varchar_13 +if $data05 != false then + return -1 +endi +sql select * from st_varchar_13 +if $data01 != false then + return -1 +endi +sql insert into st_varchar_14 using mt_varchar tags (noW) values(now, noW) +sql show tags from st_varchar_14 +if $data05 != now then + return -1 +endi +sql select * from st_varchar_14 +if $data01 != now then + return -1 +endi +sql insert into st_varchar_15 using mt_varchar tags (toDay) values(now, toDay) +sql show tags from st_varchar_15 +if $data05 != today then + return -1 +endi +sql select * from st_varchar_15 +if $data01 != today then + return -1 +endi + +## case 03: alter tag values +sql alter table st_varchar_0 set tag tagname=NULL +sql show tags from st_varchar_0 +if $data05 != NULL then + return -1 +endi +sql alter table st_varchar_1 set tag tagname=NULL +sql show tags from st_varchar_1 +if $data05 != NULL then + return -1 +endi +sql alter table st_varchar_2 set tag tagname='NULL' +sql show tags from st_varchar_2 +if $data05 != NULL then + return -1 +endi +sql alter table st_varchar_3 set tag tagname='NULL' +sql show tags from st_varchar_3 +if $data05 != NULL then + return -1 +endi +sql alter table st_varchar_4 set tag tagname="NULL" +sql show tags from st_varchar_4 +if $data05 != NULL then + return -1 +endi +sql alter table st_varchar_5 set tag tagname="NULL" +sql show tags from st_varchar_5 +if $data05 != NULL then + return -1 +endi +sql alter table st_varchar_6 set tag tagname=+0123 +sql show tags from st_varchar_6 +if $data05 != +0123 then + return -1 +endi +sql alter table st_varchar_7 set tag tagname=-01.23 +sql show tags from st_varchar_7 +if $data05 != -01.23 then + return -1 +endi +sql alter table st_varchar_8 set tag tagname=+0x01 +sql show tags from st_varchar_8 +if $data05 != +0x01 then + return -1 +endi +sql alter table st_varchar_9 set tag tagname=-0b01 +sql show tags from st_varchar_9 +if $data05 != -0b01 then + return -1 +endi +sql alter table st_varchar_10 set tag tagname=-0.1e-10 +sql show tags from st_varchar_10 +if $data05 != -0.1e-10 then + return -1 +endi +sql alter table st_varchar_11 set tag tagname=+0.1E+2 +sql show tags from st_varchar_11 +if $data05 != +0.1e+2 then + return -1 +endi +sql alter table st_varchar_12 set tag tagname=tRue +sql show tags from st_varchar_12 +if $data05 != true then + return -1 +endi +sql alter table st_varchar_13 set tag tagname=FalsE +sql show tags from st_varchar_13 +if $data05 != false then + return -1 +endi +sql alter table st_varchar_14 set tag tagname=noW +sql show tags from st_varchar_14 +if $data05 != now then + return -1 +endi +sql alter table st_varchar_15 set tag tagname=toDay +sql show tags from st_varchar_15 +if $data05 != today then + return -1 +endi + + +# case 04: illegal input + + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/parser/create_mt.sim b/tests/script/tsim/parser/create_mt.sim index dd2a7834c4..57647b3c7e 100644 --- a/tests/script/tsim/parser/create_mt.sim +++ b/tests/script/tsim/parser/create_mt.sim @@ -187,7 +187,7 @@ sql_error create table $tb using $mt tags (abc) sql_error create table $tb using $mt tags ('abc') sql drop table if exists $tb sql reset query cache -sql_error create table $tb using $mt tags (1e1) +sql create table $tb using $mt tags (1e1) sql_error create table $tb using $mt tags ('1e1') sql_error create table $tb using $mt tags (2147483649) diff --git a/tests/script/tsim/parser/null_char.sim b/tests/script/tsim/parser/null_char.sim index 9d476b5227..3bac92334b 100644 --- a/tests/script/tsim/parser/null_char.sim +++ b/tests/script/tsim/parser/null_char.sim @@ -140,7 +140,7 @@ endi ### bool: sql create table stx using mt2 tags ('NULL', '123aBc', 104, '123') -sql create table sty using mt2 tags ('NULL', '123aBc', 104, 'xtz') +sql_error create table sty using mt2 tags ('NULL', '123aBc', 104, 'xtz') sql create table st4 using mt2 tags ('NULL', '123aBc', 104, 'NULL') sql insert into st4 (ts, col1) values(now, 1) sql select tag1,tag2,tag3,tag5 from st4 @@ -156,7 +156,7 @@ endi if $data02 != 104 then return -1 endi -if $data03 != 0 then +if $data03 != NULL then print ==6== expect: NULL, actually: $data03 return -1 endi @@ -182,7 +182,7 @@ endi #### case 2: dynamic create table using super table when insert into sql create table mt3 (ts timestamp, col1 int, col3 float, col5 binary(8), col6 bool, col9 nchar(8)) tags (tag1 binary(8), tag2 nchar(8), tag3 int, tag5 bool) -sql_error insert into st31 using mt3 tags (NULL, 'NULL', 102, 'true') values (now+1s, 31, 31, 'bin_31', '123', 'nchar_31') +sql insert into st31 using mt3 tags (NULL, 'NULL', 102, 'true') values (now+1s, 31, 31, 'bin_31', '123', 'nchar_31') sql_error insert into st32 using mt3 tags (NULL, 'ABC', 103, 'FALSE') values (now+2s, 32, 32.12345, 'bin_32', 'abc', 'nchar_32') sql_error insert into st33 using mt3 tags ('NULL', '123aBc', 104, 'NULL') values (now+3s, 33, 33, 'bin_33', 'false123', 'nchar_33') sql_error insert into st34 using mt3 tags ('NULL', '123aBc', 105, NULL) values (now+4s, 34, 34.12345, 'bin_34', 'true123', 'nchar_34') @@ -306,8 +306,8 @@ if $data02 != NULL then print ==10== expect: NULL, actually: $data02 return -1 endi -sql_error alter table st41 set tag tag_int = 'NULL' -sql alter table st41 set tag tag_int = '' +sql alter table st41 set tag tag_int = 'NULL' +sql_error alter table st41 set tag tag_int = '' sql_error alter table st41 set tag tag_int = abc379 ################### bool @@ -333,8 +333,8 @@ if $data03 != 1 then endi sql alter table st41 set tag tag_bool = 'NULL' sql select tag_binary, tag_nchar, tag_int, tag_bool, tag_float, tag_double from st41 -if $data03 != 0 then - print ==14== expect: 0, actually: $data03 +if $data03 != NULL then + print ==14== expect: NULL, actually: $data03 return -1 endi sql alter table st41 set tag tag_bool = NULL @@ -344,7 +344,7 @@ if $data03 != NULL then endi sql alter table st41 set tag tag_bool = '123' -sql alter table st41 set tag tag_bool = '' +sql_error alter table st41 set tag tag_bool = '' sql_error alter table st41 set tag tag_bool = abc379 ################### float @@ -380,8 +380,8 @@ if $data04 != NULL then endi sql alter table st41 set tag tag_float = 'NULL' sql select tag_binary, tag_nchar, tag_int, tag_bool, tag_float, tag_double from st41 -if $data04 != 0.00000 then - print ==17== expect: 0.00000, actually : $data04 +if $data04 != NULL then + print ==17== expect: NULL, actually : $data04 return -1 endi sql alter table st41 set tag tag_float = '54.123456' @@ -396,10 +396,10 @@ if $data04 != -54.12346 then print ==19== expect: -54.12346, actually : $data04 return -1 endi -sql alter table st41 set tag tag_float = '' +sql_error alter table st41 set tag tag_float = '' -sql alter table st41 set tag tag_float = 'abc' -sql alter table st41 set tag tag_float = '123abc' +sql_error alter table st41 set tag tag_float = 'abc' +sql_error alter table st41 set tag tag_float = '123abc' sql_error alter table st41 set tag tag_float = abc ################### double @@ -428,14 +428,15 @@ if $data05 != NULL then endi sql alter table st41 set tag tag_double = 'NULL' sql select tag_binary, tag_nchar, tag_int, tag_bool, tag_float, tag_double from st41 -if $data05 != 0.000000000 then - print ==20== expect: 0.000000000, actually : $data05 +if $data05 != NULL then + print ==20== expect: NULL, actually : $data05 return -1 endi -sql alter table st41 set tag tag_double = '' -sql alter table st41 set tag tag_double = 'abc' -sql alter table st41 set tag tag_double = '123abc' +sql_error alter table st41 set tag tag_double = '' +sql alter table st41 set tag tag_double = '123' +sql_error alter table st41 set tag tag_double = 'abc' +sql_error alter table st41 set tag tag_double = '123abc' sql_error alter table st41 set tag tag_double = abc ################### bigint smallint tinyint @@ -459,8 +460,8 @@ if $data00 != -9223372036854775807 then endi sql alter table st51 set tag tag_bigint = -9223372036854775808 -sql_error alter table st51 set tag tag_bigint = 'NULL' -sql alter table st51 set tag tag_bigint = '' +sql alter table st51 set tag tag_bigint = 'NULL' +sql_error alter table st51 set tag tag_bigint = '' sql_error alter table st51 set tag tag_bigint = abc379 #### @@ -480,8 +481,8 @@ if $data01 != -32767 then endi sql alter table st51 set tag tag_smallint = -32768 -sql_error alter table st51 set tag tag_smallint = 'NULL' -sql alter table st51 set tag tag_smallint = '' +sql alter table st51 set tag tag_smallint = 'NULL' +sql_error alter table st51 set tag tag_smallint = '' sql_error alter table st51 set tag tag_smallint = abc379 #### @@ -499,8 +500,8 @@ if $data02 != -127 then endi sql alter table st51 set tag tag_tinyint = '-128' sql_error alter table st51 set tag tag_tinyint = 128 -sql_error alter table st51 set tag tag_tinyint = 'NULL' -sql alter table st51 set tag tag_tinyint = '' +sql alter table st51 set tag tag_tinyint = 'NULL' +sql_error alter table st51 set tag tag_tinyint = '' sql_error alter table st51 set tag tag_tinyint = abc379 # test end diff --git a/tests/script/tsim/tag/add.sim b/tests/script/tsim/tag/add.sim index 2b528c0255..0e0755111d 100644 --- a/tests/script/tsim/tag/add.sim +++ b/tests/script/tsim/tag/add.sim @@ -409,7 +409,7 @@ endi if $data03 != 5 then return -1 endi -if $data04 != 0 then +if $data04 != 1 then return -1 endi diff --git a/tests/script/win-test-file b/tests/script/win-test-file index b9f250927f..d51de0a61b 100644 --- a/tests/script/win-test-file +++ b/tests/script/win-test-file @@ -113,6 +113,13 @@ ./test.sh -f tsim/parser/columnValue_smallint.sim ./test.sh -f tsim/parser/columnValue_tinyint.sim ./test.sh -f tsim/parser/columnValue_unsign.sim +./test.sh -f tsim/parser/columnValue_uint.sim +./test.sh -f tsim/parser/columnValue_timestamp.sim +./test.sh -f tsim/parser/columnValue_varchar.sim +./test.sh -f tsim/parser/columnValue_nchar.sim +./test.sh -f tsim/parser/columnValue_varbinary.sim +./test.sh -f tsim/parser/columnValue_json.sim +./test.sh -f tsim/parser/columnValue_geometry.sim ./test.sh -f tsim/parser/condition.sim ./test.sh -f tsim/parser/condition_scl.sim ./test.sh -f tsim/parser/constCol.sim diff --git a/tests/system-test/1-insert/insert_column_value.py b/tests/system-test/1-insert/insert_column_value.py new file mode 100644 index 0000000000..49b77f4199 --- /dev/null +++ b/tests/system-test/1-insert/insert_column_value.py @@ -0,0 +1,353 @@ +import datetime +from enum import Enum +from util.log import * +from util.sql import * +from util.cases import * +from util.common import * +from util.dnodes import * +from util.sqlset import * + + +DBNAME = "db" + +class TDDataType(Enum): + NULL = 0 + BOOL = 1 + TINYINT = 2 + SMALLINT = 3 + INT = 4 + BIGINT = 5 + FLOAT = 6 + DOUBLE = 7 + VARCHAR = 8 + TIMESTAMP = 9 + NCHAR = 10 + UTINYINT = 11 + USMALLINT = 12 + UINT = 13 + UBIGINT = 14 + JSON = 15 + VARBINARY = 16 + DECIMAL = 17 + BLOB = 18 + MEDIUMBLOB = 19 + BINARY = 8 + GEOMETRY = 20 + MAX = 21 + + +class TDTestCase: + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + self.TIMESTAMP_MIN = -1000 + self.TIMESTAMP_BASE = 1706716800 + tdSql.init(conn.cursor()) + tdSql.execute(f'drop database if exists db') + tdSql.execute(f'create database if not exists db vgroups 1') + + def __create_tb(self, dbname="db"): + CREATE_STB_LIST = [ f"create table {dbname}.stb_vc (ts timestamp, c0 binary(50), c1 varchar(50)) tags(t0 varchar(50), t1 binary(50));", + f"create table {dbname}.stb_nc (ts timestamp, c0 nchar(50), c1 nchar(50)) tags(t0 nchar(50), t1 nchar(50));", + f"create table {dbname}.stb_ts (ts timestamp, c0 timestamp, c1 timestamp) tags(t0 timestamp, t1 timestamp);", + f"create table {dbname}.stb_bo (ts timestamp, c0 bool, c1 bool) tags(t0 bool, t1 bool);", + f"create table {dbname}.stb_vb (ts timestamp, c0 varbinary(50), c1 varbinary(50)) tags(t0 varbinary(50), t1 varbinary(50));", + f"create table {dbname}.stb_in (ts timestamp, c0 int, c1 smallint) tags(t0 bigint, t1 tinyint);", + f"create table {dbname}.stb_ui (ts timestamp, c0 int unsigned, c1 smallint unsigned) tags(t0 bigint unsigned, t1 tinyint unsigned);", + f"create table {dbname}.stb_fl (ts timestamp, c0 float, c1 float) tags(t0 float, t1 float);", + f"create table {dbname}.stb_db (ts timestamp, c0 float, c1 float) tags(t0 float, t1 float);", + f"create table {dbname}.stb_ge (ts timestamp, c0 geometry(512), c1 geometry(512)) tags(t0 geometry(512), t1 geometry(512));", + f"create table {dbname}.stb_js (ts timestamp, c0 int) tags(t0 json);" ] + for _stb in CREATE_STB_LIST: + tdSql.execute(_stb) + tdSql.query(f'show {dbname}.stables') + tdSql.checkRows(len(CREATE_STB_LIST)) + + def _query_check_varchar(self, result, okv, nv, row = 0, col = 0): + for i in range(row): + for j in range(1, col): + check_result = False + check_item = result[i][j] + if result[i][j] == None: + check_item = 'null' + if check_item == okv or check_item == nv: + check_result = True + if check_result == False and (okv[0:1] == '\'' or okv[0:1] == '\"'): + if check_item == okv[1:-1]: + check_result = True + if check_result == False and (nv[0:1] == '\'' or nv[0:1] == '\"'): + if check_item == nv[1:-1]: + check_result = True + if check_result == False: + if check_item == nv.strip().lower(): + check_result = True + tdSql.checkEqual(check_result, True) + + def _query_check_int(self, result, okv, nv, row = 0, col = 0): + for i in range(row): + for j in range(1, col): + check_result = False + check_item = result[i][j] + if result[i][j] == None: + check_item = 'null' + if check_item == okv or check_item == nv: + check_result = True + if check_item == nv.strip().lower(): + check_result = True + if check_result == False and (okv.find('1') != -1 or okv.find('2') != -1): + if check_item != 0: + check_result = True + if check_result == False and (nv.find('1') != -1 or nv.find('2') != -1): + if check_item != 0: + check_result = True + if check_item == 0: + check_result = True + tdSql.checkEqual(check_result, True) + + def _query_check_bool(self, result, okv, nv, row = 0, col = 0): + for i in range(row): + for j in range(1, col): + check_result = False + check_item = result[i][j] + if result[i][j] == None: + check_item = 'null' + elif result[i][j] == True: + check_item = "true" + else: + check_item = "false" + if check_item == okv.strip().lower() or check_item == nv.strip().lower(): + check_result = True + if check_result == False and (nv[0:1] == '\'' or nv[0:1] == '\"'): + if check_item == nv[1:-1].strip().lower(): + check_result = True + if check_result == False and (nv.find('1') != -1 or nv.find('2') != -1): # char 1 or 2 exist for non-zero values + if check_item == "true": + check_result = True + else: + if check_item == "false": + check_result = True + tdSql.checkEqual(check_result, True) + + def _query_check_timestamp(self, result, okv, nv, row = 0, col = 0): + for i in range(row): + for j in range(1, col): + check_result = False + check_item = result[i][j] + if result[i][j] == None: + check_item = 'null' + if nv.lower().find(check_item) != -1: + check_result = True + else: + check_item = int(result[i][j].timestamp()) + if check_result == False and nv.lower().find("now") != -1 or nv.lower().find("today") != -1 or nv.lower().find("now") != -1 or nv.lower().find("today") != -1: + if check_item > self.TIMESTAMP_BASE: + check_result = True + if check_result == False and check_item > self.TIMESTAMP_MIN: + check_result = True + tdSql.checkEqual(check_result, True) + + + def _query_check(self, dbname="db", stbname="", ctbname="", nRows = 0, okv = None, nv = None, dtype = TDDataType.NULL): + result = None + if dtype != TDDataType.GEOMETRY: # geometry query by py connector need to be supported + tdSql.query(f'select * from {dbname}.{stbname}') + tdSql.checkRows(nRows) + result = tdSql.queryResult + + if dtype == TDDataType.VARCHAR or dtype == TDDataType.NCHAR: + self._query_check_varchar(result, okv, nv, nRows, 4) + elif dtype == TDDataType.TIMESTAMP: + self._query_check_timestamp(result, okv, nv, nRows, 4) + elif dtype == TDDataType.BOOL: + self._query_check_bool(result, okv, nv, nRows, 4) + elif dtype == TDDataType.VARBINARY: + pass + elif dtype == TDDataType.INT: + self._query_check_int(result, okv, nv, nRows, 4) + elif dtype == TDDataType.UINT: + self._query_check_int(result, okv, nv, nRows, 4) + elif dtype == TDDataType.FLOAT or dtype == TDDataType.DOUBLE: + self._query_check_int(result, okv, nv, nRows, 4) + elif dtype == TDDataType.GEOMETRY: + pass + else: + tdLog.info(f"unknown data type %s" % (dtype)) + + if ctbname != "": + tdSql.execute(f'drop table {dbname}.{ctbname}') + + def __insert_query_common(self, dbname="db", stbname="", ctbname="", oklist=[], kolist=[], okv=None, dtype = TDDataType.NULL): + tdLog.info(f'{dbname}.{stbname} {ctbname}, oklist:%d, kolist:%d'%(len(oklist), len(kolist))) + tdSql.checkEqual(34, len(oklist) + len(kolist)) + + for _l in kolist: + for _e in _l: + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv})' %(_e)) + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, %s)' %(_e)) + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, %s)' %(_e, _e)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, %s) values(now, {okv}, {okv})' %(_e)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv}) values(now, {okv}, {okv})' %(_e)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, %s, {okv})' %(_e)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, {okv}, %s)' %(_e)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, %s, %s)' %(_e, _e)) + tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, {okv}, {okv})') + self._query_check(dbname,stbname, "", 1, okv, _e, dtype) + tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = {okv}') + tdSql.error(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e)) + tdSql.error(f'alter table {dbname}.{ctbname} set tag t1 = %s' %(_e)) + tdSql.execute(f'drop table {dbname}.{ctbname}') + for _l in oklist: + for _e in _l: + tdLog.info(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv})' %(_e)) + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv})' %(_e)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now + 0s, %s, {okv})' %(_e)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now + 1s, {okv}, %s)' %(_e)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now + 2s, %s, %s)' %(_e, _e)) + tdLog.info(f'insert into {dbname}.{ctbname} values(now + 0s, %s, {okv})' %(_e)) + tdLog.info(f'insert into {dbname}.{ctbname} values(now + 1s, {okv}, %s)' %(_e)) + tdLog.info(f'insert into {dbname}.{ctbname} values(now + 2s, %s, %s)' %(_e, _e)) + tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e)) + tdSql.execute(f'alter table {dbname}.{ctbname} set tag t1 = %s' %(_e)) + self._query_check(dbname,stbname, ctbname, 3, okv, _e, dtype) + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, %s)' %(_e, _e)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now, %s, %s)' %(_e, _e)) + self._query_check(dbname,stbname, ctbname, 1, okv, _e, dtype) + tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv}) values(now, %s, {okv})' %(_e, _e)) + self._query_check(dbname,stbname, ctbname, 1, okv, _e, dtype) + tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, %s) values(now, {okv}, %s)' %(_e, _e)) + self._query_check(dbname,stbname, ctbname, 1, okv, _e, dtype) + tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, %s) values(now, %s, %s)' %(_e, _e, _e, _e)) + self._query_check(dbname,stbname, ctbname, 1, okv, _e, dtype) + + def __insert_query_json(self, dbname="db", stbname="", ctbname="", oklist=[], kolist=[], okv=None): + tdLog.info(f'{dbname}.{stbname} {ctbname}, oklist:%d, kolist:%d'%(len(oklist), len(kolist))) + tdSql.checkEqual(34, len(oklist) + len(kolist)) + + for _l in kolist: + for _e in _l: + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s)' %(_e)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s) values(now, 1)' %(_e)) + tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}) values(now, 1)') + tdSql.query(f'select * from {dbname}.{stbname}') + tdSql.checkRows(1) + tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = {okv}') + tdSql.error(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e)) + tdSql.execute(f'drop table {dbname}.{ctbname}') + for _l in oklist: + for _e in _l: + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s)' %(_e)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now, 1)') + tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e)) + tdSql.query(f'select * from {dbname}.{stbname}') + tdSql.checkRows(1) + tdSql.execute(f'drop table {dbname}.{ctbname}') + + def __insert_query_exec(self): + STR_EMPTY = ['\'\'', "\"\"", '\' \'', "\" \""] + STR_INTEGER_P = ["\"42\"", '\'+42\'', '\'+0\'', '\'-0\'', '\'0x2A\'', '\'-0X0\'', '\'+0x0\'', '\'0B00101010\'', '\'-0b00\''] + STR_INTEGER_M = ['\'-128\'', '\'-0X1\'', '\"-0x34\"', '\'-0b01\'', '\'-0B00101010\''] + STR_FLOAT_P = ['\'42.1\'', "\"+0.003\"", "\'-0.0\'"] + STR_FLOAT_M = ["\"-32.001\""] + STR_FLOAT_E_P = ['\'1e1\'', "\"3e-2\"", "\"-3e-5\""] + STR_FLOAT_E_M = ["\"-0.3E+1\""] + STR_MISC = ["\"123ab\"", '\'123d\'', '\'-12s\'', '\'\x012\'', '\'x12\'', '\'x\'', '\'NULL \'', '\' NULL\'', '\'True \'', '\' False\'', + '\'0B0101 \'', '\' 0B0101\'', '\' -0x01 \'', '\'-0x02 \''] + STR_OPTR = ['\'1*10\'', '\'1+2\'', '\'-2-0\'','\'1%2\'', '\'2/0\'', '\'1&31\''] + STR_TSK = ['\'now\'', '\'today\''] + STR_TSK_MISC = ['\'now+1s\'', '\' now\'', '\'today \'', '\'today+1m\'', '\'today-1w\''] + STR_TSKP = ['\'now()\'', '\'today()\''] + STR_TSKP_MISC = ['\'now()+1s\'', '\' now()\'', '\'now( )\'', '\'today() \'', '\'today())\'', '\'today()+1m\'', '\'today()-1w\''] + STR_BOOL = ['\'true\'', '\'false\'', '\'TRUE\'', '\'FALSE\'', '\'tRuE\'', '\'falsE\''] + STR_TS = ["\"2024-02-01 00:00:01.001-08:00\"", "\'2024-02-01T00:00:01.001+09:00\'", "\"2024-02-01\"", "\'2024-02-02 00:00:01\'", "\'2024-02-02 00:00:01.009\'"] + STR_VARBIN = ['\'\\x12\'', '\'\\x13\'', '\' \\x14 \'', '\'\\x12ab\''] + STR_JSON_O = ['\'{\"k1\":\"v1\"}\'', '\' {} \''] + STR_JSON_A = ['\'[]\''] + STR_GEO = ['\' POINT(1.0 1.0)\'', '\'LINESTRING(1.00 +2.0, 2.1 -3.2, 5.00 5.01) \'', '\'POLYGON((1.0 1.0, -2.0 +2.0, 1.0 1.0))\'' ] + STR_NULL = ['\'NuLl\'', '\'null\'', '\'NULL\''] + + RAW_INTEGER_P = [' 42 ', '+042 ', ' +0', '0 ', '-0', '0', ' 0X2A', ' -0x0 ', '+0x0 ', ' 0B00101010', ' -0b00'] + RAW_INTEGER_M = [' -42 ', ' -0128',' -0x1', ' -0X2A', '-0b01 ', ' -0B00101010 '] + RAW_FLOAT_P = [' 123.012', ' 0.0', ' +0.0', ' -0.0 '] + RAW_FLOAT_M = ['-128.001 '] + RAW_FLOAT_E_P = [' 1e-100', ' +0.1E+2', ' -0.1E-10'] + RAW_FLOAT_E_M = [" -1E2 "] + RAW_MISC = ['123abc', "123c", '-123d', '+', '-', ' *', ' /', '% ', '&', "|", "^", "&&", "||", "!", " =", ' None ', 'NONE', 'now+1 s', 'now-1','now-1y','now+2 d', + 'today+1 s', 'today-1','today-1y','today+2 d', 'now()+1 s', 'now()-1','now()-1y','now()+2 d', 'today()+1 s', 'today()-1','today()-1y','today()+2 d'] + RAW_OPTR = ['1*10', '1+2', '-2-0','1%2', '2/0', '1&31'] + RAW_TSK = [' now ', 'today '] + RAW_TSK_OPTR = [' now +1s', 'today + 2d'] + RAW_TSKP = ['now( ) ', ' toDay() '] + RAW_TSKP_OPTR = [' noW ( ) + 1s', 'nOw( ) + 2D', 'NOW () + 000s', ' today()+1M', 'today( ) - 1w ', 'TodaY ( ) - 1U '] + RAW_BOOL = ['true', 'false', ' TRUE ', 'FALSE ', ' tRuE', ' falsE '] + RAW_NULL = ['NuLl', 'null ', ' NULL', ' NULL '] + + OK_VC = [STR_EMPTY, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, + STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, STR_NULL, RAW_INTEGER_P, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, + RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_TSK, RAW_BOOL, RAW_NULL] + KO_VC = [RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + OK_NC = OK_VC + KO_NC = KO_VC + OK_TS = [STR_TSK, STR_INTEGER_P, STR_INTEGER_M, STR_TSKP, STR_TS, STR_NULL, RAW_INTEGER_P, RAW_INTEGER_M, RAW_TSK, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, RAW_NULL] + KO_TS = [STR_EMPTY, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_MISC, STR_OPTR, STR_TSK_MISC, STR_TSKP_MISC, STR_BOOL, STR_VARBIN, + STR_JSON_O, STR_JSON_A, STR_GEO, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_MISC, RAW_OPTR, RAW_BOOL] + OK_BO = [STR_BOOL, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M,RAW_BOOL, STR_NULL, RAW_INTEGER_P, RAW_INTEGER_M, + RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_NULL] + KO_BO = [STR_EMPTY, STR_TSK, STR_TSKP, STR_TS, STR_MISC, STR_OPTR, STR_TSK_MISC, STR_TSKP_MISC, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, + RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, RAW_MISC, RAW_OPTR] + OK_VB = [STR_EMPTY, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, + STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, STR_NULL, RAW_NULL] + KO_VB = [RAW_INTEGER_P, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_TSK, RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + OK_IN = [STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_NULL, RAW_INTEGER_P, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, + RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_NULL] + KO_IN = [STR_EMPTY, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, + RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + OK_UI = [STR_INTEGER_P, STR_FLOAT_P, STR_FLOAT_E_P, STR_NULL, RAW_INTEGER_P, RAW_FLOAT_P, RAW_FLOAT_E_P, RAW_NULL] + KO_UI = [STR_EMPTY, STR_MISC, STR_INTEGER_M, STR_FLOAT_M, STR_FLOAT_E_M, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, + STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, RAW_BOOL, RAW_INTEGER_M, RAW_FLOAT_M, RAW_FLOAT_E_M, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + OK_FL = [RAW_INTEGER_P, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_NULL, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, + RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_NULL] + KO_FL = [STR_EMPTY, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, + RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + OK_DB = OK_FL + KO_DB = KO_FL + OK_GE = [STR_GEO, STR_NULL, RAW_NULL] + KO_GE = [STR_EMPTY, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_JSON_O, STR_JSON_A, STR_VARBIN, RAW_TSK, RAW_BOOL, RAW_MISC, + RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, RAW_INTEGER_P, RAW_INTEGER_M, + RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M] + OK_JS = [STR_EMPTY, STR_JSON_O, STR_NULL, RAW_NULL] + KO_JS = [STR_JSON_A, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_GEO, STR_VARBIN, RAW_TSK, RAW_BOOL, RAW_MISC, RAW_OPTR, + RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, RAW_INTEGER_P, RAW_INTEGER_M, + RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M] + + PARAM_LIST = [ + ["db", "stb_vc", "ctb_vc", OK_VC, KO_VC, "\'vc\'", TDDataType.VARCHAR], + ["db", "stb_nc", "ctb_nc", OK_NC, KO_NC, "\'nc\'", TDDataType.NCHAR], + ["db", "stb_ts", "ctb_ts", OK_TS, KO_TS, "now", TDDataType.TIMESTAMP], + ["db", "stb_bo", "ctb_bo", OK_BO, KO_BO, "true", TDDataType.BOOL], + ["db", "stb_vb", "ctb_vb", OK_VB, KO_VB, "\'\\x12\'", TDDataType.VARBINARY], + ["db", "stb_in", "ctb_in", OK_IN, KO_IN, "-1", TDDataType.UINT], + ["db", "stb_ui", "ctb_ui", OK_UI, KO_UI, "1", TDDataType.UINT], + ["db", "stb_fl", "ctb_fl", OK_FL, KO_FL, "1.0", TDDataType.FLOAT], + ["db", "stb_db", "ctb_db", OK_DB, KO_DB, "1.0", TDDataType.DOUBLE], + ["db", "stb_ge", "ctb_ge", OK_GE, KO_GE, "\'POINT(1.0 1.0)\'", TDDataType.GEOMETRY] + ] + + # check with common function + for _pl in PARAM_LIST: + self.__insert_query_common(_pl[0], _pl[1], _pl[2], _pl[3], _pl[4], _pl[5], _pl[6]) + # check json + self.__insert_query_json("db", "stb_js", "ctb_js", OK_JS, KO_JS, "\'{\"k1\":\"v1\",\"k2\":\"v2\"}\'") + + + def run(self): + tdLog.printNoPrefix("==========step1:create table") + self.__create_tb() + self.__insert_query_exec() + + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/2-query/count_partition.py b/tests/system-test/2-query/count_partition.py index e970b00cec..3077f5bb13 100644 --- a/tests/system-test/2-query/count_partition.py +++ b/tests/system-test/2-query/count_partition.py @@ -22,7 +22,7 @@ class TDTestCase: for i in range(tb_nums): tbname = f"{dbname}.sub_{stb_name}_{i}" ts = self.ts + i*10000 - tdSql.execute(f"create table {tbname} using {dbname}.{stb_name} tags ({ts} , {i} , {i}*10 ,{i}*1.0,{i}*1.0 , 1 , 2, 'true', 'binary_{i}' ,'nchar_{i}',{i},{i},10,20 )") + tdSql.execute(f"create table {tbname} using {dbname}.{stb_name} tags ({ts} , {i} , %d , %f , %f , 1 , 2, 'true', 'binary_{i}' ,'nchar_{i}',{i},{i},10,20 )"%(i*10,i*1.0,i*1.0)) for row in range(row_nums): ts = self.ts + row*1000 diff --git a/tests/system-test/2-query/group_partition.py b/tests/system-test/2-query/group_partition.py index a20b124c33..36e3afd3ca 100644 --- a/tests/system-test/2-query/group_partition.py +++ b/tests/system-test/2-query/group_partition.py @@ -24,7 +24,7 @@ class TDTestCase: for i in range(self.tb_nums): tbname = f"{self.dbname}.sub_{self.stable}_{i}" ts = self.ts + i*10000 - tdSql.execute(f"create table {tbname} using {self.dbname}.{self.stable} tags ({ts} , {i} , {i}*10 ,{i}*1.0,{i}*1.0 , 1 , 2, 'true', 'binary_{i}' ,'nchar_{i}',{i},{i},10,20 )") + tdSql.execute(f"create table {tbname} using {self.dbname}.{self.stable} tags ({ts} , {i} , %d ,%d , %f , 1 , 2, 'true', 'binary_{i}' ,'nchar_{i}',{i},{i},10,20 )"%(i*10,i*1.0,i*1.0)) def insert_db(self, tb_nums, row_nums): for i in range(tb_nums): diff --git a/tests/system-test/2-query/max_partition.py b/tests/system-test/2-query/max_partition.py index fbd3488aab..7e43597948 100644 --- a/tests/system-test/2-query/max_partition.py +++ b/tests/system-test/2-query/max_partition.py @@ -21,7 +21,7 @@ class TDTestCase: for i in range(tb_nums): tbname = f"{dbname}.sub_{stb_name}_{i}" ts = self.ts + i*1000*120 - tdSql.execute(f"create table {tbname} using {dbname}.{stb_name} tags ({ts} , {i} , {i}*10 ,{i}*1.0,{i}*1.0 , 1 , 2, 'true', 'binary_{i}' ,'nchar_{i}',{i},{i},10,20 )") + tdSql.execute(f"create table {tbname} using {dbname}.{stb_name} tags ({ts} , {i} , %d , %f , %f , 1 , 2, 'true', 'binary_{i}' ,'nchar_{i}',{i},{i},10,20 )"%(i*10,i*1.0,i*1.0)) for row in range(row_nums): ts = ts + row*1000 diff --git a/tests/system-test/2-query/tagFilter.py b/tests/system-test/2-query/tagFilter.py index b03776c31b..a8106a7051 100644 --- a/tests/system-test/2-query/tagFilter.py +++ b/tests/system-test/2-query/tagFilter.py @@ -1,3 +1,4 @@ +import datetime from util.log import * from util.sql import * from util.cases import * @@ -52,6 +53,202 @@ class TDTestCase: ) tdSql.checkRows(0) + def __ts4421(self, dbname="db", stbname='stb4421', ctbname='ctb4421'): + TAG_BIND = [True, False] + TAG_TYPE = ['varchar', 'nchar'] + TAG_LEN = [2, 8, 200] + TAG_VAL_INT = [0, -200, 123456789] + TAG_VAL_STR = ["noW()", "now", "'now'", "todAy()", "today", "\"today\"" ] + TAG_VAL_BOOL_INT = [ -1, 1, 0, -0] + TAG_VAL_BOOL_STR = ["TrUe", "\"true\"","fALse", "'FALSE'"] + TAG_VAL_TIMESTAMP = ["now()", "NoW", "'now'", "\"now()\"", "toDay()", "toDaY", "'today'", "\"today()\"", "\"2200-01-01 08:00:00\"", "'2200-01-02'","\"2200-01-02T00:00:00.000Z\"", "'2200-01-02T00:00:00.000'", "2200-01-01 08:00:00", "\"2200-01-02'", "2200-01-02T00:00:00.000Z"] + TAG_RESULT_INT = [True,False,False,True,True,False,True,True,True,True,False,False,True,True,False,True,True,True] + TAG_RESULT_STR = [False,False,False,False,False,False,False,True,True,False,True,True,False,True,True,False,True,True,False,False,False,False,False,False,False,True,True,False,True,True,False,True,True,False,True,True] + TAG_RESULT_BOOL = ["True","True","False","False"] + TAG_RESULT_TIMESTAMP = [True, True, True, True, True, True, True, True, True, True, True, True, False, False, False] + + # check int for vartype(one tag) + nTagCtb = 0 + for tagType in TAG_TYPE: + for tagLen in TAG_LEN: + tdSql.execute(f'create stable {dbname}.{stbname}(ts timestamp, f1 int) tags(t1 %s(%d))'%(tagType,tagLen)) + for tagVal in TAG_VAL_INT: + for tagBind in TAG_BIND: + if tagBind == True: + bindStr = "(t1)" + else: + bindStr = "" + tdLog.info(f'nTagCtb={nTagCtb}, tagType={tagType}, tagLen = {tagLen}, tagVal = {tagVal}, tagBind={tagBind}') + if TAG_RESULT_INT[nTagCtb] == False: + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%d)'%(bindStr,tagVal)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%d) values(now,1)'%(bindStr,tagVal)) + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags("%d")'%(bindStr,tagVal)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} %s tags("%d") values(now,1)'%(bindStr,tagVal)) + tdSql.error(f"create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags('%d')"%(bindStr,tagVal)) + tdSql.error(f"insert into {dbname}.{ctbname} using {dbname}.{stbname} %s tags('%d') values(now,1)"%(bindStr,tagVal)) + else: + # integer as tag value + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%d)'%(bindStr,tagVal)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now,1)') + tdSql.execute(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags(%d) values(now,1)'%(bindStr,tagVal)) + tdSql.query(f'select * from {dbname}.{stbname} where t1="%d"'%(tagVal)) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + # string as tag value + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags("%d")'%(bindStr,tagVal)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now,1)') + tdSql.execute(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags("%d") values(now,1)'%(bindStr,tagVal)) + tdSql.query(f'select * from {dbname}.{stbname} where t1="%d"'%(tagVal)) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + tdSql.execute(f"create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags('%d')"%(bindStr,tagVal)) + tdSql.execute(f"insert into {dbname}.{ctbname} values(now,1)") + tdSql.execute(f"insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags('%d') values(now,1)"%(bindStr,tagVal)) + tdSql.query(f"select * from {dbname}.{stbname} where t1='%d'"%(tagVal)) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + nTagCtb += 1 + tdSql.execute(f'drop table {dbname}.{stbname}') + + # check int for vartype(two tags/bind tags) + nTagCtb = 0 + for tagType in TAG_TYPE: + for tagLen in TAG_LEN: + tdSql.execute(f'create stable {dbname}.{stbname}(ts timestamp, f1 int) tags(t1 %s(%d),t2 %s(%d) )'%(tagType,tagLen,tagType,tagLen)) + for tagVal in TAG_VAL_INT: + for tagBind in TAG_BIND: + if tagBind == True: + bindStr = "(t1,t2)" + else: + bindStr = "" + if TAG_RESULT_INT[nTagCtb] == False: + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%d,%d)'%(bindStr,tagVal,tagVal)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%d,%d) values(now,1)'%(bindStr,tagVal,tagVal)) + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags("%d","%d")'%(bindStr,tagVal,tagVal)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} %s tags("%d","%d") values(now,1)'%(bindStr,tagVal,tagVal)) + tdSql.error(f"create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags('%d','%d')"%(bindStr,tagVal,tagVal)) + tdSql.error(f"insert into {dbname}.{ctbname} using {dbname}.{stbname} %s tags('%d','%d') values(now,1)"%(bindStr,tagVal,tagVal)) + else: + # integer as tag value + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%d,%d)'%(bindStr,tagVal,tagVal)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now,1)') + tdSql.execute(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags(%d,%d) values(now,1)'%(bindStr,tagVal,tagVal)) + tdSql.query(f"select * from {dbname}.{stbname} where t1='%d' and t2='%d'"%(tagVal,tagVal)) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + # string as tag value + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags("%d","%d")'%(bindStr,tagVal,tagVal)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now,1)') + tdSql.execute(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags("%d","%d") values(now,1)'%(bindStr,tagVal,tagVal)) + tdSql.query(f'select * from {dbname}.{stbname} where t1="%d" and t2="%d"'%(tagVal,tagVal)) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + tdSql.execute(f"create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags('%d','%d')"%(bindStr,tagVal,tagVal)) + tdSql.execute(f"insert into {dbname}.{ctbname} values(now,1)") + tdSql.execute(f"insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags('%d','%d') values(now,1)"%(bindStr,tagVal,tagVal)) + tdSql.query(f"select * from {dbname}.{stbname} where t1='%d' and t2='%d'"%(tagVal,tagVal)) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + nTagCtb += 1 + tdSql.execute(f'drop table {dbname}.{stbname}') + + # check now/today for vartype + nTagCtb = 0 + for tagType in TAG_TYPE: + for tagLen in TAG_LEN: + tdSql.execute(f'create stable {dbname}.{stbname}(ts timestamp, f1 int) tags(t1 %s(%d))'%(tagType,tagLen)) + for tagVal in TAG_VAL_STR: + for tagBind in TAG_BIND: + if tagBind == True: + bindStr = "(t1)" + else: + bindStr = "" + if TAG_RESULT_STR[nTagCtb] == False: + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%s)'%(bindStr,tagVal)) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%s) values(now,1)'%(bindStr,tagVal)) + else: + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%s)'%(bindStr,tagVal)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now,1)') + tdSql.execute(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags(%s) values(now,1)'%(bindStr,tagVal)) + if tagVal.startswith("'") or tagVal.startswith("\""): + tdSql.query(f'select * from {dbname}.{stbname} where t1=%s'%(tagVal)) + else: + tdSql.query(f'select * from {dbname}.{stbname} where t1=\"%s\"'%(tagVal)) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + nTagCtb += 1 + tdSql.execute(f'drop table {dbname}.{stbname}') + + # check int for bool + nTagCtb = 0 + tdSql.execute(f'create stable {dbname}.{stbname}(ts timestamp, f1 int) tags(t1 bool)') + for tagVal in TAG_VAL_BOOL_INT: + for tagBind in TAG_BIND: + if tagBind == True: + bindStr = "(t1)" + else: + bindStr = "" + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%d)'%(bindStr,tagVal)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now,1)') + tdSql.execute(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags(%d) values(now,1)'%(bindStr,tagVal)) + tdSql.query(f'select * from {dbname}.{stbname} where t1=%s'%(TAG_RESULT_BOOL[nTagCtb])) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + nTagCtb += 1 + tdSql.execute(f'drop table {dbname}.{stbname}') + + # check str for bool + nTagCtb = 0 + tdSql.execute(f'create stable {dbname}.{stbname}(ts timestamp, f1 int) tags(t1 bool)') + for tagVal in TAG_VAL_BOOL_STR: + for tagBind in TAG_BIND: + if tagBind == True: + bindStr = "(t1)" + else: + bindStr = "" + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%s)'%(bindStr,tagVal)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now,1)') + tdSql.execute(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags(%s) values(now,1)'%(bindStr,tagVal)) + tdSql.query(f'select * from {dbname}.{stbname} where t1=%s'%(TAG_RESULT_BOOL[nTagCtb])) + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + nTagCtb += 1 + tdSql.execute(f'drop table {dbname}.{stbname}') + + # check misc for timestamp + nTagCtb = 0 + tdSql.execute(f'create stable {dbname}.{stbname}(ts timestamp, f1 int) tags(t1 timestamp)') + checkTS = datetime.datetime.today() - datetime.timedelta(days=1) + for tagVal in TAG_VAL_TIMESTAMP: + for tagBind in TAG_BIND: + if tagBind == True: + bindStr = "(t1)" + else: + bindStr = "" + if TAG_RESULT_TIMESTAMP[nTagCtb] == False: + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%s)'%(bindStr,tagVal)) + tdSql.error(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags(%s) values(now,1)'%(bindStr,tagVal)) + else: + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} %s tags(%s)'%(bindStr,tagVal)) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now,1)') + tdSql.execute(f'insert into {dbname}.{ctbname}t using {dbname}.{stbname} %s tags(%s) values(now,1)'%(bindStr,tagVal)) + tdSql.query(f'select * from {dbname}.{stbname} where t1>"{checkTS}"') + tdSql.checkRows(2) + tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'drop table {dbname}.{ctbname}t') + nTagCtb += 1 + tdSql.execute(f'drop table {dbname}.{stbname}') + + def run(self): tdLog.printNoPrefix("==========step1:create table") self.__create_tb() @@ -59,9 +256,12 @@ class TDTestCase: tdLog.printNoPrefix("==========step2:query data") self.__query_data(10) + tdLog.printNoPrefix("==========step3:check ts4421") + self.__ts4421() + def stop(self): tdSql.close() tdLog.success(f"{__file__} successfully executed") tdCases.addLinux(__file__, TDTestCase()) -tdCases.addWindows(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/system-test/2-query/tsbsQuery.py b/tests/system-test/2-query/tsbsQuery.py index 5a49f653ec..60e710e4f1 100644 --- a/tests/system-test/2-query/tsbsQuery.py +++ b/tests/system-test/2-query/tsbsQuery.py @@ -33,7 +33,7 @@ class TDTestCase: for i in range(ctbNum): tagValue = 'beijing' if (i % 10 == 0): - sql += f" {dbName}.%s%d using %s (name,fleet,driver,device_version,load_capacity,fuel_capacity,nominal_fuel_consumption) tags('truck_%d', 'South%d','Trish%d','v2.%d', 1500+%d*20, 150+%d*2, 5+%d)"%(ctbPrefix,i,stbName,i,i,i,i,(1500+i*20),(150+i*2),(5+i)) + sql += f" {dbName}.%s%d using %s (name,fleet,driver,device_version,load_capacity,fuel_capacity,nominal_fuel_consumption) tags('truck_%d', 'South%d','Trish%d','v2.%d', %d, %d, %d)"%(ctbPrefix,i,stbName,i,i,i,i,1500+(1500+i*20)*20,150+(150+i*2)*2,5+(5+i)) else: model = 'H-%d'%i sql += f" {dbName}.%s%d using %s tags('truck_%d', 'South%d','Trish%d','%s','v2.%d', %d, %d,%d)"%(ctbPrefix,i,stbName,i,i,i,model,i,(1500+i*20),(150+i*2),(5+i)) diff --git a/tests/system-test/7-tmq/tmq_taosx.py b/tests/system-test/7-tmq/tmq_taosx.py index 0330454b73..94e9babf3c 100644 --- a/tests/system-test/7-tmq/tmq_taosx.py +++ b/tests/system-test/7-tmq/tmq_taosx.py @@ -16,6 +16,7 @@ sys.path.append("./7-tmq") from tmqCommon import * class TDTestCase: + updatecfgDict = {'debugFlag': 135, 'asynclog': 0} def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) tdLog.debug(f"start to excute {__file__}") diff --git a/tests/system-test/7-tmq/tmq_ts4563.py b/tests/system-test/7-tmq/tmq_ts4563.py new file mode 100644 index 0000000000..fc1cc259ce --- /dev/null +++ b/tests/system-test/7-tmq/tmq_ts4563.py @@ -0,0 +1,149 @@ + +import taos +import sys +import time +import socket +import os +import threading + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import * +from util.common import * +from taos.tmq import * +from taos import * + +sys.path.append("./7-tmq") +from tmqCommon import * + +class TDTestCase: + updatecfgDict = {'debugFlag': 143, 'asynclog': 0} + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor()) + #tdSql.init(conn.cursor(), logSql) # output sql.txt file + + def consumeTest_TS_4563(self): + tdSql.execute(f'use db_stmt') + + tdSql.query("select ts,k from st") + tdSql.checkRows(2) + + tdSql.execute(f'create topic t_unorder_data as select ts,k from st') + consumer_dict = { + "group.id": "g1", + "td.connect.user": "root", + "td.connect.pass": "taosdata", + "auto.offset.reset": "earliest", + } + consumer = Consumer(consumer_dict) + + try: + consumer.subscribe(["t_unorder_data"]) + except TmqError: + tdLog.exit(f"subscribe error") + + cnt = 0 + try: + while True: + res = consumer.poll(1) + print(res) + if not res: + if cnt == 0: + tdLog.exit("consume error") + break + val = res.value() + if val is None: + continue + for block in val: + cnt += len(block.fetchall()) + + if cnt != 2: + tdLog.exit("consume error") + + finally: + consumer.close() + + def getBuildPath(self): + selfPath = os.path.dirname(os.path.realpath(__file__)) + + if ("community" in selfPath): + projPath = selfPath[:selfPath.find("community")] + else: + projPath = selfPath[:selfPath.find("tests")] + + for root, dirs, files in os.walk(projPath): + if ("taosd" in files or "taosd.exe" in files): + rootRealPath = os.path.dirname(os.path.realpath(root)) + if ("packaging" not in rootRealPath): + buildPath = root[:len(root)-len("/build/bin")] + break + return buildPath + + def newcon(self,host,cfg): + user = "root" + password = "taosdata" + port =6030 + con=taos.connect(host=host, user=user, password=password, config=cfg ,port=port) + print(con) + return con + + def test_stmt_insert_multi(self,conn): + # type: (TaosConnection) -> None + + dbname = "db_stmt" + try: + conn.execute("drop database if exists %s" % dbname) + conn.execute("create database if not exists %s" % dbname) + conn.select_db(dbname) + + conn.execute( + "create table st(ts timestamp, i int, j int, k int)", + ) + # conn.load_table_info("log") + tdLog.debug("statement start") + start = datetime.now() + stmt = conn.statement("insert into st(ts,j) values(?, ?)") + + params = new_multi_binds(2) + params[0].timestamp((1626861392589, 1626861392590)) + params[1].int([3, None]) + + # print(type(stmt)) + tdLog.debug("bind_param_batch start") + stmt.bind_param_batch(params) + tdLog.debug("bind_param_batch end") + stmt.execute() + tdLog.debug("execute end") + end = datetime.now() + print("elapsed time: ", end - start) + assert stmt.affected_rows == 2 + tdLog.debug("close start") + + stmt.close() + + # conn.execute("drop database if exists %s" % dbname) + conn.close() + + except Exception as err: + # conn.execute("drop database if exists %s" % dbname) + conn.close() + raise err + + def run(self): + buildPath = self.getBuildPath() + config = buildPath+ "../sim/dnode1/cfg/" + host="localhost" + connectstmt=self.newcon(host,config) + self.test_stmt_insert_multi(connectstmt) + self.consumeTest_TS_4563() + + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/runAllOne.sh b/tests/system-test/runAllOne.sh index 6d4c80c388..099ae1bbd3 100644 --- a/tests/system-test/runAllOne.sh +++ b/tests/system-test/runAllOne.sh @@ -22,6 +22,7 @@ python3 ./test.py -f 1-insert/update_data_muti_rows.py -P python3 ./test.py -f 1-insert/db_tb_name_check.py -P python3 ./test.py -f 1-insert/InsertFuturets.py -P python3 ./test.py -f 1-insert/insert_wide_column.py -P +python3 ./test.py -f 1-insert/insert_column_value.py python3 ./test.py -f 2-query/nestedQuery.py -P python3 ./test.py -f 2-query/nestedQuery_str.py -P python3 ./test.py -f 2-query/nestedQuery_math.py -P diff --git a/tests/system-test/win-test-file b/tests/system-test/win-test-file index 1ab0fee7bf..96f9452827 100644 --- a/tests/system-test/win-test-file +++ b/tests/system-test/win-test-file @@ -233,6 +233,7 @@ python3 ./test.py -f 1-insert/update_data_muti_rows.py python3 ./test.py -f 1-insert/db_tb_name_check.py python3 ./test.py -f 1-insert/InsertFuturets.py python3 ./test.py -f 1-insert/insert_wide_column.py +python3 ./test.py -f 1-insert/insert_column_value.py python3 ./test.py -f 1-insert/rowlength64k_benchmark.py python3 ./test.py -f 1-insert/rowlength64k.py python3 ./test.py -f 1-insert/rowlength64k.py -R diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index f39fbfbdf5..6c3716519b 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -1866,6 +1866,9 @@ _return: // main key press tab void pressTabKey(SShellCmd* cmd) { +#ifdef WINDOWS + return ; +#endif // check empty tab key if (cmd->commandSize == 0) { // have multi line tab key @@ -1909,6 +1912,10 @@ void pressTabKey(SShellCmd* cmd) { // press othr key void pressOtherKey(char c) { +#ifdef WINDOWS + return ; +#endif + // reset global variant firstMatchIndex = -1; lastMatchIndex = -1; diff --git a/tools/shell/src/shellCommand.c b/tools/shell/src/shellCommand.c index c6459c4590..265dc4530f 100644 --- a/tools/shell/src/shellCommand.c +++ b/tools/shell/src/shellCommand.c @@ -445,7 +445,7 @@ char taosGetConsoleChar() { static char mbStr[5]; static unsigned long bufLen = 0; static uint16_t bufIndex = 0, mbStrIndex = 0, mbStrLen = 0; - CONSOLE_READCONSOLE_CONTROL inputControl={ sizeof(CONSOLE_READCONSOLE_CONTROL), 0, 1< 0 && buf[0] == 0) bufLen = 0; @@ -500,13 +500,11 @@ int32_t shellReadCommand(char *command) { } shellInsertChar(&cmd, utf8_array, count); pressOtherKey(c); -#ifndef WINDOWS } else if (c == TAB_KEY) { // press TAB key pressTabKey(&cmd); -#endif } else if (c < '\033') { - pressOtherKey(c); + pressOtherKey(c); // Ctrl keys. TODO: Implement ctrl combinations switch (c) { case 0: diff --git a/tools/shell/src/shellWebsocket.c b/tools/shell/src/shellWebsocket.c index 2d3aa27a3b..fc7c914c21 100644 --- a/tools/shell/src/shellWebsocket.c +++ b/tools/shell/src/shellWebsocket.c @@ -77,7 +77,7 @@ int shell_conn_ws_server(bool first) { } fprintf(stdout, "successfully connected to %s\n", host); } else { - fprintf(stdout, "successfully connected to cloud service\n"); + fprintf(stdout, "successfully connected to service\n"); } } fflush(stdout);