diff --git a/cmake/cmake.options b/cmake/cmake.options
index e013ff759239c8861b9601e79f0b3bcf11c8f618..2acd46694bca7d710f2371fc308411f7d1cd3db5 100644
--- a/cmake/cmake.options
+++ b/cmake/cmake.options
@@ -79,10 +79,16 @@ ENDIF ()
option(
BUILD_SANITIZER
- "If build addr2line"
+ "If build sanitizer"
OFF
)
+option(
+ TDENGINE_3
+ "TDengine 3.x"
+ ON
+ )
+
option(
BUILD_ADDR2LINE
"If build addr2line"
diff --git a/examples/c/stream_demo.c b/examples/c/stream_demo.c
index 1e9058d6289eba4b732ad4678f31c3e7725e8325..dd4fbc8d2d400bc9fc257202bda1979a62041895 100644
--- a/examples/c/stream_demo.c
+++ b/examples/c/stream_demo.c
@@ -98,10 +98,10 @@ int32_t create_stream() {
/*const char* sql = "select min(k), max(k), sum(k) as sum_of_k from st1";*/
/*const char* sql = "select sum(k) from tu1 interval(10m)";*/
/*pRes = tmq_create_stream(pConn, "stream1", "out1", sql);*/
- pRes = taos_query(
- pConn,
- "create stream stream1 trigger max_delay 10s into outstb as select _wstartts, sum(k) from st1 partition "
- "by tbname session(ts, 10s) ");
+ pRes =
+ taos_query(pConn,
+ "create stream stream1 trigger max_delay 10s into outstb as select _wstart, sum(k) from st1 partition "
+ "by tbname session(ts, 10s) ");
if (taos_errno(pRes) != 0) {
printf("failed to create stream stream1, reason:%s\n", taos_errstr(pRes));
return -1;
diff --git a/examples/c/tmq.c b/examples/c/tmq.c
index 5d7f1bbe702649789b04a5a0636cbb60e9a973c4..94e0b86821b4dc601709b4b513027b5ccf882861 100644
--- a/examples/c/tmq.c
+++ b/examples/c/tmq.c
@@ -30,21 +30,35 @@ static void msg_process(TAOS_RES* msg) {
if (tmq_get_res_type(msg) == TMQ_RES_TABLE_META) {
tmq_raw_data *raw = tmq_get_raw_meta(msg);
if(raw){
- TAOS* pConn = taos_connect("192.168.1.86", "root", "taosdata", "abc1", 0);
+ TAOS* pConn = taos_connect("192.168.1.86", "root", "taosdata", NULL, 0);
if (pConn == NULL) {
return;
}
+
+ TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1 vgroups 5");
+ if (taos_errno(pRes) != 0) {
+ printf("error in create db, reason:%s\n", taos_errstr(pRes));
+ return;
+ }
+ taos_free_result(pRes);
+
+ pRes = taos_query(pConn, "use abc1");
+ if (taos_errno(pRes) != 0) {
+ printf("error in use db, reason:%s\n", taos_errstr(pRes));
+ return;
+ }
+ taos_free_result(pRes);
+
int32_t ret = taos_write_raw_meta(pConn, raw);
printf("write raw data: %s\n", tmq_err2str(ret));
- free(raw);
taos_close(pConn);
}
+ tmq_free_raw_meta(raw);
char* result = tmq_get_json_meta(msg);
if(result){
printf("meta result: %s\n", result);
- free(result);
}
- printf("meta:%p\n", raw);
+ tmq_free_json_meta(result);
return;
}
while (1) {
@@ -68,7 +82,7 @@ int32_t init_env() {
return -1;
}
- TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1 vgroups 1");
+ TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1 vgroups 5");
if (taos_errno(pRes) != 0) {
printf("error in create db, reason:%s\n", taos_errstr(pRes));
return -1;
@@ -82,15 +96,14 @@ int32_t init_env() {
}
taos_free_result(pRes);
- pRes =
- taos_query(pConn, "create stable if not exists st1 (ts timestamp, c1 int, c2 float, c3 binary(16)) tags(t1 int)");
+ pRes = taos_query(pConn, "create stable if not exists st1 (ts timestamp, c1 int, c2 float, c3 binary(16)) tags(t1 int, t3 nchar(8), t4 bool)");
if (taos_errno(pRes) != 0) {
printf("failed to create super table st1, reason:%s\n", taos_errstr(pRes));
return -1;
}
taos_free_result(pRes);
- pRes = taos_query(pConn, "create table if not exists ct0 using st1 tags(1000)");
+ pRes = taos_query(pConn, "create table if not exists ct0 using st1 tags(1000, \"ttt\", true)");
if (taos_errno(pRes) != 0) {
printf("failed to create child table tu1, reason:%s\n", taos_errstr(pRes));
return -1;
@@ -104,13 +117,20 @@ int32_t init_env() {
}
taos_free_result(pRes);
- pRes = taos_query(pConn, "create table if not exists ct1 using st1 tags(2000)");
+ pRes = taos_query(pConn, "create table if not exists ct1 using st1(t1) tags(2000)");
if (taos_errno(pRes) != 0) {
printf("failed to create child table ct1, reason:%s\n", taos_errstr(pRes));
return -1;
}
taos_free_result(pRes);
+ pRes = taos_query(pConn, "create table if not exists ct2 using st1(t1) tags(NULL)");
+ if (taos_errno(pRes) != 0) {
+ printf("failed to create child table ct2, reason:%s\n", taos_errstr(pRes));
+ return -1;
+ }
+ taos_free_result(pRes);
+
pRes = taos_query(pConn, "insert into ct1 values(now, 3, 4, 'b')");
if (taos_errno(pRes) != 0) {
printf("failed to insert into ct1, reason:%s\n", taos_errstr(pRes));
@@ -118,7 +138,7 @@ int32_t init_env() {
}
taos_free_result(pRes);
- pRes = taos_query(pConn, "create table if not exists ct3 using st1 tags(3000)");
+ pRes = taos_query(pConn, "create table if not exists ct3 using st1(t1) tags(3000)");
if (taos_errno(pRes) != 0) {
printf("failed to create child table ct3, reason:%s\n", taos_errstr(pRes));
return -1;
@@ -202,6 +222,13 @@ int32_t init_env() {
}
taos_free_result(pRes);
+ pRes = taos_query(pConn, "alter table n1 comment 'hello'");
+ if (taos_errno(pRes) != 0) {
+ printf("failed to alter normal table n1, reason:%s\n", taos_errstr(pRes));
+ return -1;
+ }
+ taos_free_result(pRes);
+
pRes = taos_query(pConn, "alter table n1 drop column c1");
if (taos_errno(pRes) != 0) {
printf("failed to alter normal table n1, reason:%s\n", taos_errstr(pRes));
@@ -230,6 +257,27 @@ int32_t init_env() {
}
taos_free_result(pRes);
+ pRes = taos_query(pConn, "create table jt2 using jt tags('')");
+ if (taos_errno(pRes) != 0) {
+ printf("failed to create super table jt2, reason:%s\n", taos_errstr(pRes));
+ return -1;
+ }
+ taos_free_result(pRes);
+
+ pRes = taos_query(pConn, "create stable if not exists st1 (ts timestamp, c1 int, c2 float, c3 binary(16)) tags(t1 int, t3 nchar(8), t4 bool)");
+ if (taos_errno(pRes) != 0) {
+ printf("failed to create super table st1, reason:%s\n", taos_errstr(pRes));
+ return -1;
+ }
+ taos_free_result(pRes);
+
+ pRes = taos_query(pConn, "drop table st1");
+ if (taos_errno(pRes) != 0) {
+ printf("failed to drop super table st1, reason:%s\n", taos_errstr(pRes));
+ return -1;
+ }
+ taos_free_result(pRes);
+
return 0;
}
diff --git a/include/client/taos.h b/include/client/taos.h
index 362782b420ab6c7b292f911c9bd6503f1c3fdbb6..690c4739866ef8ee8d87a37754c59345aeaa556d 100644
--- a/include/client/taos.h
+++ b/include/client/taos.h
@@ -265,7 +265,9 @@ typedef struct tmq_raw_data tmq_raw_data;
DLL_EXPORT tmq_res_t tmq_get_res_type(TAOS_RES *res);
DLL_EXPORT tmq_raw_data *tmq_get_raw_meta(TAOS_RES *res);
DLL_EXPORT int32_t taos_write_raw_meta(TAOS *taos, tmq_raw_data *raw_meta);
-DLL_EXPORT char *tmq_get_json_meta(TAOS_RES *res); // Returning null means error. Returned result need to be freed.
+DLL_EXPORT void tmq_free_raw_meta(tmq_raw_data *rawMeta);
+DLL_EXPORT char *tmq_get_json_meta(TAOS_RES *res); // Returning null means error. Returned result need to be freed by tmq_free_json_meta
+DLL_EXPORT void tmq_free_json_meta(char* jsonMeta);
DLL_EXPORT const char *tmq_get_topic_name(TAOS_RES *res);
DLL_EXPORT const char *tmq_get_db_name(TAOS_RES *res);
DLL_EXPORT int32_t tmq_get_vgroup_id(TAOS_RES *res);
diff --git a/include/common/tcommon.h b/include/common/tcommon.h
index 3d15e8b087e242f63e4bfd5bff6bda786d973de3..5a7b32d20b2b7c2fbc57142f8b9a01a66250fbec 100644
--- a/include/common/tcommon.h
+++ b/include/common/tcommon.h
@@ -40,7 +40,6 @@ enum {
|| x == TDMT_VND_CREATE_TABLE \
|| x == TDMT_VND_ALTER_TABLE \
|| x == TDMT_VND_DROP_TABLE \
- || x == TDMT_VND_DROP_TTL_TABLE \
)
// clang-format on
@@ -108,6 +107,7 @@ typedef struct SDataBlockInfo {
// TODO: optimize and remove following
int32_t childId; // used for stream, do not serialize
EStreamType type; // used for stream, do not serialize
+ STimeWindow calWin; // used for stream, do not serialize
} SDataBlockInfo;
typedef struct SSDataBlock {
@@ -161,7 +161,6 @@ typedef struct SQueryTableDataCond {
int64_t endVersion;
} SQueryTableDataCond;
-void* blockDataDestroy(SSDataBlock* pBlock);
int32_t tEncodeDataBlock(void** buf, const SSDataBlock* pBlock);
void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock);
@@ -169,19 +168,6 @@ int32_t tEncodeDataBlocks(void** buf, const SArray* blocks);
void* tDecodeDataBlocks(const void* buf, SArray** blocks);
void colDataDestroy(SColumnInfoData* pColData);
-static FORCE_INLINE void blockDestroyInner(SSDataBlock* pBlock) {
- int32_t numOfOutput = taosArrayGetSize(pBlock->pDataBlock);
- for (int32_t i = 0; i < numOfOutput; ++i) {
- SColumnInfoData* pColInfoData = (SColumnInfoData*)taosArrayGet(pBlock->pDataBlock, i);
- colDataDestroy(pColInfoData);
- }
-
- taosArrayDestroy(pBlock->pDataBlock);
- taosMemoryFreeClear(pBlock->pBlockAgg);
-}
-
-static FORCE_INLINE void tDeleteSSDataBlock(SSDataBlock* pBlock) { blockDestroyInner(pBlock); }
-
//======================================================================================================================
// the following structure shared by parser and executor
typedef struct SColumn {
diff --git a/include/common/tdatablock.h b/include/common/tdatablock.h
index af333f72aad03a882a336a6a41df0c11b3211507..a4f59040184221db85ac41a68e3e62f9e21398e9 100644
--- a/include/common/tdatablock.h
+++ b/include/common/tdatablock.h
@@ -226,8 +226,12 @@ int32_t blockDataKeepFirstNRows(SSDataBlock* pBlock, size_t n);
int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src);
int32_t copyDataBlock(SSDataBlock* dst, const SSDataBlock* src);
-SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData);
+
SSDataBlock* createDataBlock();
+void* blockDataDestroy(SSDataBlock* pBlock);
+void blockDataFreeRes(SSDataBlock* pBlock);
+SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData);
+
int32_t blockDataAppendColInfo(SSDataBlock* pBlock, SColumnInfoData* pColInfoData);
SColumnInfoData createColumnInfoData(int16_t type, int32_t bytes, int16_t colId);
diff --git a/include/common/tdataformat.h b/include/common/tdataformat.h
index eaa8ac5cc4d43dcbbfe5157a025f6a1bf5d3bea9..311eb72b4d94564ce0c426e3c460c7980976cae0 100644
--- a/include/common/tdataformat.h
+++ b/include/common/tdataformat.h
@@ -64,18 +64,22 @@ int32_t tPutValue(uint8_t *p, SValue *pValue, int8_t type);
int32_t tGetValue(uint8_t *p, SValue *pValue, int8_t type);
int tValueCmprFn(const SValue *pValue1, const SValue *pValue2, int8_t type);
-// STSRow2
+// SColVal
#define COL_VAL_NONE(CID, TYPE) ((SColVal){.cid = (CID), .type = (TYPE), .isNone = 1})
#define COL_VAL_NULL(CID, TYPE) ((SColVal){.cid = (CID), .type = (TYPE), .isNull = 1})
#define COL_VAL_VALUE(CID, TYPE, V) ((SColVal){.cid = (CID), .type = (TYPE), .value = (V)})
+// STSRow2
+#define TSROW_LEN(PROW, V) tGetI32v((uint8_t *)(PROW)->data, (V) ? &(V) : NULL)
+#define TSROW_SVER(PROW, V) tGetI32v((PROW)->data + TSROW_LEN(PROW, NULL), (V) ? &(V) : NULL)
+
int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, STSRow2 **ppRow);
int32_t tTSRowClone(const STSRow2 *pRow, STSRow2 **ppRow);
void tTSRowFree(STSRow2 *pRow);
void tTSRowGet(STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal);
int32_t tTSRowToArray(STSRow2 *pRow, STSchema *pTSchema, SArray **ppArray);
int32_t tPutTSRow(uint8_t *p, STSRow2 *pRow);
-int32_t tGetTSRow(uint8_t *p, STSRow2 *pRow);
+int32_t tGetTSRow(uint8_t *p, STSRow2 **ppRow);
// STSRowBuilder
#define tsRowBuilderInit() ((STSRowBuilder){0})
@@ -97,7 +101,7 @@ int32_t tEncodeTag(SEncoder *pEncoder, const STag *pTag);
int32_t tDecodeTag(SDecoder *pDecoder, STag **ppTag);
int32_t tTagToValArray(const STag *pTag, SArray **ppArray);
void debugPrintSTag(STag *pTag, const char *tag, int32_t ln); // TODO: remove
-int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, void* pMsgBuf);
+int32_t parseJsontoTagData(const char *json, SArray *pTagVals, STag **ppTag, void *pMsgBuf);
// STRUCT =================
struct STColumn {
@@ -123,16 +127,16 @@ struct STSchema {
#define TSROW_KV_SMALL ((uint8_t)0x10U)
#define TSROW_KV_MID ((uint8_t)0x20U)
#define TSROW_KV_BIG ((uint8_t)0x40U)
+#pragma pack(push, 1)
struct STSRow2 {
- TSKEY ts;
- uint8_t flags;
- int32_t sver;
- uint32_t nData;
- uint8_t *pData;
+ TSKEY ts;
+ uint8_t flags;
+ uint8_t data[];
};
+#pragma pack(pop)
struct STSRowBuilder {
- STSRow2 tsRow;
+ // STSRow2 tsRow;
int32_t szBuf;
uint8_t *pBuf;
};
@@ -167,6 +171,7 @@ struct SColVal {
#pragma pack(push, 1)
struct STagVal {
+// char colName[TSDB_COL_NAME_LEN]; // only used for tmq_get_meta
union {
int16_t cid;
char *pKey;
@@ -226,50 +231,6 @@ struct STag {
memcpy(varDataVal(x), (str), (_size)); \
} while (0);
-// ----------------- TSDB COLUMN DEFINITION
-
-#define colType(col) ((col)->type)
-#define colFlags(col) ((col)->flags)
-#define colColId(col) ((col)->colId)
-#define colBytes(col) ((col)->bytes)
-#define colOffset(col) ((col)->offset)
-
-#define colSetType(col, t) (colType(col) = (t))
-#define colSetFlags(col, f) (colFlags(col) = (f))
-#define colSetColId(col, id) (colColId(col) = (id))
-#define colSetBytes(col, b) (colBytes(col) = (b))
-#define colSetOffset(col, o) (colOffset(col) = (o))
-
-// ----------------- TSDB SCHEMA DEFINITION
-
-#define schemaNCols(s) ((s)->numOfCols)
-#define schemaVersion(s) ((s)->version)
-#define schemaTLen(s) ((s)->tlen)
-#define schemaFLen(s) ((s)->flen)
-#define schemaVLen(s) ((s)->vlen)
-#define schemaColAt(s, i) ((s)->columns + i)
-#define tdFreeSchema(s) taosMemoryFreeClear((s))
-
-STSchema *tdDupSchema(const STSchema *pSchema);
-int32_t tdEncodeSchema(void **buf, STSchema *pSchema);
-void *tdDecodeSchema(void *buf, STSchema **pRSchema);
-
-static FORCE_INLINE int32_t comparColId(const void *key1, const void *key2) {
- if (*(int16_t *)key1 > ((STColumn *)key2)->colId) {
- return 1;
- } else if (*(int16_t *)key1 < ((STColumn *)key2)->colId) {
- return -1;
- } else {
- return 0;
- }
-}
-
-static FORCE_INLINE STColumn *tdGetColOfID(STSchema *pSchema, int16_t colId) {
- void *ptr = bsearch(&colId, (void *)pSchema->columns, schemaNCols(pSchema), sizeof(STColumn), comparColId);
- if (ptr == NULL) return NULL;
- return (STColumn *)ptr;
-}
-
// ----------------- SCHEMA BUILDER DEFINITION
typedef struct {
int32_t tCols;
@@ -299,141 +260,6 @@ void tdResetTSchemaBuilder(STSchemaBuilder *pBuilder, schema_ver_t version)
int32_t tdAddColToSchema(STSchemaBuilder *pBuilder, int8_t type, int8_t flags, col_id_t colId, col_bytes_t bytes);
STSchema *tdGetSchemaFromBuilder(STSchemaBuilder *pBuilder);
-// ----------------- Semantic timestamp key definition
-// typedef uint64_t TKEY;
-#define TKEY TSKEY
-
-#define TKEY_INVALID UINT64_MAX
-#define TKEY_NULL TKEY_INVALID
-#define TKEY_NEGATIVE_FLAG (((TKEY)1) << 63)
-#define TKEY_VALUE_FILTER (~(TKEY_NEGATIVE_FLAG))
-
-#define TKEY_IS_NEGATIVE(tkey) (((tkey)&TKEY_NEGATIVE_FLAG) != 0)
-#define TKEY_IS_DELETED(tkey) (false)
-
-#define tdGetTKEY(key) (key)
-#define tdGetKey(tskey) (tskey)
-
-#define MIN_TS_KEY ((TSKEY)0x8000000000000001)
-#define MAX_TS_KEY ((TSKEY)0x7fffffffffffffff)
-
-#define TD_TO_TKEY(key) tdGetTKEY(((key) < MIN_TS_KEY) ? MIN_TS_KEY : (((key) > MAX_TS_KEY) ? MAX_TS_KEY : key))
-
-static FORCE_INLINE TKEY keyToTkey(TSKEY key) {
- TSKEY lkey = key;
- if (key > MAX_TS_KEY) {
- lkey = MAX_TS_KEY;
- } else if (key < MIN_TS_KEY) {
- lkey = MIN_TS_KEY;
- }
-
- return tdGetTKEY(lkey);
-}
-
-static FORCE_INLINE int32_t tkeyComparFn(const void *tkey1, const void *tkey2) {
- TSKEY key1 = tdGetKey(*(TKEY *)tkey1);
- TSKEY key2 = tdGetKey(*(TKEY *)tkey2);
-
- if (key1 < key2) {
- return -1;
- } else if (key1 > key2) {
- return 1;
- } else {
- return 0;
- }
-}
-
-// ----------------- Data column structure
-// SDataCol arrangement: data => bitmap => dataOffset
-typedef struct SDataCol {
- int8_t type; // column type
- uint8_t bitmap : 1; // 0: no bitmap if all rows are NORM, 1: has bitmap if has NULL/NORM rows
- uint8_t reserve : 7;
- int16_t colId; // column ID
- int32_t bytes; // column data bytes defined
- int32_t offset; // data offset in a SDataRow (including the header size)
- int32_t spaceSize; // Total space size for this column
- int32_t len; // column data length
- VarDataOffsetT *dataOff; // For binary and nchar data, the offset in the data column
- void *pData; // Actual data pointer
- void *pBitmap; // Bitmap pointer
- TSKEY ts; // only used in last NULL column
-} SDataCol;
-
-#define isAllRowsNull(pCol) ((pCol)->len == 0)
-#define isAllRowsNone(pCol) ((pCol)->len == 0)
-static FORCE_INLINE void dataColReset(SDataCol *pDataCol) { pDataCol->len = 0; }
-
-int32_t tdAllocMemForCol(SDataCol *pCol, int32_t maxPoints);
-
-void dataColInit(SDataCol *pDataCol, STColumn *pCol, int32_t maxPoints);
-int32_t dataColAppendVal(SDataCol *pCol, const void *value, int32_t numOfRows, int32_t maxPoints);
-void *dataColSetOffset(SDataCol *pCol, int32_t nEle);
-
-bool isNEleNull(SDataCol *pCol, int32_t nEle);
-
-typedef struct {
- col_id_t maxCols; // max number of columns
- col_id_t numOfCols; // Total number of cols
- int32_t maxPoints; // max number of points
- int32_t numOfRows;
- int32_t bitmapMode : 1; // default is 0(2 bits), otherwise 1(1 bit)
- int32_t sversion : 31; // TODO: set sversion(not used yet)
- SDataCol *cols;
-} SDataCols;
-
-static FORCE_INLINE bool tdDataColsIsBitmapI(SDataCols *pCols) { return pCols->bitmapMode != TSDB_BITMODE_DEFAULT; }
-static FORCE_INLINE void tdDataColsSetBitmapI(SDataCols *pCols) { pCols->bitmapMode = TSDB_BITMODE_ONE_BIT; }
-static FORCE_INLINE bool tdIsBitmapModeI(int8_t bitmapMode) { return bitmapMode != TSDB_BITMODE_DEFAULT; }
-
-#define keyCol(pCols) (&((pCols)->cols[0])) // Key column
-#define dataColsTKeyAt(pCols, idx) ((TKEY *)(keyCol(pCols)->pData))[(idx)] // the idx row of column-wised data
-#define dataColsKeyAt(pCols, idx) tdGetKey(dataColsTKeyAt(pCols, idx))
-static FORCE_INLINE TKEY dataColsTKeyFirst(SDataCols *pCols) {
- if (pCols->numOfRows) {
- return dataColsTKeyAt(pCols, 0);
- } else {
- return TKEY_INVALID;
- }
-}
-
-static FORCE_INLINE TSKEY dataColsKeyAtRow(SDataCols *pCols, int32_t row) {
- assert(row < pCols->numOfRows);
- return dataColsKeyAt(pCols, row);
-}
-
-static FORCE_INLINE TSKEY dataColsKeyFirst(SDataCols *pCols) {
- if (pCols->numOfRows) {
- return dataColsKeyAt(pCols, 0);
- } else {
- return TSDB_DATA_TIMESTAMP_NULL;
- }
-}
-
-static FORCE_INLINE TKEY dataColsTKeyLast(SDataCols *pCols) {
- if (pCols->numOfRows) {
- return dataColsTKeyAt(pCols, pCols->numOfRows - 1);
- } else {
- return TKEY_INVALID;
- }
-}
-
-static FORCE_INLINE TSKEY dataColsKeyLast(SDataCols *pCols) {
- if (pCols->numOfRows) {
- return dataColsKeyAt(pCols, pCols->numOfRows - 1);
- } else {
- return TSDB_DATA_TIMESTAMP_NULL;
- }
-}
-
-SDataCols *tdNewDataCols(int32_t maxCols, int32_t maxRows);
-void tdResetDataCols(SDataCols *pCols);
-int32_t tdInitDataCols(SDataCols *pCols, STSchema *pSchema);
-SDataCols *tdDupDataCols(SDataCols *pCols, bool keepData);
-SDataCols *tdFreeDataCols(SDataCols *pCols);
-int32_t tdMergeDataCols(SDataCols *target, SDataCols *source, int32_t rowsToMerge, int32_t *pOffset, bool update,
- TDRowVerT maxVer);
-
#endif
#ifdef __cplusplus
diff --git a/include/common/tglobal.h b/include/common/tglobal.h
index 944eaa28bc60b5eecab3bdc983511927fbf0ffb0..96014b12341395994e3409cff37c3e090cfa07a6 100644
--- a/include/common/tglobal.h
+++ b/include/common/tglobal.h
@@ -64,6 +64,7 @@ extern int32_t tsNumOfMnodeQueryThreads;
extern int32_t tsNumOfMnodeFetchThreads;
extern int32_t tsNumOfMnodeReadThreads;
extern int32_t tsNumOfVnodeQueryThreads;
+extern int32_t tsNumOfVnodeStreamThreads;
extern int32_t tsNumOfVnodeFetchThreads;
extern int32_t tsNumOfVnodeWriteThreads;
extern int32_t tsNumOfVnodeSyncThreads;
diff --git a/include/common/tmsg.h b/include/common/tmsg.h
index 0ab65e7978369a003e4c118eeb8cccc70b31108a..c8e13fce3d6fdc45c8bd15fc2f59e6f91dc39c4c 100644
--- a/include/common/tmsg.h
+++ b/include/common/tmsg.h
@@ -1939,6 +1939,8 @@ typedef struct SVCreateStbReq {
SSchemaWrapper schemaRow;
SSchemaWrapper schemaTag;
SRSmaParam rsmaParam;
+ int32_t alterOriDataLen;
+ void* alterOriData;
} SVCreateStbReq;
int tEncodeSVCreateStbReq(SEncoder* pCoder, const SVCreateStbReq* pReq);
@@ -1966,7 +1968,9 @@ typedef struct SVCreateTbReq {
int8_t type;
union {
struct {
+ char* name; // super table name
tb_uid_t suid;
+ SArray* tagName;
uint8_t* pTag;
} ctb;
struct {
@@ -1983,6 +1987,9 @@ static FORCE_INLINE void tdDestroySVCreateTbReq(SVCreateTbReq* req) {
taosMemoryFreeClear(req->comment);
if (req->type == TSDB_CHILD_TABLE) {
taosMemoryFreeClear(req->ctb.pTag);
+ taosMemoryFreeClear(req->ctb.name);
+ taosArrayDestroy(req->ctb.tagName);
+ req->ctb.tagName = NULL;
} else if (req->type == TSDB_NORMAL_TABLE) {
taosMemoryFreeClear(req->ntb.schemaRow.pSchema);
}
@@ -2066,12 +2073,14 @@ typedef struct {
int32_t bytes;
// TSDB_ALTER_TABLE_DROP_COLUMN
// TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES
+ int8_t colModType;
int32_t colModBytes;
// TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME
char* colNewName;
// TSDB_ALTER_TABLE_UPDATE_TAG_VAL
char* tagName;
int8_t isNull;
+ int8_t tagType;
uint32_t nTagVal;
uint8_t* pTagVal;
// TSDB_ALTER_TABLE_UPDATE_OPTIONS
@@ -2858,8 +2867,8 @@ typedef struct {
static FORCE_INLINE int32_t tEncodeSMqMetaRsp(void** buf, const SMqMetaRsp* pRsp) {
int32_t tlen = 0;
- // tlen += taosEncodeFixedI64(buf, pRsp->reqOffset);
- // tlen += taosEncodeFixedI64(buf, pRsp->rspOffset);
+ tlen += taosEncodeFixedI64(buf, pRsp->reqOffset);
+ tlen += taosEncodeFixedI64(buf, pRsp->rspOffset);
tlen += taosEncodeFixedI16(buf, pRsp->resMsgType);
tlen += taosEncodeFixedI32(buf, pRsp->metaRspLen);
tlen += taosEncodeBinary(buf, pRsp->metaRsp, pRsp->metaRspLen);
@@ -2867,8 +2876,7 @@ static FORCE_INLINE int32_t tEncodeSMqMetaRsp(void** buf, const SMqMetaRsp* pRsp
}
static FORCE_INLINE void* tDecodeSMqMetaRsp(const void* buf, SMqMetaRsp* pRsp) {
- // buf = taosDecodeFixedI64(buf, &pRsp->reqOffset);
- // buf = taosDecodeFixedI64(buf, &pRsp->rspOffset);
+ buf = taosDecodeFixedI64(buf, &pRsp->reqOffset);buf = taosDecodeFixedI64(buf, &pRsp->rspOffset);
buf = taosDecodeFixedI16(buf, &pRsp->resMsgType);
buf = taosDecodeFixedI32(buf, &pRsp->metaRspLen);
buf = taosDecodeBinary(buf, &pRsp->metaRsp, pRsp->metaRspLen);
diff --git a/include/common/tmsgcb.h b/include/common/tmsgcb.h
index b56f7552666dd23650f9911dc23e03b9ae2fa707..c13c50e1616146e43d3a74dc4145a5e7c7ffccf3 100644
--- a/include/common/tmsgcb.h
+++ b/include/common/tmsgcb.h
@@ -34,6 +34,7 @@ typedef enum {
WRITE_QUEUE,
APPLY_QUEUE,
SYNC_QUEUE,
+ STREAM_QUEUE,
QUEUE_MAX,
} EQueueType;
diff --git a/include/common/trow.h b/include/common/trow.h
index 086a6ce6fb6b059fd4f05961ccd7bb16a5542b2c..807a4c0f0a9d8b6396db72848c7815c7deb63888 100644
--- a/include/common/trow.h
+++ b/include/common/trow.h
@@ -168,7 +168,7 @@ typedef struct {
// N.B. If without STSchema, getExtendedRowSize() is used to get the rowMaxBytes and
// (int32_t)ceil((double)nCols/TD_VTYPE_PARTS) should be added if TD_SUPPORT_BITMAP defined.
-#define TD_ROW_MAX_BYTES_FROM_SCHEMA(s) (schemaTLen(s) + TD_ROW_HEAD_LEN)
+#define TD_ROW_MAX_BYTES_FROM_SCHEMA(s) ((s)->tlen + TD_ROW_HEAD_LEN)
#define TD_ROW_SET_INFO(r, i) (TD_ROW_INFO(r) = (i))
#define TD_ROW_SET_TYPE(r, t) (TD_ROW_TYPE(r) = (t))
@@ -223,9 +223,10 @@ int32_t tdSetBitmapValTypeN(void *pBitmap, int16_t nEle, TDR
static FORCE_INLINE int32_t tdGetBitmapValType(const void *pBitmap, int16_t colIdx, TDRowValT *pValType,
int8_t bitmapMode);
bool tdIsBitmapBlkNorm(const void *pBitmap, int32_t numOfBits, int8_t bitmapMode);
-int32_t tdAppendValToDataCol(SDataCol *pCol, TDRowValT valType, const void *val, int32_t numOfRows, int32_t maxPoints,
- int8_t bitmapMode, bool isMerge);
-int32_t tdAppendSTSRowToDataCol(STSRow *pRow, STSchema *pSchema, SDataCols *pCols, bool isMerge);
+// int32_t tdAppendValToDataCol(SDataCol *pCol, TDRowValT valType, const void *val, int32_t numOfRows, int32_t
+// maxPoints,
+// int8_t bitmapMode, bool isMerge);
+// int32_t tdAppendSTSRowToDataCol(STSRow *pRow, STSchema *pSchema, SDataCols *pCols, bool isMerge);
int32_t tdGetBitmapValTypeII(const void *pBitmap, int16_t colIdx, TDRowValT *pValType);
int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType);
@@ -318,12 +319,9 @@ bool tdSTSRowGetVal(STSRowIter *pIter, col_id_t colId, col_type_t colType, SC
bool tdGetTpRowDataOfCol(STSRowIter *pIter, col_type_t colType, int32_t offset, SCellVal *pVal);
bool tdGetKvRowValOfColEx(STSRowIter *pIter, col_id_t colId, col_type_t colType, col_id_t *nIdx, SCellVal *pVal);
bool tdSTSRowIterNext(STSRowIter *pIter, col_id_t colId, col_type_t colType, SCellVal *pVal);
-STSRow *mergeTwoRows(void *buffer, STSRow *row1, STSRow *row2, STSchema *pSchema1, STSchema *pSchema2);
-int32_t tdGetColDataOfRow(SCellVal *pVal, SDataCol *pCol, int32_t row, int8_t bitmapMode);
bool tdSTpRowGetVal(STSRow *pRow, col_id_t colId, col_type_t colType, int32_t flen, uint32_t offset, col_id_t colIdx,
SCellVal *pVal);
bool tdSKvRowGetVal(STSRow *pRow, col_id_t colId, col_id_t colIdx, SCellVal *pVal);
-int32_t dataColGetNEleLen(SDataCol *pDataCol, int32_t rows, int8_t bitmapMode);
void tdSCellValPrint(SCellVal *pVal, int8_t colType);
void tdSRowPrint(STSRow *row, STSchema *pSchema, const char *tag);
diff --git a/include/common/ttime.h b/include/common/ttime.h
index cd704bb1f7971526cbfacc9f6167852d21b8ec5d..de55b016cdacf2acb43c9f4c0b26599a310eb619 100644
--- a/include/common/ttime.h
+++ b/include/common/ttime.h
@@ -72,6 +72,8 @@ static FORCE_INLINE int64_t taosGetTimestampToday(int32_t precision) {
}
int64_t taosTimeAdd(int64_t t, int64_t duration, char unit, int32_t precision);
+int64_t taosTimeSub(int64_t t, int64_t duration, char unit, int32_t precision);
+
int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precision);
int32_t taosTimeCountInterval(int64_t skey, int64_t ekey, int64_t interval, char unit, int32_t precision);
diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h
index 29dd4daa25506fd1af35ebe2583091c5249ad5ea..e2089f30236fc68923d35948da3d16a5283e373e 100644
--- a/include/common/ttokendef.h
+++ b/include/common/ttokendef.h
@@ -213,63 +213,64 @@
#define TK_NK_ARROW 195
#define TK_ROWTS 196
#define TK_TBNAME 197
-#define TK_QSTARTTS 198
-#define TK_QENDTS 199
-#define TK_WSTARTTS 200
-#define TK_WENDTS 201
-#define TK_WDURATION 202
-#define TK_CAST 203
-#define TK_NOW 204
-#define TK_TODAY 205
-#define TK_TIMEZONE 206
-#define TK_CLIENT_VERSION 207
-#define TK_SERVER_VERSION 208
-#define TK_SERVER_STATUS 209
-#define TK_CURRENT_USER 210
-#define TK_COUNT 211
-#define TK_LAST_ROW 212
-#define TK_BETWEEN 213
-#define TK_IS 214
-#define TK_NK_LT 215
-#define TK_NK_GT 216
-#define TK_NK_LE 217
-#define TK_NK_GE 218
-#define TK_NK_NE 219
-#define TK_MATCH 220
-#define TK_NMATCH 221
-#define TK_CONTAINS 222
-#define TK_JOIN 223
-#define TK_INNER 224
-#define TK_SELECT 225
-#define TK_DISTINCT 226
-#define TK_WHERE 227
-#define TK_PARTITION 228
-#define TK_BY 229
-#define TK_SESSION 230
-#define TK_STATE_WINDOW 231
-#define TK_SLIDING 232
-#define TK_FILL 233
-#define TK_VALUE 234
-#define TK_NONE 235
-#define TK_PREV 236
-#define TK_LINEAR 237
-#define TK_NEXT 238
-#define TK_HAVING 239
-#define TK_RANGE 240
-#define TK_EVERY 241
-#define TK_ORDER 242
-#define TK_SLIMIT 243
-#define TK_SOFFSET 244
-#define TK_LIMIT 245
-#define TK_OFFSET 246
-#define TK_ASC 247
-#define TK_NULLS 248
-#define TK_ID 249
-#define TK_NK_BITNOT 250
-#define TK_VALUES 251
-#define TK_IMPORT 252
-#define TK_NK_SEMI 253
-#define TK_FILE 254
+#define TK_QSTART 198
+#define TK_QEND 199
+#define TK_QDURATION 200
+#define TK_WSTART 201
+#define TK_WEND 202
+#define TK_WDURATION 203
+#define TK_CAST 204
+#define TK_NOW 205
+#define TK_TODAY 206
+#define TK_TIMEZONE 207
+#define TK_CLIENT_VERSION 208
+#define TK_SERVER_VERSION 209
+#define TK_SERVER_STATUS 210
+#define TK_CURRENT_USER 211
+#define TK_COUNT 212
+#define TK_LAST_ROW 213
+#define TK_BETWEEN 214
+#define TK_IS 215
+#define TK_NK_LT 216
+#define TK_NK_GT 217
+#define TK_NK_LE 218
+#define TK_NK_GE 219
+#define TK_NK_NE 220
+#define TK_MATCH 221
+#define TK_NMATCH 222
+#define TK_CONTAINS 223
+#define TK_JOIN 224
+#define TK_INNER 225
+#define TK_SELECT 226
+#define TK_DISTINCT 227
+#define TK_WHERE 228
+#define TK_PARTITION 229
+#define TK_BY 230
+#define TK_SESSION 231
+#define TK_STATE_WINDOW 232
+#define TK_SLIDING 233
+#define TK_FILL 234
+#define TK_VALUE 235
+#define TK_NONE 236
+#define TK_PREV 237
+#define TK_LINEAR 238
+#define TK_NEXT 239
+#define TK_HAVING 240
+#define TK_RANGE 241
+#define TK_EVERY 242
+#define TK_ORDER 243
+#define TK_SLIMIT 244
+#define TK_SOFFSET 245
+#define TK_LIMIT 246
+#define TK_OFFSET 247
+#define TK_ASC 248
+#define TK_NULLS 249
+#define TK_ID 250
+#define TK_NK_BITNOT 251
+#define TK_VALUES 252
+#define TK_IMPORT 253
+#define TK_NK_SEMI 254
+#define TK_FILE 255
#define TK_NK_SPACE 300
#define TK_NK_COMMENT 301
diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h
index 783193db49f00d60341134c3496dab8e6edbab7b..dd64c5bf713794d136a829e9c116283831f9c9c0 100644
--- a/include/libs/executor/executor.h
+++ b/include/libs/executor/executor.h
@@ -42,25 +42,28 @@ typedef struct SReadHandle {
bool initTqReader;
} SReadHandle;
+// in queue mode, data streams are seperated by msg
typedef enum {
OPTR_EXEC_MODEL_BATCH = 0x1,
OPTR_EXEC_MODEL_STREAM = 0x2,
+ OPTR_EXEC_MODEL_QUEUE = 0x3,
} EOPTR_EXEC_MODEL;
/**
- * Create the exec task for streaming mode
+ * Create the exec task for stream mode
* @param pMsg
- * @param streamReadHandle
+ * @param SReadHandle
* @return
*/
qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers);
/**
- * Switch the stream scan to snapshot mode
- * @param tinfo
+ * Create the exec task for queue mode
+ * @param pMsg
+ * @param SReadHandle
* @return
*/
-int32_t qStreamScanSnapshot(qTaskInfo_t tinfo);
+qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* readers);
/**
* Set the input data block for the stream scan.
@@ -111,7 +114,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
* @return
*/
int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* tableName, int32_t* sversion,
- int32_t* tversion);
+ int32_t* tversion);
/**
* The main task execution function, including query on both table and multiple tables,
@@ -183,9 +186,12 @@ int32_t qStreamExtractOffset(qTaskInfo_t tinfo, STqOffsetVal* pOffset);
void* qStreamExtractMetaMsg(qTaskInfo_t tinfo);
-void* qExtractReaderFromStreamScanner(void* scanner);
+void* qExtractReaderFromStreamScanner(void* scanner);
+
int32_t qExtractStreamScanner(qTaskInfo_t tinfo, void** scanner);
+int32_t qStreamInput(qTaskInfo_t tinfo, void* pItem);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h
index 1012161d0eb57f604a6afe52df6ef5cdb4ed02b9..04825f376fb12912282f74aa4256422289850f6c 100644
--- a/include/libs/function/functionMgt.h
+++ b/include/libs/function/functionMgt.h
@@ -34,7 +34,7 @@ typedef enum EFunctionType {
FUNCTION_TYPE_ELAPSED,
FUNCTION_TYPE_IRATE,
FUNCTION_TYPE_LAST_ROW,
- FUNCTION_TYPE_LAST_ROWT, //TODO: removed
+ FUNCTION_TYPE_LAST_ROWT, // TODO: removed
FUNCTION_TYPE_MAX,
FUNCTION_TYPE_MIN,
FUNCTION_TYPE_MODE,
@@ -114,10 +114,11 @@ typedef enum EFunctionType {
// pseudo column function
FUNCTION_TYPE_ROWTS = 3500,
FUNCTION_TYPE_TBNAME,
- FUNCTION_TYPE_QSTARTTS,
- FUNCTION_TYPE_QENDTS,
- FUNCTION_TYPE_WSTARTTS,
- FUNCTION_TYPE_WENDTS,
+ FUNCTION_TYPE_QSTART,
+ FUNCTION_TYPE_QEND,
+ FUNCTION_TYPE_QDURATION,
+ FUNCTION_TYPE_WSTART,
+ FUNCTION_TYPE_WEND,
FUNCTION_TYPE_WDURATION,
// internal function
@@ -197,6 +198,7 @@ bool fmIsInterpFunc(int32_t funcId);
bool fmIsLastRowFunc(int32_t funcId);
bool fmIsSystemInfoFunc(int32_t funcId);
bool fmIsImplicitTsFunc(int32_t funcId);
+bool fmIsClientPseudoColumnFunc(int32_t funcId);
int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc, SFunctionNode** pMergeFunc);
diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h
index bbff34c66f0b99c839d11cc965d7ef7336aac495..234b554526ea198aa78aece70a28988b61de8c1c 100644
--- a/include/libs/nodes/querynodes.h
+++ b/include/libs/nodes/querynodes.h
@@ -228,7 +228,7 @@ typedef struct SFillNode {
ENodeType type; // QUERY_NODE_FILL
EFillMode mode;
SNode* pValues; // SNodeListNode
- SNode* pWStartTs; // _wstartts pseudo column
+ SNode* pWStartTs; // _wstart pseudo column
STimeWindow timeRange;
} SFillNode;
@@ -248,6 +248,7 @@ typedef struct SSelectStmt {
SNodeList* pOrderByList; // SOrderByExprNode
SLimitNode* pLimit;
SLimitNode* pSlimit;
+ STimeWindow timeRange;
char stmtName[TSDB_TABLE_NAME_LEN];
uint8_t precision;
int32_t selectFuncNum;
diff --git a/include/libs/parser/parser.h b/include/libs/parser/parser.h
index a4aec72d4f720909296af64c5f951d3e03d503df..a3de9164a2d4418dd1edc8493d46c20f2fafdcac 100644
--- a/include/libs/parser/parser.h
+++ b/include/libs/parser/parser.h
@@ -29,7 +29,7 @@ struct SMetaData;
typedef struct SStmtCallback {
TAOS_STMT* pStmt;
int32_t (*getTbNameFn)(TAOS_STMT*, char**);
- int32_t (*setInfoFn)(TAOS_STMT*, STableMeta*, void*, char*, bool, SHashObj*, SHashObj*);
+ int32_t (*setInfoFn)(TAOS_STMT*, STableMeta*, void*, char*, bool, SHashObj*, SHashObj*, const char*);
int32_t (*getExecInfoFn)(TAOS_STMT*, SHashObj**, SHashObj**);
} SStmtCallback;
@@ -84,7 +84,7 @@ int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBu
int32_t rowNum);
int32_t qBuildStmtColFields(void* pDataBlock, int32_t* fieldNum, TAOS_FIELD_E** fields);
int32_t qBuildStmtTagFields(void* pBlock, void* boundTags, int32_t* fieldNum, TAOS_FIELD_E** fields);
-int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, char* tName, TAOS_MULTI_BIND* bind,
+int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const char* sTableName, char* tName, TAOS_MULTI_BIND* bind,
char* msgBuf, int32_t msgBufLen);
void destroyBoundColumnInfo(void* pBoundInfo);
int32_t qCreateSName(SName* pName, const char* pTableName, int32_t acctId, char* dbName, char* msgBuf,
@@ -93,7 +93,7 @@ int32_t qCreateSName(SName* pName, const char* pTableName, int32_t acctId, char*
void* smlInitHandle(SQuery* pQuery);
void smlDestroyHandle(void* pHandle);
int32_t smlBindData(void* handle, SArray* tags, SArray* colsSchema, SArray* cols, bool format, STableMeta* pTableMeta,
- char* tableName, char* msgBuf, int16_t msgBufLen);
+ char* tableName, const char* sTableName, int32_t sTableNameLen, char* msgBuf, int16_t msgBufLen);
int32_t smlBuildOutput(void* handle, SHashObj* pVgHash);
int32_t rewriteToVnodeModifyOpStmt(SQuery* pQuery, SArray* pBufArray);
diff --git a/include/libs/scalar/scalar.h b/include/libs/scalar/scalar.h
index c81c474366831aeb4dab8dcdb155642bd8af7042..517c5ff0e6c25e403306fd3e4cce875dcc8adc71 100644
--- a/include/libs/scalar/scalar.h
+++ b/include/libs/scalar/scalar.h
@@ -32,6 +32,7 @@ pNode will be freed in API;
*pRes need to freed in caller
*/
int32_t scalarCalculateConstants(SNode *pNode, SNode **pRes);
+int32_t scalarCalculateConstantsFromDual(SNode *pNode, SNode **pRes);
/*
pDst need to freed in caller
diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h
index d6cb2c27b02b132b4ab87fdefb545dc6d6cc2fd3..071c539ff32c3a47b996c0b3a15a168fe0e87490 100644
--- a/include/libs/stream/tstream.h
+++ b/include/libs/stream/tstream.h
@@ -13,7 +13,9 @@
* along with this program. If not, see .
*/
+#include "executor.h"
#include "os.h"
+#include "query.h"
#include "tdatablock.h"
#include "tmsg.h"
#include "tmsgcb.h"
@@ -305,13 +307,18 @@ static FORCE_INLINE int32_t streamTaskInput(SStreamTask* pTask, SStreamQueueItem
atomic_store_8(&pTask->inputStatus, TASK_INPUT_STATUS__FAILED);
return -1;
}
+ qDebug("task %d %p submit enqueue %p %p %p", pTask->taskId, pTask, pItem, pSubmitClone, pSubmitClone->data);
taosWriteQitem(pTask->inputQueue->queue, pSubmitClone);
+ // qStreamInput(pTask->exec.executor, pSubmitClone);
} else if (pItem->type == STREAM_INPUT__DATA_BLOCK || pItem->type == STREAM_INPUT__DATA_RETRIEVE) {
taosWriteQitem(pTask->inputQueue->queue, pItem);
+ // qStreamInput(pTask->exec.executor, pItem);
} else if (pItem->type == STREAM_INPUT__CHECKPOINT) {
taosWriteQitem(pTask->inputQueue->queue, pItem);
+ // qStreamInput(pTask->exec.executor, pItem);
} else if (pItem->type == STREAM_INPUT__TRIGGER) {
taosWriteQitem(pTask->inputQueue->queue, pItem);
+ // qStreamInput(pTask->exec.executor, pItem);
}
if (pItem->type != STREAM_INPUT__TRIGGER && pItem->type != STREAM_INPUT__CHECKPOINT && pTask->triggerParam != 0) {
@@ -333,12 +340,12 @@ static FORCE_INLINE int32_t streamTaskOutput(SStreamTask* pTask, SStreamDataBloc
if (pTask->sinkType == TASK_SINK__TABLE) {
ASSERT(pTask->dispatchType == TASK_DISPATCH__NONE);
pTask->tbSink.tbSinkFunc(pTask, pTask->tbSink.vnode, 0, pBlock->blocks);
- taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock);
+ taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes);
taosFreeQitem(pBlock);
} else if (pTask->sinkType == TASK_SINK__SMA) {
ASSERT(pTask->dispatchType == TASK_DISPATCH__NONE);
pTask->smaSink.smaSink(pTask->smaSink.vnode, pTask->smaSink.smaId, pBlock->blocks);
- taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock);
+ taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes);
taosFreeQitem(pBlock);
} else {
ASSERT(pTask->dispatchType != TASK_DISPATCH__NONE);
diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h
index bef26cb3102173b6353afd83fa4ae05b3de97803..c226d7c8ccbd2cb2e9c248ec895d1220ef40e104 100644
--- a/include/libs/sync/sync.h
+++ b/include/libs/sync/sync.h
@@ -26,6 +26,8 @@ extern "C" {
extern bool gRaftDetailLog;
+#define SYNC_RESP_TTL_MS 5000
+
#define SYNC_MAX_BATCH_SIZE 500
#define SYNC_INDEX_BEGIN 0
#define SYNC_INDEX_INVALID -1
diff --git a/include/os/osDef.h b/include/os/osDef.h
index 6f6199de7af6a09d7be1b4b60009f2d7507f2d46..14f38eb7ffbe15dbf07ca5e57f6963f1624a7352 100644
--- a/include/os/osDef.h
+++ b/include/os/osDef.h
@@ -22,7 +22,10 @@ extern "C" {
#if defined(_TD_DARWIN_64)
// specific
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
typedef int(*__compar_fn_t)(const void *, const void *);
+#endif
// for send function in tsocket.c
#if defined(MSG_NOSIGNAL)
@@ -41,7 +44,10 @@ extern "C" {
#endif
#if defined(_ALPINE)
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
typedef int(*__compar_fn_t)(const void *, const void *);
+#endif
void error (int, int, const char *);
#ifndef PTHREAD_MUTEX_RECURSIVE_NP
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
@@ -54,7 +60,10 @@ extern "C" {
char *stpncpy (char *dest, const char *src, size_t n);
// specific
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
typedef int (*__compar_fn_t)(const void *, const void *);
+#endif
#define ssize_t int
#define _SSIZE_T_
#define bzero(ptr, size) memset((ptr), 0, (size))
@@ -69,7 +78,6 @@ extern "C" {
char * strsep(char **stringp, const char *delim);
char * getpass(const char *prefix);
char * strndup(const char *s, size_t n);
- int gettimeofday(struct timeval *ptv, void *pTimeZone);
// for send function in tsocket.c
#define MSG_NOSIGNAL 0
diff --git a/include/util/taoserror.h b/include/util/taoserror.h
index ce434612c3026a043d76787005dd5dddda855bd9..c057d48875822b2330342bf170d1b69a24391368 100644
--- a/include/util/taoserror.h
+++ b/include/util/taoserror.h
@@ -584,7 +584,8 @@ int32_t* taosGetErrno();
#define TSDB_CODE_PAR_INVALID_INTERP_CLAUSE TAOS_DEF_ERROR_CODE(0, 0x265D)
#define TSDB_CODE_PAR_NO_VALID_FUNC_IN_WIN TAOS_DEF_ERROR_CODE(0, 0x265E)
#define TSDB_CODE_PAR_ONLY_SUPPORT_SINGLE_TABLE TAOS_DEF_ERROR_CODE(0, 0x265F)
-#define TSDB_CODE_PAR_INVALID_SMA_INDEX TAOS_DEF_ERROR_CODE(0, 0x265C)
+#define TSDB_CODE_PAR_INVALID_SMA_INDEX TAOS_DEF_ERROR_CODE(0, 0x2660)
+#define TSDB_CODE_PAR_INVALID_SELECTED_EXPR TAOS_DEF_ERROR_CODE(0, 0x2661)
//planner
#define TSDB_CODE_PLAN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x2700)
diff --git a/include/util/tencode.h b/include/util/tencode.h
index e318d4f2400065c3a8926c06f36c7d077fb5b45a..ad642cd612db4d1bb31f57b7a49d977e90978ee5 100644
--- a/include/util/tencode.h
+++ b/include/util/tencode.h
@@ -440,7 +440,7 @@ static FORCE_INLINE bool tDecodeIsEnd(SDecoder* pCoder) { return (pCoder->size =
static FORCE_INLINE void* tEncoderMalloc(SEncoder* pCoder, int32_t size) {
void* p = NULL;
- SCoderMem* pMem = (SCoderMem*)taosMemoryMalloc(sizeof(*pMem) + size);
+ SCoderMem* pMem = (SCoderMem*)taosMemoryCalloc(1, sizeof(*pMem) + size);
if (pMem) {
pMem->next = pCoder->mList;
pCoder->mList = pMem;
@@ -451,7 +451,7 @@ static FORCE_INLINE void* tEncoderMalloc(SEncoder* pCoder, int32_t size) {
static FORCE_INLINE void* tDecoderMalloc(SDecoder* pCoder, int32_t size) {
void* p = NULL;
- SCoderMem* pMem = (SCoderMem*)taosMemoryMalloc(sizeof(*pMem) + size);
+ SCoderMem* pMem = (SCoderMem*)taosMemoryCalloc(1, sizeof(*pMem) + size);
if (pMem) {
pMem->next = pCoder->mList;
pCoder->mList = pMem;
diff --git a/include/util/tlog.h b/include/util/tlog.h
index a8c9eeabdea712bba37a461c053dbd5ca41d7fe7..d186c328412d5eb25983103afced9d3e00c8dccd 100644
--- a/include/util/tlog.h
+++ b/include/util/tlog.h
@@ -94,7 +94,7 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons
#define pError(...) { taosPrintLog("APP ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }
#define pPrint(...) { taosPrintLog("APP ", DEBUG_INFO, 255, __VA_ARGS__); }
// clang-format on
-#define BUF_PAGE_DEBUG
+//#define BUF_PAGE_DEBUG
#ifdef __cplusplus
}
#endif
diff --git a/include/util/tqueue.h b/include/util/tqueue.h
index 466c577c0079d07774722ff2efdd30bf207e0fc3..0f4f1db9eee4c1b57e25464cd947c1c96218fbec 100644
--- a/include/util/tqueue.h
+++ b/include/util/tqueue.h
@@ -44,6 +44,8 @@ typedef struct STaosQset STaosQset;
typedef struct STaosQall STaosQall;
typedef struct {
void *ahandle;
+ void *fp;
+ void *queue;
int32_t workerId;
int32_t threadNum;
int64_t timestamp;
@@ -65,6 +67,7 @@ void taosFreeQitem(void *pItem);
void taosWriteQitem(STaosQueue *queue, void *pItem);
int32_t taosReadQitem(STaosQueue *queue, void **ppItem);
bool taosQueueEmpty(STaosQueue *queue);
+void taosUpdateItemSize(STaosQueue *queue, int32_t items);
int32_t taosQueueItemSize(STaosQueue *queue);
int64_t taosQueueMemorySize(STaosQueue *queue);
@@ -81,8 +84,8 @@ int32_t taosAddIntoQset(STaosQset *qset, STaosQueue *queue, void *ahandle);
void taosRemoveFromQset(STaosQset *qset, STaosQueue *queue);
int32_t taosGetQueueNumber(STaosQset *qset);
-int32_t taosReadQitemFromQset(STaosQset *qset, void **ppItem, int64_t *ts, void **ahandle, FItem *itemFp);
-int32_t taosReadAllQitemsFromQset(STaosQset *qset, STaosQall *qall, void **ahandle, FItems *itemsFp);
+int32_t taosReadQitemFromQset(STaosQset *qset, void **ppItem, SQueueInfo *qinfo);
+int32_t taosReadAllQitemsFromQset(STaosQset *qset, STaosQall *qall, SQueueInfo *qinfo);
void taosResetQsetThread(STaosQset *qset, void *pItem);
extern int64_t tsRpcQueueMemoryAllowed;
diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h
index 641d235dd10ab7c815955d7df813d000ec2a61d9..367e656f064a200ace8a051a88a554808f7dae61 100644
--- a/source/client/inc/clientInt.h
+++ b/source/client/inc/clientInt.h
@@ -181,6 +181,7 @@ typedef struct SRequestSendRecvBody {
tsem_t rspSem; // not used now
__taos_async_fn_t queryFp;
__taos_async_fn_t fetchFp;
+ EQueryExecMode execMode;
void* param;
SDataBuf requestMsg;
int64_t queryJob; // query job, created according to sql query DAG.
@@ -223,8 +224,8 @@ typedef struct SRequestObj {
SArray* tableList;
SQueryExecMetric metric;
SRequestSendRecvBody body;
- bool stableQuery; // todo refactor
- bool validateOnly; // todo refactor
+ bool stableQuery; // todo refactor
+ bool validateOnly; // todo refactor
bool killed;
uint32_t prevCode; // previous error code: todo refactor, add update flag for catalog
@@ -325,7 +326,8 @@ int32_t parseSql(SRequestObj* pRequest, bool topicQuery, SQuery** pQuery, SStmtC
int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArray* pNodeList);
-int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, bool validateSql, SRequestObj** pRequest);
+int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, bool validateSql,
+ SRequestObj** pRequest);
void taos_close_internal(void* taos);
@@ -359,9 +361,6 @@ int32_t removeMeta(STscObj* pTscObj, SArray* tbList); // todo move to clie
int32_t handleAlterTbExecRes(void* res, struct SCatalog* pCatalog); // todo move to xxx
bool qnodeRequired(SRequestObj* pRequest);
-void initTscQhandle();
-void cleanupTscQhandle();
-
#ifdef __cplusplus
}
#endif
diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c
index 6805e4d501e5128fb967bfd2e868a9751d17b10b..207ac01a2c46eb50123ce6e108c617d74560de74 100644
--- a/source/client/src/clientEnv.c
+++ b/source/client/src/clientEnv.c
@@ -35,22 +35,10 @@ SAppInfo appInfo;
int32_t clientReqRefPool = -1;
int32_t clientConnRefPool = -1;
-void *tscQhandle = NULL;
-
static TdThreadOnce tscinit = PTHREAD_ONCE_INIT;
volatile int32_t tscInitRes = 0;
-void initTscQhandle() {
- // init handle
- tscQhandle = taosInitScheduler(4096, 5, "tsc");
-}
-
-void cleanupTscQhandle() {
- // destroy handle
- taosCleanUpScheduler(tscQhandle);
-}
-
-static int32_t registerRequest(SRequestObj *pRequest, STscObj* pTscObj) {
+static int32_t registerRequest(SRequestObj *pRequest, STscObj *pTscObj) {
// connection has been released already, abort creating request.
pRequest->self = taosAddRef(clientReqRefPool, pRequest);
@@ -72,7 +60,7 @@ static int32_t registerRequest(SRequestObj *pRequest, STscObj* pTscObj) {
static void deregisterRequest(SRequestObj *pRequest) {
assert(pRequest != NULL);
- STscObj * pTscObj = pRequest->pTscObj;
+ STscObj *pTscObj = pRequest->pTscObj;
SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary;
int32_t currentInst = atomic_sub_fetch_64((int64_t *)&pActivity->currentRequests, 1);
@@ -97,7 +85,8 @@ void closeTransporter(SAppInstInfo *pAppInfo) {
static bool clientRpcRfp(int32_t code, tmsg_t msgType) {
if (NEED_REDIRECT_ERROR(code)) {
- if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH || msgType == TDMT_SCH_MERGE_FETCH) {
+ if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH ||
+ msgType == TDMT_SCH_MERGE_FETCH) {
return false;
}
return true;
@@ -251,7 +240,7 @@ void *createRequest(uint64_t connId, int32_t type) {
return NULL;
}
- STscObj* pTscObj = acquireTscObj(connId);
+ STscObj *pTscObj = acquireTscObj(connId);
if (pTscObj == NULL) {
terrno = TSDB_CODE_TSC_DISCONNECTED;
return NULL;
@@ -348,7 +337,6 @@ void taos_init_imp(void) {
// In the APIs of other program language, taos_cleanup is not available yet.
// So, to make sure taos_cleanup will be invoked to clean up the allocated resource to suppress the valgrind warning.
atexit(taos_cleanup);
- initTscQhandle();
errno = TSDB_CODE_SUCCESS;
taosSeedRand(taosGetTimestampSec());
@@ -407,7 +395,7 @@ int taos_options_imp(TSDB_OPTION option, const char *str) {
return 0;
}
- SConfig * pCfg = taosGetCfg();
+ SConfig *pCfg = taosGetCfg();
SConfigItem *pItem = NULL;
switch (option) {
diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c
index 3605f49a5ce5e0ef00adbe1d3159225dd3be6049..d846cb93af6a2c16fd21d2f954b8393e426aa27a 100644
--- a/source/client/src/clientImpl.c
+++ b/source/client/src/clientImpl.c
@@ -153,7 +153,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
*pRequest = createRequest(connId, TSDB_SQL_SELECT);
if (*pRequest == NULL) {
tscError("failed to malloc sqlObj, %s", sql);
- return TSDB_CODE_TSC_OUT_OF_MEMORY;
+ return terrno;
}
(*pRequest)->sqlstr = taosMemoryMalloc(sqlLen + 1);
@@ -933,6 +933,8 @@ SRequestObj* launchQuery(uint64_t connId, const char* sql, int sqlLen, bool vali
void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultMeta) {
int32_t code = 0;
+ pRequest->body.execMode = pQuery->execMode;
+
switch (pQuery->execMode) {
case QUERY_EXEC_MODE_LOCAL:
asyncExecLocalCmd(pRequest, pQuery);
@@ -1149,7 +1151,6 @@ STscObj* taosConnectImpl(const char* user, const char* auth, const char* db, __t
SRequestObj* pRequest = createRequest(pTscObj->id, TDMT_MND_CONNECT);
if (pRequest == NULL) {
destroyTscObj(pTscObj);
- terrno = TSDB_CODE_TSC_OUT_OF_MEMORY;
return NULL;
}
@@ -1274,8 +1275,8 @@ typedef struct SchedArg {
SEpSet* pEpset;
} SchedArg;
-void doProcessMsgFromServer(SSchedMsg* schedMsg) {
- SchedArg* arg = (SchedArg*)schedMsg->ahandle;
+int32_t doProcessMsgFromServer(void* param) {
+ SchedArg* arg = (SchedArg*)param;
SRpcMsg* pMsg = &arg->msg;
SEpSet* pEpSet = arg->pEpset;
@@ -1328,11 +1329,10 @@ void doProcessMsgFromServer(SSchedMsg* schedMsg) {
rpcFreeCont(pMsg->pCont);
destroySendMsgInfo(pSendInfo);
taosMemoryFree(arg);
+ return TSDB_CODE_SUCCESS;
}
void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
- SSchedMsg schedMsg = {0};
-
SEpSet* tEpSet = NULL;
if (pEpSet != NULL) {
tEpSet = taosMemoryCalloc(1, sizeof(SEpSet));
@@ -1343,9 +1343,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
arg->msg = *pMsg;
arg->pEpset = tEpSet;
- schedMsg.fp = doProcessMsgFromServer;
- schedMsg.ahandle = arg;
- taosScheduleTask(tscQhandle, &schedMsg);
+ taosAsyncExec(doProcessMsgFromServer, arg, NULL);
}
TAOS* taos_connect_auth(const char* ip, const char* user, const char* auth, const char* db, uint16_t port) {
diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c
index d3fdfa7a39595569c1e2a7f819e3fc1d7671819d..14a431feabab2934aed0a7eee46f85dbdae2009c 100644
--- a/source/client/src/clientMain.c
+++ b/source/client/src/clientMain.c
@@ -49,7 +49,7 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) {
}
// this function may be called by user or system, or by both simultaneously.
void taos_cleanup(void) {
- tscInfo("start to cleanup client environment");
+ tscDebug("start to cleanup client environment");
if (atomic_val_compare_exchange_32(&sentinel, TSC_VAR_NOT_RELEASE, TSC_VAR_RELEASED) != TSC_VAR_NOT_RELEASE) {
return;
}
@@ -58,7 +58,10 @@ void taos_cleanup(void) {
clientReqRefPool = -1;
taosCloseRef(id);
- cleanupTaskQueue();
+ hbMgrCleanUp();
+
+ catalogDestroy();
+ schedulerDestroy();
fmFuncMgtDestroy();
qCleanupKeywordsTable();
@@ -67,13 +70,11 @@ void taos_cleanup(void) {
clientConnRefPool = -1;
taosCloseRef(id);
- hbMgrCleanUp();
+ rpcCleanup();
+ tscDebug("rpc cleanup");
- catalogDestroy();
- schedulerDestroy();
+ cleanupTaskQueue();
- cleanupTscQhandle();
- rpcCleanup();
tscInfo("all local resources released");
taosCleanupCfg();
taosCloseLog();
@@ -242,7 +243,7 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) {
#endif
} else if (TD_RES_TMQ(res)) {
- SMqRspObj * msg = ((SMqRspObj *)res);
+ SMqRspObj *msg = ((SMqRspObj *)res);
SReqResultInfo *pResultInfo;
if (msg->resIter == -1) {
pResultInfo = tmqGetNextResInfo(res, true);
@@ -418,7 +419,7 @@ int taos_affected_rows(TAOS_RES *res) {
return 0;
}
- SRequestObj * pRequest = (SRequestObj *)res;
+ SRequestObj *pRequest = (SRequestObj *)res;
SReqResultInfo *pResInfo = &pRequest->body.resInfo;
return pResInfo->numOfRows;
}
@@ -601,7 +602,7 @@ int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex) {
}
SReqResultInfo *pResInfo = tscGetCurResInfo(res);
- TAOS_FIELD * pField = &pResInfo->userFields[columnIndex];
+ TAOS_FIELD *pField = &pResInfo->userFields[columnIndex];
if (!IS_VAR_DATA_TYPE(pField->type)) {
return 0;
}
@@ -645,8 +646,8 @@ const char *taos_get_server_info(TAOS *taos) {
typedef struct SqlParseWrapper {
SParseContext *pCtx;
SCatalogReq catalogReq;
- SRequestObj * pRequest;
- SQuery * pQuery;
+ SRequestObj *pRequest;
+ SQuery *pQuery;
} SqlParseWrapper;
static void destorySqlParseWrapper(SqlParseWrapper *pWrapper) {
@@ -665,8 +666,8 @@ static void destorySqlParseWrapper(SqlParseWrapper *pWrapper) {
void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
SqlParseWrapper *pWrapper = (SqlParseWrapper *)param;
- SQuery * pQuery = pWrapper->pQuery;
- SRequestObj * pRequest = pWrapper->pRequest;
+ SQuery *pQuery = pWrapper->pQuery;
+ SRequestObj *pRequest = pWrapper->pRequest;
if (code == TSDB_CODE_SUCCESS) {
code = qAnalyseSqlSemantic(pWrapper->pCtx, &pWrapper->catalogReq, pResultMeta, pQuery);
@@ -684,7 +685,8 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
destorySqlParseWrapper(pWrapper);
- tscDebug("0x%"PRIx64" analysis semantics completed, start async query, reqId:0x%"PRIx64, pRequest->self, pRequest->requestId);
+ tscDebug("0x%" PRIx64 " analysis semantics completed, start async query, reqId:0x%" PRIx64, pRequest->self,
+ pRequest->requestId);
launchAsyncQuery(pRequest, pQuery, pResultMeta);
} else {
destorySqlParseWrapper(pWrapper);
@@ -705,7 +707,7 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
}
void taos_query_a(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param) {
- int64_t connId = *(int64_t*)taos;
+ int64_t connId = *(int64_t *)taos;
taosAsyncQueryImpl(connId, sql, fp, param, false);
}
@@ -739,7 +741,7 @@ int32_t createParseContext(const SRequestObj *pRequest, SParseContext **pCxt) {
void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
SParseContext *pCxt = NULL;
- STscObj * pTscObj = pRequest->pTscObj;
+ STscObj *pTscObj = pRequest->pTscObj;
int32_t code = 0;
if (pRequest->retry++ > REQUEST_TOTAL_EXEC_TIMES) {
@@ -852,31 +854,28 @@ void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
}
// all data has returned to App already, no need to try again
- if (pResultInfo->completed && (pRequest->body.queryJob != 0)) {
- pResultInfo->numOfRows = 0;
- pRequest->body.fetchFp(param, pRequest, pResultInfo->numOfRows);
- return;
- }
-
- // it is a local executed query, no need to do async fetch
- if (pRequest->body.queryJob == 0) {
- ASSERT(pResultInfo->completed && pResultInfo->numOfRows >= 0);
- if (pResultInfo->localResultFetched) {
- pResultInfo->numOfRows = 0;
- pResultInfo->current = 0;
- pRequest->body.fetchFp(param, pRequest, pResultInfo->numOfRows);
+ if (pResultInfo->completed) {
+ // it is a local executed query, no need to do async fetch
+ if (QUERY_EXEC_MODE_LOCAL == pRequest->body.execMode) {
+ ASSERT(pResultInfo->numOfRows >= 0);
+ if (pResultInfo->localResultFetched) {
+ pResultInfo->numOfRows = 0;
+ pResultInfo->current = 0;
+ } else {
+ pResultInfo->localResultFetched = true;
+ }
} else {
- pResultInfo->localResultFetched = true;
- pRequest->body.fetchFp(param, pRequest, pResultInfo->numOfRows);
+ pResultInfo->numOfRows = 0;
}
+
+ pRequest->body.fetchFp(param, pRequest, pResultInfo->numOfRows);
return;
}
-
SSchedulerReq req = {
- .syncReq = false,
- .fetchFp = fetchCallback,
- .cbParam = pRequest,
+ .syncReq = false,
+ .fetchFp = fetchCallback,
+ .cbParam = pRequest,
};
schedulerFetchRows(pRequest->body.queryJob, &req);
@@ -886,7 +885,7 @@ void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
ASSERT(res != NULL && fp != NULL);
ASSERT(TD_RES_QUERY(res));
- SRequestObj *pRequest = res;
+ SRequestObj *pRequest = res;
SReqResultInfo *pResultInfo = &pRequest->body.resInfo;
// set the current block is all consumed
@@ -928,7 +927,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
int64_t connId = *(int64_t *)taos;
const int32_t MAX_TABLE_NAME_LENGTH = 12 * 1024 * 1024; // 12MB list
int32_t code = 0;
- SRequestObj * pRequest = NULL;
+ SRequestObj *pRequest = NULL;
SCatalogReq catalogReq = {0};
if (NULL == tableNameList) {
@@ -950,7 +949,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
goto _return;
}
- STscObj* pTscObj = pRequest->pTscObj;
+ STscObj *pTscObj = pRequest->pTscObj;
code = transferTableNameList(tableNameList, pTscObj->acctId, pTscObj->db, &catalogReq.pTableMeta);
if (code) {
goto _return;
@@ -972,7 +971,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
goto _return;
}
- SSyncQueryParam* pParam = pRequest->body.param;
+ SSyncQueryParam *pParam = pRequest->body.param;
tsem_wait(&pParam->sem);
_return:
diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c
index dcccbb17c98472d1b1a13d3eea9a255be0763494..94bd5dd7871fa7fa636bfd9c8aa6ff90097ff3e1 100644
--- a/source/client/src/clientMsgHandler.c
+++ b/source/client/src/clientMsgHandler.c
@@ -179,7 +179,6 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
if (code != 0) {
terrno = code;
if (output.dbVgroup) taosHashCleanup(output.dbVgroup->vgHash);
- taosMemoryFreeClear(output.dbVgroup);
tscError("0x%" PRIx64 " failed to build use db output since %s", pRequest->requestId, terrstr());
} else if (output.dbVgroup && output.dbVgroup->vgHash) {
@@ -189,12 +188,14 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
if (code1 != TSDB_CODE_SUCCESS) {
tscWarn("catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", pRequest->pTscObj->pAppInfo->clusterId,
tstrerror(code1));
- taosMemoryFreeClear(output.dbVgroup);
} else {
catalogUpdateDBVgInfo(pCatalog, output.db, output.dbId, output.dbVgroup);
+ output.dbVgroup = NULL;
}
}
+ taosMemoryFreeClear(output.dbVgroup);
+
tFreeSUsedbRsp(&usedbRsp);
char db[TSDB_DB_NAME_LEN] = {0};
diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c
index 6e689adf957ae9be4e4f3b06f17d25278507ee69..9ac34cf2df8e9b6b7ed5482bf56259c61a2b7f79 100644
--- a/source/client/src/clientSml.c
+++ b/source/client/src/clientSml.c
@@ -2256,7 +2256,7 @@ static int32_t smlInsertData(SSmlHandle *info) {
(*pMeta)->tableMeta->uid = tableData->uid; // one table merge data block together according uid
code = smlBindData(info->exec, tableData->tags, (*pMeta)->cols, tableData->cols, info->dataFormat,
- (*pMeta)->tableMeta, tableData->childTableName, info->msgBuf.buf, info->msgBuf.len);
+ (*pMeta)->tableMeta, tableData->childTableName, tableData->sTableName, tableData->sTableNameLen, info->msgBuf.buf, info->msgBuf.len);
if (code != TSDB_CODE_SUCCESS) {
uError("SML:0x%" PRIx64 " smlBindData failed", info->id);
return code;
diff --git a/source/client/src/clientStmt.c b/source/client/src/clientStmt.c
index 92ed830dee05e413a6e950c53380dcf46aec7a0a..bf00965c7ad6f267d2d942d2a8e5d00e677026e9 100644
--- a/source/client/src/clientStmt.c
+++ b/source/client/src/clientStmt.c
@@ -136,7 +136,7 @@ int32_t stmtRestoreQueryFields(STscStmt* pStmt) {
return TSDB_CODE_SUCCESS;
}
-int32_t stmtUpdateBindInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, char* tbFName) {
+int32_t stmtUpdateBindInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, char* tbFName, const char* sTableName) {
STscStmt* pStmt = (STscStmt*)stmt;
strncpy(pStmt->bInfo.tbFName, tbFName, sizeof(pStmt->bInfo.tbFName) - 1);
@@ -147,6 +147,7 @@ int32_t stmtUpdateBindInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags,
pStmt->bInfo.tbType = pTableMeta->tableType;
pStmt->bInfo.boundTags = tags;
pStmt->bInfo.tagsCached = false;
+ strcpy(pStmt->bInfo.stbFName, sTableName);
return TSDB_CODE_SUCCESS;
}
@@ -162,10 +163,10 @@ int32_t stmtUpdateExecInfo(TAOS_STMT* stmt, SHashObj* pVgHash, SHashObj* pBlockH
}
int32_t stmtUpdateInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, char* tbFName, bool autoCreateTbl,
- SHashObj* pVgHash, SHashObj* pBlockHash) {
+ SHashObj* pVgHash, SHashObj* pBlockHash, const char* sTableName) {
STscStmt* pStmt = (STscStmt*)stmt;
- STMT_ERR_RET(stmtUpdateBindInfo(stmt, pTableMeta, tags, tbFName));
+ STMT_ERR_RET(stmtUpdateBindInfo(stmt, pTableMeta, tags, tbFName, sTableName));
STMT_ERR_RET(stmtUpdateExecInfo(stmt, pVgHash, pBlockHash, autoCreateTbl));
pStmt->sql.autoCreateTbl = autoCreateTbl;
@@ -253,7 +254,7 @@ int32_t stmtCleanBindInfo(STscStmt* pStmt) {
destroyBoundColumnInfo(pStmt->bInfo.boundTags);
taosMemoryFreeClear(pStmt->bInfo.boundTags);
}
-
+ memset(pStmt->bInfo.stbFName, 0, TSDB_TABLE_FNAME_LEN);
return TSDB_CODE_SUCCESS;
}
@@ -592,7 +593,7 @@ int stmtSetTbTags(TAOS_STMT* stmt, TAOS_MULTI_BIND* tags) {
}
tscDebug("start to bind stmt tag values");
- STMT_ERR_RET(qBindStmtTagsValue(*pDataBlock, pStmt->bInfo.boundTags, pStmt->bInfo.tbSuid, pStmt->bInfo.sname.tname,
+ STMT_ERR_RET(qBindStmtTagsValue(*pDataBlock, pStmt->bInfo.boundTags, pStmt->bInfo.tbSuid, pStmt->bInfo.stbFName, pStmt->bInfo.sname.tname,
tags, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen));
return TSDB_CODE_SUCCESS;
diff --git a/source/client/src/tmq.c b/source/client/src/tmq.c
index 110b839216d1910cd6b7b892a613afd5ee6743be..ad47348c2291ecd4a0edabd1f1500b7d0031e34b 100644
--- a/source/client/src/tmq.c
+++ b/source/client/src/tmq.c
@@ -1149,11 +1149,10 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
tDecoderInit(&decoder, POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), pMsg->len - sizeof(SMqRspHead));
tDecodeSMqDataRsp(&decoder, &pRspWrapper->dataRsp);
memcpy(&pRspWrapper->dataRsp, pMsg->pData, sizeof(SMqRspHead));
- /*tDecodeSMqDataBlkRsp(POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), &pRspWrapper->dataRsp);*/
} else {
ASSERT(rspType == TMQ_MSG_TYPE__POLL_META_RSP);
- memcpy(&pRspWrapper->metaRsp, pMsg->pData, sizeof(SMqRspHead));
tDecodeSMqMetaRsp(POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), &pRspWrapper->metaRsp);
+ memcpy(&pRspWrapper->metaRsp, pMsg->pData, sizeof(SMqRspHead));
}
taosMemoryFree(pMsg->pData);
@@ -1859,9 +1858,9 @@ const char* tmq_get_table_name(TAOS_RES* res) {
return NULL;
}
-tmq_raw_data* tmq_get_raw_meta(TAOS_RES* res) {
+tmq_raw_data *tmq_get_raw_meta(TAOS_RES* res) {
if (TD_RES_TMQ_META(res)) {
- tmq_raw_data* raw = taosMemoryCalloc(1, sizeof(tmq_raw_data));
+ tmq_raw_data *raw = taosMemoryCalloc(1, sizeof(tmq_raw_data));
SMqMetaRspObj* pMetaRspObj = (SMqMetaRspObj*)res;
raw->raw_meta = pMetaRspObj->metaRsp.metaRsp;
raw->raw_meta_len = pMetaRspObj->metaRsp.metaRspLen;
@@ -1871,8 +1870,7 @@ tmq_raw_data* tmq_get_raw_meta(TAOS_RES* res) {
return NULL;
}
-static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* schemaTag, char* name, int64_t id,
- int8_t t) {
+static char *buildCreateTableJson(SSchemaWrapper *schemaRow, SSchemaWrapper* schemaTag, char* name, int64_t id, int8_t t){
char* string = NULL;
cJSON* json = cJSON_CreateObject();
if (json == NULL) {
@@ -1881,32 +1879,32 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch
cJSON* type = cJSON_CreateString("create");
cJSON_AddItemToObject(json, "type", type);
- char uid[32] = {0};
- sprintf(uid, "%" PRIi64, id);
- cJSON* id_ = cJSON_CreateString(uid);
- cJSON_AddItemToObject(json, "id", id_);
+// char uid[32] = {0};
+// sprintf(uid, "%"PRIi64, id);
+// cJSON* id_ = cJSON_CreateString(uid);
+// cJSON_AddItemToObject(json, "id", id_);
cJSON* tableName = cJSON_CreateString(name);
cJSON_AddItemToObject(json, "tableName", tableName);
cJSON* tableType = cJSON_CreateString(t == TSDB_NORMAL_TABLE ? "normal" : "super");
cJSON_AddItemToObject(json, "tableType", tableType);
- // cJSON* version = cJSON_CreateNumber(1);
- // cJSON_AddItemToObject(json, "version", version);
+// cJSON* version = cJSON_CreateNumber(1);
+// cJSON_AddItemToObject(json, "version", version);
cJSON* columns = cJSON_CreateArray();
- for (int i = 0; i < schemaRow->nCols; i++) {
- cJSON* column = cJSON_CreateObject();
- SSchema* s = schemaRow->pSchema + i;
- cJSON* cname = cJSON_CreateString(s->name);
+ for(int i = 0; i < schemaRow->nCols; i++){
+ cJSON* column = cJSON_CreateObject();
+ SSchema *s = schemaRow->pSchema + i;
+ cJSON* cname = cJSON_CreateString(s->name);
cJSON_AddItemToObject(column, "name", cname);
cJSON* ctype = cJSON_CreateNumber(s->type);
cJSON_AddItemToObject(column, "type", ctype);
- if (s->type == TSDB_DATA_TYPE_BINARY) {
+ if(s->type == TSDB_DATA_TYPE_BINARY){
int32_t length = s->bytes - VARSTR_HEADER_SIZE;
- cJSON* cbytes = cJSON_CreateNumber(length);
+ cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(column, "length", cbytes);
- } else if (s->type == TSDB_DATA_TYPE_NCHAR) {
- int32_t length = (s->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE;
- cJSON* cbytes = cJSON_CreateNumber(length);
+ }else if (s->type == TSDB_DATA_TYPE_NCHAR){
+ int32_t length = (s->bytes - VARSTR_HEADER_SIZE)/TSDB_NCHAR_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(column, "length", cbytes);
}
cJSON_AddItemToArray(columns, column);
@@ -1914,20 +1912,20 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch
cJSON_AddItemToObject(json, "columns", columns);
cJSON* tags = cJSON_CreateArray();
- for (int i = 0; schemaTag && i < schemaTag->nCols; i++) {
- cJSON* tag = cJSON_CreateObject();
- SSchema* s = schemaTag->pSchema + i;
- cJSON* tname = cJSON_CreateString(s->name);
+ for(int i = 0; schemaTag && i < schemaTag->nCols; i++){
+ cJSON* tag = cJSON_CreateObject();
+ SSchema *s = schemaTag->pSchema + i;
+ cJSON* tname = cJSON_CreateString(s->name);
cJSON_AddItemToObject(tag, "name", tname);
cJSON* ttype = cJSON_CreateNumber(s->type);
cJSON_AddItemToObject(tag, "type", ttype);
- if (s->type == TSDB_DATA_TYPE_BINARY) {
+ if(s->type == TSDB_DATA_TYPE_BINARY){
int32_t length = s->bytes - VARSTR_HEADER_SIZE;
- cJSON* cbytes = cJSON_CreateNumber(length);
+ cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(tag, "length", cbytes);
- } else if (s->type == TSDB_DATA_TYPE_NCHAR) {
- int32_t length = (s->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE;
- cJSON* cbytes = cJSON_CreateNumber(length);
+ }else if (s->type == TSDB_DATA_TYPE_NCHAR){
+ int32_t length = (s->bytes - VARSTR_HEADER_SIZE)/TSDB_NCHAR_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(tag, "length", cbytes);
}
cJSON_AddItemToArray(tags, tag);
@@ -1939,13 +1937,105 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch
return string;
}
-static char* processCreateStb(SMqMetaRsp* metaRsp) {
+static char *buildAlterSTableJson(void* alterData, int32_t alterDataLen){
+ SMAlterStbReq req = {0};
+ cJSON* json = NULL;
+ char* string = NULL;
+
+ if (tDeserializeSMAlterStbReq(alterData, alterDataLen, &req) != 0) {
+ goto end;
+ }
+
+ json = cJSON_CreateObject();
+ if (json == NULL) {
+ goto end;
+ }
+ cJSON* type = cJSON_CreateString("alter");
+ cJSON_AddItemToObject(json, "type", type);
+// cJSON* uid = cJSON_CreateNumber(id);
+// cJSON_AddItemToObject(json, "uid", uid);
+ SName name = {0};
+ tNameFromString(&name, req.name, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE);
+ cJSON* tableName = cJSON_CreateString(name.tname);
+ cJSON_AddItemToObject(json, "tableName", tableName);
+ cJSON* tableType = cJSON_CreateString("super");
+ cJSON_AddItemToObject(json, "tableType", tableType);
+
+ cJSON* alterType = cJSON_CreateNumber(req.alterType);
+ cJSON_AddItemToObject(json, "alterType", alterType);
+ switch (req.alterType) {
+ case TSDB_ALTER_TABLE_ADD_TAG:
+ case TSDB_ALTER_TABLE_ADD_COLUMN: {
+ TAOS_FIELD *field = taosArrayGet(req.pFields, 0);
+ cJSON* colName = cJSON_CreateString(field->name);
+ cJSON_AddItemToObject(json, "colName", colName);
+ cJSON* colType = cJSON_CreateNumber(field->type);
+ cJSON_AddItemToObject(json, "colType", colType);
+
+ if(field->type == TSDB_DATA_TYPE_BINARY){
+ int32_t length = field->bytes - VARSTR_HEADER_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
+ cJSON_AddItemToObject(json, "colLength", cbytes);
+ }else if (field->type == TSDB_DATA_TYPE_NCHAR){
+ int32_t length = (field->bytes - VARSTR_HEADER_SIZE)/TSDB_NCHAR_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
+ cJSON_AddItemToObject(json, "colLength", cbytes);
+ }
+ break;
+ }
+ case TSDB_ALTER_TABLE_DROP_TAG:
+ case TSDB_ALTER_TABLE_DROP_COLUMN:{
+ TAOS_FIELD *field = taosArrayGet(req.pFields, 0);
+ cJSON* colName = cJSON_CreateString(field->name);
+ cJSON_AddItemToObject(json, "colName", colName);
+ break;
+ }
+ case TSDB_ALTER_TABLE_UPDATE_TAG_BYTES:
+ case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES:{
+ TAOS_FIELD *field = taosArrayGet(req.pFields, 0);
+ cJSON* colName = cJSON_CreateString(field->name);
+ cJSON_AddItemToObject(json, "colName", colName);
+ cJSON* colType = cJSON_CreateNumber(field->type);
+ cJSON_AddItemToObject(json, "colType", colType);
+ if(field->type == TSDB_DATA_TYPE_BINARY){
+ int32_t length = field->bytes - VARSTR_HEADER_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
+ cJSON_AddItemToObject(json, "colLength", cbytes);
+ }else if (field->type == TSDB_DATA_TYPE_NCHAR){
+ int32_t length = (field->bytes - VARSTR_HEADER_SIZE)/TSDB_NCHAR_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
+ cJSON_AddItemToObject(json, "colLength", cbytes);
+ }
+ break;
+ }
+ case TSDB_ALTER_TABLE_UPDATE_TAG_NAME:
+ case TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME:{
+ TAOS_FIELD *oldField = taosArrayGet(req.pFields, 0);
+ TAOS_FIELD *newField = taosArrayGet(req.pFields, 1);
+ cJSON* colName = cJSON_CreateString(oldField->name);
+ cJSON_AddItemToObject(json, "colName", colName);
+ cJSON* colNewName = cJSON_CreateString(newField->name);
+ cJSON_AddItemToObject(json, "colNewName", colNewName);
+ break;
+ }
+ default:
+ break;
+ }
+ string = cJSON_PrintUnformatted(json);
+
+ end:
+ cJSON_Delete(json);
+ tFreeSMAltertbReq(&req);
+ return string;
+}
+
+static char *processCreateStb(SMqMetaRsp *metaRsp){
SVCreateStbReq req = {0};
SDecoder coder;
- char* string = NULL;
+ char* string = NULL;
// decode and process req
- void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
int32_t len = metaRsp->metaRspLen - sizeof(SMsgHead);
tDecoderInit(&coder, data, len);
@@ -1956,68 +2046,95 @@ static char* processCreateStb(SMqMetaRsp* metaRsp) {
tDecoderClear(&coder);
return string;
-_err:
+ _err:
+ tDecoderClear(&coder);
+ return string;
+}
+
+static char *processAlterStb(SMqMetaRsp *metaRsp){
+ SVCreateStbReq req = {0};
+ SDecoder coder;
+ char* string = NULL;
+
+ // decode and process req
+ void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
+ int32_t len = metaRsp->metaRspLen - sizeof(SMsgHead);
+ tDecoderInit(&coder, data, len);
+
+ if (tDecodeSVCreateStbReq(&coder, &req) < 0) {
+ goto _err;
+ }
+ string = buildAlterSTableJson(req.alterOriData, req.alterOriDataLen);
+ tDecoderClear(&coder);
+ return string;
+
+ _err:
tDecoderClear(&coder);
return string;
}
-static char* buildCreateCTableJson(STag* pTag, int64_t sid, char* name, int64_t id) {
+static char *buildCreateCTableJson(STag* pTag, char* sname, char* name, SArray* tagName, int64_t id){
char* string = NULL;
+ SArray* pTagVals = NULL;
cJSON* json = cJSON_CreateObject();
if (json == NULL) {
return string;
}
cJSON* type = cJSON_CreateString("create");
cJSON_AddItemToObject(json, "type", type);
- char cid[32] = {0};
- sprintf(cid, "%" PRIi64, id);
- cJSON* cid_ = cJSON_CreateString(cid);
- cJSON_AddItemToObject(json, "id", cid_);
+// char cid[32] = {0};
+// sprintf(cid, "%"PRIi64, id);
+// cJSON* cid_ = cJSON_CreateString(cid);
+// cJSON_AddItemToObject(json, "id", cid_);
cJSON* tableName = cJSON_CreateString(name);
cJSON_AddItemToObject(json, "tableName", tableName);
cJSON* tableType = cJSON_CreateString("child");
cJSON_AddItemToObject(json, "tableType", tableType);
-
- char sid_[32] = {0};
- sprintf(sid_, "%" PRIi64, sid);
- cJSON* using = cJSON_CreateString(sid_);
+ cJSON* using = cJSON_CreateString(sname);
cJSON_AddItemToObject(json, "using", using);
- // cJSON* version = cJSON_CreateNumber(1);
- // cJSON_AddItemToObject(json, "version", version);
+// cJSON* version = cJSON_CreateNumber(1);
+// cJSON_AddItemToObject(json, "version", version);
cJSON* tags = cJSON_CreateArray();
+ int32_t code = tTagToValArray(pTag, &pTagVals);
+ if (code) {
+ goto end;
+ }
- if (tTagIsJson(pTag)) { // todo
+ if (tTagIsJson(pTag)) {
+ STag* p = (STag*)pTag;
+ if(p->nTag == 0){
+ goto end;
+ }
char* pJson = parseTagDatatoJson(pTag);
-
cJSON* tag = cJSON_CreateObject();
- cJSON* tname = cJSON_CreateString("unknown"); // todo
+ STagVal* pTagVal = taosArrayGet(pTagVals, 0);
+
+ char* ptname = taosArrayGet(tagName, 0);
+ cJSON* tname = cJSON_CreateString(ptname);
cJSON_AddItemToObject(tag, "name", tname);
+// cJSON* cid_ = cJSON_CreateString("");
+// cJSON_AddItemToObject(tag, "cid", cid_);
cJSON* ttype = cJSON_CreateNumber(TSDB_DATA_TYPE_JSON);
cJSON_AddItemToObject(tag, "type", ttype);
cJSON* tvalue = cJSON_CreateString(pJson);
cJSON_AddItemToObject(tag, "value", tvalue);
cJSON_AddItemToArray(tags, tag);
- cJSON_AddItemToObject(json, "tags", tags);
-
- string = cJSON_PrintUnformatted(json);
- goto end;
- }
-
- SArray* pTagVals = NULL;
- int32_t code = tTagToValArray(pTag, &pTagVals);
- if (code) {
+ taosMemoryFree(pJson);
goto end;
}
- for (int i = 0; i < taosArrayGetSize(pTagVals); i++) {
+ for(int i = 0; i < taosArrayGetSize(pTagVals); i++){
STagVal* pTagVal = (STagVal*)taosArrayGet(pTagVals, i);
cJSON* tag = cJSON_CreateObject();
- // cJSON* tname = cJSON_CreateNumber(pTagVal->cid);
- cJSON* tname = cJSON_CreateString("unkonwn"); // todo
+
+ char* ptname = taosArrayGet(tagName, i);
+ cJSON* tname = cJSON_CreateString(ptname);
cJSON_AddItemToObject(tag, "name", tname);
+// cJSON* cid = cJSON_CreateNumber(pTagVal->cid);
+// cJSON_AddItemToObject(tag, "cid", cid);
cJSON* ttype = cJSON_CreateNumber(pTagVal->type);
cJSON_AddItemToObject(tag, "type", ttype);
@@ -2035,22 +2152,22 @@ static char* buildCreateCTableJson(STag* pTag, int64_t sid, char* name, int64_t
cJSON_AddItemToObject(tag, "value", tvalue);
cJSON_AddItemToArray(tags, tag);
}
+
+ end:
cJSON_AddItemToObject(json, "tags", tags);
string = cJSON_PrintUnformatted(json);
-
-end:
-
cJSON_Delete(json);
+ taosArrayDestroy(pTagVals);
return string;
}
-static char* processCreateTable(SMqMetaRsp* metaRsp) {
+static char *processCreateTable(SMqMetaRsp *metaRsp){
SDecoder decoder = {0};
SVCreateTbBatchReq req = {0};
- SVCreateTbReq* pCreateReq;
- char* string = NULL;
+ SVCreateTbReq *pCreateReq;
+ char *string = NULL;
// decode
- void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
int32_t len = metaRsp->metaRspLen - sizeof(SMsgHead);
tDecoderInit(&decoder, data, len);
if (tDecodeSVCreateTbBatchReq(&decoder, &req) < 0) {
@@ -2060,29 +2177,27 @@ static char* processCreateTable(SMqMetaRsp* metaRsp) {
// loop to create table
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
pCreateReq = req.pReqs + iReq;
- if (pCreateReq->type == TSDB_CHILD_TABLE) {
- string =
- buildCreateCTableJson((STag*)pCreateReq->ctb.pTag, pCreateReq->ctb.suid, pCreateReq->name, pCreateReq->uid);
- } else if (pCreateReq->type == TSDB_NORMAL_TABLE) {
- string =
- buildCreateTableJson(&pCreateReq->ntb.schemaRow, NULL, pCreateReq->name, pCreateReq->uid, TSDB_NORMAL_TABLE);
+ if(pCreateReq->type == TSDB_CHILD_TABLE){
+ string = buildCreateCTableJson((STag*)pCreateReq->ctb.pTag, pCreateReq->ctb.name, pCreateReq->name, pCreateReq->ctb.tagName, pCreateReq->uid);
+ }else if(pCreateReq->type == TSDB_NORMAL_TABLE){
+ string = buildCreateTableJson(&pCreateReq->ntb.schemaRow, NULL, pCreateReq->name, pCreateReq->uid, TSDB_NORMAL_TABLE);
}
}
tDecoderClear(&decoder);
-_exit:
+ _exit:
tDecoderClear(&decoder);
return string;
}
-static char* processAlterTable(SMqMetaRsp* metaRsp) {
- SDecoder decoder = {0};
- SVAlterTbReq vAlterTbReq = {0};
- char* string = NULL;
+static char *processAlterTable(SMqMetaRsp *metaRsp){
+ SDecoder decoder = {0};
+ SVAlterTbReq vAlterTbReq = {0};
+ char *string = NULL;
// decode
- void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
int32_t len = metaRsp->metaRspLen - sizeof(SMsgHead);
tDecoderInit(&decoder, data, len);
if (tDecodeSVAlterTbReq(&decoder, &vAlterTbReq) < 0) {
@@ -2095,76 +2210,88 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) {
}
cJSON* type = cJSON_CreateString("alter");
cJSON_AddItemToObject(json, "type", type);
- // cJSON* uid = cJSON_CreateNumber(id);
- // cJSON_AddItemToObject(json, "uid", uid);
+// cJSON* uid = cJSON_CreateNumber(id);
+// cJSON_AddItemToObject(json, "uid", uid);
cJSON* tableName = cJSON_CreateString(vAlterTbReq.tbName);
cJSON_AddItemToObject(json, "tableName", tableName);
cJSON* tableType = cJSON_CreateString(vAlterTbReq.action == TSDB_ALTER_TABLE_UPDATE_TAG_VAL ? "child" : "normal");
cJSON_AddItemToObject(json, "tableType", tableType);
+ cJSON* alterType = cJSON_CreateNumber(vAlterTbReq.action);
+ cJSON_AddItemToObject(json, "alterType", alterType);
switch (vAlterTbReq.action) {
case TSDB_ALTER_TABLE_ADD_COLUMN: {
- cJSON* alterType = cJSON_CreateNumber(TSDB_ALTER_TABLE_ADD_COLUMN);
- cJSON_AddItemToObject(json, "alterType", alterType);
cJSON* colName = cJSON_CreateString(vAlterTbReq.colName);
cJSON_AddItemToObject(json, "colName", colName);
cJSON* colType = cJSON_CreateNumber(vAlterTbReq.type);
cJSON_AddItemToObject(json, "colType", colType);
- if (vAlterTbReq.type == TSDB_DATA_TYPE_BINARY) {
+ if(vAlterTbReq.type == TSDB_DATA_TYPE_BINARY){
int32_t length = vAlterTbReq.bytes - VARSTR_HEADER_SIZE;
- cJSON* cbytes = cJSON_CreateNumber(length);
+ cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(json, "colLength", cbytes);
- } else if (vAlterTbReq.type == TSDB_DATA_TYPE_NCHAR) {
- int32_t length = (vAlterTbReq.bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE;
- cJSON* cbytes = cJSON_CreateNumber(length);
+ }else if (vAlterTbReq.type == TSDB_DATA_TYPE_NCHAR){
+ int32_t length = (vAlterTbReq.bytes - VARSTR_HEADER_SIZE)/TSDB_NCHAR_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(json, "colLength", cbytes);
}
break;
}
- case TSDB_ALTER_TABLE_DROP_COLUMN: {
- cJSON* alterType = cJSON_CreateNumber(TSDB_ALTER_TABLE_DROP_COLUMN);
- cJSON_AddItemToObject(json, "alterType", alterType);
+ case TSDB_ALTER_TABLE_DROP_COLUMN:{
cJSON* colName = cJSON_CreateString(vAlterTbReq.colName);
cJSON_AddItemToObject(json, "colName", colName);
break;
}
- case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES: {
- cJSON* alterType = cJSON_CreateNumber(TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES);
- cJSON_AddItemToObject(json, "alterType", alterType);
+ case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES:{
cJSON* colName = cJSON_CreateString(vAlterTbReq.colName);
cJSON_AddItemToObject(json, "colName", colName);
- cJSON* colType = cJSON_CreateNumber(vAlterTbReq.type);
+ cJSON* colType = cJSON_CreateNumber(vAlterTbReq.colModType);
cJSON_AddItemToObject(json, "colType", colType);
- if (vAlterTbReq.type == TSDB_DATA_TYPE_BINARY) {
- int32_t length = vAlterTbReq.bytes - VARSTR_HEADER_SIZE;
- cJSON* cbytes = cJSON_CreateNumber(length);
+ if(vAlterTbReq.colModType == TSDB_DATA_TYPE_BINARY){
+ int32_t length = vAlterTbReq.colModBytes - VARSTR_HEADER_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(json, "colLength", cbytes);
- } else if (vAlterTbReq.type == TSDB_DATA_TYPE_NCHAR) {
- int32_t length = (vAlterTbReq.bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE;
- cJSON* cbytes = cJSON_CreateNumber(length);
+ }else if (vAlterTbReq.colModType == TSDB_DATA_TYPE_NCHAR){
+ int32_t length = (vAlterTbReq.colModBytes - VARSTR_HEADER_SIZE)/TSDB_NCHAR_SIZE;
+ cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(json, "colLength", cbytes);
}
break;
}
- case TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME: {
- cJSON* alterType = cJSON_CreateNumber(TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME);
- cJSON_AddItemToObject(json, "alterType", alterType);
+ case TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME:{
cJSON* colName = cJSON_CreateString(vAlterTbReq.colName);
cJSON_AddItemToObject(json, "colName", colName);
cJSON* colNewName = cJSON_CreateString(vAlterTbReq.colNewName);
cJSON_AddItemToObject(json, "colNewName", colNewName);
break;
}
- case TSDB_ALTER_TABLE_UPDATE_TAG_VAL: {
- cJSON* alterType = cJSON_CreateNumber(TSDB_ALTER_TABLE_UPDATE_TAG_VAL);
- cJSON_AddItemToObject(json, "alterType", alterType);
+ case TSDB_ALTER_TABLE_UPDATE_TAG_VAL:{
cJSON* tagName = cJSON_CreateString(vAlterTbReq.tagName);
cJSON_AddItemToObject(json, "colName", tagName);
- cJSON* colValue = cJSON_CreateString("invalid, todo"); // todo
- cJSON_AddItemToObject(json, "colValue", colValue);
- cJSON* isNull = cJSON_CreateBool(vAlterTbReq.isNull);
- cJSON_AddItemToObject(json, "colValueNull", isNull);
+
+ bool isNull = vAlterTbReq.isNull;
+ if(vAlterTbReq.tagType == TSDB_DATA_TYPE_JSON){
+ STag *jsonTag = (STag *)vAlterTbReq.pTagVal;
+ if(jsonTag->nTag == 0) isNull = true;
+ }
+ if (!isNull){
+ char* buf = NULL;
+
+ if (vAlterTbReq.tagType == TSDB_DATA_TYPE_JSON) {
+ ASSERT(tTagIsJson(vAlterTbReq.pTagVal) == true);
+ buf = parseTagDatatoJson(vAlterTbReq.pTagVal);
+ } else {
+ buf = taosMemoryCalloc(vAlterTbReq.nTagVal + 1, 1);
+ dataConverToStr(buf, vAlterTbReq.tagType, vAlterTbReq.pTagVal, vAlterTbReq.nTagVal, NULL);
+ }
+
+ cJSON* colValue = cJSON_CreateString(buf);
+ cJSON_AddItemToObject(json, "colValue", colValue);
+ taosMemoryFree(buf);
+ }
+
+ cJSON* isNullCJson = cJSON_CreateBool(isNull);
+ cJSON_AddItemToObject(json, "colValueNull", isNullCJson);
break;
}
default:
@@ -2172,18 +2299,18 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) {
}
string = cJSON_PrintUnformatted(json);
-_exit:
+ _exit:
tDecoderClear(&decoder);
return string;
}
-static char* processDropSTable(SMqMetaRsp* metaRsp) {
- SDecoder decoder = {0};
- SVDropStbReq req = {0};
- char* string = NULL;
+static char *processDropSTable(SMqMetaRsp *metaRsp){
+ SDecoder decoder = {0};
+ SVDropStbReq req = {0};
+ char *string = NULL;
// decode
- void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
int32_t len = metaRsp->metaRspLen - sizeof(SMsgHead);
tDecoderInit(&decoder, data, len);
if (tDecodeSVDropStbReq(&decoder, &req) < 0) {
@@ -2196,10 +2323,6 @@ static char* processDropSTable(SMqMetaRsp* metaRsp) {
}
cJSON* type = cJSON_CreateString("drop");
cJSON_AddItemToObject(json, "type", type);
- char uid[32] = {0};
- sprintf(uid, "%" PRIi64, req.suid);
- cJSON* id = cJSON_CreateString(uid);
- cJSON_AddItemToObject(json, "id", id);
cJSON* tableName = cJSON_CreateString(req.name);
cJSON_AddItemToObject(json, "tableName", tableName);
cJSON* tableType = cJSON_CreateString("super");
@@ -2207,18 +2330,18 @@ static char* processDropSTable(SMqMetaRsp* metaRsp) {
string = cJSON_PrintUnformatted(json);
-_exit:
+ _exit:
tDecoderClear(&decoder);
return string;
}
-static char* processDropTable(SMqMetaRsp* metaRsp) {
- SDecoder decoder = {0};
- SVDropTbBatchReq req = {0};
- char* string = NULL;
+static char *processDropTable(SMqMetaRsp *metaRsp){
+ SDecoder decoder = {0};
+ SVDropTbBatchReq req = {0};
+ char *string = NULL;
// decode
- void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(metaRsp->metaRsp, sizeof(SMsgHead));
int32_t len = metaRsp->metaRspLen - sizeof(SMsgHead);
tDecoderInit(&decoder, data, len);
if (tDecodeSVDropTbBatchReq(&decoder, &req) < 0) {
@@ -2231,67 +2354,71 @@ static char* processDropTable(SMqMetaRsp* metaRsp) {
}
cJSON* type = cJSON_CreateString("drop");
cJSON_AddItemToObject(json, "type", type);
- // cJSON* uid = cJSON_CreateNumber(id);
- // cJSON_AddItemToObject(json, "uid", uid);
- // cJSON* tableType = cJSON_CreateString("normal");
- // cJSON_AddItemToObject(json, "tableType", tableType);
+// cJSON* uid = cJSON_CreateNumber(id);
+// cJSON_AddItemToObject(json, "uid", uid);
+// cJSON* tableType = cJSON_CreateString("normal");
+// cJSON_AddItemToObject(json, "tableType", tableType);
cJSON* tableNameList = cJSON_CreateArray();
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
SVDropTbReq* pDropTbReq = req.pReqs + iReq;
- cJSON* tableName = cJSON_CreateString(pDropTbReq->name); // todo
+ cJSON* tableName = cJSON_CreateString(pDropTbReq->name);
cJSON_AddItemToArray(tableNameList, tableName);
}
cJSON_AddItemToObject(json, "tableNameList", tableNameList);
string = cJSON_PrintUnformatted(json);
-_exit:
+ _exit:
tDecoderClear(&decoder);
return string;
}
-char* tmq_get_json_meta(TAOS_RES* res) {
+char *tmq_get_json_meta(TAOS_RES *res){
if (!TD_RES_TMQ_META(res)) {
return NULL;
}
SMqMetaRspObj* pMetaRspObj = (SMqMetaRspObj*)res;
- if (pMetaRspObj->metaRsp.resMsgType == TDMT_VND_CREATE_STB) {
- return processCreateStb(&pMetaRspObj->metaRsp);
- } else if (pMetaRspObj->metaRsp.resMsgType == TDMT_VND_ALTER_STB) {
+ if(pMetaRspObj->metaRsp.resMsgType == TDMT_VND_CREATE_STB){
return processCreateStb(&pMetaRspObj->metaRsp);
- } else if (pMetaRspObj->metaRsp.resMsgType == TDMT_VND_DROP_STB) {
+ }else if(pMetaRspObj->metaRsp.resMsgType == TDMT_VND_ALTER_STB){
+ return processAlterStb(&pMetaRspObj->metaRsp);
+ }else if(pMetaRspObj->metaRsp.resMsgType == TDMT_VND_DROP_STB){
return processDropSTable(&pMetaRspObj->metaRsp);
- } else if (pMetaRspObj->metaRsp.resMsgType == TDMT_VND_CREATE_TABLE) {
+ }else if(pMetaRspObj->metaRsp.resMsgType == TDMT_VND_CREATE_TABLE){
return processCreateTable(&pMetaRspObj->metaRsp);
- } else if (pMetaRspObj->metaRsp.resMsgType == TDMT_VND_ALTER_TABLE) {
+ }else if(pMetaRspObj->metaRsp.resMsgType == TDMT_VND_ALTER_TABLE){
return processAlterTable(&pMetaRspObj->metaRsp);
- } else if (pMetaRspObj->metaRsp.resMsgType == TDMT_VND_DROP_TABLE) {
+ }else if(pMetaRspObj->metaRsp.resMsgType == TDMT_VND_DROP_TABLE){
return processDropTable(&pMetaRspObj->metaRsp);
}
return NULL;
}
-static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
+void tmq_free_json_meta(char* jsonMeta){
+ taosMemoryFreeClear(jsonMeta);
+}
+
+static int32_t taosCreateStb(TAOS *taos, void *meta, int32_t metaLen){
SVCreateStbReq req = {0};
SDecoder coder;
SMCreateStbReq pReq = {0};
- int32_t code = TSDB_CODE_SUCCESS;
- SRequestObj* pRequest = NULL;
+ int32_t code = TSDB_CODE_SUCCESS;
+ SRequestObj* pRequest = NULL;
code = buildRequest(*(int64_t*)taos, "", 0, NULL, false, &pRequest);
if (code != TSDB_CODE_SUCCESS) {
goto end;
}
- if (!pRequest->pDb) {
+ if(!pRequest->pDb){
code = TSDB_CODE_PAR_DB_NOT_SPECIFIED;
goto end;
}
// decode and process req
- void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
int32_t len = metaLen - sizeof(SMsgHead);
tDecoderInit(&coder, data, len);
if (tDecodeSVCreateStbReq(&coder, &req) < 0) {
@@ -2300,29 +2427,30 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
}
// build create stable
pReq.pColumns = taosArrayInit(req.schemaRow.nCols, sizeof(SField));
- for (int32_t i = 0; i < req.schemaRow.nCols; i++) {
+ for(int32_t i = 0; i < req.schemaRow.nCols; i++){
SSchema* pSchema = req.schemaRow.pSchema + i;
- SField field = {.type = pSchema->type, .bytes = pSchema->bytes};
+ SField field = {.type = pSchema->type, .bytes = pSchema->bytes};
strcpy(field.name, pSchema->name);
taosArrayPush(pReq.pColumns, &field);
}
pReq.pTags = taosArrayInit(req.schemaTag.nCols, sizeof(SField));
- for (int32_t i = 0; i < req.schemaTag.nCols; i++) {
+ for(int32_t i = 0; i < req.schemaTag.nCols; i++){
SSchema* pSchema = req.schemaTag.pSchema + i;
- SField field = {.type = pSchema->type, .bytes = pSchema->bytes};
+ SField field = {.type = pSchema->type, .bytes = pSchema->bytes};
strcpy(field.name, pSchema->name);
taosArrayPush(pReq.pTags, &field);
}
+
pReq.colVer = req.schemaRow.version;
pReq.tagVer = req.schemaTag.version;
pReq.numOfColumns = req.schemaRow.nCols;
pReq.numOfTags = req.schemaTag.nCols;
pReq.commentLen = -1;
pReq.suid = req.suid;
- pReq.source = 1;
+ pReq.source = TD_REQ_FROM_TAOX;
+ pReq.igExists = true;
STscObj* pTscObj = pRequest->pTscObj;
-
SName tableName;
tNameExtractFullName(toName(pTscObj->acctId, pRequest->pDb, req.name, &tableName), pReq.name);
@@ -2337,7 +2465,7 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
}
tSerializeSMCreateStbReq(pCmdMsg.pMsg, pCmdMsg.msgLen, &pReq);
- SQuery pQuery = {0};
+ SQuery pQuery = {0};
pQuery.execMode = QUERY_EXEC_MODE_RPC;
pQuery.pCmdMsg = &pCmdMsg;
pQuery.msgType = pQuery.pCmdMsg->msgType;
@@ -2347,18 +2475,18 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
code = pRequest->code;
taosMemoryFree(pCmdMsg.pMsg);
-end:
+ end:
destroyRequest(pRequest);
tFreeSMCreateStbReq(&pReq);
tDecoderClear(&coder);
return code;
}
-static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
+static int32_t taosDropStb(TAOS *taos, void *meta, int32_t metaLen){
SVDropStbReq req = {0};
SDecoder coder;
SMDropStbReq pReq = {0};
- int32_t code = TSDB_CODE_SUCCESS;
+ int32_t code = TSDB_CODE_SUCCESS;
SRequestObj* pRequest = NULL;
code = buildRequest(*(int64_t*)taos, "", 0, NULL, false, &pRequest);
@@ -2366,12 +2494,12 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
goto end;
}
- if (!pRequest->pDb) {
+ if(!pRequest->pDb){
code = TSDB_CODE_PAR_DB_NOT_SPECIFIED;
goto end;
}
// decode and process req
- void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
int32_t len = metaLen - sizeof(SMsgHead);
tDecoderInit(&coder, data, len);
if (tDecodeSVDropStbReq(&coder, &req) < 0) {
@@ -2381,11 +2509,10 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
// build drop stable
pReq.igNotExists = true;
- pReq.source = 1;
+ pReq.source = TD_REQ_FROM_TAOX;
pReq.suid = req.suid;
STscObj* pTscObj = pRequest->pTscObj;
-
SName tableName;
tNameExtractFullName(toName(pTscObj->acctId, pRequest->pDb, req.name, &tableName), pReq.name);
@@ -2400,7 +2527,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
}
tSerializeSMDropStbReq(pCmdMsg.pMsg, pCmdMsg.msgLen, &pReq);
- SQuery pQuery = {0};
+ SQuery pQuery = {0};
pQuery.execMode = QUERY_EXEC_MODE_RPC;
pQuery.pCmdMsg = &pCmdMsg;
pQuery.msgType = pQuery.pCmdMsg->msgType;
@@ -2410,7 +2537,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
code = pRequest->code;
taosMemoryFree(pCmdMsg.pMsg);
-end:
+ end:
destroyRequest(pRequest);
tDecoderClear(&coder);
return code;
@@ -2423,29 +2550,30 @@ typedef struct SVgroupCreateTableBatch {
} SVgroupCreateTableBatch;
static void destroyCreateTbReqBatch(void* data) {
- SVgroupCreateTableBatch* pTbBatch = (SVgroupCreateTableBatch*)data;
+ SVgroupCreateTableBatch* pTbBatch = (SVgroupCreateTableBatch*) data;
taosArrayDestroy(pTbBatch->req.pArray);
}
-static int32_t taosCreateTable(TAOS *taos, void *meta, int32_t metaLen){
- SVCreateTbBatchReq req = {0};
- SDecoder coder = {0};
- int32_t code = TSDB_CODE_SUCCESS;
- SRequestObj *pRequest = NULL;
- SQuery *pQuery = NULL;
- SHashObj *pVgroupHashmap = NULL;
+static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
+ SVCreateTbBatchReq req = {0};
+ SDecoder coder = {0};
+ int32_t code = TSDB_CODE_SUCCESS;
+ SRequestObj* pRequest = NULL;
+ SQuery* pQuery = NULL;
+ SHashObj* pVgroupHashmap = NULL;
- code = buildRequest(*(int64_t*) taos, "", 0, NULL, false, &pRequest);
+ code = buildRequest(*(int64_t*)taos, "", 0, NULL, false, &pRequest);
if (code != TSDB_CODE_SUCCESS) {
goto end;
}
- if (!pRequest->pDb) {
+
+ if(!pRequest->pDb){
code = TSDB_CODE_PAR_DB_NOT_SPECIFIED;
goto end;
}
// decode and process req
- void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
int32_t len = metaLen - sizeof(SMsgHead);
tDecoderInit(&coder, data, len);
if (tDecodeSVCreateTbBatchReq(&coder, &req) < 0) {
@@ -2455,8 +2583,8 @@ static int32_t taosCreateTable(TAOS *taos, void *meta, int32_t metaLen){
STscObj* pTscObj = pRequest->pTscObj;
- SVCreateTbReq *pCreateReq = NULL;
- SCatalog* pCatalog = NULL;
+ SVCreateTbReq* pCreateReq = NULL;
+ SCatalog* pCatalog = NULL;
code = catalogGetHandle(pTscObj->pAppInfo->clusterId, &pCatalog);
if (code != TSDB_CODE_SUCCESS) {
goto end;
@@ -2470,15 +2598,15 @@ static int32_t taosCreateTable(TAOS *taos, void *meta, int32_t metaLen){
taosHashSetFreeFp(pVgroupHashmap, destroyCreateTbReqBatch);
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
// loop to create table
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
pCreateReq = req.pReqs + iReq;
SVgroupInfo pInfo = {0};
- SName pName;
+ SName pName;
toName(pTscObj->acctId, pRequest->pDb, pCreateReq->name, &pName);
code = catalogGetTableHashVgroup(pCatalog, &conn, &pName, &pInfo);
if (code != TSDB_CODE_SUCCESS) {
@@ -2510,7 +2638,7 @@ static int32_t taosCreateTable(TAOS *taos, void *meta, int32_t metaLen){
pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE;
pQuery->msgType = TDMT_VND_CREATE_TABLE;
pQuery->stableQuery = false;
- pQuery->pRoot = nodesMakeNode(QUERY_NODE_CREATE_TABLE_STMT);
+ pQuery->pRoot = nodesMakeNode(QUERY_NODE_CREATE_TABLE_STMT);
code = rewriteToVnodeModifyOpStmt(pQuery, pBufArray);
if (code != TSDB_CODE_SUCCESS) {
@@ -2518,10 +2646,10 @@ static int32_t taosCreateTable(TAOS *taos, void *meta, int32_t metaLen){
}
launchQueryImpl(pRequest, pQuery, false, NULL);
- pQuery = NULL; // no need to free in the end
- code = pRequest->code;
+ pQuery = NULL; // no need to free in the end
+ code = pRequest->code;
-end:
+ end:
taosHashCleanup(pVgroupHashmap);
destroyRequest(pRequest);
tDecoderClear(&coder);
@@ -2540,25 +2668,25 @@ static void destroyDropTbReqBatch(void* data) {
taosArrayDestroy(pTbBatch->req.pArray);
}
-static int32_t taosDropTable(TAOS *taos, void *meta, int32_t metaLen){
- SVDropTbBatchReq req = {0};
- SDecoder coder = {0};
- int32_t code = TSDB_CODE_SUCCESS;
- SRequestObj *pRequest = NULL;
- SQuery *pQuery = NULL;
- SHashObj *pVgroupHashmap = NULL;
+static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
+ SVDropTbBatchReq req = {0};
+ SDecoder coder = {0};
+ int32_t code = TSDB_CODE_SUCCESS;
+ SRequestObj* pRequest = NULL;
+ SQuery* pQuery = NULL;
+ SHashObj* pVgroupHashmap = NULL;
code = buildRequest(*(int64_t*)taos, "", 0, NULL, false, &pRequest);
if (code != TSDB_CODE_SUCCESS) {
goto end;
}
- if (!pRequest->pDb) {
+ if(!pRequest->pDb){
code = TSDB_CODE_PAR_DB_NOT_SPECIFIED;
goto end;
}
// decode and process req
- void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
int32_t len = metaLen - sizeof(SMsgHead);
tDecoderInit(&coder, data, len);
if (tDecodeSVDropTbBatchReq(&coder, &req) < 0) {
@@ -2568,8 +2696,8 @@ static int32_t taosDropTable(TAOS *taos, void *meta, int32_t metaLen){
STscObj* pTscObj = pRequest->pTscObj;
- SVDropTbReq *pDropReq = NULL;
- SCatalog *pCatalog = NULL;
+ SVDropTbReq* pDropReq = NULL;
+ SCatalog* pCatalog = NULL;
code = catalogGetHandle(pTscObj->pAppInfo->clusterId, &pCatalog);
if (code != TSDB_CODE_SUCCESS) {
goto end;
@@ -2583,15 +2711,16 @@ static int32_t taosDropTable(TAOS *taos, void *meta, int32_t metaLen){
taosHashSetFreeFp(pVgroupHashmap, destroyDropTbReqBatch);
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
// loop to create table
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
pDropReq = req.pReqs + iReq;
+ pDropReq->igNotExists = true;
SVgroupInfo pInfo = {0};
- SName pName;
+ SName pName;
toName(pTscObj->acctId, pRequest->pDb, pDropReq->name, &pName);
code = catalogGetTableHashVgroup(pCatalog, &conn, &pName, &pInfo);
if (code != TSDB_CODE_SUCCESS) {
@@ -2621,7 +2750,7 @@ static int32_t taosDropTable(TAOS *taos, void *meta, int32_t metaLen){
pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE;
pQuery->msgType = TDMT_VND_DROP_TABLE;
pQuery->stableQuery = false;
- pQuery->pRoot = nodesMakeNode(QUERY_NODE_DROP_TABLE_STMT);
+ pQuery->pRoot = nodesMakeNode(QUERY_NODE_DROP_TABLE_STMT);
code = rewriteToVnodeModifyOpStmt(pQuery, pBufArray);
if (code != TSDB_CODE_SUCCESS) {
@@ -2629,10 +2758,10 @@ static int32_t taosDropTable(TAOS *taos, void *meta, int32_t metaLen){
}
launchQueryImpl(pRequest, pQuery, false, NULL);
- pQuery = NULL; // no need to free in the end
- code = pRequest->code;
+ pQuery = NULL; // no need to free in the end
+ code = pRequest->code;
-end:
+ end:
taosHashCleanup(pVgroupHashmap);
destroyRequest(pRequest);
tDecoderClear(&coder);
@@ -2649,18 +2778,18 @@ static int32_t taosAlterTable(TAOS *taos, void *meta, int32_t metaLen){
SArray *pArray = NULL;
SVgDataBlocks *pVgData = NULL;
-
code = buildRequest(*(int64_t*) taos, "", 0, NULL, false, &pRequest);
+
if (code != TSDB_CODE_SUCCESS) {
goto end;
}
- if (!pRequest->pDb) {
+ if(!pRequest->pDb){
code = TSDB_CODE_PAR_DB_NOT_SPECIFIED;
goto end;
}
// decode and process req
- void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
+ void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
int32_t len = metaLen - sizeof(SMsgHead);
tDecoderInit(&coder, data, len);
if (tDecodeSVAlterTbReq(&coder, &req) < 0) {
@@ -2669,24 +2798,24 @@ static int32_t taosAlterTable(TAOS *taos, void *meta, int32_t metaLen){
}
// do not deal TSDB_ALTER_TABLE_UPDATE_OPTIONS
- if (req.action == TSDB_ALTER_TABLE_UPDATE_OPTIONS) {
+ if(req.action == TSDB_ALTER_TABLE_UPDATE_OPTIONS){
goto end;
}
STscObj* pTscObj = pRequest->pTscObj;
- SCatalog* pCatalog = NULL;
+ SCatalog *pCatalog = NULL;
code = catalogGetHandle(pTscObj->pAppInfo->clusterId, &pCatalog);
if (code != TSDB_CODE_SUCCESS) {
goto end;
}
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
SVgroupInfo pInfo = {0};
- SName pName = {0};
+ SName pName = {0};
toName(pTscObj->acctId, pRequest->pDb, req.tbName, &pName);
code = catalogGetTableHashVgroup(pCatalog, &conn, &pName, &pInfo);
if (code != TSDB_CODE_SUCCESS) {
@@ -2720,7 +2849,7 @@ static int32_t taosAlterTable(TAOS *taos, void *meta, int32_t metaLen){
pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE;
pQuery->msgType = TDMT_VND_ALTER_TABLE;
pQuery->stableQuery = false;
- pQuery->pRoot = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT);
+ pQuery->pRoot = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT);
code = rewriteToVnodeModifyOpStmt(pQuery, pArray);
if (code != TSDB_CODE_SUCCESS) {
@@ -2728,14 +2857,17 @@ static int32_t taosAlterTable(TAOS *taos, void *meta, int32_t metaLen){
}
launchQueryImpl(pRequest, pQuery, false, NULL);
- pQuery = NULL; // no need to free in the end
+ pQuery = NULL; // no need to free in the end
pVgData = NULL;
- pArray = NULL;
- code = pRequest->code;
+ pArray = NULL;
+ code = pRequest->code;
+ if (code == TSDB_CODE_VND_TABLE_NOT_EXIST){
+ code = 0;
+ }
-end:
+ end:
taosArrayDestroy(pArray);
- if (pVgData) taosMemoryFreeClear(pVgData->pData);
+ if(pVgData) taosMemoryFreeClear(pVgData->pData);
taosMemoryFreeClear(pVgData);
destroyRequest(pRequest);
tDecoderClear(&coder);
@@ -2743,29 +2875,33 @@ end:
return code;
}
-int32_t taos_write_raw_meta(TAOS* taos, tmq_raw_data* raw_meta) {
+int32_t taos_write_raw_meta(TAOS *taos, tmq_raw_data *raw_meta){
if (!taos || !raw_meta) {
return TSDB_CODE_INVALID_PARA;
}
- if (raw_meta->raw_meta_type == TDMT_VND_CREATE_STB) {
+ if(raw_meta->raw_meta_type == TDMT_VND_CREATE_STB) {
return taosCreateStb(taos, raw_meta->raw_meta, raw_meta->raw_meta_len);
- } else if (raw_meta->raw_meta_type == TDMT_VND_ALTER_STB) {
+ }else if(raw_meta->raw_meta_type == TDMT_VND_ALTER_STB){
return taosCreateStb(taos, raw_meta->raw_meta, raw_meta->raw_meta_len);
- } else if (raw_meta->raw_meta_type == TDMT_VND_DROP_STB) {
+ }else if(raw_meta->raw_meta_type == TDMT_VND_DROP_STB){
return taosDropStb(taos, raw_meta->raw_meta, raw_meta->raw_meta_len);
- } else if (raw_meta->raw_meta_type == TDMT_VND_CREATE_TABLE) {
+ }else if(raw_meta->raw_meta_type == TDMT_VND_CREATE_TABLE){
return taosCreateTable(taos, raw_meta->raw_meta, raw_meta->raw_meta_len);
- } else if (raw_meta->raw_meta_type == TDMT_VND_ALTER_TABLE) {
+ }else if(raw_meta->raw_meta_type == TDMT_VND_ALTER_TABLE){
return taosAlterTable(taos, raw_meta->raw_meta, raw_meta->raw_meta_len);
- } else if (raw_meta->raw_meta_type == TDMT_VND_DROP_TABLE) {
+ }else if(raw_meta->raw_meta_type == TDMT_VND_DROP_TABLE){
return taosDropTable(taos, raw_meta->raw_meta, raw_meta->raw_meta_len);
}
return TSDB_CODE_INVALID_PARA;
}
+void tmq_free_raw_meta(tmq_raw_data *rawMeta){
+ taosMemoryFreeClear(rawMeta);
+}
+
void tmq_commit_async(tmq_t* tmq, const TAOS_RES* msg, tmq_commit_cb* cb, void* param) {
tmqCommitInner2(tmq, msg, 0, 1, cb, param);
}
-int32_t tmq_commit_sync(tmq_t* tmq, const TAOS_RES* msg) { return tmqCommitInner2(tmq, msg, 0, 0, NULL, NULL); }
+int32_t tmq_commit_sync(tmq_t* tmq, const TAOS_RES* msg) { return tmqCommitInner2(tmq, msg, 0, 0, NULL, NULL); }
\ No newline at end of file
diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c
index 38f46b9b11d92849c9b9b32f9ee0f5727f4debf9..47cfa5d4106c5368105abe18d2970a05203e4d8d 100644
--- a/source/common/src/tdatablock.c
+++ b/source/common/src/tdatablock.c
@@ -320,7 +320,9 @@ int32_t colDataAssign(SColumnInfoData* pColumnInfoData, const SColumnInfoData* p
memcpy(pColumnInfoData->pData, pSource->pData, pSource->varmeta.length);
} else {
memcpy(pColumnInfoData->nullbitmap, pSource->nullbitmap, BitmapLen(numOfRows));
- memcpy(pColumnInfoData->pData, pSource->pData, pSource->info.bytes * numOfRows);
+ if (pSource->pData) {
+ memcpy(pColumnInfoData->pData, pSource->pData, pSource->info.bytes * numOfRows);
+ }
}
pColumnInfoData->hasNull = pSource->hasNull;
@@ -540,8 +542,10 @@ int32_t blockDataToBuf(char* buf, const SSDataBlock* pBlock) {
}
int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
- pBlock->info.rows = *(int32_t*)buf;
+ int32_t numOfRows = *(int32_t*) buf;
+ blockDataEnsureCapacity(pBlock, numOfRows);
+ pBlock->info.rows = numOfRows;
size_t numOfCols = taosArrayGetSize(pBlock->pDataBlock);
const char* pStart = buf + sizeof(uint32_t);
@@ -587,6 +591,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
return TSDB_CODE_SUCCESS;
}
+// todo remove this
int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity) {
pBlock->info.rows = *(int32_t*)buf;
pBlock->info.groupId = *(uint64_t*)(buf + sizeof(int32_t));
@@ -1172,8 +1177,6 @@ int32_t colInfoDataEnsureCapacity(SColumnInfoData* pColumn, uint32_t numOfRows)
int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows) {
int32_t code = 0;
- // ASSERT(numOfRows > 0);
-
if (numOfRows == 0) {
return TSDB_CODE_SUCCESS;
}
@@ -1194,15 +1197,28 @@ int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows) {
return TSDB_CODE_SUCCESS;
}
+void blockDataFreeRes(SSDataBlock* pBlock) {
+ int32_t numOfOutput = taosArrayGetSize(pBlock->pDataBlock);
+ for (int32_t i = 0; i < numOfOutput; ++i) {
+ SColumnInfoData* pColInfoData = (SColumnInfoData*)taosArrayGet(pBlock->pDataBlock, i);
+ colDataDestroy(pColInfoData);
+ }
+
+ taosArrayDestroy(pBlock->pDataBlock);
+ taosMemoryFreeClear(pBlock->pBlockAgg);
+ memset(&pBlock->info, 0, sizeof(SDataBlockInfo));
+}
+
void* blockDataDestroy(SSDataBlock* pBlock) {
if (pBlock == NULL) {
return NULL;
}
- blockDestroyInner(pBlock);
+ blockDataFreeRes(pBlock);
taosMemoryFreeClear(pBlock);
return NULL;
}
+
int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src) {
ASSERT(src != NULL);
@@ -1736,56 +1752,57 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
int32_t colNum = taosArrayGetSize(pDataBlock->pDataBlock);
int32_t rows = pDataBlock->info.rows;
int32_t len = 0;
- len += snprintf(dumpBuf + len, size - len, "\n%s |block type %d |child id %d|group id:%" PRIu64 "|\n", flag,
- (int32_t)pDataBlock->info.type, pDataBlock->info.childId, pDataBlock->info.groupId);
+ len += snprintf(dumpBuf + len, size - len, "\n%s |block type %d |child id %d|group id:%" PRIu64 "| uid:%ld\n", flag,
+ (int32_t)pDataBlock->info.type, pDataBlock->info.childId, pDataBlock->info.groupId,
+ pDataBlock->info.uid);
if (len >= size - 1) return dumpBuf;
for (int32_t j = 0; j < rows; j++) {
len += snprintf(dumpBuf + len, size - len, "%s |", flag);
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
for (int32_t k = 0; k < colNum; k++) {
SColumnInfoData* pColInfoData = taosArrayGet(pDataBlock->pDataBlock, k);
void* var = POINTER_SHIFT(pColInfoData->pData, j * pColInfoData->info.bytes);
if (colDataIsNull(pColInfoData, rows, j, NULL) || !pColInfoData->pData) {
len += snprintf(dumpBuf + len, size - len, " %15s |", "NULL");
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
continue;
}
switch (pColInfoData->info.type) {
case TSDB_DATA_TYPE_TIMESTAMP:
formatTimestamp(pBuf, *(uint64_t*)var, TSDB_TIME_PRECISION_MILLI);
len += snprintf(dumpBuf + len, size - len, " %25s |", pBuf);
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
break;
case TSDB_DATA_TYPE_INT:
len += snprintf(dumpBuf + len, size - len, " %15d |", *(int32_t*)var);
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
break;
case TSDB_DATA_TYPE_UINT:
len += snprintf(dumpBuf + len, size - len, " %15u |", *(uint32_t*)var);
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
break;
case TSDB_DATA_TYPE_BIGINT:
len += snprintf(dumpBuf + len, size - len, " %15ld |", *(int64_t*)var);
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
break;
case TSDB_DATA_TYPE_UBIGINT:
len += snprintf(dumpBuf + len, size - len, " %15lu |", *(uint64_t*)var);
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
break;
case TSDB_DATA_TYPE_FLOAT:
len += snprintf(dumpBuf + len, size - len, " %15f |", *(float*)var);
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
break;
case TSDB_DATA_TYPE_DOUBLE:
len += snprintf(dumpBuf + len, size - len, " %15lf |", *(double*)var);
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
break;
}
}
len += snprintf(dumpBuf + len, size - len, "\n");
- if (len >= size -1) return dumpBuf;
+ if (len >= size - 1) return dumpBuf;
}
len += snprintf(dumpBuf + len, size - len, "%s |end\n", flag);
return dumpBuf;
diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c
index ec7be79934bf2d42909716f267d276fae4448e8d..8eeab77a157993bd8d89479b221982d3b1e5c336 100644
--- a/source/common/src/tdataformat.c
+++ b/source/common/src/tdataformat.c
@@ -175,7 +175,8 @@ static void setBitMap(uint8_t *pb, uint8_t v, int32_t idx, uint8_t flags) {
} while (0)
int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, STSRow2 **ppRow) {
- int32_t code = 0;
+ int32_t code = 0;
+#if 0
STColumn *pTColumn;
SColVal *pColVal;
int32_t nColVal = taosArrayGetSize(pArray);
@@ -462,30 +463,22 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
}
}
+#endif
_exit:
return code;
}
int32_t tTSRowClone(const STSRow2 *pRow, STSRow2 **ppRow) {
int32_t code = 0;
+ int32_t rLen;
- (*ppRow) = (STSRow2 *)taosMemoryMalloc(sizeof(**ppRow));
+ TSROW_LEN(pRow, rLen);
+ (*ppRow) = (STSRow2 *)taosMemoryMalloc(rLen);
if (*ppRow == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
goto _exit;
}
- **ppRow = *pRow;
- (*ppRow)->pData = NULL;
-
- if (pRow->nData) {
- (*ppRow)->pData = taosMemoryMalloc(pRow->nData);
- if ((*ppRow)->pData == NULL) {
- taosMemoryFree(*ppRow);
- code = TSDB_CODE_OUT_OF_MEMORY;
- goto _exit;
- }
- memcpy((*ppRow)->pData, pRow->pData, pRow->nData);
- }
+ memcpy(*ppRow, pRow, rLen);
_exit:
return code;
@@ -493,12 +486,12 @@ _exit:
void tTSRowFree(STSRow2 *pRow) {
if (pRow) {
- if (pRow->pData) taosMemoryFree(pRow->pData);
taosMemoryFree(pRow);
}
}
void tTSRowGet(STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal) {
+#if 0
uint8_t isTuple = ((pRow->flags & 0xf0) == 0) ? 1 : 0;
STColumn *pTColumn = &pTSchema->columns[iCol];
uint8_t flags = pRow->flags & (uint8_t)0xf;
@@ -643,10 +636,12 @@ _return_null:
_return_value:
*pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, value);
return;
+#endif
}
int32_t tTSRowToArray(STSRow2 *pRow, STSchema *pTSchema, SArray **ppArray) {
int32_t code = 0;
+#if 0
SColVal cv;
(*ppArray) = taosArrayInit(pTSchema->numOfCols, sizeof(SColVal));
@@ -660,52 +655,27 @@ int32_t tTSRowToArray(STSRow2 *pRow, STSchema *pTSchema, SArray **ppArray) {
taosArrayPush(*ppArray, &cv);
}
+#endif
_exit:
return code;
}
int32_t tPutTSRow(uint8_t *p, STSRow2 *pRow) {
- int32_t n = 0;
+ int32_t n;
- n += tPutI64(p ? p + n : p, pRow->ts);
- n += tPutI8(p ? p + n : p, pRow->flags);
- n += tPutI32v(p ? p + n : p, pRow->sver);
-
- ASSERT(pRow->flags & 0xf);
-
- switch (pRow->flags & 0xf) {
- case TSROW_HAS_NONE:
- case TSROW_HAS_NULL:
- ASSERT(pRow->nData == 0);
- ASSERT(pRow->pData == NULL);
- break;
- default:
- ASSERT(pRow->nData && pRow->pData);
- n += tPutBinary(p ? p + n : p, pRow->pData, pRow->nData);
- break;
+ TSROW_LEN(pRow, n);
+ if (p) {
+ memcpy(p, pRow, n);
}
return n;
}
-int32_t tGetTSRow(uint8_t *p, STSRow2 *pRow) {
- int32_t n = 0;
+int32_t tGetTSRow(uint8_t *p, STSRow2 **ppRow) {
+ int32_t n;
- n += tGetI64(p + n, &pRow->ts);
- n += tGetI8(p + n, &pRow->flags);
- n += tGetI32v(p + n, &pRow->sver);
-
- ASSERT(pRow->flags);
- switch (pRow->flags & 0xf) {
- case TSROW_HAS_NONE:
- case TSROW_HAS_NULL:
- pRow->nData = 0;
- pRow->pData = NULL;
- break;
- default:
- n += tGetBinary(p + n, &pRow->pData, &pRow->nData);
- break;
- }
+ *ppRow = (STSRow2 *)p;
+ TSROW_LEN(*ppRow, n);
return n;
}
@@ -904,15 +874,13 @@ static int32_t tGetTagVal(uint8_t *p, STagVal *pTagVal, int8_t isJson) {
return n;
}
-bool tTagIsJson(const void *pTag){
- return (((const STag *)pTag)->flags & TD_TAG_JSON);
-}
+bool tTagIsJson(const void *pTag) { return (((const STag *)pTag)->flags & TD_TAG_JSON); }
-bool tTagIsJsonNull(void *data){
- STag *pTag = (STag*)data;
- int8_t isJson = tTagIsJson(pTag);
- if(!isJson) return false;
- return ((STag*)data)->nTag == 0;
+bool tTagIsJsonNull(void *data) {
+ STag *pTag = (STag *)data;
+ int8_t isJson = tTagIsJson(pTag);
+ if (!isJson) return false;
+ return ((STag *)data)->nTag == 0;
}
int32_t tTagNew(SArray *pArray, int32_t version, int8_t isJson, STag **ppTag) {
@@ -1097,112 +1065,6 @@ _err:
}
#if 1 // ===================================================================================================================
-static void dataColSetNEleNull(SDataCol *pCol, int nEle);
-int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
- int spaceNeeded = pCol->bytes * maxPoints;
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- spaceNeeded += sizeof(VarDataOffsetT) * maxPoints;
- }
-#ifdef TD_SUPPORT_BITMAP
- int32_t nBitmapBytes = (int32_t)TD_BITMAP_BYTES(maxPoints);
- spaceNeeded += (int)nBitmapBytes;
- // TODO: Currently, the compression of bitmap parts is affiliated to the column data parts, thus allocate 1 more
- // TYPE_BYTES as to comprise complete TYPE_BYTES. Otherwise, invalid read/write would be triggered.
- // spaceNeeded += TYPE_BYTES[pCol->type]; // the bitmap part is append as a single part since 2022.04.03, thus
- // remove the additional space
-#endif
-
- if (pCol->spaceSize < spaceNeeded) {
- void *ptr = taosMemoryRealloc(pCol->pData, spaceNeeded);
- if (ptr == NULL) {
- uDebug("malloc failure, size:%" PRId64 " failed, reason:%s", (int64_t)spaceNeeded, strerror(errno));
- return -1;
- } else {
- pCol->pData = ptr;
- pCol->spaceSize = spaceNeeded;
- }
- }
-#ifdef TD_SUPPORT_BITMAP
-
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- pCol->pBitmap = POINTER_SHIFT(pCol->pData, pCol->bytes * maxPoints);
- pCol->dataOff = POINTER_SHIFT(pCol->pBitmap, nBitmapBytes);
- } else {
- pCol->pBitmap = POINTER_SHIFT(pCol->pData, pCol->bytes * maxPoints);
- }
-#else
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- pCol->dataOff = POINTER_SHIFT(pCol->pData, pCol->bytes * maxPoints);
- }
-#endif
- return 0;
-}
-
-/**
- * Duplicate the schema and return a new object
- */
-STSchema *tdDupSchema(const STSchema *pSchema) {
- int tlen = sizeof(STSchema) + sizeof(STColumn) * schemaNCols(pSchema);
- STSchema *tSchema = (STSchema *)taosMemoryMalloc(tlen);
- if (tSchema == NULL) return NULL;
-
- memcpy((void *)tSchema, (void *)pSchema, tlen);
-
- return tSchema;
-}
-
-/**
- * Encode a schema to dst, and return the next pointer
- */
-int tdEncodeSchema(void **buf, STSchema *pSchema) {
- int tlen = 0;
- tlen += taosEncodeFixedI32(buf, schemaVersion(pSchema));
- tlen += taosEncodeFixedI32(buf, schemaNCols(pSchema));
-
- for (int i = 0; i < schemaNCols(pSchema); i++) {
- STColumn *pCol = schemaColAt(pSchema, i);
- tlen += taosEncodeFixedI8(buf, colType(pCol));
- tlen += taosEncodeFixedI8(buf, colFlags(pCol));
- tlen += taosEncodeFixedI16(buf, colColId(pCol));
- tlen += taosEncodeFixedI16(buf, colBytes(pCol));
- }
-
- return tlen;
-}
-
-/**
- * Decode a schema from a binary.
- */
-void *tdDecodeSchema(void *buf, STSchema **pRSchema) {
- int version = 0;
- int numOfCols = 0;
- STSchemaBuilder schemaBuilder;
-
- buf = taosDecodeFixedI32(buf, &version);
- buf = taosDecodeFixedI32(buf, &numOfCols);
-
- if (tdInitTSchemaBuilder(&schemaBuilder, version) < 0) return NULL;
-
- for (int i = 0; i < numOfCols; i++) {
- col_type_t type = 0;
- int8_t flags = 0;
- col_id_t colId = 0;
- col_bytes_t bytes = 0;
- buf = taosDecodeFixedI8(buf, &type);
- buf = taosDecodeFixedI8(buf, &flags);
- buf = taosDecodeFixedI16(buf, &colId);
- buf = taosDecodeFixedI32(buf, &bytes);
- if (tdAddColToSchema(&schemaBuilder, type, flags, colId, bytes) < 0) {
- tdDestroyTSchemaBuilder(&schemaBuilder);
- return NULL;
- }
- }
-
- *pRSchema = tdGetSchemaFromBuilder(&schemaBuilder);
- tdDestroyTSchemaBuilder(&schemaBuilder);
- return buf;
-}
-
int tdInitTSchemaBuilder(STSchemaBuilder *pBuilder, schema_ver_t version) {
if (pBuilder == NULL) return -1;
@@ -1239,22 +1101,22 @@ int32_t tdAddColToSchema(STSchemaBuilder *pBuilder, int8_t type, int8_t flags, c
}
STColumn *pCol = &(pBuilder->columns[pBuilder->nCols]);
- colSetType(pCol, type);
- colSetColId(pCol, colId);
- colSetFlags(pCol, flags);
+ pCol->type = type;
+ pCol->colId = colId;
+ pCol->flags = flags;
if (pBuilder->nCols == 0) {
- colSetOffset(pCol, 0);
+ pCol->offset = 0;
} else {
STColumn *pTCol = &(pBuilder->columns[pBuilder->nCols - 1]);
- colSetOffset(pCol, pTCol->offset + TYPE_BYTES[pTCol->type]);
+ pCol->offset = pTCol->offset + TYPE_BYTES[pTCol->type];
}
if (IS_VAR_DATA_TYPE(type)) {
- colSetBytes(pCol, bytes);
+ pCol->bytes = bytes;
pBuilder->tlen += (TYPE_BYTES[type] + bytes);
pBuilder->vlen += bytes - sizeof(VarDataLenT);
} else {
- colSetBytes(pCol, TYPE_BYTES[type]);
+ pCol->bytes = TYPE_BYTES[type];
pBuilder->tlen += TYPE_BYTES[type];
pBuilder->vlen += TYPE_BYTES[type];
}
@@ -1275,151 +1137,19 @@ STSchema *tdGetSchemaFromBuilder(STSchemaBuilder *pBuilder) {
STSchema *pSchema = (STSchema *)taosMemoryMalloc(tlen);
if (pSchema == NULL) return NULL;
- schemaVersion(pSchema) = pBuilder->version;
- schemaNCols(pSchema) = pBuilder->nCols;
- schemaTLen(pSchema) = pBuilder->tlen;
- schemaFLen(pSchema) = pBuilder->flen;
- schemaVLen(pSchema) = pBuilder->vlen;
+ pSchema->version = pBuilder->version;
+ pSchema->numOfCols = pBuilder->nCols;
+ pSchema->tlen = pBuilder->tlen;
+ pSchema->flen = pBuilder->flen;
+ pSchema->vlen = pBuilder->vlen;
#ifdef TD_SUPPORT_BITMAP
- schemaTLen(pSchema) += (int)TD_BITMAP_BYTES(schemaNCols(pSchema));
+ pSchema->tlen += (int)TD_BITMAP_BYTES(pSchema->numOfCols);
#endif
- memcpy(schemaColAt(pSchema, 0), pBuilder->columns, sizeof(STColumn) * pBuilder->nCols);
+ memcpy(&pSchema->columns[0], pBuilder->columns, sizeof(STColumn) * pBuilder->nCols);
return pSchema;
}
-void dataColInit(SDataCol *pDataCol, STColumn *pCol, int maxPoints) {
- pDataCol->type = colType(pCol);
- pDataCol->colId = colColId(pCol);
- pDataCol->bytes = colBytes(pCol);
- pDataCol->offset = colOffset(pCol) + 0; // TD_DATA_ROW_HEAD_SIZE;
-
- pDataCol->len = 0;
-}
-
-static FORCE_INLINE const void *tdGetColDataOfRowUnsafe(SDataCol *pCol, int row) {
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- return POINTER_SHIFT(pCol->pData, pCol->dataOff[row]);
- } else {
- return POINTER_SHIFT(pCol->pData, TYPE_BYTES[pCol->type] * row);
- }
-}
-
-bool isNEleNull(SDataCol *pCol, int nEle) {
- if (isAllRowsNull(pCol)) return true;
- for (int i = 0; i < nEle; ++i) {
- if (!isNull(tdGetColDataOfRowUnsafe(pCol, i), pCol->type)) return false;
- }
- return true;
-}
-
-void *dataColSetOffset(SDataCol *pCol, int nEle) {
- ASSERT(((pCol->type == TSDB_DATA_TYPE_BINARY) || (pCol->type == TSDB_DATA_TYPE_NCHAR)));
-
- void *tptr = pCol->pData;
- // char *tptr = (char *)(pCol->pData);
-
- VarDataOffsetT offset = 0;
- for (int i = 0; i < nEle; ++i) {
- pCol->dataOff[i] = offset;
- offset += varDataTLen(tptr);
- tptr = POINTER_SHIFT(tptr, varDataTLen(tptr));
- }
- return POINTER_SHIFT(tptr, varDataTLen(tptr));
-}
-
-SDataCols *tdNewDataCols(int maxCols, int maxRows) {
- SDataCols *pCols = (SDataCols *)taosMemoryCalloc(1, sizeof(SDataCols));
- if (pCols == NULL) {
- uDebug("malloc failure, size:%" PRId64 " failed, reason:%s", (int64_t)sizeof(SDataCols), strerror(errno));
- return NULL;
- }
-
- pCols->maxPoints = maxRows;
- pCols->maxCols = maxCols;
- pCols->numOfRows = 0;
- pCols->numOfCols = 0;
- pCols->bitmapMode = TSDB_BITMODE_DEFAULT;
-
- if (maxCols > 0) {
- pCols->cols = (SDataCol *)taosMemoryCalloc(maxCols, sizeof(SDataCol));
- if (pCols->cols == NULL) {
- uDebug("malloc failure, size:%" PRId64 " failed, reason:%s", (int64_t)sizeof(SDataCol) * maxCols,
- strerror(errno));
- tdFreeDataCols(pCols);
- return NULL;
- }
-#if 0 // no need as calloc used
- int i;
- for (i = 0; i < maxCols; i++) {
- pCols->cols[i].spaceSize = 0;
- pCols->cols[i].len = 0;
- pCols->cols[i].pData = NULL;
- pCols->cols[i].dataOff = NULL;
- }
-#endif
- }
-
- return pCols;
-}
-
-int tdInitDataCols(SDataCols *pCols, STSchema *pSchema) {
- int i;
- int oldMaxCols = pCols->maxCols;
- if (schemaNCols(pSchema) > oldMaxCols) {
- pCols->maxCols = schemaNCols(pSchema);
- void *ptr = (SDataCol *)taosMemoryRealloc(pCols->cols, sizeof(SDataCol) * pCols->maxCols);
- if (ptr == NULL) return -1;
- pCols->cols = ptr;
- for (i = oldMaxCols; i < pCols->maxCols; ++i) {
- pCols->cols[i].pData = NULL;
- pCols->cols[i].dataOff = NULL;
- pCols->cols[i].pBitmap = NULL;
- pCols->cols[i].spaceSize = 0;
- }
- }
-#if 0
- tdResetDataCols(pCols); // redundant loop to reset len/blen to 0, already reset in following dataColInit(...)
-#endif
-
- pCols->numOfRows = 0;
- pCols->bitmapMode = TSDB_BITMODE_DEFAULT;
- pCols->numOfCols = schemaNCols(pSchema);
-
- for (i = 0; i < schemaNCols(pSchema); ++i) {
- dataColInit(pCols->cols + i, schemaColAt(pSchema, i), pCols->maxPoints);
- }
-
- return 0;
-}
-
-SDataCols *tdFreeDataCols(SDataCols *pCols) {
- int i;
- if (pCols) {
- if (pCols->cols) {
- int maxCols = pCols->maxCols;
- for (i = 0; i < maxCols; ++i) {
- SDataCol *pCol = &pCols->cols[i];
- taosMemoryFreeClear(pCol->pData);
- }
- taosMemoryFree(pCols->cols);
- pCols->cols = NULL;
- }
- taosMemoryFree(pCols);
- }
- return NULL;
-}
-
-void tdResetDataCols(SDataCols *pCols) {
- if (pCols != NULL) {
- pCols->numOfRows = 0;
- pCols->bitmapMode = 0;
- for (int i = 0; i < pCols->maxCols; ++i) {
- dataColReset(pCols->cols + i);
- }
- }
-}
-
#endif
\ No newline at end of file
diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c
index 357f25895166a43309fbfbecbbb7051cbe32eae8..e4032118c668a34df552698017eb4aa2d03b4e13 100644
--- a/source/common/src/tglobal.c
+++ b/source/common/src/tglobal.c
@@ -55,6 +55,7 @@ int32_t tsNumOfMnodeQueryThreads = 2;
int32_t tsNumOfMnodeFetchThreads = 1;
int32_t tsNumOfMnodeReadThreads = 1;
int32_t tsNumOfVnodeQueryThreads = 2;
+int32_t tsNumOfVnodeStreamThreads = 2;
int32_t tsNumOfVnodeFetchThreads = 4;
int32_t tsNumOfVnodeWriteThreads = 2;
int32_t tsNumOfVnodeSyncThreads = 2;
@@ -412,7 +413,12 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
tsNumOfVnodeQueryThreads = TMAX(tsNumOfVnodeQueryThreads, 2);
if (cfgAddInt32(pCfg, "numOfVnodeQueryThreads", tsNumOfVnodeQueryThreads, 1, 1024, 0) != 0) return -1;
- tsNumOfVnodeFetchThreads = TRANGE(tsNumOfVnodeFetchThreads, 1, 1);
+ tsNumOfVnodeStreamThreads = tsNumOfCores / 4;
+ tsNumOfVnodeStreamThreads = TMAX(tsNumOfVnodeStreamThreads, 4);
+ if (cfgAddInt32(pCfg, "numOfVnodeStreamThreads", tsNumOfVnodeStreamThreads, 1, 1024, 0) != 0) return -1;
+
+ tsNumOfVnodeFetchThreads = tsNumOfCores / 4;
+ tsNumOfVnodeFetchThreads = TMAX(tsNumOfVnodeFetchThreads, 4);
if (cfgAddInt32(pCfg, "numOfVnodeFetchThreads", tsNumOfVnodeFetchThreads, 1, 1024, 0) != 0) return -1;
tsNumOfVnodeWriteThreads = tsNumOfCores;
@@ -586,6 +592,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsNumOfMnodeQueryThreads = cfgGetItem(pCfg, "numOfMnodeQueryThreads")->i32;
tsNumOfMnodeReadThreads = cfgGetItem(pCfg, "numOfMnodeReadThreads")->i32;
tsNumOfVnodeQueryThreads = cfgGetItem(pCfg, "numOfVnodeQueryThreads")->i32;
+ tsNumOfVnodeStreamThreads = cfgGetItem(pCfg, "numOfVnodeStreamThreads")->i32;
tsNumOfVnodeFetchThreads = cfgGetItem(pCfg, "numOfVnodeFetchThreads")->i32;
tsNumOfVnodeWriteThreads = cfgGetItem(pCfg, "numOfVnodeWriteThreads")->i32;
tsNumOfVnodeSyncThreads = cfgGetItem(pCfg, "numOfVnodeSyncThreads")->i32;
@@ -1116,10 +1123,44 @@ void taosCfgDynamicOptions(const char *option, const char *value) {
if (strncasecmp(option, "debugFlag", 9) == 0) {
int32_t flag = atoi(value);
taosSetAllDebugFlag(flag);
+ return;
}
if (strcasecmp(option, "resetlog") == 0) {
taosResetLog();
cfgDumpCfg(tsCfg, 0, false);
+ return;
+ }
+
+ if (strcasecmp(option, "monitor") == 0) {
+ int32_t monitor = atoi(value);
+ uInfo("monitor set from %d to %d", tsEnableMonitor, monitor);
+ tsEnableMonitor = monitor;
+ return;
+ }
+
+ const char *options[] = {
+ "dDebugFlag", "vDebugFlag", "mDebugFlag", "wDebugFlag", "sDebugFlag", "tsdbDebugFlag",
+ "tqDebugFlag", "fsDebugFlag", "udfDebugFlag", "smaDebugFlag", "idxDebugFlag", "tmrDebugFlag",
+ "uDebugFlag", "smaDebugFlag", "rpcDebugFlag", "qDebugFlag",
+ };
+ int32_t *optionVars[] = {
+ &dDebugFlag, &vDebugFlag, &mDebugFlag, &wDebugFlag, &sDebugFlag, &tsdbDebugFlag,
+ &tqDebugFlag, &fsDebugFlag, &udfDebugFlag, &smaDebugFlag, &idxDebugFlag, &tmrDebugFlag,
+ &uDebugFlag, &smaDebugFlag, &rpcDebugFlag, &qDebugFlag,
+ };
+
+ int32_t optionSize = tListLen(options);
+ for (int32_t d = 0; d < optionSize; ++d) {
+ const char *optName = options[d];
+ int32_t optLen = strlen(optName);
+ if (strncasecmp(option, optName, optLen) != 0) continue;
+
+ int32_t flag = atoi(value);
+ uInfo("%s set from %d to %d", optName, *optionVars[d], flag);
+ *optionVars[d] = flag;
+ return;
}
+
+ uError("failed to cfg dynamic option:%s value:%s", option, value);
}
diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c
index adfa5b0f1e2bca783de927f510db17a31ffbe3c1..9ebfa78b80d3e986c3b79a84f15e4b81032a465e 100644
--- a/source/common/src/tmsg.c
+++ b/source/common/src/tmsg.c
@@ -4871,6 +4871,11 @@ int tEncodeSVCreateStbReq(SEncoder *pCoder, const SVCreateStbReq *pReq) {
if (tEncodeSRSmaParam(pCoder, &pReq->rsmaParam) < 0) return -1;
}
+ if (tEncodeI32(pCoder, pReq->alterOriDataLen) < 0) return -1;
+ if (pReq->alterOriDataLen > 0) {
+ if (tEncodeBinary(pCoder, pReq->alterOriData, pReq->alterOriDataLen) < 0) return -1;
+ }
+
tEndEncode(pCoder);
return 0;
}
@@ -4887,6 +4892,11 @@ int tDecodeSVCreateStbReq(SDecoder *pCoder, SVCreateStbReq *pReq) {
if (tDecodeSRSmaParam(pCoder, &pReq->rsmaParam) < 0) return -1;
}
+ if (tDecodeI32(pCoder, &pReq->alterOriDataLen) < 0) return -1;
+ if (pReq->alterOriDataLen > 0) {
+ if (tDecodeBinary(pCoder, (uint8_t **)&pReq->alterOriData, NULL) < 0) return -1;
+ }
+
tEndDecode(pCoder);
return 0;
}
@@ -4930,8 +4940,15 @@ int tEncodeSVCreateTbReq(SEncoder *pCoder, const SVCreateTbReq *pReq) {
}
if (pReq->type == TSDB_CHILD_TABLE) {
+ if (tEncodeCStr(pCoder, pReq->ctb.name) < 0) return -1;
if (tEncodeI64(pCoder, pReq->ctb.suid) < 0) return -1;
if (tEncodeTag(pCoder, (const STag *)pReq->ctb.pTag) < 0) return -1;
+ int32_t len = taosArrayGetSize(pReq->ctb.tagName);
+ if (tEncodeI32(pCoder, len) < 0) return -1;
+ for (int32_t i = 0; i < len; i++){
+ char* name = taosArrayGet(pReq->ctb.tagName, i);
+ if (tEncodeCStr(pCoder, name) < 0) return -1;
+ }
} else if (pReq->type == TSDB_NORMAL_TABLE) {
if (tEncodeSSchemaWrapper(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
} else {
@@ -4959,10 +4976,22 @@ int tDecodeSVCreateTbReq(SDecoder *pCoder, SVCreateTbReq *pReq) {
}
if (pReq->type == TSDB_CHILD_TABLE) {
+ if (tDecodeCStr(pCoder, &pReq->ctb.name) < 0) return -1;
if (tDecodeI64(pCoder, &pReq->ctb.suid) < 0) return -1;
if (tDecodeTag(pCoder, (STag **)&pReq->ctb.pTag) < 0) return -1;
+ int32_t len = 0;
+ if (tDecodeI32(pCoder, &len) < 0) return -1;
+ pReq->ctb.tagName = taosArrayInit(len, TSDB_COL_NAME_LEN);
+ if(pReq->ctb.tagName == NULL) return -1;
+ for (int32_t i = 0; i < len; i++){
+ char name[TSDB_COL_NAME_LEN] = {0};
+ char *tmp = NULL;
+ if (tDecodeCStr(pCoder, &tmp) < 0) return -1;
+ strcpy(name, tmp);
+ taosArrayPush(pReq->ctb.tagName, name);
+ }
} else if (pReq->type == TSDB_NORMAL_TABLE) {
- if (tDecodeSSchemaWrapper(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
+ if (tDecodeSSchemaWrapperEx(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
} else {
ASSERT(0);
}
@@ -5292,6 +5321,7 @@ int32_t tEncodeSVAlterTbReq(SEncoder *pEncoder, const SVAlterTbReq *pReq) {
break;
case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES:
if (tEncodeCStr(pEncoder, pReq->colName) < 0) return -1;
+ if (tEncodeI8(pEncoder, pReq->colModType) < 0) return -1;
if (tEncodeI32v(pEncoder, pReq->colModBytes) < 0) return -1;
break;
case TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME:
@@ -5301,6 +5331,7 @@ int32_t tEncodeSVAlterTbReq(SEncoder *pEncoder, const SVAlterTbReq *pReq) {
case TSDB_ALTER_TABLE_UPDATE_TAG_VAL:
if (tEncodeCStr(pEncoder, pReq->tagName) < 0) return -1;
if (tEncodeI8(pEncoder, pReq->isNull) < 0) return -1;
+ if (tEncodeI8(pEncoder, pReq->tagType) < 0) return -1;
if (!pReq->isNull) {
if (tEncodeBinary(pEncoder, pReq->pTagVal, pReq->nTagVal) < 0) return -1;
}
@@ -5340,6 +5371,7 @@ int32_t tDecodeSVAlterTbReq(SDecoder *pDecoder, SVAlterTbReq *pReq) {
break;
case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES:
if (tDecodeCStr(pDecoder, &pReq->colName) < 0) return -1;
+ if (tDecodeI8(pDecoder, &pReq->colModType) < 0) return -1;
if (tDecodeI32v(pDecoder, &pReq->colModBytes) < 0) return -1;
break;
case TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME:
@@ -5349,6 +5381,7 @@ int32_t tDecodeSVAlterTbReq(SDecoder *pDecoder, SVAlterTbReq *pReq) {
case TSDB_ALTER_TABLE_UPDATE_TAG_VAL:
if (tDecodeCStr(pDecoder, &pReq->tagName) < 0) return -1;
if (tDecodeI8(pDecoder, &pReq->isNull) < 0) return -1;
+ if (tDecodeI8(pDecoder, &pReq->tagType) < 0) return -1;
if (!pReq->isNull) {
if (tDecodeBinary(pDecoder, &pReq->pTagVal, &pReq->nTagVal) < 0) return -1;
}
@@ -5526,6 +5559,11 @@ bool tOffsetEqual(const STqOffsetVal *pLeft, const STqOffsetVal *pRight) {
ASSERT(0);
// TODO
return pLeft->uid == pRight->uid && pLeft->ts == pRight->ts;
+ } else {
+ ASSERT(0);
+ /*ASSERT(pLeft->type == TMQ_OFFSET__RESET_NONE || pLeft->type == TMQ_OFFSET__RESET_EARLIEAST ||*/
+ /*pLeft->type == TMQ_OFFSET__RESET_LATEST);*/
+ /*return true;*/
}
}
return false;
diff --git a/source/common/src/trow.c b/source/common/src/trow.c
index 052b6ffe585cf6e89944384f6a4c7e3c09ecb8cb..f64250bce61210bf94f116512c19885aebf3f42b 100644
--- a/source/common/src/trow.c
+++ b/source/common/src/trow.c
@@ -32,28 +32,10 @@ const uint8_t tdVTypeByte[2][3] = {{
};
// declaration
-static uint8_t tdGetBitmapByte(uint8_t byte);
-static int32_t tdCompareColId(const void *arg1, const void *arg2);
+static uint8_t tdGetBitmapByte(uint8_t byte);
+static int32_t tdCompareColId(const void *arg1, const void *arg2);
static FORCE_INLINE int32_t compareKvRowColId(const void *key1, const void *key2);
-// static void dataColSetNEleNull(SDataCol *pCol, int nEle);
-
-/**
- * @brief src2 data has more priority than src1
- *
- * @param target
- * @param src1
- * @param iter1
- * @param limit1
- * @param src2
- * @param iter2
- * @param limit2
- * @param tRows
- * @param update
- */
-static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, int limit1, SDataCols *src2, int *iter2,
- int limit2, int tRows, bool update);
-
// implementation
/**
* @brief Compress bitmap bytes comprised of 2-bits to counterpart of 1-bit.
@@ -287,33 +269,6 @@ void tdMergeBitmap(uint8_t *srcBitmap, int32_t nBits, uint8_t *dstBitmap) {
}
}
-static FORCE_INLINE void dataColSetNullAt(SDataCol *pCol, int index, bool setBitmap, int8_t bitmapMode) {
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- pCol->dataOff[index] = pCol->len;
- char *ptr = POINTER_SHIFT(pCol->pData, pCol->len);
- setVardataNull(ptr, pCol->type);
- pCol->len += varDataTLen(ptr);
- } else {
- setNull(POINTER_SHIFT(pCol->pData, TYPE_BYTES[pCol->type] * index), pCol->type, pCol->bytes);
- pCol->len += TYPE_BYTES[pCol->type];
- }
- if (setBitmap) {
- tdSetBitmapValType(pCol->pBitmap, index, TD_VTYPE_NONE, bitmapMode);
- }
-}
-
-// static void dataColSetNEleNull(SDataCol *pCol, int nEle) {
-// if (IS_VAR_DATA_TYPE(pCol->type)) {
-// pCol->len = 0;
-// for (int i = 0; i < nEle; i++) {
-// dataColSetNullAt(pCol, i);
-// }
-// } else {
-// setNullN(pCol->pData, pCol->type, pCol->bytes, nEle);
-// pCol->len = TYPE_BYTES[pCol->type] * nEle;
-// }
-// }
-
/**
* @brief Set bitmap area by byte preferentially and then by bit.
*
@@ -362,56 +317,6 @@ bool tdIsBitmapBlkNorm(const void *pBitmap, int32_t numOfBits, int8_t bitmapMode
return true;
}
-static FORCE_INLINE void dataColSetNoneAt(SDataCol *pCol, int index, bool setBitmap, int8_t bitmapMode) {
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- pCol->dataOff[index] = pCol->len;
- char *ptr = POINTER_SHIFT(pCol->pData, pCol->len);
- setVardataNull(ptr, pCol->type);
- pCol->len += varDataTLen(ptr);
- } else {
- setNull(POINTER_SHIFT(pCol->pData, TYPE_BYTES[pCol->type] * index), pCol->type, pCol->bytes);
- pCol->len += TYPE_BYTES[pCol->type];
- }
- if (setBitmap) {
- tdSetBitmapValType(pCol->pBitmap, index, TD_VTYPE_NONE, bitmapMode);
- }
-}
-
-static void dataColSetNEleNone(SDataCol *pCol, int nEle, int8_t bitmapMode) {
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- pCol->len = 0;
- for (int i = 0; i < nEle; ++i) {
- dataColSetNoneAt(pCol, i, false, bitmapMode);
- }
- } else {
- setNullN(pCol->pData, pCol->type, pCol->bytes, nEle);
- pCol->len = TYPE_BYTES[pCol->type] * nEle;
- }
-#ifdef TD_SUPPORT_BITMAP
- tdSetBitmapValTypeN(pCol->pBitmap, nEle, TD_VTYPE_NONE, bitmapMode);
-#endif
-}
-
-#if 0
-void trbSetRowInfo(SRowBuilder *pRB, bool del, uint16_t sver) {
- // TODO
-}
-
-void trbSetRowVersion(SRowBuilder *pRB, uint64_t ver) {
- // TODO
-}
-
-void trbSetRowTS(SRowBuilder *pRB, TSKEY ts) {
- // TODO
-}
-
-int trbWriteCol(SRowBuilder *pRB, void *pData, col_id_t cid) {
- // TODO
- return 0;
-}
-
-#endif
-
STSRow *tdRowDup(STSRow *row) {
STSRow *trow = taosMemoryMalloc(TD_ROW_LEN(row));
if (trow == NULL) return NULL;
@@ -420,511 +325,6 @@ STSRow *tdRowDup(STSRow *row) {
return trow;
}
-/**
- * @brief
- *
- * @param pCol
- * @param valType
- * @param val
- * @param numOfRows
- * @param maxPoints
- * @param bitmapMode default is 0(2 bits), otherwise 1(1 bit)
- * @param isMerge merge to current row
- * @return int
- */
-int tdAppendValToDataCol(SDataCol *pCol, TDRowValT valType, const void *val, int numOfRows, int maxPoints,
- int8_t bitmapMode, bool isMerge) {
- TASSERT(pCol != NULL);
-
- // Assume that the columns not specified during insert/upsert mean None.
- if (isAllRowsNone(pCol)) {
- if (tdValIsNone(valType)) {
- // all None value yet, just return
- return 0;
- }
-
- if (tdAllocMemForCol(pCol, maxPoints) < 0) return -1;
- if (numOfRows > 0) {
- // Find the first not None value, fill all previous values as None
- dataColSetNEleNone(pCol, numOfRows, bitmapMode);
- }
- }
- const void *value = val;
- if (!tdValTypeIsNorm(valType) || !val) {
- // TODO:
- // 1. back compatibility and easy to debug with codes of 2.0 to save NULL values.
- // 2. later on, considering further optimization, don't save Null/None for VarType.
- value = getNullValue(pCol->type);
- }
- if (!isMerge) {
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- // set offset
- pCol->dataOff[numOfRows] = pCol->len;
- // Copy data
- memcpy(POINTER_SHIFT(pCol->pData, pCol->len), value, varDataTLen(value));
- // Update the length
- pCol->len += varDataTLen(value);
- } else {
- ASSERT(pCol->len == TYPE_BYTES[pCol->type] * numOfRows);
- memcpy(POINTER_SHIFT(pCol->pData, pCol->len), value, pCol->bytes);
- pCol->len += pCol->bytes;
- }
- } else if (!tdValTypeIsNone(valType)) {
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- // keep the last offset
- // discard the last var data
- int32_t lastVarLen = varDataTLen(POINTER_SHIFT(pCol->pData, pCol->dataOff[numOfRows]));
- pCol->len -= lastVarLen;
- // Copy data
- memcpy(POINTER_SHIFT(pCol->pData, pCol->len), value, varDataTLen(value));
- // Update the length
- pCol->len += varDataTLen(value);
- } else {
- ASSERT(pCol->len - TYPE_BYTES[pCol->type] == TYPE_BYTES[pCol->type] * numOfRows);
- memcpy(POINTER_SHIFT(pCol->pData, pCol->len - TYPE_BYTES[pCol->type]), value, pCol->bytes);
- }
- }
-
-#ifdef TD_SUPPORT_BITMAP
- if (!isMerge || !tdValTypeIsNone(valType)) {
- tdSetBitmapValType(pCol->pBitmap, numOfRows, valType, bitmapMode);
- }
-#endif
- return 0;
-}
-
-// internal
-static int32_t tdAppendTpRowToDataCol(STSRow *pRow, STSchema *pSchema, SDataCols *pCols, bool isMerge) {
-#if 0
- ASSERT(pCols->numOfRows == 0 || dataColsKeyLast(pCols) < TD_ROW_KEY(pRow));
-#endif
-
- // Multi-Version rows with the same key and different versions supported
- ASSERT(pCols->numOfRows == 0 || dataColsKeyLast(pCols) <= TD_ROW_KEY(pRow));
-
- int rcol = 1;
- int dcol = 1;
- void *pBitmap = tdGetBitmapAddrTp(pRow, pSchema->flen);
-
- SDataCol *pDataCol = &(pCols->cols[0]);
- ASSERT(pDataCol->colId == PRIMARYKEY_TIMESTAMP_COL_ID);
- tdAppendValToDataCol(pDataCol, TD_VTYPE_NORM, &pRow->ts, pCols->numOfRows, pCols->maxPoints, pCols->bitmapMode,
- isMerge);
-
- while (dcol < pCols->numOfCols) {
- pDataCol = &(pCols->cols[dcol]);
- if (rcol >= schemaNCols(pSchema)) {
- tdAppendValToDataCol(pDataCol, TD_VTYPE_NULL, NULL, pCols->numOfRows, pCols->maxPoints, pCols->bitmapMode,
- isMerge);
- ++dcol;
- continue;
- }
-
- STColumn *pRowCol = schemaColAt(pSchema, rcol);
- SCellVal sVal = {0};
- if (pRowCol->colId == pDataCol->colId) {
- if (tdGetTpRowValOfCol(&sVal, pRow, pBitmap, pRowCol->type, pRowCol->offset - sizeof(TSKEY), rcol - 1) < 0) {
- return terrno;
- }
- tdAppendValToDataCol(pDataCol, sVal.valType, sVal.val, pCols->numOfRows, pCols->maxPoints, pCols->bitmapMode,
- isMerge);
- ++dcol;
- ++rcol;
- } else if (pRowCol->colId < pDataCol->colId) {
- ++rcol;
- } else {
- tdAppendValToDataCol(pDataCol, TD_VTYPE_NULL, NULL, pCols->numOfRows, pCols->maxPoints, pCols->bitmapMode,
- isMerge);
- ++dcol;
- }
- }
-#if 0
- ++pCols->numOfRows;
-#endif
-
- return TSDB_CODE_SUCCESS;
-}
-// internal
-static int32_t tdAppendKvRowToDataCol(STSRow *pRow, STSchema *pSchema, SDataCols *pCols, bool isMerge) {
- ASSERT(pCols->numOfRows == 0 || dataColsKeyLast(pCols) < TD_ROW_KEY(pRow));
-
- int rcol = 0;
- int dcol = 1;
- int tRowCols = tdRowGetNCols(pRow) - 1; // the primary TS key not included in kvRowColIdx part
- int tSchemaCols = schemaNCols(pSchema) - 1;
- void *pBitmap = tdGetBitmapAddrKv(pRow, tdRowGetNCols(pRow));
-
- SDataCol *pDataCol = &(pCols->cols[0]);
- ASSERT(pDataCol->colId == PRIMARYKEY_TIMESTAMP_COL_ID);
- tdAppendValToDataCol(pDataCol, TD_VTYPE_NORM, &pRow->ts, pCols->numOfRows, pCols->maxPoints, pCols->bitmapMode,
- isMerge);
-
- while (dcol < pCols->numOfCols) {
- pDataCol = &(pCols->cols[dcol]);
- if (rcol >= tRowCols || rcol >= tSchemaCols) {
- tdAppendValToDataCol(pDataCol, TD_VTYPE_NULL, NULL, pCols->numOfRows, pCols->maxPoints, pCols->bitmapMode,
- isMerge);
- ++dcol;
- continue;
- }
-
- SKvRowIdx *pIdx = tdKvRowColIdxAt(pRow, rcol);
- int16_t colIdx = -1;
- if (pIdx) {
- colIdx = POINTER_DISTANCE(pIdx, TD_ROW_COL_IDX(pRow)) / sizeof(SKvRowIdx);
- }
- TASSERT(colIdx >= 0);
- SCellVal sVal = {0};
- if (pIdx->colId == pDataCol->colId) {
- if (tdGetKvRowValOfCol(&sVal, pRow, pBitmap, pIdx->offset, colIdx) < 0) {
- return terrno;
- }
- tdAppendValToDataCol(pDataCol, sVal.valType, sVal.val, pCols->numOfRows, pCols->maxPoints, pCols->bitmapMode,
- isMerge);
- ++dcol;
- ++rcol;
- } else if (pIdx->colId < pDataCol->colId) {
- ++rcol;
- } else {
- tdAppendValToDataCol(pDataCol, TD_VTYPE_NULL, NULL, pCols->numOfRows, pCols->maxPoints, pCols->bitmapMode,
- isMerge);
- ++dcol;
- }
- }
-#if 0
- ++pCols->numOfRows;
-#endif
-
- return TSDB_CODE_SUCCESS;
-}
-
-/**
- * @brief exposed
- *
- * @param pRow
- * @param pSchema
- * @param pCols
- */
-int32_t tdAppendSTSRowToDataCol(STSRow *pRow, STSchema *pSchema, SDataCols *pCols, bool isMerge) {
-#ifdef TD_DEBUG_PRINT_TSDB_LOAD_DCOLS
- printf("%s:%d ts: %" PRIi64 " sver:%d maxCols:%" PRIi16 " nCols:%" PRIi16 ", nRows:%d\n", __func__, __LINE__,
- TD_ROW_KEY(pRow), TD_ROW_SVER(pRow), pCols->maxCols, pCols->numOfCols, pCols->numOfRows);
-#endif
- if (TD_IS_TP_ROW(pRow)) {
- return tdAppendTpRowToDataCol(pRow, pSchema, pCols, isMerge);
- } else if (TD_IS_KV_ROW(pRow)) {
- return tdAppendKvRowToDataCol(pRow, pSchema, pCols, isMerge);
- } else {
- ASSERT(0);
- }
- return TSDB_CODE_SUCCESS;
-}
-
-/**
- * @brief source data has more priority than target
- *
- * @param target
- * @param source
- * @param rowsToMerge
- * @param pOffset
- * @param update
- * @param maxVer
- * @return int
- */
-int tdMergeDataCols(SDataCols *target, SDataCols *source, int rowsToMerge, int *pOffset, bool update,
- TDRowVerT maxVer) {
- ASSERT(rowsToMerge > 0 && rowsToMerge <= source->numOfRows);
- ASSERT(target->numOfCols == source->numOfCols);
- int offset = 0;
-
- if (pOffset == NULL) {
- pOffset = &offset;
- }
-
- SDataCols *pTarget = NULL;
-
- if ((target->numOfRows == 0) || (dataColsKeyLast(target) < dataColsKeyAtRow(source, *pOffset))) { // No overlap
- ASSERT(target->numOfRows + rowsToMerge <= target->maxPoints);
- // TODO: filter the maxVer
- TSKEY lastKey = TSKEY_INITIAL_VAL;
- for (int i = 0; i < rowsToMerge; ++i) {
- bool merge = false;
- for (int j = 0; j < source->numOfCols; j++) {
- if (source->cols[j].len > 0 || target->cols[j].len > 0) {
- SCellVal sVal = {0};
- if (tdGetColDataOfRow(&sVal, source->cols + j, i + (*pOffset), source->bitmapMode) < 0) {
- TASSERT(0);
- }
-
- if (j == 0) {
- if (lastKey == *(TSKEY *)sVal.val) {
- if (!update) {
- break;
- }
- merge = true;
- } else if (lastKey != TSKEY_INITIAL_VAL) {
- ++target->numOfRows;
- }
-
- lastKey = *(TSKEY *)sVal.val;
- }
- if (i == 0) {
- (target->cols + j)->bitmap = (source->cols + j)->bitmap;
- }
-
- tdAppendValToDataCol(target->cols + j, sVal.valType, sVal.val, target->numOfRows, target->maxPoints,
- target->bitmapMode, merge);
- }
- }
- }
- if (lastKey != TSKEY_INITIAL_VAL) {
- ++target->numOfRows;
- }
- (*pOffset) += rowsToMerge;
- } else {
- pTarget = tdDupDataCols(target, true);
- if (pTarget == NULL) goto _err;
-
- int iter1 = 0;
- tdMergeTwoDataCols(target, pTarget, &iter1, pTarget->numOfRows, source, pOffset, source->numOfRows,
- pTarget->numOfRows + rowsToMerge, update);
- }
-
- tdFreeDataCols(pTarget);
- return 0;
-
-_err:
- tdFreeDataCols(pTarget);
- return -1;
-}
-
-static void tdAppendValToDataCols(SDataCols *target, SDataCols *src, int iter, bool isMerge) {
- for (int i = 0; i < src->numOfCols; ++i) {
- ASSERT(target->cols[i].type == src->cols[i].type);
- if (src->cols[i].len > 0 || target->cols[i].len > 0) {
- SCellVal sVal = {0};
- if (tdGetColDataOfRow(&sVal, src->cols + i, iter, src->bitmapMode) < 0) {
- TASSERT(0);
- }
- if (isMerge) {
- if (!tdValTypeIsNone(sVal.valType)) {
- tdAppendValToDataCol(&(target->cols[i]), sVal.valType, sVal.val, target->numOfRows, target->maxPoints,
- target->bitmapMode, isMerge);
- } else {
- // Keep the origin value for None
- }
- } else {
- tdAppendValToDataCol(&(target->cols[i]), sVal.valType, sVal.val, target->numOfRows, target->maxPoints,
- target->bitmapMode, isMerge);
- }
- }
- }
-}
-/**
- * @brief src2 data has more priority than src1
- *
- * @param target
- * @param src1
- * @param iter1
- * @param limit1
- * @param src2
- * @param iter2
- * @param limit2
- * @param tRows
- * @param update
- */
-static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, int limit1, SDataCols *src2, int *iter2,
- int limit2, int tRows, bool update) {
- tdResetDataCols(target);
- target->bitmapMode = src1->bitmapMode;
- ASSERT(limit1 <= src1->numOfRows && limit2 <= src2->numOfRows);
- int32_t nRows = 0;
-
- // TODO: filter the maxVer
- // TODO: handle the delete function
- TSKEY lastKey = TSKEY_INITIAL_VAL;
- while (nRows < tRows) {
- if (*iter1 >= limit1 && *iter2 >= limit2) break;
-
- TSKEY key1 = (*iter1 >= limit1) ? INT64_MAX : dataColsKeyAt(src1, *iter1);
- // TKEY tkey1 = (*iter1 >= limit1) ? TKEY_NULL : dataColsTKeyAt(src1, *iter1);
- TSKEY key2 = (*iter2 >= limit2) ? INT64_MAX : dataColsKeyAt(src2, *iter2);
- // TKEY tkey2 = (*iter2 >= limit2) ? TKEY_NULL : dataColsTKeyAt(src2, *iter2);
-
- // ASSERT(tkey1 == TKEY_NULL || (!TKEY_IS_DELETED(tkey1)));
-
- if (key1 <= key2) {
- // select key1 if not delete
- if (update && (lastKey == key1)) {
- tdAppendValToDataCols(target, src1, *iter1, true);
- } else if (lastKey != key1) {
- if (lastKey != TSKEY_INITIAL_VAL) {
- ++target->numOfRows;
- }
- tdAppendValToDataCols(target, src1, *iter1, false);
- }
- ++nRows;
- ++(*iter1);
- lastKey = key1;
- } else {
- // use key2 if not deleted
- // TODO: handle the delete function
- if (update && (lastKey == key2)) {
- tdAppendValToDataCols(target, src2, *iter2, true);
- } else if (lastKey != key2) {
- if (lastKey != TSKEY_INITIAL_VAL) {
- ++target->numOfRows;
- }
- tdAppendValToDataCols(target, src2, *iter2, false);
- }
-
- ++nRows;
- ++(*iter2);
- lastKey = key2;
- }
-
- ASSERT(target->numOfRows <= target->maxPoints - 1);
- }
- if (lastKey != TSKEY_INITIAL_VAL) {
- ++target->numOfRows;
- }
-}
-
-STSRow *mergeTwoRows(void *buffer, STSRow *row1, STSRow *row2, STSchema *pSchema1, STSchema *pSchema2) {
-#if 0
- ASSERT(TD_ROW_KEY(row1) == TD_ROW_KEY(row2));
- ASSERT(schemaVersion(pSchema1) == TD_ROW_SVER(row1));
- ASSERT(schemaVersion(pSchema2) == TD_ROW_SVER(row2));
- ASSERT(schemaVersion(pSchema1) >= schemaVersion(pSchema2));
-#endif
-
-#if 0
- SArray *stashRow = taosArrayInit(pSchema1->numOfCols, sizeof(SColInfo));
- if (stashRow == NULL) {
- return NULL;
- }
-
- STSRow pRow = buffer;
- STpRow dataRow = memRowDataBody(pRow);
- memRowSetType(pRow, SMEM_ROW_DATA);
- dataRowSetVersion(dataRow, schemaVersion(pSchema1)); // use latest schema version
- dataRowSetLen(dataRow, (TDRowLenT)(TD_DATA_ROW_HEAD_SIZE + pSchema1->flen));
-
- TDRowLenT dataLen = 0, kvLen = TD_MEM_ROW_KV_HEAD_SIZE;
-
- int32_t i = 0; // row1
- int32_t j = 0; // row2
- int32_t nCols1 = schemaNCols(pSchema1);
- int32_t nCols2 = schemaNCols(pSchema2);
- SColInfo colInfo = {0};
- int32_t kvIdx1 = 0, kvIdx2 = 0;
-
- while (i < nCols1) {
- STColumn *pCol = schemaColAt(pSchema1, i);
- void * val1 = tdGetMemRowDataOfColEx(row1, pCol->colId, pCol->type, TD_DATA_ROW_HEAD_SIZE + pCol->offset, &kvIdx1);
- // if val1 != NULL, use val1;
- if (val1 != NULL && !isNull(val1, pCol->type)) {
- tdAppendColVal(dataRow, val1, pCol->type, pCol->offset);
- kvLen += tdGetColAppendLen(SMEM_ROW_KV, val1, pCol->type);
- setSColInfo(&colInfo, pCol->colId, pCol->type, val1);
- taosArrayPush(stashRow, &colInfo);
- ++i; // next col
- continue;
- }
-
- void *val2 = NULL;
- while (j < nCols2) {
- STColumn *tCol = schemaColAt(pSchema2, j);
- if (tCol->colId < pCol->colId) {
- ++j;
- continue;
- }
- if (tCol->colId == pCol->colId) {
- val2 = tdGetMemRowDataOfColEx(row2, tCol->colId, tCol->type, TD_DATA_ROW_HEAD_SIZE + tCol->offset, &kvIdx2);
- } else if (tCol->colId > pCol->colId) {
- // set NULL
- }
- break;
- } // end of while(jtype);
- }
- tdAppendColVal(dataRow, val2, pCol->type, pCol->offset);
- if (!isNull(val2, pCol->type)) {
- kvLen += tdGetColAppendLen(SMEM_ROW_KV, val2, pCol->type);
- setSColInfo(&colInfo, pCol->colId, pCol->type, val2);
- taosArrayPush(stashRow, &colInfo);
- }
-
- ++i; // next col
- }
-
- dataLen = TD_ROW_LEN(pRow);
-
- if (kvLen < dataLen) {
- // scan stashRow and generate SKVRow
- memset(buffer, 0, sizeof(dataLen));
- STSRow tRow = buffer;
- memRowSetType(tRow, SMEM_ROW_KV);
- SKVRow kvRow = (SKVRow)memRowKvBody(tRow);
- int16_t nKvNCols = (int16_t) taosArrayGetSize(stashRow);
- kvRowSetLen(kvRow, (TDRowLenT)(TD_KV_ROW_HEAD_SIZE + sizeof(SColIdx) * nKvNCols));
- kvRowSetNCols(kvRow, nKvNCols);
- memRowSetKvVersion(tRow, pSchema1->version);
-
- int32_t toffset = 0;
- int16_t k;
- for (k = 0; k < nKvNCols; ++k) {
- SColInfo *pColInfo = taosArrayGet(stashRow, k);
- tdAppendKvColVal(kvRow, pColInfo->colVal, true, pColInfo->colId, pColInfo->colType, toffset);
- toffset += sizeof(SColIdx);
- }
- ASSERT(kvLen == TD_ROW_LEN(tRow));
- }
- taosArrayDestroy(stashRow);
- return buffer;
-#endif
- return NULL;
-}
-
-SDataCols *tdDupDataCols(SDataCols *pDataCols, bool keepData) {
- SDataCols *pRet = tdNewDataCols(pDataCols->maxCols, pDataCols->maxPoints);
- if (pRet == NULL) return NULL;
-
- pRet->numOfCols = pDataCols->numOfCols;
- pRet->bitmapMode = pDataCols->bitmapMode;
- pRet->sversion = pDataCols->sversion;
- if (keepData) pRet->numOfRows = pDataCols->numOfRows;
-
- for (int i = 0; i < pDataCols->numOfCols; ++i) {
- pRet->cols[i].type = pDataCols->cols[i].type;
- pRet->cols[i].bitmap = pDataCols->cols[i].bitmap;
- pRet->cols[i].colId = pDataCols->cols[i].colId;
- pRet->cols[i].bytes = pDataCols->cols[i].bytes;
- pRet->cols[i].offset = pDataCols->cols[i].offset;
-
- if (keepData) {
- if (pDataCols->cols[i].len > 0) {
- if (tdAllocMemForCol(&pRet->cols[i], pRet->maxPoints) < 0) {
- tdFreeDataCols(pRet);
- return NULL;
- }
- pRet->cols[i].len = pDataCols->cols[i].len;
- memcpy(pRet->cols[i].pData, pDataCols->cols[i].pData, pDataCols->cols[i].len);
- if (IS_VAR_DATA_TYPE(pRet->cols[i].type)) {
- int dataOffSize = sizeof(VarDataOffsetT) * pDataCols->maxPoints;
- memcpy(pRet->cols[i].dataOff, pDataCols->cols[i].dataOff, dataOffSize);
- }
- if (!TD_COL_ROWS_NORM(pRet->cols + i)) {
- memcpy(pRet->cols[i].pBitmap, pDataCols->cols[i].pBitmap, TD_BITMAP_BYTES(pDataCols->numOfRows));
- }
- }
- }
- }
-
- return pRet;
-}
-
void tdSRowPrint(STSRow *row, STSchema *pSchema, const char *tag) {
STSRowIter iter = {0};
tdSTSRowIterInit(&iter, pSchema);
@@ -1020,32 +420,6 @@ void tdSCellValPrint(SCellVal *pVal, int8_t colType) {
}
}
-int32_t dataColGetNEleLen(SDataCol *pDataCol, int32_t rows, int8_t bitmapMode) {
- ASSERT(rows > 0);
- int32_t result = 0;
-
- if (IS_VAR_DATA_TYPE(pDataCol->type)) {
- result += pDataCol->dataOff[rows - 1];
- SCellVal val = {0};
- if (tdGetColDataOfRow(&val, pDataCol, rows - 1, bitmapMode) < 0) {
- TASSERT(0);
- }
-
- // Currently, count the varDataTLen in of Null/None cols considering back compatibility test for 2.4
- result += varDataTLen(val.val);
- // TODO: later on, don't save Null/None for VarDataT for 3.0
- // if (tdValTypeIsNorm(val.valType)) {
- // result += varDataTLen(val.val);
- // }
- } else {
- result += TYPE_BYTES[pDataCol->type] * rows;
- }
-
- ASSERT(pDataCol->len == result);
-
- return result;
-}
-
bool tdSKvRowGetVal(STSRow *pRow, col_id_t colId, col_id_t colIdx, SCellVal *pVal) {
if (colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
tdRowSetVal(pVal, TD_VTYPE_NORM, TD_ROW_KEY_ADDR(pRow));
@@ -1082,40 +456,6 @@ bool tdSTpRowGetVal(STSRow *pRow, col_id_t colId, col_type_t colType, int32_t fl
return true;
}
-int32_t tdGetColDataOfRow(SCellVal *pVal, SDataCol *pCol, int32_t row, int8_t bitmapMode) {
- if (isAllRowsNone(pCol)) {
- pVal->valType = TD_VTYPE_NONE;
-#ifdef TD_SUPPORT_READ2
- pVal->val = (void *)getNullValue(pCol->type);
-#else
- pVal->val = NULL;
-#endif
- return TSDB_CODE_SUCCESS;
- }
-
- if (TD_COL_ROWS_NORM(pCol)) {
- pVal->valType = TD_VTYPE_NORM;
- } else if (tdGetBitmapValType(pCol->pBitmap, row, &(pVal->valType), bitmapMode) < 0) {
- return terrno;
- }
-
- if (tdValTypeIsNorm(pVal->valType)) {
- if (IS_VAR_DATA_TYPE(pCol->type)) {
- pVal->val = POINTER_SHIFT(pCol->pData, pCol->dataOff[row]);
- } else {
- pVal->val = POINTER_SHIFT(pCol->pData, TYPE_BYTES[pCol->type] * row);
- }
- } else {
- pVal->valType = TD_VTYPE_NULL;
-#ifdef TD_SUPPORT_READ2
- pVal->val = (void *)getNullValue(pCol->type);
-#else
- pVal->val = NULL;
-#endif
- }
- return TSDB_CODE_SUCCESS;
-}
-
bool tdSTSRowIterNext(STSRowIter *pIter, col_id_t colId, col_type_t colType, SCellVal *pVal) {
if (colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
pVal->val = &pIter->pRow->ts;
diff --git a/source/common/src/ttime.c b/source/common/src/ttime.c
index befb0abac8b1dc451efbe5fd0690b2b85842d2e7..d728bbe49e9aecda349c34e5d9ec8528172ec271 100644
--- a/source/common/src/ttime.c
+++ b/source/common/src/ttime.c
@@ -710,6 +710,32 @@ int64_t taosTimeAdd(int64_t t, int64_t duration, char unit, int32_t precision) {
return (int64_t)(taosMktime(&tm) * TSDB_TICK_PER_SECOND(precision));
}
+int64_t taosTimeSub(int64_t t, int64_t duration, char unit, int32_t precision) {
+ if (duration == 0) {
+ return t;
+ }
+
+ if (unit != 'n' && unit != 'y') {
+ return t - duration;
+ }
+
+ // The following code handles the y/n time duration
+ int64_t numOfMonth = duration;
+ if (unit == 'y') {
+ numOfMonth *= 12;
+ }
+
+ struct tm tm;
+ time_t tt = (time_t)(t / TSDB_TICK_PER_SECOND(precision));
+ taosLocalTime(&tt, &tm);
+ int32_t mon = tm.tm_year * 12 + tm.tm_mon - (int32_t)numOfMonth;
+ tm.tm_year = mon / 12;
+ tm.tm_mon = mon % 12;
+
+ return (int64_t)(taosMktime(&tm) * TSDB_TICK_PER_SECOND(precision));
+}
+
+
int32_t taosTimeCountInterval(int64_t skey, int64_t ekey, int64_t interval, char unit, int32_t precision) {
if (ekey < skey) {
int64_t tmp = ekey;
diff --git a/source/common/test/dataformatTest.cpp b/source/common/test/dataformatTest.cpp
index a52bb6b516f06953150873647634f3db82d563b0..d16e35ff073d5f1928dc3ee17f5a0f4f657da99e 100644
--- a/source/common/test/dataformatTest.cpp
+++ b/source/common/test/dataformatTest.cpp
@@ -285,8 +285,8 @@ int32_t debugPrintSColVal(SColVal *cv, int8_t type) {
}
void debugPrintTSRow(STSRow2 *row, STSchema *pTSchema, const char *tags, int32_t ln) {
- printf("%s:%d %s:v%d:%d ", tags, ln, (row->flags & 0xf0) ? "KV" : "TP", row->sver, row->nData);
- for (int16_t i = 0; i < schemaNCols(pTSchema); ++i) {
+ // printf("%s:%d %s:v%d:%d ", tags, ln, (row->flags & 0xf0) ? "KV" : "TP", row->sver, row->nData);
+ for (int16_t i = 0; i < pTSchema->numOfCols; ++i) {
SColVal cv = {0};
tTSRowGet(row, pTSchema, i, &cv);
debugPrintSColVal(&cv, pTSchema->columns[i].type);
@@ -393,7 +393,7 @@ static int32_t checkSColVal(const char *rawVal, SColVal *cv, int8_t type) {
}
static void checkTSRow(const char **data, STSRow2 *row, STSchema *pTSchema) {
- for (int16_t i = 0; i < schemaNCols(pTSchema); ++i) {
+ for (int16_t i = 0; i < pTSchema->numOfCols; ++i) {
SColVal cv = {0};
tTSRowGet(row, pTSchema, i, &cv);
checkSColVal(data[i], &cv, pTSchema->columns[i].type);
diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
index a171d2e1e459811f55ffd5bfaa7039ccea90d2f5..d2b071ec61d7343f826ed9975cd6b07745399357 100644
--- a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+++ b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
@@ -168,7 +168,12 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
memcpy(pMsg, pRpc, sizeof(SRpcMsg));
dTrace("msg:%p, is created and will put into %s queue, type:%s", pMsg, pWorker->name, TMSG_INFO(pRpc->msgType));
- return mmPutMsgToWorker(pMgmt, pWorker, pMsg);
+ int32_t code = mmPutMsgToWorker(pMgmt, pWorker, pMsg);
+ if (code != 0) {
+ dTrace("msg:%p, is freed", pMsg);
+ taosFreeQitem(pMsg);
+ }
+ return code;
}
int32_t mmStartWorker(SMnodeMgmt *pMgmt) {
diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
index 6f00767eb0301cff76b891e6873abf7e2ef755ea..ebbb9fa5d4f820cbdc46f92590dabc56161c80b2 100644
--- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
+++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
@@ -31,7 +31,8 @@ typedef struct SVnodeMgmt {
const char *path;
const char *name;
SQWorkerPool queryPool;
- SQWorkerPool fetchPool;
+ SQWorkerPool streamPool;
+ SWWorkerPool fetchPool;
SWWorkerPool syncPool;
SWWorkerPool writePool;
SWWorkerPool applyPool;
@@ -61,6 +62,7 @@ typedef struct {
STaosQueue *pSyncQ;
STaosQueue *pApplyQ;
STaosQueue *pQueryQ;
+ STaosQueue *pStreamQ;
STaosQueue *pFetchQ;
} SVnodeObj;
@@ -105,6 +107,7 @@ int32_t vmPutMsgToWriteQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t vmPutMsgToSyncQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t vmPutMsgToQueryQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t vmPutMsgToFetchQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
+int32_t vmPutMsgToStreamQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t vmPutMsgToMergeQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t vmPutMsgToMgmtQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t vmPutMsgToMonitorQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg);
diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c
index 90f852eed17bcdc69513593b56a81c7594044566..cbcb541200c899260a265872f625cb306987f7ae 100644
--- a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c
+++ b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c
@@ -31,7 +31,7 @@ SVnodeObj **vmGetVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes) {
SVnodeObj *pVnode = *ppVnode;
if (pVnode && num < size) {
int32_t refCount = atomic_add_fetch_32(&pVnode->refCount, 1);
- // dTrace("vgId:%d, acquire vnode, refCount:%d", pVnode->vgId, refCount);
+ // dTrace("vgId:%d, acquire vnode list, ref:%d", pVnode->vgId, refCount);
pVnodes[num++] = (*ppVnode);
pIter = taosHashIterate(pMgmt->hash, pIter);
} else {
diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
index 7e7139ba53459757561aad1f384efaa4b8a22f70..9571a83116eeb56aa731a3d2c3a938a8428ba371 100644
--- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
@@ -357,16 +357,16 @@ SArray *vmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_VND_COMMIT, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_HEARTBEAT, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TRIGGER, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TRIGGER, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DROP, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DEPLOY, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RUN, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH_RSP, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RECOVER, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RECOVER_RSP, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_RSP, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RUN, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RECOVER, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RECOVER_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_REPLICA, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_CONFIG, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c
index eac9052289ab9d3c0715e4b6172e84b90f6138d0..1f981cc9e0fbc6b119542980e241e20bb06b1fde 100644
--- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c
@@ -23,6 +23,7 @@ SVnodeObj *vmAcquireVnode(SVnodeMgmt *pMgmt, int32_t vgId) {
taosHashGetDup(pMgmt->hash, &vgId, sizeof(int32_t), (void *)&pVnode);
if (pVnode == NULL || pVnode->dropped) {
terrno = TSDB_CODE_VND_INVALID_VGROUP_ID;
+ pVnode = NULL;
} else {
int32_t refCount = atomic_add_fetch_32(&pVnode->refCount, 1);
// dTrace("vgId:%d, acquire vnode, ref:%d", pVnode->vgId, refCount);
@@ -82,6 +83,7 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
taosThreadRwlockUnlock(&pMgmt->lock);
vmReleaseVnode(pMgmt, pVnode);
+ dTrace("vgId:%d, wait for vnode ref become 0", pVnode->vgId);
while (pVnode->refCount > 0) taosMsleep(10);
dTrace("vgId:%d, wait for vnode queue is empty", pVnode->vgId);
@@ -90,6 +92,7 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
while (!taosQueueEmpty(pVnode->pApplyQ)) taosMsleep(10);
while (!taosQueueEmpty(pVnode->pQueryQ)) taosMsleep(10);
while (!taosQueueEmpty(pVnode->pFetchQ)) taosMsleep(10);
+ while (!taosQueueEmpty(pVnode->pStreamQ)) taosMsleep(10);
dTrace("vgId:%d, vnode queue is empty", pVnode->vgId);
vmFreeQueue(pMgmt, pVnode);
diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
index 1d795c74f234f0b91978f4c2c738b64f3ffb0464..4a60dbfe0fbbc8e207f42a3399495bb173ca49dc 100644
--- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
@@ -81,15 +81,15 @@ static void vmProcessQueryQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
taosFreeQitem(pMsg);
}
-static void vmProcessFetchQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
+static void vmProcessStreamQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
SVnodeObj *pVnode = pInfo->ahandle;
const STraceId *trace = &pMsg->info.traceId;
- dGTrace("vgId:%d, msg:%p get from vnode-fetch queue", pVnode->vgId, pMsg);
+ dGTrace("vgId:%d, msg:%p get from vnode-stream queue", pVnode->vgId, pMsg);
int32_t code = vnodeProcessFetchMsg(pVnode->pImpl, pMsg, pInfo);
if (code != 0) {
if (terrno != 0) code = terrno;
- dGError("vgId:%d, msg:%p failed to fetch since %s", pVnode->vgId, pMsg, terrstr());
+ dGError("vgId:%d, msg:%p failed to stream since %s", pVnode->vgId, pMsg, terrstr());
vmSendRsp(pMsg, code);
}
@@ -98,6 +98,28 @@ static void vmProcessFetchQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
taosFreeQitem(pMsg);
}
+static void vmProcessFetchQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) {
+ SVnodeObj *pVnode = pInfo->ahandle;
+ SRpcMsg *pMsg = NULL;
+
+ for (int32_t i = 0; i < numOfMsgs; ++i) {
+ if (taosGetQitem(qall, (void **)&pMsg) == 0) continue;
+ const STraceId *trace = &pMsg->info.traceId;
+ dGTrace("vgId:%d, msg:%p get from vnode-fetch queue", pVnode->vgId, pMsg);
+
+ int32_t code = vnodeProcessFetchMsg(pVnode->pImpl, pMsg, pInfo);
+ if (code != 0) {
+ if (terrno != 0) code = terrno;
+ dGError("vgId:%d, msg:%p failed to fetch since %s", pVnode->vgId, pMsg, terrstr());
+ vmSendRsp(pMsg, code);
+ }
+
+ dGTrace("vgId:%d, msg:%p is freed, code:0x%x", pVnode->vgId, pMsg, code);
+ rpcFreeCont(pMsg->pCont);
+ taosFreeQitem(pMsg);
+ }
+}
+
static void vmProcessSyncQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) {
SVnodeObj *pVnode = pInfo->ahandle;
SRpcMsg *pMsg = NULL;
@@ -135,6 +157,10 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
dGTrace("vgId:%d, msg:%p put into vnode-query queue", pVnode->vgId, pMsg);
taosWriteQitem(pVnode->pQueryQ, pMsg);
break;
+ case STREAM_QUEUE:
+ dGTrace("vgId:%d, msg:%p put into vnode-stream queue", pVnode->vgId, pMsg);
+ taosWriteQitem(pVnode->pStreamQ, pMsg);
+ break;
case FETCH_QUEUE:
dGTrace("vgId:%d, msg:%p put into vnode-fetch queue", pVnode->vgId, pMsg);
taosWriteQitem(pVnode->pFetchQ, pMsg);
@@ -169,6 +195,8 @@ int32_t vmPutMsgToQueryQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return vmPutMsg
int32_t vmPutMsgToFetchQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return vmPutMsgToQueue(pMgmt, pMsg, FETCH_QUEUE); }
+int32_t vmPutMsgToStreamQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return vmPutMsgToQueue(pMgmt, pMsg, STREAM_QUEUE); }
+
int32_t vmPutMsgToMgmtQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
const STraceId *trace = &pMsg->info.traceId;
dGTrace("msg:%p, put into vnode-mgmt queue", pMsg);
@@ -201,9 +229,9 @@ int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
int32_t code = vmPutMsgToQueue(pMgmt, pMsg, qtype);
if (code != 0) {
dTrace("msg:%p, is freed", pMsg);
- taosFreeQitem(pMsg);
rpcFreeCont(pMsg->pCont);
pRpc->pCont = NULL;
+ taosFreeQitem(pMsg);
}
return code;
@@ -229,11 +257,14 @@ int32_t vmGetQueueSize(SVnodeMgmt *pMgmt, int32_t vgId, EQueueType qtype) {
case FETCH_QUEUE:
size = taosQueueItemSize(pVnode->pFetchQ);
break;
+ case STREAM_QUEUE:
+ size = taosQueueItemSize(pVnode->pStreamQ);
+ break;
default:
break;
}
+ vmReleaseVnode(pMgmt, pVnode);
}
- vmReleaseVnode(pMgmt, pVnode);
return size;
}
@@ -242,15 +273,21 @@ int32_t vmAllocQueue(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
pVnode->pSyncQ = tWWorkerAllocQueue(&pMgmt->syncPool, pVnode, (FItems)vmProcessSyncQueue);
pVnode->pApplyQ = tWWorkerAllocQueue(&pMgmt->applyPool, pVnode->pImpl, (FItems)vnodeApplyWriteMsg);
pVnode->pQueryQ = tQWorkerAllocQueue(&pMgmt->queryPool, pVnode, (FItem)vmProcessQueryQueue);
- pVnode->pFetchQ = tQWorkerAllocQueue(&pMgmt->fetchPool, pVnode, (FItem)vmProcessFetchQueue);
+ pVnode->pStreamQ = tQWorkerAllocQueue(&pMgmt->streamPool, pVnode, (FItem)vmProcessStreamQueue);
+ pVnode->pFetchQ = tWWorkerAllocQueue(&pMgmt->fetchPool, pVnode, (FItems)vmProcessFetchQueue);
if (pVnode->pWriteQ == NULL || pVnode->pSyncQ == NULL || pVnode->pApplyQ == NULL || pVnode->pQueryQ == NULL ||
- pVnode->pFetchQ == NULL) {
+ pVnode->pStreamQ == NULL || pVnode->pFetchQ == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1;
}
- dDebug("vgId:%d, queue is alloced", pVnode->vgId);
+ dDebug("vgId:%d, write-queue:%p is alloced", pVnode->vgId, pVnode->pWriteQ);
+ dDebug("vgId:%d, sync-queue:%p is alloced", pVnode->vgId, pVnode->pSyncQ);
+ dDebug("vgId:%d, apply-queue:%p is alloced", pVnode->vgId, pVnode->pApplyQ);
+ dDebug("vgId:%d, query-queue:%p is alloced", pVnode->vgId, pVnode->pQueryQ);
+ dDebug("vgId:%d, stream-queue:%p is alloced", pVnode->vgId, pVnode->pStreamQ);
+ dDebug("vgId:%d, fetch-queue:%p is alloced", pVnode->vgId, pVnode->pFetchQ);
return 0;
}
@@ -259,11 +296,13 @@ void vmFreeQueue(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
tWWorkerFreeQueue(&pMgmt->applyPool, pVnode->pApplyQ);
tWWorkerFreeQueue(&pMgmt->syncPool, pVnode->pSyncQ);
tQWorkerFreeQueue(&pMgmt->queryPool, pVnode->pQueryQ);
- tQWorkerFreeQueue(&pMgmt->fetchPool, pVnode->pFetchQ);
+ tQWorkerFreeQueue(&pMgmt->streamPool, pVnode->pStreamQ);
+ tWWorkerFreeQueue(&pMgmt->fetchPool, pVnode->pFetchQ);
pVnode->pWriteQ = NULL;
pVnode->pSyncQ = NULL;
pVnode->pApplyQ = NULL;
pVnode->pQueryQ = NULL;
+ pVnode->pStreamQ = NULL;
pVnode->pFetchQ = NULL;
dDebug("vgId:%d, queue is freed", pVnode->vgId);
}
@@ -275,11 +314,16 @@ int32_t vmStartWorker(SVnodeMgmt *pMgmt) {
pQPool->max = tsNumOfVnodeQueryThreads;
if (tQWorkerInit(pQPool) != 0) return -1;
- SQWorkerPool *pFPool = &pMgmt->fetchPool;
+ SQWorkerPool *pStreamPool = &pMgmt->streamPool;
+ pStreamPool->name = "vnode-stream";
+ pStreamPool->min = tsNumOfVnodeStreamThreads;
+ pStreamPool->max = tsNumOfVnodeStreamThreads;
+ if (tQWorkerInit(pStreamPool) != 0) return -1;
+
+ SWWorkerPool *pFPool = &pMgmt->fetchPool;
pFPool->name = "vnode-fetch";
- pFPool->min = tsNumOfVnodeFetchThreads;
pFPool->max = tsNumOfVnodeFetchThreads;
- if (tQWorkerInit(pFPool) != 0) return -1;
+ if (tWWorkerInit(pFPool) != 0) return -1;
SWWorkerPool *pWPool = &pMgmt->writePool;
pWPool->name = "vnode-write";
@@ -325,6 +369,7 @@ void vmStopWorker(SVnodeMgmt *pMgmt) {
tWWorkerCleanup(&pMgmt->applyPool);
tWWorkerCleanup(&pMgmt->syncPool);
tQWorkerCleanup(&pMgmt->queryPool);
- tQWorkerCleanup(&pMgmt->fetchPool);
+ tQWorkerCleanup(&pMgmt->streamPool);
+ tWWorkerCleanup(&pMgmt->fetchPool);
dDebug("vnode workers are closed");
}
diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c
index 9ce108b789b1d910b011306e50b169ba1828e453..3e5d378bb11959da0155a1aa31a3f7ea77307819 100644
--- a/source/dnode/mnode/impl/src/mndDnode.c
+++ b/source/dnode/mnode/impl/src/mndDnode.c
@@ -781,7 +781,13 @@ _OVER:
}
static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
- SMnode *pMnode = pReq->info.node;
+ SMnode *pMnode = pReq->info.node;
+ const char *options[] = {
+ "debugFlag", "dDebugFlag", "vDebugFlag", "mDebugFlag", "wDebugFlag", "sDebugFlag",
+ "tsdbDebugFlag", "tqDebugFlag", "fsDebugFlag", "udfDebugFlag", "smaDebugFlag", "idxDebugFlag",
+ "tmrDebugFlag", "uDebugFlag", "smaDebugFlag", "rpcDebugFlag", "qDebugFlag",
+ };
+ int32_t optionSize = tListLen(options);
SMCfgDnodeReq cfgReq = {0};
if (tDeserializeSMCfgDnodeReq(pReq->pCont, pReq->contLen, &cfgReq) != 0) {
@@ -802,27 +808,52 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
SEpSet epSet = mndGetDnodeEpset(pDnode);
mndReleaseDnode(pMnode, pDnode);
+
SDCfgDnodeReq dcfgReq = {0};
- if (strncasecmp(cfgReq.config, "debugFlag", 9) == 0) {
+ if (strcasecmp(cfgReq.config, "resetlog") == 0) {
+ strcpy(dcfgReq.config, "resetlog");
+ } else if (strncasecmp(cfgReq.config, "monitor", 7) == 0) {
const char *value = cfgReq.value;
int32_t flag = atoi(value);
if (flag <= 0) {
- flag = atoi(cfgReq.config + 10);
+ flag = atoi(cfgReq.config + 8);
}
- if (flag <= 0 || flag > 255) {
- mError("dnode:%d, failed to config debugFlag since value:%d", cfgReq.dnodeId, flag);
+ if (flag < 0 || flag > 2) {
+ mError("dnode:%d, failed to config monitor since value:%d", cfgReq.dnodeId, flag);
terrno = TSDB_CODE_INVALID_CFG;
return -1;
}
- strcpy(dcfgReq.config, "debugFlag");
+ strcpy(dcfgReq.config, "monitor");
snprintf(dcfgReq.value, TSDB_DNODE_VALUE_LEN, "%d", flag);
- } else if (strcasecmp(cfgReq.config, "resetlog") == 0) {
- strcpy(dcfgReq.config, "resetlog");
} else {
- terrno = TSDB_CODE_INVALID_CFG;
- mError("dnode:%d, failed to config since %s", cfgReq.dnodeId, terrstr());
- return -1;
+ bool findOpt = false;
+ for (int32_t d = 0; d < optionSize; ++d) {
+ const char *optName = options[d];
+ int32_t optLen = strlen(optName);
+ if (strncasecmp(cfgReq.config, optName, optLen) != 0) continue;
+
+ const char *value = cfgReq.value;
+ int32_t flag = atoi(value);
+ if (flag <= 0) {
+ flag = atoi(cfgReq.config + optLen + 1);
+ }
+ if (flag <= 0 || flag > 255) {
+ mError("dnode:%d, failed to config %s since value:%d", cfgReq.dnodeId, optName, flag);
+ terrno = TSDB_CODE_INVALID_CFG;
+ return -1;
+ }
+
+ tstrncpy(dcfgReq.config, optName, optLen + 1);
+ snprintf(dcfgReq.value, TSDB_DNODE_VALUE_LEN, "%d", flag);
+ findOpt = true;
+ }
+
+ if (!findOpt) {
+ terrno = TSDB_CODE_INVALID_CFG;
+ mError("dnode:%d, failed to config since %s", cfgReq.dnodeId, terrstr());
+ return -1;
+ }
}
int32_t bufLen = tSerializeSDCfgDnodeReq(NULL, 0, &dcfgReq);
@@ -831,13 +862,14 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
if (pBuf == NULL) return -1;
tSerializeSDCfgDnodeReq(pBuf, bufLen, &dcfgReq);
- mDebug("dnode:%d, send config req to dnode, app:%p", cfgReq.dnodeId, pReq->info.ahandle);
+ mInfo("dnode:%d, send config req to dnode, app:%p config:%s value:%s", cfgReq.dnodeId, pReq->info.ahandle,
+ dcfgReq.config, dcfgReq.value);
SRpcMsg rpcMsg = {.msgType = TDMT_DND_CONFIG_DNODE, .pCont = pBuf, .contLen = bufLen};
return tmsgSendReq(&epSet, &rpcMsg);
}
static int32_t mndProcessConfigDnodeRsp(SRpcMsg *pRsp) {
- mDebug("config rsp from dnode, app:%p", pRsp->info.ahandle);
+ mInfo("config rsp from dnode, app:%p", pRsp->info.ahandle);
return 0;
}
diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c
index c03951b1d89e312c366dc281d94a351725383b30..d7eaa722026db935d0369e84b3513bf5603830c7 100644
--- a/source/dnode/mnode/impl/src/mndMnode.c
+++ b/source/dnode/mnode/impl/src/mndMnode.c
@@ -218,6 +218,7 @@ bool mndIsMnode(SMnode *pMnode, int32_t dnodeId) {
}
void mndGetMnodeEpSet(SMnode *pMnode, SEpSet *pEpSet) {
+#if 0
SSdb *pSdb = pMnode->pSdb;
int32_t totalMnodes = sdbGetSize(pSdb, SDB_MNODE);
void *pIter = NULL;
@@ -237,6 +238,9 @@ void mndGetMnodeEpSet(SMnode *pMnode, SEpSet *pEpSet) {
addEpIntoEpSet(pEpSet, pObj->pDnode->fqdn, pObj->pDnode->port);
sdbRelease(pSdb, pObj);
}
+#else
+ syncGetRetryEpSet(pMnode->syncMgmt.sync, pEpSet);
+#endif
}
static int32_t mndSetCreateMnodeRedoLogs(SMnode *pMnode, STrans *pTrans, SMnodeObj *pObj) {
diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c
index 1e576250285b88aaab8f4aad134bbb240e2646f3..bff33af5afb92d7bb41ba810e817fe095d569ec9 100644
--- a/source/dnode/mnode/impl/src/mndStb.c
+++ b/source/dnode/mnode/impl/src/mndStb.c
@@ -45,7 +45,7 @@ static int32_t mndProcessTableMetaReq(SRpcMsg *pReq);
static int32_t mndRetrieveStb(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows);
static void mndCancelGetNextStb(SMnode *pMnode, void *pIter);
static int32_t mndProcessTableCfgReq(SRpcMsg *pReq);
-static int32_t mndAlterStbImp(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SStbObj *pStb, bool needRsp);
+static int32_t mndAlterStbImp(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SStbObj *pStb, bool needRsp, void* alterOriData, int32_t alterOriDataLen);
int32_t mndInitStb(SMnode *pMnode) {
SSdbTable table = {
@@ -409,7 +409,7 @@ static FORCE_INLINE int32_t schemaExColIdCompare(const void *colId, const void *
return 0;
}
-static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb, int32_t *pContLen) {
+static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb, int32_t *pContLen, void* alterOriData, int32_t alterOriDataLen) {
SEncoder encoder = {0};
int32_t contLen;
SName name = {0};
@@ -422,6 +422,8 @@ static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pSt
req.name = (char *)tNameGetTableName(&name);
req.suid = pStb->uid;
req.rollup = pStb->ast1Len > 0 ? 1 : 0;
+ req.alterOriData = alterOriData;
+ req.alterOriDataLen = alterOriDataLen;
// todo
req.schemaRow.nCols = pStb->numOfColumns;
req.schemaRow.version = pStb->colVer;
@@ -626,7 +628,7 @@ static int32_t mndSetCreateStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
continue;
}
- void *pReq = mndBuildVCreateStbReq(pMnode, pVgroup, pStb, &contLen);
+ void *pReq = mndBuildVCreateStbReq(pMnode, pVgroup, pStb, &contLen, NULL, 0);
if (pReq == NULL) {
sdbCancelFetch(pSdb, pIter);
sdbRelease(pSdb, pVgroup);
@@ -706,10 +708,10 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat
memcpy(pDst->db, pDb->name, TSDB_DB_FNAME_LEN);
pDst->createdTime = taosGetTimestampMs();
pDst->updateTime = pDst->createdTime;
- pDst->uid = (pCreate->source == 1) ? pCreate->suid : mndGenerateUid(pCreate->name, TSDB_TABLE_FNAME_LEN);
+ pDst->uid = (pCreate->source == TD_REQ_FROM_TAOX) ? pCreate->suid : mndGenerateUid(pCreate->name, TSDB_TABLE_FNAME_LEN);
pDst->dbUid = pDb->uid;
- pDst->tagVer = (pCreate->source != TD_REQ_FROM_APP) ? pCreate->tagVer : 1;
- pDst->colVer = (pCreate->source != TD_REQ_FROM_APP) ? pCreate->colVer : 1;
+ pDst->tagVer = 1;
+ pDst->colVer = 1;
pDst->smaVer = 1;
pDst->nextColId = 1;
pDst->maxdelay[0] = pCreate->delay1;
@@ -849,6 +851,75 @@ static int32_t mndProcessTtlTimer(SRpcMsg *pReq) {
return 0;
}
+static int32_t mndFindSuperTableTagIndex(const SStbObj *pStb, const char *tagName) {
+ for (int32_t tag = 0; tag < pStb->numOfTags; tag++) {
+ if (strcasecmp(pStb->pTags[tag].name, tagName) == 0) {
+ return tag;
+ }
+ }
+
+ return -1;
+}
+
+static int32_t mndFindSuperTableColumnIndex(const SStbObj *pStb, const char *colName) {
+ for (int32_t col = 0; col < pStb->numOfColumns; col++) {
+ if (strcasecmp(pStb->pColumns[col].name, colName) == 0) {
+ return col;
+ }
+ }
+
+ return -1;
+}
+
+static int32_t mndBuildStbFromAlter(SStbObj *pStb, SStbObj *pDst, SMCreateStbReq *createReq) {
+ taosRLockLatch(&pStb->lock);
+ memcpy(pDst, pStb, sizeof(SStbObj));
+ taosRUnLockLatch(&pStb->lock);
+
+ pDst->updateTime = taosGetTimestampMs();
+ pDst->numOfColumns = createReq->numOfColumns;
+ pDst->numOfTags = createReq->numOfTags;
+ pDst->pColumns = taosMemoryCalloc(1, pDst->numOfColumns * sizeof(SSchema));
+ pDst->pTags = taosMemoryCalloc(1, pDst->numOfTags * sizeof(SSchema));
+ if (pDst->pColumns == NULL || pDst->pTags == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ return -1;
+ }
+
+ for (int32_t i = 0; i < pDst->numOfColumns; ++i) {
+ SField *pField = taosArrayGet(createReq->pColumns, i);
+ SSchema *pSchema = &pDst->pColumns[i];
+ pSchema->type = pField->type;
+ pSchema->bytes = pField->bytes;
+ pSchema->flags = pField->flags;
+ memcpy(pSchema->name, pField->name, TSDB_COL_NAME_LEN);
+ int32_t cIndex = mndFindSuperTableColumnIndex(pStb, pField->name);
+ if (cIndex >= 0){
+ pSchema->colId = pStb->pColumns[cIndex].colId;
+ }else{
+ pSchema->colId = pDst->nextColId++;
+ }
+ }
+
+ for (int32_t i = 0; i < pDst->numOfTags; ++i) {
+ SField *pField = taosArrayGet(createReq->pTags, i);
+ SSchema *pSchema = &pDst->pTags[i];
+ pSchema->type = pField->type;
+ pSchema->bytes = pField->bytes;
+ memcpy(pSchema->name, pField->name, TSDB_COL_NAME_LEN);
+ int32_t cIndex = mndFindSuperTableTagIndex(pStb, pField->name);
+ if (cIndex >= 0){
+ pSchema->colId = pStb->pTags[cIndex].colId;
+ }else{
+ pSchema->colId = pDst->nextColId++;
+ }
+
+ }
+ pDst->tagVer = createReq->tagVer;
+ pDst->colVer = createReq->colVer;
+ return TSDB_CODE_SUCCESS;
+}
+
static int32_t mndProcessCreateStbReq(SRpcMsg *pReq) {
SMnode *pMnode = pReq->info.node;
int32_t code = -1;
@@ -881,9 +952,9 @@ static int32_t mndProcessCreateStbReq(SRpcMsg *pReq) {
terrno = TSDB_CODE_MND_STABLE_UID_NOT_MATCH;
goto _OVER;
} else if (createReq.tagVer > 0 || createReq.colVer > 0) {
- int32_t tagDelta = pStb->tagVer - createReq.tagVer;
- int32_t colDelta = pStb->colVer - createReq.colVer;
- int32_t verDelta = tagDelta + verDelta;
+ int32_t tagDelta = createReq.tagVer - pStb->tagVer;
+ int32_t colDelta = createReq.colVer - pStb->colVer;
+ int32_t verDelta = tagDelta + colDelta;
mInfo("stb:%s, already exist while create, input tagVer:%d colVer:%d, exist tagVer:%d colVer:%d",
createReq.name, createReq.tagVer, createReq.colVer, pStb->tagVer, pStb->colVer);
if (tagDelta <= 0 && colDelta <= 0) {
@@ -910,6 +981,10 @@ static int32_t mndProcessCreateStbReq(SRpcMsg *pReq) {
}
} else if (terrno != TSDB_CODE_MND_STB_NOT_EXIST) {
goto _OVER;
+ } else if (createReq.source == TD_REQ_FROM_TAOX && (createReq.tagVer != 1 || createReq.colVer != 1)){
+ mInfo("stb:%s, alter table does not need to be done, because table is deleted", createReq.name);
+ code = 0;
+ goto _OVER;
}
pDb = mndAcquireDbByStb(pMnode, createReq.name);
@@ -934,7 +1009,16 @@ static int32_t mndProcessCreateStbReq(SRpcMsg *pReq) {
if (isAlter) {
bool needRsp = false;
- code = mndAlterStbImp(pMnode, pReq, pDb, pStb, needRsp);
+ SStbObj pDst = {0};
+ if (mndBuildStbFromAlter(pStb, &pDst, &createReq) != 0) {
+ taosMemoryFreeClear(pDst.pTags);
+ taosMemoryFreeClear(pDst.pColumns);
+ goto _OVER;
+ }
+
+ code = mndAlterStbImp(pMnode, pReq, pDb, &pDst, needRsp, NULL, 0);
+ taosMemoryFreeClear(pDst.pTags);
+ taosMemoryFreeClear(pDst.pColumns);
} else {
code = mndCreateStb(pMnode, pReq, &createReq, pDb);
}
@@ -972,26 +1056,6 @@ static int32_t mndCheckAlterStbReq(SMAlterStbReq *pAlter) {
return 0;
}
-static int32_t mndFindSuperTableTagIndex(const SStbObj *pStb, const char *tagName) {
- for (int32_t tag = 0; tag < pStb->numOfTags; tag++) {
- if (strcasecmp(pStb->pTags[tag].name, tagName) == 0) {
- return tag;
- }
- }
-
- return -1;
-}
-
-static int32_t mndFindSuperTableColumnIndex(const SStbObj *pStb, const char *colName) {
- for (int32_t col = 0; col < pStb->numOfColumns; col++) {
- if (strcasecmp(pStb->pColumns[col].name, colName) == 0) {
- return col;
- }
- }
-
- return -1;
-}
-
static int32_t mndAllocStbSchemas(const SStbObj *pOld, SStbObj *pNew) {
pNew->pTags = taosMemoryCalloc(pNew->numOfTags, sizeof(SSchema));
pNew->pColumns = taosMemoryCalloc(pNew->numOfColumns, sizeof(SSchema));
@@ -1315,7 +1379,7 @@ static int32_t mndSetAlterStbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj *
return 0;
}
-static int32_t mndSetAlterStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SStbObj *pStb) {
+static int32_t mndSetAlterStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SStbObj *pStb, void* alterOriData, int32_t alterOriDataLen) {
SSdb *pSdb = pMnode->pSdb;
SVgObj *pVgroup = NULL;
void *pIter = NULL;
@@ -1329,7 +1393,7 @@ static int32_t mndSetAlterStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
continue;
}
- void *pReq = mndBuildVCreateStbReq(pMnode, pVgroup, pStb, &contLen);
+ void *pReq = mndBuildVCreateStbReq(pMnode, pVgroup, pStb, &contLen, alterOriData, alterOriDataLen);
if (pReq == NULL) {
sdbCancelFetch(pSdb, pIter);
sdbRelease(pSdb, pVgroup);
@@ -1542,7 +1606,7 @@ static int32_t mndBuildSMAlterStbRsp(SDbObj *pDb, SStbObj *pObj, void **pCont, i
return 0;
}
-static int32_t mndAlterStbImp(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SStbObj *pStb, bool needRsp) {
+static int32_t mndAlterStbImp(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SStbObj *pStb, bool needRsp, void* alterOriData, int32_t alterOriDataLen) {
int32_t code = -1;
STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_DB_INSIDE, pReq);
if (pTrans == NULL) goto _OVER;
@@ -1559,7 +1623,7 @@ static int32_t mndAlterStbImp(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SStbOb
if (mndSetAlterStbRedoLogs(pMnode, pTrans, pDb, pStb) != 0) goto _OVER;
if (mndSetAlterStbCommitLogs(pMnode, pTrans, pDb, pStb) != 0) goto _OVER;
- if (mndSetAlterStbRedoActions(pMnode, pTrans, pDb, pStb) != 0) goto _OVER;
+ if (mndSetAlterStbRedoActions(pMnode, pTrans, pDb, pStb, alterOriData, alterOriDataLen) != 0) goto _OVER;
if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
code = 0;
@@ -1620,7 +1684,7 @@ static int32_t mndAlterStb(SMnode *pMnode, SRpcMsg *pReq, const SMAlterStbReq *p
}
if (code != 0) goto _OVER;
- code = mndAlterStbImp(pMnode, pReq, pDb, &stbObj, needRsp);
+ code = mndAlterStbImp(pMnode, pReq, pDb, &stbObj, needRsp, pReq->pCont, pReq->contLen);
_OVER:
taosMemoryFreeClear(stbObj.pTags);
@@ -1785,8 +1849,8 @@ static int32_t mndProcessDropStbReq(SRpcMsg *pReq) {
}
}
- if (dropReq.source != TD_REQ_FROM_APP && pStb->uid != dropReq.suid) {
- terrno = TSDB_CODE_MND_STB_NOT_EXIST;
+ if (dropReq.source == TD_REQ_FROM_TAOX && pStb->uid != dropReq.suid) {
+ code = 0;
goto _OVER;
}
diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c
index bcf926e5ee7a5f9a9879f3dc613f13e9fbd9eefb..3c3864b620861c36836df917c361f3f979d26077 100644
--- a/source/dnode/mnode/impl/src/mndSync.c
+++ b/source/dnode/mnode/impl/src/mndSync.c
@@ -56,20 +56,22 @@ void mndSyncCommitMsg(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta cbM
sdbSetApplyInfo(pMnode->pSdb, cbMeta.index, cbMeta.term, cbMeta.lastConfigIndex);
}
- if (pMgmt->transId == transId) {
+ if (pMgmt->transId == transId && transId != 0) {
if (pMgmt->errCode != 0) {
mError("trans:%d, failed to propose since %s", transId, tstrerror(pMgmt->errCode));
}
pMgmt->transId = 0;
tsem_post(&pMgmt->syncSem);
} else {
+#if 1
+ mError("trans:%d, invalid commit msg since trandId not match with %d", transId, pMgmt->transId);
+#else
STrans *pTrans = mndAcquireTrans(pMnode, transId);
if (pTrans != NULL) {
mndTransExecute(pMnode, pTrans);
mndReleaseTrans(pMnode, pTrans);
}
-#if 0
- sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
+ // sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
#endif
}
}
diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h
index 1294f0cff3446dca7fb7dcdfc6d293d947d13852..be56d901de35cee34c41fe7c9b902ef43a65e38b 100644
--- a/source/dnode/mnode/sdb/inc/sdb.h
+++ b/source/dnode/mnode/sdb/inc/sdb.h
@@ -163,6 +163,7 @@ typedef struct SSdbRow {
ESdbType type;
ESdbStatus status;
int32_t refCount;
+ int64_t forAlign;
char pObj[];
} SSdbRow;
diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h
index 8f2d3bde0926ed1c0d96a2152b1620e352fec7bc..f0a6b6505d68cc77b6dedb52c48e87cd06491528 100644
--- a/source/dnode/vnode/inc/vnode.h
+++ b/source/dnode/vnode/inc/vnode.h
@@ -137,9 +137,8 @@ int64_t tsdbGetNumOfRowsInMemTable(STsdbReader *pHandle);
void *tsdbGetIdx(SMeta *pMeta);
void *tsdbGetIvtIdx(SMeta *pMeta);
-int32_t tsdbLastRowReaderOpen(void *pVnode, int32_t type, SArray *pTableIdList, int32_t *colId, int32_t numOfCols,
- void **pReader);
-int32_t tsdbRetrieveLastRow(void *pReader, SSDataBlock *pResBlock, const int32_t *slotIds);
+int32_t tsdbLastRowReaderOpen(void *pVnode, int32_t type, SArray *pTableIdList, int32_t numOfCols, void **pReader);
+int32_t tsdbRetrieveLastRow(void *pReader, SSDataBlock *pResBlock, const int32_t *slotIds, SArray* pTableUids);
int32_t tsdbLastrowReaderClose(void *pReader);
int32_t tsdbGetTableSchema(SVnode *pVnode, int64_t uid, STSchema **pSchema, int64_t *suid);
diff --git a/source/dnode/vnode/src/inc/tq.h b/source/dnode/vnode/src/inc/tq.h
index 8abaac6dffb15a656d78cd4454001ae8d28b8277..c62b7e95bfe4aa0d54401f5bd1b2434476db0cba 100644
--- a/source/dnode/vnode/src/inc/tq.h
+++ b/source/dnode/vnode/src/inc/tq.h
@@ -89,8 +89,6 @@ typedef struct {
STqExecTb execTb;
STqExecDb execDb;
};
- // TODO remove it
- int64_t tsdbEndVer;
} STqExecHandle;
@@ -101,6 +99,8 @@ typedef struct {
int32_t epoch;
int8_t fetchMeta;
+ int64_t snapshotVer;
+
// TODO remove
SWalReader* pWalReader;
@@ -131,7 +131,7 @@ typedef struct {
static STqMgmt tqMgmt = {0};
// tqRead
-int64_t tqScan(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, STqOffsetVal* offset);
+int64_t tqScan(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffsetVal* offset);
int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHead** pHeadWithCkSum);
// tqExec
diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c
index daf7ccb26ae1091e386dd038aec713f857cb39aa..29c10c40c2b00d8e9006fc4b9fe2505059c3e8a6 100644
--- a/source/dnode/vnode/src/meta/metaTable.c
+++ b/source/dnode/vnode/src/meta/metaTable.c
@@ -1125,6 +1125,11 @@ static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME) {
skmDbKey.uid = pME->uid;
skmDbKey.sver = pSW->version;
+ // if receive tmq meta message is: create stable1 then delete stable1 then create stable1 with multi vgroups
+ if (tdbTbGet(pMeta->pSkmDb, &skmDbKey, sizeof(skmDbKey), NULL, NULL) == 0) {
+ return rcode;
+ }
+
// encode schema
int32_t ret = 0;
tEncodeSize(tEncodeSSchemaWrapper, pSW, vLen, ret);
diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c
index fbb972fafe2ad644f82035f3f12a4a2347a49643..6f4a04ee09d6a6b7f4afb96374fe0ab62dc5abfc 100644
--- a/source/dnode/vnode/src/tq/tq.c
+++ b/source/dnode/vnode/src/tq/tq.c
@@ -244,6 +244,9 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
STqOffsetVal reqOffset = pReq->reqOffset;
STqOffsetVal fetchOffsetNew;
+ // todo
+ workerId = 0;
+
// 1.find handle
STqHandle* pHandle = taosHashGet(pTq->handles, pReq->subKey, strlen(pReq->subKey));
/*ASSERT(pHandle);*/
@@ -284,7 +287,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
fetchOffsetNew = pOffset->val;
char formatBuf[80];
tFormatOffset(formatBuf, 80, &fetchOffsetNew);
- tqDebug("tmq poll: consumer %" PRId64 ", subkey %s, offset reset to %s", consumerId, pHandle->subKey, formatBuf);
+ tqDebug("tmq poll: consumer %" PRId64 ", subkey %s, vg %d, offset reset to %s", consumerId, pHandle->subKey,
+ TD_VID(pTq->pVnode), formatBuf);
} else {
if (reqOffset.type == TMQ_OFFSET__RESET_EARLIEAST) {
if (pReq->useSnapshot && pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
@@ -299,8 +303,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
}
} else if (reqOffset.type == TMQ_OFFSET__RESET_LATEST) {
tqOffsetResetToLog(&dataRsp.rspOffset, walGetLastVer(pTq->pVnode->pWal));
- tqDebug("tmq poll: consumer %ld, subkey %s, offset reset to %ld", consumerId, pHandle->subKey,
- dataRsp.rspOffset.version);
+ tqDebug("tmq poll: consumer %ld, subkey %s, vg %d, offset reset to %ld", consumerId, pHandle->subKey,
+ TD_VID(pTq->pVnode), dataRsp.rspOffset.version);
if (tqSendDataRsp(pTq, pMsg, pReq, &dataRsp) < 0) {
code = -1;
}
@@ -318,10 +322,10 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
// 3.query
if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
- if (fetchOffsetNew.type == TMQ_OFFSET__LOG) {
- fetchOffsetNew.version++;
- }
- if (tqScan(pTq, &pHandle->execHandle, &dataRsp, &fetchOffsetNew) < 0) {
+ /*if (fetchOffsetNew.type == TMQ_OFFSET__LOG) {*/
+ /*fetchOffsetNew.version++;*/
+ /*}*/
+ if (tqScan(pTq, pHandle, &dataRsp, &fetchOffsetNew) < 0) {
ASSERT(0);
code = -1;
goto OVER;
@@ -397,7 +401,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
tqDebug("fetch meta msg, ver:%" PRId64 ", type:%d", pHead->version, pHead->msgType);
SMqMetaRsp metaRsp = {0};
/*metaRsp.reqOffset = pReq->reqOffset.version;*/
- /*metaRsp.rspOffset = fetchVer;*/
+ metaRsp.rspOffset = fetchVer;
/*metaRsp.rspOffsetNew.version = fetchVer;*/
tqOffsetResetToLog(&metaRsp.reqOffsetNew, pReq->reqOffset.version);
tqOffsetResetToLog(&metaRsp.rspOffsetNew, fetchVer);
@@ -480,30 +484,28 @@ int32_t tqProcessVgChangeReq(STQ* pTq, char* msg, int32_t msgLen) {
pHandle->fetchMeta = req.withMeta;
pHandle->pWalReader = walOpenReader(pTq->pVnode->pWal, NULL);
- /*for (int32_t i = 0; i < 5; i++) {*/
- /*pHandle->execHandle.pExecReader[i] = tqOpenReader(pTq->pVnode);*/
- /*}*/
+
+ // TODO version should be assigned in preprocess
int64_t ver = walGetCommittedVer(pTq->pVnode->pWal);
if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
pHandle->execHandle.execCol.qmsg = req.qmsg;
+ pHandle->snapshotVer = ver;
req.qmsg = NULL;
for (int32_t i = 0; i < 5; i++) {
SReadHandle handle = {
- .tqReader = pHandle->execHandle.pExecReader[i],
.meta = pTq->pVnode->pMeta,
.vnode = pTq->pVnode,
.initTableReader = true,
.initTqReader = true,
.version = ver,
};
- pHandle->execHandle.execCol.task[i] = qCreateStreamExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle);
+ pHandle->execHandle.execCol.task[i] = qCreateQueueExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle);
ASSERT(pHandle->execHandle.execCol.task[i]);
void* scanner = NULL;
qExtractStreamScanner(pHandle->execHandle.execCol.task[i], &scanner);
ASSERT(scanner);
pHandle->execHandle.pExecReader[i] = qExtractReaderFromStreamScanner(scanner);
ASSERT(pHandle->execHandle.pExecReader[i]);
- pHandle->execHandle.tsdbEndVer = ver;
}
} else if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__DB) {
for (int32_t i = 0; i < 5; i++) {
diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c
index 54e46e7b9aaf3b6ad036eca98bf3f6f61c169015..0bdbe82b772e807e6e05798ecb836b3b089d1bb0 100644
--- a/source/dnode/vnode/src/tq/tqExec.c
+++ b/source/dnode/vnode/src/tq/tqExec.c
@@ -59,13 +59,13 @@ static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, SMqDataRsp* pRsp) {
return 0;
}
-int64_t tqScan(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, STqOffsetVal* pOffset) {
- qTaskInfo_t task = pExec->execCol.task[0];
+int64_t tqScan(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffsetVal* pOffset) {
+ const STqExecHandle* pExec = &pHandle->execHandle;
+ qTaskInfo_t task = pExec->execCol.task[0];
if (qStreamPrepareScan(task, pOffset) < 0) {
ASSERT(pOffset->type == TMQ_OFFSET__LOG);
pRsp->rspOffset = *pOffset;
- pRsp->rspOffset.version--;
return 0;
}
@@ -73,9 +73,11 @@ int64_t tqScan(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, STqOffset
while (1) {
SSDataBlock* pDataBlock = NULL;
uint64_t ts = 0;
+ tqDebug("task start to execute");
if (qExecTask(task, &pDataBlock, &ts) < 0) {
ASSERT(0);
}
+ tqDebug("task execute end, get %p", pDataBlock);
if (pDataBlock != NULL) {
tqAddBlockDataToRsp(pDataBlock, pRsp);
@@ -97,7 +99,7 @@ int64_t tqScan(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, STqOffset
}
if (pRsp->blockNum == 0 && pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
- tqOffsetResetToLog(pOffset, pExec->tsdbEndVer + 1);
+ tqOffsetResetToLog(pOffset, pHandle->snapshotVer + 1);
qStreamPrepareScan(task, pOffset);
continue;
}
@@ -116,7 +118,7 @@ int64_t tqScan(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, STqOffset
if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) {
ASSERT(pRsp->rspOffset.version + 1 >= pRsp->reqOffset.version);
}
-
+ tqDebug("task exec exited");
break;
}
diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c
index 67fa4ed1661752aebc151a11babe42c190364d99..e6df58696d6421295f1a7e5551f4b1f05b75747e 100644
--- a/source/dnode/vnode/src/tq/tqMeta.c
+++ b/source/dnode/vnode/src/tq/tqMeta.c
@@ -19,6 +19,7 @@ static int32_t tEncodeSTqHandle(SEncoder* pEncoder, const STqHandle* pHandle) {
if (tStartEncode(pEncoder) < 0) return -1;
if (tEncodeCStr(pEncoder, pHandle->subKey) < 0) return -1;
if (tEncodeI64(pEncoder, pHandle->consumerId) < 0) return -1;
+ if (tEncodeI64(pEncoder, pHandle->snapshotVer) < 0) return -1;
if (tEncodeI32(pEncoder, pHandle->epoch) < 0) return -1;
if (tEncodeI8(pEncoder, pHandle->execHandle.subType) < 0) return -1;
if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
@@ -32,6 +33,7 @@ static int32_t tDecodeSTqHandle(SDecoder* pDecoder, STqHandle* pHandle) {
if (tStartDecode(pDecoder) < 0) return -1;
if (tDecodeCStrTo(pDecoder, pHandle->subKey) < 0) return -1;
if (tDecodeI64(pDecoder, &pHandle->consumerId) < 0) return -1;
+ if (tDecodeI64(pDecoder, &pHandle->snapshotVer) < 0) return -1;
if (tDecodeI32(pDecoder, &pHandle->epoch) < 0) return -1;
if (tDecodeI8(pDecoder, &pHandle->execHandle.subType) < 0) return -1;
if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
@@ -78,19 +80,25 @@ int32_t tqMetaOpen(STQ* pTq) {
tDecoderInit(&decoder, (uint8_t*)pVal, vLen);
tDecodeSTqHandle(&decoder, &handle);
handle.pWalReader = walOpenReader(pTq->pVnode->pWal, NULL);
- for (int32_t i = 0; i < 5; i++) {
- handle.execHandle.pExecReader[i] = tqOpenReader(pTq->pVnode);
- }
+ /*for (int32_t i = 0; i < 5; i++) {*/
+ /*handle.execHandle.pExecReader[i] = tqOpenReader(pTq->pVnode);*/
+ /*}*/
if (handle.execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
for (int32_t i = 0; i < 5; i++) {
SReadHandle reader = {
- .tqReader = handle.execHandle.pExecReader[i],
.meta = pTq->pVnode->pMeta,
- .pMsgCb = &pTq->pVnode->msgCb,
.vnode = pTq->pVnode,
+ .initTableReader = true,
+ .initTqReader = true,
+ .version = handle.snapshotVer,
};
- handle.execHandle.execCol.task[i] = qCreateStreamExecTaskInfo(handle.execHandle.execCol.qmsg, &reader);
+ handle.execHandle.execCol.task[i] = qCreateQueueExecTaskInfo(handle.execHandle.execCol.qmsg, &reader);
ASSERT(handle.execHandle.execCol.task[i]);
+ void* scanner = NULL;
+ qExtractStreamScanner(handle.execHandle.execCol.task[i], &scanner);
+ ASSERT(scanner);
+ handle.execHandle.pExecReader[i] = qExtractReaderFromStreamScanner(scanner);
+ ASSERT(handle.execHandle.pExecReader[i]);
}
} else {
handle.execHandle.execDb.pFilterOutTbUid =
diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c
index 8753ecc47c04f1d5d4e151c502436225cc49e806..a7ad935caa12c5ee794784c48bfc09bcd3a59dbc 100644
--- a/source/dnode/vnode/src/tq/tqRead.c
+++ b/source/dnode/vnode/src/tq/tqRead.c
@@ -319,7 +319,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) {
return 0;
FAIL:
- tDeleteSSDataBlock(pBlock);
+ blockDataFreeRes(pBlock);
return -1;
}
diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c
index dbbb2b266101d2d21fc7bbbe1590b0f59af82e33..25615f8d5cc93e962fb8e61798f748cb75d9e0fd 100644
--- a/source/dnode/vnode/src/tq/tqSink.c
+++ b/source/dnode/vnode/src/tq/tqSink.c
@@ -50,6 +50,7 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
SVCreateTbReq createTbReq = {0};
createTbReq.name = buildCtbNameByGroupId(stbFullName, pDataBlock->info.groupId);
+ createTbReq.ctb.name = strdup(stbFullName);
createTbReq.flags = 0;
createTbReq.type = TSDB_CHILD_TABLE;
createTbReq.ctb.suid = suid;
diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c
index 150ed620bfe7a41c1ad26a9d3a882d6a8eacf3d8..5d3cfee592a027cd85342674b24b475eb982ee24 100644
--- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c
@@ -22,34 +22,35 @@ typedef struct SLastrowReader {
SVnode* pVnode;
STSchema* pSchema;
uint64_t uid;
- // int32_t* pSlotIds;
- char** transferBuf; // todo remove it soon
- int32_t numOfCols;
- int32_t type;
- int32_t tableIndex; // currently returned result tables
- SArray* pTableList; // table id list
+ char** transferBuf; // todo remove it soon
+ int32_t numOfCols;
+ int32_t type;
+ int32_t tableIndex; // currently returned result tables
+ SArray* pTableList; // table id list
} SLastrowReader;
static void saveOneRow(STSRow* pRow, SSDataBlock* pBlock, SLastrowReader* pReader, const int32_t* slotIds) {
+ ASSERT(pReader->numOfCols <= taosArrayGetSize(pBlock->pDataBlock));
int32_t numOfRows = pBlock->info.rows;
- size_t numOfCols = taosArrayGetSize(pBlock->pDataBlock);
SColVal colVal = {0};
- for (int32_t i = 0; i < numOfCols; ++i) {
+ for (int32_t i = 0; i < pReader->numOfCols; ++i) {
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i);
if (slotIds[i] == -1) {
colDataAppend(pColInfoData, numOfRows, (const char*)&pRow->ts, false);
} else {
- tTSRowGetVal(pRow, pReader->pSchema, slotIds[i], &colVal);
+ int32_t slotId = slotIds[i];
+
+ tTSRowGetVal(pRow, pReader->pSchema, slotId, &colVal);
if (IS_VAR_DATA_TYPE(colVal.type)) {
if (colVal.isNull || colVal.isNone) {
colDataAppendNULL(pColInfoData, numOfRows);
} else {
- varDataSetLen(pReader->transferBuf[i], colVal.value.nData);
- memcpy(varDataVal(pReader->transferBuf[i]), colVal.value.pData, colVal.value.nData);
- colDataAppend(pColInfoData, numOfRows, pReader->transferBuf[i], false);
+ varDataSetLen(pReader->transferBuf[slotId], colVal.value.nData);
+ memcpy(varDataVal(pReader->transferBuf[slotId]), colVal.value.pData, colVal.value.nData);
+ colDataAppend(pColInfoData, numOfRows, pReader->transferBuf[slotId], false);
}
} else {
colDataAppend(pColInfoData, numOfRows, (const char*)&colVal.value, colVal.isNull || colVal.isNone);
@@ -60,8 +61,7 @@ static void saveOneRow(STSRow* pRow, SSDataBlock* pBlock, SLastrowReader* pReade
pBlock->info.rows += 1;
}
-int32_t tsdbLastRowReaderOpen(void* pVnode, int32_t type, SArray* pTableIdList, int32_t* colId, int32_t numOfCols,
- void** pReader) {
+int32_t tsdbLastRowReaderOpen(void* pVnode, int32_t type, SArray* pTableIdList, int32_t numOfCols, void** pReader) {
SLastrowReader* p = taosMemoryCalloc(1, sizeof(SLastrowReader));
if (p == NULL) {
return TSDB_CODE_OUT_OF_MEMORY;
@@ -70,13 +70,18 @@ int32_t tsdbLastRowReaderOpen(void* pVnode, int32_t type, SArray* pTableIdList,
p->type = type;
p->pVnode = pVnode;
p->numOfCols = numOfCols;
- p->transferBuf = taosMemoryCalloc(p->numOfCols, POINTER_BYTES);
+
+ if (taosArrayGetSize(pTableIdList) == 0) {
+ *pReader = p;
+ return TSDB_CODE_SUCCESS;
+ }
STableKeyInfo* pKeyInfo = taosArrayGet(pTableIdList, 0);
p->pSchema = metaGetTbTSchema(p->pVnode->pMeta, pKeyInfo->uid, -1);
p->pTableList = pTableIdList;
- for (int32_t i = 0; i < p->numOfCols; ++i) {
+ p->transferBuf = taosMemoryCalloc(p->pSchema->numOfCols, POINTER_BYTES);
+ for (int32_t i = 0; i < p->pSchema->numOfCols; ++i) {
if (IS_VAR_DATA_TYPE(p->pSchema->columns[i].type)) {
p->transferBuf[i] = taosMemoryMalloc(p->pSchema->columns[i].bytes);
}
@@ -89,16 +94,20 @@ int32_t tsdbLastRowReaderOpen(void* pVnode, int32_t type, SArray* pTableIdList,
int32_t tsdbLastrowReaderClose(void* pReader) {
SLastrowReader* p = pReader;
- for (int32_t i = 0; i < p->numOfCols; ++i) {
- taosMemoryFreeClear(p->transferBuf[i]);
+ if (p->pSchema != NULL) {
+ for (int32_t i = 0; i < p->pSchema->numOfCols; ++i) {
+ taosMemoryFreeClear(p->transferBuf[i]);
+ }
+
+ taosMemoryFree(p->transferBuf);
+ taosMemoryFree(p->pSchema);
}
- taosMemoryFree(p->transferBuf);
taosMemoryFree(pReader);
return TSDB_CODE_SUCCESS;
}
-int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t* slotIds) {
+int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t* slotIds, SArray* pTableUidList) {
if (pReader == NULL || pResBlock == NULL) {
return TSDB_CODE_INVALID_PARA;
}
@@ -135,14 +144,15 @@ int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t
// appended or not.
if (internalResult) {
pResBlock->info.rows -= 1;
+ taosArrayClear(pTableUidList);
}
saveOneRow(pRow, pResBlock, pr, slotIds);
+ taosArrayPush(pTableUidList, &pKeyInfo->uid);
internalResult = true;
lastKey = pRow->ts;
}
- // taosMemoryFree(pRow);
tsdbCacheRelease(lruCache, h);
}
} else if (pr->type == LASTROW_RETRIEVE_TYPE_ALL) {
@@ -165,6 +175,7 @@ int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t
// tsdbCacheLastArray2Row(pLast, &pRow, pr->pSchema);
saveOneRow(pRow, pResBlock, pr, slotIds);
+ taosArrayPush(pTableUidList, &pKeyInfo->uid);
// taosMemoryFree(pRow);
tsdbCacheRelease(lruCache, h);
diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c
index 6e68d30a083f39637b8b4113eb7caf1b6ceb2f2b..5e30fcd5b2efbae26232e5340cf00f1617ad90c1 100644
--- a/source/dnode/vnode/src/tsdb/tsdbRead.c
+++ b/source/dnode/vnode/src/tsdb/tsdbRead.c
@@ -71,7 +71,7 @@ typedef struct SFilesetIter {
typedef struct SFileDataBlockInfo {
int32_t
- tbBlockIdx; // index position in STableBlockScanInfo in order to check whether neighbor block overlaps with it
+ tbBlockIdx; // index position in STableBlockScanInfo in order to check whether neighbor block overlaps with it
uint64_t uid;
} SFileDataBlockInfo;
@@ -119,10 +119,10 @@ struct STsdbReader {
int32_t type; // query type: 1. retrieve all data blocks, 2. retrieve direct prev|next rows
SBlockLoadSuppInfo suppInfo;
- SIOCostSummary cost;
- STSchema* pSchema;
- SDataFReader* pFileReader;
- SVersionRange verRange;
+ SIOCostSummary cost;
+ STSchema* pSchema;
+ SDataFReader* pFileReader;
+ SVersionRange verRange;
};
static SFileDataBlockInfo* getCurrentBlockInfo(SDataBlockIter* pBlockIter);
@@ -209,10 +209,10 @@ static void resetDataBlockScanInfo(SHashObj* pTableMap) {
p->iterInit = false;
p->iiter.hasVal = false;
if (p->iter.iter != NULL) {
- tsdbTbDataIterDestroy(p->iter.iter);
+ p->iter.iter = tsdbTbDataIterDestroy(p->iter.iter);
}
- taosArrayDestroy(p->delSkyline);
+ p->delSkyline = taosArrayDestroy(p->delSkyline);
}
}
@@ -224,17 +224,15 @@ static void destroyBlockScanInfo(SHashObj* pTableMap) {
p->iiter.hasVal = false;
if (p->iter.iter != NULL) {
- tsdbTbDataIterDestroy(p->iter.iter);
- p->iter.iter = NULL;
+ p->iter.iter = tsdbTbDataIterDestroy(p->iter.iter);
}
if (p->iiter.iter != NULL) {
- tsdbTbDataIterDestroy(p->iiter.iter);
- p->iiter.iter = NULL;
+ p->iiter.iter = tsdbTbDataIterDestroy(p->iiter.iter);
}
- taosArrayDestroy(p->delSkyline);
- p->delSkyline = NULL;
+ p->delSkyline = taosArrayDestroy(p->delSkyline);
+ p->pBlockList = taosArrayDestroy(p->pBlockList);
}
taosHashCleanup(pTableMap);
@@ -287,9 +285,7 @@ static int32_t initFilesetIterator(SFilesetIter* pIter, const STsdbFSState* pFSt
return TSDB_CODE_SUCCESS;
}
-static void cleanupFilesetIterator(SFilesetIter* pIter) {
- taosArrayDestroy(pIter->pFileList);
-}
+static void cleanupFilesetIterator(SFilesetIter* pIter) { taosArrayDestroy(pIter->pFileList); }
static bool filesetIteratorNext(SFilesetIter* pIter, STsdbReader* pReader) {
bool asc = ASCENDING_TRAVERSE(pIter->order);
@@ -304,6 +300,10 @@ static bool filesetIteratorNext(SFilesetIter* pIter, STsdbReader* pReader) {
STimeWindow win = {0};
while (1) {
+ if (pReader->pFileReader != NULL) {
+ tsdbDataFReaderClose(&pReader->pFileReader);
+ }
+
pReader->status.pCurrentFileset = (SDFileSet*)taosArrayGet(pIter->pFileList, pIter->index);
int32_t code = tsdbDataFReaderOpen(&pReader->pFileReader, pReader->pTsdb, pReader->status.pCurrentFileset);
@@ -349,9 +349,7 @@ static void resetDataBlockIterator(SDataBlockIter* pIter, int32_t order) {
}
}
-static void cleanupDataBlockIterator(SDataBlockIter* pIter) {
- taosArrayDestroy(pIter->blockList);
-}
+static void cleanupDataBlockIterator(SDataBlockIter* pIter) { taosArrayDestroy(pIter->blockList); }
static void initReaderStatus(SReaderStatus* pStatus) {
pStatus->pTableIter = NULL;
@@ -392,8 +390,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
initReaderStatus(&pReader->status);
- pReader->pTsdb =
- getTsdbByRetentions(pVnode, pCond->twindows.skey, pVnode->config.tsdbCfg.retentions, idstr, &level);
+ pReader->pTsdb = getTsdbByRetentions(pVnode, pCond->twindows.skey, pVnode->config.tsdbCfg.retentions, idstr, &level);
pReader->suid = pCond->suid;
pReader->order = pCond->order;
pReader->capacity = 4096;
@@ -697,12 +694,14 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, uint32_
void* p = taosArrayPush(pScanInfo->pBlockList, &block);
if (p == NULL) {
+ tMapDataClear(&mapData);
return TSDB_CODE_OUT_OF_MEMORY;
}
(*numOfBlocks) += 1;
}
+ tMapDataClear(&mapData);
if (pScanInfo->pBlockList != NULL && taosArrayGetSize(pScanInfo->pBlockList) > 0) {
(*numOfValidTables) += 1;
}
@@ -833,7 +832,7 @@ static int32_t doLoadFileBlockData(STsdbReader* pReader, SDataBlockIter* pBlockI
uint8_t *pb = NULL, *pb1 = NULL;
int32_t code = tsdbReadColData(pReader->pFileReader, &pBlockScanInfo->blockIdx, pBlock, pSupInfo->colIds, numOfCols,
- pBlockData, &pb, &pb1);
+ pBlockData, &pb, &pb1);
if (code != TSDB_CODE_SUCCESS) {
goto _error;
}
@@ -1309,6 +1308,8 @@ static int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIte
pReader->idStr);
pBlockIter->index = asc ? 0 : (numOfBlocks - 1);
+
+ cleanupBlockOrderSupporter(&sup);
return TSDB_CODE_SUCCESS;
}
@@ -1459,18 +1460,18 @@ static bool overlapWithDelSkyline(STableBlockScanInfo* pBlockScanInfo, const SBl
}
TSDBKEY* pFirst = taosArrayGet(pBlockScanInfo->delSkyline, 0);
- TSDBKEY* pLast = taosArrayGetLast(pBlockScanInfo->delSkyline);
+ TSDBKEY* pLast = taosArrayGetLast(pBlockScanInfo->delSkyline);
// ts is not overlap
if (pBlock->minKey.ts > pLast->ts || pBlock->maxKey.ts < pFirst->ts) {
return false;
}
- int32_t step = ASCENDING_TRAVERSE(order)? 1:-1;
+ int32_t step = ASCENDING_TRAVERSE(order) ? 1 : -1;
// version is not overlap
size_t num = taosArrayGetSize(pBlockScanInfo->delSkyline);
- for(int32_t i = pBlockScanInfo->fileDelIndex; i < num; i += step) {
+ for (int32_t i = pBlockScanInfo->fileDelIndex; i < num; i += step) {
TSDBKEY* p = taosArrayGet(pBlockScanInfo->delSkyline, i);
if (p->ts >= pBlock->minKey.ts && p->ts <= pBlock->maxKey.ts) {
if (p->version >= pBlock->minVersion) {
@@ -1502,8 +1503,8 @@ static bool fileBlockShouldLoad(STsdbReader* pReader, SFileDataBlockInfo* pFBloc
}
// has duplicated ts of different version in this block
- bool hasDup = (pBlock->nSubBlock == 1)? pBlock->hasDup:true;
- bool overlapWithDel= overlapWithDelSkyline(pScanInfo, pBlock, pReader->order);
+ bool hasDup = (pBlock->nSubBlock == 1) ? pBlock->hasDup : true;
+ bool overlapWithDel = overlapWithDelSkyline(pScanInfo, pBlock, pReader->order);
return (overlapWithNeighbor || hasDup || dataBlockPartiallyRequired(&pReader->window, &pReader->verRange, pBlock) ||
keyOverlapFileBlock(key, pBlock, &pReader->verRange) || (pBlock->nRow > pReader->capacity) || overlapWithDel);
@@ -1991,6 +1992,7 @@ static TSDBKEY getCurrentKeyInBuf(SDataBlockIter* pBlockIter, STsdbReader* pRead
static int32_t moveToNextFile(STsdbReader* pReader, int32_t* numOfBlocks) {
SReaderStatus* pStatus = &pReader->status;
+ SArray* pIndexList = taosArrayInit(4, sizeof(SBlockIdx));
while (1) {
bool hasNext = filesetIteratorNext(&pStatus->fileIter, pReader);
@@ -1998,9 +2000,10 @@ static int32_t moveToNextFile(STsdbReader* pReader, int32_t* numOfBlocks) {
break;
}
- SArray* pIndexList = taosArrayInit(4, sizeof(SBlockIdx));
+ taosArrayClear(pIndexList);
int32_t code = doLoadBlockIndex(pReader, pReader->pFileReader, pIndexList);
if (code != TSDB_CODE_SUCCESS) {
+ taosArrayDestroy(pIndexList);
return code;
}
@@ -2008,6 +2011,7 @@ static int32_t moveToNextFile(STsdbReader* pReader, int32_t* numOfBlocks) {
uint32_t numOfValidTable = 0;
code = doLoadFileBlock(pReader, pIndexList, &numOfValidTable, numOfBlocks);
if (code != TSDB_CODE_SUCCESS) {
+ taosArrayDestroy(pIndexList);
return code;
}
@@ -2015,10 +2019,10 @@ static int32_t moveToNextFile(STsdbReader* pReader, int32_t* numOfBlocks) {
break;
}
}
-
// no blocks in current file, try next files
}
+ taosArrayDestroy(pIndexList);
return TSDB_CODE_SUCCESS;
}
@@ -2220,17 +2224,18 @@ static STsdb* getTsdbByRetentions(SVnode* pVnode, TSKEY winSKey, SRetention* ret
}
SVersionRange getQueryVerRange(SVnode* pVnode, SQueryTableDataCond* pCond, int8_t level) {
- int64_t startVer = (pCond->startVersion == -1)? 0:pCond->startVersion;
+ int64_t startVer = (pCond->startVersion == -1) ? 0 : pCond->startVersion;
if (VND_IS_RSMA(pVnode)) {
return (SVersionRange){.minVer = startVer, .maxVer = tdRSmaGetMaxSubmitVer(pVnode->pSma, level)};
}
int64_t endVer = 0;
- if (pCond->endVersion == -1) { // user not specified end version, set current maximum version of vnode as the endVersion
+ if (pCond->endVersion ==
+ -1) { // user not specified end version, set current maximum version of vnode as the endVersion
endVer = pVnode->state.applied;
} else {
- endVer = (pCond->endVersion > pVnode->state.applied)? pVnode->state.applied:pCond->endVersion;
+ endVer = (pCond->endVersion > pVnode->state.applied) ? pVnode->state.applied : pCond->endVersion;
}
return (SVersionRange){.minVer = startVer, .maxVer = endVer};
@@ -2274,9 +2279,9 @@ bool hasBeenDropped(const SArray* pDelList, int32_t* index, TSDBKEY* pKey, int32
if (pDelList == NULL) {
return false;
}
- size_t num = taosArrayGetSize(pDelList);
- bool asc = ASCENDING_TRAVERSE(order);
- int32_t step = asc? 1:-1;
+ size_t num = taosArrayGetSize(pDelList);
+ bool asc = ASCENDING_TRAVERSE(order);
+ int32_t step = asc ? 1 : -1;
if (asc) {
if (*index >= num - 1) {
@@ -2437,6 +2442,7 @@ static int32_t doMergeRowsInFileBlockImpl(SBlockData* pBlockData, int32_t rowInd
SVersionRange* pVerRange, int32_t step) {
while (pBlockData->aTSKEY[rowIndex] == key && rowIndex < pBlockData->nRow && rowIndex >= 0) {
if (pBlockData->aVersion[rowIndex] > pVerRange->maxVer || pBlockData->aVersion[rowIndex] < pVerRange->minVer) {
+ rowIndex += step;
continue;
}
@@ -2823,7 +2829,7 @@ void tsdbReaderClose(STsdbReader* pReader) {
taosMemoryFree(pSupInfo->colIds);
taosArrayDestroy(pSupInfo->pColAgg);
- for(int32_t i = 0; i < blockDataGetNumOfCols(pReader->pResBlock); ++i) {
+ for (int32_t i = 0; i < blockDataGetNumOfCols(pReader->pResBlock); ++i) {
if (pSupInfo->buildBuf[i] != NULL) {
taosMemoryFreeClear(pSupInfo->buildBuf[i]);
}
@@ -2835,6 +2841,9 @@ void tsdbReaderClose(STsdbReader* pReader) {
destroyBlockScanInfo(pReader->status.pTableMap);
blockDataDestroy(pReader->pResBlock);
+ if (pReader->pFileReader != NULL) {
+ tsdbDataFReaderClose(&pReader->pFileReader);
+ }
#if 0
// if (pReader->status.pTableScanInfo != NULL) {
@@ -3011,8 +3020,8 @@ int32_t tsdbReaderReset(STsdbReader* pReader, SQueryTableDataCond* pCond) {
return TSDB_CODE_SUCCESS;
}
- pReader->order = pCond->order;
- pReader->type = BLOCK_LOAD_OFFSET_ORDER;
+ pReader->order = pCond->order;
+ pReader->type = BLOCK_LOAD_OFFSET_ORDER;
pReader->status.loadFromFile = true;
pReader->status.pTableIter = NULL;
@@ -3023,11 +3032,14 @@ int32_t tsdbReaderReset(STsdbReader* pReader, SQueryTableDataCond* pCond) {
memset(pReader->suppInfo.plist, 0, POINTER_BYTES);
pReader->suppInfo.tsColAgg.colId = PRIMARYKEY_TIMESTAMP_COL_ID;
+ tsdbDataFReaderClose(&pReader->pFileReader);
// todo set the correct numOfTables
int32_t numOfTables = 1;
SDataBlockIter* pBlockIter = &pReader->status.blockIter;
+ tsdbDataFReaderClose(&pReader->pFileReader);
+
STsdbFSState* pFState = pReader->pTsdb->fs->cState;
initFilesetIterator(&pReader->status.fileIter, pFState, pReader->order, pReader->idStr);
resetDataBlockIterator(&pReader->status.blockIter, pReader->order);
@@ -3074,10 +3086,13 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
SDataBlockIter* pBlockIter = &pStatus->blockIter;
pTableBlockInfo->numOfFiles += pStatus->fileIter.numOfFiles;
- pTableBlockInfo->numOfBlocks += pBlockIter->numOfBlocks;
+
+ if (pBlockIter->numOfBlocks > 0) {
+ pTableBlockInfo->numOfBlocks += pBlockIter->numOfBlocks;
+ }
pTableBlockInfo->numOfTables = numOfTables;
- bool hasNext = true;
+ bool hasNext = (pBlockIter->numOfBlocks > 0);
while (true) {
if (hasNext) {
@@ -3114,13 +3129,12 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo->numOfBlocks += pBlockIter->numOfBlocks;
}
-/*
- hasNext = blockIteratorNext(&pStatus->blockIter);
-*/
-
+ /*
+ hasNext = blockIteratorNext(&pStatus->blockIter);
+ */
-// tsdbDebug("%p %d blocks found in file for %d table(s), fid:%d, %s", pReader, numOfBlocks, numOfTables,
-// pReader->pFileGroup->fid, pReader->idStr);
+ // tsdbDebug("%p %d blocks found in file for %d table(s), fid:%d, %s", pReader, numOfBlocks, numOfTables,
+ // pReader->pFileGroup->fid, pReader->idStr);
}
return code;
@@ -3158,7 +3172,7 @@ int64_t tsdbGetNumOfRowsInMemTable(STsdbReader* pReader) {
return rows;
}
-int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int64_t *suid) {
+int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int64_t* suid) {
int32_t sversion = 1;
SMetaReader mr = {0};
@@ -3171,7 +3185,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6
}
*suid = 0;
-
+
if (mr.me.type == TSDB_CHILD_TABLE) {
*suid = mr.me.ctbEntry.suid;
code = metaGetTableEntryByUid(&mr, *suid);
@@ -3188,8 +3202,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6
metaReaderClear(&mr);
*pSchema = metaGetTbTSchema(pVnode->pMeta, uid, sversion);
-
+
return TSDB_CODE_SUCCESS;
}
-
diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c
index d25ae817c7a700217d066ede669cb28a8b5da845..cca212a4e405dddedb9175677395ece6326bc5d8 100644
--- a/source/dnode/vnode/src/vnd/vnodeSvr.c
+++ b/source/dnode/vnode/src/vnd/vnodeSvr.c
@@ -494,8 +494,6 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR
taosArrayPush(rsp.pArray, &cRsp);
}
- tDecoderClear(&decoder);
-
tqUpdateTbUidList(pVnode->pTq, tbUids, true);
tdUpdateTbUidList(pVnode->pSma, pStore);
tdUidStoreFree(pStore);
@@ -512,9 +510,12 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR
}
tEncoderInit(&encoder, pRsp->pCont, pRsp->contLen);
tEncodeSVCreateTbBatchRsp(&encoder, &rsp);
- tEncoderClear(&encoder);
_exit:
+ for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
+ pCreateReq = req.pReqs + iReq;
+ taosArrayDestroy(pCreateReq->ctb.tagName);
+ }
taosArrayDestroy(rsp.pArray);
taosArrayDestroy(tbUids);
tDecoderClear(&decoder);
@@ -611,7 +612,7 @@ static int32_t vnodeProcessAlterTbReq(SVnode *pVnode, int64_t version, void *pRe
// process
if (metaAlterTable(pVnode->pMeta, version, &vAlterTbReq, &vMetaRsp) < 0) {
- vAlterTbRsp.code = TSDB_CODE_INVALID_MSG;
+ vAlterTbRsp.code = terrno;
tDecoderClear(&dc);
rcode = -1;
goto _exit;
@@ -795,6 +796,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
if (tDecodeSVCreateTbReq(&decoder, &createTbReq) < 0) {
pRsp->code = TSDB_CODE_INVALID_MSG;
tDecoderClear(&decoder);
+ taosArrayDestroy(createTbReq.ctb.tagName);
goto _exit;
}
@@ -802,6 +804,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
if (terrno != TSDB_CODE_TDB_TABLE_ALREADY_EXIST) {
submitBlkRsp.code = terrno;
tDecoderClear(&decoder);
+ taosArrayDestroy(createTbReq.ctb.tagName);
goto _exit;
}
}
@@ -822,6 +825,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
vnodeDebugPrintSingleSubmitMsg(pVnode->pMeta, pBlock, &msgIter, "real uid");
#endif
tDecoderClear(&decoder);
+ taosArrayDestroy(createTbReq.ctb.tagName);
} else {
submitBlkRsp.tblFName = taosMemoryMalloc(TSDB_TABLE_FNAME_LEN);
sprintf(submitBlkRsp.tblFName, "%s.", pVnode->config.dbname);
diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c
index bdcfe208d693f9bc6a655b58f4836e4f3396300e..87148a8450da794b6dd0cf980b7415f2e490c014 100644
--- a/source/dnode/vnode/src/vnd/vnodeSync.c
+++ b/source/dnode/vnode/src/vnd/vnodeSync.c
@@ -427,13 +427,22 @@ static void vnodeSyncCommitMsg(SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta c
syncGetVgId(pVnode->sync), pFsm, cbMeta.index, cbMeta.isWeak, cbMeta.code, cbMeta.state,
syncUtilState2String(cbMeta.state), pMsg->msgType, TMSG_INFO(pMsg->msgType));
- SRpcMsg rpcMsg = {.msgType = pMsg->msgType, .contLen = pMsg->contLen};
- rpcMsg.pCont = rpcMallocCont(rpcMsg.contLen);
- memcpy(rpcMsg.pCont, pMsg->pCont, pMsg->contLen);
- syncGetAndDelRespRpc(pVnode->sync, cbMeta.seqNum, &rpcMsg.info);
- rpcMsg.info.conn.applyIndex = cbMeta.index;
- rpcMsg.info.conn.applyTerm = cbMeta.term;
- tmsgPutToQueue(&pVnode->msgCb, APPLY_QUEUE, &rpcMsg);
+ if (cbMeta.code == 0) {
+ SRpcMsg rpcMsg = {.msgType = pMsg->msgType, .contLen = pMsg->contLen};
+ rpcMsg.pCont = rpcMallocCont(rpcMsg.contLen);
+ memcpy(rpcMsg.pCont, pMsg->pCont, pMsg->contLen);
+ syncGetAndDelRespRpc(pVnode->sync, cbMeta.seqNum, &rpcMsg.info);
+ rpcMsg.info.conn.applyIndex = cbMeta.index;
+ rpcMsg.info.conn.applyTerm = cbMeta.term;
+ tmsgPutToQueue(&pVnode->msgCb, APPLY_QUEUE, &rpcMsg);
+ } else {
+ SRpcMsg rsp = {.code = cbMeta.code, .info = pMsg->info};
+ vError("vgId:%d, sync commit error, msgtype:%d,%s, error:0x%X, errmsg:%s", syncGetVgId(pVnode->sync), pMsg->msgType,
+ TMSG_INFO(pMsg->msgType), cbMeta.code, tstrerror(cbMeta.code));
+ if (rsp.info.handle != NULL) {
+ tmsgSendRsp(&rsp);
+ }
+ }
}
static void vnodeSyncPreCommitMsg(SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta cbMeta) {
diff --git a/source/libs/catalog/inc/catalogInt.h b/source/libs/catalog/inc/catalogInt.h
index dce7adfea9aba3a6cb04e773de7bbf33ae633852..fb9f588bae5c1a5ab14a25a6dbb0e47e831c1e4c 100644
--- a/source/libs/catalog/inc/catalogInt.h
+++ b/source/libs/catalog/inc/catalogInt.h
@@ -642,6 +642,7 @@ void ctgFreeSTableIndex(void *info);
void ctgClearSubTaskRes(SCtgSubRes *pRes);
void ctgFreeQNode(SCtgQNode *node);
void ctgClearHandle(SCatalog* pCtg);
+void ctgFreeTbCacheImpl(SCtgTbCache *pCache);
extern SCatalogMgmt gCtgMgmt;
diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c
index ca50702894a2a473099fc336c385d01588354173..1b7f53ae67c41ff8f757b8ab65d8f18cec549f84 100644
--- a/source/libs/catalog/src/catalog.c
+++ b/source/libs/catalog/src/catalog.c
@@ -1293,7 +1293,7 @@ void catalogDestroy(void) {
if (!taosCheckCurrentInDll()) {
ctgClearCacheEnqueue(NULL, true, true, true);
- taosThreadJoin(gCtgMgmt.updateThread, NULL);
+ taosThreadJoin(gCtgMgmt.updateThread, NULL);
}
taosHashCleanup(gCtgMgmt.pCluster);
diff --git a/source/libs/catalog/src/ctgCache.c b/source/libs/catalog/src/ctgCache.c
index 77c1e5b8b119d349e9fb83b8490123a4846c9cb6..499ce7727676381ad28ea0fb672d768e88ac7907 100644
--- a/source/libs/catalog/src/ctgCache.c
+++ b/source/libs/catalog/src/ctgCache.c
@@ -647,6 +647,8 @@ int32_t ctgEnqueue(SCatalog* pCtg, SCtgCacheOperation *operation) {
CTG_RET(TSDB_CODE_OUT_OF_MEMORY);
}
+ bool syncOp = operation->syncOp;
+ char* opName = gCtgCacheOperation[operation->opId].name;
if (operation->syncOp) {
tsem_init(&operation->rspSem, 0, 0);
}
@@ -664,14 +666,14 @@ int32_t ctgEnqueue(SCatalog* pCtg, SCtgCacheOperation *operation) {
gCtgMgmt.queue.tail = node;
CTG_UNLOCK(CTG_WRITE, &gCtgMgmt.queue.qlock);
+ ctgDebug("action [%s] added into queue", opName);
+
CTG_QUEUE_INC();
CTG_RT_STAT_INC(numOfOpEnqueue, 1);
tsem_post(&gCtgMgmt.queue.reqSem);
- ctgDebug("action [%s] added into queue", gCtgCacheOperation[operation->opId].name);
-
- if (operation->syncOp) {
+ if (syncOp) {
tsem_wait(&operation->rspSem);
taosMemoryFree(operation);
}
@@ -840,6 +842,7 @@ _return:
ctgFreeVgInfo(dbInfo);
taosMemoryFreeClear(op->data);
+ taosMemoryFreeClear(op);
CTG_RET(code);
}
@@ -852,7 +855,7 @@ int32_t ctgUpdateTbMetaEnqueue(SCatalog* pCtg, STableMetaOutput *output, bool sy
SCtgUpdateTbMetaMsg *msg = taosMemoryMalloc(sizeof(SCtgUpdateTbMetaMsg));
if (NULL == msg) {
ctgError("malloc %d failed", (int32_t)sizeof(SCtgUpdateTbMetaMsg));
- CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
+ CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
}
char *p = strchr(output->dbFName, '.');
@@ -871,6 +874,11 @@ int32_t ctgUpdateTbMetaEnqueue(SCatalog* pCtg, STableMetaOutput *output, bool sy
_return:
+ if (output) {
+ taosMemoryFree(output->tbMeta);
+ taosMemoryFree(output);
+ }
+
taosMemoryFreeClear(msg);
CTG_RET(code);
@@ -1753,6 +1761,16 @@ int32_t ctgOpDropStbMeta(SCtgCacheOperation *operation) {
CTG_CACHE_STAT_DEC(numOfStb, 1);
}
+ SCtgTbCache* pTbCache = taosHashGet(dbCache->tbCache, msg->stbName, strlen(msg->stbName));
+ if (NULL == pTbCache) {
+ ctgDebug("stb %s already not in cache", msg->stbName);
+ goto _return;
+ }
+
+ CTG_LOCK(CTG_WRITE, &pTbCache->metaLock);
+ ctgFreeTbCacheImpl(pTbCache);
+ CTG_UNLOCK(CTG_WRITE, &pTbCache->metaLock);
+
if (taosHashRemove(dbCache->tbCache, msg->stbName, strlen(msg->stbName))) {
ctgError("stb not exist in cache, dbFName:%s, stb:%s, suid:0x%"PRIx64, msg->dbFName, msg->stbName, msg->suid);
} else {
@@ -1780,14 +1798,24 @@ int32_t ctgOpDropTbMeta(SCtgCacheOperation *operation) {
SCtgDBCache *dbCache = NULL;
ctgGetDBCache(pCtg, msg->dbFName, &dbCache);
if (NULL == dbCache) {
- return TSDB_CODE_SUCCESS;
+ goto _return;
}
if (dbCache->dbId != msg->dbId) {
ctgDebug("dbId 0x%" PRIx64 " not match with curId 0x%"PRIx64", dbFName:%s, tbName:%s", msg->dbId, dbCache->dbId, msg->dbFName, msg->tbName);
- return TSDB_CODE_SUCCESS;
+ goto _return;
}
+ SCtgTbCache* pTbCache = taosHashGet(dbCache->tbCache, msg->tbName, strlen(msg->tbName));
+ if (NULL == pTbCache) {
+ ctgDebug("tb %s already not in cache", msg->tbName);
+ goto _return;
+ }
+
+ CTG_LOCK(CTG_WRITE, &pTbCache->metaLock);
+ ctgFreeTbCacheImpl(pTbCache);
+ CTG_UNLOCK(CTG_WRITE, &pTbCache->metaLock);
+
if (taosHashRemove(dbCache->tbCache, msg->tbName, strlen(msg->tbName))) {
ctgError("tb %s not exist in cache, dbFName:%s", msg->tbName, msg->dbFName);
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
@@ -2063,6 +2091,8 @@ void* ctgUpdateThreadFunc(void* param) {
if (operation->syncOp) {
tsem_post(&operation->rspSem);
+ } else {
+ taosMemoryFreeClear(operation);
}
CTG_RT_STAT_INC(numOfOpDequeue, 1);
diff --git a/source/libs/catalog/src/ctgRemote.c b/source/libs/catalog/src/ctgRemote.c
index 59ad00952733623007f3ce0b5fca34c88fedf829..8e0a5b7de3753baaf08d4628032f40dcf51c711e 100644
--- a/source/libs/catalog/src/ctgRemote.c
+++ b/source/libs/catalog/src/ctgRemote.c
@@ -261,6 +261,8 @@ int32_t ctgHandleMsgCallback(void *param, SDataBuf *pMsg, int32_t rspCode) {
_return:
+ taosMemoryFree(pMsg->pData);
+
if (pJob) {
taosReleaseRef(gCtgMgmt.jobPool, cbParam->refId);
}
diff --git a/source/libs/catalog/src/ctgUtil.c b/source/libs/catalog/src/ctgUtil.c
index ad73fe40d2e9606d10bf2b7fc0c207a0c53674e8..a996a70973a18caa8573af224f0bcaa03938e3a3 100644
--- a/source/libs/catalog/src/ctgUtil.c
+++ b/source/libs/catalog/src/ctgUtil.c
@@ -152,6 +152,7 @@ void ctgFreeStbMetaCache(SCtgDBCache *dbCache) {
}
void ctgFreeTbCacheImpl(SCtgTbCache *pCache) {
+ qDebug("tbMeta freed, p:%p", pCache->pMeta);
taosMemoryFreeClear(pCache->pMeta);
if (pCache->pIndex) {
taosArrayDestroyEx(pCache->pIndex->pIndex, tFreeSTableIndexInfo);
@@ -831,6 +832,7 @@ int32_t ctgCloneMetaOutput(STableMetaOutput *output, STableMetaOutput **pOutput)
if (output->tbMeta) {
int32_t metaSize = CTG_META_SIZE(output->tbMeta);
(*pOutput)->tbMeta = taosMemoryMalloc(metaSize);
+ qDebug("tbMeta cloned, size:%d, p:%p", metaSize, (*pOutput)->tbMeta);
if (NULL == (*pOutput)->tbMeta) {
qError("malloc %d failed", (int32_t)sizeof(STableMetaOutput));
taosMemoryFreeClear(*pOutput);
diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c
index a2816209a91cdc29891e3895e6db0bdf696be76f..034778e5bfd4f527ca4782d7e91015244db8b012 100644
--- a/source/libs/command/src/command.c
+++ b/source/libs/command/src/command.c
@@ -570,10 +570,14 @@ int32_t buildSelectResultDataBlock(SNodeList* pProjects, SSDataBlock* pBlock) {
int32_t index = 0;
SNode* pProj = NULL;
FOREACH(pProj, pProjects) {
- if (((SValueNode*)pProj)->isNull) {
- colDataAppend(taosArrayGet(pBlock->pDataBlock, index++), 0, NULL, true);
+ if (QUERY_NODE_VALUE != nodeType(pProj)) {
+ return TSDB_CODE_PAR_INVALID_SELECTED_EXPR;
} else {
- colDataAppend(taosArrayGet(pBlock->pDataBlock, index++), 0, nodesGetValueFromNode((SValueNode*)pProj), false);
+ if (((SValueNode*)pProj)->isNull) {
+ colDataAppend(taosArrayGet(pBlock->pDataBlock, index++), 0, NULL, true);
+ } else {
+ colDataAppend(taosArrayGet(pBlock->pDataBlock, index++), 0, nodesGetValueFromNode((SValueNode*)pProj), false);
+ }
}
}
diff --git a/source/libs/executor/CMakeLists.txt b/source/libs/executor/CMakeLists.txt
index ed15aeb0387dc0ab34e06458111bbca257047b36..89d08b3078d184e77bbc966f2f14e15dc09fddc9 100644
--- a/source/libs/executor/CMakeLists.txt
+++ b/source/libs/executor/CMakeLists.txt
@@ -8,7 +8,7 @@ add_library(executor STATIC ${EXECUTOR_SRC})
# )
target_link_libraries(executor
- PRIVATE os util common function parser planner qcom vnode scalar nodes index
+ PRIVATE os util common function parser planner qcom vnode scalar nodes index stream
)
target_include_directories(
diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h
index 69ba88916a38dc1e0fb5f5fdbb32438c7533ccdd..74bb80eed17f9e82539c37e425c5dc7a2d4fc1f3 100644
--- a/source/libs/executor/inc/executorimpl.h
+++ b/source/libs/executor/inc/executorimpl.h
@@ -39,6 +39,7 @@ extern "C" {
#include "tmsg.h"
#include "tpagedbuf.h"
#include "tstreamUpdate.h"
+#include "tstream.h"
#include "vnode.h"
#include "executorInt.h"
@@ -139,12 +140,14 @@ typedef struct STaskIdInfo {
} STaskIdInfo;
typedef struct {
+ //TODO remove prepareStatus
STqOffsetVal prepareStatus; // for tmq
STqOffsetVal lastStatus; // for tmq
void* metaBlk; // for tmq fetching meta
SSDataBlock* pullOverBlk; // for streaming
SWalFilterCond cond;
int64_t lastScanUid;
+ SStreamQueue* inputQueue;
} SStreamTaskInfo;
typedef struct SExecTaskInfo {
@@ -319,6 +322,7 @@ typedef struct SLastrowScanInfo {
void *pLastrowReader;
SArray *pColMatchInfo;
int32_t *pSlotIds;
+ SExprSupp pseudoExprSup;
} SLastrowScanInfo;
typedef enum EStreamScanMode {
@@ -389,6 +393,7 @@ typedef struct SStreamScanInfo {
SSDataBlock* pPullDataRes; // pull data SSDataBlock
SSDataBlock* pDeleteDataRes; // delete data SSDataBlock
int32_t deleteDataIndex;
+ STimeWindow updateWin;
// status for tmq
// SSchemaWrapper schema;
@@ -786,6 +791,8 @@ int32_t getBufferPgSize(int32_t rowSize, uint32_t* defaultPgsz, uint32_t* defaul
void doSetOperatorCompleted(SOperatorInfo* pOperator);
void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock);
+int32_t addTagPseudoColumnData(SReadHandle* pHandle, SExprInfo* pPseudoExpr, int32_t numOfPseudoExpr,
+ SSDataBlock* pBlock, const char* idStr);
void cleanupAggSup(SAggSupporter* pAggSup);
void destroyBasicOperatorInfo(void* param, int32_t numOfOutput);
diff --git a/source/libs/executor/src/cachescanoperator.c b/source/libs/executor/src/cachescanoperator.c
index b6ad3b6cc0555c6d029f38fc5ceb6bce70af4b96..0f6817cd6bc4380f542e84976edb2145566eb625 100644
--- a/source/libs/executor/src/cachescanoperator.c
+++ b/source/libs/executor/src/cachescanoperator.c
@@ -45,20 +45,20 @@ SOperatorInfo* createLastrowScanOperator(SLastRowScanPhysiNode* pScanNode, SRead
int32_t numOfCols = 0;
pInfo->pColMatchInfo = extractColMatchInfo(pScanNode->pScanCols, pScanNode->node.pOutputDataBlockDesc, &numOfCols,
COL_MATCH_FROM_COL_ID);
- int32_t* pCols = taosMemoryMalloc(numOfCols * sizeof(int32_t));
- for (int32_t i = 0; i < numOfCols; ++i) {
- SColMatchInfo* pColMatch = taosArrayGet(pInfo->pColMatchInfo, i);
- pCols[i] = pColMatch->colId;
- }
-
int32_t code = extractTargetSlotId(pInfo->pColMatchInfo, pTaskInfo, &pInfo->pSlotIds);
if (code != TSDB_CODE_SUCCESS) {
goto _error;
}
- tsdbLastRowReaderOpen(readHandle->vnode, LASTROW_RETRIEVE_TYPE_ALL, pTableList, pCols, numOfCols,
+ tsdbLastRowReaderOpen(readHandle->vnode, LASTROW_RETRIEVE_TYPE_SINGLE, pTableList, taosArrayGetSize(pInfo->pColMatchInfo),
&pInfo->pLastrowReader);
- taosMemoryFree(pCols);
+
+ if (pScanNode->pScanPseudoCols != NULL) {
+ SExprSupp* pPseudoExpr = &pInfo->pseudoExprSup;
+
+ pPseudoExpr->pExprInfo = createExprInfo(pScanNode->pScanPseudoCols, NULL, &pPseudoExpr->numOfExprs);
+ pPseudoExpr->pCtx = createSqlFunctionCtx(pPseudoExpr->pExprInfo, pPseudoExpr->numOfExprs, &pPseudoExpr->rowEntryInfoOffset);
+ }
pOperator->name = "LastrowScanOperator";
pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN;
@@ -100,7 +100,20 @@ SSDataBlock* doScanLastrow(SOperatorInfo* pOperator) {
// check if it is a group by tbname
if (size == taosArrayGetSize(pInfo->pTableList)) {
blockDataCleanup(pInfo->pRes);
- tsdbRetrieveLastRow(pInfo->pLastrowReader, pInfo->pRes, pInfo->pSlotIds);
+ SArray* pUidList = taosArrayInit(1, sizeof(tb_uid_t));
+ int32_t code = tsdbRetrieveLastRow(pInfo->pLastrowReader, pInfo->pRes, pInfo->pSlotIds, pUidList);
+ if (code != TSDB_CODE_SUCCESS) {
+ longjmp(pTaskInfo->env, code);
+ }
+
+ // check for tag values
+ if (pInfo->pRes->info.rows > 0 && pInfo->pseudoExprSup.numOfExprs > 0) {
+ SExprSupp* pSup = &pInfo->pseudoExprSup;
+ pInfo->pRes->info.uid = *(tb_uid_t*) taosArrayGet(pUidList, 0);
+ addTagPseudoColumnData(&pInfo->readHandle, pSup->pExprInfo, pSup->numOfExprs, pInfo->pRes, GET_TASKID(pTaskInfo));
+ }
+
+ doSetOperatorCompleted(pOperator);
return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes;
} else {
// todo fetch the result for each group
diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c
index 2da8811e5e5e7565ec5639adc501c138cad83d73..95b4fdcd6e626ea66421beb2c543db8b784e8c4c 100644
--- a/source/libs/executor/src/executil.c
+++ b/source/libs/executor/src/executil.c
@@ -191,6 +191,7 @@ SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) {
pBlock->info.blockId = pNode->dataBlockId;
pBlock->info.type = STREAM_INVALID;
+ pBlock->info.calWin = (STimeWindow){.skey = INT64_MIN, .ekey = INT64_MAX};
for (int32_t i = 0; i < numOfCols; ++i) {
SSlotDescNode* pDescNode = (SSlotDescNode*)nodesListGetNode(pNode->pSlots, i);
@@ -306,7 +307,6 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
SNode* pTagIndexCond = (SNode*)pListInfo->pTagIndexCond;
if (pScanNode->tableType == TSDB_SUPER_TABLE) {
if (pTagIndexCond) {
- ///<<<<<<< HEAD
SIndexMetaArg metaArg = {
.metaEx = metaHandle, .idx = tsdbGetIdx(metaHandle), .ivtIdx = tsdbGetIvtIdx(metaHandle), .suid = tableUid};
@@ -314,20 +314,9 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
SIdxFltStatus status = SFLT_NOT_INDEX;
code = doFilterTag(pTagIndexCond, &metaArg, res, &status);
if (code != 0 || status == SFLT_NOT_INDEX) {
- code = TSDB_CODE_INDEX_REBUILDING;
- }
- //=======
- // SArray* res = taosArrayInit(8, sizeof(uint64_t));
- // // code = doFilterTag(pTagIndexCond, &metaArg, res);
- // code = TSDB_CODE_INDEX_REBUILDING;
- //>>>>>>> dvv
- if (code == TSDB_CODE_INDEX_REBUILDING) {
+ qError("failed to get tableIds from index, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid);
+// code = TSDB_CODE_INDEX_REBUILDING;
code = vnodeGetAllTableList(pVnode, tableUid, pListInfo->pTableList);
- } else if (code != TSDB_CODE_SUCCESS) {
- qError("failed to get tableIds, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid);
- taosArrayDestroy(res);
- terrno = code;
- return code;
} else {
qDebug("success to get tableIds, size:%d, suid:%" PRIu64, (int)taosArrayGetSize(res), tableUid);
}
@@ -346,25 +335,25 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
terrno = code;
return code;
}
-
- if (pTagCond) {
- int32_t i = 0;
- while (i < taosArrayGetSize(pListInfo->pTableList)) {
- STableKeyInfo* info = taosArrayGet(pListInfo->pTableList, i);
- bool isOk = isTableOk(info, pTagCond, metaHandle);
- if (terrno) return terrno;
- if (!isOk) {
- taosArrayRemove(pListInfo->pTableList, i);
- continue;
- }
- i++;
- }
- }
} else { // Create one table group.
STableKeyInfo info = {.lastKey = 0, .uid = tableUid, .groupId = 0};
taosArrayPush(pListInfo->pTableList, &info);
}
+ if (pTagCond) {
+ int32_t i = 0;
+ while (i < taosArrayGetSize(pListInfo->pTableList)) {
+ STableKeyInfo* info = taosArrayGet(pListInfo->pTableList, i);
+ bool isOk = isTableOk(info, pTagCond, metaHandle);
+ if (terrno) return terrno;
+ if (!isOk) {
+ taosArrayRemove(pListInfo->pTableList, i);
+ continue;
+ }
+ i++;
+ }
+ }
+
pListInfo->pGroupList = taosArrayInit(4, POINTER_BYTES);
if (pListInfo->pGroupList == NULL) {
return TSDB_CODE_OUT_OF_MEMORY;
@@ -852,6 +841,9 @@ static STimeWindow doCalculateTimeWindow(int64_t ts, SInterval* pInterval) {
w.ekey = taosTimeAdd(w.skey, pInterval->interval, pInterval->intervalUnit, pInterval->precision) - 1;
} else {
int64_t st = w.skey;
+ if (pInterval->offset > 0) {
+ st = taosTimeAdd(st, pInterval->offset, pInterval->offsetUnit, pInterval->precision);
+ }
if (st > ts) {
st -= ((st - ts + pInterval->sliding - 1) / pInterval->sliding) * pInterval->sliding;
diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c
index 9f6b12c13a5729d869c6baeb7f5ab8ffa1293ea7..f2008ed97a5c54f1fae090fa721d396ee5eaa49c 100644
--- a/source/libs/executor/src/executor.c
+++ b/source/libs/executor/src/executor.c
@@ -60,8 +60,6 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
taosArrayAddAll(p->pDataBlock, pDataBlock->pDataBlock);
taosArrayPush(pInfo->pBlockLists, &p);
}
- /*} else if (type == STREAM_INPUT__TABLE_SCAN) {*/
- /*ASSERT(pInfo->blockType == STREAM_INPUT__TABLE_SCAN);*/
} else {
ASSERT(0);
}
@@ -106,6 +104,30 @@ int32_t qSetMultiStreamInput(qTaskInfo_t tinfo, const void* pBlocks, size_t numO
return code;
}
+qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* readers) {
+ if (msg == NULL) {
+ // TODO create raw scan
+ return NULL;
+ }
+
+ struct SSubplan* plan = NULL;
+ int32_t code = qStringToSubplan(msg, &plan);
+ if (code != TSDB_CODE_SUCCESS) {
+ terrno = code;
+ return NULL;
+ }
+
+ qTaskInfo_t pTaskInfo = NULL;
+ code = qCreateExecTask(readers, 0, 0, plan, &pTaskInfo, NULL, NULL, OPTR_EXEC_MODEL_QUEUE);
+ if (code != TSDB_CODE_SUCCESS) {
+ // TODO: destroy SSubplan & pTaskInfo
+ terrno = code;
+ return NULL;
+ }
+
+ return pTaskInfo;
+}
+
qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers) {
if (msg == NULL) {
return NULL;
@@ -186,7 +208,7 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bo
}
int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* tableName, int32_t* sversion,
- int32_t* tversion) {
+ int32_t* tversion) {
ASSERT(tinfo != NULL && dbName != NULL && tableName != NULL);
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
diff --git a/source/libs/executor/src/executorMain.c b/source/libs/executor/src/executorMain.c
index b30800680b512641b1a652390e2e85ad881fc8ad..6381d20255004a71541f0e6c227ea90fa6613769 100644
--- a/source/libs/executor/src/executorMain.c
+++ b/source/libs/executor/src/executorMain.c
@@ -44,6 +44,13 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
goto _error;
}
+ if (model == OPTR_EXEC_MODEL_STREAM) {
+ (*pTask)->streamInfo.inputQueue = streamQueueOpen();
+ if ((*pTask)->streamInfo.inputQueue == NULL) {
+ goto _error;
+ }
+ }
+
SDataSinkMgtCfg cfg = {.maxDataBlockNum = 1000, .maxDataBlockNumPerQuery = 100};
code = dsDataSinkMgtInit(&cfg);
if (code != TSDB_CODE_SUCCESS) {
@@ -252,6 +259,13 @@ int32_t qExtractStreamScanner(qTaskInfo_t tinfo, void** scanner) {
}
}
+int32_t qStreamInput(qTaskInfo_t tinfo, void* pItem) {
+ SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
+ ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
+ taosWriteQitem(pTaskInfo->streamInfo.inputQueue->queue, pItem);
+ return 0;
+}
+
void* qExtractReaderFromStreamScanner(void* scanner) {
SStreamScanInfo* pInfo = scanner;
return (void*)pInfo->tqReader;
@@ -269,13 +283,13 @@ const STqOffset* qExtractStatusFromStreamScanner(void* scanner) {
void* qStreamExtractMetaMsg(qTaskInfo_t tinfo) {
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
- ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
+ ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
return pTaskInfo->streamInfo.metaBlk;
}
int32_t qStreamExtractOffset(qTaskInfo_t tinfo, STqOffsetVal* pOffset) {
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
- ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
+ ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
memcpy(pOffset, &pTaskInfo->streamInfo.lastStatus, sizeof(STqOffsetVal));
return 0;
}
@@ -283,35 +297,41 @@ int32_t qStreamExtractOffset(qTaskInfo_t tinfo, STqOffsetVal* pOffset) {
int32_t qStreamPrepareScan(qTaskInfo_t tinfo, const STqOffsetVal* pOffset) {
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
SOperatorInfo* pOperator = pTaskInfo->pRoot;
- ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
+ ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
pTaskInfo->streamInfo.prepareStatus = *pOffset;
- // TODO: optimize
- /*if (pTaskInfo->streamInfo.lastStatus.type != pOffset->type ||*/
- /*pTaskInfo->streamInfo.prepareStatus.version != pTaskInfo->streamInfo.lastStatus.version) {*/
- while (1) {
- uint8_t type = pOperator->operatorType;
- pOperator->status = OP_OPENED;
- if (type == QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
- SStreamScanInfo* pInfo = pOperator->info;
- if (pOffset->type == TMQ_OFFSET__LOG) {
- if (tqSeekVer(pInfo->tqReader, pOffset->version) < 0) {
- return -1;
- }
- ASSERT(pInfo->tqReader->pWalReader->curVersion == pOffset->version);
- } else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
- /*pInfo->blockType = STREAM_INPUT__TABLE_SCAN;*/
- int64_t uid = pOffset->uid;
- int64_t ts = pOffset->ts;
-
- if (uid == 0) {
- if (taosArrayGetSize(pTaskInfo->tableqinfoList.pTableList) != 0) {
- STableKeyInfo* pTableInfo = taosArrayGet(pTaskInfo->tableqinfoList.pTableList, 0);
- uid = pTableInfo->uid;
- ts = INT64_MIN;
+ if (!tOffsetEqual(pOffset, &pTaskInfo->streamInfo.lastStatus)) {
+ while (1) {
+ uint8_t type = pOperator->operatorType;
+ pOperator->status = OP_OPENED;
+ if (type == QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
+ SStreamScanInfo* pInfo = pOperator->info;
+ if (pOffset->type == TMQ_OFFSET__LOG) {
+#if 0
+ if (tOffsetEqual(pOffset, &pTaskInfo->streamInfo.lastStatus) &&
+ pInfo->tqReader->pWalReader->curVersion != pOffset->version) {
+ qError("prepare scan ver %ld actual ver %ld, last %ld", pOffset->version,
+ pInfo->tqReader->pWalReader->curVersion, pTaskInfo->streamInfo.lastStatus.version);
+ ASSERT(0);
}
- }
- if (pTaskInfo->streamInfo.lastStatus.type != TMQ_OFFSET__SNAPSHOT_DATA ||
- pTaskInfo->streamInfo.lastStatus.uid != uid || pTaskInfo->streamInfo.lastStatus.ts != ts) {
+#endif
+ if (tqSeekVer(pInfo->tqReader, pOffset->version + 1) < 0) {
+ return -1;
+ }
+ ASSERT(pInfo->tqReader->pWalReader->curVersion == pOffset->version + 1);
+ } else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
+ /*pInfo->blockType = STREAM_INPUT__TABLE_SCAN;*/
+ int64_t uid = pOffset->uid;
+ int64_t ts = pOffset->ts;
+
+ if (uid == 0) {
+ if (taosArrayGetSize(pTaskInfo->tableqinfoList.pTableList) != 0) {
+ STableKeyInfo* pTableInfo = taosArrayGet(pTaskInfo->tableqinfoList.pTableList, 0);
+ uid = pTableInfo->uid;
+ ts = INT64_MIN;
+ }
+ }
+ /*if (pTaskInfo->streamInfo.lastStatus.type != TMQ_OFFSET__SNAPSHOT_DATA ||*/
+ /*pTaskInfo->streamInfo.lastStatus.uid != uid || pTaskInfo->streamInfo.lastStatus.ts != ts) {*/
STableScanInfo* pTableScanInfo = pInfo->pTableScanOp->info;
int32_t tableSz = taosArrayGetSize(pTaskInfo->tableqinfoList.pTableList);
bool found = false;
@@ -320,6 +340,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, const STqOffsetVal* pOffset) {
if (pTableInfo->uid == uid) {
found = true;
pTableScanInfo->currentTable = i;
+ break;
}
}
@@ -335,18 +356,18 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, const STqOffsetVal* pOffset) {
qDebug("tsdb reader offset seek to uid %ld ts %ld, table cur set to %d , all table num %d", uid, ts,
pTableScanInfo->currentTable, tableSz);
- }
+ /*}*/
+ } else {
+ ASSERT(0);
+ }
+ return 0;
} else {
- ASSERT(0);
+ ASSERT(pOperator->numOfDownstream == 1);
+ pOperator = pOperator->pDownstream[0];
}
- return 0;
- } else {
- ASSERT(pOperator->numOfDownstream == 1);
- pOperator = pOperator->pDownstream[0];
}
}
- /*}*/
return 0;
}
diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c
index 2ae09e043452a96bd4ce6ed601597d2c102834dc..674bbfef0b227729f49ee4584b080547e0090f70 100644
--- a/source/libs/executor/src/executorimpl.c
+++ b/source/libs/executor/src/executorimpl.c
@@ -594,10 +594,14 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc
SColumnInfoData* pColInfoData = taosArrayGet(pResult->pDataBlock, outputSlotId);
int32_t offset = createNewColModel ? 0 : pResult->info.rows;
- for (int32_t i = 0; i < pSrcBlock->info.rows; ++i) {
- colDataAppend(pColInfoData, i + offset,
- taosVariantGet(&pExpr[k].base.pParam[0].param, pExpr[k].base.pParam[0].param.nType),
- TSDB_DATA_TYPE_NULL == pExpr[k].base.pParam[0].param.nType);
+
+ int32_t type = pExpr[k].base.pParam[0].param.nType;
+ if (TSDB_DATA_TYPE_NULL == type) {
+ colDataAppendNNULL(pColInfoData, offset, pSrcBlock->info.rows);
+ } else {
+ for (int32_t i = 0; i < pSrcBlock->info.rows; ++i) {
+ colDataAppend(pColInfoData, i + offset, taosVariantGet(&pExpr[k].base.pParam[0].param, type), false);
+ }
}
numOfRows = pSrcBlock->info.rows;
@@ -1479,8 +1483,8 @@ int32_t finalizeResultRowIntoResultDataBlock(SDiskbasedBuf* pBuf, SResultRowPosi
} else if (strcmp(pCtx[j].pExpr->pExpr->_function.functionName, "_select_value") == 0) {
// do nothing, todo refactor
} else {
- // expand the result into multiple rows. E.g., _wstartts, top(k, 20)
- // the _wstartts needs to copy to 20 following rows, since the results of top-k expands to 20 different rows.
+ // expand the result into multiple rows. E.g., _wstart, top(k, 20)
+ // the _wstart needs to copy to 20 following rows, since the results of top-k expands to 20 different rows.
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, slotId);
char* in = GET_ROWCELL_INTERBUF(pCtx[j].resultInfo);
for (int32_t k = 0; k < pRow->numOfRows; ++k) {
@@ -1551,8 +1555,8 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprI
} else if (strcmp(pCtx[j].pExpr->pExpr->_function.functionName, "_select_value") == 0) {
// do nothing, todo refactor
} else {
- // expand the result into multiple rows. E.g., _wstartts, top(k, 20)
- // the _wstartts needs to copy to 20 following rows, since the results of top-k expands to 20 different rows.
+ // expand the result into multiple rows. E.g., _wstart, top(k, 20)
+ // the _wstart needs to copy to 20 following rows, since the results of top-k expands to 20 different rows.
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, slotId);
char* in = GET_ROWCELL_INTERBUF(pCtx[j].resultInfo);
if (pCtx[j].increase) {
@@ -3235,6 +3239,10 @@ static SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) {
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
if (pOperator->status == OP_EXEC_DONE) {
+ if (pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE) {
+ pOperator->status = OP_OPENED;
+ return NULL;
+ }
return NULL;
}
@@ -3268,11 +3276,15 @@ static SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) {
while (1) {
// The downstream exec may change the value of the newgroup, so use a local variable instead.
+ qDebug("projection call next");
SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream);
if (pBlock == NULL) {
- // TODO optimize
- /*if (pTaskInfo->execModel != OPTR_EXEC_MODEL_STREAM) {*/
+ qDebug("projection get null");
+
+ /*if (pTaskInfo->execModel == OPTR_EXEC_MODEL_BATCH) {*/
doSetOperatorCompleted(pOperator);
+ /*} else if (pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE) {*/
+ /*pOperator->status = OP_RES_TO_RETURN;*/
/*}*/
break;
}
@@ -3463,9 +3475,12 @@ static SSDataBlock* doFill(SOperatorInfo* pOperator) {
static void destroyExprInfo(SExprInfo* pExpr, int32_t numOfExprs) {
for (int32_t i = 0; i < numOfExprs; ++i) {
SExprInfo* pExprInfo = &pExpr[i];
- if (pExprInfo->pExpr->nodeType == QUERY_NODE_COLUMN) {
- taosMemoryFree(pExprInfo->base.pParam[0].pCol);
+ for(int32_t j = 0; j < pExprInfo->base.numOfParams; ++j) {
+ if (pExprInfo->base.pParam[j].type == FUNC_PARAM_TYPE_COLUMN) {
+ taosMemoryFreeClear(pExprInfo->base.pParam[j].pCol);
+ }
}
+
taosMemoryFree(pExprInfo->base.pParam);
taosMemoryFree(pExprInfo->pExpr);
}
@@ -3673,10 +3688,20 @@ void destroyBasicOperatorInfo(void* param, int32_t numOfOutput) {
taosMemoryFreeClear(param);
}
+
+static void freeItem(void* pItem) {
+ void** p = pItem;
+ if (*p != NULL) {
+ taosMemoryFreeClear(*p);
+ }
+}
+
void destroyAggOperatorInfo(void* param, int32_t numOfOutput) {
SAggOperatorInfo* pInfo = (SAggOperatorInfo*)param;
cleanupBasicInfo(&pInfo->binfo);
+ cleanupAggSup(&pInfo->aggSup);
+ taosArrayDestroyEx(pInfo->groupResInfo.pRows, freeItem);
taosMemoryFreeClear(param);
}
@@ -4322,6 +4347,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
pTaskInfo->code = code;
return NULL;
}
+
code = extractTableSchemaInfo(pHandle, pTableScanNode->scan.uid, pTaskInfo);
if (code) {
pTaskInfo->code = terrno;
@@ -4337,7 +4363,6 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
} else if (QUERY_NODE_PHYSICAL_PLAN_EXCHANGE == type) {
return createExchangeOperatorInfo(pHandle->pMsgCb->clientRpc, (SExchangePhysiNode*)pPhyNode, pTaskInfo);
-
} else if (QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN == type) {
STableScanPhysiNode* pTableScanNode = (STableScanPhysiNode*)pPhyNode;
STimeWindowAggSupp twSup = {
diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c
index f3c240b6f26348e8ebd0afda46d7785173674ea9..7b274e5af8c4081e206d1c6bc7ec056cb23e93a4 100644
--- a/source/libs/executor/src/scanoperator.c
+++ b/source/libs/executor/src/scanoperator.c
@@ -39,8 +39,6 @@ static int32_t buildSysDbTableInfo(const SSysTableScanInfo* pInfo, int32_t capac
static int32_t buildDbTableInfoBlock(const SSDataBlock* p, const SSysTableMeta* pSysDbTableMeta, size_t size,
const char* dbName);
-static int32_t addTagPseudoColumnData(SReadHandle* pHandle, SExprInfo* pPseudoExpr, int32_t numOfPseudoExpr,
- SSDataBlock* pBlock, const char* idStr);
static bool processBlockWithProbability(const SSampleExecInfo* pInfo);
bool processBlockWithProbability(const SSampleExecInfo* pInfo) {
@@ -198,12 +196,6 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanInfo* pTableSca
pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows);
pCost->skipBlocks += 1;
- // clear all data in pBlock that are set when handing the previous block
- for (int32_t i = 0; i < taosArrayGetSize(pBlock->pDataBlock); ++i) {
- SColumnInfoData* pcol = taosArrayGet(pBlock->pDataBlock, i);
- pcol->pData = NULL;
- }
-
return TSDB_CODE_SUCCESS;
} else if (*status == FUNC_DATA_REQUIRED_STATIS_LOAD) {
pCost->loadBlockStatis += 1;
@@ -320,8 +312,6 @@ int32_t addTagPseudoColumnData(SReadHandle* pHandle, SExprInfo* pPseudoExpr, int
int32_t dstSlotId = pExpr->base.resSchema.slotId;
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, dstSlotId);
-
- colInfoDataEnsureCapacity(pColInfoData, pBlock->info.rows);
colInfoDataCleanup(pColInfoData, pBlock->info.rows);
int32_t functionId = pExpr->pExpr->_function.functionId;
@@ -884,6 +874,28 @@ static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_
return true;
}
+static STimeWindow getSlidingWindow(TSKEY* tsCol, SInterval* pInterval, SDataBlockInfo* pDataBlockInfo, int32_t* pRowIndex) {
+ SResultRowInfo dumyInfo;
+ dumyInfo.cur.pageId = -1;
+ STimeWindow win = getActiveTimeWindow(NULL, &dumyInfo, tsCol[*pRowIndex], pInterval,
+ TSDB_ORDER_ASC);
+ STimeWindow endWin = win;
+ STimeWindow preWin = win;
+ while (1) {
+ (*pRowIndex) += getNumOfRowsInTimeWindow(pDataBlockInfo, tsCol, *pRowIndex, endWin.ekey,
+ binarySearchForKey, NULL, TSDB_ORDER_ASC);
+ do {
+ preWin = endWin;
+ getNextTimeWindow(pInterval, &endWin, TSDB_ORDER_ASC);
+ } while (tsCol[(*pRowIndex) - 1] >= endWin.skey);
+ endWin = preWin;
+ if (win.ekey == endWin.ekey || (*pRowIndex) == pDataBlockInfo->rows ) {
+ win.ekey = endWin.ekey;
+ return win;
+ }
+ win.ekey = endWin.ekey;
+ }
+}
static bool prepareDataScan(SStreamScanInfo* pInfo, SSDataBlock* pSDB, int32_t tsColIndex, int32_t* pRowIndex) {
STimeWindow win = {
.skey = INT64_MIN,
@@ -905,10 +917,13 @@ static bool prepareDataScan(SStreamScanInfo* pInfo, SSDataBlock* pSDB, int32_t t
setGroupId(pInfo, pSDB, GROUPID_COLUMN_INDEX, *pRowIndex);
(*pRowIndex) += updateSessionWindowInfo(pCurWin, tsCols, NULL, pSDB->info.rows, *pRowIndex, gap, NULL);
} else {
- win = getActiveTimeWindow(NULL, &dumyInfo, tsCols[*pRowIndex], &pInfo->interval, TSDB_ORDER_ASC);
setGroupId(pInfo, pSDB, GROUPID_COLUMN_INDEX, *pRowIndex);
- (*pRowIndex) +=
- getNumOfRowsInTimeWindow(&pSDB->info, tsCols, *pRowIndex, win.ekey, binarySearchForKey, NULL, TSDB_ORDER_ASC);
+ pInfo->updateWin.skey = tsCols[*pRowIndex];
+ win = getSlidingWindow(tsCols, &pInfo->interval, &pSDB->info, pRowIndex);
+ pInfo->updateWin.ekey = tsCols[*pRowIndex - 1];
+ // win = getActiveTimeWindow(NULL, &dumyInfo, tsCols[*pRowIndex], &pInfo->interval, TSDB_ORDER_ASC);
+ // (*pRowIndex) +=
+ // getNumOfRowsInTimeWindow(&pSDB->info, tsCols, *pRowIndex, win.ekey, binarySearchForKey, NULL, TSDB_ORDER_ASC);
}
needRead = true;
} else if (isStateWindow(pInfo)) {
@@ -974,10 +989,12 @@ static SSDataBlock* doDataScan(SStreamScanInfo* pInfo, SSDataBlock* pSDB, int32_
}
}
if (!pResult) {
+ pInfo->updateWin = (STimeWindow){.skey = INT64_MIN, .ekey = INT64_MAX};
return NULL;
}
if (pResult->info.groupId == pInfo->groupId) {
+ pResult->info.calWin = pInfo->updateWin;
return pResult;
}
}
@@ -1130,10 +1147,11 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
SOperatorInfo* pOperator = pInfo->pStreamScanOp;
SExecTaskInfo* pTaskInfo = pInfo->pStreamScanOp->pTaskInfo;
+ blockDataEnsureCapacity(pInfo->pRes, pBlock->info.rows);
+
pInfo->pRes->info.rows = pBlock->info.rows;
pInfo->pRes->info.uid = pBlock->info.uid;
pInfo->pRes->info.type = STREAM_NORMAL;
- pInfo->pRes->info.capacity = pBlock->info.rows;
uint64_t* groupIdPre = taosHashGet(pOperator->pTaskInfo->tableqinfoList.map, &pBlock->info.uid, sizeof(int64_t));
if (groupIdPre) {
@@ -1159,7 +1177,10 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
for (int32_t j = 0; j < blockDataGetNumOfCols(pBlock); ++j) {
SColumnInfoData* pResCol = bdGetColumnInfoData(pBlock, j);
if (pResCol->info.colId == pColMatchInfo->colId) {
- taosArraySet(pInfo->pRes->pDataBlock, pColMatchInfo->targetSlotId, pResCol);
+
+ SColumnInfoData* pDst = taosArrayGet(pInfo->pRes->pDataBlock, pColMatchInfo->targetSlotId);
+ colDataAssign(pDst, pResCol, pBlock->info.rows, &pInfo->pRes->info);
+// taosArraySet(pInfo->pRes->pDataBlock, pColMatchInfo->targetSlotId, pResCol);
colExists = true;
break;
}
@@ -1172,30 +1193,21 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
}
}
- taosArrayDestroy(pBlock->pDataBlock);
-
ASSERT(pInfo->pRes->pDataBlock != NULL);
-#if 0
- if (pInfo->pRes->pDataBlock == NULL) {
- // TODO add log
- updateInfoDestoryColseWinSBF(pInfo->pUpdateInfo);
- pOperator->status = OP_EXEC_DONE;
- pTaskInfo->code = terrno;
- return -1;
- }
-#endif
// currently only the tbname pseudo column
if (pInfo->numOfPseudoExpr > 0) {
int32_t code = addTagPseudoColumnData(&pInfo->readHandle, pInfo->pPseudoExpr, pInfo->numOfPseudoExpr, pInfo->pRes,
GET_TASKID(pTaskInfo));
if (code != TSDB_CODE_SUCCESS) {
+ blockDataFreeRes((SSDataBlock*) pBlock);
longjmp(pTaskInfo->env, code);
}
}
doFilter(pInfo->pCondition, pInfo->pRes);
blockDataUpdateTsWindow(pInfo->pRes, pInfo->primaryTsIndex);
+ blockDataFreeRes((SSDataBlock*) pBlock);
return 0;
}
@@ -1204,11 +1216,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
SStreamScanInfo* pInfo = pOperator->info;
- /*pTaskInfo->code = pOperator->fpSet._openFn(pOperator);*/
- /*if (pTaskInfo->code != TSDB_CODE_SUCCESS || pOperator->status == OP_EXEC_DONE) {*/
- /*return NULL;*/
- /*}*/
-
+ qDebug("stream scan called");
if (pTaskInfo->streamInfo.prepareStatus.type == TMQ_OFFSET__LOG) {
while (1) {
SFetchRet ret = {0};
@@ -1220,6 +1228,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
}
// TODO clean data block
if (pInfo->pRes->info.rows > 0) {
+ qDebug("stream scan log return %d rows", pInfo->pRes->info.rows);
return pInfo->pRes;
}
} else if (ret.fetchType == FETCH_TYPE__META) {
@@ -1230,6 +1239,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
} else if (ret.fetchType == FETCH_TYPE__NONE) {
pTaskInfo->streamInfo.lastStatus = ret.offset;
ASSERT(pTaskInfo->streamInfo.lastStatus.version + 1 >= pTaskInfo->streamInfo.prepareStatus.version);
+ qDebug("stream scan log return null");
return NULL;
} else {
ASSERT(0);
@@ -1237,7 +1247,12 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
}
} else if (pTaskInfo->streamInfo.prepareStatus.type == TMQ_OFFSET__SNAPSHOT_DATA) {
SSDataBlock* pResult = doTableScan(pInfo->pTableScanOp);
- return pResult && pResult->info.rows > 0 ? pResult : NULL;
+ if (pResult && pResult->info.rows > 0) {
+ qDebug("stream scan tsdb return %d rows", pResult->info.rows);
+ return pResult;
+ }
+ qDebug("stream scan tsdb return null");
+ return NULL;
} else if (pTaskInfo->streamInfo.prepareStatus.type == TMQ_OFFSET__SNAPSHOT_META) {
// TODO scan meta
ASSERT(0);
@@ -1256,8 +1271,13 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
int32_t current = pInfo->validBlockIndex++;
SSDataBlock* pBlock = taosArrayGetP(pInfo->pBlockLists, current);
// TODO move into scan
+ pBlock->info.calWin.skey = INT64_MIN;
+ pBlock->info.calWin.ekey = INT64_MAX;
blockDataUpdateTsWindow(pBlock, 0);
switch (pBlock->info.type) {
+ case STREAM_NORMAL:
+ case STREAM_GET_ALL:
+ return pBlock;
case STREAM_RETRIEVE: {
pInfo->blockType = STREAM_INPUT__DATA_SUBMIT;
pInfo->scanMode = STREAM_SCAN_FROM_DATAREADER_RETRIEVE;
@@ -1287,6 +1307,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
}
return pBlock;
} else if (pInfo->blockType == STREAM_INPUT__DATA_SUBMIT) {
+ qDebug("scan mode %d", pInfo->scanMode);
if (pInfo->scanMode == STREAM_SCAN_FROM_RES) {
blockDataDestroy(pInfo->pUpdateRes);
pInfo->scanMode = STREAM_SCAN_FROM_READERHANDLE;
@@ -1381,18 +1402,9 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
}
}
}
-
+ qDebug("scan rows: %d", pBlockInfo->rows);
return (pBlockInfo->rows == 0) ? NULL : pInfo->pRes;
-#if 0
- } else if (pInfo->blockType == STREAM_INPUT__TABLE_SCAN) {
- ASSERT(0);
- // check reader last status
- // if not match, reset status
- SSDataBlock* pResult = doTableScan(pInfo->pTableScanOp);
- return pResult && pResult->info.rows > 0 ? pResult : NULL;
-#endif
-
} else {
ASSERT(0);
return NULL;
@@ -1533,6 +1545,7 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys
pInfo->pStreamScanOp = pOperator;
pInfo->deleteDataIndex = 0;
pInfo->pDeleteDataRes = createPullDataBlock();
+ pInfo->updateWin = (STimeWindow){.skey = INT64_MAX, .ekey = INT64_MAX};
pOperator->name = "StreamScanOperator";
pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN;
@@ -2377,6 +2390,7 @@ int32_t createScanTableListInfo(STableScanPhysiNode* pTableScanNode, SReadHandle
qDebug("no table qualified for query, TID:0x%" PRIx64 ", QID:0x%" PRIx64, taskId, queryId);
return TSDB_CODE_SUCCESS;
}
+
pTableListInfo->needSortTableByGroupId = pTableScanNode->groupSort;
code = generateGroupIdMap(pTableListInfo, pHandle, pTableScanNode->pGroupTags);
if (code != TSDB_CODE_SUCCESS) {
@@ -2550,9 +2564,11 @@ static SSDataBlock* getTableDataBlock(void* param) {
SDataBlockInfo binfo = pBlock->info;
tsdbRetrieveDataBlockInfo(reader, &binfo);
- binfo.capacity = binfo.rows;
- blockDataEnsureCapacity(pBlock, binfo.capacity);
- pBlock->info = binfo;
+ blockDataEnsureCapacity(pBlock, binfo.rows);
+ pBlock->info.type = binfo.type;
+ pBlock->info.uid = binfo.uid;
+ pBlock->info.window = binfo.window;
+ pBlock->info.rows = binfo.rows;
uint32_t status = 0;
int32_t code = loadDataBlockFromOneTable(pOperator, pTableScanInfo, readerIdx, pBlock, &status);
@@ -2579,11 +2595,19 @@ static SSDataBlock* getTableDataBlock(void* param) {
return NULL;
}
-SArray* generateSortByTsInfo(int32_t order) {
+SArray* generateSortByTsInfo(SArray* colMatchInfo, int32_t order) {
+ int32_t tsTargetSlotId = 0;
+ for (int32_t i = 0; i < taosArrayGetSize(colMatchInfo); ++i) {
+ SColMatchInfo* colInfo = taosArrayGet(colMatchInfo, i);
+ if (colInfo->colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
+ tsTargetSlotId = colInfo->targetSlotId;
+ }
+ }
+
SArray* pList = taosArrayInit(1, sizeof(SBlockOrderInfo));
SBlockOrderInfo bi = {0};
bi.order = order;
- bi.slotId = 0;
+ bi.slotId = tsTargetSlotId;
bi.nullFirst = NULL_ORDER_FIRST;
taosArrayPush(pList, &bi);
@@ -2832,7 +2856,7 @@ SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanN
pInfo->sortSourceParams = taosArrayInit(64, sizeof(STableMergeScanSortSourceParam));
- pInfo->pSortInfo = generateSortByTsInfo(pInfo->cond.order);
+ pInfo->pSortInfo = generateSortByTsInfo(pInfo->pColMatchInfo, pInfo->cond.order);
pInfo->pSortInputBlock = createOneDataBlock(pInfo->pResBlock, false);
int32_t rowSize = pInfo->pResBlock->info.rowSize;
diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c
index 8d9cac3614f6ac19527c3074c8fb1c98ff93195c..9795907404f9805b93082c0e41fe13ffe3b41f25 100644
--- a/source/libs/executor/src/sortoperator.c
+++ b/source/libs/executor/src/sortoperator.c
@@ -621,7 +621,9 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData
break;
}
}
-
+ if (pInfo->groupSort) {
+ pInfo->hasGroupId = false;
+ }
if (p->info.rows > 0) { // todo extract method
blockDataEnsureCapacity(pDataBlock, p->info.rows);
int32_t numOfCols = taosArrayGetSize(pColMatchInfo);
diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c
index c008c7c4a9d0fec83188ae3eee55144242125db3..e0bdcfdc3a6a744c9f67e1d466e05be8bd30c4f5 100644
--- a/source/libs/executor/src/tfill.c
+++ b/source/libs/executor/src/tfill.c
@@ -53,8 +53,8 @@ static void setNullRow(SSDataBlock* pBlock, int64_t ts, int32_t rowIndex) {
// the first are always the timestamp column, so start from the second column.
for (int32_t i = 0; i < taosArrayGetSize(pBlock->pDataBlock); ++i) {
SColumnInfoData* p = taosArrayGet(pBlock->pDataBlock, i);
- if (p->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
- colDataAppend(p, rowIndex, (const char*)&ts, false);
+ if (p->info.type == TSDB_DATA_TYPE_TIMESTAMP) { // handle timestamp
+ colDataAppend(p, rowIndex, (const char*)&ts, false);
} else {
colDataAppendNULL(p, rowIndex);
}
@@ -71,66 +71,76 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
SPoint point1, point2, point;
int32_t step = GET_FORWARD_DIRECTION_FACTOR(pFillInfo->order);
- // set the primary timestamp column value
- int32_t index = pFillInfo->numOfCurrent;
- SColumnInfoData* pCol0 = taosArrayGet(pBlock->pDataBlock, pFillInfo->tsSlotId);
- char* val = colDataGetData(pCol0, index);
-
- // set the primary timestamp value
- *(TSKEY*)val = pFillInfo->currentKey;
+// set the primary timestamp column value
+ int32_t index = pFillInfo->numOfCurrent;
// set the other values
if (pFillInfo->type == TSDB_FILL_PREV) {
SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev : pFillInfo->next;
- for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
+ for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
if (TSDB_COL_IS_TAG(pCol->flag)) {
continue;
}
- SGroupKeys* pKey = taosArrayGet(p, i);
SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol));
- doSetVal(pDstColInfoData, index, pKey);
+
+ if (pDstColInfoData->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
+ colDataAppend(pDstColInfoData, index, (const char*)&pFillInfo->currentKey, false);
+ } else {
+ SGroupKeys* pKey = taosArrayGet(p, i);
+ doSetVal(pDstColInfoData, index, pKey);
+ }
}
} else if (pFillInfo->type == TSDB_FILL_NEXT) {
SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->next : pFillInfo->prev;
// todo refactor: start from 0 not 1
- for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
+ for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
if (TSDB_COL_IS_TAG(pCol->flag)) {
continue;
}
- SGroupKeys* pKey = taosArrayGet(p, i);
SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol));
- doSetVal(pDstColInfoData, index, pKey);
+
+ if (pDstColInfoData->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
+ colDataAppend(pDstColInfoData, index, (const char*)&pFillInfo->currentKey, false);
+ } else {
+ SGroupKeys* pKey = taosArrayGet(p, i);
+ doSetVal(pDstColInfoData, index, pKey);
+ }
}
} else if (pFillInfo->type == TSDB_FILL_LINEAR) {
// TODO : linear interpolation supports NULL value
if (outOfBound) {
setNullRow(pBlock, pFillInfo->currentKey, index);
} else {
- for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
+ for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
if (TSDB_COL_IS_TAG(pCol->flag)) {
continue;
}
- int32_t srcSlotId = GET_SRC_SLOT_ID(pCol);
-
int32_t dstSlotId = GET_DEST_SLOT_ID(pCol);
SColumnInfoData* pDstCol = taosArrayGet(pBlock->pDataBlock, dstSlotId);
- int16_t type = pCol->pExpr->base.resSchema.type;
+ int16_t type = pDstCol->info.type;
+ if (type == TSDB_DATA_TYPE_TIMESTAMP) {
+ colDataAppend(pDstCol, index, (const char*)&pFillInfo->currentKey, false);
+ continue;
+ }
+
SGroupKeys* pKey = taosArrayGet(pFillInfo->prev, i);
if (IS_VAR_DATA_TYPE(type) || type == TSDB_DATA_TYPE_BOOL || pKey->isNull) {
colDataAppendNULL(pDstCol, index);
continue;
}
- SGroupKeys* pKey1 = taosArrayGet(pFillInfo->prev, 0);
- int64_t prevTs = *(int64_t*)pKey1->pData;
+ SGroupKeys* pKey1 = taosArrayGet(pFillInfo->prev, pFillInfo->tsSlotId);
+
+ int64_t prevTs = *(int64_t*)pKey1->pData;
+ int32_t srcSlotId = GET_SRC_SLOT_ID(pCol);
SColumnInfoData* pSrcCol = taosArrayGet(pSrcBlock->pDataBlock, srcSlotId);
char* data = colDataGetData(pSrcCol, pFillInfo->index);
@@ -148,7 +158,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
} else if (pFillInfo->type == TSDB_FILL_NULL) { // fill with NULL
setNullRow(pBlock, pFillInfo->currentKey, index);
} else { // fill with user specified value for each column
- for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
+ for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
if (TSDB_COL_IS_TAG(pCol->flag) /* || IS_VAR_DATA_TYPE(pCol->schema.type)*/) {
continue;
@@ -171,6 +181,8 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
colDataAppend(pDst, index, (char*)&v, false);
} else if (pDst->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
colDataAppend(pDst, index, (const char*)&pFillInfo->currentKey, false);
+ } else { // varchar/nchar data
+ colDataAppendNULL(pDst, index);
}
}
}
@@ -229,8 +241,7 @@ static void copyCurrentRowIntoBuf(SFillInfo* pFillInfo, int32_t rowIndex, SArray
static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t outputRows) {
pFillInfo->numOfCurrent = 0;
- // todo make sure the first column is always the primary timestamp column?
- SColumnInfoData* pTsCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, 0);
+ SColumnInfoData* pTsCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, pFillInfo->tsSlotId);
int32_t step = GET_FORWARD_DIRECTION_FACTOR(pFillInfo->order);
bool ascFill = FILL_IS_ASC_FILL(pFillInfo);
@@ -264,9 +275,8 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
assert(pFillInfo->currentKey == ts);
if (pFillInfo->type == TSDB_FILL_NEXT && (pFillInfo->index + 1) < pFillInfo->numOfRows) {
- ++pFillInfo->index;
- copyCurrentRowIntoBuf(pFillInfo, pFillInfo->index, pFillInfo->next);
- --pFillInfo->index;
+ int32_t nextRowIndex = pFillInfo->index + 1;
+ copyCurrentRowIntoBuf(pFillInfo, nextRowIndex, pFillInfo->next);
}
// assign rows to dst buffer
diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c
index 78775073a489ece1be13eb31705f803bc1b2889f..74b5a3dab202bed509fc5fde773ca207fce71285 100644
--- a/source/libs/executor/src/timewindowoperator.c
+++ b/source/libs/executor/src/timewindowoperator.c
@@ -419,6 +419,14 @@ static bool setTimeWindowInterpolationEndTs(SIntervalAggOperatorInfo* pInfo, SEx
return true;
}
+bool inSlidingWindow(SInterval* pInterval, STimeWindow* pWin, SDataBlockInfo* pBlockInfo) {
+ if (pInterval->interval != pInterval->sliding &&
+ (pWin->ekey < pBlockInfo->calWin.skey || pWin->skey > pBlockInfo->calWin.ekey)) {
+ return false;
+ }
+ return true;
+}
+
static int32_t getNextQualifiedWindow(SInterval* pInterval, STimeWindow* pNext, SDataBlockInfo* pDataBlockInfo,
TSKEY* primaryKeys, int32_t prevPosition, int32_t order) {
bool ascQuery = (order == TSDB_ORDER_ASC);
@@ -432,6 +440,10 @@ static int32_t getNextQualifiedWindow(SInterval* pInterval, STimeWindow* pNext,
return -1;
}
+ if (!inSlidingWindow(pInterval, pNext, pDataBlockInfo) && order == TSDB_ORDER_ASC) {
+ return -1;
+ }
+
TSKEY skey = ascQuery ? pNext->skey : pNext->ekey;
int32_t startPos = 0;
@@ -801,7 +813,8 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul
STimeWindow win = getActiveTimeWindow(pInfo->aggSup.pResultBuf, pResultRowInfo, ts, &pInfo->interval, pInfo->order);
int32_t ret = TSDB_CODE_SUCCESS;
- if (!pInfo->ignoreExpiredData || !isCloseWindow(&win, &pInfo->twAggSup)) {
+ if ((!pInfo->ignoreExpiredData || !isCloseWindow(&win, &pInfo->twAggSup)) &&
+ inSlidingWindow(&pInfo->interval, &win, &pBlock->info)) {
ret = setTimeWindowOutputBuf(pResultRowInfo, &win, (scanFlag == MAIN_SCAN), &pResult, tableGroupId, pSup->pCtx,
numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo);
if (ret != TSDB_CODE_SUCCESS || pResult == NULL) {
@@ -834,7 +847,8 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul
doWindowBorderInterpolation(pInfo, pBlock, pResult, &win, startPos, forwardRows, pSup);
}
- if (!pInfo->ignoreExpiredData || !isCloseWindow(&win, &pInfo->twAggSup)) {
+ if ((!pInfo->ignoreExpiredData || !isCloseWindow(&win, &pInfo->twAggSup)) &&
+ inSlidingWindow(&pInfo->interval, &win, &pBlock->info)) {
updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &win, true);
doApplyFunctions(pTaskInfo, pSup->pCtx, &win, &pInfo->twAggSup.timeWindowData, startPos, forwardRows, tsCols,
pBlock->info.rows, numOfOutput, pInfo->order);
@@ -1278,18 +1292,25 @@ static void doClearWindows(SAggSupporter* pAggSup, SExprSupp* pSup1, SInterval*
SColumnInfoData* pGpCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX);
pGpDatas = (uint64_t*)pGpCol->pData;
}
- int32_t step = 0;
- for (int32_t i = 0; i < pBlock->info.rows; i += step) {
- SResultRowInfo dumyInfo;
- dumyInfo.cur.pageId = -1;
- STimeWindow win = getActiveTimeWindow(NULL, &dumyInfo, tsCols[i], pInterval, TSDB_ORDER_ASC);
- step = getNumOfRowsInTimeWindow(&pBlock->info, tsCols, i, win.ekey, binarySearchForKey, NULL, TSDB_ORDER_ASC);
- uint64_t winGpId = pGpDatas ? pGpDatas[i] : pBlock->info.groupId;
- bool res = doClearWindow(pAggSup, pSup1, (char*)&win.skey, sizeof(TKEY), winGpId, numOfOutput);
+ int32_t step = 0;
+ int32_t startPos = 0;
+ SResultRowInfo dumyInfo;
+ dumyInfo.cur.pageId = -1;
+ STimeWindow win = getActiveTimeWindow(NULL, &dumyInfo, tsCols[0], pInterval, TSDB_ORDER_ASC);
+ while (1) {
+ step =
+ getNumOfRowsInTimeWindow(&pBlock->info, tsCols, startPos, win.ekey, binarySearchForKey, NULL, TSDB_ORDER_ASC);
+ uint64_t winGpId = pGpDatas ? pGpDatas[startPos] : pBlock->info.groupId;
+ bool res = doClearWindow(pAggSup, pSup1, (char*)&win.skey, sizeof(TSKEY), winGpId, numOfOutput);
if (pUpWins && res) {
SWinRes winRes = {.ts = win.skey, .groupId = winGpId};
taosArrayPush(pUpWins, &winRes);
}
+ int32_t prevEndPos = step - 1 + startPos;
+ startPos = getNextQualifiedWindow(pInterval, &win, &pBlock->info, tsCols, prevEndPos, TSDB_ORDER_ASC);
+ if (startPos < 0) {
+ break;
+ }
}
}
@@ -1320,9 +1341,9 @@ static int32_t closeIntervalWindow(SHashObj* pHashMap, STimeWindowAggSupp* pSup,
uint64_t groupId = *(uint64_t*)key;
ASSERT(keyLen == GET_RES_WINDOW_KEY_LEN(sizeof(TSKEY)));
TSKEY ts = *(int64_t*)((char*)key + sizeof(uint64_t));
- SResultRowInfo dumyInfo;
- dumyInfo.cur.pageId = -1;
- STimeWindow win = getActiveTimeWindow(NULL, &dumyInfo, ts, pInterval, TSDB_ORDER_ASC);
+ STimeWindow win;
+ win.skey = ts;
+ win.ekey = taosTimeAdd(win.skey, pInterval->interval, pInterval->intervalUnit, pInterval->precision) - 1;
SWinRes winRe = {
.ts = win.skey,
.groupId = groupId,
@@ -1332,13 +1353,13 @@ static int32_t closeIntervalWindow(SHashObj* pHashMap, STimeWindowAggSupp* pSup,
if (chIds && pPullDataMap) {
SArray* chAy = *(SArray**)chIds;
int32_t size = taosArrayGetSize(chAy);
- qInfo("window %" PRId64 " wait child size:%d", win.skey, size);
+ qDebug("window %" PRId64 " wait child size:%d", win.skey, size);
for (int32_t i = 0; i < size; i++) {
- qInfo("window %" PRId64 " wait chid id:%d", win.skey, *(int32_t*)taosArrayGet(chAy, i));
+ qDebug("window %" PRId64 " wait chid id:%d", win.skey, *(int32_t*)taosArrayGet(chAy, i));
}
continue;
} else if (pPullDataMap) {
- qInfo("close window %" PRId64, win.skey);
+ qDebug("close window %" PRId64, win.skey);
}
SResultRowPosition* pPos = (SResultRowPosition*)pIte;
if (pSup->calTrigger == STREAM_TRIGGER_WINDOW_CLOSE) {
@@ -1579,7 +1600,7 @@ static bool timeWindowinterpNeeded(SqlFunctionCtx* pCtx, int32_t numOfCols, SInt
}
void increaseTs(SqlFunctionCtx* pCtx) {
- if (pCtx[0].pExpr->pExpr->_function.pFunctNode->funcType == FUNCTION_TYPE_WSTARTTS) {
+ if (pCtx[0].pExpr->pExpr->_function.pFunctNode->funcType == FUNCTION_TYPE_WSTART) {
pCtx[0].increase = true;
}
}
@@ -2434,7 +2455,7 @@ static void doHashInterval(SOperatorInfo* pOperatorInfo, SSDataBlock* pSDataBloc
}
while (1) {
bool isClosed = isCloseWindow(&nextWin, &pInfo->twAggSup);
- if (pInfo->ignoreExpiredData && isClosed) {
+ if ((pInfo->ignoreExpiredData && isClosed) || !inSlidingWindow(&pInfo->interval, &nextWin, &pSDataBlock->info)) {
startPos = getNexWindowPos(&pInfo->interval, &pSDataBlock->info, tsCols, startPos, nextWin.ekey, &nextWin);
if (startPos < 0) {
break;
@@ -2491,8 +2512,8 @@ static void doHashInterval(SOperatorInfo* pOperatorInfo, SSDataBlock* pSDataBloc
if (IS_FINAL_OP(pInfo)) {
forwardRows = 1;
} else {
- forwardRows = getNumOfRowsInTimeWindow(&pSDataBlock->info, tsCols, startPos, nextWin.ekey, binarySearchForKey, NULL,
- TSDB_ORDER_ASC);
+ forwardRows = getNumOfRowsInTimeWindow(&pSDataBlock->info, tsCols, startPos, nextWin.ekey, binarySearchForKey,
+ NULL, TSDB_ORDER_ASC);
}
if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE && pUpdated) {
saveResultRow(pResult, tableGroupId, pUpdated);
@@ -2609,6 +2630,8 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
SExprSupp* pSup = &pOperator->exprSupp;
+ qDebug("interval status %d %s", pOperator->status, IS_FINAL_OP(pInfo) ? "interval Final" : "interval Semi");
+
if (pOperator->status == OP_EXEC_DONE) {
return NULL;
} else if (pOperator->status == OP_RES_TO_RETURN) {
@@ -2659,7 +2682,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
clearSpecialDataBlock(pInfo->pUpdateRes);
removeDeleteResults(pUpdated, pInfo->pDelWins);
pOperator->status = OP_RES_TO_RETURN;
- qInfo("%s return data", IS_FINAL_OP(pInfo) ? "interval Final" : "interval Semi");
+ qDebug("%s return data", IS_FINAL_OP(pInfo) ? "interval Final" : "interval Semi");
break;
}
printDataBlock(pBlock, IS_FINAL_OP(pInfo) ? "interval Final recv" : "interval Semi recv");
@@ -3101,12 +3124,7 @@ int64_t getSessionWindowEndkey(void* data, int32_t index) {
}
bool isInTimeWindow(STimeWindow* pWin, TSKEY ts, int64_t gap) {
- int64_t sGap = ts - pWin->skey + gap;
- int64_t eGap = pWin->ekey - ts + gap;
- // if ((sGap < 0 && sGap >= -gap) || (eGap < 0 && eGap >= -gap) || (sGap >= 0 && eGap >= 0)) {
- // return true;
- // }
- if (sGap >= 0 && eGap >= 0) {
+ if (ts + gap >= pWin->skey && ts - gap <= pWin->ekey) {
return true;
}
return false;
@@ -4489,13 +4507,14 @@ static SSDataBlock* doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) {
setInputDataBlock(pOperator, pSup->pCtx, pBlock, iaInfo->order, scanFlag, true);
doMergeAlignedIntervalAggImpl(pOperator, &iaInfo->binfo.resultRowInfo, pBlock, scanFlag, pRes);
doFilter(miaInfo->pCondition, pRes);
- if (pRes->info.rows > 0) {
+ if (pRes->info.rows >= pOperator->resultInfo.capacity) {
break;
}
}
pRes->info.groupId = miaInfo->groupId;
}
+ miaInfo->hasGroupId = false;
if (miaInfo->inputBlocksFinished) {
doSetOperatorCompleted(pOperator);
diff --git a/source/libs/function/inc/functionMgtInt.h b/source/libs/function/inc/functionMgtInt.h
index 2fcddce5eb2132aff7dd9799cc76e41f54073d99..da5dd0433d4a307d27d98b4caacf71d85a14092d 100644
--- a/source/libs/function/inc/functionMgtInt.h
+++ b/source/libs/function/inc/functionMgtInt.h
@@ -47,6 +47,7 @@ extern "C" {
#define FUNC_MGT_FORBID_WINDOW_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(18)
#define FUNC_MGT_FORBID_GROUP_BY_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(19)
#define FUNC_MGT_SYSTEM_INFO_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(20)
+#define FUNC_MGT_CLIENT_PC_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(21)
#define FUNC_MGT_TEST_MASK(val, mask) (((val) & (mask)) != 0)
diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c
index a735edafab74e6056cefcb2d055944d827e99146..5feb1427572af248428e454ac3f168487344f24e 100644
--- a/source/libs/function/src/builtins.c
+++ b/source/libs/function/src/builtins.c
@@ -1976,7 +1976,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.name = "leastsquares",
.type = FUNCTION_TYPE_LEASTSQUARES,
- .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_FORBID_STREAM_FUNC,
+ .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC,
.translateFunc = translateLeastSQR,
.getEnvFunc = getLeastSQRFuncEnv,
.initFunc = leastSQRFunctionSetup,
@@ -2217,7 +2217,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.name = "last_row",
.type = FUNCTION_TYPE_LAST_ROW,
- .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC,
+ .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC,
.translateFunc = translateFirstLast,
.getEnvFunc = getFirstLastFuncEnv,
.initFunc = functionSetup,
@@ -2784,28 +2784,38 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.finalizeFunc = NULL
},
{
- .name = "_qstartts",
- .type = FUNCTION_TYPE_QSTARTTS,
- .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
+ .name = "_qstart",
+ .type = FUNCTION_TYPE_QSTART,
+ .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_CLIENT_PC_FUNC,
.translateFunc = translateTimePseudoColumn,
- .getEnvFunc = getTimePseudoFuncEnv,
+ .getEnvFunc = NULL,
.initFunc = NULL,
- .sprocessFunc = qStartTsFunction,
+ .sprocessFunc = NULL,
.finalizeFunc = NULL
},
{
- .name = "_qendts",
- .type = FUNCTION_TYPE_QENDTS,
- .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
+ .name = "_qend",
+ .type = FUNCTION_TYPE_QEND,
+ .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_CLIENT_PC_FUNC,
.translateFunc = translateTimePseudoColumn,
- .getEnvFunc = getTimePseudoFuncEnv,
+ .getEnvFunc = NULL,
+ .initFunc = NULL,
+ .sprocessFunc = NULL,
+ .finalizeFunc = NULL
+ },
+ {
+ .name = "_qduration",
+ .type = FUNCTION_TYPE_QDURATION,
+ .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_CLIENT_PC_FUNC,
+ .translateFunc = translateWduration,
+ .getEnvFunc = NULL,
.initFunc = NULL,
- .sprocessFunc = qEndTsFunction,
+ .sprocessFunc = NULL,
.finalizeFunc = NULL
},
{
- .name = "_wstartts",
- .type = FUNCTION_TYPE_WSTARTTS,
+ .name = "_wstart",
+ .type = FUNCTION_TYPE_WSTART,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.translateFunc = translateTimePseudoColumn,
.getEnvFunc = getTimePseudoFuncEnv,
@@ -2814,8 +2824,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.finalizeFunc = NULL
},
{
- .name = "_wendts",
- .type = FUNCTION_TYPE_WENDTS,
+ .name = "_wend",
+ .type = FUNCTION_TYPE_WEND,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.translateFunc = translateTimePseudoColumn,
.getEnvFunc = getTimePseudoFuncEnv,
diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c
index 194d75a8a04b857938bd54a49e6d3abd071e8866..97cb1f0ee112966412e777909387a3f6ad66aa67 100644
--- a/source/libs/function/src/builtinsimpl.c
+++ b/source/libs/function/src/builtinsimpl.c
@@ -81,8 +81,11 @@ typedef struct STopBotRes {
typedef struct SFirstLastRes {
bool hasResult;
- bool isNull; // used for last_row function only
+ // used for last_row function only, isNullRes in SResultRowEntry can not be passed to downstream.So,
+ // this attribute is required
+ bool isNull;
int32_t bytes;
+ int64_t ts;
char buf[];
} SFirstLastRes;
@@ -1144,9 +1147,9 @@ static void copyTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBl
static int32_t findRowIndex(int32_t start, int32_t num, SColumnInfoData* pCol, const char* tval) {
// the data is loaded, not only the block SMA value
- for(int32_t i = start; i < num + start; ++i) {
+ for (int32_t i = start; i < num + start; ++i) {
char* p = colDataGetData(pCol, i);
- if (memcpy((void*)tval, p, pCol->info.bytes) == 0) {
+ if (memcpy((void*)tval, p, pCol->info.bytes) == 0) {
return i;
}
}
@@ -1154,7 +1157,6 @@ static int32_t findRowIndex(int32_t start, int32_t num, SColumnInfoData* pCol, c
ASSERT(0);
}
-
int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
int32_t numOfElems = 0;
@@ -1631,10 +1633,14 @@ void setNullSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, int32_t
}
void setSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, const STuplePos* pTuplePos, int32_t rowIndex) {
+ if (pCtx->subsidiaries.num <= 0) {
+ return;
+ }
+
int32_t pageId = pTuplePos->pageId;
int32_t offset = pTuplePos->offset;
- if (pTuplePos->pageId != -1 && pCtx->subsidiaries.num > 0) {
+ if (pTuplePos->pageId != -1) {
int32_t numOfCols = pCtx->subsidiaries.num;
SFilePage* pPage = getBufPage(pCtx->pBuf, pageId);
@@ -1934,7 +1940,7 @@ int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx) {
SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
- for(int32_t i = pInput->startRowIndex; i < pInput->startRowIndex + pInput->numOfRows; ++i) {
+ for (int32_t i = pInput->startRowIndex; i < pInput->startRowIndex + pInput->numOfRows; ++i) {
char* data = colDataGetData(pCol, i);
SStddevRes* pInputInfo = (SStddevRes*)varDataVal(data);
stddevTransferInfo(pInputInfo, pInfo);
@@ -2945,7 +2951,8 @@ int32_t firstLastFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
pResInfo->isNullRes = (pResInfo->numOfRes == 0) ? 1 : 0;
SFirstLastRes* pRes = GET_ROWCELL_INTERBUF(pResInfo);
- colDataAppend(pCol, pBlock->info.rows, pRes->buf, pResInfo->isNullRes);
+ colDataAppend(pCol, pBlock->info.rows, pRes->buf, pRes->isNull||pResInfo->isNullRes);
+
// handle selectivity
STuplePos* pTuplePos = (STuplePos*)(pRes->buf + pRes->bytes + sizeof(TSKEY));
setSelectivityValue(pCtx, pBlock, pTuplePos, pBlock->info.rows);
@@ -3454,9 +3461,16 @@ void doAddIntoResult(SqlFunctionCtx* pCtx, void* pData, int32_t rowIndex, SSData
}
}
+/*
+ * +------------------------------------+--------------+--------------+
+ * | null bitmap | | |
+ * |(n columns, one bit for each column)| src column #1| src column #2|
+ * +------------------------------------+--------------+--------------+
+ */
void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pSrcBlock, STuplePos* pPos) {
SFilePage* pPage = NULL;
+ // todo refactor: move away
int32_t completeRowSize = pCtx->subsidiaries.num * sizeof(bool);
for (int32_t j = 0; j < pCtx->subsidiaries.num; ++j) {
SqlFunctionCtx* pc = pCtx->subsidiaries.pCtx[j];
@@ -3469,12 +3483,15 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS
} else {
pPage = getBufPage(pCtx->pBuf, pCtx->curBufPage);
if (pPage->num + completeRowSize > getBufPageSize(pCtx->pBuf)) {
+ // current page is all used, let's prepare a new buffer page
+ releaseBufPage(pCtx->pBuf, pPage);
pPage = getNewBufPage(pCtx->pBuf, 0, &pCtx->curBufPage);
pPage->num = sizeof(SFilePage);
}
}
pPos->pageId = pCtx->curBufPage;
+ pPos->offset = pPage->num;
// keep the current row data, extract method
int32_t offset = 0;
@@ -3502,14 +3519,12 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS
offset += pCol->info.bytes;
}
- pPos->offset = pPage->num;
pPage->num += completeRowSize;
setBufPageDirty(pPage, true);
releaseBufPage(pCtx->pBuf, pPage);
#ifdef BUF_PAGE_DEBUG
- qDebug("page_saveTuple pos:%p,pageId:%d, offset:%d\n", pPos, pPos->pageId,
- pPos->offset);
+ qDebug("page_saveTuple pos:%p,pageId:%d, offset:%d\n", pPos, pPos->pageId, pPos->offset);
#endif
}
@@ -3810,7 +3825,7 @@ bool elapsedFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo
SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo);
pInfo->result = 0;
- pInfo->min = MAX_TS_KEY;
+ pInfo->min = TSKEY_MAX;
pInfo->max = 0;
if (pCtx->numOfParams > 1) {
@@ -3837,7 +3852,7 @@ int32_t elapsedFunction(SqlFunctionCtx* pCtx) {
}
if (pInput->colDataAggIsSet) {
- if (pInfo->min == MAX_TS_KEY) {
+ if (pInfo->min == TSKEY_MAX) {
pInfo->min = GET_INT64_VAL(&pAgg->min);
pInfo->max = GET_INT64_VAL(&pAgg->max);
} else {
@@ -4833,7 +4848,7 @@ static void doReservoirSample(SqlFunctionCtx* pCtx, SSampleInfo* pInfo, char* da
if (pInfo->numSampled < pInfo->samples) {
sampleAssignResult(pInfo, data, pInfo->numSampled);
if (pCtx->subsidiaries.num > 0) {
- saveTupleData(pCtx, index, pCtx->pSrcBlock, pInfo->tuplePos + pInfo->numSampled * sizeof(STuplePos));
+ saveTupleData(pCtx, index, pCtx->pSrcBlock, &pInfo->tuplePos[pInfo->numSampled]);
}
pInfo->numSampled++;
} else {
@@ -4841,7 +4856,7 @@ static void doReservoirSample(SqlFunctionCtx* pCtx, SSampleInfo* pInfo, char* da
if (j < pInfo->samples) {
sampleAssignResult(pInfo, data, j);
if (pCtx->subsidiaries.num > 0) {
- copyTupleData(pCtx, index, pCtx->pSrcBlock, pInfo->tuplePos + j * sizeof(STuplePos));
+ copyTupleData(pCtx, index, pCtx->pSrcBlock, &pInfo->tuplePos[j]);
}
}
}
@@ -4879,7 +4894,7 @@ int32_t sampleFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
int32_t currentRow = pBlock->info.rows;
for (int32_t i = 0; i < pInfo->numSampled; ++i) {
colDataAppend(pCol, currentRow + i, pInfo->data + i * pInfo->colBytes, false);
- setSelectivityValue(pCtx, pBlock, pInfo->tuplePos + i * sizeof(STuplePos), currentRow + i);
+ setSelectivityValue(pCtx, pBlock, &pInfo->tuplePos[i], currentRow + i);
}
return pInfo->numSampled;
@@ -5553,6 +5568,10 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, 0);
+ if (pData->totalRows == 0) {
+ pData->minRows = 0;
+ }
+
int32_t row = 0;
char st[256] = {0};
double totalRawSize = pData->totalRows * pData->rowSize;
@@ -5564,10 +5583,14 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
varDataSetLen(st, len);
colDataAppend(pColInfo, row++, st, false);
+ int64_t avgRows = 0;
+ if (pData->numOfBlocks > 0) {
+ avgRows = pData->totalRows / pData->numOfBlocks;
+ }
+
len = sprintf(st + VARSTR_HEADER_SIZE,
"Total_Rows=[%" PRId64 "] Inmem_Rows=[%d] MinRows=[%d] MaxRows=[%d] Average_Rows=[%" PRId64 "]",
- pData->totalRows, pData->numOfInmemRows, pData->minRows, pData->maxRows,
- pData->totalRows / pData->numOfBlocks);
+ pData->totalRows, pData->numOfInmemRows, pData->minRows, pData->maxRows, avgRows);
varDataSetLen(st, len);
colDataAppend(pColInfo, row++, st, false);
@@ -5984,28 +6007,31 @@ int32_t lastrowFunction(SqlFunctionCtx* pCtx) {
SInputColumnInfoData* pInput = &pCtx->input;
SColumnInfoData* pInputCol = pInput->pData[0];
- int32_t type = pInputCol->info.type;
+ int32_t type = pInputCol->info.type;
int32_t bytes = pInputCol->info.bytes;
+
pInfo->bytes = bytes;
+ // last_row function does not ignore the null value
for (int32_t i = pInput->numOfRows + pInput->startRowIndex - 1; i >= pInput->startRowIndex; --i) {
- if (pInputCol->hasNull && colDataIsNull_s(pInputCol, i)) {
- continue;
- }
-
numOfElems++;
char* data = colDataGetData(pInputCol, i);
TSKEY cts = getRowPTs(pInput->pPTS, i);
- if (pResInfo->numOfRes == 0 || *(TSKEY*)(pInfo->buf + bytes) < cts) {
- if (IS_VAR_DATA_TYPE(type)) {
- bytes = varDataTLen(data);
- pInfo->bytes = bytes;
- }
+ if (pResInfo->numOfRes == 0 || pInfo->ts < cts) {
+
+ if (colDataIsNull_s(pInputCol, i)) {
+ pInfo->isNull = true;
+ } else {
+ if (IS_VAR_DATA_TYPE(type)) {
+ bytes = varDataTLen(data);
+ pInfo->bytes = bytes;
+ }
- memcpy(pInfo->buf, data, bytes);
- *(TSKEY*)(pInfo->buf + bytes) = cts;
+ memcpy(pInfo->buf, data, bytes);
+ }
+ pInfo->ts = cts;
pInfo->hasResult = true;
pResInfo->numOfRes = 1;
diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c
index ed82654f7736dfa788605053a3fa9a875d15733a..f73a61fa60c971b78f32c5468b6eee8c3a7cf1d9 100644
--- a/source/libs/function/src/functionMgt.c
+++ b/source/libs/function/src/functionMgt.c
@@ -183,6 +183,8 @@ bool fmIsSystemInfoFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId,
bool fmIsImplicitTsFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_IMPLICIT_TS_FUNC); }
+bool fmIsClientPseudoColumnFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_CLIENT_PC_FUNC); }
+
bool fmIsInterpFunc(int32_t funcId) {
if (funcId < 0 || funcId >= funcMgtBuiltinsNum) {
return false;
@@ -227,8 +229,8 @@ bool fmIsInvertible(int32_t funcId) {
case FUNCTION_TYPE_SUM:
case FUNCTION_TYPE_STDDEV:
case FUNCTION_TYPE_AVG:
- case FUNCTION_TYPE_WSTARTTS:
- case FUNCTION_TYPE_WENDTS:
+ case FUNCTION_TYPE_WSTART:
+ case FUNCTION_TYPE_WEND:
case FUNCTION_TYPE_WDURATION:
res = true;
break;
diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c
index a412b589a9eb1163c80bb0677838b4d39070e25f..fd9b588d46d182742cfd7b8568257d375ee42942 100644
--- a/source/libs/function/src/udfd.c
+++ b/source/libs/function/src/udfd.c
@@ -296,8 +296,8 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
switch (call->callType) {
case TSDB_UDF_CALL_SCALA_PROC: {
- tDeleteSSDataBlock(&call->block);
- tDeleteSSDataBlock(&subRsp->resultData);
+ blockDataFreeRes(&call->block);
+ blockDataFreeRes(&subRsp->resultData);
break;
}
case TSDB_UDF_CALL_AGG_INIT: {
@@ -305,7 +305,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
break;
}
case TSDB_UDF_CALL_AGG_PROC: {
- tDeleteSSDataBlock(&call->block);
+ blockDataFreeRes(&call->block);
freeUdfInterBuf(&subRsp->resultBuf);
break;
}
diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c
index 6c0717e8450e5b5e3a5f5f07bcc29545035d7eb0..e7109b5a87aedd9024eb99376befe20e241e9c13 100644
--- a/source/libs/nodes/src/nodesCloneFuncs.c
+++ b/source/libs/nodes/src/nodesCloneFuncs.c
@@ -127,6 +127,7 @@ static int32_t valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) {
COPY_SCALAR_FIELD(isDuration);
COPY_SCALAR_FIELD(translate);
COPY_SCALAR_FIELD(notReserved);
+ COPY_SCALAR_FIELD(isNull);
COPY_SCALAR_FIELD(placeholderNo);
COPY_SCALAR_FIELD(typeData);
COPY_SCALAR_FIELD(unit);
diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c
index 3c285cc7f1d70123001d64976a29893c4894b0bb..a50df01d44794b1958cb6e95949e13733500176b 100644
--- a/source/libs/nodes/src/nodesCodeFuncs.c
+++ b/source/libs/nodes/src/nodesCodeFuncs.c
@@ -225,6 +225,8 @@ const char* nodesNodeName(ENodeType type) {
return "PhysiBlockDistScan";
case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN:
return "PhysiLastRowScan";
+ case QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN:
+ return "PhysiTableMergeScan";
case QUERY_NODE_PHYSICAL_PLAN_PROJECT:
return "PhysiProject";
case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN:
@@ -2712,6 +2714,7 @@ static const char* jkValueLiteral = "Literal";
static const char* jkValueDuration = "Duration";
static const char* jkValueTranslate = "Translate";
static const char* jkValueNotReserved = "NotReserved";
+static const char* jkValueIsNull = "IsNull";
static const char* jkValueDatum = "Datum";
static int32_t datumToJson(const void* pObj, SJson* pJson) {
@@ -2798,6 +2801,9 @@ static int32_t valueNodeToJson(const void* pObj, SJson* pJson) {
if (TSDB_CODE_SUCCESS == code) {
code = tjsonAddBoolToObject(pJson, jkValueNotReserved, pNode->notReserved);
}
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddBoolToObject(pJson, jkValueIsNull, pNode->isNull);
+ }
if (TSDB_CODE_SUCCESS == code && pNode->translate) {
code = datumToJson(pNode, pJson);
}
@@ -2945,6 +2951,9 @@ static int32_t jsonToValueNode(const SJson* pJson, void* pObj) {
if (TSDB_CODE_SUCCESS == code) {
code = tjsonGetBoolValue(pJson, jkValueNotReserved, &pNode->notReserved);
}
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetBoolValue(pJson, jkValueIsNull, &pNode->isNull);
+ }
if (TSDB_CODE_SUCCESS == code && pNode->translate) {
code = jsonToDatum(pJson, pNode);
}
diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c
index 4abb8f5c2c3732388cc36c65beb3c517c4e90d77..b00b08a66d4835f0a01fdde843582910b0ac8f3d 100644
--- a/source/libs/nodes/src/nodesUtilFuncs.c
+++ b/source/libs/nodes/src/nodesUtilFuncs.c
@@ -956,7 +956,6 @@ void nodesDestroyNode(SNode* pNode) {
}
case QUERY_NODE_PHYSICAL_SUBPLAN: {
SSubplan* pSubplan = (SSubplan*)pNode;
- // nodesDestroyList(pSubplan->pChildren);
nodesClearList(pSubplan->pChildren);
nodesDestroyNode((SNode*)pSubplan->pNode);
nodesDestroyNode((SNode*)pSubplan->pDataSink);
@@ -965,25 +964,9 @@ void nodesDestroyNode(SNode* pNode) {
nodesClearList(pSubplan->pParents);
break;
}
- case QUERY_NODE_PHYSICAL_PLAN: {
- SQueryPlan* pPlan = (SQueryPlan*)pNode;
- if (NULL != pPlan->pSubplans) {
- // only need to destroy the top-level subplans, because they will recurse to all the subplans below
- bool first = true;
- SNode* pElement = NULL;
- FOREACH(pElement, pPlan->pSubplans) {
- if (first) {
- // first = false;
- nodesDestroyNode(pElement);
- } else {
- nodesClearList(((SNodeListNode*)pElement)->pNodeList);
- taosMemoryFreeClear(pElement);
- }
- }
- nodesClearList(pPlan->pSubplans);
- }
+ case QUERY_NODE_PHYSICAL_PLAN:
+ nodesDestroyList(((SQueryPlan*)pNode)->pSubplans);
break;
- }
default:
break;
}
@@ -1709,6 +1692,11 @@ int32_t nodesGetOutputNumFromSlotList(SNodeList* pSlots) {
}
void nodesValueNodeToVariant(const SValueNode* pNode, SVariant* pVal) {
+ if (pNode->isNull) {
+ pVal->nType = TSDB_DATA_TYPE_NULL;
+ pVal->nLen = tDataTypes[TSDB_DATA_TYPE_NULL].bytes;
+ return;
+ }
pVal->nType = pNode->node.resType.type;
pVal->nLen = pNode->node.resType.bytes;
switch (pNode->node.resType.type) {
@@ -1789,7 +1777,7 @@ static EDealRes classifyConditionImpl(SNode* pNode, void* pContext) {
SClassifyConditionCxt* pCxt = (SClassifyConditionCxt*)pContext;
if (QUERY_NODE_COLUMN == nodeType(pNode)) {
SColumnNode* pCol = (SColumnNode*)pNode;
- if (PRIMARYKEY_TIMESTAMP_COL_ID == pCol->colId) {
+ if (PRIMARYKEY_TIMESTAMP_COL_ID == pCol->colId && TSDB_SYSTEM_TABLE != pCol->tableType) {
pCxt->hasPrimaryKey = true;
} else if (pCol->hasIndex) {
pCxt->hasTagIndexCol = true;
diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y
index 606d35a65bbbb60a2ae3900c0926398fb524d40d..ddde20e8e947f90d387fa3a1048a40b1a13bf215 100644
--- a/source/libs/parser/inc/sql.y
+++ b/source/libs/parser/inc/sql.y
@@ -520,7 +520,9 @@ cmd ::= DELETE FROM full_table_name(A) where_clause_opt(B).
cmd ::= query_expression(A). { pCxt->pRootNode = A; }
/************************************************ insert **************************************************************/
-cmd ::= INSERT INTO full_table_name(A) specific_cols_opt(B) query_expression(C). { pCxt->pRootNode = createInsertStmt(pCxt, A, B, C); }
+cmd ::= INSERT INTO full_table_name(A)
+ NK_LP col_name_list(B) NK_RP query_expression(C). { pCxt->pRootNode = createInsertStmt(pCxt, A, B, C); }
+cmd ::= INSERT INTO full_table_name(A) query_expression(B). { pCxt->pRootNode = createInsertStmt(pCxt, A, NULL, B); }
/************************************************ literal *************************************************************/
literal(A) ::= NK_INTEGER(B). { A = createRawExprNode(pCxt, &B, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &B)); }
@@ -675,10 +677,11 @@ column_reference(A) ::= table_name(B) NK_DOT column_name(C).
pseudo_column(A) ::= ROWTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= TBNAME(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= table_name(B) NK_DOT TBNAME(C). { A = createRawExprNodeExt(pCxt, &B, &C, createFunctionNode(pCxt, &C, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B)))); }
-pseudo_column(A) ::= QSTARTTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
-pseudo_column(A) ::= QENDTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
-pseudo_column(A) ::= WSTARTTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
-pseudo_column(A) ::= WENDTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
+pseudo_column(A) ::= QSTART(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
+pseudo_column(A) ::= QEND(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
+pseudo_column(A) ::= QDURATION(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
+pseudo_column(A) ::= WSTART(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
+pseudo_column(A) ::= WEND(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= WDURATION(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
function_expression(A) ::= function_name(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); }
diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c
index c60e5541e06fa2aa2abf8543059f2ec1026cdc82..a7806f5e34613170b2e5069810524258314ed758 100644
--- a/source/libs/parser/src/parAstCreater.c
+++ b/source/libs/parser/src/parAstCreater.c
@@ -598,7 +598,7 @@ SNode* createFillNode(SAstCreateContext* pCxt, EFillMode mode, SNode* pValues) {
nodesDestroyNode((SNode*)fill);
CHECK_OUT_OF_MEM(fill->pWStartTs);
}
- strcpy(((SFunctionNode*)fill->pWStartTs)->functionName, "_wstartts");
+ strcpy(((SFunctionNode*)fill->pWStartTs)->functionName, "_wstart");
return (SNode*)fill;
}
@@ -740,6 +740,7 @@ SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pPr
select->pFromTable = pTable;
sprintf(select->stmtName, "%p", select);
select->isTimeLineResult = true;
+ select->timeRange = TSWINDOW_INITIALIZER;
return (SNode*)select;
}
diff --git a/source/libs/parser/src/parCalcConst.c b/source/libs/parser/src/parCalcConst.c
index 4dff42592a56a5233a3ad6db5dad71a72c0e3e57..68a60e0b35f54a2a12a7cb9b5e1c506f8b6a2a7b 100644
--- a/source/libs/parser/src/parCalcConst.c
+++ b/source/libs/parser/src/parCalcConst.c
@@ -166,7 +166,7 @@ static int32_t calcConstStmtCondition(SCalcConstContext* pCxt, SNode** pCond, bo
return code;
}
-static int32_t calcConstProject(SNode* pProject, SNode** pNew) {
+static int32_t calcConstProject(SNode* pProject, bool dual, SNode** pNew) {
SArray* pAssociation = NULL;
if (NULL != ((SExprNode*)pProject)->pAssociation) {
pAssociation = taosArrayDup(((SExprNode*)pProject)->pAssociation);
@@ -177,7 +177,12 @@ static int32_t calcConstProject(SNode* pProject, SNode** pNew) {
char aliasName[TSDB_COL_NAME_LEN] = {0};
strcpy(aliasName, ((SExprNode*)pProject)->aliasName);
- int32_t code = scalarCalculateConstants(pProject, pNew);
+ int32_t code = TSDB_CODE_SUCCESS;
+ if (dual) {
+ code = scalarCalculateConstantsFromDual(pProject, pNew);
+ } else {
+ code = scalarCalculateConstants(pProject, pNew);
+ }
if (TSDB_CODE_SUCCESS == code && QUERY_NODE_VALUE == nodeType(*pNew) && NULL != pAssociation) {
strcpy(((SExprNode*)*pNew)->aliasName, aliasName);
int32_t size = taosArrayGetSize(pAssociation);
@@ -218,12 +223,12 @@ static SNode* createConstantValue() {
static int32_t calcConstProjections(SCalcConstContext* pCxt, SSelectStmt* pSelect, bool subquery) {
SNode* pProj = NULL;
WHERE_EACH(pProj, pSelect->pProjectionList) {
- if (subquery && isUselessCol((SExprNode*)pProj)) {
+ if (subquery && !pSelect->isDistinct && isUselessCol((SExprNode*)pProj)) {
ERASE_NODE(pSelect->pProjectionList);
continue;
}
SNode* pNew = NULL;
- int32_t code = calcConstProject(pProj, &pNew);
+ int32_t code = calcConstProject(pProj, (NULL == pSelect->pFromTable), &pNew);
if (TSDB_CODE_SUCCESS == code) {
REPLACE_NODE(pNew);
} else {
diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c
index f986d24a7e12b1d6413d28a7f761107e32b7335a..005a7f919a82a19dd8b7e0a59e963303c3b61ee3 100644
--- a/source/libs/parser/src/parInsert.c
+++ b/source/libs/parser/src/parInsert.c
@@ -71,6 +71,7 @@ typedef struct SInsertParseContext {
SVnodeModifOpStmt* pOutput;
SStmtCallback* pStmtCb;
SParseMetaCache* pMetaCache;
+ char sTableName[TSDB_TABLE_NAME_LEN];
} SInsertParseContext;
typedef struct SInsertParseSyntaxCxt {
@@ -734,11 +735,13 @@ static int32_t parseBoundColumns(SInsertParseContext* pCxt, SParsedDataColInfo*
return TSDB_CODE_SUCCESS;
}
-static void buildCreateTbReq(SVCreateTbReq* pTbReq, const char* tname, STag* pTag, int64_t suid) {
+static void buildCreateTbReq(SVCreateTbReq* pTbReq, const char* tname, STag* pTag, int64_t suid, const char* sname, SArray* tagName) {
pTbReq->type = TD_CHILD_TABLE;
pTbReq->name = strdup(tname);
pTbReq->ctb.suid = suid;
+ if(sname) pTbReq->ctb.name = strdup(sname);
pTbReq->ctb.pTag = (uint8_t*)pTag;
+ pTbReq->ctb.tagName = taosArrayDup(tagName);
pTbReq->commentLen = -1;
return;
@@ -758,6 +761,7 @@ static int32_t parseTagToken(char** end, SToken* pToken, SSchema* pSchema, int16
return TSDB_CODE_SUCCESS;
}
+// strcpy(val->colName, pSchema->name);
val->cid = pSchema->colId;
val->type = pSchema->type;
@@ -936,6 +940,7 @@ static int32_t parseTagToken(char** end, SToken* pToken, SSchema* pSchema, int16
static int32_t parseTagsClause(SInsertParseContext* pCxt, SSchema* pSchema, uint8_t precision, const char* tName) {
int32_t code = TSDB_CODE_SUCCESS;
SArray* pTagVals = taosArrayInit(pCxt->tags.numOfBound, sizeof(STagVal));
+ SArray* tagName = taosArrayInit(8, TSDB_COL_NAME_LEN);
SToken sToken;
bool isParseBindParam = false;
bool isJson = false;
@@ -965,6 +970,10 @@ static int32_t parseTagsClause(SInsertParseContext* pCxt, SSchema* pSchema, uint
taosMemoryFree(tmpTokenBuf);
goto end;
}
+
+ if (!isNullStr(&sToken)) {
+ taosArrayPush(tagName, pTagSchema->name);
+ }
if (pTagSchema->type == TSDB_DATA_TYPE_JSON) {
if (sToken.n > (TSDB_MAX_JSON_TAG_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) {
code = buildSyntaxErrMsg(&pCxt->msg, "json string too long than 4095", sToken.z);
@@ -1004,7 +1013,7 @@ static int32_t parseTagsClause(SInsertParseContext* pCxt, SSchema* pSchema, uint
goto end;
}
- buildCreateTbReq(&pCxt->createTblReq, tName, pTag, pCxt->pTableMeta->suid);
+ buildCreateTbReq(&pCxt->createTblReq, tName, pTag, pCxt->pTableMeta->suid, pCxt->sTableName, tagName);
end:
for (int i = 0; i < taosArrayGetSize(pTagVals); ++i) {
@@ -1014,6 +1023,7 @@ end:
}
}
taosArrayDestroy(pTagVals);
+ taosArrayDestroy(tagName);
return code;
}
@@ -1089,6 +1099,7 @@ static int32_t parseUsingClause(SInsertParseContext* pCxt, SName* name, char* tb
createSName(&sname, &sToken, pCxt->pComCxt->acctId, pCxt->pComCxt->db, &pCxt->msg);
char dbFName[TSDB_DB_FNAME_LEN];
tNameGetFullDbName(&sname, dbFName);
+ strcpy(pCxt->sTableName, sname.tname);
CHECK_CODE(getSTableMeta(pCxt, &sname, dbFName));
if (TSDB_SUPER_TABLE != pCxt->pTableMeta->tableType) {
@@ -1325,15 +1336,10 @@ static int32_t parseDataFromFile(SInsertParseContext* pCxt, SToken filePath, STa
return TSDB_CODE_SUCCESS;
}
-void destroyCreateSubTbReq(SVCreateTbReq* pReq) {
- taosMemoryFreeClear(pReq->name);
- taosMemoryFreeClear(pReq->ctb.pTag);
-}
-
static void destroyInsertParseContextForTable(SInsertParseContext* pCxt) {
taosMemoryFreeClear(pCxt->pTableMeta);
destroyBoundColumnInfo(&pCxt->tags);
- destroyCreateSubTbReq(&pCxt->createTblReq);
+ tdDestroySVCreateTbReq(&pCxt->createTblReq);
}
static void destroySubTableHashElem(void* p) { taosMemoryFree(*(STableMeta**)p); }
@@ -1479,7 +1485,7 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
}
memcpy(tags, &pCxt->tags, sizeof(pCxt->tags));
(*pCxt->pStmtCb->setInfoFn)(pCxt->pStmtCb->pStmt, pCxt->pTableMeta, tags, tbFName, autoCreateTbl,
- pCxt->pVgroupsHashObj, pCxt->pTableBlockHashObj);
+ pCxt->pVgroupsHashObj, pCxt->pTableBlockHashObj, pCxt->sTableName);
memset(&pCxt->tags, 0, sizeof(pCxt->tags));
pCxt->pVgroupsHashObj = NULL;
@@ -1508,6 +1514,7 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery, SParseMetaCache
.pSql = (char*)pContext->pSql,
.msg = {.buf = pContext->pMsg, .len = pContext->msgLen},
.pTableMeta = NULL,
+ .createTblReq = {0},
.pSubTableHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK),
.pTableNameHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK),
.pDbFNameHashObj = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK),
@@ -1788,7 +1795,7 @@ int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash
return TSDB_CODE_SUCCESS;
}
-int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, char* tName, TAOS_MULTI_BIND* bind,
+int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const char* sTableName, char* tName, TAOS_MULTI_BIND* bind,
char* msgBuf, int32_t msgBufLen) {
STableDataBlocks* pDataBlock = (STableDataBlocks*)pBlock;
SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen};
@@ -1802,6 +1809,11 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, char* tN
return buildInvalidOperationMsg(&pBuf, "out of memory");
}
+ SArray* tagName = taosArrayInit(8, TSDB_COL_NAME_LEN);
+ if (!tagName) {
+ return buildInvalidOperationMsg(&pBuf, "out of memory");
+ }
+
int32_t code = TSDB_CODE_SUCCESS;
SSchema* pSchema = getTableTagSchema(pDataBlock->pTableMeta);
@@ -1818,6 +1830,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, char* tN
if (IS_VAR_DATA_TYPE(pTagSchema->type)) {
colLen = bind[c].length[0];
}
+ taosArrayPush(tagName, pTagSchema->name);
if (pTagSchema->type == TSDB_DATA_TYPE_JSON) {
if (colLen > (TSDB_MAX_JSON_TAG_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) {
code = buildSyntaxErrMsg(&pBuf, "json string too long than 4095", bind[c].buffer);
@@ -1834,6 +1847,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, char* tN
}
} else {
STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type};
+// strcpy(val.colName, pTagSchema->name);
if (pTagSchema->type == TSDB_DATA_TYPE_BINARY) {
val.pData = (uint8_t*)bind[c].buffer;
val.nData = colLen;
@@ -1870,9 +1884,9 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, char* tN
}
SVCreateTbReq tbReq = {0};
- buildCreateTbReq(&tbReq, tName, pTag, suid);
+ buildCreateTbReq(&tbReq, tName, pTag, suid, sTableName, tagName);
code = buildCreateTbMsg(pDataBlock, &tbReq);
- destroyCreateSubTbReq(&tbReq);
+ tdDestroySVCreateTbReq(&tbReq);
end:
for (int i = 0; i < taosArrayGetSize(pTagArray); ++i) {
@@ -1882,6 +1896,7 @@ end:
}
}
taosArrayDestroy(pTagArray);
+ taosArrayDestroy(tagName);
return code;
}
@@ -2136,7 +2151,7 @@ typedef struct SmlExecHandle {
static void smlDestroyTableHandle(void* pHandle) {
SmlExecTableHandle* handle = (SmlExecTableHandle*)pHandle;
destroyBoundColumnInfo(&handle->tags);
- destroyCreateSubTbReq(&handle->createTblReq);
+ tdDestroySVCreateTbReq(&handle->createTblReq);
}
static int32_t smlBoundColumnData(SArray* cols, SParsedDataColInfo* pColList, SSchema* pSchema) {
@@ -2222,18 +2237,24 @@ static int32_t smlBoundColumnData(SArray* cols, SParsedDataColInfo* pColList, SS
* @param msg
* @return int32_t
*/
-static int32_t smlBuildTagRow(SArray* cols, SParsedDataColInfo* tags, SSchema* pSchema, STag** ppTag, SMsgBuf* msg) {
+static int32_t smlBuildTagRow(SArray* cols, SParsedDataColInfo* tags, SSchema* pSchema, STag** ppTag, SArray** tagName, SMsgBuf* msg) {
SArray* pTagArray = taosArrayInit(tags->numOfBound, sizeof(STagVal));
if (!pTagArray) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
+ *tagName = taosArrayInit(8, TSDB_COL_NAME_LEN);
+ if (!*tagName) {
+ return TSDB_CODE_TSC_OUT_OF_MEMORY;
+ }
int32_t code = TSDB_CODE_SUCCESS;
for (int i = 0; i < tags->numOfBound; ++i) {
SSchema* pTagSchema = &pSchema[tags->boundColumns[i]];
SSmlKv* kv = taosArrayGetP(cols, i);
+ taosArrayPush(*tagName, pTagSchema->name);
STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type};
+// strcpy(val.colName, pTagSchema->name);
if (pTagSchema->type == TSDB_DATA_TYPE_BINARY) {
val.pData = (uint8_t*)kv->value;
val.nData = kv->length;
@@ -2277,7 +2298,7 @@ end:
}
int32_t smlBindData(void* handle, SArray* tags, SArray* colsSchema, SArray* cols, bool format, STableMeta* pTableMeta,
- char* tableName, char* msgBuf, int16_t msgBufLen) {
+ char* tableName, const char* sTableName, int32_t sTableNameLen, char* msgBuf, int16_t msgBufLen) {
SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen};
SSmlExecHandle* smlHandle = (SSmlExecHandle*)handle;
@@ -2290,12 +2311,19 @@ int32_t smlBindData(void* handle, SArray* tags, SArray* colsSchema, SArray* cols
return ret;
}
STag* pTag = NULL;
- ret = smlBuildTagRow(tags, &smlHandle->tableExecHandle.tags, pTagsSchema, &pTag, &pBuf);
+ SArray* tagName = NULL;
+ ret = smlBuildTagRow(tags, &smlHandle->tableExecHandle.tags, pTagsSchema, &pTag, &tagName, &pBuf);
if (ret != TSDB_CODE_SUCCESS) {
+ taosArrayDestroy(tagName);
return ret;
}
- buildCreateTbReq(&smlHandle->tableExecHandle.createTblReq, tableName, pTag, pTableMeta->suid);
+ buildCreateTbReq(&smlHandle->tableExecHandle.createTblReq, tableName, pTag, pTableMeta->suid, NULL, tagName);
+ taosArrayDestroy(tagName);
+
+ smlHandle->tableExecHandle.createTblReq.ctb.name = taosMemoryMalloc(sTableNameLen + 1);
+ memcpy(smlHandle->tableExecHandle.createTblReq.ctb.name, sTableName, sTableNameLen);
+ smlHandle->tableExecHandle.createTblReq.ctb.name[sTableNameLen] = 0;
STableDataBlocks* pDataBlock = NULL;
ret = getDataBlockFromList(smlHandle->pBlockHash, &pTableMeta->uid, sizeof(pTableMeta->uid),
diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c
index 58f6354402b94c265e2e0850581c5fe1abe7fb7f..0d176cef0951b757496c613b7c50b7a0bb7264b3 100644
--- a/source/libs/parser/src/parTokenizer.c
+++ b/source/libs/parser/src/parTokenizer.c
@@ -240,12 +240,13 @@ static SKeyword keywordTable[] = {
{"WITH", TK_WITH},
{"WRITE", TK_WRITE},
{"_C0", TK_ROWTS},
- {"_QENDTS", TK_QENDTS},
- {"_QSTARTTS", TK_QSTARTTS},
+ {"_QDURATION", TK_QDURATION},
+ {"_QEND", TK_QEND},
+ {"_QSTART", TK_QSTART},
{"_ROWTS", TK_ROWTS},
{"_WDURATION", TK_WDURATION},
- {"_WENDTS", TK_WENDTS},
- {"_WSTARTTS", TK_WSTARTTS},
+ {"_WEND", TK_WEND},
+ {"_WSTART", TK_WSTART},
// {"ID", TK_ID},
// {"STRING", TK_STRING},
// {"EQ", TK_EQ},
diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c
index da393bb883f6ed32fd425b96dbc7824c4b92df72..d108e86df15f5e63d8b513953e86264bf743ce23 100644
--- a/source/libs/parser/src/parTranslater.c
+++ b/source/libs/parser/src/parTranslater.c
@@ -496,7 +496,7 @@ static bool isPrimaryKeyImpl(SNode* pExpr) {
SFunctionNode* pFunc = (SFunctionNode*)pExpr;
if (FUNCTION_TYPE_SELECT_VALUE == pFunc->funcType) {
return isPrimaryKeyImpl(nodesListGetNode(pFunc->pParameterList, 0));
- } else if (FUNCTION_TYPE_WSTARTTS == pFunc->funcType || FUNCTION_TYPE_WENDTS == pFunc->funcType) {
+ } else if (FUNCTION_TYPE_WSTART == pFunc->funcType || FUNCTION_TYPE_WEND == pFunc->funcType) {
return true;
}
}
@@ -916,8 +916,6 @@ static EDealRes translateValueImpl(STranslateContext* pCxt, SValueNode* pVal, SD
}
if (TSDB_DATA_TYPE_NULL == pVal->node.resType.type) {
- // TODO
- // pVal->node.resType = targetDt;
pVal->translate = true;
pVal->isNull = true;
return DEAL_RES_CONTINUE;
@@ -932,6 +930,7 @@ static EDealRes translateValueImpl(STranslateContext* pCxt, SValueNode* pVal, SD
res = translateNormalValue(pCxt, pVal, targetDt, strict);
}
pVal->node.resType = targetDt;
+ pVal->node.resType.scale = pVal->unit;
pVal->translate = true;
return res;
}
@@ -1198,7 +1197,7 @@ static void setFuncClassification(SNode* pCurrStmt, SFunctionNode* pFunc) {
}
}
-static int32_t rewriteSystemInfoFuncImpl(STranslateContext* pCxt, char* pLiteral, SNode** pNode) {
+static int32_t rewriteFuncToValue(STranslateContext* pCxt, char* pLiteral, SNode** pNode) {
SValueNode* pVal = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE);
if (NULL == pVal) {
return TSDB_CODE_OUT_OF_MEMORY;
@@ -1229,7 +1228,7 @@ static int32_t rewriteDatabaseFunc(STranslateContext* pCxt, SNode** pNode) {
return TSDB_CODE_OUT_OF_MEMORY;
}
}
- return rewriteSystemInfoFuncImpl(pCxt, pCurrDb, pNode);
+ return rewriteFuncToValue(pCxt, pCurrDb, pNode);
}
static int32_t rewriteClentVersionFunc(STranslateContext* pCxt, SNode** pNode) {
@@ -1237,7 +1236,7 @@ static int32_t rewriteClentVersionFunc(STranslateContext* pCxt, SNode** pNode) {
if (NULL == pVer) {
return TSDB_CODE_OUT_OF_MEMORY;
}
- return rewriteSystemInfoFuncImpl(pCxt, pVer, pNode);
+ return rewriteFuncToValue(pCxt, pVer, pNode);
}
static int32_t rewriteServerVersionFunc(STranslateContext* pCxt, SNode** pNode) {
@@ -1245,7 +1244,7 @@ static int32_t rewriteServerVersionFunc(STranslateContext* pCxt, SNode** pNode)
if (NULL == pVer) {
return TSDB_CODE_OUT_OF_MEMORY;
}
- return rewriteSystemInfoFuncImpl(pCxt, pVer, pNode);
+ return rewriteFuncToValue(pCxt, pVer, pNode);
}
static int32_t rewriteServerStatusFunc(STranslateContext* pCxt, SNode** pNode) {
@@ -1253,7 +1252,7 @@ static int32_t rewriteServerStatusFunc(STranslateContext* pCxt, SNode** pNode) {
return TSDB_CODE_RPC_NETWORK_UNAVAIL;
}
char* pStatus = taosMemoryStrDup((void*)"1");
- return rewriteSystemInfoFuncImpl(pCxt, pStatus, pNode);
+ return rewriteFuncToValue(pCxt, pStatus, pNode);
}
static int32_t rewriteUserFunc(STranslateContext* pCxt, SNode** pNode) {
@@ -1264,7 +1263,7 @@ static int32_t rewriteUserFunc(STranslateContext* pCxt, SNode** pNode) {
if (NULL == pUserConn) {
return TSDB_CODE_OUT_OF_MEMORY;
}
- return rewriteSystemInfoFuncImpl(pCxt, pUserConn, pNode);
+ return rewriteFuncToValue(pCxt, pUserConn, pNode);
}
static int32_t rewriteSystemInfoFunc(STranslateContext* pCxt, SNode** pNode) {
@@ -1318,10 +1317,60 @@ static int32_t translateNoramlFunction(STranslateContext* pCxt, SFunctionNode* p
return code;
}
+static int32_t rewriteQueryTimeFunc(STranslateContext* pCxt, int64_t val, SNode** pNode) {
+ if (INT64_MIN == val || INT64_MAX == val) {
+ return rewriteFuncToValue(pCxt, NULL, pNode);
+ }
+
+ char* pStr = taosMemoryCalloc(1, 20);
+ if (NULL == pStr) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ snprintf(pStr, 20, "%" PRId64 "", val);
+ return rewriteFuncToValue(pCxt, pStr, pNode);
+}
+
+static int32_t rewriteQstartFunc(STranslateContext* pCxt, SNode** pNode) {
+ return rewriteQueryTimeFunc(pCxt, ((SSelectStmt*)pCxt->pCurrStmt)->timeRange.skey, pNode);
+}
+
+static int32_t rewriteQendFunc(STranslateContext* pCxt, SNode** pNode) {
+ return rewriteQueryTimeFunc(pCxt, ((SSelectStmt*)pCxt->pCurrStmt)->timeRange.ekey, pNode);
+}
+
+static int32_t rewriteQdurationFunc(STranslateContext* pCxt, SNode** pNode) {
+ STimeWindow range = ((SSelectStmt*)pCxt->pCurrStmt)->timeRange;
+ if (INT64_MIN == range.skey || INT64_MAX == range.ekey) {
+ return rewriteQueryTimeFunc(pCxt, INT64_MIN, pNode);
+ }
+ return rewriteQueryTimeFunc(pCxt, range.ekey - range.skey + 1, pNode);
+}
+
+static int32_t rewriteClientPseudoColumnFunc(STranslateContext* pCxt, SNode** pNode) {
+ if (NULL == pCxt->pCurrStmt || QUERY_NODE_SELECT_STMT != nodeType(pCxt->pCurrStmt) ||
+ pCxt->currClause <= SQL_CLAUSE_WHERE) {
+ return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC, "Illegal pseudo column");
+ }
+ switch (((SFunctionNode*)*pNode)->funcType) {
+ case FUNCTION_TYPE_QSTART:
+ return rewriteQstartFunc(pCxt, pNode);
+ case FUNCTION_TYPE_QEND:
+ return rewriteQendFunc(pCxt, pNode);
+ case FUNCTION_TYPE_QDURATION:
+ return rewriteQdurationFunc(pCxt, pNode);
+ default:
+ break;
+ }
+ return TSDB_CODE_PAR_INTERNAL_ERROR;
+}
+
static int32_t translateFunctionImpl(STranslateContext* pCxt, SFunctionNode** pFunc) {
if (fmIsSystemInfoFunc((*pFunc)->funcId)) {
return rewriteSystemInfoFunc(pCxt, (SNode**)pFunc);
}
+ if (fmIsClientPseudoColumnFunc((*pFunc)->funcId)) {
+ return rewriteClientPseudoColumnFunc(pCxt, (SNode**)pFunc);
+ }
return translateNoramlFunction(pCxt, *pFunc);
}
@@ -2078,7 +2127,7 @@ static int32_t getTimeRange(SNode** pPrimaryKeyCond, STimeWindow* pTimeRange, bo
return code;
}
-static int32_t getFillTimeRange(STranslateContext* pCxt, SNode* pWhere, STimeWindow* pTimeRange) {
+static int32_t getQueryTimeRange(STranslateContext* pCxt, SNode* pWhere, STimeWindow* pTimeRange) {
if (NULL == pWhere) {
*pTimeRange = TSWINDOW_INITIALIZER;
return TSDB_CODE_SUCCESS;
@@ -2139,16 +2188,13 @@ static int32_t checkFill(STranslateContext* pCxt, SFillNode* pFill, SValueNode*
return TSDB_CODE_SUCCESS;
}
-static int32_t translateFill(STranslateContext* pCxt, SNode* pWhere, SIntervalWindowNode* pInterval) {
+static int32_t translateFill(STranslateContext* pCxt, SSelectStmt* pSelect, SIntervalWindowNode* pInterval) {
if (NULL == pInterval->pFill) {
return TSDB_CODE_SUCCESS;
}
- int32_t code = getFillTimeRange(pCxt, pWhere, &(((SFillNode*)pInterval->pFill)->timeRange));
- if (TSDB_CODE_SUCCESS == code) {
- code = checkFill(pCxt, (SFillNode*)pInterval->pFill, (SValueNode*)pInterval->pInterval);
- }
- return code;
+ ((SFillNode*)pInterval->pFill)->timeRange = pSelect->timeRange;
+ return checkFill(pCxt, (SFillNode*)pInterval->pFill, (SValueNode*)pInterval->pInterval);
}
static int64_t getMonthsFromTimeVal(int64_t val, int32_t fromPrecision, char unit) {
@@ -2235,7 +2281,7 @@ static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode*
static int32_t translateIntervalWindow(STranslateContext* pCxt, SSelectStmt* pSelect, SIntervalWindowNode* pInterval) {
int32_t code = checkIntervalWindow(pCxt, pInterval);
if (TSDB_CODE_SUCCESS == code) {
- code = translateFill(pCxt, pSelect->pWhere, pInterval);
+ code = translateFill(pCxt, pSelect, pInterval);
}
return code;
}
@@ -2330,7 +2376,7 @@ static int32_t translateInterpFill(STranslateContext* pCxt, SSelectStmt* pSelect
code = translateExpr(pCxt, &pSelect->pFill);
}
if (TSDB_CODE_SUCCESS == code) {
- code = getFillTimeRange(pCxt, pSelect->pRange, &(((SFillNode*)pSelect->pFill)->timeRange));
+ code = getQueryTimeRange(pCxt, pSelect->pRange, &(((SFillNode*)pSelect->pFill)->timeRange));
}
if (TSDB_CODE_SUCCESS == code) {
code = checkFill(pCxt, (SFillNode*)pSelect->pFill, (SValueNode*)pSelect->pEvery);
@@ -2362,9 +2408,13 @@ static int32_t translatePartitionBy(STranslateContext* pCxt, SNodeList* pPartiti
return translateExprList(pCxt, pPartitionByList);
}
-static int32_t translateWhere(STranslateContext* pCxt, SNode** pWhere) {
+static int32_t translateWhere(STranslateContext* pCxt, SSelectStmt* pSelect) {
pCxt->currClause = SQL_CLAUSE_WHERE;
- return translateExpr(pCxt, pWhere);
+ int32_t code = translateExpr(pCxt, &pSelect->pWhere);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = getQueryTimeRange(pCxt, pSelect->pWhere, &pSelect->timeRange);
+ }
+ return code;
}
static int32_t translateFrom(STranslateContext* pCxt, SNode* pTable) {
@@ -2495,7 +2545,7 @@ static int32_t translateSelectFrom(STranslateContext* pCxt, SSelectStmt* pSelect
int32_t code = translateFrom(pCxt, pSelect->pFromTable);
if (TSDB_CODE_SUCCESS == code) {
pSelect->precision = ((STableNode*)pSelect->pFromTable)->precision;
- code = translateWhere(pCxt, &pSelect->pWhere);
+ code = translateWhere(pCxt, pSelect);
}
if (TSDB_CODE_SUCCESS == code) {
code = translatePartitionBy(pCxt, pSelect->pPartitionByList);
@@ -2681,7 +2731,8 @@ static int32_t partitionDeleteWhere(STranslateContext* pCxt, SDeleteStmt* pDelet
}
static int32_t translateDeleteWhere(STranslateContext* pCxt, SDeleteStmt* pDelete) {
- int32_t code = translateWhere(pCxt, &pDelete->pWhere);
+ pCxt->currClause = SQL_CLAUSE_WHERE;
+ int32_t code = translateExpr(pCxt, &pDelete->pWhere);
if (TSDB_CODE_SUCCESS == code) {
code = partitionDeleteWhere(pCxt, pDelete);
}
@@ -3508,7 +3559,7 @@ static int32_t buildSampleAst(STranslateContext* pCxt, SSampleAstInfo* pInfo, ch
nodesDestroyNode((SNode*)pSelect);
return TSDB_CODE_OUT_OF_MEMORY;
}
- strcpy(pFunc->functionName, "_wstartts");
+ strcpy(pFunc->functionName, "_wstart");
nodesListPushFront(pSelect->pProjectionList, (SNode*)pFunc);
SNode* pProject = NULL;
FOREACH(pProject, pSelect->pProjectionList) { sprintf(((SExprNode*)pProject)->aliasName, "#%p", pProject); }
@@ -3703,6 +3754,9 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm
pReq->delay2 = pStmt->pOptions->maxDelay2;
pReq->watermark1 = pStmt->pOptions->watermark1;
pReq->watermark2 = pStmt->pOptions->watermark2;
+ pReq->colVer = 1;
+ pReq->tagVer = 1;
+ pReq->source = TD_REQ_FROM_APP;
columnDefNodeToField(pStmt->pCols, &pReq->pColumns);
columnDefNodeToField(pStmt->pTags, &pReq->pTags);
pReq->numOfColumns = LIST_LENGTH(pStmt->pCols);
@@ -4334,14 +4388,14 @@ static int32_t addWstartTsToCreateStreamQuery(SNode* pStmt) {
SSelectStmt* pSelect = (SSelectStmt*)pStmt;
SNode* pProj = nodesListGetNode(pSelect->pProjectionList, 0);
if (NULL == pSelect->pWindow ||
- (QUERY_NODE_FUNCTION == nodeType(pProj) && 0 == strcmp("_wstartts", ((SFunctionNode*)pProj)->functionName))) {
+ (QUERY_NODE_FUNCTION == nodeType(pProj) && 0 == strcmp("_wstart", ((SFunctionNode*)pProj)->functionName))) {
return TSDB_CODE_SUCCESS;
}
SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION);
if (NULL == pFunc) {
return TSDB_CODE_OUT_OF_MEMORY;
}
- strcpy(pFunc->functionName, "_wstartts");
+ strcpy(pFunc->functionName, "_wstart");
strcpy(pFunc->node.aliasName, pFunc->functionName);
int32_t code = nodesListPushFront(pSelect->pProjectionList, (SNode*)pFunc);
if (TSDB_CODE_SUCCESS != code) {
@@ -4757,8 +4811,13 @@ static int32_t extractQueryResultSchema(const SNodeList* pProjections, int32_t*
int32_t index = 0;
FOREACH(pNode, pProjections) {
SExprNode* pExpr = (SExprNode*)pNode;
- (*pSchema)[index].type = pExpr->resType.type;
- (*pSchema)[index].bytes = pExpr->resType.bytes;
+ if (TSDB_DATA_TYPE_NULL == pExpr->resType.type) {
+ (*pSchema)[index].type = TSDB_DATA_TYPE_VARCHAR;
+ (*pSchema)[index].bytes = 0;
+ } else {
+ (*pSchema)[index].type = pExpr->resType.type;
+ (*pSchema)[index].bytes = pExpr->resType.bytes;
+ }
(*pSchema)[index].colId = index + 1;
if ('\0' != pExpr->userAlias[0]) {
strcpy((*pSchema)[index].name, pExpr->userAlias);
@@ -5281,6 +5340,8 @@ static void destroyCreateTbReqBatch(void* data) {
taosMemoryFreeClear(pTableReq->ntb.schemaRow.pSchema);
} else if (pTableReq->type == TSDB_CHILD_TABLE) {
taosMemoryFreeClear(pTableReq->ctb.pTag);
+ taosMemoryFreeClear(pTableReq->ctb.name);
+ taosArrayDestroy(pTableReq->ctb.tagName);
}
}
@@ -5352,11 +5413,11 @@ static int32_t rewriteCreateTable(STranslateContext* pCxt, SQuery* pQuery) {
}
static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, SCreateSubTableClause* pStmt,
- const STag* pTag, uint64_t suid, SVgroupInfo* pVgInfo) {
- // char dbFName[TSDB_DB_FNAME_LEN] = {0};
- // SName name = {.type = TSDB_DB_NAME_T, .acctId = acctId};
- // strcpy(name.dbname, pStmt->dbName);
- // tNameGetFullDbName(&name, dbFName);
+ const STag* pTag, uint64_t suid, const char* sTableNmae, SVgroupInfo* pVgInfo, SArray* tagName) {
+// char dbFName[TSDB_DB_FNAME_LEN] = {0};
+// SName name = {.type = TSDB_DB_NAME_T, .acctId = acctId};
+// strcpy(name.dbname, pStmt->dbName);
+// tNameGetFullDbName(&name, dbFName);
struct SVCreateTbReq req = {0};
req.type = TD_CHILD_TABLE;
@@ -5369,7 +5430,9 @@ static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, S
req.commentLen = -1;
}
req.ctb.suid = suid;
+ req.ctb.name = strdup(sTableNmae);
req.ctb.pTag = (uint8_t*)pTag;
+ req.ctb.tagName = taosArrayDup(tagName);
if (pStmt->ignoreExists) {
req.flags |= TD_CREATE_IF_NOT_EXISTS;
}
@@ -5461,6 +5524,7 @@ static int32_t buildNormalTagVal(STranslateContext* pCxt, SSchema* pTagSchema, S
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);
@@ -5473,7 +5537,7 @@ static int32_t buildNormalTagVal(STranslateContext* pCxt, SSchema* pTagSchema, S
}
static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableClause* pStmt, STableMeta* pSuperTableMeta,
- STag** ppTag) {
+ STag** ppTag, SArray* tagName) {
int32_t numOfTags = getNumOfTags(pSuperTableMeta);
if (LIST_LENGTH(pStmt->pValsOfTags) != LIST_LENGTH(pStmt->pSpecificTags) ||
numOfTags < LIST_LENGTH(pStmt->pValsOfTags)) {
@@ -5504,8 +5568,10 @@ static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableCla
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);
}
}
if (TSDB_CODE_SUCCESS == code) {
@@ -5526,7 +5592,7 @@ static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableCla
}
static int32_t buildKVRowForAllTags(STranslateContext* pCxt, SCreateSubTableClause* pStmt, STableMeta* pSuperTableMeta,
- STag** ppTag) {
+ STag** ppTag, SArray* tagName) {
if (getNumOfTags(pSuperTableMeta) != LIST_LENGTH(pStmt->pValsOfTags)) {
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_TAGS_NOT_MATCHED);
}
@@ -5551,9 +5617,11 @@ static int32_t buildKVRowForAllTags(STranslateContext* pCxt, SCreateSubTableClau
if (pTagSchema->type == TSDB_DATA_TYPE_JSON) {
isJson = true;
code = buildJsonTagVal(pCxt, pTagSchema, pVal, pTagArray, ppTag);
+ 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);
@@ -5561,6 +5629,7 @@ static int32_t buildKVRowForAllTags(STranslateContext* pCxt, SCreateSubTableClau
memcpy(&val.i64, tmpVal, pTagSchema->bytes);
}
taosArrayPush(pTagArray, &val);
+ taosArrayPush(tagName, pTagSchema->name);
}
}
if (TSDB_CODE_SUCCESS == code) {
@@ -5596,12 +5665,13 @@ static int32_t rewriteCreateSubTable(STranslateContext* pCxt, SCreateSubTableCla
}
STag* pTag = NULL;
+ SArray* tagName = taosArrayInit(8, TSDB_COL_NAME_LEN);
if (TSDB_CODE_SUCCESS == code) {
if (NULL != pStmt->pSpecificTags) {
- code = buildKVRowForBindTags(pCxt, pStmt, pSuperTableMeta, &pTag);
+ code = buildKVRowForBindTags(pCxt, pStmt, pSuperTableMeta, &pTag, tagName);
} else {
- code = buildKVRowForAllTags(pCxt, pStmt, pSuperTableMeta, &pTag);
+ code = buildKVRowForAllTags(pCxt, pStmt, pSuperTableMeta, &pTag, tagName);
}
}
@@ -5610,9 +5680,10 @@ static int32_t rewriteCreateSubTable(STranslateContext* pCxt, SCreateSubTableCla
code = getTableHashVgroup(pCxt, pStmt->dbName, pStmt->tableName, &info);
}
if (TSDB_CODE_SUCCESS == code) {
- addCreateTbReqIntoVgroup(pCxt->pParseCxt->acctId, pVgroupHashmap, pStmt, pTag, pSuperTableMeta->uid, &info);
+ addCreateTbReqIntoVgroup(pCxt->pParseCxt->acctId, pVgroupHashmap, pStmt, pTag, pSuperTableMeta->uid, pStmt->useTableName, &info, tagName);
}
+ taosArrayDestroy(tagName);
taosMemoryFreeClear(pSuperTableMeta);
return code;
}
@@ -5827,9 +5898,8 @@ static int32_t buildUpdateTagValReq(STranslateContext* pCxt, SAlterTableStmt* pS
return pCxt->errCode;
}
- pReq->isNull = (TSDB_DATA_TYPE_NULL == pStmt->pVal->node.resType.type);
+ pReq->tagType = targetDt.type;
if (targetDt.type == TSDB_DATA_TYPE_JSON) {
- pReq->isNull = 0;
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);
@@ -5857,6 +5927,7 @@ static int32_t buildUpdateTagValReq(STranslateContext* pCxt, SAlterTableStmt* pS
pReq->pTagVal = (uint8_t*)pTag;
pStmt->pVal->datum.p = (char*)pTag; // for free
} else {
+ pReq->isNull = (TSDB_DATA_TYPE_NULL == pStmt->pVal->node.resType.type);
pReq->nTagVal = pStmt->pVal->node.resType.bytes;
pReq->pTagVal = nodesGetValueFromNode(pStmt->pVal);
@@ -5883,7 +5954,8 @@ static int32_t buildAddColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt, S
pReq->type = pStmt->dataType.type;
pReq->flags = COL_SMA_ON;
- pReq->bytes = pStmt->dataType.bytes;
+ // pReq->bytes = pStmt->dataType.bytes;
+ pReq->bytes = calcTypeBytes(pStmt->dataType);
return TSDB_CODE_SUCCESS;
}
@@ -5910,7 +5982,7 @@ static int32_t buildDropColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt,
static int32_t buildUpdateColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt, STableMeta* pTableMeta,
SVAlterTbReq* pReq) {
pReq->colModBytes = calcTypeBytes(pStmt->dataType);
-
+ pReq->colModType = pStmt->dataType.type;
SSchema* pSchema = getColSchema(pTableMeta, pStmt->colName);
if (NULL == pSchema) {
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_COLUMN, pStmt->colName);
diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c
index dedd9cabfcb3f88ca28f854070bd743fb4fc8db7..51f59c9362755702a804581c2981c7472b9f578d 100644
--- a/source/libs/parser/src/parUtil.c
+++ b/source/libs/parser/src/parUtil.c
@@ -187,7 +187,7 @@ static char* getSyntaxErrFormat(int32_t errCode) {
case TSDB_CODE_PAR_FILL_NOT_ALLOWED_FUNC:
return "%s function is not supported in fill query";
case TSDB_CODE_PAR_INVALID_WINDOW_PC:
- return "_WSTARTTS, _WENDTS and _WDURATION can only be used in window query";
+ return "_WSTART, _WEND and _WDURATION can only be used in window query";
case TSDB_CODE_PAR_WINDOW_NOT_ALLOWED_FUNC:
return "%s function is not supported in time window query";
case TSDB_CODE_PAR_STREAM_NOT_ALLOWED_FUNC:
@@ -389,6 +389,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, voi
continue;
}
STagVal val = {0};
+// strcpy(val.colName, colName);
val.pKey = jsonKey;
taosHashPut(keyHash, jsonKey, keyLen, &keyLen,
CHAR_BYTES); // add key to hash to remove dumplicate, value is useless
diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c
index d01050ceeb719bd8d611af397164cf26dd0a7fc9..2200b43db1a0af14d2382311c7f2adb6ca40b7a4 100644
--- a/source/libs/parser/src/sql.c
+++ b/source/libs/parser/src/sql.c
@@ -104,26 +104,26 @@
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
-#define YYNOCODE 378
+#define YYNOCODE 379
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SToken
typedef union {
int yyinit;
ParseTOKENTYPE yy0;
- EFillMode yy18;
- EJoinType yy36;
- ENullOrder yy109;
- EOperatorType yy128;
- bool yy173;
- SDataType yy196;
- EOrder yy218;
- SAlterOption yy389;
- int32_t yy424;
- SToken yy533;
- SNode* yy560;
- int64_t yy585;
- SNodeList* yy712;
- int8_t yy719;
+ EOrder yy58;
+ bool yy151;
+ int8_t yy285;
+ SNodeList* yy356;
+ SToken yy361;
+ SAlterOption yy409;
+ int64_t yy457;
+ EFillMode yy494;
+ EJoinType yy504;
+ EOperatorType yy526;
+ SDataType yy600;
+ ENullOrder yy613;
+ SNode* yy616;
+ int32_t yy734;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
@@ -139,17 +139,17 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
-#define YYNSTATE 666
-#define YYNRULE 489
-#define YYNTOKEN 255
-#define YY_MAX_SHIFT 665
-#define YY_MIN_SHIFTREDUCE 970
-#define YY_MAX_SHIFTREDUCE 1458
-#define YY_ERROR_ACTION 1459
-#define YY_ACCEPT_ACTION 1460
-#define YY_NO_ACTION 1461
-#define YY_MIN_REDUCE 1462
-#define YY_MAX_REDUCE 1950
+#define YYNSTATE 669
+#define YYNRULE 491
+#define YYNTOKEN 256
+#define YY_MAX_SHIFT 668
+#define YY_MIN_SHIFTREDUCE 974
+#define YY_MAX_SHIFTREDUCE 1464
+#define YY_ERROR_ACTION 1465
+#define YY_ACCEPT_ACTION 1466
+#define YY_NO_ACTION 1467
+#define YY_MIN_REDUCE 1468
+#define YY_MAX_REDUCE 1958
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -216,648 +216,694 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (2318)
+#define YY_ACTTAB_COUNT (2547)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 529, 1700, 433, 552, 434, 1497, 441, 1589, 434, 1497,
- /* 10 */ 1772, 113, 39, 37, 386, 62, 517, 1585, 471, 380,
- /* 20 */ 338, 1768, 1259, 1003, 324, 79, 1785, 1697, 1600, 30,
- /* 30 */ 260, 122, 143, 1335, 103, 1257, 1556, 102, 101, 100,
- /* 40 */ 99, 98, 97, 96, 95, 94, 1593, 1764, 1770, 327,
- /* 50 */ 71, 302, 557, 1928, 1803, 555, 1330, 1514, 1285, 574,
- /* 60 */ 1928, 14, 581, 1007, 1008, 500, 1927, 1754, 1265, 580,
- /* 70 */ 1925, 120, 1596, 159, 39, 37, 1398, 1925, 498, 487,
- /* 80 */ 496, 529, 338, 557, 1259, 1, 250, 1870, 551, 1020,
- /* 90 */ 550, 1019, 164, 1928, 1816, 1335, 61, 1257, 89, 1786,
- /* 100 */ 583, 1788, 1789, 579, 469, 574, 161, 662, 1862, 1600,
- /* 110 */ 1925, 343, 305, 1858, 1645, 1647, 71, 61, 1330, 1021,
- /* 120 */ 43, 1337, 1338, 14, 1928, 1463, 1928, 33, 32, 117,
- /* 130 */ 1265, 40, 38, 36, 35, 34, 475, 161, 1595, 160,
- /* 140 */ 142, 1925, 1474, 1925, 1485, 1785, 103, 2, 214, 102,
- /* 150 */ 101, 100, 99, 98, 97, 96, 95, 94, 474, 1156,
- /* 160 */ 1157, 486, 485, 484, 170, 1928, 1260, 483, 1258, 662,
- /* 170 */ 118, 480, 325, 1803, 479, 478, 477, 1460, 1926, 74,
- /* 180 */ 140, 556, 1925, 1337, 1338, 1754, 1754, 555, 580, 1602,
- /* 190 */ 1646, 1647, 69, 1263, 1264, 68, 1313, 1314, 1316, 1317,
- /* 200 */ 1318, 1319, 1320, 576, 572, 1328, 1329, 1331, 1332, 1333,
- /* 210 */ 1334, 1336, 1339, 1816, 36, 35, 34, 90, 1786, 583,
- /* 220 */ 1788, 1789, 579, 529, 574, 162, 371, 1862, 1260, 555,
- /* 230 */ 1258, 329, 1858, 154, 113, 419, 162, 350, 1484, 33,
- /* 240 */ 32, 476, 450, 40, 38, 36, 35, 34, 373, 369,
- /* 250 */ 1285, 1600, 552, 1889, 1395, 1263, 1264, 162, 1313, 1314,
- /* 260 */ 1316, 1317, 1318, 1319, 1320, 576, 572, 1328, 1329, 1331,
- /* 270 */ 1332, 1333, 1334, 1336, 1339, 39, 37, 1455, 1928, 1754,
- /* 280 */ 122, 174, 173, 338, 220, 1259, 40, 38, 36, 35,
- /* 290 */ 34, 159, 306, 61, 42, 1925, 1335, 1741, 1257, 1114,
- /* 300 */ 605, 604, 603, 1118, 602, 1120, 1121, 601, 1123, 598,
- /* 310 */ 1803, 1129, 595, 1131, 1132, 592, 589, 1298, 545, 1330,
- /* 320 */ 120, 1785, 33, 32, 14, 1357, 40, 38, 36, 35,
- /* 330 */ 34, 1265, 39, 37, 554, 155, 1870, 1871, 86, 1875,
- /* 340 */ 338, 552, 1259, 1772, 359, 1652, 1239, 1240, 2, 1803,
- /* 350 */ 341, 119, 326, 1335, 1768, 1257, 544, 581, 140, 1592,
- /* 360 */ 344, 1650, 1754, 529, 580, 1402, 1454, 1602, 140, 122,
- /* 370 */ 662, 1284, 1284, 379, 165, 378, 1330, 1602, 557, 1358,
- /* 380 */ 1764, 1770, 333, 1578, 1337, 1338, 1462, 432, 1265, 1816,
- /* 390 */ 436, 1600, 574, 89, 1786, 583, 1788, 1789, 579, 1483,
- /* 400 */ 574, 440, 1363, 1862, 436, 8, 215, 305, 1858, 120,
- /* 410 */ 112, 111, 110, 109, 108, 107, 106, 105, 104, 1928,
- /* 420 */ 482, 481, 632, 630, 156, 1870, 1871, 662, 1875, 1260,
- /* 430 */ 208, 1258, 159, 162, 162, 61, 1925, 75, 516, 1482,
- /* 440 */ 1754, 1337, 1338, 450, 29, 336, 1352, 1353, 1354, 1355,
- /* 450 */ 1356, 1360, 1361, 1362, 1481, 315, 1263, 1264, 546, 1313,
- /* 460 */ 1314, 1316, 1317, 1318, 1319, 1320, 576, 572, 1328, 1329,
- /* 470 */ 1331, 1332, 1333, 1334, 1336, 1339, 1394, 33, 32, 1928,
- /* 480 */ 1754, 40, 38, 36, 35, 34, 1260, 1359, 1258, 73,
- /* 490 */ 304, 1652, 159, 519, 541, 1754, 1925, 33, 32, 348,
- /* 500 */ 1286, 40, 38, 36, 35, 34, 316, 1651, 314, 313,
- /* 510 */ 1364, 473, 616, 1263, 1264, 475, 1313, 1314, 1316, 1317,
- /* 520 */ 1318, 1319, 1320, 576, 572, 1328, 1329, 1331, 1332, 1333,
- /* 530 */ 1334, 1336, 1339, 39, 37, 1340, 438, 474, 1007, 1008,
- /* 540 */ 1928, 338, 1282, 1259, 1785, 162, 1877, 1480, 1315, 1020,
- /* 550 */ 306, 1019, 27, 159, 1335, 1429, 1257, 1925, 1591, 33,
- /* 560 */ 32, 221, 222, 40, 38, 36, 35, 34, 1287, 1768,
- /* 570 */ 1874, 552, 1803, 547, 542, 162, 1576, 1330, 1283, 1021,
- /* 580 */ 556, 529, 529, 1357, 153, 1754, 1479, 580, 1754, 1265,
- /* 590 */ 39, 37, 384, 385, 22, 1764, 1770, 1639, 338, 122,
- /* 600 */ 1259, 1524, 1076, 11, 10, 140, 9, 574, 1652, 1600,
- /* 610 */ 1600, 1335, 1816, 1257, 1603, 342, 90, 1786, 583, 1788,
- /* 620 */ 1789, 579, 304, 574, 1650, 519, 1862, 1754, 662, 529,
- /* 630 */ 329, 1858, 154, 252, 1330, 1078, 616, 1358, 1877, 120,
- /* 640 */ 389, 1557, 1337, 1338, 158, 1345, 1265, 1696, 1690, 299,
- /* 650 */ 517, 1284, 1888, 1265, 157, 1870, 1871, 1600, 1875, 172,
- /* 660 */ 1363, 1698, 1873, 9, 639, 638, 637, 636, 346, 1587,
- /* 670 */ 635, 634, 633, 123, 628, 627, 626, 625, 624, 623,
- /* 680 */ 622, 621, 133, 617, 1527, 662, 1284, 1260, 1371, 1258,
- /* 690 */ 33, 32, 1877, 1478, 40, 38, 36, 35, 34, 1337,
- /* 700 */ 1338, 232, 29, 336, 1352, 1353, 1354, 1355, 1356, 1360,
- /* 710 */ 1361, 1362, 7, 1477, 1263, 1264, 1872, 1313, 1314, 1316,
- /* 720 */ 1317, 1318, 1319, 1320, 576, 572, 1328, 1329, 1331, 1332,
- /* 730 */ 1333, 1334, 1336, 1339, 1754, 33, 32, 1882, 1391, 40,
- /* 740 */ 38, 36, 35, 34, 1260, 561, 1258, 486, 485, 484,
- /* 750 */ 44, 4, 1259, 483, 1754, 272, 118, 480, 1630, 608,
- /* 760 */ 479, 478, 477, 1476, 619, 1257, 1419, 1695, 1409, 299,
- /* 770 */ 612, 1263, 1264, 1643, 1313, 1314, 1316, 1317, 1318, 1319,
- /* 780 */ 1320, 576, 572, 1328, 1329, 1331, 1332, 1333, 1334, 1336,
- /* 790 */ 1339, 39, 37, 301, 613, 1282, 614, 1643, 1265, 338,
- /* 800 */ 1583, 1259, 412, 1785, 1754, 424, 1268, 538, 1417, 1418,
- /* 810 */ 1420, 1421, 1335, 1298, 1257, 131, 130, 611, 610, 609,
- /* 820 */ 11, 10, 397, 529, 425, 211, 399, 631, 1315, 529,
- /* 830 */ 529, 1803, 529, 1473, 404, 1330, 620, 662, 1572, 581,
- /* 840 */ 405, 449, 26, 1597, 1754, 59, 580, 1265, 33, 32,
- /* 850 */ 1509, 1600, 40, 38, 36, 35, 34, 1600, 1600, 390,
- /* 860 */ 1600, 33, 32, 1315, 2, 40, 38, 36, 35, 34,
- /* 870 */ 374, 1816, 489, 570, 1754, 91, 1786, 583, 1788, 1789,
- /* 880 */ 579, 28, 574, 1457, 1458, 1862, 662, 33, 32, 1861,
- /* 890 */ 1858, 40, 38, 36, 35, 34, 1260, 1391, 1258, 423,
- /* 900 */ 1337, 1338, 418, 417, 416, 415, 414, 411, 410, 409,
- /* 910 */ 408, 407, 403, 402, 401, 400, 394, 393, 392, 391,
- /* 920 */ 575, 388, 387, 1263, 1264, 529, 564, 529, 1507, 141,
- /* 930 */ 1472, 529, 199, 529, 278, 197, 1729, 201, 510, 1271,
- /* 940 */ 200, 1047, 514, 194, 527, 1260, 562, 1258, 276, 58,
- /* 950 */ 492, 203, 57, 1600, 202, 1600, 607, 146, 502, 1600,
- /* 960 */ 509, 1600, 467, 463, 459, 455, 193, 1785, 177, 429,
- /* 970 */ 427, 1754, 1263, 1264, 1048, 1313, 1314, 1316, 1317, 1318,
- /* 980 */ 1319, 1320, 576, 572, 1328, 1329, 1331, 1332, 1333, 1334,
- /* 990 */ 1336, 1339, 335, 334, 72, 1803, 61, 191, 529, 1928,
- /* 1000 */ 529, 205, 1273, 581, 204, 1349, 139, 1475, 1754, 528,
- /* 1010 */ 580, 261, 159, 1335, 1773, 1266, 1925, 52, 513, 529,
- /* 1020 */ 255, 539, 85, 468, 1471, 1768, 1600, 1470, 1600, 1267,
- /* 1030 */ 345, 1469, 82, 41, 88, 1816, 1330, 1577, 1468, 90,
- /* 1040 */ 1786, 583, 1788, 1789, 579, 1785, 574, 1600, 1265, 1862,
- /* 1050 */ 1467, 1764, 1770, 329, 1858, 1941, 1503, 503, 244, 190,
- /* 1060 */ 183, 1575, 188, 574, 1896, 1754, 446, 1466, 1754, 66,
- /* 1070 */ 65, 383, 1754, 1803, 169, 1465, 1207, 1804, 347, 1754,
- /* 1080 */ 377, 581, 219, 125, 559, 181, 1754, 569, 580, 1775,
- /* 1090 */ 1498, 1754, 1640, 300, 128, 129, 367, 50, 365, 361,
- /* 1100 */ 357, 166, 352, 349, 657, 1892, 236, 50, 1754, 41,
- /* 1110 */ 249, 553, 254, 1816, 257, 259, 1754, 90, 1786, 583,
- /* 1120 */ 1788, 1789, 579, 1785, 574, 223, 522, 1862, 1777, 565,
- /* 1130 */ 80, 329, 1858, 1941, 614, 3, 162, 229, 1107, 41,
- /* 1140 */ 1416, 53, 1919, 5, 351, 1282, 1274, 354, 1269, 239,
- /* 1150 */ 1365, 1803, 1321, 131, 130, 611, 610, 609, 614, 581,
- /* 1160 */ 587, 128, 1270, 358, 1754, 1785, 580, 311, 1076, 129,
- /* 1170 */ 114, 128, 312, 1277, 1279, 1223, 268, 131, 130, 611,
- /* 1180 */ 610, 609, 271, 406, 572, 1328, 1329, 1331, 1332, 1333,
- /* 1190 */ 1334, 1816, 1692, 1803, 171, 90, 1786, 583, 1788, 1789,
- /* 1200 */ 579, 581, 574, 1135, 1139, 1862, 1754, 413, 580, 329,
- /* 1210 */ 1858, 1941, 1146, 1144, 132, 421, 426, 420, 422, 428,
- /* 1220 */ 1881, 430, 557, 1288, 431, 439, 1785, 180, 1291, 442,
- /* 1230 */ 443, 182, 1290, 1816, 444, 1292, 1785, 285, 1786, 583,
- /* 1240 */ 1788, 1789, 579, 445, 574, 491, 185, 447, 1289, 187,
- /* 1250 */ 448, 189, 70, 451, 1803, 192, 470, 472, 1590, 196,
- /* 1260 */ 501, 1586, 581, 1928, 1803, 303, 1734, 1754, 93, 580,
- /* 1270 */ 198, 209, 581, 269, 207, 134, 161, 1754, 135, 580,
- /* 1280 */ 1925, 1588, 504, 557, 1584, 136, 137, 508, 494, 505,
- /* 1290 */ 212, 511, 488, 1785, 1816, 515, 216, 206, 285, 1786,
- /* 1300 */ 583, 1788, 1789, 579, 1816, 574, 537, 1785, 91, 1786,
- /* 1310 */ 583, 1788, 1789, 579, 126, 574, 518, 1733, 1862, 1702,
- /* 1320 */ 321, 1803, 568, 1858, 1928, 56, 520, 523, 55, 578,
- /* 1330 */ 323, 127, 524, 525, 1754, 1803, 580, 159, 225, 227,
- /* 1340 */ 270, 1925, 1601, 581, 78, 1287, 533, 540, 1754, 535,
- /* 1350 */ 580, 234, 1893, 1903, 536, 1902, 238, 1785, 328, 543,
- /* 1360 */ 6, 1816, 1884, 549, 534, 293, 1786, 583, 1788, 1789,
- /* 1370 */ 579, 577, 574, 571, 1834, 1816, 243, 1785, 148, 144,
- /* 1380 */ 1786, 583, 1788, 1789, 579, 1803, 574, 532, 531, 248,
- /* 1390 */ 1391, 245, 246, 581, 121, 247, 1286, 1878, 1754, 566,
- /* 1400 */ 580, 563, 48, 330, 253, 1803, 1924, 1573, 1644, 273,
- /* 1410 */ 322, 658, 585, 581, 560, 1944, 1843, 264, 1754, 661,
- /* 1420 */ 580, 51, 659, 558, 1942, 1816, 147, 277, 256, 91,
- /* 1430 */ 1786, 583, 1788, 1789, 579, 1748, 574, 286, 275, 1862,
- /* 1440 */ 567, 258, 296, 1785, 1859, 1816, 63, 295, 1747, 294,
- /* 1450 */ 1786, 583, 1788, 1789, 579, 1785, 574, 1746, 64, 1745,
- /* 1460 */ 353, 1742, 355, 1251, 356, 1785, 1252, 167, 360, 1740,
- /* 1470 */ 364, 1803, 362, 363, 1739, 366, 530, 1738, 368, 581,
- /* 1480 */ 1737, 1736, 370, 1803, 1754, 1719, 580, 372, 168, 375,
- /* 1490 */ 376, 581, 1226, 1803, 1225, 1713, 1754, 1712, 580, 381,
- /* 1500 */ 382, 581, 1711, 1710, 1195, 1685, 1754, 1684, 580, 1683,
- /* 1510 */ 67, 1816, 1682, 1681, 1680, 294, 1786, 583, 1788, 1789,
- /* 1520 */ 579, 1785, 574, 1816, 1679, 1678, 396, 289, 1786, 583,
- /* 1530 */ 1788, 1789, 579, 1816, 574, 1785, 395, 144, 1786, 583,
- /* 1540 */ 1788, 1789, 579, 1677, 574, 398, 1676, 1675, 1674, 1803,
- /* 1550 */ 124, 1662, 1661, 1660, 1659, 1658, 1657, 578, 1673, 1672,
- /* 1560 */ 1671, 1670, 1754, 1803, 580, 548, 1669, 1668, 337, 1667,
- /* 1570 */ 1666, 581, 1665, 1664, 1663, 1656, 1754, 1655, 580, 1197,
- /* 1580 */ 1654, 1653, 1943, 1529, 175, 1528, 176, 1526, 1785, 1816,
- /* 1590 */ 1494, 178, 1010, 293, 1786, 583, 1788, 1789, 579, 1493,
- /* 1600 */ 574, 115, 1835, 1816, 179, 1009, 152, 294, 1786, 583,
- /* 1610 */ 1788, 1789, 579, 665, 574, 453, 1803, 435, 116, 1727,
- /* 1620 */ 1721, 339, 437, 1709, 581, 184, 1708, 267, 186, 1754,
- /* 1630 */ 1785, 580, 1694, 1579, 1525, 1523, 452, 454, 1521, 456,
- /* 1640 */ 457, 151, 1519, 460, 1785, 458, 655, 651, 647, 643,
- /* 1650 */ 265, 1040, 461, 462, 1517, 466, 1816, 464, 1803, 465,
- /* 1660 */ 294, 1786, 583, 1788, 1789, 579, 581, 574, 1506, 1505,
- /* 1670 */ 1490, 1754, 1803, 580, 1581, 1150, 49, 1149, 87, 1580,
- /* 1680 */ 581, 230, 1075, 1074, 195, 1754, 1073, 580, 1072, 629,
- /* 1690 */ 1515, 1069, 631, 1068, 1067, 1066, 1510, 317, 1816, 318,
- /* 1700 */ 1508, 490, 279, 1786, 583, 1788, 1789, 579, 1785, 574,
- /* 1710 */ 319, 493, 1816, 1489, 526, 495, 280, 1786, 583, 1788,
- /* 1720 */ 1789, 579, 1488, 574, 497, 1487, 499, 92, 1726, 1233,
- /* 1730 */ 1785, 1720, 506, 1707, 1705, 1706, 1803, 54, 1704, 1703,
- /* 1740 */ 1701, 1693, 226, 231, 581, 82, 217, 213, 507, 1754,
- /* 1750 */ 1785, 580, 218, 320, 41, 16, 15, 512, 1803, 1431,
- /* 1760 */ 138, 521, 228, 224, 47, 242, 581, 1231, 76, 210,
- /* 1770 */ 77, 1754, 23, 580, 17, 241, 1816, 1243, 1803, 235,
- /* 1780 */ 281, 1786, 583, 1788, 1789, 579, 581, 574, 1413, 1775,
- /* 1790 */ 233, 1754, 1785, 580, 237, 25, 251, 145, 1816, 46,
- /* 1800 */ 1415, 240, 288, 1786, 583, 1788, 1789, 579, 1785, 574,
- /* 1810 */ 1408, 24, 81, 1774, 149, 1388, 1387, 18, 1816, 1443,
- /* 1820 */ 1803, 1442, 290, 1786, 583, 1788, 1789, 579, 581, 574,
- /* 1830 */ 45, 1448, 1437, 1754, 331, 580, 1803, 1447, 13, 1446,
- /* 1840 */ 332, 10, 1275, 19, 581, 1819, 1306, 1325, 573, 1754,
- /* 1850 */ 1323, 580, 1322, 150, 1350, 31, 12, 20, 163, 582,
- /* 1860 */ 1816, 1785, 21, 586, 282, 1786, 583, 1788, 1789, 579,
- /* 1870 */ 340, 574, 584, 1785, 1136, 588, 1816, 1133, 590, 591,
- /* 1880 */ 291, 1786, 583, 1788, 1789, 579, 593, 574, 594, 1803,
- /* 1890 */ 596, 599, 1130, 1113, 1124, 597, 600, 581, 1128, 1122,
- /* 1900 */ 83, 1803, 1754, 84, 580, 1127, 1126, 1125, 1145, 581,
- /* 1910 */ 262, 606, 60, 1141, 1754, 1785, 580, 1063, 1082, 1038,
- /* 1920 */ 615, 618, 263, 1061, 1060, 1785, 1056, 1059, 1058, 1816,
- /* 1930 */ 1057, 1055, 1054, 283, 1786, 583, 1788, 1789, 579, 1785,
- /* 1940 */ 574, 1816, 1079, 1803, 1077, 292, 1786, 583, 1788, 1789,
- /* 1950 */ 579, 581, 574, 1803, 1051, 1050, 1754, 1049, 580, 1046,
- /* 1960 */ 1045, 581, 1044, 1043, 1522, 640, 1754, 1803, 580, 1520,
- /* 1970 */ 641, 642, 644, 645, 646, 581, 1518, 648, 649, 1516,
- /* 1980 */ 1754, 652, 580, 1816, 650, 653, 654, 284, 1786, 583,
- /* 1990 */ 1788, 1789, 579, 1816, 574, 1785, 1504, 297, 1786, 583,
- /* 2000 */ 1788, 1789, 579, 656, 574, 1785, 1000, 1816, 1486, 266,
- /* 2010 */ 660, 298, 1786, 583, 1788, 1789, 579, 1785, 574, 1261,
- /* 2020 */ 274, 663, 664, 1803, 1461, 1461, 1461, 1461, 1461, 1461,
- /* 2030 */ 1461, 581, 1461, 1803, 1461, 1461, 1754, 1461, 580, 1461,
- /* 2040 */ 1461, 581, 1461, 1461, 1461, 1803, 1754, 1461, 580, 1461,
- /* 2050 */ 1461, 1461, 1461, 581, 1461, 1461, 1461, 1461, 1754, 1461,
- /* 2060 */ 580, 1461, 1461, 1816, 1461, 1461, 1461, 1797, 1786, 583,
- /* 2070 */ 1788, 1789, 579, 1816, 574, 1461, 1461, 1796, 1786, 583,
- /* 2080 */ 1788, 1789, 579, 1785, 574, 1816, 1461, 1461, 1461, 1795,
- /* 2090 */ 1786, 583, 1788, 1789, 579, 1785, 574, 1461, 1461, 1461,
- /* 2100 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461,
- /* 2110 */ 1461, 1803, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 581,
- /* 2120 */ 1461, 1461, 1461, 1803, 1754, 1461, 580, 1461, 1461, 1461,
- /* 2130 */ 1461, 581, 1461, 1461, 1461, 1461, 1754, 1461, 580, 1461,
- /* 2140 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1785, 1461,
- /* 2150 */ 1461, 1816, 1461, 1461, 1461, 309, 1786, 583, 1788, 1789,
- /* 2160 */ 579, 1461, 574, 1816, 1461, 1461, 1461, 308, 1786, 583,
- /* 2170 */ 1788, 1789, 579, 1461, 574, 1461, 1803, 1461, 1461, 1461,
- /* 2180 */ 1461, 1461, 1461, 1461, 581, 1461, 1461, 1461, 1461, 1754,
- /* 2190 */ 1461, 580, 1461, 1461, 1461, 1461, 1461, 1461, 1785, 1461,
- /* 2200 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1785, 1461,
- /* 2210 */ 552, 1461, 1461, 1461, 1461, 1461, 1816, 1461, 1461, 1461,
- /* 2220 */ 310, 1786, 583, 1788, 1789, 579, 1803, 574, 1461, 1461,
- /* 2230 */ 1461, 1461, 1461, 1461, 581, 1461, 1803, 1461, 122, 1754,
- /* 2240 */ 1461, 580, 1461, 1461, 581, 1461, 1461, 1461, 1461, 1754,
- /* 2250 */ 1461, 580, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 557,
- /* 2260 */ 1461, 1461, 1461, 1461, 1461, 1461, 1816, 1461, 1461, 1461,
- /* 2270 */ 307, 1786, 583, 1788, 1789, 579, 1816, 574, 120, 1461,
- /* 2280 */ 287, 1786, 583, 1788, 1789, 579, 1461, 574, 1461, 1461,
- /* 2290 */ 1461, 1461, 1461, 250, 1870, 551, 1461, 550, 1461, 1461,
- /* 2300 */ 1928, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461,
- /* 2310 */ 1461, 1461, 1461, 159, 1461, 1461, 1461, 1925,
+ /* 0 */ 532, 73, 1466, 436, 555, 437, 1503, 327, 520, 73,
+ /* 10 */ 1658, 115, 39, 37, 119, 142, 326, 312, 474, 1703,
+ /* 20 */ 340, 1469, 1264, 1601, 1608, 145, 1656, 555, 1606, 1562,
+ /* 30 */ 1810, 1602, 124, 1341, 444, 1262, 437, 1503, 548, 558,
+ /* 40 */ 345, 389, 105, 1651, 1653, 104, 103, 102, 101, 100,
+ /* 50 */ 99, 98, 97, 96, 81, 124, 1336, 1491, 1792, 33,
+ /* 60 */ 32, 14, 353, 40, 38, 36, 35, 34, 1270, 39,
+ /* 70 */ 37, 1404, 122, 558, 558, 1599, 547, 340, 303, 1264,
+ /* 80 */ 1936, 1290, 144, 1936, 1480, 1, 1810, 158, 1878, 1879,
+ /* 90 */ 1341, 1883, 1262, 162, 584, 122, 1935, 1933, 1761, 1761,
+ /* 100 */ 1933, 583, 435, 1936, 64, 439, 1289, 665, 532, 557,
+ /* 110 */ 157, 1878, 1879, 1336, 1883, 560, 161, 1290, 14, 55,
+ /* 120 */ 1933, 1343, 1344, 30, 261, 1270, 1824, 131, 155, 221,
+ /* 130 */ 91, 1793, 586, 1795, 1796, 582, 1606, 577, 43, 42,
+ /* 140 */ 1870, 1645, 2, 105, 306, 1866, 104, 103, 102, 101,
+ /* 150 */ 100, 99, 98, 97, 96, 343, 1936, 40, 38, 36,
+ /* 160 */ 35, 34, 1080, 142, 665, 63, 1265, 195, 1263, 163,
+ /* 170 */ 54, 63, 1608, 1933, 383, 519, 351, 443, 1343, 1344,
+ /* 180 */ 439, 148, 1160, 1161, 1401, 63, 470, 466, 462, 458,
+ /* 190 */ 194, 1243, 1244, 1268, 1269, 1082, 1318, 1319, 1321, 1322,
+ /* 200 */ 1323, 1324, 1325, 1326, 579, 575, 1334, 1335, 1337, 1338,
+ /* 210 */ 1339, 1340, 1342, 1345, 1936, 1936, 1936, 1936, 74, 1652,
+ /* 220 */ 1653, 192, 1024, 1265, 1023, 1263, 164, 162, 161, 161,
+ /* 230 */ 161, 1933, 1933, 1933, 1933, 33, 32, 350, 63, 40,
+ /* 240 */ 38, 36, 35, 34, 1490, 382, 171, 381, 555, 564,
+ /* 250 */ 1268, 1269, 1025, 1318, 1319, 1321, 1322, 1323, 1324, 1325,
+ /* 260 */ 1326, 579, 575, 1334, 1335, 1337, 1338, 1339, 1340, 1342,
+ /* 270 */ 1345, 39, 37, 1468, 71, 1289, 124, 70, 1936, 340,
+ /* 280 */ 164, 1264, 1792, 191, 184, 1761, 189, 1584, 307, 49,
+ /* 290 */ 449, 161, 1341, 453, 1262, 1933, 532, 114, 113, 112,
+ /* 300 */ 111, 110, 109, 108, 107, 106, 164, 115, 1289, 182,
+ /* 310 */ 1810, 1489, 164, 1303, 479, 1336, 122, 1936, 559, 505,
+ /* 320 */ 14, 1363, 1488, 1761, 1606, 583, 164, 1270, 39, 37,
+ /* 330 */ 1934, 159, 1878, 1879, 1933, 1883, 340, 532, 1264, 1530,
+ /* 340 */ 317, 485, 484, 1425, 2, 478, 1658, 453, 166, 1341,
+ /* 350 */ 1824, 1262, 1761, 328, 92, 1793, 586, 1795, 1796, 582,
+ /* 360 */ 1936, 577, 1656, 1761, 1870, 1606, 665, 477, 331, 1866,
+ /* 370 */ 156, 1582, 1336, 161, 549, 1364, 1658, 1933, 1291, 164,
+ /* 380 */ 1343, 1344, 160, 344, 1270, 541, 1423, 1424, 1426, 1427,
+ /* 390 */ 1896, 318, 1656, 316, 315, 1702, 476, 300, 1369, 1706,
+ /* 400 */ 478, 8, 642, 641, 640, 639, 348, 1400, 638, 637,
+ /* 410 */ 636, 125, 631, 630, 629, 628, 627, 626, 625, 624,
+ /* 420 */ 135, 620, 477, 665, 1024, 1265, 1023, 1263, 33, 32,
+ /* 430 */ 164, 619, 40, 38, 36, 35, 34, 1343, 1344, 472,
+ /* 440 */ 1007, 29, 338, 1358, 1359, 1360, 1361, 1362, 1366, 1367,
+ /* 450 */ 1368, 565, 1268, 1269, 1025, 1318, 1319, 1321, 1322, 1323,
+ /* 460 */ 1324, 1325, 1326, 579, 575, 1334, 1335, 1337, 1338, 1339,
+ /* 470 */ 1340, 1342, 1345, 1583, 216, 222, 223, 489, 488, 487,
+ /* 480 */ 1011, 1012, 1265, 486, 1263, 1320, 120, 483, 635, 633,
+ /* 490 */ 482, 481, 480, 33, 32, 1533, 1779, 40, 38, 36,
+ /* 500 */ 35, 34, 209, 63, 619, 77, 1487, 1775, 422, 1268,
+ /* 510 */ 1269, 253, 1318, 1319, 1321, 1322, 1323, 1324, 1325, 1326,
+ /* 520 */ 579, 575, 1334, 1335, 1337, 1338, 1339, 1340, 1342, 1345,
+ /* 530 */ 39, 37, 1346, 1771, 1777, 329, 305, 441, 340, 522,
+ /* 540 */ 1264, 1792, 164, 1287, 215, 577, 307, 1761, 1701, 346,
+ /* 550 */ 300, 1341, 532, 1262, 175, 174, 1509, 142, 489, 488,
+ /* 560 */ 487, 75, 305, 387, 486, 522, 1608, 120, 483, 1810,
+ /* 570 */ 617, 482, 481, 480, 1336, 76, 1365, 559, 1461, 1363,
+ /* 580 */ 1606, 544, 1761, 494, 583, 1658, 1270, 39, 37, 133,
+ /* 590 */ 132, 614, 613, 612, 532, 340, 532, 1264, 504, 1370,
+ /* 600 */ 1696, 1657, 567, 9, 660, 388, 503, 392, 1341, 1824,
+ /* 610 */ 1262, 173, 208, 92, 1793, 586, 1795, 1796, 582, 501,
+ /* 620 */ 577, 499, 1606, 1870, 1606, 665, 497, 331, 1866, 156,
+ /* 630 */ 491, 1336, 374, 1364, 1597, 207, 532, 532, 1288, 1343,
+ /* 640 */ 1344, 1779, 27, 1270, 164, 1775, 88, 407, 408, 1897,
+ /* 650 */ 1595, 1408, 1775, 1486, 376, 372, 1369, 1289, 1270, 121,
+ /* 660 */ 9, 550, 545, 58, 1606, 1606, 57, 1598, 1460, 33,
+ /* 670 */ 32, 1771, 1777, 40, 38, 36, 35, 34, 1771, 1777,
+ /* 680 */ 335, 520, 665, 577, 1265, 1351, 1263, 36, 35, 34,
+ /* 690 */ 577, 1289, 1704, 1485, 1761, 611, 1343, 1344, 1581, 29,
+ /* 700 */ 338, 1358, 1359, 1360, 1361, 1362, 1366, 1367, 1368, 11,
+ /* 710 */ 10, 1268, 1269, 61, 1318, 1319, 1321, 1322, 1323, 1324,
+ /* 720 */ 1325, 1326, 579, 575, 1334, 1335, 1337, 1338, 1339, 1340,
+ /* 730 */ 1342, 1345, 33, 32, 1761, 1885, 40, 38, 36, 35,
+ /* 740 */ 34, 1265, 615, 1263, 623, 1649, 1578, 1435, 1118, 608,
+ /* 750 */ 607, 606, 1122, 605, 1124, 1125, 604, 1127, 601, 1882,
+ /* 760 */ 1133, 598, 1135, 1136, 595, 592, 1484, 22, 1268, 1269,
+ /* 770 */ 1483, 1318, 1319, 1321, 1322, 1323, 1324, 1325, 1326, 579,
+ /* 780 */ 575, 1334, 1335, 1337, 1338, 1339, 1340, 1342, 1345, 39,
+ /* 790 */ 37, 302, 1051, 1287, 1377, 617, 142, 340, 532, 1264,
+ /* 800 */ 415, 1792, 532, 427, 622, 1609, 568, 1761, 532, 452,
+ /* 810 */ 1341, 1761, 1262, 1603, 133, 132, 614, 613, 612, 1735,
+ /* 820 */ 400, 532, 428, 1747, 402, 1052, 1606, 532, 532, 1810,
+ /* 830 */ 1606, 1292, 513, 1336, 1320, 7, 1606, 584, 517, 530,
+ /* 840 */ 1482, 1479, 1761, 634, 583, 1270, 33, 32, 87, 1606,
+ /* 850 */ 40, 38, 36, 35, 34, 1606, 1606, 393, 84, 33,
+ /* 860 */ 32, 532, 2, 40, 38, 36, 35, 34, 1320, 1824,
+ /* 870 */ 362, 617, 531, 93, 1793, 586, 1795, 1796, 582, 1591,
+ /* 880 */ 577, 1761, 1761, 1870, 665, 1478, 377, 1869, 1866, 1606,
+ /* 890 */ 133, 132, 614, 613, 612, 44, 4, 426, 1343, 1344,
+ /* 900 */ 421, 420, 419, 418, 417, 414, 413, 412, 411, 410,
+ /* 910 */ 406, 405, 404, 403, 397, 396, 395, 394, 1885, 391,
+ /* 920 */ 390, 1593, 1477, 26, 1415, 1885, 1761, 143, 1589, 33,
+ /* 930 */ 32, 1476, 279, 40, 38, 36, 35, 34, 1011, 1012,
+ /* 940 */ 1273, 532, 1881, 1265, 212, 1263, 277, 60, 28, 1880,
+ /* 950 */ 59, 512, 262, 562, 33, 32, 1475, 41, 40, 38,
+ /* 960 */ 36, 35, 34, 1761, 233, 1792, 178, 432, 430, 1606,
+ /* 970 */ 1268, 1269, 1761, 1318, 1319, 1321, 1322, 1323, 1324, 1325,
+ /* 980 */ 1326, 579, 575, 1334, 1335, 1337, 1338, 1339, 1340, 1342,
+ /* 990 */ 1345, 668, 532, 1810, 63, 273, 616, 1761, 1636, 1649,
+ /* 1000 */ 1211, 584, 578, 347, 141, 268, 1761, 1474, 583, 1473,
+ /* 1010 */ 33, 32, 1472, 1471, 40, 38, 36, 35, 34, 153,
+ /* 1020 */ 1606, 1397, 560, 1520, 658, 654, 650, 646, 266, 1272,
+ /* 1030 */ 1890, 1397, 90, 1824, 53, 516, 1782, 91, 1793, 586,
+ /* 1040 */ 1795, 1796, 582, 220, 577, 490, 1792, 1870, 1761, 1515,
+ /* 1050 */ 1761, 306, 1866, 1761, 1761, 200, 89, 1513, 198, 231,
+ /* 1060 */ 337, 336, 202, 1936, 127, 201, 573, 68, 67, 386,
+ /* 1070 */ 1278, 492, 170, 1276, 1810, 1784, 161, 610, 380, 495,
+ /* 1080 */ 1933, 1341, 584, 1271, 130, 1481, 224, 1761, 1303, 583,
+ /* 1090 */ 1563, 301, 529, 256, 370, 131, 368, 364, 360, 167,
+ /* 1100 */ 355, 352, 1780, 204, 1336, 206, 203, 525, 205, 51,
+ /* 1110 */ 41, 237, 542, 1775, 1824, 51, 1270, 41, 92, 1793,
+ /* 1120 */ 586, 1795, 1796, 582, 218, 577, 590, 230, 1870, 11,
+ /* 1130 */ 10, 471, 331, 1866, 1949, 164, 1792, 1811, 1111, 1771,
+ /* 1140 */ 1777, 1463, 1464, 1904, 130, 1235, 131, 211, 116, 506,
+ /* 1150 */ 130, 577, 1422, 1327, 240, 572, 245, 349, 1371, 1504,
+ /* 1160 */ 272, 1646, 1275, 1900, 1810, 556, 250, 3, 255, 1139,
+ /* 1170 */ 258, 5, 584, 260, 354, 1287, 361, 1761, 357, 583,
+ /* 1180 */ 313, 1080, 1227, 314, 269, 409, 1698, 1143, 424, 1150,
+ /* 1190 */ 172, 1148, 1792, 134, 416, 423, 425, 429, 1355, 431,
+ /* 1200 */ 434, 433, 1293, 442, 1824, 1296, 445, 181, 93, 1793,
+ /* 1210 */ 586, 1795, 1796, 582, 1279, 577, 1274, 446, 1870, 183,
+ /* 1220 */ 1810, 1295, 571, 1866, 1297, 448, 186, 447, 584, 188,
+ /* 1230 */ 1294, 450, 451, 1761, 1792, 583, 190, 454, 72, 193,
+ /* 1240 */ 473, 1282, 1284, 475, 1596, 95, 197, 1592, 199, 136,
+ /* 1250 */ 137, 1594, 304, 575, 1334, 1335, 1337, 1338, 1339, 1340,
+ /* 1260 */ 1824, 1590, 1810, 138, 92, 1793, 586, 1795, 1796, 582,
+ /* 1270 */ 584, 577, 139, 270, 1870, 1761, 210, 583, 331, 1866,
+ /* 1280 */ 1949, 1740, 507, 540, 511, 526, 213, 1792, 217, 1927,
+ /* 1290 */ 508, 514, 518, 521, 128, 323, 1739, 1792, 1708, 523,
+ /* 1300 */ 129, 325, 1824, 226, 527, 528, 92, 1793, 586, 1795,
+ /* 1310 */ 1796, 582, 228, 577, 271, 1810, 1870, 1607, 1292, 543,
+ /* 1320 */ 331, 1866, 1949, 584, 80, 1810, 536, 538, 1761, 539,
+ /* 1330 */ 583, 1889, 1264, 584, 1901, 330, 546, 6, 1761, 534,
+ /* 1340 */ 583, 235, 244, 239, 552, 1262, 537, 1792, 1397, 1911,
+ /* 1350 */ 1910, 150, 535, 123, 560, 1824, 1291, 1792, 1892, 280,
+ /* 1360 */ 1793, 586, 1795, 1796, 582, 1824, 577, 249, 246, 286,
+ /* 1370 */ 1793, 586, 1795, 1796, 582, 1810, 577, 569, 1270, 332,
+ /* 1380 */ 1886, 566, 1932, 584, 254, 1810, 563, 257, 1761, 1952,
+ /* 1390 */ 583, 48, 82, 581, 247, 1936, 1650, 248, 1761, 1579,
+ /* 1400 */ 583, 274, 265, 1851, 560, 588, 661, 570, 163, 662,
+ /* 1410 */ 664, 259, 1933, 52, 149, 1824, 278, 665, 1755, 286,
+ /* 1420 */ 1793, 586, 1795, 1796, 582, 1824, 577, 276, 1754, 294,
+ /* 1430 */ 1793, 586, 1795, 1796, 582, 580, 577, 574, 1842, 1792,
+ /* 1440 */ 555, 287, 297, 296, 65, 1936, 1753, 1752, 66, 1751,
+ /* 1450 */ 356, 1748, 358, 359, 1255, 1256, 168, 363, 161, 1746,
+ /* 1460 */ 365, 366, 1933, 367, 1745, 369, 1744, 1810, 124, 1743,
+ /* 1470 */ 371, 1742, 373, 375, 1725, 584, 1265, 169, 1263, 378,
+ /* 1480 */ 1761, 379, 583, 1230, 1229, 1719, 1718, 384, 385, 560,
+ /* 1490 */ 1717, 1716, 1691, 1792, 1199, 1690, 1689, 69, 1688, 1687,
+ /* 1500 */ 1686, 1685, 1684, 1268, 1269, 398, 1683, 1824, 122, 401,
+ /* 1510 */ 399, 146, 1793, 586, 1795, 1796, 582, 1792, 577, 1682,
+ /* 1520 */ 1681, 1810, 126, 251, 1878, 554, 1680, 553, 1679, 584,
+ /* 1530 */ 1936, 1678, 1677, 1676, 1761, 1675, 583, 1674, 1673, 1672,
+ /* 1540 */ 1671, 1670, 1669, 163, 1668, 1810, 1667, 1933, 1666, 1665,
+ /* 1550 */ 324, 1664, 1663, 584, 117, 561, 1950, 1662, 1761, 1661,
+ /* 1560 */ 583, 1824, 1660, 1659, 1535, 93, 1793, 586, 1795, 1796,
+ /* 1570 */ 582, 1792, 577, 176, 1534, 1870, 1201, 177, 1532, 1500,
+ /* 1580 */ 1867, 1792, 1014, 1013, 1499, 1824, 154, 179, 1733, 295,
+ /* 1590 */ 1793, 586, 1795, 1796, 582, 1727, 577, 1715, 180, 1810,
+ /* 1600 */ 118, 438, 440, 1714, 533, 185, 1700, 584, 1585, 1810,
+ /* 1610 */ 187, 1531, 1761, 1529, 583, 1044, 455, 584, 456, 457,
+ /* 1620 */ 1527, 459, 1761, 460, 583, 1525, 461, 1523, 463, 465,
+ /* 1630 */ 464, 1792, 468, 467, 1512, 469, 1511, 1496, 1587, 1824,
+ /* 1640 */ 1154, 50, 196, 295, 1793, 586, 1795, 1796, 582, 1824,
+ /* 1650 */ 577, 1153, 1586, 290, 1793, 586, 1795, 1796, 582, 1810,
+ /* 1660 */ 577, 1079, 632, 1078, 634, 1077, 1076, 584, 1073, 1521,
+ /* 1670 */ 1072, 319, 1761, 320, 583, 1071, 1070, 1516, 1514, 321,
+ /* 1680 */ 496, 1792, 1495, 498, 1494, 500, 1493, 502, 493, 1732,
+ /* 1690 */ 94, 551, 15, 1792, 1237, 1726, 140, 509, 1713, 1824,
+ /* 1700 */ 1711, 1712, 1710, 146, 1793, 586, 1795, 1796, 582, 1810,
+ /* 1710 */ 577, 1709, 1707, 56, 1699, 1247, 229, 581, 510, 227,
+ /* 1720 */ 214, 1810, 1761, 16, 583, 232, 339, 225, 322, 584,
+ /* 1730 */ 219, 78, 515, 41, 1761, 17, 583, 47, 79, 23,
+ /* 1740 */ 524, 1437, 84, 234, 13, 243, 236, 1419, 1951, 1824,
+ /* 1750 */ 1421, 238, 147, 294, 1793, 586, 1795, 1796, 582, 241,
+ /* 1760 */ 577, 1824, 1843, 242, 1782, 295, 1793, 586, 1795, 1796,
+ /* 1770 */ 582, 1792, 577, 24, 25, 252, 46, 1414, 83, 18,
+ /* 1780 */ 1781, 1792, 1394, 1393, 151, 1449, 1448, 333, 1453, 1454,
+ /* 1790 */ 1443, 1452, 334, 10, 1280, 1356, 1331, 45, 19, 1810,
+ /* 1800 */ 1827, 576, 1311, 1329, 341, 1328, 31, 584, 152, 1810,
+ /* 1810 */ 12, 20, 1761, 165, 583, 21, 589, 584, 585, 587,
+ /* 1820 */ 342, 1140, 1761, 1137, 583, 591, 594, 593, 1134, 596,
+ /* 1830 */ 597, 1792, 1128, 599, 600, 602, 1132, 1131, 1117, 1824,
+ /* 1840 */ 609, 1792, 1149, 295, 1793, 586, 1795, 1796, 582, 1824,
+ /* 1850 */ 577, 1792, 1126, 281, 1793, 586, 1795, 1796, 582, 1810,
+ /* 1860 */ 577, 603, 85, 86, 62, 263, 1145, 584, 1130, 1810,
+ /* 1870 */ 1129, 1042, 1761, 618, 583, 264, 1067, 584, 1086, 1810,
+ /* 1880 */ 621, 1065, 1761, 1064, 583, 1063, 1062, 584, 1061, 1060,
+ /* 1890 */ 1059, 1058, 1761, 1083, 583, 1081, 1055, 1054, 1053, 1824,
+ /* 1900 */ 1050, 1049, 1528, 282, 1793, 586, 1795, 1796, 582, 1824,
+ /* 1910 */ 577, 1048, 1047, 289, 1793, 586, 1795, 1796, 582, 1824,
+ /* 1920 */ 577, 643, 644, 291, 1793, 586, 1795, 1796, 582, 645,
+ /* 1930 */ 577, 1526, 1792, 647, 648, 649, 1524, 1522, 651, 652,
+ /* 1940 */ 653, 655, 656, 657, 1510, 659, 1004, 1492, 267, 663,
+ /* 1950 */ 666, 1792, 1266, 667, 275, 1467, 1467, 1467, 1467, 1467,
+ /* 1960 */ 1810, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 584, 1467,
+ /* 1970 */ 1467, 1467, 1467, 1761, 1467, 583, 1467, 1467, 1467, 1810,
+ /* 1980 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 584, 1467, 1467,
+ /* 1990 */ 1467, 1467, 1761, 1467, 583, 1467, 1467, 1467, 1467, 1467,
+ /* 2000 */ 1824, 1467, 1467, 1467, 283, 1793, 586, 1795, 1796, 582,
+ /* 2010 */ 1467, 577, 1467, 1792, 1467, 1467, 1467, 1467, 1467, 1824,
+ /* 2020 */ 1467, 1467, 1467, 292, 1793, 586, 1795, 1796, 582, 1792,
+ /* 2030 */ 577, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2040 */ 1467, 1810, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 584,
+ /* 2050 */ 1467, 1467, 1467, 1467, 1761, 1467, 583, 1810, 1467, 1467,
+ /* 2060 */ 1467, 1467, 1467, 1467, 1467, 584, 1467, 1467, 1467, 1467,
+ /* 2070 */ 1761, 1467, 583, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2080 */ 1467, 1824, 1792, 1467, 1467, 284, 1793, 586, 1795, 1796,
+ /* 2090 */ 582, 1467, 577, 1467, 1467, 1467, 1467, 1824, 1467, 1792,
+ /* 2100 */ 1467, 293, 1793, 586, 1795, 1796, 582, 1467, 577, 1467,
+ /* 2110 */ 1810, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 584, 1467,
+ /* 2120 */ 1467, 1467, 1467, 1761, 1467, 583, 1467, 1810, 1467, 1467,
+ /* 2130 */ 1467, 1467, 1467, 1467, 1467, 584, 1467, 1467, 1467, 1467,
+ /* 2140 */ 1761, 1467, 583, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2150 */ 1824, 1467, 1792, 1467, 285, 1793, 586, 1795, 1796, 582,
+ /* 2160 */ 1467, 577, 1467, 1467, 1792, 1467, 1467, 1824, 1467, 1467,
+ /* 2170 */ 1467, 298, 1793, 586, 1795, 1796, 582, 1467, 577, 1467,
+ /* 2180 */ 1810, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 584, 1467,
+ /* 2190 */ 1467, 1467, 1810, 1761, 1467, 583, 1467, 1467, 1467, 1467,
+ /* 2200 */ 584, 1467, 1467, 1467, 1467, 1761, 1467, 583, 1467, 1467,
+ /* 2210 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2220 */ 1824, 1467, 1467, 1467, 299, 1793, 586, 1795, 1796, 582,
+ /* 2230 */ 1467, 577, 1824, 1792, 1467, 1467, 1804, 1793, 586, 1795,
+ /* 2240 */ 1796, 582, 1467, 577, 1467, 1467, 1467, 1792, 1467, 1467,
+ /* 2250 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2260 */ 1467, 1810, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 584,
+ /* 2270 */ 1467, 1467, 1467, 1467, 1761, 1810, 583, 1467, 1467, 1467,
+ /* 2280 */ 1467, 1467, 1467, 584, 1467, 1467, 1467, 1467, 1761, 1792,
+ /* 2290 */ 583, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2300 */ 1467, 1824, 1467, 1467, 1467, 1803, 1793, 586, 1795, 1796,
+ /* 2310 */ 582, 1467, 577, 1467, 1467, 1824, 1467, 1810, 1467, 1802,
+ /* 2320 */ 1793, 586, 1795, 1796, 582, 584, 577, 1467, 1467, 1467,
+ /* 2330 */ 1761, 1467, 583, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2340 */ 1467, 1792, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2350 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1824, 1467, 1792,
+ /* 2360 */ 1467, 310, 1793, 586, 1795, 1796, 582, 1467, 577, 1810,
+ /* 2370 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 584, 1467, 1467,
+ /* 2380 */ 1467, 1467, 1761, 1792, 583, 1467, 1467, 1810, 1467, 1467,
+ /* 2390 */ 1467, 1467, 1467, 1467, 1467, 584, 1467, 1467, 1467, 1467,
+ /* 2400 */ 1761, 1467, 583, 1467, 1467, 1467, 1467, 1467, 1467, 1824,
+ /* 2410 */ 1467, 1810, 1467, 309, 1793, 586, 1795, 1796, 582, 584,
+ /* 2420 */ 577, 1467, 1467, 1467, 1761, 1467, 583, 1824, 1467, 1467,
+ /* 2430 */ 1467, 311, 1793, 586, 1795, 1796, 582, 1467, 577, 555,
+ /* 2440 */ 1792, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2450 */ 1467, 1824, 1467, 1467, 1467, 308, 1793, 586, 1795, 1796,
+ /* 2460 */ 582, 1467, 577, 1467, 1467, 1467, 1467, 124, 1810, 1467,
+ /* 2470 */ 1467, 1467, 1467, 1467, 1467, 1467, 584, 1467, 1467, 1467,
+ /* 2480 */ 1467, 1761, 1467, 583, 1467, 1467, 1467, 1467, 560, 1467,
+ /* 2490 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2500 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 122, 1824, 1467,
+ /* 2510 */ 1467, 1467, 288, 1793, 586, 1795, 1796, 582, 1467, 577,
+ /* 2520 */ 1467, 1467, 251, 1878, 554, 1467, 553, 1467, 1467, 1936,
+ /* 2530 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+ /* 2540 */ 1467, 1467, 161, 1467, 1467, 1467, 1933,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 266, 0, 262, 266, 264, 265, 262, 287, 264, 265,
- /* 10 */ 288, 277, 12, 13, 266, 4, 301, 287, 284, 315,
- /* 20 */ 20, 299, 22, 4, 309, 268, 258, 312, 294, 341,
- /* 30 */ 342, 294, 271, 33, 21, 35, 275, 24, 25, 26,
- /* 40 */ 27, 28, 29, 30, 31, 32, 289, 325, 326, 327,
- /* 50 */ 270, 303, 315, 356, 286, 20, 56, 0, 20, 337,
- /* 60 */ 356, 61, 294, 44, 45, 21, 369, 299, 68, 301,
- /* 70 */ 373, 334, 292, 369, 12, 13, 14, 373, 34, 22,
- /* 80 */ 36, 266, 20, 315, 22, 85, 349, 350, 351, 20,
- /* 90 */ 353, 22, 277, 356, 326, 33, 85, 35, 330, 331,
- /* 100 */ 332, 333, 334, 335, 35, 337, 369, 107, 340, 294,
- /* 110 */ 373, 297, 344, 345, 300, 301, 270, 85, 56, 50,
- /* 120 */ 85, 121, 122, 61, 356, 0, 356, 8, 9, 283,
- /* 130 */ 68, 12, 13, 14, 15, 16, 97, 369, 292, 369,
- /* 140 */ 257, 373, 259, 373, 258, 258, 21, 85, 56, 24,
- /* 150 */ 25, 26, 27, 28, 29, 30, 31, 32, 119, 121,
- /* 160 */ 122, 63, 64, 65, 56, 356, 166, 69, 168, 107,
- /* 170 */ 72, 73, 278, 286, 76, 77, 78, 255, 369, 87,
- /* 180 */ 286, 294, 373, 121, 122, 299, 299, 20, 301, 295,
- /* 190 */ 300, 301, 84, 193, 194, 87, 196, 197, 198, 199,
+ /* 0 */ 267, 271, 256, 263, 267, 265, 266, 279, 302, 271,
+ /* 10 */ 287, 278, 12, 13, 284, 287, 310, 294, 285, 313,
+ /* 20 */ 20, 0, 22, 293, 296, 272, 303, 267, 295, 276,
+ /* 30 */ 287, 293, 295, 33, 263, 35, 265, 266, 295, 20,
+ /* 40 */ 298, 267, 21, 301, 302, 24, 25, 26, 27, 28,
+ /* 50 */ 29, 30, 31, 32, 269, 295, 56, 259, 259, 8,
+ /* 60 */ 9, 61, 316, 12, 13, 14, 15, 16, 68, 12,
+ /* 70 */ 13, 14, 335, 20, 20, 290, 333, 20, 304, 22,
+ /* 80 */ 357, 20, 258, 357, 260, 85, 287, 350, 351, 352,
+ /* 90 */ 33, 354, 35, 370, 295, 335, 370, 374, 300, 300,
+ /* 100 */ 374, 302, 264, 357, 4, 267, 20, 107, 267, 349,
+ /* 110 */ 350, 351, 352, 56, 354, 316, 370, 20, 61, 278,
+ /* 120 */ 374, 121, 122, 342, 343, 68, 327, 43, 286, 116,
+ /* 130 */ 331, 332, 333, 334, 335, 336, 295, 338, 85, 85,
+ /* 140 */ 341, 299, 85, 21, 345, 346, 24, 25, 26, 27,
+ /* 150 */ 28, 29, 30, 31, 32, 279, 357, 12, 13, 14,
+ /* 160 */ 15, 16, 35, 287, 107, 85, 166, 33, 168, 370,
+ /* 170 */ 86, 85, 296, 374, 316, 316, 316, 264, 121, 122,
+ /* 180 */ 267, 47, 121, 122, 4, 85, 52, 53, 54, 55,
+ /* 190 */ 56, 178, 179, 193, 194, 68, 196, 197, 198, 199,
/* 200 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
- /* 210 */ 210, 211, 212, 326, 14, 15, 16, 330, 331, 332,
- /* 220 */ 333, 334, 335, 266, 337, 225, 161, 340, 166, 20,
- /* 230 */ 168, 344, 345, 346, 277, 79, 225, 315, 258, 8,
- /* 240 */ 9, 284, 60, 12, 13, 14, 15, 16, 183, 184,
- /* 250 */ 20, 294, 266, 366, 4, 193, 194, 225, 196, 197,
- /* 260 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
- /* 270 */ 208, 209, 210, 211, 212, 12, 13, 158, 356, 299,
- /* 280 */ 294, 125, 126, 20, 116, 22, 12, 13, 14, 15,
- /* 290 */ 16, 369, 61, 85, 85, 373, 33, 0, 35, 98,
- /* 300 */ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
- /* 310 */ 286, 110, 111, 112, 113, 114, 115, 86, 294, 56,
- /* 320 */ 334, 258, 8, 9, 61, 94, 12, 13, 14, 15,
- /* 330 */ 16, 68, 12, 13, 348, 349, 350, 351, 268, 353,
- /* 340 */ 20, 266, 22, 288, 47, 286, 178, 179, 85, 286,
- /* 350 */ 278, 281, 293, 33, 299, 35, 332, 294, 286, 289,
- /* 360 */ 278, 302, 299, 266, 301, 14, 247, 295, 286, 294,
- /* 370 */ 107, 20, 20, 165, 277, 167, 56, 295, 315, 148,
- /* 380 */ 325, 326, 327, 0, 121, 122, 0, 263, 68, 326,
- /* 390 */ 266, 294, 337, 330, 331, 332, 333, 334, 335, 258,
- /* 400 */ 337, 263, 171, 340, 266, 85, 56, 344, 345, 334,
- /* 410 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 356,
- /* 420 */ 272, 273, 272, 273, 349, 350, 351, 107, 353, 166,
- /* 430 */ 117, 168, 369, 225, 225, 85, 373, 87, 315, 258,
- /* 440 */ 299, 121, 122, 60, 213, 214, 215, 216, 217, 218,
- /* 450 */ 219, 220, 221, 222, 258, 37, 193, 194, 20, 196,
- /* 460 */ 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
- /* 470 */ 207, 208, 209, 210, 211, 212, 226, 8, 9, 356,
- /* 480 */ 299, 12, 13, 14, 15, 16, 166, 148, 168, 176,
- /* 490 */ 177, 286, 369, 180, 151, 299, 373, 8, 9, 315,
- /* 500 */ 20, 12, 13, 14, 15, 16, 88, 302, 90, 91,
- /* 510 */ 171, 93, 60, 193, 194, 97, 196, 197, 198, 199,
- /* 520 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
- /* 530 */ 210, 211, 212, 12, 13, 14, 14, 119, 44, 45,
- /* 540 */ 356, 20, 20, 22, 258, 225, 328, 258, 197, 20,
- /* 550 */ 61, 22, 213, 369, 33, 86, 35, 373, 288, 8,
- /* 560 */ 9, 116, 117, 12, 13, 14, 15, 16, 20, 299,
- /* 570 */ 352, 266, 286, 230, 231, 225, 0, 56, 20, 50,
- /* 580 */ 294, 266, 266, 94, 285, 299, 258, 301, 299, 68,
- /* 590 */ 12, 13, 277, 277, 43, 325, 326, 298, 20, 294,
- /* 600 */ 22, 0, 35, 1, 2, 286, 85, 337, 286, 294,
- /* 610 */ 294, 33, 326, 35, 295, 293, 330, 331, 332, 333,
- /* 620 */ 334, 335, 177, 337, 302, 180, 340, 299, 107, 266,
- /* 630 */ 344, 345, 346, 153, 56, 68, 60, 148, 328, 334,
- /* 640 */ 277, 275, 121, 122, 358, 14, 68, 311, 294, 313,
- /* 650 */ 301, 20, 366, 68, 349, 350, 351, 294, 353, 305,
- /* 660 */ 171, 312, 352, 85, 63, 64, 65, 66, 67, 287,
- /* 670 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- /* 680 */ 79, 80, 81, 82, 0, 107, 20, 166, 86, 168,
- /* 690 */ 8, 9, 328, 258, 12, 13, 14, 15, 16, 121,
- /* 700 */ 122, 153, 213, 214, 215, 216, 217, 218, 219, 220,
- /* 710 */ 221, 222, 39, 258, 193, 194, 352, 196, 197, 198,
- /* 720 */ 199, 200, 201, 202, 203, 204, 205, 206, 207, 208,
- /* 730 */ 209, 210, 211, 212, 299, 8, 9, 223, 224, 12,
- /* 740 */ 13, 14, 15, 16, 166, 43, 168, 63, 64, 65,
- /* 750 */ 42, 43, 22, 69, 299, 279, 72, 73, 282, 96,
- /* 760 */ 76, 77, 78, 258, 68, 35, 193, 311, 86, 313,
- /* 770 */ 296, 193, 194, 299, 196, 197, 198, 199, 200, 201,
- /* 780 */ 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
- /* 790 */ 212, 12, 13, 18, 296, 20, 97, 299, 68, 20,
- /* 800 */ 287, 22, 27, 258, 299, 30, 35, 234, 235, 236,
- /* 810 */ 237, 238, 33, 86, 35, 116, 117, 118, 119, 120,
- /* 820 */ 1, 2, 47, 266, 49, 287, 51, 43, 197, 266,
- /* 830 */ 266, 286, 266, 258, 277, 56, 274, 107, 276, 294,
- /* 840 */ 277, 277, 2, 277, 299, 3, 301, 68, 8, 9,
- /* 850 */ 0, 294, 12, 13, 14, 15, 16, 294, 294, 84,
- /* 860 */ 294, 8, 9, 197, 85, 12, 13, 14, 15, 16,
- /* 870 */ 86, 326, 22, 61, 299, 330, 331, 332, 333, 334,
- /* 880 */ 335, 2, 337, 121, 122, 340, 107, 8, 9, 344,
- /* 890 */ 345, 12, 13, 14, 15, 16, 166, 224, 168, 124,
- /* 900 */ 121, 122, 127, 128, 129, 130, 131, 132, 133, 134,
- /* 910 */ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
- /* 920 */ 287, 146, 147, 193, 194, 266, 43, 266, 0, 18,
- /* 930 */ 258, 266, 89, 266, 23, 92, 277, 89, 277, 168,
- /* 940 */ 92, 35, 277, 33, 277, 166, 244, 168, 37, 38,
- /* 950 */ 22, 89, 41, 294, 92, 294, 287, 47, 315, 294,
- /* 960 */ 319, 294, 52, 53, 54, 55, 56, 258, 57, 58,
- /* 970 */ 59, 299, 193, 194, 68, 196, 197, 198, 199, 200,
- /* 980 */ 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
- /* 990 */ 211, 212, 12, 13, 84, 286, 85, 87, 266, 356,
- /* 1000 */ 266, 89, 22, 294, 92, 193, 153, 259, 299, 277,
- /* 1010 */ 301, 277, 369, 33, 288, 35, 373, 153, 154, 266,
- /* 1020 */ 376, 367, 85, 267, 258, 299, 294, 258, 294, 35,
- /* 1030 */ 277, 258, 95, 43, 123, 326, 56, 0, 258, 330,
- /* 1040 */ 331, 332, 333, 334, 335, 258, 337, 294, 68, 340,
- /* 1050 */ 258, 325, 326, 344, 345, 346, 0, 322, 363, 149,
- /* 1060 */ 150, 0, 152, 337, 355, 299, 156, 258, 299, 158,
- /* 1070 */ 159, 160, 299, 286, 163, 258, 86, 286, 267, 299,
- /* 1080 */ 169, 294, 43, 43, 242, 175, 299, 107, 301, 46,
- /* 1090 */ 265, 299, 298, 182, 43, 43, 185, 43, 187, 188,
- /* 1100 */ 189, 190, 191, 192, 48, 329, 43, 43, 299, 43,
- /* 1110 */ 347, 354, 370, 326, 370, 370, 299, 330, 331, 332,
- /* 1120 */ 333, 334, 335, 258, 337, 86, 86, 340, 85, 246,
- /* 1130 */ 85, 344, 345, 346, 97, 357, 225, 86, 86, 43,
- /* 1140 */ 86, 290, 355, 227, 324, 20, 166, 266, 168, 86,
- /* 1150 */ 86, 286, 86, 116, 117, 118, 119, 120, 97, 294,
- /* 1160 */ 43, 43, 168, 47, 299, 258, 301, 323, 35, 43,
- /* 1170 */ 43, 43, 272, 193, 194, 164, 317, 116, 117, 118,
- /* 1180 */ 119, 120, 86, 266, 204, 205, 206, 207, 208, 209,
- /* 1190 */ 210, 326, 266, 286, 42, 330, 331, 332, 333, 334,
- /* 1200 */ 335, 294, 337, 86, 86, 340, 299, 306, 301, 344,
- /* 1210 */ 345, 346, 86, 86, 86, 148, 266, 304, 304, 266,
- /* 1220 */ 355, 266, 315, 20, 260, 260, 258, 270, 20, 321,
- /* 1230 */ 301, 270, 20, 326, 314, 20, 258, 330, 331, 332,
- /* 1240 */ 333, 334, 335, 316, 337, 4, 270, 314, 20, 270,
- /* 1250 */ 307, 270, 270, 266, 286, 270, 260, 286, 286, 286,
- /* 1260 */ 19, 286, 294, 356, 286, 260, 299, 299, 266, 301,
- /* 1270 */ 286, 268, 294, 321, 33, 286, 369, 299, 286, 301,
- /* 1280 */ 373, 286, 174, 315, 286, 286, 286, 301, 47, 320,
- /* 1290 */ 268, 266, 51, 258, 326, 266, 268, 56, 330, 331,
- /* 1300 */ 332, 333, 334, 335, 326, 337, 232, 258, 330, 331,
- /* 1310 */ 332, 333, 334, 335, 310, 337, 299, 299, 340, 299,
- /* 1320 */ 314, 286, 344, 345, 356, 84, 299, 150, 87, 294,
- /* 1330 */ 299, 310, 308, 307, 299, 286, 301, 369, 294, 268,
- /* 1340 */ 282, 373, 294, 294, 268, 20, 299, 233, 299, 299,
- /* 1350 */ 301, 310, 329, 362, 299, 362, 310, 258, 299, 299,
- /* 1360 */ 239, 326, 365, 157, 241, 330, 331, 332, 333, 334,
- /* 1370 */ 335, 336, 337, 338, 339, 326, 364, 258, 362, 330,
- /* 1380 */ 331, 332, 333, 334, 335, 286, 337, 240, 228, 324,
- /* 1390 */ 224, 361, 360, 294, 294, 359, 20, 328, 299, 245,
- /* 1400 */ 301, 243, 85, 248, 371, 286, 372, 276, 299, 266,
- /* 1410 */ 291, 36, 290, 294, 372, 377, 343, 268, 299, 260,
- /* 1420 */ 301, 318, 261, 374, 375, 326, 313, 256, 371, 330,
- /* 1430 */ 331, 332, 333, 334, 335, 0, 337, 280, 269, 340,
- /* 1440 */ 372, 371, 280, 258, 345, 326, 176, 280, 0, 330,
- /* 1450 */ 331, 332, 333, 334, 335, 258, 337, 0, 42, 0,
- /* 1460 */ 76, 0, 35, 35, 186, 258, 35, 35, 186, 0,
- /* 1470 */ 186, 286, 35, 35, 0, 186, 291, 0, 35, 294,
- /* 1480 */ 0, 0, 22, 286, 299, 0, 301, 35, 85, 171,
- /* 1490 */ 170, 294, 168, 286, 166, 0, 299, 0, 301, 162,
- /* 1500 */ 161, 294, 0, 0, 46, 0, 299, 0, 301, 0,
- /* 1510 */ 145, 326, 0, 0, 0, 330, 331, 332, 333, 334,
- /* 1520 */ 335, 258, 337, 326, 0, 0, 35, 330, 331, 332,
- /* 1530 */ 333, 334, 335, 326, 337, 258, 140, 330, 331, 332,
- /* 1540 */ 333, 334, 335, 0, 337, 140, 0, 0, 0, 286,
- /* 1550 */ 42, 0, 0, 0, 0, 0, 0, 294, 0, 0,
- /* 1560 */ 0, 0, 299, 286, 301, 368, 0, 0, 291, 0,
- /* 1570 */ 0, 294, 0, 0, 0, 0, 299, 0, 301, 22,
- /* 1580 */ 0, 0, 375, 0, 56, 0, 56, 0, 258, 326,
- /* 1590 */ 0, 42, 14, 330, 331, 332, 333, 334, 335, 0,
- /* 1600 */ 337, 39, 339, 326, 40, 14, 43, 330, 331, 332,
- /* 1610 */ 333, 334, 335, 19, 337, 47, 286, 46, 39, 0,
- /* 1620 */ 0, 291, 46, 0, 294, 39, 0, 33, 157, 299,
- /* 1630 */ 258, 301, 0, 0, 0, 0, 35, 39, 0, 35,
- /* 1640 */ 47, 47, 0, 35, 258, 39, 52, 53, 54, 55,
- /* 1650 */ 56, 62, 47, 39, 0, 39, 326, 35, 286, 47,
- /* 1660 */ 330, 331, 332, 333, 334, 335, 294, 337, 0, 0,
- /* 1670 */ 0, 299, 286, 301, 0, 35, 94, 22, 84, 0,
- /* 1680 */ 294, 87, 35, 35, 92, 299, 35, 301, 35, 43,
- /* 1690 */ 0, 35, 43, 35, 35, 35, 0, 22, 326, 22,
- /* 1700 */ 0, 49, 330, 331, 332, 333, 334, 335, 258, 337,
- /* 1710 */ 22, 35, 326, 0, 120, 35, 330, 331, 332, 333,
- /* 1720 */ 334, 335, 0, 337, 35, 0, 22, 20, 0, 35,
- /* 1730 */ 258, 0, 22, 0, 0, 0, 286, 153, 0, 0,
- /* 1740 */ 0, 0, 39, 46, 294, 95, 152, 150, 153, 299,
- /* 1750 */ 258, 301, 86, 153, 43, 229, 85, 155, 286, 86,
- /* 1760 */ 172, 151, 149, 85, 43, 46, 294, 173, 85, 175,
- /* 1770 */ 85, 299, 85, 301, 229, 43, 326, 181, 286, 86,
- /* 1780 */ 330, 331, 332, 333, 334, 335, 294, 337, 86, 46,
- /* 1790 */ 85, 299, 258, 301, 85, 43, 46, 85, 326, 43,
- /* 1800 */ 86, 85, 330, 331, 332, 333, 334, 335, 258, 337,
- /* 1810 */ 86, 85, 85, 46, 46, 86, 86, 43, 326, 35,
- /* 1820 */ 286, 35, 330, 331, 332, 333, 334, 335, 294, 337,
- /* 1830 */ 223, 86, 86, 299, 35, 301, 286, 35, 229, 35,
- /* 1840 */ 35, 2, 22, 43, 294, 85, 22, 86, 85, 299,
- /* 1850 */ 86, 301, 86, 46, 193, 85, 85, 85, 46, 195,
- /* 1860 */ 326, 258, 85, 35, 330, 331, 332, 333, 334, 335,
- /* 1870 */ 35, 337, 96, 258, 86, 85, 326, 86, 35, 85,
- /* 1880 */ 330, 331, 332, 333, 334, 335, 35, 337, 85, 286,
- /* 1890 */ 35, 35, 86, 22, 86, 85, 85, 294, 109, 86,
- /* 1900 */ 85, 286, 299, 85, 301, 109, 109, 109, 35, 294,
- /* 1910 */ 43, 97, 85, 22, 299, 258, 301, 35, 68, 62,
- /* 1920 */ 61, 83, 43, 35, 35, 258, 22, 35, 35, 326,
- /* 1930 */ 35, 35, 35, 330, 331, 332, 333, 334, 335, 258,
- /* 1940 */ 337, 326, 68, 286, 35, 330, 331, 332, 333, 334,
- /* 1950 */ 335, 294, 337, 286, 35, 35, 299, 35, 301, 35,
- /* 1960 */ 35, 294, 35, 35, 0, 35, 299, 286, 301, 0,
- /* 1970 */ 47, 39, 35, 47, 39, 294, 0, 35, 47, 0,
- /* 1980 */ 299, 35, 301, 326, 39, 47, 39, 330, 331, 332,
- /* 1990 */ 333, 334, 335, 326, 337, 258, 0, 330, 331, 332,
- /* 2000 */ 333, 334, 335, 35, 337, 258, 35, 326, 0, 22,
- /* 2010 */ 21, 330, 331, 332, 333, 334, 335, 258, 337, 22,
- /* 2020 */ 22, 21, 20, 286, 378, 378, 378, 378, 378, 378,
- /* 2030 */ 378, 294, 378, 286, 378, 378, 299, 378, 301, 378,
- /* 2040 */ 378, 294, 378, 378, 378, 286, 299, 378, 301, 378,
- /* 2050 */ 378, 378, 378, 294, 378, 378, 378, 378, 299, 378,
- /* 2060 */ 301, 378, 378, 326, 378, 378, 378, 330, 331, 332,
- /* 2070 */ 333, 334, 335, 326, 337, 378, 378, 330, 331, 332,
- /* 2080 */ 333, 334, 335, 258, 337, 326, 378, 378, 378, 330,
- /* 2090 */ 331, 332, 333, 334, 335, 258, 337, 378, 378, 378,
- /* 2100 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
- /* 2110 */ 378, 286, 378, 378, 378, 378, 378, 378, 378, 294,
- /* 2120 */ 378, 378, 378, 286, 299, 378, 301, 378, 378, 378,
- /* 2130 */ 378, 294, 378, 378, 378, 378, 299, 378, 301, 378,
- /* 2140 */ 378, 378, 378, 378, 378, 378, 378, 378, 258, 378,
- /* 2150 */ 378, 326, 378, 378, 378, 330, 331, 332, 333, 334,
- /* 2160 */ 335, 378, 337, 326, 378, 378, 378, 330, 331, 332,
- /* 2170 */ 333, 334, 335, 378, 337, 378, 286, 378, 378, 378,
- /* 2180 */ 378, 378, 378, 378, 294, 378, 378, 378, 378, 299,
- /* 2190 */ 378, 301, 378, 378, 378, 378, 378, 378, 258, 378,
- /* 2200 */ 378, 378, 378, 378, 378, 378, 378, 378, 258, 378,
- /* 2210 */ 266, 378, 378, 378, 378, 378, 326, 378, 378, 378,
- /* 2220 */ 330, 331, 332, 333, 334, 335, 286, 337, 378, 378,
- /* 2230 */ 378, 378, 378, 378, 294, 378, 286, 378, 294, 299,
- /* 2240 */ 378, 301, 378, 378, 294, 378, 378, 378, 378, 299,
- /* 2250 */ 378, 301, 378, 378, 378, 378, 378, 378, 378, 315,
- /* 2260 */ 378, 378, 378, 378, 378, 378, 326, 378, 378, 378,
- /* 2270 */ 330, 331, 332, 333, 334, 335, 326, 337, 334, 378,
- /* 2280 */ 330, 331, 332, 333, 334, 335, 378, 337, 378, 378,
- /* 2290 */ 378, 378, 378, 349, 350, 351, 378, 353, 378, 378,
- /* 2300 */ 356, 378, 378, 378, 378, 378, 378, 378, 378, 378,
- /* 2310 */ 378, 378, 378, 369, 378, 378, 378, 373,
+ /* 210 */ 210, 211, 212, 213, 357, 357, 357, 357, 84, 301,
+ /* 220 */ 302, 87, 20, 166, 22, 168, 226, 370, 370, 370,
+ /* 230 */ 370, 374, 374, 374, 374, 8, 9, 316, 85, 12,
+ /* 240 */ 13, 14, 15, 16, 259, 165, 56, 167, 267, 43,
+ /* 250 */ 193, 194, 50, 196, 197, 198, 199, 200, 201, 202,
+ /* 260 */ 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
+ /* 270 */ 213, 12, 13, 0, 84, 20, 295, 87, 357, 20,
+ /* 280 */ 226, 22, 259, 149, 150, 300, 152, 0, 61, 85,
+ /* 290 */ 156, 370, 33, 60, 35, 374, 267, 24, 25, 26,
+ /* 300 */ 27, 28, 29, 30, 31, 32, 226, 278, 20, 175,
+ /* 310 */ 287, 259, 226, 86, 285, 56, 335, 357, 295, 316,
+ /* 320 */ 61, 94, 259, 300, 295, 302, 226, 68, 12, 13,
+ /* 330 */ 370, 350, 351, 352, 374, 354, 20, 267, 22, 0,
+ /* 340 */ 37, 273, 274, 193, 85, 97, 287, 60, 278, 33,
+ /* 350 */ 327, 35, 300, 294, 331, 332, 333, 334, 335, 336,
+ /* 360 */ 357, 338, 303, 300, 341, 295, 107, 119, 345, 346,
+ /* 370 */ 347, 0, 56, 370, 20, 148, 287, 374, 20, 226,
+ /* 380 */ 121, 122, 359, 294, 68, 235, 236, 237, 238, 239,
+ /* 390 */ 367, 88, 303, 90, 91, 312, 93, 314, 171, 0,
+ /* 400 */ 97, 85, 63, 64, 65, 66, 67, 227, 69, 70,
+ /* 410 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ /* 420 */ 81, 82, 119, 107, 20, 166, 22, 168, 8, 9,
+ /* 430 */ 226, 60, 12, 13, 14, 15, 16, 121, 122, 35,
+ /* 440 */ 4, 214, 215, 216, 217, 218, 219, 220, 221, 222,
+ /* 450 */ 223, 245, 193, 194, 50, 196, 197, 198, 199, 200,
+ /* 460 */ 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
+ /* 470 */ 211, 212, 213, 0, 56, 116, 117, 63, 64, 65,
+ /* 480 */ 44, 45, 166, 69, 168, 197, 72, 73, 273, 274,
+ /* 490 */ 76, 77, 78, 8, 9, 0, 289, 12, 13, 14,
+ /* 500 */ 15, 16, 117, 85, 60, 87, 259, 300, 79, 193,
+ /* 510 */ 194, 153, 196, 197, 198, 199, 200, 201, 202, 203,
+ /* 520 */ 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,
+ /* 530 */ 12, 13, 14, 326, 327, 328, 177, 14, 20, 180,
+ /* 540 */ 22, 259, 226, 20, 56, 338, 61, 300, 312, 279,
+ /* 550 */ 314, 33, 267, 35, 125, 126, 0, 287, 63, 64,
+ /* 560 */ 65, 176, 177, 278, 69, 180, 296, 72, 73, 287,
+ /* 570 */ 97, 76, 77, 78, 56, 87, 148, 295, 158, 94,
+ /* 580 */ 295, 151, 300, 4, 302, 287, 68, 12, 13, 116,
+ /* 590 */ 117, 118, 119, 120, 267, 20, 267, 22, 19, 171,
+ /* 600 */ 295, 303, 43, 85, 48, 278, 21, 278, 33, 327,
+ /* 610 */ 35, 306, 33, 331, 332, 333, 334, 335, 336, 34,
+ /* 620 */ 338, 36, 295, 341, 295, 107, 47, 345, 346, 347,
+ /* 630 */ 51, 56, 161, 148, 289, 56, 267, 267, 20, 121,
+ /* 640 */ 122, 289, 214, 68, 226, 300, 269, 278, 278, 367,
+ /* 650 */ 288, 14, 300, 259, 183, 184, 171, 20, 68, 282,
+ /* 660 */ 85, 231, 232, 84, 295, 295, 87, 290, 248, 8,
+ /* 670 */ 9, 326, 327, 12, 13, 14, 15, 16, 326, 327,
+ /* 680 */ 328, 302, 107, 338, 166, 14, 168, 14, 15, 16,
+ /* 690 */ 338, 20, 313, 259, 300, 96, 121, 122, 0, 214,
+ /* 700 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 1,
+ /* 710 */ 2, 193, 194, 3, 196, 197, 198, 199, 200, 201,
+ /* 720 */ 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
+ /* 730 */ 212, 213, 8, 9, 300, 329, 12, 13, 14, 15,
+ /* 740 */ 16, 166, 297, 168, 275, 300, 277, 86, 98, 99,
+ /* 750 */ 100, 101, 102, 103, 104, 105, 106, 107, 108, 353,
+ /* 760 */ 110, 111, 112, 113, 114, 115, 259, 43, 193, 194,
+ /* 770 */ 259, 196, 197, 198, 199, 200, 201, 202, 203, 204,
+ /* 780 */ 205, 206, 207, 208, 209, 210, 211, 212, 213, 12,
+ /* 790 */ 13, 18, 35, 20, 86, 97, 287, 20, 267, 22,
+ /* 800 */ 27, 259, 267, 30, 68, 296, 247, 300, 267, 278,
+ /* 810 */ 33, 300, 35, 278, 116, 117, 118, 119, 120, 278,
+ /* 820 */ 47, 267, 49, 0, 51, 68, 295, 267, 267, 287,
+ /* 830 */ 295, 20, 278, 56, 197, 39, 295, 295, 278, 278,
+ /* 840 */ 259, 259, 300, 43, 302, 68, 8, 9, 85, 295,
+ /* 850 */ 12, 13, 14, 15, 16, 295, 295, 84, 95, 8,
+ /* 860 */ 9, 267, 85, 12, 13, 14, 15, 16, 197, 327,
+ /* 870 */ 47, 97, 278, 331, 332, 333, 334, 335, 336, 288,
+ /* 880 */ 338, 300, 300, 341, 107, 259, 86, 345, 346, 295,
+ /* 890 */ 116, 117, 118, 119, 120, 42, 43, 124, 121, 122,
+ /* 900 */ 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
+ /* 910 */ 137, 138, 139, 140, 141, 142, 143, 144, 329, 146,
+ /* 920 */ 147, 288, 259, 2, 86, 329, 300, 18, 288, 8,
+ /* 930 */ 9, 259, 23, 12, 13, 14, 15, 16, 44, 45,
+ /* 940 */ 35, 267, 353, 166, 288, 168, 37, 38, 2, 353,
+ /* 950 */ 41, 320, 278, 243, 8, 9, 259, 43, 12, 13,
+ /* 960 */ 14, 15, 16, 300, 153, 259, 57, 58, 59, 295,
+ /* 970 */ 193, 194, 300, 196, 197, 198, 199, 200, 201, 202,
+ /* 980 */ 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
+ /* 990 */ 213, 19, 267, 287, 85, 280, 297, 300, 283, 300,
+ /* 1000 */ 86, 295, 288, 278, 153, 33, 300, 259, 302, 259,
+ /* 1010 */ 8, 9, 259, 259, 12, 13, 14, 15, 16, 47,
+ /* 1020 */ 295, 225, 316, 0, 52, 53, 54, 55, 56, 35,
+ /* 1030 */ 224, 225, 123, 327, 153, 154, 46, 331, 332, 333,
+ /* 1040 */ 334, 335, 336, 43, 338, 22, 259, 341, 300, 0,
+ /* 1050 */ 300, 345, 346, 300, 300, 89, 84, 0, 92, 87,
+ /* 1060 */ 12, 13, 89, 357, 43, 92, 61, 158, 159, 160,
+ /* 1070 */ 22, 22, 163, 168, 287, 85, 370, 288, 169, 22,
+ /* 1080 */ 374, 33, 295, 35, 43, 260, 86, 300, 86, 302,
+ /* 1090 */ 276, 182, 120, 377, 185, 43, 187, 188, 189, 190,
+ /* 1100 */ 191, 192, 289, 89, 56, 89, 92, 86, 92, 43,
+ /* 1110 */ 43, 43, 368, 300, 327, 43, 68, 43, 331, 332,
+ /* 1120 */ 333, 334, 335, 336, 152, 338, 43, 86, 341, 1,
+ /* 1130 */ 2, 268, 345, 346, 347, 226, 259, 287, 86, 326,
+ /* 1140 */ 327, 121, 122, 356, 43, 173, 43, 175, 43, 323,
+ /* 1150 */ 43, 338, 86, 86, 86, 107, 364, 268, 86, 266,
+ /* 1160 */ 86, 299, 168, 330, 287, 355, 348, 358, 371, 86,
+ /* 1170 */ 371, 228, 295, 371, 325, 20, 47, 300, 267, 302,
+ /* 1180 */ 324, 35, 164, 273, 318, 267, 267, 86, 148, 86,
+ /* 1190 */ 42, 86, 259, 86, 307, 305, 305, 267, 193, 267,
+ /* 1200 */ 261, 267, 20, 261, 327, 20, 322, 271, 331, 332,
+ /* 1210 */ 333, 334, 335, 336, 166, 338, 168, 302, 341, 271,
+ /* 1220 */ 287, 20, 345, 346, 20, 317, 271, 315, 295, 271,
+ /* 1230 */ 20, 315, 308, 300, 259, 302, 271, 267, 271, 271,
+ /* 1240 */ 261, 193, 194, 287, 287, 267, 287, 287, 287, 287,
+ /* 1250 */ 287, 287, 261, 205, 206, 207, 208, 209, 210, 211,
+ /* 1260 */ 327, 287, 287, 287, 331, 332, 333, 334, 335, 336,
+ /* 1270 */ 295, 338, 287, 322, 341, 300, 269, 302, 345, 346,
+ /* 1280 */ 347, 300, 174, 233, 302, 150, 269, 259, 269, 356,
+ /* 1290 */ 321, 267, 267, 300, 311, 315, 300, 259, 300, 300,
+ /* 1300 */ 311, 300, 327, 295, 309, 308, 331, 332, 333, 334,
+ /* 1310 */ 335, 336, 269, 338, 283, 287, 341, 295, 20, 234,
+ /* 1320 */ 345, 346, 347, 295, 269, 287, 300, 300, 300, 300,
+ /* 1330 */ 302, 356, 22, 295, 330, 300, 300, 240, 300, 229,
+ /* 1340 */ 302, 311, 365, 311, 157, 35, 242, 259, 225, 363,
+ /* 1350 */ 363, 363, 241, 295, 316, 327, 20, 259, 366, 331,
+ /* 1360 */ 332, 333, 334, 335, 336, 327, 338, 325, 362, 331,
+ /* 1370 */ 332, 333, 334, 335, 336, 287, 338, 246, 68, 249,
+ /* 1380 */ 329, 244, 373, 295, 372, 287, 373, 372, 300, 378,
+ /* 1390 */ 302, 85, 85, 295, 361, 357, 300, 360, 300, 277,
+ /* 1400 */ 302, 267, 269, 344, 316, 291, 36, 373, 370, 262,
+ /* 1410 */ 261, 372, 374, 319, 314, 327, 257, 107, 0, 331,
+ /* 1420 */ 332, 333, 334, 335, 336, 327, 338, 270, 0, 331,
+ /* 1430 */ 332, 333, 334, 335, 336, 337, 338, 339, 340, 259,
+ /* 1440 */ 267, 281, 281, 281, 176, 357, 0, 0, 42, 0,
+ /* 1450 */ 76, 0, 35, 186, 35, 35, 35, 186, 370, 0,
+ /* 1460 */ 35, 35, 374, 186, 0, 186, 0, 287, 295, 0,
+ /* 1470 */ 35, 0, 22, 35, 0, 295, 166, 85, 168, 171,
+ /* 1480 */ 300, 170, 302, 168, 166, 0, 0, 162, 161, 316,
+ /* 1490 */ 0, 0, 0, 259, 46, 0, 0, 145, 0, 0,
+ /* 1500 */ 0, 0, 0, 193, 194, 140, 0, 327, 335, 140,
+ /* 1510 */ 35, 331, 332, 333, 334, 335, 336, 259, 338, 0,
+ /* 1520 */ 0, 287, 42, 350, 351, 352, 0, 354, 0, 295,
+ /* 1530 */ 357, 0, 0, 0, 300, 0, 302, 0, 0, 0,
+ /* 1540 */ 0, 0, 0, 370, 0, 287, 0, 374, 0, 0,
+ /* 1550 */ 292, 0, 0, 295, 39, 375, 376, 0, 300, 0,
+ /* 1560 */ 302, 327, 0, 0, 0, 331, 332, 333, 334, 335,
+ /* 1570 */ 336, 259, 338, 56, 0, 341, 22, 56, 0, 0,
+ /* 1580 */ 346, 259, 14, 14, 0, 327, 43, 42, 0, 331,
+ /* 1590 */ 332, 333, 334, 335, 336, 0, 338, 0, 40, 287,
+ /* 1600 */ 39, 46, 46, 0, 292, 39, 0, 295, 0, 287,
+ /* 1610 */ 157, 0, 300, 0, 302, 62, 35, 295, 47, 39,
+ /* 1620 */ 0, 35, 300, 47, 302, 0, 39, 0, 35, 39,
+ /* 1630 */ 47, 259, 47, 35, 0, 39, 0, 0, 0, 327,
+ /* 1640 */ 35, 94, 92, 331, 332, 333, 334, 335, 336, 327,
+ /* 1650 */ 338, 22, 0, 331, 332, 333, 334, 335, 336, 287,
+ /* 1660 */ 338, 35, 43, 35, 43, 35, 35, 295, 35, 0,
+ /* 1670 */ 35, 22, 300, 22, 302, 35, 35, 0, 0, 22,
+ /* 1680 */ 35, 259, 0, 35, 0, 35, 0, 22, 49, 0,
+ /* 1690 */ 20, 369, 85, 259, 35, 0, 172, 22, 0, 327,
+ /* 1700 */ 0, 0, 0, 331, 332, 333, 334, 335, 336, 287,
+ /* 1710 */ 338, 0, 0, 153, 0, 181, 149, 295, 153, 39,
+ /* 1720 */ 150, 287, 300, 230, 302, 46, 292, 85, 153, 295,
+ /* 1730 */ 86, 85, 155, 43, 300, 230, 302, 43, 85, 85,
+ /* 1740 */ 151, 86, 95, 85, 230, 46, 86, 86, 376, 327,
+ /* 1750 */ 86, 85, 85, 331, 332, 333, 334, 335, 336, 85,
+ /* 1760 */ 338, 327, 340, 43, 46, 331, 332, 333, 334, 335,
+ /* 1770 */ 336, 259, 338, 85, 43, 46, 43, 86, 85, 43,
+ /* 1780 */ 46, 259, 86, 86, 46, 35, 35, 35, 35, 86,
+ /* 1790 */ 86, 35, 35, 2, 22, 193, 86, 224, 43, 287,
+ /* 1800 */ 85, 85, 22, 86, 292, 86, 85, 295, 46, 287,
+ /* 1810 */ 85, 85, 300, 46, 302, 85, 35, 295, 195, 96,
+ /* 1820 */ 35, 86, 300, 86, 302, 85, 85, 35, 86, 35,
+ /* 1830 */ 85, 259, 86, 35, 85, 35, 109, 109, 22, 327,
+ /* 1840 */ 97, 259, 35, 331, 332, 333, 334, 335, 336, 327,
+ /* 1850 */ 338, 259, 86, 331, 332, 333, 334, 335, 336, 287,
+ /* 1860 */ 338, 85, 85, 85, 85, 43, 22, 295, 109, 287,
+ /* 1870 */ 109, 62, 300, 61, 302, 43, 35, 295, 68, 287,
+ /* 1880 */ 83, 35, 300, 35, 302, 35, 35, 295, 35, 22,
+ /* 1890 */ 35, 35, 300, 68, 302, 35, 35, 35, 35, 327,
+ /* 1900 */ 35, 35, 0, 331, 332, 333, 334, 335, 336, 327,
+ /* 1910 */ 338, 35, 35, 331, 332, 333, 334, 335, 336, 327,
+ /* 1920 */ 338, 35, 47, 331, 332, 333, 334, 335, 336, 39,
+ /* 1930 */ 338, 0, 259, 35, 47, 39, 0, 0, 35, 47,
+ /* 1940 */ 39, 35, 47, 39, 0, 35, 35, 0, 22, 21,
+ /* 1950 */ 21, 259, 22, 20, 22, 379, 379, 379, 379, 379,
+ /* 1960 */ 287, 379, 379, 379, 379, 379, 379, 379, 295, 379,
+ /* 1970 */ 379, 379, 379, 300, 379, 302, 379, 379, 379, 287,
+ /* 1980 */ 379, 379, 379, 379, 379, 379, 379, 295, 379, 379,
+ /* 1990 */ 379, 379, 300, 379, 302, 379, 379, 379, 379, 379,
+ /* 2000 */ 327, 379, 379, 379, 331, 332, 333, 334, 335, 336,
+ /* 2010 */ 379, 338, 379, 259, 379, 379, 379, 379, 379, 327,
+ /* 2020 */ 379, 379, 379, 331, 332, 333, 334, 335, 336, 259,
+ /* 2030 */ 338, 379, 379, 379, 379, 379, 379, 379, 379, 379,
+ /* 2040 */ 379, 287, 379, 379, 379, 379, 379, 379, 379, 295,
+ /* 2050 */ 379, 379, 379, 379, 300, 379, 302, 287, 379, 379,
+ /* 2060 */ 379, 379, 379, 379, 379, 295, 379, 379, 379, 379,
+ /* 2070 */ 300, 379, 302, 379, 379, 379, 379, 379, 379, 379,
+ /* 2080 */ 379, 327, 259, 379, 379, 331, 332, 333, 334, 335,
+ /* 2090 */ 336, 379, 338, 379, 379, 379, 379, 327, 379, 259,
+ /* 2100 */ 379, 331, 332, 333, 334, 335, 336, 379, 338, 379,
+ /* 2110 */ 287, 379, 379, 379, 379, 379, 379, 379, 295, 379,
+ /* 2120 */ 379, 379, 379, 300, 379, 302, 379, 287, 379, 379,
+ /* 2130 */ 379, 379, 379, 379, 379, 295, 379, 379, 379, 379,
+ /* 2140 */ 300, 379, 302, 379, 379, 379, 379, 379, 379, 379,
+ /* 2150 */ 327, 379, 259, 379, 331, 332, 333, 334, 335, 336,
+ /* 2160 */ 379, 338, 379, 379, 259, 379, 379, 327, 379, 379,
+ /* 2170 */ 379, 331, 332, 333, 334, 335, 336, 379, 338, 379,
+ /* 2180 */ 287, 379, 379, 379, 379, 379, 379, 379, 295, 379,
+ /* 2190 */ 379, 379, 287, 300, 379, 302, 379, 379, 379, 379,
+ /* 2200 */ 295, 379, 379, 379, 379, 300, 379, 302, 379, 379,
+ /* 2210 */ 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
+ /* 2220 */ 327, 379, 379, 379, 331, 332, 333, 334, 335, 336,
+ /* 2230 */ 379, 338, 327, 259, 379, 379, 331, 332, 333, 334,
+ /* 2240 */ 335, 336, 379, 338, 379, 379, 379, 259, 379, 379,
+ /* 2250 */ 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
+ /* 2260 */ 379, 287, 379, 379, 379, 379, 379, 379, 379, 295,
+ /* 2270 */ 379, 379, 379, 379, 300, 287, 302, 379, 379, 379,
+ /* 2280 */ 379, 379, 379, 295, 379, 379, 379, 379, 300, 259,
+ /* 2290 */ 302, 379, 379, 379, 379, 379, 379, 379, 379, 379,
+ /* 2300 */ 379, 327, 379, 379, 379, 331, 332, 333, 334, 335,
+ /* 2310 */ 336, 379, 338, 379, 379, 327, 379, 287, 379, 331,
+ /* 2320 */ 332, 333, 334, 335, 336, 295, 338, 379, 379, 379,
+ /* 2330 */ 300, 379, 302, 379, 379, 379, 379, 379, 379, 379,
+ /* 2340 */ 379, 259, 379, 379, 379, 379, 379, 379, 379, 379,
+ /* 2350 */ 379, 379, 379, 379, 379, 379, 379, 327, 379, 259,
+ /* 2360 */ 379, 331, 332, 333, 334, 335, 336, 379, 338, 287,
+ /* 2370 */ 379, 379, 379, 379, 379, 379, 379, 295, 379, 379,
+ /* 2380 */ 379, 379, 300, 259, 302, 379, 379, 287, 379, 379,
+ /* 2390 */ 379, 379, 379, 379, 379, 295, 379, 379, 379, 379,
+ /* 2400 */ 300, 379, 302, 379, 379, 379, 379, 379, 379, 327,
+ /* 2410 */ 379, 287, 379, 331, 332, 333, 334, 335, 336, 295,
+ /* 2420 */ 338, 379, 379, 379, 300, 379, 302, 327, 379, 379,
+ /* 2430 */ 379, 331, 332, 333, 334, 335, 336, 379, 338, 267,
+ /* 2440 */ 259, 379, 379, 379, 379, 379, 379, 379, 379, 379,
+ /* 2450 */ 379, 327, 379, 379, 379, 331, 332, 333, 334, 335,
+ /* 2460 */ 336, 379, 338, 379, 379, 379, 379, 295, 287, 379,
+ /* 2470 */ 379, 379, 379, 379, 379, 379, 295, 379, 379, 379,
+ /* 2480 */ 379, 300, 379, 302, 379, 379, 379, 379, 316, 379,
+ /* 2490 */ 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
+ /* 2500 */ 379, 379, 379, 379, 379, 379, 379, 335, 327, 379,
+ /* 2510 */ 379, 379, 331, 332, 333, 334, 335, 336, 379, 338,
+ /* 2520 */ 379, 379, 350, 351, 352, 379, 354, 379, 379, 357,
+ /* 2530 */ 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
+ /* 2540 */ 379, 379, 370, 379, 379, 379, 374,
};
-#define YY_SHIFT_COUNT (665)
+#define YY_SHIFT_COUNT (668)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (2008)
+#define YY_SHIFT_MAX (1947)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 911, 0, 0, 62, 62, 263, 263, 263, 320, 320,
- /* 10 */ 263, 263, 521, 578, 779, 578, 578, 578, 578, 578,
- /* 20 */ 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- /* 30 */ 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- /* 40 */ 578, 578, 209, 209, 35, 35, 35, 980, 980, 980,
- /* 50 */ 980, 208, 350, 32, 32, 167, 167, 19, 19, 11,
- /* 60 */ 38, 32, 32, 167, 167, 167, 167, 167, 167, 167,
- /* 70 */ 167, 167, 182, 167, 167, 167, 230, 352, 167, 167,
- /* 80 */ 352, 438, 167, 352, 352, 352, 167, 452, 775, 231,
- /* 90 */ 489, 489, 13, 98, 730, 730, 730, 730, 730, 730,
- /* 100 */ 730, 730, 730, 730, 730, 730, 730, 730, 730, 730,
- /* 110 */ 730, 730, 730, 418, 38, 522, 522, 383, 567, 576,
- /* 120 */ 480, 480, 480, 567, 558, 230, 1, 1, 352, 352,
- /* 130 */ 585, 585, 663, 696, 201, 201, 201, 201, 201, 201,
- /* 140 */ 201, 1594, 125, 684, 119, 573, 69, 313, 343, 351,
- /* 150 */ 631, 529, 494, 39, 548, 514, 673, 514, 708, 842,
- /* 160 */ 842, 842, 250, 666, 1045, 916, 1125, 1116, 1133, 1011,
- /* 170 */ 1125, 1125, 1152, 1067, 1067, 1125, 1125, 1125, 1203, 1203,
- /* 180 */ 1208, 182, 230, 182, 1212, 1215, 182, 1212, 182, 1228,
- /* 190 */ 182, 182, 1125, 182, 1203, 352, 352, 352, 352, 352,
- /* 200 */ 352, 352, 352, 352, 352, 352, 1125, 1203, 585, 1208,
- /* 210 */ 452, 1108, 230, 452, 1125, 1125, 1212, 452, 1074, 585,
- /* 220 */ 585, 585, 585, 1074, 585, 1177, 558, 1228, 452, 663,
- /* 230 */ 452, 558, 1325, 585, 1114, 1074, 585, 585, 1114, 1074,
- /* 240 */ 585, 585, 352, 1121, 1206, 1114, 1123, 1147, 1160, 916,
- /* 250 */ 1166, 558, 1376, 1154, 1158, 1155, 1154, 1158, 1154, 1158,
- /* 260 */ 1317, 1045, 585, 696, 1125, 452, 1375, 1203, 2318, 2318,
- /* 270 */ 2318, 2318, 2318, 2318, 2318, 601, 910, 386, 1241, 469,
- /* 280 */ 551, 682, 840, 879, 853, 727, 1037, 314, 314, 314,
- /* 290 */ 314, 314, 314, 314, 314, 1061, 699, 274, 274, 445,
- /* 300 */ 65, 108, 156, 44, 168, 602, 339, 200, 200, 200,
- /* 310 */ 200, 297, 784, 843, 848, 862, 912, 57, 850, 928,
- /* 320 */ 92, 864, 990, 1039, 1040, 1051, 1052, 1054, 1063, 819,
- /* 330 */ 762, 702, 883, 1064, 771, 994, 812, 1066, 1043, 1096,
- /* 340 */ 1117, 1118, 1126, 1127, 1128, 937, 906, 1056, 1435, 1270,
- /* 350 */ 1448, 1457, 1416, 1459, 1384, 1461, 1427, 1278, 1428, 1431,
- /* 360 */ 1432, 1282, 1469, 1437, 1438, 1284, 1474, 1289, 1477, 1443,
- /* 370 */ 1480, 1460, 1481, 1452, 1485, 1403, 1318, 1320, 1324, 1328,
- /* 380 */ 1495, 1497, 1337, 1339, 1502, 1503, 1458, 1505, 1507, 1509,
- /* 390 */ 1365, 1512, 1513, 1514, 1524, 1525, 1396, 1491, 1543, 1405,
- /* 400 */ 1546, 1547, 1548, 1558, 1559, 1560, 1561, 1566, 1567, 1569,
- /* 410 */ 1570, 1572, 1573, 1574, 1508, 1551, 1552, 1553, 1554, 1555,
- /* 420 */ 1556, 1557, 1575, 1577, 1580, 1581, 1583, 1528, 1585, 1530,
- /* 430 */ 1587, 1590, 1549, 1562, 1563, 1578, 1571, 1591, 1576, 1599,
- /* 440 */ 1564, 1579, 1619, 1620, 1623, 1586, 1471, 1626, 1632, 1633,
- /* 450 */ 1589, 1634, 1635, 1601, 1568, 1598, 1638, 1604, 1593, 1606,
- /* 460 */ 1642, 1608, 1605, 1614, 1654, 1622, 1612, 1616, 1668, 1669,
- /* 470 */ 1670, 1674, 1582, 1592, 1640, 1655, 1679, 1647, 1648, 1651,
- /* 480 */ 1653, 1646, 1649, 1656, 1658, 1659, 1660, 1690, 1675, 1696,
- /* 490 */ 1677, 1652, 1700, 1688, 1676, 1713, 1680, 1722, 1689, 1725,
- /* 500 */ 1704, 1707, 1728, 1584, 1694, 1731, 1588, 1710, 1595, 1597,
- /* 510 */ 1733, 1734, 1600, 1602, 1735, 1738, 1739, 1671, 1666, 1596,
- /* 520 */ 1740, 1678, 1610, 1683, 1741, 1703, 1613, 1685, 1650, 1697,
- /* 530 */ 1711, 1526, 1687, 1673, 1705, 1693, 1702, 1709, 1721, 1714,
- /* 540 */ 1712, 1716, 1726, 1724, 1732, 1719, 1743, 1727, 1752, 1545,
- /* 550 */ 1729, 1730, 1750, 1607, 1756, 1767, 1768, 1745, 1774, 1609,
- /* 560 */ 1746, 1784, 1786, 1799, 1802, 1804, 1805, 1746, 1839, 1820,
- /* 570 */ 1661, 1800, 1760, 1761, 1763, 1764, 1770, 1766, 1807, 1771,
- /* 580 */ 1772, 1812, 1824, 1664, 1777, 1776, 1788, 1828, 1835, 1790,
- /* 590 */ 1791, 1843, 1794, 1806, 1851, 1803, 1808, 1855, 1810, 1813,
- /* 600 */ 1856, 1811, 1789, 1796, 1797, 1798, 1871, 1814, 1815, 1818,
- /* 610 */ 1873, 1827, 1867, 1867, 1891, 1857, 1859, 1882, 1850, 1838,
- /* 620 */ 1879, 1888, 1889, 1892, 1893, 1895, 1904, 1896, 1897, 1874,
- /* 630 */ 1646, 1909, 1649, 1919, 1920, 1922, 1924, 1925, 1927, 1928,
- /* 640 */ 1964, 1930, 1923, 1932, 1969, 1937, 1926, 1935, 1976, 1942,
- /* 650 */ 1931, 1945, 1979, 1946, 1938, 1947, 1996, 1968, 1971, 2008,
- /* 660 */ 1987, 1989, 1997, 1998, 2000, 2002,
+ /* 0 */ 909, 0, 0, 57, 57, 259, 259, 259, 316, 316,
+ /* 10 */ 259, 259, 518, 575, 777, 575, 575, 575, 575, 575,
+ /* 20 */ 575, 575, 575, 575, 575, 575, 575, 575, 575, 575,
+ /* 30 */ 575, 575, 575, 575, 575, 575, 575, 575, 575, 575,
+ /* 40 */ 575, 575, 54, 54, 53, 53, 53, 1048, 1048, 86,
+ /* 50 */ 1048, 1048, 80, 418, 153, 204, 153, 19, 19, 436,
+ /* 60 */ 436, 100, 61, 153, 153, 19, 19, 19, 19, 19,
+ /* 70 */ 19, 19, 19, 19, 233, 19, 19, 19, 97, 255,
+ /* 80 */ 19, 19, 255, 354, 19, 255, 255, 255, 19, 444,
+ /* 90 */ 773, 227, 485, 485, 122, 414, 1310, 1310, 1310, 1310,
+ /* 100 */ 1310, 1310, 1310, 1310, 1310, 1310, 1310, 1310, 1310, 1310,
+ /* 110 */ 1310, 1310, 1310, 1310, 1310, 303, 61, 523, 523, 287,
+ /* 120 */ 127, 371, 358, 358, 358, 127, 618, 97, 399, 399,
+ /* 130 */ 255, 255, 590, 590, 599, 736, 650, 650, 650, 650,
+ /* 140 */ 650, 650, 650, 972, 21, 495, 420, 150, 404, 385,
+ /* 150 */ 430, 637, 671, 202, 894, 248, 811, 806, 796, 806,
+ /* 160 */ 853, 710, 710, 710, 180, 288, 943, 1155, 1129, 1146,
+ /* 170 */ 1018, 1155, 1155, 1148, 1040, 1040, 1155, 1155, 1155, 1182,
+ /* 180 */ 1182, 1185, 233, 97, 233, 1201, 1204, 233, 1201, 233,
+ /* 190 */ 1210, 233, 233, 1155, 233, 1182, 255, 255, 255, 255,
+ /* 200 */ 255, 255, 255, 255, 255, 255, 255, 1155, 1182, 590,
+ /* 210 */ 1185, 444, 1108, 97, 444, 1155, 1155, 1201, 444, 1050,
+ /* 220 */ 590, 590, 590, 590, 1050, 590, 1135, 618, 1210, 444,
+ /* 230 */ 599, 444, 618, 1298, 590, 1085, 1050, 590, 590, 1085,
+ /* 240 */ 1050, 590, 590, 255, 1097, 1187, 1085, 1104, 1111, 1110,
+ /* 250 */ 943, 1123, 618, 1336, 1131, 1137, 1130, 1131, 1137, 1131,
+ /* 260 */ 1137, 1306, 1307, 590, 736, 1155, 444, 1370, 1182, 2547,
+ /* 270 */ 2547, 2547, 2547, 2547, 2547, 2547, 339, 134, 273, 579,
+ /* 280 */ 661, 724, 838, 921, 946, 851, 1002, 473, 51, 51,
+ /* 290 */ 51, 51, 51, 51, 51, 51, 698, 774, 145, 145,
+ /* 300 */ 359, 471, 190, 429, 585, 13, 708, 428, 673, 673,
+ /* 310 */ 673, 673, 84, 823, 800, 966, 973, 1014, 1016, 1023,
+ /* 320 */ 1049, 1057, 488, 881, 914, 1000, 1021, 1041, 1052, 1066,
+ /* 330 */ 1068, 1128, 1020, 206, 559, 1072, 905, 994, 1005, 1067,
+ /* 340 */ 990, 1074, 1083, 1101, 1103, 1105, 1107, 763, 757, 556,
+ /* 350 */ 1418, 1428, 1268, 1446, 1447, 1406, 1449, 1374, 1451, 1417,
+ /* 360 */ 1267, 1419, 1420, 1421, 1271, 1459, 1425, 1426, 1277, 1464,
+ /* 370 */ 1279, 1466, 1435, 1469, 1450, 1471, 1438, 1474, 1392, 1308,
+ /* 380 */ 1311, 1315, 1318, 1485, 1486, 1325, 1327, 1490, 1491, 1448,
+ /* 390 */ 1492, 1495, 1496, 1352, 1498, 1499, 1500, 1501, 1502, 1365,
+ /* 400 */ 1475, 1506, 1369, 1519, 1520, 1526, 1528, 1531, 1532, 1533,
+ /* 410 */ 1535, 1537, 1538, 1539, 1540, 1541, 1542, 1480, 1544, 1546,
+ /* 420 */ 1548, 1549, 1551, 1552, 1554, 1557, 1559, 1562, 1563, 1564,
+ /* 430 */ 1517, 1574, 1521, 1578, 1579, 1545, 1515, 1543, 1568, 1555,
+ /* 440 */ 1569, 1556, 1584, 1558, 1561, 1588, 1595, 1597, 1566, 1453,
+ /* 450 */ 1603, 1606, 1608, 1553, 1611, 1613, 1581, 1571, 1580, 1620,
+ /* 460 */ 1586, 1576, 1587, 1625, 1593, 1583, 1590, 1627, 1598, 1585,
+ /* 470 */ 1596, 1634, 1636, 1637, 1638, 1547, 1550, 1605, 1629, 1652,
+ /* 480 */ 1626, 1628, 1630, 1631, 1619, 1621, 1633, 1635, 1640, 1641,
+ /* 490 */ 1669, 1649, 1677, 1651, 1639, 1678, 1657, 1645, 1682, 1648,
+ /* 500 */ 1684, 1650, 1686, 1665, 1670, 1689, 1560, 1659, 1695, 1524,
+ /* 510 */ 1675, 1565, 1570, 1698, 1700, 1575, 1577, 1701, 1702, 1711,
+ /* 520 */ 1607, 1644, 1534, 1712, 1642, 1589, 1646, 1714, 1680, 1567,
+ /* 530 */ 1653, 1647, 1679, 1690, 1493, 1654, 1655, 1658, 1660, 1661,
+ /* 540 */ 1666, 1694, 1664, 1667, 1674, 1688, 1691, 1720, 1699, 1718,
+ /* 550 */ 1693, 1731, 1505, 1696, 1697, 1729, 1573, 1733, 1734, 1738,
+ /* 560 */ 1703, 1736, 1514, 1704, 1750, 1751, 1752, 1753, 1756, 1757,
+ /* 570 */ 1704, 1791, 1772, 1602, 1755, 1715, 1710, 1716, 1717, 1721,
+ /* 580 */ 1719, 1762, 1725, 1726, 1767, 1780, 1623, 1730, 1723, 1735,
+ /* 590 */ 1781, 1785, 1740, 1737, 1792, 1741, 1742, 1794, 1745, 1746,
+ /* 600 */ 1798, 1749, 1766, 1800, 1776, 1727, 1728, 1759, 1761, 1816,
+ /* 610 */ 1743, 1777, 1778, 1807, 1779, 1822, 1822, 1844, 1809, 1812,
+ /* 620 */ 1841, 1810, 1797, 1832, 1846, 1848, 1850, 1851, 1853, 1867,
+ /* 630 */ 1855, 1856, 1825, 1619, 1860, 1621, 1861, 1862, 1863, 1865,
+ /* 640 */ 1866, 1876, 1877, 1902, 1886, 1875, 1890, 1931, 1898, 1887,
+ /* 650 */ 1896, 1936, 1903, 1892, 1901, 1937, 1906, 1895, 1904, 1944,
+ /* 660 */ 1910, 1911, 1947, 1926, 1928, 1930, 1932, 1929, 1933,
};
-#define YY_REDUCE_COUNT (274)
-#define YY_REDUCE_MIN (-312)
-#define YY_REDUCE_MAX (1950)
+#define YY_REDUCE_COUNT (275)
+#define YY_REDUCE_MIN (-294)
+#define YY_REDUCE_MAX (2181)
static const short yy_reduce_ofst[] = {
- /* 0 */ -78, -232, 63, 286, -113, 709, 787, 865, 907, 968,
- /* 10 */ 545, 978, 1035, 1049, 1099, 1119, 1185, 1197, 1207, 1263,
- /* 20 */ 1277, 1330, 1372, 1386, 1450, 1472, 1492, 1534, 1550, 1603,
- /* 30 */ 1615, 1657, 1667, 1681, 1737, 1747, 1759, 1825, 1837, 1890,
- /* 40 */ 1940, 1950, -263, 1944, -14, 75, 305, -278, 55, 270,
- /* 50 */ 726, -296, 123, 184, 643, -266, -43, -260, -256, -303,
- /* 60 */ -186, -230, -191, -185, 97, 315, 316, 363, 557, 563,
- /* 70 */ 564, 566, -154, 659, 661, 665, -285, -106, 667, 732,
- /* 80 */ 59, 24, 734, 72, 322, 82, 753, 70, -252, -312,
- /* 90 */ -312, -312, -117, -239, -114, -20, 141, 181, 196, 289,
- /* 100 */ 328, 435, 455, 505, 575, 672, 766, 769, 773, 780,
- /* 110 */ 792, 809, 817, 299, -110, 124, 138, -220, 148, -243,
- /* 120 */ 218, 310, 364, 150, 354, 349, 336, 456, 319, 205,
- /* 130 */ 474, 498, 476, 562, -280, -270, 382, 513, 538, 633,
- /* 140 */ 669, 641, 748, 366, 644, 654, 756, 735, 695, 791,
- /* 150 */ 791, 811, 825, 794, 776, 757, 757, 757, 763, 742,
- /* 160 */ 744, 745, 778, 791, 851, 820, 881, 844, 900, 859,
- /* 170 */ 917, 926, 901, 913, 914, 950, 953, 955, 964, 965,
- /* 180 */ 908, 957, 929, 961, 920, 927, 976, 933, 979, 943,
- /* 190 */ 981, 982, 987, 985, 996, 971, 972, 973, 975, 984,
- /* 200 */ 989, 992, 995, 998, 999, 1000, 1002, 1005, 967, 952,
- /* 210 */ 1003, 969, 986, 1022, 1025, 1029, 1006, 1028, 1004, 1017,
- /* 220 */ 1018, 1020, 1027, 1021, 1031, 1024, 1044, 1026, 1071, 1058,
- /* 230 */ 1076, 1048, 1023, 1047, 991, 1041, 1050, 1055, 993, 1046,
- /* 240 */ 1059, 1060, 791, 997, 1012, 1016, 1030, 1032, 1036, 1065,
- /* 250 */ 757, 1100, 1069, 1034, 1033, 1038, 1042, 1057, 1068, 1070,
- /* 260 */ 1073, 1122, 1109, 1131, 1143, 1149, 1161, 1159, 1103, 1113,
- /* 270 */ 1157, 1162, 1167, 1169, 1171,
+ /* 0 */ -254, -201, 706, 23, 282, 787, 933, 975, 1038, 1088,
+ /* 10 */ 542, 877, 1098, 1180, 1234, 1258, 1312, 1322, 1372, 1422,
+ /* 20 */ 1434, 1512, 1028, 1522, 1572, 1582, 1592, 1673, 1692, 1754,
+ /* 30 */ 1770, 1823, 1840, 1893, 1905, 1974, 1988, 2030, 2082, 2100,
+ /* 40 */ 2124, 2181, 1173, 2172, -240, -263, -19, 207, 352, -277,
+ /* 50 */ 345, 813, -142, -141, -140, -79, 3, -267, 29, -260,
+ /* 60 */ -229, -274, -258, -143, -40, -159, 70, 285, 327, 329,
+ /* 70 */ 369, 370, 531, 535, -270, 541, 554, 560, -294, -272,
+ /* 80 */ 561, 594, 59, -257, 674, -124, 89, 270, 725, 377,
+ /* 90 */ -226, -219, -219, -219, -176, -247, -202, -15, 52, 63,
+ /* 100 */ 247, 394, 434, 507, 511, 581, 582, 626, 663, 672,
+ /* 110 */ 697, 748, 750, 753, 754, -158, -82, -162, -87, -262,
+ /* 120 */ 68, -215, 406, 589, 596, 215, 305, 379, 83, 236,
+ /* 130 */ 509, 298, 445, 699, 715, 469, 362, 591, 633, 640,
+ /* 140 */ 656, 714, 789, 631, 825, 814, 716, 744, 863, 826,
+ /* 150 */ 792, 850, 850, 889, 893, 862, 833, 810, 810, 810,
+ /* 160 */ 818, 797, 799, 802, 809, 850, 849, 911, 856, 910,
+ /* 170 */ 866, 918, 919, 887, 890, 891, 930, 932, 934, 939,
+ /* 180 */ 942, 884, 936, 915, 948, 912, 908, 955, 916, 958,
+ /* 190 */ 924, 965, 967, 970, 968, 979, 956, 957, 959, 960,
+ /* 200 */ 961, 962, 963, 964, 974, 976, 985, 978, 991, 981,
+ /* 210 */ 951, 1007, 969, 982, 1017, 1024, 1025, 980, 1019, 983,
+ /* 220 */ 993, 996, 998, 999, 989, 1001, 995, 1008, 997, 1043,
+ /* 230 */ 1031, 1055, 1022, 1004, 1026, 986, 1030, 1027, 1029, 987,
+ /* 240 */ 1032, 1035, 1036, 850, 992, 977, 988, 1006, 1033, 1037,
+ /* 250 */ 1042, 810, 1058, 1051, 1009, 1012, 1011, 1013, 1015, 1034,
+ /* 260 */ 1039, 1059, 1114, 1096, 1122, 1134, 1133, 1147, 1149, 1094,
+ /* 270 */ 1100, 1160, 1161, 1162, 1157, 1159,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 10 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 20 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 30 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 40 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 50 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 60 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 70 */ 1459, 1459, 1533, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 80 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1531, 1686, 1459,
- /* 90 */ 1864, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 100 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 110 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1533, 1459, 1531,
- /* 120 */ 1876, 1876, 1876, 1459, 1459, 1459, 1730, 1730, 1459, 1459,
- /* 130 */ 1459, 1459, 1629, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 140 */ 1459, 1722, 1459, 1459, 1945, 1459, 1459, 1728, 1899, 1459,
- /* 150 */ 1459, 1459, 1459, 1582, 1891, 1868, 1882, 1869, 1866, 1930,
- /* 160 */ 1930, 1930, 1885, 1459, 1598, 1895, 1459, 1459, 1459, 1714,
- /* 170 */ 1459, 1459, 1691, 1688, 1688, 1459, 1459, 1459, 1459, 1459,
- /* 180 */ 1459, 1533, 1459, 1533, 1459, 1459, 1533, 1459, 1533, 1459,
- /* 190 */ 1533, 1533, 1459, 1533, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 200 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 210 */ 1531, 1724, 1459, 1531, 1459, 1459, 1459, 1531, 1904, 1459,
- /* 220 */ 1459, 1459, 1459, 1904, 1459, 1459, 1459, 1459, 1531, 1459,
- /* 230 */ 1531, 1459, 1459, 1459, 1906, 1904, 1459, 1459, 1906, 1904,
- /* 240 */ 1459, 1459, 1459, 1918, 1914, 1906, 1922, 1920, 1897, 1895,
- /* 250 */ 1882, 1459, 1459, 1936, 1932, 1948, 1936, 1932, 1936, 1932,
- /* 260 */ 1459, 1598, 1459, 1459, 1459, 1531, 1491, 1459, 1716, 1730,
- /* 270 */ 1632, 1632, 1632, 1534, 1464, 1459, 1459, 1459, 1459, 1459,
- /* 280 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1802, 1917, 1916,
- /* 290 */ 1840, 1839, 1838, 1836, 1801, 1459, 1594, 1800, 1799, 1459,
- /* 300 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1793, 1794, 1792,
- /* 310 */ 1791, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 320 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1865,
- /* 330 */ 1459, 1933, 1937, 1459, 1459, 1459, 1459, 1459, 1776, 1459,
- /* 340 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 350 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 360 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 370 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 380 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 390 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 400 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 410 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 420 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 430 */ 1459, 1459, 1459, 1459, 1496, 1459, 1459, 1459, 1459, 1459,
- /* 440 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 450 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 460 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 470 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 480 */ 1459, 1563, 1562, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 490 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 500 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 510 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 520 */ 1734, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 530 */ 1898, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 540 */ 1459, 1459, 1459, 1459, 1459, 1459, 1776, 1459, 1915, 1459,
- /* 550 */ 1875, 1871, 1459, 1459, 1867, 1775, 1459, 1459, 1931, 1459,
- /* 560 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1860, 1459,
- /* 570 */ 1459, 1833, 1818, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 580 */ 1459, 1459, 1459, 1787, 1459, 1459, 1459, 1459, 1459, 1626,
- /* 590 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 600 */ 1459, 1459, 1611, 1609, 1608, 1607, 1459, 1604, 1459, 1459,
- /* 610 */ 1459, 1459, 1635, 1634, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 620 */ 1554, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 630 */ 1545, 1459, 1544, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 640 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 650 */ 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459,
- /* 660 */ 1459, 1459, 1459, 1459, 1459, 1459,
+ /* 0 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 10 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 20 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 30 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 40 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 50 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 60 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 70 */ 1465, 1465, 1465, 1465, 1539, 1465, 1465, 1465, 1465, 1465,
+ /* 80 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1537,
+ /* 90 */ 1692, 1465, 1872, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 100 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 110 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1539,
+ /* 120 */ 1465, 1537, 1884, 1884, 1884, 1465, 1465, 1465, 1736, 1736,
+ /* 130 */ 1465, 1465, 1465, 1465, 1635, 1465, 1465, 1465, 1465, 1465,
+ /* 140 */ 1465, 1465, 1465, 1728, 1465, 1465, 1953, 1465, 1465, 1734,
+ /* 150 */ 1907, 1465, 1465, 1465, 1465, 1588, 1899, 1876, 1890, 1877,
+ /* 160 */ 1874, 1938, 1938, 1938, 1893, 1465, 1903, 1465, 1465, 1465,
+ /* 170 */ 1720, 1465, 1465, 1697, 1694, 1694, 1465, 1465, 1465, 1465,
+ /* 180 */ 1465, 1465, 1539, 1465, 1539, 1465, 1465, 1539, 1465, 1539,
+ /* 190 */ 1465, 1539, 1539, 1465, 1539, 1465, 1465, 1465, 1465, 1465,
+ /* 200 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 210 */ 1465, 1537, 1730, 1465, 1537, 1465, 1465, 1465, 1537, 1912,
+ /* 220 */ 1465, 1465, 1465, 1465, 1912, 1465, 1465, 1465, 1465, 1537,
+ /* 230 */ 1465, 1537, 1465, 1465, 1465, 1914, 1912, 1465, 1465, 1914,
+ /* 240 */ 1912, 1465, 1465, 1465, 1926, 1922, 1914, 1930, 1928, 1905,
+ /* 250 */ 1903, 1890, 1465, 1465, 1944, 1940, 1956, 1944, 1940, 1944,
+ /* 260 */ 1940, 1465, 1604, 1465, 1465, 1465, 1537, 1497, 1465, 1722,
+ /* 270 */ 1736, 1638, 1638, 1638, 1540, 1470, 1465, 1465, 1465, 1465,
+ /* 280 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1809, 1925,
+ /* 290 */ 1924, 1848, 1847, 1846, 1844, 1808, 1465, 1600, 1807, 1806,
+ /* 300 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1800, 1801,
+ /* 310 */ 1799, 1798, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 320 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 330 */ 1465, 1873, 1465, 1941, 1945, 1465, 1465, 1465, 1465, 1465,
+ /* 340 */ 1783, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 350 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 360 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 370 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 380 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 390 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 400 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 410 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 420 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 430 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1502, 1465, 1465,
+ /* 440 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 450 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 460 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 470 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 480 */ 1465, 1465, 1465, 1465, 1569, 1568, 1465, 1465, 1465, 1465,
+ /* 490 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 500 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 510 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 520 */ 1465, 1465, 1465, 1740, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 530 */ 1465, 1465, 1465, 1906, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 540 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1783,
+ /* 550 */ 1465, 1923, 1465, 1883, 1879, 1465, 1465, 1875, 1782, 1465,
+ /* 560 */ 1465, 1939, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 570 */ 1465, 1868, 1465, 1465, 1841, 1826, 1465, 1465, 1465, 1465,
+ /* 580 */ 1465, 1465, 1465, 1465, 1465, 1465, 1794, 1465, 1465, 1465,
+ /* 590 */ 1465, 1465, 1632, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 600 */ 1465, 1465, 1465, 1465, 1465, 1617, 1615, 1614, 1613, 1465,
+ /* 610 */ 1610, 1465, 1465, 1465, 1465, 1641, 1640, 1465, 1465, 1465,
+ /* 620 */ 1465, 1465, 1465, 1560, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 630 */ 1465, 1465, 1465, 1551, 1465, 1550, 1465, 1465, 1465, 1465,
+ /* 640 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 650 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ /* 660 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -1075,10 +1121,11 @@ static const YYCODETYPE yyFallback[] = {
0, /* NK_ARROW => nothing */
0, /* ROWTS => nothing */
0, /* TBNAME => nothing */
- 0, /* QSTARTTS => nothing */
- 0, /* QENDTS => nothing */
- 0, /* WSTARTTS => nothing */
- 0, /* WENDTS => nothing */
+ 0, /* QSTART => nothing */
+ 0, /* QEND => nothing */
+ 0, /* QDURATION => nothing */
+ 0, /* WSTART => nothing */
+ 0, /* WEND => nothing */
0, /* WDURATION => nothing */
0, /* CAST => nothing */
0, /* NOW => nothing */
@@ -1127,11 +1174,11 @@ static const YYCODETYPE yyFallback[] = {
0, /* ASC => nothing */
0, /* NULLS => nothing */
0, /* ID => nothing */
- 249, /* NK_BITNOT => ID */
- 249, /* VALUES => ID */
- 249, /* IMPORT => ID */
- 249, /* NK_SEMI => ID */
- 249, /* FILE => ID */
+ 250, /* NK_BITNOT => ID */
+ 250, /* VALUES => ID */
+ 250, /* IMPORT => ID */
+ 250, /* NK_SEMI => ID */
+ 250, /* FILE => ID */
};
#endif /* YYFALLBACK */
@@ -1417,186 +1464,187 @@ static const char *const yyTokenName[] = {
/* 195 */ "NK_ARROW",
/* 196 */ "ROWTS",
/* 197 */ "TBNAME",
- /* 198 */ "QSTARTTS",
- /* 199 */ "QENDTS",
- /* 200 */ "WSTARTTS",
- /* 201 */ "WENDTS",
- /* 202 */ "WDURATION",
- /* 203 */ "CAST",
- /* 204 */ "NOW",
- /* 205 */ "TODAY",
- /* 206 */ "TIMEZONE",
- /* 207 */ "CLIENT_VERSION",
- /* 208 */ "SERVER_VERSION",
- /* 209 */ "SERVER_STATUS",
- /* 210 */ "CURRENT_USER",
- /* 211 */ "COUNT",
- /* 212 */ "LAST_ROW",
- /* 213 */ "BETWEEN",
- /* 214 */ "IS",
- /* 215 */ "NK_LT",
- /* 216 */ "NK_GT",
- /* 217 */ "NK_LE",
- /* 218 */ "NK_GE",
- /* 219 */ "NK_NE",
- /* 220 */ "MATCH",
- /* 221 */ "NMATCH",
- /* 222 */ "CONTAINS",
- /* 223 */ "JOIN",
- /* 224 */ "INNER",
- /* 225 */ "SELECT",
- /* 226 */ "DISTINCT",
- /* 227 */ "WHERE",
- /* 228 */ "PARTITION",
- /* 229 */ "BY",
- /* 230 */ "SESSION",
- /* 231 */ "STATE_WINDOW",
- /* 232 */ "SLIDING",
- /* 233 */ "FILL",
- /* 234 */ "VALUE",
- /* 235 */ "NONE",
- /* 236 */ "PREV",
- /* 237 */ "LINEAR",
- /* 238 */ "NEXT",
- /* 239 */ "HAVING",
- /* 240 */ "RANGE",
- /* 241 */ "EVERY",
- /* 242 */ "ORDER",
- /* 243 */ "SLIMIT",
- /* 244 */ "SOFFSET",
- /* 245 */ "LIMIT",
- /* 246 */ "OFFSET",
- /* 247 */ "ASC",
- /* 248 */ "NULLS",
- /* 249 */ "ID",
- /* 250 */ "NK_BITNOT",
- /* 251 */ "VALUES",
- /* 252 */ "IMPORT",
- /* 253 */ "NK_SEMI",
- /* 254 */ "FILE",
- /* 255 */ "cmd",
- /* 256 */ "account_options",
- /* 257 */ "alter_account_options",
- /* 258 */ "literal",
- /* 259 */ "alter_account_option",
- /* 260 */ "user_name",
- /* 261 */ "sysinfo_opt",
- /* 262 */ "privileges",
- /* 263 */ "priv_level",
- /* 264 */ "priv_type_list",
- /* 265 */ "priv_type",
- /* 266 */ "db_name",
- /* 267 */ "dnode_endpoint",
- /* 268 */ "not_exists_opt",
- /* 269 */ "db_options",
- /* 270 */ "exists_opt",
- /* 271 */ "alter_db_options",
- /* 272 */ "integer_list",
- /* 273 */ "variable_list",
- /* 274 */ "retention_list",
- /* 275 */ "alter_db_option",
- /* 276 */ "retention",
- /* 277 */ "full_table_name",
- /* 278 */ "column_def_list",
- /* 279 */ "tags_def_opt",
- /* 280 */ "table_options",
- /* 281 */ "multi_create_clause",
- /* 282 */ "tags_def",
- /* 283 */ "multi_drop_clause",
- /* 284 */ "alter_table_clause",
- /* 285 */ "alter_table_options",
- /* 286 */ "column_name",
- /* 287 */ "type_name",
- /* 288 */ "signed_literal",
- /* 289 */ "create_subtable_clause",
- /* 290 */ "specific_cols_opt",
- /* 291 */ "expression_list",
- /* 292 */ "drop_table_clause",
- /* 293 */ "col_name_list",
- /* 294 */ "table_name",
- /* 295 */ "column_def",
- /* 296 */ "duration_list",
- /* 297 */ "rollup_func_list",
- /* 298 */ "alter_table_option",
- /* 299 */ "duration_literal",
- /* 300 */ "rollup_func_name",
- /* 301 */ "function_name",
- /* 302 */ "col_name",
- /* 303 */ "db_name_cond_opt",
- /* 304 */ "like_pattern_opt",
- /* 305 */ "table_name_cond",
- /* 306 */ "from_db_opt",
- /* 307 */ "index_name",
- /* 308 */ "index_options",
- /* 309 */ "func_list",
- /* 310 */ "sliding_opt",
- /* 311 */ "sma_stream_opt",
- /* 312 */ "func",
- /* 313 */ "stream_options",
- /* 314 */ "topic_name",
- /* 315 */ "query_expression",
- /* 316 */ "cgroup_name",
- /* 317 */ "analyze_opt",
- /* 318 */ "explain_options",
- /* 319 */ "agg_func_opt",
- /* 320 */ "bufsize_opt",
- /* 321 */ "stream_name",
- /* 322 */ "into_opt",
- /* 323 */ "dnode_list",
- /* 324 */ "where_clause_opt",
- /* 325 */ "signed",
- /* 326 */ "literal_func",
- /* 327 */ "literal_list",
- /* 328 */ "table_alias",
- /* 329 */ "column_alias",
- /* 330 */ "expression",
- /* 331 */ "pseudo_column",
- /* 332 */ "column_reference",
- /* 333 */ "function_expression",
- /* 334 */ "subquery",
- /* 335 */ "star_func",
- /* 336 */ "star_func_para_list",
- /* 337 */ "noarg_func",
- /* 338 */ "other_para_list",
- /* 339 */ "star_func_para",
- /* 340 */ "predicate",
- /* 341 */ "compare_op",
- /* 342 */ "in_op",
- /* 343 */ "in_predicate_value",
- /* 344 */ "boolean_value_expression",
- /* 345 */ "boolean_primary",
- /* 346 */ "common_expression",
- /* 347 */ "from_clause_opt",
- /* 348 */ "table_reference_list",
- /* 349 */ "table_reference",
- /* 350 */ "table_primary",
- /* 351 */ "joined_table",
- /* 352 */ "alias_opt",
- /* 353 */ "parenthesized_joined_table",
- /* 354 */ "join_type",
- /* 355 */ "search_condition",
- /* 356 */ "query_specification",
- /* 357 */ "set_quantifier_opt",
- /* 358 */ "select_list",
- /* 359 */ "partition_by_clause_opt",
- /* 360 */ "range_opt",
- /* 361 */ "every_opt",
- /* 362 */ "fill_opt",
- /* 363 */ "twindow_clause_opt",
- /* 364 */ "group_by_clause_opt",
- /* 365 */ "having_clause_opt",
- /* 366 */ "select_item",
- /* 367 */ "fill_mode",
- /* 368 */ "group_by_list",
- /* 369 */ "query_expression_body",
- /* 370 */ "order_by_clause_opt",
- /* 371 */ "slimit_clause_opt",
- /* 372 */ "limit_clause_opt",
- /* 373 */ "query_primary",
- /* 374 */ "sort_specification_list",
- /* 375 */ "sort_specification",
- /* 376 */ "ordering_specification_opt",
- /* 377 */ "null_ordering_opt",
+ /* 198 */ "QSTART",
+ /* 199 */ "QEND",
+ /* 200 */ "QDURATION",
+ /* 201 */ "WSTART",
+ /* 202 */ "WEND",
+ /* 203 */ "WDURATION",
+ /* 204 */ "CAST",
+ /* 205 */ "NOW",
+ /* 206 */ "TODAY",
+ /* 207 */ "TIMEZONE",
+ /* 208 */ "CLIENT_VERSION",
+ /* 209 */ "SERVER_VERSION",
+ /* 210 */ "SERVER_STATUS",
+ /* 211 */ "CURRENT_USER",
+ /* 212 */ "COUNT",
+ /* 213 */ "LAST_ROW",
+ /* 214 */ "BETWEEN",
+ /* 215 */ "IS",
+ /* 216 */ "NK_LT",
+ /* 217 */ "NK_GT",
+ /* 218 */ "NK_LE",
+ /* 219 */ "NK_GE",
+ /* 220 */ "NK_NE",
+ /* 221 */ "MATCH",
+ /* 222 */ "NMATCH",
+ /* 223 */ "CONTAINS",
+ /* 224 */ "JOIN",
+ /* 225 */ "INNER",
+ /* 226 */ "SELECT",
+ /* 227 */ "DISTINCT",
+ /* 228 */ "WHERE",
+ /* 229 */ "PARTITION",
+ /* 230 */ "BY",
+ /* 231 */ "SESSION",
+ /* 232 */ "STATE_WINDOW",
+ /* 233 */ "SLIDING",
+ /* 234 */ "FILL",
+ /* 235 */ "VALUE",
+ /* 236 */ "NONE",
+ /* 237 */ "PREV",
+ /* 238 */ "LINEAR",
+ /* 239 */ "NEXT",
+ /* 240 */ "HAVING",
+ /* 241 */ "RANGE",
+ /* 242 */ "EVERY",
+ /* 243 */ "ORDER",
+ /* 244 */ "SLIMIT",
+ /* 245 */ "SOFFSET",
+ /* 246 */ "LIMIT",
+ /* 247 */ "OFFSET",
+ /* 248 */ "ASC",
+ /* 249 */ "NULLS",
+ /* 250 */ "ID",
+ /* 251 */ "NK_BITNOT",
+ /* 252 */ "VALUES",
+ /* 253 */ "IMPORT",
+ /* 254 */ "NK_SEMI",
+ /* 255 */ "FILE",
+ /* 256 */ "cmd",
+ /* 257 */ "account_options",
+ /* 258 */ "alter_account_options",
+ /* 259 */ "literal",
+ /* 260 */ "alter_account_option",
+ /* 261 */ "user_name",
+ /* 262 */ "sysinfo_opt",
+ /* 263 */ "privileges",
+ /* 264 */ "priv_level",
+ /* 265 */ "priv_type_list",
+ /* 266 */ "priv_type",
+ /* 267 */ "db_name",
+ /* 268 */ "dnode_endpoint",
+ /* 269 */ "not_exists_opt",
+ /* 270 */ "db_options",
+ /* 271 */ "exists_opt",
+ /* 272 */ "alter_db_options",
+ /* 273 */ "integer_list",
+ /* 274 */ "variable_list",
+ /* 275 */ "retention_list",
+ /* 276 */ "alter_db_option",
+ /* 277 */ "retention",
+ /* 278 */ "full_table_name",
+ /* 279 */ "column_def_list",
+ /* 280 */ "tags_def_opt",
+ /* 281 */ "table_options",
+ /* 282 */ "multi_create_clause",
+ /* 283 */ "tags_def",
+ /* 284 */ "multi_drop_clause",
+ /* 285 */ "alter_table_clause",
+ /* 286 */ "alter_table_options",
+ /* 287 */ "column_name",
+ /* 288 */ "type_name",
+ /* 289 */ "signed_literal",
+ /* 290 */ "create_subtable_clause",
+ /* 291 */ "specific_cols_opt",
+ /* 292 */ "expression_list",
+ /* 293 */ "drop_table_clause",
+ /* 294 */ "col_name_list",
+ /* 295 */ "table_name",
+ /* 296 */ "column_def",
+ /* 297 */ "duration_list",
+ /* 298 */ "rollup_func_list",
+ /* 299 */ "alter_table_option",
+ /* 300 */ "duration_literal",
+ /* 301 */ "rollup_func_name",
+ /* 302 */ "function_name",
+ /* 303 */ "col_name",
+ /* 304 */ "db_name_cond_opt",
+ /* 305 */ "like_pattern_opt",
+ /* 306 */ "table_name_cond",
+ /* 307 */ "from_db_opt",
+ /* 308 */ "index_name",
+ /* 309 */ "index_options",
+ /* 310 */ "func_list",
+ /* 311 */ "sliding_opt",
+ /* 312 */ "sma_stream_opt",
+ /* 313 */ "func",
+ /* 314 */ "stream_options",
+ /* 315 */ "topic_name",
+ /* 316 */ "query_expression",
+ /* 317 */ "cgroup_name",
+ /* 318 */ "analyze_opt",
+ /* 319 */ "explain_options",
+ /* 320 */ "agg_func_opt",
+ /* 321 */ "bufsize_opt",
+ /* 322 */ "stream_name",
+ /* 323 */ "into_opt",
+ /* 324 */ "dnode_list",
+ /* 325 */ "where_clause_opt",
+ /* 326 */ "signed",
+ /* 327 */ "literal_func",
+ /* 328 */ "literal_list",
+ /* 329 */ "table_alias",
+ /* 330 */ "column_alias",
+ /* 331 */ "expression",
+ /* 332 */ "pseudo_column",
+ /* 333 */ "column_reference",
+ /* 334 */ "function_expression",
+ /* 335 */ "subquery",
+ /* 336 */ "star_func",
+ /* 337 */ "star_func_para_list",
+ /* 338 */ "noarg_func",
+ /* 339 */ "other_para_list",
+ /* 340 */ "star_func_para",
+ /* 341 */ "predicate",
+ /* 342 */ "compare_op",
+ /* 343 */ "in_op",
+ /* 344 */ "in_predicate_value",
+ /* 345 */ "boolean_value_expression",
+ /* 346 */ "boolean_primary",
+ /* 347 */ "common_expression",
+ /* 348 */ "from_clause_opt",
+ /* 349 */ "table_reference_list",
+ /* 350 */ "table_reference",
+ /* 351 */ "table_primary",
+ /* 352 */ "joined_table",
+ /* 353 */ "alias_opt",
+ /* 354 */ "parenthesized_joined_table",
+ /* 355 */ "join_type",
+ /* 356 */ "search_condition",
+ /* 357 */ "query_specification",
+ /* 358 */ "set_quantifier_opt",
+ /* 359 */ "select_list",
+ /* 360 */ "partition_by_clause_opt",
+ /* 361 */ "range_opt",
+ /* 362 */ "every_opt",
+ /* 363 */ "fill_opt",
+ /* 364 */ "twindow_clause_opt",
+ /* 365 */ "group_by_clause_opt",
+ /* 366 */ "having_clause_opt",
+ /* 367 */ "select_item",
+ /* 368 */ "fill_mode",
+ /* 369 */ "group_by_list",
+ /* 370 */ "query_expression_body",
+ /* 371 */ "order_by_clause_opt",
+ /* 372 */ "slimit_clause_opt",
+ /* 373 */ "limit_clause_opt",
+ /* 374 */ "query_primary",
+ /* 375 */ "sort_specification_list",
+ /* 376 */ "sort_specification",
+ /* 377 */ "ordering_specification_opt",
+ /* 378 */ "null_ordering_opt",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
@@ -1890,209 +1938,211 @@ static const char *const yyRuleName[] = {
/* 283 */ "cmd ::= SYNCDB db_name REPLICA",
/* 284 */ "cmd ::= DELETE FROM full_table_name where_clause_opt",
/* 285 */ "cmd ::= query_expression",
- /* 286 */ "cmd ::= INSERT INTO full_table_name specific_cols_opt query_expression",
- /* 287 */ "literal ::= NK_INTEGER",
- /* 288 */ "literal ::= NK_FLOAT",
- /* 289 */ "literal ::= NK_STRING",
- /* 290 */ "literal ::= NK_BOOL",
- /* 291 */ "literal ::= TIMESTAMP NK_STRING",
- /* 292 */ "literal ::= duration_literal",
- /* 293 */ "literal ::= NULL",
- /* 294 */ "literal ::= NK_QUESTION",
- /* 295 */ "duration_literal ::= NK_VARIABLE",
- /* 296 */ "signed ::= NK_INTEGER",
- /* 297 */ "signed ::= NK_PLUS NK_INTEGER",
- /* 298 */ "signed ::= NK_MINUS NK_INTEGER",
- /* 299 */ "signed ::= NK_FLOAT",
- /* 300 */ "signed ::= NK_PLUS NK_FLOAT",
- /* 301 */ "signed ::= NK_MINUS NK_FLOAT",
- /* 302 */ "signed_literal ::= signed",
- /* 303 */ "signed_literal ::= NK_STRING",
- /* 304 */ "signed_literal ::= NK_BOOL",
- /* 305 */ "signed_literal ::= TIMESTAMP NK_STRING",
- /* 306 */ "signed_literal ::= duration_literal",
- /* 307 */ "signed_literal ::= NULL",
- /* 308 */ "signed_literal ::= literal_func",
- /* 309 */ "signed_literal ::= NK_QUESTION",
- /* 310 */ "literal_list ::= signed_literal",
- /* 311 */ "literal_list ::= literal_list NK_COMMA signed_literal",
- /* 312 */ "db_name ::= NK_ID",
- /* 313 */ "table_name ::= NK_ID",
- /* 314 */ "column_name ::= NK_ID",
- /* 315 */ "function_name ::= NK_ID",
- /* 316 */ "table_alias ::= NK_ID",
- /* 317 */ "column_alias ::= NK_ID",
- /* 318 */ "user_name ::= NK_ID",
- /* 319 */ "index_name ::= NK_ID",
- /* 320 */ "topic_name ::= NK_ID",
- /* 321 */ "stream_name ::= NK_ID",
- /* 322 */ "cgroup_name ::= NK_ID",
- /* 323 */ "expression ::= literal",
- /* 324 */ "expression ::= pseudo_column",
- /* 325 */ "expression ::= column_reference",
- /* 326 */ "expression ::= function_expression",
- /* 327 */ "expression ::= subquery",
- /* 328 */ "expression ::= NK_LP expression NK_RP",
- /* 329 */ "expression ::= NK_PLUS expression",
- /* 330 */ "expression ::= NK_MINUS expression",
- /* 331 */ "expression ::= expression NK_PLUS expression",
- /* 332 */ "expression ::= expression NK_MINUS expression",
- /* 333 */ "expression ::= expression NK_STAR expression",
- /* 334 */ "expression ::= expression NK_SLASH expression",
- /* 335 */ "expression ::= expression NK_REM expression",
- /* 336 */ "expression ::= column_reference NK_ARROW NK_STRING",
- /* 337 */ "expression ::= expression NK_BITAND expression",
- /* 338 */ "expression ::= expression NK_BITOR expression",
- /* 339 */ "expression_list ::= expression",
- /* 340 */ "expression_list ::= expression_list NK_COMMA expression",
- /* 341 */ "column_reference ::= column_name",
- /* 342 */ "column_reference ::= table_name NK_DOT column_name",
- /* 343 */ "pseudo_column ::= ROWTS",
- /* 344 */ "pseudo_column ::= TBNAME",
- /* 345 */ "pseudo_column ::= table_name NK_DOT TBNAME",
- /* 346 */ "pseudo_column ::= QSTARTTS",
- /* 347 */ "pseudo_column ::= QENDTS",
- /* 348 */ "pseudo_column ::= WSTARTTS",
- /* 349 */ "pseudo_column ::= WENDTS",
- /* 350 */ "pseudo_column ::= WDURATION",
- /* 351 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
- /* 352 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
- /* 353 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP",
- /* 354 */ "function_expression ::= literal_func",
- /* 355 */ "literal_func ::= noarg_func NK_LP NK_RP",
- /* 356 */ "literal_func ::= NOW",
- /* 357 */ "noarg_func ::= NOW",
- /* 358 */ "noarg_func ::= TODAY",
- /* 359 */ "noarg_func ::= TIMEZONE",
- /* 360 */ "noarg_func ::= DATABASE",
- /* 361 */ "noarg_func ::= CLIENT_VERSION",
- /* 362 */ "noarg_func ::= SERVER_VERSION",
- /* 363 */ "noarg_func ::= SERVER_STATUS",
- /* 364 */ "noarg_func ::= CURRENT_USER",
- /* 365 */ "noarg_func ::= USER",
- /* 366 */ "star_func ::= COUNT",
- /* 367 */ "star_func ::= FIRST",
- /* 368 */ "star_func ::= LAST",
- /* 369 */ "star_func ::= LAST_ROW",
- /* 370 */ "star_func_para_list ::= NK_STAR",
- /* 371 */ "star_func_para_list ::= other_para_list",
- /* 372 */ "other_para_list ::= star_func_para",
- /* 373 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
- /* 374 */ "star_func_para ::= expression",
- /* 375 */ "star_func_para ::= table_name NK_DOT NK_STAR",
- /* 376 */ "predicate ::= expression compare_op expression",
- /* 377 */ "predicate ::= expression BETWEEN expression AND expression",
- /* 378 */ "predicate ::= expression NOT BETWEEN expression AND expression",
- /* 379 */ "predicate ::= expression IS NULL",
- /* 380 */ "predicate ::= expression IS NOT NULL",
- /* 381 */ "predicate ::= expression in_op in_predicate_value",
- /* 382 */ "compare_op ::= NK_LT",
- /* 383 */ "compare_op ::= NK_GT",
- /* 384 */ "compare_op ::= NK_LE",
- /* 385 */ "compare_op ::= NK_GE",
- /* 386 */ "compare_op ::= NK_NE",
- /* 387 */ "compare_op ::= NK_EQ",
- /* 388 */ "compare_op ::= LIKE",
- /* 389 */ "compare_op ::= NOT LIKE",
- /* 390 */ "compare_op ::= MATCH",
- /* 391 */ "compare_op ::= NMATCH",
- /* 392 */ "compare_op ::= CONTAINS",
- /* 393 */ "in_op ::= IN",
- /* 394 */ "in_op ::= NOT IN",
- /* 395 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
- /* 396 */ "boolean_value_expression ::= boolean_primary",
- /* 397 */ "boolean_value_expression ::= NOT boolean_primary",
- /* 398 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
- /* 399 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
- /* 400 */ "boolean_primary ::= predicate",
- /* 401 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
- /* 402 */ "common_expression ::= expression",
- /* 403 */ "common_expression ::= boolean_value_expression",
- /* 404 */ "from_clause_opt ::=",
- /* 405 */ "from_clause_opt ::= FROM table_reference_list",
- /* 406 */ "table_reference_list ::= table_reference",
- /* 407 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
- /* 408 */ "table_reference ::= table_primary",
- /* 409 */ "table_reference ::= joined_table",
- /* 410 */ "table_primary ::= table_name alias_opt",
- /* 411 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
- /* 412 */ "table_primary ::= subquery alias_opt",
- /* 413 */ "table_primary ::= parenthesized_joined_table",
- /* 414 */ "alias_opt ::=",
- /* 415 */ "alias_opt ::= table_alias",
- /* 416 */ "alias_opt ::= AS table_alias",
- /* 417 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
- /* 418 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
- /* 419 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
- /* 420 */ "join_type ::=",
- /* 421 */ "join_type ::= INNER",
- /* 422 */ "query_specification ::= SELECT set_quantifier_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",
- /* 423 */ "set_quantifier_opt ::=",
- /* 424 */ "set_quantifier_opt ::= DISTINCT",
- /* 425 */ "set_quantifier_opt ::= ALL",
- /* 426 */ "select_list ::= select_item",
- /* 427 */ "select_list ::= select_list NK_COMMA select_item",
- /* 428 */ "select_item ::= NK_STAR",
- /* 429 */ "select_item ::= common_expression",
- /* 430 */ "select_item ::= common_expression column_alias",
- /* 431 */ "select_item ::= common_expression AS column_alias",
- /* 432 */ "select_item ::= table_name NK_DOT NK_STAR",
- /* 433 */ "where_clause_opt ::=",
- /* 434 */ "where_clause_opt ::= WHERE search_condition",
- /* 435 */ "partition_by_clause_opt ::=",
- /* 436 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
- /* 437 */ "twindow_clause_opt ::=",
- /* 438 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
- /* 439 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
- /* 440 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
- /* 441 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
- /* 442 */ "sliding_opt ::=",
- /* 443 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
- /* 444 */ "fill_opt ::=",
- /* 445 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
- /* 446 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
- /* 447 */ "fill_mode ::= NONE",
- /* 448 */ "fill_mode ::= PREV",
- /* 449 */ "fill_mode ::= NULL",
- /* 450 */ "fill_mode ::= LINEAR",
- /* 451 */ "fill_mode ::= NEXT",
- /* 452 */ "group_by_clause_opt ::=",
- /* 453 */ "group_by_clause_opt ::= GROUP BY group_by_list",
- /* 454 */ "group_by_list ::= expression",
- /* 455 */ "group_by_list ::= group_by_list NK_COMMA expression",
- /* 456 */ "having_clause_opt ::=",
- /* 457 */ "having_clause_opt ::= HAVING search_condition",
- /* 458 */ "range_opt ::=",
- /* 459 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP",
- /* 460 */ "every_opt ::=",
- /* 461 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
- /* 462 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
- /* 463 */ "query_expression_body ::= query_primary",
- /* 464 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
- /* 465 */ "query_expression_body ::= query_expression_body UNION query_expression_body",
- /* 466 */ "query_primary ::= query_specification",
- /* 467 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP",
- /* 468 */ "order_by_clause_opt ::=",
- /* 469 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
- /* 470 */ "slimit_clause_opt ::=",
- /* 471 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
- /* 472 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
- /* 473 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 474 */ "limit_clause_opt ::=",
- /* 475 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
- /* 476 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
- /* 477 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 478 */ "subquery ::= NK_LP query_expression NK_RP",
- /* 479 */ "search_condition ::= common_expression",
- /* 480 */ "sort_specification_list ::= sort_specification",
- /* 481 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
- /* 482 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
- /* 483 */ "ordering_specification_opt ::=",
- /* 484 */ "ordering_specification_opt ::= ASC",
- /* 485 */ "ordering_specification_opt ::= DESC",
- /* 486 */ "null_ordering_opt ::=",
- /* 487 */ "null_ordering_opt ::= NULLS FIRST",
- /* 488 */ "null_ordering_opt ::= NULLS LAST",
+ /* 286 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression",
+ /* 287 */ "cmd ::= INSERT INTO full_table_name query_expression",
+ /* 288 */ "literal ::= NK_INTEGER",
+ /* 289 */ "literal ::= NK_FLOAT",
+ /* 290 */ "literal ::= NK_STRING",
+ /* 291 */ "literal ::= NK_BOOL",
+ /* 292 */ "literal ::= TIMESTAMP NK_STRING",
+ /* 293 */ "literal ::= duration_literal",
+ /* 294 */ "literal ::= NULL",
+ /* 295 */ "literal ::= NK_QUESTION",
+ /* 296 */ "duration_literal ::= NK_VARIABLE",
+ /* 297 */ "signed ::= NK_INTEGER",
+ /* 298 */ "signed ::= NK_PLUS NK_INTEGER",
+ /* 299 */ "signed ::= NK_MINUS NK_INTEGER",
+ /* 300 */ "signed ::= NK_FLOAT",
+ /* 301 */ "signed ::= NK_PLUS NK_FLOAT",
+ /* 302 */ "signed ::= NK_MINUS NK_FLOAT",
+ /* 303 */ "signed_literal ::= signed",
+ /* 304 */ "signed_literal ::= NK_STRING",
+ /* 305 */ "signed_literal ::= NK_BOOL",
+ /* 306 */ "signed_literal ::= TIMESTAMP NK_STRING",
+ /* 307 */ "signed_literal ::= duration_literal",
+ /* 308 */ "signed_literal ::= NULL",
+ /* 309 */ "signed_literal ::= literal_func",
+ /* 310 */ "signed_literal ::= NK_QUESTION",
+ /* 311 */ "literal_list ::= signed_literal",
+ /* 312 */ "literal_list ::= literal_list NK_COMMA signed_literal",
+ /* 313 */ "db_name ::= NK_ID",
+ /* 314 */ "table_name ::= NK_ID",
+ /* 315 */ "column_name ::= NK_ID",
+ /* 316 */ "function_name ::= NK_ID",
+ /* 317 */ "table_alias ::= NK_ID",
+ /* 318 */ "column_alias ::= NK_ID",
+ /* 319 */ "user_name ::= NK_ID",
+ /* 320 */ "index_name ::= NK_ID",
+ /* 321 */ "topic_name ::= NK_ID",
+ /* 322 */ "stream_name ::= NK_ID",
+ /* 323 */ "cgroup_name ::= NK_ID",
+ /* 324 */ "expression ::= literal",
+ /* 325 */ "expression ::= pseudo_column",
+ /* 326 */ "expression ::= column_reference",
+ /* 327 */ "expression ::= function_expression",
+ /* 328 */ "expression ::= subquery",
+ /* 329 */ "expression ::= NK_LP expression NK_RP",
+ /* 330 */ "expression ::= NK_PLUS expression",
+ /* 331 */ "expression ::= NK_MINUS expression",
+ /* 332 */ "expression ::= expression NK_PLUS expression",
+ /* 333 */ "expression ::= expression NK_MINUS expression",
+ /* 334 */ "expression ::= expression NK_STAR expression",
+ /* 335 */ "expression ::= expression NK_SLASH expression",
+ /* 336 */ "expression ::= expression NK_REM expression",
+ /* 337 */ "expression ::= column_reference NK_ARROW NK_STRING",
+ /* 338 */ "expression ::= expression NK_BITAND expression",
+ /* 339 */ "expression ::= expression NK_BITOR expression",
+ /* 340 */ "expression_list ::= expression",
+ /* 341 */ "expression_list ::= expression_list NK_COMMA expression",
+ /* 342 */ "column_reference ::= column_name",
+ /* 343 */ "column_reference ::= table_name NK_DOT column_name",
+ /* 344 */ "pseudo_column ::= ROWTS",
+ /* 345 */ "pseudo_column ::= TBNAME",
+ /* 346 */ "pseudo_column ::= table_name NK_DOT TBNAME",
+ /* 347 */ "pseudo_column ::= QSTART",
+ /* 348 */ "pseudo_column ::= QEND",
+ /* 349 */ "pseudo_column ::= QDURATION",
+ /* 350 */ "pseudo_column ::= WSTART",
+ /* 351 */ "pseudo_column ::= WEND",
+ /* 352 */ "pseudo_column ::= WDURATION",
+ /* 353 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
+ /* 354 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
+ /* 355 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP",
+ /* 356 */ "function_expression ::= literal_func",
+ /* 357 */ "literal_func ::= noarg_func NK_LP NK_RP",
+ /* 358 */ "literal_func ::= NOW",
+ /* 359 */ "noarg_func ::= NOW",
+ /* 360 */ "noarg_func ::= TODAY",
+ /* 361 */ "noarg_func ::= TIMEZONE",
+ /* 362 */ "noarg_func ::= DATABASE",
+ /* 363 */ "noarg_func ::= CLIENT_VERSION",
+ /* 364 */ "noarg_func ::= SERVER_VERSION",
+ /* 365 */ "noarg_func ::= SERVER_STATUS",
+ /* 366 */ "noarg_func ::= CURRENT_USER",
+ /* 367 */ "noarg_func ::= USER",
+ /* 368 */ "star_func ::= COUNT",
+ /* 369 */ "star_func ::= FIRST",
+ /* 370 */ "star_func ::= LAST",
+ /* 371 */ "star_func ::= LAST_ROW",
+ /* 372 */ "star_func_para_list ::= NK_STAR",
+ /* 373 */ "star_func_para_list ::= other_para_list",
+ /* 374 */ "other_para_list ::= star_func_para",
+ /* 375 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
+ /* 376 */ "star_func_para ::= expression",
+ /* 377 */ "star_func_para ::= table_name NK_DOT NK_STAR",
+ /* 378 */ "predicate ::= expression compare_op expression",
+ /* 379 */ "predicate ::= expression BETWEEN expression AND expression",
+ /* 380 */ "predicate ::= expression NOT BETWEEN expression AND expression",
+ /* 381 */ "predicate ::= expression IS NULL",
+ /* 382 */ "predicate ::= expression IS NOT NULL",
+ /* 383 */ "predicate ::= expression in_op in_predicate_value",
+ /* 384 */ "compare_op ::= NK_LT",
+ /* 385 */ "compare_op ::= NK_GT",
+ /* 386 */ "compare_op ::= NK_LE",
+ /* 387 */ "compare_op ::= NK_GE",
+ /* 388 */ "compare_op ::= NK_NE",
+ /* 389 */ "compare_op ::= NK_EQ",
+ /* 390 */ "compare_op ::= LIKE",
+ /* 391 */ "compare_op ::= NOT LIKE",
+ /* 392 */ "compare_op ::= MATCH",
+ /* 393 */ "compare_op ::= NMATCH",
+ /* 394 */ "compare_op ::= CONTAINS",
+ /* 395 */ "in_op ::= IN",
+ /* 396 */ "in_op ::= NOT IN",
+ /* 397 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
+ /* 398 */ "boolean_value_expression ::= boolean_primary",
+ /* 399 */ "boolean_value_expression ::= NOT boolean_primary",
+ /* 400 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
+ /* 401 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
+ /* 402 */ "boolean_primary ::= predicate",
+ /* 403 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
+ /* 404 */ "common_expression ::= expression",
+ /* 405 */ "common_expression ::= boolean_value_expression",
+ /* 406 */ "from_clause_opt ::=",
+ /* 407 */ "from_clause_opt ::= FROM table_reference_list",
+ /* 408 */ "table_reference_list ::= table_reference",
+ /* 409 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
+ /* 410 */ "table_reference ::= table_primary",
+ /* 411 */ "table_reference ::= joined_table",
+ /* 412 */ "table_primary ::= table_name alias_opt",
+ /* 413 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
+ /* 414 */ "table_primary ::= subquery alias_opt",
+ /* 415 */ "table_primary ::= parenthesized_joined_table",
+ /* 416 */ "alias_opt ::=",
+ /* 417 */ "alias_opt ::= table_alias",
+ /* 418 */ "alias_opt ::= AS table_alias",
+ /* 419 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
+ /* 420 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
+ /* 421 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
+ /* 422 */ "join_type ::=",
+ /* 423 */ "join_type ::= INNER",
+ /* 424 */ "query_specification ::= SELECT set_quantifier_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",
+ /* 425 */ "set_quantifier_opt ::=",
+ /* 426 */ "set_quantifier_opt ::= DISTINCT",
+ /* 427 */ "set_quantifier_opt ::= ALL",
+ /* 428 */ "select_list ::= select_item",
+ /* 429 */ "select_list ::= select_list NK_COMMA select_item",
+ /* 430 */ "select_item ::= NK_STAR",
+ /* 431 */ "select_item ::= common_expression",
+ /* 432 */ "select_item ::= common_expression column_alias",
+ /* 433 */ "select_item ::= common_expression AS column_alias",
+ /* 434 */ "select_item ::= table_name NK_DOT NK_STAR",
+ /* 435 */ "where_clause_opt ::=",
+ /* 436 */ "where_clause_opt ::= WHERE search_condition",
+ /* 437 */ "partition_by_clause_opt ::=",
+ /* 438 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
+ /* 439 */ "twindow_clause_opt ::=",
+ /* 440 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
+ /* 441 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
+ /* 442 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
+ /* 443 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
+ /* 444 */ "sliding_opt ::=",
+ /* 445 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
+ /* 446 */ "fill_opt ::=",
+ /* 447 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
+ /* 448 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
+ /* 449 */ "fill_mode ::= NONE",
+ /* 450 */ "fill_mode ::= PREV",
+ /* 451 */ "fill_mode ::= NULL",
+ /* 452 */ "fill_mode ::= LINEAR",
+ /* 453 */ "fill_mode ::= NEXT",
+ /* 454 */ "group_by_clause_opt ::=",
+ /* 455 */ "group_by_clause_opt ::= GROUP BY group_by_list",
+ /* 456 */ "group_by_list ::= expression",
+ /* 457 */ "group_by_list ::= group_by_list NK_COMMA expression",
+ /* 458 */ "having_clause_opt ::=",
+ /* 459 */ "having_clause_opt ::= HAVING search_condition",
+ /* 460 */ "range_opt ::=",
+ /* 461 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP",
+ /* 462 */ "every_opt ::=",
+ /* 463 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
+ /* 464 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
+ /* 465 */ "query_expression_body ::= query_primary",
+ /* 466 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
+ /* 467 */ "query_expression_body ::= query_expression_body UNION query_expression_body",
+ /* 468 */ "query_primary ::= query_specification",
+ /* 469 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP",
+ /* 470 */ "order_by_clause_opt ::=",
+ /* 471 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
+ /* 472 */ "slimit_clause_opt ::=",
+ /* 473 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
+ /* 474 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
+ /* 475 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 476 */ "limit_clause_opt ::=",
+ /* 477 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
+ /* 478 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
+ /* 479 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 480 */ "subquery ::= NK_LP query_expression NK_RP",
+ /* 481 */ "search_condition ::= common_expression",
+ /* 482 */ "sort_specification_list ::= sort_specification",
+ /* 483 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
+ /* 484 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
+ /* 485 */ "ordering_specification_opt ::=",
+ /* 486 */ "ordering_specification_opt ::= ASC",
+ /* 487 */ "ordering_specification_opt ::= DESC",
+ /* 488 */ "null_ordering_opt ::=",
+ /* 489 */ "null_ordering_opt ::= NULLS FIRST",
+ /* 490 */ "null_ordering_opt ::= NULLS LAST",
};
#endif /* NDEBUG */
@@ -2219,181 +2269,181 @@ static void yy_destructor(
*/
/********* Begin destructor definitions ***************************************/
/* Default NON-TERMINAL Destructor */
- case 255: /* cmd */
- case 258: /* literal */
- case 269: /* db_options */
- case 271: /* alter_db_options */
- case 276: /* retention */
- case 277: /* full_table_name */
- case 280: /* table_options */
- case 284: /* alter_table_clause */
- case 285: /* alter_table_options */
- case 288: /* signed_literal */
- case 289: /* create_subtable_clause */
- case 292: /* drop_table_clause */
- case 295: /* column_def */
- case 299: /* duration_literal */
- case 300: /* rollup_func_name */
- case 302: /* col_name */
- case 303: /* db_name_cond_opt */
- case 304: /* like_pattern_opt */
- case 305: /* table_name_cond */
- case 306: /* from_db_opt */
- case 308: /* index_options */
- case 310: /* sliding_opt */
- case 311: /* sma_stream_opt */
- case 312: /* func */
- case 313: /* stream_options */
- case 315: /* query_expression */
- case 318: /* explain_options */
- case 322: /* into_opt */
- case 324: /* where_clause_opt */
- case 325: /* signed */
- case 326: /* literal_func */
- case 330: /* expression */
- case 331: /* pseudo_column */
- case 332: /* column_reference */
- case 333: /* function_expression */
- case 334: /* subquery */
- case 339: /* star_func_para */
- case 340: /* predicate */
- case 343: /* in_predicate_value */
- case 344: /* boolean_value_expression */
- case 345: /* boolean_primary */
- case 346: /* common_expression */
- case 347: /* from_clause_opt */
- case 348: /* table_reference_list */
- case 349: /* table_reference */
- case 350: /* table_primary */
- case 351: /* joined_table */
- case 353: /* parenthesized_joined_table */
- case 355: /* search_condition */
- case 356: /* query_specification */
- case 360: /* range_opt */
- case 361: /* every_opt */
- case 362: /* fill_opt */
- case 363: /* twindow_clause_opt */
- case 365: /* having_clause_opt */
- case 366: /* select_item */
- case 369: /* query_expression_body */
- case 371: /* slimit_clause_opt */
- case 372: /* limit_clause_opt */
- case 373: /* query_primary */
- case 375: /* sort_specification */
+ case 256: /* cmd */
+ case 259: /* literal */
+ case 270: /* db_options */
+ case 272: /* alter_db_options */
+ case 277: /* retention */
+ case 278: /* full_table_name */
+ case 281: /* table_options */
+ case 285: /* alter_table_clause */
+ case 286: /* alter_table_options */
+ case 289: /* signed_literal */
+ case 290: /* create_subtable_clause */
+ case 293: /* drop_table_clause */
+ case 296: /* column_def */
+ case 300: /* duration_literal */
+ case 301: /* rollup_func_name */
+ case 303: /* col_name */
+ case 304: /* db_name_cond_opt */
+ case 305: /* like_pattern_opt */
+ case 306: /* table_name_cond */
+ case 307: /* from_db_opt */
+ case 309: /* index_options */
+ case 311: /* sliding_opt */
+ case 312: /* sma_stream_opt */
+ case 313: /* func */
+ case 314: /* stream_options */
+ case 316: /* query_expression */
+ case 319: /* explain_options */
+ case 323: /* into_opt */
+ case 325: /* where_clause_opt */
+ case 326: /* signed */
+ case 327: /* literal_func */
+ case 331: /* expression */
+ case 332: /* pseudo_column */
+ case 333: /* column_reference */
+ case 334: /* function_expression */
+ case 335: /* subquery */
+ case 340: /* star_func_para */
+ case 341: /* predicate */
+ case 344: /* in_predicate_value */
+ case 345: /* boolean_value_expression */
+ case 346: /* boolean_primary */
+ case 347: /* common_expression */
+ case 348: /* from_clause_opt */
+ case 349: /* table_reference_list */
+ case 350: /* table_reference */
+ case 351: /* table_primary */
+ case 352: /* joined_table */
+ case 354: /* parenthesized_joined_table */
+ case 356: /* search_condition */
+ case 357: /* query_specification */
+ case 361: /* range_opt */
+ case 362: /* every_opt */
+ case 363: /* fill_opt */
+ case 364: /* twindow_clause_opt */
+ case 366: /* having_clause_opt */
+ case 367: /* select_item */
+ case 370: /* query_expression_body */
+ case 372: /* slimit_clause_opt */
+ case 373: /* limit_clause_opt */
+ case 374: /* query_primary */
+ case 376: /* sort_specification */
{
- nodesDestroyNode((yypminor->yy560));
+ nodesDestroyNode((yypminor->yy616));
}
break;
- case 256: /* account_options */
- case 257: /* alter_account_options */
- case 259: /* alter_account_option */
- case 320: /* bufsize_opt */
+ case 257: /* account_options */
+ case 258: /* alter_account_options */
+ case 260: /* alter_account_option */
+ case 321: /* bufsize_opt */
{
}
break;
- case 260: /* user_name */
- case 263: /* priv_level */
- case 266: /* db_name */
- case 267: /* dnode_endpoint */
- case 286: /* column_name */
- case 294: /* table_name */
- case 301: /* function_name */
- case 307: /* index_name */
- case 314: /* topic_name */
- case 316: /* cgroup_name */
- case 321: /* stream_name */
- case 328: /* table_alias */
- case 329: /* column_alias */
- case 335: /* star_func */
- case 337: /* noarg_func */
- case 352: /* alias_opt */
+ case 261: /* user_name */
+ case 264: /* priv_level */
+ case 267: /* db_name */
+ case 268: /* dnode_endpoint */
+ case 287: /* column_name */
+ case 295: /* table_name */
+ case 302: /* function_name */
+ case 308: /* index_name */
+ case 315: /* topic_name */
+ case 317: /* cgroup_name */
+ case 322: /* stream_name */
+ case 329: /* table_alias */
+ case 330: /* column_alias */
+ case 336: /* star_func */
+ case 338: /* noarg_func */
+ case 353: /* alias_opt */
{
}
break;
- case 261: /* sysinfo_opt */
+ case 262: /* sysinfo_opt */
{
}
break;
- case 262: /* privileges */
- case 264: /* priv_type_list */
- case 265: /* priv_type */
+ case 263: /* privileges */
+ case 265: /* priv_type_list */
+ case 266: /* priv_type */
{
}
break;
- case 268: /* not_exists_opt */
- case 270: /* exists_opt */
- case 317: /* analyze_opt */
- case 319: /* agg_func_opt */
- case 357: /* set_quantifier_opt */
+ case 269: /* not_exists_opt */
+ case 271: /* exists_opt */
+ case 318: /* analyze_opt */
+ case 320: /* agg_func_opt */
+ case 358: /* set_quantifier_opt */
{
}
break;
- case 272: /* integer_list */
- case 273: /* variable_list */
- case 274: /* retention_list */
- case 278: /* column_def_list */
- case 279: /* tags_def_opt */
- case 281: /* multi_create_clause */
- case 282: /* tags_def */
- case 283: /* multi_drop_clause */
- case 290: /* specific_cols_opt */
- case 291: /* expression_list */
- case 293: /* col_name_list */
- case 296: /* duration_list */
- case 297: /* rollup_func_list */
- case 309: /* func_list */
- case 323: /* dnode_list */
- case 327: /* literal_list */
- case 336: /* star_func_para_list */
- case 338: /* other_para_list */
- case 358: /* select_list */
- case 359: /* partition_by_clause_opt */
- case 364: /* group_by_clause_opt */
- case 368: /* group_by_list */
- case 370: /* order_by_clause_opt */
- case 374: /* sort_specification_list */
+ case 273: /* integer_list */
+ case 274: /* variable_list */
+ case 275: /* retention_list */
+ case 279: /* column_def_list */
+ case 280: /* tags_def_opt */
+ case 282: /* multi_create_clause */
+ case 283: /* tags_def */
+ case 284: /* multi_drop_clause */
+ case 291: /* specific_cols_opt */
+ case 292: /* expression_list */
+ case 294: /* col_name_list */
+ case 297: /* duration_list */
+ case 298: /* rollup_func_list */
+ case 310: /* func_list */
+ case 324: /* dnode_list */
+ case 328: /* literal_list */
+ case 337: /* star_func_para_list */
+ case 339: /* other_para_list */
+ case 359: /* select_list */
+ case 360: /* partition_by_clause_opt */
+ case 365: /* group_by_clause_opt */
+ case 369: /* group_by_list */
+ case 371: /* order_by_clause_opt */
+ case 375: /* sort_specification_list */
{
- nodesDestroyList((yypminor->yy712));
+ nodesDestroyList((yypminor->yy356));
}
break;
- case 275: /* alter_db_option */
- case 298: /* alter_table_option */
+ case 276: /* alter_db_option */
+ case 299: /* alter_table_option */
{
}
break;
- case 287: /* type_name */
+ case 288: /* type_name */
{
}
break;
- case 341: /* compare_op */
- case 342: /* in_op */
+ case 342: /* compare_op */
+ case 343: /* in_op */
{
}
break;
- case 354: /* join_type */
+ case 355: /* join_type */
{
}
break;
- case 367: /* fill_mode */
+ case 368: /* fill_mode */
{
}
break;
- case 376: /* ordering_specification_opt */
+ case 377: /* ordering_specification_opt */
{
}
break;
- case 377: /* null_ordering_opt */
+ case 378: /* null_ordering_opt */
{
}
@@ -2692,495 +2742,497 @@ static const struct {
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
signed char nrhs; /* Negative of the number of RHS symbols in the rule */
} yyRuleInfo[] = {
- { 255, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
- { 255, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
- { 256, 0 }, /* (2) account_options ::= */
- { 256, -3 }, /* (3) account_options ::= account_options PPS literal */
- { 256, -3 }, /* (4) account_options ::= account_options TSERIES literal */
- { 256, -3 }, /* (5) account_options ::= account_options STORAGE literal */
- { 256, -3 }, /* (6) account_options ::= account_options STREAMS literal */
- { 256, -3 }, /* (7) account_options ::= account_options QTIME literal */
- { 256, -3 }, /* (8) account_options ::= account_options DBS literal */
- { 256, -3 }, /* (9) account_options ::= account_options USERS literal */
- { 256, -3 }, /* (10) account_options ::= account_options CONNS literal */
- { 256, -3 }, /* (11) account_options ::= account_options STATE literal */
- { 257, -1 }, /* (12) alter_account_options ::= alter_account_option */
- { 257, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
- { 259, -2 }, /* (14) alter_account_option ::= PASS literal */
- { 259, -2 }, /* (15) alter_account_option ::= PPS literal */
- { 259, -2 }, /* (16) alter_account_option ::= TSERIES literal */
- { 259, -2 }, /* (17) alter_account_option ::= STORAGE literal */
- { 259, -2 }, /* (18) alter_account_option ::= STREAMS literal */
- { 259, -2 }, /* (19) alter_account_option ::= QTIME literal */
- { 259, -2 }, /* (20) alter_account_option ::= DBS literal */
- { 259, -2 }, /* (21) alter_account_option ::= USERS literal */
- { 259, -2 }, /* (22) alter_account_option ::= CONNS literal */
- { 259, -2 }, /* (23) alter_account_option ::= STATE literal */
- { 255, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
- { 255, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
- { 255, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
- { 255, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
- { 255, -3 }, /* (28) cmd ::= DROP USER user_name */
- { 261, 0 }, /* (29) sysinfo_opt ::= */
- { 261, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */
- { 255, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */
- { 255, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */
- { 262, -1 }, /* (33) privileges ::= ALL */
- { 262, -1 }, /* (34) privileges ::= priv_type_list */
- { 264, -1 }, /* (35) priv_type_list ::= priv_type */
- { 264, -3 }, /* (36) priv_type_list ::= priv_type_list NK_COMMA priv_type */
- { 265, -1 }, /* (37) priv_type ::= READ */
- { 265, -1 }, /* (38) priv_type ::= WRITE */
- { 263, -3 }, /* (39) priv_level ::= NK_STAR NK_DOT NK_STAR */
- { 263, -3 }, /* (40) priv_level ::= db_name NK_DOT NK_STAR */
- { 255, -3 }, /* (41) cmd ::= CREATE DNODE dnode_endpoint */
- { 255, -5 }, /* (42) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
- { 255, -3 }, /* (43) cmd ::= DROP DNODE NK_INTEGER */
- { 255, -3 }, /* (44) cmd ::= DROP DNODE dnode_endpoint */
- { 255, -4 }, /* (45) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
- { 255, -5 }, /* (46) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
- { 255, -4 }, /* (47) cmd ::= ALTER ALL DNODES NK_STRING */
- { 255, -5 }, /* (48) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
- { 267, -1 }, /* (49) dnode_endpoint ::= NK_STRING */
- { 267, -1 }, /* (50) dnode_endpoint ::= NK_ID */
- { 267, -1 }, /* (51) dnode_endpoint ::= NK_IPTOKEN */
- { 255, -3 }, /* (52) cmd ::= ALTER LOCAL NK_STRING */
- { 255, -4 }, /* (53) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
- { 255, -5 }, /* (54) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
- { 255, -5 }, /* (55) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
- { 255, -5 }, /* (56) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
- { 255, -5 }, /* (57) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
- { 255, -5 }, /* (58) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
- { 255, -5 }, /* (59) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
- { 255, -5 }, /* (60) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
- { 255, -5 }, /* (61) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
- { 255, -5 }, /* (62) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
- { 255, -4 }, /* (63) cmd ::= DROP DATABASE exists_opt db_name */
- { 255, -2 }, /* (64) cmd ::= USE db_name */
- { 255, -4 }, /* (65) cmd ::= ALTER DATABASE db_name alter_db_options */
- { 255, -3 }, /* (66) cmd ::= FLUSH DATABASE db_name */
- { 255, -3 }, /* (67) cmd ::= TRIM DATABASE db_name */
- { 268, -3 }, /* (68) not_exists_opt ::= IF NOT EXISTS */
- { 268, 0 }, /* (69) not_exists_opt ::= */
- { 270, -2 }, /* (70) exists_opt ::= IF EXISTS */
- { 270, 0 }, /* (71) exists_opt ::= */
- { 269, 0 }, /* (72) db_options ::= */
- { 269, -3 }, /* (73) db_options ::= db_options BUFFER NK_INTEGER */
- { 269, -3 }, /* (74) db_options ::= db_options CACHELAST NK_INTEGER */
- { 269, -3 }, /* (75) db_options ::= db_options CACHELASTSIZE NK_INTEGER */
- { 269, -3 }, /* (76) db_options ::= db_options COMP NK_INTEGER */
- { 269, -3 }, /* (77) db_options ::= db_options DURATION NK_INTEGER */
- { 269, -3 }, /* (78) db_options ::= db_options DURATION NK_VARIABLE */
- { 269, -3 }, /* (79) db_options ::= db_options FSYNC NK_INTEGER */
- { 269, -3 }, /* (80) db_options ::= db_options MAXROWS NK_INTEGER */
- { 269, -3 }, /* (81) db_options ::= db_options MINROWS NK_INTEGER */
- { 269, -3 }, /* (82) db_options ::= db_options KEEP integer_list */
- { 269, -3 }, /* (83) db_options ::= db_options KEEP variable_list */
- { 269, -3 }, /* (84) db_options ::= db_options PAGES NK_INTEGER */
- { 269, -3 }, /* (85) db_options ::= db_options PAGESIZE NK_INTEGER */
- { 269, -3 }, /* (86) db_options ::= db_options PRECISION NK_STRING */
- { 269, -3 }, /* (87) db_options ::= db_options REPLICA NK_INTEGER */
- { 269, -3 }, /* (88) db_options ::= db_options STRICT NK_INTEGER */
- { 269, -3 }, /* (89) db_options ::= db_options WAL NK_INTEGER */
- { 269, -3 }, /* (90) db_options ::= db_options VGROUPS NK_INTEGER */
- { 269, -3 }, /* (91) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
- { 269, -3 }, /* (92) db_options ::= db_options RETENTIONS retention_list */
- { 269, -3 }, /* (93) db_options ::= db_options SCHEMALESS NK_INTEGER */
- { 271, -1 }, /* (94) alter_db_options ::= alter_db_option */
- { 271, -2 }, /* (95) alter_db_options ::= alter_db_options alter_db_option */
- { 275, -2 }, /* (96) alter_db_option ::= BUFFER NK_INTEGER */
- { 275, -2 }, /* (97) alter_db_option ::= CACHELAST NK_INTEGER */
- { 275, -2 }, /* (98) alter_db_option ::= CACHELASTSIZE NK_INTEGER */
- { 275, -2 }, /* (99) alter_db_option ::= FSYNC NK_INTEGER */
- { 275, -2 }, /* (100) alter_db_option ::= KEEP integer_list */
- { 275, -2 }, /* (101) alter_db_option ::= KEEP variable_list */
- { 275, -2 }, /* (102) alter_db_option ::= PAGES NK_INTEGER */
- { 275, -2 }, /* (103) alter_db_option ::= REPLICA NK_INTEGER */
- { 275, -2 }, /* (104) alter_db_option ::= STRICT NK_INTEGER */
- { 275, -2 }, /* (105) alter_db_option ::= WAL NK_INTEGER */
- { 272, -1 }, /* (106) integer_list ::= NK_INTEGER */
- { 272, -3 }, /* (107) integer_list ::= integer_list NK_COMMA NK_INTEGER */
- { 273, -1 }, /* (108) variable_list ::= NK_VARIABLE */
- { 273, -3 }, /* (109) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
- { 274, -1 }, /* (110) retention_list ::= retention */
- { 274, -3 }, /* (111) retention_list ::= retention_list NK_COMMA retention */
- { 276, -3 }, /* (112) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
- { 255, -9 }, /* (113) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
- { 255, -3 }, /* (114) cmd ::= CREATE TABLE multi_create_clause */
- { 255, -9 }, /* (115) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
- { 255, -3 }, /* (116) cmd ::= DROP TABLE multi_drop_clause */
- { 255, -4 }, /* (117) cmd ::= DROP STABLE exists_opt full_table_name */
- { 255, -3 }, /* (118) cmd ::= ALTER TABLE alter_table_clause */
- { 255, -3 }, /* (119) cmd ::= ALTER STABLE alter_table_clause */
- { 284, -2 }, /* (120) alter_table_clause ::= full_table_name alter_table_options */
- { 284, -5 }, /* (121) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
- { 284, -4 }, /* (122) alter_table_clause ::= full_table_name DROP COLUMN column_name */
- { 284, -5 }, /* (123) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
- { 284, -5 }, /* (124) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
- { 284, -5 }, /* (125) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
- { 284, -4 }, /* (126) alter_table_clause ::= full_table_name DROP TAG column_name */
- { 284, -5 }, /* (127) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
- { 284, -5 }, /* (128) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
- { 284, -6 }, /* (129) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
- { 281, -1 }, /* (130) multi_create_clause ::= create_subtable_clause */
- { 281, -2 }, /* (131) multi_create_clause ::= multi_create_clause create_subtable_clause */
- { 289, -10 }, /* (132) 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 */
- { 283, -1 }, /* (133) multi_drop_clause ::= drop_table_clause */
- { 283, -2 }, /* (134) multi_drop_clause ::= multi_drop_clause drop_table_clause */
- { 292, -2 }, /* (135) drop_table_clause ::= exists_opt full_table_name */
- { 290, 0 }, /* (136) specific_cols_opt ::= */
- { 290, -3 }, /* (137) specific_cols_opt ::= NK_LP col_name_list NK_RP */
- { 277, -1 }, /* (138) full_table_name ::= table_name */
- { 277, -3 }, /* (139) full_table_name ::= db_name NK_DOT table_name */
- { 278, -1 }, /* (140) column_def_list ::= column_def */
- { 278, -3 }, /* (141) column_def_list ::= column_def_list NK_COMMA column_def */
- { 295, -2 }, /* (142) column_def ::= column_name type_name */
- { 295, -4 }, /* (143) column_def ::= column_name type_name COMMENT NK_STRING */
- { 287, -1 }, /* (144) type_name ::= BOOL */
- { 287, -1 }, /* (145) type_name ::= TINYINT */
- { 287, -1 }, /* (146) type_name ::= SMALLINT */
- { 287, -1 }, /* (147) type_name ::= INT */
- { 287, -1 }, /* (148) type_name ::= INTEGER */
- { 287, -1 }, /* (149) type_name ::= BIGINT */
- { 287, -1 }, /* (150) type_name ::= FLOAT */
- { 287, -1 }, /* (151) type_name ::= DOUBLE */
- { 287, -4 }, /* (152) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
- { 287, -1 }, /* (153) type_name ::= TIMESTAMP */
- { 287, -4 }, /* (154) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
- { 287, -2 }, /* (155) type_name ::= TINYINT UNSIGNED */
- { 287, -2 }, /* (156) type_name ::= SMALLINT UNSIGNED */
- { 287, -2 }, /* (157) type_name ::= INT UNSIGNED */
- { 287, -2 }, /* (158) type_name ::= BIGINT UNSIGNED */
- { 287, -1 }, /* (159) type_name ::= JSON */
- { 287, -4 }, /* (160) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
- { 287, -1 }, /* (161) type_name ::= MEDIUMBLOB */
- { 287, -1 }, /* (162) type_name ::= BLOB */
- { 287, -4 }, /* (163) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
- { 287, -1 }, /* (164) type_name ::= DECIMAL */
- { 287, -4 }, /* (165) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
- { 287, -6 }, /* (166) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
- { 279, 0 }, /* (167) tags_def_opt ::= */
- { 279, -1 }, /* (168) tags_def_opt ::= tags_def */
- { 282, -4 }, /* (169) tags_def ::= TAGS NK_LP column_def_list NK_RP */
- { 280, 0 }, /* (170) table_options ::= */
- { 280, -3 }, /* (171) table_options ::= table_options COMMENT NK_STRING */
- { 280, -3 }, /* (172) table_options ::= table_options MAX_DELAY duration_list */
- { 280, -3 }, /* (173) table_options ::= table_options WATERMARK duration_list */
- { 280, -5 }, /* (174) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
- { 280, -3 }, /* (175) table_options ::= table_options TTL NK_INTEGER */
- { 280, -5 }, /* (176) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
- { 285, -1 }, /* (177) alter_table_options ::= alter_table_option */
- { 285, -2 }, /* (178) alter_table_options ::= alter_table_options alter_table_option */
- { 298, -2 }, /* (179) alter_table_option ::= COMMENT NK_STRING */
- { 298, -2 }, /* (180) alter_table_option ::= TTL NK_INTEGER */
- { 296, -1 }, /* (181) duration_list ::= duration_literal */
- { 296, -3 }, /* (182) duration_list ::= duration_list NK_COMMA duration_literal */
- { 297, -1 }, /* (183) rollup_func_list ::= rollup_func_name */
- { 297, -3 }, /* (184) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */
- { 300, -1 }, /* (185) rollup_func_name ::= function_name */
- { 300, -1 }, /* (186) rollup_func_name ::= FIRST */
- { 300, -1 }, /* (187) rollup_func_name ::= LAST */
- { 293, -1 }, /* (188) col_name_list ::= col_name */
- { 293, -3 }, /* (189) col_name_list ::= col_name_list NK_COMMA col_name */
- { 302, -1 }, /* (190) col_name ::= column_name */
- { 255, -2 }, /* (191) cmd ::= SHOW DNODES */
- { 255, -2 }, /* (192) cmd ::= SHOW USERS */
- { 255, -2 }, /* (193) cmd ::= SHOW DATABASES */
- { 255, -4 }, /* (194) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
- { 255, -4 }, /* (195) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
- { 255, -3 }, /* (196) cmd ::= SHOW db_name_cond_opt VGROUPS */
- { 255, -2 }, /* (197) cmd ::= SHOW MNODES */
- { 255, -2 }, /* (198) cmd ::= SHOW MODULES */
- { 255, -2 }, /* (199) cmd ::= SHOW QNODES */
- { 255, -2 }, /* (200) cmd ::= SHOW FUNCTIONS */
- { 255, -5 }, /* (201) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
- { 255, -2 }, /* (202) cmd ::= SHOW STREAMS */
- { 255, -2 }, /* (203) cmd ::= SHOW ACCOUNTS */
- { 255, -2 }, /* (204) cmd ::= SHOW APPS */
- { 255, -2 }, /* (205) cmd ::= SHOW CONNECTIONS */
- { 255, -2 }, /* (206) cmd ::= SHOW LICENCE */
- { 255, -2 }, /* (207) cmd ::= SHOW GRANTS */
- { 255, -4 }, /* (208) cmd ::= SHOW CREATE DATABASE db_name */
- { 255, -4 }, /* (209) cmd ::= SHOW CREATE TABLE full_table_name */
- { 255, -4 }, /* (210) cmd ::= SHOW CREATE STABLE full_table_name */
- { 255, -2 }, /* (211) cmd ::= SHOW QUERIES */
- { 255, -2 }, /* (212) cmd ::= SHOW SCORES */
- { 255, -2 }, /* (213) cmd ::= SHOW TOPICS */
- { 255, -2 }, /* (214) cmd ::= SHOW VARIABLES */
- { 255, -3 }, /* (215) cmd ::= SHOW LOCAL VARIABLES */
- { 255, -4 }, /* (216) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */
- { 255, -2 }, /* (217) cmd ::= SHOW BNODES */
- { 255, -2 }, /* (218) cmd ::= SHOW SNODES */
- { 255, -2 }, /* (219) cmd ::= SHOW CLUSTER */
- { 255, -2 }, /* (220) cmd ::= SHOW TRANSACTIONS */
- { 255, -4 }, /* (221) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
- { 255, -2 }, /* (222) cmd ::= SHOW CONSUMERS */
- { 255, -2 }, /* (223) cmd ::= SHOW SUBSCRIPTIONS */
- { 303, 0 }, /* (224) db_name_cond_opt ::= */
- { 303, -2 }, /* (225) db_name_cond_opt ::= db_name NK_DOT */
- { 304, 0 }, /* (226) like_pattern_opt ::= */
- { 304, -2 }, /* (227) like_pattern_opt ::= LIKE NK_STRING */
- { 305, -1 }, /* (228) table_name_cond ::= table_name */
- { 306, 0 }, /* (229) from_db_opt ::= */
- { 306, -2 }, /* (230) from_db_opt ::= FROM db_name */
- { 255, -8 }, /* (231) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
- { 255, -4 }, /* (232) cmd ::= DROP INDEX exists_opt index_name */
- { 308, -10 }, /* (233) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
- { 308, -12 }, /* (234) 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 */
- { 309, -1 }, /* (235) func_list ::= func */
- { 309, -3 }, /* (236) func_list ::= func_list NK_COMMA func */
- { 312, -4 }, /* (237) func ::= function_name NK_LP expression_list NK_RP */
- { 311, 0 }, /* (238) sma_stream_opt ::= */
- { 311, -3 }, /* (239) sma_stream_opt ::= stream_options WATERMARK duration_literal */
- { 311, -3 }, /* (240) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */
- { 255, -6 }, /* (241) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
- { 255, -7 }, /* (242) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
- { 255, -9 }, /* (243) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
- { 255, -7 }, /* (244) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
- { 255, -9 }, /* (245) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
- { 255, -4 }, /* (246) cmd ::= DROP TOPIC exists_opt topic_name */
- { 255, -7 }, /* (247) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
- { 255, -2 }, /* (248) cmd ::= DESC full_table_name */
- { 255, -2 }, /* (249) cmd ::= DESCRIBE full_table_name */
- { 255, -3 }, /* (250) cmd ::= RESET QUERY CACHE */
- { 255, -4 }, /* (251) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
- { 317, 0 }, /* (252) analyze_opt ::= */
- { 317, -1 }, /* (253) analyze_opt ::= ANALYZE */
- { 318, 0 }, /* (254) explain_options ::= */
- { 318, -3 }, /* (255) explain_options ::= explain_options VERBOSE NK_BOOL */
- { 318, -3 }, /* (256) explain_options ::= explain_options RATIO NK_FLOAT */
- { 255, -6 }, /* (257) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
- { 255, -10 }, /* (258) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
- { 255, -4 }, /* (259) cmd ::= DROP FUNCTION exists_opt function_name */
- { 319, 0 }, /* (260) agg_func_opt ::= */
- { 319, -1 }, /* (261) agg_func_opt ::= AGGREGATE */
- { 320, 0 }, /* (262) bufsize_opt ::= */
- { 320, -2 }, /* (263) bufsize_opt ::= BUFSIZE NK_INTEGER */
- { 255, -8 }, /* (264) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
- { 255, -4 }, /* (265) cmd ::= DROP STREAM exists_opt stream_name */
- { 322, 0 }, /* (266) into_opt ::= */
- { 322, -2 }, /* (267) into_opt ::= INTO full_table_name */
- { 313, 0 }, /* (268) stream_options ::= */
- { 313, -3 }, /* (269) stream_options ::= stream_options TRIGGER AT_ONCE */
- { 313, -3 }, /* (270) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
- { 313, -4 }, /* (271) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
- { 313, -3 }, /* (272) stream_options ::= stream_options WATERMARK duration_literal */
- { 313, -3 }, /* (273) stream_options ::= stream_options IGNORE EXPIRED */
- { 255, -3 }, /* (274) cmd ::= KILL CONNECTION NK_INTEGER */
- { 255, -3 }, /* (275) cmd ::= KILL QUERY NK_STRING */
- { 255, -3 }, /* (276) cmd ::= KILL TRANSACTION NK_INTEGER */
- { 255, -2 }, /* (277) cmd ::= BALANCE VGROUP */
- { 255, -4 }, /* (278) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
- { 255, -4 }, /* (279) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
- { 255, -3 }, /* (280) cmd ::= SPLIT VGROUP NK_INTEGER */
- { 323, -2 }, /* (281) dnode_list ::= DNODE NK_INTEGER */
- { 323, -3 }, /* (282) dnode_list ::= dnode_list DNODE NK_INTEGER */
- { 255, -3 }, /* (283) cmd ::= SYNCDB db_name REPLICA */
- { 255, -4 }, /* (284) cmd ::= DELETE FROM full_table_name where_clause_opt */
- { 255, -1 }, /* (285) cmd ::= query_expression */
- { 255, -5 }, /* (286) cmd ::= INSERT INTO full_table_name specific_cols_opt query_expression */
- { 258, -1 }, /* (287) literal ::= NK_INTEGER */
- { 258, -1 }, /* (288) literal ::= NK_FLOAT */
- { 258, -1 }, /* (289) literal ::= NK_STRING */
- { 258, -1 }, /* (290) literal ::= NK_BOOL */
- { 258, -2 }, /* (291) literal ::= TIMESTAMP NK_STRING */
- { 258, -1 }, /* (292) literal ::= duration_literal */
- { 258, -1 }, /* (293) literal ::= NULL */
- { 258, -1 }, /* (294) literal ::= NK_QUESTION */
- { 299, -1 }, /* (295) duration_literal ::= NK_VARIABLE */
- { 325, -1 }, /* (296) signed ::= NK_INTEGER */
- { 325, -2 }, /* (297) signed ::= NK_PLUS NK_INTEGER */
- { 325, -2 }, /* (298) signed ::= NK_MINUS NK_INTEGER */
- { 325, -1 }, /* (299) signed ::= NK_FLOAT */
- { 325, -2 }, /* (300) signed ::= NK_PLUS NK_FLOAT */
- { 325, -2 }, /* (301) signed ::= NK_MINUS NK_FLOAT */
- { 288, -1 }, /* (302) signed_literal ::= signed */
- { 288, -1 }, /* (303) signed_literal ::= NK_STRING */
- { 288, -1 }, /* (304) signed_literal ::= NK_BOOL */
- { 288, -2 }, /* (305) signed_literal ::= TIMESTAMP NK_STRING */
- { 288, -1 }, /* (306) signed_literal ::= duration_literal */
- { 288, -1 }, /* (307) signed_literal ::= NULL */
- { 288, -1 }, /* (308) signed_literal ::= literal_func */
- { 288, -1 }, /* (309) signed_literal ::= NK_QUESTION */
- { 327, -1 }, /* (310) literal_list ::= signed_literal */
- { 327, -3 }, /* (311) literal_list ::= literal_list NK_COMMA signed_literal */
- { 266, -1 }, /* (312) db_name ::= NK_ID */
- { 294, -1 }, /* (313) table_name ::= NK_ID */
- { 286, -1 }, /* (314) column_name ::= NK_ID */
- { 301, -1 }, /* (315) function_name ::= NK_ID */
- { 328, -1 }, /* (316) table_alias ::= NK_ID */
- { 329, -1 }, /* (317) column_alias ::= NK_ID */
- { 260, -1 }, /* (318) user_name ::= NK_ID */
- { 307, -1 }, /* (319) index_name ::= NK_ID */
- { 314, -1 }, /* (320) topic_name ::= NK_ID */
- { 321, -1 }, /* (321) stream_name ::= NK_ID */
- { 316, -1 }, /* (322) cgroup_name ::= NK_ID */
- { 330, -1 }, /* (323) expression ::= literal */
- { 330, -1 }, /* (324) expression ::= pseudo_column */
- { 330, -1 }, /* (325) expression ::= column_reference */
- { 330, -1 }, /* (326) expression ::= function_expression */
- { 330, -1 }, /* (327) expression ::= subquery */
- { 330, -3 }, /* (328) expression ::= NK_LP expression NK_RP */
- { 330, -2 }, /* (329) expression ::= NK_PLUS expression */
- { 330, -2 }, /* (330) expression ::= NK_MINUS expression */
- { 330, -3 }, /* (331) expression ::= expression NK_PLUS expression */
- { 330, -3 }, /* (332) expression ::= expression NK_MINUS expression */
- { 330, -3 }, /* (333) expression ::= expression NK_STAR expression */
- { 330, -3 }, /* (334) expression ::= expression NK_SLASH expression */
- { 330, -3 }, /* (335) expression ::= expression NK_REM expression */
- { 330, -3 }, /* (336) expression ::= column_reference NK_ARROW NK_STRING */
- { 330, -3 }, /* (337) expression ::= expression NK_BITAND expression */
- { 330, -3 }, /* (338) expression ::= expression NK_BITOR expression */
- { 291, -1 }, /* (339) expression_list ::= expression */
- { 291, -3 }, /* (340) expression_list ::= expression_list NK_COMMA expression */
- { 332, -1 }, /* (341) column_reference ::= column_name */
- { 332, -3 }, /* (342) column_reference ::= table_name NK_DOT column_name */
- { 331, -1 }, /* (343) pseudo_column ::= ROWTS */
- { 331, -1 }, /* (344) pseudo_column ::= TBNAME */
- { 331, -3 }, /* (345) pseudo_column ::= table_name NK_DOT TBNAME */
- { 331, -1 }, /* (346) pseudo_column ::= QSTARTTS */
- { 331, -1 }, /* (347) pseudo_column ::= QENDTS */
- { 331, -1 }, /* (348) pseudo_column ::= WSTARTTS */
- { 331, -1 }, /* (349) pseudo_column ::= WENDTS */
- { 331, -1 }, /* (350) pseudo_column ::= WDURATION */
- { 333, -4 }, /* (351) function_expression ::= function_name NK_LP expression_list NK_RP */
- { 333, -4 }, /* (352) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
- { 333, -6 }, /* (353) function_expression ::= CAST NK_LP expression AS type_name NK_RP */
- { 333, -1 }, /* (354) function_expression ::= literal_func */
- { 326, -3 }, /* (355) literal_func ::= noarg_func NK_LP NK_RP */
- { 326, -1 }, /* (356) literal_func ::= NOW */
- { 337, -1 }, /* (357) noarg_func ::= NOW */
- { 337, -1 }, /* (358) noarg_func ::= TODAY */
- { 337, -1 }, /* (359) noarg_func ::= TIMEZONE */
- { 337, -1 }, /* (360) noarg_func ::= DATABASE */
- { 337, -1 }, /* (361) noarg_func ::= CLIENT_VERSION */
- { 337, -1 }, /* (362) noarg_func ::= SERVER_VERSION */
- { 337, -1 }, /* (363) noarg_func ::= SERVER_STATUS */
- { 337, -1 }, /* (364) noarg_func ::= CURRENT_USER */
- { 337, -1 }, /* (365) noarg_func ::= USER */
- { 335, -1 }, /* (366) star_func ::= COUNT */
- { 335, -1 }, /* (367) star_func ::= FIRST */
- { 335, -1 }, /* (368) star_func ::= LAST */
- { 335, -1 }, /* (369) star_func ::= LAST_ROW */
- { 336, -1 }, /* (370) star_func_para_list ::= NK_STAR */
- { 336, -1 }, /* (371) star_func_para_list ::= other_para_list */
- { 338, -1 }, /* (372) other_para_list ::= star_func_para */
- { 338, -3 }, /* (373) other_para_list ::= other_para_list NK_COMMA star_func_para */
- { 339, -1 }, /* (374) star_func_para ::= expression */
- { 339, -3 }, /* (375) star_func_para ::= table_name NK_DOT NK_STAR */
- { 340, -3 }, /* (376) predicate ::= expression compare_op expression */
- { 340, -5 }, /* (377) predicate ::= expression BETWEEN expression AND expression */
- { 340, -6 }, /* (378) predicate ::= expression NOT BETWEEN expression AND expression */
- { 340, -3 }, /* (379) predicate ::= expression IS NULL */
- { 340, -4 }, /* (380) predicate ::= expression IS NOT NULL */
- { 340, -3 }, /* (381) predicate ::= expression in_op in_predicate_value */
- { 341, -1 }, /* (382) compare_op ::= NK_LT */
- { 341, -1 }, /* (383) compare_op ::= NK_GT */
- { 341, -1 }, /* (384) compare_op ::= NK_LE */
- { 341, -1 }, /* (385) compare_op ::= NK_GE */
- { 341, -1 }, /* (386) compare_op ::= NK_NE */
- { 341, -1 }, /* (387) compare_op ::= NK_EQ */
- { 341, -1 }, /* (388) compare_op ::= LIKE */
- { 341, -2 }, /* (389) compare_op ::= NOT LIKE */
- { 341, -1 }, /* (390) compare_op ::= MATCH */
- { 341, -1 }, /* (391) compare_op ::= NMATCH */
- { 341, -1 }, /* (392) compare_op ::= CONTAINS */
- { 342, -1 }, /* (393) in_op ::= IN */
- { 342, -2 }, /* (394) in_op ::= NOT IN */
- { 343, -3 }, /* (395) in_predicate_value ::= NK_LP literal_list NK_RP */
- { 344, -1 }, /* (396) boolean_value_expression ::= boolean_primary */
- { 344, -2 }, /* (397) boolean_value_expression ::= NOT boolean_primary */
- { 344, -3 }, /* (398) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
- { 344, -3 }, /* (399) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
- { 345, -1 }, /* (400) boolean_primary ::= predicate */
- { 345, -3 }, /* (401) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
- { 346, -1 }, /* (402) common_expression ::= expression */
- { 346, -1 }, /* (403) common_expression ::= boolean_value_expression */
- { 347, 0 }, /* (404) from_clause_opt ::= */
- { 347, -2 }, /* (405) from_clause_opt ::= FROM table_reference_list */
- { 348, -1 }, /* (406) table_reference_list ::= table_reference */
- { 348, -3 }, /* (407) table_reference_list ::= table_reference_list NK_COMMA table_reference */
- { 349, -1 }, /* (408) table_reference ::= table_primary */
- { 349, -1 }, /* (409) table_reference ::= joined_table */
- { 350, -2 }, /* (410) table_primary ::= table_name alias_opt */
- { 350, -4 }, /* (411) table_primary ::= db_name NK_DOT table_name alias_opt */
- { 350, -2 }, /* (412) table_primary ::= subquery alias_opt */
- { 350, -1 }, /* (413) table_primary ::= parenthesized_joined_table */
- { 352, 0 }, /* (414) alias_opt ::= */
- { 352, -1 }, /* (415) alias_opt ::= table_alias */
- { 352, -2 }, /* (416) alias_opt ::= AS table_alias */
- { 353, -3 }, /* (417) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- { 353, -3 }, /* (418) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
- { 351, -6 }, /* (419) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
- { 354, 0 }, /* (420) join_type ::= */
- { 354, -1 }, /* (421) join_type ::= INNER */
- { 356, -12 }, /* (422) query_specification ::= SELECT set_quantifier_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 */
- { 357, 0 }, /* (423) set_quantifier_opt ::= */
- { 357, -1 }, /* (424) set_quantifier_opt ::= DISTINCT */
- { 357, -1 }, /* (425) set_quantifier_opt ::= ALL */
- { 358, -1 }, /* (426) select_list ::= select_item */
- { 358, -3 }, /* (427) select_list ::= select_list NK_COMMA select_item */
- { 366, -1 }, /* (428) select_item ::= NK_STAR */
- { 366, -1 }, /* (429) select_item ::= common_expression */
- { 366, -2 }, /* (430) select_item ::= common_expression column_alias */
- { 366, -3 }, /* (431) select_item ::= common_expression AS column_alias */
- { 366, -3 }, /* (432) select_item ::= table_name NK_DOT NK_STAR */
- { 324, 0 }, /* (433) where_clause_opt ::= */
- { 324, -2 }, /* (434) where_clause_opt ::= WHERE search_condition */
- { 359, 0 }, /* (435) partition_by_clause_opt ::= */
- { 359, -3 }, /* (436) partition_by_clause_opt ::= PARTITION BY expression_list */
- { 363, 0 }, /* (437) twindow_clause_opt ::= */
- { 363, -6 }, /* (438) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
- { 363, -4 }, /* (439) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
- { 363, -6 }, /* (440) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
- { 363, -8 }, /* (441) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
- { 310, 0 }, /* (442) sliding_opt ::= */
- { 310, -4 }, /* (443) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
- { 362, 0 }, /* (444) fill_opt ::= */
- { 362, -4 }, /* (445) fill_opt ::= FILL NK_LP fill_mode NK_RP */
- { 362, -6 }, /* (446) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
- { 367, -1 }, /* (447) fill_mode ::= NONE */
- { 367, -1 }, /* (448) fill_mode ::= PREV */
- { 367, -1 }, /* (449) fill_mode ::= NULL */
- { 367, -1 }, /* (450) fill_mode ::= LINEAR */
- { 367, -1 }, /* (451) fill_mode ::= NEXT */
- { 364, 0 }, /* (452) group_by_clause_opt ::= */
- { 364, -3 }, /* (453) group_by_clause_opt ::= GROUP BY group_by_list */
- { 368, -1 }, /* (454) group_by_list ::= expression */
- { 368, -3 }, /* (455) group_by_list ::= group_by_list NK_COMMA expression */
- { 365, 0 }, /* (456) having_clause_opt ::= */
- { 365, -2 }, /* (457) having_clause_opt ::= HAVING search_condition */
- { 360, 0 }, /* (458) range_opt ::= */
- { 360, -6 }, /* (459) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */
- { 361, 0 }, /* (460) every_opt ::= */
- { 361, -4 }, /* (461) every_opt ::= EVERY NK_LP duration_literal NK_RP */
- { 315, -4 }, /* (462) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
- { 369, -1 }, /* (463) query_expression_body ::= query_primary */
- { 369, -4 }, /* (464) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
- { 369, -3 }, /* (465) query_expression_body ::= query_expression_body UNION query_expression_body */
- { 373, -1 }, /* (466) query_primary ::= query_specification */
- { 373, -6 }, /* (467) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
- { 370, 0 }, /* (468) order_by_clause_opt ::= */
- { 370, -3 }, /* (469) order_by_clause_opt ::= ORDER BY sort_specification_list */
- { 371, 0 }, /* (470) slimit_clause_opt ::= */
- { 371, -2 }, /* (471) slimit_clause_opt ::= SLIMIT NK_INTEGER */
- { 371, -4 }, /* (472) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- { 371, -4 }, /* (473) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- { 372, 0 }, /* (474) limit_clause_opt ::= */
- { 372, -2 }, /* (475) limit_clause_opt ::= LIMIT NK_INTEGER */
- { 372, -4 }, /* (476) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
- { 372, -4 }, /* (477) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- { 334, -3 }, /* (478) subquery ::= NK_LP query_expression NK_RP */
- { 355, -1 }, /* (479) search_condition ::= common_expression */
- { 374, -1 }, /* (480) sort_specification_list ::= sort_specification */
- { 374, -3 }, /* (481) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
- { 375, -3 }, /* (482) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
- { 376, 0 }, /* (483) ordering_specification_opt ::= */
- { 376, -1 }, /* (484) ordering_specification_opt ::= ASC */
- { 376, -1 }, /* (485) ordering_specification_opt ::= DESC */
- { 377, 0 }, /* (486) null_ordering_opt ::= */
- { 377, -2 }, /* (487) null_ordering_opt ::= NULLS FIRST */
- { 377, -2 }, /* (488) null_ordering_opt ::= NULLS LAST */
+ { 256, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
+ { 256, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
+ { 257, 0 }, /* (2) account_options ::= */
+ { 257, -3 }, /* (3) account_options ::= account_options PPS literal */
+ { 257, -3 }, /* (4) account_options ::= account_options TSERIES literal */
+ { 257, -3 }, /* (5) account_options ::= account_options STORAGE literal */
+ { 257, -3 }, /* (6) account_options ::= account_options STREAMS literal */
+ { 257, -3 }, /* (7) account_options ::= account_options QTIME literal */
+ { 257, -3 }, /* (8) account_options ::= account_options DBS literal */
+ { 257, -3 }, /* (9) account_options ::= account_options USERS literal */
+ { 257, -3 }, /* (10) account_options ::= account_options CONNS literal */
+ { 257, -3 }, /* (11) account_options ::= account_options STATE literal */
+ { 258, -1 }, /* (12) alter_account_options ::= alter_account_option */
+ { 258, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
+ { 260, -2 }, /* (14) alter_account_option ::= PASS literal */
+ { 260, -2 }, /* (15) alter_account_option ::= PPS literal */
+ { 260, -2 }, /* (16) alter_account_option ::= TSERIES literal */
+ { 260, -2 }, /* (17) alter_account_option ::= STORAGE literal */
+ { 260, -2 }, /* (18) alter_account_option ::= STREAMS literal */
+ { 260, -2 }, /* (19) alter_account_option ::= QTIME literal */
+ { 260, -2 }, /* (20) alter_account_option ::= DBS literal */
+ { 260, -2 }, /* (21) alter_account_option ::= USERS literal */
+ { 260, -2 }, /* (22) alter_account_option ::= CONNS literal */
+ { 260, -2 }, /* (23) alter_account_option ::= STATE literal */
+ { 256, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
+ { 256, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
+ { 256, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
+ { 256, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
+ { 256, -3 }, /* (28) cmd ::= DROP USER user_name */
+ { 262, 0 }, /* (29) sysinfo_opt ::= */
+ { 262, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */
+ { 256, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */
+ { 256, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */
+ { 263, -1 }, /* (33) privileges ::= ALL */
+ { 263, -1 }, /* (34) privileges ::= priv_type_list */
+ { 265, -1 }, /* (35) priv_type_list ::= priv_type */
+ { 265, -3 }, /* (36) priv_type_list ::= priv_type_list NK_COMMA priv_type */
+ { 266, -1 }, /* (37) priv_type ::= READ */
+ { 266, -1 }, /* (38) priv_type ::= WRITE */
+ { 264, -3 }, /* (39) priv_level ::= NK_STAR NK_DOT NK_STAR */
+ { 264, -3 }, /* (40) priv_level ::= db_name NK_DOT NK_STAR */
+ { 256, -3 }, /* (41) cmd ::= CREATE DNODE dnode_endpoint */
+ { 256, -5 }, /* (42) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
+ { 256, -3 }, /* (43) cmd ::= DROP DNODE NK_INTEGER */
+ { 256, -3 }, /* (44) cmd ::= DROP DNODE dnode_endpoint */
+ { 256, -4 }, /* (45) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
+ { 256, -5 }, /* (46) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
+ { 256, -4 }, /* (47) cmd ::= ALTER ALL DNODES NK_STRING */
+ { 256, -5 }, /* (48) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
+ { 268, -1 }, /* (49) dnode_endpoint ::= NK_STRING */
+ { 268, -1 }, /* (50) dnode_endpoint ::= NK_ID */
+ { 268, -1 }, /* (51) dnode_endpoint ::= NK_IPTOKEN */
+ { 256, -3 }, /* (52) cmd ::= ALTER LOCAL NK_STRING */
+ { 256, -4 }, /* (53) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
+ { 256, -5 }, /* (54) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
+ { 256, -5 }, /* (55) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
+ { 256, -5 }, /* (56) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
+ { 256, -5 }, /* (57) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
+ { 256, -5 }, /* (58) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
+ { 256, -5 }, /* (59) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
+ { 256, -5 }, /* (60) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
+ { 256, -5 }, /* (61) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
+ { 256, -5 }, /* (62) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
+ { 256, -4 }, /* (63) cmd ::= DROP DATABASE exists_opt db_name */
+ { 256, -2 }, /* (64) cmd ::= USE db_name */
+ { 256, -4 }, /* (65) cmd ::= ALTER DATABASE db_name alter_db_options */
+ { 256, -3 }, /* (66) cmd ::= FLUSH DATABASE db_name */
+ { 256, -3 }, /* (67) cmd ::= TRIM DATABASE db_name */
+ { 269, -3 }, /* (68) not_exists_opt ::= IF NOT EXISTS */
+ { 269, 0 }, /* (69) not_exists_opt ::= */
+ { 271, -2 }, /* (70) exists_opt ::= IF EXISTS */
+ { 271, 0 }, /* (71) exists_opt ::= */
+ { 270, 0 }, /* (72) db_options ::= */
+ { 270, -3 }, /* (73) db_options ::= db_options BUFFER NK_INTEGER */
+ { 270, -3 }, /* (74) db_options ::= db_options CACHELAST NK_INTEGER */
+ { 270, -3 }, /* (75) db_options ::= db_options CACHELASTSIZE NK_INTEGER */
+ { 270, -3 }, /* (76) db_options ::= db_options COMP NK_INTEGER */
+ { 270, -3 }, /* (77) db_options ::= db_options DURATION NK_INTEGER */
+ { 270, -3 }, /* (78) db_options ::= db_options DURATION NK_VARIABLE */
+ { 270, -3 }, /* (79) db_options ::= db_options FSYNC NK_INTEGER */
+ { 270, -3 }, /* (80) db_options ::= db_options MAXROWS NK_INTEGER */
+ { 270, -3 }, /* (81) db_options ::= db_options MINROWS NK_INTEGER */
+ { 270, -3 }, /* (82) db_options ::= db_options KEEP integer_list */
+ { 270, -3 }, /* (83) db_options ::= db_options KEEP variable_list */
+ { 270, -3 }, /* (84) db_options ::= db_options PAGES NK_INTEGER */
+ { 270, -3 }, /* (85) db_options ::= db_options PAGESIZE NK_INTEGER */
+ { 270, -3 }, /* (86) db_options ::= db_options PRECISION NK_STRING */
+ { 270, -3 }, /* (87) db_options ::= db_options REPLICA NK_INTEGER */
+ { 270, -3 }, /* (88) db_options ::= db_options STRICT NK_INTEGER */
+ { 270, -3 }, /* (89) db_options ::= db_options WAL NK_INTEGER */
+ { 270, -3 }, /* (90) db_options ::= db_options VGROUPS NK_INTEGER */
+ { 270, -3 }, /* (91) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
+ { 270, -3 }, /* (92) db_options ::= db_options RETENTIONS retention_list */
+ { 270, -3 }, /* (93) db_options ::= db_options SCHEMALESS NK_INTEGER */
+ { 272, -1 }, /* (94) alter_db_options ::= alter_db_option */
+ { 272, -2 }, /* (95) alter_db_options ::= alter_db_options alter_db_option */
+ { 276, -2 }, /* (96) alter_db_option ::= BUFFER NK_INTEGER */
+ { 276, -2 }, /* (97) alter_db_option ::= CACHELAST NK_INTEGER */
+ { 276, -2 }, /* (98) alter_db_option ::= CACHELASTSIZE NK_INTEGER */
+ { 276, -2 }, /* (99) alter_db_option ::= FSYNC NK_INTEGER */
+ { 276, -2 }, /* (100) alter_db_option ::= KEEP integer_list */
+ { 276, -2 }, /* (101) alter_db_option ::= KEEP variable_list */
+ { 276, -2 }, /* (102) alter_db_option ::= PAGES NK_INTEGER */
+ { 276, -2 }, /* (103) alter_db_option ::= REPLICA NK_INTEGER */
+ { 276, -2 }, /* (104) alter_db_option ::= STRICT NK_INTEGER */
+ { 276, -2 }, /* (105) alter_db_option ::= WAL NK_INTEGER */
+ { 273, -1 }, /* (106) integer_list ::= NK_INTEGER */
+ { 273, -3 }, /* (107) integer_list ::= integer_list NK_COMMA NK_INTEGER */
+ { 274, -1 }, /* (108) variable_list ::= NK_VARIABLE */
+ { 274, -3 }, /* (109) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
+ { 275, -1 }, /* (110) retention_list ::= retention */
+ { 275, -3 }, /* (111) retention_list ::= retention_list NK_COMMA retention */
+ { 277, -3 }, /* (112) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
+ { 256, -9 }, /* (113) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
+ { 256, -3 }, /* (114) cmd ::= CREATE TABLE multi_create_clause */
+ { 256, -9 }, /* (115) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
+ { 256, -3 }, /* (116) cmd ::= DROP TABLE multi_drop_clause */
+ { 256, -4 }, /* (117) cmd ::= DROP STABLE exists_opt full_table_name */
+ { 256, -3 }, /* (118) cmd ::= ALTER TABLE alter_table_clause */
+ { 256, -3 }, /* (119) cmd ::= ALTER STABLE alter_table_clause */
+ { 285, -2 }, /* (120) alter_table_clause ::= full_table_name alter_table_options */
+ { 285, -5 }, /* (121) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
+ { 285, -4 }, /* (122) alter_table_clause ::= full_table_name DROP COLUMN column_name */
+ { 285, -5 }, /* (123) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+ { 285, -5 }, /* (124) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+ { 285, -5 }, /* (125) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+ { 285, -4 }, /* (126) alter_table_clause ::= full_table_name DROP TAG column_name */
+ { 285, -5 }, /* (127) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+ { 285, -5 }, /* (128) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+ { 285, -6 }, /* (129) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
+ { 282, -1 }, /* (130) multi_create_clause ::= create_subtable_clause */
+ { 282, -2 }, /* (131) multi_create_clause ::= multi_create_clause create_subtable_clause */
+ { 290, -10 }, /* (132) 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 */
+ { 284, -1 }, /* (133) multi_drop_clause ::= drop_table_clause */
+ { 284, -2 }, /* (134) multi_drop_clause ::= multi_drop_clause drop_table_clause */
+ { 293, -2 }, /* (135) drop_table_clause ::= exists_opt full_table_name */
+ { 291, 0 }, /* (136) specific_cols_opt ::= */
+ { 291, -3 }, /* (137) specific_cols_opt ::= NK_LP col_name_list NK_RP */
+ { 278, -1 }, /* (138) full_table_name ::= table_name */
+ { 278, -3 }, /* (139) full_table_name ::= db_name NK_DOT table_name */
+ { 279, -1 }, /* (140) column_def_list ::= column_def */
+ { 279, -3 }, /* (141) column_def_list ::= column_def_list NK_COMMA column_def */
+ { 296, -2 }, /* (142) column_def ::= column_name type_name */
+ { 296, -4 }, /* (143) column_def ::= column_name type_name COMMENT NK_STRING */
+ { 288, -1 }, /* (144) type_name ::= BOOL */
+ { 288, -1 }, /* (145) type_name ::= TINYINT */
+ { 288, -1 }, /* (146) type_name ::= SMALLINT */
+ { 288, -1 }, /* (147) type_name ::= INT */
+ { 288, -1 }, /* (148) type_name ::= INTEGER */
+ { 288, -1 }, /* (149) type_name ::= BIGINT */
+ { 288, -1 }, /* (150) type_name ::= FLOAT */
+ { 288, -1 }, /* (151) type_name ::= DOUBLE */
+ { 288, -4 }, /* (152) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+ { 288, -1 }, /* (153) type_name ::= TIMESTAMP */
+ { 288, -4 }, /* (154) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+ { 288, -2 }, /* (155) type_name ::= TINYINT UNSIGNED */
+ { 288, -2 }, /* (156) type_name ::= SMALLINT UNSIGNED */
+ { 288, -2 }, /* (157) type_name ::= INT UNSIGNED */
+ { 288, -2 }, /* (158) type_name ::= BIGINT UNSIGNED */
+ { 288, -1 }, /* (159) type_name ::= JSON */
+ { 288, -4 }, /* (160) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+ { 288, -1 }, /* (161) type_name ::= MEDIUMBLOB */
+ { 288, -1 }, /* (162) type_name ::= BLOB */
+ { 288, -4 }, /* (163) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+ { 288, -1 }, /* (164) type_name ::= DECIMAL */
+ { 288, -4 }, /* (165) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+ { 288, -6 }, /* (166) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+ { 280, 0 }, /* (167) tags_def_opt ::= */
+ { 280, -1 }, /* (168) tags_def_opt ::= tags_def */
+ { 283, -4 }, /* (169) tags_def ::= TAGS NK_LP column_def_list NK_RP */
+ { 281, 0 }, /* (170) table_options ::= */
+ { 281, -3 }, /* (171) table_options ::= table_options COMMENT NK_STRING */
+ { 281, -3 }, /* (172) table_options ::= table_options MAX_DELAY duration_list */
+ { 281, -3 }, /* (173) table_options ::= table_options WATERMARK duration_list */
+ { 281, -5 }, /* (174) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
+ { 281, -3 }, /* (175) table_options ::= table_options TTL NK_INTEGER */
+ { 281, -5 }, /* (176) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+ { 286, -1 }, /* (177) alter_table_options ::= alter_table_option */
+ { 286, -2 }, /* (178) alter_table_options ::= alter_table_options alter_table_option */
+ { 299, -2 }, /* (179) alter_table_option ::= COMMENT NK_STRING */
+ { 299, -2 }, /* (180) alter_table_option ::= TTL NK_INTEGER */
+ { 297, -1 }, /* (181) duration_list ::= duration_literal */
+ { 297, -3 }, /* (182) duration_list ::= duration_list NK_COMMA duration_literal */
+ { 298, -1 }, /* (183) rollup_func_list ::= rollup_func_name */
+ { 298, -3 }, /* (184) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */
+ { 301, -1 }, /* (185) rollup_func_name ::= function_name */
+ { 301, -1 }, /* (186) rollup_func_name ::= FIRST */
+ { 301, -1 }, /* (187) rollup_func_name ::= LAST */
+ { 294, -1 }, /* (188) col_name_list ::= col_name */
+ { 294, -3 }, /* (189) col_name_list ::= col_name_list NK_COMMA col_name */
+ { 303, -1 }, /* (190) col_name ::= column_name */
+ { 256, -2 }, /* (191) cmd ::= SHOW DNODES */
+ { 256, -2 }, /* (192) cmd ::= SHOW USERS */
+ { 256, -2 }, /* (193) cmd ::= SHOW DATABASES */
+ { 256, -4 }, /* (194) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
+ { 256, -4 }, /* (195) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
+ { 256, -3 }, /* (196) cmd ::= SHOW db_name_cond_opt VGROUPS */
+ { 256, -2 }, /* (197) cmd ::= SHOW MNODES */
+ { 256, -2 }, /* (198) cmd ::= SHOW MODULES */
+ { 256, -2 }, /* (199) cmd ::= SHOW QNODES */
+ { 256, -2 }, /* (200) cmd ::= SHOW FUNCTIONS */
+ { 256, -5 }, /* (201) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
+ { 256, -2 }, /* (202) cmd ::= SHOW STREAMS */
+ { 256, -2 }, /* (203) cmd ::= SHOW ACCOUNTS */
+ { 256, -2 }, /* (204) cmd ::= SHOW APPS */
+ { 256, -2 }, /* (205) cmd ::= SHOW CONNECTIONS */
+ { 256, -2 }, /* (206) cmd ::= SHOW LICENCE */
+ { 256, -2 }, /* (207) cmd ::= SHOW GRANTS */
+ { 256, -4 }, /* (208) cmd ::= SHOW CREATE DATABASE db_name */
+ { 256, -4 }, /* (209) cmd ::= SHOW CREATE TABLE full_table_name */
+ { 256, -4 }, /* (210) cmd ::= SHOW CREATE STABLE full_table_name */
+ { 256, -2 }, /* (211) cmd ::= SHOW QUERIES */
+ { 256, -2 }, /* (212) cmd ::= SHOW SCORES */
+ { 256, -2 }, /* (213) cmd ::= SHOW TOPICS */
+ { 256, -2 }, /* (214) cmd ::= SHOW VARIABLES */
+ { 256, -3 }, /* (215) cmd ::= SHOW LOCAL VARIABLES */
+ { 256, -4 }, /* (216) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */
+ { 256, -2 }, /* (217) cmd ::= SHOW BNODES */
+ { 256, -2 }, /* (218) cmd ::= SHOW SNODES */
+ { 256, -2 }, /* (219) cmd ::= SHOW CLUSTER */
+ { 256, -2 }, /* (220) cmd ::= SHOW TRANSACTIONS */
+ { 256, -4 }, /* (221) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
+ { 256, -2 }, /* (222) cmd ::= SHOW CONSUMERS */
+ { 256, -2 }, /* (223) cmd ::= SHOW SUBSCRIPTIONS */
+ { 304, 0 }, /* (224) db_name_cond_opt ::= */
+ { 304, -2 }, /* (225) db_name_cond_opt ::= db_name NK_DOT */
+ { 305, 0 }, /* (226) like_pattern_opt ::= */
+ { 305, -2 }, /* (227) like_pattern_opt ::= LIKE NK_STRING */
+ { 306, -1 }, /* (228) table_name_cond ::= table_name */
+ { 307, 0 }, /* (229) from_db_opt ::= */
+ { 307, -2 }, /* (230) from_db_opt ::= FROM db_name */
+ { 256, -8 }, /* (231) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
+ { 256, -4 }, /* (232) cmd ::= DROP INDEX exists_opt index_name */
+ { 309, -10 }, /* (233) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
+ { 309, -12 }, /* (234) 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 */
+ { 310, -1 }, /* (235) func_list ::= func */
+ { 310, -3 }, /* (236) func_list ::= func_list NK_COMMA func */
+ { 313, -4 }, /* (237) func ::= function_name NK_LP expression_list NK_RP */
+ { 312, 0 }, /* (238) sma_stream_opt ::= */
+ { 312, -3 }, /* (239) sma_stream_opt ::= stream_options WATERMARK duration_literal */
+ { 312, -3 }, /* (240) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */
+ { 256, -6 }, /* (241) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
+ { 256, -7 }, /* (242) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
+ { 256, -9 }, /* (243) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
+ { 256, -7 }, /* (244) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
+ { 256, -9 }, /* (245) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
+ { 256, -4 }, /* (246) cmd ::= DROP TOPIC exists_opt topic_name */
+ { 256, -7 }, /* (247) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
+ { 256, -2 }, /* (248) cmd ::= DESC full_table_name */
+ { 256, -2 }, /* (249) cmd ::= DESCRIBE full_table_name */
+ { 256, -3 }, /* (250) cmd ::= RESET QUERY CACHE */
+ { 256, -4 }, /* (251) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
+ { 318, 0 }, /* (252) analyze_opt ::= */
+ { 318, -1 }, /* (253) analyze_opt ::= ANALYZE */
+ { 319, 0 }, /* (254) explain_options ::= */
+ { 319, -3 }, /* (255) explain_options ::= explain_options VERBOSE NK_BOOL */
+ { 319, -3 }, /* (256) explain_options ::= explain_options RATIO NK_FLOAT */
+ { 256, -6 }, /* (257) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
+ { 256, -10 }, /* (258) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
+ { 256, -4 }, /* (259) cmd ::= DROP FUNCTION exists_opt function_name */
+ { 320, 0 }, /* (260) agg_func_opt ::= */
+ { 320, -1 }, /* (261) agg_func_opt ::= AGGREGATE */
+ { 321, 0 }, /* (262) bufsize_opt ::= */
+ { 321, -2 }, /* (263) bufsize_opt ::= BUFSIZE NK_INTEGER */
+ { 256, -8 }, /* (264) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
+ { 256, -4 }, /* (265) cmd ::= DROP STREAM exists_opt stream_name */
+ { 323, 0 }, /* (266) into_opt ::= */
+ { 323, -2 }, /* (267) into_opt ::= INTO full_table_name */
+ { 314, 0 }, /* (268) stream_options ::= */
+ { 314, -3 }, /* (269) stream_options ::= stream_options TRIGGER AT_ONCE */
+ { 314, -3 }, /* (270) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
+ { 314, -4 }, /* (271) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
+ { 314, -3 }, /* (272) stream_options ::= stream_options WATERMARK duration_literal */
+ { 314, -3 }, /* (273) stream_options ::= stream_options IGNORE EXPIRED */
+ { 256, -3 }, /* (274) cmd ::= KILL CONNECTION NK_INTEGER */
+ { 256, -3 }, /* (275) cmd ::= KILL QUERY NK_STRING */
+ { 256, -3 }, /* (276) cmd ::= KILL TRANSACTION NK_INTEGER */
+ { 256, -2 }, /* (277) cmd ::= BALANCE VGROUP */
+ { 256, -4 }, /* (278) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
+ { 256, -4 }, /* (279) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
+ { 256, -3 }, /* (280) cmd ::= SPLIT VGROUP NK_INTEGER */
+ { 324, -2 }, /* (281) dnode_list ::= DNODE NK_INTEGER */
+ { 324, -3 }, /* (282) dnode_list ::= dnode_list DNODE NK_INTEGER */
+ { 256, -3 }, /* (283) cmd ::= SYNCDB db_name REPLICA */
+ { 256, -4 }, /* (284) cmd ::= DELETE FROM full_table_name where_clause_opt */
+ { 256, -1 }, /* (285) cmd ::= query_expression */
+ { 256, -7 }, /* (286) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression */
+ { 256, -4 }, /* (287) cmd ::= INSERT INTO full_table_name query_expression */
+ { 259, -1 }, /* (288) literal ::= NK_INTEGER */
+ { 259, -1 }, /* (289) literal ::= NK_FLOAT */
+ { 259, -1 }, /* (290) literal ::= NK_STRING */
+ { 259, -1 }, /* (291) literal ::= NK_BOOL */
+ { 259, -2 }, /* (292) literal ::= TIMESTAMP NK_STRING */
+ { 259, -1 }, /* (293) literal ::= duration_literal */
+ { 259, -1 }, /* (294) literal ::= NULL */
+ { 259, -1 }, /* (295) literal ::= NK_QUESTION */
+ { 300, -1 }, /* (296) duration_literal ::= NK_VARIABLE */
+ { 326, -1 }, /* (297) signed ::= NK_INTEGER */
+ { 326, -2 }, /* (298) signed ::= NK_PLUS NK_INTEGER */
+ { 326, -2 }, /* (299) signed ::= NK_MINUS NK_INTEGER */
+ { 326, -1 }, /* (300) signed ::= NK_FLOAT */
+ { 326, -2 }, /* (301) signed ::= NK_PLUS NK_FLOAT */
+ { 326, -2 }, /* (302) signed ::= NK_MINUS NK_FLOAT */
+ { 289, -1 }, /* (303) signed_literal ::= signed */
+ { 289, -1 }, /* (304) signed_literal ::= NK_STRING */
+ { 289, -1 }, /* (305) signed_literal ::= NK_BOOL */
+ { 289, -2 }, /* (306) signed_literal ::= TIMESTAMP NK_STRING */
+ { 289, -1 }, /* (307) signed_literal ::= duration_literal */
+ { 289, -1 }, /* (308) signed_literal ::= NULL */
+ { 289, -1 }, /* (309) signed_literal ::= literal_func */
+ { 289, -1 }, /* (310) signed_literal ::= NK_QUESTION */
+ { 328, -1 }, /* (311) literal_list ::= signed_literal */
+ { 328, -3 }, /* (312) literal_list ::= literal_list NK_COMMA signed_literal */
+ { 267, -1 }, /* (313) db_name ::= NK_ID */
+ { 295, -1 }, /* (314) table_name ::= NK_ID */
+ { 287, -1 }, /* (315) column_name ::= NK_ID */
+ { 302, -1 }, /* (316) function_name ::= NK_ID */
+ { 329, -1 }, /* (317) table_alias ::= NK_ID */
+ { 330, -1 }, /* (318) column_alias ::= NK_ID */
+ { 261, -1 }, /* (319) user_name ::= NK_ID */
+ { 308, -1 }, /* (320) index_name ::= NK_ID */
+ { 315, -1 }, /* (321) topic_name ::= NK_ID */
+ { 322, -1 }, /* (322) stream_name ::= NK_ID */
+ { 317, -1 }, /* (323) cgroup_name ::= NK_ID */
+ { 331, -1 }, /* (324) expression ::= literal */
+ { 331, -1 }, /* (325) expression ::= pseudo_column */
+ { 331, -1 }, /* (326) expression ::= column_reference */
+ { 331, -1 }, /* (327) expression ::= function_expression */
+ { 331, -1 }, /* (328) expression ::= subquery */
+ { 331, -3 }, /* (329) expression ::= NK_LP expression NK_RP */
+ { 331, -2 }, /* (330) expression ::= NK_PLUS expression */
+ { 331, -2 }, /* (331) expression ::= NK_MINUS expression */
+ { 331, -3 }, /* (332) expression ::= expression NK_PLUS expression */
+ { 331, -3 }, /* (333) expression ::= expression NK_MINUS expression */
+ { 331, -3 }, /* (334) expression ::= expression NK_STAR expression */
+ { 331, -3 }, /* (335) expression ::= expression NK_SLASH expression */
+ { 331, -3 }, /* (336) expression ::= expression NK_REM expression */
+ { 331, -3 }, /* (337) expression ::= column_reference NK_ARROW NK_STRING */
+ { 331, -3 }, /* (338) expression ::= expression NK_BITAND expression */
+ { 331, -3 }, /* (339) expression ::= expression NK_BITOR expression */
+ { 292, -1 }, /* (340) expression_list ::= expression */
+ { 292, -3 }, /* (341) expression_list ::= expression_list NK_COMMA expression */
+ { 333, -1 }, /* (342) column_reference ::= column_name */
+ { 333, -3 }, /* (343) column_reference ::= table_name NK_DOT column_name */
+ { 332, -1 }, /* (344) pseudo_column ::= ROWTS */
+ { 332, -1 }, /* (345) pseudo_column ::= TBNAME */
+ { 332, -3 }, /* (346) pseudo_column ::= table_name NK_DOT TBNAME */
+ { 332, -1 }, /* (347) pseudo_column ::= QSTART */
+ { 332, -1 }, /* (348) pseudo_column ::= QEND */
+ { 332, -1 }, /* (349) pseudo_column ::= QDURATION */
+ { 332, -1 }, /* (350) pseudo_column ::= WSTART */
+ { 332, -1 }, /* (351) pseudo_column ::= WEND */
+ { 332, -1 }, /* (352) pseudo_column ::= WDURATION */
+ { 334, -4 }, /* (353) function_expression ::= function_name NK_LP expression_list NK_RP */
+ { 334, -4 }, /* (354) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
+ { 334, -6 }, /* (355) function_expression ::= CAST NK_LP expression AS type_name NK_RP */
+ { 334, -1 }, /* (356) function_expression ::= literal_func */
+ { 327, -3 }, /* (357) literal_func ::= noarg_func NK_LP NK_RP */
+ { 327, -1 }, /* (358) literal_func ::= NOW */
+ { 338, -1 }, /* (359) noarg_func ::= NOW */
+ { 338, -1 }, /* (360) noarg_func ::= TODAY */
+ { 338, -1 }, /* (361) noarg_func ::= TIMEZONE */
+ { 338, -1 }, /* (362) noarg_func ::= DATABASE */
+ { 338, -1 }, /* (363) noarg_func ::= CLIENT_VERSION */
+ { 338, -1 }, /* (364) noarg_func ::= SERVER_VERSION */
+ { 338, -1 }, /* (365) noarg_func ::= SERVER_STATUS */
+ { 338, -1 }, /* (366) noarg_func ::= CURRENT_USER */
+ { 338, -1 }, /* (367) noarg_func ::= USER */
+ { 336, -1 }, /* (368) star_func ::= COUNT */
+ { 336, -1 }, /* (369) star_func ::= FIRST */
+ { 336, -1 }, /* (370) star_func ::= LAST */
+ { 336, -1 }, /* (371) star_func ::= LAST_ROW */
+ { 337, -1 }, /* (372) star_func_para_list ::= NK_STAR */
+ { 337, -1 }, /* (373) star_func_para_list ::= other_para_list */
+ { 339, -1 }, /* (374) other_para_list ::= star_func_para */
+ { 339, -3 }, /* (375) other_para_list ::= other_para_list NK_COMMA star_func_para */
+ { 340, -1 }, /* (376) star_func_para ::= expression */
+ { 340, -3 }, /* (377) star_func_para ::= table_name NK_DOT NK_STAR */
+ { 341, -3 }, /* (378) predicate ::= expression compare_op expression */
+ { 341, -5 }, /* (379) predicate ::= expression BETWEEN expression AND expression */
+ { 341, -6 }, /* (380) predicate ::= expression NOT BETWEEN expression AND expression */
+ { 341, -3 }, /* (381) predicate ::= expression IS NULL */
+ { 341, -4 }, /* (382) predicate ::= expression IS NOT NULL */
+ { 341, -3 }, /* (383) predicate ::= expression in_op in_predicate_value */
+ { 342, -1 }, /* (384) compare_op ::= NK_LT */
+ { 342, -1 }, /* (385) compare_op ::= NK_GT */
+ { 342, -1 }, /* (386) compare_op ::= NK_LE */
+ { 342, -1 }, /* (387) compare_op ::= NK_GE */
+ { 342, -1 }, /* (388) compare_op ::= NK_NE */
+ { 342, -1 }, /* (389) compare_op ::= NK_EQ */
+ { 342, -1 }, /* (390) compare_op ::= LIKE */
+ { 342, -2 }, /* (391) compare_op ::= NOT LIKE */
+ { 342, -1 }, /* (392) compare_op ::= MATCH */
+ { 342, -1 }, /* (393) compare_op ::= NMATCH */
+ { 342, -1 }, /* (394) compare_op ::= CONTAINS */
+ { 343, -1 }, /* (395) in_op ::= IN */
+ { 343, -2 }, /* (396) in_op ::= NOT IN */
+ { 344, -3 }, /* (397) in_predicate_value ::= NK_LP literal_list NK_RP */
+ { 345, -1 }, /* (398) boolean_value_expression ::= boolean_primary */
+ { 345, -2 }, /* (399) boolean_value_expression ::= NOT boolean_primary */
+ { 345, -3 }, /* (400) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ { 345, -3 }, /* (401) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ { 346, -1 }, /* (402) boolean_primary ::= predicate */
+ { 346, -3 }, /* (403) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
+ { 347, -1 }, /* (404) common_expression ::= expression */
+ { 347, -1 }, /* (405) common_expression ::= boolean_value_expression */
+ { 348, 0 }, /* (406) from_clause_opt ::= */
+ { 348, -2 }, /* (407) from_clause_opt ::= FROM table_reference_list */
+ { 349, -1 }, /* (408) table_reference_list ::= table_reference */
+ { 349, -3 }, /* (409) table_reference_list ::= table_reference_list NK_COMMA table_reference */
+ { 350, -1 }, /* (410) table_reference ::= table_primary */
+ { 350, -1 }, /* (411) table_reference ::= joined_table */
+ { 351, -2 }, /* (412) table_primary ::= table_name alias_opt */
+ { 351, -4 }, /* (413) table_primary ::= db_name NK_DOT table_name alias_opt */
+ { 351, -2 }, /* (414) table_primary ::= subquery alias_opt */
+ { 351, -1 }, /* (415) table_primary ::= parenthesized_joined_table */
+ { 353, 0 }, /* (416) alias_opt ::= */
+ { 353, -1 }, /* (417) alias_opt ::= table_alias */
+ { 353, -2 }, /* (418) alias_opt ::= AS table_alias */
+ { 354, -3 }, /* (419) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ { 354, -3 }, /* (420) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
+ { 352, -6 }, /* (421) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+ { 355, 0 }, /* (422) join_type ::= */
+ { 355, -1 }, /* (423) join_type ::= INNER */
+ { 357, -12 }, /* (424) query_specification ::= SELECT set_quantifier_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 */
+ { 358, 0 }, /* (425) set_quantifier_opt ::= */
+ { 358, -1 }, /* (426) set_quantifier_opt ::= DISTINCT */
+ { 358, -1 }, /* (427) set_quantifier_opt ::= ALL */
+ { 359, -1 }, /* (428) select_list ::= select_item */
+ { 359, -3 }, /* (429) select_list ::= select_list NK_COMMA select_item */
+ { 367, -1 }, /* (430) select_item ::= NK_STAR */
+ { 367, -1 }, /* (431) select_item ::= common_expression */
+ { 367, -2 }, /* (432) select_item ::= common_expression column_alias */
+ { 367, -3 }, /* (433) select_item ::= common_expression AS column_alias */
+ { 367, -3 }, /* (434) select_item ::= table_name NK_DOT NK_STAR */
+ { 325, 0 }, /* (435) where_clause_opt ::= */
+ { 325, -2 }, /* (436) where_clause_opt ::= WHERE search_condition */
+ { 360, 0 }, /* (437) partition_by_clause_opt ::= */
+ { 360, -3 }, /* (438) partition_by_clause_opt ::= PARTITION BY expression_list */
+ { 364, 0 }, /* (439) twindow_clause_opt ::= */
+ { 364, -6 }, /* (440) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
+ { 364, -4 }, /* (441) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
+ { 364, -6 }, /* (442) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+ { 364, -8 }, /* (443) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+ { 311, 0 }, /* (444) sliding_opt ::= */
+ { 311, -4 }, /* (445) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
+ { 363, 0 }, /* (446) fill_opt ::= */
+ { 363, -4 }, /* (447) fill_opt ::= FILL NK_LP fill_mode NK_RP */
+ { 363, -6 }, /* (448) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+ { 368, -1 }, /* (449) fill_mode ::= NONE */
+ { 368, -1 }, /* (450) fill_mode ::= PREV */
+ { 368, -1 }, /* (451) fill_mode ::= NULL */
+ { 368, -1 }, /* (452) fill_mode ::= LINEAR */
+ { 368, -1 }, /* (453) fill_mode ::= NEXT */
+ { 365, 0 }, /* (454) group_by_clause_opt ::= */
+ { 365, -3 }, /* (455) group_by_clause_opt ::= GROUP BY group_by_list */
+ { 369, -1 }, /* (456) group_by_list ::= expression */
+ { 369, -3 }, /* (457) group_by_list ::= group_by_list NK_COMMA expression */
+ { 366, 0 }, /* (458) having_clause_opt ::= */
+ { 366, -2 }, /* (459) having_clause_opt ::= HAVING search_condition */
+ { 361, 0 }, /* (460) range_opt ::= */
+ { 361, -6 }, /* (461) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */
+ { 362, 0 }, /* (462) every_opt ::= */
+ { 362, -4 }, /* (463) every_opt ::= EVERY NK_LP duration_literal NK_RP */
+ { 316, -4 }, /* (464) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ { 370, -1 }, /* (465) query_expression_body ::= query_primary */
+ { 370, -4 }, /* (466) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
+ { 370, -3 }, /* (467) query_expression_body ::= query_expression_body UNION query_expression_body */
+ { 374, -1 }, /* (468) query_primary ::= query_specification */
+ { 374, -6 }, /* (469) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
+ { 371, 0 }, /* (470) order_by_clause_opt ::= */
+ { 371, -3 }, /* (471) order_by_clause_opt ::= ORDER BY sort_specification_list */
+ { 372, 0 }, /* (472) slimit_clause_opt ::= */
+ { 372, -2 }, /* (473) slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ { 372, -4 }, /* (474) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ { 372, -4 }, /* (475) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ { 373, 0 }, /* (476) limit_clause_opt ::= */
+ { 373, -2 }, /* (477) limit_clause_opt ::= LIMIT NK_INTEGER */
+ { 373, -4 }, /* (478) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
+ { 373, -4 }, /* (479) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ { 335, -3 }, /* (480) subquery ::= NK_LP query_expression NK_RP */
+ { 356, -1 }, /* (481) search_condition ::= common_expression */
+ { 375, -1 }, /* (482) sort_specification_list ::= sort_specification */
+ { 375, -3 }, /* (483) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
+ { 376, -3 }, /* (484) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
+ { 377, 0 }, /* (485) ordering_specification_opt ::= */
+ { 377, -1 }, /* (486) ordering_specification_opt ::= ASC */
+ { 377, -1 }, /* (487) ordering_specification_opt ::= DESC */
+ { 378, 0 }, /* (488) null_ordering_opt ::= */
+ { 378, -2 }, /* (489) null_ordering_opt ::= NULLS FIRST */
+ { 378, -2 }, /* (490) null_ordering_opt ::= NULLS LAST */
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -3269,11 +3321,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,256,&yymsp[0].minor);
+ yy_destructor(yypParser,257,&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,257,&yymsp[0].minor);
+ yy_destructor(yypParser,258,&yymsp[0].minor);
break;
case 2: /* account_options ::= */
{ }
@@ -3287,20 +3339,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,256,&yymsp[-2].minor);
+{ yy_destructor(yypParser,257,&yymsp[-2].minor);
{ }
- yy_destructor(yypParser,258,&yymsp[0].minor);
+ yy_destructor(yypParser,259,&yymsp[0].minor);
}
break;
case 12: /* alter_account_options ::= alter_account_option */
-{ yy_destructor(yypParser,259,&yymsp[0].minor);
+{ yy_destructor(yypParser,260,&yymsp[0].minor);
{ }
}
break;
case 13: /* alter_account_options ::= alter_account_options alter_account_option */
-{ yy_destructor(yypParser,257,&yymsp[-1].minor);
+{ yy_destructor(yypParser,258,&yymsp[-1].minor);
{ }
- yy_destructor(yypParser,259,&yymsp[0].minor);
+ yy_destructor(yypParser,260,&yymsp[0].minor);
}
break;
case 14: /* alter_account_option ::= PASS literal */
@@ -3314,72 +3366,72 @@ 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,258,&yymsp[0].minor);
+ yy_destructor(yypParser,259,&yymsp[0].minor);
break;
case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
-{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy533, &yymsp[-1].minor.yy0, yymsp[0].minor.yy719); }
+{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy361, &yymsp[-1].minor.yy0, yymsp[0].minor.yy285); }
break;
case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy361, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
break;
case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy361, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
break;
case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy361, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
break;
case 28: /* cmd ::= DROP USER user_name */
-{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy361); }
break;
case 29: /* sysinfo_opt ::= */
-{ yymsp[1].minor.yy719 = 1; }
+{ yymsp[1].minor.yy285 = 1; }
break;
case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */
-{ yymsp[-1].minor.yy719 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
+{ yymsp[-1].minor.yy285 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */
-{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy585, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy457, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361); }
break;
case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */
-{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy585, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy457, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361); }
break;
case 33: /* privileges ::= ALL */
-{ yymsp[0].minor.yy585 = PRIVILEGE_TYPE_ALL; }
+{ yymsp[0].minor.yy457 = PRIVILEGE_TYPE_ALL; }
break;
case 34: /* privileges ::= priv_type_list */
case 35: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==35);
-{ yylhsminor.yy585 = yymsp[0].minor.yy585; }
- yymsp[0].minor.yy585 = yylhsminor.yy585;
+{ yylhsminor.yy457 = yymsp[0].minor.yy457; }
+ yymsp[0].minor.yy457 = yylhsminor.yy457;
break;
case 36: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
-{ yylhsminor.yy585 = yymsp[-2].minor.yy585 | yymsp[0].minor.yy585; }
- yymsp[-2].minor.yy585 = yylhsminor.yy585;
+{ yylhsminor.yy457 = yymsp[-2].minor.yy457 | yymsp[0].minor.yy457; }
+ yymsp[-2].minor.yy457 = yylhsminor.yy457;
break;
case 37: /* priv_type ::= READ */
-{ yymsp[0].minor.yy585 = PRIVILEGE_TYPE_READ; }
+{ yymsp[0].minor.yy457 = PRIVILEGE_TYPE_READ; }
break;
case 38: /* priv_type ::= WRITE */
-{ yymsp[0].minor.yy585 = PRIVILEGE_TYPE_WRITE; }
+{ yymsp[0].minor.yy457 = PRIVILEGE_TYPE_WRITE; }
break;
case 39: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
-{ yylhsminor.yy533 = yymsp[-2].minor.yy0; }
- yymsp[-2].minor.yy533 = yylhsminor.yy533;
+{ yylhsminor.yy361 = yymsp[-2].minor.yy0; }
+ yymsp[-2].minor.yy361 = yylhsminor.yy361;
break;
case 40: /* priv_level ::= db_name NK_DOT NK_STAR */
-{ yylhsminor.yy533 = yymsp[-2].minor.yy533; }
- yymsp[-2].minor.yy533 = yylhsminor.yy533;
+{ yylhsminor.yy361 = yymsp[-2].minor.yy361; }
+ yymsp[-2].minor.yy361 = yylhsminor.yy361;
break;
case 41: /* cmd ::= CREATE DNODE dnode_endpoint */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy533, NULL); }
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy361, NULL); }
break;
case 42: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy0); }
break;
case 43: /* cmd ::= DROP DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
break;
case 44: /* cmd ::= DROP DNODE dnode_endpoint */
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy361); }
break;
case 45: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
@@ -3396,32 +3448,32 @@ static YYACTIONTYPE yy_reduce(
case 49: /* dnode_endpoint ::= NK_STRING */
case 50: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==50);
case 51: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==51);
- case 312: /* db_name ::= NK_ID */ yytestcase(yyruleno==312);
- case 313: /* table_name ::= NK_ID */ yytestcase(yyruleno==313);
- case 314: /* column_name ::= NK_ID */ yytestcase(yyruleno==314);
- case 315: /* function_name ::= NK_ID */ yytestcase(yyruleno==315);
- case 316: /* table_alias ::= NK_ID */ yytestcase(yyruleno==316);
- case 317: /* column_alias ::= NK_ID */ yytestcase(yyruleno==317);
- case 318: /* user_name ::= NK_ID */ yytestcase(yyruleno==318);
- case 319: /* index_name ::= NK_ID */ yytestcase(yyruleno==319);
- case 320: /* topic_name ::= NK_ID */ yytestcase(yyruleno==320);
- case 321: /* stream_name ::= NK_ID */ yytestcase(yyruleno==321);
- case 322: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==322);
- case 357: /* noarg_func ::= NOW */ yytestcase(yyruleno==357);
- case 358: /* noarg_func ::= TODAY */ yytestcase(yyruleno==358);
- case 359: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==359);
- case 360: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==360);
- case 361: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==361);
- case 362: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==362);
- case 363: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==363);
- case 364: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==364);
- case 365: /* noarg_func ::= USER */ yytestcase(yyruleno==365);
- case 366: /* star_func ::= COUNT */ yytestcase(yyruleno==366);
- case 367: /* star_func ::= FIRST */ yytestcase(yyruleno==367);
- case 368: /* star_func ::= LAST */ yytestcase(yyruleno==368);
- case 369: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==369);
-{ yylhsminor.yy533 = yymsp[0].minor.yy0; }
- yymsp[0].minor.yy533 = yylhsminor.yy533;
+ case 313: /* db_name ::= NK_ID */ yytestcase(yyruleno==313);
+ case 314: /* table_name ::= NK_ID */ yytestcase(yyruleno==314);
+ case 315: /* column_name ::= NK_ID */ yytestcase(yyruleno==315);
+ case 316: /* function_name ::= NK_ID */ yytestcase(yyruleno==316);
+ case 317: /* table_alias ::= NK_ID */ yytestcase(yyruleno==317);
+ case 318: /* column_alias ::= NK_ID */ yytestcase(yyruleno==318);
+ case 319: /* user_name ::= NK_ID */ yytestcase(yyruleno==319);
+ case 320: /* index_name ::= NK_ID */ yytestcase(yyruleno==320);
+ case 321: /* topic_name ::= NK_ID */ yytestcase(yyruleno==321);
+ case 322: /* stream_name ::= NK_ID */ yytestcase(yyruleno==322);
+ case 323: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==323);
+ case 359: /* noarg_func ::= NOW */ yytestcase(yyruleno==359);
+ case 360: /* noarg_func ::= TODAY */ yytestcase(yyruleno==360);
+ case 361: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==361);
+ case 362: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==362);
+ case 363: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==363);
+ case 364: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==364);
+ case 365: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==365);
+ case 366: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==366);
+ case 367: /* noarg_func ::= USER */ yytestcase(yyruleno==367);
+ case 368: /* star_func ::= COUNT */ yytestcase(yyruleno==368);
+ case 369: /* star_func ::= FIRST */ yytestcase(yyruleno==369);
+ case 370: /* star_func ::= LAST */ yytestcase(yyruleno==370);
+ case 371: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==371);
+{ yylhsminor.yy361 = yymsp[0].minor.yy0; }
+ yymsp[0].minor.yy361 = yylhsminor.yy361;
break;
case 52: /* cmd ::= ALTER LOCAL NK_STRING */
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
@@ -3454,169 +3506,169 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
break;
case 62: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
-{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy173, &yymsp[-1].minor.yy533, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy151, &yymsp[-1].minor.yy361, yymsp[0].minor.yy616); }
break;
case 63: /* cmd ::= DROP DATABASE exists_opt db_name */
-{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); }
break;
case 64: /* cmd ::= USE db_name */
-{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy361); }
break;
case 65: /* cmd ::= ALTER DATABASE db_name alter_db_options */
-{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy361, yymsp[0].minor.yy616); }
break;
case 66: /* cmd ::= FLUSH DATABASE db_name */
-{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy361); }
break;
case 67: /* cmd ::= TRIM DATABASE db_name */
-{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[0].minor.yy361); }
break;
case 68: /* not_exists_opt ::= IF NOT EXISTS */
-{ yymsp[-2].minor.yy173 = true; }
+{ yymsp[-2].minor.yy151 = true; }
break;
case 69: /* not_exists_opt ::= */
case 71: /* exists_opt ::= */ yytestcase(yyruleno==71);
case 252: /* analyze_opt ::= */ yytestcase(yyruleno==252);
case 260: /* agg_func_opt ::= */ yytestcase(yyruleno==260);
- case 423: /* set_quantifier_opt ::= */ yytestcase(yyruleno==423);
-{ yymsp[1].minor.yy173 = false; }
+ case 425: /* set_quantifier_opt ::= */ yytestcase(yyruleno==425);
+{ yymsp[1].minor.yy151 = false; }
break;
case 70: /* exists_opt ::= IF EXISTS */
-{ yymsp[-1].minor.yy173 = true; }
+{ yymsp[-1].minor.yy151 = true; }
break;
case 72: /* db_options ::= */
-{ yymsp[1].minor.yy560 = createDefaultDatabaseOptions(pCxt); }
+{ yymsp[1].minor.yy616 = createDefaultDatabaseOptions(pCxt); }
break;
case 73: /* db_options ::= db_options BUFFER NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 74: /* db_options ::= db_options CACHELAST NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 75: /* db_options ::= db_options CACHELASTSIZE NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_CACHELASTSIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_CACHELASTSIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 76: /* db_options ::= db_options COMP NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 77: /* db_options ::= db_options DURATION NK_INTEGER */
case 78: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==78);
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 79: /* db_options ::= db_options FSYNC NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 80: /* db_options ::= db_options MAXROWS NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 81: /* db_options ::= db_options MINROWS NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 82: /* db_options ::= db_options KEEP integer_list */
case 83: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==83);
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_KEEP, yymsp[0].minor.yy712); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_KEEP, yymsp[0].minor.yy356); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 84: /* db_options ::= db_options PAGES NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 85: /* db_options ::= db_options PAGESIZE NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 86: /* db_options ::= db_options PRECISION NK_STRING */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 87: /* db_options ::= db_options REPLICA NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 88: /* db_options ::= db_options STRICT NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_STRICT, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_STRICT, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 89: /* db_options ::= db_options WAL NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 90: /* db_options ::= db_options VGROUPS NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 91: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 92: /* db_options ::= db_options RETENTIONS retention_list */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_RETENTIONS, yymsp[0].minor.yy712); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_RETENTIONS, yymsp[0].minor.yy356); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 93: /* db_options ::= db_options SCHEMALESS NK_INTEGER */
-{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 94: /* alter_db_options ::= alter_db_option */
-{ yylhsminor.yy560 = createAlterDatabaseOptions(pCxt); yylhsminor.yy560 = setAlterDatabaseOption(pCxt, yylhsminor.yy560, &yymsp[0].minor.yy389); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterDatabaseOptions(pCxt); yylhsminor.yy616 = setAlterDatabaseOption(pCxt, yylhsminor.yy616, &yymsp[0].minor.yy409); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
case 95: /* alter_db_options ::= alter_db_options alter_db_option */
-{ yylhsminor.yy560 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy560, &yymsp[0].minor.yy389); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy616, &yymsp[0].minor.yy409); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
case 96: /* alter_db_option ::= BUFFER NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 97: /* alter_db_option ::= CACHELAST NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 98: /* alter_db_option ::= CACHELASTSIZE NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = DB_OPTION_CACHELASTSIZE; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_CACHELASTSIZE; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 99: /* alter_db_option ::= FSYNC NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 100: /* alter_db_option ::= KEEP integer_list */
case 101: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==101);
-{ yymsp[-1].minor.yy389.type = DB_OPTION_KEEP; yymsp[-1].minor.yy389.pList = yymsp[0].minor.yy712; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_KEEP; yymsp[-1].minor.yy409.pList = yymsp[0].minor.yy356; }
break;
case 102: /* alter_db_option ::= PAGES NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = DB_OPTION_PAGES; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_PAGES; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 103: /* alter_db_option ::= REPLICA NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 104: /* alter_db_option ::= STRICT NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = DB_OPTION_STRICT; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_STRICT; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 105: /* alter_db_option ::= WAL NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = DB_OPTION_WAL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = DB_OPTION_WAL; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 106: /* integer_list ::= NK_INTEGER */
-{ yylhsminor.yy712 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy712 = yylhsminor.yy712;
+{ yylhsminor.yy356 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy356 = yylhsminor.yy356;
break;
case 107: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
case 282: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==282);
-{ yylhsminor.yy712 = addNodeToList(pCxt, yymsp[-2].minor.yy712, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy712 = yylhsminor.yy712;
+{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy356 = yylhsminor.yy356;
break;
case 108: /* variable_list ::= NK_VARIABLE */
-{ yylhsminor.yy712 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy712 = yylhsminor.yy712;
+{ yylhsminor.yy356 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy356 = yylhsminor.yy356;
break;
case 109: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
-{ yylhsminor.yy712 = addNodeToList(pCxt, yymsp[-2].minor.yy712, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy712 = yylhsminor.yy712;
+{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy356 = yylhsminor.yy356;
break;
case 110: /* retention_list ::= retention */
case 130: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==130);
@@ -3625,266 +3677,266 @@ static YYACTIONTYPE yy_reduce(
case 183: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==183);
case 188: /* col_name_list ::= col_name */ yytestcase(yyruleno==188);
case 235: /* func_list ::= func */ yytestcase(yyruleno==235);
- case 310: /* literal_list ::= signed_literal */ yytestcase(yyruleno==310);
- case 372: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==372);
- case 426: /* select_list ::= select_item */ yytestcase(yyruleno==426);
- case 480: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==480);
-{ yylhsminor.yy712 = createNodeList(pCxt, yymsp[0].minor.yy560); }
- yymsp[0].minor.yy712 = yylhsminor.yy712;
+ case 311: /* literal_list ::= signed_literal */ yytestcase(yyruleno==311);
+ case 374: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==374);
+ case 428: /* select_list ::= select_item */ yytestcase(yyruleno==428);
+ case 482: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==482);
+{ yylhsminor.yy356 = createNodeList(pCxt, yymsp[0].minor.yy616); }
+ yymsp[0].minor.yy356 = yylhsminor.yy356;
break;
case 111: /* retention_list ::= retention_list NK_COMMA retention */
case 141: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==141);
case 184: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==184);
case 189: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==189);
case 236: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==236);
- case 311: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==311);
- case 373: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==373);
- case 427: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==427);
- case 481: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==481);
-{ yylhsminor.yy712 = addNodeToList(pCxt, yymsp[-2].minor.yy712, yymsp[0].minor.yy560); }
- yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ case 312: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==312);
+ case 375: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==375);
+ case 429: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==429);
+ case 483: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==483);
+{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, yymsp[0].minor.yy616); }
+ yymsp[-2].minor.yy356 = yylhsminor.yy356;
break;
case 112: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
-{ yylhsminor.yy560 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 113: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
case 115: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==115);
-{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy173, yymsp[-5].minor.yy560, yymsp[-3].minor.yy712, yymsp[-1].minor.yy712, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy151, yymsp[-5].minor.yy616, yymsp[-3].minor.yy356, yymsp[-1].minor.yy356, yymsp[0].minor.yy616); }
break;
case 114: /* cmd ::= CREATE TABLE multi_create_clause */
-{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy712); }
+{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy356); }
break;
case 116: /* cmd ::= DROP TABLE multi_drop_clause */
-{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy712); }
+{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy356); }
break;
case 117: /* cmd ::= DROP STABLE exists_opt full_table_name */
-{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy151, yymsp[0].minor.yy616); }
break;
case 118: /* cmd ::= ALTER TABLE alter_table_clause */
case 285: /* cmd ::= query_expression */ yytestcase(yyruleno==285);
-{ pCxt->pRootNode = yymsp[0].minor.yy560; }
+{ pCxt->pRootNode = yymsp[0].minor.yy616; }
break;
case 119: /* cmd ::= ALTER STABLE alter_table_clause */
-{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy616); }
break;
case 120: /* alter_table_clause ::= full_table_name alter_table_options */
-{ yylhsminor.yy560 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
case 121: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
-{ yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy533, yymsp[0].minor.yy196); }
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600); }
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
case 122: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
-{ yylhsminor.yy560 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy560, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy533); }
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy616, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy361); }
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
case 123: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
-{ yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy533, yymsp[0].minor.yy196); }
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600); }
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
case 124: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
-{ yylhsminor.yy560 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); }
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy361, &yymsp[0].minor.yy361); }
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
case 125: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
-{ yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy533, yymsp[0].minor.yy196); }
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600); }
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
case 126: /* alter_table_clause ::= full_table_name DROP TAG column_name */
-{ yylhsminor.yy560 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy560, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy533); }
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy616, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy361); }
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
case 127: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
-{ yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy533, yymsp[0].minor.yy196); }
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600); }
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
case 128: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
-{ yylhsminor.yy560 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); }
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy361, &yymsp[0].minor.yy361); }
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
case 129: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
-{ yylhsminor.yy560 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy560, &yymsp[-2].minor.yy533, yymsp[0].minor.yy560); }
- yymsp[-5].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy616, &yymsp[-2].minor.yy361, yymsp[0].minor.yy616); }
+ yymsp[-5].minor.yy616 = yylhsminor.yy616;
break;
case 131: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
case 134: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==134);
-{ yylhsminor.yy712 = addNodeToList(pCxt, yymsp[-1].minor.yy712, yymsp[0].minor.yy560); }
- yymsp[-1].minor.yy712 = yylhsminor.yy712;
+{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-1].minor.yy356, yymsp[0].minor.yy616); }
+ yymsp[-1].minor.yy356 = yylhsminor.yy356;
break;
case 132: /* 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.yy560 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy173, yymsp[-8].minor.yy560, yymsp[-6].minor.yy560, yymsp[-5].minor.yy712, yymsp[-2].minor.yy712, yymsp[0].minor.yy560); }
- yymsp[-9].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy151, yymsp[-8].minor.yy616, yymsp[-6].minor.yy616, yymsp[-5].minor.yy356, yymsp[-2].minor.yy356, yymsp[0].minor.yy616); }
+ yymsp[-9].minor.yy616 = yylhsminor.yy616;
break;
case 135: /* drop_table_clause ::= exists_opt full_table_name */
-{ yylhsminor.yy560 = createDropTableClause(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createDropTableClause(pCxt, yymsp[-1].minor.yy151, yymsp[0].minor.yy616); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
case 136: /* specific_cols_opt ::= */
case 167: /* tags_def_opt ::= */ yytestcase(yyruleno==167);
- case 435: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==435);
- case 452: /* group_by_clause_opt ::= */ yytestcase(yyruleno==452);
- case 468: /* order_by_clause_opt ::= */ yytestcase(yyruleno==468);
-{ yymsp[1].minor.yy712 = NULL; }
+ case 437: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==437);
+ case 454: /* group_by_clause_opt ::= */ yytestcase(yyruleno==454);
+ case 470: /* order_by_clause_opt ::= */ yytestcase(yyruleno==470);
+{ yymsp[1].minor.yy356 = NULL; }
break;
case 137: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
-{ yymsp[-2].minor.yy712 = yymsp[-1].minor.yy712; }
+{ yymsp[-2].minor.yy356 = yymsp[-1].minor.yy356; }
break;
case 138: /* full_table_name ::= table_name */
-{ yylhsminor.yy560 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy533, NULL); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy361, NULL); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
case 139: /* full_table_name ::= db_name NK_DOT table_name */
-{ yylhsminor.yy560 = createRealTableNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533, NULL); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createRealTableNode(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361, NULL); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 142: /* column_def ::= column_name type_name */
-{ yylhsminor.yy560 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy196, NULL); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600, NULL); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
case 143: /* column_def ::= column_name type_name COMMENT NK_STRING */
-{ yylhsminor.yy560 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy533, yymsp[-2].minor.yy196, &yymsp[0].minor.yy0); }
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy361, yymsp[-2].minor.yy600, &yymsp[0].minor.yy0); }
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
case 144: /* type_name ::= BOOL */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_BOOL); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_BOOL); }
break;
case 145: /* type_name ::= TINYINT */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_TINYINT); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_TINYINT); }
break;
case 146: /* type_name ::= SMALLINT */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
break;
case 147: /* type_name ::= INT */
case 148: /* type_name ::= INTEGER */ yytestcase(yyruleno==148);
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_INT); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_INT); }
break;
case 149: /* type_name ::= BIGINT */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_BIGINT); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_BIGINT); }
break;
case 150: /* type_name ::= FLOAT */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_FLOAT); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_FLOAT); }
break;
case 151: /* type_name ::= DOUBLE */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
break;
case 152: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy196 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
+{ yymsp[-3].minor.yy600 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
break;
case 153: /* type_name ::= TIMESTAMP */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
break;
case 154: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy196 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
+{ yymsp[-3].minor.yy600 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
break;
case 155: /* type_name ::= TINYINT UNSIGNED */
-{ yymsp[-1].minor.yy196 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
+{ yymsp[-1].minor.yy600 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
break;
case 156: /* type_name ::= SMALLINT UNSIGNED */
-{ yymsp[-1].minor.yy196 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
+{ yymsp[-1].minor.yy600 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
break;
case 157: /* type_name ::= INT UNSIGNED */
-{ yymsp[-1].minor.yy196 = createDataType(TSDB_DATA_TYPE_UINT); }
+{ yymsp[-1].minor.yy600 = createDataType(TSDB_DATA_TYPE_UINT); }
break;
case 158: /* type_name ::= BIGINT UNSIGNED */
-{ yymsp[-1].minor.yy196 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
+{ yymsp[-1].minor.yy600 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
break;
case 159: /* type_name ::= JSON */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_JSON); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_JSON); }
break;
case 160: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy196 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
+{ yymsp[-3].minor.yy600 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
break;
case 161: /* type_name ::= MEDIUMBLOB */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
break;
case 162: /* type_name ::= BLOB */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_BLOB); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_BLOB); }
break;
case 163: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy196 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
+{ yymsp[-3].minor.yy600 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
break;
case 164: /* type_name ::= DECIMAL */
-{ yymsp[0].minor.yy196 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 165: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy196 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+{ yymsp[-3].minor.yy600 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 166: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
-{ yymsp[-5].minor.yy196 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+{ yymsp[-5].minor.yy600 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 168: /* tags_def_opt ::= tags_def */
- case 371: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==371);
-{ yylhsminor.yy712 = yymsp[0].minor.yy712; }
- yymsp[0].minor.yy712 = yylhsminor.yy712;
+ case 373: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==373);
+{ yylhsminor.yy356 = yymsp[0].minor.yy356; }
+ yymsp[0].minor.yy356 = yylhsminor.yy356;
break;
case 169: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
-{ yymsp[-3].minor.yy712 = yymsp[-1].minor.yy712; }
+{ yymsp[-3].minor.yy356 = yymsp[-1].minor.yy356; }
break;
case 170: /* table_options ::= */
-{ yymsp[1].minor.yy560 = createDefaultTableOptions(pCxt); }
+{ yymsp[1].minor.yy616 = createDefaultTableOptions(pCxt); }
break;
case 171: /* table_options ::= table_options COMMENT NK_STRING */
-{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-2].minor.yy616, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 172: /* table_options ::= table_options MAX_DELAY duration_list */
-{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy712); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-2].minor.yy616, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy356); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 173: /* table_options ::= table_options WATERMARK duration_list */
-{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy712); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-2].minor.yy616, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy356); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 174: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
-{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-4].minor.yy560, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy712); }
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-4].minor.yy616, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy356); }
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
case 175: /* table_options ::= table_options TTL NK_INTEGER */
-{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-2].minor.yy616, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 176: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
-{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-4].minor.yy560, TABLE_OPTION_SMA, yymsp[-1].minor.yy712); }
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-4].minor.yy616, TABLE_OPTION_SMA, yymsp[-1].minor.yy356); }
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
case 177: /* alter_table_options ::= alter_table_option */
-{ yylhsminor.yy560 = createAlterTableOptions(pCxt); yylhsminor.yy560 = setTableOption(pCxt, yylhsminor.yy560, yymsp[0].minor.yy389.type, &yymsp[0].minor.yy389.val); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createAlterTableOptions(pCxt); yylhsminor.yy616 = setTableOption(pCxt, yylhsminor.yy616, yymsp[0].minor.yy409.type, &yymsp[0].minor.yy409.val); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
case 178: /* alter_table_options ::= alter_table_options alter_table_option */
-{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy389.type, &yymsp[0].minor.yy389.val); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy409.type, &yymsp[0].minor.yy409.val); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
case 179: /* alter_table_option ::= COMMENT NK_STRING */
-{ yymsp[-1].minor.yy389.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 180: /* alter_table_option ::= TTL NK_INTEGER */
-{ yymsp[-1].minor.yy389.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy409.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; }
break;
case 181: /* duration_list ::= duration_literal */
- case 339: /* expression_list ::= expression */ yytestcase(yyruleno==339);
-{ yylhsminor.yy712 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); }
- yymsp[0].minor.yy712 = yylhsminor.yy712;
+ case 340: /* expression_list ::= expression */ yytestcase(yyruleno==340);
+{ yylhsminor.yy356 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy616)); }
+ yymsp[0].minor.yy356 = yylhsminor.yy356;
break;
case 182: /* duration_list ::= duration_list NK_COMMA duration_literal */
- case 340: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==340);
-{ yylhsminor.yy712 = addNodeToList(pCxt, yymsp[-2].minor.yy712, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); }
- yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ case 341: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==341);
+{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, releaseRawExprNode(pCxt, yymsp[0].minor.yy616)); }
+ yymsp[-2].minor.yy356 = yylhsminor.yy356;
break;
case 185: /* rollup_func_name ::= function_name */
-{ yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[0].minor.yy533, NULL); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createFunctionNode(pCxt, &yymsp[0].minor.yy361, NULL); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
case 186: /* rollup_func_name ::= FIRST */
case 187: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==187);
-{ yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
case 190: /* col_name ::= column_name */
-{ yylhsminor.yy560 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy533); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy361); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
case 191: /* cmd ::= SHOW DNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); }
@@ -3896,13 +3948,13 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); }
break;
case 194: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, OP_TYPE_LIKE); }
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy616, yymsp[0].minor.yy616, OP_TYPE_LIKE); }
break;
case 195: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, OP_TYPE_LIKE); }
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy616, yymsp[0].minor.yy616, OP_TYPE_LIKE); }
break;
case 196: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy560, NULL, OP_TYPE_LIKE); }
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy616, NULL, OP_TYPE_LIKE); }
break;
case 197: /* cmd ::= SHOW MNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); }
@@ -3917,7 +3969,7 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); }
break;
case 201: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy560, yymsp[-1].minor.yy560, OP_TYPE_EQUAL); }
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy616, yymsp[-1].minor.yy616, OP_TYPE_EQUAL); }
break;
case 202: /* cmd ::= SHOW STREAMS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); }
@@ -3936,13 +3988,13 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT); }
break;
case 208: /* cmd ::= SHOW CREATE DATABASE db_name */
-{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy361); }
break;
case 209: /* cmd ::= SHOW CREATE TABLE full_table_name */
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy616); }
break;
case 210: /* cmd ::= SHOW CREATE STABLE full_table_name */
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy616); }
break;
case 211: /* cmd ::= SHOW QUERIES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); }
@@ -3975,7 +4027,7 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); }
break;
case 221: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
-{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy616); }
break;
case 222: /* cmd ::= SHOW CONSUMERS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); }
@@ -3985,154 +4037,154 @@ static YYACTIONTYPE yy_reduce(
break;
case 224: /* db_name_cond_opt ::= */
case 229: /* from_db_opt ::= */ yytestcase(yyruleno==229);
-{ yymsp[1].minor.yy560 = createDefaultDatabaseCondValue(pCxt); }
+{ yymsp[1].minor.yy616 = createDefaultDatabaseCondValue(pCxt); }
break;
case 225: /* db_name_cond_opt ::= db_name NK_DOT */
-{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy533); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy361); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
case 226: /* like_pattern_opt ::= */
case 266: /* into_opt ::= */ yytestcase(yyruleno==266);
- case 404: /* from_clause_opt ::= */ yytestcase(yyruleno==404);
- case 433: /* where_clause_opt ::= */ yytestcase(yyruleno==433);
- case 437: /* twindow_clause_opt ::= */ yytestcase(yyruleno==437);
- case 442: /* sliding_opt ::= */ yytestcase(yyruleno==442);
- case 444: /* fill_opt ::= */ yytestcase(yyruleno==444);
- case 456: /* having_clause_opt ::= */ yytestcase(yyruleno==456);
- case 458: /* range_opt ::= */ yytestcase(yyruleno==458);
- case 460: /* every_opt ::= */ yytestcase(yyruleno==460);
- case 470: /* slimit_clause_opt ::= */ yytestcase(yyruleno==470);
- case 474: /* limit_clause_opt ::= */ yytestcase(yyruleno==474);
-{ yymsp[1].minor.yy560 = NULL; }
+ case 406: /* from_clause_opt ::= */ yytestcase(yyruleno==406);
+ case 435: /* where_clause_opt ::= */ yytestcase(yyruleno==435);
+ case 439: /* twindow_clause_opt ::= */ yytestcase(yyruleno==439);
+ case 444: /* sliding_opt ::= */ yytestcase(yyruleno==444);
+ case 446: /* fill_opt ::= */ yytestcase(yyruleno==446);
+ case 458: /* having_clause_opt ::= */ yytestcase(yyruleno==458);
+ case 460: /* range_opt ::= */ yytestcase(yyruleno==460);
+ case 462: /* every_opt ::= */ yytestcase(yyruleno==462);
+ case 472: /* slimit_clause_opt ::= */ yytestcase(yyruleno==472);
+ case 476: /* limit_clause_opt ::= */ yytestcase(yyruleno==476);
+{ yymsp[1].minor.yy616 = NULL; }
break;
case 227: /* like_pattern_opt ::= LIKE NK_STRING */
-{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
break;
case 228: /* table_name_cond ::= table_name */
-{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy533); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy361); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
case 230: /* from_db_opt ::= FROM db_name */
-{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy533); }
+{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy361); }
break;
case 231: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy173, &yymsp[-3].minor.yy533, &yymsp[-1].minor.yy533, NULL, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy151, &yymsp[-3].minor.yy361, &yymsp[-1].minor.yy361, NULL, yymsp[0].minor.yy616); }
break;
case 232: /* cmd ::= DROP INDEX exists_opt index_name */
-{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); }
break;
case 233: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
-{ yymsp[-9].minor.yy560 = createIndexOption(pCxt, yymsp[-7].minor.yy712, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); }
+{ yymsp[-9].minor.yy616 = createIndexOption(pCxt, yymsp[-7].minor.yy356, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), NULL, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); }
break;
case 234: /* 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.yy560 = createIndexOption(pCxt, yymsp[-9].minor.yy712, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy560, yymsp[0].minor.yy560); }
+{ yymsp[-11].minor.yy616 = createIndexOption(pCxt, yymsp[-9].minor.yy356, releaseRawExprNode(pCxt, yymsp[-5].minor.yy616), releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), yymsp[-1].minor.yy616, yymsp[0].minor.yy616); }
break;
case 237: /* func ::= function_name NK_LP expression_list NK_RP */
-{ yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[-3].minor.yy533, yymsp[-1].minor.yy712); }
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = createFunctionNode(pCxt, &yymsp[-3].minor.yy361, yymsp[-1].minor.yy356); }
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
case 238: /* sma_stream_opt ::= */
case 268: /* stream_options ::= */ yytestcase(yyruleno==268);
-{ yymsp[1].minor.yy560 = createStreamOptions(pCxt); }
+{ yymsp[1].minor.yy616 = createStreamOptions(pCxt); }
break;
case 239: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */
case 272: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==272);
-{ ((SStreamOptions*)yymsp[-2].minor.yy560)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-2].minor.yy560; }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ ((SStreamOptions*)yymsp[-2].minor.yy616)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy616); yylhsminor.yy616 = yymsp[-2].minor.yy616; }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 240: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */
-{ ((SStreamOptions*)yymsp[-2].minor.yy560)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-2].minor.yy560; }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ ((SStreamOptions*)yymsp[-2].minor.yy616)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy616); yylhsminor.yy616 = yymsp[-2].minor.yy616; }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 241: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
-{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy173, &yymsp[-2].minor.yy533, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy151, &yymsp[-2].minor.yy361, yymsp[0].minor.yy616); }
break;
case 242: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy173, &yymsp[-3].minor.yy533, &yymsp[0].minor.yy533, false); }
+{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy151, &yymsp[-3].minor.yy361, &yymsp[0].minor.yy361, false); }
break;
case 243: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy173, &yymsp[-5].minor.yy533, &yymsp[0].minor.yy533, true); }
+{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy151, &yymsp[-5].minor.yy361, &yymsp[0].minor.yy361, true); }
break;
case 244: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy173, &yymsp[-3].minor.yy533, yymsp[0].minor.yy560, false); }
+{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy151, &yymsp[-3].minor.yy361, yymsp[0].minor.yy616, false); }
break;
case 245: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy173, &yymsp[-5].minor.yy533, yymsp[0].minor.yy560, true); }
+{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy151, &yymsp[-5].minor.yy361, yymsp[0].minor.yy616, true); }
break;
case 246: /* cmd ::= DROP TOPIC exists_opt topic_name */
-{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); }
break;
case 247: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
-{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy173, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy151, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361); }
break;
case 248: /* cmd ::= DESC full_table_name */
case 249: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==249);
-{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy616); }
break;
case 250: /* cmd ::= RESET QUERY CACHE */
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
break;
case 251: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */
-{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy173, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy151, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); }
break;
case 253: /* analyze_opt ::= ANALYZE */
case 261: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==261);
- case 424: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==424);
-{ yymsp[0].minor.yy173 = true; }
+ case 426: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==426);
+{ yymsp[0].minor.yy151 = true; }
break;
case 254: /* explain_options ::= */
-{ yymsp[1].minor.yy560 = createDefaultExplainOptions(pCxt); }
+{ yymsp[1].minor.yy616 = createDefaultExplainOptions(pCxt); }
break;
case 255: /* explain_options ::= explain_options VERBOSE NK_BOOL */
-{ yylhsminor.yy560 = setExplainVerbose(pCxt, yymsp[-2].minor.yy560, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setExplainVerbose(pCxt, yymsp[-2].minor.yy616, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 256: /* explain_options ::= explain_options RATIO NK_FLOAT */
-{ yylhsminor.yy560 = setExplainRatio(pCxt, yymsp[-2].minor.yy560, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ yylhsminor.yy616 = setExplainRatio(pCxt, yymsp[-2].minor.yy616, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 257: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
-{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy712); }
+{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy356); }
break;
case 258: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
-{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy173, yymsp[-8].minor.yy173, &yymsp[-5].minor.yy533, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy196, yymsp[0].minor.yy424); }
+{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy151, yymsp[-8].minor.yy151, &yymsp[-5].minor.yy361, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy600, yymsp[0].minor.yy734); }
break;
case 259: /* cmd ::= DROP FUNCTION exists_opt function_name */
-{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); }
break;
case 262: /* bufsize_opt ::= */
-{ yymsp[1].minor.yy424 = 0; }
+{ yymsp[1].minor.yy734 = 0; }
break;
case 263: /* bufsize_opt ::= BUFSIZE NK_INTEGER */
-{ yymsp[-1].minor.yy424 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
+{ yymsp[-1].minor.yy734 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 264: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
-{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy173, &yymsp[-4].minor.yy533, yymsp[-2].minor.yy560, yymsp[-3].minor.yy560, yymsp[0].minor.yy560); }
+{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy151, &yymsp[-4].minor.yy361, yymsp[-2].minor.yy616, yymsp[-3].minor.yy616, yymsp[0].minor.yy616); }
break;
case 265: /* cmd ::= DROP STREAM exists_opt stream_name */
-{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); }
+{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); }
break;
case 267: /* into_opt ::= INTO full_table_name */
- case 405: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==405);
- case 434: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==434);
- case 457: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==457);
-{ yymsp[-1].minor.yy560 = yymsp[0].minor.yy560; }
+ case 407: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==407);
+ case 436: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==436);
+ case 459: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==459);
+{ yymsp[-1].minor.yy616 = yymsp[0].minor.yy616; }
break;
case 269: /* stream_options ::= stream_options TRIGGER AT_ONCE */
-{ ((SStreamOptions*)yymsp[-2].minor.yy560)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy560 = yymsp[-2].minor.yy560; }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ ((SStreamOptions*)yymsp[-2].minor.yy616)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy616 = yymsp[-2].minor.yy616; }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 270: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
-{ ((SStreamOptions*)yymsp[-2].minor.yy560)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy560 = yymsp[-2].minor.yy560; }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ ((SStreamOptions*)yymsp[-2].minor.yy616)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy616 = yymsp[-2].minor.yy616; }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 271: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
-{ ((SStreamOptions*)yymsp[-3].minor.yy560)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy560)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-3].minor.yy560; }
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+{ ((SStreamOptions*)yymsp[-3].minor.yy616)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy616)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy616); yylhsminor.yy616 = yymsp[-3].minor.yy616; }
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
case 273: /* stream_options ::= stream_options IGNORE EXPIRED */
-{ ((SStreamOptions*)yymsp[-2].minor.yy560)->ignoreExpired = true; yylhsminor.yy560 = yymsp[-2].minor.yy560; }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+{ ((SStreamOptions*)yymsp[-2].minor.yy616)->ignoreExpired = true; yylhsminor.yy616 = yymsp[-2].minor.yy616; }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
case 274: /* cmd ::= KILL CONNECTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
@@ -4150,546 +4202,550 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 279: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
-{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy712); }
+{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy356); }
break;
case 280: /* cmd ::= SPLIT VGROUP NK_INTEGER */
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
break;
case 281: /* dnode_list ::= DNODE NK_INTEGER */
-{ yymsp[-1].minor.yy712 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+{ yymsp[-1].minor.yy356 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
break;
case 283: /* cmd ::= SYNCDB db_name REPLICA */
-{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy533); }
+{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy361); }
break;
case 284: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
-{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); }
- break;
- case 286: /* cmd ::= INSERT INTO full_table_name specific_cols_opt query_expression */
-{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-2].minor.yy560, yymsp[-1].minor.yy712, yymsp[0].minor.yy560); }
- break;
- case 287: /* literal ::= NK_INTEGER */
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 288: /* literal ::= NK_FLOAT */
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 289: /* literal ::= NK_STRING */
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 290: /* literal ::= NK_BOOL */
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 291: /* literal ::= TIMESTAMP NK_STRING */
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
- break;
- case 292: /* literal ::= duration_literal */
- case 302: /* signed_literal ::= signed */ yytestcase(yyruleno==302);
- case 323: /* expression ::= literal */ yytestcase(yyruleno==323);
- case 324: /* expression ::= pseudo_column */ yytestcase(yyruleno==324);
- case 325: /* expression ::= column_reference */ yytestcase(yyruleno==325);
- case 326: /* expression ::= function_expression */ yytestcase(yyruleno==326);
- case 327: /* expression ::= subquery */ yytestcase(yyruleno==327);
- case 354: /* function_expression ::= literal_func */ yytestcase(yyruleno==354);
- case 396: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==396);
- case 400: /* boolean_primary ::= predicate */ yytestcase(yyruleno==400);
- case 402: /* common_expression ::= expression */ yytestcase(yyruleno==402);
- case 403: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==403);
- case 406: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==406);
- case 408: /* table_reference ::= table_primary */ yytestcase(yyruleno==408);
- case 409: /* table_reference ::= joined_table */ yytestcase(yyruleno==409);
- case 413: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==413);
- case 463: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==463);
- case 466: /* query_primary ::= query_specification */ yytestcase(yyruleno==466);
-{ yylhsminor.yy560 = yymsp[0].minor.yy560; }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 293: /* literal ::= NULL */
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 294: /* literal ::= NK_QUESTION */
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 295: /* duration_literal ::= NK_VARIABLE */
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 296: /* signed ::= NK_INTEGER */
-{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 297: /* signed ::= NK_PLUS NK_INTEGER */
-{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
- break;
- case 298: /* signed ::= NK_MINUS NK_INTEGER */
+{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); }
+ break;
+ case 286: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression */
+{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy616, yymsp[-2].minor.yy356, yymsp[0].minor.yy616); }
+ break;
+ case 287: /* cmd ::= INSERT INTO full_table_name query_expression */
+{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy616, NULL, yymsp[0].minor.yy616); }
+ break;
+ case 288: /* literal ::= NK_INTEGER */
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 289: /* literal ::= NK_FLOAT */
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 290: /* literal ::= NK_STRING */
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 291: /* literal ::= NK_BOOL */
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 292: /* literal ::= TIMESTAMP NK_STRING */
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 293: /* literal ::= duration_literal */
+ case 303: /* signed_literal ::= signed */ yytestcase(yyruleno==303);
+ case 324: /* expression ::= literal */ yytestcase(yyruleno==324);
+ case 325: /* expression ::= pseudo_column */ yytestcase(yyruleno==325);
+ case 326: /* expression ::= column_reference */ yytestcase(yyruleno==326);
+ case 327: /* expression ::= function_expression */ yytestcase(yyruleno==327);
+ case 328: /* expression ::= subquery */ yytestcase(yyruleno==328);
+ case 356: /* function_expression ::= literal_func */ yytestcase(yyruleno==356);
+ case 398: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==398);
+ case 402: /* boolean_primary ::= predicate */ yytestcase(yyruleno==402);
+ case 404: /* common_expression ::= expression */ yytestcase(yyruleno==404);
+ case 405: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==405);
+ case 408: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==408);
+ case 410: /* table_reference ::= table_primary */ yytestcase(yyruleno==410);
+ case 411: /* table_reference ::= joined_table */ yytestcase(yyruleno==411);
+ case 415: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==415);
+ case 465: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==465);
+ case 468: /* query_primary ::= query_specification */ yytestcase(yyruleno==468);
+{ yylhsminor.yy616 = yymsp[0].minor.yy616; }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 294: /* literal ::= NULL */
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 295: /* literal ::= NK_QUESTION */
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 296: /* duration_literal ::= NK_VARIABLE */
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 297: /* signed ::= NK_INTEGER */
+{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 298: /* signed ::= NK_PLUS NK_INTEGER */
+{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+ break;
+ case 299: /* signed ::= 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.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
+ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
}
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
- case 299: /* signed ::= NK_FLOAT */
-{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+ case 300: /* signed ::= NK_FLOAT */
+{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
- case 300: /* signed ::= NK_PLUS NK_FLOAT */
-{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+ case 301: /* signed ::= NK_PLUS NK_FLOAT */
+{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
break;
- case 301: /* signed ::= NK_MINUS NK_FLOAT */
+ case 302: /* signed ::= NK_MINUS NK_FLOAT */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
+ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
}
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
- case 303: /* signed_literal ::= NK_STRING */
-{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+ case 304: /* signed_literal ::= NK_STRING */
+{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
- case 304: /* signed_literal ::= NK_BOOL */
-{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+ case 305: /* signed_literal ::= NK_BOOL */
+{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
- case 305: /* signed_literal ::= TIMESTAMP NK_STRING */
-{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ case 306: /* signed_literal ::= TIMESTAMP NK_STRING */
+{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
break;
- case 306: /* signed_literal ::= duration_literal */
- case 308: /* signed_literal ::= literal_func */ yytestcase(yyruleno==308);
- case 374: /* star_func_para ::= expression */ yytestcase(yyruleno==374);
- case 429: /* select_item ::= common_expression */ yytestcase(yyruleno==429);
- case 479: /* search_condition ::= common_expression */ yytestcase(yyruleno==479);
-{ yylhsminor.yy560 = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+ case 307: /* signed_literal ::= duration_literal */
+ case 309: /* signed_literal ::= literal_func */ yytestcase(yyruleno==309);
+ case 376: /* star_func_para ::= expression */ yytestcase(yyruleno==376);
+ case 431: /* select_item ::= common_expression */ yytestcase(yyruleno==431);
+ case 481: /* search_condition ::= common_expression */ yytestcase(yyruleno==481);
+{ yylhsminor.yy616 = releaseRawExprNode(pCxt, yymsp[0].minor.yy616); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
- case 307: /* signed_literal ::= NULL */
-{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+ case 308: /* signed_literal ::= NULL */
+{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
- case 309: /* signed_literal ::= NK_QUESTION */
-{ yylhsminor.yy560 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+ case 310: /* signed_literal ::= NK_QUESTION */
+{ yylhsminor.yy616 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
- case 328: /* expression ::= NK_LP expression NK_RP */
- case 401: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==401);
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ case 329: /* expression ::= NK_LP expression NK_RP */
+ case 403: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==403);
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy616)); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 329: /* expression ::= NK_PLUS expression */
+ case 330: /* expression ::= NK_PLUS expression */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy560));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy616));
}
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
- case 330: /* expression ::= NK_MINUS expression */
+ case 331: /* expression ::= NK_MINUS expression */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy560), NULL));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy616), NULL));
}
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
- case 331: /* expression ::= expression NK_PLUS expression */
+ case 332: /* expression ::= expression NK_PLUS expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 332: /* expression ::= expression NK_MINUS expression */
+ case 333: /* expression ::= expression NK_MINUS expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 333: /* expression ::= expression NK_STAR expression */
+ case 334: /* expression ::= expression NK_STAR expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 334: /* expression ::= expression NK_SLASH expression */
+ case 335: /* expression ::= expression NK_SLASH expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 335: /* expression ::= expression NK_REM expression */
+ case 336: /* expression ::= expression NK_REM expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 336: /* expression ::= column_reference NK_ARROW NK_STRING */
+ case 337: /* expression ::= column_reference NK_ARROW NK_STRING */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 337: /* expression ::= expression NK_BITAND expression */
+ case 338: /* expression ::= expression NK_BITAND expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 338: /* expression ::= expression NK_BITOR expression */
+ case 339: /* expression ::= expression NK_BITOR expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
- break;
- case 341: /* column_reference ::= column_name */
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy533, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy533)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 342: /* column_reference ::= table_name NK_DOT column_name */
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533, createColumnNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533)); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
- break;
- case 343: /* pseudo_column ::= ROWTS */
- case 344: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==344);
- case 346: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==346);
- case 347: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==347);
- case 348: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==348);
- case 349: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==349);
- case 350: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==350);
- case 356: /* literal_func ::= NOW */ yytestcase(yyruleno==356);
-{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
- break;
- case 345: /* pseudo_column ::= table_name NK_DOT TBNAME */
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy533)))); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
- break;
- case 351: /* function_expression ::= function_name NK_LP expression_list NK_RP */
- case 352: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==352);
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy533, yymsp[-1].minor.yy712)); }
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
- break;
- case 353: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy196)); }
- yymsp[-5].minor.yy560 = yylhsminor.yy560;
- break;
- case 355: /* literal_func ::= noarg_func NK_LP NK_RP */
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy533, NULL)); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
- break;
- case 370: /* star_func_para_list ::= NK_STAR */
-{ yylhsminor.yy712 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy712 = yylhsminor.yy712;
- break;
- case 375: /* star_func_para ::= table_name NK_DOT NK_STAR */
- case 432: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==432);
-{ yylhsminor.yy560 = createColumnNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
- break;
- case 376: /* predicate ::= expression compare_op expression */
- case 381: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==381);
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 342: /* column_reference ::= column_name */
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy361, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy361)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 343: /* column_reference ::= table_name NK_DOT column_name */
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361, createColumnNode(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361)); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 344: /* pseudo_column ::= ROWTS */
+ case 345: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==345);
+ case 347: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==347);
+ case 348: /* pseudo_column ::= QEND */ yytestcase(yyruleno==348);
+ case 349: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==349);
+ case 350: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==350);
+ case 351: /* pseudo_column ::= WEND */ yytestcase(yyruleno==351);
+ case 352: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==352);
+ case 358: /* literal_func ::= NOW */ yytestcase(yyruleno==358);
+{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 346: /* pseudo_column ::= table_name NK_DOT TBNAME */
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy361)))); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 353: /* function_expression ::= function_name NK_LP expression_list NK_RP */
+ case 354: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==354);
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy361, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy361, yymsp[-1].minor.yy356)); }
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 355: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), yymsp[-1].minor.yy600)); }
+ yymsp[-5].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 357: /* literal_func ::= noarg_func NK_LP NK_RP */
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy361, NULL)); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 372: /* star_func_para_list ::= NK_STAR */
+{ yylhsminor.yy356 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy356 = yylhsminor.yy356;
+ break;
+ case 377: /* star_func_para ::= table_name NK_DOT NK_STAR */
+ case 434: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==434);
+{ yylhsminor.yy616 = createColumnNode(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
+ break;
+ case 378: /* predicate ::= expression compare_op expression */
+ case 383: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==383);
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy128, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy526, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 377: /* predicate ::= expression BETWEEN expression AND expression */
+ case 379: /* predicate ::= expression BETWEEN expression AND expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy560), releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy616), releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-4].minor.yy560 = yylhsminor.yy560;
+ yymsp[-4].minor.yy616 = yylhsminor.yy616;
break;
- case 378: /* predicate ::= expression NOT BETWEEN expression AND expression */
+ case 380: /* predicate ::= expression NOT BETWEEN expression AND expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy616), releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-5].minor.yy560 = yylhsminor.yy560;
+ yymsp[-5].minor.yy616 = yylhsminor.yy616;
break;
- case 379: /* predicate ::= expression IS NULL */
+ case 381: /* predicate ::= expression IS NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), NULL));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 380: /* predicate ::= expression IS NOT NULL */
+ case 382: /* predicate ::= expression IS NOT NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), NULL));
}
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
- case 382: /* compare_op ::= NK_LT */
-{ yymsp[0].minor.yy128 = OP_TYPE_LOWER_THAN; }
+ case 384: /* compare_op ::= NK_LT */
+{ yymsp[0].minor.yy526 = OP_TYPE_LOWER_THAN; }
break;
- case 383: /* compare_op ::= NK_GT */
-{ yymsp[0].minor.yy128 = OP_TYPE_GREATER_THAN; }
+ case 385: /* compare_op ::= NK_GT */
+{ yymsp[0].minor.yy526 = OP_TYPE_GREATER_THAN; }
break;
- case 384: /* compare_op ::= NK_LE */
-{ yymsp[0].minor.yy128 = OP_TYPE_LOWER_EQUAL; }
+ case 386: /* compare_op ::= NK_LE */
+{ yymsp[0].minor.yy526 = OP_TYPE_LOWER_EQUAL; }
break;
- case 385: /* compare_op ::= NK_GE */
-{ yymsp[0].minor.yy128 = OP_TYPE_GREATER_EQUAL; }
+ case 387: /* compare_op ::= NK_GE */
+{ yymsp[0].minor.yy526 = OP_TYPE_GREATER_EQUAL; }
break;
- case 386: /* compare_op ::= NK_NE */
-{ yymsp[0].minor.yy128 = OP_TYPE_NOT_EQUAL; }
+ case 388: /* compare_op ::= NK_NE */
+{ yymsp[0].minor.yy526 = OP_TYPE_NOT_EQUAL; }
break;
- case 387: /* compare_op ::= NK_EQ */
-{ yymsp[0].minor.yy128 = OP_TYPE_EQUAL; }
+ case 389: /* compare_op ::= NK_EQ */
+{ yymsp[0].minor.yy526 = OP_TYPE_EQUAL; }
break;
- case 388: /* compare_op ::= LIKE */
-{ yymsp[0].minor.yy128 = OP_TYPE_LIKE; }
+ case 390: /* compare_op ::= LIKE */
+{ yymsp[0].minor.yy526 = OP_TYPE_LIKE; }
break;
- case 389: /* compare_op ::= NOT LIKE */
-{ yymsp[-1].minor.yy128 = OP_TYPE_NOT_LIKE; }
+ case 391: /* compare_op ::= NOT LIKE */
+{ yymsp[-1].minor.yy526 = OP_TYPE_NOT_LIKE; }
break;
- case 390: /* compare_op ::= MATCH */
-{ yymsp[0].minor.yy128 = OP_TYPE_MATCH; }
+ case 392: /* compare_op ::= MATCH */
+{ yymsp[0].minor.yy526 = OP_TYPE_MATCH; }
break;
- case 391: /* compare_op ::= NMATCH */
-{ yymsp[0].minor.yy128 = OP_TYPE_NMATCH; }
+ case 393: /* compare_op ::= NMATCH */
+{ yymsp[0].minor.yy526 = OP_TYPE_NMATCH; }
break;
- case 392: /* compare_op ::= CONTAINS */
-{ yymsp[0].minor.yy128 = OP_TYPE_JSON_CONTAINS; }
+ case 394: /* compare_op ::= CONTAINS */
+{ yymsp[0].minor.yy526 = OP_TYPE_JSON_CONTAINS; }
break;
- case 393: /* in_op ::= IN */
-{ yymsp[0].minor.yy128 = OP_TYPE_IN; }
+ case 395: /* in_op ::= IN */
+{ yymsp[0].minor.yy526 = OP_TYPE_IN; }
break;
- case 394: /* in_op ::= NOT IN */
-{ yymsp[-1].minor.yy128 = OP_TYPE_NOT_IN; }
+ case 396: /* in_op ::= NOT IN */
+{ yymsp[-1].minor.yy526 = OP_TYPE_NOT_IN; }
break;
- case 395: /* in_predicate_value ::= NK_LP literal_list NK_RP */
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy712)); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ case 397: /* in_predicate_value ::= NK_LP literal_list NK_RP */
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy356)); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 397: /* boolean_value_expression ::= NOT boolean_primary */
+ case 399: /* boolean_value_expression ::= NOT boolean_primary */
{
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy560), NULL));
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy616), NULL));
}
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
- case 398: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ case 400: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 399: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ case 401: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560);
- yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616);
+ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616)));
}
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 407: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
-{ yylhsminor.yy560 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, NULL); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ case 409: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
+{ yylhsminor.yy616 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy616, yymsp[0].minor.yy616, NULL); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 410: /* table_primary ::= table_name alias_opt */
-{ yylhsminor.yy560 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+ case 412: /* table_primary ::= table_name alias_opt */
+{ yylhsminor.yy616 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy361, &yymsp[0].minor.yy361); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
- case 411: /* table_primary ::= db_name NK_DOT table_name alias_opt */
-{ yylhsminor.yy560 = createRealTableNode(pCxt, &yymsp[-3].minor.yy533, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); }
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+ case 413: /* table_primary ::= db_name NK_DOT table_name alias_opt */
+{ yylhsminor.yy616 = createRealTableNode(pCxt, &yymsp[-3].minor.yy361, &yymsp[-1].minor.yy361, &yymsp[0].minor.yy361); }
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
- case 412: /* table_primary ::= subquery alias_opt */
-{ yylhsminor.yy560 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), &yymsp[0].minor.yy533); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+ case 414: /* table_primary ::= subquery alias_opt */
+{ yylhsminor.yy616 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy616), &yymsp[0].minor.yy361); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
- case 414: /* alias_opt ::= */
-{ yymsp[1].minor.yy533 = nil_token; }
+ case 416: /* alias_opt ::= */
+{ yymsp[1].minor.yy361 = nil_token; }
break;
- case 415: /* alias_opt ::= table_alias */
-{ yylhsminor.yy533 = yymsp[0].minor.yy533; }
- yymsp[0].minor.yy533 = yylhsminor.yy533;
+ case 417: /* alias_opt ::= table_alias */
+{ yylhsminor.yy361 = yymsp[0].minor.yy361; }
+ yymsp[0].minor.yy361 = yylhsminor.yy361;
break;
- case 416: /* alias_opt ::= AS table_alias */
-{ yymsp[-1].minor.yy533 = yymsp[0].minor.yy533; }
+ case 418: /* alias_opt ::= AS table_alias */
+{ yymsp[-1].minor.yy361 = yymsp[0].minor.yy361; }
break;
- case 417: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- case 418: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==418);
-{ yymsp[-2].minor.yy560 = yymsp[-1].minor.yy560; }
+ case 419: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ case 420: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==420);
+{ yymsp[-2].minor.yy616 = yymsp[-1].minor.yy616; }
break;
- case 419: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
-{ yylhsminor.yy560 = createJoinTableNode(pCxt, yymsp[-4].minor.yy36, yymsp[-5].minor.yy560, yymsp[-2].minor.yy560, yymsp[0].minor.yy560); }
- yymsp[-5].minor.yy560 = yylhsminor.yy560;
+ case 421: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+{ yylhsminor.yy616 = createJoinTableNode(pCxt, yymsp[-4].minor.yy504, yymsp[-5].minor.yy616, yymsp[-2].minor.yy616, yymsp[0].minor.yy616); }
+ yymsp[-5].minor.yy616 = yylhsminor.yy616;
break;
- case 420: /* join_type ::= */
-{ yymsp[1].minor.yy36 = JOIN_TYPE_INNER; }
+ case 422: /* join_type ::= */
+{ yymsp[1].minor.yy504 = JOIN_TYPE_INNER; }
break;
- case 421: /* join_type ::= INNER */
-{ yymsp[0].minor.yy36 = JOIN_TYPE_INNER; }
+ case 423: /* join_type ::= INNER */
+{ yymsp[0].minor.yy504 = JOIN_TYPE_INNER; }
break;
- case 422: /* query_specification ::= SELECT set_quantifier_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 424: /* query_specification ::= SELECT set_quantifier_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[-11].minor.yy560 = createSelectStmt(pCxt, yymsp[-10].minor.yy173, yymsp[-9].minor.yy712, yymsp[-8].minor.yy560);
- yymsp[-11].minor.yy560 = addWhereClause(pCxt, yymsp[-11].minor.yy560, yymsp[-7].minor.yy560);
- yymsp[-11].minor.yy560 = addPartitionByClause(pCxt, yymsp[-11].minor.yy560, yymsp[-6].minor.yy712);
- yymsp[-11].minor.yy560 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy560, yymsp[-2].minor.yy560);
- yymsp[-11].minor.yy560 = addGroupByClause(pCxt, yymsp[-11].minor.yy560, yymsp[-1].minor.yy712);
- yymsp[-11].minor.yy560 = addHavingClause(pCxt, yymsp[-11].minor.yy560, yymsp[0].minor.yy560);
- yymsp[-11].minor.yy560 = addRangeClause(pCxt, yymsp[-11].minor.yy560, yymsp[-5].minor.yy560);
- yymsp[-11].minor.yy560 = addEveryClause(pCxt, yymsp[-11].minor.yy560, yymsp[-4].minor.yy560);
- yymsp[-11].minor.yy560 = addFillClause(pCxt, yymsp[-11].minor.yy560, yymsp[-3].minor.yy560);
+ yymsp[-11].minor.yy616 = createSelectStmt(pCxt, yymsp[-10].minor.yy151, yymsp[-9].minor.yy356, yymsp[-8].minor.yy616);
+ yymsp[-11].minor.yy616 = addWhereClause(pCxt, yymsp[-11].minor.yy616, yymsp[-7].minor.yy616);
+ yymsp[-11].minor.yy616 = addPartitionByClause(pCxt, yymsp[-11].minor.yy616, yymsp[-6].minor.yy356);
+ yymsp[-11].minor.yy616 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy616, yymsp[-2].minor.yy616);
+ yymsp[-11].minor.yy616 = addGroupByClause(pCxt, yymsp[-11].minor.yy616, yymsp[-1].minor.yy356);
+ yymsp[-11].minor.yy616 = addHavingClause(pCxt, yymsp[-11].minor.yy616, yymsp[0].minor.yy616);
+ yymsp[-11].minor.yy616 = addRangeClause(pCxt, yymsp[-11].minor.yy616, yymsp[-5].minor.yy616);
+ yymsp[-11].minor.yy616 = addEveryClause(pCxt, yymsp[-11].minor.yy616, yymsp[-4].minor.yy616);
+ yymsp[-11].minor.yy616 = addFillClause(pCxt, yymsp[-11].minor.yy616, yymsp[-3].minor.yy616);
}
break;
- case 425: /* set_quantifier_opt ::= ALL */
-{ yymsp[0].minor.yy173 = false; }
+ case 427: /* set_quantifier_opt ::= ALL */
+{ yymsp[0].minor.yy151 = false; }
break;
- case 428: /* select_item ::= NK_STAR */
-{ yylhsminor.yy560 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy560 = yylhsminor.yy560;
+ case 430: /* select_item ::= NK_STAR */
+{ yylhsminor.yy616 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy616 = yylhsminor.yy616;
break;
- case 430: /* select_item ::= common_expression column_alias */
-{ yylhsminor.yy560 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), &yymsp[0].minor.yy533); }
- yymsp[-1].minor.yy560 = yylhsminor.yy560;
+ case 432: /* select_item ::= common_expression column_alias */
+{ yylhsminor.yy616 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy616), &yymsp[0].minor.yy361); }
+ yymsp[-1].minor.yy616 = yylhsminor.yy616;
break;
- case 431: /* select_item ::= common_expression AS column_alias */
-{ yylhsminor.yy560 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), &yymsp[0].minor.yy533); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ case 433: /* select_item ::= common_expression AS column_alias */
+{ yylhsminor.yy616 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), &yymsp[0].minor.yy361); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 436: /* partition_by_clause_opt ::= PARTITION BY expression_list */
- case 453: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==453);
- case 469: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==469);
-{ yymsp[-2].minor.yy712 = yymsp[0].minor.yy712; }
+ case 438: /* partition_by_clause_opt ::= PARTITION BY expression_list */
+ case 455: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==455);
+ case 471: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==471);
+{ yymsp[-2].minor.yy356 = yymsp[0].minor.yy356; }
break;
- case 438: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
-{ yymsp[-5].minor.yy560 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); }
+ case 440: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
+{ yymsp[-5].minor.yy616 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), releaseRawExprNode(pCxt, yymsp[-1].minor.yy616)); }
break;
- case 439: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
-{ yymsp[-3].minor.yy560 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); }
+ case 441: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
+{ yymsp[-3].minor.yy616 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy616)); }
break;
- case 440: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-5].minor.yy560 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); }
+ case 442: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-5].minor.yy616 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), NULL, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); }
break;
- case 441: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-7].minor.yy560 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy560, yymsp[0].minor.yy560); }
+ case 443: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-7].minor.yy616 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy616), releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), yymsp[-1].minor.yy616, yymsp[0].minor.yy616); }
break;
- case 443: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
- case 461: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==461);
-{ yymsp[-3].minor.yy560 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy560); }
+ case 445: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
+ case 463: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==463);
+{ yymsp[-3].minor.yy616 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy616); }
break;
- case 445: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
-{ yymsp[-3].minor.yy560 = createFillNode(pCxt, yymsp[-1].minor.yy18, NULL); }
+ case 447: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
+{ yymsp[-3].minor.yy616 = createFillNode(pCxt, yymsp[-1].minor.yy494, NULL); }
break;
- case 446: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
-{ yymsp[-5].minor.yy560 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy712)); }
+ case 448: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+{ yymsp[-5].minor.yy616 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy356)); }
break;
- case 447: /* fill_mode ::= NONE */
-{ yymsp[0].minor.yy18 = FILL_MODE_NONE; }
+ case 449: /* fill_mode ::= NONE */
+{ yymsp[0].minor.yy494 = FILL_MODE_NONE; }
break;
- case 448: /* fill_mode ::= PREV */
-{ yymsp[0].minor.yy18 = FILL_MODE_PREV; }
+ case 450: /* fill_mode ::= PREV */
+{ yymsp[0].minor.yy494 = FILL_MODE_PREV; }
break;
- case 449: /* fill_mode ::= NULL */
-{ yymsp[0].minor.yy18 = FILL_MODE_NULL; }
+ case 451: /* fill_mode ::= NULL */
+{ yymsp[0].minor.yy494 = FILL_MODE_NULL; }
break;
- case 450: /* fill_mode ::= LINEAR */
-{ yymsp[0].minor.yy18 = FILL_MODE_LINEAR; }
+ case 452: /* fill_mode ::= LINEAR */
+{ yymsp[0].minor.yy494 = FILL_MODE_LINEAR; }
break;
- case 451: /* fill_mode ::= NEXT */
-{ yymsp[0].minor.yy18 = FILL_MODE_NEXT; }
+ case 453: /* fill_mode ::= NEXT */
+{ yymsp[0].minor.yy494 = FILL_MODE_NEXT; }
break;
- case 454: /* group_by_list ::= expression */
-{ yylhsminor.yy712 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); }
- yymsp[0].minor.yy712 = yylhsminor.yy712;
+ case 456: /* group_by_list ::= expression */
+{ yylhsminor.yy356 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); }
+ yymsp[0].minor.yy356 = yylhsminor.yy356;
break;
- case 455: /* group_by_list ::= group_by_list NK_COMMA expression */
-{ yylhsminor.yy712 = addNodeToList(pCxt, yymsp[-2].minor.yy712, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); }
- yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ case 457: /* group_by_list ::= group_by_list NK_COMMA expression */
+{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); }
+ yymsp[-2].minor.yy356 = yylhsminor.yy356;
break;
- case 459: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */
-{ yymsp[-5].minor.yy560 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); }
+ case 461: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */
+{ yymsp[-5].minor.yy616 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), releaseRawExprNode(pCxt, yymsp[-1].minor.yy616)); }
break;
- case 462: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ case 464: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
- yylhsminor.yy560 = addOrderByClause(pCxt, yymsp[-3].minor.yy560, yymsp[-2].minor.yy712);
- yylhsminor.yy560 = addSlimitClause(pCxt, yylhsminor.yy560, yymsp[-1].minor.yy560);
- yylhsminor.yy560 = addLimitClause(pCxt, yylhsminor.yy560, yymsp[0].minor.yy560);
+ yylhsminor.yy616 = addOrderByClause(pCxt, yymsp[-3].minor.yy616, yymsp[-2].minor.yy356);
+ yylhsminor.yy616 = addSlimitClause(pCxt, yylhsminor.yy616, yymsp[-1].minor.yy616);
+ yylhsminor.yy616 = addLimitClause(pCxt, yylhsminor.yy616, yymsp[0].minor.yy616);
}
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
- case 464: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
-{ yylhsminor.yy560 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy560, yymsp[0].minor.yy560); }
- yymsp[-3].minor.yy560 = yylhsminor.yy560;
+ case 466: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
+{ yylhsminor.yy616 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy616, yymsp[0].minor.yy616); }
+ yymsp[-3].minor.yy616 = yylhsminor.yy616;
break;
- case 465: /* query_expression_body ::= query_expression_body UNION query_expression_body */
-{ yylhsminor.yy560 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy560, yymsp[0].minor.yy560); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ case 467: /* query_expression_body ::= query_expression_body UNION query_expression_body */
+{ yylhsminor.yy616 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy616, yymsp[0].minor.yy616); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 467: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
+ case 469: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
{
- yymsp[-5].minor.yy560 = addOrderByClause(pCxt, yymsp[-4].minor.yy560, yymsp[-3].minor.yy712);
- yymsp[-5].minor.yy560 = addSlimitClause(pCxt, yymsp[-5].minor.yy560, yymsp[-2].minor.yy560);
- yymsp[-5].minor.yy560 = addLimitClause(pCxt, yymsp[-5].minor.yy560, yymsp[-1].minor.yy560);
+ yymsp[-5].minor.yy616 = addOrderByClause(pCxt, yymsp[-4].minor.yy616, yymsp[-3].minor.yy356);
+ yymsp[-5].minor.yy616 = addSlimitClause(pCxt, yymsp[-5].minor.yy616, yymsp[-2].minor.yy616);
+ yymsp[-5].minor.yy616 = addLimitClause(pCxt, yymsp[-5].minor.yy616, yymsp[-1].minor.yy616);
}
break;
- case 471: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
- case 475: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==475);
-{ yymsp[-1].minor.yy560 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ case 473: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ case 477: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==477);
+{ yymsp[-1].minor.yy616 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
break;
- case 472: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- case 476: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==476);
-{ yymsp[-3].minor.yy560 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
+ case 474: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ case 478: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==478);
+{ yymsp[-3].minor.yy616 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
break;
- case 473: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- case 477: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==477);
-{ yymsp[-3].minor.yy560 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
+ case 475: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ case 479: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==479);
+{ yymsp[-3].minor.yy616 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
break;
- case 478: /* subquery ::= NK_LP query_expression NK_RP */
-{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy560); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ case 480: /* subquery ::= NK_LP query_expression NK_RP */
+{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy616); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 482: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
-{ yylhsminor.yy560 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), yymsp[-1].minor.yy218, yymsp[0].minor.yy109); }
- yymsp[-2].minor.yy560 = yylhsminor.yy560;
+ case 484: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
+{ yylhsminor.yy616 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), yymsp[-1].minor.yy58, yymsp[0].minor.yy613); }
+ yymsp[-2].minor.yy616 = yylhsminor.yy616;
break;
- case 483: /* ordering_specification_opt ::= */
-{ yymsp[1].minor.yy218 = ORDER_ASC; }
+ case 485: /* ordering_specification_opt ::= */
+{ yymsp[1].minor.yy58 = ORDER_ASC; }
break;
- case 484: /* ordering_specification_opt ::= ASC */
-{ yymsp[0].minor.yy218 = ORDER_ASC; }
+ case 486: /* ordering_specification_opt ::= ASC */
+{ yymsp[0].minor.yy58 = ORDER_ASC; }
break;
- case 485: /* ordering_specification_opt ::= DESC */
-{ yymsp[0].minor.yy218 = ORDER_DESC; }
+ case 487: /* ordering_specification_opt ::= DESC */
+{ yymsp[0].minor.yy58 = ORDER_DESC; }
break;
- case 486: /* null_ordering_opt ::= */
-{ yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; }
+ case 488: /* null_ordering_opt ::= */
+{ yymsp[1].minor.yy613 = NULL_ORDER_DEFAULT; }
break;
- case 487: /* null_ordering_opt ::= NULLS FIRST */
-{ yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; }
+ case 489: /* null_ordering_opt ::= NULLS FIRST */
+{ yymsp[-1].minor.yy613 = NULL_ORDER_FIRST; }
break;
- case 488: /* null_ordering_opt ::= NULLS LAST */
-{ yymsp[-1].minor.yy109 = NULL_ORDER_LAST; }
+ case 490: /* null_ordering_opt ::= NULLS LAST */
+{ yymsp[-1].minor.yy613 = NULL_ORDER_LAST; }
break;
default:
break;
diff --git a/source/libs/parser/test/parSelectTest.cpp b/source/libs/parser/test/parSelectTest.cpp
index 0aa1773c28546014fde210c12e7d04b842304dec..e68205979379a80f33be833a20205d344c32e330 100644
--- a/source/libs/parser/test/parSelectTest.cpp
+++ b/source/libs/parser/test/parSelectTest.cpp
@@ -75,7 +75,7 @@ TEST_F(ParserSelectTest, condition) {
TEST_F(ParserSelectTest, pseudoColumn) {
useDb("root", "test");
- run("SELECT _WSTARTTS, _WENDTS, COUNT(*) FROM t1 INTERVAL(10s)");
+ run("SELECT _WSTART, _WEND, COUNT(*) FROM t1 INTERVAL(10s)");
}
TEST_F(ParserSelectTest, pseudoColumnSemanticCheck) {
@@ -286,7 +286,7 @@ TEST_F(ParserSelectTest, intervalSemanticCheck) {
run("SELECT HISTOGRAM(c1, 'log_bin', '{\"start\": -33,\"factor\": 55,\"count\": 5,\"infinity\": false}', 1) FROM t1 "
"WHERE ts > TIMESTAMP '2022-04-01 00:00:00' and ts < TIMESTAMP '2022-04-30 23:59:59' INTERVAL(10s) FILL(NULL)",
TSDB_CODE_PAR_FILL_NOT_ALLOWED_FUNC);
- run("SELECT _WSTARTTS, _WENDTS, _WDURATION, sum(c1) FROM t1", TSDB_CODE_PAR_INVALID_WINDOW_PC);
+ run("SELECT _WSTART, _WEND, _WDURATION, sum(c1) FROM t1", TSDB_CODE_PAR_INVALID_WINDOW_PC);
}
TEST_F(ParserSelectTest, interp) {
@@ -310,11 +310,11 @@ TEST_F(ParserSelectTest, subquery) {
run("SELECT SUM(a) FROM (SELECT MAX(c1) a, ts FROM st1s1 INTERVAL(1m)) INTERVAL(1n)");
- run("SELECT SUM(a) FROM (SELECT MAX(c1) a, _wstartts FROM st1s1 INTERVAL(1m)) INTERVAL(1n)");
+ run("SELECT SUM(a) FROM (SELECT MAX(c1) a, _wstart FROM st1s1 INTERVAL(1m)) INTERVAL(1n)");
run("SELECT SUM(a) FROM (SELECT MAX(c1) a, ts FROM st1s1 PARTITION BY TBNAME INTERVAL(1m)) INTERVAL(1n)");
- run("SELECT SUM(a) FROM (SELECT MAX(c1) a, _wstartts FROM st1s1 PARTITION BY TBNAME INTERVAL(1m)) INTERVAL(1n)");
+ run("SELECT SUM(a) FROM (SELECT MAX(c1) a, _wstart FROM st1s1 PARTITION BY TBNAME INTERVAL(1m)) INTERVAL(1n)");
run("SELECT _C0 FROM (SELECT _ROWTS, ts FROM st1s1)");
diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c
index 4d4756c3ace3c7e0e2c8afa3fd2530984ecc349b..190ec3a1f6e8e49e5fea49c894ca95d4da4867a1 100644
--- a/source/libs/planner/src/planLogicCreater.c
+++ b/source/libs/planner/src/planLogicCreater.c
@@ -59,7 +59,7 @@ static EDealRes doRewriteExpr(SNode** pNode, void* pContext) {
strcpy(pCol->node.aliasName, pToBeRewrittenExpr->aliasName);
strcpy(pCol->colName, ((SExprNode*)pExpr)->aliasName);
if (QUERY_NODE_FUNCTION == nodeType(pExpr)) {
- if (FUNCTION_TYPE_WSTARTTS == ((SFunctionNode*)pExpr)->funcType) {
+ if (FUNCTION_TYPE_WSTART == ((SFunctionNode*)pExpr)->funcType) {
pCol->colId = PRIMARYKEY_TIMESTAMP_COL_ID;
} else if (FUNCTION_TYPE_TBNAME == ((SFunctionNode*)pExpr)->funcType) {
pCol->colType = COLUMN_TYPE_TBNAME;
diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c
index 855427f26e47d893dafd6954dd92ab04858ddcd9..7915f4a138f587e89304c2fedb7f8471389029b1 100644
--- a/source/libs/planner/src/planOptimizer.c
+++ b/source/libs/planner/src/planOptimizer.c
@@ -124,12 +124,15 @@ static bool scanPathOptMayBeOptimized(SLogicNode* pNode) {
QUERY_NODE_LOGIC_PLAN_PARTITION != nodeType(pNode->pParent))) {
return false;
}
- if (QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode->pParent) ||
+ if ((QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode->pParent) && WINDOW_TYPE_INTERVAL == ((SWindowLogicNode*)pNode->pParent)->winType) ||
(QUERY_NODE_LOGIC_PLAN_PARTITION == nodeType(pNode->pParent) && pNode->pParent->pParent &&
- QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode->pParent->pParent))) {
+ QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode->pParent->pParent) && WINDOW_TYPE_INTERVAL == ((SWindowLogicNode*)pNode->pParent)->winType)) {
return true;
}
- return !scanPathOptHaveNormalCol(((SAggLogicNode*)pNode->pParent)->pGroupKeys);
+ if (QUERY_NODE_LOGIC_PLAN_AGG == nodeType(pNode->pParent)) {
+ return !scanPathOptHaveNormalCol(((SAggLogicNode*)pNode->pParent)->pGroupKeys);
+ }
+ return false;
}
static SNodeList* scanPathOptGetAllFuncs(SLogicNode* pNode) {
@@ -792,15 +795,15 @@ static EDealRes rewriteAggGroupKeyCondForPushDownImpl(SNode** pNode, void* pCont
if (0 == strcmp(((SExprNode*)pGroup)->aliasName, ((SColumnNode*)(*pNode))->colName)) {
SNode* pExpr = nodesCloneNode(pGroup);
if (pExpr == NULL) {
- pCxt->errCode = terrno;
+ pCxt->errCode = TSDB_CODE_OUT_OF_MEMORY;
return DEAL_RES_ERROR;
}
nodesDestroyNode(*pNode);
*pNode = pExpr;
+ return DEAL_RES_IGNORE_CHILD;
}
}
}
- return DEAL_RES_IGNORE_CHILD;
}
return DEAL_RES_CONTINUE;
}
@@ -861,16 +864,16 @@ static EDealRes rewriteProjectCondForPushDownImpl(SNode** ppNode, void* pContext
if (0 == strcmp(((SExprNode*)pProjection)->aliasName, ((SColumnNode*)(*ppNode))->colName)) {
SNode* pExpr = nodesCloneNode(pProjection);
if (pExpr == NULL) {
- pCxt->errCode = terrno;
+ pCxt->errCode = TSDB_CODE_OUT_OF_MEMORY;
return DEAL_RES_ERROR;
}
nodesDestroyNode(*ppNode);
*ppNode = pExpr;
+ return DEAL_RES_IGNORE_CHILD;
} // end if expr alias name equal column name
} // end for each project
} // end if target node equals cond column node
} // end for each targets
- return DEAL_RES_IGNORE_CHILD;
}
return DEAL_RES_CONTINUE;
}
@@ -1208,7 +1211,7 @@ static int32_t smaIndexOptCreateSmaCols(SNodeList* pFuncs, uint64_t tableId, SNo
int32_t smaFuncIndex = -1;
*pWStrartIndex = -1;
FOREACH(pFunc, pFuncs) {
- if (FUNCTION_TYPE_WSTARTTS == ((SFunctionNode*)pFunc)->funcType) {
+ if (FUNCTION_TYPE_WSTART == ((SFunctionNode*)pFunc)->funcType) {
*pWStrartIndex = index;
}
smaFuncIndex = smaIndexOptFindSmaFunc(pFunc, pSmaFuncs);
@@ -1252,7 +1255,7 @@ static SNode* smaIndexOptCreateWStartTs() {
if (NULL == pWStart) {
return NULL;
}
- strcpy(pWStart->functionName, "_wstartts");
+ strcpy(pWStart->functionName, "_wstart");
snprintf(pWStart->node.aliasName, sizeof(pWStart->node.aliasName), "%s.%p", pWStart->functionName, pWStart);
if (TSDB_CODE_SUCCESS != fmGetFuncInfo(pWStart, NULL, 0)) {
nodesDestroyNode((SNode*)pWStart);
@@ -2054,11 +2057,11 @@ static EDealRes mergeProjectionsExpr(SNode** pNode, void* pContext) {
((SExprNode*)*pNode)->aliasName);
nodesDestroyNode(*pNode);
*pNode = pExpr;
+ return DEAL_RES_IGNORE_CHILD;
}
}
}
}
- return DEAL_RES_IGNORE_CHILD;
}
return DEAL_RES_CONTINUE;
}
@@ -2100,11 +2103,12 @@ static bool tagScanMayBeOptimized(SLogicNode* pNode) {
if (QUERY_NODE_LOGIC_PLAN_SCAN != nodeType(pNode) || (SCAN_TYPE_TAG == ((SScanLogicNode*)pNode)->scanType)) {
return false;
}
- SScanLogicNode *pScan = (SScanLogicNode*)pNode;
+ SScanLogicNode* pScan = (SScanLogicNode*)pNode;
if (NULL != pScan->pScanCols) {
return false;
}
- if (NULL == pNode->pParent || QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode->pParent) || 1 != LIST_LENGTH(pNode->pParent->pChildren)) {
+ if (NULL == pNode->pParent || QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode->pParent) ||
+ 1 != LIST_LENGTH(pNode->pParent->pChildren)) {
return false;
}
diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c
index 987da0dd17ba59430dcd94c5d14ec60f8c3b9094..7b9d553501a274e5ccaedcd09a8e4c622392de03 100644
--- a/source/libs/planner/src/planSpliter.c
+++ b/source/libs/planner/src/planSpliter.c
@@ -308,7 +308,7 @@ static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex) {
int32_t index = 0;
SNode* pFunc = NULL;
FOREACH(pFunc, pFuncs) {
- if (FUNCTION_TYPE_WSTARTTS == ((SFunctionNode*)pFunc)->funcType) {
+ if (FUNCTION_TYPE_WSTART == ((SFunctionNode*)pFunc)->funcType) {
*pIndex = index;
return TSDB_CODE_SUCCESS;
}
@@ -319,7 +319,7 @@ static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex) {
if (NULL == pWStart) {
return TSDB_CODE_OUT_OF_MEMORY;
}
- strcpy(pWStart->functionName, "_wstartts");
+ strcpy(pWStart->functionName, "_wstart");
snprintf(pWStart->node.aliasName, sizeof(pWStart->node.aliasName), "%s.%p", pWStart->functionName, pWStart);
int32_t code = fmGetFuncInfo(pWStart, NULL, 0);
if (TSDB_CODE_SUCCESS == code) {
@@ -333,7 +333,7 @@ static int32_t stbSplAppendWEnd(SWindowLogicNode* pWin, int32_t* pIndex) {
int32_t index = 0;
SNode* pFunc = NULL;
FOREACH(pFunc, pWin->pFuncs) {
- if (FUNCTION_TYPE_WENDTS == ((SFunctionNode*)pFunc)->funcType) {
+ if (FUNCTION_TYPE_WEND == ((SFunctionNode*)pFunc)->funcType) {
*pIndex = index;
return TSDB_CODE_SUCCESS;
}
@@ -344,7 +344,7 @@ static int32_t stbSplAppendWEnd(SWindowLogicNode* pWin, int32_t* pIndex) {
if (NULL == pWEnd) {
return TSDB_CODE_OUT_OF_MEMORY;
}
- strcpy(pWEnd->functionName, "_wendts");
+ strcpy(pWEnd->functionName, "_wend");
snprintf(pWEnd->node.aliasName, sizeof(pWEnd->node.aliasName), "%s.%p", pWEnd->functionName, pWEnd);
int32_t code = fmGetFuncInfo(pWEnd, NULL, 0);
if (TSDB_CODE_SUCCESS == code) {
diff --git a/source/libs/planner/test/planBasicTest.cpp b/source/libs/planner/test/planBasicTest.cpp
index c99e4ea8663221234682411d7b7323e6122f56a2..0d6bab145a0a399f36500c4b34f89bfb3febddfb 100644
--- a/source/libs/planner/test/planBasicTest.cpp
+++ b/source/libs/planner/test/planBasicTest.cpp
@@ -137,6 +137,17 @@ TEST_F(PlanBasicTest, sampleFunc) {
run("SELECT SAMPLE(c1, 10) FROM st1 PARTITION BY TBNAME");
}
+TEST_F(PlanBasicTest, pseudoColumn) {
+ useDb("root", "test");
+
+ run("SELECT _QSTART, _QEND, _QDURATION FROM t1");
+
+ run("SELECT _QSTART, _QEND, _QDURATION FROM t1 WHERE ts BETWEEN '2017-7-14 18:00:00' AND '2017-7-14 19:00:00'");
+
+ run("SELECT _QSTART, _QEND, _QDURATION, _WSTART, _WEND, _WDURATION, COUNT(*) FROM t1 "
+ "WHERE ts BETWEEN '2017-7-14 18:00:00' AND '2017-7-14 19:00:00' INTERVAL(10S)");
+}
+
TEST_F(PlanBasicTest, withoutFrom) {
useDb("root", "test");
diff --git a/source/libs/planner/test/planIntervalTest.cpp b/source/libs/planner/test/planIntervalTest.cpp
index 73fa898bf85d3d90656b0ddea006f560c3c3df56..9f34ead6ffec789653e99ebba12a203e86e75e7e 100644
--- a/source/libs/planner/test/planIntervalTest.cpp
+++ b/source/libs/planner/test/planIntervalTest.cpp
@@ -29,7 +29,7 @@ TEST_F(PlanIntervalTest, basic) {
TEST_F(PlanIntervalTest, pseudoCol) {
useDb("root", "test");
- run("SELECT _WSTARTTS, _WDURATION, _WENDTS, COUNT(*) FROM t1 INTERVAL(10s)");
+ run("SELECT _WSTART, _WDURATION, _WEND, COUNT(*) FROM t1 INTERVAL(10s)");
}
TEST_F(PlanIntervalTest, fill) {
@@ -59,9 +59,9 @@ TEST_F(PlanIntervalTest, stable) {
run("SELECT COUNT(*) FROM st1 INTERVAL(10s)");
- run("SELECT _WSTARTTS, COUNT(*) FROM st1 INTERVAL(10s)");
+ run("SELECT _WSTART, COUNT(*) FROM st1 INTERVAL(10s)");
- run("SELECT _WSTARTTS, COUNT(*) FROM st1 PARTITION BY TBNAME INTERVAL(10s)");
+ run("SELECT _WSTART, COUNT(*) FROM st1 PARTITION BY TBNAME INTERVAL(10s)");
run("SELECT TBNAME, COUNT(*) FROM st1 PARTITION BY TBNAME INTERVAL(10s)");
}
diff --git a/source/libs/planner/test/planOptimizeTest.cpp b/source/libs/planner/test/planOptimizeTest.cpp
index 316148df27c880dbdf039003db4d0b7873d7e132..75b4aa0dc109e20ca59145d595bf095cd790f0ba 100644
--- a/source/libs/planner/test/planOptimizeTest.cpp
+++ b/source/libs/planner/test/planOptimizeTest.cpp
@@ -55,7 +55,7 @@ TEST_F(PlanOptimizeTest, sortPrimaryKey) {
run("SELECT c1 FROM t1 ORDER BY ts DESC");
- run("SELECT COUNT(*) FROM t1 INTERVAL(10S) ORDER BY _WSTARTTS DESC");
+ run("SELECT COUNT(*) FROM t1 INTERVAL(10S) ORDER BY _WSTART DESC");
}
TEST_F(PlanOptimizeTest, PartitionTags) {
diff --git a/source/libs/planner/test/planOtherTest.cpp b/source/libs/planner/test/planOtherTest.cpp
index 6add1cf630416b7adaff1394f2af0e2791a9e3f6..7107f8b3c94c616ae9db90132a59f2804b542aca 100644
--- a/source/libs/planner/test/planOtherTest.cpp
+++ b/source/libs/planner/test/planOtherTest.cpp
@@ -49,7 +49,7 @@ TEST_F(PlanOtherTest, createSmaIndex) {
run("SELECT SUM(c4) FROM t1 INTERVAL(10s)");
- run("SELECT _WSTARTTS, MIN(c3 + 10) FROM t1 "
+ run("SELECT _WSTART, MIN(c3 + 10) FROM t1 "
"WHERE ts BETWEEN TIMESTAMP '2022-04-01 00:00:00' AND TIMESTAMP '2022-04-30 23:59:59.999' INTERVAL(10s)");
run("SELECT SUM(c4), MAX(c3) FROM t1 INTERVAL(10s)");
diff --git a/source/libs/qcom/src/queryUtil.c b/source/libs/qcom/src/queryUtil.c
index b4e217ef7482d44d6ebca0509c3043fec175e72b..eeb44c4f82db68b445e944ed1b4870686187f740 100644
--- a/source/libs/qcom/src/queryUtil.c
+++ b/source/libs/qcom/src/queryUtil.c
@@ -282,7 +282,7 @@ int32_t dataConverToStr(char* str, int type, void* buf, int32_t bufSize, int32_t
}
*str = '"';
- int32_t length = taosUcs4ToMbs((TdUcs4 *)buf, bufSize, str + 1);
+ int32_t length = taosUcs4ToMbs((TdUcs4*)buf, bufSize, str + 1);
if (length <= 0) {
return TSDB_CODE_TSC_INVALID_VALUE;
}
@@ -310,15 +310,15 @@ int32_t dataConverToStr(char* str, int type, void* buf, int32_t bufSize, int32_t
return TSDB_CODE_TSC_INVALID_VALUE;
}
- if(len) *len = n;
+ if (len) *len = n;
return TSDB_CODE_SUCCESS;
}
char* parseTagDatatoJson(void* p) {
- char* string = NULL;
+ char* string = NULL;
SArray* pTagVals = NULL;
- cJSON* json = NULL;
+ cJSON* json = NULL;
if (tTagToValArray((const STag*)p, &pTagVals) != 0) {
goto end;
}
@@ -327,7 +327,7 @@ char* parseTagDatatoJson(void* p) {
if (nCols == 0) {
goto end;
}
- char tagJsonKey[256] = {0};
+ char tagJsonKey[256] = {0};
json = cJSON_CreateObject();
if (json == NULL) {
goto end;
@@ -390,7 +390,7 @@ char* parseTagDatatoJson(void* p) {
end:
cJSON_Delete(json);
taosArrayDestroy(pTagVals);
- if(string == NULL){
+ if (string == NULL) {
string = strdup(TSDB_DATA_NULL_STR_L);
}
return string;
diff --git a/source/libs/qworker/CMakeLists.txt b/source/libs/qworker/CMakeLists.txt
index 306753808bcca232f7c8b0f824f98ba0351a2b60..92ccde31634eb8051952ff313c86056fba08f075 100644
--- a/source/libs/qworker/CMakeLists.txt
+++ b/source/libs/qworker/CMakeLists.txt
@@ -13,4 +13,4 @@ target_link_libraries(qworker
if(${BUILD_TEST})
ADD_SUBDIRECTORY(test)
-endif(${BUILD_TEST})
\ No newline at end of file
+endif(${BUILD_TEST})
diff --git a/source/libs/scalar/inc/sclInt.h b/source/libs/scalar/inc/sclInt.h
index 4422da1b8160ab9c17dbba75245a7e21d5d8cc9c..d423b92da7e83589aacc6d384c0e2cafa0949038 100644
--- a/source/libs/scalar/inc/sclInt.h
+++ b/source/libs/scalar/inc/sclInt.h
@@ -30,6 +30,7 @@ typedef struct SOperatorValueType {
typedef struct SScalarCtx {
int32_t code;
+ bool dual;
SArray *pBlockList; /* element is SSDataBlock* */
SHashObj *pRes; /* element is SScalarParam */
void *param; // additional parameter (meta actually) for acquire value such as tbname/tags values
diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c
index dd558942665a5c516963a7cffcc71d4ca55b9f5f..bdfc411fa6243864ab58402e449af988174f4866 100644
--- a/source/libs/scalar/src/scalar.c
+++ b/source/libs/scalar/src/scalar.c
@@ -729,6 +729,7 @@ EDealRes sclRewriteFunction(SNode** pNode, SScalarCtx *ctx) {
if (colDataIsNull_s(output.columnData, 0)) {
res->node.resType.type = TSDB_DATA_TYPE_NULL;
+ res->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_NULL].bytes;
} else {
res->node.resType.type = output.columnData->info.type;
res->node.resType.bytes = output.columnData->info.bytes;
@@ -819,6 +820,7 @@ EDealRes sclRewriteOperator(SNode** pNode, SScalarCtx *ctx) {
if (colDataIsNull_s(output.columnData, 0)) {
if(node->node.resType.type != TSDB_DATA_TYPE_JSON){
res->node.resType.type = TSDB_DATA_TYPE_NULL;
+ res->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_NULL].bytes;
}else{
res->node.resType = node->node.resType;
res->isNull = true;
@@ -1008,13 +1010,14 @@ int32_t sclExtendResRows(SScalarParam *pDst, SScalarParam *pSrc, SArray *pBlockL
return TSDB_CODE_SUCCESS;
}
-int32_t scalarCalculateConstants(SNode *pNode, SNode **pRes) {
+int32_t sclCalcConstants(SNode *pNode, bool dual, SNode **pRes) {
if (NULL == pNode) {
SCL_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT);
}
int32_t code = 0;
SScalarCtx ctx = {0};
+ ctx.dual = dual;
ctx.pRes = taosHashInit(SCL_DEFAULT_OP_NUM, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
if (NULL == ctx.pRes) {
sclError("taosHashInit failed, num:%d", SCL_DEFAULT_OP_NUM);
@@ -1026,54 +1029,12 @@ int32_t scalarCalculateConstants(SNode *pNode, SNode **pRes) {
*pRes = pNode;
_return:
- sclFreeRes(ctx.pRes);
- return code;
-}
-
-int32_t scalarCalculate(SNode *pNode, SArray *pBlockList, SScalarParam *pDst) {
- if (NULL == pNode || NULL == pBlockList) {
- SCL_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT);
- }
-
- int32_t code = 0;
- SScalarCtx ctx = {.code = 0, .pBlockList = pBlockList, .param = pDst ? pDst->param : NULL};
-
- // TODO: OPT performance
- ctx.pRes = taosHashInit(SCL_DEFAULT_OP_NUM, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
- if (NULL == ctx.pRes) {
- sclError("taosHashInit failed, num:%d", SCL_DEFAULT_OP_NUM);
- SCL_ERR_RET(TSDB_CODE_QRY_OUT_OF_MEMORY);
- }
-
- nodesWalkExprPostOrder(pNode, sclCalcWalker, (void *)&ctx);
- SCL_ERR_JRET(ctx.code);
-
- if (pDst) {
- SScalarParam *res = (SScalarParam *)taosHashGet(ctx.pRes, (void *)&pNode, POINTER_BYTES);
- if (NULL == res) {
- sclError("no valid res in hash, node:%p, type:%d", pNode, nodeType(pNode));
- SCL_ERR_JRET(TSDB_CODE_QRY_APP_ERROR);
- }
- if (1 == res->numOfRows) {
- SCL_ERR_JRET(sclExtendResRows(pDst, res, pBlockList));
- } else {
- colInfoDataEnsureCapacity(pDst->columnData, res->numOfRows);
- colDataAssign(pDst->columnData, res->columnData, res->numOfRows, NULL);
- pDst->numOfRows = res->numOfRows;
- }
-
- sclFreeParam(res);
- taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES);
- }
-
-_return:
- //nodesDestroyNode(pNode);
sclFreeRes(ctx.pRes);
return code;
}
-static int32_t getMinusOperatorResultType(SOperatorNode* pOp) {
+static int32_t sclGetMinusOperatorResType(SOperatorNode* pOp) {
if (!IS_MATHABLE_TYPE(((SExprNode*)(pOp->pLeft))->resType.type)) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
@@ -1082,7 +1043,7 @@ static int32_t getMinusOperatorResultType(SOperatorNode* pOp) {
return TSDB_CODE_SUCCESS;
}
-static int32_t getArithmeticOperatorResultType(SOperatorNode* pOp) {
+static int32_t sclGetMathOperatorResType(SOperatorNode* pOp) {
SDataType ldt = ((SExprNode*)(pOp->pLeft))->resType;
SDataType rdt = ((SExprNode*)(pOp->pRight))->resType;
if ((TSDB_DATA_TYPE_TIMESTAMP == ldt.type && TSDB_DATA_TYPE_TIMESTAMP == rdt.type) ||
@@ -1104,7 +1065,7 @@ static int32_t getArithmeticOperatorResultType(SOperatorNode* pOp) {
return TSDB_CODE_SUCCESS;
}
-static int32_t getComparisonOperatorResultType(SOperatorNode* pOp) {
+static int32_t sclGetCompOperatorResType(SOperatorNode* pOp) {
SDataType ldt = ((SExprNode*)(pOp->pLeft))->resType;
if (OP_TYPE_IN == pOp->opType || OP_TYPE_NOT_IN == pOp->opType) {
((SExprNode*)(pOp->pRight))->resType = ldt;
@@ -1120,7 +1081,7 @@ static int32_t getComparisonOperatorResultType(SOperatorNode* pOp) {
return TSDB_CODE_SUCCESS;
}
-static int32_t getJsonOperatorResultType(SOperatorNode* pOp) {
+static int32_t sclGetJsonOperatorResType(SOperatorNode* pOp) {
SDataType ldt = ((SExprNode*)(pOp->pLeft))->resType;
SDataType rdt = ((SExprNode*)(pOp->pRight))->resType;
if (TSDB_DATA_TYPE_JSON != ldt.type || !IS_STR_DATA_TYPE(rdt.type)) {
@@ -1135,12 +1096,64 @@ static int32_t getJsonOperatorResultType(SOperatorNode* pOp) {
return TSDB_CODE_SUCCESS;
}
-static int32_t getBitwiseOperatorResultType(SOperatorNode* pOp) {
+static int32_t sclGetBitwiseOperatorResType(SOperatorNode* pOp) {
pOp->node.resType.type = TSDB_DATA_TYPE_BIGINT;
pOp->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes;
return TSDB_CODE_SUCCESS;
}
+
+int32_t scalarCalculateConstants(SNode *pNode, SNode **pRes) {
+ return sclCalcConstants(pNode, false, pRes);
+}
+
+int32_t scalarCalculateConstantsFromDual(SNode *pNode, SNode **pRes) {
+ return sclCalcConstants(pNode, true, pRes);
+}
+
+int32_t scalarCalculate(SNode *pNode, SArray *pBlockList, SScalarParam *pDst) {
+ if (NULL == pNode || NULL == pBlockList) {
+ SCL_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT);
+ }
+
+ int32_t code = 0;
+ SScalarCtx ctx = {.code = 0, .pBlockList = pBlockList, .param = pDst ? pDst->param : NULL};
+
+ // TODO: OPT performance
+ ctx.pRes = taosHashInit(SCL_DEFAULT_OP_NUM, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
+ if (NULL == ctx.pRes) {
+ sclError("taosHashInit failed, num:%d", SCL_DEFAULT_OP_NUM);
+ SCL_ERR_RET(TSDB_CODE_QRY_OUT_OF_MEMORY);
+ }
+
+ nodesWalkExprPostOrder(pNode, sclCalcWalker, (void *)&ctx);
+ SCL_ERR_JRET(ctx.code);
+
+ if (pDst) {
+ SScalarParam *res = (SScalarParam *)taosHashGet(ctx.pRes, (void *)&pNode, POINTER_BYTES);
+ if (NULL == res) {
+ sclError("no valid res in hash, node:%p, type:%d", pNode, nodeType(pNode));
+ SCL_ERR_JRET(TSDB_CODE_QRY_APP_ERROR);
+ }
+
+ if (1 == res->numOfRows) {
+ SCL_ERR_JRET(sclExtendResRows(pDst, res, pBlockList));
+ } else {
+ colInfoDataEnsureCapacity(pDst->columnData, res->numOfRows);
+ colDataAssign(pDst->columnData, res->columnData, res->numOfRows, NULL);
+ pDst->numOfRows = res->numOfRows;
+ }
+
+ sclFreeParam(res);
+ taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES);
+ }
+
+_return:
+ //nodesDestroyNode(pNode);
+ sclFreeRes(ctx.pRes);
+ return code;
+}
+
int32_t scalarGetOperatorResultType(SOperatorNode* pOp) {
if (TSDB_DATA_TYPE_BLOB == ((SExprNode*)(pOp->pLeft))->resType.type ||
(NULL != pOp->pRight && TSDB_DATA_TYPE_BLOB == ((SExprNode*)(pOp->pRight))->resType.type)) {
@@ -1153,15 +1166,15 @@ int32_t scalarGetOperatorResultType(SOperatorNode* pOp) {
case OP_TYPE_MULTI:
case OP_TYPE_DIV:
case OP_TYPE_REM:
- return getArithmeticOperatorResultType(pOp);
+ return sclGetMathOperatorResType(pOp);
case OP_TYPE_MINUS:
- return getMinusOperatorResultType(pOp);
+ return sclGetMinusOperatorResType(pOp);
case OP_TYPE_ASSIGN:
pOp->node.resType = ((SExprNode*)(pOp->pLeft))->resType;
break;
case OP_TYPE_BIT_AND:
case OP_TYPE_BIT_OR:
- return getBitwiseOperatorResultType(pOp);
+ return sclGetBitwiseOperatorResType(pOp);
case OP_TYPE_GREATER_THAN:
case OP_TYPE_GREATER_EQUAL:
case OP_TYPE_LOWER_THAN:
@@ -1182,10 +1195,10 @@ int32_t scalarGetOperatorResultType(SOperatorNode* pOp) {
case OP_TYPE_NMATCH:
case OP_TYPE_IN:
case OP_TYPE_NOT_IN:
- return getComparisonOperatorResultType(pOp);
+ return sclGetCompOperatorResType(pOp);
case OP_TYPE_JSON_GET_VALUE:
case OP_TYPE_JSON_CONTAINS:
- return getJsonOperatorResultType(pOp);
+ return sclGetJsonOperatorResType(pOp);
default:
break;
}
diff --git a/source/libs/scalar/src/sclvector.c b/source/libs/scalar/src/sclvector.c
index bf457d07eb86f9bb929e64a59440182bce1b185f..39b2f04f3e29044a484b10fd1110b1695a4a1128 100644
--- a/source/libs/scalar/src/sclvector.c
+++ b/source/libs/scalar/src/sclvector.c
@@ -1055,7 +1055,7 @@ static void vectorMathAddHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRig
}
}
-static void vectorMathBigintAddHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRightCol, SColumnInfoData* pOutputCol, int32_t numOfRows, int32_t step, int32_t i) {
+static void vectorMathTsAddHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRightCol, SColumnInfoData* pOutputCol, int32_t numOfRows, int32_t step, int32_t i) {
_getBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(pLeftCol->info.type);
_getBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(pRightCol->info.type);
@@ -1069,7 +1069,8 @@ static void vectorMathBigintAddHelper(SColumnInfoData* pLeftCol, SColumnInfoData
colDataAppendNULL(pOutputCol, i);
continue; // TODO set null or ignore
}
- *output = getVectorBigintValueFnLeft(pLeftCol->pData, i) + getVectorBigintValueFnRight(pRightCol->pData, 0);
+ *output = taosTimeAdd(getVectorBigintValueFnLeft(pLeftCol->pData, i), getVectorBigintValueFnRight(pRightCol->pData, 0),
+ pRightCol->info.scale, pRightCol->info.precision);
}
}
}
@@ -1116,7 +1117,17 @@ void vectorMathAdd(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut
_getBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(pLeftCol->info.type);
_getBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(pRightCol->info.type);
- if (pLeft->numOfRows == pRight->numOfRows) {
+ if (pLeft->numOfRows == 1 && pRight->numOfRows == 1) {
+ if (GET_PARAM_TYPE(pLeft) == TSDB_DATA_TYPE_TIMESTAMP) {
+ vectorMathTsAddHelper(pLeftCol, pRightCol, pOutputCol, pRight->numOfRows, step, i);
+ } else {
+ vectorMathTsAddHelper(pRightCol, pLeftCol, pOutputCol, pRight->numOfRows, step, i);
+ }
+ } else if (pLeft->numOfRows == 1) {
+ vectorMathTsAddHelper(pRightCol, pLeftCol, pOutputCol, pRight->numOfRows, step, i);
+ } else if (pRight->numOfRows == 1) {
+ vectorMathTsAddHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, i);
+ } else if (pLeft->numOfRows == pRight->numOfRows) {
for (; i < pRight->numOfRows && i >= 0; i += step, output += 1) {
if (IS_NULL) {
colDataAppendNULL(pOutputCol, i);
@@ -1124,11 +1135,7 @@ void vectorMathAdd(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut
}
*output = getVectorBigintValueFnLeft(pLeftCol->pData, i) + getVectorBigintValueFnRight(pRightCol->pData, i);
}
- } else if (pLeft->numOfRows == 1) {
- vectorMathBigintAddHelper(pRightCol, pLeftCol, pOutputCol, pRight->numOfRows, step, i);
- } else if (pRight->numOfRows == 1) {
- vectorMathBigintAddHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, i);
- }
+ }
} else {
double *output = (double *)pOutputCol->pData;
_getDoubleValue_fn_t getVectorDoubleValueFnLeft = getVectorDoubleValueFn(pLeftCol->info.type);
@@ -1174,7 +1181,7 @@ static void vectorMathSubHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRig
}
}
-static void vectorMathBigintSubHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRightCol, SColumnInfoData* pOutputCol, int32_t numOfRows, int32_t step, int32_t factor, int32_t i) {
+static void vectorMathTsSubHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRightCol, SColumnInfoData* pOutputCol, int32_t numOfRows, int32_t step, int32_t factor, int32_t i) {
_getBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(pLeftCol->info.type);
_getBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(pRightCol->info.type);
@@ -1188,7 +1195,9 @@ static void vectorMathBigintSubHelper(SColumnInfoData* pLeftCol, SColumnInfoData
colDataAppendNULL(pOutputCol, i);
continue; // TODO set null or ignore
}
- *output = (getVectorBigintValueFnLeft(pLeftCol->pData, i) - getVectorBigintValueFnRight(pRightCol->pData, 0)) * factor;
+ *output = taosTimeSub(getVectorBigintValueFnLeft(pLeftCol->pData, i), getVectorBigintValueFnRight(pRightCol->pData, 0),
+ pRightCol->info.scale, pRightCol->info.precision);
+
}
}
}
@@ -1211,7 +1220,13 @@ void vectorMathSub(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut
_getBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(pLeftCol->info.type);
_getBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(pRightCol->info.type);
- if (pLeft->numOfRows == pRight->numOfRows) {
+ if (pLeft->numOfRows == 1 && pRight->numOfRows == 1) {
+ vectorMathTsSubHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, 1, i);
+ } else if (pLeft->numOfRows == 1) {
+ vectorMathTsSubHelper(pRightCol, pLeftCol, pOutputCol, pRight->numOfRows, step, -1, i);
+ } else if (pRight->numOfRows == 1) {
+ vectorMathTsSubHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, 1, i);
+ } else if (pLeft->numOfRows == pRight->numOfRows) {
for (; i < pRight->numOfRows && i >= 0; i += step, output += 1) {
if (IS_NULL) {
colDataAppendNULL(pOutputCol, i);
@@ -1219,10 +1234,6 @@ void vectorMathSub(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut
}
*output = getVectorBigintValueFnLeft(pLeftCol->pData, i) - getVectorBigintValueFnRight(pRightCol->pData, i);
}
- } else if (pLeft->numOfRows == 1) {
- vectorMathBigintSubHelper(pRightCol, pLeftCol, pOutputCol, pRight->numOfRows, step, -1, i);
- } else if (pRight->numOfRows == 1) {
- vectorMathBigintSubHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, 1, i);
}
} else {
double *output = (double *)pOutputCol->pData;
diff --git a/source/libs/scheduler/inc/schInt.h b/source/libs/scheduler/inc/schInt.h
index 0a0d3190259693cc0f8205d5874a5fb33568a06a..b6b17cb1066e738e360bd7a8cd2d80c5b0d7def3 100644
--- a/source/libs/scheduler/inc/schInt.h
+++ b/source/libs/scheduler/inc/schInt.h
@@ -223,6 +223,7 @@ typedef struct SSchJobAttr {
typedef struct {
int32_t op;
+ SRWLatch lock;
bool syncReq;
} SSchOpStatus;
@@ -473,6 +474,7 @@ int32_t schGetTaskFromList(SHashObj *pTaskList, uint64_t taskId, SSchTask **pTas
int32_t schInitTask(SSchJob *pJob, SSchTask *pTask, SSubplan *pPlan, SSchLevel *pLevel, int32_t levelNum);
int32_t schSwitchTaskCandidateAddr(SSchJob *pJob, SSchTask *pTask);
void schDirectPostJobRes(SSchedulerReq* pReq, int32_t errCode);
+bool schChkCurrentOp(SSchJob *pJob, int32_t op, bool sync);
extern SSchDebug gSCHDebug;
diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c
index e482814ee7a71d12acb350ae99f3db9656892a02..19bb93249f50d22bb535e25654fc93bbab11a981 100644
--- a/source/libs/scheduler/src/schJob.c
+++ b/source/libs/scheduler/src/schJob.c
@@ -443,25 +443,37 @@ int32_t schNotifyUserFetchRes(SSchJob* pJob) {
}
void schPostJobRes(SSchJob *pJob, SCH_OP_TYPE op) {
+ SCH_LOCK(SCH_WRITE, &pJob->opStatus.lock);
+
if (SCH_OP_NULL == pJob->opStatus.op) {
SCH_JOB_DLOG("job not in any operation, no need to post job res, status:%s", jobTaskStatusStr(pJob->status));
- return;
+ goto _return;
}
if (op && pJob->opStatus.op != op) {
SCH_JOB_ELOG("job in operation %s mis-match with expected %s", schGetOpStr(pJob->opStatus.op), schGetOpStr(op));
- return;
+ goto _return;
}
if (SCH_JOB_IN_SYNC_OP(pJob)) {
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
tsem_post(&pJob->rspSem);
} else if (SCH_JOB_IN_ASYNC_EXEC_OP(pJob)) {
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
schNotifyUserExecRes(pJob);
} else if (SCH_JOB_IN_ASYNC_FETCH_OP(pJob)) {
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
schNotifyUserFetchRes(pJob);
} else {
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
SCH_JOB_ELOG("job not in any operation, status:%s", jobTaskStatusStr(pJob->status));
}
+
+ return;
+
+_return:
+
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
}
int32_t schProcessOnJobFailureImpl(SSchJob *pJob, int32_t status, int32_t errCode) {
@@ -658,13 +670,13 @@ int32_t schJobFetchRows(SSchJob *pJob) {
if (!(pJob->attr.explainMode == EXPLAIN_MODE_STATIC)) {
SCH_ERR_RET(schLaunchFetchTask(pJob));
- if (pJob->opStatus.syncReq) {
+ if (schChkCurrentOp(pJob, SCH_OP_FETCH, true)) {
SCH_JOB_DLOG("sync wait for rsp now, job status:%s", SCH_GET_JOB_STATUS_STR(pJob));
tsem_wait(&pJob->rspSem);
SCH_RET(schDumpJobFetchRes(pJob, pJob->userRes.fetchRes));
}
} else {
- if (pJob->opStatus.syncReq) {
+ if (schChkCurrentOp(pJob, SCH_OP_FETCH, true)) {
SCH_RET(schDumpJobFetchRes(pJob, pJob->userRes.fetchRes));
} else {
schPostJobRes(pJob, SCH_OP_FETCH);
@@ -775,25 +787,37 @@ void schDirectPostJobRes(SSchedulerReq* pReq, int32_t errCode) {
}
}
+bool schChkCurrentOp(SSchJob *pJob, int32_t op, bool sync) {
+ SCH_LOCK(SCH_READ, &pJob->opStatus.lock);
+ bool r = (pJob->opStatus.op == op) && (pJob->opStatus.syncReq == sync);
+ SCH_UNLOCK(SCH_READ, &pJob->opStatus.lock);
+
+ return r;
+}
+
void schProcessOnOpEnd(SSchJob *pJob, SCH_OP_TYPE type, SSchedulerReq* pReq, int32_t errCode) {
int32_t op = 0;
switch (type) {
case SCH_OP_EXEC:
if (pReq && pReq->syncReq) {
+ SCH_LOCK(SCH_WRITE, &pJob->opStatus.lock);
op = atomic_val_compare_exchange_32(&pJob->opStatus.op, type, SCH_OP_NULL);
if (SCH_OP_NULL == op || op != type) {
SCH_JOB_ELOG("job not in %s operation, op:%s, status:%s", schGetOpStr(type), schGetOpStr(op), jobTaskStatusStr(pJob->status));
}
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
schDumpJobExecRes(pJob, pReq->pExecRes);
}
break;
case SCH_OP_FETCH:
if (pReq && pReq->syncReq) {
+ SCH_LOCK(SCH_WRITE, &pJob->opStatus.lock);
op = atomic_val_compare_exchange_32(&pJob->opStatus.op, type, SCH_OP_NULL);
if (SCH_OP_NULL == op || op != type) {
SCH_JOB_ELOG("job not in %s operation, op:%s, status:%s", schGetOpStr(type), schGetOpStr(op), jobTaskStatusStr(pJob->status));
}
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
}
break;
case SCH_OP_GET_STATUS:
@@ -816,8 +840,10 @@ int32_t schProcessOnOpBegin(SSchJob* pJob, SCH_OP_TYPE type, SSchedulerReq* pReq
switch (type) {
case SCH_OP_EXEC:
+ SCH_LOCK(SCH_WRITE, &pJob->opStatus.lock);
if (SCH_OP_NULL != atomic_val_compare_exchange_32(&pJob->opStatus.op, SCH_OP_NULL, type)) {
SCH_JOB_ELOG("job already in %s operation", schGetOpStr(pJob->opStatus.op));
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
schDirectPostJobRes(pReq, TSDB_CODE_TSC_APP_ERROR);
SCH_ERR_RET(TSDB_CODE_TSC_APP_ERROR);
}
@@ -825,10 +851,13 @@ int32_t schProcessOnOpBegin(SSchJob* pJob, SCH_OP_TYPE type, SSchedulerReq* pReq
SCH_JOB_DLOG("job start %s operation", schGetOpStr(pJob->opStatus.op));
pJob->opStatus.syncReq = pReq->syncReq;
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
break;
case SCH_OP_FETCH:
+ SCH_LOCK(SCH_WRITE, &pJob->opStatus.lock);
if (SCH_OP_NULL != atomic_val_compare_exchange_32(&pJob->opStatus.op, SCH_OP_NULL, type)) {
SCH_JOB_ELOG("job already in %s operation", schGetOpStr(pJob->opStatus.op));
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
schDirectPostJobRes(pReq, TSDB_CODE_TSC_APP_ERROR);
SCH_ERR_RET(TSDB_CODE_TSC_APP_ERROR);
}
@@ -840,6 +869,7 @@ int32_t schProcessOnOpBegin(SSchJob* pJob, SCH_OP_TYPE type, SSchedulerReq* pReq
pJob->userRes.cbParam = pReq->cbParam;
pJob->opStatus.syncReq = pReq->syncReq;
+ SCH_UNLOCK(SCH_WRITE, &pJob->opStatus.lock);
if (!SCH_JOB_NEED_FETCH(pJob)) {
SCH_JOB_ELOG("no need to fetch data, status:%s", SCH_GET_JOB_STATUS_STR(pJob));
diff --git a/source/libs/scheduler/src/schTask.c b/source/libs/scheduler/src/schTask.c
index 6bb8db593c13c28802ff6d63ab48f3da54cd0c66..236257666b23b93d174f8f1126497f061dfd90c9 100644
--- a/source/libs/scheduler/src/schTask.c
+++ b/source/libs/scheduler/src/schTask.c
@@ -41,6 +41,8 @@ void schFreeTask(SSchJob *pJob, SSchTask *pTask) {
if (pTask->execNodes) {
taosHashCleanup(pTask->execNodes);
}
+
+ taosMemoryFree(pTask->profile.execTime);
}
int32_t schInitTask(SSchJob *pJob, SSchTask *pTask, SSubplan *pPlan, SSchLevel *pLevel, int32_t levelNum) {
@@ -503,6 +505,7 @@ int32_t schTaskCheckSetRetry(SSchJob *pJob, SSchTask *pTask, int32_t errCode, bo
return TSDB_CODE_SUCCESS;
}
+/*
if (SCH_IS_DATA_BIND_TASK(pTask)) {
if ((pTask->execId + 1) >= SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode)) {
*needRetry = false;
@@ -520,6 +523,7 @@ int32_t schTaskCheckSetRetry(SSchJob *pJob, SSchTask *pTask, int32_t errCode, bo
return TSDB_CODE_SUCCESS;
}
}
+*/
*needRetry = true;
SCH_TASK_DLOG("task need the %dth retry, errCode:%x - %s", pTask->execId + 1, errCode, tstrerror(errCode));
diff --git a/source/libs/stream/inc/streamInc.h b/source/libs/stream/inc/streamInc.h
index 1629c863d5389614f01ea726d69e885d42f76ce9..f9f4e6277424f3f1be7a24b3f2f71412406fd661 100644
--- a/source/libs/stream/inc/streamInc.h
+++ b/source/libs/stream/inc/streamInc.h
@@ -42,6 +42,9 @@ int32_t streamBroadcastToChildren(SStreamTask* pTask, const SSDataBlock* pBlock)
int32_t tEncodeStreamRetrieveReq(SEncoder* pEncoder, const SStreamRetrieveReq* pReq);
+int32_t streamAppendQueueItem(SStreamQueueItem* dst, SStreamQueueItem* elem);
+void streamFreeQitem(SStreamQueueItem* data);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/libs/stream/src/stream.c b/source/libs/stream/src/stream.c
index 29e0f7ded0c4ab04acf7579b8dbeaedaf3cabaa3..566d9209a84e123840a5b0abb68c6583b9f4eb93 100644
--- a/source/libs/stream/src/stream.c
+++ b/source/libs/stream/src/stream.c
@@ -97,7 +97,7 @@ int32_t streamLaunchByWrite(SStreamTask* pTask, int32_t vgId) {
.pCont = pRunReq,
.contLen = sizeof(SStreamTaskRunReq),
};
- tmsgPutToQueue(pTask->pMsgCb, FETCH_QUEUE, &msg);
+ tmsgPutToQueue(pTask->pMsgCb, STREAM_QUEUE, &msg);
}
return 0;
}
@@ -173,7 +173,8 @@ int32_t streamTaskEnqueueRetrieve(SStreamTask* pTask, SStreamRetrieveReq* pReq,
}
int32_t streamProcessDispatchReq(SStreamTask* pTask, SStreamDispatchReq* pReq, SRpcMsg* pRsp) {
- qInfo("task %d receive dispatch req from node %d task %d", pTask->taskId, pReq->upstreamNodeId, pReq->upstreamTaskId);
+ qDebug("task %d receive dispatch req from node %d task %d", pTask->taskId, pReq->upstreamNodeId,
+ pReq->upstreamTaskId);
// 1. handle input
streamTaskEnqueue(pTask, pReq, pRsp);
diff --git a/source/libs/stream/src/streamData.c b/source/libs/stream/src/streamData.c
index 529615d4fde525b4f27507617f5a15f3e56d388d..8e16b23e56e9506c1110afcbee0dfb251c7e4cc8 100644
--- a/source/libs/stream/src/streamData.c
+++ b/source/libs/stream/src/streamData.c
@@ -97,3 +97,29 @@ void streamDataSubmitRefDec(SStreamDataSubmit* pDataSubmit) {
taosMemoryFree(pDataSubmit->dataRef);
}
}
+
+int32_t streamAppendQueueItem(SStreamQueueItem* dst, SStreamQueueItem* elem) {
+ ASSERT(elem);
+ if (dst->type == elem->type && dst->type == STREAM_INPUT__DATA_BLOCK) {
+ SStreamDataBlock* pBlock = (SStreamDataBlock*)dst;
+ SStreamDataBlock* pBlockSrc = (SStreamDataBlock*)elem;
+ taosArrayAddAll(pBlock->blocks, pBlockSrc->blocks);
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+void streamFreeQitem(SStreamQueueItem* data) {
+ int8_t type = data->type;
+ if (type == STREAM_INPUT__TRIGGER) {
+ blockDataDestroy(((SStreamTrigger*)data)->pBlock);
+ taosFreeQitem(data);
+ } else if (type == STREAM_INPUT__DATA_BLOCK || type == STREAM_INPUT__DATA_RETRIEVE) {
+ taosArrayDestroyEx(((SStreamDataBlock*)data)->blocks, (FDelete)blockDataFreeRes);
+ taosFreeQitem(data);
+ } else if (type == STREAM_INPUT__DATA_SUBMIT) {
+ streamDataSubmitRefDec((SStreamDataSubmit*)data);
+ taosFreeQitem(data);
+ }
+}
diff --git a/source/libs/stream/src/streamDispatch.c b/source/libs/stream/src/streamDispatch.c
index 98b0874b0047ae84aa4b302bcf691a190af6f3dd..e2faf28abe2e0e6fa2e61abe7fbd9b1f00a8ff9e 100644
--- a/source/libs/stream/src/streamDispatch.c
+++ b/source/libs/stream/src/streamDispatch.c
@@ -251,8 +251,8 @@ int32_t streamBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* data,
ASSERT(vgId > 0 || vgId == SNODE_HANDLE);
req.taskId = downstreamTaskId;
- qInfo("dispatch from task %d (child id %d) to down stream task %d in vnode %d", pTask->taskId, pTask->selfChildId,
- downstreamTaskId, vgId);
+ qDebug("dispatch from task %d (child id %d) to down stream task %d in vnode %d", pTask->taskId, pTask->selfChildId,
+ downstreamTaskId, vgId);
// serialize
int32_t tlen;
@@ -298,6 +298,7 @@ int32_t streamDispatch(SStreamTask* pTask, SMsgCb* pMsgCb) {
SStreamDataBlock* pBlock = streamQueueNextItem(pTask->outputQueue);
if (pBlock == NULL) {
+ qDebug("stream stop dispatching since no output: task %d", pTask->taskId);
atomic_store_8(&pTask->outputStatus, TASK_OUTPUT_STATUS__NORMAL);
return 0;
}
@@ -312,7 +313,7 @@ int32_t streamDispatch(SStreamTask* pTask, SMsgCb* pMsgCb) {
atomic_store_8(&pTask->outputStatus, TASK_OUTPUT_STATUS__NORMAL);
return -1;
}
- taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock);
+ taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes);
taosFreeQitem(pBlock);
tmsgSendReq(pEpSet, &dispatchMsg);
diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c
index d178c196158e2a60657e79032bd4b1eb72d2eb16..023c092028bf4ec22196844bb3d42c2c7ad45409 100644
--- a/source/libs/stream/src/streamExec.c
+++ b/source/libs/stream/src/streamExec.c
@@ -26,10 +26,12 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, void* data, SArray* pRes)
} else if (pItem->type == STREAM_INPUT__DATA_SUBMIT) {
ASSERT(pTask->isDataScan);
SStreamDataSubmit* pSubmit = (SStreamDataSubmit*)data;
+ qDebug("task %d %p set submit input %p %p %d", pTask->taskId, pTask, pSubmit, pSubmit->data, *pSubmit->dataRef);
qSetStreamInput(exec, pSubmit->data, STREAM_INPUT__DATA_SUBMIT, false);
} else if (pItem->type == STREAM_INPUT__DATA_BLOCK || pItem->type == STREAM_INPUT__DATA_RETRIEVE) {
SStreamDataBlock* pBlock = (SStreamDataBlock*)data;
SArray* blocks = pBlock->blocks;
+ qDebug("task %d %p set ssdata input", pTask->taskId, pTask);
qSetMultiStreamInput(exec, blocks->pData, blocks->size, STREAM_INPUT__DATA_BLOCK, false);
} else if (pItem->type == STREAM_INPUT__DROP) {
// TODO exec drop
@@ -73,13 +75,38 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, void* data, SArray* pRes)
static SArray* streamExecForQall(SStreamTask* pTask, SArray* pRes) {
while (1) {
- void* data = streamQueueNextItem(pTask->inputQueue);
+ int32_t cnt = 0;
+ void* data = NULL;
+ while (1) {
+ SStreamQueueItem* qItem = streamQueueNextItem(pTask->inputQueue);
+ if (qItem == NULL) {
+ qDebug("stream exec over, queue empty");
+ break;
+ }
+ if (data == NULL) {
+ data = qItem;
+ streamQueueProcessSuccess(pTask->inputQueue);
+ continue;
+ } else {
+ if (streamAppendQueueItem(data, qItem) < 0) {
+ streamQueueProcessFail(pTask->inputQueue);
+ break;
+ } else {
+ cnt++;
+ streamQueueProcessSuccess(pTask->inputQueue);
+ taosArrayDestroy(((SStreamDataBlock*)qItem)->blocks);
+ taosFreeQitem(qItem);
+ }
+ }
+ }
if (data == NULL) break;
+ qDebug("stream task %d exec begin, batch msg: %d", pTask->taskId, cnt);
streamTaskExecImpl(pTask, data, pRes);
+ qDebug("stream task %d exec end", pTask->taskId);
if (pTask->taskStatus == TASK_STATUS__DROPPING) {
- taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock);
+ taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes);
return NULL;
}
@@ -93,27 +120,16 @@ static SArray* streamExecForQall(SStreamTask* pTask, SArray* pRes) {
qRes->type = STREAM_INPUT__DATA_BLOCK;
qRes->blocks = pRes;
if (streamTaskOutput(pTask, qRes) < 0) {
- streamQueueProcessFail(pTask->inputQueue);
- taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock);
+ /*streamQueueProcessFail(pTask->inputQueue);*/
+ taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes);
taosFreeQitem(qRes);
return NULL;
}
- streamQueueProcessSuccess(pTask->inputQueue);
+ /*streamQueueProcessSuccess(pTask->inputQueue);*/
pRes = taosArrayInit(0, sizeof(SSDataBlock));
}
- int8_t type = ((SStreamQueueItem*)data)->type;
- if (type == STREAM_INPUT__TRIGGER) {
- blockDataDestroy(((SStreamTrigger*)data)->pBlock);
- taosFreeQitem(data);
- } else if (type == STREAM_INPUT__DATA_BLOCK || type == STREAM_INPUT__DATA_RETRIEVE) {
- taosArrayDestroyEx(((SStreamDataBlock*)data)->blocks, (FDelete)tDeleteSSDataBlock);
- taosFreeQitem(data);
- } else if (type == STREAM_INPUT__DATA_SUBMIT) {
- ASSERT(pTask->isDataScan);
- streamDataSubmitRefDec((SStreamDataSubmit*)data);
- taosFreeQitem(data);
- }
+ streamFreeQitem(data);
}
return pRes;
}
@@ -127,6 +143,7 @@ int32_t streamExec(SStreamTask* pTask, SMsgCb* pMsgCb) {
atomic_val_compare_exchange_8(&pTask->execStatus, TASK_EXEC_STATUS__IDLE, TASK_EXEC_STATUS__EXECUTING);
if (execStatus == TASK_EXEC_STATUS__IDLE) {
// first run
+ qDebug("stream exec, enter exec status");
pRes = streamExecForQall(pTask, pRes);
if (pRes == NULL) goto FAIL;
@@ -134,17 +151,19 @@ int32_t streamExec(SStreamTask* pTask, SMsgCb* pMsgCb) {
atomic_store_8(&pTask->execStatus, TASK_EXEC_STATUS__CLOSING);
// second run, make sure inputQ and qall are cleared
+ qDebug("stream exec, enter closing status");
pRes = streamExecForQall(pTask, pRes);
if (pRes == NULL) goto FAIL;
- taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock);
+ taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes);
atomic_store_8(&pTask->execStatus, TASK_EXEC_STATUS__IDLE);
+ qDebug("stream exec, return result");
return 0;
} else if (execStatus == TASK_EXEC_STATUS__CLOSING) {
continue;
} else if (execStatus == TASK_EXEC_STATUS__EXECUTING) {
ASSERT(taosArrayGetSize(pRes) == 0);
- taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock);
+ taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes);
return 0;
} else {
ASSERT(0);
diff --git a/source/libs/stream/src/streamUpdate.c b/source/libs/stream/src/streamUpdate.c
index 3d64cec8d831d70fb1a3f858c844fb264943f926..d0fb9c22e19527ee9352245596663877a6ba29c7 100644
--- a/source/libs/stream/src/streamUpdate.c
+++ b/source/libs/stream/src/streamUpdate.c
@@ -17,7 +17,7 @@
#include "ttime.h"
#define DEFAULT_FALSE_POSITIVE 0.01
-#define DEFAULT_BUCKET_SIZE 1024
+#define DEFAULT_BUCKET_SIZE 131072
#define ROWS_PER_MILLISECOND 1
#define MAX_NUM_SCALABLE_BF 100000
#define MIN_NUM_SCALABLE_BF 10
diff --git a/source/libs/sync/inc/syncRaftEntry.h b/source/libs/sync/inc/syncRaftEntry.h
index 82d5c0a6ead08ed673809335a90ae2d2406062ba..fdfabf12a3820d332b2404592a2f104a90fb76b6 100644
--- a/source/libs/sync/inc/syncRaftEntry.h
+++ b/source/libs/sync/inc/syncRaftEntry.h
@@ -26,6 +26,7 @@ extern "C" {
#include "syncInt.h"
#include "syncMessage.h"
#include "taosdef.h"
+#include "tskiplist.h"
typedef struct SSyncRaftEntry {
uint32_t bytes;
@@ -58,29 +59,52 @@ void syncEntryLog(const SSyncRaftEntry* pObj);
void syncEntryLog2(char* s, const SSyncRaftEntry* pObj);
//-----------------------------------
-typedef struct SRaftEntryCache {
+typedef struct SRaftEntryHashCache {
SHashObj* pEntryHash;
int32_t maxCount;
int32_t currentCount;
TdThreadMutex mutex;
SSyncNode* pSyncNode;
+} SRaftEntryHashCache;
+
+SRaftEntryHashCache* raftCacheCreate(SSyncNode* pSyncNode, int32_t maxCount);
+void raftCacheDestroy(SRaftEntryHashCache* pCache);
+int32_t raftCachePutEntry(struct SRaftEntryHashCache* pCache, SSyncRaftEntry* pEntry);
+int32_t raftCacheGetEntry(struct SRaftEntryHashCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry);
+int32_t raftCacheGetEntryP(struct SRaftEntryHashCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry);
+int32_t raftCacheDelEntry(struct SRaftEntryHashCache* pCache, SyncIndex index);
+int32_t raftCacheGetAndDel(struct SRaftEntryHashCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry);
+int32_t raftCacheClear(struct SRaftEntryHashCache* pCache);
+
+cJSON* raftCache2Json(SRaftEntryHashCache* pObj);
+char* raftCache2Str(SRaftEntryHashCache* pObj);
+void raftCachePrint(SRaftEntryHashCache* pObj);
+void raftCachePrint2(char* s, SRaftEntryHashCache* pObj);
+void raftCacheLog(SRaftEntryHashCache* pObj);
+void raftCacheLog2(char* s, SRaftEntryHashCache* pObj);
+
+//-----------------------------------
+typedef struct SRaftEntryCache {
+ SSkipList* pSkipList;
+ int32_t maxCount;
+ int32_t currentCount;
+ TdThreadMutex mutex;
+ SSyncNode* pSyncNode;
} SRaftEntryCache;
-SRaftEntryCache* raftCacheCreate(SSyncNode* pSyncNode, int32_t maxCount);
-void raftCacheDestroy(SRaftEntryCache* pCache);
-int32_t raftCachePutEntry(struct SRaftEntryCache* pCache, SSyncRaftEntry* pEntry);
-int32_t raftCacheGetEntry(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry);
-int32_t raftCacheGetEntryP(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry);
-int32_t raftCacheDelEntry(struct SRaftEntryCache* pCache, SyncIndex index);
-int32_t raftCacheGetAndDel(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry);
-int32_t raftCacheClear(struct SRaftEntryCache* pCache);
+SRaftEntryCache* raftEntryCacheCreate(SSyncNode* pSyncNode, int32_t maxCount);
+void raftEntryCacheDestroy(SRaftEntryCache* pCache);
+int32_t raftEntryCachePutEntry(struct SRaftEntryCache* pCache, SSyncRaftEntry* pEntry);
+int32_t raftEntryCacheGetEntry(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry);
+int32_t raftEntryCacheGetEntryP(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry);
+int32_t raftEntryCacheClear(struct SRaftEntryCache* pCache, int32_t count);
-cJSON* raftCache2Json(SRaftEntryCache* pObj);
-char* raftCache2Str(SRaftEntryCache* pObj);
-void raftCachePrint(SRaftEntryCache* pObj);
-void raftCachePrint2(char* s, SRaftEntryCache* pObj);
-void raftCacheLog(SRaftEntryCache* pObj);
-void raftCacheLog2(char* s, SRaftEntryCache* pObj);
+cJSON* raftEntryCache2Json(SRaftEntryCache* pObj);
+char* raftEntryCache2Str(SRaftEntryCache* pObj);
+void raftEntryCachePrint(SRaftEntryCache* pObj);
+void raftEntryCachePrint2(char* s, SRaftEntryCache* pObj);
+void raftEntryCacheLog(SRaftEntryCache* pObj);
+void raftEntryCacheLog2(char* s, SRaftEntryCache* pObj);
#ifdef __cplusplus
}
diff --git a/source/libs/sync/src/syncIO.c b/source/libs/sync/src/syncIO.c
index 663745a7d76e7ece6bf9cf9619bbd504ee5630a8..d9f11ba80f925ad2b73e443169968a54d10209f3 100644
--- a/source/libs/sync/src/syncIO.c
+++ b/source/libs/sync/src/syncIO.c
@@ -242,13 +242,13 @@ static int32_t syncIOStopInternal(SSyncIO *io) {
}
static void *syncIOConsumerFunc(void *param) {
- SSyncIO * io = param;
- STaosQall *qall;
- SRpcMsg * pRpcMsg, rpcMsg;
- qall = taosAllocateQall();
+ SSyncIO *io = param;
+ STaosQall *qall = taosAllocateQall();
+ SRpcMsg *pRpcMsg, rpcMsg;
+ SQueueInfo qinfo = {0};
while (1) {
- int numOfMsgs = taosReadAllQitemsFromQset(io->pQset, qall, NULL, NULL);
+ int numOfMsgs = taosReadAllQitemsFromQset(io->pQset, qall, &qinfo);
sTrace("syncIOConsumerFunc %d msgs are received", numOfMsgs);
if (numOfMsgs <= 0) {
break;
@@ -369,6 +369,8 @@ static void *syncIOConsumerFunc(void *param) {
taosFreeQitem(pRpcMsg);
}
+
+ taosUpdateItemSize(qinfo.queue, numOfMsgs);
}
taosFreeQall(qall);
diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c
index abc0f53611663a509bf82097e0d627da0c70be10..b7e6c1e142adbc0929eaf18f3686bbf0ceb08278 100644
--- a/source/libs/sync/src/syncMain.c
+++ b/source/libs/sync/src/syncMain.c
@@ -293,7 +293,7 @@ int32_t syncLeaderTransferTo(int64_t rid, SNodeInfo newLeader) {
int32_t syncNodeLeaderTransfer(SSyncNode* pSyncNode) {
if (pSyncNode->peersNum == 0) {
- sError("only one replica, cannot leader transfer");
+ sDebug("only one replica, cannot leader transfer");
terrno = TSDB_CODE_SYN_ONE_REPLICA;
return -1;
}
@@ -307,7 +307,7 @@ int32_t syncNodeLeaderTransferTo(SSyncNode* pSyncNode, SNodeInfo newLeader) {
int32_t ret = 0;
if (pSyncNode->replicaNum == 1) {
- sError("only one replica, cannot leader transfer");
+ sDebug("only one replica, cannot leader transfer");
terrno = TSDB_CODE_SYN_ONE_REPLICA;
return -1;
}
@@ -1055,19 +1055,12 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) {
}
// tools
- pSyncNode->pSyncRespMgr = syncRespMgrCreate(pSyncNode, 0);
+ pSyncNode->pSyncRespMgr = syncRespMgrCreate(pSyncNode, SYNC_RESP_TTL_MS);
ASSERT(pSyncNode->pSyncRespMgr != NULL);
// restore state
pSyncNode->restoreFinish = false;
- // pSyncNode->pSnapshot = NULL;
- // if (pSyncNode->pFsm->FpGetSnapshotInfo != NULL) {
- // pSyncNode->pSnapshot = taosMemoryMalloc(sizeof(SSnapshot));
- // pSyncNode->pFsm->FpGetSnapshotInfo(pSyncNode->pFsm, pSyncNode->pSnapshot);
- // }
- // tsem_init(&(pSyncNode->restoreSem), 0, 0);
-
// snapshot senders
for (int i = 0; i < TSDB_MAX_REPLICA; ++i) {
SSyncSnapshotSender* pSender = snapshotSenderCreate(pSyncNode, i);
diff --git a/source/libs/sync/src/syncRaftEntry.c b/source/libs/sync/src/syncRaftEntry.c
index 465584a40f0e867b52c0bb62aeb0d13cae551f67..89e67fab288b5a2a0594829b6a39b27bdf698c44 100644
--- a/source/libs/sync/src/syncRaftEntry.c
+++ b/source/libs/sync/src/syncRaftEntry.c
@@ -198,8 +198,8 @@ void syncEntryLog2(char* s, const SSyncRaftEntry* pObj) {
}
//-----------------------------------
-SRaftEntryCache* raftCacheCreate(SSyncNode* pSyncNode, int32_t maxCount) {
- SRaftEntryCache* pCache = taosMemoryMalloc(sizeof(SRaftEntryCache));
+SRaftEntryHashCache* raftCacheCreate(SSyncNode* pSyncNode, int32_t maxCount) {
+ SRaftEntryHashCache* pCache = taosMemoryMalloc(sizeof(SRaftEntryHashCache));
if (pCache == NULL) {
sError("vgId:%d raft cache create error", pSyncNode->vgId);
return NULL;
@@ -220,7 +220,7 @@ SRaftEntryCache* raftCacheCreate(SSyncNode* pSyncNode, int32_t maxCount) {
return pCache;
}
-void raftCacheDestroy(SRaftEntryCache* pCache) {
+void raftCacheDestroy(SRaftEntryHashCache* pCache) {
if (pCache != NULL) {
taosThreadMutexLock(&(pCache->mutex));
taosHashCleanup(pCache->pEntryHash);
@@ -233,7 +233,7 @@ void raftCacheDestroy(SRaftEntryCache* pCache) {
// success, return 1
// max count, return 0
// error, return -1
-int32_t raftCachePutEntry(struct SRaftEntryCache* pCache, SSyncRaftEntry* pEntry) {
+int32_t raftCachePutEntry(struct SRaftEntryHashCache* pCache, SSyncRaftEntry* pEntry) {
taosThreadMutexLock(&(pCache->mutex));
if (pCache->currentCount >= pCache->maxCount) {
@@ -259,7 +259,7 @@ int32_t raftCachePutEntry(struct SRaftEntryCache* pCache, SSyncRaftEntry* pEntry
// success, return 0
// error, return -1
// not exist, return -1, terrno = TSDB_CODE_WAL_LOG_NOT_EXIST
-int32_t raftCacheGetEntry(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry) {
+int32_t raftCacheGetEntry(struct SRaftEntryHashCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry) {
if (ppEntry == NULL) {
return -1;
}
@@ -292,7 +292,7 @@ int32_t raftCacheGetEntry(struct SRaftEntryCache* pCache, SyncIndex index, SSync
// success, return 0
// error, return -1
// not exist, return -1, terrno = TSDB_CODE_WAL_LOG_NOT_EXIST
-int32_t raftCacheGetEntryP(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry) {
+int32_t raftCacheGetEntryP(struct SRaftEntryHashCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry) {
if (ppEntry == NULL) {
return -1;
}
@@ -321,7 +321,7 @@ int32_t raftCacheGetEntryP(struct SRaftEntryCache* pCache, SyncIndex index, SSyn
return -1;
}
-int32_t raftCacheDelEntry(struct SRaftEntryCache* pCache, SyncIndex index) {
+int32_t raftCacheDelEntry(struct SRaftEntryHashCache* pCache, SyncIndex index) {
taosThreadMutexLock(&(pCache->mutex));
taosHashRemove(pCache->pEntryHash, &index, sizeof(index));
--(pCache->currentCount);
@@ -329,7 +329,7 @@ int32_t raftCacheDelEntry(struct SRaftEntryCache* pCache, SyncIndex index) {
return 0;
}
-int32_t raftCacheGetAndDel(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry) {
+int32_t raftCacheGetAndDel(struct SRaftEntryHashCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry) {
if (ppEntry == NULL) {
return -1;
}
@@ -362,7 +362,7 @@ int32_t raftCacheGetAndDel(struct SRaftEntryCache* pCache, SyncIndex index, SSyn
return -1;
}
-int32_t raftCacheClear(struct SRaftEntryCache* pCache) {
+int32_t raftCacheClear(struct SRaftEntryHashCache* pCache) {
taosThreadMutexLock(&(pCache->mutex));
taosHashClear(pCache->pEntryHash);
pCache->currentCount = 0;
@@ -371,7 +371,7 @@ int32_t raftCacheClear(struct SRaftEntryCache* pCache) {
}
//-----------------------------------
-cJSON* raftCache2Json(SRaftEntryCache* pCache) {
+cJSON* raftCache2Json(SRaftEntryHashCache* pCache) {
char u64buf[128] = {0};
cJSON* pRoot = cJSON_CreateObject();
@@ -402,41 +402,283 @@ cJSON* raftCache2Json(SRaftEntryCache* pCache) {
}
cJSON* pJson = cJSON_CreateObject();
- cJSON_AddItemToObject(pJson, "SRaftEntryCache", pRoot);
+ cJSON_AddItemToObject(pJson, "SRaftEntryHashCache", pRoot);
return pJson;
}
-char* raftCache2Str(SRaftEntryCache* pCache) {
+char* raftCache2Str(SRaftEntryHashCache* pCache) {
cJSON* pJson = raftCache2Json(pCache);
char* serialized = cJSON_Print(pJson);
cJSON_Delete(pJson);
return serialized;
}
-void raftCachePrint(SRaftEntryCache* pCache) {
+void raftCachePrint(SRaftEntryHashCache* pCache) {
char* serialized = raftCache2Str(pCache);
printf("raftCachePrint | len:%" PRIu64 " | %s \n", strlen(serialized), serialized);
fflush(NULL);
taosMemoryFree(serialized);
}
-void raftCachePrint2(char* s, SRaftEntryCache* pCache) {
+void raftCachePrint2(char* s, SRaftEntryHashCache* pCache) {
char* serialized = raftCache2Str(pCache);
printf("raftCachePrint2 | len:%" PRIu64 " | %s | %s \n", strlen(serialized), s, serialized);
fflush(NULL);
taosMemoryFree(serialized);
}
-void raftCacheLog(SRaftEntryCache* pCache) {
+void raftCacheLog(SRaftEntryHashCache* pCache) {
char* serialized = raftCache2Str(pCache);
sTrace("raftCacheLog | len:%" PRIu64 " | %s", strlen(serialized), serialized);
taosMemoryFree(serialized);
}
-void raftCacheLog2(char* s, SRaftEntryCache* pCache) {
+void raftCacheLog2(char* s, SRaftEntryHashCache* pCache) {
if (gRaftDetailLog) {
char* serialized = raftCache2Str(pCache);
sTraceLong("raftCacheLog2 | len:%" PRIu64 " | %s | %s", strlen(serialized), s, serialized);
taosMemoryFree(serialized);
}
+}
+
+//-----------------------------------
+static char* keyFn(const void* pData) {
+ SSyncRaftEntry* pEntry = (SSyncRaftEntry*)pData;
+ return (char*)(&(pEntry->index));
+}
+
+static int cmpFn(const void* p1, const void* p2) { return memcmp(p1, p2, sizeof(SyncIndex)); }
+
+SRaftEntryCache* raftEntryCacheCreate(SSyncNode* pSyncNode, int32_t maxCount) {
+ SRaftEntryCache* pCache = taosMemoryMalloc(sizeof(SRaftEntryCache));
+ if (pCache == NULL) {
+ sError("vgId:%d raft cache create error", pSyncNode->vgId);
+ return NULL;
+ }
+
+ pCache->pSkipList =
+ tSkipListCreate(MAX_SKIP_LIST_LEVEL, TSDB_DATA_TYPE_BINARY, sizeof(SyncIndex), cmpFn, SL_ALLOW_DUP_KEY, keyFn);
+ if (pCache->pSkipList == NULL) {
+ sError("vgId:%d raft cache create hash error", pSyncNode->vgId);
+ return NULL;
+ }
+
+ taosThreadMutexInit(&(pCache->mutex), NULL);
+ pCache->maxCount = maxCount;
+ pCache->currentCount = 0;
+ pCache->pSyncNode = pSyncNode;
+
+ return pCache;
+}
+
+void raftEntryCacheDestroy(SRaftEntryCache* pCache) {
+ if (pCache != NULL) {
+ taosThreadMutexLock(&(pCache->mutex));
+ tSkipListDestroy(pCache->pSkipList);
+ taosThreadMutexUnlock(&(pCache->mutex));
+ taosThreadMutexDestroy(&(pCache->mutex));
+ taosMemoryFree(pCache);
+ }
+}
+
+// success, return 1
+// max count, return 0
+// error, return -1
+int32_t raftEntryCachePutEntry(struct SRaftEntryCache* pCache, SSyncRaftEntry* pEntry) {
+ taosThreadMutexLock(&(pCache->mutex));
+
+ if (pCache->currentCount >= pCache->maxCount) {
+ taosThreadMutexUnlock(&(pCache->mutex));
+ return 0;
+ }
+
+ SSkipListNode* pSkipListNode = tSkipListPut(pCache->pSkipList, pEntry);
+ ASSERT(pSkipListNode != NULL);
+ ++(pCache->currentCount);
+
+ do {
+ char eventLog[128];
+ snprintf(eventLog, sizeof(eventLog), "raft cache add, type:%s,%d, type2:%s,%d, index:%" PRId64 ", bytes:%d",
+ TMSG_INFO(pEntry->msgType), pEntry->msgType, TMSG_INFO(pEntry->originalRpcType), pEntry->originalRpcType,
+ pEntry->index, pEntry->bytes);
+ syncNodeEventLog(pCache->pSyncNode, eventLog);
+ } while (0);
+
+ taosThreadMutexUnlock(&(pCache->mutex));
+ return 1;
+}
+
+// find one, return 1
+// not found, return 0
+// error, return -1
+int32_t raftEntryCacheGetEntry(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry) {
+ ASSERT(ppEntry != NULL);
+ SSyncRaftEntry* pEntry = NULL;
+ int32_t code = raftEntryCacheGetEntryP(pCache, index, &pEntry);
+ if (code == 1) {
+ *ppEntry = taosMemoryMalloc(pEntry->bytes);
+ memcpy(*ppEntry, pEntry, pEntry->bytes);
+ } else {
+ *ppEntry = NULL;
+ }
+ return code;
+}
+
+// find one, return 1
+// not found, return 0
+// error, return -1
+int32_t raftEntryCacheGetEntryP(struct SRaftEntryCache* pCache, SyncIndex index, SSyncRaftEntry** ppEntry) {
+ taosThreadMutexLock(&(pCache->mutex));
+
+ SyncIndex index2 = index;
+ int32_t code = 0;
+
+ SArray* entryPArray = tSkipListGet(pCache->pSkipList, (char*)(&index2));
+ int32_t arraySize = taosArrayGetSize(entryPArray);
+ if (arraySize == 1) {
+ SSkipListNode** ppNode = (SSkipListNode**)taosArrayGet(entryPArray, 0);
+ ASSERT(*ppNode != NULL);
+ *ppEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(*ppNode);
+ code = 1;
+
+ } else if (arraySize == 0) {
+ code = 0;
+
+ } else {
+ ASSERT(0);
+
+ code = -1;
+ }
+ taosArrayDestroy(entryPArray);
+
+ taosThreadMutexUnlock(&(pCache->mutex));
+ return code;
+}
+
+// count = -1, clear all
+// count >= 0, clear count
+// return -1, error
+// return delete count
+int32_t raftEntryCacheClear(struct SRaftEntryCache* pCache, int32_t count) {
+ taosThreadMutexLock(&(pCache->mutex));
+ int32_t returnCnt = 0;
+
+ if (count == -1) {
+ // clear all
+ SSkipListIterator* pIter = tSkipListCreateIter(pCache->pSkipList);
+ while (tSkipListIterNext(pIter)) {
+ SSkipListNode* pNode = tSkipListIterGet(pIter);
+ ASSERT(pNode != NULL);
+ SSyncRaftEntry* pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(pNode);
+ syncEntryDestory(pEntry);
+ ++returnCnt;
+ }
+ tSkipListDestroyIter(pIter);
+
+ tSkipListDestroy(pCache->pSkipList);
+ pCache->pSkipList =
+ tSkipListCreate(MAX_SKIP_LIST_LEVEL, TSDB_DATA_TYPE_BINARY, sizeof(SyncIndex), cmpFn, SL_ALLOW_DUP_KEY, keyFn);
+ ASSERT(pCache->pSkipList != NULL);
+
+ } else {
+ // clear count
+ int i = 0;
+ SSkipListIterator* pIter = tSkipListCreateIter(pCache->pSkipList);
+ SArray* delNodeArray = taosArrayInit(0, sizeof(SSkipListNode*));
+
+ // free entry
+ while (tSkipListIterNext(pIter)) {
+ SSkipListNode* pNode = tSkipListIterGet(pIter);
+ ASSERT(pNode != NULL);
+ if (i++ >= count) {
+ break;
+ }
+
+ // sDebug("push pNode:%p", pNode);
+ taosArrayPush(delNodeArray, &pNode);
+ ++returnCnt;
+ SSyncRaftEntry* pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(pNode);
+ syncEntryDestory(pEntry);
+ }
+ tSkipListDestroyIter(pIter);
+
+ // delete skiplist node
+ int32_t arraySize = taosArrayGetSize(delNodeArray);
+ for (int32_t i = 0; i < arraySize; ++i) {
+ SSkipListNode** ppNode = taosArrayGet(delNodeArray, i);
+ // sDebug("get pNode:%p", *ppNode);
+ tSkipListRemoveNode(pCache->pSkipList, *ppNode);
+ }
+ taosArrayDestroy(delNodeArray);
+ }
+
+ pCache->currentCount -= returnCnt;
+ taosThreadMutexUnlock(&(pCache->mutex));
+ return returnCnt;
+}
+
+cJSON* raftEntryCache2Json(SRaftEntryCache* pCache) {
+ char u64buf[128] = {0};
+ cJSON* pRoot = cJSON_CreateObject();
+
+ if (pCache != NULL) {
+ taosThreadMutexLock(&(pCache->mutex));
+
+ snprintf(u64buf, sizeof(u64buf), "%p", pCache->pSyncNode);
+ cJSON_AddStringToObject(pRoot, "pSyncNode", u64buf);
+ cJSON_AddNumberToObject(pRoot, "currentCount", pCache->currentCount);
+ cJSON_AddNumberToObject(pRoot, "maxCount", pCache->maxCount);
+ cJSON* pEntries = cJSON_CreateArray();
+ cJSON_AddItemToObject(pRoot, "entries", pEntries);
+
+ SSkipListIterator* pIter = tSkipListCreateIter(pCache->pSkipList);
+ while (tSkipListIterNext(pIter)) {
+ SSkipListNode* pNode = tSkipListIterGet(pIter);
+ ASSERT(pNode != NULL);
+ SSyncRaftEntry* pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(pNode);
+ cJSON_AddItemToArray(pEntries, syncEntry2Json(pEntry));
+ }
+ tSkipListDestroyIter(pIter);
+
+ taosThreadMutexUnlock(&(pCache->mutex));
+ }
+
+ cJSON* pJson = cJSON_CreateObject();
+ cJSON_AddItemToObject(pJson, "SRaftEntryCache", pRoot);
+ return pJson;
+}
+
+char* raftEntryCache2Str(SRaftEntryCache* pObj) {
+ cJSON* pJson = raftEntryCache2Json(pObj);
+ char* serialized = cJSON_Print(pJson);
+ cJSON_Delete(pJson);
+ return serialized;
+}
+
+void raftEntryCachePrint(SRaftEntryCache* pObj) {
+ char* serialized = raftEntryCache2Str(pObj);
+ printf("raftEntryCachePrint | len:%" PRIu64 " | %s \n", strlen(serialized), serialized);
+ fflush(NULL);
+ taosMemoryFree(serialized);
+}
+
+void raftEntryCachePrint2(char* s, SRaftEntryCache* pObj) {
+ char* serialized = raftEntryCache2Str(pObj);
+ printf("raftEntryCachePrint2 | len:%" PRIu64 " | %s | %s \n", strlen(serialized), s, serialized);
+ fflush(NULL);
+ taosMemoryFree(serialized);
+}
+
+void raftEntryCacheLog(SRaftEntryCache* pObj) {
+ char* serialized = raftEntryCache2Str(pObj);
+ sTrace("raftEntryCacheLog | len:%" PRIu64 " | %s", strlen(serialized), serialized);
+ taosMemoryFree(serialized);
+}
+
+void raftEntryCacheLog2(char* s, SRaftEntryCache* pObj) {
+ if (gRaftDetailLog) {
+ char* serialized = raftEntryCache2Str(pObj);
+ sTraceLong("raftEntryCacheLog2 | len:%" PRIu64 " | %s | %s", strlen(serialized), s, serialized);
+ taosMemoryFree(serialized);
+ }
}
\ No newline at end of file
diff --git a/source/libs/sync/src/syncRespMgr.c b/source/libs/sync/src/syncRespMgr.c
index eaeadd39910bc8a8e0e68f0096bcb88785e6ed0c..97e5816038a4213a222b336cdb687560290be4be 100644
--- a/source/libs/sync/src/syncRespMgr.c
+++ b/source/libs/sync/src/syncRespMgr.c
@@ -122,54 +122,45 @@ void syncRespCleanByTTL(SSyncRespMgr *pObj, int64_t ttl) {
int cnt = 0;
SSyncNode *pSyncNode = pObj->data;
- SArray *delIndexArray = taosArrayInit(0, sizeof(SyncIndex));
+ SArray *delIndexArray = taosArrayInit(0, sizeof(uint64_t));
ASSERT(delIndexArray != NULL);
while (pStub) {
- size_t len;
- void * key = taosHashGetKey(pStub, &len);
- SyncIndex *pIndex = (SyncIndex *)key;
+ size_t len;
+ void * key = taosHashGetKey(pStub, &len);
+ uint64_t *pSeqNum = (uint64_t *)key;
int64_t nowMS = taosGetTimestampMs();
if (nowMS - pStub->createTime > ttl) {
- taosArrayPush(delIndexArray, pIndex);
+ taosArrayPush(delIndexArray, pSeqNum);
cnt++;
- SSyncRaftEntry *pEntry = NULL;
- int32_t code = 0;
- if (pSyncNode->pLogStore != NULL) {
- code = pSyncNode->pLogStore->syncLogGetEntry(pSyncNode->pLogStore, *pIndex, &pEntry);
- if (code == 0 && pEntry != NULL) {
- SFsmCbMeta cbMeta = {0};
- cbMeta.index = pEntry->index;
- cbMeta.lastConfigIndex = syncNodeGetSnapshotConfigIndex(pSyncNode, cbMeta.index);
- cbMeta.isWeak = pEntry->isWeak;
- cbMeta.code = TSDB_CODE_SYN_TIMEOUT;
- cbMeta.state = pSyncNode->state;
- cbMeta.seqNum = pEntry->seqNum;
- cbMeta.term = pEntry->term;
- cbMeta.currentTerm = pSyncNode->pRaftStore->currentTerm;
- cbMeta.flag = 0;
-
- SRpcMsg rpcMsg = pStub->rpcMsg;
- rpcMsg.pCont = rpcMallocCont(pEntry->dataLen);
- memcpy(rpcMsg.pCont, pEntry->data, pEntry->dataLen);
- pSyncNode->pFsm->FpCommitCb(pSyncNode->pFsm, &rpcMsg, cbMeta);
-
- syncEntryDestory(pEntry);
- }
- }
+ SFsmCbMeta cbMeta = {0};
+ cbMeta.index = SYNC_INDEX_INVALID;
+ cbMeta.lastConfigIndex = SYNC_INDEX_INVALID;
+ cbMeta.isWeak = false;
+ cbMeta.code = TSDB_CODE_SYN_TIMEOUT;
+ cbMeta.state = pSyncNode->state;
+ cbMeta.seqNum = *pSeqNum;
+ cbMeta.term = SYNC_TERM_INVALID;
+ cbMeta.currentTerm = pSyncNode->pRaftStore->currentTerm;
+ cbMeta.flag = 0;
+
+ pStub->rpcMsg.pCont = NULL;
+ pStub->rpcMsg.contLen = 0;
+ pSyncNode->pFsm->FpCommitCb(pSyncNode->pFsm, &(pStub->rpcMsg), cbMeta);
}
pStub = (SRespStub *)taosHashIterate(pObj->pRespHash, pStub);
}
int32_t arraySize = taosArrayGetSize(delIndexArray);
- sDebug("vgId:%d, resp clean by ttl, cnt:%d, array-size:%d", pSyncNode->vgId, cnt, arraySize);
+ sDebug("vgId:%d, resp mgr clean by ttl, cnt:%d, array-size:%d", pSyncNode->vgId, cnt, arraySize);
for (int32_t i = 0; i < arraySize; ++i) {
- SyncIndex *pIndex = taosArrayGet(delIndexArray, i);
- taosHashRemove(pObj->pRespHash, pIndex, sizeof(SyncIndex));
+ uint64_t *pSeqNum = taosArrayGet(delIndexArray, i);
+ taosHashRemove(pObj->pRespHash, pSeqNum, sizeof(uint64_t));
+ sDebug("vgId:%d, resp mgr clean by ttl, seq:%d", pSyncNode->vgId, *pSeqNum);
}
taosArrayDestroy(delIndexArray);
}
diff --git a/source/libs/sync/src/syncTimeout.c b/source/libs/sync/src/syncTimeout.c
index 52181a3da8c0d9a21e9ec8a0eb3acdc6e7a1ca82..ad5f82900c855db2d74d2a2e825a9a7f29dcdc50 100644
--- a/source/libs/sync/src/syncTimeout.c
+++ b/source/libs/sync/src/syncTimeout.c
@@ -16,9 +16,14 @@
#include "syncTimeout.h"
#include "syncElection.h"
#include "syncReplication.h"
+#include "syncRespMgr.h"
int32_t syncNodeTimerRoutine(SSyncNode* ths) {
syncNodeEventLog(ths, "timer routines ... ");
+
+ if (ths->vgId != 1) {
+ syncRespClean(ths->pSyncRespMgr);
+ }
return 0;
}
diff --git a/source/libs/sync/test/CMakeLists.txt b/source/libs/sync/test/CMakeLists.txt
index e1f3a2b2fc18d1d0481576ccbb3363cf95c5358a..e787080795a36f77aca41d520ce7e232e9555358 100644
--- a/source/libs/sync/test/CMakeLists.txt
+++ b/source/libs/sync/test/CMakeLists.txt
@@ -18,6 +18,7 @@ add_executable(syncIndexMgrTest "")
add_executable(syncLogStoreTest "")
add_executable(syncEntryTest "")
add_executable(syncEntryCacheTest "")
+add_executable(syncHashCacheTest "")
add_executable(syncRequestVoteTest "")
add_executable(syncRequestVoteReplyTest "")
add_executable(syncAppendEntriesTest "")
@@ -137,6 +138,10 @@ target_sources(syncEntryCacheTest
PRIVATE
"syncEntryCacheTest.cpp"
)
+target_sources(syncHashCacheTest
+ PRIVATE
+ "syncHashCacheTest.cpp"
+)
target_sources(syncRequestVoteTest
PRIVATE
"syncRequestVoteTest.cpp"
@@ -387,6 +392,11 @@ target_include_directories(syncEntryCacheTest
"${TD_SOURCE_DIR}/include/libs/sync"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
+target_include_directories(syncHashCacheTest
+ PUBLIC
+ "${TD_SOURCE_DIR}/include/libs/sync"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
+)
target_include_directories(syncRequestVoteTest
PUBLIC
"${TD_SOURCE_DIR}/include/libs/sync"
@@ -654,6 +664,10 @@ target_link_libraries(syncEntryCacheTest
sync
gtest_main
)
+target_link_libraries(syncHashCacheTest
+ sync
+ gtest_main
+)
target_link_libraries(syncRequestVoteTest
sync
gtest_main
diff --git a/source/libs/sync/test/syncEntryCacheTest.cpp b/source/libs/sync/test/syncEntryCacheTest.cpp
index 6250181b25d5bb88319532cb53fac5843aac361a..66b93563e752f16b1af04dcc0272c6d5a7731cf1 100644
--- a/source/libs/sync/test/syncEntryCacheTest.cpp
+++ b/source/libs/sync/test/syncEntryCacheTest.cpp
@@ -43,222 +43,82 @@ SRaftEntryCache* createCache(int maxCount) {
SSyncNode* pSyncNode = createFakeNode();
ASSERT(pSyncNode != NULL);
- SRaftEntryCache* pCache = raftCacheCreate(pSyncNode, maxCount);
+ SRaftEntryCache* pCache = raftEntryCacheCreate(pSyncNode, maxCount);
ASSERT(pCache != NULL);
return pCache;
}
void test1() {
- int32_t code = 0;
+ int32_t code = 0;
SRaftEntryCache* pCache = createCache(5);
- for (int i = 0; i < 5; ++i) {
+ for (int i = 0; i < 10; ++i) {
SSyncRaftEntry* pEntry = createEntry(i);
- code = raftCachePutEntry(pCache, pEntry);
- ASSERT(code == 1);
- syncEntryDestory(pEntry);
+ code = raftEntryCachePutEntry(pCache, pEntry);
+ sTrace("put entry code:%d, pEntry:%p", code, pEntry);
}
- raftCacheLog2((char*)"==test1 write 5 entries==", pCache);
+ raftEntryCacheLog2((char*)"==test1 write 5 entries==", pCache);
- SyncIndex index;
- index = 1;
- code = raftCacheDelEntry(pCache, index);
- ASSERT(code == 0);
- index = 3;
- code = raftCacheDelEntry(pCache, index);
- ASSERT(code == 0);
- raftCacheLog2((char*)"==test1 delete 1,3==", pCache);
+ raftEntryCacheClear(pCache, 3);
+ raftEntryCacheLog2((char*)"==test1 evict 3 entries==", pCache);
- code = raftCacheClear(pCache);
- ASSERT(code == 0);
- raftCacheLog2((char*)"==clear all==", pCache);
+ raftEntryCacheClear(pCache, -1);
+ raftEntryCacheLog2((char*)"==test1 evict -1(all) entries==", pCache);
}
void test2() {
- int32_t code = 0;
+ int32_t code = 0;
SRaftEntryCache* pCache = createCache(5);
- for (int i = 0; i < 5; ++i) {
+ for (int i = 0; i < 10; ++i) {
SSyncRaftEntry* pEntry = createEntry(i);
- code = raftCachePutEntry(pCache, pEntry);
- ASSERT(code == 1);
- syncEntryDestory(pEntry);
+ code = raftEntryCachePutEntry(pCache, pEntry);
+ sTrace("put entry code:%d, pEntry:%p", code, pEntry);
}
- raftCacheLog2((char*)"==test2 write 5 entries==", pCache);
+ raftEntryCacheLog2((char*)"==test1 write 5 entries==", pCache);
- SyncIndex index;
- index = 1;
- SSyncRaftEntry* pEntry;
- code = raftCacheGetEntry(pCache, index, &pEntry);
- ASSERT(code == 0);
- syncEntryDestory(pEntry);
- syncEntryLog2((char*)"==test2 get entry 1==", pEntry);
+ SyncIndex index = 2;
+ SSyncRaftEntry* pEntry = NULL;
- index = 2;
- code = raftCacheGetEntryP(pCache, index, &pEntry);
- ASSERT(code == 0);
+ code = raftEntryCacheGetEntryP(pCache, index, &pEntry);
+ ASSERT(code == 1 && index == pEntry->index);
+ sTrace("get entry:%p for %ld", pEntry, index);
syncEntryLog2((char*)"==test2 get entry pointer 2==", pEntry);
+ code = raftEntryCacheGetEntry(pCache, index, &pEntry);
+ ASSERT(code == 1 && index == pEntry->index);
+ sTrace("get entry:%p for %ld", pEntry, index);
+ syncEntryLog2((char*)"==test2 get entry 2==", pEntry);
+ syncEntryDestory(pEntry);
+
// not found
index = 8;
- code = raftCacheGetEntry(pCache, index, &pEntry);
- ASSERT(code == -1 && terrno == TSDB_CODE_WAL_LOG_NOT_EXIST);
+ code = raftEntryCacheGetEntry(pCache, index, &pEntry);
+ ASSERT(code == 0);
+ sTrace("get entry:%p for %ld", pEntry, index);
sTrace("==test2 get entry 8 not found==");
// not found
index = 9;
- code = raftCacheGetEntryP(pCache, index, &pEntry);
- ASSERT(code == -1 && terrno == TSDB_CODE_WAL_LOG_NOT_EXIST);
- sTrace("==test2 get entry pointer 9 not found==");
+ code = raftEntryCacheGetEntry(pCache, index, &pEntry);
+ ASSERT(code == 0);
+ sTrace("get entry:%p for %ld", pEntry, index);
+ sTrace("==test2 get entry 9 not found==");
}
void test3() {
- int32_t code = 0;
- SRaftEntryCache* pCache = createCache(5);
- for (int i = 0; i < 5; ++i) {
- SSyncRaftEntry* pEntry = createEntry(i);
- code = raftCachePutEntry(pCache, pEntry);
- ASSERT(code == 1);
- syncEntryDestory(pEntry);
- }
- for (int i = 6; i < 10; ++i) {
- SSyncRaftEntry* pEntry = createEntry(i);
- code = raftCachePutEntry(pCache, pEntry);
- ASSERT(code == 0);
- syncEntryDestory(pEntry);
- }
- raftCacheLog2((char*)"==test3 write 10 entries, max count is 5==", pCache);
-}
-
-void test4() {
- int32_t code = 0;
- SRaftEntryCache* pCache = createCache(5);
- for (int i = 0; i < 5; ++i) {
+ int32_t code = 0;
+ SRaftEntryCache* pCache = createCache(20);
+ for (int i = 0; i <= 4; ++i) {
SSyncRaftEntry* pEntry = createEntry(i);
- code = raftCachePutEntry(pCache, pEntry);
- ASSERT(code == 1);
- syncEntryDestory(pEntry);
- }
- raftCacheLog2((char*)"==test4 write 5 entries==", pCache);
-
- SyncIndex index;
- index = 3;
- SSyncRaftEntry* pEntry;
- code = raftCacheGetAndDel(pCache, index, &pEntry);
- ASSERT(code == 0);
- syncEntryLog2((char*)"==test4 get-and-del entry 3==", pEntry);
- raftCacheLog2((char*)"==test4 after get-and-del entry 3==", pCache);
-}
-
-static char* keyFn(const void* pData) {
- SSyncRaftEntry* pEntry = (SSyncRaftEntry*)pData;
- return (char*)(&(pEntry->index));
-}
-
-static int cmpFn(const void* p1, const void* p2) { return memcmp(p1, p2, sizeof(SyncIndex)); }
-
-void printSkipList(SSkipList* pSkipList) {
- ASSERT(pSkipList != NULL);
-
- SSkipListIterator* pIter = tSkipListCreateIter(pSkipList);
- while (tSkipListIterNext(pIter)) {
- SSkipListNode* pNode = tSkipListIterGet(pIter);
- ASSERT(pNode != NULL);
- SSyncRaftEntry* pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(pNode);
- syncEntryPrint2((char*)"", pEntry);
- }
-}
-
-void delSkipListFirst(SSkipList* pSkipList, int n) {
- ASSERT(pSkipList != NULL);
-
- sTrace("delete first %d -------------", n);
- SSkipListIterator* pIter = tSkipListCreateIter(pSkipList);
- for (int i = 0; i < n; ++i) {
- tSkipListIterNext(pIter);
- SSkipListNode* pNode = tSkipListIterGet(pIter);
- tSkipListRemoveNode(pSkipList, pNode);
+ code = raftEntryCachePutEntry(pCache, pEntry);
+ sTrace("put entry code:%d, pEntry:%p", code, pEntry);
}
-}
-
-
-SSyncRaftEntry* getLogEntry2(SSkipList* pSkipList, SyncIndex index) {
- SyncIndex index2 = index;
- SSyncRaftEntry *pEntry = NULL;
- int arraySize = 0;
-
- SArray* entryPArray = tSkipListGet(pSkipList, (char*)(&index2));
- arraySize = taosArrayGetSize(entryPArray);
- if (arraySize > 0) {
- SSkipListNode** ppNode = (SSkipListNode**)taosArrayGet(entryPArray, 0);
- ASSERT(*ppNode != NULL);
- pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(*ppNode);
- }
- taosArrayDestroy(entryPArray);
-
- sTrace("get index2: %ld, arraySize:%d -------------", index, arraySize);
- syncEntryLog2((char*)"getLogEntry2", pEntry);
- return pEntry;
-}
-
-
-SSyncRaftEntry* getLogEntry(SSkipList* pSkipList, SyncIndex index) {
- sTrace("get index: %ld -------------", index);
- SyncIndex index2 = index;
- SSyncRaftEntry *pEntry = NULL;
- SSkipListIterator* pIter = tSkipListCreateIterFromVal(pSkipList, (const char *)&index2, TSDB_DATA_TYPE_BINARY, TSDB_ORDER_ASC);
- if (tSkipListIterNext(pIter)) {
- SSkipListNode* pNode = tSkipListIterGet(pIter);
- ASSERT(pNode != NULL);
- pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(pNode);
- }
-
- syncEntryLog2((char*)"getLogEntry", pEntry);
- return pEntry;
-}
-
-void test5() {
- SSkipList* pSkipList =
- tSkipListCreate(MAX_SKIP_LIST_LEVEL, TSDB_DATA_TYPE_BINARY, sizeof(SyncIndex), cmpFn, SL_ALLOW_DUP_KEY, keyFn);
- ASSERT(pSkipList != NULL);
-
- sTrace("insert 9 - 5");
for (int i = 9; i >= 5; --i) {
SSyncRaftEntry* pEntry = createEntry(i);
- SSkipListNode* pSkipListNode = tSkipListPut(pSkipList, pEntry);
+ code = raftEntryCachePutEntry(pCache, pEntry);
+ sTrace("put entry code:%d, pEntry:%p", code, pEntry);
}
-
- sTrace("insert 0 - 4");
- for (int i = 0; i <= 4; ++i) {
- SSyncRaftEntry* pEntry = createEntry(i);
- SSkipListNode* pSkipListNode = tSkipListPut(pSkipList, pEntry);
- }
-
- sTrace("insert 7 7 7 7 7");
- for (int i = 0; i <= 4; ++i) {
- SSyncRaftEntry* pEntry = createEntry(7);
- SSkipListNode* pSkipListNode = tSkipListPut(pSkipList, pEntry);
- }
-
- sTrace("print: -------------");
- printSkipList(pSkipList);
-
- delSkipListFirst(pSkipList, 3);
-
- sTrace("print: -------------");
- printSkipList(pSkipList);
-
- getLogEntry(pSkipList, 2);
- getLogEntry(pSkipList, 5);
- getLogEntry(pSkipList, 7);
- getLogEntry(pSkipList, 7);
-
- getLogEntry2(pSkipList, 2);
- getLogEntry2(pSkipList, 5);
- getLogEntry2(pSkipList, 7);
- getLogEntry2(pSkipList, 7);
-
-
- tSkipListDestroy(pSkipList);
+ raftEntryCacheLog2((char*)"==test3 write 10 entries==", pCache);
}
int main(int argc, char** argv) {
@@ -266,14 +126,9 @@ int main(int argc, char** argv) {
tsAsyncLog = 0;
sDebugFlag = DEBUG_TRACE + DEBUG_SCREEN + DEBUG_FILE + DEBUG_DEBUG;
- /*
- test1();
- test2();
- test3();
- test4();
- */
-
- test5();
+ test1();
+ test2();
+ test3();
return 0;
}
diff --git a/source/libs/sync/test/syncHashCacheTest.cpp b/source/libs/sync/test/syncHashCacheTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f155bd834fb1ac860c72372b1a99ad7a3f0b1474
--- /dev/null
+++ b/source/libs/sync/test/syncHashCacheTest.cpp
@@ -0,0 +1,277 @@
+#include
+#include "syncEnv.h"
+#include "syncIO.h"
+#include "syncInt.h"
+#include "syncRaftLog.h"
+#include "syncRaftStore.h"
+#include "syncUtil.h"
+#include "tskiplist.h"
+
+void logTest() {
+ sTrace("--- sync log test: trace");
+ sDebug("--- sync log test: debug");
+ sInfo("--- sync log test: info");
+ sWarn("--- sync log test: warn");
+ sError("--- sync log test: error");
+ sFatal("--- sync log test: fatal");
+}
+
+SSyncRaftEntry* createEntry(int i) {
+ int32_t dataLen = 20;
+ SSyncRaftEntry* pEntry = syncEntryBuild(dataLen);
+ assert(pEntry != NULL);
+ pEntry->msgType = 88;
+ pEntry->originalRpcType = 99;
+ pEntry->seqNum = 3;
+ pEntry->isWeak = true;
+ pEntry->term = 100 + i;
+ pEntry->index = i;
+ snprintf(pEntry->data, dataLen, "value%d", i);
+
+ return pEntry;
+}
+
+SSyncNode* createFakeNode() {
+ SSyncNode* pSyncNode = (SSyncNode*)taosMemoryMalloc(sizeof(SSyncNode));
+ ASSERT(pSyncNode != NULL);
+ memset(pSyncNode, 0, sizeof(SSyncNode));
+
+ return pSyncNode;
+}
+
+SRaftEntryHashCache* createCache(int maxCount) {
+ SSyncNode* pSyncNode = createFakeNode();
+ ASSERT(pSyncNode != NULL);
+
+ SRaftEntryHashCache* pCache = raftCacheCreate(pSyncNode, maxCount);
+ ASSERT(pCache != NULL);
+
+ return pCache;
+}
+
+void test1() {
+ int32_t code = 0;
+ SRaftEntryHashCache* pCache = createCache(5);
+ for (int i = 0; i < 5; ++i) {
+ SSyncRaftEntry* pEntry = createEntry(i);
+ code = raftCachePutEntry(pCache, pEntry);
+ ASSERT(code == 1);
+ syncEntryDestory(pEntry);
+ }
+ raftCacheLog2((char*)"==test1 write 5 entries==", pCache);
+
+ SyncIndex index;
+ index = 1;
+ code = raftCacheDelEntry(pCache, index);
+ ASSERT(code == 0);
+ index = 3;
+ code = raftCacheDelEntry(pCache, index);
+ ASSERT(code == 0);
+ raftCacheLog2((char*)"==test1 delete 1,3==", pCache);
+
+ code = raftCacheClear(pCache);
+ ASSERT(code == 0);
+ raftCacheLog2((char*)"==clear all==", pCache);
+}
+
+void test2() {
+ int32_t code = 0;
+ SRaftEntryHashCache* pCache = createCache(5);
+ for (int i = 0; i < 5; ++i) {
+ SSyncRaftEntry* pEntry = createEntry(i);
+ code = raftCachePutEntry(pCache, pEntry);
+ ASSERT(code == 1);
+ syncEntryDestory(pEntry);
+ }
+ raftCacheLog2((char*)"==test2 write 5 entries==", pCache);
+
+ SyncIndex index;
+ index = 1;
+ SSyncRaftEntry* pEntry;
+ code = raftCacheGetEntry(pCache, index, &pEntry);
+ ASSERT(code == 0);
+ syncEntryDestory(pEntry);
+ syncEntryLog2((char*)"==test2 get entry 1==", pEntry);
+
+ index = 2;
+ code = raftCacheGetEntryP(pCache, index, &pEntry);
+ ASSERT(code == 0);
+ syncEntryLog2((char*)"==test2 get entry pointer 2==", pEntry);
+
+ // not found
+ index = 8;
+ code = raftCacheGetEntry(pCache, index, &pEntry);
+ ASSERT(code == -1 && terrno == TSDB_CODE_WAL_LOG_NOT_EXIST);
+ sTrace("==test2 get entry 8 not found==");
+
+ // not found
+ index = 9;
+ code = raftCacheGetEntryP(pCache, index, &pEntry);
+ ASSERT(code == -1 && terrno == TSDB_CODE_WAL_LOG_NOT_EXIST);
+ sTrace("==test2 get entry pointer 9 not found==");
+}
+
+void test3() {
+ int32_t code = 0;
+ SRaftEntryHashCache* pCache = createCache(5);
+ for (int i = 0; i < 5; ++i) {
+ SSyncRaftEntry* pEntry = createEntry(i);
+ code = raftCachePutEntry(pCache, pEntry);
+ ASSERT(code == 1);
+ syncEntryDestory(pEntry);
+ }
+ for (int i = 6; i < 10; ++i) {
+ SSyncRaftEntry* pEntry = createEntry(i);
+ code = raftCachePutEntry(pCache, pEntry);
+ ASSERT(code == 0);
+ syncEntryDestory(pEntry);
+ }
+ raftCacheLog2((char*)"==test3 write 10 entries, max count is 5==", pCache);
+}
+
+void test4() {
+ int32_t code = 0;
+ SRaftEntryHashCache* pCache = createCache(5);
+ for (int i = 0; i < 5; ++i) {
+ SSyncRaftEntry* pEntry = createEntry(i);
+ code = raftCachePutEntry(pCache, pEntry);
+ ASSERT(code == 1);
+ syncEntryDestory(pEntry);
+ }
+ raftCacheLog2((char*)"==test4 write 5 entries==", pCache);
+
+ SyncIndex index;
+ index = 3;
+ SSyncRaftEntry* pEntry;
+ code = raftCacheGetAndDel(pCache, index, &pEntry);
+ ASSERT(code == 0);
+ syncEntryLog2((char*)"==test4 get-and-del entry 3==", pEntry);
+ raftCacheLog2((char*)"==test4 after get-and-del entry 3==", pCache);
+}
+
+static char* keyFn(const void* pData) {
+ SSyncRaftEntry* pEntry = (SSyncRaftEntry*)pData;
+ return (char*)(&(pEntry->index));
+}
+
+static int cmpFn(const void* p1, const void* p2) { return memcmp(p1, p2, sizeof(SyncIndex)); }
+
+void printSkipList(SSkipList* pSkipList) {
+ ASSERT(pSkipList != NULL);
+
+ SSkipListIterator* pIter = tSkipListCreateIter(pSkipList);
+ while (tSkipListIterNext(pIter)) {
+ SSkipListNode* pNode = tSkipListIterGet(pIter);
+ ASSERT(pNode != NULL);
+ SSyncRaftEntry* pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(pNode);
+ syncEntryPrint2((char*)"", pEntry);
+ }
+}
+
+void delSkipListFirst(SSkipList* pSkipList, int n) {
+ ASSERT(pSkipList != NULL);
+
+ sTrace("delete first %d -------------", n);
+ SSkipListIterator* pIter = tSkipListCreateIter(pSkipList);
+ for (int i = 0; i < n; ++i) {
+ tSkipListIterNext(pIter);
+ SSkipListNode* pNode = tSkipListIterGet(pIter);
+ tSkipListRemoveNode(pSkipList, pNode);
+ }
+}
+
+SSyncRaftEntry* getLogEntry2(SSkipList* pSkipList, SyncIndex index) {
+ SyncIndex index2 = index;
+ SSyncRaftEntry* pEntry = NULL;
+ int arraySize = 0;
+
+ SArray* entryPArray = tSkipListGet(pSkipList, (char*)(&index2));
+ arraySize = taosArrayGetSize(entryPArray);
+ if (arraySize > 0) {
+ SSkipListNode** ppNode = (SSkipListNode**)taosArrayGet(entryPArray, 0);
+ ASSERT(*ppNode != NULL);
+ pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(*ppNode);
+ }
+ taosArrayDestroy(entryPArray);
+
+ sTrace("get index2: %ld, arraySize:%d -------------", index, arraySize);
+ syncEntryLog2((char*)"getLogEntry2", pEntry);
+ return pEntry;
+}
+
+SSyncRaftEntry* getLogEntry(SSkipList* pSkipList, SyncIndex index) {
+ sTrace("get index: %ld -------------", index);
+ SyncIndex index2 = index;
+ SSyncRaftEntry* pEntry = NULL;
+ SSkipListIterator* pIter =
+ tSkipListCreateIterFromVal(pSkipList, (const char*)&index2, TSDB_DATA_TYPE_BINARY, TSDB_ORDER_ASC);
+ if (tSkipListIterNext(pIter)) {
+ SSkipListNode* pNode = tSkipListIterGet(pIter);
+ ASSERT(pNode != NULL);
+ pEntry = (SSyncRaftEntry*)SL_GET_NODE_DATA(pNode);
+ }
+
+ syncEntryLog2((char*)"getLogEntry", pEntry);
+ return pEntry;
+}
+
+void test5() {
+ SSkipList* pSkipList =
+ tSkipListCreate(MAX_SKIP_LIST_LEVEL, TSDB_DATA_TYPE_BINARY, sizeof(SyncIndex), cmpFn, SL_ALLOW_DUP_KEY, keyFn);
+ ASSERT(pSkipList != NULL);
+
+ sTrace("insert 9 - 5");
+ for (int i = 9; i >= 5; --i) {
+ SSyncRaftEntry* pEntry = createEntry(i);
+ SSkipListNode* pSkipListNode = tSkipListPut(pSkipList, pEntry);
+ }
+
+ sTrace("insert 0 - 4");
+ for (int i = 0; i <= 4; ++i) {
+ SSyncRaftEntry* pEntry = createEntry(i);
+ SSkipListNode* pSkipListNode = tSkipListPut(pSkipList, pEntry);
+ }
+
+ sTrace("insert 7 7 7 7 7");
+ for (int i = 0; i <= 4; ++i) {
+ SSyncRaftEntry* pEntry = createEntry(7);
+ SSkipListNode* pSkipListNode = tSkipListPut(pSkipList, pEntry);
+ }
+
+ sTrace("print: -------------");
+ printSkipList(pSkipList);
+
+ delSkipListFirst(pSkipList, 3);
+
+ sTrace("print: -------------");
+ printSkipList(pSkipList);
+
+ getLogEntry(pSkipList, 2);
+ getLogEntry(pSkipList, 5);
+ getLogEntry(pSkipList, 7);
+ getLogEntry(pSkipList, 7);
+
+ getLogEntry2(pSkipList, 2);
+ getLogEntry2(pSkipList, 5);
+ getLogEntry2(pSkipList, 7);
+ getLogEntry2(pSkipList, 7);
+
+ tSkipListDestroy(pSkipList);
+}
+
+int main(int argc, char** argv) {
+ gRaftDetailLog = true;
+ tsAsyncLog = 0;
+ sDebugFlag = DEBUG_TRACE + DEBUG_SCREEN + DEBUG_FILE + DEBUG_DEBUG;
+
+ /*
+ test1();
+ test2();
+ test3();
+ test4();
+ */
+
+ test5();
+
+ return 0;
+}
diff --git a/source/libs/transport/test/pushServer.c b/source/libs/transport/test/pushServer.c
index 6a4ff213d0df668122196c760345eecfe358ef69..754433a5e6a1bd3709ef2c45af3762b9c280c3c9 100644
--- a/source/libs/transport/test/pushServer.c
+++ b/source/libs/transport/test/pushServer.c
@@ -31,12 +31,12 @@ void processShellMsg() {
STaosQall *qall;
SRpcMsg * pRpcMsg, rpcMsg;
int type;
- void * pvnode;
+ SQueueInfo qinfo = {0};
qall = taosAllocateQall();
while (1) {
- int numOfMsgs = taosReadAllQitemsFromQset(qset, qall, &pvnode, NULL);
+ int numOfMsgs = taosReadAllQitemsFromQset(qset, qall, &qinfo);
tDebug("%d shell msgs are received", numOfMsgs);
if (numOfMsgs <= 0) break;
@@ -86,6 +86,8 @@ void processShellMsg() {
rpcSendResponse(&nRpcMsg);
}
}
+
+ taosUpdateItemSize(qinfo.queue, numOfMsgs);
}
taosFreeQall(qall);
diff --git a/source/libs/wal/src/walRead.c b/source/libs/wal/src/walRead.c
index eb0c7f56bd70582d9d193cdbfbf23781066f2100..908523f2a66f50c081152752fc5cafb28b8eebae 100644
--- a/source/libs/wal/src/walRead.c
+++ b/source/libs/wal/src/walRead.c
@@ -66,6 +66,7 @@ void walCloseReader(SWalReader *pRead) {
}
int32_t walNextValidMsg(SWalReader *pRead) {
+ wDebug("vgId:%d wal start to fetch", pRead->pWal->cfg.vgId);
int64_t fetchVer = pRead->curVersion;
int64_t endVer = pRead->cond.scanUncommited ? walGetLastVer(pRead->pWal) : walGetCommittedVer(pRead->pWal);
while (fetchVer <= endVer) {
@@ -176,7 +177,7 @@ int32_t walReadSeekVerImpl(SWalReader *pRead, int64_t ver) {
return -1;
}
- wDebug("wal version reset from %ld to %ld", pRead->curVersion, ver);
+ wDebug("wal version reset from %ld(invalid: %d) to %ld", pRead->curVersion, pRead->curInvalid, ver);
pRead->curVersion = ver;
return 0;
@@ -242,6 +243,7 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
return -1;
}
}
+ pRead->curInvalid = 0;
return 0;
}
@@ -301,6 +303,7 @@ static int32_t walSkipFetchBodyNew(SWalReader *pRead) {
int64_t code;
ASSERT(pRead->curVersion == pRead->pHead->head.version);
+ ASSERT(pRead->curInvalid == 0);
code = taosLSeekFile(pRead->pLogFile, pRead->pHead->head.bodyLen, SEEK_CUR);
if (code < 0) {
@@ -404,6 +407,7 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
}
int32_t walReadVer(SWalReader *pRead, int64_t ver) {
+ wDebug("vgId:%d wal start to read ver %ld", pRead->pWal->cfg.vgId, ver);
int64_t contLen;
bool seeked = false;
diff --git a/source/util/src/terror.c b/source/util/src/terror.c
index ef6697b3b5eade35c27fe8dcf6ae48d868091254..2364c53a9abd9c15a858e912eeb856d44e25474d 100644
--- a/source/util/src/terror.c
+++ b/source/util/src/terror.c
@@ -561,6 +561,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_COL_JSON, "Only tag can be jso
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_VALUE_TOO_LONG, "Value too long for column/tag")
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_DELETE_WHERE, "The DELETE statement must have a definite time window range")
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_REDISTRIBUTE_VG, "The REDISTRIBUTE VGROUP statement only support 1 to 3 dnodes")
+TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_SELECTED_EXPR, "Invalid SELECTed expression")
//planner
TAOS_DEFINE_ERROR(TSDB_CODE_PLAN_INTERNAL_ERROR, "Planner internal error")
diff --git a/source/util/src/tqueue.c b/source/util/src/tqueue.c
index 94311bc4355a9b1016b4c92bda0ef3386f5124d3..50beba8a9b67e191d402e580a2964f954c454869 100644
--- a/source/util/src/tqueue.c
+++ b/source/util/src/tqueue.c
@@ -115,7 +115,7 @@ bool taosQueueEmpty(STaosQueue *queue) {
bool empty = false;
taosThreadMutexLock(&queue->mutex);
- if (queue->head == NULL && queue->tail == NULL) {
+ if (queue->head == NULL && queue->tail == NULL && queue->numOfItems == 0 && queue->memOfItems == 0) {
empty = true;
}
taosThreadMutexUnlock(&queue->mutex);
@@ -123,6 +123,14 @@ bool taosQueueEmpty(STaosQueue *queue) {
return empty;
}
+void taosUpdateItemSize(STaosQueue *queue, int32_t items) {
+ if (queue == NULL) return;
+
+ taosThreadMutexLock(&queue->mutex);
+ queue->numOfItems -= items;
+ taosThreadMutexUnlock(&queue->mutex);
+}
+
int32_t taosQueueItemSize(STaosQueue *queue) {
if (queue == NULL) return 0;
@@ -257,6 +265,7 @@ int32_t taosReadAllQitems(STaosQueue *queue, STaosQall *qall) {
queue->tail = NULL;
queue->numOfItems = 0;
queue->memOfItems = 0;
+ uTrace("read %d items from queue:%p, items:%d mem:%" PRId64, code, queue, queue->numOfItems, queue->memOfItems);
if (queue->qset) atomic_sub_fetch_32(&queue->qset->numOfItems, qall->numOfItems);
}
@@ -397,7 +406,7 @@ void taosRemoveFromQset(STaosQset *qset, STaosQueue *queue) {
int32_t taosGetQueueNumber(STaosQset *qset) { return qset->numOfQueues; }
-int32_t taosReadQitemFromQset(STaosQset *qset, void **ppItem, int64_t *ts, void **ahandle, FItem *itemFp) {
+int32_t taosReadQitemFromQset(STaosQset *qset, void **ppItem, SQueueInfo *qinfo) {
STaosQnode *pNode = NULL;
int32_t code = 0;
@@ -417,17 +426,18 @@ int32_t taosReadQitemFromQset(STaosQset *qset, void **ppItem, int64_t *ts, void
if (queue->head) {
pNode = queue->head;
*ppItem = pNode->item;
- if (ahandle) *ahandle = queue->ahandle;
- if (itemFp) *itemFp = queue->itemFp;
- if (ts) *ts = pNode->timestamp;
+ qinfo->ahandle = queue->ahandle;
+ qinfo->fp = queue->itemFp;
+ qinfo->queue = queue;
+ qinfo->timestamp = pNode->timestamp;
queue->head = pNode->next;
if (queue->head == NULL) queue->tail = NULL;
- queue->numOfItems--;
+ // queue->numOfItems--;
queue->memOfItems -= pNode->size;
atomic_sub_fetch_32(&qset->numOfItems, 1);
code = 1;
- uTrace("item:%p is read out from queue:%p, items:%d mem:%" PRId64, *ppItem, queue, queue->numOfItems,
+ uTrace("item:%p is read out from queue:%p, items:%d mem:%" PRId64, *ppItem, queue, queue->numOfItems - 1,
queue->memOfItems);
}
@@ -440,7 +450,7 @@ int32_t taosReadQitemFromQset(STaosQset *qset, void **ppItem, int64_t *ts, void
return code;
}
-int32_t taosReadAllQitemsFromQset(STaosQset *qset, STaosQall *qall, void **ahandle, FItems *itemsFp) {
+int32_t taosReadAllQitemsFromQset(STaosQset *qset, STaosQall *qall, SQueueInfo *qinfo) {
STaosQueue *queue;
int32_t code = 0;
@@ -461,13 +471,16 @@ int32_t taosReadAllQitemsFromQset(STaosQset *qset, STaosQall *qall, void **ahand
qall->start = queue->head;
qall->numOfItems = queue->numOfItems;
code = qall->numOfItems;
- if (ahandle) *ahandle = queue->ahandle;
- if (itemsFp) *itemsFp = queue->itemsFp;
+ qinfo->ahandle = queue->ahandle;
+ qinfo->fp = queue->itemsFp;
+ qinfo->queue = queue;
queue->head = NULL;
queue->tail = NULL;
- queue->numOfItems = 0;
+ // queue->numOfItems = 0;
queue->memOfItems = 0;
+ uTrace("read %d items from queue:%p, items:0 mem:%" PRId64, code, queue, queue->memOfItems);
+
atomic_sub_fetch_32(&qset->numOfItems, qall->numOfItems);
for (int32_t j = 1; j < qall->numOfItems; ++j) {
tsem_wait(&qset->sem);
diff --git a/source/util/src/tref.c b/source/util/src/tref.c
index 2e4c33bc8758f995c10e8efef6569e9f30cb67ee..9cd849b9be023f2db1d41266104d889fcb38768d 100644
--- a/source/util/src/tref.c
+++ b/source/util/src/tref.c
@@ -431,7 +431,7 @@ static int32_t taosDecRefCount(int32_t rsetId, int64_t rid, int32_t remove) {
}
released = 1;
} else {
- uTrace("rsetId:%d p:%p rid:%" PRId64 " is released", rsetId, pNode->p, rid);
+ uTrace("rsetId:%d p:%p rid:%" PRId64 " is released, remain count %d", rsetId, pNode->p, rid, pNode->count);
}
} else {
uTrace("rsetId:%d rid:%" PRId64 " is not there, failed to release/remove", rsetId, rid);
diff --git a/source/util/src/tsched.c b/source/util/src/tsched.c
index 691a0d34d42ca3ab04be5daf61414016436a6bb1..9abce966f5f97fc1f5b050f3a9bd3e0d2e8a3519 100644
--- a/source/util/src/tsched.c
+++ b/source/util/src/tsched.c
@@ -129,7 +129,7 @@ void *taosProcessSchedQueue(void *scheduler) {
while (1) {
if ((ret = tsem_wait(&pSched->fullSem)) != 0) {
uFatal("wait %s fullSem failed(%s)", pSched->label, strerror(errno));
- exit(ret);
+ ASSERT(0);
}
if (pSched->stop) {
break;
@@ -137,7 +137,7 @@ void *taosProcessSchedQueue(void *scheduler) {
if ((ret = taosThreadMutexLock(&pSched->queueMutex)) != 0) {
uFatal("lock %s queueMutex failed(%s)", pSched->label, strerror(errno));
- exit(ret);
+ ASSERT(0);
}
msg = pSched->queue[pSched->fullSlot];
@@ -146,12 +146,12 @@ void *taosProcessSchedQueue(void *scheduler) {
if ((ret = taosThreadMutexUnlock(&pSched->queueMutex)) != 0) {
uFatal("unlock %s queueMutex failed(%s)", pSched->label, strerror(errno));
- exit(ret);
+ ASSERT(0);
}
if ((ret = tsem_post(&pSched->emptySem)) != 0) {
uFatal("post %s emptySem failed(%s)", pSched->label, strerror(errno));
- exit(ret);
+ ASSERT(0);
}
if (msg.fp)
@@ -174,12 +174,12 @@ void taosScheduleTask(void *queueScheduler, SSchedMsg *pMsg) {
if ((ret = tsem_wait(&pSched->emptySem)) != 0) {
uFatal("wait %s emptySem failed(%s)", pSched->label, strerror(errno));
- exit(ret);
+ ASSERT(0);
}
if ((ret = taosThreadMutexLock(&pSched->queueMutex)) != 0) {
uFatal("lock %s queueMutex failed(%s)", pSched->label, strerror(errno));
- exit(ret);
+ ASSERT(0);
}
pSched->queue[pSched->emptySlot] = *pMsg;
@@ -187,12 +187,12 @@ void taosScheduleTask(void *queueScheduler, SSchedMsg *pMsg) {
if ((ret = taosThreadMutexUnlock(&pSched->queueMutex)) != 0) {
uFatal("unlock %s queueMutex failed(%s)", pSched->label, strerror(errno));
- exit(ret);
+ ASSERT(0);
}
if ((ret = tsem_post(&pSched->fullSem)) != 0) {
uFatal("post %s fullSem failed(%s)", pSched->label, strerror(errno));
- exit(ret);
+ ASSERT(0);
}
}
@@ -200,6 +200,8 @@ void taosCleanUpScheduler(void *param) {
SSchedQueue *pSched = (SSchedQueue *)param;
if (pSched == NULL) return;
+ uDebug("start to cleanup %s schedQsueue", pSched->label);
+
pSched->stop = true;
for (int32_t i = 0; i < pSched->numOfThreads; ++i) {
if (taosCheckPthreadValid(pSched->qthread[i])) {
diff --git a/source/util/src/tworker.c b/source/util/src/tworker.c
index 88bd36f0cb0f048e301c93e28c2eba21de6ec36f..1f0731812c9ec739adfdb2a0c17451938cb5e007 100644
--- a/source/util/src/tworker.c
+++ b/source/util/src/tworker.c
@@ -70,27 +70,27 @@ void tQWorkerCleanup(SQWorkerPool *pool) {
static void *tQWorkerThreadFp(SQWorker *worker) {
SQWorkerPool *pool = worker->pool;
- FItem fp = NULL;
-
- void *msg = NULL;
- void *ahandle = NULL;
- int32_t code = 0;
- int64_t ts = 0;
+ SQueueInfo qinfo = {0};
+ void *msg = NULL;
+ int32_t code = 0;
taosBlockSIGPIPE();
setThreadName(pool->name);
uDebug("worker:%s:%d is running", pool->name, worker->id);
while (1) {
- if (taosReadQitemFromQset(pool->qset, (void **)&msg, &ts, &ahandle, &fp) == 0) {
+ if (taosReadQitemFromQset(pool->qset, (void **)&msg, &qinfo) == 0) {
uDebug("worker:%s:%d qset:%p, got no message and exiting", pool->name, worker->id, pool->qset);
break;
}
- if (fp != NULL) {
- SQueueInfo info = {.ahandle = ahandle, .workerId = worker->id, .threadNum = pool->num, .timestamp = ts};
- (*fp)(&info, msg);
+ if (qinfo.fp != NULL) {
+ qinfo.workerId = worker->id;
+ qinfo.threadNum = pool->num;
+ (*((FItem)qinfo.fp))(&qinfo, msg);
}
+
+ taosUpdateItemSize(qinfo.queue, 1);
}
return NULL;
@@ -195,28 +195,28 @@ void tWWorkerCleanup(SWWorkerPool *pool) {
static void *tWWorkerThreadFp(SWWorker *worker) {
SWWorkerPool *pool = worker->pool;
- FItems fp = NULL;
-
- void *msg = NULL;
- void *ahandle = NULL;
- int32_t numOfMsgs = 0;
- int32_t qtype = 0;
+ SQueueInfo qinfo = {0};
+ void *msg = NULL;
+ int32_t code = 0;
+ int32_t numOfMsgs = 0;
taosBlockSIGPIPE();
setThreadName(pool->name);
uDebug("worker:%s:%d is running", pool->name, worker->id);
while (1) {
- numOfMsgs = taosReadAllQitemsFromQset(worker->qset, worker->qall, &ahandle, &fp);
+ numOfMsgs = taosReadAllQitemsFromQset(worker->qset, worker->qall, &qinfo);
if (numOfMsgs == 0) {
uDebug("worker:%s:%d qset:%p, got no message and exiting", pool->name, worker->id, worker->qset);
break;
}
- if (fp != NULL) {
- SQueueInfo info = {.ahandle = ahandle, .workerId = worker->id, .threadNum = pool->num};
- (*fp)(&info, worker->qall, numOfMsgs);
+ if (qinfo.fp != NULL) {
+ qinfo.workerId = worker->id;
+ qinfo.threadNum = pool->num;
+ (*((FItems)qinfo.fp))(&qinfo, worker->qall, numOfMsgs);
}
+ taosUpdateItemSize(qinfo.queue, numOfMsgs);
}
return NULL;
diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh
index 9705c024b85c8add289e3a7cca1331e7e26efdcf..52a5627e342c1d737982e54000e3ac019df04316 100755
--- a/tests/parallel_test/run_case.sh
+++ b/tests/parallel_test/run_case.sh
@@ -65,6 +65,7 @@ ulimit -c unlimited
$TIMEOUT_CMD $cmd
RET=$?
+echo "cmd exit code: $RET"
if [ $RET -ne 0 ]; then
pwd
diff --git a/tests/pytest/stream/test1.py b/tests/pytest/stream/test1.py
index d3439a7bdbbf258795a15164eb63b9278549ed8a..31e70c21d28fc4bc52d9c4a248294f1b3ac4bb9c 100644
--- a/tests/pytest/stream/test1.py
+++ b/tests/pytest/stream/test1.py
@@ -18,7 +18,7 @@ class TDTestCase:
tdSql.execute('create table ownsampling_ct1 using downsampling_stb tags(10, 10.1, "beijing", True);')
tdSql.execute('create table if not exists scalar_stb (ts timestamp, c1 int, c2 double, c3 binary(20)) tags (t1 int);')
tdSql.execute('create table scalar_ct1 using scalar_stb tags(10);')
- tdSql.execute('create stream downsampling_stream into output_downsampling_stb as select _wstartts AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
+ tdSql.execute('create stream downsampling_stream into output_downsampling_stb as select _wstart AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
tdSql.execute('create stream scalar_stream into output_scalar_stb as select ts, abs(c1) a1 , abs(c2) a2 from scalar_stb;')
tdSql.execute('insert into scalar_ct1 values (1653471881952, 100, 100.1, "beijing");')
tdSql.execute('insert into scalar_ct1 values (1653471881952+1s, -50, -50.1, "tianjin");')
diff --git a/tests/pytest/stream/test2.py b/tests/pytest/stream/test2.py
index a441174722047d7fb7819f535fe7b6c7bf55380f..e6044662e91017849ea5ac568bd1dc4f57957c93 100644
--- a/tests/pytest/stream/test2.py
+++ b/tests/pytest/stream/test2.py
@@ -22,23 +22,23 @@ class TDTestCase:
tdSql.execute('create table downsampling_ct1 using downsampling_stb tags(10, 10.1, "Beijing", True);')
tdSql.execute('create table if not exists scalar_stb (ts timestamp, c1 int, c2 double, c3 binary(20), c4 nchar(20), c5 nchar(20)) tags (t1 int);')
tdSql.execute('create table scalar_ct1 using scalar_stb tags(10);')
- tdSql.execute('create stream downsampling_stream into output_downsampling_stb as select _wstartts AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
+ tdSql.execute('create stream downsampling_stream into output_downsampling_stb as select _wstart AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
tdSql.execute('insert into downsampling_ct1 values (1653547828591, 100, 100.1, "Beijing", True);')
tdSql.execute('insert into downsampling_ct1 values (1653547828591+1s, -100, -100.1, "Tianjin", False);')
tdSql.execute('insert into downsampling_ct1 values (1653547828591+2s, 50, 50.3, "HeBei", False);')
tdSql.execute('select * from output_downsampling_stb;')
tdSql.execute('select start, `min(c1)`, `max(c2)`, `sum(c1)` from output_downsampling_stb;')
- tdSql.execute('select _wstartts AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
+ tdSql.execute('select _wstart AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
tdSql.execute('insert into downsampling_ct1 values (1653547828591+10m, 60, 60.3, "heilongjiang", True);')
tdSql.execute('insert into downsampling_ct1 values (1653547828591+11m, 70, 70.3, "JiLin", True);')
tdSql.execute('select * from output_downsampling_stb;')
tdSql.execute('select start, `min(c1)`, `max(c2)`, `sum(c1)` from output_downsampling_stb;')
- tdSql.execute('select _wstartts AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
+ tdSql.execute('select _wstart AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
tdSql.execute('insert into downsampling_ct1 values (1653547828591+21m, 70, 70.3, "JiLin", True);')
tdSql.execute('select * from output_downsampling_stb;')
tdSql.execute('select * from output_downsampling_stb;')
tdSql.execute('select start, `min(c1)`, `max(c2)`, `sum(c1)` from output_downsampling_stb;')
- tdSql.execute('select _wstartts AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
+ tdSql.execute('select _wstart AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);')
tdSql.execute('create stream abs_stream into output_abs_stb as select ts, abs(c1), abs(c2), c3 from scalar_stb;')
tdSql.query('describe output_abs_stb')
tdSql.execute('create stream acos_stream into output_acos_stb as select ts, acos(c1), acos(c2), c3 from scalar_stb;')
diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py
index a38b14a52de8eb7fa99042dbad768d73533fd645..96723978ae7bfd55b6c5568d30eb99eb71aa2ee2 100644
--- a/tests/pytest/util/dnodes.py
+++ b/tests/pytest/util/dnodes.py
@@ -382,7 +382,7 @@ class TDDnode:
if self.valgrind == 0:
if platform.system().lower() == 'windows':
- cmd = "mintty -h never -w hide %s -c %s" % (
+ cmd = "mintty -h never %s -c %s" % (
binPath, self.cfgDir)
else:
cmd = "nohup %s -c %s > /dev/null 2>&1 & " % (
@@ -391,7 +391,7 @@ class TDDnode:
valgrindCmdline = "valgrind --log-file=\"%s/../log/valgrind.log\" --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes"%self.cfgDir
if platform.system().lower() == 'windows':
- cmd = "mintty -h never -w hide %s %s -c %s" % (
+ cmd = "mintty -h never %s %s -c %s" % (
valgrindCmdline, binPath, self.cfgDir)
else:
cmd = "nohup %s %s -c %s 2>&1 & " % (
@@ -518,20 +518,20 @@ class TDDnode:
if self.running != 0:
if platform.system().lower() == 'windows':
- os.system("wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId | xargs echo | awk '{print $2}' | xargs taskkill -f -pid"%self.index)
+ psCmd = "for /f %a in ('wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId ^| xargs echo ^| awk ^'{print $2}^'') do @(ps | grep %a | awk '{print $1}' | xargs kill -INT )" % (self.index)
else:
psCmd = "ps -ef|grep -w %s| grep dnode%d|grep -v grep | awk '{print $2}'" % (toBeKilled,self.index)
+ processID = subprocess.check_output(
+ psCmd, shell=True).decode("utf-8")
+
+ while(processID):
+ killCmd = "kill -INT %s > /dev/null 2>&1" % processID
+ os.system(killCmd)
+ time.sleep(1)
processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8")
-
- while(processID):
- killCmd = "kill -INT %s > /dev/null 2>&1" % processID
- os.system(killCmd)
- time.sleep(1)
- processID = subprocess.check_output(
- psCmd, shell=True).decode("utf-8")
- if self.valgrind:
- time.sleep(2)
+ if self.valgrind:
+ time.sleep(2)
self.running = 0
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))
diff --git a/tests/pytest/util/sqlset.py b/tests/pytest/util/sqlset.py
index bccd49a20973dc60c9ffbc7196c99af87a35dcb0..3c1b6cd7f76fdeac1056f4933d202cbd99baea6a 100644
--- a/tests/pytest/util/sqlset.py
+++ b/tests/pytest/util/sqlset.py
@@ -41,7 +41,7 @@ class TDSetSql:
create_stb_sql = f'create table {stbname} ({column_sql[:-1]}) tags({tag_sql[:-1]})'
return create_stb_sql
- def set_insertsql(self,column_dict,tbname,binary_str,nchar_str):
+ def set_insertsql(self,column_dict,tbname,binary_str=None,nchar_str=None):
sql = ''
for k, v in column_dict.items():
if v.lower() == 'timestamp' or v.lower() == 'tinyint' or v.lower() == 'smallint' or v.lower() == 'int' or v.lower() == 'bigint' or \
diff --git a/tests/script/api/stopquery.c b/tests/script/api/stopquery.c
index 0f27fdf9f9184788b1fd3ad6f7a0bcad741c3785..082d987a22461725411c6528729d3de7f8e33c7c 100644
--- a/tests/script/api/stopquery.c
+++ b/tests/script/api/stopquery.c
@@ -36,7 +36,7 @@ int64_t st, et;
char hostName[128];
char dbName[128];
char tbName[128];
-int32_t runTimes = 10000;
+int32_t runTimes = 1000;
typedef struct {
int id;
@@ -85,9 +85,12 @@ static void sqExecSQLE(TAOS *taos, char *command) {
taos_free_result(pSql);
}
+void sqError(char* prefix, const char* errMsg) {
+ fprintf(stderr, "%s error: %s\n", prefix, errMsg);
+}
void sqExit(char* prefix, const char* errMsg) {
- fprintf(stderr, "%s error: %s\n", prefix, errMsg);
+ sqError(prefix, errMsg);
exit(1);
}
@@ -141,16 +144,20 @@ void sqCloseFetchCb(void *param, TAOS_RES *pRes, int numOfRows) {
taos_close(qParam->taos);
*qParam->end = 1;
+
+ taos_free_result(pRes);
}
void sqCloseQueryCb(void *param, TAOS_RES *pRes, int code) {
SSP_CB_PARAM *qParam = (SSP_CB_PARAM *)param;
if (code == 0 && pRes) {
if (qParam->fetch) {
- taos_fetch_rows_a(pRes, sqFreeFetchCb, param);
+ taos_fetch_rows_a(pRes, sqCloseFetchCb, param);
} else {
taos_close(qParam->taos);
*qParam->end = 1;
+
+ taos_free_result(pRes);
}
} else {
sqExit("select", taos_errstr(pRes));
@@ -203,7 +210,9 @@ void sqAsyncQueryCb(void *param, TAOS_RES *pRes, int code) {
*qParam->end = 1;
}
} else {
- sqExit("select", taos_errstr(pRes));
+ sqError("select", taos_errstr(pRes));
+ *qParam->end = 1;
+ taos_free_result(pRes);
}
}
@@ -358,6 +367,7 @@ int sqCloseSyncQuery(bool fetch) {
}
taos_close(taos);
+ taos_free_result(pRes);
}
CASE_LEAVE();
}
@@ -382,7 +392,7 @@ int sqCloseAsyncQuery(bool fetch) {
SSP_CB_PARAM param = {0};
param.fetch = fetch;
param.end = &qEnd;
- taos_query_a(taos, sql, sqFreeQueryCb, ¶m);
+ taos_query_a(taos, sql, sqCloseQueryCb, ¶m);
while (0 == qEnd) {
usleep(5000);
}
@@ -457,8 +467,6 @@ void *closeThreadFp(void *arg) {
}
}
-
-
void *killThreadFp(void *arg) {
SSP_CB_PARAM* qParam = (SSP_CB_PARAM*)arg;
while (true) {
@@ -471,6 +479,19 @@ void *killThreadFp(void *arg) {
}
}
+void *cleanupThreadFp(void *arg) {
+ SSP_CB_PARAM* qParam = (SSP_CB_PARAM*)arg;
+ while (true) {
+ if (qParam->taos) {
+ usleep(rand() % 10000);
+ taos_cleanup();
+ break;
+ }
+ usleep(1);
+ }
+}
+
+
int sqConCloseSyncQuery(bool fetch) {
@@ -578,6 +599,8 @@ int sqConKillSyncQuery(bool fetch) {
pthread_join(qid, NULL);
pthread_join(cid, NULL);
+
+ taos_close(param.taos);
}
CASE_LEAVE();
}
@@ -593,6 +616,40 @@ int sqConKillAsyncQuery(bool fetch) {
pthread_join(qid, NULL);
pthread_join(cid, NULL);
+
+ taos_close(param.taos);
+ }
+ CASE_LEAVE();
+}
+
+int sqConCleanupSyncQuery(bool fetch) {
+ CASE_ENTER();
+ pthread_t qid, cid;
+ for (int32_t i = 0; i < runTimes; ++i) {
+ SSP_CB_PARAM param = {0};
+ param.fetch = fetch;
+ pthread_create(&qid, NULL, syncQueryThreadFp, (void*)¶m);
+ pthread_create(&cid, NULL, cleanupThreadFp, (void*)¶m);
+
+ pthread_join(qid, NULL);
+ pthread_join(cid, NULL);
+ break;
+ }
+ CASE_LEAVE();
+}
+
+int sqConCleanupAsyncQuery(bool fetch) {
+ CASE_ENTER();
+ pthread_t qid, cid;
+ for (int32_t i = 0; i < runTimes; ++i) {
+ SSP_CB_PARAM param = {0};
+ param.fetch = fetch;
+ pthread_create(&qid, NULL, asyncQueryThreadFp, (void*)¶m);
+ pthread_create(&cid, NULL, cleanupThreadFp, (void*)¶m);
+
+ pthread_join(qid, NULL);
+ pthread_join(cid, NULL);
+ break;
}
CASE_LEAVE();
}
@@ -600,7 +657,7 @@ int sqConKillAsyncQuery(bool fetch) {
void sqRunAllCase(void) {
-/*
+#if 1
sqStopSyncQuery(false);
sqStopSyncQuery(true);
sqStopAsyncQuery(false);
@@ -620,23 +677,26 @@ void sqRunAllCase(void) {
sqConCloseSyncQuery(true);
sqConCloseAsyncQuery(false);
sqConCloseAsyncQuery(true);
-*/
-#if 0
sqKillSyncQuery(false);
sqKillSyncQuery(true);
sqKillAsyncQuery(false);
sqKillAsyncQuery(true);
-#endif
- //sqConKillSyncQuery(false);
+ sqConKillSyncQuery(false);
sqConKillSyncQuery(true);
-#if 0
sqConKillAsyncQuery(false);
sqConKillAsyncQuery(true);
#endif
+ /*
+ sqConCleanupSyncQuery(false);
+ sqConCleanupSyncQuery(true);
+ sqConCleanupAsyncQuery(false);
+ sqConCleanupAsyncQuery(true);
+ */
+
int32_t l = 5;
while (l) {
printf("%d\n", l--);
diff --git a/tests/script/general/alter/dnode.sim b/tests/script/general/alter/dnode.sim
deleted file mode 100644
index 64e8a17de02c956a937aa1001ac4d5873a6bed21..0000000000000000000000000000000000000000
--- a/tests/script/general/alter/dnode.sim
+++ /dev/null
@@ -1,67 +0,0 @@
-system sh/stop_dnodes.sh
-system sh/deploy.sh -n dnode1 -i 1
-system sh/exec.sh -n dnode1 -s start
-sql connect
-
-print ======== step1
-sql alter dnode 1 resetlog
-sql alter dnode 1 monitor 1
-
-sleep 3000
-sql select * from log.dn
-if $rows <= 0 then
- return -1
-endi
-
-print ======== step2
-
-sql alter dnode 1 resetquerycache
-sql alter dnode 1 debugFlag 135
-sql alter dnode 1 debugFlag 131
-sql alter dnode 1 monitor 0
-sql alter dnode 1 debugFlag 135
-sql alter dnode 1 monDebugFlag 135
-sql alter dnode 1 vDebugFlag 135
-sql alter dnode 1 mDebugFlag 135
-sql alter dnode 1 cDebugFlag 135
-sql alter dnode 1 httpDebugFlag 135
-sql alter dnode 1 qDebugflag 135
-sql alter dnode 1 sdbDebugFlag 135
-sql alter dnode 1 uDebugFlag 135
-sql alter dnode 1 tsdbDebugFlag 135
-sql alter dnode 1 sDebugflag 135
-sql alter dnode 1 rpcDebugFlag 135
-sql alter dnode 1 dDebugFlag 135
-sql alter dnode 1 mqttDebugFlag 135
-sql alter dnode 1 wDebugFlag 135
-sql alter dnode 1 tmrDebugFlag 135
-sql_error alter dnode 2 wDebugFlag 135
-sql_error alter dnode 2 tmrDebugFlag 135
-
-print ======== step3
-sql_error alter $hostname1 debugFlag 135
-sql_error alter $hostname1 monDebugFlag 135
-sql_error alter $hostname1 vDebugFlag 135
-sql_error alter $hostname1 mDebugFlag 135
-sql_error alter dnode $hostname2 debugFlag 135
-sql_error alter dnode $hostname2 monDebugFlag 135
-sql_error alter dnode $hostname2 vDebugFlag 135
-sql_error alter dnode $hostname2 mDebugFlag 135
-sql alter dnode $hostname1 debugFlag 135
-sql alter dnode $hostname1 monDebugFlag 135
-sql alter dnode $hostname1 vDebugFlag 135
-sql alter dnode $hostname1 tmrDebugFlag 131
-
-print ======== step4
-sql_error sql alter dnode 1 balance 0
-sql_error sql alter dnode 1 balance vnode:1-dnode:1
-sql_error sql alter dnode 1 balance "vnode:1"
-sql_error sql alter dnode 1 balance "vnode:1-dnode:1"
-sql_error sql alter dnode 1 balance "dnode:1-vnode:1"
-sql_error sql alter dnode 1 balance "dnode:1-"
-sql_error sql alter dnode 1 balance "vnode:2-dnod"
-sql alter dnode 1 balance "vnode:2-dnode:1" -x step4
-step4:
-
-print ======= over
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
diff --git a/tests/script/general/cache/testSuite.sim b/tests/script/general/cache/testSuite.sim
deleted file mode 100644
index f09ece89b6574af1261d6127624a78a222b5fbd5..0000000000000000000000000000000000000000
--- a/tests/script/general/cache/testSuite.sim
+++ /dev/null
@@ -1,3 +0,0 @@
-run general/cache/new_metrics.sim
-run general/cache/restart_table.sim
-run general/cache/restart_metrics.sim
diff --git a/tests/script/general/column/testSuite.sim b/tests/script/general/column/testSuite.sim
deleted file mode 100644
index f60d197e95dd2285f2b5b155c0d361b8a28bd90e..0000000000000000000000000000000000000000
--- a/tests/script/general/column/testSuite.sim
+++ /dev/null
@@ -1,3 +0,0 @@
-run general/column/commit.sim
-run general/column/metrics.sim
-run general/column/table.sim
diff --git a/tests/script/general/compress/testSuite.sim b/tests/script/general/compress/testSuite.sim
deleted file mode 100644
index 3573985c8a90be4cab0b5abeaa37dbae0b2eefdd..0000000000000000000000000000000000000000
--- a/tests/script/general/compress/testSuite.sim
+++ /dev/null
@@ -1,4 +0,0 @@
-run general/compress/commitlog.sim
-run general/compress/compress2.sim
-run general/compress/compress.sim
-run general/compress/uncompress.sim
diff --git a/tests/script/general/compute/testSuite.sim b/tests/script/general/compute/testSuite.sim
deleted file mode 100644
index 91bf4bf0cda54d300f4d284c9e057616d4d54abe..0000000000000000000000000000000000000000
--- a/tests/script/general/compute/testSuite.sim
+++ /dev/null
@@ -1,17 +0,0 @@
-run general/compute/avg.sim
-run general/compute/bottom.sim
-run general/compute/count.sim
-run general/compute/diff.sim
-run general/compute/diff2.sim
-run general/compute/first.sim
-run general/compute/interval.sim
-run general/compute/last.sim
-run general/compute/leastsquare.sim
-run general/compute/max.sim
-run general/compute/min.sim
-run general/compute/null.sim
-run general/compute/percentile.sim
-run general/compute/stddev.sim
-run general/compute/sum.sim
-run general/compute/top.sim
-run general/compute/block_dist.sim
diff --git a/tests/script/general/connection/connection.sim b/tests/script/general/connection/connection.sim
deleted file mode 100644
index 1af6e1fda6989c8a9c6eed36e579f8325eee0ac6..0000000000000000000000000000000000000000
--- a/tests/script/general/connection/connection.sim
+++ /dev/null
@@ -1,21 +0,0 @@
-system sh/stop_dnodes.sh
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c wallevel -v 0
-system sh/exec.sh -n dnode1 -s start
-sleep 2000
-sql connect
-
-print ============= step1
-sql close
-print close1
-sql connect
-
-print ============= step2
-sql close
-sql connect
-
-print ============= step3
-sql close
-sql connect
-
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
diff --git a/tests/script/general/connection/mqtt.sim b/tests/script/general/connection/mqtt.sim
deleted file mode 100644
index c2c50ef17e1264d6f27f64417f1500bc83346012..0000000000000000000000000000000000000000
--- a/tests/script/general/connection/mqtt.sim
+++ /dev/null
@@ -1,19 +0,0 @@
-system sh/stop_dnodes.sh
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 2
-system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
-system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 100000
-system sh/cfg.sh -n dnode1 -c http -v 1
-system sh/cfg.sh -n dnode1 -c mqtt -v 1
-
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-sql create database mqttdb;
-sql create table mqttdb.devices(ts timestamp, value double) tags(name binary(32), model binary(32), serial binary(16), param binary(16), unit binary(16));
-
-sleep 1000
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/general/connection/sim.tar.gz b/tests/script/general/connection/sim.tar.gz
deleted file mode 100644
index 10bc1a6bace1c8b6796a98c53e3aa3c15e0bfd7c..0000000000000000000000000000000000000000
Binary files a/tests/script/general/connection/sim.tar.gz and /dev/null differ
diff --git a/tests/script/general/connection/test_old_data.sim b/tests/script/general/connection/test_old_data.sim
deleted file mode 100644
index 83df850f0bb93fd216520bbea4065400aa334091..0000000000000000000000000000000000000000
--- a/tests/script/general/connection/test_old_data.sim
+++ /dev/null
@@ -1,32 +0,0 @@
-system sh/stop_dnodes.sh
-system sh/mv_old_data.sh
-
-print ============== deploy
-
-system sh/exec.sh -n dnode1 -s start
-system sh/exec.sh -n dnode2 -s start
-system sh/exec.sh -n dnode3 -s start
-
-print =============== step1
-
-sql use test
-sql select * from m1
-
-print $rows points data are retrieved
-if $rows != 7 then
- return -1
-endi
-
-print =============== step 2
-
-sql select * from t1
-
-print $rows points data are retrieved
-if $rows != 7 then
- return -1
-endi
-
-
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
-system sh/exec.sh -n dnode2 -s stop -x SIGINT
-system sh/exec.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file
diff --git a/tests/script/general/field/testSuite.sim b/tests/script/general/field/testSuite.sim
deleted file mode 100644
index d12f0ebbd4df84f837104ab5078ba22b70a8034d..0000000000000000000000000000000000000000
--- a/tests/script/general/field/testSuite.sim
+++ /dev/null
@@ -1,14 +0,0 @@
-# run general/field/single.sim
-run general/field/bool.sim
-run general/field/smallint.sim
-run general/field/tinyint.sim
-run general/field/int.sim
-run general/field/bigint.sim
-run general/field/float.sim
-run general/field/double.sim
-# run general/field/binary.sim
-# run general/field/2.sim
-# run general/field/3.sim
-# run general/field/4.sim
-# run general/field/5.sim
-# run general/field/6.sim
diff --git a/tests/script/general/import/testSuite.sim b/tests/script/general/import/testSuite.sim
deleted file mode 100644
index 9157410ea562ed924725013b81cac2fd78946c75..0000000000000000000000000000000000000000
--- a/tests/script/general/import/testSuite.sim
+++ /dev/null
@@ -1,4 +0,0 @@
-run general/import/basic.sim
-run general/import/commit.sim
-run general/import/large.sim
-run general/import/replica1.sim
diff --git a/tests/script/general/rm_bak/tag/testSuite.sim b/tests/script/general/rm_bak/tag/testSuite.sim
deleted file mode 100644
index 45356efac1daa4f8f5fae06b8aad8c7b139bc9a0..0000000000000000000000000000000000000000
--- a/tests/script/general/rm_bak/tag/testSuite.sim
+++ /dev/null
@@ -1,25 +0,0 @@
-run general/tag/3.sim
-run general/tag/4.sim
-run general/tag/5.sim
-run general/tag/6.sim
-run general/tag/add.sim
-run general/tag/bigint.sim
-run general/tag/binary_binary.sim
-run general/tag/binary.sim
-run general/tag/bool_binary.sim
-run general/tag/bool_int.sim
-run general/tag/bool.sim
-run general/tag/change.sim
-run general/tag/column.sim
-run general/tag/commit.sim
-run general/tag/create.sim
-run general/tag/delete.sim
-run general/tag/double.sim
-run general/tag/filter.sim
-run general/tag/float.sim
-run general/tag/int_binary.sim
-run general/tag/int_float.sim
-run general/tag/int.sim
-run general/tag/set.sim
-run general/tag/smallint.sim
-run general/tag/tinyint.sim
diff --git a/tests/script/general/stream/agg_stream.sim b/tests/script/general/stream/agg_stream.sim
deleted file mode 100644
index 548f59cab7e6b3a81c5b01a62e02456f3c209720..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/agg_stream.sim
+++ /dev/null
@@ -1,316 +0,0 @@
-system sh/stop_dnodes.sh
-
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c wallevel -v 0
-
-print ========== step1
-system sh/cfg.sh -n dnode1 -c monitor -v 1
-system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
-system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000
-system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000
-system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000
-system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print =============== step2
-sql create database d4 precision 'us'
-sql use d4
-sql create table t1 (ts timestamp, i int)
-sql insert into d4.t1 values(1626739200000, 1)
-
-sql create table d4.s001 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s002 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s003 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s004 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s005 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s006 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s007 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s008 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s009 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s000 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s011 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s012 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s013 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s014 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s015 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s016 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s017 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s018 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s019 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s010 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s021 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s022 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s023 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s024 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s025 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s026 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s027 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s028 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s029 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s020 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s031 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s032 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s033 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s034 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s035 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s036 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s037 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s038 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s039 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s030 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s041 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s042 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s043 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s044 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s045 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s046 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s047 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s048 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s049 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s040 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s051 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s052 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s053 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s054 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s055 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s056 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s057 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s058 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s059 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s050 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s061 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s062 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s063 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s064 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s065 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s066 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s067 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s068 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s069 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s060 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s071 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s072 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s073 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s074 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s075 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s076 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s077 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s078 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s079 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s070 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s081 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s082 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s083 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s084 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s085 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s086 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s087 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s088 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s089 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s080 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s091 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s092 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s093 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s094 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s095 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s096 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s097 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s098 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s099 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s090 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-print =============== step21
-
-sql create table d4.s101 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s102 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s103 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s104 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s105 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s106 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s107 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s108 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s109 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s100 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s111 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s112 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s113 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s114 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s115 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s116 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s117 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s118 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s119 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s110 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s121 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s122 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s123 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s124 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s125 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s126 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s127 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s128 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s129 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s120 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s131 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s132 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s133 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s134 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s135 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s136 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s137 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s138 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s139 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s130 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s141 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s142 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s143 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s144 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s145 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s146 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s147 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s148 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s149 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s140 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s151 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s152 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s153 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s154 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s155 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s156 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s157 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s158 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s159 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s150 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s161 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s162 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s163 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s164 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s165 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s166 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s167 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s168 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s169 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s160 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s171 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s172 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s173 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s174 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s175 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s176 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s177 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s178 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s179 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s170 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s181 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s182 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s183 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s184 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s185 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s186 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s187 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s188 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s189 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s180 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-sql create table d4.s191 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s192 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s193 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s194 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s195 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s196 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
-sql create table d4.s197 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
-sql create table d4.s198 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
-sql create table d4.s199 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
-sql create table d4.s190 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
-
-
-print =============== step3
-print sleep 22 seconds
-sleep 50000
-
-sql select * from d4.s001
-$s1 = $rows
-print select * from d4.s001 ==> $s1
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s002
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s003
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s004
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s005
-$s5 = $rows
-print select * from d4.s005 ==> $s5
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s006
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s007
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s008
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s009
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s010
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s101
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s102
-$s12 = $rows
-print select * from d4.s102 ==> $s12
-if $rows <= 0 then
- return -1
-endi
diff --git a/tests/script/general/stream/column_stream.sim b/tests/script/general/stream/column_stream.sim
deleted file mode 100644
index 59a65f0969ebc6e2fd6d62c5b3fcc1bf66c420b7..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/column_stream.sim
+++ /dev/null
@@ -1,200 +0,0 @@
-system sh/stop_dnodes.sh
-
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c wallevel -v 0
-
-print ========== step1
-system sh/cfg.sh -n dnode1 -c monitor -v 1
-system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print =============== step1
-sleep 2000
-sql select * from log.dn
-if $rows == 0 then
- return -1
-endi
-
-print =============== step2
-sql create database d4 precision 'us'
-sql use d4
-sql create table t1 (ts timestamp, i int)
-sql insert into d4.t1 values(1626739200000, 1)
-
-sql create table d4.s1 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), stddev(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
-
-sql create table d4.s2 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), stddev(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
-
-sql create table d4.s3 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used), stddev(disk_used), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
-
-sql create table d4.s4 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read), stddev(io_write), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
-
-sql create table d4.s5 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed), stddev(band_speed), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
-
-sql create table d4.s6 as select count(req_http), count(req_insert), avg(req_http), avg(req_select), sum(req_insert), max(req_select), min(req_insert), stddev(req_select), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
-
-sql create table d4.s7 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
-
-sql create table d4.s8 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
-
-sql create table d4.s9 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
-
-sql create table d4.s10 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
-
-sql create table d4.s11 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
-
-sql create table d4.s12 as select count(req_http), count(req_insert), avg(req_select), avg(req_insert), sum(req_insert), max(req_select), min(req_insert), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
-
-print =============== step3
-print sleep 22 seconds
-sleep 22000
-
-sql select * from d4.s1
-$s1 = $rows
-print select * from d4.s1 ==> $s1
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s2
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s3
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s4
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s5
-$s5 = $rows
-print select * from d4.s5 ==> $s5
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s6
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s7
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s8
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s9
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s10
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s11
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s12
-$s12 = $rows
-print select * from d4.s12 ==> $s12
-if $rows <= 0 then
- return -1
-endi
-
-print =============== step4
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
-system sh/exec.sh -n dnode1 -s start
-print sleep 22 seconds
-sleep 22000
-
-sql select * from d4.s1
-print select * from d4.s1 ==> $rows $s1
-if $rows <= 0 then
- return -1
-endi
-if $rows <= $s1 then
- return -1
-endi
-
-sql select * from d4.s2
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s3
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s4
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s5
-print select * from d4.s5 ==> $rows $s5
-if $rows <= 0 then
- return -1
-endi
-if $rows <= $s5 then
- return -1
-endi
-
-
-sql select * from d4.s6
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s7
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s8
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s9
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s10
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s11
-if $rows <= 0 then
- return -1
-endi
-
-sql select * from d4.s12
-print select * from d4.s12 ==> $rows $s12
-if $rows <= 0 then
- return -1
-endi
-if $rows <= $s12 then
- return -1
-endi
\ No newline at end of file
diff --git a/tests/script/general/stream/metrics_del.sim b/tests/script/general/stream/metrics_del.sim
deleted file mode 100644
index 6cc3da71e9a5c34f83a74be5e4fe0345e94beadf..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/metrics_del.sim
+++ /dev/null
@@ -1,95 +0,0 @@
-system sh/stop_dnodes.sh
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print ======================== dnode1 start
-
-$dbPrefix = md_db
-$tbPrefix = md_tb
-$mtPrefix = md_mt
-$stPrefix = md_st
-$tbNum = 10
-$rowNum = 20
-$totalNum = 200
-
-print =============== step1
-$i = 0
-$db = $dbPrefix . $i
-$mt = $mtPrefix . $i
-$st = $stPrefix . $i
-
-sql drop databae $db -x step1
-step1:
-sql create database $db
-sql use $db
-sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
-
-$i = 0
-while $i < $tbNum
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( $i )
-
- $x = 0
- $y = 0
- while $y < $rowNum
- $ts = 1626710400000 + $x
- sql insert into $tb values ($ts , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-sleep 100
-
-print =============== step2 c3
-
-sql select count(*), count(tbcol), count(tbcol2) from $mt interval(1d)
-print select count(*), count(tbcol), count(tbcol2) from $mt interval(1d) ===> $data00 $data01 $data02, $data03
-if $data01 != 200 then
- return -1
-endi
-if $data02 != 200 then
- return -1
-endi
-if $data03 != 200 then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql create table $st as select count(*), count(tbcol), count(tbcol2) from $mt interval(1d)
-
-print =============== step3
-
-$i = 0
-while $i < $tbNum
- $tb = $tbPrefix . $i
- sql drop table $tb
- $i = $i + 1
-endw
-sql drop table $mt
-
-print =============== step4
-print sleep 120 seconds
-sleep 120000
-
-print =============== step5
-$st = $stPrefix . c3
-sql select * from $st
-print ===> select * from $st
-print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-if $data01 != null then
- return -1
-endi
-if $data02 != null then
- return -1
-endi
-if $data03 != null then
- return -1
-endi
diff --git a/tests/script/general/stream/metrics_replica1_vnoden.sim b/tests/script/general/stream/metrics_replica1_vnoden.sim
deleted file mode 100644
index db1044a597510048c4b812d8a3a16d53ff4e5ac0..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/metrics_replica1_vnoden.sim
+++ /dev/null
@@ -1,245 +0,0 @@
-system sh/stop_dnodes.sh
-
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
-system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print ======================== dnode1 start
-
-$dbPrefix = m1v_db
-$tbPrefix = m1v_tb
-$mtPrefix = m1v_mt
-$stPrefix = m1v_st
-$tbNum = 10
-$rowNum = 20
-$totalNum = 200
-
-print =============== step1
-$i = 0
-$db = $dbPrefix . $i
-$mt = $mtPrefix . $i
-$st = $stPrefix . $i
-
-sql drop databae $db -x step1
-step1:
-sql create database $db
-sql use $db
-sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
-
-$i = 0
-while $i < $tbNum
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( $i )
-
- $x = -400
- $y = 0
- while $y < $rowNum
- $ms = $x . m
- sql insert into $tb values (1626739200000 $ms , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-sleep 100
-
-print =============== step2 c1
-
-sql select count(*) from $mt interval(1d)
-print select count(*) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
-
-$st = $stPrefix . c1
-sql create table $st as select count(*) from $mt interval(1d)
-
-print =============== step3 c2
-sql select count(tbcol) from $mt interval(1d)
-print select count(tbcol) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
-
-$st = $stPrefix . c2
-sql create table $st as select count(tbcol) from $mt interval(1d)
-
-print =============== step4 c3
-sql select count(tbcol2) from $mt interval(1d)
-print select count(tbcol2) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql create table $st as select count(tbcol2) from $mt interval(1d)
-
-print =============== step5 avg
-sql select avg(tbcol) from $mt interval(1d)
-print select avg(tbcol) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 9.500000000 then
- return -1
-endi
-
-$st = $stPrefix . av
-sql create table $st as select avg(tbcol) from $mt interval(1d)
-
-print =============== step6 su
-sql select sum(tbcol) from $mt interval(1d)
-print select sum(tbcol) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 1900 then
- return -1
-endi
-
-$st = $stPrefix . su
-sql create table $st as select sum(tbcol) from $mt interval(1d)
-
-print =============== step7 mi
-sql select min(tbcol) from $mt interval(1d)
-print select min(tbcol) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 0 then
- return -1
-endi
-
-$st = $stPrefix . mi
-sql create table $st as select min(tbcol) from $mt interval(1d)
-
-print =============== step8 ma
-sql select max(tbcol) from $mt interval(1d)
-print select max(tbcol) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 19 then
- return -1
-endi
-
-$st = $stPrefix . ma
-sql create table $st as select max(tbcol) from $mt interval(1d)
-
-print =============== step9 fi
-sql select first(tbcol) from $mt interval(1d)
-print select first(tbcol) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 0 then
- return -1
-endi
-
-$st = $stPrefix . fi
-sql create table $st as select first(tbcol) from $mt interval(1d)
-
-print =============== step10 la
-sql select last(tbcol) from $mt interval(1d)
-print select last(tbcol) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 19 then
- return -1
-endi
-
-$st = $stPrefix . la
-sql create table $st as select last(tbcol) from $mt interval(1d)
-
-print =============== step11 wh
-sql select count(tbcol) from $mt where ts < 1626739440001 interval(1d)
-print select count(tbcol) from $mt where ts < 1626739440000 interval(1d) ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
-
-$st = $stPrefix . wh
-#sql create table $st as select count(tbcol) from $mt where ts < 1626739200000 + 4m interval(1d)
-
-print =============== step12 as
-sql select count(tbcol) from $mt interval(1d)
-print select count(tbcol) from $mt interval(1d) ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
-
-$st = $stPrefix . as
-sql create table $st as select count(tbcol) as c from $mt interval(1d)
-
-print =============== step13
-print sleep 120 seconds
-sleep 120000
-
-print =============== step14
-$st = $stPrefix . c1
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
-
-$st = $stPrefix . c2
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
-
-$st = $stPrefix . av
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 9.500000000 then
- return -1
-endi
-
-$st = $stPrefix . su
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 1900 then
- return -1
-endi
-
-$st = $stPrefix . mi
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 0 then
- return -1
-endi
-
-$st = $stPrefix . ma
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 19 then
- return -1
-endi
-
-$st = $stPrefix . fi
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 0 then
- return -1
-endi
-
-$st = $stPrefix . la
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 19 then
- return -1
-endi
-
-$st = $stPrefix . wh
-#sql select * from $st
-#print ===> select * from $st ===> $data00 $data01
-#if $data01 != 200 then
-# return -1
-#endi
-
-$st = $stPrefix . as
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 200 then
- return -1
-endi
diff --git a/tests/script/general/stream/restart_stream.sim b/tests/script/general/stream/restart_stream.sim
deleted file mode 100644
index 62e47f9b3a6c12668409293769ee7c5a12a718ac..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/restart_stream.sim
+++ /dev/null
@@ -1,176 +0,0 @@
-system sh/stop_dnodes.sh
-
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-print ======================== dnode1 start
-
-$i = 0
-$dbPrefix = rs_db
-$tbPrefix = rs_tb
-$mtPrefix = rs_mt
-$stPrefix = rs_st
-$tbNum = 10
-$rowNum = 20
-$totalNum = 200
-
-$db = $dbPrefix
-$tb = $tbPrefix . $i
-$mt = $mtPrefix
-$stm = $stPrefix . m
-$stt = $stPrefix . t
-
-print =============== step1
-sql create database $db
-sql use $db
-
-sql create table $mt (ts timestamp, tbcol int, tbcol2 int ) TAGS(tgcol bool)
-$i = 0
-while $i < 10
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( 0 )
-
- $x = -400
- $y = 0
- while $y < $rowNum
- $ms = $x . m
- sql insert into $tb values (1626739200000 $ms , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-print =============== step2
-$i = 0
-$tb = $tbPrefix . $i
-
-sql select count(*) from $tb interval(1d)
-print ===>rows $rows, data $data01
-if $rows != 1 then
- return -1
-endi
-if $data01 != 20 then
- return -1
-endi
-
-sql select count(*) from $mt interval(1d)
-print ===>rows $rows, data $data01
-if $rows != 1 then
- return -1
-endi
-if $data01 != 200 then
- return -1
-endi
-
-print =============== step3
-sql create table $stt as select count(*) from $tb interval(1d)
-sql create table $stm as select count(*) from $mt interval(1d)
-
-print sleep 120 seconds
-sleep 120000
-
-sql select * from $stt
-print select count(*) from $stt ===> $data00 $data01
-if $rows != 1 then
- return -1
-endi
-if $data01 != 20 then
- return -1
-endi
-
-sql select * from $stm
-print select * from $stm ===> $data00 $data01
-if $rows != 1 then
- return -1
-endi
-if $data01 != 200 then
- return -1
-endi
-
-print =============== step4
-system sh/exec.sh -n dnode1 -s stop
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/exec.sh -n dnode1 -s start
-
-print =============== step5
-print ==> renew cache
-sql reset query cache
-sleep 1000
-
-
-print =============== step6
-sql create database $db
-sql use $db
-sql create table $mt (ts timestamp, tbcol bigint, tbcol2 bigint ) TAGS(tgcol int)
-$i = 0
-while $i < 5
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( 0 )
-
- $x = -400
- $y = 0
- while $y < $rowNum
- $ms = $x . m
- sql insert into $tb values (1626739200000 $ms , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-
-print =============== step7
-
-sql select count(*) from $tb interval(1d)
-print ===>rows $rows, data $data01
-if $rows != 1 then
- return -1
-endi
-if $data01 != 20 then
- return -1
-endi
-
-sql select count(*) from $mt interval(1d)
-print ===>rows $rows, data $data01
-if $rows != 1 then
- return -1
-endi
-if $data01 != 100 then
- return -1
-endi
-
-print =============== step8
-sql create table $stt as select count(*) from $tb interval(1d)
-sql create table $stm as select count(*) from $mt interval(1d)
-
-print sleep 120 seconds
-sleep 120000
-
-sql select * from $stt
-sleep 1000
-print ===>rows $rows, data $data01
-if $rows != 1 then
- return -1
-endi
-if $data01 != 20 then
- return -1
-endi
-
-sql select * from $stm
-print ===>rows $rows, data $data01
-if $rows != 1 then
- return -1
-endi
-if $data01 != 100 then
- return -1
-endi
-
-
diff --git a/tests/script/general/stream/stream_1970.sim b/tests/script/general/stream/stream_1970.sim
deleted file mode 100644
index 30a733c08ff37d193df688ee956f3c5911671ddf..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/stream_1970.sim
+++ /dev/null
@@ -1,73 +0,0 @@
-system sh/stop_dnodes.sh
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print ======================== dnode1 start
-
-$dbPrefix = s3_db
-$tbPrefix = s3_tb
-$mtPrefix = s3_mt
-$stPrefix = s3_st
-$tbNum = 10
-$rowNum = 20
-$totalNum = 200
-
-print =============== step1
-$i = 0
-$db = $dbPrefix . $i
-$mt = $mtPrefix . $i
-$st = $stPrefix . $i
-
-sql drop databae $db -x step1
-step1:
-sql create database $db keep 36500
-sql use $db
-sql create stable $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
-
-sql create table cq1 as select count(*) from $mt interval(10s);
-
-sleep 1000
-
-sql create table $st using $mt tags(1);
-
-sql insert into $st values (-50000, 1, 1.0);
-sql insert into $st values (-10000, 1, 1.0);
-sql insert into $st values (10000, 1, 1.0);
-
-
-$i = 0
-while $i < 12
- sql select * from cq1;
-
- if $rows != 3 then
- sleep 10000
- else
- if $data00 != @70-01-01 07:59:10.000@ then
- return -1
- endi
- if $data01 != 1 then
- return -1
- endi
- if $data10 != @70-01-01 07:59:50.000@ then
- return -1
- endi
- if $data11 != 1 then
- return -1
- endi
- if $data20 != @70-01-01 08:00:10.000@ then
- return -1
- endi
- if $data21 != 1 then
- return -1
- endi
- $i = 12
- endi
-
- $i = $i + 1
-endw
-
diff --git a/tests/script/general/stream/stream_3.sim b/tests/script/general/stream/stream_3.sim
deleted file mode 100644
index b043993814db2ea5bf8c6a3513317efca50b51d3..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/stream_3.sim
+++ /dev/null
@@ -1,201 +0,0 @@
-system sh/stop_dnodes.sh
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print ======================== dnode1 start
-
-$dbPrefix = s3_db
-$tbPrefix = s3_tb
-$mtPrefix = s3_mt
-$stPrefix = s3_st
-$tbNum = 10
-$rowNum = 20
-$totalNum = 200
-
-print =============== step1
-$i = 0
-$db = $dbPrefix . $i
-$mt = $mtPrefix . $i
-$st = $stPrefix . $i
-
-sql drop databae $db -x step1
-step1:
-sql create database $db
-sql use $db
-sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
-
-$i = 0
-while $i < $tbNum
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( $i )
-
- $x = -400
- $y = 0
- while $y < $rowNum
- $ms = $x . m
- sql insert into $tb values (1626739200000 $ms , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-sleep 100
-
-print =============== step2 c1
-$i = 1
-$tb = $tbPrefix . $i
-
-sql select count(*) from $tb interval(1d)
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c1
-sql create table $st as select count(*) from $tb interval(1d)
-
-print =============== step3 c2
-sql select count(tbcol) from $tb interval(1d)
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c2
-sql create table $st as select count(tbcol) from $tb interval(1d)
-
-print =============== step4 c3
-sql select count(tbcol2) from $tb interval(1d)
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql create table $st as select count(tbcol2) from $tb interval(1d)
-
-print =============== step5
-print sleep 120 seconds
-sleep 120000
-
-print =============== step6
-$st = $stPrefix . c1
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c2
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-print =============== step7
-
-system sh/exec.sh -n dnode1 -s stop
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/exec.sh -n dnode1 -s start
-
-sleep 4000
-print ======================== dnode1 start
-
-$dbPrefix = stst3db
-$tbPrefix = stst3tb
-$mtPrefix = stst3mt
-$stPrefix = stst3st
-$tbNum = 10
-$rowNum = 20
-$totalNum = 200
-
-print =============== step8
-$i = 0
-$db = $dbPrefix . $i
-$mt = $mtPrefix . $i
-$st = $stPrefix . $i
-
-sql drop databae $db -x step8
-step8:
-sql create database $db
-sql use $db
-sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
-
-$i = 0
-while $i < $tbNum
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( $i )
-
- $x = -400
- $y = 0
- while $y < $rowNum
- $ms = $x . m
- sql insert into $tb values (1626739200000 $ms , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-sleep 100
-
-print =============== step9 c3
-$i = 1
-$tb = $tbPrefix . $i
-
-sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
-print select count(*), count(tbcol), count(tbcol2) from $tb interval(1d) ===> $data00 $data01 $data02, $data03
-if $data01 != $rowNum then
- return -1
-endi
-if $data02 != $rowNum then
- return -1
-endi
-if $data03 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
-
-print =============== step10
-print sleep 120 seconds
-sleep 120000
-
-print =============== step11
-#$st = $stPrefix . c3
-#sql select * from $st -x step11
-# print ===> select * from $st first time should be error
-# return -1
-#step11:
-
-print =============== step12
-$st = $stPrefix . c3
-sql select * from $st
-print ===> select * from $st
-print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-if $data01 != $rowNum then
- return -1
-endi
-if $data02 != $rowNum then
- return -1
-endi
-if $data03 != $rowNum then
- return -1
-endi
-
-
diff --git a/tests/script/general/stream/stream_restart.sim b/tests/script/general/stream/stream_restart.sim
deleted file mode 100644
index 54a60a00811de0253d1ad1110b69f2587f707aa1..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/stream_restart.sim
+++ /dev/null
@@ -1,142 +0,0 @@
-system sh/stop_dnodes.sh
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print ======================== dnode1 start
-
-$dbPrefix = sr_db
-$tbPrefix = sr_tb
-$mtPrefix = sr_mt
-$stPrefix = sr_st
-$tbNum = 10
-$rowNum = 200
-$totalNum = 200
-
-print =============== step1
-
-$i = 0
-$db = $dbPrefix . $i
-$mt = $mtPrefix . $i
-$st = $stPrefix . $i
-
-sql create database $db
-sql use $db
-sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
-
-$i = 0
-while $i < $tbNum
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( $i )
-
- $x = 0
- $y = 0
- while $y < $rowNum
- $ms = $x . s
- sql insert into $tb values (1626739200000 + $ms , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-sleep 100
-
-print =============== step2
-
-$i = 1
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
-sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(10s)
-
-$i = 5
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
-sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(10s)
-
-$i = 8
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
-sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(10s)
-
-sql show tables
-if $rows != 13 then
- return -1
-endi
-
-print =============== step3
-sleep 2000
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 1000
-system sh/exec.sh -n dnode1 -s start
-
-print =============== step4
-print sleep 120 seconds
-sleep 120000
-
-print =============== step5
-$i = 1
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select * from $tb
-print $tb ==> $rows $data00 $data01
-if $rows != $rowNum then
- return -1
-endi
-
-$i = 5
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select * from $tb
-print $tb ==> $rows $data00 $data01
-if $rows != $rowNum then
- return -1
-endi
-
-$i = 8
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select * from $tb
-print $tb ==> $rows $data00 $data01
-if $rows != $rowNum then
- return -1
-endi
-
-print =============== step6
-
-$i = 1
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select * from $st
-print $st ==> $rows $data00 $data01
-if $rows <= 1 then
- return -1
-endi
-
-$i = 5
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select * from $st
-print $st ==> $rows $data00 $data01
-if $rows <= 1 then
- return -1
-endi
-
-$i = 8
-$tb = $tbPrefix . $i
-$st = $stPrefix . $i
-sql select * from $st
-print $st ==> $rows $data00 $data01
-if $rows <= 1 then
- return -1
-endi
-
-
diff --git a/tests/script/general/stream/table_del.sim b/tests/script/general/stream/table_del.sim
deleted file mode 100644
index 34673605d63b39b9fd809aaedd94f4e6ef80f5b7..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/table_del.sim
+++ /dev/null
@@ -1,90 +0,0 @@
-system sh/stop_dnodes.sh
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print ======================== dnode1 start
-
-$dbPrefix = td_db
-$tbPrefix = td_tb
-$mtPrefix = td_mt
-$stPrefix = td_st
-$tbNum = 10
-$rowNum = 20
-$totalNum = 200
-
-print =============== step1
-$i = 0
-$db = $dbPrefix . $i
-$mt = $mtPrefix . $i
-$st = $stPrefix . $i
-
-sql drop databae $db -x step1
-step1:
-sql create database $db
-sql use $db
-sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
-
-$i = 0
-while $i < $tbNum
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( $i )
-
- $x = -400
- $y = 0
- while $y < $rowNum
- $ms = $x . m
- sql insert into $tb values (1626739200000 $ms , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-sleep 100
-
-print =============== step2 c3
-$i = 1
-$tb = $tbPrefix . $i
-
-sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
-print select count(*), count(tbcol), count(tbcol2) from $tb interval(1d) ===> $data00 $data01 $data02, $data03
-if $data01 != $rowNum then
- return -1
-endi
-if $data02 != $rowNum then
- return -1
-endi
-if $data03 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
-
-print =============== step3
-sql drop table $tb
-
-print =============== step4
-print sleep 120 seconds
-sleep 120000
-
-print =============== step5
-$st = $stPrefix . c3
-sql select * from $st
-print ===> select * from $st
-print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-if $data01 != null then
- return -1
-endi
-if $data02 != null then
- return -1
-endi
-if $data03 != null then
- return -1
-endi
diff --git a/tests/script/general/stream/table_replica1_vnoden.sim b/tests/script/general/stream/table_replica1_vnoden.sim
deleted file mode 100644
index 4a6c4fe0462fc675e13785905ff1b707815fd168..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/table_replica1_vnoden.sim
+++ /dev/null
@@ -1,299 +0,0 @@
-system sh/stop_dnodes.sh
-
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
-system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3
-system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
-sql connect
-
-print ======================== dnode1 start
-
-$dbPrefix = t1v_db
-$tbPrefix = t1v_tb
-$mtPrefix = t1v_mt
-$stPrefix = t1v_st
-$tbNum = 10
-$rowNum = 20
-$totalNum = 200
-
-print =============== step1
-$i = 0
-$db = $dbPrefix . $i
-$mt = $mtPrefix . $i
-$st = $stPrefix . $i
-
-sql drop databae $db -x step1
-step1:
-sql create database $db
-sql use $db
-sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
-
-$i = 0
-while $i < $tbNum
- $tb = $tbPrefix . $i
- sql create table $tb using $mt tags( $i )
-
- $x = -400
- $y = 0
- while $y < $rowNum
- $ms = $x . m
- sql insert into $tb values (1626739200000 $ms , $y , $y )
- $x = $x + 1
- $y = $y + 1
- endw
-
- $i = $i + 1
-endw
-
-sleep 100
-
-print =============== step2 c1
-$i = 1
-$tb = $tbPrefix . $i
-
-sql select count(*) from $tb interval(1d)
-print select count(*) from $tb interval(1d) ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c1
-sql create table $st as select count(*) from $tb interval(1d)
-
-print =============== step3 c2
-sql select count(tbcol) from $tb interval(1d)
-print select count(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c2
-sql create table $st as select count(tbcol) from $tb interval(1d)
-
-print =============== step4 c3
-sql select count(tbcol2) from $tb interval(1d)
-print select count(tbcol2) from $tb interval(1d) ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql create table $st as select count(tbcol2) from $tb interval(1d)
-
-print =============== step5 avg
-sql select avg(tbcol) from $tb interval(1d)
-print select avg(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != 9.500000000 then
- return -1
-endi
-
-$st = $stPrefix . av
-sql create table $st as select avg(tbcol) from $tb interval(1d)
-
-print =============== step6 su
-sql select sum(tbcol) from $tb interval(1d)
-print select sum(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != 190 then
- return -1
-endi
-
-$st = $stPrefix . su
-sql create table $st as select sum(tbcol) from $tb interval(1d)
-
-print =============== step7 mi
-sql select min(tbcol) from $tb interval(1d)
-print select min(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != 0 then
- return -1
-endi
-
-$st = $stPrefix . mi
-sql create table $st as select min(tbcol) from $tb interval(1d)
-
-print =============== step8 ma
-sql select max(tbcol) from $tb interval(1d)
-print select max(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != 19 then
- return -1
-endi
-
-$st = $stPrefix . ma
-sql create table $st as select max(tbcol) from $tb interval(1d)
-
-print =============== step9 fi
-sql select first(tbcol) from $tb interval(1d)
-print select first(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != 0 then
- return -1
-endi
-
-$st = $stPrefix . fi
-sql create table $st as select first(tbcol) from $tb interval(1d)
-
-print =============== step10 la
-sql select last(tbcol) from $tb interval(1d)
-print select last(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != 19 then
- return -1
-endi
-
-$st = $stPrefix . la
-sql create table $st as select last(tbcol) from $tb interval(1d)
-
-print =============== step11 st
-sql select stddev(tbcol) from $tb interval(1d)
-print select stddev(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != 5.766281297 then
- return -1
-endi
-
-$st = $stPrefix . st
-sql create table $st as select stddev(tbcol) from $tb interval(1d)
-
-print =============== step12 le
-sql select leastsquares(tbcol, 1, 1) from $tb interval(1d)
-print select leastsquares(tbcol, 1, 1) from $tb interval(1d) ===> $data00 $data01
-#if $data01 != @(0.000017, -25362055.126740)@ then
-# return -1
-#endi
-
-$st = $stPrefix . le
-sql create table $st as select leastsquares(tbcol, 1, 1) from $tb interval(1d)
-
-print =============== step13 pe
-
-sql select percentile(tbcol, 1) from $tb interval(1d)
-print select percentile(tbcol, 1) from $tb interval(1d) ===> $data00 $data01
-if $data01 != 0.190000000 then
- return -1
-endi
-
-$st = $stPrefix . pe
-sql create table $st as select percentile(tbcol, 1) from $tb interval(1d)
-
-print =============== step14 wh
-sql select count(tbcol) from $tb where ts < 1626739440001 interval(1d)
-print select count(tbcol) from $tb where ts < 1626739440001 interval(1d) ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . wh
-#sql create table $st as select count(tbcol) from $tb where ts < 1626739200000 + 4m interval(1d)
-
-print =============== step15 as
-sql select count(tbcol) from $tb interval(1d)
-print select count(tbcol) from $tb interval(1d) ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . as
-sql create table $st as select count(tbcol) as c from $tb interval(1d)
-
-print =============== step16
-print sleep 120 seconds
-sleep 120000
-
-print =============== step17
-$st = $stPrefix . c1
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c2
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . c3
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
-
-$st = $stPrefix . av
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 9.500000000 then
- return -1
-endi
-
-$st = $stPrefix . su
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 190 then
- return -1
-endi
-
-$st = $stPrefix . mi
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 0 then
- return -1
-endi
-
-$st = $stPrefix . ma
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 19 then
- return -1
-endi
-
-$st = $stPrefix . fi
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 0 then
- return -1
-endi
-
-$st = $stPrefix . la
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 19 then
- return -1
-endi
-
-$st = $stPrefix . st
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 5.766281297 then
- return -1
-endi
-
-$st = $stPrefix . le
-sql select * from $st
-#print ===> select * from $st ===> $data00 $data01
-#if $data01 != @(0.000017, -25270086.331047)@ then
-# return -1
-#endi
-
-$st = $stPrefix . pe
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != 0.190000000 then
- return -1
-endi
-
-$st = $stPrefix . wh
-#sql select * from $st
-#print ===> select * from $st ===> $data00 $data01
-#if $data01 != $rowNum then
-# return -1
-#endi
-
-$st = $stPrefix . as
-sql select * from $st
-print ===> select * from $st ===> $data00 $data01
-if $data01 != $rowNum then
- return -1
-endi
diff --git a/tests/script/general/stream/testSuite.sim b/tests/script/general/stream/testSuite.sim
deleted file mode 100644
index 4a9912b848f1976903199ad314352e70db0ca059..0000000000000000000000000000000000000000
--- a/tests/script/general/stream/testSuite.sim
+++ /dev/null
@@ -1,6 +0,0 @@
-run general/stream/stream_3.sim
-run general/stream/stream_restart.sim
-run general/stream/table_del.sim
-run general/stream/metrics_del.sim
-run general/stream/table_replica1_vnoden.sim
-run general/stream/metrics_replica1_vnoden.sim
\ No newline at end of file
diff --git a/tests/script/general/vector/testSuite.sim b/tests/script/general/vector/testSuite.sim
deleted file mode 100644
index f0b9fef9912699f5e8ed86b322c30db2d4210c83..0000000000000000000000000000000000000000
--- a/tests/script/general/vector/testSuite.sim
+++ /dev/null
@@ -1,11 +0,0 @@
-run general/vector/metrics_field.sim
-run general/vector/metrics_mix.sim
-run general/vector/metrics_query.sim
-run general/vector/metrics_tag.sim
-run general/vector/metrics_time.sim
-run general/vector/multi.sim
-run general/vector/single.sim
-run general/vector/table_field.sim
-run general/vector/table_mix.sim
-run general/vector/table_query.sim
-run general/vector/table_time.sim
diff --git a/tests/script/general/wal/maxtables.sim b/tests/script/general/wal/maxtables.sim
deleted file mode 100644
index acd6af1d1a1dbb02a3aef35fe2d9c07cae74b529..0000000000000000000000000000000000000000
--- a/tests/script/general/wal/maxtables.sim
+++ /dev/null
@@ -1,46 +0,0 @@
-system sh/stop_dnodes.sh
-system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 100
-system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
-system sh/cfg.sh -n dnode1 -c tableIncStepPerVnode -v 2
-
-
-print ============== deploy
-system sh/exec.sh -n dnode1 -s start
-sleep 3001
-sql connect
-
-sql create database d1
-sql use d1
-sql create table st (ts timestamp, tbcol int) TAGS(tgcol int)
-
-$i = 0
-while $i < 100
- $tb = t . $i
- sql create table $tb using st tags( $i )
- sql insert into $tb values (now , $i )
- $i = $i + 1
-endw
-
-sql_error sql create table tt (ts timestamp, i int)
-
-print =============== step3
-sql select * from st;
-if $rows != 100 then
- return -1
-endi
-
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
-system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
-sleep 2000
-
-print =============== step4
-system sh/exec.sh -n dnode1 -s start
-sleep 2000
-
-sql select * from st;
-if $rows != 100 then
- return -1
-endi
-
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/general/wal/sync.sim b/tests/script/general/wal/sync.sim
deleted file mode 100644
index 3a8952391818bc02244f7455f694b6c1fe834288..0000000000000000000000000000000000000000
--- a/tests/script/general/wal/sync.sim
+++ /dev/null
@@ -1,146 +0,0 @@
-system sh/stop_dnodes.sh
-
-system sh/deploy.sh -n dnode1 -i 1
-system sh/deploy.sh -n dnode2 -i 2
-system sh/deploy.sh -n dnode3 -i 3
-
-system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3
-system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
-system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
-
-system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
-system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
-system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
-
-system sh/cfg.sh -n dnode1 -c http -v 1
-system sh/cfg.sh -n dnode2 -c http -v 1
-system sh/cfg.sh -n dnode3 -c http -v 1
-
-system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 20000
-system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 20000
-system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 20000
-
-system sh/cfg.sh -n dnode1 -c replica -v 3
-system sh/cfg.sh -n dnode2 -c replica -v 3
-system sh/cfg.sh -n dnode3 -c replica -v 3
-
-system sh/cfg.sh -n dnode1 -c maxSQLLength -v 940032
-system sh/cfg.sh -n dnode2 -c maxSQLLength -v 940032
-system sh/cfg.sh -n dnode3 -c maxSQLLength -v 940032
-
-print ============== deploy
-
-system sh/exec.sh -n dnode1 -s start
-sql connect
-
-sql create dnode $hostname2
-sql create dnode $hostname3
-system sh/exec.sh -n dnode2 -s start
-system sh/exec.sh -n dnode3 -s start
-
-print =============== step1
-$x = 0
-show1:
- $x = $x + 1
- sleep 1000
- if $x == 10 then
- return -1
- endi
-sql show mnodes -x show1
-$mnode1Role = $data2_1
-print mnode1Role $mnode1Role
-$mnode2Role = $data2_2
-print mnode2Role $mnode2Role
-$mnode3Role = $data2_3
-print mnode3Role $mnode3Role
-
-if $mnode1Role != master then
- goto show1
-endi
-if $mnode2Role != slave then
- goto show1
-endi
-if $mnode3Role != slave then
- goto show1
-endi
-
-print =============== step2
-sql create database d1 replica 3
-sql use d1
-
-sql create table table_rest (ts timestamp, i int)
-print sql length is 870KB
-restful d1 table_rest 1591072800 30000
-restful d1 table_rest 1591172800 30000
-restful d1 table_rest 1591272800 30000
-restful d1 table_rest 1591372800 30000
-restful d1 table_rest 1591472800 30000
-restful d1 table_rest 1591572800 30000
-restful d1 table_rest 1591672800 30000
-restful d1 table_rest 1591772800 30000
-restful d1 table_rest 1591872800 30000
-restful d1 table_rest 1591972800 30000
-
-sleep 100
-sql select * from table_rest;
-print rows: $rows
-if $rows != 300000 then
- return -1
-endi
-
-print =============== step3
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sql select * from table_rest;
-print rows: $rows
-if $rows != 300000 then
- return -1
-endi
-system sh/exec.sh -n dnode1 -s start -x SIGINT
-
-$x = 0
-a1:
- $x = $x + 1
- sleep 1000
- if $x == 40 then
- return -1
- endi
-
-sql show vgroups
-print online vnodes $data03
-if $data03 != 3 then
- goto a1
-endi
-
-print =============== step4
-system sh/exec.sh -n dnode2 -s stop -x SIGINT
-sql select * from table_rest;
-print rows: $rows
-if $rows != 300000 then
- return -1
-endi
-system sh/exec.sh -n dnode2 -s start -x SIGINT
-$x = 0
-a2:
- $x = $x + 1
- sleep 1000
- if $x == 40 then
- return -1
- endi
-
-sql show vgroups
-print online vnodes $data03
-if $data03 != 3 then
- goto a2
-endi
-
-print =============== step5
-system sh/exec.sh -n dnode3 -s stop -x SIGINT
-sql select * from table_rest;
-print rows: $rows
-if $rows != 300000 then
- return -1
-endi
-
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
-system sh/exec.sh -n dnode2 -s stop -x SIGINT
-system sh/exec.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file
diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt
index 6826258151b2894b00f72c63aecf4941ac8dafef..9c7d84b21b94f7e59d40c08c2d1c8744f81ed68b 100644
--- a/tests/script/jenkins/basic.txt
+++ b/tests/script/jenkins/basic.txt
@@ -7,7 +7,7 @@
./test.sh -f tsim/user/privilege_db.sim
./test.sh -f tsim/user/privilege_sysinfo.sim
-## ---- db
+# ---- db
./test.sh -f tsim/db/alter_option.sim
# ./test.sh -f tsim/db/alter_replica_13.sim
# ./test.sh -f tsim/db/alter_replica_31.sim
@@ -45,6 +45,12 @@
# ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v3.sim
# ./test.sh -f tsim/dnode/vnode_clean.sim
+# ---- import
+./test.sh -f tsim/import/basic.sim
+./test.sh -f tsim/import/commit.sim
+./test.sh -f tsim/import/large.sim
+./test.sh -f tsim/import/replica1.sim
+
# ---- insert
./test.sh -f tsim/insert/basic0.sim
./test.sh -f tsim/insert/basic1.sim
@@ -81,7 +87,7 @@
./test.sh -f tsim/mnode/basic1.sim
./test.sh -f tsim/mnode/basic2.sim
./test.sh -f tsim/mnode/basic3.sim
-#./test.sh -f tsim/mnode/basic4.sim
+./test.sh -f tsim/mnode/basic4.sim
./test.sh -f tsim/mnode/basic5.sim
# ---- show
@@ -96,11 +102,11 @@
./test.sh -f tsim/stream/basic2.sim
./test.sh -f tsim/stream/drop_stream.sim
./test.sh -f tsim/stream/distributeInterval0.sim
-# ./test.sh -f tsim/stream/distributeIntervalRetrive0.sim
+./test.sh -f tsim/stream/distributeIntervalRetrive0.sim
# ./test.sh -f tsim/stream/distributesession0.sim
./test.sh -f tsim/stream/session0.sim
./test.sh -f tsim/stream/session1.sim
-# ./test.sh -f tsim/stream/state0.sim
+./test.sh -f tsim/stream/state0.sim
./test.sh -f tsim/stream/triggerInterval0.sim
# ./test.sh -f tsim/stream/triggerSession0.sim
./test.sh -f tsim/stream/partitionby.sim
@@ -108,6 +114,7 @@
# ./test.sh -f tsim/stream/schedSnode.sim
./test.sh -f tsim/stream/windowClose.sim
./test.sh -f tsim/stream/ignoreExpiredData.sim
+./test.sh -f tsim/stream/sliding.sim
# ---- transaction
./test.sh -f tsim/trans/lossdata1.sim
@@ -170,6 +177,7 @@
# --- valgrind
./test.sh -f tsim/valgrind/checkError1.sim
./test.sh -f tsim/valgrind/checkError2.sim
+./test.sh -f tsim/valgrind/checkError3.sim
# --- vnode
# ./test.sh -f tsim/vnode/replica3_basic.sim
@@ -196,5 +204,108 @@
# --- scalar
./test.sh -f tsim/scalar/in.sim
+./test.sh -f tsim/scalar/scalar.sim
+
+# ---- alter
+./test.sh -f tsim/alter/cached_schema_after_alter.sim
+./test.sh -f tsim/alter/dnode.sim
+#./test.sh -f tsim/alter/table.sim
+
+# ---- cache
+./test.sh -f tsim/cache/new_metrics.sim
+./test.sh -f tsim/cache/restart_table.sim
+./test.sh -f tsim/cache/restart_metrics.sim
+
+# ---- column
+./test.sh -f tsim/column/commit.sim
+./test.sh -f tsim/column/metrics.sim
+./test.sh -f tsim/column/table.sim
+
+# ---- compress
+./test.sh -f tsim/compress/commitlog.sim
+./test.sh -f tsim/compress/compress2.sim
+./test.sh -f tsim/compress/compress.sim
+./test.sh -f tsim/compress/uncompress.sim
+
+# ---- compute
+#./test.sh -f tsim/compute/avg.sim
+#./test.sh -f tsim/compute/block_dist.sim
+#./test.sh -f tsim/compute/bottom.sim
+#./test.sh -f tsim/compute/count.sim
+#./test.sh -f tsim/compute/diff.sim
+#./test.sh -f tsim/compute/diff2.sim
+#./test.sh -f tsim/compute/first.sim
+#./test.sh -f tsim/compute/interval.sim
+#./test.sh -f tsim/compute/last_row.sim
+#./test.sh -f tsim/compute/last.sim
+#./test.sh -f tsim/compute/leastsquare.sim
+#./test.sh -f tsim/compute/max.sim
+#./test.sh -f tsim/compute/min.sim
+#./test.sh -f tsim/compute/null.sim
+./test.sh -f tsim/compute/percentile.sim
+./test.sh -f tsim/compute/stddev.sim
+#./test.sh -f tsim/compute/sum.sim
+./test.sh -f tsim/compute/top.sim
+
+# ---- field
+./test.sh -f tsim/field/2.sim
+./test.sh -f tsim/field/3.sim
+./test.sh -f tsim/field/4.sim
+./test.sh -f tsim/field/5.sim
+./test.sh -f tsim/field/6.sim
+./test.sh -f tsim/field/binary.sim
+./test.sh -f tsim/field/bigint.sim
+./test.sh -f tsim/field/bool.sim
+./test.sh -f tsim/field/double.sim
+./test.sh -f tsim/field/float.sim
+./test.sh -f tsim/field/int.sim
+./test.sh -f tsim/field/single.sim
+./test.sh -f tsim/field/smallint.sim
+./test.sh -f tsim/field/tinyint.sim
+./test.sh -f tsim/field/unsigined_bigint.sim
+
+# ---- vector
+./test.sh -f tsim/vector/metrics_field.sim
+./test.sh -f tsim/vector/metrics_mix.sim
+./test.sh -f tsim/vector/metrics_query.sim
+./test.sh -f tsim/vector/metrics_tag.sim
+./test.sh -f tsim/vector/metrics_time.sim
+./test.sh -f tsim/vector/multi.sim
+./test.sh -f tsim/vector/single.sim
+./test.sh -f tsim/vector/table_field.sim
+./test.sh -f tsim/vector/table_mix.sim
+./test.sh -f tsim/vector/table_query.sim
+./test.sh -f tsim/vector/table_time.sim
+
+# ---- wal
+./test.sh -f tsim/wal/kill.sim
+
+# ---- tag
+./test.sh -f tsim/tag/3.sim
+./test.sh -f tsim/tag/4.sim
+./test.sh -f tsim/tag/5.sim
+#./test.sh -f tsim/tag/6.sim
+#./test.sh -f tsim/tag/add.sim
+./test.sh -f tsim/tag/bigint.sim
+./test.sh -f tsim/tag/binary_binary.sim
+./test.sh -f tsim/tag/binary.sim
+./test.sh -f tsim/tag/bool_binary.sim
+./test.sh -f tsim/tag/bool_int.sim
+./test.sh -f tsim/tag/bool.sim
+#./test.sh -f tsim/tag/change.sim
+#./test.sh -f tsim/tag/column.sim
+#./test.sh -f tsim/tag/commit.sim
+#./test.sh -f tsim/tag/create.sim
+#./test.sh -f tsim/tag/delete.sim
+#./test.sh -f tsim/tag/double.sim
+#./test.sh -f tsim/tag/filter.sim
+#./test.sh -f tsim/tag/float.sim
+./test.sh -f tsim/tag/int_binary.sim
+./test.sh -f tsim/tag/int_float.sim
+./test.sh -f tsim/tag/int.sim
+#./test.sh -f tsim/tag/set.sim
+./test.sh -f tsim/tag/smallint.sim
+./test.sh -f tsim/tag/tinyint.sim
+
#======================b1-end===============
diff --git a/tests/script/sh/deploy.sh b/tests/script/sh/deploy.sh
index de7b8ecfbf1aa45d32b99378285191a966a65e3d..5f497a248f7aadd1e060cd44ee9073d792bf14ba 100755
--- a/tests/script/sh/deploy.sh
+++ b/tests/script/sh/deploy.sh
@@ -127,8 +127,8 @@ echo "dataDir $DATA_DIR" >> $TAOS_CFG
echo "logDir $LOG_DIR" >> $TAOS_CFG
echo "debugFlag 0" >> $TAOS_CFG
echo "tmrDebugFlag 131" >> $TAOS_CFG
-echo "uDebugFlag 131" >> $TAOS_CFG
-echo "rpcDebugFlag 131" >> $TAOS_CFG
+echo "uDebugFlag 143" >> $TAOS_CFG
+echo "rpcDebugFlag 143" >> $TAOS_CFG
echo "jniDebugFlag 143" >> $TAOS_CFG
echo "qDebugFlag 143" >> $TAOS_CFG
echo "cDebugFlag 143" >> $TAOS_CFG
diff --git a/tests/script/sh/exec.bat b/tests/script/sh/exec.bat
index e4c998c25b1f0d38f02c793b4b01755cd113b362..88dd43349ed9d49774faafe827b77126286c741d 100644
--- a/tests/script/sh/exec.bat
+++ b/tests/script/sh/exec.bat
@@ -77,7 +77,10 @@ goto :eof
:check_offline
sleep 1
for /f "tokens=2" %%C in ('wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" get processId ^| xargs echo') do (
- echo check taosd offline
- goto :check_offline
+ for /f "tokens=1" %%D in ('ps ^| grep %%C') do (
+ echo kill -INT %%D
+ echo check taosd offline %NODE_NAME% %%C %%D
+ goto :check_offline
+ )
)
goto :eof
\ No newline at end of file
diff --git a/tests/script/test-all.bat b/tests/script/test-all.bat
index f771f8fcb6541720bd6b9ee68f297a8d443cde93..056d989e6b1c668c6a3bde70d3e5ab4d0f86ed58 100644
--- a/tests/script/test-all.bat
+++ b/tests/script/test-all.bat
@@ -24,7 +24,7 @@ for /F "usebackq tokens=*" %%i in (!caseFile!) do (
)
)
)
-exit !exitNum!
+exit /b !exitNum!
:colorEcho
set timeNow=%time%
diff --git a/tests/script/general/alter/cached_schema_after_alter.sim b/tests/script/tsim/alter/cached_schema_after_alter.sim
similarity index 100%
rename from tests/script/general/alter/cached_schema_after_alter.sim
rename to tests/script/tsim/alter/cached_schema_after_alter.sim
diff --git a/tests/script/tsim/alter/dnode.sim b/tests/script/tsim/alter/dnode.sim
new file mode 100644
index 0000000000000000000000000000000000000000..35620f17aa81b98028c9a159290ce6d71bbdcbe7
--- /dev/null
+++ b/tests/script/tsim/alter/dnode.sim
@@ -0,0 +1,62 @@
+system sh/stop_dnodes.sh
+system sh/deploy.sh -n dnode1 -i 1
+system sh/exec.sh -n dnode1 -s start
+sql connect
+
+print ======== step1
+sql alter dnode 1 'resetlog'
+sql alter dnode 1 'monitor' '1'
+sql alter dnode 1 'monitor' '0'
+sql alter dnode 1 'monitor 1'
+sql alter dnode 1 'monitor 0'
+
+print ======== step2
+sql_error alter dnode 1 'resetquerycache'
+sql alter dnode 1 'debugFlag 135'
+sql alter dnode 1 'dDebugFlag 131'
+sql alter dnode 1 'vDebugFlag 131'
+sql alter dnode 1 'mDebugFlag 131'
+sql alter dnode 1 'wDebugFlag 131'
+sql alter dnode 1 'sDebugFlag 131'
+sql alter dnode 1 'tsdbDebugFlag 131'
+sql alter dnode 1 'tqDebugFlag 131'
+sql alter dnode 1 'fsDebugFlag 131'
+sql alter dnode 1 'udfDebugFlag 131'
+sql alter dnode 1 'smaDebugFlag 131'
+sql alter dnode 1 'idxDebugFlag 131'
+sql alter dnode 1 'tmrDebugFlag 131'
+sql alter dnode 1 'uDebugFlag 131'
+sql alter dnode 1 'smaDebugFlag 131'
+sql alter dnode 1 'rpcDebugFlag 131'
+sql alter dnode 1 'qDebugFlag 131'
+
+sql_error alter dnode 2 'wDebugFlag 135'
+sql_error alter dnode 2 'tmrDebugFlag 135'
+
+print ======== step3
+sql_error alter $hostname1 debugFlag 135
+sql_error alter $hostname1 monDebugFlag 135
+sql_error alter $hostname1 vDebugFlag 135
+sql_error alter $hostname1 mDebugFlag 135
+sql_error alter dnode $hostname2 debugFlag 135
+sql_error alter dnode $hostname2 monDebugFlag 135
+sql_error alter dnode $hostname2 vDebugFlag 135
+sql_error alter dnode $hostname2 mDebugFlag 135
+sql_error alter dnode $hostname1 debugFlag 135
+sql_error alter dnode $hostname1 monDebugFlag 135
+sql_error alter dnode $hostname1 vDebugFlag 135
+sql_error alter dnode $hostname1 tmrDebugFlag 131
+
+print ======== step4
+sql_error sql alter dnode 1 balance 0
+sql_error sql alter dnode 1 balance vnode:1-dnode:1
+sql_error sql alter dnode 1 balance "vnode:1"
+sql_error sql alter dnode 1 balance "vnode:1-dnode:1"
+sql_error sql alter dnode 1 balance "dnode:1-vnode:1"
+sql_error sql alter dnode 1 balance "dnode:1-"
+sql_error sql alter dnode 1 balance "vnode:2-dnod"
+sql alter dnode 1 balance "vnode:2-dnode:1" -x step4
+step4:
+
+print ======= over
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
diff --git a/tests/script/general/alter/table.sim b/tests/script/tsim/alter/table.sim
similarity index 99%
rename from tests/script/general/alter/table.sim
rename to tests/script/tsim/alter/table.sim
index 9ca2f60bdc37f827e0832dc59399bf73732d7748..348bef21fef847b4c58dadfe13e1dd7d51f58b17 100644
--- a/tests/script/general/alter/table.sim
+++ b/tests/script/tsim/alter/table.sim
@@ -315,9 +315,7 @@ endi
print ======== step9
print ======== step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
sql use d1
sql describe tb
@@ -662,8 +660,8 @@ endi
print ======= over
sql drop database d1
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/general/cache/new_metrics.sim b/tests/script/tsim/cache/new_metrics.sim
similarity index 92%
rename from tests/script/general/cache/new_metrics.sim
rename to tests/script/tsim/cache/new_metrics.sim
index eb9b042483251856c2ac7b3f973ab31176a8ff56..af7db900704325f6aec6268faa4d8c723e8393d2 100644
--- a/tests/script/general/cache/new_metrics.sim
+++ b/tests/script/tsim/cache/new_metrics.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$i = 0
@@ -38,7 +33,6 @@ while $i < 5
endw
print =============== step2
-
sql select * from $tb order by ts desc
print ===>rows $rows, data $data01
if $rows != 20 then
@@ -67,7 +61,6 @@ if $data00 != 100 then
endi
print =============== step3
-
sql show stables
if $rows != 1 then
return -1
@@ -75,12 +68,8 @@ endi
if $data00 != $mt then
return -1
endi
-if $data04 != 5 then
- return -1
-endi
print =============== step4
-
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
@@ -99,7 +88,6 @@ sql reset query cache
sleep 1000
print =============== step5
-
sql select * from $tb order by ts desc
print ===>rows $rows, data $data01
if $rows != 20 then
@@ -128,7 +116,6 @@ if $data00 != 200 then
endi
print =============== step6
-
sql show stables
if $rows != 1 then
return -1
@@ -136,8 +123,5 @@ endi
if $data00 != $mt then
return -1
endi
-if $data04 != 10 then
- return -1
-endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
diff --git a/tests/script/general/cache/restart_metrics.sim b/tests/script/tsim/cache/restart_metrics.sim
similarity index 91%
rename from tests/script/general/cache/restart_metrics.sim
rename to tests/script/tsim/cache/restart_metrics.sim
index a1b2365b2aef739d7bdf97ba82b757648285fe97..e144a49bf70109395155d52a1e1ac76cafc4513a 100644
--- a/tests/script/general/cache/restart_metrics.sim
+++ b/tests/script/tsim/cache/restart_metrics.sim
@@ -1,14 +1,9 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
-print ======================== dnode1 start
+print ======================== dnode1 start
$i = 0
$dbPrefix = ca_rm_db
$tbPrefix = ca_rm_tb
@@ -49,9 +44,7 @@ endi
print =============== step2
system sh/exec.sh -n dnode1 -s stop
-sleep 3000
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
print =============== step3
diff --git a/tests/script/general/cache/restart_table.sim b/tests/script/tsim/cache/restart_table.sim
similarity index 86%
rename from tests/script/general/cache/restart_table.sim
rename to tests/script/tsim/cache/restart_table.sim
index 1f7d982a2848a5df443f32a8c2b5c1edb97874d2..b450f6c65499e97bf190c587edaaf5051e4d9f75 100644
--- a/tests/script/general/cache/restart_table.sim
+++ b/tests/script/tsim/cache/restart_table.sim
@@ -1,14 +1,9 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
-print ======================== dnode1 start
+print ======================== dnode1 start
$i = 0
$dbPrefix = ca_rt_db
$tbPrefix = ca_rt_tb
@@ -33,9 +28,7 @@ endi
print =============== step2
system sh/exec.sh -n dnode1 -s stop
-sleep 3000
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
print =============== step3
diff --git a/tests/script/general/column/commit.sim b/tests/script/tsim/column/commit.sim
similarity index 99%
rename from tests/script/general/column/commit.sim
rename to tests/script/tsim/column/commit.sim
index 008bec3bf9dc6c0bd8ca0a4c2b5816a9a22c93b2..43aebb490256b7ba28c2ed99c47a800d4ee2e102 100644
--- a/tests/script/general/column/commit.sim
+++ b/tests/script/tsim/column/commit.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print =============== step1
@@ -25,7 +20,6 @@ if $rows != 1 then
endi
print =============== step2
-
sql insert into d3.t1 values (now -300d,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 );
sql insert into d3.t1 values (now-200d,1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 );
sql insert into d3.t1 values (now-150d,2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 );
@@ -38,7 +32,6 @@ sql insert into d3.t1 values (now,8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8
sql insert into d3.t1 values (now+1d,9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 );
print =============== step3
-
sql select * from d3.mt
if $rows != 10 then
return -1
@@ -89,12 +82,9 @@ endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
print =============== step5
-
sql select * from d3.mt
if $rows != 10 then
return -1
diff --git a/tests/script/general/column/metrics.sim b/tests/script/tsim/column/metrics.sim
similarity index 99%
rename from tests/script/general/column/metrics.sim
rename to tests/script/tsim/column/metrics.sim
index 580e2320cd139af4bd9174f7eecef6dbdef97396..a492f5a2f9027aba1ce332367e92a18da657ce46 100644
--- a/tests/script/general/column/metrics.sim
+++ b/tests/script/tsim/column/metrics.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print =============== step1
@@ -26,7 +21,6 @@ if $rows != 1 then
endi
print =============== step2
-
sql insert into d2.t1 values (now,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 )
sql insert into d2.t1 values (now+1m,1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 )
sql insert into d2.t1 values (now+2m,2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 )
@@ -58,7 +52,6 @@ sql insert into d2.t2 values (now+8m,8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 ,
sql insert into d2.t2 values (now+9m,9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 )
print =============== step3
-
sql select * from d2.mt
if $rows != 20 then
return -1
@@ -157,12 +150,9 @@ endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
print =============== step5
-
sql select * from d2.mt
if $rows != 20 then
return -1
diff --git a/tests/script/general/column/table.sim b/tests/script/tsim/column/table.sim
similarity index 99%
rename from tests/script/general/column/table.sim
rename to tests/script/tsim/column/table.sim
index 46d5de1e82f957ac8ccd223ae28f80286a27a827..07948ebce36f88ae5eef2de51fd11e352d9af86a 100644
--- a/tests/script/general/column/table.sim
+++ b/tests/script/tsim/column/table.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print =============== step1
@@ -19,7 +14,6 @@ if $rows != 1 then
endi
print =============== step2
-
sql insert into d1.t1 values (now,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 )
sql insert into d1.t1 values (now+1m,1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 )
sql insert into d1.t1 values (now+2m,2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 )
@@ -36,7 +30,6 @@ sql insert into d1.t1 values (now+8m,8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 ,
sql insert into d1.t1 values (now+9m,9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 )
print ======= step3
-
sql select * from d1.t1
print select * from d1.t1 => rows $rows
if $rows != 10 then
@@ -129,9 +122,7 @@ endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
print ============== step5
diff --git a/tests/script/general/compress/commitlog.sim b/tests/script/tsim/compress/commitlog.sim
similarity index 93%
rename from tests/script/general/compress/commitlog.sim
rename to tests/script/tsim/compress/commitlog.sim
index e8eab6ed0cd9b5b6c2ea70042bd0f24e92c512a6..d90780bd6c13f1076ce82e5a3320ca86479e435d 100644
--- a/tests/script/general/compress/commitlog.sim
+++ b/tests/script/tsim/compress/commitlog.sim
@@ -1,14 +1,9 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode1 -c comp -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
-print ============================ dnode1 start
+print ============================ dnode1 start
$i = 0
$dbPrefix = db
$tbPrefix = tb
@@ -18,7 +13,6 @@ $tb = $tbPrefix . $i
$N = 2000
print =============== step1
-
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
@@ -87,9 +81,7 @@ endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
print =============== step5
diff --git a/tests/script/general/compress/compress.sim b/tests/script/tsim/compress/compress.sim
similarity index 92%
rename from tests/script/general/compress/compress.sim
rename to tests/script/tsim/compress/compress.sim
index cecfe61229667086d83e963b8833ae9b0fabc2da..766f97450c3b9469b2788fb12cb5099d91cc4163 100644
--- a/tests/script/general/compress/compress.sim
+++ b/tests/script/tsim/compress/compress.sim
@@ -1,15 +1,9 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode1 -c comp -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ============================ dnode1 start
-
$i = 0
$dbPrefix = db
$tbPrefix = tb
@@ -19,7 +13,6 @@ $tb = $tbPrefix . $i
$N = 2000
print =============== step1
-
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
@@ -82,9 +75,7 @@ endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
print =============== step5
diff --git a/tests/script/general/compress/compress2.sim b/tests/script/tsim/compress/compress2.sim
similarity index 93%
rename from tests/script/general/compress/compress2.sim
rename to tests/script/tsim/compress/compress2.sim
index 1e6868eaa6382218e4f4d1b8fb3f69c8762f77c8..87e50cce5bd273abcf82bf960adee78b96bac774 100644
--- a/tests/script/general/compress/compress2.sim
+++ b/tests/script/tsim/compress/compress2.sim
@@ -1,15 +1,9 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode1 -c comp -v 2
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ============================ dnode1 start
-
$i = 0
$dbPrefix = db
$tbPrefix = tb
@@ -82,9 +76,7 @@ endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
print =============== step5
diff --git a/tests/script/general/compress/uncompress.sim b/tests/script/tsim/compress/uncompress.sim
similarity index 93%
rename from tests/script/general/compress/uncompress.sim
rename to tests/script/tsim/compress/uncompress.sim
index 49945dcb79ef69b31aa8cc4e8b0009e2ceb691f1..ccd5db4b0cf473d763a761587830212729cf9810 100644
--- a/tests/script/general/compress/uncompress.sim
+++ b/tests/script/tsim/compress/uncompress.sim
@@ -1,13 +1,9 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode1 -c comp -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
-print ============================ dnode1 start
+print ============================ dnode1 start
$i = 0
$dbPrefix = cp_cp_db
$tbPrefix = cp_cp_tb
@@ -17,7 +13,6 @@ $tb = $tbPrefix . $i
$N = 2000
print =============== step1
-
sql create database $db
sql use $db
@@ -81,12 +76,9 @@ endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 2000
print =============== step5
-
$i = 0
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
diff --git a/tests/script/general/compute/avg.sim b/tests/script/tsim/compute/avg.sim
similarity index 96%
rename from tests/script/general/compute/avg.sim
rename to tests/script/tsim/compute/avg.sim
index db452b0344b6cbe14f313e613e737415780aeb27..2805b65fff5328b6e263e3f536bc54f9de3b5119 100644
--- a/tests/script/general/compute/avg.sim
+++ b/tests/script/tsim/compute/avg.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_av_db
@@ -163,7 +160,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/block_dist.sim b/tests/script/tsim/compute/block_dist.sim
similarity index 95%
rename from tests/script/general/compute/block_dist.sim
rename to tests/script/tsim/compute/block_dist.sim
index 5343c1db286d41c6f1d588617a1123f4993ccf29..201d222af736004a4d5dd40dbd534a59ef6c8992 100644
--- a/tests/script/general/compute/block_dist.sim
+++ b/tests/script/tsim/compute/block_dist.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_di_db
@@ -91,7 +88,7 @@ sql_error select _block_dist() from (select * from $mt)
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/bottom.sim b/tests/script/tsim/compute/bottom.sim
similarity index 93%
rename from tests/script/general/compute/bottom.sim
rename to tests/script/tsim/compute/bottom.sim
index 7af67ecbf0237bd591d84a243fd88b80e167e4f7..cfac02d6d54e8103848f9cf7ba442e6f1f3a3236 100644
--- a/tests/script/general/compute/bottom.sim
+++ b/tests/script/tsim/compute/bottom.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_bo_db
@@ -98,7 +95,7 @@ step6:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/count.sim b/tests/script/tsim/compute/count.sim
similarity index 97%
rename from tests/script/general/compute/count.sim
rename to tests/script/tsim/compute/count.sim
index cf84918f5b7c2bd5a396b6457c75b4c59b62bb19..0a6ce93077263260899b63d1cf10a0ccef2007de 100644
--- a/tests/script/general/compute/count.sim
+++ b/tests/script/tsim/compute/count.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_co_db
@@ -192,7 +189,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/diff.sim b/tests/script/tsim/compute/diff.sim
similarity index 93%
rename from tests/script/general/compute/diff.sim
rename to tests/script/tsim/compute/diff.sim
index bc303a9ca59152fb34836da6d37535d7e049d754..ba4b32ddbbb7fd782397fd9dd17a03411057f6ad 100644
--- a/tests/script/general/compute/diff.sim
+++ b/tests/script/tsim/compute/diff.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_di_db
@@ -91,7 +88,7 @@ step6:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/diff2.sim b/tests/script/tsim/compute/diff2.sim
similarity index 96%
rename from tests/script/general/compute/diff2.sim
rename to tests/script/tsim/compute/diff2.sim
index 55fa1daa95516729fb37b2e541067fe7abda19e6..08b52cb37b2649aa0d89a6558c85d159fa969dcd 100644
--- a/tests/script/general/compute/diff2.sim
+++ b/tests/script/tsim/compute/diff2.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_di_db
@@ -152,7 +149,7 @@ step6:
print =============== clear
#sql drop database $db
#sql show databases
-#if $rows != 0 then
+#if $rows != 2 then
# return -1
#endi
diff --git a/tests/script/general/compute/first.sim b/tests/script/tsim/compute/first.sim
similarity index 96%
rename from tests/script/general/compute/first.sim
rename to tests/script/tsim/compute/first.sim
index fce334167b7b553bdd056b2372a2fae30f2af79b..cf1160dbdb446be07eb1efafd07a81f687637ec6 100644
--- a/tests/script/general/compute/first.sim
+++ b/tests/script/tsim/compute/first.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_fi_db
@@ -165,7 +162,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/interval.sim b/tests/script/tsim/compute/interval.sim
similarity index 96%
rename from tests/script/general/compute/interval.sim
rename to tests/script/tsim/compute/interval.sim
index c21003a6463d00d53a2b75bd402f5a2a905247a0..a8539701c7773dee1facc13c56d3ebbd8559ae40 100644
--- a/tests/script/general/compute/interval.sim
+++ b/tests/script/tsim/compute/interval.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_in_db
@@ -199,7 +196,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/last.sim b/tests/script/tsim/compute/last.sim
similarity index 96%
rename from tests/script/general/compute/last.sim
rename to tests/script/tsim/compute/last.sim
index 9f20f8c5aa63416119e2148da575166602d0a226..aa9b041ca912566bacdc3b5587f6e1840541d58d 100644
--- a/tests/script/general/compute/last.sim
+++ b/tests/script/tsim/compute/last.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_la_db
@@ -169,7 +166,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/last_row.sim b/tests/script/tsim/compute/last_row.sim
similarity index 98%
rename from tests/script/general/compute/last_row.sim
rename to tests/script/tsim/compute/last_row.sim
index 3b28b0baa54d179693db7be1e7386a8701b8ff7f..867f64fa2e87205526461251528ec46e3fdb3087 100644
--- a/tests/script/general/compute/last_row.sim
+++ b/tests/script/tsim/compute/last_row.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_la_db
@@ -217,7 +214,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/leastsquare.sim b/tests/script/tsim/compute/leastsquare.sim
similarity index 94%
rename from tests/script/general/compute/leastsquare.sim
rename to tests/script/tsim/compute/leastsquare.sim
index 1c8af7fe7fdceb6666000e79bb89ee7c11ac3cac..aa83a4e14ef31566842f6a669d81cc4940238511 100644
--- a/tests/script/general/compute/leastsquare.sim
+++ b/tests/script/tsim/compute/leastsquare.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_le_db
@@ -93,7 +90,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/max.sim b/tests/script/tsim/compute/max.sim
similarity index 96%
rename from tests/script/general/compute/max.sim
rename to tests/script/tsim/compute/max.sim
index f9665a823db130a0eb5b4a7eb169a5900948c8a8..1b3fac5820502a1403699ff5d8621423d3fedefa 100644
--- a/tests/script/general/compute/max.sim
+++ b/tests/script/tsim/compute/max.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_ma_db
@@ -169,7 +166,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/min.sim b/tests/script/tsim/compute/min.sim
similarity index 85%
rename from tests/script/general/compute/min.sim
rename to tests/script/tsim/compute/min.sim
index 4a9904e06594f63f4de7e13c193a2e8561ccbf10..33e9eb0f3e06aefd6c551785c673bd9583e4f53e 100644
--- a/tests/script/general/compute/min.sim
+++ b/tests/script/tsim/compute/min.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_mi_db
@@ -73,14 +69,14 @@ endi
print =============== step5
sql select min(tbcol) as b from $tb interval(1m)
-print ===> $data11
-if $data11 != 1 then
+print ===> $data10
+if $data10 != 1 then
return -1
endi
sql select min(tbcol) as b from $tb interval(1d)
-print ===> $data01
-if $data01 != 0 then
+print ===> $data00
+if $data00 != 0 then
return -1
endi
@@ -90,8 +86,8 @@ $ms = 1601481600000 + $cc
sql select min(tbcol) as b from $tb where ts <= $ms interval(1m)
print select min(tbcol) as b from $tb where ts <= $ms interval(1m)
-print ===> $data11
-if $data11 != 1 then
+print ===> $data10
+if $data10 != 1 then
return -1
endi
if $rows != 5 then
@@ -130,14 +126,14 @@ endi
print =============== step9
sql select min(tbcol) as b from $mt interval(1m)
-print ===> $data11
-if $data11 != 1 then
+print ===> $data10
+if $data10 != 1 then
return -1
endi
sql select min(tbcol) as b from $mt interval(1d)
-print ===> $data01
-if $data01 != 0 then
+print ===> $data00
+if $data00 != 0 then
return -1
endi
@@ -155,9 +151,9 @@ endi
print =============== step11
$cc = 4 * 60000
$ms = 1601481600000 + $cc
-sql select min(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol
-print ===> $data11
-if $data11 != 1 then
+sql select min(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m)
+print ===> $data10
+if $data10 != 1 then
return -1
endi
print ===> $rows
@@ -168,7 +164,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/null.sim b/tests/script/tsim/compute/null.sim
similarity index 92%
rename from tests/script/general/compute/null.sim
rename to tests/script/tsim/compute/null.sim
index cd00b7a69dae3c039794b19573bd25cbb436be1a..30860da48ba503821790dae66ca4f4b03656032c 100644
--- a/tests/script/general/compute/null.sim
+++ b/tests/script/tsim/compute/null.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = db
@@ -98,22 +95,26 @@ if $data02 != 19 then
return -1
endi
-sql select * from $tb where tbcol = NULL -x step3
+sql select * from $tb where tbcol is NULL
+if $rows != 1 then
return -1
-step3:
+endi
+
+sql_error select * from $tb where tbcol = NULL
+
+return
print =============== step5
-sql create table $tb using $mt tags( NULL )
-# return -1
-#step51:
+sql create table tt using $mt tags( NULL )
#sql alter table $tb set tgcol=NULL -x step52
# return -1
#step52:
-sql select * from $mt where tgcol = NULL -x step5
+sql select * from $mt where tgcol is NULL
+if $rows != 1 then
return -1
-step5:
+endi
print =============== step6
sql select count(tbcol), count(tbcol2), avg(tbcol), avg(tbcol2), sum(tbcol), sum(tbcol2) from $mt
@@ -222,7 +223,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/percentile.sim b/tests/script/tsim/compute/percentile.sim
similarity index 95%
rename from tests/script/general/compute/percentile.sim
rename to tests/script/tsim/compute/percentile.sim
index b0f4fff8d7e9d36d62fab8a587e359ad9ab4f5ec..5cba3ad85659766c2de4b425d72662d8a307721d 100644
--- a/tests/script/general/compute/percentile.sim
+++ b/tests/script/tsim/compute/percentile.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_pe_db
@@ -125,11 +122,10 @@ if $data00 != 5.000000000 then
return -1
endi
-
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/stddev.sim b/tests/script/tsim/compute/stddev.sim
similarity index 85%
rename from tests/script/general/compute/stddev.sim
rename to tests/script/tsim/compute/stddev.sim
index 772ec8386a8d61167e4a208eef4c9b8830893f9c..70483991127ae1255b5326f4c832c33a12582689 100644
--- a/tests/script/general/compute/stddev.sim
+++ b/tests/script/tsim/compute/stddev.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_st_db
@@ -72,14 +69,14 @@ endi
print =============== step5
sql select stddev(tbcol) as b from $tb interval(1m)
-print ===> $data01
-if $data01 != 0.000000000 then
+print ===> $data00
+if $data00 != 0.000000000 then
return -1
endi
sql select stddev(tbcol) as b from $tb interval(1d)
-print ===> $data01
-if $data01 != 5.766281297 then
+print ===> $data00
+if $data00 != 5.766281297 then
return -1
endi
@@ -88,8 +85,8 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select stddev(tbcol) as b from $tb where ts <= $ms interval(1m)
-print ===> $data01
-if $data01 != 0.000000000 then
+print ===> $data00
+if $data00 != 0.000000000 then
return -1
endi
if $rows != 5 then
@@ -99,7 +96,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/sum.sim b/tests/script/tsim/compute/sum.sim
similarity index 83%
rename from tests/script/general/compute/sum.sim
rename to tests/script/tsim/compute/sum.sim
index 8fad9927504221b0313892360ab30b5d1e8b59c9..c53568f98f38f17ef7941fdaeae61bd8f6e63e43 100644
--- a/tests/script/general/compute/sum.sim
+++ b/tests/script/tsim/compute/sum.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_su_db
@@ -72,14 +69,14 @@ endi
print =============== step5
sql select sum(tbcol) as b from $tb interval(1m)
-print ===> $data11
-if $data11 != 1 then
+print ===> $data10
+if $data10 != 1 then
return -1
endi
sql select sum(tbcol) as b from $tb interval(1d)
-print ===> $data01
-if $data01 != 190 then
+print ===> $data00
+if $data00 != 190 then
return -1
endi
@@ -88,8 +85,8 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select sum(tbcol) as b from $tb where ts <= $ms interval(1m)
-print ===> $data11
-if $data11 != 1 then
+print ===> $data10
+if $data10 != 1 then
return -1
endi
if $rows != 5 then
@@ -130,14 +127,14 @@ endi
print =============== step9
sql select sum(tbcol) as b from $mt interval(1m)
-print ===> $data11
-if $data11 < 5 then
+print ===> $data10
+if $data10 < 5 then
return -1
endi
sql select sum(tbcol) as b from $mt interval(1d)
-print ===> $data01
-if $data01 != 1900 then
+print ===> $data00
+if $data00 != 1900 then
return -1
endi
@@ -156,10 +153,10 @@ print =============== step11
$cc = 4 * 60000
$ms = 1601481600000 + $cc
-sql select sum(tbcol) as b from $mt where ts <= $ms interval(1d) group by tgcol
-print select sum(tbcol) as b from $mt where ts <= $ms interval(1d) group by tgcol
-print ===> $data01
-if $data01 != 10 then
+sql select sum(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1d)
+print select sum(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1d)
+print ===> $data00 $rows
+if $data00 != 10 then
return -1
endi
if $rows != 10 then
@@ -169,7 +166,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/compute/top.sim b/tests/script/tsim/compute/top.sim
similarity index 78%
rename from tests/script/general/compute/top.sim
rename to tests/script/tsim/compute/top.sim
index 1e9d302b7c9b8d4e8c690ff372d3c802fa2a8d7a..9899a8a9eadab3dca8414dcae3d37df92b240106 100644
--- a/tests/script/general/compute/top.sim
+++ b/tests/script/tsim/compute/top.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
$dbPrefix = m_to_db
@@ -48,8 +45,8 @@ $i = 1
$tb = $tbPrefix . $i
sql select top(tbcol, 1) from $tb
-print ===> $data01
-if $data01 != 19 then
+print ===> $data00
+if $data00 != 19 then
return -1
endi
@@ -58,25 +55,25 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select top(tbcol, 1) from $tb where ts <= $ms
-print ===> $data01
-if $data01 != 4 then
+print ===> $data00
+if $data00 != 4 then
return -1
endi
print =============== step4
sql select top(tbcol, 1) as b from $tb
-print ===> $data01
-if $data01 != 19 then
+print ===> $data00
+if $data00 != 19 then
return -1
endi
print =============== step5
sql select top(tbcol, 2) as b from $tb
-print ===> $data01 $data11
-if $data01 != 18 then
+print ===> $data00 $data10
+if $data00 != 18 then
return -1
endi
-if $data11 != 19 then
+if $data10 != 19 then
return -1
endi
@@ -85,11 +82,11 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select top(tbcol, 2) as b from $tb where ts <= $ms
-print ===> $data01 $data11
-if $data01 != 3 then
+print ===> $data00 $data10
+if $data00 != 3 then
return -1
endi
-if $data11 != 4 then
+if $data10 != 4 then
return -1
endi
@@ -100,7 +97,7 @@ step6:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/2.sim b/tests/script/tsim/field/2.sim
similarity index 95%
rename from tests/script/general/field/2.sim
rename to tests/script/tsim/field/2.sim
index cc6889fd75441c9fa4913f8219ebc1b50710b0cb..3161f020970fc91023f72308c2729f079586c2d6 100644
--- a/tests/script/general/field/2.sim
+++ b/tests/script/tsim/field/2.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -280,18 +278,18 @@ if $data00 != 25 then
endi
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 partition by tgcol interval(1d) order by tgcol desc
print $db
-print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 interval(1d) group by tgcol
+print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/3.sim b/tests/script/tsim/field/3.sim
similarity index 97%
rename from tests/script/general/field/3.sim
rename to tests/script/tsim/field/3.sim
index cb3c6621ac3723b09fba489d894657a457e12af1..72b65c74066faa1e8af92c2e55b3803c6bc492c7 100644
--- a/tests/script/general/field/3.sim
+++ b/tests/script/tsim/field/3.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -493,28 +491,28 @@ if $data00 != 25 then
endi
print =============== step19
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol1 interval(1d) order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol2 interval(1d) order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol3 interval(1d) order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/4.sim b/tests/script/tsim/field/4.sim
similarity index 97%
rename from tests/script/general/field/4.sim
rename to tests/script/tsim/field/4.sim
index 2d893da777bea8260a333a957cf6f904b95eb6d0..d37c05173c0eafaaeb379c811357ef0b6f4c358a 100644
--- a/tests/script/general/field/4.sim
+++ b/tests/script/tsim/field/4.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -677,34 +675,34 @@ if $data00 != 25 then
endi
print =============== step24
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol1 interval(1d) order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol2 interval(1d) order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol3 interval(1d) order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 partition by tgcol4 interval(1d) order by tgcol4 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/5.sim b/tests/script/tsim/field/5.sim
similarity index 97%
rename from tests/script/general/field/5.sim
rename to tests/script/tsim/field/5.sim
index e1421bdb4f9e25b37deeafe699feb1ce8c0f6c0a..127dcd26838d79cb31f81dfacd58952fde1a85c4 100644
--- a/tests/script/general/field/5.sim
+++ b/tests/script/tsim/field/5.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -794,40 +792,40 @@ endi
print =============== step27
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol1 interval(1d) order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol2 interval(1d) order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol3 interval(1d) order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 partition by tgcol4 interval(1d) order by tgcol4 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 interval(1d) group by tgcol5 order by tgcol5 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 partition by tgcol5 interval(1d) order by tgcol5 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/6.sim b/tests/script/tsim/field/6.sim
similarity index 97%
rename from tests/script/general/field/6.sim
rename to tests/script/tsim/field/6.sim
index 27475d591fc6acaffb4e1f985f59d9a3c8778df5..474582fcae43ef3fc7521f2d0292202811056d1c 100644
--- a/tests/script/general/field/6.sim
+++ b/tests/script/tsim/field/6.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -943,46 +941,46 @@ if $data00 != 25 then
endi
print =============== step31
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol1 interval(1d) order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol2 interval(1d) order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 partition by tgcol3 interval(1d) order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 partition by tgcol4 interval(1d) order by tgcol4 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 interval(1d) group by tgcol5 order by tgcol5 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 partition by tgcol5 interval(1d) order by tgcol5 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 interval(1d) group by tgcol6 order by tgcol6 desc
+sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 partition by tgcol6 interval(1d) order by tgcol6 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/bigint.sim b/tests/script/tsim/field/bigint.sim
similarity index 94%
rename from tests/script/general/field/bigint.sim
rename to tests/script/tsim/field/bigint.sim
index cfe8c561f0d852133267f7dd597f7796aee951f0..d9401ed88f2c573755db1341760341515c0b8c7c 100644
--- a/tests/script/general/field/bigint.sim
+++ b/tests/script/tsim/field/bigint.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -146,16 +143,16 @@ if $data00 != 25 then
endi
print =============== step8
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 partition by tgcol interval(1d) order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/binary.sim b/tests/script/tsim/field/binary.sim
similarity index 93%
rename from tests/script/general/field/binary.sim
rename to tests/script/tsim/field/binary.sim
index 821dbc9a82f7d8e6e21be419d6c28a7b67f1271d..59005e1ef1b57a3624d054cdd1bdc11ef0023824 100644
--- a/tests/script/general/field/binary.sim
+++ b/tests/script/tsim/field/binary.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -47,7 +44,6 @@ while $i < 10
$i = $i + 1
endw
-
print =============== step2
sql select * from $mt where tbcol = '0'
@@ -70,7 +66,7 @@ sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), f
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/bool.sim b/tests/script/tsim/field/bool.sim
similarity index 93%
rename from tests/script/general/field/bool.sim
rename to tests/script/tsim/field/bool.sim
index d94071b3282613a51c7580fc23f0bdc700cea03f..04cd48ab2d7d5e69de1685ae0d3e94f93926c9fd 100644
--- a/tests/script/general/field/bool.sim
+++ b/tests/script/tsim/field/bool.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -144,17 +141,17 @@ if $data00 != 25 then
endi
print =============== step8
-sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true interval(1d) group by tgcol order by tgcol desc
-print select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true partition by tgcol interval(1d) order by tgcol desc
+print select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true partition by tgcol interval(1d) order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/double.sim b/tests/script/tsim/field/double.sim
similarity index 93%
rename from tests/script/general/field/double.sim
rename to tests/script/tsim/field/double.sim
index 0c9c23e3047466da264fd2ac3b2624ff22a5d0b0..c7b26add6500ad671101075731a278bb7539cdf6 100644
--- a/tests/script/general/field/double.sim
+++ b/tests/script/tsim/field/double.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -144,16 +141,16 @@ if $data00 != 25 then
endi
print =============== step8
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 partition by tgcol interval(1d) order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/float.sim b/tests/script/tsim/field/float.sim
similarity index 93%
rename from tests/script/general/field/float.sim
rename to tests/script/tsim/field/float.sim
index 00423c00b8515bafb7974604e1211c15868512d7..1e11eed3be192499a7318af408b0a870ba5dcf4f 100644
--- a/tests/script/general/field/float.sim
+++ b/tests/script/tsim/field/float.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -144,16 +142,16 @@ if $data00 != 25 then
endi
print =============== step8
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 partition by tgcol interval(1d) order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/int.sim b/tests/script/tsim/field/int.sim
similarity index 93%
rename from tests/script/general/field/int.sim
rename to tests/script/tsim/field/int.sim
index 0e322e4f120d6eef933023467d1246a127780529..484272631ba2f4cfcdcd28548d23631e30ab79be 100644
--- a/tests/script/general/field/int.sim
+++ b/tests/script/tsim/field/int.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -144,16 +142,16 @@ if $data00 != 25 then
endi
print =============== step8
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 partition by tgcol interval(1d) order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/single.sim b/tests/script/tsim/field/single.sim
similarity index 97%
rename from tests/script/general/field/single.sim
rename to tests/script/tsim/field/single.sim
index 3f6bf4309fac7ce45577094f3316c34edcd954c1..115e76ffebebc2188b2a33700a3be33769511eb5 100644
--- a/tests/script/general/field/single.sim
+++ b/tests/script/tsim/field/single.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -211,7 +209,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/smallint.sim b/tests/script/tsim/field/smallint.sim
similarity index 93%
rename from tests/script/general/field/smallint.sim
rename to tests/script/tsim/field/smallint.sim
index 78b2b998cfa56f368b1480716dabe8be38a45b9a..326186f6c20b4712388c7b9c9796cfd374ef7b85 100644
--- a/tests/script/general/field/smallint.sim
+++ b/tests/script/tsim/field/smallint.sim
@@ -1,10 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
+
print ======================== dnode1 start
$dbPrefix = db
@@ -144,16 +142,16 @@ if $data00 != 25 then
endi
print =============== step8
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 partition by tgcol interval(1d) order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/tinyint.sim b/tests/script/tsim/field/tinyint.sim
similarity index 93%
rename from tests/script/general/field/tinyint.sim
rename to tests/script/tsim/field/tinyint.sim
index 7e1a0c6e80022435a50c48398ee9098ce9ec43aa..cba4ac504d682c24e055edbbc7ccbf98c8abe6f2 100644
--- a/tests/script/general/field/tinyint.sim
+++ b/tests/script/tsim/field/tinyint.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -145,16 +142,16 @@ if $data00 != 25 then
endi
print =============== step8
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 partition by tgcol interval(1d) order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/field/unsigined_bigint.sim b/tests/script/tsim/field/unsigined_bigint.sim
similarity index 94%
rename from tests/script/general/field/unsigined_bigint.sim
rename to tests/script/tsim/field/unsigined_bigint.sim
index 260128b5c2476911e8e1d809e63c7f89b4fd300a..0a492ae44c5efc03b21f9936894aa5b4fe606bb8 100644
--- a/tests/script/general/field/unsigined_bigint.sim
+++ b/tests/script/tsim/field/unsigined_bigint.sim
@@ -1,12 +1,9 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
-print ======================== dnode1 start
+print ======================== dnode1 start
$dbPrefix = db
$tbPrefix = tb
$mtPrefix = st
@@ -27,7 +24,7 @@ $i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
- sql create table $tb using $mt tags( -111 )
+ sql_error create table $tb using $mt tags( -111 )
$x = 0
while $x < $rowNum
$ms = $x . m
@@ -150,16 +147,16 @@ if $data00 != 25 then
endi
print =============== step8
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 partition by tgcol interval(1d) order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/import/basic.sim b/tests/script/tsim/import/basic.sim
similarity index 74%
rename from tests/script/general/import/basic.sim
rename to tests/script/tsim/import/basic.sim
index f72d132ca39cdf0138b0c79d94857d6d646bccb5..cb1b525120920cf98d48c84324c24f7c7f689c50 100644
--- a/tests/script/general/import/basic.sim
+++ b/tests/script/tsim/import/basic.sim
@@ -1,32 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/deploy.sh -n dnode2 -i 2
-system sh/deploy.sh -n dnode3 -i 3
-system sh/deploy.sh -n dnode4 -i 4
-
-system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
-
-system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 10
-
-system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000
-
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode2 -c walLevel -v 1
-system sh/cfg.sh -n dnode3 -c walLevel -v 1
-system sh/cfg.sh -n dnode4 -c walLevel -v 1
-
-print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
sql create database ibadb
diff --git a/tests/script/general/import/commit.sim b/tests/script/tsim/import/commit.sim
similarity index 64%
rename from tests/script/general/import/commit.sim
rename to tests/script/tsim/import/commit.sim
index aefc724fdb70e57cdf7a988464ed143c57d9a62c..e7f0440f5ec76a52eb4dbb61cb89ecee74f3e27d 100644
--- a/tests/script/general/import/commit.sim
+++ b/tests/script/tsim/import/commit.sim
@@ -1,32 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/deploy.sh -n dnode2 -i 2
-system sh/deploy.sh -n dnode3 -i 3
-system sh/deploy.sh -n dnode4 -i 4
-
-system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
-
-system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 10
-
-system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000
-
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode2 -c walLevel -v 1
-system sh/cfg.sh -n dnode3 -c walLevel -v 1
-system sh/cfg.sh -n dnode4 -c walLevel -v 1
-
-print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
print ========= step1
@@ -72,9 +46,7 @@ endi
print ========= step3
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
print ========= step4
sql select * from ic2db.tb;
diff --git a/tests/script/general/import/large.sim b/tests/script/tsim/import/large.sim
similarity index 61%
rename from tests/script/general/import/large.sim
rename to tests/script/tsim/import/large.sim
index 23fbcc75eae55623e3ed2afa8b8ebf42c77a1012..f694502e2a420719c8f38b2abed3fe332c283abb 100644
--- a/tests/script/general/import/large.sim
+++ b/tests/script/tsim/import/large.sim
@@ -1,32 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/deploy.sh -n dnode2 -i 2
-system sh/deploy.sh -n dnode3 -i 3
-system sh/deploy.sh -n dnode4 -i 4
-
-system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
-
-system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 10
-
-system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000
-
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
-system sh/cfg.sh -n dnode2 -c walLevel -v 1
-system sh/cfg.sh -n dnode3 -c walLevel -v 1
-system sh/cfg.sh -n dnode4 -c walLevel -v 1
-
-print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
sql create database db
diff --git a/tests/script/general/import/replica1.sim b/tests/script/tsim/import/replica1.sim
similarity index 83%
rename from tests/script/general/import/replica1.sim
rename to tests/script/tsim/import/replica1.sim
index 1e8eabb798164f7966e25fa5cc140189a710617a..3a4b4a2876a515b9942ea04c3db2ff6dad00f672 100644
--- a/tests/script/general/import/replica1.sim
+++ b/tests/script/tsim/import/replica1.sim
@@ -1,33 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/deploy.sh -n dnode2 -i 2
-system sh/deploy.sh -n dnode3 -i 3
-system sh/deploy.sh -n dnode4 -i 4
-
-system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
-system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
-
-system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 10
-system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 10
-
-system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000
-system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000
-
-system sh/cfg.sh -n dnode1 -c walLevel -v 2
-system sh/cfg.sh -n dnode2 -c walLevel -v 2
-system sh/cfg.sh -n dnode3 -c walLevel -v 2
-system sh/cfg.sh -n dnode4 -c walLevel -v 2
-
-print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
-sleep 2000
sql connect
sql create database ir1db duration 7
@@ -93,9 +66,7 @@ endi
print ================== dnode restart
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
sql use ir1db
sql select * from tb;
@@ -162,9 +133,7 @@ endi
print ================= step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-sleep 3000
system sh/exec.sh -n dnode1 -s start
-sleep 3000
sql use ir1db
sql select * from tb;
diff --git a/tests/script/tsim/insert/basic0.sim b/tests/script/tsim/insert/basic0.sim
index 722bc0f907f7712e8da1b692cfd7ee14ebd0be6d..6de904eca12472a3dcf31b5205ee6baa50539728 100644
--- a/tests/script/tsim/insert/basic0.sim
+++ b/tests/script/tsim/insert/basic0.sim
@@ -32,7 +32,6 @@ if $rows != 3 then
return -1
endi
-
print =============== insert data, mode1: one row one table in sql
print =============== insert data, mode1: mulit rows one table in sql
#print =============== insert data, mode1: one rows mulit table in sql
@@ -41,9 +40,6 @@ sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
-#sql insert into ct1 values(now+4s, -14, -2.4, -3.4) ct2 values(now+4s, -14, -2.4, -3.4)
-#sql insert into ct1 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6) ct2 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6)
-
sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
#===================================================================
@@ -67,16 +63,6 @@ endi
if $data03 != 3.000000000 then
return -1
endi
-#if $data41 != -14 then
-# return -1
-#endi
-#if $data42 != -2.40000 then
-# return -1
-#endi
-#if $data43 != -3.400000000 then
-# return -1
-#endi
-
print =============== select count(*) from child table
sql select count(*) from ct1
@@ -107,10 +93,10 @@ if $data03 != 4 then
endi
#print =============== select first(*)/first(column) from child table
-#sql select first(*) from ct1
-#print ====> select first(*) from ct1
-#print rows: $rows
-#print $data00 $data01 $data02 $data03
+sql select first(*) from ct1
+print ====> select first(*) from ct1
+print rows: $rows
+print $data00 $data01 $data02 $data03
sql select first(ts), first(c1), first(c2), first(c3) from ct1
print ====> select first(ts), first(c1), first(c2), first(c3) from ct1
@@ -217,23 +203,23 @@ if $data32 != -3.300000000 then
return -1
endi
#===================================================================
-#===================================================================
#print =============== query data from stb
-#sql select * from stb
-#if $rows != 4 then
-# return -1
-#endi
+sql select * from stb
+print $rows
+if $rows != 9 then
+ return -1
+endi
#print =============== select count(*) from supter table
-#sql select count(*) from stb
-#print $data00 $data01 $data02
-#if $rows != 1 then
-# return -1
-#endi
-#if $data00 != 9 then
-# return -1
-#endi
+sql select count(*) from stb
+print $data00 $data01 $data02
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 9 then
+ return -1
+endi
print =============== select count(column) from supter table
sql select ts, c1, c2, c3 from stb
@@ -264,28 +250,23 @@ if $data03 != 3.000000000 then
endi
#print =============== select count(column) from supter table
-#sql select count(ts), count(c1), count(c2), count(c3) from stb
-#print rows: $rows
-#print $data00 $data01 $data02 $data03
-#print $data10 $data11 $data12 $data13
-#print $data20 $data21 $data22 $data23
-#print $data30 $data31 $data32 $data33
-#if $data00 != 9 then
-# return -1
-#endi
-#if $data01 != 8 then
-# return -1
-#endi
-#if $data02 != 8 then
-# return -1
-#endi
-#if $data03 != 8 then
-# return -1
-#endi
+sql select count(ts), count(c1), count(c2), count(c3) from stb
+print rows: $rows
+print $data00 $data01 $data02 $data03
+if $data00 != 9 then
+ return -1
+endi
+if $data01 != 9 then
+ return -1
+endi
+if $data02 != 9 then
+ return -1
+endi
+if $data03 != 9 then
+ return -1
+endi
#===================================================================
-#===================================================================
-
print =============== stop and restart taosd, then again do query above
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
@@ -326,16 +307,6 @@ endi
if $data03 != 3.000000000 then
return -1
endi
-#if $data41 != -14 then
-# return -1
-#endi
-#if $data42 != -2.40000 then
-# return -1
-#endi
-#if $data43 != -3.400000000 then
-# return -1
-#endi
-
print =============== select count(*) from child table
sql select count(*) from ct1
@@ -366,10 +337,10 @@ if $data03 != 4 then
endi
#print =============== select first(*)/first(column) from child table
-#sql select first(*) from ct1
-#print ====> select first(*) from ct1
-#print rows: $rows
-#print $data00 $data01 $data02 $data03
+sql select first(*) from ct1
+print ====> select first(*) from ct1
+print rows: $rows
+print $data00 $data01 $data02 $data03
sql select first(ts), first(c1), first(c2), first(c3) from ct1
print ====> select first(ts), first(c1), first(c2), first(c3) from ct1
@@ -474,24 +445,23 @@ endi
if $data32 != -3.300000000 then
return -1
endi
-#===================================================================
-#===================================================================
-#print =============== query data from stb
-#sql select * from stb
-#if $rows != 4 then
-# return -1
-#endi
+#===================================================================
+print =============== query data from stb
+sql select * from stb
+if $rows != 9 then
+ return -1
+endi
-#print =============== select count(*) from supter table
-#sql select count(*) from stb
-#print $data00 $data01 $data02
-#if $rows != 1 then
-# return -1
-#endi
-#if $data00 != 9 then
-# return -1
-#endi
+print =============== select count(*) from supter table
+sql select count(*) from stb
+print $data00 $data01 $data02
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 9 then
+ return -1
+endi
print =============== select count(column) from supter table
sql select ts, c1, c2, c3 from stb
@@ -521,20 +491,19 @@ if $data03 != 3.000000000 then
endi
#print =============== select count(column) from supter table
-#sql select count(ts), count(c1), count(c2), count(c3) from stb
-#print $data00 $data01 $data02 $data03
-#if $data00 != 8 then
-# return -1
-#endi
-#if $data01 != 8 then
-# return -1
-#endi
-#if $data02 != 8 then
-# return -1
-#endi
-#if $data03 != 8 then
-# return -1
-#endi
-
+sql select count(ts), count(c1), count(c2), count(c3) from stb
+print $data00 $data01 $data02 $data03
+if $data00 != 9 then
+ return -1
+endi
+if $data01 != 9 then
+ return -1
+endi
+if $data02 != 9 then
+ return -1
+endi
+if $data03 != 9 then
+ return -1
+endi
-system sh/exec.sh -n dnode1 -s stop -x SIGINT
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
diff --git a/tests/script/tsim/insert/basic1.sim b/tests/script/tsim/insert/basic1.sim
index d98407b380247cc43e1b641fcfe97914c09b2a15..6d31dcdffbdbc555793af9ef151c068d9143fa77 100644
--- a/tests/script/tsim/insert/basic1.sim
+++ b/tests/script/tsim/insert/basic1.sim
@@ -1,9 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
-sleep 50
sql connect
-
print =============== create database
sql create database d1
sql show databases
@@ -17,7 +15,6 @@ sql use d1
print =============== create super table, include all type
sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned)
-
sql create stable if not exists stb_1 (ts timestamp, i int) tags (j int)
sql create table stb_2 (ts timestamp, i int) tags (j int)
sql create stable stb_3 (ts timestamp, i int) tags (j int)
@@ -36,11 +33,6 @@ if $rows != 2 then
return -1
endi
-
-print =============== insert data, mode1: one row one table in sql
-print =============== insert data, mode1: mulit rows one table in sql
-print =============== insert data, mode1: one rows mulit table in sql
-print =============== insert data, mode1: mulit rows mulit table in sql
sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
@@ -69,32 +61,15 @@ if $data03 != -2 then
endi
print =============== query data from st, but not support select * from super table, waiting fix
-#sql select * from st
-#if $rows != 4 then
-# return -1
-#endi
+sql select * from stb
+if $rows != 4 then
+ return -1
+endi
print =============== stop and restart taosd
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
-$loop_cnt = 0
-check_dnode_ready:
- $loop_cnt = $loop_cnt + 1
- sleep 200
- if $loop_cnt == 10 then
- print ====> dnode not ready!
- return -1
- endi
-sql show dnodes
-print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
-if $data00 != 1 then
- return -1
-endi
-if $data04 != ready then
- goto check_dnode_ready
-endi
-
print =============== query data
sql select * from c1
print rows: $rows
@@ -119,9 +94,9 @@ if $data03 != -2 then
endi
print =============== query data from st, but not support select * from super table, waiting fix
-#sql select * from st
-#if $rows != 4 then
-# return -1
-#endi
+sql select * from stb
+if $rows != 4 then
+ return -1
+endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/query/interval-offset.sim b/tests/script/tsim/query/interval-offset.sim
index ab6ee79d6e31c22a3704fa7831e2a492013e9e04..b6dffb5fe3676328021232f41b8a3a3a54d9252b 100644
--- a/tests/script/tsim/query/interval-offset.sim
+++ b/tests/script/tsim/query/interval-offset.sim
@@ -68,8 +68,8 @@ sql insert into ct4 values ( '2022-12-01 01:01:30.000', 8 )
sql insert into ct4 values ( '2022-12-31 01:01:36.000', 9 )
print ================ start query ======================
-sql select _wstartts, _wendts, _wduration, _qstartts, _qendts, count(*) from ct1 interval(10s, 2s)
-print ===> select _wstartts, _wendts, _wduration, _qstartts, _qendts, count(*) from ct1 interval(10s, 2s)
+sql select _wstart, _wend, _wduration, _qstart, _qend, count(*) from ct1 interval(10s, 2s)
+print ===> select _wstart, _wend, _wduration, _qstart, _qend, count(*) from ct1 interval(10s, 2s)
print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data05
print ===> rows1: $data10 $data11 $data12 $data15
@@ -89,8 +89,8 @@ if $data45 != 1 then
return -1
endi
-sql select _wstartts, _wendts, _wduration, _qstartts, _qendts, count(*) from ct1 interval(10s, 2s) sliding(10s)
-print ===> select _wstartts, _wendts, _wduration, _qstartts, _qendts, count(*) from ct1 interval(10s, 2s) sliding(10s)
+sql select _wstart, _wend, _wduration, _qstart, _qend, count(*) from ct1 interval(10s, 2s) sliding(10s)
+print ===> select _wstart, _wend, _wduration, _qstart, _qend, count(*) from ct1 interval(10s, 2s) sliding(10s)
print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data05
print ===> rows1: $data10 $data11 $data12 $data15
@@ -177,7 +177,7 @@ if $data70 != 1 then
return -1
endi
-sql select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w)
+sql select _wstart, count(tbcol), _wduration, _wstart, count(*) from ct3 interval(1n, 1w)
print ===> select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct3 interval(1n, 1w)
print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04
@@ -200,11 +200,11 @@ if $data02 != 2678400000 then
return -1
endi
-sql_error select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w) sliding(2w)
-sql_error select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w) sliding(4w)
+sql_error select _wstart, count(tbcol), _wduration, _wstart, count(*) from ct3 interval(1n, 1w) sliding(2w)
+sql_error select _wstart, count(tbcol), _wduration, _wstart, count(*) from ct3 interval(1n, 1w) sliding(4w)
-sql select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n)
-print ===> select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n)
+sql select _wstart, count(tbcol), _wduration, _wstart, count(*) from ct4 interval(1y, 6n)
+print ===> select _wstart, count(tbcol), _wduration, _wstart, count(*) from ct4 interval(1y, 6n)
print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04
print ===> rows1: $data10 $data11 $data12 $data13 $data14
@@ -220,7 +220,7 @@ if $data04 != 2 then
endi
sql_error select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct4 interval(1y, 6n) sliding(6n)
-sql_error select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n) sliding(12n)
+sql_error select _wstart, count(tbcol), _wduration, _wstart, count(*) from ct4 interval(1y, 6n) sliding(12n)
#=================================================
print =============== stop and restart taosd
diff --git a/tests/script/tsim/query/interval.sim b/tests/script/tsim/query/interval.sim
index 9d7104c3ded697f835cc61ac2ed71ae68c1d7d55..280a66de00dae0b44154649927820b51d61a09f5 100644
--- a/tests/script/tsim/query/interval.sim
+++ b/tests/script/tsim/query/interval.sim
@@ -82,8 +82,8 @@ print =============== step4
#$cc = 1 * 60000
#$ms2 = 1601481600000 - $cc
-sql select _wstartts, _wendts, _wduration, _qstartts, _qendts, count(tbcol) from $tb interval(1m)
-print ===> select _wstartts, _wendts, _wduration, _qstartts, _qendts, count(tbcol) from $tb interval(1m)
+sql select _wstart, _wend, _wduration, _qstart, _qend, count(tbcol) from $tb interval(1m)
+print ===> select _wstart, _wend, _wduration, _qstart, _qend, count(tbcol) from $tb interval(1m)
print ===> $rows $data01 $data05
if $rows != $rowNum then
return -1
diff --git a/tests/script/tsim/query/scalarNull.sim b/tests/script/tsim/query/scalarNull.sim
index 07bd5e57cd1d2c24e712a57c0f66aa4f764b8ccf..ae4b2a96245b3e938abbd3842be764cf15b3023f 100644
--- a/tests/script/tsim/query/scalarNull.sim
+++ b/tests/script/tsim/query/scalarNull.sim
@@ -89,5 +89,10 @@ endi
#TODO: MOVE IT TO NORMAL CASE
sql_error select * from tb1 where not (null);
+sql select sum(1/0) from tb1;
+if $rows != 1 then
+ return -1
+endi
+
system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/query/session.sim b/tests/script/tsim/query/session.sim
index c39956c0df979a6c702d23782d0320223f4b8fad..29559fdee539cdc59c1cc368eec3090acc160cec 100644
--- a/tests/script/tsim/query/session.sim
+++ b/tests/script/tsim/query/session.sim
@@ -81,7 +81,7 @@ sql use $dbNamme
# session(ts,5a)
print ====> select count(*) from dev_001 session(ts,5a)
-sql select _wstartts, count(*) from dev_001 session(ts,5a)
+sql select _wstart, count(*) from dev_001 session(ts,5a)
print ====> rows: $rows
print ====> $data00 $data01 $data02 $data03 $data04 $data05
print ====> $data10 $data11 $data12 $data13 $data14 $data15
@@ -102,7 +102,7 @@ endi
#
#print ====> select count(*) from (select * from dev_001) session(ts,5a)
-#sql select _wstartts, count(*) from (select * from dev_001) session(ts,5a)
+#sql select _wstart, count(*) from (select * from dev_001) session(ts,5a)
#if $rows != 15 then
# return -1
#endi
@@ -111,7 +111,7 @@ endi
#endi
print ====> select count(*) from dev_001 session(ts,1s)
-sql select _wstartts, count(*) from dev_001 session(ts,1s)
+sql select _wstart, count(*) from dev_001 session(ts,1s)
if $rows != 12 then
return -1
endi
@@ -120,7 +120,7 @@ if $data01 != 5 then
endi
#print ====> select count(*) from (select * from dev_001) session(ts,1s)
-#sql select _wstartts, count(*) from (select * from dev_001) session(ts,1s)
+#sql select _wstart, count(*) from (select * from dev_001) session(ts,1s)
#if $rows != 12 then
# return -1
#endi
@@ -129,7 +129,7 @@ endi
#endi
print ====> select count(*) from dev_001 session(ts,1000a)
-sql select _wstartts, count(*) from dev_001 session(ts,1000a)
+sql select _wstart, count(*) from dev_001 session(ts,1000a)
if $rows != 12 then
return -1
endi
@@ -138,7 +138,7 @@ if $data01 != 5 then
endi
#print ====> select count(*) from (select * from dev_001) session(ts,1000a)
-#sql select _wstartts, count(*) from (select * from dev_001) session(ts,1000a)
+#sql select _wstart, count(*) from (select * from dev_001) session(ts,1000a)
#if $rows != 12 then
# return -1
#endi
@@ -147,7 +147,7 @@ endi
#endi
print ====> select count(*) from dev_001 session(ts,1m)
-sql select _wstartts, count(*) from dev_001 session(ts,1m)
+sql select _wstart, count(*) from dev_001 session(ts,1m)
if $rows != 9 then
return -1
endi
@@ -156,7 +156,7 @@ if $data01 != 8 then
endi
#print ====> select count(*) from (select * from dev_001) session(ts,1m)
-#sql select _wstartts, count(*) from (select * from dev_001) session(ts,1m)
+#sql select _wstart, count(*) from (select * from dev_001) session(ts,1m)
#if $rows != 9 then
# return -1
#endi
@@ -165,7 +165,7 @@ endi
#endi
print ====> select count(*) from dev_001 session(ts,1h)
-sql select _wstartts, count(*) from dev_001 session(ts,1h)
+sql select _wstart, count(*) from dev_001 session(ts,1h)
if $rows != 6 then
return -1
endi
@@ -174,7 +174,7 @@ if $data01 != 11 then
endi
#print ====> select count(*) from (select * from dev_001) session(ts,1h)
-#sql select _wstartts, count(*) from (select * from dev_001) session(ts,1h)
+#sql select _wstart, count(*) from (select * from dev_001) session(ts,1h)
#if $rows != 6 then
# return -1
#endi
@@ -183,7 +183,7 @@ endi
#endi
print ====> select count(*) from dev_001 session(ts,1d)
-sql select _wstartts, count(*) from dev_001 session(ts,1d)
+sql select _wstart, count(*) from dev_001 session(ts,1d)
if $rows != 4 then
return -1
endi
@@ -192,7 +192,7 @@ if $data01 != 13 then
endi
#print ====> select count(*) from (select * from dev_001) session(ts,1d)
-#sql select _wstartts, count(*) from (select * from dev_001) session(ts,1d)
+#sql select _wstart, count(*) from (select * from dev_001) session(ts,1d)
#if $rows != 4 then
# return -1
#endi
@@ -201,7 +201,7 @@ endi
#endi
print ====> select count(*) from dev_001 session(ts,1w)
-sql select _wstartts, count(*) from dev_001 session(ts,1w)
+sql select _wstart, count(*) from dev_001 session(ts,1w)
if $rows != 2 then
return -1
endi
@@ -210,7 +210,7 @@ if $data01 != 15 then
endi
#print ====> select count(*) from (select * from dev_001) session(ts,1w)
-#sql select _wstartts, count(*) from (select * from dev_001) session(ts,1w)
+#sql select _wstart, count(*) from (select * from dev_001) session(ts,1w)
#if $rows != 2 then
# return -1
#endi
@@ -298,7 +298,7 @@ sql_error select count(*) from dev_001 session(i,1y)
sql_error select count(*) from dev_001 session(ts,1d) where ts <'2020-05-20 0:0:0'
#print ====> select count(*) from dev_001 session(ts,1u)
-#sql select _wstartts, count(*) from dev_001 session(ts,1u)
+#sql select _wstart, count(*) from dev_001 session(ts,1u)
#print rows: $rows
#print $data00 $data01 $data02 $data03
#print $data10 $data11 $data12 $data13
diff --git a/tests/script/tsim/query/stddev.sim b/tests/script/tsim/query/stddev.sim
index 74bc444da232bf73d7c92e1194df14d0e5c46cd6..15041623bce3dc68ac0aed7577eadad22963e484 100644
--- a/tests/script/tsim/query/stddev.sim
+++ b/tests/script/tsim/query/stddev.sim
@@ -103,29 +103,29 @@ if $rows != 1 then
return -1
endi
-print =====sql : select _wstartts, stddev(c1) as b from ct4 interval(1y)
-sql select _wstartts, stddev(c1) as b from ct4 interval(1y)
+print =====sql : select _wstart, stddev(c1) as b from ct4 interval(1y)
+sql select _wstart, stddev(c1) as b from ct4 interval(1y)
print ===> $rows
if $rows != 4 then
return -1
endi
-print =====sql : select _wstartts, stddev(c1) as b from t1 interval(1y)
-sql select _wstartts, stddev(c1) as b from t1 interval(1y)
+print =====sql : select _wstart, stddev(c1) as b from t1 interval(1y)
+sql select _wstart, stddev(c1) as b from t1 interval(1y)
print ===> $rows
if $rows != 3 then
return -1
endi
-print =====select _wstartts, stddev(c1) as b from ct4 where c1 <= 6 interval(180d)
-sql select _wstartts, stddev(c1) as b from ct4 where c1 <= 6 interval(180d)
+print =====select _wstart, stddev(c1) as b from ct4 where c1 <= 6 interval(180d)
+sql select _wstart, stddev(c1) as b from ct4 where c1 <= 6 interval(180d)
# print ===> $rows
# if $rows != 3 then
# return -1
# endi
-print =====select _wstartts, stddev(c1) as b from t1 where c1 <= 6 interval(180d)
-sql select _wstartts, stddev(c1) as b from t1 where c1 <= 6 interval(180d)
+print =====select _wstart, stddev(c1) as b from t1 where c1 <= 6 interval(180d)
+sql select _wstart, stddev(c1) as b from t1 where c1 <= 6 interval(180d)
# print ===> $rows
# if $rows != 3 then
# return -1
@@ -281,29 +281,29 @@ if $rows != 1 then
return -1
endi
-print =====sql : select _wstartts, stddev(c1) as b from ct4 interval(1y)
-sql select _wstartts, stddev(c1) as b from ct4 interval(1y)
+print =====sql : select _wstart, stddev(c1) as b from ct4 interval(1y)
+sql select _wstart, stddev(c1) as b from ct4 interval(1y)
print ===> $rows
if $rows != 4 then
return -1
endi
-print =====sql : select _wstartts, stddev(c1) as b from t1 interval(1y)
-sql select _wstartts, stddev(c1) as b from t1 interval(1y)
+print =====sql : select _wstart, stddev(c1) as b from t1 interval(1y)
+sql select _wstart, stddev(c1) as b from t1 interval(1y)
print ===> $rows
if $rows != 3 then
return -1
endi
-print =====select _wstartts, stddev(c1) as b from ct4 where c1 <= 6 interval(180d)
-sql select _wstartts, stddev(c1) as b from ct4 where c1 <= 6 interval(180d)
+print =====select _wstart, stddev(c1) as b from ct4 where c1 <= 6 interval(180d)
+sql select _wstart, stddev(c1) as b from ct4 where c1 <= 6 interval(180d)
print ===> $rows
if $rows != 3 then
return -1
endi
-print =====select _wstartts, stddev(c1) as b from t1 where c1 <= 6 interval(180d)
-sql select _wstartts, stddev(c1) as b from t1 where c1 <= 6 interval(180d)
+print =====select _wstart, stddev(c1) as b from t1 where c1 <= 6 interval(180d)
+sql select _wstart, stddev(c1) as b from t1 where c1 <= 6 interval(180d)
print ===> $rows
if $rows != 3 then
return -1
diff --git a/tests/script/tsim/scalar/scalar.sim b/tests/script/tsim/scalar/scalar.sim
new file mode 100644
index 0000000000000000000000000000000000000000..32224e33ba7fa149d8f64ae9e7b3901d2cce0809
--- /dev/null
+++ b/tests/script/tsim/scalar/scalar.sim
@@ -0,0 +1,67 @@
+system sh/stop_dnodes.sh
+system sh/deploy.sh -n dnode1 -i 1
+system sh/exec.sh -n dnode1 -s start
+sql connect
+
+print ======== step1
+sql drop database if exists db1;
+sql create database db1 vgroups 3;
+sql use db1;
+sql create stable st1 (fts timestamp, fbool bool, ftiny tinyint, fsmall smallint, fint int, fbig bigint, futiny tinyint unsigned, fusmall smallint unsigned, fuint int unsigned, fubig bigint unsigned, ffloat float, fdouble double, fbin binary(10), fnchar nchar(10)) tags(tts timestamp, tbool bool, ttiny tinyint, tsmall smallint, tint int, tbig bigint, tutiny tinyint unsigned, tusmall smallint unsigned, tuint int unsigned, tubig bigint unsigned, tfloat float, tdouble double, tbin binary(10), tnchar nchar(10));
+sql create table tb1 using st1 tags('2022-07-10 16:31:00', true, 1, 1, 1, 1, 1, 1, 1, 1, 1.0, 1.0, 'a', 'a');
+sql create table tb2 using st1 tags('2022-07-10 16:32:00', false, 2, 2, 2, 2, 2, 2, 2, 2, 2.0, 2.0, 'b', 'b');
+sql create table tb3 using st1 tags('2022-07-10 16:33:00', true, 3, 3, 3, 3, 3, 3, 3, 3, 3.0, 3.0, 'c', 'c');
+
+sql insert into tb1 values ('2022-07-10 16:31:01', false, 1, 1, 1, 1, 1, 1, 1, 1, 1.0, 1.0, 'a', 'a');
+sql insert into tb1 values ('2022-07-10 16:31:02', true, 2, 2, 2, 2, 2, 2, 2, 2, 2.0, 2.0, 'b', 'b');
+sql insert into tb1 values ('2022-07-10 16:31:03', false, 3, 3, 3, 3, 3, 3, 3, 3, 3.0, 3.0, 'c', 'c');
+sql insert into tb1 values ('2022-07-10 16:31:04', true, 4, 4, 4, 4, 4, 4, 4, 4, 4.0, 4.0, 'd', 'd');
+sql insert into tb1 values ('2022-07-10 16:31:05', false, 5, 5, 5, 5, 5, 5, 5, 5, 5.0, 5.0, 'e', 'e');
+
+sql insert into tb2 values ('2022-07-10 16:32:01', false, 1, 1, 1, 1, 1, 1, 1, 1, 1.0, 1.0, 'a', 'a');
+sql insert into tb2 values ('2022-07-10 16:32:02', true, 2, 2, 2, 2, 2, 2, 2, 2, 2.0, 2.0, 'b', 'b');
+sql insert into tb2 values ('2022-07-10 16:32:03', false, 3, 3, 3, 3, 3, 3, 3, 3, 3.0, 3.0, 'c', 'c');
+sql insert into tb2 values ('2022-07-10 16:32:04', true, 4, 4, 4, 4, 4, 4, 4, 4, 4.0, 4.0, 'd', 'd');
+sql insert into tb2 values ('2022-07-10 16:32:05', false, 5, 5, 5, 5, 5, 5, 5, 5, 5.0, 5.0, 'e', 'e');
+
+sql insert into tb3 values ('2022-07-10 16:33:01', false, 1, 1, 1, 1, 1, 1, 1, 1, 1.0, 1.0, 'a', 'a');
+sql insert into tb3 values ('2022-07-10 16:33:02', true, 2, 2, 2, 2, 2, 2, 2, 2, 2.0, 2.0, 'b', 'b');
+sql insert into tb3 values ('2022-07-10 16:33:03', false, 3, 3, 3, 3, 3, 3, 3, 3, 3.0, 3.0, 'c', 'c');
+sql insert into tb3 values ('2022-07-10 16:33:04', true, 4, 4, 4, 4, 4, 4, 4, 4, 4.0, 4.0, 'd', 'd');
+sql insert into tb3 values ('2022-07-10 16:33:05', false, 5, 5, 5, 5, 5, 5, 5, 5, 5.0, 5.0, 'e', 'e');
+
+sql select 1+1n;
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 2.000000000 then
+ return -1
+endi
+
+
+sql select cast(1 as timestamp)+1n;
+if $rows != 1 then
+ return -1
+endi
+if $data00 != @70-02-01 08:00:00.000@ then
+ return -1
+endi
+
+sql select 1-1n;
+if $rows != 1 then
+ return -1
+endi
+
+sql select cast(1 as timestamp)-1y;
+if $rows != 1 then
+ return -1
+endi
+if $data00 != @69-01-01 08:00:00.000@ then
+ return -1
+endi
+
+sql select 1n-now();
+sql select 1n+now();
+#sql select avg(4n);
+
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim
index 3a1ed62a7203566ae2e8c4c43df4bee11e5c9aa3..6cca47423ab7596b129cf6a9da7f773354b6a853 100644
--- a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim
+++ b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim
@@ -58,7 +58,7 @@ if $rows != 5 then
endi
print =============== select * from stb from memory in designated vgroup
-sql select _wstartts, _wendts, min(c1),max(c2),max(c1) from stb interval(5m,10s) sliding(5m);
+sql select _wstart, _wend, min(c1),max(c2),max(c1) from stb interval(5m,10s) sliding(5m);
print $data00 $data01 $data02 $data03 $data04
if $rows != 1 then
print rows $rows != 1
@@ -81,7 +81,7 @@ if $data04 != 20 then
endi
print =============== select * from stb from memory in common vgroups
-sql select _wstartts, _wendts, min(c1),max(c2),max(c1),max(c3) from stb interval(5m,10s) sliding(5m);
+sql select _wstart, _wend, min(c1),max(c2),max(c1),max(c3) from stb interval(5m,10s) sliding(5m);
print $data00 $data01 $data02 $data03 $data04 $data05
if $rows != 1 then
print rows $rows != 1
@@ -128,7 +128,7 @@ if $rows != 5 then
endi
print =============== select * from stb from file in designated vgroup
-sql select _wstartts, _wendts, min(c1),max(c2),max(c1) from stb interval(5m,10s) sliding(5m);
+sql select _wstart, _wend, min(c1),max(c2),max(c1) from stb interval(5m,10s) sliding(5m);
print $data00 $data01 $data02 $data03 $data04
if $rows != 1 then
print rows $rows != 1
@@ -151,7 +151,7 @@ if $data04 != 20 then
endi
print =============== select * from stb from file in common vgroups
-sql select _wstartts, _wendts, min(c1),max(c2),max(c1),max(c3) from stb interval(5m,10s) sliding(5m);
+sql select _wstart, _wend, min(c1),max(c2),max(c1),max(c3) from stb interval(5m,10s) sliding(5m);
print $data00 $data01 $data02 $data03 $data04 $data05
if $rows != 1 then
print rows $rows != 1
diff --git a/tests/script/tsim/stream/basic0.sim b/tests/script/tsim/stream/basic0.sim
index 29775a5ef1d1daf90122f053da6c153bac843341..61f7a57dcffe605f9b7d262676c95f377e6669e6 100644
--- a/tests/script/tsim/stream/basic0.sim
+++ b/tests/script/tsim/stream/basic0.sim
@@ -33,7 +33,7 @@ if $rows != 3 then
return -1
endi
-sql create stream s1 trigger at_once into outstb as select _wstartts, min(k), max(k), sum(k) as sum_alias from ct1 interval(10m)
+sql create stream s1 trigger at_once into outstb as select _wstart, min(k), max(k), sum(k) as sum_alias from ct1 interval(10m)
sql show stables
if $rows != 2 then
@@ -48,7 +48,7 @@ sleep 100
#===================================================================
print =============== query data from child table
-sql select `_wstartts`,`min(k)`,`max(k)`,sum_alias from outstb
+sql select `_wstart`,`min(k)`,`max(k)`,sum_alias from outstb
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
@@ -77,7 +77,7 @@ sleep 100
#===================================================================
print =============== query data from child table
-sql select `_wstartts`,`min(k)`,`max(k)`,sum_alias from outstb
+sql select `_wstart`,`min(k)`,`max(k)`,sum_alias from outstb
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
@@ -105,7 +105,7 @@ sleep 100
#===================================================================
print =============== query data from child table
-sql select `_wstartts`,`min(k)`,`max(k)`,sum_alias from outstb
+sql select `_wstart`,`min(k)`,`max(k)`,sum_alias from outstb
print rows: $rows
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
diff --git a/tests/script/tsim/stream/basic1.sim b/tests/script/tsim/stream/basic1.sim
index 8e6391eb0b76d9d8585ce6ac941705e10e24ed6c..2a6d64bcaf4871283a56a1e9452ec03ad80e1dfc 100644
--- a/tests/script/tsim/stream/basic1.sim
+++ b/tests/script/tsim/stream/basic1.sim
@@ -17,14 +17,14 @@ sql use test
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams1 trigger at_once into streamt as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
+sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791223001,2,2,3,1.1);
sql insert into t1 values(1648791233002,3,2,3,2.1);
sql insert into t1 values(1648791243003,4,2,3,3.1);
sql insert into t1 values(1648791213004,4,2,3,4.1);
sleep 1000
-sql select `_wstartts`, c1, c2 ,c3 ,c4, c5 from streamt;
+sql select `_wstart`, c1, c2 ,c3 ,c4, c5 from streamt;
if $rows != 4 then
print ======$rows
@@ -254,7 +254,7 @@ endi
sql insert into t1 values(1648791223002,12,14,13,11.1);
sleep 100
-sql select `_wstartts`, c1, c2 ,c3 ,c4, c5 from streamt;
+sql select `_wstart`, c1, c2 ,c3 ,c4, c5 from streamt;
# row 1
if $data11 != 2 then
@@ -284,7 +284,7 @@ endi
sql insert into t1 values(1648791223003,12,14,13,11.1);
sleep 100
-sql select `_wstartts`, c1, c2 ,c3 ,c4, c5 from streamt;
+sql select `_wstart`, c1, c2 ,c3 ,c4, c5 from streamt;
# row 1
if $data11 != 3 then
@@ -316,7 +316,7 @@ sql insert into t1 values(1648791223001,1,1,1,1.1);
sql insert into t1 values(1648791223002,2,2,2,2.1);
sql insert into t1 values(1648791223003,3,3,3,3.1);
sleep 100
-sql select `_wstartts`, c1, c2 ,c3 ,c4, c5 from streamt;
+sql select `_wstart`, c1, c2 ,c3 ,c4, c5 from streamt;
# row 1
if $data11 != 3 then
@@ -348,7 +348,7 @@ sql insert into t1 values(1648791233003,3,2,3,2.1);
sql insert into t1 values(1648791233002,5,6,7,8.1);
sql insert into t1 values(1648791233002,3,2,3,2.1);
sleep 100
-sql select `_wstartts`, c1, c2 ,c3 ,c4, c5 from streamt;
+sql select `_wstart`, c1, c2 ,c3 ,c4, c5 from streamt;
# row 2
if $data21 != 2 then
@@ -378,7 +378,7 @@ endi
sql insert into t1 values(1648791213004,4,2,3,4.1) (1648791213006,5,4,7,9.1) (1648791213004,40,20,30,40.1) (1648791213005,4,2,3,4.1);
sleep 100
-sql select `_wstartts`, c1, c2 ,c3 ,c4, c5 from streamt;
+sql select `_wstart`, c1, c2 ,c3 ,c4, c5 from streamt;
# row 0
if $data01 != 4 then
@@ -408,7 +408,7 @@ endi
sql insert into t1 values(1648791223004,4,2,3,4.1) (1648791233006,5,4,7,9.1) (1648791223004,40,20,30,40.1) (1648791233005,4,2,3,4.1);
sleep 100
-sql select `_wstartts`, c1, c2 ,c3 ,c4, c5 from streamt;
+sql select `_wstart`, c1, c2 ,c3 ,c4, c5 from streamt;
# row 1
if $data11 != 4 then
diff --git a/tests/script/tsim/stream/basic2.sim b/tests/script/tsim/stream/basic2.sim
index 247d8f62eeae7cda38829db5c2c4fd6b2843c787..1a6c7c5c25e02500ed6e0683c9766b49d1e353e4 100644
--- a/tests/script/tsim/stream/basic2.sim
+++ b/tests/script/tsim/stream/basic2.sim
@@ -33,7 +33,7 @@ if $rows != 3 then
return -1
endi
-sql create stream s1 trigger at_once into outstb as select _wstartts, min(k), max(k), sum(k) as sum_alias from ct1 interval(10m)
+sql create stream s1 trigger at_once into outstb as select _wstart, min(k), max(k), sum(k) as sum_alias from ct1 interval(10m)
sql show stables
if $rows != 2 then
@@ -48,7 +48,7 @@ sleep 100
#===================================================================
print =============== query data from child table
-sql select `_wstartts`,`min(k)`,`max(k)`,sum_alias from outstb
+sql select `_wstart`,`min(k)`,`max(k)`,sum_alias from outstb
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
@@ -77,7 +77,7 @@ sleep 100
#===================================================================
print =============== query data from child table
-sql select `_wstartts`,`min(k)`,`max(k)`,sum_alias from outstb
+sql select `_wstart`,`min(k)`,`max(k)`,sum_alias from outstb
print rows: $rows
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
diff --git a/tests/script/tsim/stream/distributeInterval0.sim b/tests/script/tsim/stream/distributeInterval0.sim
index ab2ca92c86b0d543631be0463e59668ac6470a5a..1ee72527e91fedc144f4328651bb755bd0073044 100644
--- a/tests/script/tsim/stream/distributeInterval0.sim
+++ b/tests/script/tsim/stream/distributeInterval0.sim
@@ -41,7 +41,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once watermark 1d into streamtST1 as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
+sql create stream stream_t1 trigger at_once watermark 1d into streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
sleep 1000
@@ -195,7 +195,7 @@ if $data35 != 3 then
return -1
endi
-sql select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5, avg(d) from st interval(10s);
+sql select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5, avg(d) from st interval(10s);
sql create database test1 vgroups 1;
@@ -203,7 +203,7 @@ sql use test1;
sql create stable st(ts timestamp, a int, b int , c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t2 trigger at_once watermark 20s into streamtST1 as select _wstartts, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st interval(10s) ;
+sql create stream stream_t2 trigger at_once watermark 20s into streamtST1 as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3);
sql insert into ts1 values(1648791222001,2,2,3);
diff --git a/tests/script/tsim/stream/distributeIntervalRetrive0.sim b/tests/script/tsim/stream/distributeIntervalRetrive0.sim
index cde5c7058fc43e62d95e70bbeb150e5d2033e073..927301c3c84027e3aed64660de34887683ccc6a2 100644
--- a/tests/script/tsim/stream/distributeIntervalRetrive0.sim
+++ b/tests/script/tsim/stream/distributeIntervalRetrive0.sim
@@ -41,7 +41,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once into streamtST1 as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
+sql create stream stream_t1 trigger at_once into streamtST1 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
sleep 1000
@@ -76,7 +76,7 @@ if $data01 != 5 then
goto loop1
endi
-if $data02 != 14 then
+if $data02 != 38 then
print =====data02=$data02
goto loop1
endi
@@ -134,7 +134,7 @@ if $data01 != 6 then
goto loop2
endi
-if $data02 != 18 then
+if $data02 != 42 then
print =====data02=$data02
goto loop2
endi
@@ -192,7 +192,7 @@ if $data01 != 7 then
goto loop3
endi
-if $data02 != 22 then
+if $data02 != 46 then
print =====data02=$data02
goto loop3
endi
@@ -232,60 +232,4 @@ endi
print loop3 over
-$loop_count = 0
-loop4:
-sleep 1000
-sql select * from streamtST1;
-
-$loop_count = $loop_count + 1
-if $loop_count == 10 then
- return -1
-endi
-
-# row 0
-if $data01 != 7 then
- print =====data01=$data01
- goto loop4
-endi
-
-if $data02 != 22 then
- print =====data02=$data02
- goto loop4
-endi
-
-# row 1
-if $data11 != 3 then
- print =====data11=$data11
- goto loop4
-endi
-
-if $data12 != 10 then
- print =====data12=$data12
- goto loop4
-endi
-
-#row2
-if $data21 != 3 then
- print =====data21=$data21
- goto loop4
-endi
-
-if $data22 != 11 then
- print =====data22=$data22
- goto loop4
-endi
-
-#row 3
-if $data31 != 5 then
- print =====data31=$data31
- goto loop4
-endi
-
-if $data32 != 60 then
- print =====data32=$data32
- goto loop4
-endi
-
-print loop4 over
-
system sh/stop_dnodes.sh
diff --git a/tests/script/tsim/stream/distributeSession0.sim b/tests/script/tsim/stream/distributeSession0.sim
index 30c3c641d446413e4cac58e8462bedf84a520a68..190304ff196d9af0705074d88dee4f86df394def 100644
--- a/tests/script/tsim/stream/distributeSession0.sim
+++ b/tests/script/tsim/stream/distributeSession0.sim
@@ -39,7 +39,7 @@ sql use test;
sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t1 trigger at_once into streamtST as select _wstartts, count(*) c1, sum(a) c2 , max(b) c3 from st session(ts, 10s) ;
+sql create stream stream_t1 trigger at_once into streamtST as select _wstart, count(*) c1, sum(a) c2 , max(b) c3 from st session(ts, 10s) ;
sleep 1000
diff --git a/tests/script/tsim/stream/ignoreExpiredData.sim b/tests/script/tsim/stream/ignoreExpiredData.sim
index c6b708d1e8783a2b5b9c02e2e2e285661623c839..a3b14c4f7a09721aac842d206c3f15dd75fd8fa7 100644
--- a/tests/script/tsim/stream/ignoreExpiredData.sim
+++ b/tests/script/tsim/stream/ignoreExpiredData.sim
@@ -45,9 +45,9 @@ print $data00 $data01 $data02
sql use test
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams1 trigger at_once IGNORE EXPIRED into streamt1 as select _wstartts, count(*) c1, sum(a) c3 from t1 interval(10s);
-sql create stream streams2 trigger at_once IGNORE EXPIRED into streamt2 as select _wstartts, count(*) c1, sum(a) c3 from t1 session(ts,10s);
-sql create stream streams3 trigger at_once IGNORE EXPIRED into streamt3 as select _wstartts, count(*) c1, sum(a) c3 from t1 state_window(a);
+sql create stream streams1 trigger at_once IGNORE EXPIRED into streamt1 as select _wstart, count(*) c1, sum(a) c3 from t1 interval(10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED into streamt2 as select _wstart, count(*) c1, sum(a) c3 from t1 session(ts,10s);
+sql create stream streams3 trigger at_once IGNORE EXPIRED into streamt3 as select _wstart, count(*) c1, sum(a) c3 from t1 state_window(a);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791223001,1,2,3,1.1);
sql insert into t1 values(1648791233002,2,2,3,2.1);
@@ -111,8 +111,8 @@ sql use test1
sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t1 trigger at_once IGNORE EXPIRED into streamtST1 as select _wstartts, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st interval(10s) ;
-sql create stream stream_t2 trigger at_once IGNORE EXPIRED into streamtST2 as select _wstartts, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st session(ts, 10s) ;
+sql create stream stream_t1 trigger at_once IGNORE EXPIRED into streamtST1 as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st interval(10s) ;
+sql create stream stream_t2 trigger at_once IGNORE EXPIRED into streamtST2 as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st session(ts, 10s) ;
sql insert into ts1 values(1648791211000,1,2,3);
sql insert into ts1 values(1648791222001,2,2,3);
sql insert into ts2 values(1648791211000,1,2,3);
diff --git a/tests/script/tsim/stream/partitionby.sim b/tests/script/tsim/stream/partitionby.sim
index c634ad85eef0713a3955d806a953e4bf93947be7..e5e02c3873252a7d942ee5a5c07772c89aa97111 100644
--- a/tests/script/tsim/stream/partitionby.sim
+++ b/tests/script/tsim/stream/partitionby.sim
@@ -11,7 +11,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once into streamtST1 as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by ta,tb,tc interval(10s);
+sql create stream stream_t1 trigger at_once into streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by ta,tb,tc interval(10s);
sql insert into ts1 values(1648791213001,1,12,3,1.0);
sql insert into ts2 values(1648791213001,1,12,3,1.0);
@@ -43,7 +43,7 @@ sql create table ts1 using st tags(1,2,3);
sql create table ts2 using st tags(1,3,4);
sql create table ts3 using st tags(1,4,5);
-sql create stream streams1 trigger at_once into streamt as select _wstartts, count(*) c1, count(a) c2 from st partition by ta,tb,tc interval(10s);
+sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, count(a) c2 from st partition by ta,tb,tc interval(10s);
sql insert into ts1 values(1648791211000,1,2,3);
@@ -74,7 +74,7 @@ sql create stable st(ts timestamp,a int,b int,c int,id int) tags(ta int,tb int,t
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t2 trigger at_once watermark 20s into streamtST as select _wstartts, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6, max(id) c7 from st partition by ta interval(10s) ;
+sql create stream stream_t2 trigger at_once watermark 20s into streamtST as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6, max(id) c7 from st partition by ta interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3,1);
sql insert into ts1 values(1648791222001,2,2,3,2);
sql insert into ts2 values(1648791211000,1,2,3,3);
diff --git a/tests/script/tsim/stream/partitionby1.sim b/tests/script/tsim/stream/partitionby1.sim
index 3e823b05d613e9dcd8016e5889cc4181c82c2696..b29666cad7df8178e65f7032948d8b01ebd86855 100644
--- a/tests/script/tsim/stream/partitionby1.sim
+++ b/tests/script/tsim/stream/partitionby1.sim
@@ -11,7 +11,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once into streamtST1 as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by tbname interval(10s);
+sql create stream stream_t1 trigger at_once into streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by tbname interval(10s);
sql insert into ts1 values(1648791213001,1,12,3,1.0);
sql insert into ts2 values(1648791213001,1,12,3,1.0);
@@ -43,7 +43,7 @@ sql create table ts1 using st tags(1,2,3);
sql create table ts2 using st tags(1,3,4);
sql create table ts3 using st tags(1,4,5);
-sql create stream streams1 trigger at_once into streamt as select _wstartts, count(*) c1, count(a) c2 from st partition by tbname interval(10s);
+sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, count(a) c2 from st partition by tbname interval(10s);
sql insert into ts1 values(1648791211000,1,2,3);
@@ -74,7 +74,7 @@ sql create stable st(ts timestamp,a int,b int,c int,id int) tags(ta int,tb int,t
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t2 trigger at_once into streamtST as select _wstartts, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6, max(id) c7 from st partition by tbname interval(10s) ;
+sql create stream stream_t2 trigger at_once into streamtST as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6, max(id) c7 from st partition by tbname interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3,1);
sql insert into ts1 values(1648791222001,2,2,3,2);
sql insert into ts2 values(1648791211000,1,2,3,3);
diff --git a/tests/script/tsim/stream/schedSnode.sim b/tests/script/tsim/stream/schedSnode.sim
index dbdaaf65d0ad74ef28f6709f8a9c04582b0c5293..61f01baf399b0fa4aad3adee9e006ecda60a72a5 100644
--- a/tests/script/tsim/stream/schedSnode.sim
+++ b/tests/script/tsim/stream/schedSnode.sim
@@ -16,7 +16,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once into target.streamtST1 as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
+sql create stream stream_t1 trigger at_once into target.streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
sleep 1000
@@ -170,4 +170,4 @@ if $data35 != 3 then
return -1
endi
-sql select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5, avg(d) from st interval(10s);
+sql select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5, avg(d) from st interval(10s);
diff --git a/tests/script/tsim/stream/session0.sim b/tests/script/tsim/stream/session0.sim
index eb440d78c467c704669e64faf2fdf539638bdeb8..16a53d49f3690e3b3994da2f36ece8209fbb6cfb 100644
--- a/tests/script/tsim/stream/session0.sim
+++ b/tests/script/tsim/stream/session0.sim
@@ -17,7 +17,7 @@ sql use test
sql create table t1(ts timestamp, a int, b int , c int, d double,id int);
-sql create stream streams1 trigger at_once into streamt as select _wstartts, count(*) c1, sum(a), max(a), min(d), stddev(a), last(a), first(d), max(id) s from t1 session(ts,10s);
+sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, sum(a), max(a), min(d), stddev(a), last(a), first(d), max(id) s from t1 session(ts,10s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL,1);
sql insert into t1 values(1648791223001,10,2,3,1.1,2);
sql insert into t1 values(1648791233002,3,2,3,2.1,3);
@@ -179,7 +179,7 @@ endi
sql create database test2 vgroups 1;
sql use test2;
sql create table t2(ts timestamp, a int, b int , c int, d double, id int);
-sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstartts,apercentile(a,30) c1, apercentile(a,70), apercentile(a,20,"t-digest") c2, apercentile(a,60,"t-digest") c3, max(id) c4 from t2 session(ts,10s);
+sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstart,apercentile(a,30) c1, apercentile(a,70), apercentile(a,20,"t-digest") c2, apercentile(a,60,"t-digest") c3, max(id) c4 from t2 session(ts,10s);
sql insert into t2 values(1648791213001,1,1,3,1.0,1);
sql insert into t2 values(1648791213002,2,2,6,3.4,2);
sql insert into t2 values(1648791213003,4,9,3,4.8,3);
@@ -229,13 +229,13 @@ endi
sql create database test3 vgroups 1;
sql use test3;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams3 trigger at_once watermark 1d into streamt3 as select _wstartts, min(b), a,c from t1 session(ts,10s);
-sql create stream streams4 trigger at_once watermark 1d into streamt4 as select _wstartts, max(b), a,c from t1 session(ts,10s);
-# sql create stream streams5 trigger at_once watermark 1d into streamt5 as select _wstartts, top(b,3), a,c from t1 session(ts,10s);
-# sql create stream streams6 trigger at_once watermark 1d into streamt6 as select _wstartts, bottom(b,3), a,c from t1 session(ts,10s);
-# sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstartts, spread(a), elapsed(ts), hyperloglog(a) from t1 session(ts,10s);
-sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstartts, spread(a), hyperloglog(a) from t1 session(ts,10s);
-# sql create stream streams8 trigger at_once watermark 1d into streamt8 as select _wstartts, histogram(a,"user_input", "[1,3,5,7]", 1), histogram(a,"user_input", "[1,3,5,7]", 0) from t1 session(ts,10s);
+sql create stream streams3 trigger at_once watermark 1d into streamt3 as select _wstart, min(b), a,c from t1 session(ts,10s);
+sql create stream streams4 trigger at_once watermark 1d into streamt4 as select _wstart, max(b), a,c from t1 session(ts,10s);
+# sql create stream streams5 trigger at_once watermark 1d into streamt5 as select _wstart, top(b,3), a,c from t1 session(ts,10s);
+# sql create stream streams6 trigger at_once watermark 1d into streamt6 as select _wstart, bottom(b,3), a,c from t1 session(ts,10s);
+# sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstart, spread(a), elapsed(ts), hyperloglog(a) from t1 session(ts,10s);
+sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstart, spread(a), hyperloglog(a) from t1 session(ts,10s);
+# sql create stream streams8 trigger at_once watermark 1d into streamt8 as select _wstart, histogram(a,"user_input", "[1,3,5,7]", 1), histogram(a,"user_input", "[1,3,5,7]", 0) from t1 session(ts,10s);
sql insert into t1 values(1648791213001,1,1,1,1.0);
sql insert into t1 values(1648791213002,2,3,2,3.4);
sql insert into t1 values(1648791213003,4,9,3,4.8);
diff --git a/tests/script/tsim/stream/session1.sim b/tests/script/tsim/stream/session1.sim
index 347eda9bf6fc8c6a20e3e94184b78ee1309df5f3..12ff2a61991b02495b62859cf33a55d3c8037aba 100644
--- a/tests/script/tsim/stream/session1.sim
+++ b/tests/script/tsim/stream/session1.sim
@@ -17,7 +17,7 @@ sql use test
sql create table t1(ts timestamp, a int, b int , c int, d double,id int);
-sql create stream streams2 trigger at_once into streamt as select _wstartts, count(*) c1, sum(a), min(b), max(id) s from t1 session(ts,10s);
+sql create stream streams2 trigger at_once into streamt as select _wstart, count(*) c1, sum(a), min(b), max(id) s from t1 session(ts,10s);
sql insert into t1 values(1648791210000,1,1,1,1.1,1);
sql insert into t1 values(1648791220000,2,2,2,2.1,2);
sql insert into t1 values(1648791230000,3,3,3,3.1,3);
diff --git a/tests/script/tsim/stream/sliding.sim b/tests/script/tsim/stream/sliding.sim
new file mode 100644
index 0000000000000000000000000000000000000000..44f96cbefa091ae6f89028f525f2d8659ac9f1f7
--- /dev/null
+++ b/tests/script/tsim/stream/sliding.sim
@@ -0,0 +1,243 @@
+system sh/stop_dnodes.sh
+system sh/deploy.sh -n dnode1 -i 1
+system sh/exec.sh -n dnode1 -s start
+sleep 50
+sql connect
+
+print =============== create database
+sql create database test vgroups 1
+sql show databases
+if $rows != 3 then
+ return -1
+endi
+
+print $data00 $data01 $data02
+
+sql use test
+sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
+sql create table t1 using st tags(1,1,1);
+sql create table t2 using st tags(2,2,2);
+sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
+sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
+sql create stream stream_t1 trigger at_once into streamtST as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
+sql create stream stream_t2 trigger at_once watermark 1d into streamtST2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
+
+sql insert into t1 values(1648791210000,1,2,3,1.0);
+sql insert into t1 values(1648791216000,2,2,3,1.1);
+sql insert into t1 values(1648791220000,3,2,3,2.1);
+
+sql insert into t1 values(1648791210000,1,2,3,1.0);
+sql insert into t1 values(1648791216000,2,2,3,1.1);
+sql insert into t1 values(1648791220000,3,2,3,2.1);
+
+sql insert into t2 values(1648791210000,1,2,3,1.0);
+sql insert into t2 values(1648791216000,2,2,3,1.1);
+sql insert into t2 values(1648791220000,3,2,3,2.1);
+
+sql insert into t2 values(1648791210000,1,2,3,1.0);
+sql insert into t2 values(1648791216000,2,2,3,1.1);
+sql insert into t2 values(1648791220000,3,2,3,2.1);
+
+$loop_count = 0
+
+loop0:
+sleep 300
+
+$loop_count = $loop_count + 1
+if $loop_count == 10 then
+ return -1
+endi
+
+
+sql select * from streamt
+
+# row 0
+if $data01 != 1 then
+ print =====data01=$data01
+ goto loop0
+endi
+
+if $data02 != 1 then
+ print =====data02=$data02
+ goto loop0
+endi
+
+# row 1
+if $data11 != 2 then
+ print =====data11=$data11
+ goto loop0
+endi
+
+if $data12 != 3 then
+ print =====data12=$data12
+ goto loop0
+endi
+
+# row 2
+if $data21 != 2 then
+ print =====data21=$data21
+ goto loop0
+endi
+
+if $data22 != 5 then
+ print =====data22=$data22
+ goto loop0
+endi
+
+# row 3
+if $data31 != 1 then
+ print =====data31=$data31
+ goto loop0
+endi
+
+if $data32 != 3 then
+ print =====data32=$data32
+ goto loop0
+endi
+
+print step 1
+
+sql select * from streamt2
+
+# row 0
+if $data01 != 1 then
+ print =====data01=$data01
+ goto loop0
+endi
+
+if $data02 != 1 then
+ print =====data02=$data02
+ goto loop0
+endi
+
+# row 1
+if $data11 != 2 then
+ print =====data11=$data11
+ goto loop0
+endi
+
+if $data12 != 3 then
+ print =====data12=$data12
+ goto loop0
+endi
+
+# row 2
+if $data21 != 2 then
+ print =====data21=$data21
+ goto loop0
+endi
+
+if $data22 != 5 then
+ print =====data22=$data22
+ goto loop0
+endi
+
+# row 3
+if $data31 != 1 then
+ print =====data31=$data31
+ goto loop0
+endi
+
+if $data32 != 3 then
+ print =====data32=$data32
+ goto loop0
+endi
+
+print step 2
+
+sql select * from streamtST
+
+# row 0
+if $data01 != 2 then
+ print =====data01=$data01
+ goto loop0
+endi
+
+if $data02 != 2 then
+ print =====data02=$data02
+ goto loop0
+endi
+
+# row 1
+if $data11 != 4 then
+ print =====data11=$data11
+ goto loop0
+endi
+
+if $data12 != 6 then
+ print =====data12=$data12
+ goto loop0
+endi
+
+# row 2
+if $data21 != 4 then
+ print =====data21=$data21
+ goto loop0
+endi
+
+if $data22 != 10 then
+ print =====data22=$data22
+ goto loop0
+endi
+
+# row 3
+if $data31 != 2 then
+ print =====data31=$data31
+ goto loop0
+endi
+
+if $data32 != 6 then
+ print =====data32=$data32
+ goto loop0
+endi
+
+print step 3
+
+sql select * from streamtST2
+
+# row 0
+if $data01 != 2 then
+ print =====data01=$data01
+ goto loop0
+endi
+
+if $data02 != 2 then
+ print =====data02=$data02
+ goto loop0
+endi
+
+# row 1
+if $data11 != 4 then
+ print =====data11=$data11
+ goto loop0
+endi
+
+if $data12 != 6 then
+ print =====data12=$data12
+ goto loop0
+endi
+
+# row 2
+if $data21 != 4 then
+ print =====data21=$data21
+ goto loop0
+endi
+
+if $data22 != 10 then
+ print =====data22=$data22
+ goto loop0
+endi
+
+# row 3
+if $data31 != 2 then
+ print =====data31=$data31
+ goto loop0
+endi
+
+if $data32 != 6 then
+ print =====data32=$data32
+ goto loop0
+endi
+
+
+system sh/stop_dnodes.sh
\ No newline at end of file
diff --git a/tests/script/tsim/stream/state0.sim b/tests/script/tsim/stream/state0.sim
index f98e356540dbb0e5cfef0c6bcd4d8613312939dd..a0535cf93d168401e6384cd3c4039db095e331aa 100644
--- a/tests/script/tsim/stream/state0.sim
+++ b/tests/script/tsim/stream/state0.sim
@@ -16,7 +16,7 @@ print $data00 $data01 $data02
sql use test
sql create table t1(ts timestamp, a int, b int , c int, d double, id int);
-sql create stream streams1 trigger at_once into streamt1 as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
+sql create stream streams1 trigger at_once into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
sql insert into t1 values(1648791213000,1,2,3,1.0,1);
sql insert into t1 values(1648791213000,1,2,3,1.0,2);
@@ -54,7 +54,7 @@ sql insert into t1 values(1648791213000,1,2,3,1.0,5);
sql insert into t1 values(1648791214000,1,2,3,1.0,6);
$loop_count = 0
loop1:
-sql select * from streamt1 where c >=4 order by `_wstartts`;
+sql select * from streamt1 where c >=4 order by `_wstart`;
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
@@ -163,7 +163,7 @@ sql insert into t1 values(1648791213011,1,2,3,1.0,7);
$loop_count = 0
loop2:
-sql select * from streamt1 where c in (5,4,7) order by `_wstartts`;
+sql select * from streamt1 where c in (5,4,7) order by `_wstart`;
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
@@ -207,7 +207,7 @@ sql insert into t1 values(1648791213011,1,2,3,1.0,8);
$loop_count = 0
loop21:
-sql select * from streamt1 where c in (5,4,8) order by `_wstartts`;
+sql select * from streamt1 where c in (5,4,8) order by `_wstart`;
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
@@ -227,7 +227,7 @@ sql insert into t1 values(1648791213011,10,20,10,10.0,12);
$loop_count = 0
loop3:
-sql select * from streamt1 where c in (5,4,10,11,12) order by `_wstartts`;
+sql select * from streamt1 where c in (5,4,10,11,12) order by `_wstart`;
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
@@ -339,7 +339,7 @@ sql insert into t1 values(1648791213030,3,14,14,14.0,15) (1648791214020,15,15,15
$loop_count = 0
loop4:
-sql select * from streamt1 where c in (14,15,16) order by `_wstartts`;
+sql select * from streamt1 where c in (14,15,16) order by `_wstart`;
sleep 300
$loop_count = $loop_count + 1
@@ -457,7 +457,7 @@ print $data00 $data01 $data02
sql use test1
sql create table t1(ts timestamp, a int, b int , c int, d double, id int);
-sql create stream streams2 trigger at_once into streamt1 as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
+sql create stream streams2 trigger at_once into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
sql insert into t1 values(1648791212000,2,2,3,1.0,1);
sql insert into t1 values(1648791213000,1,2,3,1.0,1);
diff --git a/tests/script/tsim/stream/triggerInterval0.sim b/tests/script/tsim/stream/triggerInterval0.sim
index 756f591f3ff8a58586cc77ba5a95acc1f31d46b0..db6f27ed511ada5a81137e7cb5ee12c2e70edbf9 100644
--- a/tests/script/tsim/stream/triggerInterval0.sim
+++ b/tests/script/tsim/stream/triggerInterval0.sim
@@ -15,7 +15,7 @@ print $data00 $data01 $data02
sql use test
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams1 trigger window_close into streamt as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
+sql create stream streams1 trigger window_close into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
sql insert into t1 values(1648791213001,1,2,3,1.0);
sleep 300
diff --git a/tests/script/tsim/stream/triggerSession0.sim b/tests/script/tsim/stream/triggerSession0.sim
index 48827a64a274b34d935e8baea13a10f64baf617a..b15083ab1bb27016b542a25eb5a6d38515896019 100644
--- a/tests/script/tsim/stream/triggerSession0.sim
+++ b/tests/script/tsim/stream/triggerSession0.sim
@@ -15,7 +15,7 @@ print $data00 $data01 $data02
sql use test
sql create table t2(ts timestamp, a int, b int , c int, d double);
-sql create stream streams2 trigger window_close into streamt2 as select _wstartts, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t2 session(ts, 10s);
+sql create stream streams2 trigger window_close into streamt2 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t2 session(ts, 10s);
sql insert into t2 values(1648791213000,1,2,3,1.0);
sql insert into t2 values(1648791222999,1,2,3,1.0);
diff --git a/tests/script/tsim/stream/windowClose.sim b/tests/script/tsim/stream/windowClose.sim
index 695d5749faeddc08fa6f8376600b6cbcb188edd5..1f024b9836554c39e7f898fc8964015b851aef99 100644
--- a/tests/script/tsim/stream/windowClose.sim
+++ b/tests/script/tsim/stream/windowClose.sim
@@ -18,7 +18,7 @@ sql create stable st(ts timestamp, a int) tags(t int);
sql create table tu1 using st tags(1);
sql create table tu2 using st tags(2);
-sql create stream stream1 trigger window_close into streamt as select _wstartts, sum(a) from st interval(10s);
+sql create stream stream1 trigger window_close into streamt as select _wstart, sum(a) from st interval(10s);
sql insert into tu1 values(now, 1);
diff --git a/tests/script/general/rm_bak/tag/3.sim b/tests/script/tsim/tag/3.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/3.sim
rename to tests/script/tsim/tag/3.sim
index 20185f5f01403b838799427d9ac39fcafe653d86..d816aec3e3791762451e180b6cd7d807319d9ba6 100644
--- a/tests/script/general/rm_bak/tag/3.sim
+++ b/tests/script/tsim/tag/3.sim
@@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -494,28 +491,28 @@ if $data00 != 25 then
endi
print =============== step19
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/4.sim b/tests/script/tsim/tag/4.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/4.sim
rename to tests/script/tsim/tag/4.sim
index ee3c8efa6c47be1fc91b1114294b6ebf832eabdc..fcdb146fb9ce5e82dc72b114017173531be53dbf 100644
--- a/tests/script/general/rm_bak/tag/4.sim
+++ b/tests/script/tsim/tag/4.sim
@@ -1,13 +1,7 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
-sql reset query cache
print ======================== dnode1 start
@@ -681,34 +675,34 @@ if $data00 != 25 then
endi
print =============== step24
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 interval(1d) group by tgcol4
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/5.sim b/tests/script/tsim/tag/5.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/5.sim
rename to tests/script/tsim/tag/5.sim
index 895b1a9492644290e5c30abc901849e1adf33e6c..92695ddfcf10194d38baa4be27926659ce5d82f7 100644
--- a/tests/script/general/rm_bak/tag/5.sim
+++ b/tests/script/tsim/tag/5.sim
@@ -1,13 +1,7 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
-sql reset query cache
print ======================== dnode1 start
@@ -798,40 +792,40 @@ endi
print =============== step27
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 interval(1d) group by tgcol4
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 interval(1d) group by tgcol5
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 partition by tgcol5 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/6.sim b/tests/script/tsim/tag/6.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/6.sim
rename to tests/script/tsim/tag/6.sim
index 9190998bb316bc63fd47022029b4c8deb61c0727..4f7f5b88d1d2fad8cc6c55bed9937e29f2ef95e2 100644
--- a/tests/script/general/rm_bak/tag/6.sim
+++ b/tests/script/tsim/tag/6.sim
@@ -1,13 +1,7 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
-sql reset query cache
print ======================== dnode1 start
@@ -947,46 +941,46 @@ if $data00 != 25 then
endi
print =============== step31
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 interval(1d) group by tgcol4
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 interval(1d) group by tgcol5
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 partition by tgcol5 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 interval(1d) group by tgcol6
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 partition by tgcol6 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/add.sim b/tests/script/tsim/tag/add.sim
similarity index 99%
rename from tests/script/general/rm_bak/tag/add.sim
rename to tests/script/tsim/tag/add.sim
index 4a3871235ecfbd1546cbab1ba4ab90de33ac7ed8..290161488911d4ab9fcd075c6b3169d6a59ab09f 100644
--- a/tests/script/general/rm_bak/tag/add.sim
+++ b/tests/script/tsim/tag/add.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -849,7 +845,7 @@ step142:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/bigint.sim b/tests/script/tsim/tag/bigint.sim
similarity index 96%
rename from tests/script/general/rm_bak/tag/bigint.sim
rename to tests/script/tsim/tag/bigint.sim
index 3e5d528980e3f8716ae5dea0c1d4090e02d0420a..813387eb384316ac01bbb5c78da0afb38092a1e3 100644
--- a/tests/script/general/rm_bak/tag/bigint.sim
+++ b/tests/script/tsim/tag/bigint.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -226,18 +221,17 @@ if $data00 != 25 then
return -1
endi
-
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/binary.sim b/tests/script/tsim/tag/binary.sim
similarity index 96%
rename from tests/script/general/rm_bak/tag/binary.sim
rename to tests/script/tsim/tag/binary.sim
index 960f45675d28349d170544729055ca3b815a2ccb..6ede9889547fbde75bde999403d38d38dd59233a 100644
--- a/tests/script/general/rm_bak/tag/binary.sim
+++ b/tests/script/tsim/tag/binary.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -226,18 +221,17 @@ if $data00 != 25 then
return -1
endi
-
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/binary_binary.sim b/tests/script/tsim/tag/binary_binary.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/binary_binary.sim
rename to tests/script/tsim/tag/binary_binary.sim
index 3a0fb568482fa19a142f4b9019bd09c5208b4252..071b457b4486c03b617cf0e4de1466ca936db40e 100644
--- a/tests/script/general/rm_bak/tag/binary_binary.sim
+++ b/tests/script/tsim/tag/binary_binary.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -295,16 +290,16 @@ if $data00 != 25 then
endi
print =============== step14
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/bool.sim b/tests/script/tsim/tag/bool.sim
similarity index 95%
rename from tests/script/general/rm_bak/tag/bool.sim
rename to tests/script/tsim/tag/bool.sim
index e37cba669ba27ec4046e8483938763b90360de31..356269e1e178f103b03d1c4b8ece23d2604f3d9c 100644
--- a/tests/script/general/rm_bak/tag/bool.sim
+++ b/tests/script/tsim/tag/bool.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -223,19 +218,18 @@ if $data00 != 25 then
return -1
endi
-
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
-print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
+print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/bool_binary.sim b/tests/script/tsim/tag/bool_binary.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/bool_binary.sim
rename to tests/script/tsim/tag/bool_binary.sim
index 9f6e4f734432bd39c6250adbc0fe26883f104267..3fcb085e37507343af8c4686253a3e7d265d081b 100644
--- a/tests/script/general/rm_bak/tag/bool_binary.sim
+++ b/tests/script/tsim/tag/bool_binary.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -295,16 +290,16 @@ if $data00 != 25 then
endi
print =============== step14
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/bool_int.sim b/tests/script/tsim/tag/bool_int.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/bool_int.sim
rename to tests/script/tsim/tag/bool_int.sim
index 60345c2d68b9216acc78e8bb8617c698013f4402..2ff640b329a87624809a2ef41a6e2c84f9ffb530 100644
--- a/tests/script/general/rm_bak/tag/bool_int.sim
+++ b/tests/script/tsim/tag/bool_int.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -311,16 +306,16 @@ if $data00 != 25 then
endi
print =============== step14
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/change.sim b/tests/script/tsim/tag/change.sim
similarity index 98%
rename from tests/script/general/rm_bak/tag/change.sim
rename to tests/script/tsim/tag/change.sim
index 6f294c0f48fb18d232a5e78f9fbec084e8dc699d..f58e38721776d9e134f2cc4d873148bde096fb7d 100644
--- a/tests/script/general/rm_bak/tag/change.sim
+++ b/tests/script/tsim/tag/change.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -508,7 +504,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/column.sim b/tests/script/tsim/tag/column.sim
similarity index 92%
rename from tests/script/general/rm_bak/tag/column.sim
rename to tests/script/tsim/tag/column.sim
index 5a0cd169c5a77f0dfd6f81b615bbd09bb8e5a629..c73999230f6375b43a4eadaca88c49b0e7c4bdd9 100644
--- a/tests/script/general/rm_bak/tag/column.sim
+++ b/tests/script/tsim/tag/column.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -89,7 +84,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/commit.sim b/tests/script/tsim/tag/commit.sim
similarity index 99%
rename from tests/script/general/rm_bak/tag/commit.sim
rename to tests/script/tsim/tag/commit.sim
index bcd9d7c618f68eb356813224a7b75f6e649a2e12..18128fc464a931de5f5f82b43dfbe35fc0cbb846 100644
--- a/tests/script/general/rm_bak/tag/commit.sim
+++ b/tests/script/tsim/tag/commit.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -1177,7 +1173,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/create.sim b/tests/script/tsim/tag/create.sim
similarity index 99%
rename from tests/script/general/rm_bak/tag/create.sim
rename to tests/script/tsim/tag/create.sim
index 95b416654394946287cc8f9cdb95b984edbf3a88..e25f1eb71f9818404e43ab63c76d7829f18bb49b 100644
--- a/tests/script/general/rm_bak/tag/create.sim
+++ b/tests/script/tsim/tag/create.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
diff --git a/tests/script/general/rm_bak/tag/delete.sim b/tests/script/tsim/tag/delete.sim
similarity index 99%
rename from tests/script/general/rm_bak/tag/delete.sim
rename to tests/script/tsim/tag/delete.sim
index 2a0aa27bde6ef70e5354695a83dfc2d3853e1463..bcfd822dbdb9de83c7530f54ac8dbef775d45f10 100644
--- a/tests/script/general/rm_bak/tag/delete.sim
+++ b/tests/script/tsim/tag/delete.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -820,7 +816,7 @@ step145:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/double.sim b/tests/script/tsim/tag/double.sim
similarity index 96%
rename from tests/script/general/rm_bak/tag/double.sim
rename to tests/script/tsim/tag/double.sim
index f17043393ffe51f7cdce4fb053168746430ab498..fedc1c89ec9f610d0b06501d408c7df991e059a9 100644
--- a/tests/script/general/rm_bak/tag/double.sim
+++ b/tests/script/tsim/tag/double.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -228,16 +223,16 @@ endi
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/filter.sim b/tests/script/tsim/tag/filter.sim
similarity index 98%
rename from tests/script/general/rm_bak/tag/filter.sim
rename to tests/script/tsim/tag/filter.sim
index 7a899a7e67d9261ea2a68c5ad1ee311f03278cb9..b9f2df0cc6b05363f222a5d94971dd9986e67607 100644
--- a/tests/script/general/rm_bak/tag/filter.sim
+++ b/tests/script/tsim/tag/filter.sim
@@ -1,8 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -142,7 +140,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/float.sim b/tests/script/tsim/tag/float.sim
similarity index 96%
rename from tests/script/general/rm_bak/tag/float.sim
rename to tests/script/tsim/tag/float.sim
index 35bf7d6090140ba73cb0c63efd57d828fb6b21bb..0ed12d226991ca93becea62ed158170b5494dfcc 100644
--- a/tests/script/general/rm_bak/tag/float.sim
+++ b/tests/script/tsim/tag/float.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -228,16 +223,16 @@ endi
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/int.sim b/tests/script/tsim/tag/int.sim
similarity index 96%
rename from tests/script/general/rm_bak/tag/int.sim
rename to tests/script/tsim/tag/int.sim
index 4eea02c9cd4438f16cdf759fef0ade88eaabc8b1..e561cde56a515ee9c7ccb6e236e936c168c45d27 100644
--- a/tests/script/general/rm_bak/tag/int.sim
+++ b/tests/script/tsim/tag/int.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -226,18 +221,17 @@ if $data00 != 25 then
return -1
endi
-
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/int_binary.sim b/tests/script/tsim/tag/int_binary.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/int_binary.sim
rename to tests/script/tsim/tag/int_binary.sim
index 9a756976769c6294f65f61c5318033274b1145f2..01d73cf0c2943f1807b2c1dc836466eef00b31a6 100644
--- a/tests/script/general/rm_bak/tag/int_binary.sim
+++ b/tests/script/tsim/tag/int_binary.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -295,16 +290,16 @@ if $data00 != 25 then
endi
print =============== step14
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/int_float.sim b/tests/script/tsim/tag/int_float.sim
similarity index 97%
rename from tests/script/general/rm_bak/tag/int_float.sim
rename to tests/script/tsim/tag/int_float.sim
index a03c4b7148ab14c9c0b1e28d3fc28dc86df0c2d9..0b20ff3d62db7522524d916018e7d8673cafc85f 100644
--- a/tests/script/general/rm_bak/tag/int_float.sim
+++ b/tests/script/tsim/tag/int_float.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -311,16 +306,16 @@ if $data00 != 25 then
endi
print =============== step14
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/set.sim b/tests/script/tsim/tag/set.sim
similarity index 98%
rename from tests/script/general/rm_bak/tag/set.sim
rename to tests/script/tsim/tag/set.sim
index cbc964fad7d73b9ba6fee5128e50bb4b9dfa433b..2c14313a07d53a6098305160804e4d97fddadbe4 100644
--- a/tests/script/general/rm_bak/tag/set.sim
+++ b/tests/script/tsim/tag/set.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -452,7 +448,7 @@ endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/smallint.sim b/tests/script/tsim/tag/smallint.sim
similarity index 96%
rename from tests/script/general/rm_bak/tag/smallint.sim
rename to tests/script/tsim/tag/smallint.sim
index e69eef05f274175b55ba78e4c9f69a5e102eb6f8..47e28db46ce7cf1c65b33b0bd5546e8b519284d9 100644
--- a/tests/script/general/rm_bak/tag/smallint.sim
+++ b/tests/script/tsim/tag/smallint.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -226,18 +221,17 @@ if $data00 != 25 then
return -1
endi
-
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/rm_bak/tag/tinyint.sim b/tests/script/tsim/tag/tinyint.sim
similarity index 96%
rename from tests/script/general/rm_bak/tag/tinyint.sim
rename to tests/script/tsim/tag/tinyint.sim
index 2d70dc7d4880d4b1540da557f779fe06b877dabc..0941c9cf18c6ef3d6075a12f6db78d6f42a2437b 100644
--- a/tests/script/general/rm_bak/tag/tinyint.sim
+++ b/tests/script/tsim/tag/tinyint.sim
@@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
-
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
print ======================== dnode1 start
@@ -226,18 +221,17 @@ if $data00 != 25 then
return -1
endi
-
print =============== step12
-sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol
+sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
-if $data01 != 100 then
+if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/valgrind/basic1.sim b/tests/script/tsim/valgrind/basic1.sim
index e9dfc0eb4e650e9b9a5341cbcdd892a00c92a8c6..784b83d96b4244d0edbb717685e8259d7b130cf8 100644
--- a/tests/script/tsim/valgrind/basic1.sim
+++ b/tests/script/tsim/valgrind/basic1.sim
@@ -1,7 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c debugflag -v 131
-system sh/exec.sh -n dnode1 -s start -v
+system sh/exec.sh -n dnode1 -s start
sql connect
print =============== step1: create drop show dnodes
@@ -23,48 +23,77 @@ if $data(1)[4] != ready then
endi
print =============== step2: create db
-sql create database d1 vgroups 1 buffer 3
+sql create database d1 vgroups 3 buffer 3
sql show databases
sql use d1
sql show vgroups
-print =============== step3: create show stable
-sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
+print =============== step3: create show stable, include all type
+sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned)
+sql create stable if not exists stb_1 (ts timestamp, c1 int) tags (j int)
+sql create table stb_2 (ts timestamp, c1 int) tags (t1 int)
+sql create stable stb_3 (ts timestamp, c1 int) tags (t1 int)
sql show stables
-if $rows != 1 then
+if $rows != 4 then
return -1
endi
-print =============== step3: create show table
-sql create table ct1 using stb tags(1000)
+print =============== step4: ccreate child table
+sql create table c1 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql create table c2 using stb tags(false, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 2', 'child tbl 2', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql show tables
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
print =============== step5: insert data
-sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
-sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
+sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c2 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c2 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+
+print =============== step6: alter insert
+sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+
+print =============== restart
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
+system sh/exec.sh -n dnode1 -s start -v
-print =============== step6: select data
-sql select * from ct1
+print =============== stepa: query data
+sql select * from c1
#sql select * from stb
+#sql select * from stb_1
+#sql select ts, c1, c2, c3 from c1
+#sql select ts, c1, c2, c3 from stb
+#sql select ts, c1 from stb_2
+#sql select ts, c1, t1 from c1
+#sql select ts, c1, t1 from stb
+#sql select ts, c1, t1 from stb_2
+
+print =============== stepb: count
+#sql select count(*) from c1;
+#sql select count(*) from stb;
+#sql select count(ts), count(c1), count(c2), count(c3) from c1
+#sql select count(ts), count(c1), count(c2), count(c3) from stb
+
+print =============== stepc: func
+#sql select first(ts), first(c1), first(c2), first(c3) from c1
+#sql select min(c2), min(c3), min(c4) from c1
+#sql select max(c2), max(c3), max(c4) from c1
+#sql select sum(c2), sum(c3), sum(c4) from c1
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-
print =============== check
-print ----> start to check if there are ERRORS in vagrind log file for each dnode
-system_content sh/checkValgrind.sh -n dnode1
+$null=
+system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
-if $system_content <= 0 then
- return 0
+if $system_content > 1 then
+ return -1
endi
-$null=
if $system_content == $null then
- return 0
+ return -1
endi
-
-return -1
diff --git a/tests/script/tsim/valgrind/basic2.sim b/tests/script/tsim/valgrind/basic2.sim
index 154617bc18402790170f5c94d84f1d9eb890b689..15e092da35ffbac2de2cb5a8293e591e8f7a2dfc 100644
--- a/tests/script/tsim/valgrind/basic2.sim
+++ b/tests/script/tsim/valgrind/basic2.sim
@@ -23,48 +23,74 @@ if $data(1)[4] != ready then
endi
print =============== step2: create db
-sql create database d1 vgroups 1 buffer 3
+sql create database d1 vgroups 3 buffer 3
sql show databases
sql use d1
sql show vgroups
-print =============== step3: create show stable
-sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
+print =============== step3: create show stable, include all type
+sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned)
+sql create stable if not exists stb_1 (ts timestamp, c1 int) tags (j int)
+sql create table stb_2 (ts timestamp, c1 int) tags (t1 int)
+sql create stable stb_3 (ts timestamp, c1 int) tags (t1 int)
sql show stables
-if $rows != 1 then
+if $rows != 4 then
return -1
endi
-print =============== step3: create show table
-sql create table ct1 using stb tags(1000)
-#sql show tables
-#if $rows != 1 then
-# return -1
-#endi
+print =============== step4: ccreate child table
+sql create table c1 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql create table c2 using stb tags(false, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 2', 'child tbl 2', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql show tables
+if $rows != 2 then
+ return -1
+endi
print =============== step5: insert data
-sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
-sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
+sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c2 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c2 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
-print =============== step6: select data
-sql select * from ct1
+print =============== step6: alter insert
+sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+
+goto _OVER
+print =============== stepa: query data
+sql select * from c1
sql select * from stb
+sql select * from stb_1
+sql select ts, c1, c2, c3 from c1
+sql select ts, c1, c2, c3 from stb
+sql select ts, c1 from stb_2
+sql select ts, c1, t1 from c1
+sql select ts, c1, t1 from stb
+sql select ts, c1, t1 from stb_2
+
+print =============== stepb: count
+#sql select count(*) from c1;
+#sql select count(*) from stb;
+#sql select count(ts), count(c1), count(c2), count(c3) from c1
+#sql select count(ts), count(c1), count(c2), count(c3) from stb
+
+print =============== stepc: func
+#sql select first(ts), first(c1), first(c2), first(c3) from c1
+#sql select min(c1), min(c2), min(c3) from c1
+#sql select max(c1), max(c2), max(c3) from c1
+#sql select sum(c1), sum(c2), sum(c3) from c1
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-
print =============== check
-print ----> start to check if there are ERRORS in vagrind log file for each dnode
-system_content sh/checkValgrind.sh -n dnode1
+$null=
+system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
-if $system_content <= 0 then
- return 0
+if $system_content > 1 then
+ return -1
endi
-$null=
if $system_content == $null then
- return 0
+ return -1
endi
-
-return -1
diff --git a/tests/script/tsim/valgrind/checkError1.sim b/tests/script/tsim/valgrind/checkError1.sim
index 1a76d8ce5c410c6e3bfa159ca535fcc472df2a34..fe4f4654b1f1d3a53ffc6003b4809e874128a576 100644
--- a/tests/script/tsim/valgrind/checkError1.sim
+++ b/tests/script/tsim/valgrind/checkError1.sim
@@ -36,7 +36,12 @@ sql create dnode $hostname port 7200
sql drop dnode 2
sql alter dnode 1 'debugflag 131'
-print =============== step4:
+print =============== create database, stable, table
+sql create database db vgroups 3
+sql use db
+sql create table stb (ts timestamp, c int) tags (t int)
+sql create table t0 using stb tags (0)
+sql create table tba (ts timestamp, c1 binary(10), c2 nchar(10));
print =============== run show xxxx
sql show dnodes
@@ -50,7 +55,17 @@ if $rows != 1 then
endi
sql show databases
-if $rows != 2 then
+if $rows != 3 then
+ return -1
+endi
+
+sql show stables
+if $rows != 1 then
+ return -1
+endi
+
+sql show tables
+if $rows != 2 then
return -1
endi
@@ -70,11 +85,31 @@ if $rows != 1 then
return -1
endi
+sql select * from information_schema.user_databases
+if $rows != 3 then
+ return -1
+endi
+
+sql select * from information_schema.user_stables
+if $rows != 1 then
+ return -1
+endi
+
+sql select * from information_schema.user_tables
+if $rows != 30 then
+ return -1
+endi
+
sql select * from information_schema.user_users
if $rows != 1 then
return -1
endi
+sql select * from information_schema.`vgroups`
+if $rows != 3 then
+ return -1
+endi
+
sql show variables;
if $rows != 4 then
return -1
@@ -94,17 +129,14 @@ print =============== stop
system sh/exec.sh -n dnode1 -s stop -x SIGINT
print =============== check
-print ----> start to check if there are ERRORS in vagrind log file for each dnode
-system_content sh/checkValgrind.sh -n dnode1
+$null=
+system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
-if $system_content <= 0 then
- return 0
+if $system_content > 1 then
+ return -1
endi
-$null=
if $system_content == $null then
- return 0
+ return -1
endi
-
-return -1
diff --git a/tests/script/tsim/valgrind/checkError2.sim b/tests/script/tsim/valgrind/checkError2.sim
index fdac687224fa464e3131c25d5a8d63bab9a3e79d..3a82218015b833e0c4a5c9c15c9ab3323c58ea42 100644
--- a/tests/script/tsim/valgrind/checkError2.sim
+++ b/tests/script/tsim/valgrind/checkError2.sim
@@ -35,36 +35,51 @@ if $rows != 1 then
return -1
endi
-print =============== step3: create show table
+print =============== step4: create show table
sql create table ct1 using stb tags(1000)
+sql create table ct2 using stb tags(2000)
+sql create table ct3 using stb tags(3000)
sql show tables
-if $rows != 1 then
+if $rows != 3 then
return -1
endi
print =============== step5: insert data
sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
+sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
+sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
+sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
-print =============== step6: select data
+print =============== step6: query data
sql select * from ct1
sql select * from stb
+sql select c1, c2, c3 from ct1
+sql select ts, c1, c2, c3 from stb
+
+print =============== step7: count
+sql select count(*) from ct1;
+sql select count(*) from stb;
+sql select count(ts), count(c1), count(c2), count(c3) from ct1
+sql select count(ts), count(c1), count(c2), count(c3) from stb
+
+print =============== step8: func
+sql select first(ts), first(c1), first(c2), first(c3) from ct1
+sql select min(c1), min(c2), min(c3) from ct1
+sql select max(c1), max(c2), max(c3) from ct1
+sql select sum(c1), sum(c2), sum(c3) from ct1
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-
print =============== check
-print ----> start to check if there are ERRORS in vagrind log file for each dnode
-system_content sh/checkValgrind.sh -n dnode1
+$null=
+system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
-if $system_content <= 0 then
- return 0
+if $system_content > 1 then
+ return -1
endi
-$null=
if $system_content == $null then
- return 0
+ return -1
endi
-
-return -1
diff --git a/tests/script/tsim/valgrind/checkError3.sim b/tests/script/tsim/valgrind/checkError3.sim
index 3713f372ae35d664ae6b99e607fa6e4cc34d784a..10a8f01fb3ceea5eaaffcffecd74a75584d98b3f 100644
--- a/tests/script/tsim/valgrind/checkError3.sim
+++ b/tests/script/tsim/valgrind/checkError3.sim
@@ -4,7 +4,7 @@ system sh/cfg.sh -n dnode1 -c debugflag -v 131
system sh/exec.sh -n dnode1 -s start -v
sql connect
-print =============== step1: show dnodes
+print =============== step1: create drop show dnodes
$x = 0
step1:
$x = $x + 1
@@ -22,124 +22,74 @@ if $data(1)[4] != ready then
goto step1
endi
-print =============== step2: create alter drop show user
-sql create user u1 pass 'taosdata'
-sql show users
-sql alter user u1 sysinfo 1
-sql alter user u1 enable 1
-sql alter user u1 pass 'taosdata'
-sql drop user u1
-sql_error alter user u2 sysinfo 0
-
-print =============== step3: create drop dnode
-sql create dnode $hostname port 7200
-sql drop dnode 2
-sql alter dnode 1 'debugflag 131'
-
-print =============== create database, stable, table
-sql create database db vgroups 3
-sql use db
-sql create table stb (ts timestamp, c int) tags (t int)
-sql create table t0 using stb tags (0)
-sql create table tba (ts timestamp, c1 binary(10), c2 nchar(10));
-
-print =============== run show xxxx
-sql show dnodes
-if $rows != 1 then
- return -1
-endi
-
-sql show mnodes
-if $rows != 1 then
- return -1
-endi
-
+print =============== step2: create db
+sql create database d1 vgroups 3 buffer 3
sql show databases
-if $rows != 3 then
- return -1
-endi
-
+sql use d1
+sql show vgroups
+
+print =============== step3: create show stable, include all type
+sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned)
+sql create stable if not exists stb_1 (ts timestamp, c1 int) tags (j int)
+sql create table stb_2 (ts timestamp, c1 int) tags (t1 int)
+sql create stable stb_3 (ts timestamp, c1 int) tags (t1 int)
sql show stables
-if $rows != 1 then
+if $rows != 4 then
return -1
endi
+print =============== step4: ccreate child table
+sql create table c1 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql create table c2 using stb tags(false, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 2', 'child tbl 2', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql show tables
if $rows != 2 then
return -1
endi
-sql show users
-if $rows != 1 then
- return -1
-endi
-
-print =============== run select * from information_schema.xxxx
-sql select * from information_schema.`dnodes`
-if $rows != 1 then
- return -1
-endi
-
-sql select * from information_schema.`mnodes`
-if $rows != 1 then
- return -1
-endi
-
-sql select * from information_schema.user_databases
-if $rows != 3 then
- return -1
-endi
-
-sql select * from information_schema.user_stables
-if $rows != 1 then
- return -1
-endi
-
-sql select * from information_schema.user_tables
-if $rows != 30 then
- return -1
-endi
-
-sql select * from information_schema.user_users
-if $rows != 1 then
- return -1
-endi
-
-sql select * from information_schema.`vgroups`
-if $rows != 3 then
- return -1
-endi
-
-sql show variables;
-if $rows != 4 then
- return -1
-endi
-
-sql show dnode 1 variables;
-if $rows <= 0 then
- return -1
-endi
-
-sql show local variables;
-if $rows <= 0 then
- return -1
-endi
-
-print =============== stop
+print =============== step5: insert data
+sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c2 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c2 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+
+print =============== step6: alter insert
+sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
+
+print =============== stepa: query data
+sql select * from c1
+sql select * from stb
+sql select * from stb_1
+sql select ts, c1, c2, c3 from c1
+sql select ts, c1, c2, c3 from stb
+sql select ts, c1 from stb_2
+sql select ts, c1, t1 from c1
+sql select ts, c1, t1 from stb
+sql select ts, c1, t1 from stb_2
+
+print =============== stepb: count
+sql select count(*) from c1;
+sql select count(*) from stb;
+sql select count(ts), count(c1), count(c2), count(c3) from c1
+sql select count(ts), count(c1), count(c2), count(c3) from stb
+
+print =============== stepc: func
+sql select first(ts), first(c1), first(c2), first(c3) from c1
+sql select min(c2), min(c3), min(c4) from c1
+sql select max(c2), max(c3), max(c4) from c1
+sql select sum(c2), sum(c3), sum(c4) from c1
+
+_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
-
print =============== check
-print ----> start to check if there are ERRORS in vagrind log file for each dnode
-system_content sh/checkValgrind.sh -n dnode1
+$null=
+system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
-if $system_content <= 0 then
- return 0
+if $system_content > 1 then
+ return -1
endi
-$null=
if $system_content == $null then
- return 0
+ return -1
endi
-
-return -1
diff --git a/tests/script/general/vector/metrics_field.sim b/tests/script/tsim/vector/metrics_field.sim
similarity index 97%
rename from tests/script/general/vector/metrics_field.sim
rename to tests/script/tsim/vector/metrics_field.sim
index 2719805c63af87d4088a9b1fd87249f09e51b957..4d0f9e19fce157315aaeeda1f86947d946fa071c 100644
--- a/tests/script/general/vector/metrics_field.sim
+++ b/tests/script/tsim/vector/metrics_field.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_mf_db
@@ -99,17 +95,9 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $mt where a = 5 -x step21
- return -1
-step21:
-
-sql select h - f from $mt where a = 5 -x step22
- return -1
-step22:
-
-sql select ts - f from $mt where a = 5 -x step23
- return -1
-step23:
+sql select g - f from $mt where a = 5
+sql select h - f from $mt where a = 5
+sql select ts - f from $mt where a = 5
sql select a - e from $mt where a = 5
print ===> $data00
@@ -616,7 +604,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/metrics_mix.sim b/tests/script/tsim/vector/metrics_mix.sim
similarity index 98%
rename from tests/script/general/vector/metrics_mix.sim
rename to tests/script/tsim/vector/metrics_mix.sim
index 7c9bb3b668c67fbc75cffc9b15bad1b276142917..fd36a62332c64403f3d09f6f1acc45d5d021ee99 100644
--- a/tests/script/general/vector/metrics_mix.sim
+++ b/tests/script/tsim/vector/metrics_mix.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_mx_db
@@ -99,17 +95,11 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step21
- return -1
-step21:
+sql select g - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m
-sql select h - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step22
- return -1
-step22:
+sql select h - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m
-sql select ts - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step23
- return -1
-step23:
+sql select ts - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m
sql select a - e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m
print ===> $data00
@@ -616,7 +606,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/metrics_query.sim b/tests/script/tsim/vector/metrics_query.sim
similarity index 97%
rename from tests/script/general/vector/metrics_query.sim
rename to tests/script/tsim/vector/metrics_query.sim
index fd635a3104f70f4fcbcd71914b476dfc3fb69ea8..8a334acef27adc112e6cf49f1c9ef4e64f697264 100644
--- a/tests/script/general/vector/metrics_query.sim
+++ b/tests/script/tsim/vector/metrics_query.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_mq_db
@@ -95,17 +91,9 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $mt -x step21
- return -1
-step21:
-
-sql select h - f from $mt -x step22
- return -1
-step22:
-
-sql select ts - f from $mt -x step23
- return -1
-step23:
+sql select g - f from $mt
+sql select h - f from $mt
+sql select ts - f from $mt
sql select a - e from $mt
print ===> $data00
@@ -612,7 +600,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/metrics_tag.sim b/tests/script/tsim/vector/metrics_tag.sim
similarity index 97%
rename from tests/script/general/vector/metrics_tag.sim
rename to tests/script/tsim/vector/metrics_tag.sim
index 1d412d35d3669ced6437e6025f8415ddd3a1cf1e..0b275336f9604476ee8206aea21f16f3f935a134 100644
--- a/tests/script/general/vector/metrics_tag.sim
+++ b/tests/script/tsim/vector/metrics_tag.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_mtg_db
@@ -95,17 +91,11 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $mt where tgcol = 5 -x step21
- return -1
-step21:
+sql select g - f from $mt where tgcol = 5
-sql select h - f from $mt where tgcol = 5 -x step22
- return -1
-step22:
+sql select h - f from $mt where tgcol = 5
-sql select ts - f from $mt where tgcol = 5 -x step23
- return -1
-step23:
+sql select ts - f from $mt where tgcol = 5
sql select a - e from $mt where tgcol = 5
print ===> $data00
@@ -612,7 +602,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/metrics_time.sim b/tests/script/tsim/vector/metrics_time.sim
similarity index 98%
rename from tests/script/general/vector/metrics_time.sim
rename to tests/script/tsim/vector/metrics_time.sim
index d0152439bff2c9ab5450d870b2238d0b137a2fa4..bcd93cb5823f25a15c0bfe03b9f0ea6c615e0685 100644
--- a/tests/script/general/vector/metrics_time.sim
+++ b/tests/script/tsim/vector/metrics_time.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_mt_db
@@ -95,17 +91,11 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step21
- return -1
-step21:
+sql select g - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m
-sql select h - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step22
- return -1
-step22:
+sql select h - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m
-sql select ts - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step23
- return -1
-step23:
+sql select ts - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m
sql select a - e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m
print ===> $data00
@@ -612,7 +602,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/multi.sim b/tests/script/tsim/vector/multi.sim
similarity index 89%
rename from tests/script/general/vector/multi.sim
rename to tests/script/tsim/vector/multi.sim
index 1101b0b0dbc4484e8ccef3aaab5ce8fe54b03d0b..dcedbe73c9ae678b7b35199b057112f8cd9a4442 100644
--- a/tests/script/general/vector/multi.sim
+++ b/tests/script/tsim/vector/multi.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_mu_db
@@ -71,9 +67,7 @@ sql select a + a from $tb where ts > now + 4m order by ts desc
sql select a + c from $tb where ts < now + 4m order by ts asc
-sql select a + f from $tb where ts > now + 4m order by ts asc -x step24
- return -1
-step24:
+sql select a + f from $tb where ts > now + 4m order by ts asc
print =============== step3
$i = 1
@@ -150,17 +144,11 @@ endi
print =============== step6
$i = 1
$tb = $tbPrefix . $i
-sql select a + ts from $tb -x step61
- return -1
-step61:
+sql select a + ts from $tb
-sql select a + f from $tb -x step62
- return -1
-step62:
+sql select a + f from $tb
-sql select a + g from $tb -x step63
- return -1
-step63:
+sql select a + g from $tb
print =============== step7
$i = 1
@@ -202,14 +190,12 @@ sql select a + a from $tb where e = 2 and ts > now + 4m order by ts desc
sql select a + c from $tb where f = 2 and ts < now + 4m order by ts asc
-sql select a + f from $tb where g = 2 and ts > now + 4m order by ts asc -x step74
- return -1
-step74:
+sql select a + f from $tb where g = 2 and ts > now + 4m order by ts asc
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/single.sim b/tests/script/tsim/vector/single.sim
similarity index 96%
rename from tests/script/general/vector/single.sim
rename to tests/script/tsim/vector/single.sim
index e979a0ffb71e78ed2a3a79cb32e5b34ab98fd21a..c9d794456c3604ce3d94bc2cc8ede33c42b72ecf 100644
--- a/tests/script/general/vector/single.sim
+++ b/tests/script/tsim/vector/single.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_si_db
@@ -150,9 +146,7 @@ $i = 11
$tb = $tbPrefix . $i
sql create table $tb (ts timestamp, tbcol bool)
sql insert into $tb values(now, 0)
-sql select tbcol + 2 from $tb -x step6
- return -1
-step6:
+sql select tbcol + 2 from $tb
print =============== step7
$i = $i + 1
@@ -289,14 +283,12 @@ $i = $i + 1
$tb = $tbPrefix . $i
sql create table $tb (ts timestamp, tbcol binary(100))
sql insert into $tb values(now, '0');
-sql select tbcol + 2 from $tb -x step12
- return -1
-step12:
+sql select tbcol + 2 from $tb
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/table_field.sim b/tests/script/tsim/vector/table_field.sim
similarity index 97%
rename from tests/script/general/vector/table_field.sim
rename to tests/script/tsim/vector/table_field.sim
index d86eb99331f9c65c013d4d9bdd5798672629eab9..5ad60b2a3535ab361ca0b24af361efabcc2b5dd3 100644
--- a/tests/script/general/vector/table_field.sim
+++ b/tests/script/tsim/vector/table_field.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_tf_db
@@ -95,17 +91,11 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $tb where a = 5 -x step21
- return -1
-step21:
+sql select g - f from $tb where a = 5
-sql select h - f from $tb where a = 5 -x step22
- return -1
-step22:
+sql select h - f from $tb where a = 5
-sql select ts - f from $tb where a = 5 -x step23
- return -1
-step23:
+sql select ts - f from $tb where a = 5
sql select a - e from $tb where a = 5
print ===> $data00
@@ -612,7 +602,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/table_mix.sim b/tests/script/tsim/vector/table_mix.sim
similarity index 98%
rename from tests/script/general/vector/table_mix.sim
rename to tests/script/tsim/vector/table_mix.sim
index 5c4fb52888d3a02608bdc90d4c213c3a4f4ac0ff..358d6cf87f74186c07c15a4e6ad86bd5be4089c5 100644
--- a/tests/script/general/vector/table_mix.sim
+++ b/tests/script/tsim/vector/table_mix.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_tm_db
@@ -95,17 +91,11 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step21
- return -1
-step21:
+sql select g - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m
-sql select h - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step22
- return -1
-step22:
+sql select h - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m
-sql select ts - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step23
- return -1
-step23:
+sql select ts - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m
sql select a - e from $tb where a = 5 and ts > now + 4m and ts < now + 6m
print ===> $data00
@@ -612,7 +602,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/table_query.sim b/tests/script/tsim/vector/table_query.sim
similarity index 97%
rename from tests/script/general/vector/table_query.sim
rename to tests/script/tsim/vector/table_query.sim
index 9ef18255a9582982cddcd8c8c699adeb6f01f1b6..0e4562716e2b96beed5bf6e307566c5050fe008c 100644
--- a/tests/script/general/vector/table_query.sim
+++ b/tests/script/tsim/vector/table_query.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_tq_db
@@ -95,17 +91,11 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $tb -x step21
- return -1
-step21:
+sql select g - f from $tb
-sql select h - f from $tb -x step22
- return -1
-step22:
+sql select h - f from $tb
-sql select ts - f from $tb -x step23
- return -1
-step23:
+sql select ts - f from $tb
sql select a - e from $tb
print ===> $data00
@@ -612,7 +602,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/general/vector/table_time.sim b/tests/script/tsim/vector/table_time.sim
similarity index 97%
rename from tests/script/general/vector/table_time.sim
rename to tests/script/tsim/vector/table_time.sim
index c38546b1170fdbe5249a4220fbf112ea8eb25b18..1e6bdb2cde91562ff2ea387d29c9eff49a88a9f3 100644
--- a/tests/script/general/vector/table_time.sim
+++ b/tests/script/tsim/vector/table_time.sim
@@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
-
system sh/deploy.sh -n dnode1 -i 1
-system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
-
-sleep 2000
sql connect
$dbPrefix = m_tt_db
@@ -95,17 +91,11 @@ if $data00 != 0.000000000 then
return -1
endi
-sql select g - f from $tb where ts > now + 4m and ts < now + 6m -x step21
- return -1
-step21:
+sql select g - f from $tb where ts > now + 4m and ts < now + 6m
-sql select h - f from $tb where ts > now + 4m and ts < now + 6m -x step22
- return -1
-step22:
+sql select h - f from $tb where ts > now + 4m and ts < now + 6m
-sql select ts - f from $tb where ts > now + 4m and ts < now + 6m -x step23
- return -1
-step23:
+sql select ts - f from $tb where ts > now + 4m and ts < now + 6m
sql select a - e from $tb where ts > now + 4m and ts < now + 6m
print ===> $data00
@@ -612,7 +602,7 @@ step63:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/vnode/stable_dnode2.sim b/tests/script/tsim/vnode/stable_dnode2.sim
index c29d9607061d2500410cc5cc49275d4eb93ab6b8..99047086c4b614b19c7bc96f868fb9e2ebee127a 100644
--- a/tests/script/tsim/vnode/stable_dnode2.sim
+++ b/tests/script/tsim/vnode/stable_dnode2.sim
@@ -109,20 +109,20 @@ if $data00 != $rowNum then
endi
print =============== step5
-sql select _wstartts, count(tbcol) as b from $tb interval(1m)
+sql select _wstart, count(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
-sql select _wstartts, count(tbcol) as b from $tb interval(1d)
+sql select _wstart, count(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != $rowNum then
return -1
endi
print =============== step6
-sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
+sql select _wstart, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
@@ -164,13 +164,13 @@ if $data00 != 25 then
endi
print =============== step9
-sql select _wstartts, count(tbcol) as b from $mt interval(1m)
+sql select _wstart, count(tbcol) as b from $mt interval(1m)
print ===> $data01
if $data01 != 10 then
return -1
endi
-sql select _wstartts, count(tbcol) as b from $mt interval(1d)
+sql select _wstart, count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
diff --git a/tests/script/tsim/vnode/stable_dnode2_stop.sim b/tests/script/tsim/vnode/stable_dnode2_stop.sim
index 113cf27e17aa23112ec6c2a088a0a8cb5f1d7b8a..87972a15f9b77e84438a354b5a8020c6063b4e7f 100644
--- a/tests/script/tsim/vnode/stable_dnode2_stop.sim
+++ b/tests/script/tsim/vnode/stable_dnode2_stop.sim
@@ -138,13 +138,13 @@ if $data00 != 25 then
endi
print =============== step4
-sql select _wstartts, count(tbcol) as b from $mt interval(1m)
+sql select _wstart, count(tbcol) as b from $mt interval(1m)
print ===> $data01
if $data01 != 10 then
return -1
endi
-sql select _wstartts, count(tbcol) as b from $mt interval(1d)
+sql select _wstart, count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
diff --git a/tests/script/tsim/vnode/stable_dnode3.sim b/tests/script/tsim/vnode/stable_dnode3.sim
index ae777b994251b380d373e724ab677e2d3beeca9f..279fb3b4416edbdda3ab36c4cae56fe440f58c60 100644
--- a/tests/script/tsim/vnode/stable_dnode3.sim
+++ b/tests/script/tsim/vnode/stable_dnode3.sim
@@ -111,20 +111,20 @@ if $data00 != $rowNum then
endi
print =============== step5
-sql select _wstartts, count(tbcol) as b from $tb interval(1m)
+sql select _wstart, count(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
-sql select _wstartts, count(tbcol) as b from $tb interval(1d)
+sql select _wstart, count(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != $rowNum then
return -1
endi
print =============== step6
-sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
+sql select _wstart, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
@@ -166,13 +166,13 @@ if $data00 != 25 then
endi
print =============== step9
-sql select _wstartts, count(tbcol) as b from $mt interval(1m)
+sql select _wstart, count(tbcol) as b from $mt interval(1m)
print ===> $data01
if $data01 != 10 then
return -1
endi
-sql select _wstartts, count(tbcol) as b from $mt interval(1d)
+sql select _wstart, count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
diff --git a/tests/script/tsim/vnode/stable_replica3_dnode6.sim b/tests/script/tsim/vnode/stable_replica3_dnode6.sim
index aea5b88fedd9e943752f5e597b1a6dc96cbee61e..e5c677ccbc89d84d2725fa445f69fe337d48e857 100644
--- a/tests/script/tsim/vnode/stable_replica3_dnode6.sim
+++ b/tests/script/tsim/vnode/stable_replica3_dnode6.sim
@@ -140,20 +140,20 @@ if $data00 != $rowNum then
endi
print =============== step5
-sql select _wstartts, count(tbcol) as b from $tb interval(1m)
+sql select _wstart, count(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
-sql select _wstartts, count(tbcol) as b from $tb interval(1d)
+sql select _wstart, count(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != $rowNum then
return -1
endi
print =============== step6
-sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
+sql select _wstart, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
@@ -195,13 +195,13 @@ if $data00 != 25 then
endi
print =============== step9
-#sql select _wstartts, count(tbcol) as b from $mt interval(1m)
+#sql select _wstart, count(tbcol) as b from $mt interval(1m)
#print ===> $data01
#if $data01 != 10 then
# return -1
#endi
-sql select _wstartts, count(tbcol) as b from $mt interval(1d)
+sql select _wstart, count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
diff --git a/tests/script/tsim/vnode/stable_replica3_vnode3.sim b/tests/script/tsim/vnode/stable_replica3_vnode3.sim
index 8137b087f52b1585681da5aad8a3b9e0925eb5f0..ca26b2fd102a15720aa3140c7f98d495835006af 100644
--- a/tests/script/tsim/vnode/stable_replica3_vnode3.sim
+++ b/tests/script/tsim/vnode/stable_replica3_vnode3.sim
@@ -124,20 +124,20 @@ if $data00 != $rowNum then
endi
print =============== step5
-sql select _wstartts, count(tbcol) as b from $tb interval(1m)
+sql select _wstart, count(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
-sql select _wstartts, count(tbcol) as b from $tb interval(1d)
+sql select _wstart, count(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != $rowNum then
return -1
endi
print =============== step6
-sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
+sql select _wstart, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
@@ -180,13 +180,13 @@ if $data00 != 25 then
endi
print =============== step9
-sql select _wstartts, count(tbcol) as b from $mt interval(1m)
+sql select _wstart, count(tbcol) as b from $mt interval(1m)
print ===> $data01
if $data01 != 10 then
return -1
endi
-sql select _wstartts, count(tbcol) as b from $mt interval(1d)
+sql select _wstart, count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
diff --git a/tests/script/general/wal/kill.sim b/tests/script/tsim/wal/kill.sim
similarity index 73%
rename from tests/script/general/wal/kill.sim
rename to tests/script/tsim/wal/kill.sim
index 94a35b636e7915842787ed982590b39a93e1f408..f8a732f59f16906b2c2315783f1ce77ef41ab397 100644
--- a/tests/script/general/wal/kill.sim
+++ b/tests/script/tsim/wal/kill.sim
@@ -2,8 +2,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
print ============== deploy
-system sh/exec.sh -n dnode1 -s start
-sleep 3001
+system sh/exec.sh -n dnode1 -s start ]
sql connect
sql create database d1
@@ -13,65 +12,55 @@ sql create table t1 (ts timestamp, i int)
sql insert into t1 values(now, 1);
print =============== step3
-sleep 2000
sql select * from t1;
print rows: $rows
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGKILL
-sleep 2000
print =============== step4
-system sh/exec.sh -n dnode1 -s start -x SIGKILL
-sleep 2000
+system sh/exec.sh -n dnode1 -s start
sql select * from t1;
print rows: $rows
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGKILL
-sleep 2000
print =============== step5
-system sh/exec.sh -n dnode1 -s start -x SIGKILL
-sleep 2000
+system sh/exec.sh -n dnode1 -s start
sql select * from t1;
print rows: $rows
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGKILL
-sleep 2000
print =============== step6
-system sh/exec.sh -n dnode1 -s start -x SIGKILL
-sleep 2000
+system sh/exec.sh -n dnode1 -s start
sql select * from t1;
print rows: $rows
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGKILL
-sleep 2000
print =============== step7
-system sh/exec.sh -n dnode1 -s start -x SIGKILL
-sleep 2000
+system sh/exec.sh -n dnode1 -s start
sql select * from t1;
print rows: $rows
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGKILL
-sleep 2000
print =============== step8
-system sh/exec.sh -n dnode1 -s start -x SIGKILL
-sleep 2000
+system sh/exec.sh -n dnode1 -s start
sql select * from t1;
print rows: $rows
if $rows != 1 then
return -1
endi
+
system sh/exec.sh -n dnode1 -s stop -x SIGKILL
diff --git a/tests/script/wtest.bat b/tests/script/wtest.bat
index e3bbff9db535fdea5501746f25cb8539dddc09ac..f674277df9455d0abac76bc4f214b9c53a62ce91 100644
--- a/tests/script/wtest.bat
+++ b/tests/script/wtest.bat
@@ -44,9 +44,10 @@ echo serverPort 7100 >> %TAOS_CFG%
echo logDir %LOG_DIR% >> %TAOS_CFG%
echo scriptDir %SCRIPT_DIR% >> %TAOS_CFG%
echo numOfLogLines 100000000 >> %TAOS_CFG%
-echo rpcDebugFlag 135 >> %TAOS_CFG%
+echo rpcDebugFlag 143 >> %TAOS_CFG%
echo tmrDebugFlag 131 >> %TAOS_CFG%
echo cDebugFlag 135 >> %TAOS_CFG%
+echo qDebugFlag 143 >> %TAOS_CFG%
echo udebugFlag 135 >> %TAOS_CFG%
echo wal 0 >> %TAOS_CFG%
echo asyncLog 0 >> %TAOS_CFG%
diff --git a/tests/system-test/0-others/sysinfo.py b/tests/system-test/0-others/sysinfo.py
new file mode 100644
index 0000000000000000000000000000000000000000..d74c4f6db93d94794481695e78087ce46cfc5be9
--- /dev/null
+++ b/tests/system-test/0-others/sysinfo.py
@@ -0,0 +1,59 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+
+from util.log import *
+from util.cases import *
+from util.sql import *
+import subprocess
+from util.common import *
+
+
+class TDTestCase:
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor())
+ self.dbname = 'db'
+ def get_database_info(self):
+ tdSql.query('select database()')
+ tdSql.checkData(0,0,None)
+ tdSql.execute(f'create database if not exists {self.dbname}')
+ tdSql.execute(f'use {self.dbname}')
+ tdSql.query('select database()')
+ tdSql.checkData(0,0,self.dbname)
+ tdSql.execute(f'drop database {self.dbname}')
+
+ def check_version(self):
+ taos_list = ['server','client']
+ for i in taos_list:
+ tdSql.query(f'select {i}_version()')
+ version_info = str(subprocess.run('cat ../../source/util/src/version.c |grep "char version"', shell=True,capture_output=True).stdout.decode('utf8')).split('"')[1]
+ tdSql.checkData(0,0,version_info)
+
+ def get_server_status(self):
+ tdSql.query('select server_status()')
+ tdSql.checkData(0,0,1)
+ tdDnodes.stoptaosd(1)
+
+ tdSql.query('select server_status()')
+ print(tdSql.queryResult)
+ def run(self):
+ self.get_database_info()
+ self.check_version()
+ # self.get_server_status()
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
diff --git a/tests/system-test/1-insert/alter_table.py b/tests/system-test/1-insert/alter_table.py
index f2de7c6baee4402e752f826335f391b09539f54d..4a9cfd30c7f717a29e75b8bc5e4b594e7b77a25f 100644
--- a/tests/system-test/1-insert/alter_table.py
+++ b/tests/system-test/1-insert/alter_table.py
@@ -210,10 +210,11 @@ class TDTestCase:
self.tag_check(i,k,tag_unint)
for error in [constant.INT_UN_MIN-1,constant.INT_UN_MAX+1]:
tdSql.error(f'alter table {self.stbname}_{i} set tag {k} = {error}')
- elif v.lower() == 'bigint unsigned':
- self.tag_check(i,k,tag_unbigint)
- for error in [constant.BIGINT_UN_MIN-1,constant.BIGINT_UN_MAX+1]:
- tdSql.error(f'alter table {self.stbname}_{i} set tag {k} = {error}')
+ #! bug TD-17106
+ # elif v.lower() == 'bigint unsigned':
+ # self.tag_check(i,k,tag_unbigint)
+ # for error in [constant.BIGINT_UN_MIN-1,constant.BIGINT_UN_MAX+1]:
+ # tdSql.error(f'alter table {self.stbname}_{i} set tag {k} = {error}')
elif v.lower() == 'bool':
self.tag_check(i,k,tag_bool)
elif v.lower() == 'float':
@@ -223,7 +224,8 @@ class TDTestCase:
tdSql.checkEqual(tdSql.queryResult[0][0],tdSql.queryResult[0][0])
else:
tdLog.exit(f'select {k} from {self.stbname}_{i},data check failure')
- # for error in [constant.FLOAT_MIN*10,constant.FLOAT_MAX*10]:
+ #! bug TD-17106
+ # for error in [constant.FLOAT_MIN*1.1,constant.FLOAT_MAX*1.1]:
# tdSql.error(f'alter table {self.stbname}_{i} set tag {k} = {error}')
elif v.lower() == 'double':
tdSql.execute(f'alter table {self.stbname}_{i} set tag {k} = {tag_double}')
@@ -232,7 +234,7 @@ class TDTestCase:
tdSql.checkEqual(tdSql.queryResult[0][0],tdSql.queryResult[0][0])
else:
tdLog.exit(f'select {k} from {self.stbname}_{i},data check failure')
- for error in [constant.DOUBLE_MIN-1,constant.DOUBLE_MAX+1]:
+ for error in [constant.DOUBLE_MIN*1.1,constant.DOUBLE_MAX*1.1]:
tdSql.error(f'alter table {self.stbname}_{i} set tag {k} = {error}')
elif 'binary' in v.lower():
tag_binary_error = tdCom.getLongName(self.binary_length+1)
@@ -242,7 +244,8 @@ class TDTestCase:
tdSql.checkData(0,0,tag_binary)
elif 'nchar' in v.lower():
tag_nchar_error = tdCom.getLongName(self.nchar_length+1)
- tdSql.execute(f'alter table {self.stbname}_{i} set tag {k} = "{tag_nchar_error}"')
+ tdSql.error(f'alter table {self.stbname}_{i} set tag {k} = "{tag_nchar_error}"')
+ tdSql.execute(f'alter table {self.stbname}_{i} set tag {k} = "{tag_nchar}"')
tdSql.query(f'select {k} from {self.stbname}_{i}')
tdSql.checkData(0,0,tag_nchar)
diff --git a/tests/system-test/2-query/To_iso8601.py b/tests/system-test/2-query/To_iso8601.py
index da7b7e272f657333447d0c5d7d3c068d037aec70..a80978bcda87171d1135178e99854abc8b920667 100644
--- a/tests/system-test/2-query/To_iso8601.py
+++ b/tests/system-test/2-query/To_iso8601.py
@@ -16,18 +16,18 @@ class TDTestCase:
self.rowNum = 10
self.ts = 1640966400000 # 2022-1-1 00:00:00.000
def check_customize_param_ms(self):
-
+
time_zone = time.strftime('%z')
tdSql.execute('create database db1 precision "ms"')
tdSql.execute('use db1')
tdSql.execute('create table if not exists ntb(ts timestamp, c1 int, c2 timestamp)')
for i in range(self.rowNum):
- tdSql.execute("insert into ntb values(%d, %d, %d)"
+ tdSql.execute("insert into ntb values(%d, %d, %d)"
% (self.ts + i, i + 1, self.ts + i))
tdSql.query('select to_iso8601(ts) from ntb')
for i in range(self.rowNum):
tdSql.checkEqual(tdSql.queryResult[i][0],f'2022-01-01T00:00:00.00{i}{time_zone}')
-
+
timezone_list = ['+0000','+0100','+0200','+0300','+0330','+0400','+0500','+0530','+0600','+0700','+0800','+0900','+1000','+1100','+1200',\
'+00','+01','+02','+03','+04','+05','+06','+07','+08','+09','+10','+11','+12',\
'+00:00','+01:00','+02:00','+03:00','+03:30','+04:00','+05:00','+05:30','+06:00','+07:00','+08:00','+09:00','+10:00','+11:00','+12:00',\
@@ -39,7 +39,7 @@ class TDTestCase:
tdSql.query(f'select to_iso8601(ts,"{j}") from ntb')
for i in range(self.rowNum):
tdSql.checkEqual(tdSql.queryResult[i][0],f'2022-01-01T00:00:00.00{i}{j}')
-
+
error_param_list = [0,100.5,'a','!']
for i in error_param_list:
tdSql.error(f'select to_iso8601(ts,"{i}") from ntb')
@@ -47,7 +47,7 @@ class TDTestCase:
error_timezone_param = ['+13','-13','+1300','-1300','+0001','-0001','-0330','-0530']
for i in error_timezone_param:
tdSql.error(f'select to_iso8601(ts,"{i}") from ntb')
-
+
def check_base_function(self):
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create tables==========")
@@ -75,12 +75,12 @@ class TDTestCase:
tdSql.query("select to_iso8601(ts) from ntb")
tdSql.checkRows(3)
tdSql.query("select to_iso8601(ts) from db.ntb")
-
+
tdSql.query("select to_iso8601(today()) from ntb")
tdSql.checkRows(3)
tdSql.query("select to_iso8601(now()) from ntb")
tdSql.checkRows(3)
-
+
tdSql.error("select to_iso8601(timezone()) from ntb")
tdSql.error("select to_iso8601('abc') from ntb")
@@ -104,7 +104,7 @@ class TDTestCase:
for i in err_param:
tdSql.error(f"select to_iso8601({i}) from ntb")
tdSql.error(f"select to_iso8601({i}) from db.ntb")
-
+
tdSql.query("select to_iso8601(now) from stb")
tdSql.checkRows(3)
tdSql.query("select to_iso8601(now()) from stb")
@@ -126,7 +126,7 @@ class TDTestCase:
tdSql.query(f"select to_iso8601(today()) {i}null from db.stb")
tdSql.checkRows(3)
tdSql.checkData(0,0,None)
-
+
def run(self): # sourcery skip: extract-duplicate-method
self.check_base_function()
self.check_customize_param_ms()
diff --git a/tests/system-test/2-query/To_unixtimestamp.py b/tests/system-test/2-query/To_unixtimestamp.py
index 8dc995b17808c528589f216a5400522804fcb93b..60d5cc7b72f76f46b36c510f8f08f69dbb57c858 100644
--- a/tests/system-test/2-query/To_unixtimestamp.py
+++ b/tests/system-test/2-query/To_unixtimestamp.py
@@ -13,11 +13,11 @@ class TDTestCase:
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
# name of normal table
- self.ntbname = 'ntb'
+ self.ntbname = 'ntb'
# name of stable
- self.stbname = 'stb'
+ self.stbname = 'stb'
# structure of column
- self.column_dict = {
+ self.column_dict = {
'ts':'timestamp',
'c1':'int',
'c2':'float',
@@ -25,13 +25,13 @@ class TDTestCase:
'c4':'nchar(20)'
}
# structure of tag
- self.tag_dict = {
+ self.tag_dict = {
't0':'int'
}
# number of child tables
- self.tbnum = 2
+ self.tbnum = 2
# values of tag,the number of values should equal to tbnum
- self.tag_values = [
+ self.tag_values = [
f'10',
f'100'
]
@@ -42,7 +42,7 @@ class TDTestCase:
]
self.error_param = [1,'now()']
-
+
def run(self): # sourcery skip: extract-duplicate-method
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create tables==========")
@@ -93,11 +93,11 @@ class TDTestCase:
tdSql.query("select ts from ntb where to_unixtimestamp('1970-01-01T08:00:00+08:00')=0")
tdSql.checkRows(3)
-
+
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
-tdCases.addWindows(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addWindows(__file__, TDTestCase())
diff --git a/tests/system-test/2-query/Today.py b/tests/system-test/2-query/Today.py
index e6199d629ea8e27094d6934a68936651c888f377..43c5263af6dcb91c1b7700ce899ae1041f93f5fa 100644
--- a/tests/system-test/2-query/Today.py
+++ b/tests/system-test/2-query/Today.py
@@ -58,7 +58,7 @@ class TDTestCase:
tag_sql += f"{k} {v},"
create_stb_sql = f'create table {stbname} ({column_sql[:-1]}) tags({tag_sql[:-1]})'
return create_stb_sql
-
+
def data_check(self,column_dict={},tbname = '',values_list = [],tb_num = 1,tb = 'tb',precision = 'ms'):
for k,v in column_dict.items():
num_up = 0
@@ -175,7 +175,7 @@ class TDTestCase:
tdSql.execute('drop database db')
def run(self): # sourcery skip: extract-duplicate-method
-
+
self.today_check_ntb()
self.today_check_stb_tb()
diff --git a/tests/system-test/2-query/abs.py b/tests/system-test/2-query/abs.py
index 7ebb2eba8cb4f6b61128e8b26e4af93abbe023c5..6dc65ce3c25f3bfa196a119a6d6db6f1ac36c1c3 100644
--- a/tests/system-test/2-query/abs.py
+++ b/tests/system-test/2-query/abs.py
@@ -47,7 +47,7 @@ class TDTestCase:
c9 = "'nchar_val'"
c10 = ts
tdSql.execute(f" insert into {tbname} values ({ts},{c1},{c2},{c3},{c4},{c5},{c6},{c7},{c8},{c9},{c10})")
-
+
tdSql.execute("use test")
tbnames = ["stb", "sub_tb_1"]
support_types = ["BIGINT", "SMALLINT", "TINYINT", "FLOAT", "DOUBLE", "INT"]
@@ -60,7 +60,7 @@ class TDTestCase:
origin_sql = "select {} from {} order by tbname".format(colname, tbname)
if coltype[1] in support_types:
self.check_result_auto(origin_sql , abs_sql)
-
+
def prepare_datas(self):
tdSql.execute(
diff --git a/tests/system-test/2-query/and_or_for_byte.py b/tests/system-test/2-query/and_or_for_byte.py
index 416e62c0f28a1a0661a1c3fd0e9c92da0f4a30fb..62951e571f7de65a2f5a083f8b3dcee17b163f21 100644
--- a/tests/system-test/2-query/and_or_for_byte.py
+++ b/tests/system-test/2-query/and_or_for_byte.py
@@ -47,7 +47,7 @@ class TDTestCase:
c9 = "'nchar_val'"
c10 = ts
tdSql.execute(f" insert into {tbname} values ({ts},{c1},{c2},{c3},{c4},{c5},{c6},{c7},{c8},{c9},{c10})")
-
+
tdSql.execute("use test")
tbnames = ["stb", "sub_tb_1"]
support_types = ["BIGINT", "SMALLINT", "TINYINT", "FLOAT", "DOUBLE", "INT"]
@@ -62,7 +62,7 @@ class TDTestCase:
cols = random.sample(colnames,3)
self.check_function("&",False,tbname,cols[0],cols[1],cols[2])
self.check_function("|",False,tbname,cols[0],cols[1],cols[2])
-
+
def prepare_datas(self):
tdSql.execute(
@@ -215,14 +215,14 @@ class TDTestCase:
"abs value check pass , it work as expected ,sql is \"%s\" " % abs_query)
def check_function(self, opera ,agg, tbname , *args):
-
+
if opera =="&":
pass
elif opera =="|":
pass
else:
pass
- work_sql = " select "
+ work_sql = " select "
for ind , arg in enumerate(args):
if ind ==len(args)-1:
work_sql += f"cast({arg} as bigint) "
@@ -235,7 +235,7 @@ class TDTestCase:
work_sql+= f" from {tbname} "
tdSql.query(work_sql)
work_result = tdSql.queryResult
-
+
origin_sql = " select "
for ind , arg in enumerate(args):
if ind ==len(args)-1:
@@ -323,7 +323,7 @@ class TDTestCase:
tdSql.checkData(0,0,None)
tdSql.checkData(1,0,640)
tdSql.checkData(10,0,0)
-
+
# used for regular table
tdSql.query("select abs(c1)&c3&c3 from t1")
tdSql.checkData(0, 0, None)
@@ -349,7 +349,7 @@ class TDTestCase:
self.check_function("&",False,"stb1","c1","floor(t1)","abs(c1+c2)","t1+1")
self.check_function("&",True,"stb1","max(c1)","min(floor(t1))","sum(abs(c1+c2))","last(t1)+1")
self.check_function("&",False,"stb1","abs(abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))))","floor(t1)","abs(c1+c2)","t1+1")
-
+
# mix with common col
tdSql.query("select c1&abs(c1)&c2&c3 ,c1,c2, t1 from ct1")
tdSql.checkData(0, 0, 8)
@@ -388,7 +388,7 @@ class TDTestCase:
# agg functions mix with agg functions
tdSql.query("select sum(c1&abs(c1)&c2&c3) ,max(c5), count(c5) from stb1")
-
+
tdSql.query("select max(c1)&max(c2)|first(ts), count(c5) from ct1")
# bug fix for compute
@@ -409,7 +409,7 @@ class TDTestCase:
tdSql.checkData(1, 2, 894.900000000)
-
+
def check_boundary_values(self):
@@ -490,7 +490,7 @@ class TDTestCase:
self.check_function("&", False ,"ct4","123","abs(c1)","t1","abs(t2)","abs(t3)","abs(t4)","t5")
self.check_function("&", False ,"ct4","c1+2","abs(t2+2)","t3","abs(t4)","abs(t5)","abs(c1)","t5")
- tdSql.query(" select sum(c1) from stb1 where t1+10 >1; ")
+ tdSql.query(" select sum(c1) from stb1 where t1+10 >1; ")
tdSql.query("select c1 ,t1 from stb1 where t1 =0 ")
tdSql.checkRows(13)
self.check_function("&", False ,"t1","c1+2","abs(c2)")
@@ -534,7 +534,7 @@ class TDTestCase:
self.support_super_table_test()
self.insert_datas_and_check_abs(self.tb_nums,self.row_nums,self.time_step)
-
+
def stop(self):
tdSql.close()
diff --git a/tests/system-test/2-query/apercentile.py b/tests/system-test/2-query/apercentile.py
index 8c8b47f3bf431fcce17bc9a8f3db42f2ef432c3c..6e4b4eeb8a94c3d23772211367082e7678153212 100644
--- a/tests/system-test/2-query/apercentile.py
+++ b/tests/system-test/2-query/apercentile.py
@@ -44,7 +44,7 @@ class TDTestCase:
'col12': f'binary({self.binary_length})',
'col13': f'nchar({self.nchar_length})'
}
-
+
self.tag_dict = {
'ts_tag' : 'timestamp',
't1': 'tinyint',
@@ -79,9 +79,9 @@ class TDTestCase:
self.tag_values = [
f'{self.tag_ts},{self.tag_tinyint},{self.tag_smallint},{self.tag_int},{self.tag_bigint},\
{self.tag_utint},{self.tag_usint},{self.tag_uint},{self.tag_ubint},{self.tag_float},{self.tag_double},{self.tag_bool},"{self.binary_str}","{self.nchar_str}"'
-
+
]
-
+
self.percent = [1,50,100]
self.param_list = ['default','t-digest']
def insert_data(self,column_dict,tbname,row_num):
@@ -90,7 +90,7 @@ class TDTestCase:
insert_list = []
self.setsql.insert_values(column_dict,i,insert_sql,insert_list,self.ts)
-
+
def function_check_ntb(self):
tdSql.prepare()
tdSql.execute(self.setsql.set_create_normaltable_sql(self.ntbname,self.column_dict))
@@ -126,7 +126,7 @@ class TDTestCase:
def run(self):
self.function_check_ntb()
self.function_check_stb()
-
+
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
diff --git a/tests/system-test/2-query/arccos.py b/tests/system-test/2-query/arccos.py
index e7e5ecb11486b312f1e814ee821cb339c609af45..d5656d9104367c9799c6d1eea7a08763ac3e4cfa 100644
--- a/tests/system-test/2-query/arccos.py
+++ b/tests/system-test/2-query/arccos.py
@@ -9,14 +9,14 @@ from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def init(self, conn, powSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
self.PI =3.1415926
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -24,7 +24,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -66,14 +66,14 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def check_result_auto_acos(self ,origin_query , pow_query):
pow_result = tdSql.getResult(pow_query)
origin_result = tdSql.getResult(origin_query)
auto_result =[]
-
+
for row in origin_result:
row_check = []
for elem in row:
@@ -93,7 +93,7 @@ class TDTestCase:
if auto_result[row_index][col_index] == None and not (auto_result[row_index][col_index] == None and elem == None):
check_status = False
elif auto_result[row_index][col_index] != None and (auto_result[row_index][col_index] - elem > 0.00000001):
- check_status = False
+ check_status = False
else:
pass
if not check_status:
@@ -101,7 +101,7 @@ class TDTestCase:
sys.exit(1)
else:
tdLog.info("acos value check pass , it work as expected ,sql is \"%s\" "%pow_query )
-
+
def test_errors(self):
error_sql_lists = [
"select acos from t1",
@@ -135,42 +135,42 @@ class TDTestCase:
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
-
+
def support_types(self):
type_error_sql_lists = [
- "select acos(ts) from t1" ,
+ "select acos(ts) from t1" ,
"select acos(c7) from t1",
"select acos(c8) from t1",
"select acos(c9) from t1",
- "select acos(ts) from ct1" ,
+ "select acos(ts) from ct1" ,
"select acos(c7) from ct1",
"select acos(c8) from ct1",
"select acos(c9) from ct1",
- "select acos(ts) from ct3" ,
+ "select acos(ts) from ct3" ,
"select acos(c7) from ct3",
"select acos(c8) from ct3",
"select acos(c9) from ct3",
- "select acos(ts) from ct4" ,
+ "select acos(ts) from ct4" ,
"select acos(c7) from ct4",
"select acos(c8) from ct4",
"select acos(c9) from ct4",
- "select acos(ts) from stb1" ,
+ "select acos(ts) from stb1" ,
"select acos(c7) from stb1",
"select acos(c8) from stb1",
"select acos(c9) from stb1" ,
- "select acos(ts) from stbbb1" ,
+ "select acos(ts) from stbbb1" ,
"select acos(c7) from stbbb1",
"select acos(ts) from tbname",
"select acos(c9) from tbname"
]
-
+
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
-
-
+
+
type_sql_lists = [
"select acos(c1) from t1",
"select acos(c2) from t1",
@@ -200,16 +200,16 @@ class TDTestCase:
"select acos(c5) from stb1",
"select acos(c6) from stb1",
- "select acos(c6) as alisb from stb1",
- "select acos(c6) alisb from stb1",
+ "select acos(c6) as alisb from stb1",
+ "select acos(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
-
+
def basic_acos_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -250,7 +250,7 @@ class TDTestCase:
tdSql.checkData(5, 5, None)
self.check_result_auto_acos( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from t1", "select acos(abs(c1)), acos(abs(c2)) ,acos(abs(c3)), acos(abs(c4)), acos(abs(c5)) from t1")
-
+
# used for sub table
tdSql.query("select c2 ,acos(c2) from ct1")
tdSql.checkData(0, 1, None)
@@ -266,7 +266,7 @@ class TDTestCase:
tdSql.checkData(5 , 2, None)
self.check_result_auto_acos( "select c1, c2, c3 , c4, c5 from ct1", "select acos(c1), acos(c2) ,acos(c3), acos(c4), acos(c5) from ct1")
-
+
# nest query for acos functions
tdSql.query("select c4 , acos(c4) ,acos(acos(c4)) , acos(acos(acos(c4))) from ct1;")
tdSql.checkData(0 , 0 , 88)
@@ -284,21 +284,21 @@ class TDTestCase:
tdSql.checkData(11 , 2 , None)
tdSql.checkData(11 , 3 , None)
- # used for stable table
-
+ # used for stable table
+
tdSql.query("select acos(c1) from stb1")
tdSql.checkRows(25)
-
+
# used for not exists table
tdSql.error("select acos(c1) from stbbb1")
tdSql.error("select acos(c1) from tbname")
tdSql.error("select acos(c1) from ct5")
- # mix with common col
+ # mix with common col
tdSql.query("select c1, acos(c1) from ct1")
tdSql.query("select c2, acos(c2) from ct4")
-
+
# mix with common functions
tdSql.query("select c1, acos(c1),acos(c1), acos(acos(c1)) from ct4 ")
@@ -306,7 +306,7 @@ class TDTestCase:
tdSql.checkData(0 , 1 ,None)
tdSql.checkData(0 , 2 ,None)
tdSql.checkData(0 , 3 ,None)
-
+
tdSql.checkData(3 , 0 , 6)
tdSql.checkData(3 , 1 ,None)
tdSql.checkData(3 , 2 ,None)
@@ -327,8 +327,8 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
-
- # # bug fix for compute
+
+ # # bug fix for compute
tdSql.query("select c1, acos(c1) -0 ,acos(c1-4)-0 from ct4 ")
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None)
@@ -397,10 +397,10 @@ class TDTestCase:
tdSql.checkData(0,3,0.000000000)
tdSql.checkData(0,4,-0.100000000)
tdSql.checkData(0,5,2)
-
+
def pow_Arithmetic(self):
pass
-
+
def check_boundary_values(self):
PI=3.1415926
@@ -429,11 +429,11 @@ class TDTestCase:
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto_acos( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ", "select acos(abs(c1)), acos(abs(c2)) ,acos(abs(c3)), acos(abs(c4)), acos(abs(c5)) from sub1_bound")
-
+
self.check_result_auto_acos( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select acos(c1), acos(c2) ,acos(c3), acos(c3), acos(c2) ,acos(c1) from sub1_bound")
self.check_result_auto_acos("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound" , "select acos(abs(c1)) from sub1_bound" )
-
+
# check basic elem for table per row
tdSql.query("select acos(abs(c1)) ,acos(abs(c2)) , acos(abs(c3)) , acos(abs(c4)), acos(abs(c5)), acos(abs(c6)) from sub1_bound ")
tdSql.checkData(0,0,None)
@@ -492,41 +492,41 @@ class TDTestCase:
self.check_result_auto_acos( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select acos(t1) ,acos(c5) from stb1 where c1 > 0 order by tbname" )
self.check_result_auto_acos( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select acos(t1) , acos(c5) from stb1 where c1 > 0 order by tbname" )
pass
-
-
+
+
def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: acos basic query ============")
+ tdLog.printNoPrefix("==========step4: acos basic query ============")
self.basic_acos_function()
- tdLog.printNoPrefix("==========step5: big number acos query ============")
+ tdLog.printNoPrefix("==========step5: big number acos query ============")
self.test_big_number()
- tdLog.printNoPrefix("==========step6: acos boundary query ============")
+ tdLog.printNoPrefix("==========step6: acos boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step7: acos filter query ============")
+ tdLog.printNoPrefix("==========step7: acos filter query ============")
self.abs_func_filter()
- tdLog.printNoPrefix("==========step7: acos filter query ============")
+ tdLog.printNoPrefix("==========step7: acos filter query ============")
self.abs_func_filter()
diff --git a/tests/system-test/2-query/arcsin.py b/tests/system-test/2-query/arcsin.py
index 80c89a47abaa7b4b628a0c98b1693d106f478f34..31185ffcaae0aa043911b1935919a6243f41dd20 100644
--- a/tests/system-test/2-query/arcsin.py
+++ b/tests/system-test/2-query/arcsin.py
@@ -9,14 +9,14 @@ from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def init(self, conn, powSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
self.PI =3.1415926
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -24,7 +24,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -66,14 +66,14 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def check_result_auto_asin(self ,origin_query , pow_query):
pow_result = tdSql.getResult(pow_query)
origin_result = tdSql.getResult(origin_query)
auto_result =[]
-
+
for row in origin_result:
row_check = []
for elem in row:
@@ -93,7 +93,7 @@ class TDTestCase:
if auto_result[row_index][col_index] == None and not (auto_result[row_index][col_index] == None and elem == None):
check_status = False
elif auto_result[row_index][col_index] != None and (auto_result[row_index][col_index] - elem > 0.00000001):
- check_status = False
+ check_status = False
else:
pass
if not check_status:
@@ -101,7 +101,7 @@ class TDTestCase:
sys.exit(1)
else:
tdLog.info("asin value check pass , it work as expected ,sql is \"%s\" "%pow_query )
-
+
def test_errors(self):
error_sql_lists = [
"select asin from t1",
@@ -135,42 +135,42 @@ class TDTestCase:
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
-
+
def support_types(self):
type_error_sql_lists = [
- "select asin(ts) from t1" ,
+ "select asin(ts) from t1" ,
"select asin(c7) from t1",
"select asin(c8) from t1",
"select asin(c9) from t1",
- "select asin(ts) from ct1" ,
+ "select asin(ts) from ct1" ,
"select asin(c7) from ct1",
"select asin(c8) from ct1",
"select asin(c9) from ct1",
- "select asin(ts) from ct3" ,
+ "select asin(ts) from ct3" ,
"select asin(c7) from ct3",
"select asin(c8) from ct3",
"select asin(c9) from ct3",
- "select asin(ts) from ct4" ,
+ "select asin(ts) from ct4" ,
"select asin(c7) from ct4",
"select asin(c8) from ct4",
"select asin(c9) from ct4",
- "select asin(ts) from stb1" ,
+ "select asin(ts) from stb1" ,
"select asin(c7) from stb1",
"select asin(c8) from stb1",
"select asin(c9) from stb1" ,
- "select asin(ts) from stbbb1" ,
+ "select asin(ts) from stbbb1" ,
"select asin(c7) from stbbb1",
"select asin(ts) from tbname",
"select asin(c9) from tbname"
]
-
+
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
-
-
+
+
type_sql_lists = [
"select asin(c1) from t1",
"select asin(c2) from t1",
@@ -200,16 +200,16 @@ class TDTestCase:
"select asin(c5) from stb1",
"select asin(c6) from stb1",
- "select asin(c6) as alisb from stb1",
- "select asin(c6) alisb from stb1",
+ "select asin(c6) as alisb from stb1",
+ "select asin(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
-
+
def basic_asin_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -250,7 +250,7 @@ class TDTestCase:
tdSql.checkData(5, 5, None)
self.check_result_auto_asin( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from t1", "select asin(abs(c1)), asin(abs(c2)) ,asin(abs(c3)), asin(abs(c4)), asin(abs(c5)) from t1")
-
+
# used for sub table
tdSql.query("select c2 ,asin(c2) from ct1")
tdSql.checkData(0, 1, None)
@@ -266,7 +266,7 @@ class TDTestCase:
tdSql.checkData(5 , 2, None)
self.check_result_auto_asin( "select c1, c2, c3 , c4, c5 from ct1", "select asin(c1), asin(c2) ,asin(c3), asin(c4), asin(c5) from ct1")
-
+
# nest query for asin functions
tdSql.query("select c4 , asin(c4) ,asin(asin(c4)) , asin(asin(asin(c4))) from ct1;")
tdSql.checkData(0 , 0 , 88)
@@ -284,21 +284,21 @@ class TDTestCase:
tdSql.checkData(11 , 2 , None)
tdSql.checkData(11 , 3 , None)
- # used for stable table
-
+ # used for stable table
+
tdSql.query("select asin(c1) from stb1")
tdSql.checkRows(25)
-
+
# used for not exists table
tdSql.error("select asin(c1) from stbbb1")
tdSql.error("select asin(c1) from tbname")
tdSql.error("select asin(c1) from ct5")
- # mix with common col
+ # mix with common col
tdSql.query("select c1, asin(c1) from ct1")
tdSql.query("select c2, asin(c2) from ct4")
-
+
# mix with common functions
tdSql.query("select c1, asin(c1),asin(c1), asin(asin(c1)) from ct4 ")
@@ -306,7 +306,7 @@ class TDTestCase:
tdSql.checkData(0 , 1 ,None)
tdSql.checkData(0 , 2 ,None)
tdSql.checkData(0 , 3 ,None)
-
+
tdSql.checkData(3 , 0 , 6)
tdSql.checkData(3 , 1 ,None)
tdSql.checkData(3 , 2 ,None)
@@ -327,8 +327,8 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
-
- # # bug fix for compute
+
+ # # bug fix for compute
tdSql.query("select c1, asin(c1) -0 ,asin(c1-4)-0 from ct4 ")
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None)
@@ -397,10 +397,10 @@ class TDTestCase:
tdSql.checkData(0,3,1.000000000)
tdSql.checkData(0,4,0.900000000)
tdSql.checkData(0,5,2)
-
+
def pow_Arithmetic(self):
pass
-
+
def check_boundary_values(self):
PI=3.1415926
@@ -429,11 +429,11 @@ class TDTestCase:
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto_asin( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ", "select asin(abs(c1)), asin(abs(c2)) ,asin(abs(c3)), asin(abs(c4)), asin(abs(c5)) from sub1_bound")
-
+
self.check_result_auto_asin( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select asin(c1), asin(c2) ,asin(c3), asin(c3), asin(c2) ,asin(c1) from sub1_bound")
self.check_result_auto_asin("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound" , "select asin(abs(c1)) from sub1_bound" )
-
+
# check basic elem for table per row
tdSql.query("select asin(abs(c1)) ,asin(abs(c2)) , asin(abs(c3)) , asin(abs(c4)), asin(abs(c5)), asin(abs(c6)) from sub1_bound ")
tdSql.checkData(0,0,None)
@@ -492,37 +492,37 @@ class TDTestCase:
self.check_result_auto_asin( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select asin(t1) ,asin(c5) from stb1 where c1 > 0 order by tbname" )
self.check_result_auto_asin( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select asin(t1) , asin(c5) from stb1 where c1 > 0 order by tbname" )
pass
-
-
+
+
def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: asin basic query ============")
+ tdLog.printNoPrefix("==========step4: asin basic query ============")
self.basic_asin_function()
- tdLog.printNoPrefix("==========step5: big number asin query ============")
+ tdLog.printNoPrefix("==========step5: big number asin query ============")
self.test_big_number()
- tdLog.printNoPrefix("==========step6: asin boundary query ============")
+ tdLog.printNoPrefix("==========step6: asin boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step7: asin filter query ============")
+ tdLog.printNoPrefix("==========step7: asin filter query ============")
self.abs_func_filter()
diff --git a/tests/system-test/2-query/arctan.py b/tests/system-test/2-query/arctan.py
index db596934257e31b40edac45d6c7f2a300bde876a..4c729bd52178bcfdc9c40d6c817d77c42865984a 100644
--- a/tests/system-test/2-query/arctan.py
+++ b/tests/system-test/2-query/arctan.py
@@ -9,13 +9,13 @@ from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def init(self, conn, powSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -23,7 +23,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -65,14 +65,14 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def check_result_auto_atan(self ,origin_query , pow_query):
pow_result = tdSql.getResult(pow_query)
origin_result = tdSql.getResult(origin_query)
auto_result =[]
-
+
for row in origin_result:
row_check = []
for elem in row:
@@ -90,7 +90,7 @@ class TDTestCase:
if auto_result[row_index][col_index] == None and not (auto_result[row_index][col_index] == None and elem == None):
check_status = False
elif auto_result[row_index][col_index] != None and (auto_result[row_index][col_index] - elem > 0.00000001):
- check_status = False
+ check_status = False
else:
pass
if not check_status:
@@ -98,7 +98,7 @@ class TDTestCase:
sys.exit(1)
else:
tdLog.info("atan value check pass , it work as expected ,sql is \"%s\" "%pow_query )
-
+
def test_errors(self):
error_sql_lists = [
"select atan from t1",
@@ -132,42 +132,42 @@ class TDTestCase:
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
-
+
def support_types(self):
type_error_sql_lists = [
- "select atan(ts) from t1" ,
+ "select atan(ts) from t1" ,
"select atan(c7) from t1",
"select atan(c8) from t1",
"select atan(c9) from t1",
- "select atan(ts) from ct1" ,
+ "select atan(ts) from ct1" ,
"select atan(c7) from ct1",
"select atan(c8) from ct1",
"select atan(c9) from ct1",
- "select atan(ts) from ct3" ,
+ "select atan(ts) from ct3" ,
"select atan(c7) from ct3",
"select atan(c8) from ct3",
"select atan(c9) from ct3",
- "select atan(ts) from ct4" ,
+ "select atan(ts) from ct4" ,
"select atan(c7) from ct4",
"select atan(c8) from ct4",
"select atan(c9) from ct4",
- "select atan(ts) from stb1" ,
+ "select atan(ts) from stb1" ,
"select atan(c7) from stb1",
"select atan(c8) from stb1",
"select atan(c9) from stb1" ,
- "select atan(ts) from stbbb1" ,
+ "select atan(ts) from stbbb1" ,
"select atan(c7) from stbbb1",
"select atan(ts) from tbname",
"select atan(c9) from tbname"
]
-
+
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
-
-
+
+
type_sql_lists = [
"select atan(c1) from t1",
"select atan(c2) from t1",
@@ -197,16 +197,16 @@ class TDTestCase:
"select atan(c5) from stb1",
"select atan(c6) from stb1",
- "select atan(c6) as alisb from stb1",
- "select atan(c6) alisb from stb1",
+ "select atan(c6) as alisb from stb1",
+ "select atan(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
-
+
def basic_atan_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -247,7 +247,7 @@ class TDTestCase:
tdSql.checkData(5, 5, None)
self.check_result_auto_atan( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from t1", "select atan(abs(c1)), atan(abs(c2)) ,atan(abs(c3)), atan(abs(c4)), atan(abs(c5)) from t1")
-
+
# used for sub table
tdSql.query("select c2 ,atan(c2) from ct1")
tdSql.checkData(0, 1, 1.570785077)
@@ -263,7 +263,7 @@ class TDTestCase:
tdSql.checkData(5 , 2, None)
self.check_result_auto_atan( "select c1, c2, c3 , c4, c5 from ct1", "select atan(c1), atan(c2) ,atan(c3), atan(c4), atan(c5) from ct1")
-
+
# nest query for atan functions
tdSql.query("select c4 , atan(c4) ,atan(atan(c4)) , atan(atan(atan(c4))) from ct1;")
tdSql.checkData(0 , 0 , 88)
@@ -281,21 +281,21 @@ class TDTestCase:
tdSql.checkData(11 , 2 , -1.000958403)
tdSql.checkData(11 , 3 , -0.785877135)
- # used for stable table
-
+ # used for stable table
+
tdSql.query("select atan(c1) from stb1")
tdSql.checkRows(25)
-
+
# used for not exists table
tdSql.error("select atan(c1) from stbbb1")
tdSql.error("select atan(c1) from tbname")
tdSql.error("select atan(c1) from ct5")
- # mix with common col
+ # mix with common col
tdSql.query("select c1, atan(c1) from ct1")
tdSql.query("select c2, atan(c2) from ct4")
-
+
# mix with common functions
tdSql.query("select c1, atan(c1),atan(c1), atan(atan(c1)) from ct4 ")
@@ -303,7 +303,7 @@ class TDTestCase:
tdSql.checkData(0 , 1 ,None)
tdSql.checkData(0 , 2 ,None)
tdSql.checkData(0 , 3 ,None)
-
+
tdSql.checkData(3 , 0 , 6)
tdSql.checkData(3 , 1 ,1.405647649)
tdSql.checkData(3 , 2 ,1.405647649)
@@ -324,8 +324,8 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
-
- # # bug fix for compute
+
+ # # bug fix for compute
tdSql.query("select c1, atan(c1) -0 ,atan(c1-4)-0 from ct4 ")
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None)
@@ -394,10 +394,10 @@ class TDTestCase:
tdSql.checkData(0,3,0.000000000)
tdSql.checkData(0,4,-0.100000000)
tdSql.checkData(0,5,0.000000000)
-
+
def pow_Arithmetic(self):
pass
-
+
def check_boundary_values(self):
PI=3.1415926
@@ -426,11 +426,11 @@ class TDTestCase:
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto_atan( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ", "select atan(abs(c1)), atan(abs(c2)) ,atan(abs(c3)), atan(abs(c4)), atan(abs(c5)) from sub1_bound")
-
+
self.check_result_auto_atan( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select atan(c1), atan(c2) ,atan(c3), atan(c3), atan(c2) ,atan(c1) from sub1_bound")
self.check_result_auto_atan("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound" , "select atan(abs(c1)) from sub1_bound" )
-
+
# check basic elem for table per row
tdSql.query("select atan(abs(c1)) ,atan(abs(c2)) , atan(abs(c3)) , atan(abs(c4)), atan(abs(c5)), atan(abs(c6)) from sub1_bound ")
tdSql.checkData(0,0,math.atan(2147483647))
@@ -490,36 +490,36 @@ class TDTestCase:
self.check_result_auto_atan( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select atan(t1) ,atan(c5) from stb1 where c1 > 0 order by tbname" )
self.check_result_auto_atan( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select atan(t1) , atan(c5) from stb1 where c1 > 0 order by tbname" )
pass
-
+
def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: atan basic query ============")
+ tdLog.printNoPrefix("==========step4: atan basic query ============")
self.basic_atan_function()
- tdLog.printNoPrefix("==========step5: big number atan query ============")
+ tdLog.printNoPrefix("==========step5: big number atan query ============")
self.test_big_number()
- tdLog.printNoPrefix("==========step6: atan boundary query ============")
+ tdLog.printNoPrefix("==========step6: atan boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step7: atan filter query ============")
+ tdLog.printNoPrefix("==========step7: atan filter query ============")
self.abs_func_filter()
@@ -527,7 +527,7 @@ class TDTestCase:
self.support_super_table_test()
-
+
def stop(self):
tdSql.close()
diff --git a/tests/system-test/2-query/bottom.py b/tests/system-test/2-query/bottom.py
index 3aeadb172a5d0e33cc971037d77b6667d30ac289..1b7c9673485019e375ee233d5b488077ac71a95e 100644
--- a/tests/system-test/2-query/bottom.py
+++ b/tests/system-test/2-query/bottom.py
@@ -48,7 +48,7 @@ class TDTestCase:
'col12': 'binary(20)',
'col13': 'nchar(20)'
}
-
+
self.param_list = [1,100]
def insert_data(self,column_dict,tbname,row_num):
insert_sql = self.setsql.set_insertsql(column_dict,tbname,self.binary_str,self.nchar_str)
@@ -125,11 +125,11 @@ class TDTestCase:
self.bottom_check_data(f'{stbname}_{i}','child_table')
self.bottom_check_data(f'{stbname}','stable')
tdSql.execute(f'drop database {self.dbname}')
-
+
def run(self):
self.bottom_check_ntb()
self.bottom_check_stb()
-
+
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
diff --git a/tests/system-test/2-query/ceil.py b/tests/system-test/2-query/ceil.py
index 9816751e55c5cb15a5e6664dbf999fbba00af468..f1379e66610f99cef8e6233e0196e31c30e8d6bf 100644
--- a/tests/system-test/2-query/ceil.py
+++ b/tests/system-test/2-query/ceil.py
@@ -9,14 +9,14 @@ from util.sql import *
from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def init(self, conn, logSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -24,7 +24,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -66,14 +66,14 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def check_result_auto(self ,origin_query , ceil_query):
pass
ceil_result = tdSql.getResult(ceil_query)
origin_result = tdSql.getResult(origin_query)
auto_result =[]
-
+
for row in origin_result:
row_check = []
for elem in row:
@@ -88,13 +88,13 @@ class TDTestCase:
for row_index , row in enumerate(ceil_result):
for col_index , elem in enumerate(row):
if auto_result[row_index][col_index] != elem:
- check_status = False
+ check_status = False
if not check_status:
tdLog.notice("ceil function value has not as expected , sql is \"%s\" "%ceil_query )
sys.exit(1)
else:
tdLog.info("ceil value check pass , it work as expected ,sql is \"%s\" "%ceil_query )
-
+
def test_errors(self):
error_sql_lists = [
"select ceil from t1",
@@ -128,42 +128,42 @@ class TDTestCase:
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
-
+
def support_types(self):
type_error_sql_lists = [
- "select ceil(ts) from t1" ,
+ "select ceil(ts) from t1" ,
"select ceil(c7) from t1",
"select ceil(c8) from t1",
"select ceil(c9) from t1",
- "select ceil(ts) from ct1" ,
+ "select ceil(ts) from ct1" ,
"select ceil(c7) from ct1",
"select ceil(c8) from ct1",
"select ceil(c9) from ct1",
- "select ceil(ts) from ct3" ,
+ "select ceil(ts) from ct3" ,
"select ceil(c7) from ct3",
"select ceil(c8) from ct3",
"select ceil(c9) from ct3",
- "select ceil(ts) from ct4" ,
+ "select ceil(ts) from ct4" ,
"select ceil(c7) from ct4",
"select ceil(c8) from ct4",
"select ceil(c9) from ct4",
- "select ceil(ts) from stb1" ,
+ "select ceil(ts) from stb1" ,
"select ceil(c7) from stb1",
"select ceil(c8) from stb1",
"select ceil(c9) from stb1" ,
- "select ceil(ts) from stbbb1" ,
+ "select ceil(ts) from stbbb1" ,
"select ceil(c7) from stbbb1",
"select ceil(ts) from tbname",
"select ceil(c9) from tbname"
]
-
+
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
-
-
+
+
type_sql_lists = [
"select ceil(c1) from t1",
"select ceil(c2) from t1",
@@ -193,16 +193,16 @@ class TDTestCase:
"select ceil(c5) from stb1",
"select ceil(c6) from stb1",
- "select ceil(c6) as alisb from stb1",
- "select ceil(c6) alisb from stb1",
+ "select ceil(c6) as alisb from stb1",
+ "select ceil(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
-
+
def basic_ceil_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -222,7 +222,7 @@ class TDTestCase:
tdSql.query("select ceil(c5) from ct3")
tdSql.checkRows(0)
tdSql.query("select ceil(c6) from ct3")
-
+
# used for regular table
tdSql.query("select ceil(c1) from t1")
tdSql.checkData(0, 0, None)
@@ -240,7 +240,7 @@ class TDTestCase:
tdSql.checkData(5, 5, None)
self.check_result_auto( "select c1, c2, c3 , c4, c5 from t1", "select (c1), ceil(c2) ,ceil(c3), ceil(c4), ceil(c5) from t1")
-
+
# used for sub table
tdSql.query("select ceil(c1) from ct1")
tdSql.checkData(0, 0, 8)
@@ -252,20 +252,20 @@ class TDTestCase:
self.check_result_auto( "select c1, c2, c3 , c4, c5 from ct1", "select (c1), ceil(c2) ,ceil(c3), ceil(c4), ceil(c5) from ct1")
self.check_result_auto("select ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(c1)))))))))) nest_col_func from ct1;","select c1 from ct1" )
- # used for stable table
-
+ # used for stable table
+
tdSql.query("select ceil(c1) from stb1")
tdSql.checkRows(25)
self.check_result_auto( "select c1, c2, c3 , c4, c5 from ct4 ", "select (c1), ceil(c2) ,ceil(c3), ceil(c4), ceil(c5) from ct4")
self.check_result_auto("select ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(c1)))))))))) nest_col_func from ct4;" , "select c1 from ct4" )
-
+
# used for not exists table
tdSql.error("select ceil(c1) from stbbb1")
tdSql.error("select ceil(c1) from tbname")
tdSql.error("select ceil(c1) from ct5")
- # mix with common col
+ # mix with common col
tdSql.query("select c1, ceil(c1) from ct1")
tdSql.checkData(0 , 0 ,8)
tdSql.checkData(0 , 1 ,8)
@@ -290,7 +290,7 @@ class TDTestCase:
tdSql.checkData(0 , 1 ,None)
tdSql.checkData(0 , 2 ,None)
tdSql.checkData(0 , 3 ,None)
-
+
tdSql.checkData(3 , 0 , 6)
tdSql.checkData(3 , 1 , 6)
tdSql.checkData(3 , 2 ,6.66000)
@@ -311,7 +311,7 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
-
+
# bug fix for count
tdSql.query("select count(c1) from ct4 ")
tdSql.checkData(0,0,9)
@@ -322,7 +322,7 @@ class TDTestCase:
tdSql.query("select count(*) from stb1 ")
tdSql.checkData(0,0,25)
- # bug fix for compute
+ # bug fix for compute
tdSql.query("select c1, abs(c1) -0 ,ceil(c1)-0 from ct4 ")
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None)
@@ -373,10 +373,10 @@ class TDTestCase:
tdSql.checkData(0,3,8.000000000)
tdSql.checkData(0,4,7.900000000)
tdSql.checkData(0,5,3.000000000)
-
+
def ceil_Arithmetic(self):
pass
-
+
def check_boundary_values(self):
tdSql.execute("drop database if exists bound_test")
@@ -405,14 +405,14 @@ class TDTestCase:
tdSql.execute(
f"insert into sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
-
+
tdSql.error(
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto( "select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ", "select ceil(c1), ceil(c2) ,ceil(c3), ceil(c4), ceil(c5) ,ceil(c6) from sub1_bound")
self.check_result_auto( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select ceil(c1), ceil(c2) ,ceil(c3), ceil(c3), ceil(c2) ,ceil(c1) from sub1_bound")
self.check_result_auto("select ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(ceil(c1)))))))))) nest_col_func from sub1_bound;" , "select ceil(c1) from sub1_bound" )
-
+
# check basic elem for table per row
tdSql.query("select ceil(c1+0.2) ,ceil(c2) , ceil(c3+0.3) , ceil(c4-0.3), ceil(c5/2), ceil(c6/2) from sub1_bound ")
tdSql.checkData(0, 0, 2147483648.000000000)
@@ -426,7 +426,7 @@ class TDTestCase:
tdSql.checkData(4, 4, -169499995645668991474575059260979281920.000000000)
self.check_result_auto("select c1+1 ,c2 , c3*1 , c4/2, c5/2, c6 from sub1_bound" ,"select ceil(c1+1) ,ceil(c2) , ceil(c3*1) , ceil(c4/2), ceil(c5)/2, ceil(c6) from sub1_bound ")
-
+
def support_super_table_test(self):
tdSql.execute(" use db ")
self.check_result_auto( " select c5 from stb1 order by ts " , "select ceil(c5) from stb1 order by ts" )
@@ -444,26 +444,26 @@ class TDTestCase:
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: ceil basic query ============")
+ tdLog.printNoPrefix("==========step4: ceil basic query ============")
self.basic_ceil_function()
- tdLog.printNoPrefix("==========step5: ceil boundary query ============")
+ tdLog.printNoPrefix("==========step5: ceil boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step6: ceil filter query ============")
+ tdLog.printNoPrefix("==========step6: ceil filter query ============")
self.abs_func_filter()
diff --git a/tests/system-test/2-query/cos.py b/tests/system-test/2-query/cos.py
index e50ec6d5238f6da313feecb44e26b48b33de2b1e..e0941b91579a76c85ff8896364bc2e8b525ceb09 100644
--- a/tests/system-test/2-query/cos.py
+++ b/tests/system-test/2-query/cos.py
@@ -9,13 +9,13 @@ from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def init(self, conn, powSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -23,7 +23,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -65,14 +65,14 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def check_result_auto_cos(self ,origin_query , pow_query):
pow_result = tdSql.getResult(pow_query)
origin_result = tdSql.getResult(origin_query)
auto_result =[]
-
+
for row in origin_result:
row_check = []
for elem in row:
@@ -90,7 +90,7 @@ class TDTestCase:
if auto_result[row_index][col_index] == None and not (auto_result[row_index][col_index] == None and elem == None):
check_status = False
elif auto_result[row_index][col_index] != None and (auto_result[row_index][col_index] - elem > 0.00000001):
- check_status = False
+ check_status = False
else:
pass
if not check_status:
@@ -98,7 +98,7 @@ class TDTestCase:
sys.exit(1)
else:
tdLog.info("cos value check pass , it work as expected ,sql is \"%s\" "%pow_query )
-
+
def test_errors(self):
error_sql_lists = [
"select cos from t1",
@@ -132,42 +132,42 @@ class TDTestCase:
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
-
+
def support_types(self):
type_error_sql_lists = [
- "select cos(ts) from t1" ,
+ "select cos(ts) from t1" ,
"select cos(c7) from t1",
"select cos(c8) from t1",
"select cos(c9) from t1",
- "select cos(ts) from ct1" ,
+ "select cos(ts) from ct1" ,
"select cos(c7) from ct1",
"select cos(c8) from ct1",
"select cos(c9) from ct1",
- "select cos(ts) from ct3" ,
+ "select cos(ts) from ct3" ,
"select cos(c7) from ct3",
"select cos(c8) from ct3",
"select cos(c9) from ct3",
- "select cos(ts) from ct4" ,
+ "select cos(ts) from ct4" ,
"select cos(c7) from ct4",
"select cos(c8) from ct4",
"select cos(c9) from ct4",
- "select cos(ts) from stb1" ,
+ "select cos(ts) from stb1" ,
"select cos(c7) from stb1",
"select cos(c8) from stb1",
"select cos(c9) from stb1" ,
- "select cos(ts) from stbbb1" ,
+ "select cos(ts) from stbbb1" ,
"select cos(c7) from stbbb1",
"select cos(ts) from tbname",
"select cos(c9) from tbname"
]
-
+
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
-
-
+
+
type_sql_lists = [
"select cos(c1) from t1",
"select cos(c2) from t1",
@@ -197,16 +197,16 @@ class TDTestCase:
"select cos(c5) from stb1",
"select cos(c6) from stb1",
- "select cos(c6) as alisb from stb1",
- "select cos(c6) alisb from stb1",
+ "select cos(c6) as alisb from stb1",
+ "select cos(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
-
+
def basic_cosin_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -247,7 +247,7 @@ class TDTestCase:
tdSql.checkData(5, 5, None)
self.check_result_auto_cos( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from t1", "select cos(abs(c1)), cos(abs(c2)) ,cos(abs(c3)), cos(abs(c4)), cos(abs(c5)) from t1")
-
+
# used for sub table
tdSql.query("select c2 ,cos(c2) from ct1")
tdSql.checkData(0, 1, 0.975339851)
@@ -263,7 +263,7 @@ class TDTestCase:
tdSql.checkData(5 , 2, None)
self.check_result_auto_cos( "select c1, c2, c3 , c4, c5 from ct1", "select cos(c1), cos(c2) ,cos(c3), cos(c4), cos(c5) from ct1")
-
+
# nest query for cos functions
tdSql.query("select c4 , cos(c4) ,cos(cos(c4)) , cos(cos(cos(c4))) from ct1;")
tdSql.checkData(0 , 0 , 88)
@@ -281,21 +281,21 @@ class TDTestCase:
tdSql.checkData(11 , 2 , 0.999207254)
tdSql.checkData(11 , 3 , 0.540969209)
- # used for stable table
-
+ # used for stable table
+
tdSql.query("select cos(c1) from stb1")
tdSql.checkRows(25)
-
+
# used for not exists table
tdSql.error("select cos(c1) from stbbb1")
tdSql.error("select cos(c1) from tbname")
tdSql.error("select cos(c1) from ct5")
- # mix with common col
+ # mix with common col
tdSql.query("select c1, cos(c1) from ct1")
tdSql.query("select c2, cos(c2) from ct4")
-
+
# mix with common functions
tdSql.query("select c1, cos(c1),cos(c1), cos(cos(c1)) from ct4 ")
@@ -303,7 +303,7 @@ class TDTestCase:
tdSql.checkData(0 , 1 ,None)
tdSql.checkData(0 , 2 ,None)
tdSql.checkData(0 , 3 ,None)
-
+
tdSql.checkData(3 , 0 , 6)
tdSql.checkData(3 , 1 ,0.960170287)
tdSql.checkData(3 , 2 ,0.960170287)
@@ -324,8 +324,8 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
-
- # # bug fix for compute
+
+ # # bug fix for compute
tdSql.query("select c1, cos(c1) -0 ,cos(c1-4)-0 from ct4 ")
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None)
@@ -394,10 +394,10 @@ class TDTestCase:
tdSql.checkData(0,3,8.000000000)
tdSql.checkData(0,4,7.900000000)
tdSql.checkData(0,5,0.000000000)
-
+
def pow_Arithmetic(self):
pass
-
+
def check_boundary_values(self):
PI=3.1415926
@@ -426,11 +426,11 @@ class TDTestCase:
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto_cos( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ", "select cos(abs(c1)), cos(abs(c2)) ,cos(abs(c3)), cos(abs(c4)), cos(abs(c5)) from sub1_bound")
-
+
self.check_result_auto_cos( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select cos(c1), cos(c2) ,cos(c3), cos(c3), cos(c2) ,cos(c1) from sub1_bound")
self.check_result_auto_cos("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound" , "select cos(abs(c1)) from sub1_bound" )
-
+
# check basic elem for table per row
tdSql.query("select cos(abs(c1)) ,cos(abs(c2)) , cos(abs(c3)) , cos(abs(c4)), cos(abs(c5)), cos(abs(c6)) from sub1_bound ")
tdSql.checkData(0,0,math.cos(2147483647))
@@ -489,36 +489,36 @@ class TDTestCase:
self.check_result_auto_cos( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select cos(t1) ,cos(c5) from stb1 where c1 > 0 order by tbname" )
self.check_result_auto_cos( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select cos(t1) , cos(c5) from stb1 where c1 > 0 order by tbname" )
pass
-
+
def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: cos basic query ============")
+ tdLog.printNoPrefix("==========step4: cos basic query ============")
self.basic_cosin_function()
- tdLog.printNoPrefix("==========step5: big number cos query ============")
+ tdLog.printNoPrefix("==========step5: big number cos query ============")
self.test_big_number()
- tdLog.printNoPrefix("==========step6: cos boundary query ============")
+ tdLog.printNoPrefix("==========step6: cos boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step7: cos filter query ============")
+ tdLog.printNoPrefix("==========step7: cos filter query ============")
self.abs_func_filter()
diff --git a/tests/system-test/2-query/count.py b/tests/system-test/2-query/count.py
index a70a2e72f25380d45d799d49ca240b2eb59e52a3..c83ff43c51a83157a4a7151cbcc3ab3b9269eae0 100644
--- a/tests/system-test/2-query/count.py
+++ b/tests/system-test/2-query/count.py
@@ -1,196 +1,125 @@
from util.log import *
from util.sql import *
from util.cases import *
-
+from util.sqlset import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
- tdSql.init(conn.cursor())
-
+ tdSql.init(conn.cursor(),logSql)
+ self.setsql = TDSetSql()
self.rowNum = 10
self.ts = 1537146000000
- def run(self):
+ self.ntbname = 'ntb'
+ self.stbname = 'stb'
+ self.column_dict = {
+ 'ts':'timestamp',
+ 'c1':'int',
+ 'c2':'float',
+ 'c3':'double',
+ 'c4':'timestamp'
+ }
+ self.tag_dict = {
+ 't0':'int'
+ }
+ # The number of tag_values should be same as tbnum
+ self.tbnum = 2
+ self.tag_values = [
+ f'10',
+ f'100'
+ ]
+ def query_stb(self,k,stbname,tbnum,rownum):
+ tdSql.query(f'select count({k}) from {stbname}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],tbnum*rownum)
+ tdSql.query(f'select count({k}) from {stbname} where ts <={self.ts+self.rowNum-1}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],tbnum*rownum)
+ tdSql.query(f'select count({k}) from {stbname} where ts <={self.ts+self.rowNum-2}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],tbnum*(rownum-1))
+ def query_ctb(self,k,i,stbname,rownum):
+ tdSql.query(f'select count({k}) from {stbname}_{i}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],rownum)
+ tdSql.query(f'select count({k}) from {stbname}_{i} where ts <={self.ts+self.rowNum-1}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],rownum)
+ tdSql.query(f'select count({k}) from {stbname}_{i} where ts <={self.ts+self.rowNum-2}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],rownum-1)
+ def query_ntb(self,k,ntbname,rownum):
+ tdSql.query(f'select count({k}) from {ntbname}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],rownum)
+ tdSql.query(f'select count({k}) from {ntbname} where ts <={self.ts+self.rowNum-1}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],rownum)
+ tdSql.query(f'select count({k}) from {ntbname} where ts <={self.ts+self.rowNum-2}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],rownum-1)
+ def count_query_stb(self,column_dict,tag_dict,stbname,tbnum,rownum):
+ tdSql.query(f'select count(tbname) from {stbname}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],tbnum*rownum)
+ tdSql.query(f'SELECT count(*) from (select distinct tbname from {stbname})')
+ tdSql.checkEqual(tdSql.queryResult[0][0],tbnum)
+ for k in column_dict.keys():
+ self.query_stb(k,stbname,tbnum,rownum)
+ for k in tag_dict.keys():
+ self.query_stb(k,stbname,tbnum,rownum)
+ def count_query_ctb(self,column_dict,tag_dict,stbname,tbnum,rownum):
+ for i in range(tbnum):
+ tdSql.query(f'select count(tbname) from {stbname}_{i}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],rownum)
+ for k in column_dict.keys():
+ self.query_ctb(k,i,stbname,rownum)
+ for k in tag_dict.keys():
+ self.query_ctb(k,i,stbname,rownum)
+ def count_query_ntb(self,column_dict,ntbname,rownum):
+ tdSql.query(f'select count(tbname) from {ntbname}')
+ tdSql.checkEqual(tdSql.queryResult[0][0],rownum)
+ for k in column_dict.keys():
+ self.query_ntb(k,ntbname,rownum)
+ def insert_data(self,column_dict,tbname,row_num):
+ insert_sql = self.setsql.set_insertsql(column_dict,tbname)
+ for i in range(row_num):
+ insert_list = []
+ self.setsql.insert_values(column_dict,i,insert_sql,insert_list,self.ts)
+ def check_ntb(self):
tdSql.prepare()
-
- tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
- col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
- tdSql.execute("create table stb_1 using stb tags('beijing')")
- tdSql.execute("create table stb_2 using stb tags('shanghai')")
-
- tdSql.execute('''create table ntb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
- col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''')
-
- for i in range(self.rowNum):
- tdSql.execute("insert into stb_1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
- % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
- tdSql.execute("insert into stb_2 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
- % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
-
- for i in range(self.rowNum):
- tdSql.execute("insert into ntb values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
- % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
-
- tdSql.query("select count(*) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(*) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(ts) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(ts) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col1) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col1) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col2) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col2) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col3) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col3) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col4) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col4) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col5) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col5) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col6) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col6) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col7) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col7) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col8) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col8) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col9) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col9) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col11) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col11) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col12) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col12) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col13) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col13) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col14) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col14) from db.stb")
- tdSql.checkData(0,0,20)
-
-
-
- tdSql.query("select count(ts) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(ts) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col1) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col1) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col2) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col2) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col3) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col3) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col4) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col4) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col5) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col5) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col6) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col6) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col7) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col7) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col8) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col8) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col9) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col9) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col11) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col11) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col12) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col12) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col13) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col13) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col14) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col14) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col1) from stb_1 group by col7")
- tdSql.checkRows(2)
-
- tdSql.execute("insert into stb_1 values(now,null,null,null,null,null,null,null,null,null,null,null,null,null)")
- tdSql.query("select count(col1) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col1),count(ts) from stb_1")
- tdSql.checkData(0,0,10)
- tdSql.checkData(0,1,11)
-
- tdSql.query("select count(col1) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.query("select count(col1),count(ts) from db.stb_1")
- tdSql.checkData(0,0,10)
- tdSql.checkData(0,1,11)
-
- tdSql.query("select count(col1) from stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col1),count(ts) from stb")
- tdSql.checkData(0,0,20)
- tdSql.checkData(0,1,21)
-
- tdSql.query("select count(col1) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.query("select count(col1),count(ts) from db.stb")
- tdSql.checkData(0,0,20)
- tdSql.checkData(0,1,21)
- tdSql.query("select count(col1) from stb_1 group by col7")
- tdSql.checkRows(3)
- tdSql.query("select count(col1) from stb_2 group by col7")
- tdSql.checkRows(2)
- tdSql.query("select count(col1) from stb group by col7")
- tdSql.checkRows(3)
-
-
-
-
+ tdSql.execute(self.setsql.set_create_normaltable_sql(self.ntbname,self.column_dict))
+ tdSql.query(f'select count(tbname) from {self.ntbname}')
+ tdSql.checkRows(0)
+ tdSql.execute('flush database db')
+ tdSql.query(f'select count(tbname) from {self.ntbname}')
+ tdSql.checkRows(0)
+ self.insert_data(self.column_dict,self.ntbname,self.rowNum)
+ self.count_query_ntb(self.column_dict,self.ntbname,self.rowNum)
+ tdSql.execute('flush database db')
+ self.count_query_ntb(self.column_dict,self.ntbname,self.rowNum)
+ tdSql.execute('drop database db')
+ def check_stb(self):
+ tdSql.prepare()
+ tdSql.execute(self.setsql.set_create_stable_sql(self.stbname,self.column_dict,self.tag_dict))
+ for i in range(self.tbnum):
+ tdSql.execute(f'create table {self.stbname}_{i} using {self.stbname} tags({self.tag_values[i]})')
+ #!TODO
+ # tdSql.query(f'SELECT count(*) from (select distinct tbname from {self.stbname})')
+ # tdSql.checkEqual(tdSql.queryResult[0][0],self.tbnum)
+ tdSql.query(f'select count(tbname) from {self.stbname}')
+ tdSql.checkRows(0)
+ tdSql.execute('flush database db')
+ tdSql.query(f'select count(tbname) from {self.stbname}')
+ tdSql.checkRows(0)
+ #!TODO
+ # tdSql.query(f'SELECT count(*) from (select distinct tbname from {self.stbname})')
+ # tdSql.checkEqual(tdSql.queryResult[0][0],self.tbnum)
+ for i in range(self.tbnum):
+ self.insert_data(self.column_dict,f'{self.stbname}_{i}',self.rowNum)
+ self.count_query_stb(self.column_dict,self.tag_dict,self.stbname,self.tbnum,self.rowNum)
+ self.count_query_ctb(self.column_dict,self.tag_dict,self.stbname,self.tbnum,self.rowNum)
+ tdSql.execute('flush database db')
+ self.count_query_stb(self.column_dict,self.tag_dict,self.stbname,self.tbnum,self.rowNum)
+ self.count_query_ctb(self.column_dict,self.tag_dict,self.stbname,self.tbnum,self.rowNum)
+ tdSql.execute('drop database db')
+ def run(self):
+ self.check_stb()
+ self.check_ntb()
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
-tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/2-query/csum.py b/tests/system-test/2-query/csum.py
index 5bd1d4d45e6fea063d3463d793ca3219e57a7a96..708aa351830e6c088f39e546138ee2e518921ce3 100644
--- a/tests/system-test/2-query/csum.py
+++ b/tests/system-test/2-query/csum.py
@@ -419,7 +419,7 @@ class TDTestCase:
tdSql.checkData(3,0,4)
tdSql.query("select csum(abs(c1))+2 from t1 ")
tdSql.checkRows(4)
-
+
def csum_support_stable(self):
tdSql.query(" select csum(1) from stb1 ")
tdSql.checkRows(70)
@@ -434,17 +434,17 @@ class TDTestCase:
tdSql.query("select csum(st1+c1) from stb1 partition by tbname")
tdSql.checkRows(40)
- # # bug need fix
+ # # bug need fix
# tdSql.query("select csum(st1+c1) from stb1 partition by tbname slimit 1 ")
# tdSql.checkRows(4)
# tdSql.error("select csum(st1+c1) from stb1 partition by tbname limit 1 ")
- # bug need fix
+ # bug need fix
tdSql.query("select csum(st1+c1) from stb1 partition by tbname")
- tdSql.checkRows(40)
+ tdSql.checkRows(40)
- # bug need fix
+ # bug need fix
# tdSql.query("select tbname , csum(c1) from stb1 partition by tbname")
# tdSql.checkRows(40)
# tdSql.query("select tbname , csum(st1) from stb1 partition by tbname")
@@ -452,7 +452,7 @@ class TDTestCase:
# tdSql.query("select tbname , csum(st1) from stb1 partition by tbname slimit 1")
# tdSql.checkRows(7)
- # partition by tags
+ # partition by tags
# tdSql.query("select st1 , csum(c1) from stb1 partition by st1")
# tdSql.checkRows(40)
# tdSql.query("select csum(c1) from stb1 partition by st1")
@@ -491,4 +491,4 @@ class TDTestCase:
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
-tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/2-query/diff.py b/tests/system-test/2-query/diff.py
index 0d8b0de3dca8d0db11eb98e9b04defff07df741c..30b588fa97025f4ee50f7f0e8bf2f07331e4711c 100644
--- a/tests/system-test/2-query/diff.py
+++ b/tests/system-test/2-query/diff.py
@@ -50,7 +50,7 @@ class TDTestCase:
tdSql.checkData(0, 0, None)
tdSql.checkData(1, 0, None)
- tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
+ tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table stb_1 using stb tags('beijing')")
tdSql.execute(
@@ -115,7 +115,7 @@ class TDTestCase:
tdSql.query("select diff(col6) from stb_1")
tdSql.checkRows(10)
- tdSql.execute('''create table stb1(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
+ tdSql.execute('''create table stb1(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table stb1_1 using stb tags('shanghai')")
diff --git a/tests/system-test/2-query/elapsed.py b/tests/system-test/2-query/elapsed.py
index d2f1331e0099bff03824eab209bcb6e672dcc2e3..333c60286e68ea20daf465d4c8670a569377a852 100644
--- a/tests/system-test/2-query/elapsed.py
+++ b/tests/system-test/2-query/elapsed.py
@@ -894,7 +894,7 @@ class TDTestCase:
tdSql.query(sql_common)
results= query_datas[0]
if operator == "+":
- for data in query_datas[1:]:
+ for data in query_datas[1:]:
results += data
tdSql.checkData(0,0,results)
diff --git a/tests/system-test/2-query/floor.py b/tests/system-test/2-query/floor.py
index 7f5c7f55910759dfe9b9e6e9438ad05414a6338e..29fddda0aedbd8e7dab8f7473e5e302f311ee4c5 100644
--- a/tests/system-test/2-query/floor.py
+++ b/tests/system-test/2-query/floor.py
@@ -16,7 +16,7 @@ class TDTestCase:
def init(self, conn, logSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -24,7 +24,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -66,14 +66,14 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def check_result_auto(self ,origin_query , floor_query):
pass
floor_result = tdSql.getResult(floor_query)
origin_result = tdSql.getResult(origin_query)
auto_result =[]
-
+
for row in origin_result:
row_check = []
for elem in row:
@@ -88,13 +88,13 @@ class TDTestCase:
for row_index , row in enumerate(floor_result):
for col_index , elem in enumerate(row):
if auto_result[row_index][col_index] != elem:
- check_status = False
+ check_status = False
if not check_status:
tdLog.notice("floor function value has not as expected , sql is \"%s\" "%floor_query )
sys.exit(1)
else:
tdLog.info("floor value check pass , it work as expected ,sql is \"%s\" "%floor_query )
-
+
def test_errors(self):
error_sql_lists = [
"select floor from t1",
@@ -128,42 +128,42 @@ class TDTestCase:
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
-
+
def support_types(self):
type_error_sql_lists = [
- "select floor(ts) from t1" ,
+ "select floor(ts) from t1" ,
"select floor(c7) from t1",
"select floor(c8) from t1",
"select floor(c9) from t1",
- "select floor(ts) from ct1" ,
+ "select floor(ts) from ct1" ,
"select floor(c7) from ct1",
"select floor(c8) from ct1",
"select floor(c9) from ct1",
- "select floor(ts) from ct3" ,
+ "select floor(ts) from ct3" ,
"select floor(c7) from ct3",
"select floor(c8) from ct3",
"select floor(c9) from ct3",
- "select floor(ts) from ct4" ,
+ "select floor(ts) from ct4" ,
"select floor(c7) from ct4",
"select floor(c8) from ct4",
"select floor(c9) from ct4",
- "select floor(ts) from stb1" ,
+ "select floor(ts) from stb1" ,
"select floor(c7) from stb1",
"select floor(c8) from stb1",
"select floor(c9) from stb1" ,
- "select floor(ts) from stbbb1" ,
+ "select floor(ts) from stbbb1" ,
"select floor(c7) from stbbb1",
"select floor(ts) from tbname",
"select floor(c9) from tbname"
]
-
+
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
-
-
+
+
type_sql_lists = [
"select floor(c1) from t1",
"select floor(c2) from t1",
@@ -193,16 +193,16 @@ class TDTestCase:
"select floor(c5) from stb1",
"select floor(c6) from stb1",
- "select floor(c6) as alisb from stb1",
- "select floor(c6) alisb from stb1",
+ "select floor(c6) as alisb from stb1",
+ "select floor(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
-
+
def basic_floor_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -222,7 +222,7 @@ class TDTestCase:
tdSql.query("select floor(c5) from ct3")
tdSql.checkRows(0)
tdSql.query("select floor(c6) from ct3")
-
+
# used for regular table
tdSql.query("select floor(c1) from t1")
tdSql.checkData(0, 0, None)
@@ -240,7 +240,7 @@ class TDTestCase:
tdSql.checkData(5, 5, None)
self.check_result_auto( "select c1, c2, c3 , c4, c5 from t1", "select (c1), floor(c2) ,floor(c3), floor(c4), floor(c5) from t1")
-
+
# used for sub table
tdSql.query("select floor(c1) from ct1")
tdSql.checkData(0, 0, 8)
@@ -252,20 +252,20 @@ class TDTestCase:
self.check_result_auto( "select c1, c2, c3 , c4, c5 from ct1", "select (c1), floor(c2) ,floor(c3), floor(c4), floor(c5) from ct1")
self.check_result_auto("select floor(floor(floor(floor(floor(floor(floor(floor(floor(floor(c1)))))))))) nest_col_func from ct1;","select c1 from ct1" )
- # used for stable table
-
+ # used for stable table
+
tdSql.query("select floor(c1) from stb1")
tdSql.checkRows(25)
self.check_result_auto( "select c1, c2, c3 , c4, c5 from ct4 ", "select (c1), floor(c2) ,floor(c3), floor(c4), floor(c5) from ct4")
self.check_result_auto("select floor(floor(floor(floor(floor(floor(floor(floor(floor(floor(c1)))))))))) nest_col_func from ct4;" , "select c1 from ct4" )
-
+
# used for not exists table
tdSql.error("select floor(c1) from stbbb1")
tdSql.error("select floor(c1) from tbname")
tdSql.error("select floor(c1) from ct5")
- # mix with common col
+ # mix with common col
tdSql.query("select c1, floor(c1) from ct1")
tdSql.checkData(0 , 0 ,8)
tdSql.checkData(0 , 1 ,8)
@@ -290,7 +290,7 @@ class TDTestCase:
tdSql.checkData(0 , 1 ,None)
tdSql.checkData(0 , 2 ,None)
tdSql.checkData(0 , 3 ,None)
-
+
tdSql.checkData(3 , 0 , 6)
tdSql.checkData(3 , 1 , 6)
tdSql.checkData(3 , 2 ,6.66000)
@@ -311,7 +311,7 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
-
+
# bug fix for count
tdSql.query("select count(c1) from ct4 ")
tdSql.checkData(0,0,9)
@@ -322,7 +322,7 @@ class TDTestCase:
tdSql.query("select count(*) from stb1 ")
tdSql.checkData(0,0,25)
- # bug fix for compute
+ # bug fix for compute
tdSql.query("select c1, abs(c1) -0 ,floor(c1)-0 from ct4 ")
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None)
@@ -373,10 +373,10 @@ class TDTestCase:
tdSql.checkData(0,3,8.000000000)
tdSql.checkData(0,4,7.900000000)
tdSql.checkData(0,5,3.000000000)
-
+
def floor_Arithmetic(self):
pass
-
+
def check_boundary_values(self):
tdSql.execute("drop database if exists bound_test")
@@ -405,14 +405,14 @@ class TDTestCase:
tdSql.execute(
f"insert into sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
-
+
tdSql.error(
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto( "select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ", "select floor(c1), floor(c2) ,floor(c3), floor(c4), floor(c5) ,floor(c6) from sub1_bound")
self.check_result_auto( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select floor(c1), floor(c2) ,floor(c3), floor(c3), floor(c2) ,floor(c1) from sub1_bound")
self.check_result_auto("select floor(floor(floor(floor(floor(floor(floor(floor(floor(floor(c1)))))))))) nest_col_func from sub1_bound;" , "select floor(c1) from sub1_bound" )
-
+
# check basic elem for table per row
tdSql.query("select floor(c1+0.2) ,floor(c2) , floor(c3+0.3) , floor(c4-0.3), floor(c5/2), floor(c6/2) from sub1_bound ")
tdSql.checkData(0, 0, 2147483647.000000000)
@@ -444,26 +444,26 @@ class TDTestCase:
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: floor basic query ============")
+ tdLog.printNoPrefix("==========step4: floor basic query ============")
self.basic_floor_function()
- tdLog.printNoPrefix("==========step5: floor boundary query ============")
+ tdLog.printNoPrefix("==========step5: floor boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step6: floor filter query ============")
+ tdLog.printNoPrefix("==========step6: floor filter query ============")
self.abs_func_filter()
diff --git a/tests/system-test/2-query/function_diff.py b/tests/system-test/2-query/function_diff.py
index 7d49f875d1d8b6a464de6bf167dc054502f5c21e..5e95510c1d7337cfe81850249a375d35ba307c7c 100644
--- a/tests/system-test/2-query/function_diff.py
+++ b/tests/system-test/2-query/function_diff.py
@@ -370,17 +370,17 @@ class TDTestCase:
tdSql.query("select diff(st1+c1) from stb1 partition by tbname")
tdSql.checkRows(190)
- # # bug need fix
+ # # bug need fix
# tdSql.query("select diff(st1+c1) from stb1 partition by tbname slimit 1 ")
# tdSql.checkRows(19)
# tdSql.error("select diff(st1+c1) from stb1 partition by tbname limit 1 ")
- # bug need fix
+ # bug need fix
tdSql.query("select diff(st1+c1) from stb1 partition by tbname")
tdSql.checkRows(190)
- # bug need fix
+ # bug need fix
# tdSql.query("select tbname , diff(c1) from stb1 partition by tbname")
# tdSql.checkRows(199)
# tdSql.query("select tbname , diff(st1) from stb1 partition by tbname")
@@ -388,7 +388,7 @@ class TDTestCase:
# tdSql.query("select tbname , diff(st1) from stb1 partition by tbname slimit 1")
# tdSql.checkRows(19)
- # partition by tags
+ # partition by tags
# tdSql.query("select st1 , diff(c1) from stb1 partition by st1")
# tdSql.checkRows(199)
# tdSql.query("select diff(c1) from stb1 partition by st1")
@@ -488,4 +488,4 @@ class TDTestCase:
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
-tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/2-query/function_stateduration.py b/tests/system-test/2-query/function_stateduration.py
index a716d6723626c34bcedfd10d63a0733cf87acbee..3478b7fef957ad7e0d8b9e0b6867a0dd441736ff 100644
--- a/tests/system-test/2-query/function_stateduration.py
+++ b/tests/system-test/2-query/function_stateduration.py
@@ -11,7 +11,7 @@ from util.sql import *
from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
@@ -388,11 +388,11 @@ class TDTestCase:
tdSql.execute(
f"insert into sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
-
+
tdSql.error(
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
-
+
tdSql.query("select stateduration(c1,'GT',1,1s) from sub1_bound")
tdSql.checkRows(5)
@@ -400,29 +400,29 @@ class TDTestCase:
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4:support opers ============")
+ tdLog.printNoPrefix("==========step4:support opers ============")
self.support_opers()
- tdLog.printNoPrefix("==========step5: stateduration basic query ============")
+ tdLog.printNoPrefix("==========step5: stateduration basic query ============")
self.basic_stateduration_function()
- tdLog.printNoPrefix("==========step6: stateduration boundary query ============")
+ tdLog.printNoPrefix("==========step6: stateduration boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step6: stateduration unit time test ============")
+ tdLog.printNoPrefix("==========step6: stateduration unit time test ============")
self.check_unit_time()
diff --git a/tests/system-test/2-query/last.py b/tests/system-test/2-query/last.py
index ee65d22a22e28fa956d19ddecdcebe54e922ac71..d07d0c83ebc5ef4da05bb4ff1c2a3cc6048b3ec0 100644
--- a/tests/system-test/2-query/last.py
+++ b/tests/system-test/2-query/last.py
@@ -34,7 +34,7 @@ class TDTestCase:
tag_sql += f"{k} {v},"
create_stb_sql = f'create table {stbname} (ts timestamp,{column_sql[:-1]}) tags({tag_sql[:-1]})'
return create_stb_sql
-
+
def last_check_stb_tb_base(self):
tdSql.prepare()
stbname = tdCom.getLongName(5, "letters")
@@ -201,7 +201,7 @@ class TDTestCase:
tdSql.execute(f'use {dbname}')
# build 20 child tables,every table insert 10 rows
- tdSql.execute(f'''create table {stbname}(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned,
+ tdSql.execute(f'''create table {stbname}(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned,
col7 int unsigned, col8 bigint unsigned, col9 float, col10 double, col11 bool, col12 binary(20), col13 nchar(20)) tags(loc nchar(20))''')
for i in range(self.tbnum):
tdSql.execute(
diff --git a/tests/system-test/2-query/mavg.py b/tests/system-test/2-query/mavg.py
index de379e39ced9c115df58bf4ec10a75885d1a5776..91e5e013b42cb68747478827606d2bb1038334af 100644
--- a/tests/system-test/2-query/mavg.py
+++ b/tests/system-test/2-query/mavg.py
@@ -159,7 +159,7 @@ class TDTestCase:
return tdSql.error(self.mavg_query_form(
sel=sel, func=func, col=col, m_comm=m_comm, k=k, r_comm=r_comm, alias=alias, fr=fr,
table_expr=table_expr, condition=condition
- ))
+ ))
if all(["group" in condition.lower(), "tbname" not in condition.lower()]):
print(f"case in {line}: ", end='')
@@ -295,7 +295,7 @@ class TDTestCase:
pre_result = np.array(tdSql.queryResult)[np.array(tdSql.queryResult) != None]
if (platform.system().lower() == 'windows' and pre_result.dtype == 'int32'):
pre_result = np.array(pre_result, dtype = 'int64')
-
+
pre_mavg = pre_mavg = np.convolve(pre_result, np.ones(k), "valid")[offset_val:]/k
tdSql.query(self.mavg_query_form(
sel=sel, func=func, col=col, m_comm=m_comm, k=k, r_comm=r_comm, alias=alias, fr=fr,
@@ -669,7 +669,7 @@ class TDTestCase:
tdSql.checkData(0,0,1.000000000)
tdSql.checkData(1,0,1.000000000)
tdSql.checkData(5,0,1.000000000)
-
+
tdSql.query("select mavg(abs(c1),1) from t1")
tdSql.checkRows(4)
@@ -688,17 +688,17 @@ class TDTestCase:
tdSql.query("select mavg(st1+c1,3) from stb1 partition by tbname")
tdSql.checkRows(20)
- # # bug need fix
+ # # bug need fix
# tdSql.query("select mavg(st1+c1,3) from stb1 partition by tbname slimit 1 ")
# tdSql.checkRows(2)
# tdSql.error("select mavg(st1+c1,3) from stb1 partition by tbname limit 1 ")
- # bug need fix
+ # bug need fix
tdSql.query("select mavg(st1+c1,3) from stb1 partition by tbname")
tdSql.checkRows(20)
- # bug need fix
+ # bug need fix
# tdSql.query("select tbname , mavg(c1,3) from stb1 partition by tbname")
# tdSql.checkRows(38)
# tdSql.query("select tbname , mavg(st1,3) from stb1 partition by tbname")
@@ -706,7 +706,7 @@ class TDTestCase:
# tdSql.query("select tbname , mavg(st1,3) from stb1 partition by tbname slimit 1")
# tdSql.checkRows(2)
- # partition by tags
+ # partition by tags
# tdSql.query("select st1 , mavg(c1,3) from stb1 partition by st1")
# tdSql.checkRows(38)
# tdSql.query("select mavg(c1,3) from stb1 partition by st1")
@@ -743,4 +743,4 @@ class TDTestCase:
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
-tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/2-query/max.py b/tests/system-test/2-query/max.py
index 0ca3f8f71a02e70cf75ce1ba0504642c1152bb46..8a5dca37636b69fbf30ff17bc47135eb79afb750 100644
--- a/tests/system-test/2-query/max.py
+++ b/tests/system-test/2-query/max.py
@@ -5,7 +5,7 @@ import numpy as np
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143,
"maxTablesPerVnode":2 ,"minTablesPerVnode":2,"tableIncStepPerVnode":2 }
@@ -19,15 +19,15 @@ class TDTestCase:
self.nchar_str = '涛思数据'
def max_check_stb_and_tb_base(self):
tdSql.prepare()
- intData = []
+ intData = []
floatData = []
- tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned,
+ tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned,
col7 int unsigned, col8 bigint unsigned, col9 float, col10 double, col11 bool, col12 binary(20), col13 nchar(20)) tags(loc nchar(20))''')
tdSql.execute("create table stb_1 using stb tags('beijing')")
for i in range(self.rowNum):
tdSql.execute(f"insert into stb_1 values(%d, %d, %d, %d, %d, %d, %d, %d, %d, %f, %f, %d, '{self.binary_str}%d', '{self.nchar_str}%d')"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1))
- intData.append(i + 1)
+ intData.append(i + 1)
floatData.append(i + 0.1)
for i in ['ts','col11','col12','col13']:
for j in ['db.stb','stb','db.stb_1','stb_1']:
@@ -45,17 +45,17 @@ class TDTestCase:
tdSql.query("select max(col1) from stb where col2<=5")
tdSql.checkData(0,0,5)
tdSql.execute('drop database db')
-
+
def max_check_ntb_base(self):
tdSql.prepare()
- intData = []
+ intData = []
floatData = []
- tdSql.execute('''create table ntb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned,
+ tdSql.execute('''create table ntb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned,
col7 int unsigned, col8 bigint unsigned, col9 float, col10 double, col11 bool, col12 binary(20), col13 nchar(20))''')
for i in range(self.rowNum):
tdSql.execute(f"insert into ntb values(%d, %d, %d, %d, %d, %d, %d, %d, %d, %f, %f, %d, '{self.binary_str}%d', '{self.nchar_str}%d')"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1))
- intData.append(i + 1)
+ intData.append(i + 1)
floatData.append(i + 0.1)
for i in ['ts','col11','col12','col13']:
for j in ['db.ntb','ntb']:
@@ -79,7 +79,7 @@ class TDTestCase:
same_sql = f"select {col_name} from {tbname} order by {col_name} desc limit 1"
tdSql.query(max_sql)
- max_result = tdSql.queryResult
+ max_result = tdSql.queryResult
tdSql.query(same_sql)
same_result = tdSql.queryResult
@@ -91,7 +91,7 @@ class TDTestCase:
def support_distributed_aggregate(self):
-
+
# prepate datas for 20 tables distributed at different vgroups
tdSql.execute("create database if not exists testdb keep 3650 duration 1000 vgroups 5")
tdSql.execute(" use testdb ")
@@ -161,17 +161,17 @@ class TDTestCase:
vgroups = tdSql.queryResult
vnode_tables={}
-
+
for vgroup_id in vgroups:
vnode_tables[vgroup_id[0]]=[]
-
+
# check sub_table of per vnode ,make sure sub_table has been distributed
tdSql.query("show tables like 'ct%'")
table_names = tdSql.queryResult
tablenames = []
for table_name in table_names:
- vnode_tables[table_name[6]].append(table_name[0])
+ vnode_tables[table_name[6]].append(table_name[0])
count = 0
for k ,v in vnode_tables.items():
@@ -180,8 +180,8 @@ class TDTestCase:
if count < 2:
tdLog.exit(" the datas of all not satisfy sub_table has been distributed ")
- # check max function work status
-
+ # check max function work status
+
tdSql.query("show tables like 'ct%'")
table_names = tdSql.queryResult
tablenames = []
@@ -190,23 +190,23 @@ class TDTestCase:
tdSql.query("desc stb1")
col_names = tdSql.queryResult
-
+
colnames = []
for col_name in col_names:
if col_name[1] in ["INT" ,"BIGINT" ,"SMALLINT" ,"TINYINT" , "FLOAT" ,"DOUBLE"]:
colnames.append(col_name[0])
-
+
for tablename in tablenames:
for colname in colnames:
self.check_max_functions(tablename,colname)
- # max function with basic filter
+ # max function with basic filter
print(vnode_tables)
- def run(self):
+ def run(self):
- # max verifacation
+ # max verifacation
self.max_check_stb_and_tb_base()
self.max_check_ntb_base()
diff --git a/tests/system-test/2-query/min.py b/tests/system-test/2-query/min.py
index 60a8c105f1520df5b1ad8277e79a7608afe474c8..c27e9926ff52e178afe230872d70c6ab269d6983 100644
--- a/tests/system-test/2-query/min.py
+++ b/tests/system-test/2-query/min.py
@@ -12,30 +12,30 @@ class TDTestCase:
self.rowNum = 10
self.ts = 1537146000000
-
+
def run(self):
tdSql.prepare()
- intData = []
+ intData = []
floatData = []
- tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
+ tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table stb_1 using stb tags('beijing')")
- tdSql.execute('''create table ntb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
+ tdSql.execute('''create table ntb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''')
for i in range(self.rowNum):
- tdSql.execute("insert into ntb values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
+ tdSql.execute("insert into ntb values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
- intData.append(i + 1)
+ intData.append(i + 1)
floatData.append(i + 0.1)
for i in range(self.rowNum):
- tdSql.execute("insert into stb_1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
+ tdSql.execute("insert into stb_1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
- intData.append(i + 1)
- floatData.append(i + 0.1)
+ intData.append(i + 1)
+ floatData.append(i + 0.1)
- # max verifacation
+ # max verifacation
tdSql.error("select min(ts) from stb_1")
tdSql.error("select min(ts) from db.stb_1")
tdSql.error("select min(col7) from stb_1")
@@ -206,7 +206,7 @@ class TDTestCase:
tdSql.query("select min(col1) from ntb where col2>=5")
tdSql.checkData(0,0,5)
-
+
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
diff --git a/tests/system-test/2-query/nestedQuery.py b/tests/system-test/2-query/nestedQuery.py
index 9f2b8c4b564d55843c7749f5819d674031c7f83b..757a75cf888b0ca0afb5e63be174f370e8bcbc5a 100755
--- a/tests/system-test/2-query/nestedQuery.py
+++ b/tests/system-test/2-query/nestedQuery.py
@@ -23,10 +23,10 @@ from util.dnodes import tdDnodes
from util.dnodes import *
class TDTestCase:
- updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
-
+
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
@@ -34,28 +34,28 @@ class TDTestCase:
testcasePath = os.path.split(__file__)[0]
testcaseFilename = os.path.split(__file__)[-1]
os.system("rm -rf %s/%s.sql" % (testcasePath,testcaseFilename))
-
+
now = time.time()
self.ts = int(round(now * 1000))
self.num = 10
self.fornum = 5
# def case_common(self):
- # db = "nested"
- # self.dropandcreateDB("%s" % db, 1)
+ # db = "nested"
+ # self.dropandcreateDB("%s" % db, 1)
# conn1 = taos.connect(host="127.0.0.1", user="root", password="taosdata", config="/etc/taos/")
- # cur1 = conn1.cursor()
+ # cur1 = conn1.cursor()
# cur1.execute('use "%s";' %self.db)
# sql = 'select * from stable_1 limit 5;'
# cur1.execute(sql)
- # return(conn1,cur1)
-
+ # return(conn1,cur1)
+
def data_matrix_equal(self, sql1,row1_s,row1_e,col1_s,col1_e, sql2,row2_s,row2_e,col2_s,col2_e):
# ----row1_start----col1_start----
- # - - - - 是一个矩阵内的数据相等- - -
- # - - - - - - - - - - - - - - - -
+ # - - - - 是一个矩阵内的数据相等- - -
+ # - - - - - - - - - - - - - - - -
# ----row1_end------col1_end------
self.sql1 = sql1
list1 =[]
@@ -67,9 +67,9 @@ class TDTestCase:
#print("data=%s" %(tdSql.getData(i1,j1)))
list1.append(tdSql.getData(i1,j1))
print("=====list1-------list1---=%s" %set(list1))
-
+
tdSql.execute("reset query cache;")
- self.sql2 = sql2
+ self.sql2 = sql2
list2 =[]
tdSql.query(sql2)
for i2 in range(row2_s-1,row2_e):
@@ -78,8 +78,8 @@ class TDTestCase:
#print("jjjj222=%d"%j2)
#print("data=%s" %(tdSql.getData(i2,j2)))
list2.append(tdSql.getData(i2,j2))
- print("=====list2-------list2---=%s" %set(list2))
-
+ print("=====list2-------list2---=%s" %set(list2))
+
if (list1 == list2) and len(list2)>0:
# print(("=====matrix===sql1.list1:'%s',sql2.list2:'%s'") %(list1,list2))
tdLog.info(("===matrix===sql1:'%s' matrix_result = sql2:'%s' matrix_result") %(sql1,sql2))
@@ -105,7 +105,7 @@ class TDTestCase:
print(("=====matrix_error===sql1.list1:'%s',sql2.list2:'%s'") %(list1,list2))
tdLog.info(("sql1:'%s' matrix_result != sql2:'%s' matrix_result") %(sql1,sql2))
return tdSql.checkEqual(list1,list2)
-
+
def restartDnodes(self):
pass
# tdDnodes.stop(1)
@@ -125,7 +125,7 @@ class TDTestCase:
tdSql.execute('''create stable stable_2 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \
tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''')
-
+
tdSql.execute('''create stable stable_null_data (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \
tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''')
@@ -133,35 +133,35 @@ class TDTestCase:
tdSql.execute('''create stable stable_null_childtable (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \
tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''')
-
+
#tdSql.execute('''create table stable_1_1 using stable_1 tags('stable_1_1', '0' , '0' , '0' , '0' , 0 , 'binary1' , 'nchar1' , '0' , '0' ,'0') ;''')
- tdSql.execute('''create table stable_1_1 using stable_1 tags('stable_1_1', '%d' , '%d', '%d' , '%d' , 0 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
- %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
+ tdSql.execute('''create table stable_1_1 using stable_1 tags('stable_1_1', '%d' , '%d', '%d' , '%d' , 0 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
+ %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
tdSql.execute('''create table stable_1_2 using stable_1 tags('stable_1_2', '2147483647' , '9223372036854775807' , '32767' , '127' , 1 , 'binary2' , 'nchar2' , '2' , '22' , \'1999-09-09 09:09:09.090\') ;''')
tdSql.execute('''create table stable_1_3 using stable_1 tags('stable_1_3', '-2147483647' , '-9223372036854775807' , '-32767' , '-127' , false , 'binary3' , 'nchar3nchar3' , '-3.3' , '-33.33' , \'2099-09-09 09:09:09.090\') ;''')
#tdSql.execute('''create table stable_1_4 using stable_1 tags('stable_1_4', '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''')
- tdSql.execute('''create table stable_1_4 using stable_1 tags('stable_1_4', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
- %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
+ tdSql.execute('''create table stable_1_4 using stable_1 tags('stable_1_4', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
+ %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
# tdSql.execute('''create table stable_2_1 using stable_2 tags('stable_2_1' , '0' , '0' , '0' , '0' , 0 , 'binary21' , 'nchar21' , '0' , '0' ,'0') ;''')
# tdSql.execute('''create table stable_2_2 using stable_2 tags('stable_2_2' , '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''')
# tdSql.execute('''create table stable_null_data_1 using stable_null_data tags('stable_null_data_1', '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''')
-
+
tdSql.execute('''create table stable_2_1 using stable_2 tags('stable_2_1' , '0' , '0' , '0' , '0' , 0 , 'binary21' , 'nchar21' , '0' , '0' ,\'2099-09-09 09:09:09.090\') ;''')
- tdSql.execute('''create table stable_2_2 using stable_2 tags('stable_2_2' , '%d' , '%d', '%d' , '%d' , 0 , 'binary2.%s' , 'nchar2.%s' , '%f', '%f' ,'%d') ;'''
- %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
+ tdSql.execute('''create table stable_2_2 using stable_2 tags('stable_2_2' , '%d' , '%d', '%d' , '%d' , 0 , 'binary2.%s' , 'nchar2.%s' , '%f', '%f' ,'%d') ;'''
+ %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
- tdSql.execute('''create table stable_null_data_1 using stable_null_data tags('stable_null_data_1', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
- %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
+ tdSql.execute('''create table stable_null_data_1 using stable_null_data tags('stable_null_data_1', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
+ %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
#regular table
tdSql.execute('''create table regular_table_1 \
@@ -179,50 +179,50 @@ class TDTestCase:
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''')
- for i in range(num_random*n):
- tdSql.execute('''insert into stable_1_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
- % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1),
- fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ for i in range(num_random*n):
+ tdSql.execute('''insert into stable_1_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
+ % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1),
+ fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i))
- tdSql.execute('''insert into regular_table_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
- % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1) ,
- fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1) ,
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ tdSql.execute('''insert into regular_table_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
+ % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1) ,
+ fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1) ,
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i))
- tdSql.execute('''insert into stable_1_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d) ;'''
- % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1),
- fake.random_int(min=0, max=9223372036854775807, step=1),
- fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) ,
+ tdSql.execute('''insert into stable_1_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d) ;'''
+ % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1),
+ fake.random_int(min=0, max=9223372036854775807, step=1),
+ fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) ,
fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i))
- tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d) ;'''
- % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1),
- fake.random_int(min=0, max=9223372036854775807, step=1),
- fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) ,
+ tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d) ;'''
+ % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1),
+ fake.random_int(min=0, max=9223372036854775807, step=1),
+ fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) ,
fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i))
-
- tdSql.execute('''insert into stable_1_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d) ;'''
- % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1),
- fake.random_int(min=-9223372036854775807, max=0, step=1),
- fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
+
+ tdSql.execute('''insert into stable_1_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d) ;'''
+ % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1),
+ fake.random_int(min=-9223372036854775807, max=0, step=1),
+ fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i +1))
- tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d) ;'''
- % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1),
- fake.random_int(min=-9223372036854775807, max=0, step=1),
- fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
+ tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d) ;'''
+ % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1),
+ fake.random_int(min=-9223372036854775807, max=0, step=1),
+ fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i +1))
- tdSql.execute('''insert into stable_2_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
- % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1),
- fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ tdSql.execute('''insert into stable_2_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
+ % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1),
+ fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i))
- # tdSql.execute('''insert into regular_table_3 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d)'''
- # % (ts + i*1000, fake.random_int(min=-2147483647, max=0, step=1),
- # fake.random_int(min=-9223372036854775807, max=0, step=1),
- # fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
+ # tdSql.execute('''insert into regular_table_3 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d)'''
+ # % (ts + i*1000, fake.random_int(min=-2147483647, max=0, step=1),
+ # fake.random_int(min=-9223372036854775807, max=0, step=1),
+ # fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
# fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i))
tdSql.query("select count(*) from stable_1;")
@@ -234,9 +234,9 @@ class TDTestCase:
def run(self):
tdSql.prepare()
os.system("rm -rf nestedQuery3.py.sql")
-
- startTime = time.time()
-
+
+ startTime = time.time()
+
db = "nest"
self.dropandcreateDB_random("%s" %db, 1)
@@ -252,11 +252,11 @@ class TDTestCase:
qt_select= q_select + t_select
# distinct regular column select
- dq_select= ['distinct q_int', 'distinct q_bigint' , 'distinct q_smallint' , 'distinct q_tinyint' ,
+ dq_select= ['distinct q_int', 'distinct q_bigint' , 'distinct q_smallint' , 'distinct q_tinyint' ,
'distinct q_bool' , 'distinct q_binary' , 'distinct q_nchar' ,'distinct q_float' , 'distinct q_double' ,'distinct q_ts ']
# distinct tag column select
- dt_select= ['distinct loc', 'distinct t_int', 'distinct t_bigint' , 'distinct t_smallint' , 'distinct t_tinyint' ,
+ dt_select= ['distinct loc', 'distinct t_int', 'distinct t_bigint' , 'distinct t_smallint' , 'distinct t_tinyint' ,
'distinct t_bool' , 'distinct t_binary' , 'distinct t_nchar' ,'distinct t_float' , 'distinct t_double' ,'distinct t_ts ']
# distinct regular and tag column select
@@ -267,12 +267,12 @@ class TDTestCase:
s_s_select= ['tbname' , '_rowts' , '_c0', '_C0' ]
unionall_or_union= [ ' union ' , ' union all ' ]
- # regular column where
+ # regular column where
q_where = ['ts < now +1s','q_bigint >= -9223372036854775807 and q_bigint <= 9223372036854775807', 'q_int <= 2147483647 and q_int >= -2147483647',
- 'q_smallint >= -32767 and q_smallint <= 32767','q_tinyint >= -127 and q_tinyint <= 127','q_float >= -1.7E308 and q_float <= 1.7E308',
- 'q_double >= -1.7E308 and q_double <= 1.7E308', 'q_binary like \'binary%\' or q_binary = \'0\' ' , 'q_nchar like \'nchar%\' or q_nchar = \'0\' ' ,
+ 'q_smallint >= -32767 and q_smallint <= 32767','q_tinyint >= -127 and q_tinyint <= 127','q_float >= -1.7E308 and q_float <= 1.7E308',
+ 'q_double >= -1.7E308 and q_double <= 1.7E308', 'q_binary like \'binary%\' or q_binary = \'0\' ' , 'q_nchar like \'nchar%\' or q_nchar = \'0\' ' ,
'q_bool = true or q_bool = false' , 'q_bool in (0 , 1)' , 'q_bool in ( true , false)' , 'q_bool = 0 or q_bool = 1',
- 'q_bigint between -9223372036854775807 and 9223372036854775807',' q_int between -2147483647 and 2147483647','q_smallint between -32767 and 32767',
+ 'q_bigint between -9223372036854775807 and 9223372036854775807',' q_int between -2147483647 and 2147483647','q_smallint between -32767 and 32767',
'q_tinyint between -127 and 127 ','q_float >= -3.4E38 ','q_float <= 3.4E38 ','q_double >= -1.7E308 ',
'q_double <= 1.7E308 ','q_float between -3.4E38 and 3.4E38 ','q_double between -1.7E308 and 1.7E308 ' ,
'q_float is not null ' ,'q_double is not null ' ,]
@@ -284,33 +284,33 @@ class TDTestCase:
't1.q_smallint >= -32767 and t1.q_smallint <= 32767 and t2.q_smallint >= -32767 and t2.q_smallint <= 32767',
't1.q_tinyint >= -127 and t1.q_tinyint <= 127 and t2.q_tinyint >= -127 and t2.q_tinyint <= 127',
't1.q_float >= - 1.7E308 and t1.q_float <= 1.7E308 and t2.q_float >= - 1.7E308 and t2.q_float <= 1.7E308',
- 't1.q_double >= - 1.7E308 and t1.q_double <= 1.7E308 and t2.q_double >= - 1.7E308 and t2.q_double <= 1.7E308',
- 't1.q_binary like \'binary%\' and t2.q_binary like \'binary%\' ' ,
- 't1.q_nchar like \'nchar%\' and t2.q_nchar like \'nchar%\' ' ,
- 't1.q_bool in (0 , 1) and t2.q_bool in (0 , 1)' , 't1.q_bool in ( true , false) and t2.q_bool in ( true , false)' ,
+ 't1.q_double >= - 1.7E308 and t1.q_double <= 1.7E308 and t2.q_double >= - 1.7E308 and t2.q_double <= 1.7E308',
+ 't1.q_binary like \'binary%\' and t2.q_binary like \'binary%\' ' ,
+ 't1.q_nchar like \'nchar%\' and t2.q_nchar like \'nchar%\' ' ,
+ 't1.q_bool in (0 , 1) and t2.q_bool in (0 , 1)' , 't1.q_bool in ( true , false) and t2.q_bool in ( true , false)' ,
't1.q_bigint between -9223372036854775807 and 9223372036854775807 and t2.q_bigint between -9223372036854775807 and 9223372036854775807',
't1.q_int between -2147483647 and 2147483647 and t2.q_int between -2147483647 and 2147483647',
- 't1.q_smallint between -32767 and 32767 and t2.q_smallint between -32767 and 32767',
+ 't1.q_smallint between -32767 and 32767 and t2.q_smallint between -32767 and 32767',
't1.q_tinyint between -127 and 127 and t2.q_tinyint between -127 and 127 ','t1.q_float between -1.7E308 and 1.7E308 and t2.q_float between -1.7E308 and 1.7E308',
't1.q_double between -1.7E308 and 1.7E308 and t2.q_double between -1.7E308 and 1.7E308']
#TD-6201 ,'t1.q_bool between 0 and 1 or t2.q_bool between 0 and 1']
#'t1.q_bool = true and t1.q_bool = false and t2.q_bool = true and t2.q_bool = false' , 't1.q_bool = 0 and t1.q_bool = 1 and t2.q_bool = 0 and t2.q_bool = 1' ,
- q_u_or_where = ['(t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' )' ,
- '(t1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' )' , '(t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false)' ,
+ q_u_or_where = ['(t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' )' ,
+ '(t1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' )' , '(t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false)' ,
'(t1.q_bool in (0 , 1) or t2.q_bool in (0 , 1))' , '(t1.q_bool in ( true , false) or t2.q_bool in ( true , false))' , '(t1.q_bool = 0 or t1.q_bool = 1 or t2.q_bool = 0 or t2.q_bool = 1)' ,
'(t1.q_bigint between -9223372036854775807 and 9223372036854775807 or t2.q_bigint between -9223372036854775807 and 9223372036854775807)',
'(t1.q_int between -2147483647 and 2147483647 or t2.q_int between -2147483647 and 2147483647)',
- '(t1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767)',
+ '(t1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767)',
'(t1.q_tinyint between -127 and 127 or t2.q_tinyint between -127 and 127 )','(t1.q_float between -1.7E308 and 1.7E308 or t2.q_float between -1.7E308 and 1.7E308)',
'(t1.q_double between -1.7E308 and 1.7E308 or t2.q_double between -1.7E308 and 1.7E308)']
# tag column where
t_where = ['ts < now +1s','t_bigint >= -9223372036854775807 and t_bigint <= 9223372036854775807','t_int <= 2147483647 and t_int >= -2147483647',
't_smallint >= -32767 and t_smallint <= 32767','q_tinyint >= -127 and t_tinyint <= 127','t_float >= -1.7E308 and t_float <= 1.7E308',
- 't_double >= -1.7E308 and t_double <= 1.7E308', 't_binary like \'binary%\' or t_binary = \'0\' ' , 't_nchar like \'nchar%\' or t_nchar = \'0\'' ,
+ 't_double >= -1.7E308 and t_double <= 1.7E308', 't_binary like \'binary%\' or t_binary = \'0\' ' , 't_nchar like \'nchar%\' or t_nchar = \'0\'' ,
't_bool = true or t_bool = false' , 't_bool in (0 , 1)' , 't_bool in ( true , false)' , 't_bool = 0 or t_bool = 1',
- 't_bigint between -9223372036854775807 and 9223372036854775807',' t_int between -2147483647 and 2147483647','t_smallint between -32767 and 32767',
+ 't_bigint between -9223372036854775807 and 9223372036854775807',' t_int between -2147483647 and 2147483647','t_smallint between -32767 and 32767',
't_tinyint between -127 and 127 ','t_float between -1.7E308 and 1.7E308','t_double between -1.7E308 and 1.7E308']
#TD-6201,'t_bool between 0 and 1'
@@ -320,27 +320,27 @@ class TDTestCase:
't1.t_smallint >= -32767 and t1.t_smallint <= 32767 and t2.t_smallint >= -32767 and t2.t_smallint <= 32767',
't1.t_tinyint >= -127 and t1.t_tinyint <= 127 and t2.t_tinyint >= -127 and t2.t_tinyint <= 127',
't1.t_float >= -1.7E308 and t1.t_float <= 1.7E308 and t2.t_float >= -1.7E308 and t2.t_float <= 1.7E308',
- 't1.t_double >= -1.7E308 and t1.t_double <= 1.7E308 and t2.t_double >= -1.7E308 and t2.t_double <= 1.7E308',
- '(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\') ' ,
- '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' ,
+ 't1.t_double >= -1.7E308 and t1.t_double <= 1.7E308 and t2.t_double >= -1.7E308 and t2.t_double <= 1.7E308',
+ '(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\') ' ,
+ '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' ,
't1.t_bool in (0 , 1) and t2.t_bool in (0 , 1)' , 't1.t_bool in ( true , false) and t2.t_bool in ( true , false)' , '(t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1)',
't1.t_bigint between -9223372036854775807 and 9223372036854775807 and t2.t_bigint between -9223372036854775807 and 9223372036854775807',
't1.t_int between -2147483647 and 2147483647 and t2.t_int between -2147483647 and 2147483647',
- 't1.t_smallint between -32767 and 32767 and t2.t_smallint between -32767 and 32767',
+ 't1.t_smallint between -32767 and 32767 and t2.t_smallint between -32767 and 32767',
'(t1.t_tinyint between -127 and 127 and t2.t_tinyint between -127 and 127) ','t1.t_float between -1.7E308 and 1.7E308 and t2.t_float between -1.7E308 and 1.7E308',
'(t1.t_double between -1.7E308 and 1.7E308 and t2.t_double between -1.7E308 and 1.7E308)']
#TD-6201,'t1.t_bool between 0 and 1 or t2.q_bool between 0 and 1']
- t_u_or_where = ['(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' )' ,
- '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' ,
+ t_u_or_where = ['(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' )' ,
+ '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' ,
'(t1.t_bool in (0 , 1) or t2.t_bool in (0 , 1))' , '(t1.t_bool in ( true , false) or t2.t_bool in ( true , false))' , '(t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1)',
'(t1.t_bigint between -9223372036854775807 and 9223372036854775807 or t2.t_bigint between -9223372036854775807 and 9223372036854775807)',
'(t1.t_int between -2147483647 and 2147483647 or t2.t_int between -2147483647 and 2147483647)',
- '(t1.t_smallint between -32767 and 32767 or t2.t_smallint between -32767 and 32767)',
+ '(t1.t_smallint between -32767 and 32767 or t2.t_smallint between -32767 and 32767)',
'(t1.t_tinyint between -127 and 127 or t2.t_tinyint between -127 and 127 )','(t1.t_float between -1.7E308 and 1.7E308 or t2.t_float between -1.7E308 and 1.7E308)',
'(t1.t_double between -1.7E308 and 1.7E308 or t2.t_double between -1.7E308 and 1.7E308)']
- # regular and tag column where
+ # regular and tag column where
qt_where = q_where + t_where
qt_u_where = q_u_where + t_u_where
# now,qt_u_or_where is not support
@@ -354,78 +354,78 @@ class TDTestCase:
session_where = ['session(ts,10a)' , 'session(ts,10s)', 'session(ts,10m)' , 'session(ts,10h)','session(ts,10d)' , 'session(ts,10w)']
session_u_where = ['session(t1.ts,10a)' , 'session(t1.ts,10s)', 'session(t1.ts,10m)' , 'session(t1.ts,10h)','session(t1.ts,10d)' , 'session(t1.ts,10w)',
'session(t2.ts,10a)' , 'session(t2.ts,10s)', 'session(t2.ts,10m)' , 'session(t2.ts,10h)','session(t2.ts,10d)' , 'session(t2.ts,10w)']
-
+
fill_where = ['FILL(NONE)','FILL(PREV)','FILL(NULL)','FILL(LINEAR)','FILL(NEXT)','FILL(VALUE, 1.23)']
-
+
state_window = ['STATE_WINDOW(q_tinyint)','STATE_WINDOW(q_bigint)','STATE_WINDOW(q_int)','STATE_WINDOW(q_bool)','STATE_WINDOW(q_smallint)']
state_u_window = ['STATE_WINDOW(t1.q_tinyint)','STATE_WINDOW(t1.q_bigint)','STATE_WINDOW(t1.q_int)','STATE_WINDOW(t1.q_bool)','STATE_WINDOW(t1.q_smallint)',
'STATE_WINDOW(t2.q_tinyint)','STATE_WINDOW(t2.q_bigint)','STATE_WINDOW(t2.q_int)','STATE_WINDOW(t2.q_bool)','STATE_WINDOW(t2.q_smallint)']
- # order by where
+ # order by where
order_where = ['order by ts' , 'order by ts asc']
order_u_where = ['order by t1.ts' , 'order by t1.ts asc' , 'order by t2.ts' , 'order by t2.ts asc']
order_desc_where = ['order by ts' , 'order by ts asc' , 'order by ts desc' ]
orders_desc_where = ['order by ts' , 'order by ts asc' , 'order by ts desc' , 'order by loc' , 'order by loc asc' , 'order by loc desc']
-
- group_where = ['group by tbname , loc' , 'group by tbname', 'group by tbname, t_bigint', 'group by tbname,t_int', 'group by tbname, t_smallint', 'group by tbname,t_tinyint',
+
+ group_where = ['group by tbname , loc' , 'group by tbname', 'group by tbname, t_bigint', 'group by tbname,t_int', 'group by tbname, t_smallint', 'group by tbname,t_tinyint',
'group by tbname,t_float', 'group by tbname,t_double' , 'group by tbname,t_binary', 'group by tbname,t_nchar', 'group by tbname,t_bool' ,'group by tbname ,loc ,t_bigint',
'group by tbname,t_binary ,t_nchar ,t_bool' , 'group by tbname,t_int ,t_smallint ,t_tinyint' , 'group by tbname,t_float ,t_double ' ,
- 'PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint',
+ 'PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname,t_float', 'PARTITION BY tbname,t_double' , 'PARTITION BY tbname,t_binary', 'PARTITION BY tbname,t_nchar', 'PARTITION BY tbname,t_bool' ,'PARTITION BY tbname ,loc ,t_bigint',
'PARTITION BY tbname,t_binary ,t_nchar ,t_bool' , 'PARTITION BY tbname,t_int ,t_smallint ,t_tinyint' , 'PARTITION BY tbname,t_float ,t_double ']
- group_where_j = ['group by t1.loc' , 'group by t1.t_bigint', 'group by t1.t_int', 'group by t1.t_smallint', 'group by t1.t_tinyint',
+ group_where_j = ['group by t1.loc' , 'group by t1.t_bigint', 'group by t1.t_int', 'group by t1.t_smallint', 'group by t1.t_tinyint',
'group by t1.t_float', 'group by t1.t_double' , 'group by t1.t_binary', 'group by t1.t_nchar', 'group by t1.t_bool' ,'group by t1.loc ,t1.t_bigint',
'group by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'group by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'group by t1.t_float ,t1.t_double ' ,
- 'PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint',
+ 'PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint',
'PARTITION by t1.t_float', 'PARTITION by t1.t_double' , 'PARTITION by t1.t_binary', 'PARTITION by t1.t_nchar', 'PARTITION by t1.t_bool' ,'PARTITION BY t1.loc ,t1.t_bigint',
'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'PARTITION by t1.t_float ,t1.t_double ',
- 'group by t2.loc' , 'group by t2.t_bigint', 'group by t2.t_int', 'group by t2.t_smallint', 'group by t2.t_tinyint',
+ 'group by t2.loc' , 'group by t2.t_bigint', 'group by t2.t_int', 'group by t2.t_smallint', 'group by t2.t_tinyint',
'group by t2.t_float', 'group by t2.t_double' , 'group by t2.t_binary', 'group by t2.t_nchar', 'group by t2.t_bool' ,'group by t2.loc ,t2.t_bigint',
'group by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'group by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'group by t2.t_float ,t2.t_double ' ,
- 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint',
+ 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint',
'PARTITION by t2.t_float', 'PARTITION by t2.t_double' , 'PARTITION by t2.t_binary', 'PARTITION by t2.t_nchar', 'PARTITION by t2.t_bool' ,'PARTITION BY t2.loc ,t2.t_bigint',
- 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double ']
-
- partiton_where = ['PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint',
+ 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double ']
+
+ partiton_where = ['PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname,t_float', 'PARTITION BY tbname,t_double' , 'PARTITION BY tbname,t_binary', 'PARTITION BY tbname,t_nchar', 'PARTITION BY tbname,t_bool' ,'PARTITION BY tbname ,loc ,t_bigint',
'PARTITION BY tbname,t_binary ,t_nchar ,t_bool' , 'PARTITION BY tbname,t_int ,t_smallint ,t_tinyint' , 'PARTITION BY tbname,t_float ,t_double ']
- partiton_where_j = ['PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint',
+ partiton_where_j = ['PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint',
'PARTITION by t1.t_float', 'PARTITION by t1.t_double' , 'PARTITION by t1.t_binary', 'PARTITION by t1.t_nchar', 'PARTITION by t1.t_bool' ,'PARTITION BY t1.loc ,t1.t_bigint',
'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'PARTITION by t1.t_float ,t1.t_double ',
- 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint',
+ 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint',
'PARTITION by t2.t_float', 'PARTITION by t2.t_double' , 'PARTITION by t2.t_binary', 'PARTITION by t2.t_nchar', 'PARTITION by t2.t_bool' ,'PARTITION BY t2.loc ,t2.t_bigint',
- 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double ']
+ 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double ']
-
- group_where_regular = ['group by tbname ' , 'group by tbname', 'group by tbname, q_bigint', 'group by tbname,q_int', 'group by tbname, q_smallint', 'group by tbname,q_tinyint',
+
+ group_where_regular = ['group by tbname ' , 'group by tbname', 'group by tbname, q_bigint', 'group by tbname,q_int', 'group by tbname, q_smallint', 'group by tbname,q_tinyint',
'group by tbname,q_float', 'group by tbname,q_double' , 'group by tbname,q_binary', 'group by tbname,q_nchar', 'group by tbname,q_bool' ,'group by tbname ,q_bigint',
'group by tbname,q_binary ,q_nchar ,q_bool' , 'group by tbname,q_int ,q_smallint ,q_tinyint' , 'group by tbname,q_float ,q_double ' ,
- 'PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint',
+ 'PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname,q_float', 'PARTITION BY tbname,q_double' , 'PARTITION BY tbname,q_binary', 'PARTITION BY tbname,q_nchar', 'PARTITION BY tbname,q_bool' ,'PARTITION BY tbname ,q_bigint',
'PARTITION BY tbname,q_binary ,q_nchar ,q_bool' , 'PARTITION BY tbname,q_int ,q_smallint ,q_tinyint' , 'PARTITION BY tbname,q_float ,q_double ']
- group_where_regular_j = ['group by t1.q_bigint', 'group by t1.q_int', 'group by t1.q_smallint', 'group by t1.q_tinyint',
+ group_where_regular_j = ['group by t1.q_bigint', 'group by t1.q_int', 'group by t1.q_smallint', 'group by t1.q_tinyint',
'group by t1.q_float', 'group by t1.q_double' , 'group by t1.q_binary', 'group by t1.q_nchar', 'group by t1.q_bool' ,'group by t1.q_bigint',
'group by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'group by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'group by t1.q_float ,t1.q_double ' ,
- 'PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint',
+ 'PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint',
'PARTITION by t1.q_float', 'PARTITION by t1.q_double' , 'PARTITION by t1.q_binary', 'PARTITION by t1.q_nchar', 'PARTITION by t1.q_bool' ,'PARTITION BY t1.q_bigint',
'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'PARTITION by t1.q_float ,t1.q_double ',
- 'group by t2.q_bigint', 'group by t2.q_int', 'group by t2.q_smallint', 'group by t2.q_tinyint',
+ 'group by t2.q_bigint', 'group by t2.q_int', 'group by t2.q_smallint', 'group by t2.q_tinyint',
'group by t2.q_float', 'group by t2.q_double' , 'group by t2.q_binary', 'group by t2.q_nchar', 'group by t2.q_bool' ,'group by t2.q_bigint',
'group by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'group by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'group by t2.q_float ,t2.q_double ' ,
- 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint',
+ 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint',
'PARTITION by t2.q_float', 'PARTITION by t2.q_double' , 'PARTITION by t2.q_binary', 'PARTITION by t2.q_nchar', 'PARTITION by t2.q_bool' ,'PARTITION BY t2.q_bigint',
- 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double ']
-
- partiton_where_regular = ['PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint',
+ 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double ']
+
+ partiton_where_regular = ['PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname,q_float', 'PARTITION BY tbname,q_double' , 'PARTITION BY tbname,q_binary', 'PARTITION BY tbname,q_nchar', 'PARTITION BY tbname,q_bool' ,'PARTITION BY tbname ,q_bigint',
'PARTITION BY tbname,q_binary ,q_nchar ,q_bool' , 'PARTITION BY tbname,q_int ,q_smallint ,q_tinyint' , 'PARTITION BY tbname,q_float ,q_double ']
- partiton_where_regular_j = ['PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint',
+ partiton_where_regular_j = ['PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint',
'PARTITION by t1.q_float', 'PARTITION by t1.q_double' , 'PARTITION by t1.q_binary', 'PARTITION by t1.q_nchar', 'PARTITION by t1.q_bool' ,'PARTITION BY t1.q_bigint',
'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'PARTITION by t1.q_float ,t1.q_double ',
- 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint',
+ 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint',
'PARTITION by t2.q_float', 'PARTITION by t2.q_double' , 'PARTITION by t2.q_binary', 'PARTITION by t2.q_nchar', 'PARTITION by t2.q_bool' ,'PARTITION BY t2.q_bigint',
- 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double ']
-
+ 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double ']
+
having_support = ['having count(q_int) > 0','having count(q_bigint) > 0','having count(q_smallint) > 0','having count(q_tinyint) > 0','having count(q_float) > 0','having count(q_double) > 0','having count(q_bool) > 0',
'having avg(q_int) > 0','having avg(q_bigint) > 0','having avg(q_smallint) > 0','having avg(q_tinyint) > 0','having avg(q_float) > 0','having avg(q_double) > 0',
'having sum(q_int) > 0','having sum(q_bigint) > 0','having sum(q_smallint) > 0','having sum(q_tinyint) > 0','having sum(q_float) > 0','having sum(q_double) > 0',
@@ -440,9 +440,9 @@ class TDTestCase:
having_not_support = ['having TOP(q_int,10) > 0','having TOP(q_bigint,10) > 0','having TOP(q_smallint,10) > 0','having TOP(q_tinyint,10) > 0','having TOP(q_float,10) > 0','having TOP(q_double,10) > 0','having TOP(q_bool,10) > 0',
'having BOTTOM(q_int,10) > 0','having BOTTOM(q_bigint,10) > 0','having BOTTOM(q_smallint,10) > 0','having BOTTOM(q_tinyint,10) > 0','having BOTTOM(q_float,10) > 0','having BOTTOM(q_double,10) > 0','having BOTTOM(q_bool,10) > 0',
'having LEASTSQUARES(q_int) > 0','having LEASTSQUARES(q_bigint) > 0','having LEASTSQUARES(q_smallint) > 0','having LEASTSQUARES(q_tinyint) > 0','having LEASTSQUARES(q_float) > 0','having LEASTSQUARES(q_double) > 0','having LEASTSQUARES(q_bool) > 0',
- 'having FIRST(q_bool) > 0','having IRATE(q_bool) > 0','having PERCENTILE(q_bool,10) > 0','having avg(q_bool) > 0','having LAST_ROW(q_bool) > 0','having sum(q_bool) > 0','having STDDEV(q_bool) > 0','having APERCENTILE(q_bool,10) > 0','having TWA(q_bool) > 0','having LAST(q_bool) > 0',
+ 'having FIRST(q_bool) > 0','having IRATE(q_bool) > 0','having PERCENTILE(q_bool,10) > 0','having avg(q_bool) > 0','having LAST_ROW(q_bool) > 0','having sum(q_bool) > 0','having STDDEV(q_bool) > 0','having APERCENTILE(q_bool,10) > 0','having TWA(q_bool) > 0','having LAST(q_bool) > 0',
'having PERCENTILE(q_int,10) > 0','having PERCENTILE(q_bigint,10) > 0','having PERCENTILE(q_smallint,10) > 0','having PERCENTILE(q_tinyint,10) > 0','having PERCENTILE(q_float,10) > 0','having PERCENTILE(q_double,10) > 0']
- having_tagnot_support = ['having LAST_ROW(q_int) > 0','having LAST_ROW(q_bigint) > 0','having LAST_ROW(q_smallint) > 0','having LAST_ROW(q_tinyint) > 0','having LAST_ROW(q_float) > 0','having LAST_ROW(q_double) > 0']
+ having_tagnot_support = ['having LAST_ROW(q_int) > 0','having LAST_ROW(q_bigint) > 0','having LAST_ROW(q_smallint) > 0','having LAST_ROW(q_tinyint) > 0','having LAST_ROW(q_float) > 0','having LAST_ROW(q_double) > 0']
having_support_j = ['having count(t1.q_int) > 0','having count(t1.q_bigint) > 0','having count(t1.q_smallint) > 0','having count(t1.q_tinyint) > 0','having count(t1.q_float) > 0','having count(t1.q_double) > 0','having count(t1.q_bool) > 0',
'having avg(t1.q_int) > 0','having avg(t1.q_bigint) > 0','having avg(t1.q_smallint) > 0','having avg(t1.q_tinyint) > 0','having avg(t1.q_float) > 0','having avg(t1.q_double) > 0',
@@ -455,7 +455,7 @@ class TDTestCase:
'having FIRST(t1.q_int) > 0','having FIRST(t1.q_bigint) > 0','having FIRST(t1.q_smallint) > 0','having FIRST(t1.q_tinyint) > 0','having FIRST(t1.q_float) > 0','having FIRST(t1.q_double) > 0',
'having LAST(t1.q_int) > 0','having LAST(t1.q_bigint) > 0','having LAST(t1.q_smallint) > 0','having LAST(t1.q_tinyint) > 0','having LAST(t1.q_float) > 0','having LAST(t1.q_double) > 0',
'having APERCENTILE(t1.q_int,10) > 0','having APERCENTILE(t1.q_bigint,10) > 0','having APERCENTILE(t1.q_smallint,10) > 0','having APERCENTILE(t1.q_tinyint,10) > 0','having APERCENTILE(t1.q_float,10) > 0','having APERCENTILE(t1.q_double,10) > 0']
-
+
# limit offset where
limit_where = ['limit 1 offset 1' , 'limit 1' , 'limit 2 offset 1' , 'limit 2', 'limit 12 offset 1' , 'limit 20', 'limit 20 offset 10' , 'limit 200']
limit1_where = ['limit 1 offset 1' , 'limit 1' ]
@@ -464,8 +464,8 @@ class TDTestCase:
# slimit soffset where
slimit_where = ['slimit 1 soffset 1' , 'slimit 1' , 'slimit 2 soffset 1' , 'slimit 2']
slimit1_where = ['slimit 2 soffset 1' , 'slimit 1' ]
-
- # aggregate function include [all:count(*)\avg\sum\stddev ||regualr:twa\irate\leastsquares ||group by tbname:twa\irate\]
+
+ # aggregate function include [all:count(*)\avg\sum\stddev ||regualr:twa\irate\leastsquares ||group by tbname:twa\irate\]
# select function include [all: min\max\first(*)\last(*)\top\bottom\apercentile\last_row(*)(not with interval)\interp(*)(FILL) ||regualr: percentile]
# calculation function include [all:spread\+-*/ ||regualr:diff\derivative ||group by tbname:diff\derivative\]
# **_ns_** express is not support stable, therefore, separated from regular tables
@@ -475,7 +475,7 @@ class TDTestCase:
# calc_select_all calc_select_regular calc_select_in_ts calc_select_fill calc_select_not_interval
# select function include [all: min\max\first(*)\last(*)\top\bottom\apercentile\last_row(*)(not with interval)\interp(*)(FILL) ||regualr: percentile]
-
+
calc_select_all = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' ,
'top(q_int,20)' , 'top(q_bigint,20)' , 'top(q_smallint,20)' ,'top(q_tinyint,20)' ,'top(q_float,20)' ,'top(q_double,20)' ,
'first(q_int)' , 'first(q_bigint)' , 'first(q_smallint)' , 'first(q_tinyint)' , 'first(q_float)' ,'first(q_double)' ,'first(q_binary)' ,'first(q_nchar)' ,'first(q_bool)' ,'first(q_ts)' ,
@@ -483,7 +483,7 @@ class TDTestCase:
'min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' ,
'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' ,
'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)' ,
- 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
+ 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)']
calc_select_in_ts = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' ,
@@ -494,23 +494,23 @@ class TDTestCase:
calc_select_in = ['min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' ,
'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' ,
'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)' ,
- 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
+ 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)']
-
+
calc_select_not_support_ts = ['first(q_int)' , 'first(q_bigint)' , 'first(q_smallint)' , 'first(q_tinyint)' , 'first(q_float)' ,'first(q_double)' ,'first(q_binary)' ,'first(q_nchar)' ,'first(q_bool)' ,'first(q_ts)' ,
'last(q_int)' , 'last(q_bigint)' , 'last(q_smallint)' , 'last(q_tinyint)' , 'last(q_float)' ,'last(q_double)' , 'last(q_binary)' ,'last(q_nchar)' ,'last(q_bool)' ,'last(q_ts)' ,
- 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
+ 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)',
- 'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)']
-
+ 'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)']
+
calc_select_support_ts = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' ,
'top(q_int,20)' , 'top(q_bigint,20)' , 'top(q_smallint,20)' ,'top(q_tinyint,20)' ,'top(q_float,20)' ,'top(q_double,20)' ,
'min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' ,
'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' ]
-
+
calc_select_regular = [ 'PERCENTILE(q_int,10)' ,'PERCENTILE(q_bigint,20)' , 'PERCENTILE(q_smallint,30)' ,'PERCENTILE(q_tinyint,40)' ,'PERCENTILE(q_float,50)' ,'PERCENTILE(q_double,60)']
-
+
calc_select_fill = ['INTERP(q_int)' ,'INTERP(q_bigint)' ,'INTERP(q_smallint)' ,'INTERP(q_tinyint)', 'INTERP(q_float)' ,'INTERP(q_double)']
interp_where = ['ts = now' , 'ts = \'2020-09-13 20:26:40.000\'' , 'ts = \'2020-09-13 20:26:40.009\'' ,'tbname in (\'table_1\') and ts = now' ,'tbname in (\'table_0\' ,\'table_1\',\'table_2\',\'table_3\',\'table_4\',\'table_5\') and ts = \'2020-09-13 20:26:40.000\'','tbname like \'table%\' and ts = \'2020-09-13 20:26:40.002\'']
@@ -535,28 +535,28 @@ class TDTestCase:
]
calc_select_in_not_support_ts_j = ['apercentile(t1.q_int,20)' , 'apercentile(t1.q_bigint,20)' ,'apercentile(t1.q_smallint,20)' ,'apercentile(t1.q_tinyint,20)' ,'apercentile(t1.q_float,20)' ,'apercentile(t1.q_double,20)' ,
- 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' ,
+ 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' ,
'last_row(t1.q_double)' , 'last_row(t1.q_bool)' ,'last_row(t1.q_binary)' ,'last_row(t1.q_nchar)' ,'last_row(t1.q_ts)' ,
'apercentile(t2.q_int,20)' , 'apercentile(t2.q_bigint,20)' ,'apercentile(t2.q_smallint,20)' ,'apercentile(t2.q_tinyint,20)' ,'apercentile(t2.q_float,20)' ,'apercentile(t2.q_double,20)' ,
- 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' ,
+ 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' ,
'last_row(t2.q_double)' , 'last_row(t2.q_bool)' ,'last_row(t2.q_binary)' ,'last_row(t2.q_nchar)' ,'last_row(t2.q_ts)']
calc_select_in_j = ['min(t1.q_int)' , 'min(t1.q_bigint)' , 'min(t1.q_smallint)' , 'min(t1.q_tinyint)' , 'min(t1.q_float)' ,'min(t1.q_double)' ,
'max(t1.q_int)' , 'max(t1.q_bigint)' , 'max(t1.q_smallint)' , 'max(t1.q_tinyint)' ,'max(t1.q_float)' ,'max(t1.q_double)' ,
'apercentile(t1.q_int,20)' , 'apercentile(t1.q_bigint,20)' ,'apercentile(t1.q_smallint,20)' ,'apercentile(t1.q_tinyint,20)' ,'apercentile(t1.q_float,20)' ,'apercentile(t1.q_double,20)' ,
- 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' ,
+ 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' ,
'last_row(t1.q_double)' , 'last_row(t1.q_bool)' ,'last_row(t1.q_binary)' ,'last_row(t1.q_nchar)' ,'last_row(t1.q_ts)' ,
'min(t2.q_int)' , 'min(t2.q_bigint)' , 'min(t2.q_smallint)' , 'min(t2.q_tinyint)' , 'min(t2.q_float)' ,'min(t2.q_double)' ,
'max(t2.q_int)' , 'max(t2.q_bigint)' , 'max(t2.q_smallint)' , 'max(t2.q_tinyint)' ,'max(t2.q_float)' ,'max(t2.q_double)' ,
'apercentile(t2.q_int,20)' , 'apercentile(t2.q_bigint,20)' ,'apercentile(t2.q_smallint,20)' ,'apercentile(t2.q_tinyint,20)' ,'apercentile(t2.q_float,20)' ,'apercentile(t2.q_double,20)' ,
- 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' ,
- 'last_row(t2.q_double)' , 'last_row(t2.q_bool)' ,'last_row(t2.q_binary)' ,'last_row(t2.q_nchar)' ,'last_row(t2.q_ts)']
+ 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' ,
+ 'last_row(t2.q_double)' , 'last_row(t2.q_bool)' ,'last_row(t2.q_binary)' ,'last_row(t2.q_nchar)' ,'last_row(t2.q_ts)']
calc_select_all_j = calc_select_in_ts_j + calc_select_in_j
calc_select_regular_j = [ 'PERCENTILE(t1.q_int,10)' ,'PERCENTILE(t1.q_bigint,20)' , 'PERCENTILE(t1.q_smallint,30)' ,'PERCENTILE(t1.q_tinyint,40)' ,'PERCENTILE(t1.q_float,50)' ,'PERCENTILE(t1.q_double,60)' ,
'PERCENTILE(t2.q_int,10)' ,'PERCENTILE(t2.q_bigint,20)' , 'PERCENTILE(t2.q_smallint,30)' ,'PERCENTILE(t2.q_tinyint,40)' ,'PERCENTILE(t2.q_float,50)' ,'PERCENTILE(t2.q_double,60)']
-
+
calc_select_fill_j = ['INTERP(t1.q_int)' ,'INTERP(t1.q_bigint)' ,'INTERP(t1.q_smallint)' ,'INTERP(t1.q_tinyint)', 'INTERP(t1.q_float)' ,'INTERP(t1.q_double)' ,
'INTERP(t2.q_int)' ,'INTERP(t2.q_bigint)' ,'INTERP(t2.q_smallint)' ,'INTERP(t2.q_tinyint)', 'INTERP(t2.q_float)' ,'INTERP(t2.q_double)']
interp_where_j = ['t1.ts = now' , 't1.ts = \'2020-09-13 20:26:40.000\'' , 't1.ts = \'2020-09-13 20:26:40.009\'' ,'t2.ts = now' , 't2.ts = \'2020-09-13 20:26:40.000\'' , 't2.ts = \'2020-09-13 20:26:40.009\'' ,
@@ -578,7 +578,7 @@ class TDTestCase:
'PERCENTILE(q_int,10)' ,'PERCENTILE(q_bigint,20)' , 'PERCENTILE(q_smallint,30)' ,'PERCENTILE(q_tinyint,40)' ,'PERCENTILE(q_float,50)' ,'PERCENTILE(q_double,60)']
calc_aggregate_groupbytbname = ['twa(q_int)' ,'twa(q_bigint)' , 'twa(q_smallint)' ,'twa(q_tinyint)' ,'twa (q_float)' ,'twa(q_double)' ,
- 'IRATE(q_int)' ,'IRATE(q_bigint)' , 'IRATE(q_smallint)' ,'IRATE(q_tinyint)' ,'IRATE (q_float)' ,'IRATE(q_double)' ]
+ 'IRATE(q_int)' ,'IRATE(q_bigint)' , 'IRATE(q_smallint)' ,'IRATE(q_tinyint)' ,'IRATE (q_float)' ,'IRATE(q_double)' ]
#two table join
calc_aggregate_all_j = ['count(t1.*)' , 'count(t1.q_int)' ,'count(t1.q_bigint)' , 'count(t1.q_smallint)' ,'count(t1.q_tinyint)' ,'count(t1.q_float)' ,
@@ -606,18 +606,18 @@ class TDTestCase:
calc_aggregate_groupbytbname_j = ['twa(t1.q_int)' ,'twa(t1.q_bigint)' , 'twa(t1.q_smallint)' ,'twa(t1.q_tinyint)' ,'twa (t1.q_float)' ,'twa(t1.q_double)' ,
'IRATE(t1.q_int)' ,'IRATE(t1.q_bigint)' , 'IRATE(t1.q_smallint)' ,'IRATE(t1.q_tinyint)' ,'IRATE (t1.q_float)' ,'IRATE(t1.q_double)' ,
'twa(t2.q_int)' ,'twa(t2.q_bigint)' , 'twa(t2.q_smallint)' ,'twa(t2.q_tinyint)' ,'twa (t2.q_float)' ,'twa(t2.q_double)' ,
- 'IRATE(t2.q_int)' ,'IRATE(t2.q_bigint)' , 'IRATE(t2.q_smallint)' ,'IRATE(t2.q_tinyint)' ,'IRATE (t2.q_float)' ,'IRATE(t2.q_double)' ]
-
+ 'IRATE(t2.q_int)' ,'IRATE(t2.q_bigint)' , 'IRATE(t2.q_smallint)' ,'IRATE(t2.q_tinyint)' ,'IRATE (t2.q_float)' ,'IRATE(t2.q_double)' ]
+
# calc_calculate_all calc_calculate_regular calc_calculate_groupbytbname
# calculation function include [all:spread\+-*/ ||regualr:diff\derivative ||group by tbname:diff\derivative\]
- calc_calculate_all = ['SPREAD(ts)' , 'SPREAD(q_ts)' , 'SPREAD(q_int)' ,'SPREAD(q_bigint)' , 'SPREAD(q_smallint)' ,'SPREAD(q_tinyint)' ,'SPREAD(q_float)' ,'SPREAD(q_double)' ,
+ calc_calculate_all = ['SPREAD(ts)' , 'SPREAD(q_ts)' , 'SPREAD(q_int)' ,'SPREAD(q_bigint)' , 'SPREAD(q_smallint)' ,'SPREAD(q_tinyint)' ,'SPREAD(q_float)' ,'SPREAD(q_double)' ,
'(SPREAD(q_int) + SPREAD(q_bigint))' , '(SPREAD(q_smallint) - SPREAD(q_float))', '(SPREAD(q_double) * SPREAD(q_tinyint))' , '(SPREAD(q_double) / SPREAD(q_float))']
calc_calculate_regular = ['DIFF(q_int)' ,'DIFF(q_bigint)' , 'DIFF(q_smallint)' ,'DIFF(q_tinyint)' ,'DIFF(q_float)' ,'DIFF(q_double)' ,
'DIFF(q_int,0)' ,'DIFF(q_bigint,0)' , 'DIFF(q_smallint,0)' ,'DIFF(q_tinyint,0)' ,'DIFF(q_float,0)' ,'DIFF(q_double,0)' ,
'DIFF(q_int,1)' ,'DIFF(q_bigint,1)' , 'DIFF(q_smallint,1)' ,'DIFF(q_tinyint,1)' ,'DIFF(q_float,1)' ,'DIFF(q_double,1)' ,
'DERIVATIVE(q_int,15s,0)' , 'DERIVATIVE(q_bigint,10s,1)' , 'DERIVATIVE(q_smallint,20s,0)' ,'DERIVATIVE(q_tinyint,10s,1)' ,'DERIVATIVE(q_float,6s,0)' ,'DERIVATIVE(q_double,3s,1)' ]
calc_calculate_groupbytbname = calc_calculate_regular
-
+
#two table join
calc_calculate_all_j = ['SPREAD(t1.ts)' , 'SPREAD(t1.q_ts)' , 'SPREAD(t1.q_int)' ,'SPREAD(t1.q_bigint)' , 'SPREAD(t1.q_smallint)' ,'SPREAD(t1.q_tinyint)' ,'SPREAD(t1.q_float)' ,'SPREAD(t1.q_double)' ,
'SPREAD(t2.ts)' , 'SPREAD(t2.q_ts)' , 'SPREAD(t2.q_int)' ,'SPREAD(t2.q_bigint)' , 'SPREAD(t2.q_smallint)' ,'SPREAD(t2.q_tinyint)' ,'SPREAD(t2.q_float)' ,'SPREAD(t2.q_double)' ,
@@ -646,17 +646,17 @@ class TDTestCase:
#sql = "select ts , * from ( select " ===暂时不支持select * ,用下面这一行
sql = "select ts from ( select "
sql += "%s, " % random.choice(s_s_select)
- sql += "%s, " % random.choice(q_select)
+ sql += "%s, " % random.choice(q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
-
- #1 outer union not support
+
+ #1 outer union not support
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 1-2 from stable_1;")
for i in range(self.fornum):
@@ -677,11 +677,11 @@ class TDTestCase:
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
-
+
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 1-2 from stable_1;")
for i in range(self.fornum):
@@ -702,11 +702,11 @@ class TDTestCase:
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(200)
-
+
#1 inter union not support
tdSql.query("select 1-3 from stable_1;")
for i in range(self.fornum):
@@ -716,7 +716,7 @@ class TDTestCase:
sql += "%s, " % random.choice(q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(q_where)
- sql += ""
+ sql += ""
sql += " union select "
sql += "%s, " % random.choice(s_r_select)
sql += "%s, " % random.choice(q_select)
@@ -724,8 +724,8 @@ class TDTestCase:
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15606 tdSql.query(sql)
# tdSql.checkRows(200)
tdSql.query("select 1-3 from stable_1;")
@@ -743,60 +743,60 @@ class TDTestCase:
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15607 tdSql.query(sql)
# tdSql.checkRows(300)
-
- #join:TD-6020\TD-6149 select * from (select column form regular_table1,regular_table2 where t1.ts=t2.ts and <\>\in\and\or order by)
+
+ #join:TD-6020\TD-6149 select * from (select column form regular_table1,regular_table2 where t1.ts=t2.ts and <\>\in\and\or order by)
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 1-4 from stable_1;")
for i in range(self.fornum):
#sql = "select ts , * from ( select t1.ts ,"
sql = "select * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
tdSql.query("select 1-5 from stable_1;")
for i in range(self.fornum):
sql = "select ts , * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
sql += "%s " % random.choice(order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.error(sql)
# TD-15587 tdSql.query(sql)
# tdSql.checkRows(100)
- #2 select column from (select * form regular_table ) where <\>\in\and\or order by
+ #2 select column from (select * form regular_table ) where <\>\in\and\or order by
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 2-1 from stable_1;")
for i in range(self.fornum):
sql = "select ts ,"
sql += "%s, " % random.choice(s_r_select)
- sql += "%s " % random.choice(q_select)
+ sql += "%s " % random.choice(q_select)
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
@@ -805,31 +805,31 @@ class TDTestCase:
tdSql.query("select 2-2 from stable_1;")
for i in range(self.fornum):
sql = "select ts , * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 ) where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(order_u_where)
#sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.error(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.error(sql)
- #3 select * from (select column\tag form stable where <\>\in\and\or order by )
+ #3 select * from (select column\tag form stable where <\>\in\and\or order by )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 3-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
sql += "%s, " % random.choice(s_s_select)
- sql += "%s, " % random.choice(q_select)
- sql += "%s, " % random.choice(t_select)
+ sql += "%s, " % random.choice(q_select)
+ sql += "%s, " % random.choice(t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
@@ -839,35 +839,35 @@ class TDTestCase:
sql += "%s " % random.choice(s_r_select)
sql += "from ( select "
sql += "%s, " % random.choice(s_s_select)
- sql += "%s, " % random.choice(q_select)
- sql += "%s, " % random.choice(t_select)
+ sql += "%s, " % random.choice(q_select)
+ sql += "%s, " % random.choice(t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
- # select ts,* from (select column\tag form stable1,stable2 where t1.ts = t2.ts and <\>\in\and\or order by )
+ # select ts,* from (select column\tag form stable1,stable2 where t1.ts = t2.ts and <\>\in\and\or order by )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 3-2 from stable_1;")
for i in range(self.fornum):
sql = "select ts , * from ( select t1.ts , "
- sql += "t1.%s, " % random.choice(s_s_select)
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(s_s_select)
- sql += "t2.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(s_s_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(s_s_select)
+ sql += "t2.%s, " % random.choice(q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "%s " % random.choice(order_u_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# TD-15609 tdSql.query(sql)
# tdSql.checkRows(100)
-
+
#3 outer union not support
rsDn = self.restartDnodes()
tdSql.query("select 3-3 from stable_1;")
@@ -887,8 +887,8 @@ class TDTestCase:
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(200)
for i in range(self.fornum):
@@ -907,11 +907,11 @@ class TDTestCase:
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(400)
-
+
#3 inter union not support
tdSql.query("select 3-4 from stable_1;")
for i in range(self.fornum):
@@ -929,57 +929,57 @@ class TDTestCase:
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.error(sql)
#join:select * from (select column form stable1,stable2 where t1.ts=t2.ts and <\>\in\and\or order by)
tdSql.query("select 3-5 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_u_where)
sql += "%s " % random.choice(order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# TD-15609 tdSql.query(sql)
# tdSql.checkRows(100)
tdSql.query("select 3-6 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t1.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
- sql += "t2.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t1.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
+ sql += "t2.%s, " % random.choice(q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_u_or_where)
sql += "%s " % random.choice(order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# TD-15609 同上 tdSql.query(sql)
# tdSql.checkRows(100)
- #4 select column from (select * form stable where <\>\in\and\or order by )
+ #4 select column from (select * form stable where <\>\in\and\or order by )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 4-1 from stable_1;")
for i in range(self.fornum):
sql = "select ts , "
sql += "%s, " % random.choice(s_r_select)
- sql += "%s, " % random.choice(q_select)
- sql += "%s " % random.choice(t_select)
+ sql += "%s, " % random.choice(q_select)
+ sql += "%s " % random.choice(t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15616 tdSql.query(sql)
# tdSql.checkRows(300)
@@ -992,8 +992,8 @@ class TDTestCase:
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15500 tdSql.query(sql)
#5-1 select distinct column\tag from (select calc form stable where <\>\in\and\or order by limit offset )
@@ -1001,13 +1001,13 @@ class TDTestCase:
for i in range(self.fornum):
sql = "select distinct c5_1 "
sql += " from ( select "
- sql += "%s " % random.choice(calc_select_in_ts)
+ sql += "%s " % random.choice(calc_select_in_ts)
sql += " as c5_1 from stable_1 where "
sql += "%s " % random.choice(qt_where)
#sql += "%s " % random.choice(order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
#tdSql.checkRows(1)有的函数还没有提交,会不返回结果,先忽略
@@ -1020,8 +1020,8 @@ class TDTestCase:
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(order_desc_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.error(sql)
tdSql.query("select 6-1 from stable_1;")
for i in range(self.fornum):
@@ -1029,8 +1029,8 @@ class TDTestCase:
sql += "%s " % random.choice(dt_select)
sql += " from stable_1 where "
sql += "%s ) ;" % random.choice(qt_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
#tdSql.checkRows(1)#数量不一致,不在校验
@@ -1044,8 +1044,8 @@ class TDTestCase:
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice([limit_where[0] , limit_where[1]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.error(sql) #distinct 和 order by 不能混合使用
tdSql.query("select 7-1 from stable_1;")
for i in range(self.fornum):
@@ -1056,166 +1056,166 @@ class TDTestCase:
#sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice([limit_where[0] , limit_where[1]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(1)
#calc_select,TWA/Diff/Derivative/Irate are not allowed to apply to super table directly
#8 select * from (select ts,calc form ragular_table where <\>\in\and\or order by )
-
+
# dcDB = self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 8-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select ts ,"
- sql += "%s " % random.choice(calc_select_support_ts)
+ sql += "%s " % random.choice(calc_select_support_ts)
sql += "from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql) # 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql) # 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
tdSql.query("select 8-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_select_not_support_ts)
+ sql += "%s " % random.choice(calc_select_not_support_ts)
sql += "from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- #TD-15651 tdSql.query(sql) # 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
-
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ #TD-15651 tdSql.query(sql) # 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
+
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_select_in_ts)
+ sql += "%s " % random.choice(calc_select_in_ts)
sql += "from regular_table_1 where "
sql += "%s " % random.choice(q_where)
#sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
##top返回结果有问题nest.sql tdSql.checkRows(1)
tdSql.query("select 8-2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select t1.ts, "
- sql += "%s " % random.choice(calc_select_in_support_ts_j)
+ sql += "%s " % random.choice(calc_select_in_support_ts_j)
sql += "from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)# 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)# 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_select_in_not_support_ts_j)
+ sql += "%s " % random.choice(calc_select_in_not_support_ts_j)
sql += "from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- #TD-15651 tdSql.query(sql)
- ##top返回结果有问题 tdSql.checkRows(1)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ #TD-15651 tdSql.query(sql)
+ ##top返回结果有问题 tdSql.checkRows(1)
- #9 select * from (select ts,calc form stable where <\>\in\and\or order by )
+ #9 select * from (select ts,calc form stable where <\>\in\and\or order by )
# self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 9-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_select_not_support_ts)
+ sql += "%s " % random.choice(calc_select_not_support_ts)
sql += "from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
tdSql.query("select 9-2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select ts ,"
- sql += "%s " % random.choice(calc_select_support_ts)
+ sql += "%s " % random.choice(calc_select_support_ts)
sql += "from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
-
+
tdSql.query("select 9-3 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_select_in_not_support_ts_j)
+ sql += "%s " % random.choice(calc_select_in_not_support_ts_j)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += " and %s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
tdSql.query("select 9-4 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select t1.ts,"
- sql += "%s " % random.choice(calc_select_in_support_ts_j)
+ sql += "%s " % random.choice(calc_select_in_support_ts_j)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += " and %s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
-
- #10 select calc from (select * form regualr_table where <\>\in\and\or order by )
+
+ #10 select calc from (select * form regualr_table where <\>\in\and\or order by )
tdSql.query("select 10-1 from stable_1;")
for i in range(self.fornum):
- sql = "select "
- sql += "%s " % random.choice(calc_select_in_ts)
+ sql = "select "
+ sql += "%s " % random.choice(calc_select_in_ts)
sql += "as calc10_1 from ( select * from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(1)
-
+
#10-1 select calc from (select * form regualr_table where <\>\in\and\or order by )
- # rsDn = self.restartDnodes()
+ # rsDn = self.restartDnodes()
# self.dropandcreateDB_random("%s" %db, 1)
# rsDn = self.restartDnodes()
tdSql.query("select 10-2 from stable_1;")
for i in range(self.fornum):
- sql = "select "
- sql += "%s " % random.choice(calc_select_all)
+ sql = "select "
+ sql += "%s " % random.choice(calc_select_all)
sql += "as calc10_2 from ( select * from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
# tdSql.checkRows(1)
- #10-2 select calc from (select * form regualr_tables where <\>\in\and\or order by )
+ #10-2 select calc from (select * form regualr_tables where <\>\in\and\or order by )
tdSql.query("select 10-3 from stable_1;")
for i in range(self.fornum):
- sql = "select "
- sql += "%s as calc10_3 " % random.choice(calc_select_all)
+ sql = "select "
+ sql += "%s as calc10_3 " % random.choice(calc_select_all)
sql += " from ( select * from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += " and %s " % random.choice(q_u_or_where)
@@ -1223,14 +1223,14 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
tdSql.query("select 10-4 from stable_1;")
for i in range(self.fornum):
- sql = "select "
- sql += "%s as calc10_4 " % random.choice(calc_select_all)
+ sql = "select "
+ sql += "%s as calc10_4 " % random.choice(calc_select_all)
sql += " from ( select * from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
sql += " and %s " % random.choice(q_u_or_where)
@@ -1238,112 +1238,112 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
# tdSql.checkRows(1)
- #11 select calc from (select * form stable where <\>\in\and\or order by limit )
+ #11 select calc from (select * form stable where <\>\in\and\or order by limit )
tdSql.query("select 11-1 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_select_in_ts)
+ sql += "%s " % random.choice(calc_select_in_ts)
sql += "as calc11_1 from ( select * from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(1)
- #11-1 select calc from (select * form stable where <\>\in\and\or order by limit )
+ #11-1 select calc from (select * form stable where <\>\in\and\or order by limit )
tdSql.query("select 11-2 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_select_all)
+ sql += "%s " % random.choice(calc_select_all)
sql += "as calc11_1 from ( select * from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice(limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
#不好计算结果 tdSql.checkRows(1)
-
+
#11-2 select calc from (select * form stables where <\>\in\and\or order by limit )
tdSql.query("select 11-3 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_select_all)
+ sql += "%s " % random.choice(calc_select_all)
sql += "as calc11_1 from ( select * from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
tdSql.query("select 11-4 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_select_all)
+ sql += "%s " % random.choice(calc_select_all)
sql += "as calc11_1 from ( select * from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
- #12 select calc-diff from (select * form regualr_table where <\>\in\and\or order by limit )
+ #12 select calc-diff from (select * form regualr_table where <\>\in\and\or order by limit )
##self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 12-1 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_calculate_regular)
+ sql += "%s " % random.choice(calc_calculate_regular)
sql += " from ( select * from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice([limit_where[2] , limit_where[3]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
##目前derivative不支持 tdSql.query(sql)
# tdSql.checkRows(1)
tdSql.query("select 12-2 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_calculate_regular)
+ sql += "%s " % random.choice(calc_calculate_regular)
sql += " from ( select * from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice([limit_where[2] , limit_where[3]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#目前derivative不支持 tdSql.query(sql)
# tdSql.checkRows(1)
tdSql.query("select 12-2.2 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_calculate_regular)
+ sql += "%s " % random.choice(calc_calculate_regular)
sql += " from ( select * from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice([limit_where[2] , limit_where[3]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#目前derivative不支持 tdSql.query(sql)
#12-1 select calc-diff from (select * form stable where <\>\in\and\or order by limit )
@@ -1351,7 +1351,7 @@ class TDTestCase:
rsDn = self.restartDnodes()
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_calculate_regular)
+ sql += "%s " % random.choice(calc_calculate_regular)
sql += " from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(group_where)
@@ -1359,15 +1359,15 @@ class TDTestCase:
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice([limit_where[2] , limit_where[3]] )
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#目前derivative不支持 tdSql.query(sql)
tdSql.query("select 12-4 from stable_1;")
#join query does not support group by
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_calculate_regular_j)
+ sql += "%s " % random.choice(calc_calculate_regular_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "%s " % random.choice(group_where_j)
@@ -1375,15 +1375,15 @@ class TDTestCase:
#sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice([limit_where[2] , limit_where[3]] )
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) 目前de函数不支持,另外看看需要不需要将group by和pari by分开
tdSql.query("select 12-5 from stable_1;")
#join query does not support group by
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_calculate_regular_j)
+ sql += "%s " % random.choice(calc_calculate_regular_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(group_where_j)
@@ -1391,41 +1391,41 @@ class TDTestCase:
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice([limit_where[2] , limit_where[3]] )
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#derivative not support tdSql.query(sql)
-
+
#13 select calc-diff as diffns from (select * form stable where <\>\in\and\or order by limit )
tdSql.query("select 13-1 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_calculate_regular)
+ sql += "%s " % random.choice(calc_calculate_regular)
sql += " as calc13_1 from ( select * from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(orders_desc_where)
sql += "%s " % random.choice([limit_where[2] , limit_where[3]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#derivative not support tdSql.query(sql)
#14 select * from (select calc_aggregate_alls as agg from stable where <\>\in\and\or group by order by slimit soffset )
- # TD-5955 select * from ( select count (q_double) from stable_1 where t_bool = true or t_bool = false group by loc order by ts asc slimit 1 ) ;
+ # TD-5955 select * from ( select count (q_double) from stable_1 where t_bool = true or t_bool = false group by loc order by ts asc slimit 1 ) ;
tdSql.query("select 14-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc14_1, " % random.choice(calc_aggregate_all)
- sql += "%s as calc14_2, " % random.choice(calc_aggregate_all)
- sql += "%s " % random.choice(calc_aggregate_all)
+ sql += "%s as calc14_1, " % random.choice(calc_aggregate_all)
+ sql += "%s as calc14_2, " % random.choice(calc_aggregate_all)
+ sql += "%s " % random.choice(calc_aggregate_all)
sql += " as calc14_3 from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(group_where)
sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice(slimit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15678 tdSql.query(sql)
# tdSql.checkRows(1)
@@ -1433,9 +1433,9 @@ class TDTestCase:
tdSql.query("select 14-2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc14_1, " % random.choice(calc_aggregate_all)
- sql += "%s as calc14_2, " % random.choice(calc_aggregate_all)
- sql += "%s " % random.choice(calc_aggregate_all)
+ sql += "%s as calc14_1, " % random.choice(calc_aggregate_all)
+ sql += "%s as calc14_2, " % random.choice(calc_aggregate_all)
+ sql += "%s " % random.choice(calc_aggregate_all)
sql += " as calc14_3 from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(group_where)
@@ -1444,310 +1444,310 @@ class TDTestCase:
sql += "%s " % random.choice(slimit1_where)
sql += ") "
sql += "%s " % random.choice(group_where)
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
#TD-15678 tdSql.query(sql)
- # tdSql.checkRows(1)
+ # tdSql.checkRows(1)
#14-2 select * from (select calc_aggregate_all_js as agg from stables where <\>\in\and\or group by order by slimit soffset )
tdSql.query("select 14-3 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc14_1, " % random.choice(calc_aggregate_all_j)
- sql += "%s as calc14_2, " % random.choice(calc_aggregate_all_j)
- sql += "%s " % random.choice(calc_aggregate_all_j)
+ sql += "%s as calc14_1, " % random.choice(calc_aggregate_all_j)
+ sql += "%s as calc14_2, " % random.choice(calc_aggregate_all_j)
+ sql += "%s " % random.choice(calc_aggregate_all_j)
sql += " as calc14_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "%s " % random.choice(partiton_where_j)
sql += "%s " % random.choice(slimit1_where)
sql += ") "
sql += "%s ;" % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 14-4 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc14_1, " % random.choice(calc_aggregate_all_j)
- sql += "%s as calc14_2, " % random.choice(calc_aggregate_all_j)
- sql += "%s " % random.choice(calc_aggregate_all_j)
+ sql += "%s as calc14_1, " % random.choice(calc_aggregate_all_j)
+ sql += "%s as calc14_2, " % random.choice(calc_aggregate_all_j)
+ sql += "%s " % random.choice(calc_aggregate_all_j)
sql += " as calc14_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(partiton_where_j)
sql += "%s " % random.choice(slimit1_where)
sql += ") "
sql += "%s ;" % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
#15 TD-6320 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by slimit soffset )
tdSql.query("select 15-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(calc_aggregate_regular)
- sql += "%s as calc15_2, " % random.choice(calc_aggregate_regular)
- sql += "%s " % random.choice(calc_aggregate_regular)
+ sql += "%s as calc15_1, " % random.choice(calc_aggregate_regular)
+ sql += "%s as calc15_2, " % random.choice(calc_aggregate_regular)
+ sql += "%s " % random.choice(calc_aggregate_regular)
sql += " as calc15_3 from regular_table_1 where "
sql += "%s " % random.choice(q_where)
- sql += "%s " % random.choice(group_where_regular)
+ sql += "%s " % random.choice(group_where_regular)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #Invalid function name: twa'
# tdSql.checkRows(1)
-
+
tdSql.query("select 15-2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(calc_aggregate_regular_j)
- sql += "%s as calc15_2, " % random.choice(calc_aggregate_regular_j)
- sql += "%s " % random.choice(calc_aggregate_regular_j)
+ sql += "%s as calc15_1, " % random.choice(calc_aggregate_regular_j)
+ sql += "%s as calc15_2, " % random.choice(calc_aggregate_regular_j)
+ sql += "%s " % random.choice(calc_aggregate_regular_j)
sql += " as calc15_3 from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
- sql += "%s " % random.choice(group_where_regular_j)
+ sql += "%s " % random.choice(group_where_regular_j)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #Invalid function name: twa'
tdSql.query("select 15-2.2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(calc_aggregate_regular_j)
- sql += "%s as calc15_2, " % random.choice(calc_aggregate_regular_j)
- sql += "%s " % random.choice(calc_aggregate_regular_j)
+ sql += "%s as calc15_1, " % random.choice(calc_aggregate_regular_j)
+ sql += "%s as calc15_2, " % random.choice(calc_aggregate_regular_j)
+ sql += "%s " % random.choice(calc_aggregate_regular_j)
sql += " as calc15_3 from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
- sql += "%s " % random.choice(group_where_regular_j)
+ sql += "%s " % random.choice(group_where_regular_j)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #Invalid function name: twa'
rsDn = self.restartDnodes()
tdSql.query("select 15-3 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(calc_aggregate_groupbytbname)
- sql += "%s as calc15_2, " % random.choice(calc_aggregate_groupbytbname)
- sql += "%s " % random.choice(calc_aggregate_groupbytbname)
+ sql += "%s as calc15_1, " % random.choice(calc_aggregate_groupbytbname)
+ sql += "%s as calc15_2, " % random.choice(calc_aggregate_groupbytbname)
+ sql += "%s " % random.choice(calc_aggregate_groupbytbname)
sql += " as calc15_3 from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(group_where)
sql += "%s " % random.choice(having_support)
sql += "%s " % random.choice(order_desc_where)
sql += ") "
- sql += "order by calc15_1 "
+ sql += "order by calc15_1 "
sql += "%s " % random.choice(limit_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #Invalid function name: twa',可能还的去掉order by
tdSql.query("select 15-4 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(calc_aggregate_groupbytbname_j)
- sql += "%s as calc15_2, " % random.choice(calc_aggregate_groupbytbname_j)
- sql += "%s " % random.choice(calc_aggregate_groupbytbname_j)
+ sql += "%s as calc15_1, " % random.choice(calc_aggregate_groupbytbname_j)
+ sql += "%s as calc15_2, " % random.choice(calc_aggregate_groupbytbname_j)
+ sql += "%s " % random.choice(calc_aggregate_groupbytbname_j)
sql += " as calc15_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "%s " % random.choice(group_where_j)
sql += "%s " % random.choice(having_support_j)
#sql += "%s " % random.choice(orders_desc_where)
sql += ") "
- sql += "order by calc15_1 "
+ sql += "order by calc15_1 "
sql += "%s " % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #'Invalid function name: irate'
tdSql.query("select 15-4.2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(calc_aggregate_groupbytbname_j)
- sql += "%s as calc15_2, " % random.choice(calc_aggregate_groupbytbname_j)
- sql += "%s " % random.choice(calc_aggregate_groupbytbname_j)
+ sql += "%s as calc15_1, " % random.choice(calc_aggregate_groupbytbname_j)
+ sql += "%s as calc15_2, " % random.choice(calc_aggregate_groupbytbname_j)
+ sql += "%s " % random.choice(calc_aggregate_groupbytbname_j)
sql += " as calc15_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(group_where_j)
sql += "%s " % random.choice(having_support_j)
sql += "%s " % random.choice(orders_desc_where)
sql += ") "
- sql += "order by calc15_1 "
+ sql += "order by calc15_1 "
sql += "%s " % random.choice(limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15678 #tdSql.query(sql)
tdSql.query("select 15-5 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(calc_aggregate_groupbytbname)
- sql += "%s as calc15_2, " % random.choice(calc_aggregate_groupbytbname)
- sql += "%s " % random.choice(calc_aggregate_groupbytbname)
+ sql += "%s as calc15_1, " % random.choice(calc_aggregate_groupbytbname)
+ sql += "%s as calc15_2, " % random.choice(calc_aggregate_groupbytbname)
+ sql += "%s " % random.choice(calc_aggregate_groupbytbname)
sql += " as calc15_3 from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(group_where)
sql += ") "
- sql += "order by calc15_1 "
+ sql += "order by calc15_1 "
sql += "%s " % random.choice(limit_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #'Invalid function name: irate'
- #16 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by limit offset )
+ #16 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by limit offset )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 16-1 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s as calc16_0 , " % random.choice(calc_calculate_all)
- sql += "%s as calc16_1 , " % random.choice(calc_aggregate_all)
- sql += "%s as calc16_2 " % random.choice(calc_select_in)
+ sql += "%s as calc16_1 , " % random.choice(calc_aggregate_all)
+ sql += "%s as calc16_2 " % random.choice(calc_select_in)
sql += " from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(group_where)
#sql += "%s " % random.choice(having_support)having和 partition不能混合使用
sql += ") "
- sql += "order by calc16_0 "
+ sql += "order by calc16_0 "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
tdSql.query("select 16-2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s as calc16_0 " % random.choice(calc_calculate_all_j)
- sql += ", %s as calc16_1 " % random.choice(calc_aggregate_all_j)
- #sql += ", %s as calc16_2 " % random.choice(calc_select_in_j)
+ sql += ", %s as calc16_1 " % random.choice(calc_aggregate_all_j)
+ #sql += ", %s as calc16_2 " % random.choice(calc_select_in_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += ") "
- sql += "order by calc16_0 "
+ sql += "order by calc16_0 "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 16-2.2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s as calc16_0 " % random.choice(calc_calculate_all_j)
- sql += ", %s as calc16_1 " % random.choice(calc_aggregate_all_j)
+ sql += ", %s as calc16_1 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += ") "
- sql += "order by calc16_0 "
+ sql += "order by calc16_0 "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
-
+
tdSql.query("select 16-3 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(calc_calculate_regular)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(calc_calculate_regular)
sql += " from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
tdSql.query("select 16-4 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(calc_calculate_regular_j)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(calc_calculate_regular_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
tdSql.query("select 16-4.2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(calc_calculate_regular_j)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(calc_calculate_regular_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
-
+
tdSql.query("select 16-5 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s as calc16_1 , " % random.choice(calc_calculate_all)
- sql += "%s as calc16_1 , " % random.choice(calc_calculate_regular)
- sql += "%s as calc16_2 " % random.choice(calc_select_all)
+ sql += "%s as calc16_1 , " % random.choice(calc_calculate_regular)
+ sql += "%s as calc16_2 " % random.choice(calc_select_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(group_where)
#sql += "%s " % random.choice(having_support)
sql += ") "
- sql += "order by calc16_1 "
+ sql += "order by calc16_1 "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
-
+
tdSql.query("select 16-6 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(calc_calculate_groupbytbname)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(calc_calculate_groupbytbname)
sql += " from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(group_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
tdSql.query("select 16-7 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(calc_calculate_groupbytbname_j)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(calc_calculate_groupbytbname_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
tdSql.query("select 16-8 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(calc_calculate_groupbytbname_j)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(calc_calculate_groupbytbname_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
#17 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or interval_sliding group by having order by limit offset )interval_sliding
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 17-1 from stable_1;")
for i in range(self.fornum):
- #this is having_support , but tag-select cannot mix with last_row,other select can
+ #this is having_support , but tag-select cannot mix with last_row,other select can
sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
sql += "%s as cal17_0 , " % random.choice(calc_calculate_all)
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(partiton_where)
@@ -1757,17 +1757,17 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15719 tdSql.query(sql)
-
+
tdSql.query("select 17-2 from stable_1;")
for i in range(self.fornum):
- #this is having_support , but tag-select cannot mix with last_row,other select can
+ #this is having_support , but tag-select cannot mix with last_row,other select can
sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
sql += "%s as cal17_0 , " % random.choice(calc_calculate_all_j)
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1775,17 +1775,17 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 17-2.2 from stable_1;")
for i in range(self.fornum):
- #this is having_support , but tag-select cannot mix with last_row,other select can
+ #this is having_support , but tag-select cannot mix with last_row,other select can
sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
sql += "%s as cal17_0 , " % random.choice(calc_calculate_all_j)
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1793,8 +1793,8 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.restartDnodes()
@@ -1802,8 +1802,8 @@ class TDTestCase:
for i in range(self.fornum):
#this is having_tagnot_support , because tag-select cannot mix with last_row...
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(partiton_where)
@@ -1813,16 +1813,16 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15770 tdSql.query(sql)
tdSql.query("select 17-4 from stable_1;")
for i in range(self.fornum):
#this is having_tagnot_support , because tag-select cannot mix with last_row...
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1830,16 +1830,16 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 17-4.2 from stable_1;")
for i in range(self.fornum):
#this is having_tagnot_support , because tag-select cannot mix with last_row...
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1847,16 +1847,16 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 17-5 from stable_1;")
for i in range(self.fornum):
- #having_not_support
+ #having_not_support
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(partiton_where)
@@ -1866,15 +1866,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15719 tdSql.query(sql)
-
+
tdSql.query("select 17-6 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1882,15 +1882,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15770 tdSql.query(sql)
tdSql.query("select 17-7 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1898,15 +1898,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 17-7.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1914,16 +1914,16 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.restartDnodes()
tdSql.query("select 17-8 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all)
sql += " from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1931,15 +1931,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
-
+
tdSql.query("select 17-9 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1947,15 +1947,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 17-10 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
sql += "%s " % random.choice(interval_sliding)
@@ -1963,16 +1963,16 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
#18 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or session order by limit )interval_sliding
tdSql.query("select 18-1 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all)
sql += " from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(session_where)
@@ -1981,15 +1981,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
-
+
tdSql.query("select 18-2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(session_u_where)
@@ -1997,15 +1997,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 18-2.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
sql += "%s " % random.choice(session_u_where)
@@ -2013,16 +2013,16 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.restartDnodes()
tdSql.query("select 18-3 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all)
sql += " from stable_1_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(session_where)
@@ -2031,15 +2031,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 18-4 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(session_u_where)
@@ -2047,15 +2047,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 18-4.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(q_u_or_where)
sql += "%s " % random.choice(session_u_where)
@@ -2063,15 +2063,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 18-5 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(session_where)
@@ -2080,15 +2080,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15770 tdSql.query(sql)
tdSql.query("select 18-6 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(t_join_where)
sql += "%s " % random.choice(session_u_where)
@@ -2096,15 +2096,15 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
-
+
tdSql.query("select 18-7 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(qt_u_or_where)
sql += "%s " % random.choice(session_u_where)
@@ -2112,426 +2112,426 @@ class TDTestCase:
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
- #19 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or session order by limit )interval_sliding
+ #19 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or session order by limit )interval_sliding
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 19-1 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all)
sql += " from regular_table_1 where "
- sql += "%s " % random.choice(q_where)
+ sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(state_window)
#sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit1_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 19-2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(q_u_where)
+ sql += "%s " % random.choice(q_u_where)
sql += "%s " % random.choice(state_u_window)
#sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 19-2.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(q_u_or_where)
+ sql += "%s " % random.choice(q_u_or_where)
sql += "%s " % random.choice(state_u_window)
#sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
-
+
tdSql.query("select 19-3 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all)
sql += " from stable_1_1 where "
- sql += "%s " % random.choice(q_where)
+ sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(state_window)
#sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit1_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 19-4 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(q_u_where)
+ sql += "%s " % random.choice(q_u_where)
#sql += "%s " % random.choice(state_window)
#sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 19-4.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(q_u_or_where)
+ sql += "%s " % random.choice(q_u_or_where)
#sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 19-5 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all)
sql += " from stable_1 where "
- sql += "%s " % random.choice(q_where)
+ sql += "%s " % random.choice(q_where)
sql += "%s " % random.choice(state_window)
sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit1_where)
sql += ") "
sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.error(sql) #'STATE_WINDOW not support for super table query'
-
+
tdSql.query("select 19-6 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(q_u_where)
+ sql += "%s " % random.choice(q_u_where)
#sql += "%s " % random.choice(state_window)
#sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 19-7 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(calc_aggregate_all_j)
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(qt_u_or_where)
+ sql += "%s " % random.choice(qt_u_or_where)
#sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
- #20 select * from (select calc_select_fills form regualr_table or stable where <\>\in\and\or fill_where group by order by limit offset )
+ #20 select * from (select calc_select_fills form regualr_table or stable where <\>\in\and\or fill_where group by order by limit offset )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 20-1 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(calc_select_fill)
- sql += "%s ," % random.choice(calc_select_fill)
- sql += "%s " % random.choice(calc_select_fill)
+ sql += "%s ," % random.choice(calc_select_fill)
+ sql += "%s " % random.choice(calc_select_fill)
sql += " from stable_1 where "
- sql += "%s " % random.choice(interp_where)
+ sql += "%s " % random.choice(interp_where)
sql += "%s " % random.choice(fill_where)
sql += "%s " % random.choice(group_where)
sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
rsDn = self.restartDnodes()
tdSql.query("select 20-2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(calc_select_fill_j)
- sql += "%s ," % random.choice(calc_select_fill_j)
- sql += "%s " % random.choice(calc_select_fill_j)
+ sql += "%s ," % random.choice(calc_select_fill_j)
+ sql += "%s " % random.choice(calc_select_fill_j)
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s and " % random.choice(t_join_where)
- sql += "%s " % random.choice(interp_where_j)
+ sql += "%s " % random.choice(interp_where_j)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
tdSql.query("select 20-2.2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(calc_select_fill_j)
- sql += "%s ," % random.choice(calc_select_fill_j)
- sql += "%s " % random.choice(calc_select_fill_j)
+ sql += "%s ," % random.choice(calc_select_fill_j)
+ sql += "%s " % random.choice(calc_select_fill_j)
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s and " % random.choice(qt_u_or_where)
- sql += "%s " % random.choice(interp_where_j)
+ sql += "%s " % random.choice(interp_where_j)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
tdSql.query("select 20-3 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(calc_select_fill)
- sql += "%s ," % random.choice(calc_select_fill)
- sql += "%s " % random.choice(calc_select_fill)
+ sql += "%s ," % random.choice(calc_select_fill)
+ sql += "%s " % random.choice(calc_select_fill)
sql += " from stable_1 where "
- sql += "%s " % interp_where[2]
+ sql += "%s " % interp_where[2]
sql += "%s " % random.choice(fill_where)
sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
-
+
tdSql.query("select 20-4 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(calc_select_fill_j)
- sql += "%s ," % random.choice(calc_select_fill_j)
- sql += "%s " % random.choice(calc_select_fill_j)
- sql += " from stable_1 t1, table_1 t2 where t1.ts = t2.ts and "
+ sql += "%s ," % random.choice(calc_select_fill_j)
+ sql += "%s " % random.choice(calc_select_fill_j)
+ sql += " from stable_1 t1, table_1 t2 where t1.ts = t2.ts and "
#sql += "%s and " % random.choice(t_join_where)
sql += "%s " % interp_where_j[random.randint(0,5)]
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
tdSql.query("select 20-4.2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(calc_select_fill_j)
- sql += "%s ," % random.choice(calc_select_fill_j)
- sql += "%s " % random.choice(calc_select_fill_j)
- sql += " from stable_1 t1, stable_1_1 t2 where t1.ts = t2.ts and "
+ sql += "%s ," % random.choice(calc_select_fill_j)
+ sql += "%s " % random.choice(calc_select_fill_j)
+ sql += " from stable_1 t1, stable_1_1 t2 where t1.ts = t2.ts and "
sql += "%s and " % random.choice(qt_u_or_where)
sql += "%s " % interp_where_j[random.randint(0,5)]
sql += "%s " % random.choice(fill_where)
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
##interp不支持 tdSql.error(sql)
-
+
tdSql.query("select 20-5 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(calc_select_fill)
- sql += "%s ," % random.choice(calc_select_fill)
- sql += "%s " % random.choice(calc_select_fill)
+ sql += "%s ," % random.choice(calc_select_fill)
+ sql += "%s " % random.choice(calc_select_fill)
sql += " from regular_table_1 where "
- sql += "%s " % interp_where[1]
+ sql += "%s " % interp_where[1]
sql += "%s " % random.choice(fill_where)
sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(limit_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
##interp不支持 tdSql.query(sql)
tdSql.query("select 20-6 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(calc_select_fill_j)
- sql += "%s ," % random.choice(calc_select_fill_j)
- sql += "%s " % random.choice(calc_select_fill_j)
+ sql += "%s ," % random.choice(calc_select_fill_j)
+ sql += "%s " % random.choice(calc_select_fill_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
- #sql += "%s " % random.choice(interp_where_j)
- sql += "%s " % interp_where_j[random.randint(0,5)]
+ #sql += "%s " % random.choice(interp_where_j)
+ sql += "%s " % interp_where_j[random.randint(0,5)]
sql += "%s " % random.choice(order_u_where)
sql += "%s " % random.choice(limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
##interp不支持 tdSql.query(sql)
#1 select * from (select * from (select * form regular_table where <\>\in\and\or order by limit ))
tdSql.query("select 1-1 from stable_1;")
- for i in range(self.fornum):
+ for i in range(self.fornum):
# sql_start = "select * from ( "
# sql_end = ")"
for_num = random.randint(1, 15);
- sql = "select * from (" * for_num
+ sql = "select * from (" * for_num
sql += "select * from ( select * from ( select "
- sql += "%s, " % random.choice(s_r_select)
- sql += "%s, " % random.choice(q_select)
+ sql += "%s, " % random.choice(s_r_select)
+ sql += "%s, " % random.choice(q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += ")) "
- sql += ")" * for_num
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
-
+ sql += ")" * for_num
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
+
sql2 = "select * from ( select * from ( select "
- sql2 += "%s, " % random.choice(s_r_select)
- sql2 += "%s, " % random.choice(q_select)
+ sql2 += "%s, " % random.choice(s_r_select)
+ sql2 += "%s, " % random.choice(q_select)
sql2 += "ts from regular_table_1 where "
sql2 += "%s " % random.choice(q_where)
- sql2 += ")) "
- tdLog.info(sql2)
- tdLog.info(len(sql2))
-
+ sql2 += ")) "
+ tdLog.info(sql2)
+ tdLog.info(len(sql2))
+
self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1)
self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql ,1,10,3,3)
self.data_matrix_equal('%s' %sql ,1,10,3,3,'%s' %sql2 ,1,10,3,3)
-
+
for i in range(self.fornum):
for_num = random.randint(1, 15);
- sql = "select ts from (" * for_num
+ sql = "select ts from (" * for_num
sql += "select * from ( select * from ( select "
- sql += "%s, " % random.choice(s_r_select)
- sql += "%s, " % random.choice(q_select)
+ sql += "%s, " % random.choice(s_r_select)
+ sql += "%s, " % random.choice(q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(q_where)
sql += ")) "
- sql += ")" * for_num
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
-
+ sql += ")" * for_num
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
+
sql2 = "select * from ( select * from ( select "
- sql2 += "%s, " % random.choice(s_r_select)
- sql2 += "%s, " % random.choice(q_select)
+ sql2 += "%s, " % random.choice(s_r_select)
+ sql2 += "%s, " % random.choice(q_select)
sql2 += "ts from regular_table_1 where "
sql2 += "%s " % random.choice(q_where)
- sql2 += ")) "
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
-
+ sql2 += ")) "
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
+
self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1)
-
+
#2 select * from (select * from (select * form stable where <\>\in\and\or order by limit ))
tdSql.query("select 2-1 from stable_1;")
for i in range(self.fornum):
for_num = random.randint(1, 15);
- sql = "select * from (" * for_num
+ sql = "select * from (" * for_num
sql += "select * from ( select * from ( select "
- sql += "%s, " % random.choice(s_s_select)
- sql += "%s, " % random.choice(qt_select)
+ sql += "%s, " % random.choice(s_s_select)
+ sql += "%s, " % random.choice(qt_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += ")) "
- sql += ")" * for_num
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
-
+ sql += ")" * for_num
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
+
sql2 = "select * from ( select * from ( select "
- sql2 += "%s, " % random.choice(s_s_select)
- sql2 += "%s, " % random.choice(qt_select)
+ sql2 += "%s, " % random.choice(s_s_select)
+ sql2 += "%s, " % random.choice(qt_select)
sql2 += "ts from stable_1 where "
sql2 += "%s " % random.choice(q_where)
- sql2 += ")) "
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
-
+ sql2 += ")) "
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
+
self.data_matrix_equal('%s' %sql ,1,10,3,3,'%s' %sql2 ,1,10,3,3)
-
+
for i in range(self.fornum):
for_num = random.randint(1, 15);
- sql = "select ts from (" * for_num
+ sql = "select ts from (" * for_num
sql += "select * from ( select * from ( select "
- sql += "%s, " % random.choice(s_s_select)
- sql += "%s, " % random.choice(qt_select)
+ sql += "%s, " % random.choice(s_s_select)
+ sql += "%s, " % random.choice(qt_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(q_where)
sql += ")) "
- sql += ")" * for_num
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
-
+ sql += ")" * for_num
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
+
sql2 = "select ts from ( select * from ( select "
- sql2 += "%s, " % random.choice(s_s_select)
- sql2 += "%s, " % random.choice(qt_select)
+ sql2 += "%s, " % random.choice(s_s_select)
+ sql2 += "%s, " % random.choice(qt_select)
sql2 += "ts from stable_1 where "
sql2 += "%s " % random.choice(q_where)
- sql2 += ")) "
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
-
+ sql2 += ")) "
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
+
self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1)
-
- #3 select ts ,calc from (select * form stable where <\>\in\and\or order by limit )
+
+ #3 select ts ,calc from (select * form stable where <\>\in\and\or order by limit )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 3-1 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(calc_calculate_regular)
+ sql += "%s " % random.choice(calc_calculate_regular)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(qt_where)
sql += "%s " % random.choice(orders_desc_where)
sql += "%s " % random.choice(limit_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- #'Invalid function name: derivative' tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ #'Invalid function name: derivative' tdSql.query(sql)
#4 select * from (select calc form stable where <\>\in\and\or order by limit )
tdSql.query("select 4-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(calc_select_in_ts)
+ sql += "%s " % random.choice(calc_select_in_ts)
sql += "from stable_1 where "
sql += "%s " % random.choice(qt_where)
#sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice(limit_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
-
+
#5 select ts ,tbname from (select * form stable where <\>\in\and\or order by limit )
tdSql.query("select 5-1 from stable_1;")
for i in range(self.fornum):
sql = "select ts , tbname , "
- sql += "%s ," % random.choice(calc_calculate_regular)
+ sql += "%s ," % random.choice(calc_calculate_regular)
sql += "%s ," % random.choice(dqt_select)
sql += "%s " % random.choice(qt_select)
sql += " from ( select * from stable_1 where "
@@ -2539,9 +2539,9 @@ class TDTestCase:
sql += "%s " % random.choice(orders_desc_where)
sql += "%s " % random.choice(limit_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.error(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.error(sql)
#special sql
tdSql.query("select 6-1 from stable_1;")
@@ -2570,7 +2570,7 @@ class TDTestCase:
endTime = time.time()
print("total time %ds" % (endTime - startTime))
-
+
def stop(self):
diff --git a/tests/system-test/2-query/nestedQuery_str.py b/tests/system-test/2-query/nestedQuery_str.py
index 6244b37ba49873b43945ca83ff1264b2181bede0..0d40ef8147eabe133973a15607c340243b69db92 100755
--- a/tests/system-test/2-query/nestedQuery_str.py
+++ b/tests/system-test/2-query/nestedQuery_str.py
@@ -24,10 +24,10 @@ from util.dnodes import tdDnodes
from util.dnodes import *
class TDTestCase:
- updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
-
+
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
@@ -35,13 +35,13 @@ class TDTestCase:
self.testcasePath = os.path.split(__file__)[0]
self.testcaseFilename = os.path.split(__file__)[-1]
os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
-
+
self.num = 10
self.fornum = 5
-
+
self.db_nest = "nest"
self.dropandcreateDB_random("%s" %self.db_nest, 1)
-
+
# regular column select
#q_select= ['ts' , '*' , 'q_int', 'q_bigint' , 'q_bigint' , 'q_smallint' , 'q_tinyint' , 'q_bool' , 'q_binary' , 'q_nchar' ,'q_float' , 'q_double' ,'q_ts ']
self.q_select= ['ts' , 'q_int', 'q_bigint' , 'q_bigint' , 'q_smallint' , 'q_tinyint' , 'q_bool' , 'q_binary' , 'q_nchar' ,'q_float' , 'q_double' ,'q_ts ', 'q_int_null ', 'q_bigint_null ' , 'q_bigint_null ' , 'q_smallint_null ' , 'q_tinyint_null ' , 'q_bool_null ' , 'q_binary_null ' , 'q_nchar_null ' ,'q_float_null ' , 'q_double_null ' ,'q_ts_null ']
@@ -54,11 +54,11 @@ class TDTestCase:
self.qt_select= self.q_select + self.t_select
# distinct regular column select
- self.dq_select= ['distinct q_int', 'distinct q_bigint' , 'distinct q_smallint' , 'distinct q_tinyint' ,
+ self.dq_select= ['distinct q_int', 'distinct q_bigint' , 'distinct q_smallint' , 'distinct q_tinyint' ,
'distinct q_bool' , 'distinct q_binary' , 'distinct q_nchar' ,'distinct q_float' , 'distinct q_double' ,'distinct q_ts ']
# distinct tag column select
- self.dt_select= ['distinct loc', 'distinct t_int', 'distinct t_bigint' , 'distinct t_smallint' , 'distinct t_tinyint' ,
+ self.dt_select= ['distinct loc', 'distinct t_int', 'distinct t_bigint' , 'distinct t_smallint' , 'distinct t_tinyint' ,
'distinct t_bool' , 'distinct t_binary' , 'distinct t_nchar' ,'distinct t_float' , 'distinct t_double' ,'distinct t_ts ']
# distinct regular and tag column select
@@ -69,13 +69,13 @@ class TDTestCase:
self.s_s_select= ['tbname' , '_rowts' , '_c0', '_C0' ]
self.unionall_or_union= [ ' union ' , ' union all ' ]
- # regular column where
+ # regular column where
self.q_where = ['ts < now +1s','q_bigint >= -9223372036854775807 and q_bigint <= 9223372036854775807', 'q_int <= 2147483647 and q_int >= -2147483647',
- 'q_smallint >= -32767 and q_smallint <= 32767','q_tinyint >= -127 and q_tinyint <= 127','q_float >= -1.7E308 and q_float <= 1.7E308',
- 'q_double >= -1.7E308 and q_double <= 1.7E308', 'q_binary like \'binary%\' or q_binary = \'0\' ' , 'q_nchar like \'nchar%\' or q_nchar = \'0\' ' ,
+ 'q_smallint >= -32767 and q_smallint <= 32767','q_tinyint >= -127 and q_tinyint <= 127','q_float >= -1.7E308 and q_float <= 1.7E308',
+ 'q_double >= -1.7E308 and q_double <= 1.7E308', 'q_binary like \'binary%\' or q_binary = \'0\' ' , 'q_nchar like \'nchar%\' or q_nchar = \'0\' ' ,
'q_bool = true or q_bool = false' , 'q_bool in (0 , 1)' , 'q_bool in ( true , false)' , 'q_bool = 0 or q_bool = 1',
- 'q_bigint between -9223372036854775807 and 9223372036854775807',' q_int between -2147483647 and 2147483647','q_smallint between -32767 and 32767',
- 'q_bigint not between 9223372036854775807 and -9223372036854775807','q_int not between 2147483647 and -2147483647','q_smallint not between 32767 and -32767',
+ 'q_bigint between -9223372036854775807 and 9223372036854775807',' q_int between -2147483647 and 2147483647','q_smallint between -32767 and 32767',
+ 'q_bigint not between 9223372036854775807 and -9223372036854775807','q_int not between 2147483647 and -2147483647','q_smallint not between 32767 and -32767',
'q_tinyint between -127 and 127 ','q_float >= -3.4E38 ','q_float <= 3.4E38 ','q_double >= -1.7E308 ',
'q_double <= 1.7E308 ','q_float between -3.4E38 and 3.4E38 ','q_double between -1.7E308 and 1.7E308 ' ,'q_float not between 3.4E38 and -3.4E38 ','q_double not between 1.7E308 and -1.7E308 ',
'q_float is not null ' ,'q_double is not null ' ,'q_binary match \'binary\' ','q_binary nmatch \'binarynchar\' ','q_nchar match \'nchar\' ','q_nchar nmatch \'binarynchar\' ',
@@ -88,38 +88,38 @@ class TDTestCase:
't1.q_smallint >= -32767 and t1.q_smallint <= 32767 and t2.q_smallint >= -32767 and t2.q_smallint <= 32767',
't1.q_tinyint >= -127 and t1.q_tinyint <= 127 and t2.q_tinyint >= -127 and t2.q_tinyint <= 127',
't1.q_float >= - 1.7E308 and t1.q_float <= 1.7E308 and t2.q_float >= - 1.7E308 and t2.q_float <= 1.7E308',
- 't1.q_double >= - 1.7E308 and t1.q_double <= 1.7E308 and t2.q_double >= - 1.7E308 and t2.q_double <= 1.7E308',
- 't1.q_binary like \'binary%\' and t2.q_binary like \'binary%\' ' ,
- 't1.q_nchar like \'nchar%\' and t2.q_nchar like \'nchar%\' ' ,
- 't1.q_bool in (0 , 1) and t2.q_bool in (0 , 1)' , 't1.q_bool in ( true , false) and t2.q_bool in ( true , false)' ,
+ 't1.q_double >= - 1.7E308 and t1.q_double <= 1.7E308 and t2.q_double >= - 1.7E308 and t2.q_double <= 1.7E308',
+ 't1.q_binary like \'binary%\' and t2.q_binary like \'binary%\' ' ,
+ 't1.q_nchar like \'nchar%\' and t2.q_nchar like \'nchar%\' ' ,
+ 't1.q_bool in (0 , 1) and t2.q_bool in (0 , 1)' , 't1.q_bool in ( true , false) and t2.q_bool in ( true , false)' ,
't1.q_bigint between -9223372036854775807 and 9223372036854775807 and t2.q_bigint between -9223372036854775807 and 9223372036854775807',
't1.q_int between -2147483647 and 2147483647 and t2.q_int between -2147483647 and 2147483647',
- 't1.q_smallint between -32767 and 32767 and t2.q_smallint between -32767 and 32767',
+ 't1.q_smallint between -32767 and 32767 and t2.q_smallint between -32767 and 32767',
't1.q_tinyint between -127 and 127 and t2.q_tinyint between -127 and 127 ','t1.q_float between -1.7E308 and 1.7E308 and t2.q_float between -1.7E308 and 1.7E308',
't1.q_double between -1.7E308 and 1.7E308 and t2.q_double between -1.7E308 and 1.7E308',
't1.q_bigint not between 9223372036854775807 and -9223372036854775807 and t2.q_bigint not between 9223372036854775807 and -9223372036854775807',
't1.q_int not between 2147483647 and -2147483647 and t2.q_int not between 2147483647 and -2147483647',
- 't1.q_smallint not between 32767 and -32767 and t2.q_smallint not between 32767 and -32767',
+ 't1.q_smallint not between 32767 and -32767 and t2.q_smallint not between 32767 and -32767',
't1.q_tinyint not between 127 and -127 and t2.q_tinyint not between 127 and -127 ','t1.q_float not between -1.7E308 and -1.7E308 and t2.q_float not between 1.7E308 and -1.7E308',
't1.q_double not between 1.7E308 and -1.7E308 and t2.q_double not between 1.7E308 and -1.7E308']
#TD-6201 ,'t1.q_bool between 0 and 1 or t2.q_bool between 0 and 1']
#'t1.q_bool = true and t1.q_bool = false and t2.q_bool = true and t2.q_bool = false' , 't1.q_bool = 0 and t1.q_bool = 1 and t2.q_bool = 0 and t2.q_bool = 1' ,
- self.q_u_or_where = ['(t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' )' ,
- '(t1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' )' , '(t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false)' ,
+ self.q_u_or_where = ['(t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' )' ,
+ '(t1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' )' , '(t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false)' ,
'(t1.q_bool in (0 , 1) or t2.q_bool in (0 , 1))' , '(t1.q_bool in ( true , false) or t2.q_bool in ( true , false))' , '(t1.q_bool = 0 or t1.q_bool = 1 or t2.q_bool = 0 or t2.q_bool = 1)' ,
'(t1.q_bigint between -9223372036854775807 and 9223372036854775807 or t2.q_bigint between -9223372036854775807 and 9223372036854775807)',
'(t1.q_int between -2147483647 and 2147483647 or t2.q_int between -2147483647 and 2147483647)',
- '(t1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767)',
+ '(t1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767)',
'(t1.q_tinyint between -127 and 127 or t2.q_tinyint between -127 and 127 )','(t1.q_float between -1.7E308 and 1.7E308 or t2.q_float between -1.7E308 and 1.7E308)',
'(t1.q_double between -1.7E308 and 1.7E308 or t2.q_double between -1.7E308 and 1.7E308)']
# tag column where
self.t_where = ['ts < now +1s','t_bigint >= -9223372036854775807 and t_bigint <= 9223372036854775807','t_int <= 2147483647 and t_int >= -2147483647',
't_smallint >= -32767 and t_smallint <= 32767','q_tinyint >= -127 and t_tinyint <= 127','t_float >= -1.7E308 and t_float <= 1.7E308',
- 't_double >= -1.7E308 and t_double <= 1.7E308', 't_binary like \'binary%\' or t_binary = \'0\' ' , 't_nchar like \'nchar%\' or t_nchar = \'0\'' ,
+ 't_double >= -1.7E308 and t_double <= 1.7E308', 't_binary like \'binary%\' or t_binary = \'0\' ' , 't_nchar like \'nchar%\' or t_nchar = \'0\'' ,
't_bool = true or t_bool = false' , 't_bool in (0 , 1)' , 't_bool in ( true , false)' , 't_bool = 0 or t_bool = 1',
- 't_bigint between -9223372036854775807 and 9223372036854775807',' t_int between -2147483647 and 2147483647','t_smallint between -32767 and 32767',
+ 't_bigint between -9223372036854775807 and 9223372036854775807',' t_int between -2147483647 and 2147483647','t_smallint between -32767 and 32767',
't_tinyint between -127 and 127 ','t_float between -1.7E308 and 1.7E308','t_double between -1.7E308 and 1.7E308',
't_binary match \'binary\' ','t_binary nmatch \'binarynchar\' ','t_nchar match \'nchar\' ','t_nchar nmatch \'binarynchar\' ',
't_binary like \'binary%\' ','t_nchar like \'nchar%\' ','(t_binary like \'binary%\' or t_nchar = \'0\' ) ','(t_nchar like \'nchar%\' or t_binary = \'0\' ) ',]
@@ -131,27 +131,27 @@ class TDTestCase:
't1.t_smallint >= -32767 and t1.t_smallint <= 32767 and t2.t_smallint >= -32767 and t2.t_smallint <= 32767',
't1.t_tinyint >= -127 and t1.t_tinyint <= 127 and t2.t_tinyint >= -127 and t2.t_tinyint <= 127',
't1.t_float >= -1.7E308 and t1.t_float <= 1.7E308 and t2.t_float >= -1.7E308 and t2.t_float <= 1.7E308',
- 't1.t_double >= -1.7E308 and t1.t_double <= 1.7E308 and t2.t_double >= -1.7E308 and t2.t_double <= 1.7E308',
- '(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\') ' ,
- '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' ,
+ 't1.t_double >= -1.7E308 and t1.t_double <= 1.7E308 and t2.t_double >= -1.7E308 and t2.t_double <= 1.7E308',
+ '(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\') ' ,
+ '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' ,
't1.t_bool in (0 , 1) and t2.t_bool in (0 , 1)' , 't1.t_bool in ( true , false) and t2.t_bool in ( true , false)' , '(t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1)',
't1.t_bigint between -9223372036854775807 and 9223372036854775807 and t2.t_bigint between -9223372036854775807 and 9223372036854775807',
't1.t_int between -2147483647 and 2147483647 and t2.t_int between -2147483647 and 2147483647',
- 't1.t_smallint between -32767 and 32767 and t2.t_smallint between -32767 and 32767',
+ 't1.t_smallint between -32767 and 32767 and t2.t_smallint between -32767 and 32767',
'(t1.t_tinyint between -127 and 127 and t2.t_tinyint between -127 and 127) ','t1.t_float between -1.7E308 and 1.7E308 and t2.t_float between -1.7E308 and 1.7E308',
'(t1.t_double between -1.7E308 and 1.7E308 and t2.t_double between -1.7E308 and 1.7E308)']
#TD-6201,'t1.t_bool between 0 and 1 or t2.q_bool between 0 and 1']
- self.t_u_or_where = ['(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' )' ,
- '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' ,
+ self.t_u_or_where = ['(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' )' ,
+ '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' ,
'(t1.t_bool in (0 , 1) or t2.t_bool in (0 , 1))' , '(t1.t_bool in ( true , false) or t2.t_bool in ( true , false))' , '(t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1)',
'(t1.t_bigint between -9223372036854775807 and 9223372036854775807 or t2.t_bigint between -9223372036854775807 and 9223372036854775807)',
'(t1.t_int between -2147483647 and 2147483647 or t2.t_int between -2147483647 and 2147483647)',
- '(t1.t_smallint between -32767 and 32767 or t2.t_smallint between -32767 and 32767)',
+ '(t1.t_smallint between -32767 and 32767 or t2.t_smallint between -32767 and 32767)',
'(t1.t_tinyint between -127 and 127 or t2.t_tinyint between -127 and 127 )','(t1.t_float between -1.7E308 and 1.7E308 or t2.t_float between -1.7E308 and 1.7E308)',
'(t1.t_double between -1.7E308 and 1.7E308 or t2.t_double between -1.7E308 and 1.7E308)']
- # regular and tag column where
+ # regular and tag column where
self.qt_where = self.q_where + self.t_where
self.qt_u_where = self.q_u_where + self.t_u_where
# now,qt_u_or_where is not support
@@ -165,78 +165,78 @@ class TDTestCase:
self.session_where = ['session(ts,10a)' , 'session(ts,10s)', 'session(ts,10m)' , 'session(ts,10h)','session(ts,10d)' , 'session(ts,10w)']
self.session_u_where = ['session(t1.ts,10a)' , 'session(t1.ts,10s)', 'session(t1.ts,10m)' , 'session(t1.ts,10h)','session(t1.ts,10d)' , 'session(t1.ts,10w)',
'session(t2.ts,10a)' , 'session(t2.ts,10s)', 'session(t2.ts,10m)' , 'session(t2.ts,10h)','session(t2.ts,10d)' , 'session(t2.ts,10w)']
-
+
self.fill_where = ['FILL(NONE)','FILL(PREV)','FILL(NULL)','FILL(LINEAR)','FILL(NEXT)','FILL(VALUE, 1.23)']
-
+
self.state_window = ['STATE_WINDOW(q_tinyint)','STATE_WINDOW(q_bigint)','STATE_WINDOW(q_int)','STATE_WINDOW(q_bool)','STATE_WINDOW(q_smallint)']
self.state_u_window = ['STATE_WINDOW(t1.q_tinyint)','STATE_WINDOW(t1.q_bigint)','STATE_WINDOW(t1.q_int)','STATE_WINDOW(t1.q_bool)','STATE_WINDOW(t1.q_smallint)',
'STATE_WINDOW(t2.q_tinyint)','STATE_WINDOW(t2.q_bigint)','STATE_WINDOW(t2.q_int)','STATE_WINDOW(t2.q_bool)','STATE_WINDOW(t2.q_smallint)']
- # order by where
+ # order by where
self.order_where = ['order by ts' , 'order by ts asc']
self.order_u_where = ['order by t1.ts' , 'order by t1.ts asc' , 'order by t2.ts' , 'order by t2.ts asc']
self.order_desc_where = ['order by ts' , 'order by ts asc' , 'order by ts desc' ]
self.orders_desc_where = ['order by ts' , 'order by ts asc' , 'order by ts desc' , 'order by loc' , 'order by loc asc' , 'order by loc desc']
-
- self.group_where = ['group by tbname , loc' , 'group by tbname', 'group by tbname, t_bigint', 'group by tbname,t_int', 'group by tbname, t_smallint', 'group by tbname,t_tinyint',
+
+ self.group_where = ['group by tbname , loc' , 'group by tbname', 'group by tbname, t_bigint', 'group by tbname,t_int', 'group by tbname, t_smallint', 'group by tbname,t_tinyint',
'group by tbname,t_float', 'group by tbname,t_double' , 'group by tbname,t_binary', 'group by tbname,t_nchar', 'group by tbname,t_bool' ,'group by tbname ,loc ,t_bigint',
'group by tbname,t_binary ,t_nchar ,t_bool' , 'group by tbname,t_int ,t_smallint ,t_tinyint' , 'group by tbname,t_float ,t_double ' ,
- 'PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint',
+ 'PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname,t_float', 'PARTITION BY tbname,t_double' , 'PARTITION BY tbname,t_binary', 'PARTITION BY tbname,t_nchar', 'PARTITION BY tbname,t_bool' ,'PARTITION BY tbname ,loc ,t_bigint',
'PARTITION BY tbname,t_binary ,t_nchar ,t_bool' , 'PARTITION BY tbname,t_int ,t_smallint ,t_tinyint' , 'PARTITION BY tbname,t_float ,t_double ']
- self.group_where_j = ['group by t1.loc' , 'group by t1.t_bigint', 'group by t1.t_int', 'group by t1.t_smallint', 'group by t1.t_tinyint',
+ self.group_where_j = ['group by t1.loc' , 'group by t1.t_bigint', 'group by t1.t_int', 'group by t1.t_smallint', 'group by t1.t_tinyint',
'group by t1.t_float', 'group by t1.t_double' , 'group by t1.t_binary', 'group by t1.t_nchar', 'group by t1.t_bool' ,'group by t1.loc ,t1.t_bigint',
'group by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'group by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'group by t1.t_float ,t1.t_double ' ,
- 'PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint',
+ 'PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint',
'PARTITION by t1.t_float', 'PARTITION by t1.t_double' , 'PARTITION by t1.t_binary', 'PARTITION by t1.t_nchar', 'PARTITION by t1.t_bool' ,'PARTITION BY t1.loc ,t1.t_bigint',
'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'PARTITION by t1.t_float ,t1.t_double ',
- 'group by t2.loc' , 'group by t2.t_bigint', 'group by t2.t_int', 'group by t2.t_smallint', 'group by t2.t_tinyint',
+ 'group by t2.loc' , 'group by t2.t_bigint', 'group by t2.t_int', 'group by t2.t_smallint', 'group by t2.t_tinyint',
'group by t2.t_float', 'group by t2.t_double' , 'group by t2.t_binary', 'group by t2.t_nchar', 'group by t2.t_bool' ,'group by t2.loc ,t2.t_bigint',
'group by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'group by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'group by t2.t_float ,t2.t_double ' ,
- 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint',
+ 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint',
'PARTITION by t2.t_float', 'PARTITION by t2.t_double' , 'PARTITION by t2.t_binary', 'PARTITION by t2.t_nchar', 'PARTITION by t2.t_bool' ,'PARTITION BY t2.loc ,t2.t_bigint',
- 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double ']
-
- self.partiton_where = ['PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint',
+ 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double ']
+
+ self.partiton_where = ['PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname,t_float', 'PARTITION BY tbname,t_double' , 'PARTITION BY tbname,t_binary', 'PARTITION BY tbname,t_nchar', 'PARTITION BY tbname,t_bool' ,'PARTITION BY tbname ,loc ,t_bigint',
'PARTITION BY tbname,t_binary ,t_nchar ,t_bool' , 'PARTITION BY tbname,t_int ,t_smallint ,t_tinyint' , 'PARTITION BY tbname,t_float ,t_double ']
- self.partiton_where_j = ['PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint',
+ self.partiton_where_j = ['PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint',
'PARTITION by t1.t_float', 'PARTITION by t1.t_double' , 'PARTITION by t1.t_binary', 'PARTITION by t1.t_nchar', 'PARTITION by t1.t_bool' ,'PARTITION BY t1.loc ,t1.t_bigint',
'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'PARTITION by t1.t_float ,t1.t_double ',
- 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint',
+ 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint',
'PARTITION by t2.t_float', 'PARTITION by t2.t_double' , 'PARTITION by t2.t_binary', 'PARTITION by t2.t_nchar', 'PARTITION by t2.t_bool' ,'PARTITION BY t2.loc ,t2.t_bigint',
- 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double ']
+ 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double ']
+
-
- self.group_where_regular = ['group by tbname ' , 'group by tbname', 'group by tbname, q_bigint', 'group by tbname,q_int', 'group by tbname, q_smallint', 'group by tbname,q_tinyint',
+ self.group_where_regular = ['group by tbname ' , 'group by tbname', 'group by tbname, q_bigint', 'group by tbname,q_int', 'group by tbname, q_smallint', 'group by tbname,q_tinyint',
'group by tbname,q_float', 'group by tbname,q_double' , 'group by tbname,q_binary', 'group by tbname,q_nchar', 'group by tbname,q_bool' ,'group by tbname ,q_bigint',
'group by tbname,q_binary ,q_nchar ,q_bool' , 'group by tbname,q_int ,q_smallint ,q_tinyint' , 'group by tbname,q_float ,q_double ' ,
- 'PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint',
+ 'PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname,q_float', 'PARTITION BY tbname,q_double' , 'PARTITION BY tbname,q_binary', 'PARTITION BY tbname,q_nchar', 'PARTITION BY tbname,q_bool' ,'PARTITION BY tbname ,q_bigint',
'PARTITION BY tbname,q_binary ,q_nchar ,q_bool' , 'PARTITION BY tbname,q_int ,q_smallint ,q_tinyint' , 'PARTITION BY tbname,q_float ,q_double ']
- self.group_where_regular_j = ['group by t1.q_bigint', 'group by t1.q_int', 'group by t1.q_smallint', 'group by t1.q_tinyint',
+ self.group_where_regular_j = ['group by t1.q_bigint', 'group by t1.q_int', 'group by t1.q_smallint', 'group by t1.q_tinyint',
'group by t1.q_float', 'group by t1.q_double' , 'group by t1.q_binary', 'group by t1.q_nchar', 'group by t1.q_bool' ,'group by t1.q_bigint',
'group by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'group by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'group by t1.q_float ,t1.q_double ' ,
- 'PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint',
+ 'PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint',
'PARTITION by t1.q_float', 'PARTITION by t1.q_double' , 'PARTITION by t1.q_binary', 'PARTITION by t1.q_nchar', 'PARTITION by t1.q_bool' ,'PARTITION BY t1.q_bigint',
'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'PARTITION by t1.q_float ,t1.q_double ',
- 'group by t2.q_bigint', 'group by t2.q_int', 'group by t2.q_smallint', 'group by t2.q_tinyint',
+ 'group by t2.q_bigint', 'group by t2.q_int', 'group by t2.q_smallint', 'group by t2.q_tinyint',
'group by t2.q_float', 'group by t2.q_double' , 'group by t2.q_binary', 'group by t2.q_nchar', 'group by t2.q_bool' ,'group by t2.q_bigint',
'group by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'group by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'group by t2.q_float ,t2.q_double ' ,
- 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint',
+ 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint',
'PARTITION by t2.q_float', 'PARTITION by t2.q_double' , 'PARTITION by t2.q_binary', 'PARTITION by t2.q_nchar', 'PARTITION by t2.q_bool' ,'PARTITION BY t2.q_bigint',
- 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double ']
-
- self.partiton_where_regular = ['PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint',
+ 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double ']
+
+ self.partiton_where_regular = ['PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname,q_float', 'PARTITION BY tbname,q_double' , 'PARTITION BY tbname,q_binary', 'PARTITION BY tbname,q_nchar', 'PARTITION BY tbname,q_bool' ,'PARTITION BY tbname ,q_bigint',
'PARTITION BY tbname,q_binary ,q_nchar ,q_bool' , 'PARTITION BY tbname,q_int ,q_smallint ,q_tinyint' , 'PARTITION BY tbname,q_float ,q_double ']
- self.partiton_where_regular_j = ['PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint',
+ self.partiton_where_regular_j = ['PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint',
'PARTITION by t1.q_float', 'PARTITION by t1.q_double' , 'PARTITION by t1.q_binary', 'PARTITION by t1.q_nchar', 'PARTITION by t1.q_bool' ,'PARTITION BY t1.q_bigint',
'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'PARTITION by t1.q_float ,t1.q_double ',
- 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint',
+ 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint',
'PARTITION by t2.q_float', 'PARTITION by t2.q_double' , 'PARTITION by t2.q_binary', 'PARTITION by t2.q_nchar', 'PARTITION by t2.q_bool' ,'PARTITION BY t2.q_bigint',
- 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double ']
-
+ 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double ']
+
self.having_support = ['having count(q_int) > 0','having count(q_bigint) > 0','having count(q_smallint) > 0','having count(q_tinyint) > 0','having count(q_float) > 0','having count(q_double) > 0','having count(q_bool) > 0',
'having avg(q_int) > 0','having avg(q_bigint) > 0','having avg(q_smallint) > 0','having avg(q_tinyint) > 0','having avg(q_float) > 0','having avg(q_double) > 0',
'having sum(q_int) > 0','having sum(q_bigint) > 0','having sum(q_smallint) > 0','having sum(q_tinyint) > 0','having sum(q_float) > 0','having sum(q_double) > 0',
@@ -251,9 +251,9 @@ class TDTestCase:
self.having_not_support = ['having TOP(q_int,10) > 0','having TOP(q_bigint,10) > 0','having TOP(q_smallint,10) > 0','having TOP(q_tinyint,10) > 0','having TOP(q_float,10) > 0','having TOP(q_double,10) > 0','having TOP(q_bool,10) > 0',
'having BOTTOM(q_int,10) > 0','having BOTTOM(q_bigint,10) > 0','having BOTTOM(q_smallint,10) > 0','having BOTTOM(q_tinyint,10) > 0','having BOTTOM(q_float,10) > 0','having BOTTOM(q_double,10) > 0','having BOTTOM(q_bool,10) > 0',
'having LEASTSQUARES(q_int) > 0','having LEASTSQUARES(q_bigint) > 0','having LEASTSQUARES(q_smallint) > 0','having LEASTSQUARES(q_tinyint) > 0','having LEASTSQUARES(q_float) > 0','having LEASTSQUARES(q_double) > 0','having LEASTSQUARES(q_bool) > 0',
- 'having FIRST(q_bool) > 0','having IRATE(q_bool) > 0','having PERCENTILE(q_bool,10) > 0','having avg(q_bool) > 0','having LAST_ROW(q_bool) > 0','having sum(q_bool) > 0','having STDDEV(q_bool) > 0','having APERCENTILE(q_bool,10) > 0','having TWA(q_bool) > 0','having LAST(q_bool) > 0',
+ 'having FIRST(q_bool) > 0','having IRATE(q_bool) > 0','having PERCENTILE(q_bool,10) > 0','having avg(q_bool) > 0','having LAST_ROW(q_bool) > 0','having sum(q_bool) > 0','having STDDEV(q_bool) > 0','having APERCENTILE(q_bool,10) > 0','having TWA(q_bool) > 0','having LAST(q_bool) > 0',
'having PERCENTILE(q_int,10) > 0','having PERCENTILE(q_bigint,10) > 0','having PERCENTILE(q_smallint,10) > 0','having PERCENTILE(q_tinyint,10) > 0','having PERCENTILE(q_float,10) > 0','having PERCENTILE(q_double,10) > 0']
- self.having_tagnot_support = ['having LAST_ROW(q_int) > 0','having LAST_ROW(q_bigint) > 0','having LAST_ROW(q_smallint) > 0','having LAST_ROW(q_tinyint) > 0','having LAST_ROW(q_float) > 0','having LAST_ROW(q_double) > 0']
+ self.having_tagnot_support = ['having LAST_ROW(q_int) > 0','having LAST_ROW(q_bigint) > 0','having LAST_ROW(q_smallint) > 0','having LAST_ROW(q_tinyint) > 0','having LAST_ROW(q_float) > 0','having LAST_ROW(q_double) > 0']
self.having_support_j = ['having count(t1.q_int) > 0','having count(t1.q_bigint) > 0','having count(t1.q_smallint) > 0','having count(t1.q_tinyint) > 0','having count(t1.q_float) > 0','having count(t1.q_double) > 0','having count(t1.q_bool) > 0',
'having avg(t1.q_int) > 0','having avg(t1.q_bigint) > 0','having avg(t1.q_smallint) > 0','having avg(t1.q_tinyint) > 0','having avg(t1.q_float) > 0','having avg(t1.q_double) > 0',
@@ -266,7 +266,7 @@ class TDTestCase:
'having FIRST(t1.q_int) > 0','having FIRST(t1.q_bigint) > 0','having FIRST(t1.q_smallint) > 0','having FIRST(t1.q_tinyint) > 0','having FIRST(t1.q_float) > 0','having FIRST(t1.q_double) > 0',
'having LAST(t1.q_int) > 0','having LAST(t1.q_bigint) > 0','having LAST(t1.q_smallint) > 0','having LAST(t1.q_tinyint) > 0','having LAST(t1.q_float) > 0','having LAST(t1.q_double) > 0',
'having APERCENTILE(t1.q_int,10) > 0','having APERCENTILE(t1.q_bigint,10) > 0','having APERCENTILE(t1.q_smallint,10) > 0','having APERCENTILE(t1.q_tinyint,10) > 0','having APERCENTILE(t1.q_float,10) > 0','having APERCENTILE(t1.q_double,10) > 0']
-
+
# limit offset where
self.limit_where = ['limit 1 offset 1' , 'limit 1' , 'limit 2 offset 1' , 'limit 2', 'limit 12 offset 1' , 'limit 20', 'limit 20 offset 10' , 'limit 200']
self.limit1_where = ['limit 1 offset 1' , 'limit 1' ]
@@ -275,8 +275,8 @@ class TDTestCase:
# slimit soffset where
self.slimit_where = ['slimit 1 soffset 1' , 'slimit 1' , 'slimit 2 soffset 1' , 'slimit 2']
self.slimit1_where = ['slimit 2 soffset 1' , 'slimit 1' ]
-
- # aggregate function include [all:count(*)\avg\sum\stddev ||regualr:twa\irate\leastsquares ||group by tbname:twa\irate\]
+
+ # aggregate function include [all:count(*)\avg\sum\stddev ||regualr:twa\irate\leastsquares ||group by tbname:twa\irate\]
# select function include [all: min\max\first(*)\last(*)\top\bottom\apercentile\last_row(*)(not with interval)\interp(*)(FILL) ||regualr: percentile]
# calculation function include [all:spread\+-*/ ||regualr:diff\derivative ||group by tbname:diff\derivative\]
# **_ns_** express is not support stable, therefore, separated from regular tables
@@ -286,7 +286,7 @@ class TDTestCase:
# calc_select_all calc_select_regular calc_select_in_ts calc_select_fill calc_select_not_interval
# select function include [all: min\max\first(*)\last(*)\top\bottom\apercentile\last_row(*)(not with interval)\interp(*)(FILL) ||regualr: percentile]
-
+
self.calc_select_all = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' ,
'top(q_int,20)' , 'top(q_bigint,20)' , 'top(q_smallint,20)' ,'top(q_tinyint,20)' ,'top(q_float,20)' ,'top(q_double,20)' ,
'first(q_int)' , 'first(q_bigint)' , 'first(q_smallint)' , 'first(q_tinyint)' , 'first(q_float)' ,'first(q_double)' ,'first(q_binary)' ,'first(q_nchar)' ,'first(q_bool)' ,'first(q_ts)' ,
@@ -294,7 +294,7 @@ class TDTestCase:
'min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' ,
'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' ,
'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)' ,
- 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
+ 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)']
self.calc_select_in_ts = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' ,
@@ -305,23 +305,23 @@ class TDTestCase:
self.calc_select_in = ['min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' ,
'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' ,
'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)' ,
- 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
+ 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)']
-
+
self.calc_select_not_support_ts = ['first(q_int)' , 'first(q_bigint)' , 'first(q_smallint)' , 'first(q_tinyint)' , 'first(q_float)' ,'first(q_double)' ,'first(q_binary)' ,'first(q_nchar)' ,'first(q_bool)' ,'first(q_ts)' ,
'last(q_int)' , 'last(q_bigint)' , 'last(q_smallint)' , 'last(q_tinyint)' , 'last(q_float)' ,'last(q_double)' , 'last(q_binary)' ,'last(q_nchar)' ,'last(q_bool)' ,'last(q_ts)' ,
- 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
+ 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' ,
'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)',
- 'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)']
-
+ 'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)']
+
self.calc_select_support_ts = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' ,
'top(q_int,20)' , 'top(q_bigint,20)' , 'top(q_smallint,20)' ,'top(q_tinyint,20)' ,'top(q_float,20)' ,'top(q_double,20)' ,
'min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' ,
'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' ]
-
+
self.calc_select_regular = [ 'PERCENTILE(q_int,10)' ,'PERCENTILE(q_bigint,20)' , 'PERCENTILE(q_smallint,30)' ,'PERCENTILE(q_tinyint,40)' ,'PERCENTILE(q_float,50)' ,'PERCENTILE(q_double,60)']
-
+
self.calc_select_fill = ['INTERP(q_int)' ,'INTERP(q_bigint)' ,'INTERP(q_smallint)' ,'INTERP(q_tinyint)', 'INTERP(q_float)' ,'INTERP(q_double)']
self.interp_where = ['ts = now' , 'ts = \'2020-09-13 20:26:40.000\'' , 'ts = \'2020-09-13 20:26:40.009\'' ,'tbname in (\'table_1\') and ts = now' ,'tbname in (\'table_0\' ,\'table_1\',\'table_2\',\'table_3\',\'table_4\',\'table_5\') and ts = \'2020-09-13 20:26:40.000\'','tbname like \'table%\' and ts = \'2020-09-13 20:26:40.002\'']
@@ -346,28 +346,28 @@ class TDTestCase:
]
self.calc_select_in_not_support_ts_j = ['apercentile(t1.q_int,20)' , 'apercentile(t1.q_bigint,20)' ,'apercentile(t1.q_smallint,20)' ,'apercentile(t1.q_tinyint,20)' ,'apercentile(t1.q_float,20)' ,'apercentile(t1.q_double,20)' ,
- 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' ,
+ 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' ,
'last_row(t1.q_double)' , 'last_row(t1.q_bool)' ,'last_row(t1.q_binary)' ,'last_row(t1.q_nchar)' ,'last_row(t1.q_ts)' ,
'apercentile(t2.q_int,20)' , 'apercentile(t2.q_bigint,20)' ,'apercentile(t2.q_smallint,20)' ,'apercentile(t2.q_tinyint,20)' ,'apercentile(t2.q_float,20)' ,'apercentile(t2.q_double,20)' ,
- 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' ,
+ 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' ,
'last_row(t2.q_double)' , 'last_row(t2.q_bool)' ,'last_row(t2.q_binary)' ,'last_row(t2.q_nchar)' ,'last_row(t2.q_ts)']
self.calc_select_in_j = ['min(t1.q_int)' , 'min(t1.q_bigint)' , 'min(t1.q_smallint)' , 'min(t1.q_tinyint)' , 'min(t1.q_float)' ,'min(t1.q_double)' ,
'max(t1.q_int)' , 'max(t1.q_bigint)' , 'max(t1.q_smallint)' , 'max(t1.q_tinyint)' ,'max(t1.q_float)' ,'max(t1.q_double)' ,
'apercentile(t1.q_int,20)' , 'apercentile(t1.q_bigint,20)' ,'apercentile(t1.q_smallint,20)' ,'apercentile(t1.q_tinyint,20)' ,'apercentile(t1.q_float,20)' ,'apercentile(t1.q_double,20)' ,
- 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' ,
+ 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' ,
'last_row(t1.q_double)' , 'last_row(t1.q_bool)' ,'last_row(t1.q_binary)' ,'last_row(t1.q_nchar)' ,'last_row(t1.q_ts)' ,
'min(t2.q_int)' , 'min(t2.q_bigint)' , 'min(t2.q_smallint)' , 'min(t2.q_tinyint)' , 'min(t2.q_float)' ,'min(t2.q_double)' ,
'max(t2.q_int)' , 'max(t2.q_bigint)' , 'max(t2.q_smallint)' , 'max(t2.q_tinyint)' ,'max(t2.q_float)' ,'max(t2.q_double)' ,
'apercentile(t2.q_int,20)' , 'apercentile(t2.q_bigint,20)' ,'apercentile(t2.q_smallint,20)' ,'apercentile(t2.q_tinyint,20)' ,'apercentile(t2.q_float,20)' ,'apercentile(t2.q_double,20)' ,
- 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' ,
- 'last_row(t2.q_double)' , 'last_row(t2.q_bool)' ,'last_row(t2.q_binary)' ,'last_row(t2.q_nchar)' ,'last_row(t2.q_ts)']
+ 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' ,
+ 'last_row(t2.q_double)' , 'last_row(t2.q_bool)' ,'last_row(t2.q_binary)' ,'last_row(t2.q_nchar)' ,'last_row(t2.q_ts)']
self.calc_select_all_j = self.calc_select_in_ts_j + self.calc_select_in_j
self.calc_select_regular_j = [ 'PERCENTILE(t1.q_int,10)' ,'PERCENTILE(t1.q_bigint,20)' , 'PERCENTILE(t1.q_smallint,30)' ,'PERCENTILE(t1.q_tinyint,40)' ,'PERCENTILE(t1.q_float,50)' ,'PERCENTILE(t1.q_double,60)' ,
'PERCENTILE(t2.q_int,10)' ,'PERCENTILE(t2.q_bigint,20)' , 'PERCENTILE(t2.q_smallint,30)' ,'PERCENTILE(t2.q_tinyint,40)' ,'PERCENTILE(t2.q_float,50)' ,'PERCENTILE(t2.q_double,60)']
-
+
self.calc_select_fill_j = ['INTERP(t1.q_int)' ,'INTERP(t1.q_bigint)' ,'INTERP(t1.q_smallint)' ,'INTERP(t1.q_tinyint)', 'INTERP(t1.q_float)' ,'INTERP(t1.q_double)' ,
'INTERP(t2.q_int)' ,'INTERP(t2.q_bigint)' ,'INTERP(t2.q_smallint)' ,'INTERP(t2.q_tinyint)', 'INTERP(t2.q_float)' ,'INTERP(t2.q_double)']
self.interp_where_j = ['t1.ts = now' , 't1.ts = \'2020-09-13 20:26:40.000\'' , 't1.ts = \'2020-09-13 20:26:40.009\'' ,'t2.ts = now' , 't2.ts = \'2020-09-13 20:26:40.000\'' , 't2.ts = \'2020-09-13 20:26:40.009\'' ,
@@ -389,7 +389,7 @@ class TDTestCase:
'PERCENTILE(q_int,10)' ,'PERCENTILE(q_bigint,20)' , 'PERCENTILE(q_smallint,30)' ,'PERCENTILE(q_tinyint,40)' ,'PERCENTILE(q_float,50)' ,'PERCENTILE(q_double,60)']
self.calc_aggregate_groupbytbname = ['twa(q_int)' ,'twa(q_bigint)' , 'twa(q_smallint)' ,'twa(q_tinyint)' ,'twa (q_float)' ,'twa(q_double)' ,
- 'IRATE(q_int)' ,'IRATE(q_bigint)' , 'IRATE(q_smallint)' ,'IRATE(q_tinyint)' ,'IRATE (q_float)' ,'IRATE(q_double)' ]
+ 'IRATE(q_int)' ,'IRATE(q_bigint)' , 'IRATE(q_smallint)' ,'IRATE(q_tinyint)' ,'IRATE (q_float)' ,'IRATE(q_double)' ]
#two table join
self.calc_aggregate_all_j = ['count(t1.*)' , 'count(t1.q_int)' ,'count(t1.q_bigint)' , 'count(t1.q_smallint)' ,'count(t1.q_tinyint)' ,'count(t1.q_float)' ,
@@ -417,18 +417,18 @@ class TDTestCase:
self.calc_aggregate_groupbytbname_j = ['twa(t1.q_int)' ,'twa(t1.q_bigint)' , 'twa(t1.q_smallint)' ,'twa(t1.q_tinyint)' ,'twa (t1.q_float)' ,'twa(t1.q_double)' ,
'IRATE(t1.q_int)' ,'IRATE(t1.q_bigint)' , 'IRATE(t1.q_smallint)' ,'IRATE(t1.q_tinyint)' ,'IRATE (t1.q_float)' ,'IRATE(t1.q_double)' ,
'twa(t2.q_int)' ,'twa(t2.q_bigint)' , 'twa(t2.q_smallint)' ,'twa(t2.q_tinyint)' ,'twa (t2.q_float)' ,'twa(t2.q_double)' ,
- 'IRATE(t2.q_int)' ,'IRATE(t2.q_bigint)' , 'IRATE(t2.q_smallint)' ,'IRATE(t2.q_tinyint)' ,'IRATE (t2.q_float)' ,'IRATE(t2.q_double)' ]
-
+ 'IRATE(t2.q_int)' ,'IRATE(t2.q_bigint)' , 'IRATE(t2.q_smallint)' ,'IRATE(t2.q_tinyint)' ,'IRATE (t2.q_float)' ,'IRATE(t2.q_double)' ]
+
# calc_calculate_all calc_calculate_regular calc_calculate_groupbytbname
# calculation function include [all:spread\+-*/ ||regualr:diff\derivative ||group by tbname:diff\derivative\]
- self.calc_calculate_all = ['SPREAD(ts)' , 'SPREAD(q_ts)' , 'SPREAD(q_int)' ,'SPREAD(q_bigint)' , 'SPREAD(q_smallint)' ,'SPREAD(q_tinyint)' ,'SPREAD(q_float)' ,'SPREAD(q_double)' ,
+ self.calc_calculate_all = ['SPREAD(ts)' , 'SPREAD(q_ts)' , 'SPREAD(q_int)' ,'SPREAD(q_bigint)' , 'SPREAD(q_smallint)' ,'SPREAD(q_tinyint)' ,'SPREAD(q_float)' ,'SPREAD(q_double)' ,
'(SPREAD(q_int) + SPREAD(q_bigint))' , '(SPREAD(q_smallint) - SPREAD(q_float))', '(SPREAD(q_double) * SPREAD(q_tinyint))' , '(SPREAD(q_double) / SPREAD(q_float))']
self.calc_calculate_regular = ['DIFF(q_int)' ,'DIFF(q_bigint)' , 'DIFF(q_smallint)' ,'DIFF(q_tinyint)' ,'DIFF(q_float)' ,'DIFF(q_double)' ,
'DIFF(q_int,0)' ,'DIFF(q_bigint,0)' , 'DIFF(q_smallint,0)' ,'DIFF(q_tinyint,0)' ,'DIFF(q_float,0)' ,'DIFF(q_double,0)' ,
'DIFF(q_int,1)' ,'DIFF(q_bigint,1)' , 'DIFF(q_smallint,1)' ,'DIFF(q_tinyint,1)' ,'DIFF(q_float,1)' ,'DIFF(q_double,1)' ,
'DERIVATIVE(q_int,15s,0)' , 'DERIVATIVE(q_bigint,10s,1)' , 'DERIVATIVE(q_smallint,20s,0)' ,'DERIVATIVE(q_tinyint,10s,1)' ,'DERIVATIVE(q_float,6s,0)' ,'DERIVATIVE(q_double,3s,1)' ]
self.calc_calculate_groupbytbname = self.calc_calculate_regular
-
+
#two table join
self.calc_calculate_all_j = ['SPREAD(t1.ts)' , 'SPREAD(t1.q_ts)' , 'SPREAD(t1.q_int)' ,'SPREAD(t1.q_bigint)' , 'SPREAD(t1.q_smallint)' ,'SPREAD(t1.q_tinyint)' ,'SPREAD(t1.q_float)' ,'SPREAD(t1.q_double)' ,
'SPREAD(t2.ts)' , 'SPREAD(t2.q_ts)' , 'SPREAD(t2.q_int)' ,'SPREAD(t2.q_bigint)' , 'SPREAD(t2.q_smallint)' ,'SPREAD(t2.q_tinyint)' ,'SPREAD(t2.q_float)' ,'SPREAD(t2.q_double)' ,
@@ -452,17 +452,17 @@ class TDTestCase:
'interval(1y,1n) ','interval(1n,1w) ','interval(1w,1d) ','interval(1d,1h) ','interval(1h,1m) ','interval(1m,1s) ','interval(1s,10a) ' ,'interval(100a,30a)']
self.conn1 = taos.connect(host="127.0.0.1", user="root", password="taosdata", config="/etc/taos/")
- self.cur1 = self.conn1.cursor()
- print(self.cur1)
+ self.cur1 = self.conn1.cursor()
+ print(self.cur1)
self.cur1.execute("use %s ;" %self.db_nest)
sql = 'select * from stable_1 limit 5;'
self.cur1.execute(sql)
-
+
def data_matrix_equal(self, sql1,row1_s,row1_e,col1_s,col1_e, sql2,row2_s,row2_e,col2_s,col2_e):
# ----row1_start----col1_start----
- # - - - - 是一个矩阵内的数据相等- - -
- # - - - - - - - - - - - - - - - -
+ # - - - - 是一个矩阵内的数据相等- - -
+ # - - - - - - - - - - - - - - - -
# ----row1_end------col1_end------
self.sql1 = sql1
list1 =[]
@@ -474,9 +474,9 @@ class TDTestCase:
#print("data=%s" %(tdSql.getData(i1,j1)))
list1.append(tdSql.getData(i1,j1))
print("=====list1-------list1---=%s" %set(list1))
-
+
tdSql.execute("reset query cache;")
- self.sql2 = sql2
+ self.sql2 = sql2
list2 =[]
tdSql.query(sql2)
for i2 in range(row2_s-1,row2_e):
@@ -485,8 +485,8 @@ class TDTestCase:
#print("jjjj222=%d"%j2)
#print("data=%s" %(tdSql.getData(i2,j2)))
list2.append(tdSql.getData(i2,j2))
- print("=====list2-------list2---=%s" %set(list2))
-
+ print("=====list2-------list2---=%s" %set(list2))
+
if (list1 == list2) and len(list2)>0:
# print(("=====matrix===sql1.list1:'%s',sql2.list2:'%s'") %(list1,list2))
tdLog.info(("===matrix===sql1:'%s' matrix_result = sql2:'%s' matrix_result") %(sql1,sql2))
@@ -512,7 +512,7 @@ class TDTestCase:
print(("=====matrix_error===sql1.list1:'%s',sql2.list2:'%s'") %(list1,list2))
tdLog.info(("sql1:'%s' matrix_result != sql2:'%s' matrix_result") %(sql1,sql2))
return tdSql.checkEqual(list1,list2)
-
+
def restartDnodes(self):
pass
# tdDnodes.stop(1)
@@ -536,7 +536,7 @@ class TDTestCase:
q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \
tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''')
-
+
tdSql.execute('''create stable stable_null_data (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \
q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\
q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\
@@ -548,35 +548,35 @@ class TDTestCase:
q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \
tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''')
-
+
#tdSql.execute('''create table stable_1_1 using stable_1 tags('stable_1_1', '0' , '0' , '0' , '0' , 0 , 'binary1' , 'nchar1' , '0' , '0' ,'0') ;''')
- tdSql.execute('''create table stable_1_1 using stable_1 tags('stable_1_1', '%d' , '%d', '%d' , '%d' , 0 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
- %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
+ tdSql.execute('''create table stable_1_1 using stable_1 tags('stable_1_1', '%d' , '%d', '%d' , '%d' , 0 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
+ %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
tdSql.execute('''create table stable_1_2 using stable_1 tags('stable_1_2', '2147483647' , '9223372036854775807' , '32767' , '127' , 1 , 'binary2' , 'nchar2' , '2' , '22' , \'1999-09-09 09:09:09.090\') ;''')
tdSql.execute('''create table stable_1_3 using stable_1 tags('stable_1_3', '-2147483647' , '-9223372036854775807' , '-32767' , '-127' , false , 'binary3' , 'nchar3nchar3' , '-3.3' , '-33.33' , \'2099-09-09 09:09:09.090\') ;''')
#tdSql.execute('''create table stable_1_4 using stable_1 tags('stable_1_4', '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''')
- tdSql.execute('''create table stable_1_4 using stable_1 tags('stable_1_4', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
- %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
+ tdSql.execute('''create table stable_1_4 using stable_1 tags('stable_1_4', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
+ %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
# tdSql.execute('''create table stable_2_1 using stable_2 tags('stable_2_1' , '0' , '0' , '0' , '0' , 0 , 'binary21' , 'nchar21' , '0' , '0' ,'0') ;''')
# tdSql.execute('''create table stable_2_2 using stable_2 tags('stable_2_2' , '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''')
# tdSql.execute('''create table stable_null_data_1 using stable_null_data tags('stable_null_data_1', '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''')
-
+
tdSql.execute('''create table stable_2_1 using stable_2 tags('stable_2_1' , '0' , '0' , '0' , '0' , 0 , 'binary21' , 'nchar21' , '0' , '0' ,\'2099-09-09 09:09:09.090\') ;''')
- tdSql.execute('''create table stable_2_2 using stable_2 tags('stable_2_2' , '%d' , '%d', '%d' , '%d' , 0 , 'binary2.%s' , 'nchar2.%s' , '%f', '%f' ,'%d') ;'''
- %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
+ tdSql.execute('''create table stable_2_2 using stable_2 tags('stable_2_2' , '%d' , '%d', '%d' , '%d' , 0 , 'binary2.%s' , 'nchar2.%s' , '%f', '%f' ,'%d') ;'''
+ %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
- tdSql.execute('''create table stable_null_data_1 using stable_null_data tags('stable_null_data_1', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
- %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
+ tdSql.execute('''create table stable_null_data_1 using stable_null_data tags('stable_null_data_1', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
+ %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
#regular table
tdSql.execute('''create table regular_table_1 \
@@ -602,92 +602,92 @@ class TDTestCase:
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''')
- for i in range(num_random*n):
+ for i in range(num_random*n):
tdSql.execute('''insert into stable_1_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1),
- fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1),
+ fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1),
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
tdSql.execute('''insert into regular_table_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1) ,
- fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1) ,
- fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1) ,
+ fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1) ,
+ fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
tdSql.execute('''insert into stable_1_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)\
values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1),
- fake.random_int(min=0, max=9223372036854775807, step=1),
- fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1),
+ fake.random_int(min=0, max=9223372036854775807, step=1),
+ fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \
values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1),
- fake.random_int(min=0, max=9223372036854775807, step=1),
- fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1),
+ fake.random_int(min=0, max=9223372036854775807, step=1),
+ fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
-
+
tdSql.execute('''insert into stable_1_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \
values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1),
- fake.random_int(min=-9223372036854775807, max=0, step=1),
- fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i +1, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1),
+ fake.random_int(min=-9223372036854775807, max=0, step=1),
+ fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i +1, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \
values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1),
- fake.random_int(min=-9223372036854775807, max=0, step=1),
- fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i +1, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1),
+ fake.random_int(min=-9223372036854775807, max=0, step=1),
+ fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i +1, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
tdSql.execute('''insert into stable_2_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000, fake.random_int(min=-0, max=2147483647, step=1),
- fake.random_int(min=-0, max=9223372036854775807, step=1),
- fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000, fake.random_int(min=-0, max=2147483647, step=1),
+ fake.random_int(min=-0, max=9223372036854775807, step=1),
+ fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
tdSql.execute('''insert into stable_2_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000 +1, fake.random_int(min=-0, max=2147483647, step=1),
- fake.random_int(min=-0, max=9223372036854775807, step=1),
- fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000 +1, fake.random_int(min=-0, max=2147483647, step=1),
+ fake.random_int(min=-0, max=9223372036854775807, step=1),
+ fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
tdSql.execute('''insert into stable_2_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \
- 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
- % (ts + i*1000 +10, fake.random_int(min=-0, max=2147483647, step=1),
- fake.random_int(min=-0, max=9223372036854775807, step=1),
- fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) ,
- fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
+ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
+ % (ts + i*1000 +10, fake.random_int(min=-0, max=2147483647, step=1),
+ fake.random_int(min=-0, max=9223372036854775807, step=1),
+ fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) ,
+ fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , ts + i, fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() ,
fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address() , fake.pystr() , fake.address()))
tdSql.query("select count(*) from stable_1;")
@@ -696,149 +696,149 @@ class TDTestCase:
tdSql.checkData(0,0,num_random*n)
def math_nest(self,mathlist):
-
- print("==========%s===start=============" %mathlist)
- os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
-
+
+ print("==========%s===start=============" %mathlist)
+ os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
+
self.dropandcreateDB_random("%s" %self.db_nest, 1)
-
+
if (mathlist == ['ABS','SQRT']) or (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['FLOOR','CEIL','ROUND']) \
or (mathlist == ['CSUM']) or (mathlist == ['']):
- math_functions = mathlist
- fun_fix_column = ['(q_bigint)','(q_smallint)','(q_tinyint)','(q_int)','(q_float)','(q_double)','(q_bigint_null)','(q_smallint_null)','(q_tinyint_null)','(q_int_null)','(q_float_null)','(q_double_null)']
+ math_functions = mathlist
+ fun_fix_column = ['(q_bigint)','(q_smallint)','(q_tinyint)','(q_int)','(q_float)','(q_double)','(q_bigint_null)','(q_smallint_null)','(q_tinyint_null)','(q_int_null)','(q_float_null)','(q_double_null)']
fun_column_1 = random.sample(math_functions,1)+random.sample(fun_fix_column,1)
math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_2 = random.sample(math_functions,1)+random.sample(fun_fix_column,1)
math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
fun_fix_column_j = ['(t1.q_bigint)','(t1.q_smallint)','(t1.q_tinyint)','(t1.q_int)','(t1.q_float)','(t1.q_double)','(t1.q_bigint_null)','(t1.q_smallint_null)','(t1.q_tinyint_null)','(t1.q_int_null)','(t1.q_float_null)','(t1.q_double_null)',
- '(t2.q_bigint)','(t2.q_smallint)','(t2.q_tinyint)','(t2.q_int)','(t2.q_float)','(t2.q_double)','(t2.q_bigint_null)','(t2.q_smallint_null)','(t2.q_tinyint_null)','(t2.q_int_null)','(t2.q_float_null)','(t2.q_double_null)']
+ '(t2.q_bigint)','(t2.q_smallint)','(t2.q_tinyint)','(t2.q_int)','(t2.q_float)','(t2.q_double)','(t2.q_bigint_null)','(t2.q_smallint_null)','(t2.q_tinyint_null)','(t2.q_int_null)','(t2.q_float_null)','(t2.q_double_null)']
fun_column_join_1 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1)
math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_join_2 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1)
math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
elif (mathlist == ['UNIQUE']) or (mathlist == ['HYPERLOGLOG']):
- math_functions = mathlist
+ math_functions = mathlist
fun_fix_column = ['(q_bigint)','(q_smallint)','(q_tinyint)','(q_int)','(q_float)','(q_double)','(q_binary)','(q_nchar)','(q_bool)','(q_ts)',
- '(q_bigint_null)','(q_smallint_null)','(q_tinyint_null)','(q_int_null)','(q_float_null)','(q_double_null)','(q_binary_null)','(q_nchar_null)','(q_bool_null)','(q_ts_null)']
+ '(q_bigint_null)','(q_smallint_null)','(q_tinyint_null)','(q_int_null)','(q_float_null)','(q_double_null)','(q_binary_null)','(q_nchar_null)','(q_bool_null)','(q_ts_null)']
fun_column_1 = random.sample(math_functions,1)+random.sample(fun_fix_column,1)
math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_2 = random.sample(math_functions,1)+random.sample(fun_fix_column,1)
math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
fun_fix_column_j = ['(t1.q_bigint)','(t1.q_smallint)','(t1.q_tinyint)','(t1.q_int)','(t1.q_float)','(t1.q_double)','(t1.q_bigint_null)','(t1.q_smallint_null)','(t1.q_tinyint_null)','(t1.q_int_null)','(t1.q_float_null)','(t1.q_double_null)',
- '(t2.q_bigint)','(t2.q_smallint)','(t2.q_tinyint)','(t2.q_int)','(t2.q_float)','(t2.q_double)','(t2.q_bigint_null)','(t2.q_smallint_null)','(t2.q_tinyint_null)','(t2.q_int_null)','(t2.q_float_null)','(t2.q_double_null)']
+ '(t2.q_bigint)','(t2.q_smallint)','(t2.q_tinyint)','(t2.q_int)','(t2.q_float)','(t2.q_double)','(t2.q_bigint_null)','(t2.q_smallint_null)','(t2.q_tinyint_null)','(t2.q_int_null)','(t2.q_float_null)','(t2.q_double_null)']
fun_column_join_1 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1)
math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_join_2 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1)
math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","")
elif (mathlist == ['POW','LOG']) or (mathlist == ['MAVG']) or (mathlist == ['SAMPLE']) or (mathlist == ['TAIL']):
- math_functions = mathlist
- num = random.randint(0, 1000)
+ math_functions = mathlist
+ num = random.randint(0, 1000)
fun_fix_column = ['(q_bigint,num)','(q_smallint,num)','(q_tinyint,num)','(q_int,num)','(q_float,num)','(q_double,num)',
- '(q_bigint_null,num)','(q_smallint_null,num)','(q_tinyint_null,num)','(q_int_null,num)','(q_float_null,num)','(q_double_null,num)']
+ '(q_bigint_null,num)','(q_smallint_null,num)','(q_tinyint_null,num)','(q_int_null,num)','(q_float_null,num)','(q_double_null,num)']
fun_column_1 = random.sample(math_functions,1)+random.sample(fun_fix_column,1)
math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num))
fun_column_2 = random.sample(math_functions,1)+random.sample(fun_fix_column,1)
math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num))
-
+
fun_fix_column_j = ['(t1.q_bigint,num)','(t1.q_smallint,num)','(t1.q_tinyint,num)','(t1.q_int,num)','(t1.q_float,num)','(t1.q_double,num)',
'(t1.q_bigint_null,num)','(t1.q_smallint_null,num)','(t1.q_tinyint_null,num)','(t1.q_int_null,num)','(t1.q_float_null,num)','(t1.q_double_null,num)',
'(t2.q_bigint,num)','(t2.q_smallint,num)','(t2.q_tinyint,num)','(t2.q_int,num)','(t2.q_float,num)','(t2.q_double,num)',
- '(t2.q_bigint_null,num)','(t2.q_smallint_null,num)','(t2.q_tinyint_null,num)','(t2.q_int_null,num)','(t2.q_float_null,num)','(t2.q_double_null,num)']
+ '(t2.q_bigint_null,num)','(t2.q_smallint_null,num)','(t2.q_tinyint_null,num)','(t2.q_int_null,num)','(t2.q_float_null,num)','(t2.q_double_null,num)']
fun_column_join_1 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1)
math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num))
fun_column_join_2 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1)
math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num))
-
+
tdSql.query("select 1-1 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
- sql = "select ts , floor(asct1) from ( select "
- sql += "%s as asct1, " % math_fun_1
- sql += "%s as asct2, " % math_fun_2
+ sql = "select ts , floor(asct1) from ( select "
+ sql += "%s as asct1, " % math_fun_1
+ sql += "%s as asct2, " % math_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) \
or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
- sql = "select floor(asct1) from ( select "
- sql += "%s as asct1 " % math_fun_1
- # sql += "%s as asct2, " % math_fun_2
+ sql = "select floor(asct1) from ( select "
+ sql += "%s as asct1 " % math_fun_1
+ # sql += "%s as asct2, " % math_fun_2
# sql += "%s, " % random.choice(self.s_s_select)
- # sql += "%s, " % random.choice(self.q_select)
+ # sql += "%s, " % random.choice(self.q_select)
sql += " from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
#sql += "%s " % random.choice(self.order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
#tdSql.checkRows(100)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-2 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select ts , abs(asct1) from ( select "
- sql += "%s as asct1, " % math_fun_1
+ sql += "%s as asct1, " % math_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s )" % random.choice(self.order_where)
- sql += "%s " % random.choice(self.unionall_or_union)
+ sql += "%s " % random.choice(self.unionall_or_union)
sql += "select ts , asct2 from ( select "
- sql += "%s as asct2, " % math_fun_2
+ sql += "%s as asct2, " % math_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
#sql += "%s " % random.choice(having_support)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
- #TD-15437 self.cur1.execute(sql)
+ #TD-15437 self.cur1.execute(sql)
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) \
- or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
+ or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
sql = "select abs(asct1) from ( select "
- sql += "%s as asct1 " % math_fun_1
+ sql += "%s as asct1 " % math_fun_1
# sql += "%s, " % random.choice(self.s_s_select)
- # sql += "%s, " % random.choice(self.q_select)
+ # sql += "%s, " % random.choice(self.q_select)
sql += "from regular_table_1 where "
sql += "%s )" % random.choice(self.q_where)
#sql += "%s )" % random.choice(self.order_where)
- sql += "%s " % random.choice(self.unionall_or_union)
+ sql += "%s " % random.choice(self.unionall_or_union)
sql += "select floor(asct2) from ( select "
- sql += "%s as asct2 " % math_fun_2
+ sql += "%s as asct2 " % math_fun_2
# sql += "%s, " % random.choice(self.s_s_select)
- # sql += "%s, " % random.choice(self.q_select)
+ # sql += "%s, " % random.choice(self.q_select)
sql += " from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
#sql += "%s " % random.choice(having_support)
#sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15473 tdSql.query(sql)
- #TD-15473 self.cur1.execute(sql)
-
+ #TD-15473 self.cur1.execute(sql)
+
tdSql.query("select 1-3 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
@@ -847,20 +847,20 @@ class TDTestCase:
sql += "%s as asct1, ts ," % math_fun_1
sql += "%s as asct2, " % math_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s select " % random.choice(self.unionall_or_union)
+ sql += "%s select " % random.choice(self.unionall_or_union)
sql += "%s as asct2, ts ," % math_fun_2
sql += "%s as asct1, " % math_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_2 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15473 tdSql.query(sql)
#self.cur1.execute(sql)
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) \
@@ -869,86 +869,86 @@ class TDTestCase:
sql += "%s as asct1, ts ," % math_fun_1
sql += "%s as asct2, " % math_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s select " % random.choice(self.unionall_or_union)
+ sql += "%s select " % random.choice(self.unionall_or_union)
sql += "%s as asct2, ts ," % math_fun_2
sql += "%s as asct1, " % math_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_2 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15473 tdSql.query(sql)
#self.cur1.execute(sql)
-
+
tdSql.query("select 1-4 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select ts , asct1 from ( select t1.ts as ts,"
- sql += "%s, " % math_fun_join_1
- sql += "%s as asct1, " % math_fun_join_2
- sql += "%s, " % math_fun_join_1
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % math_fun_join_1
+ sql += "%s as asct1, " % math_fun_join_2
+ sql += "%s, " % math_fun_join_1
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM'])\
or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
sql = "select count(asct1) from ( select "
- sql += "%s as asct1 " % math_fun_join_2
+ sql += "%s as asct1 " % math_fun_join_2
sql += "from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s " % random.choice(self.q_u_or_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-5 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select ts ,"
- sql += "%s, " % math_fun_1
+ sql += "%s, " % math_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % math_fun_2
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM'])\
or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
sql = "select "
- # sql += "%s, " % math_fun_1
+ # sql += "%s, " % math_fun_1
+ # sql += "%s, " % random.choice(self.q_select)
# sql += "%s, " % random.choice(self.q_select)
- # sql += "%s, " % random.choice(self.q_select)
sql += "%s " % math_fun_2
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(self.q_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15973 tdSql.query(sql)
#TD-15973 self.cur1.execute(sql)
@@ -957,35 +957,35 @@ class TDTestCase:
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select ts , max(asct1) from ( select t1.ts as ts,"
- sql += "%s, " % math_fun_join_1
- sql += "%s as asct1, " % math_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "%s, " % math_fun_join_1
+ sql += "%s, " % math_fun_join_1
+ sql += "%s as asct1, " % math_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % math_fun_join_1
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s )" % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) \
or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
sql = "select max(asct1) from ( select "
- #sql += "%s, " % math_fun_join_1
- sql += "%s as asct1 " % math_fun_join_2
- # sql += "t1.%s, " % random.choice(self.q_select)
- # sql += "t2.%s, " % random.choice(self.q_select)
- # sql += "%s, " % math_fun_join_1
+ #sql += "%s, " % math_fun_join_1
+ sql += "%s as asct1 " % math_fun_join_2
+ # sql += "t1.%s, " % random.choice(self.q_select)
+ # sql += "t2.%s, " % random.choice(self.q_select)
+ # sql += "%s, " % math_fun_join_1
sql += "from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s )" % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 1-7 as math_nest from stable_1 limit 1;")
@@ -995,13 +995,13 @@ class TDTestCase:
sql = "select ts , abs(asct1) from ( select "
sql += "%s as asct1, ts ," % math_fun_1
sql += "%s as asct2, " % math_fun_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(300)
@@ -1013,11 +1013,11 @@ class TDTestCase:
sql += "from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
-
+
tdSql.query("select 1-8 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
@@ -1027,13 +1027,13 @@ class TDTestCase:
sql += "%s, " % random.choice(self.s_s_select)
sql += "%s as asct1, ts ," % math_fun_1
sql += "%s as asct2, " % math_fun_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
#tdSql.query(sql)
# tdSql.checkRows(300)
@@ -1046,7 +1046,7 @@ class TDTestCase:
sql += " from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
@@ -1056,12 +1056,12 @@ class TDTestCase:
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select ts , max(asct1) from ( select t1.ts as ts,"
- sql += "%s, " % math_fun_join_1
- sql += "%s as asct1, " % math_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % math_fun_join_1
+ sql += "%s as asct1, " % math_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "and %s " % random.choice(self.t_u_where)
@@ -1069,29 +1069,29 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM'])\
or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
- sql = "select max(asct1) from ( select "
- sql += "%s as asct1 " % math_fun_join_2
- # sql += "t1.%s, " % random.choice(self.q_select)
- # sql += "t1.%s, " % random.choice(self.q_select)
- # sql += "t2.%s, " % random.choice(self.q_select)
- # sql += "t2.%s, " % random.choice(self.q_select)
+ sql = "select max(asct1) from ( select "
+ sql += "%s as asct1 " % math_fun_join_2
+ # sql += "t1.%s, " % random.choice(self.q_select)
+ # sql += "t1.%s, " % random.choice(self.q_select)
+ # sql += "t2.%s, " % random.choice(self.q_select)
+ # sql += "t2.%s, " % random.choice(self.q_select)
sql += "from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "and %s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)# TD-16039
# self.cur1.execute(sql)
-
+
self.restartDnodes()
tdSql.query("select 1-10 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
@@ -1116,8 +1116,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
#TD-15437 self.cur1.execute(sql)
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) \
@@ -1133,11 +1133,11 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
#TD-15437 self.cur1.execute(sql)
-
+
#3 inter union not support
tdSql.query("select 1-11 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
@@ -1163,8 +1163,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15837 tdSql.query(sql)
# self.cur1.execute(sql)
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) \
@@ -1180,8 +1180,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15837 tdSql.query(sql)
#self.cur1.execute(sql)
@@ -1190,52 +1190,52 @@ class TDTestCase:
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select ts , max(asct1) from ( select t1.ts as ts,"
- sql += "%s, " % math_fun_join_1
- sql += "%s as asct1, " % math_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % math_fun_join_1
+ sql += "%s as asct1, " % math_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM'])\
or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
- sql = "select max(asct1) from ( select "
- sql += "%s as asct1 " % math_fun_join_2
+ sql = "select max(asct1) from ( select "
+ sql += "%s as asct1 " % math_fun_join_2
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
-
+
tdSql.query("select 1-13 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select ts ,"
- sql += "%s, " % math_fun_1
+ sql += "%s, " % math_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % math_fun_2
- sql += "%s " % random.choice(self.t_select)
+ sql += "%s " % random.choice(self.t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(300)
# self.cur1.execute(sql) # TD-16039
@@ -1243,21 +1243,21 @@ class TDTestCase:
or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
sql = "select "
sql += "%s " % math_fun_2
- sql += "%s " % random.choice(self.t_select)
+ sql += "%s " % random.choice(self.t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD15973 tdSql.query(sql)
#TD15973 self.cur1.execute(sql)
-
+
tdSql.query("select 1-14 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select avg(asct1),count(asct2) from ( select "
- sql += "%s as asct1, " % math_fun_1
+ sql += "%s as asct1, " % math_fun_1
sql += "%s as asct2" % math_fun_2
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
@@ -1265,63 +1265,63 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ) ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM'])\
or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
sql = "select avg(asct1) from ( select "
- sql += "%s as asct1 " % math_fun_1
+ sql += "%s as asct1 " % math_fun_1
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.partiton_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ) ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
-
+
tdSql.query("select 1-15 as math_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \
or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) :
sql = "select ts , max(asct1) from ( select t1.ts as ts,"
- sql += "%s, " % math_fun_join_1
- sql += "%s as asct1, " % math_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s " % random.choice(self.q_select)
+ sql += "%s, " % math_fun_join_1
+ sql += "%s as asct1, " % math_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s " % random.choice(self.q_select)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
- sql += ") "
+ sql += ") "
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE']) or (mathlist == ['TAIL']) or (mathlist == ['CSUM'])\
- or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
- sql = "select max(asct1) from ( select "
- sql += "%s as asct1 " % math_fun_join_2
+ or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']):
+ sql = "select max(asct1) from ( select "
+ sql += "%s as asct1 " % math_fun_join_2
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
- sql += ") "
+ sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
-
+
#taos -f sql
startTime_taos_f = time.time()
print("taos -f %s sql start!" %mathlist)
@@ -1329,271 +1329,271 @@ class TDTestCase:
_ = subprocess.check_output(taos_cmd1, shell=True).decode("utf-8")
print("taos -f %s sql over!" %mathlist)
endTime_taos_f = time.time()
- print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f))
-
- print("=========%s====over=============" %mathlist)
+ print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f))
+
+ print("=========%s====over=============" %mathlist)
def str_nest(self,strlist):
-
- print("==========%s===start=============" %strlist)
- os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
-
+
+ print("==========%s===start=============" %strlist)
+ os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
+
self.dropandcreateDB_random("%s" %self.db_nest, 1)
-
+
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['LENGTH','CHAR_LENGTH']) \
or (strlist == ['']):
- str_functions = strlist
- fun_fix_column = ['(q_nchar)','(q_binary)','(q_nchar_null)','(q_binary_null)']
+ str_functions = strlist
+ fun_fix_column = ['(q_nchar)','(q_binary)','(q_nchar_null)','(q_binary_null)']
fun_column_1 = random.sample(str_functions,1)+random.sample(fun_fix_column,1)
str_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_2 = random.sample(str_functions,1)+random.sample(fun_fix_column,1)
str_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
fun_fix_column_j = ['(t1.q_nchar)','(t1.q_binary)','(t1.q_nchar_null)','(t1.q_binary_null)',
- '(t2.q_nchar)','(t2.q_binary)','(t2.q_nchar_null)','(t2.q_binary_null)']
+ '(t2.q_nchar)','(t2.q_binary)','(t2.q_nchar_null)','(t2.q_binary_null)']
fun_column_join_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1)
str_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_join_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1)
str_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
- fun_fix_column_s = ['(q_nchar)','(q_binary)','(q_nchar_null)','(q_binary_null)','(loc)','(tbname)']
+
+ fun_fix_column_s = ['(q_nchar)','(q_binary)','(q_nchar_null)','(q_binary_null)','(loc)','(tbname)']
fun_column_s_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_s,1)
str_fun_s_1 = str(fun_column_s_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_s_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_s,1)
str_fun_s_2 = str(fun_column_s_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
fun_fix_column_s_j = ['(t1.q_nchar)','(t1.q_binary)','(t1.q_nchar_null)','(t1.q_binary_null)','(t1.loc)','(t1.tbname)',
- '(t2.q_nchar)','(t2.q_binary)','(t2.q_nchar_null)','(t2.q_binary_null)','(t2.loc)','(t2.tbname)']
+ '(t2.q_nchar)','(t2.q_binary)','(t2.q_nchar_null)','(t2.q_binary_null)','(t2.loc)','(t2.tbname)']
fun_column_join_s_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1)
str_fun_join_s_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_join_s_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1)
str_fun_join_s_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
elif (strlist == ['SUBSTR']) :
- str_functions = strlist
- pos = random.randint(1, 20)
- sub_len = random.randint(1, 10)
+ str_functions = strlist
+ pos = random.randint(1, 20)
+ sub_len = random.randint(1, 10)
fun_fix_column = ['(q_nchar,pos)','(q_binary,pos)','(q_nchar_null,pos)','(q_binary_null,pos)',
- '(q_nchar,pos,sub_len)','(q_binary,pos,sub_len)','(q_nchar_null,pos,sub_len)','(q_binary_null,pos,sub_len)',]
+ '(q_nchar,pos,sub_len)','(q_binary,pos,sub_len)','(q_nchar_null,pos,sub_len)','(q_binary_null,pos,sub_len)',]
fun_column_1 = random.sample(str_functions,1)+random.sample(fun_fix_column,1)
str_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len))
fun_column_2 = random.sample(str_functions,1)+random.sample(fun_fix_column,1)
str_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len))
-
+
fun_fix_column_j = ['(t1.q_nchar,pos)','(t1.q_binary,pos)','(t1.q_nchar_null,pos)','(t1.q_binary_null,pos)',
'(t1.q_nchar,pos,sub_len)','(t1.q_binary,pos,sub_len)','(t1.q_nchar_null,pos,sub_len)','(t1.q_binary_null,pos,sub_len)',
'(t2.q_nchar,pos)','(t2.q_binary,pos)','(t2.q_nchar_null,pos)','(t2.q_binary_null,pos)',
- '(t2.q_nchar,pos,sub_len)','(t2.q_binary,pos,sub_len)','(t2.q_nchar_null,pos,sub_len)','(t2.q_binary_null,pos,sub_len)']
+ '(t2.q_nchar,pos,sub_len)','(t2.q_binary,pos,sub_len)','(t2.q_nchar_null,pos,sub_len)','(t2.q_binary_null,pos,sub_len)']
fun_column_join_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1)
str_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len))
fun_column_join_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1)
str_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len))
-
+
fun_fix_column_s = ['(q_nchar,pos)','(q_binary,pos)','(q_nchar_null,pos)','(q_binary_null,pos)','(loc,pos)',
- '(q_nchar,pos,sub_len)','(q_binary,pos,sub_len)','(q_nchar_null,pos,sub_len)','(q_binary_null,pos,sub_len)','(loc,pos,sub_len)',]
+ '(q_nchar,pos,sub_len)','(q_binary,pos,sub_len)','(q_nchar_null,pos,sub_len)','(q_binary_null,pos,sub_len)','(loc,pos,sub_len)',]
fun_column_s_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_s,1)
str_fun_s_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len))
fun_column_s_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_s,1)
str_fun_s_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len))
-
+
fun_fix_column_s_j = ['(t1.q_nchar,pos)','(t1.q_binary,pos)','(t1.q_nchar_null,pos)','(t1.q_binary_null,pos)','(t1.loc,pos)',
'(t1.q_nchar,pos,sub_len)','(t1.q_binary,pos,sub_len)','(t1.q_nchar_null,pos,sub_len)','(t1.q_binary_null,pos,sub_len)','(t1.loc,pos,sub_len)',
'(t2.q_nchar,pos)','(t2.q_binary,pos)','(t2.q_nchar_null,pos)','(t2.q_binary_null,pos)','(t2.loc,pos)',
- '(t2.q_nchar,pos,sub_len)','(t2.q_binary,pos,sub_len)','(t2.q_nchar_null,pos,sub_len)','(t2.q_binary_null,pos,sub_len)','(t2.loc,pos,sub_len)']
+ '(t2.q_nchar,pos,sub_len)','(t2.q_binary,pos,sub_len)','(t2.q_nchar_null,pos,sub_len)','(t2.q_binary_null,pos,sub_len)','(t2.loc,pos,sub_len)']
fun_column_join_s_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_s_j,1)
str_fun_join_s_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len))
fun_column_join_s_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_s_j,1)
str_fun_join_s_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len))
-
+
elif (strlist == ['CONCAT']) :
- str_functions = strlist
- i = random.randint(2,8)
+ str_functions = strlist
+ i = random.randint(2,8)
fun_fix_column = ['q_nchar','q_nchar1','q_nchar2','q_nchar3','q_nchar4','q_nchar5','q_nchar6','q_nchar7','q_nchar8','q_nchar_null',
- 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null']
-
- column1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
+ 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null']
+
+ column1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+column1+')'
str_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","")
-
+
column2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+column2+')'
str_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","")
-
+
fun_fix_column_j = ['(t1.q_nchar)','(t1.q_nchar1)','(t1.q_nchar2)','(t1.q_nchar3)','(t1.q_nchar4)','(t1.q_nchar5)','(t1.q_nchar6)','(t1.q_nchar7)','(t1.q_nchar8)','(t1.q_nchar_null)',
'(t2.q_nchar)','(t2.q_nchar1)','(t2.q_nchar2)','(t2.q_nchar3)','(t2.q_nchar4)','(t2.q_nchar5)','(t2.q_nchar6)','(t2.q_nchar7)','(t2.q_nchar8)','(t2.q_nchar_null)',
'(t1.q_binary)','(t1.q_binary1)','(t1.q_binary2)','(t1.q_binary3)','(t1.q_binary4)','(t1.q_binary5)','(t1.q_binary6)','(t1.q_binary7)','(t1.q_binary8)','(t1.q_binary_null)',
- '(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)']
-
- column_j1 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","")
+ '(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)']
+
+ column_j1 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+column_j1+')'
str_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","")
-
- column_j2 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","")
+
+ column_j2 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+column_j2+')'
str_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
-
+
fun_fix_column_s = ['q_nchar','q_nchar1','q_nchar2','q_nchar3','q_nchar4','q_nchar5','q_nchar6','q_nchar7','q_nchar8','loc','q_nchar_null',
- 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null']
-
- column_s1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
+ 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null']
+
+ column_s1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
fun_column_s_1 = str(random.sample(str_functions,1))+'('+column_s1+')'
str_fun_s_1 = str(fun_column_s_1).replace("[","").replace("]","").replace("'","")
-
- column_s2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
+
+ column_s2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
fun_column_s_2 = str(random.sample(str_functions,1))+'('+column_s2+')'
str_fun_s_2 = str(fun_column_s_2).replace("[","").replace("]","").replace("'","")
-
+
fun_fix_column_s_j = ['(t1.q_nchar)','(t1.q_nchar1)','(t1.q_nchar2)','(t1.q_nchar3)','(t1.q_nchar4)','(t1.q_nchar5)','(t1.q_nchar6)','(t1.q_nchar7)','(t1.q_nchar8)','(t1.q_nchar_null)','(t1.loc)',
'(t2.q_nchar)','(t2.q_nchar1)','(t2.q_nchar2)','(t2.q_nchar3)','(t2.q_nchar4)','(t2.q_nchar5)','(t2.q_nchar6)','(t2.q_nchar7)','(t2.q_nchar8)','(t2.q_nchar_null)','(t2.loc)',
'(t1.q_binary)','(t1.q_binary1)','(t1.q_binary2)','(t1.q_binary3)','(t1.q_binary4)','(t1.q_binary5)','(t1.q_binary6)','(t1.q_binary7)','(t1.q_binary8)','(t1.q_binary_null)',
'(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)']
-
- column_j_s1 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","")
+
+ column_j_s1 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","")
fun_column_join_s_1 = str(random.sample(str_functions,1))+'('+column_j_s1+')'
str_fun_join_s_1 = str(fun_column_join_s_1).replace("[","").replace("]","").replace("'","")
-
- column_j_s2 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","")
+
+ column_j_s2 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","")
fun_column_join_s_2 = str(random.sample(str_functions,1))+'('+column_j_s2+')'
str_fun_join_s_2 = str(fun_column_join_s_2).replace("[","").replace("]","").replace("'","")
-
+
elif (strlist == ['CONCAT_WS']):
- str_functions = strlist
- i = random.randint(2,8)
+ str_functions = strlist
+ i = random.randint(2,8)
fun_fix_column = ['q_nchar','q_nchar1','q_nchar2','q_nchar3','q_nchar4','q_nchar5','q_nchar6','q_nchar7','q_nchar8','q_nchar_null',
- 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null']
-
+ 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null']
+
separators = ['',' ','abc','123','!','@','#','$','%','^','&','*','(',')','-','_','+','=','{',
'[','}',']','|',';',':',',','.','<','>','?','/','~','`','taos','涛思']
- separator = str(random.sample(separators,i)).replace("[","").replace("]","")
-
- column1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
+ separator = str(random.sample(separators,i)).replace("[","").replace("]","")
+
+ column1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column1+')'
str_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","")
-
+
column2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column2+')'
str_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","")
-
+
fun_fix_column_j = ['(t1.q_nchar)','(t1.q_nchar1)','(t1.q_nchar2)','(t1.q_nchar3)','(t1.q_nchar4)','(t1.q_nchar5)','(t1.q_nchar6)','(t1.q_nchar7)','(t1.q_nchar8)','(t1.q_nchar_null)',
'(t2.q_nchar)','(t2.q_nchar1)','(t2.q_nchar2)','(t2.q_nchar3)','(t2.q_nchar4)','(t2.q_nchar5)','(t2.q_nchar6)','(t2.q_nchar7)','(t2.q_nchar8)','(t2.q_nchar_null)',
'(t1.q_binary)','(t1.q_binary1)','(t1.q_binary2)','(t1.q_binary3)','(t1.q_binary4)','(t1.q_binary5)','(t1.q_binary6)','(t1.q_binary7)','(t1.q_binary8)','(t1.q_binary_null)',
- '(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)']
-
- column_j1 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","")
+ '(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)']
+
+ column_j1 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_j1+')'
str_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","")
-
- column_j2 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","")
+
+ column_j2 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_j2+')'
str_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
-
+
fun_fix_column_s = ['q_nchar','q_nchar1','q_nchar2','q_nchar3','q_nchar4','q_nchar5','q_nchar6','q_nchar7','q_nchar8','loc','q_nchar_null',
- 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null']
-
- column_s1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
+ 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null']
+
+ column_s1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
fun_column_s_1 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_s1+')'
str_fun_s_1 = str(fun_column_s_1).replace("[","").replace("]","").replace("'","")
-
- column_s2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
+
+ column_s2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","")
fun_column_s_2 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_s2+')'
str_fun_s_2 = str(fun_column_s_2).replace("[","").replace("]","").replace("'","")
-
+
fun_fix_column_s_j = ['(t1.q_nchar)','(t1.q_nchar1)','(t1.q_nchar2)','(t1.q_nchar3)','(t1.q_nchar4)','(t1.q_nchar5)','(t1.q_nchar6)','(t1.q_nchar7)','(t1.q_nchar8)','(t1.q_nchar_null)','(t1.loc)',
'(t2.q_nchar)','(t2.q_nchar1)','(t2.q_nchar2)','(t2.q_nchar3)','(t2.q_nchar4)','(t2.q_nchar5)','(t2.q_nchar6)','(t2.q_nchar7)','(t2.q_nchar8)','(t2.q_nchar_null)','(t2.loc)',
'(t1.q_binary)','(t1.q_binary1)','(t1.q_binary2)','(t1.q_binary3)','(t1.q_binary4)','(t1.q_binary5)','(t1.q_binary6)','(t1.q_binary7)','(t1.q_binary8)','(t1.q_binary_null)',
'(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)']
-
- column_j_s1 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","")
+
+ column_j_s1 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","")
fun_column_join_s_1 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_j_s1+')'
str_fun_join_s_1 = str(fun_column_join_s_1).replace("[","").replace("]","").replace("'","")
-
- column_j_s2 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","")
+
+ column_j_s2 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","")
fun_column_join_s_2 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_j_s2+')'
str_fun_join_s_2 = str(fun_column_join_s_2).replace("[","").replace("]","").replace("'","")
-
-
+
+
tdSql.query("select 1-1 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']) :
- sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select "
- sql += "%s as asct1, " % str_fun_1
- sql += "%s as asct2, " % str_fun_2
+ sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select "
+ sql += "%s as asct1, " % str_fun_1
+ sql += "%s as asct2, " % str_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (strlist == ['LENGTH','CHAR_LENGTH']):
- sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select "
- sql += "%s as asct1, " % str_fun_1
- sql += "%s as asct2, " % str_fun_2
+ sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select "
+ sql += "%s as asct1, " % str_fun_1
+ sql += "%s as asct2, " % str_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-2 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']) :
sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select "
- sql += "%s as asct1, " % str_fun_1
+ sql += "%s as asct1, " % str_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s )" % random.choice(self.order_where)
- sql += "%s " % random.choice(self.unionall_or_union)
+ sql += "%s " % random.choice(self.unionall_or_union)
sql += "select ts , asct2 from ( select "
- sql += "%s as asct2, " % str_fun_2
+ sql += "%s as asct2, " % str_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
#sql += "%s " % random.choice(having_support)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
- #TD-15437 self.cur1.execute(sql)
- elif (strlist == ['LENGTH','CHAR_LENGTH']):
+ #TD-15437 self.cur1.execute(sql)
+ elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select "
- sql += "%s as asct1, " % str_fun_1
+ sql += "%s as asct1, " % str_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s )" % random.choice(self.order_where)
- sql += "%s " % random.choice(self.unionall_or_union)
+ sql += "%s " % random.choice(self.unionall_or_union)
sql += "select ts , asct2 from ( select "
- sql += "%s as asct2, " % str_fun_2
+ sql += "%s as asct2, " % str_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
#sql += "%s " % random.choice(having_support)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
- #TD-15437 self.cur1.execute(sql)
-
+ #TD-15437 self.cur1.execute(sql)
+
tdSql.query("select 1-3 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
@@ -1601,20 +1601,20 @@ class TDTestCase:
sql += "%s as asct1, ts ," % str_fun_1
sql += "%s as asct2, " % str_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s select " % random.choice(self.unionall_or_union)
+ sql += "%s select " % random.choice(self.unionall_or_union)
sql += "%s as asct2, ts ," % str_fun_2
sql += "%s as asct1, " % str_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_2 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15473 tdSql.query(sql)
#self.cur1.execute(sql)
elif (strlist == ['LENGTH','CHAR_LENGTH']):
@@ -1622,88 +1622,88 @@ class TDTestCase:
sql += "%s as asct1, ts ," % str_fun_1
sql += "%s as asct2, " % str_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s select " % random.choice(self.unionall_or_union)
+ sql += "%s select " % random.choice(self.unionall_or_union)
sql += "%s as asct2, ts ," % str_fun_2
sql += "%s as asct1, " % str_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_2 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15473 tdSql.query(sql)
#self.cur1.execute(sql)
-
+
tdSql.query("select 1-4 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_1
- sql += "%s as asct1, " % str_fun_join_2
- sql += "%s, " % str_fun_join_1
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s as asct2, " % str_fun_join_1
+ sql += "%s as asct1, " % str_fun_join_2
+ sql += "%s, " % str_fun_join_1
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_1
- sql += "%s as asct1, " % str_fun_join_2
- sql += "%s, " % str_fun_join_1
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s as asct2, " % str_fun_join_1
+ sql += "%s as asct1, " % str_fun_join_2
+ sql += "%s, " % str_fun_join_1
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-5 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
sql = "select ts ,"
- sql += "%s, " % str_fun_1
+ sql += "%s, " % str_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % str_fun_2
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select ts ,"
- sql += "%s, " % str_fun_1
+ sql += "%s, " % str_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % str_fun_2
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
@@ -1712,34 +1712,34 @@ class TDTestCase:
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_1
- sql += "%s as asct1, " % str_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "%s, " % str_fun_join_1
+ sql += "%s as asct2, " % str_fun_join_1
+ sql += "%s as asct1, " % str_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % str_fun_join_1
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s )" % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_1
- sql += "%s as asct1, " % str_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "%s, " % str_fun_join_1
+ sql += "%s as asct2, " % str_fun_join_1
+ sql += "%s as asct1, " % str_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % str_fun_join_1
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s )" % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 1-7 as str_nest from stable_1 limit 1;")
@@ -1748,13 +1748,13 @@ class TDTestCase:
sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select "
sql += "%s as asct1, ts ," % str_fun_s_1
sql += "%s as asct2, " % str_fun_s_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(300)
@@ -1763,17 +1763,17 @@ class TDTestCase:
sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select "
sql += "%s as asct1, ts ," % str_fun_s_1
sql += "%s as asct2, " % str_fun_s_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
-
+
tdSql.query("select 1-8 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
@@ -1782,13 +1782,13 @@ class TDTestCase:
sql += "%s, " % random.choice(self.s_s_select)
sql += "%s as asct1, ts ," % str_fun_s_1
sql += "%s as asct2, " % str_fun_s_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(300)
@@ -1799,13 +1799,13 @@ class TDTestCase:
sql += "%s, " % random.choice(self.s_s_select)
sql += "%s as asct1, ts ," % str_fun_s_1
sql += "%s as asct2, " % str_fun_s_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
@@ -1814,12 +1814,12 @@ class TDTestCase:
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_s_1
- sql += "%s as asct1, " % str_fun_join_s_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s as asct2, " % str_fun_join_s_1
+ sql += "%s as asct1, " % str_fun_join_s_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "and %s " % random.choice(self.t_u_where)
@@ -1827,18 +1827,18 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_s_1
- sql += "%s as asct1, " % str_fun_join_s_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s as asct2, " % str_fun_join_s_1
+ sql += "%s as asct1, " % str_fun_join_s_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "and %s " % random.choice(self.t_u_where)
@@ -1846,11 +1846,11 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
-
+
self.restartDnodes()
tdSql.query("select 1-10 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
@@ -1874,8 +1874,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
#TD-15437 self.cur1.execute(sql)
elif (strlist == ['LENGTH','CHAR_LENGTH']):
@@ -1898,11 +1898,11 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
#TD-15437 self.cur1.execute(sql)
-
+
#3 inter union not support
tdSql.query("select 1-11 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
@@ -1927,8 +1927,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15837 tdSql.query(sql)
# self.cur1.execute(sql)
elif (strlist == ['LENGTH','CHAR_LENGTH']):
@@ -1952,8 +1952,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15837 tdSql.query(sql)
# self.cur1.execute(sql)
@@ -1961,81 +1961,81 @@ class TDTestCase:
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_s_1
- sql += "%s as asct1, " % str_fun_join_s_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s as asct2, " % str_fun_join_s_1
+ sql += "%s as asct1, " % str_fun_join_s_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_s_1
- sql += "%s as asct1, " % str_fun_join_s_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s as asct2, " % str_fun_join_s_1
+ sql += "%s as asct1, " % str_fun_join_s_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
-
+
tdSql.query("select 1-13 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
sql = "select ts ,"
- sql += "%s, " % str_fun_1
+ sql += "%s, " % str_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % str_fun_2
- sql += "%s " % random.choice(self.t_select)
+ sql += "%s " % random.choice(self.t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(300)
# self.cur1.execute(sql) # TD-16039
elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select ts ,"
- sql += "%s, " % str_fun_1
+ sql += "%s, " % str_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % str_fun_2
- sql += "%s " % random.choice(self.t_select)
+ sql += "%s " % random.choice(self.t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(300)
# self.cur1.execute(sql)# TD-16039
-
+
tdSql.query("select 1-14 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
sql = "select LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select "
- sql += "%s as asct1, " % str_fun_s_1
+ sql += "%s as asct1, " % str_fun_s_1
sql += "%s as asct2" % str_fun_s_2
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
@@ -2043,13 +2043,13 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ) ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select "
- sql += "%s as asct1, " % str_fun_s_1
+ sql += "%s as asct1, " % str_fun_s_1
sql += "%s as asct2" % str_fun_s_2
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
@@ -2057,54 +2057,54 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ) ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
-
+
tdSql.query("select 1-15 as str_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']):
sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_s_1
- sql += "%s as asct1, " % str_fun_join_s_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s " % random.choice(self.q_select)
+ sql += "%s as asct2, " % str_fun_join_s_1
+ sql += "%s as asct1, " % str_fun_join_s_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s " % random.choice(self.q_select)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
- sql += ") "
+ sql += ") "
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15955 tdSql.query(sql)
- #TD-15955 self.cur1.execute(sql)
+ #TD-15955 self.cur1.execute(sql)
elif (strlist == ['LENGTH','CHAR_LENGTH']):
sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % str_fun_join_s_1
- sql += "%s as asct1, " % str_fun_join_s_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s " % random.choice(self.q_select)
+ sql += "%s as asct2, " % str_fun_join_s_1
+ sql += "%s as asct1, " % str_fun_join_s_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s " % random.choice(self.q_select)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
- sql += ") "
+ sql += ") "
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15955 tdSql.query(sql)
- #TD-15955 self.cur1.execute(sql)
-
+ #TD-15955 self.cur1.execute(sql)
+
#taos -f sql
startTime_taos_f = time.time()
print("taos -f %s sql start!" %strlist)
@@ -2112,169 +2112,169 @@ class TDTestCase:
_ = subprocess.check_output(taos_cmd1, shell=True).decode("utf-8")
print("taos -f %s sql over!" %strlist)
endTime_taos_f = time.time()
- print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f))
-
- print("=========%s====over=============" %strlist)
-
+ print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f))
+
+ print("=========%s====over=============" %strlist)
+
def time_nest(self,timelist):
-
- print("==========%s===start=============" %timelist)
- os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
-
+
+ print("==========%s===start=============" %timelist)
+ os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
+
self.dropandcreateDB_random("%s" %self.db_nest, 1)
-
+
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMEZONE']):
- time_functions = timelist
- fun_fix_column = ['()']
+ time_functions = timelist
+ fun_fix_column = ['()']
fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
- fun_fix_column_j = ['()']
+
+ fun_fix_column_j = ['()']
fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","")
elif (timelist == ['TIMETRUNCATE']):
- time_functions = timelist
-
- t = time.time()
- t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t))
+ time_functions = timelist
+
+ t = time.time()
+ t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t))
fun_fix_column = ['q_ts','ts','_c0','_C0','_rowts','1600000000000','1600000000000000','1600000000000000000',
- '%d' %t, '%d000' %t, '%d000000' %t,'t_to_s']
-
- timeunits = ['1u' , '1a' ,'1s', '1m' ,'1h', '1d']
- timeunit = str(random.sample(timeunits,1)).replace("[","").replace("]","").replace("'","")
-
- column_1 = ['(%s,timeutil)'%(random.sample(fun_fix_column,1))]
+ '%d' %t, '%d000' %t, '%d000000' %t,'t_to_s']
+
+ timeunits = ['1u' , '1a' ,'1s', '1m' ,'1h', '1d']
+ timeunit = str(random.sample(timeunits,1)).replace("[","").replace("]","").replace("'","")
+
+ column_1 = ['(%s,timeutil)'%(random.sample(fun_fix_column,1))]
fun_column_1 = random.sample(time_functions,1)+random.sample(column_1,1)
time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'")
time_fun_1 = str(time_fun_1).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s)
-
- column_2 = ['(%s,timeutil)'%(random.sample(fun_fix_column,1))]
+
+ column_2 = ['(%s,timeutil)'%(random.sample(fun_fix_column,1))]
fun_column_2 = random.sample(time_functions,1)+random.sample(column_2,1)
time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'")
time_fun_2 = str(time_fun_2).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s)
-
-
+
+
fun_fix_column_j = ['(t1.q_ts)','(t1.ts)', '(t2.q_ts)','(t2.ts)','(1600000000000)','(1600000000000000)','(1600000000000000000)',
- '(%d)' %t, '(%d000)' %t, '(%d000000)' %t,'t_to_s']
-
- column_j1 = ['(%s,timeutil)'%(random.sample(fun_fix_column_j,1))]
+ '(%d)' %t, '(%d000)' %t, '(%d000000)' %t,'t_to_s']
+
+ column_j1 = ['(%s,timeutil)'%(random.sample(fun_fix_column_j,1))]
fun_column_join_1 = random.sample(time_functions,1)+random.sample(column_j1,1)
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'")
time_fun_join_1 = str(time_fun_join_1).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s)
-
- column_j2 = ['(%s,timeutil)'%(random.sample(fun_fix_column_j,1))]
+
+ column_j2 = ['(%s,timeutil)'%(random.sample(fun_fix_column_j,1))]
fun_column_join_2 = random.sample(time_functions,1)+random.sample(column_j2,1)
time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'")
time_fun_join_2 = str(time_fun_join_2).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s)
elif (timelist == ['TO_ISO8601']):
- time_functions = timelist
-
- t = time.time()
+ time_functions = timelist
+
+ t = time.time()
fun_fix_column = ['(now())','(ts)','(q_ts)','(_rowts)','(_c0)','(_C0)',
'(1600000000000)','(1600000000000000)','(1600000000000000000)',
- '(%d)' %t, '(%d000)' %t, '(%d000000)' %t]
-
+ '(%d)' %t, '(%d000)' %t, '(%d000000)' %t]
+
fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
fun_fix_column_j = ['(t1.q_ts)','(t1.ts)', '(t2.q_ts)','(t2.ts)','(1600000000000)','(1600000000000000)','(1600000000000000000)','(now())',
- '(%d)' %t, '(%d000)' %t, '(%d000000)' %t]
-
+ '(%d)' %t, '(%d000)' %t, '(%d000000)' %t]
+
fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","")
elif (timelist == ['TO_UNIXTIMESTAMP']):
- time_functions = timelist
-
- t = time.time()
- t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t))
- fun_fix_column = ['(q_nchar)','(q_nchar1)','(q_nchar2)','(q_nchar3)','(q_nchar4)','(q_nchar_null)','(q_binary)','(q_binary5)','(q_binary6)','(q_binary7)','(q_binary8)','(q_binary_null)','(t_to_s)']
-
+ time_functions = timelist
+
+ t = time.time()
+ t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t))
+ fun_fix_column = ['(q_nchar)','(q_nchar1)','(q_nchar2)','(q_nchar3)','(q_nchar4)','(q_nchar_null)','(q_binary)','(q_binary5)','(q_binary6)','(q_binary7)','(q_binary8)','(q_binary_null)','(t_to_s)']
+
fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'")
time_fun_1 = str(time_fun_1).replace("t_to_s","%s" %t_to_s)
-
+
fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'")
time_fun_2 = str(time_fun_2).replace("t_to_s","%s" %t_to_s)
-
- fun_fix_column_j = ['(t1.q_nchar)','(t1.q_binary)', '(t2.q_nchar)','(t2.q_binary)','(t_to_s)']
-
+
+ fun_fix_column_j = ['(t1.q_nchar)','(t1.q_binary)', '(t2.q_nchar)','(t2.q_binary)','(t_to_s)']
+
fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'")
time_fun_join_1 = str(time_fun_join_1).replace("t_to_s","%s" %t_to_s)
-
+
fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'")
time_fun_join_2 = str(time_fun_join_2).replace("t_to_s","%s" %t_to_s)
elif (timelist == ['TIMEDIFF']):
- time_functions = timelist
-
- t = time.time()
- t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t))
- fun_fix_column = ['(q_nchar)','(q_nchar1)','(q_nchar2)','(q_nchar3)','(q_nchar4)','(q_nchar_null)','(q_binary)','(q_binary5)','(q_binary6)','(q_binary7)','(q_binary8)','(q_binary_null)','(t_to_s)']
-
+ time_functions = timelist
+
+ t = time.time()
+ t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t))
+ fun_fix_column = ['(q_nchar)','(q_nchar1)','(q_nchar2)','(q_nchar3)','(q_nchar4)','(q_nchar_null)','(q_binary)','(q_binary5)','(q_binary6)','(q_binary7)','(q_binary8)','(q_binary_null)','(t_to_s)']
+
fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'")
time_fun_1 = str(time_fun_1).replace("t_to_s","%s" %t_to_s)
-
+
fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'")
time_fun_2 = str(time_fun_2).replace("t_to_s","%s" %t_to_s)
-
- fun_fix_column_j = ['(t1.q_nchar)','(t1.q_binary)', '(t2.q_nchar)','(t2.q_binary)','(t_to_s)']
-
+
+ fun_fix_column_j = ['(t1.q_nchar)','(t1.q_binary)', '(t2.q_nchar)','(t2.q_binary)','(t_to_s)']
+
fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'")
time_fun_join_1 = str(time_fun_join_1).replace("t_to_s","%s" %t_to_s)
-
+
fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'")
time_fun_join_2 = str(time_fun_join_2).replace("t_to_s","%s" %t_to_s)
elif (timelist == ['ELAPSED']):
- time_functions = timelist
-
- fun_fix_column = ['(ts)','(q_ts)','(_c0)','(_C0)','(_rowts)','(ts,time_unit)','(_c0,time_unit)','(_C0,time_unit)','(_rowts,time_unit)']
-
- time_units = ['nums','numm','numh','numd','numa']
- time_unit = str(random.sample(time_units,1)).replace("[","").replace("]","").replace("'","")
- time_num1 = random.randint(0, 1000)
- time_unit1 = time_unit.replace("num","%d" %time_num1)
- time_num2 = random.randint(0, 1000)
- time_unit2 = time_unit.replace("num","%d" %time_num2)
-
+ time_functions = timelist
+
+ fun_fix_column = ['(ts)','(q_ts)','(_c0)','(_C0)','(_rowts)','(ts,time_unit)','(_c0,time_unit)','(_C0,time_unit)','(_rowts,time_unit)']
+
+ time_units = ['nums','numm','numh','numd','numa']
+ time_unit = str(random.sample(time_units,1)).replace("[","").replace("]","").replace("'","")
+ time_num1 = random.randint(0, 1000)
+ time_unit1 = time_unit.replace("num","%d" %time_num1)
+ time_num2 = random.randint(0, 1000)
+ time_unit2 = time_unit.replace("num","%d" %time_num2)
+
fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("time_unit","%s" %time_unit1)
-
+
fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1)
time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("time_unit","%s" %time_unit2)
-
-
- fun_fix_column_j = ['(t1.ts)','(t1.q_ts)', '(t2.ts)','(t2.q_ts)','(t1.ts,time_unit)','(t1.q_ts,time_unit)','(t2.ts,time_unit)','(t2.q_ts,time_unit)']
-
+
+
+ fun_fix_column_j = ['(t1.ts)','(t1.q_ts)', '(t2.ts)','(t2.q_ts)','(t1.ts,time_unit)','(t1.q_ts,time_unit)','(t2.ts,time_unit)','(t2.q_ts,time_unit)']
+
fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("time_unit","%s" %time_unit1)
-
+
fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1)
time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("time_unit","%s" %time_unit2)
-
-
+
+
elif (timelist == ['CAST']) :
- str_functions = timelist
+ str_functions = timelist
#下面的4个是全的,这个只是1个
i = random.randint(1,4)
if i ==1:
@@ -2282,33 +2282,33 @@ class TDTestCase:
fun_fix_column = ['q_bool','q_bool_null','q_bigint','q_bigint_null','q_smallint','q_smallint_null',
'q_tinyint','q_tinyint_null','q_int','q_int_null','q_float','q_float_null','q_double','q_double_null']
type_names = ['BIGINT','BINARY(100)','TIMESTAMP','NCHAR(100)','BIGINT UNSIGNED']
-
- type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+
+ type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')'
time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","")
-
- type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+
+ type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')'
time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","")
-
+
fun_fix_column_j = ['t1.q_bool','t1.q_bool_null','t1.q_bigint','t1.q_bigint_null','t1.q_smallint','t1.q_smallint_null',
't1.q_tinyint','t1.q_tinyint_null','t1.q_int','t1.q_int_null','t1.q_float','t1.q_float_null','t1.q_double','t1.q_double_null',
't2.q_bool','t2.q_bool_null','t2.q_bigint','t2.q_bigint_null','t2.q_smallint','t2.q_smallint_null',
- 't2.q_tinyint','t2.q_tinyint_null','t2.q_int','t2.q_int_null','t2.q_float','t2.q_float_null','t2.q_double','t2.q_double_null']
-
- type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ 't2.q_tinyint','t2.q_tinyint_null','t2.q_int','t2.q_int_null','t2.q_float','t2.q_float_null','t2.q_double','t2.q_double_null']
+
+ type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')'
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","")
-
- type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+
+ type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')'
- time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
-
+ time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
+
elif i==2:
print('===========cast_2===========')
fun_fix_column = ['q_binary','q_binary_null','q_binary1','q_binary2','q_binary3','q_binary4']
type_names = ['BIGINT','BINARY(100)','NCHAR(100)','BIGINT UNSIGNED']
-
+
type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')'
time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","")
@@ -2316,279 +2316,279 @@ class TDTestCase:
type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')'
time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","")
-
+
fun_fix_column_j = ['t1.q_binary','t1.q_binary_null','t1.q_binary1','t1.q_binary2','t1.q_binary3','t1.q_smallint_null','t1.q_binary4',
- 't2.q_binary','t2.q_binary_null','t2.q_bigint','t2.q_binary1','t2.q_binary2','t2.q_binary3','t2.q_binary4']
-
- type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ 't2.q_binary','t2.q_binary_null','t2.q_bigint','t2.q_binary1','t2.q_binary2','t2.q_binary3','t2.q_binary4']
+
+ type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')'
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","")
-
- type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+
+ type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')'
- time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
-
+ time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
+
elif i==3:
print('===========cast_3===========')
fun_fix_column = ['q_nchar','q_nchar_null','q_nchar5','q_nchar6','q_nchar7','q_nchar8']
type_names = ['BIGINT','NCHAR(100)','BIGINT UNSIGNED']
-
+
type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')'
- time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","")
+ time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","")
type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')'
- time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","")
-
+ time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","")
+
fun_fix_column_j = ['t1.q_nchar','t1.q_nchar_null','t1.q_nchar5','t1.q_nchar6','t1.q_nchar7','t1.q_nchar8',
- 't2.q_nchar','t2.q_nchar_null','t2.q_nchar5','t2.q_nchar6','t2.q_nchar7','t2.q_nchar8']
-
- type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ 't2.q_nchar','t2.q_nchar_null','t2.q_nchar5','t2.q_nchar6','t2.q_nchar7','t2.q_nchar8']
+
+ type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')'
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","")
-
- type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+
+ type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')'
- time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
-
+ time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
+
elif i==4:
print('===========cast_4===========')
fun_fix_column = ['q_ts','q_ts_null','_C0','_c0','ts','_rowts']
type_names = ['BIGINT','TIMESTAMP','BIGINT UNSIGNED']
-
+
type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')'
- time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","")
-
+ time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","")
+
type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')'
- time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","")
-
- fun_fix_column_j = ['t1.q_ts','t1.q_ts_null','t1.ts','t2.q_ts','t2.q_ts_null','t2.ts']
-
- type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","")
+
+ fun_fix_column_j = ['t1.q_ts','t1.q_ts_null','t1.ts','t2.q_ts','t2.q_ts_null','t2.ts']
+
+ type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')'
time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","")
-
- type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+
+ type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')'
- time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
-
+ time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","")
+
elif (timelist == ['CAST_1']) :
- str_functions = timelist
-
+ str_functions = timelist
+
print('===========cast_1===========')
fun_fix_column = ['q_bool','q_bool_null','q_bigint','q_bigint_null','q_smallint','q_smallint_null',
'q_tinyint','q_tinyint_null','q_int','q_int_null','q_float','q_float_null','q_double','q_double_null']
type_names = ['BIGINT','BINARY(100)','TIMESTAMP','NCHAR(100)','BIGINT UNSIGNED']
-
- type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+
+ type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')'
- time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_1","")
-
- type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_1","")
+
+ type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')'
- time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_1","")
-
+ time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_1","")
+
fun_fix_column_j = ['t1.q_bool','t1.q_bool_null','t1.q_bigint','t1.q_bigint_null','t1.q_smallint','t1.q_smallint_null',
't1.q_tinyint','t1.q_tinyint_null','t1.q_int','t1.q_int_null','t1.q_float','t1.q_float_null','t1.q_double','t1.q_double_null',
't2.q_bool','t2.q_bool_null','t2.q_bigint','t2.q_bigint_null','t2.q_smallint','t2.q_smallint_null',
- 't2.q_tinyint','t2.q_tinyint_null','t2.q_int','t2.q_int_null','t2.q_float','t2.q_float_null','t2.q_double','t2.q_double_null']
-
- type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ 't2.q_tinyint','t2.q_tinyint_null','t2.q_int','t2.q_int_null','t2.q_float','t2.q_float_null','t2.q_double','t2.q_double_null']
+
+ type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')'
- time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_1","")
-
- type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_1","")
+
+ type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')'
- time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_1","")
-
+ time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_1","")
+
elif (timelist == ['CAST_2']) :
- str_functions = timelist
+ str_functions = timelist
print('===========cast_2===========')
fun_fix_column = ['q_binary','q_binary_null','q_binary1','q_binary2','q_binary3','q_binary4']
type_names = ['BIGINT','BINARY(100)','NCHAR(100)','BIGINT UNSIGNED']
-
+
type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')'
- time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_2","")
+ time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_2","")
type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')'
- time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_2","")
-
+ time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_2","")
+
fun_fix_column_j = ['t1.q_binary','t1.q_binary_null','t1.q_binary1','t1.q_binary2','t1.q_binary3','t1.q_smallint_null','t1.q_binary4',
- 't2.q_binary','t2.q_binary_null','t2.q_bigint','t2.q_binary1','t2.q_binary2','t2.q_binary3','t2.q_binary4']
-
- type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ 't2.q_binary','t2.q_binary_null','t2.q_bigint','t2.q_binary1','t2.q_binary2','t2.q_binary3','t2.q_binary4']
+
+ type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')'
- time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_2","")
-
- type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_2","")
+
+ type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')'
- time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_2","")
-
+ time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_2","")
+
elif (timelist == ['CAST_3']) :
- str_functions = timelist
+ str_functions = timelist
print('===========cast_3===========')
fun_fix_column = ['q_nchar','q_nchar_null','q_nchar5','q_nchar6','q_nchar7','q_nchar8']
type_names = ['BIGINT','NCHAR(100)','BIGINT UNSIGNED']
-
+
type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')'
- time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_3","")
+ time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_3","")
type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')'
- time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_3","")
-
+ time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_3","")
+
fun_fix_column_j = ['t1.q_nchar','t1.q_nchar_null','t1.q_nchar5','t1.q_nchar6','t1.q_nchar7','t1.q_nchar8',
- 't2.q_nchar','t2.q_nchar_null','t2.q_nchar5','t2.q_nchar6','t2.q_nchar7','t2.q_nchar8']
-
- type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ 't2.q_nchar','t2.q_nchar_null','t2.q_nchar5','t2.q_nchar6','t2.q_nchar7','t2.q_nchar8']
+
+ type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')'
- time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_3","")
-
- type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_3","")
+
+ type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')'
- time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_3","")
-
+ time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_3","")
+
elif (timelist == ['CAST_4']) :
- str_functions = timelist
+ str_functions = timelist
print('===========cast_4===========')
fun_fix_column = ['q_ts','q_ts_null','_C0','_c0','ts','_rowts']
type_names = ['BIGINT','TIMESTAMP','BIGINT UNSIGNED']
-
+
type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')'
- time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_4","")
-
+ time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_4","")
+
type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')'
- time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_4","")
-
- fun_fix_column_j = ['t1.q_ts','t1.q_ts_null','t1.ts','t2.q_ts','t2.q_ts_null','t2.ts']
-
- type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_4","")
+
+ fun_fix_column_j = ['t1.q_ts','t1.q_ts_null','t1.ts','t2.q_ts','t2.q_ts_null','t2.ts']
+
+ type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')'
- time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_4","")
-
- type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
+ time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_4","")
+
+ type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","")
fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')'
- time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_4","")
-
+ time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_4","")
+
tdSql.query("select 1-1 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
- sql = "select ts , timediff(asct1,now) from ( select "
- sql += "%s as asct1, " % time_fun_1
- sql += "%s as asct2, " % time_fun_2
+ sql = "select ts , timediff(asct1,now) from ( select "
+ sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct2, " % time_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (timelist == ['TIMEZONE']) \
or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
- sql = "select ts , asct1,now(),today(),timezone() from ( select "
- sql += "%s as asct1, " % time_fun_1
- sql += "%s as asct2, " % time_fun_2
+ sql = "select ts , asct1,now(),today(),timezone() from ( select "
+ sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct2, " % time_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (timelist == ['ELAPSED']) :
- sql = "select max(asct1),now(),today(),timezone() from ( select "
- sql += "%s as asct1, " % time_fun_1
- sql += "%s as asct2 " % time_fun_2
+ sql = "select max(asct1),now(),today(),timezone() from ( select "
+ sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct2 " % time_fun_2
sql += "from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-2 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
sql = "select ts , timediff(asct1,now),now(),today(),timezone() from ( select "
- sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct1, " % time_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s )" % random.choice(self.order_where)
- sql += "%s " % random.choice(self.unionall_or_union)
+ sql += "%s " % random.choice(self.unionall_or_union)
sql += "select ts , timediff(asct2,now),now(),today(),timezone() from ( select "
- sql += "%s as asct2, " % time_fun_2
+ sql += "%s as asct2, " % time_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
#sql += "%s " % random.choice(having_support)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
- #TD-15437 self.cur1.execute(sql)
+ #TD-15437 self.cur1.execute(sql)
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts , (asct1),now(),today(),timezone() from ( select "
- sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct1, " % time_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s )" % random.choice(self.order_where)
- sql += "%s " % random.choice(self.unionall_or_union)
+ sql += "%s " % random.choice(self.unionall_or_union)
sql += "select ts , asct2,now(),today(),timezone() from ( select "
- sql += "%s as asct2, " % time_fun_2
+ sql += "%s as asct2, " % time_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
- #TD-15437 self.cur1.execute(sql)
- elif (timelist == ['ELAPSED']) :
+ #TD-15437 self.cur1.execute(sql)
+ elif (timelist == ['ELAPSED']) :
sql = "select min(asct1),now(),today(),timezone() from ( select "
- sql += "%s as asct1 " % time_fun_1
+ sql += "%s as asct1 " % time_fun_1
sql += " from regular_table_1 where "
sql += "%s )" % random.choice(self.q_where)
- sql += "%s " % random.choice(self.unionall_or_union)
+ sql += "%s " % random.choice(self.unionall_or_union)
sql += "select avg(asct2),now(),today(),timezone() from ( select "
- sql += "%s as asct2 " % time_fun_2
+ sql += "%s as asct2 " % time_fun_2
sql += " from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
- self.cur1.execute(sql)
-
+ self.cur1.execute(sql)
+
tdSql.query("select 1-3 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
@@ -2597,20 +2597,20 @@ class TDTestCase:
sql += "%s as asct1, ts ," % time_fun_1
sql += "%s as asct2, " % time_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s select " % random.choice(self.unionall_or_union)
+ sql += "%s select " % random.choice(self.unionall_or_union)
sql += "%s as asct2, ts ," % time_fun_2
sql += "%s as asct1, " % time_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_2 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15473 tdSql.query(sql)
#self.cur1.execute(sql)
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
@@ -2618,167 +2618,167 @@ class TDTestCase:
sql += "%s as asct1, ts ," % time_fun_1
sql += "%s as asct2, " % time_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s select " % random.choice(self.unionall_or_union)
+ sql += "%s select " % random.choice(self.unionall_or_union)
sql += "%s as asct2, ts ," % time_fun_2
sql += "%s as asct1, " % time_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_2 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15473 tdSql.query(sql)
#self.cur1.execute(sql)
- elif (timelist == ['ELAPSED']) :
+ elif (timelist == ['ELAPSED']) :
sql = "select abs(asct1),now(),today(),timezone() from ( select "
sql += "%s as asct1," % time_fun_1
sql += "%s as asct2 " % time_fun_2
sql += "from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s select " % random.choice(self.unionall_or_union)
+ sql += "%s select " % random.choice(self.unionall_or_union)
sql += "%s as asct2," % time_fun_2
sql += "%s as asct1 " % time_fun_1
sql += "from regular_table_2 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-4 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
sql = "select ts , timediff(asct1,now) from ( select t1.ts as ts,"
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "%s, " % time_fun_join_1
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "%s, " % time_fun_join_1
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts , (asct1) from ( select t1.ts as ts,"
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "%s, " % time_fun_join_1
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "%s, " % time_fun_join_1
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
- elif (timelist == ['ELAPSED']) :
+ elif (timelist == ['ELAPSED']) :
sql = "select floor(asct1) from ( select "
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "%s " % time_fun_join_1
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "%s " % time_fun_join_1
sql += " from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s " % random.choice(self.q_u_or_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-5 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
- if (timelist == ['ELAPSED']) :
+ if (timelist == ['ELAPSED']) :
sql = "select now(),today(),timezone(), "
- sql += "%s, " % time_fun_1
+ sql += "%s, " % time_fun_1
sql += "%s " % time_fun_2
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(self.q_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
else:
sql = "select ts ,now(),today(),timezone(), "
- sql += "%s, " % time_fun_1
+ sql += "%s, " % time_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % time_fun_2
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
tdSql.query("select 1-6 as time_nest from stable_1 limit 1;")
- for i in range(self.fornum):
+ for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
sql = "select ts , timediff(asct1,now) from ( select t1.ts as ts,"
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "%s, " % time_fun_join_1
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % time_fun_join_1
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s )" % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts , (asct1) from ( select t1.ts as ts,"
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "%s, " % time_fun_join_1
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % time_fun_join_1
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s )" % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
elif (timelist == ['ELAPSED']) :
sql = "select (asct1)*111 from ( select "
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "%s " % time_fun_join_1
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "%s " % time_fun_join_1
sql += " from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s )" % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 1-7 as time_nest from stable_1 limit 1;")
@@ -2788,13 +2788,13 @@ class TDTestCase:
sql = "select ts , timediff(asct1,now) from ( select "
sql += "%s as asct1, ts ," % time_fun_1
sql += "%s as asct2, " % time_fun_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql) # TD-16039
# tdSql.checkRows(300)
@@ -2803,13 +2803,13 @@ class TDTestCase:
sql = "select ts , (asct1),now(),today(),timezone() from ( select "
sql += "%s as asct1, ts ," % time_fun_1
sql += "%s as asct2, " % time_fun_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql) # TD-16039
# tdSql.checkRows(300)
@@ -2821,11 +2821,11 @@ class TDTestCase:
sql += "from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql) #同时出现core:TD-16095和TD-16042
# self.cur1.execute(sql)
-
+
tdSql.query("select 1-8 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
@@ -2835,13 +2835,13 @@ class TDTestCase:
sql += "%s, " % random.choice(self.s_s_select)
sql += "%s as asct1, ts ," % time_fun_1
sql += "%s as asct2, " % time_fun_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql) # TD-16039
# tdSql.checkRows(300)
@@ -2852,17 +2852,17 @@ class TDTestCase:
sql += "%s, " % random.choice(self.s_s_select)
sql += "%s as asct1, ts ," % time_fun_1
sql += "%s as asct2, " % time_fun_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql) # TD-16039
# tdSql.checkRows(300)
- # self.cur1.execute(sql)
+ # self.cur1.execute(sql)
elif (timelist == ['ELAPSED']) :
sql = "select floor(abs(asct1)),now(),today(),timezone() "
sql += "from ( select "
@@ -2873,22 +2873,22 @@ class TDTestCase:
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql) # TD-16039
- # self.cur1.execute(sql)
+ # self.cur1.execute(sql)
tdSql.query("select 1-9 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
sql = "select ts , timediff(asct1,now) from ( select t1.ts as ts,"
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "and %s " % random.choice(self.t_u_where)
@@ -2896,18 +2896,18 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql) TD-16039
# self.cur1.execute(sql) TD-16039
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts , asct1 from ( select t1.ts as ts,"
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "and %s " % random.choice(self.t_u_where)
@@ -2915,25 +2915,25 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
- # self.cur1.execute(sql) # TD-16039
+ # self.cur1.execute(sql) # TD-16039
elif (timelist == ['ELAPSED']) :
sql = "select min(asct1*110) from ( select "
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1 " % time_fun_join_2
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1 " % time_fun_join_2
sql += "from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "and %s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
- # self.cur1.execute(sql) # TD-16039
-
+ # self.cur1.execute(sql) # TD-16039
+
self.restartDnodes()
tdSql.query("select 1-10 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
@@ -2958,8 +2958,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
#TD-15437 self.cur1.execute(sql)
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
@@ -2982,10 +2982,10 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
- #TD-15437 self.cur1.execute(sql)
+ #TD-15437 self.cur1.execute(sql)
elif (timelist == ['ELAPSED']) :
sql = "select abs(asct1),now(),today(),timezone() from ( select "
sql += "%s as asct1 ," % time_fun_1
@@ -3000,11 +3000,11 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
- #TD-15437 self.cur1.execute(sql)
-
+ #TD-15437 self.cur1.execute(sql)
+
#3 inter union not support
tdSql.query("select 1-11 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
@@ -3028,10 +3028,10 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
- # tdSql.query(sql)#TD-15473
- # self.cur1.execute(sql)#TD-15473
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ # tdSql.query(sql)#TD-15473
+ # self.cur1.execute(sql)#TD-15473
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts , (asct1,now()),(now(),asct2) from ( select "
sql += "%s as asct1, ts ," % time_fun_1
@@ -3051,10 +3051,10 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
- # tdSql.query(sql)#TD-15473
- # self.cur1.execute(sql)#TD-15473
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ # tdSql.query(sql)#TD-15473
+ # self.cur1.execute(sql)#TD-15473
elif (timelist == ['ELAPSED']) :
sql = "select asct1+asct2,now(),today(),timezone() from ( select "
sql += "%s as asct1, " % time_fun_1
@@ -3070,118 +3070,118 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)#TD-15473
- self.cur1.execute(sql)#TD-15473
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)#TD-15473
+ self.cur1.execute(sql)#TD-15473
tdSql.query("select 1-12 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
sql = "select ts , timediff(asct1,now) from ( select t1.ts as ts,"
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts , asct1,now() from ( select t1.ts as ts,"
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
elif (timelist == ['ELAPSED']) :
sql = "select min(floor(asct1)),now() from ( select "
- sql += "%s, " % time_fun_join_1
- sql += "%s as asct1 " % time_fun_join_2
+ sql += "%s, " % time_fun_join_1
+ sql += "%s as asct1 " % time_fun_join_2
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql)# TD-16039
-
+
tdSql.query("select 1-13 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
sql = "select ts , timediff(%s,now)," % time_fun_2
- sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct1, " % time_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % time_fun_2
- sql += "%s " % random.choice(self.t_select)
+ sql += "%s " % random.choice(self.t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(300)
# self.cur1.execute(sql) # TD-16039
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts ,now(),today(),timezone(), "
- sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct1, " % time_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % time_fun_2
- sql += "%s " % random.choice(self.t_select)
+ sql += "%s " % random.choice(self.t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(300)
# self.cur1.execute(sql) # TD-16039
elif (timelist == ['ELAPSED']) :
sql = "select now(),today(),timezone(), "
- sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct1, " % time_fun_1
sql += "%s " % time_fun_2
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
-
+
tdSql.query("select 1-14 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
sql = "select ts , timediff(asct1,now),timediff(now,asct2) from ( select ts ts ,"
- sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct1, " % time_fun_1
sql += "%s as asct2" % time_fun_2
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
@@ -3189,13 +3189,13 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ) ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts , (asct1),now(),(now()),asct2 from ( select ts ts ,"
- sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct1, " % time_fun_1
sql += "%s as asct2" % time_fun_2
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
@@ -3203,83 +3203,83 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ) ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
elif (timelist == ['ELAPSED']) :
sql = "select ts , (asct1)*asct2,now(),(now()) from ( select "
- sql += "%s as asct1, " % time_fun_1
+ sql += "%s as asct1, " % time_fun_1
sql += "%s as asct2" % time_fun_2
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.partiton_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ) ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
-
+
tdSql.query("select 1-15 as time_nest from stable_1 limit 1;")
for i in range(self.fornum):
if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\
or (timelist == ['TO_UNIXTIMESTAMP']):
sql = "select ts , timediff(asct1,now),timediff(now,asct2) from ( select t1.ts as ts,"
- sql += "%s as asct2, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s " % random.choice(self.q_select)
+ sql += "%s as asct2, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s " % random.choice(self.q_select)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
- sql += ") "
+ sql += ") "
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
- # self.cur1.execute(sql) # TD-16039
+ # self.cur1.execute(sql) # TD-16039
elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']):
sql = "select ts , asct1,(now()),(now()),asct2 ,now(),today(),timezone() from ( select t1.ts as ts,"
- sql += "%s as asct2, " % time_fun_join_1
- sql += "%s as asct1, " % time_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s " % random.choice(self.q_select)
+ sql += "%s as asct2, " % time_fun_join_1
+ sql += "%s as asct1, " % time_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s " % random.choice(self.q_select)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
- sql += ") "
+ sql += ") "
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
# self.cur1.execute(sql) # TD-16039
elif (timelist == ['ELAPSED']) :
sql = "select asct1,(now()),(now()),asct2 ,now(),today(),timezone() from ( select "
- sql += "%s as asct2, " % time_fun_join_1
- sql += "%s as asct1 " % time_fun_join_2
+ sql += "%s as asct2, " % time_fun_join_1
+ sql += "%s as asct1 " % time_fun_join_2
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
- sql += ") "
+ sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql) # TD-16039
-
+
#taos -f sql
startTime_taos_f = time.time()
print("taos -f %s sql start!" %timelist)
@@ -3287,149 +3287,149 @@ class TDTestCase:
_ = subprocess.check_output(taos_cmd1, shell=True).decode("utf-8")
print("taos -f %s sql over!" %timelist)
endTime_taos_f = time.time()
- print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f))
-
- print("=========%s====over=============" %timelist)
+ print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f))
+
+ print("=========%s====over=============" %timelist)
def base_nest(self,baselist):
-
- print("==========%s===start=============" %baselist)
- os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
-
+
+ print("==========%s===start=============" %baselist)
+ os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
+
self.dropandcreateDB_random("%s" %self.db_nest, 1)
-
+
if (baselist == ['A']) or (baselist == ['S']) or (baselist == ['F']) \
or (baselist == ['C']):
- base_functions = baselist
- fun_fix_column = ['(q_bigint)','(q_smallint)','(q_tinyint)','(q_int)','(q_float)','(q_double)','(q_bigint_null)','(q_smallint_null)','(q_tinyint_null)','(q_int_null)','(q_float_null)','(q_double_null)']
+ base_functions = baselist
+ fun_fix_column = ['(q_bigint)','(q_smallint)','(q_tinyint)','(q_int)','(q_float)','(q_double)','(q_bigint_null)','(q_smallint_null)','(q_tinyint_null)','(q_int_null)','(q_float_null)','(q_double_null)']
fun_column_1 = random.sample(base_functions,1)+random.sample(fun_fix_column,1)
base_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_2 = random.sample(base_functions,1)+random.sample(fun_fix_column,1)
base_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","")
-
+
fun_fix_column_j = ['(t1.q_bigint)','(t1.q_smallint)','(t1.q_tinyint)','(t1.q_int)','(t1.q_float)','(t1.q_double)','(t1.q_bigint_null)','(t1.q_smallint_null)','(t1.q_tinyint_null)','(t1.q_int_null)','(t1.q_float_null)','(t1.q_double_null)',
- '(t2.q_bigint)','(t2.q_smallint)','(t2.q_tinyint)','(t2.q_int)','(t2.q_float)','(t2.q_double)','(t2.q_bigint_null)','(t2.q_smallint_null)','(t2.q_tinyint_null)','(t2.q_int_null)','(t2.q_float_null)','(t2.q_double_null)']
+ '(t2.q_bigint)','(t2.q_smallint)','(t2.q_tinyint)','(t2.q_int)','(t2.q_float)','(t2.q_double)','(t2.q_bigint_null)','(t2.q_smallint_null)','(t2.q_tinyint_null)','(t2.q_int_null)','(t2.q_float_null)','(t2.q_double_null)']
fun_column_join_1 = random.sample(base_functions,1)+random.sample(fun_fix_column_j,1)
base_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","")
fun_column_join_2 = random.sample(base_functions,1)+random.sample(fun_fix_column_j,1)
base_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","")
elif (baselist == ['P']) or (baselist == ['M']) or (baselist == ['S'])or (baselist == ['T']):
- base_functions = baselist
- num = random.randint(0, 1000)
+ base_functions = baselist
+ num = random.randint(0, 1000)
fun_fix_column = ['(q_bigint,num)','(q_smallint,num)','(q_tinyint,num)','(q_int,num)','(q_float,num)','(q_double,num)',
- '(q_bigint_null,num)','(q_smallint_null,num)','(q_tinyint_null,num)','(q_int_null,num)','(q_float_null,num)','(q_double_null,num)']
+ '(q_bigint_null,num)','(q_smallint_null,num)','(q_tinyint_null,num)','(q_int_null,num)','(q_float_null,num)','(q_double_null,num)']
fun_column_1 = random.sample(base_functions,1)+random.sample(fun_fix_column,1)
base_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",base(num))
fun_column_2 = random.sample(base_functions,1)+random.sample(fun_fix_column,1)
base_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",base(num))
-
+
fun_fix_column_j = ['(t1.q_bigint,num)','(t1.q_smallint,num)','(t1.q_tinyint,num)','(t1.q_int,num)','(t1.q_float,num)','(t1.q_double,num)',
'(t1.q_bigint_null,num)','(t1.q_smallint_null,num)','(t1.q_tinyint_null,num)','(t1.q_int_null,num)','(t1.q_float_null,num)','(t1.q_double_null,num)',
'(t2.q_bigint,num)','(t2.q_smallint,num)','(t2.q_tinyint,num)','(t2.q_int,num)','(t2.q_float,num)','(t2.q_double,num)',
- '(t2.q_bigint_null,num)','(t2.q_smallint_null,num)','(t2.q_tinyint_null,num)','(t2.q_int_null,num)','(t2.q_float_null,num)','(t2.q_double_null,num)']
+ '(t2.q_bigint_null,num)','(t2.q_smallint_null,num)','(t2.q_tinyint_null,num)','(t2.q_int_null,num)','(t2.q_float_null,num)','(t2.q_double_null,num)']
fun_column_join_1 = random.sample(base_functions,1)+random.sample(fun_fix_column_j,1)
base_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",base(num))
fun_column_join_2 = random.sample(base_functions,1)+random.sample(fun_fix_column_j,1)
base_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",base(num))
-
+
tdSql.query("select 1-1 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
- sql = "select ts , floor(asct1) from ( select "
- sql += "%s as asct1, " % base_fun_1
- sql += "%s as asct2, " % base_fun_2
+ sql = "select ts , floor(asct1) from ( select "
+ sql += "%s as asct1, " % base_fun_1
+ sql += "%s as asct2, " % base_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-2 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts , abs(asct1) from ( select "
- sql += "%s as asct1, " % base_fun_1
+ sql += "%s as asct1, " % base_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s )" % random.choice(self.order_where)
- sql += "%s " % random.choice(self.unionall_or_union)
+ sql += "%s " % random.choice(self.unionall_or_union)
sql += "select ts , asct2 from ( select "
- sql += "%s as asct2, " % base_fun_2
+ sql += "%s as asct2, " % base_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts ts from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
#sql += "%s " % random.choice(having_support)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
- #TD-15437 self.cur1.execute(sql)
-
+ #TD-15437 self.cur1.execute(sql)
+
tdSql.query("select 1-3 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts , min(asct1) from ( select "
sql += "%s as asct1, ts ," % base_fun_1
sql += "%s as asct2, " % base_fun_2
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s select " % random.choice(self.unionall_or_union)
+ sql += "%s select " % random.choice(self.unionall_or_union)
sql += "%s as asct2, ts ," % base_fun_2
sql += "%s as asct1, " % base_fun_1
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_2 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15473 tdSql.query(sql)
#self.cur1.execute(sql)
-
+
tdSql.query("select 1-4 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts , asct1 from ( select t1.ts as ts,"
- sql += "%s, " % base_fun_join_1
- sql += "%s as asct1, " % base_fun_join_2
- sql += "%s, " % base_fun_join_1
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % base_fun_join_1
+ sql += "%s as asct1, " % base_fun_join_2
+ sql += "%s, " % base_fun_join_1
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-5 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts ,"
- sql += "%s, " % base_fun_1
+ sql += "%s, " % base_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % base_fun_2
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
@@ -3437,19 +3437,19 @@ class TDTestCase:
tdSql.query("select 1-6 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts , max(asct1) from ( select t1.ts as ts,"
- sql += "%s, " % base_fun_join_1
- sql += "%s as asct1, " % base_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "%s, " % base_fun_join_1
+ sql += "%s, " % base_fun_join_1
+ sql += "%s as asct1, " % base_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % base_fun_join_1
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "and %s )" % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 1-7 as base_nest from stable_1 limit 1;")
@@ -3457,18 +3457,18 @@ class TDTestCase:
sql = "select ts , abs(asct1) from ( select "
sql += "%s as asct1, ts ," % base_fun_1
sql += "%s as asct2, " % base_fun_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-8 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts,floor(asct1) "
@@ -3476,13 +3476,13 @@ class TDTestCase:
sql += "%s, " % random.choice(self.s_s_select)
sql += "%s as asct1, ts ," % base_fun_1
sql += "%s as asct2, " % base_fun_2
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
@@ -3491,12 +3491,12 @@ class TDTestCase:
tdSql.query("select 1-9 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts , max(asct1) from ( select t1.ts as ts,"
- sql += "%s, " % base_fun_join_1
- sql += "%s as asct1, " % base_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % base_fun_join_1
+ sql += "%s as asct1, " % base_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "and %s " % random.choice(self.t_u_where)
@@ -3504,11 +3504,11 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
self.restartDnodes()
tdSql.query("select 1-10 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
@@ -3531,11 +3531,11 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15437 tdSql.query(sql)
#TD-15437 self.cur1.execute(sql)
-
+
#3 inter union not support
tdSql.query("select 1-11 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
@@ -3559,53 +3559,53 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15837 tdSql.query(sql)
# self.cur1.execute(sql)
tdSql.query("select 1-12 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts , max(asct1) from ( select t1.ts as ts,"
- sql += "%s, " % base_fun_join_1
- sql += "%s as asct1, " % base_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "%s, " % base_fun_join_1
+ sql += "%s as asct1, " % base_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "and %s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-13 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts ,"
- sql += "%s, " % base_fun_1
+ sql += "%s, " % base_fun_1
+ sql += "%s, " % random.choice(self.q_select)
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
sql += "%s " % base_fun_2
- sql += "%s " % random.choice(self.t_select)
+ sql += "%s " % random.choice(self.t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
self.cur1.execute(sql)
-
+
tdSql.query("select 1-14 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select avg(asct1),count(asct2) from ( select "
- sql += "%s as asct1, " % base_fun_1
+ sql += "%s as asct1, " % base_fun_1
sql += "%s as asct2" % base_fun_2
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
@@ -3613,33 +3613,33 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ) ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
- self.cur1.execute(sql)
-
+ self.cur1.execute(sql)
+
tdSql.query("select 1-15 as base_nest from stable_1 limit 1;")
for i in range(self.fornum):
sql = "select ts , max(asct1) from ( select t1.ts as ts,"
- sql += "%s, " % base_fun_join_1
- sql += "%s as asct1, " % base_fun_join_2
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s " % random.choice(self.q_select)
+ sql += "%s, " % base_fun_join_1
+ sql += "%s as asct1, " % base_fun_join_2
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s " % random.choice(self.q_select)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
- sql += ") "
+ sql += ") "
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
- self.cur1.execute(sql)
-
+ self.cur1.execute(sql)
+
#taos -f sql
startTime_taos_f = time.time()
print("taos -f %s sql start!" %baselist)
@@ -3647,35 +3647,35 @@ class TDTestCase:
_ = subprocess.check_output(taos_cmd1, shell=True).decode("utf-8")
print("taos -f %s sql over!" %baselist)
endTime_taos_f = time.time()
- print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f))
-
- print("=========%s====over=============" %baselist)
-
+ print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f))
+
+ print("=========%s====over=============" %baselist)
+
def function_before_26(self):
-
+
print('=====================2.6 old function start ===========')
- os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
-
+ os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
+
self.dropandcreateDB_random("%s" %self.db_nest, 1)
-
+
#1 select * from (select column form regular_table where <\>\in\and\or order by)
tdSql.query("select 1-1 from stable_1;")
for i in range(self.fornum):
#sql = "select ts , * from ( select " ===暂时不支持select * ,用下面这一行
sql = "select ts from ( select "
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
-
- #1 outer union not support
+
+ #1 outer union not support
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 1-2 from stable_1;")
for i in range(self.fornum):
@@ -3695,12 +3695,12 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
-
+
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 1-2 from stable_1;")
for i in range(self.fornum):
@@ -3720,12 +3720,12 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(200)
self.cur1.execute(sql)
-
+
#1 inter union not support
tdSql.query("select 1-3 from stable_1;")
for i in range(self.fornum):
@@ -3735,7 +3735,7 @@ class TDTestCase:
sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += ""
+ sql += ""
sql += " union select "
sql += "%s, " % random.choice(self.s_r_select)
sql += "%s, " % random.choice(self.q_select)
@@ -3743,12 +3743,12 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15607 tdSql.query(sql)
#tdSql.checkRows(200)
#self.cur1.execute(sql)
-
+
tdSql.query("select 1-3 from stable_1;")
for i in range(self.fornum):
#sql = "select ts , * from ( select "
@@ -3764,47 +3764,47 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15607 tdSql.query(sql)
# tdSql.checkRows(300)
#self.cur1.execute(sql)
-
- #join:select * from (select column form regular_table1,regular_table2 where t1.ts=t2.ts and <\>\in\and\or order by)
+
+ #join:select * from (select column form regular_table1,regular_table2 where t1.ts=t2.ts and <\>\in\and\or order by)
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 1-4 from stable_1;")
for i in range(self.fornum):
#sql = "select ts , * from ( select t1.ts ,"
sql = "select * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
- sql += "and %s " % random.choice(self.q_u_or_where)
+ sql += "and %s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
- #2 select column from (select * form regular_table ) where <\>\in\and\or order by
+ #2 select column from (select * form regular_table ) where <\>\in\and\or order by
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 2-1 from stable_1;")
for i in range(self.fornum):
sql = "select ts ,"
sql += "%s, " % random.choice(self.s_r_select)
- sql += "%s " % random.choice(self.q_select)
+ sql += "%s " % random.choice(self.q_select)
sql += " from ( select * from regular_table_1 ) where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(100)
self.cur1.execute(sql)
@@ -3814,31 +3814,31 @@ class TDTestCase:
tdSql.query("select 2-2 from stable_1;")
for i in range(self.fornum):
sql = "select ts , * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 ) where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.order_u_where)
#sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.error(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.error(sql)
- #3 select * from (select column\tag form stable where <\>\in\and\or order by )
+ #3 select * from (select column\tag form stable where <\>\in\and\or order by )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 3-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
@@ -3849,37 +3849,37 @@ class TDTestCase:
sql += "%s " % random.choice(self.s_r_select)
sql += "from ( select "
sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.t_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
self.cur1.execute(sql)
- # select ts,* from (select column\tag form stable1,stable2 where t1.ts = t2.ts and <\>\in\and\or order by )
+ # select ts,* from (select column\tag form stable1,stable2 where t1.ts = t2.ts and <\>\in\and\or order by )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 3-2 from stable_1;")
for i in range(self.fornum):
sql = "select ts , * from ( select t1.ts , "
- sql += "t1.%s, " % random.choice(self.s_s_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.s_s_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.s_s_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.s_s_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# TD-15609 tdSql.query(sql)
# tdSql.checkRows(100)
#self.cur1.execute(sql)
-
+
#3 outer union not support
self.restartDnodes()
tdSql.query("select 3-3 from stable_1;")
@@ -3899,8 +3899,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
self.cur1.execute(sql)
@@ -3920,12 +3920,12 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(600)
self.cur1.execute(sql)
-
+
#3 inter union not support
tdSql.query("select 3-4 from stable_1;")
for i in range(self.fornum):
@@ -3943,8 +3943,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += ")"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15837 tdSql.query(sql)
# self.cur1.execute(sql)
@@ -3952,16 +3952,16 @@ class TDTestCase:
tdSql.query("select 3-5 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# TD-15609 tdSql.query(sql)
# tdSql.checkRows(100)
#self.cur1.execute(sql)
@@ -3969,34 +3969,34 @@ class TDTestCase:
tdSql.query("select 3-6 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select t1.ts ,"
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t1.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
- sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t1.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
+ sql += "t2.%s, " % random.choice(self.q_select)
sql += "t2.ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += ");"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# TD-15609 同上 tdSql.query(sql)
# tdSql.checkRows(100)
#self.cur1.execute(sql)
- #4 select column from (select * form stable where <\>\in\and\or order by )
+ #4 select column from (select * form stable where <\>\in\and\or order by )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 4-1 from stable_1;")
for i in range(self.fornum):
sql = "select ts , "
sql += "%s, " % random.choice(self.q_select)
- sql += "%s, " % random.choice(self.q_select)
- sql += "%s " % random.choice(self.t_select)
+ sql += "%s, " % random.choice(self.q_select)
+ sql += "%s " % random.choice(self.t_select)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(300)
self.cur1.execute(sql)
@@ -4010,8 +4010,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15500 tdSql.query(sql)
#self.cur1.execute(sql)
@@ -4020,13 +4020,13 @@ class TDTestCase:
for i in range(self.fornum):
sql = "select distinct c5_1 "
sql += " from ( select "
- sql += "%s " % random.choice(self.calc_select_in_ts)
+ sql += "%s " % random.choice(self.calc_select_in_ts)
sql += " as c5_1 from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
#sql += "%s " % random.choice(order_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
#tdSql.checkRows(1)有的函数还没有提交,会不返回结果,先忽略
self.cur1.execute(sql)
@@ -4040,8 +4040,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_desc_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.error(sql)
tdSql.query("select 6-1 from stable_1;")
for i in range(self.fornum):
@@ -4049,8 +4049,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.dt_select)
sql += " from stable_1 where "
sql += "%s ) ;" % random.choice(self.qt_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
@@ -4064,8 +4064,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[0] , self.limit_where[1]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.error(sql) #distinct 和 order by 不能混合使用
tdSql.query("select 7-1 from stable_1;")
for i in range(self.fornum):
@@ -4076,177 +4076,177 @@ class TDTestCase:
#sql += "%s " % random.choice(order_desc_where)
sql += "%s " % random.choice([self.limit_where[0] , self.limit_where[1]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(1)
self.cur1.execute(sql)
#calc_select,TWA/Diff/Derivative/Irate are not allowed to apply to super table directly
#8 select * from (select ts,calc form ragular_table where <\>\in\and\or order by )
-
+
# dcDB = self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 8-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select ts ,"
- sql += "%s " % random.choice(self.calc_select_support_ts)
+ sql += "%s " % random.choice(self.calc_select_support_ts)
sql += "from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql) # 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql) # 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
self.cur1.execute(sql)
tdSql.query("select 8-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_select_not_support_ts)
+ sql += "%s " % random.choice(self.calc_select_not_support_ts)
sql += "from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- #TD-15651 tdSql.query(sql) # 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ #TD-15651 tdSql.query(sql) # 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
#self.cur1.execute(sql)
-
+
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_select_in_ts)
+ sql += "%s " % random.choice(self.calc_select_in_ts)
sql += "from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
#sql += "%s " % random.choice(order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 8-2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select t1.ts, "
- sql += "%s " % random.choice(self.calc_select_in_support_ts_j)
+ sql += "%s " % random.choice(self.calc_select_in_support_ts_j)
sql += "from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)# 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)# 聚合函数不在可以和ts一起使用了 DB error: Not a single-group group function
self.cur1.execute(sql)
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_select_in_not_support_ts_j)
+ sql += "%s " % random.choice(self.calc_select_in_not_support_ts_j)
sql += "from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- #TD-15651 tdSql.query(sql)
- ##top返回结果有问题 tdSql.checkRows(1)
- #self.cur1.execute(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ #TD-15651 tdSql.query(sql)
+ ##top返回结果有问题 tdSql.checkRows(1)
+ #self.cur1.execute(sql)
- #9 select * from (select ts,calc form stable where <\>\in\and\or order by )
+ #9 select * from (select ts,calc form stable where <\>\in\and\or order by )
# self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 9-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_select_not_support_ts)
+ sql += "%s " % random.choice(self.calc_select_not_support_ts)
sql += "from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
# self.cur1.execute(sql)
tdSql.query("select 9-2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select ts ,"
- sql += "%s " % random.choice(self.calc_select_support_ts)
+ sql += "%s " % random.choice(self.calc_select_support_ts)
sql += "from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 9-3 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_select_in_not_support_ts_j)
+ sql += "%s " % random.choice(self.calc_select_in_not_support_ts_j)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 9-4 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select t1.ts,"
- sql += "%s " % random.choice(self.calc_select_in_support_ts_j)
+ sql += "%s " % random.choice(self.calc_select_in_support_ts_j)
sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += " and %s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
- #10 select calc from (select * form regualr_table where <\>\in\and\or order by )
+
+ #10 select calc from (select * form regualr_table where <\>\in\and\or order by )
tdSql.query("select 10-1 from stable_1;")
for i in range(self.fornum):
- sql = "select "
- sql += "%s " % random.choice(self.calc_select_in_ts)
+ sql = "select "
+ sql += "%s " % random.choice(self.calc_select_in_ts)
sql += "as calc10_1 from ( select * from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(1)
self.cur1.execute(sql)
-
+
#10-1 select calc from (select * form regualr_table where <\>\in\and\or order by )
- # rsDn = self.restartDnodes()
+ # rsDn = self.restartDnodes()
# self.dropandcreateDB_random("%s" %db, 1)
# rsDn = self.restartDnodes()
tdSql.query("select 10-2 from stable_1;")
for i in range(self.fornum):
- sql = "select "
- sql += "%s " % random.choice(self.calc_select_all)
+ sql = "select "
+ sql += "%s " % random.choice(self.calc_select_all)
sql += "as calc10_2 from ( select * from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
# tdSql.checkRows(1)
#self.cur1.execute(sql)
- #10-2 select calc from (select * form regualr_tables where <\>\in\and\or order by )
+ #10-2 select calc from (select * form regualr_tables where <\>\in\and\or order by )
tdSql.query("select 10-3 from stable_1;")
for i in range(self.fornum):
- sql = "select "
- sql += "%s as calc10_3 " % random.choice(self.calc_select_all)
+ sql = "select "
+ sql += "%s as calc10_3 " % random.choice(self.calc_select_all)
sql += " from ( select * from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += " and %s " % random.choice(self.q_u_or_where)
@@ -4254,15 +4254,15 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 10-4 from stable_1;")
for i in range(self.fornum):
- sql = "select "
- sql += "%s as calc10_4 " % random.choice(self.calc_select_all)
+ sql = "select "
+ sql += "%s as calc10_4 " % random.choice(self.calc_select_all)
sql += " from ( select * from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_or_where)
sql += " and %s " % random.choice(self.q_u_or_where)
@@ -4270,89 +4270,89 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
- # tdSql.checkRows(1)
+ # tdSql.checkRows(1)
#self.cur1.execute(sql)
- #11 select calc from (select * form stable where <\>\in\and\or order by limit )
+ #11 select calc from (select * form stable where <\>\in\and\or order by limit )
tdSql.query("select 11-1 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_select_in_ts)
+ sql += "%s " % random.choice(self.calc_select_in_ts)
sql += "as calc11_1 from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(1)
self.cur1.execute(sql)
- #11-1 select calc from (select * form stable where <\>\in\and\or order by limit )
+ #11-1 select calc from (select * form stable where <\>\in\and\or order by limit )
tdSql.query("select 11-2 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_select_all)
+ sql += "%s " % random.choice(self.calc_select_all)
sql += "as calc11_1 from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
#self.cur1.execute(sql)
#不好计算结果 tdSql.checkRows(1)
-
+
#11-2 select calc from (select * form stables where <\>\in\and\or order by limit )
tdSql.query("select 11-3 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_select_all)
+ sql += "%s " % random.choice(self.calc_select_all)
sql += "as calc11_1 from ( select * from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 11-4 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_select_all)
+ sql += "%s " % random.choice(self.calc_select_all)
sql += "as calc11_1 from ( select * from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
#self.cur1.execute(sql)
- #12 select calc-diff from (select * form regualr_table where <\>\in\and\or order by limit )
+ #12 select calc-diff from (select * form regualr_table where <\>\in\and\or order by limit )
##self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 12-1 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_calculate_regular)
+ sql += "%s " % random.choice(self.calc_calculate_regular)
sql += " from ( select * from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
##目前derivative不支持 tdSql.query(sql)
# tdSql.checkRows(1)
#self.cur1.execute(sql)
@@ -4360,14 +4360,14 @@ class TDTestCase:
tdSql.query("select 12-2 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_calculate_regular)
+ sql += "%s " % random.choice(self.calc_calculate_regular)
sql += " from ( select * from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#目前derivative不支持 tdSql.query(sql)
# tdSql.checkRows(1)
#self.cur1.execute(sql)
@@ -4375,14 +4375,14 @@ class TDTestCase:
tdSql.query("select 12-2.2 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_calculate_regular)
+ sql += "%s " % random.choice(self.calc_calculate_regular)
sql += " from ( select * from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#目前derivative不支持 tdSql.query(sql)
#self.cur1.execute(sql)
@@ -4391,7 +4391,7 @@ class TDTestCase:
self.restartDnodes()
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_calculate_regular)
+ sql += "%s " % random.choice(self.calc_calculate_regular)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.group_where)
@@ -4399,8 +4399,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#目前derivative不支持 tdSql.query(sql)
#self.cur1.execute(sql)
@@ -4408,7 +4408,7 @@ class TDTestCase:
#join query does not support group by
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_calculate_regular_j)
+ sql += "%s " % random.choice(self.calc_calculate_regular_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "%s " % random.choice(self.group_where_j)
@@ -4416,8 +4416,8 @@ class TDTestCase:
#sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) 目前de函数不支持,另外看看需要不需要将group by和pari by分开
#self.cur1.execute(sql)
@@ -4425,7 +4425,7 @@ class TDTestCase:
#join query does not support group by
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_calculate_regular_j)
+ sql += "%s " % random.choice(self.calc_calculate_regular_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.group_where_j)
@@ -4433,43 +4433,43 @@ class TDTestCase:
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += " ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#derivative not support tdSql.query(sql)
#self.cur1.execute(sql)
-
+
#13 select calc-diff as diffns from (select * form stable where <\>\in\and\or order by limit )
tdSql.query("select 13-1 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_calculate_regular)
+ sql += "%s " % random.choice(self.calc_calculate_regular)
sql += " as calc13_1 from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.orders_desc_where)
sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] )
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#derivative not support tdSql.query(sql)
#self.cur1.execute(sql)
#14 select * from (select calc_aggregate_alls as agg from stable where <\>\in\and\or group by order by slimit soffset )
- # TD-5955 select * from ( select count (q_double) from stable_1 where t_bool = true or t_bool = false group by loc order by ts asc slimit 1 ) ;
+ # TD-5955 select * from ( select count (q_double) from stable_1 where t_bool = true or t_bool = false group by loc order by ts asc slimit 1 ) ;
tdSql.query("select 14-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all)
- sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all)
- sql += "%s " % random.choice(self.calc_aggregate_all)
+ sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all)
+ sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all)
+ sql += "%s " % random.choice(self.calc_aggregate_all)
sql += " as calc14_3 from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.group_where)
sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice(self.slimit1_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15678 tdSql.query(sql)
# tdSql.checkRows(1)
#self.cur1.execute(sql)
@@ -4478,9 +4478,9 @@ class TDTestCase:
tdSql.query("select 14-2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all)
- sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all)
- sql += "%s " % random.choice(self.calc_aggregate_all)
+ sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all)
+ sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all)
+ sql += "%s " % random.choice(self.calc_aggregate_all)
sql += " as calc14_3 from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.group_where)
@@ -4489,44 +4489,44 @@ class TDTestCase:
sql += "%s " % random.choice(self.slimit1_where)
sql += ") "
sql += "%s " % random.choice(self.group_where)
- tdLog.info(sql)
+ tdLog.info(sql)
tdLog.info(len(sql))
#TD-15678 tdSql.query(sql)
- # tdSql.checkRows(1)
+ # tdSql.checkRows(1)
#self.cur1.execute(sql)
#14-2 select * from (select calc_aggregate_all_js as agg from stables where <\>\in\and\or group by order by slimit soffset )
tdSql.query("select 14-3 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all_j)
- sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all_j)
- sql += "%s " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s " % random.choice(self.calc_aggregate_all_j)
sql += " as calc14_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 14-4 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all_j)
- sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all_j)
- sql += "%s " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s " % random.choice(self.calc_aggregate_all_j)
sql += " as calc14_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.partiton_where_j)
sql += "%s " % random.choice(self.slimit1_where)
sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
@@ -4534,50 +4534,50 @@ class TDTestCase:
tdSql.query("select 15-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_regular)
- sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_regular)
- sql += "%s " % random.choice(self.calc_aggregate_regular)
+ sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_regular)
+ sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_regular)
+ sql += "%s " % random.choice(self.calc_aggregate_regular)
sql += " as calc15_3 from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
- sql += "%s " % random.choice(self.group_where_regular)
+ sql += "%s " % random.choice(self.group_where_regular)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #Invalid function name: twa'
# tdSql.checkRows(1)
#self.cur1.execute(sql)
-
+
tdSql.query("select 15-2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_regular_j)
- sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_regular_j)
- sql += "%s " % random.choice(self.calc_aggregate_regular_j)
+ sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_regular_j)
+ sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_regular_j)
+ sql += "%s " % random.choice(self.calc_aggregate_regular_j)
sql += " as calc15_3 from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
- sql += "%s " % random.choice(self.group_where_regular_j)
+ sql += "%s " % random.choice(self.group_where_regular_j)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #Invalid function name: twa'
#self.cur1.execute(sql)
tdSql.query("select 15-2.2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_regular_j)
- sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_regular_j)
- sql += "%s " % random.choice(self.calc_aggregate_regular_j)
+ sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_regular_j)
+ sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_regular_j)
+ sql += "%s " % random.choice(self.calc_aggregate_regular_j)
sql += " as calc15_3 from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_or_where)
- sql += "%s " % random.choice(self.group_where_regular_j)
+ sql += "%s " % random.choice(self.group_where_regular_j)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
sql += "%s ;" % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #Invalid function name: twa'
#self.cur1.execute(sql)
@@ -4585,222 +4585,222 @@ class TDTestCase:
tdSql.query("select 15-3 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname)
- sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname)
- sql += "%s " % random.choice(self.calc_aggregate_groupbytbname)
+ sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname)
+ sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname)
+ sql += "%s " % random.choice(self.calc_aggregate_groupbytbname)
sql += " as calc15_3 from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.group_where)
sql += "%s " % random.choice(self.having_support)
sql += "%s " % random.choice(self.order_desc_where)
sql += ") "
- sql += "order by calc15_1 "
+ sql += "order by calc15_1 "
sql += "%s " % random.choice(self.limit_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #Invalid function name: twa',可能还的去掉order by
#self.cur1.execute(sql)
tdSql.query("select 15-4 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname_j)
- sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname_j)
- sql += "%s " % random.choice(self.calc_aggregate_groupbytbname_j)
+ sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname_j)
+ sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname_j)
+ sql += "%s " % random.choice(self.calc_aggregate_groupbytbname_j)
sql += " as calc15_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "%s " % random.choice(self.group_where_j)
sql += "%s " % random.choice(self.having_support_j)
#sql += "%s " % random.choice(orders_desc_where)
sql += ") "
- sql += "order by calc15_1 "
+ sql += "order by calc15_1 "
sql += "%s " % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #'Invalid function name: irate'
#self.cur1.execute(sql)
tdSql.query("select 15-4.2 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname_j)
- sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname_j)
- sql += "%s " % random.choice(self.calc_aggregate_groupbytbname_j)
+ sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname_j)
+ sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname_j)
+ sql += "%s " % random.choice(self.calc_aggregate_groupbytbname_j)
sql += " as calc15_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.group_where_j)
sql += "%s " % random.choice(self.having_support_j)
sql += "%s " % random.choice(self.orders_desc_where)
sql += ") "
- sql += "order by calc15_1 "
+ sql += "order by calc15_1 "
sql += "%s " % random.choice(self.limit_u_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15678 #tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 15-5 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname)
- sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname)
- sql += "%s " % random.choice(self.calc_aggregate_groupbytbname)
+ sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname)
+ sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname)
+ sql += "%s " % random.choice(self.calc_aggregate_groupbytbname)
sql += " as calc15_3 from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.group_where)
sql += ") "
- sql += "order by calc15_1 "
+ sql += "order by calc15_1 "
sql += "%s " % random.choice(self.limit_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql) #'Invalid function name: irate'
#self.cur1.execute(sql)
- #16 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by limit offset )
+ #16 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by limit offset )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 16-1 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s as calc16_0 , " % random.choice(self.calc_calculate_all)
- sql += "%s as calc16_1 , " % random.choice(self.calc_aggregate_all)
- sql += "%s as calc16_2 " % random.choice(self.calc_select_in)
+ sql += "%s as calc16_1 , " % random.choice(self.calc_aggregate_all)
+ sql += "%s as calc16_2 " % random.choice(self.calc_select_in)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.group_where)
#sql += "%s " % random.choice(having_support)having和 partition不能混合使用
sql += ") "
- sql += "order by calc16_0 "
+ sql += "order by calc16_0 "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#TD-15651 tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 16-2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s as calc16_0 " % random.choice(self.calc_calculate_all_j)
- sql += ", %s as calc16_1 " % random.choice(self.calc_aggregate_all_j)
- #sql += ", %s as calc16_2 " % random.choice(self.calc_select_in_j)
+ sql += ", %s as calc16_1 " % random.choice(self.calc_aggregate_all_j)
+ #sql += ", %s as calc16_2 " % random.choice(self.calc_select_in_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += ") "
- sql += "order by calc16_0 "
+ sql += "order by calc16_0 "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 16-2.2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s as calc16_0 " % random.choice(self.calc_calculate_all_j)
- sql += ", %s as calc16_1 " % random.choice(self.calc_aggregate_all_j)
+ sql += ", %s as calc16_1 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += ") "
- sql += "order by calc16_0 "
+ sql += "order by calc16_0 "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 16-3 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular)
sql += " from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
#self.cur1.execute(sql)
tdSql.query("select 16-4 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular_j)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
#self.cur1.execute(sql)
tdSql.query("select 16-4.2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular_j)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_or_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#tdSql.query(sql)#Invalid function name: derivative'
#self.cur1.execute(sql)
-
+
tdSql.query("select 16-5 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s as calc16_1 , " % random.choice(self.calc_calculate_all)
- sql += "%s as calc16_1 , " % random.choice(self.calc_calculate_regular)
- sql += "%s as calc16_2 " % random.choice(self.calc_select_all)
+ sql += "%s as calc16_1 , " % random.choice(self.calc_calculate_regular)
+ sql += "%s as calc16_2 " % random.choice(self.calc_select_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.group_where)
#sql += "%s " % random.choice(having_support)
sql += ") "
- sql += "order by calc16_1 "
+ sql += "order by calc16_1 "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
# tdSql.query(sql)
#self.cur1.execute(sql)
-
+
tdSql.query("select 16-6 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.group_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 16-7 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname_j)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 16-8 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
- sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname_j)
+ sql = "select * from ( select "
+ sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += "limit 2 ) "
sql += "%s " % random.choice(self.limit1_where)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#Invalid function name: derivative' tdSql.query(sql)
#self.cur1.execute(sql)
@@ -4808,11 +4808,11 @@ class TDTestCase:
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 17-1 from stable_1;")
for i in range(self.fornum):
- #this is having_support , but tag-select cannot mix with last_row,other select can
+ #this is having_support , but tag-select cannot mix with last_row,other select can
sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
sql += "%s as cal17_0 , " % random.choice(self.calc_calculate_all)
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.partiton_where)
@@ -4822,36 +4822,36 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 17-2 from stable_1;")
for i in range(self.fornum):
- #this is having_support , but tag-select cannot mix with last_row,other select can
+ #this is having_support , but tag-select cannot mix with last_row,other select can
sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
sql += "%s as cal17_0 , " % random.choice(self.calc_calculate_all_j)
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "%s " % random.choice(self.interval_sliding)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 17-2.2 from stable_1;")
for i in range(self.fornum):
- #this is having_support , but tag-select cannot mix with last_row,other select can
+ #this is having_support , but tag-select cannot mix with last_row,other select can
sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
sql += "%s as cal17_0 , " % random.choice(self.calc_calculate_all_j)
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -4859,8 +4859,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
@@ -4869,8 +4869,8 @@ class TDTestCase:
for i in range(self.fornum):
#this is having_tagnot_support , because tag-select cannot mix with last_row...
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.partiton_where)
@@ -4880,8 +4880,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
@@ -4889,8 +4889,8 @@ class TDTestCase:
for i in range(self.fornum):
#this is having_tagnot_support , because tag-select cannot mix with last_row...
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -4898,8 +4898,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
@@ -4907,8 +4907,8 @@ class TDTestCase:
for i in range(self.fornum):
#this is having_tagnot_support , because tag-select cannot mix with last_row...
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -4916,17 +4916,17 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 17-5 from stable_1;")
for i in range(self.fornum):
- #having_not_support
+ #having_not_support
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.partiton_where)
@@ -4936,16 +4936,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 17-6 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -4953,16 +4953,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 17-7 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -4970,16 +4970,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 17-7.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -4987,8 +4987,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
@@ -4996,8 +4996,8 @@ class TDTestCase:
tdSql.query("select 17-8 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all)
sql += " from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -5005,16 +5005,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 17-9 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -5022,16 +5022,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 17-10 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.interval_sliding)
@@ -5039,8 +5039,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
@@ -5048,8 +5048,8 @@ class TDTestCase:
tdSql.query("select 18-1 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all)
sql += " from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.session_where)
@@ -5058,16 +5058,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 18-2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.session_u_where)
@@ -5075,16 +5075,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 18-2.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.session_u_where)
@@ -5092,8 +5092,8 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
@@ -5101,8 +5101,8 @@ class TDTestCase:
tdSql.query("select 18-3 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all)
sql += " from stable_1_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.session_where)
@@ -5111,16 +5111,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 18-4 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.session_u_where)
@@ -5128,16 +5128,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 18-4.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.session_u_where)
@@ -5145,16 +5145,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 18-5 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all)
sql += " from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.session_where)
@@ -5163,16 +5163,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
#sql += "%s " % random.choice(interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 18-6 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.t_join_where)
sql += "%s " % random.choice(self.session_u_where)
@@ -5180,16 +5180,16 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 18-7 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql += "%s " % random.choice(self.qt_u_or_where)
sql += "%s " % random.choice(self.session_u_where)
@@ -5197,454 +5197,454 @@ class TDTestCase:
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
- #19 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or session order by limit )interval_sliding
+ #19 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or session order by limit )interval_sliding
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 19-1 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all)
sql += " from regular_table_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.state_window)
#sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 19-2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(self.q_u_where)
+ sql += "%s " % random.choice(self.q_u_where)
sql += "%s " % random.choice(self.state_u_window)
#sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 19-2.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(self.q_u_or_where)
+ sql += "%s " % random.choice(self.q_u_or_where)
sql += "%s " % random.choice(self.state_u_window)
#sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
tdSql.query("select 19-3 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all)
sql += " from stable_1_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.state_window)
#sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 19-4 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(self.q_u_where)
+ sql += "%s " % random.choice(self.q_u_where)
#sql += "%s " % random.choice(self.state_window)
#sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 19-4.2 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(self.q_u_or_where)
+ sql += "%s " % random.choice(self.q_u_or_where)
#sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 19-5 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all)
sql += " from stable_1 where "
- sql += "%s " % random.choice(self.q_where)
+ sql += "%s " % random.choice(self.q_where)
sql += "%s " % random.choice(self.state_window)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit1_where)
sql += ") "
sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.error(sql) #'STATE_WINDOW not support for super table query'
-
+
tdSql.query("select 19-6 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(self.q_u_where)
+ sql += "%s " % random.choice(self.q_u_where)
#sql += "%s " % random.choice(self.state_window)
#sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
tdSql.query("select 19-7 from stable_1;")
for i in range(self.fornum):
sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000))
- sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
- sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j)
+ sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j)
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
- sql += "%s " % random.choice(self.qt_u_or_where)
+ sql += "%s " % random.choice(self.qt_u_or_where)
#sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
#sql += "%s " % random.choice(self.interval_sliding)
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
- #20 select * from (select calc_select_fills form regualr_table or stable where <\>\in\and\or fill_where group by order by limit offset )
+ #20 select * from (select calc_select_fills form regualr_table or stable where <\>\in\and\or fill_where group by order by limit offset )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 20-1 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(self.calc_select_fill)
- sql += "%s ," % random.choice(self.calc_select_fill)
- sql += "%s " % random.choice(self.calc_select_fill)
+ sql += "%s ," % random.choice(self.calc_select_fill)
+ sql += "%s " % random.choice(self.calc_select_fill)
sql += " from stable_1 where "
- sql += "%s " % random.choice(self.interp_where)
+ sql += "%s " % random.choice(self.interp_where)
sql += "%s " % random.choice(self.fill_where)
sql += "%s " % random.choice(self.group_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
#self.cur1.execute(sql)
rsDn = self.restartDnodes()
tdSql.query("select 20-2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(self.calc_select_fill_j)
- sql += "%s ," % random.choice(self.calc_select_fill_j)
- sql += "%s " % random.choice(self.calc_select_fill_j)
+ sql += "%s ," % random.choice(self.calc_select_fill_j)
+ sql += "%s " % random.choice(self.calc_select_fill_j)
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s and " % random.choice(self.t_join_where)
- sql += "%s " % random.choice(self.interp_where_j)
+ sql += "%s " % random.choice(self.interp_where_j)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 20-2.2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(self.calc_select_fill_j)
- sql += "%s ," % random.choice(self.calc_select_fill_j)
- sql += "%s " % random.choice(self.calc_select_fill_j)
+ sql += "%s ," % random.choice(self.calc_select_fill_j)
+ sql += "%s " % random.choice(self.calc_select_fill_j)
sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and "
sql += "%s and " % random.choice(self.qt_u_or_where)
- sql += "%s " % random.choice(self.interp_where_j)
+ sql += "%s " % random.choice(self.interp_where_j)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 20-3 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(self.calc_select_fill)
- sql += "%s ," % random.choice(self.calc_select_fill)
- sql += "%s " % random.choice(self.calc_select_fill)
+ sql += "%s ," % random.choice(self.calc_select_fill)
+ sql += "%s " % random.choice(self.calc_select_fill)
sql += " from stable_1 where "
- sql += "%s " % self.interp_where[2]
+ sql += "%s " % self.interp_where[2]
sql += "%s " % random.choice(self.fill_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
#self.cur1.execute(sql)
-
+
tdSql.query("select 20-4 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(self.calc_select_fill_j)
- sql += "%s ," % random.choice(self.calc_select_fill_j)
- sql += "%s " % random.choice(self.calc_select_fill_j)
- sql += " from stable_1 t1, table_1 t2 where t1.ts = t2.ts and "
+ sql += "%s ," % random.choice(self.calc_select_fill_j)
+ sql += "%s " % random.choice(self.calc_select_fill_j)
+ sql += " from stable_1 t1, table_1 t2 where t1.ts = t2.ts and "
#sql += "%s and " % random.choice(self.t_join_where)
sql += "%s " % self.interp_where_j[random.randint(0,5)]
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
#interp不支持 tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 20-4.2 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(self.calc_select_fill_j)
- sql += "%s ," % random.choice(self.calc_select_fill_j)
- sql += "%s " % random.choice(self.calc_select_fill_j)
- sql += " from stable_1 t1, stable_1_1 t2 where t1.ts = t2.ts and "
+ sql += "%s ," % random.choice(self.calc_select_fill_j)
+ sql += "%s " % random.choice(self.calc_select_fill_j)
+ sql += " from stable_1 t1, stable_1_1 t2 where t1.ts = t2.ts and "
sql += "%s and " % random.choice(self.qt_u_or_where)
sql += "%s " % self.interp_where_j[random.randint(0,5)]
sql += "%s " % random.choice(self.fill_where)
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
##interp不支持 tdSql.error(sql)
#self.cur1.execute(sql)
-
+
tdSql.query("select 20-5 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(self.calc_select_fill)
- sql += "%s ," % random.choice(self.calc_select_fill)
- sql += "%s " % random.choice(self.calc_select_fill)
+ sql += "%s ," % random.choice(self.calc_select_fill)
+ sql += "%s " % random.choice(self.calc_select_fill)
sql += " from regular_table_1 where "
- sql += "%s " % self.interp_where[1]
+ sql += "%s " % self.interp_where[1]
sql += "%s " % random.choice(self.fill_where)
sql += "%s " % random.choice(self.order_where)
sql += "%s " % random.choice(self.limit_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
##interp不支持 tdSql.query(sql)
#self.cur1.execute(sql)
tdSql.query("select 20-6 from stable_1;")
for i in range(self.fornum):
- sql = "select * from ( select "
+ sql = "select * from ( select "
sql += "%s , " % random.choice(self.calc_select_fill_j)
- sql += "%s ," % random.choice(self.calc_select_fill_j)
- sql += "%s " % random.choice(self.calc_select_fill_j)
+ sql += "%s ," % random.choice(self.calc_select_fill_j)
+ sql += "%s " % random.choice(self.calc_select_fill_j)
sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
- #sql += "%s " % random.choice(self.interp_where_j)
- sql += "%s " % self.interp_where_j[random.randint(0,5)]
+ #sql += "%s " % random.choice(self.interp_where_j)
+ sql += "%s " % self.interp_where_j[random.randint(0,5)]
sql += "%s " % random.choice(self.order_u_where)
sql += "%s " % random.choice(self.limit_u_where)
sql += ") "
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
##interp不支持 tdSql.query(sql)
#self.cur1.execute(sql)
#1 select * from (select * from (select * form regular_table where <\>\in\and\or order by limit ))
tdSql.query("select 1-1 from stable_1;")
- for i in range(self.fornum):
+ for i in range(self.fornum):
# sql_start = "select * from ( "
# sql_end = ")"
for_num = random.randint(1, 15);
- sql = "select * from (" * for_num
+ sql = "select * from (" * for_num
sql += "select * from ( select * from ( select "
- sql += "%s, " % random.choice(self.s_r_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.s_r_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += ")) "
- sql += ")" * for_num
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ sql += ")" * for_num
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
-
+
sql2 = "select * from ( select * from ( select "
- sql2 += "%s, " % random.choice(self.s_r_select)
- sql2 += "%s, " % random.choice(self.q_select)
+ sql2 += "%s, " % random.choice(self.s_r_select)
+ sql2 += "%s, " % random.choice(self.q_select)
sql2 += "ts from regular_table_1 where "
sql2 += "%s " % random.choice(self.q_where)
- sql2 += ")) "
- tdLog.info(sql2)
- tdLog.info(len(sql2))
- tdSql.query(sql2)
+ sql2 += ")) "
+ tdLog.info(sql2)
+ tdLog.info(len(sql2))
+ tdSql.query(sql2)
self.cur1.execute(sql2)
-
+
self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1)
self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql ,1,10,3,3)
self.data_matrix_equal('%s' %sql ,1,10,3,3,'%s' %sql2 ,1,10,3,3)
-
+
for i in range(self.fornum):
for_num = random.randint(1, 15);
- sql = "select ts from (" * for_num
+ sql = "select ts from (" * for_num
sql += "select * from ( select * from ( select "
- sql += "%s, " % random.choice(self.s_r_select)
- sql += "%s, " % random.choice(self.q_select)
+ sql += "%s, " % random.choice(self.s_r_select)
+ sql += "%s, " % random.choice(self.q_select)
sql += "ts from regular_table_1 where "
sql += "%s " % random.choice(self.q_where)
sql += ")) "
- sql += ")" * for_num
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ sql += ")" * for_num
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
-
+
sql2 = "select * from ( select * from ( select "
- sql2 += "%s, " % random.choice(self.s_r_select)
- sql2 += "%s, " % random.choice(self.q_select)
+ sql2 += "%s, " % random.choice(self.s_r_select)
+ sql2 += "%s, " % random.choice(self.q_select)
sql2 += "ts from regular_table_1 where "
sql2 += "%s " % random.choice(self.q_where)
- sql2 += ")) "
- tdLog.info(sql2)
- tdLog.info(len(sql2))
+ sql2 += ")) "
+ tdLog.info(sql2)
+ tdLog.info(len(sql2))
tdSql.query(sql2)
- self.cur1.execute(sql2)
-
+ self.cur1.execute(sql2)
+
self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1)
-
+
#2 select * from (select * from (select * form stable where <\>\in\and\or order by limit ))
tdSql.query("select 2-1 from stable_1;")
for i in range(self.fornum):
for_num = random.randint(1, 15);
- sql = "select * from (" * for_num
+ sql = "select * from (" * for_num
sql += "select * from ( select * from ( select "
- sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.qt_select)
+ sql += "%s, " % random.choice(self.s_s_select)
+ sql += "%s, " % random.choice(self.qt_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += ")) "
- sql += ")" * for_num
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ sql += ")" * for_num
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
-
+
sql2 = "select * from ( select * from ( select "
- sql2 += "%s, " % random.choice(self.s_s_select)
- sql2 += "%s, " % random.choice(self.qt_select)
+ sql2 += "%s, " % random.choice(self.s_s_select)
+ sql2 += "%s, " % random.choice(self.qt_select)
sql2 += "ts from stable_1 where "
sql2 += "%s " % random.choice(self.q_where)
- sql2 += ")) "
- tdLog.info(sql2)
- tdLog.info(len(sql2))
- tdSql.query(sql2)
+ sql2 += ")) "
+ tdLog.info(sql2)
+ tdLog.info(len(sql2))
+ tdSql.query(sql2)
self.cur1.execute(sql2)
-
+
self.data_matrix_equal('%s' %sql ,1,10,3,3,'%s' %sql2 ,1,10,3,3)
-
+
for i in range(self.fornum):
for_num = random.randint(1, 15);
- sql = "select ts from (" * for_num
+ sql = "select ts from (" * for_num
sql += "select * from ( select * from ( select "
- sql += "%s, " % random.choice(self.s_s_select)
- sql += "%s, " % random.choice(self.qt_select)
+ sql += "%s, " % random.choice(self.s_s_select)
+ sql += "%s, " % random.choice(self.qt_select)
sql += "ts from stable_1 where "
sql += "%s " % random.choice(self.q_where)
sql += ")) "
- sql += ")" * for_num
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.query(sql)
+ sql += ")" * for_num
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.query(sql)
self.cur1.execute(sql)
-
+
sql2 = "select ts from ( select * from ( select "
- sql2 += "%s, " % random.choice(self.s_s_select)
- sql2 += "%s, " % random.choice(self.qt_select)
+ sql2 += "%s, " % random.choice(self.s_s_select)
+ sql2 += "%s, " % random.choice(self.qt_select)
sql2 += "ts from stable_1 where "
sql2 += "%s " % random.choice(self.q_where)
- sql2 += ")) "
- tdLog.info(sql2)
- tdLog.info(len(sql2))
- tdSql.query(sql2)
+ sql2 += ")) "
+ tdLog.info(sql2)
+ tdLog.info(len(sql2))
+ tdSql.query(sql2)
self.cur1.execute(sql2)
-
+
self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1)
-
- #3 select ts ,calc from (select * form stable where <\>\in\and\or order by limit )
+
+ #3 select ts ,calc from (select * form stable where <\>\in\and\or order by limit )
#self.dropandcreateDB_random("%s" %db, 1)
tdSql.query("select 3-1 from stable_1;")
for i in range(self.fornum):
sql = "select "
- sql += "%s " % random.choice(self.calc_calculate_regular)
+ sql += "%s " % random.choice(self.calc_calculate_regular)
sql += " from ( select * from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
sql += "%s " % random.choice(self.orders_desc_where)
sql += "%s " % random.choice(self.limit_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- #'Invalid function name: derivative' tdSql.query(sql)
- #self.cur1.execute(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ #'Invalid function name: derivative' tdSql.query(sql)
+ #self.cur1.execute(sql)
#4 select * from (select calc form stable where <\>\in\and\or order by limit )
tdSql.query("select 4-1 from stable_1;")
for i in range(self.fornum):
sql = "select * from ( select "
- sql += "%s " % random.choice(self.calc_select_in_ts)
+ sql += "%s " % random.choice(self.calc_select_in_ts)
sql += "from stable_1 where "
sql += "%s " % random.choice(self.qt_where)
#sql += "%s " % random.choice(self.order_desc_where)
sql += "%s " % random.choice(self.limit_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
+ tdLog.info(sql)
+ tdLog.info(len(sql))
tdSql.query(sql)
self.cur1.execute(sql)
-
+
#5 select ts ,tbname from (select * form stable where <\>\in\and\or order by limit )
tdSql.query("select 5-1 from stable_1;")
for i in range(self.fornum):
sql = "select ts , tbname , "
- sql += "%s ," % random.choice(self.calc_calculate_regular)
+ sql += "%s ," % random.choice(self.calc_calculate_regular)
sql += "%s ," % random.choice(self.dqt_select)
sql += "%s " % random.choice(self.qt_select)
sql += " from ( select * from stable_1 where "
@@ -5652,9 +5652,9 @@ class TDTestCase:
sql += "%s " % random.choice(self.orders_desc_where)
sql += "%s " % random.choice(self.limit_where)
sql += ") ;"
- tdLog.info(sql)
- tdLog.info(len(sql))
- tdSql.error(sql)
+ tdLog.info(sql)
+ tdLog.info(len(sql))
+ tdSql.error(sql)
#special sql
tdSql.query("select 6-1 from stable_1;")
@@ -5678,7 +5678,7 @@ class TDTestCase:
tdSql.error(sql)
sql = "select * from (select server_status() as status);"
tdSql.error(sql)
-
+
#taos -f sql
startTime_taos_f = time.time()
print("taos -f sql start!")
@@ -5690,36 +5690,36 @@ class TDTestCase:
print('=====================2.6 old function end ===========')
-
-
+
+
def run(self):
tdSql.prepare()
-
- startTime = time.time()
-
- #
-
-
+
+ startTime = time.time()
+
+ #
+
+
#self.math_nest(['TAIL']) #TD-16009
# self.math_nest(['HYPERLOGLOG']) #TD-16038
# self.math_nest(['UNIQUE'])
-
+
# #
#self.function_before_26() #TD-16031
-
- # self.math_nest(['ABS','SQRT']) #TD-16042
- # self.math_nest(['SIN','COS','TAN','ASIN','ACOS','ATAN'])
+
+ # self.math_nest(['ABS','SQRT']) #TD-16042
+ # self.math_nest(['SIN','COS','TAN','ASIN','ACOS','ATAN'])
# self.math_nest(['POW','LOG']) #TD-16039
- # self.math_nest(['FLOOR','CEIL','ROUND'])
- # #self.math_nest(['SAMPLE']) #TD-16017
+ # self.math_nest(['FLOOR','CEIL','ROUND'])
+ # #self.math_nest(['SAMPLE']) #TD-16017
# #self.math_nest(['CSUM']) #TD-15936 crash
- # self.math_nest(['MAVG'])
-
- self.str_nest(['LTRIM','RTRIM','LOWER','UPPER'])
- self.str_nest(['LENGTH','CHAR_LENGTH'])
- self.str_nest(['SUBSTR']) #TD-16042
+ # self.math_nest(['MAVG'])
+
+ self.str_nest(['LTRIM','RTRIM','LOWER','UPPER'])
+ self.str_nest(['LENGTH','CHAR_LENGTH'])
+ self.str_nest(['SUBSTR']) #TD-16042
self.str_nest(['CONCAT']) #TD-16002 偶尔
self.str_nest(['CONCAT_WS']) #TD-16002 偶尔
# self.time_nest(['CAST']) #TD-16017偶尔,放到time里起来弄
@@ -5727,21 +5727,21 @@ class TDTestCase:
self.time_nest(['CAST_2'])
self.time_nest(['CAST_3'])
self.time_nest(['CAST_4'])
-
-
-
+
+
+
# self.time_nest(['NOW','TODAY']) #
# self.time_nest(['TIMEZONE']) #
# self.time_nest(['TIMETRUNCATE']) #TD-16039
# self.time_nest(['TO_ISO8601'])
# self.time_nest(['TO_UNIXTIMESTAMP'])#core多
# self.time_nest(['ELAPSED'])
-
+
endTime = time.time()
print("total time %ds" % (endTime - startTime))
-
+
def stop(self):
diff --git a/tests/system-test/2-query/percentile.py b/tests/system-test/2-query/percentile.py
index 21bb8763dc7e99ce1a449b57f9b35813b4596d6a..43b5c5610a3452018e32c0f3a8cd0a4ad38c521e 100644
--- a/tests/system-test/2-query/percentile.py
+++ b/tests/system-test/2-query/percentile.py
@@ -134,31 +134,16 @@ class TDTestCase:
tdSql.query(f'select percentile({k}, {param}) from {self.stbname}_{i}')
tdSql.checkData(0, 0, np.percentile(floatData, param))
- #!bug TD-17119
- # for k,v in self.tag_dict.items():
- # for param in self.param:
- # if v.lower() in ['timestamp','bool'] or 'binary' in v.lower() or 'nchar' in v.lower():
- # tdSql.error(f'select percentile({k},{param}) from {self.stbname}_{i}')
- # elif v.lower() == 'tinyint':
- # self.check_tags(k,param,i,self.tag_tinyint)
- # elif v.lower() == 'smallint':
- # self.check_tags(k,param,i,self.tag_smallint)
- # elif v.lower() == 'int':
- # self.check_tags(k,param,i,self.tag_int)
- # elif v.lower() == 'bigint':
- # self.check_tags(k,param,i,self.tag_bigint)
- # elif v.lower() == 'tinyint unsigned':
- # self.check_tags(k,param,i,self.tag_utint)
- # elif v.lower() == 'smallint unsigned':
- # self.check_tags(k,param,i,self.tag_usint)
- # elif v.lower() == 'int unsigned':
- # self.check_tags(k,param,i,self.tag_uint)
- # elif v.lower() == 'bigint unsigned':
- # self.check_tags(k,param,i,self.tag_ubint)
- # elif v.lower() == 'float':
- # self.check_tags(k,param,i,self.tag_float)
- # elif v.lower() == 'double':
- # self.check_tags(k,param,i,self.tag_double)
+ for k,v in self.tag_dict.items():
+ for param in self.param:
+ if v.lower() in ['timestamp','bool'] or 'binary' in v.lower() or 'nchar' in v.lower():
+ tdSql.error(f'select percentile({k},{param}) from {self.stbname}_{i}')
+ else:
+ tdSql.query(f'select {k} from {self.stbname}_{i}')
+ data_num = tdSql.queryResult[0][0]
+ tdSql.query(f'select percentile({k},{param}) from {self.stbname}_{i}')
+ tdSql.checkData(0,0,data_num)
+
def run(self):
self.function_check_ntb()
self.function_check_ctb()
diff --git a/tests/system-test/2-query/queryQnode.py b/tests/system-test/2-query/queryQnode.py
index 0460ccf135d1e00221ac22e2cfec2c5d6320caed..b5e2bd3328e50de5d6cabfcb96e927fc92d3ab99 100644
--- a/tests/system-test/2-query/queryQnode.py
+++ b/tests/system-test/2-query/queryQnode.py
@@ -45,7 +45,7 @@ class TDTestCase:
case1: limit offset base function test
case2: offset return valid
'''
- return
+ return
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
@@ -71,7 +71,7 @@ class TDTestCase:
# self.create_tables();
self.ts = 1500000000000
- # stop
+ # stop
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
@@ -82,7 +82,7 @@ class TDTestCase:
def newcur(self,host,cfg):
user = "root"
password = "taosdata"
- port =6030
+ port =6030
con=taos.connect(host=host, user=user, password=password, config=cfg ,port=port)
cur=con.cursor()
print(cur)
@@ -92,7 +92,7 @@ class TDTestCase:
def create_tables(self,host,dbname,stbname,count):
buildPath = self.getBuildPath()
config = buildPath+ "../sim/dnode1/cfg/"
-
+
tsql=self.newcur(host,config)
tsql.execute("use %s" %dbname)
@@ -111,7 +111,7 @@ class TDTestCase:
tsql.execute(sql)
sql = pre_create
# print(time.time())
- # end sql
+ # end sql
if sql != pre_create:
# print(sql)
tsql.execute(sql)
@@ -124,7 +124,7 @@ class TDTestCase:
def mutiThread_create_tables(self,host,dbname,stbname,vgroups,threadNumbers,childcount):
buildPath = self.getBuildPath()
config = buildPath+ "../sim/dnode1/cfg/"
-
+
tsql=self.newcur(host,config)
tdLog.debug("create database %s"%dbname)
tsql.execute("drop database if exists %s"%dbname)
@@ -134,7 +134,7 @@ class TDTestCase:
threads = []
for i in range(threadNumbers):
tsql.execute("create stable %s%d(ts timestamp, c1 int, c2 binary(10)) tags(t1 int)"%(stbname,i))
- threads.append(thd.Thread(target=self.create_tables, args=(host, dbname, stbname+"%d"%i, count,)))
+ threads.append(thd.Thread(target=self.create_tables, args=(host, dbname, stbname+"%d"%i, count,)))
start_time = time.time()
for tr in threads:
tr.start()
@@ -144,7 +144,7 @@ class TDTestCase:
spendTime=end_time-start_time
speedCreate=threadNumbers*count/spendTime
tdLog.debug("spent %.2fs to create %d stable and %d table, create speed is %.2f table/s... [OK]"% (spendTime,threadNumbers,threadNumbers*count,speedCreate))
-
+
return
# def create_tables(self,host,dbname,stbname,vgroups,tcountStart,tcountStop):
@@ -171,7 +171,7 @@ class TDTestCase:
# print(sql)
tsql.execute(sql)
sql = "insert into %s_%d values " %(stbname,i)
- # end sql
+ # end sql
if sql != pre_insert:
# print(sql)
print(len(sql))
@@ -186,7 +186,7 @@ class TDTestCase:
def mutiThread_insert_data(self, host, dbname, stbname, threadNumbers, chilCount, ts_start, childrowcount):
buildPath = self.getBuildPath()
config = buildPath+ "../sim/dnode1/cfg/"
-
+
tsql=self.newcur(host,config)
tdLog.debug("ready to inser data")
@@ -195,7 +195,7 @@ class TDTestCase:
threads = []
for i in range(threadNumbers):
# tsql.execute("create stable %s%d(ts timestamp, c1 int, c2 binary(10)) tags(t1 int)"%(stbname,i))
- threads.append(thd.Thread(target=self.insert_data, args=(host, dbname, stbname+"%d"%i, chilCount, ts_start, childrowcount,)))
+ threads.append(thd.Thread(target=self.insert_data, args=(host, dbname, stbname+"%d"%i, chilCount, ts_start, childrowcount,)))
start_time = time.time()
for tr in threads:
tr.start()
@@ -226,10 +226,10 @@ class TDTestCase:
tdLog.info("taosd found in %s" % buildPath)
taosBenchbin = buildPath+ "/build/bin/taosBenchmark"
os.system("%s -f %s -y " %(taosBenchbin,jsonFile))
-
+
return
def taosBenchCreate(self,host,dropdb,dbname,stbname,vgroups,processNumbers,count):
-
+
# count=50000
buildPath = self.getBuildPath()
config = buildPath+ "../sim/dnode1/cfg/"
@@ -243,7 +243,7 @@ class TDTestCase:
# tsql.getResult("show databases")
# print(tdSql.queryResult)
tsql.execute("use %s" %dbname)
-
+
threads = []
for i in range(processNumbers):
jsonfile="1-insert/Vgroups%d%d.json"%(vgroups,i)
@@ -254,7 +254,7 @@ class TDTestCase:
os.system("sed -i 's/\"childtable_count\": 10000,/\"childtable_count\": %d,/g' %s "%(count,jsonfile))
os.system("sed -i 's/\"name\": \"stb1\",/\"name\": \"%s%d\",/g' %s "%(stbname,i,jsonfile))
os.system("sed -i 's/\"childtable_prefix\": \"stb1_\",/\"childtable_prefix\": \"%s%d_\",/g' %s "%(stbname,i,jsonfile))
- threads.append(mp.Process(target=self.taosBench, args=("%s"%jsonfile,)))
+ threads.append(mp.Process(target=self.taosBench, args=("%s"%jsonfile,)))
start_time = time.time()
for tr in threads:
tr.start()
@@ -276,8 +276,8 @@ class TDTestCase:
for i in range(stableCount):
tdSql.query("select count(*) from %s%d"%(stbname,i))
tdSql.checkData(0,0,rowsPerSTable)
- return
-
+ return
+
# test case : Switch back and forth among the three queryPolicy(1\2\3)
def test_case1(self):
self.taosBenchCreate("127.0.0.1","no","db1", "stb1", 1, 2, 1*10)
@@ -303,7 +303,7 @@ class TDTestCase:
tdSql.execute("reset query cache")
tdSql.query("select max(c1) from stb10;")
tdSql.checkData(0, 0, "%s"%maxQnode)
- tdSql.query("select min(c1) from stb11;")
+ tdSql.query("select min(c1) from stb11;")
tdSql.checkData(0, 0, "%s"%minQnode)
tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
unionVnode=tdSql.queryResult
@@ -352,8 +352,8 @@ class TDTestCase:
tdSql.execute("reset query cache")
tdSql.query("select max(c1) from stb10;")
assert maxQnode==tdSql.getData(0,0)
- tdSql.query("select min(c1) from stb11;")
- assert minQnode==tdSql.getData(0,0)
+ tdSql.query("select min(c1) from stb11;")
+ assert minQnode==tdSql.getData(0,0)
tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
@@ -442,7 +442,7 @@ class TDTestCase:
tdLog.exit("alter queryPolicy to %d failed"%queryPolicy)
tdSql.execute("use db1;")
tdSql.error("select max(c1) from stb10;")
- tdSql.error("select min(c1) from stb11;")
+ tdSql.error("select min(c1) from stb11;")
tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
@@ -477,20 +477,20 @@ class TDTestCase:
tdSql.execute("reset query cache")
tdSql.error("select max(c1) from stb10;")
- tdSql.error("select min(c1) from stb11;")
+ tdSql.error("select min(c1) from stb11;")
tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
- # run case
+ # run case
def run(self):
# test qnode
- tdLog.debug(" test_case1 ............ [start]")
+ tdLog.debug(" test_case1 ............ [start]")
self.test_case1()
tdLog.debug(" test_case1 ............ [OK]")
- tdLog.debug(" test_case2 ............ [start]")
+ tdLog.debug(" test_case2 ............ [start]")
self.test_case2()
tdLog.debug(" test_case2 ............ [OK]")
- tdLog.debug(" test_case3 ............ [start]")
+ tdLog.debug(" test_case3 ............ [start]")
self.test_case3()
tdLog.debug(" test_case3 ............ [OK]")
@@ -500,7 +500,7 @@ class TDTestCase:
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
- return
+ return
#
# add case with filename
#
diff --git a/tests/system-test/2-query/round.py b/tests/system-test/2-query/round.py
index 9111586472421a7995f24c8de2d35f4f0fcdba32..551e225a4d02025780b4238e2079b70249dcdd5a 100644
--- a/tests/system-test/2-query/round.py
+++ b/tests/system-test/2-query/round.py
@@ -8,14 +8,14 @@ from util.sql import *
from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def init(self, conn, logSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -23,7 +23,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -65,14 +65,14 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def check_result_auto(self ,origin_query , round_query):
pass
round_result = tdSql.getResult(round_query)
origin_result = tdSql.getResult(origin_query)
auto_result =[]
-
+
for row in origin_result:
row_check = []
for elem in row:
@@ -87,13 +87,13 @@ class TDTestCase:
for row_index , row in enumerate(round_result):
for col_index , elem in enumerate(row):
if auto_result[row_index][col_index] != elem:
- check_status = False
+ check_status = False
if not check_status:
tdLog.notice("round function value has not as expected , sql is \"%s\" "%round_query )
sys.exit(1)
else:
tdLog.info("round value check pass , it work as expected ,sql is \"%s\" "%round_query )
-
+
def test_errors(self):
error_sql_lists = [
"select round from t1",
@@ -127,42 +127,42 @@ class TDTestCase:
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
-
+
def support_types(self):
type_error_sql_lists = [
- "select round(ts) from t1" ,
+ "select round(ts) from t1" ,
"select round(c7) from t1",
"select round(c8) from t1",
"select round(c9) from t1",
- "select round(ts) from ct1" ,
+ "select round(ts) from ct1" ,
"select round(c7) from ct1",
"select round(c8) from ct1",
"select round(c9) from ct1",
- "select round(ts) from ct3" ,
+ "select round(ts) from ct3" ,
"select round(c7) from ct3",
"select round(c8) from ct3",
"select round(c9) from ct3",
- "select round(ts) from ct4" ,
+ "select round(ts) from ct4" ,
"select round(c7) from ct4",
"select round(c8) from ct4",
"select round(c9) from ct4",
- "select round(ts) from stb1" ,
+ "select round(ts) from stb1" ,
"select round(c7) from stb1",
"select round(c8) from stb1",
"select round(c9) from stb1" ,
- "select round(ts) from stbbb1" ,
+ "select round(ts) from stbbb1" ,
"select round(c7) from stbbb1",
"select round(ts) from tbname",
"select round(c9) from tbname"
]
-
+
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
-
-
+
+
type_sql_lists = [
"select round(c1) from t1",
"select round(c2) from t1",
@@ -192,16 +192,16 @@ class TDTestCase:
"select round(c5) from stb1",
"select round(c6) from stb1",
- "select round(c6) as alisb from stb1",
- "select round(c6) alisb from stb1",
+ "select round(c6) as alisb from stb1",
+ "select round(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
-
+
def basic_round_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -221,7 +221,7 @@ class TDTestCase:
tdSql.query("select round(c5) from ct3")
tdSql.checkRows(0)
tdSql.query("select round(c6) from ct3")
-
+
# used for regular table
tdSql.query("select round(c1) from t1")
tdSql.checkData(0, 0, None)
@@ -239,7 +239,7 @@ class TDTestCase:
tdSql.checkData(5, 5, None)
self.check_result_auto( "select c1, c2, c3 , c4, c5 from t1", "select (c1), round(c2) ,round(c3), round(c4), round(c5) from t1")
-
+
# used for sub table
tdSql.query("select round(c1) from ct1")
tdSql.checkData(0, 0, 8)
@@ -251,20 +251,20 @@ class TDTestCase:
self.check_result_auto( "select c1, c2, c3 , c4, c5 from ct1", "select (c1), round(c2) ,round(c3), round(c4), round(c5) from ct1")
self.check_result_auto("select round(round(round(round(round(round(round(round(round(round(c1)))))))))) nest_col_func from ct1;","select c1 from ct1" )
- # used for stable table
-
+ # used for stable table
+
tdSql.query("select round(c1) from stb1")
tdSql.checkRows(25)
self.check_result_auto( "select c1, c2, c3 , c4, c5 from ct4 ", "select (c1), round(c2) ,round(c3), round(c4), round(c5) from ct4")
self.check_result_auto("select round(round(round(round(round(round(round(round(round(round(c1)))))))))) nest_col_func from ct4;" , "select c1 from ct4" )
-
+
# used for not exists table
tdSql.error("select round(c1) from stbbb1")
tdSql.error("select round(c1) from tbname")
tdSql.error("select round(c1) from ct5")
- # mix with common col
+ # mix with common col
tdSql.query("select c1, round(c1) from ct1")
tdSql.checkData(0 , 0 ,8)
tdSql.checkData(0 , 1 ,8)
@@ -289,7 +289,7 @@ class TDTestCase:
tdSql.checkData(0 , 1 ,None)
tdSql.checkData(0 , 2 ,None)
tdSql.checkData(0 , 3 ,None)
-
+
tdSql.checkData(3 , 0 , 6)
tdSql.checkData(3 , 1 , 6)
tdSql.checkData(3 , 2 ,6.66000)
@@ -315,7 +315,7 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
-
+
# bug fix for count
tdSql.query("select count(c1) from ct4 ")
tdSql.checkData(0,0,9)
@@ -326,7 +326,7 @@ class TDTestCase:
tdSql.query("select count(*) from stb1 ")
tdSql.checkData(0,0,25)
- # bug fix for compute
+ # bug fix for compute
tdSql.query("select c1, abs(c1) -0 ,round(c1)-0 from ct4 ")
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None)
@@ -378,10 +378,10 @@ class TDTestCase:
tdSql.checkData(0,4,7.900000000)
tdSql.checkData(0,5,3.000000000)
tdSql.checkData(0,6,7.500000000)
-
+
def round_Arithmetic(self):
pass
-
+
def check_boundary_values(self):
tdSql.execute("drop database if exists bound_test")
@@ -410,14 +410,14 @@ class TDTestCase:
tdSql.execute(
f"insert into sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
-
+
tdSql.error(
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto( "select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ", "select round(c1), round(c2) ,round(c3), round(c4), round(c5) ,round(c6) from sub1_bound")
self.check_result_auto( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select round(c1), round(c2) ,round(c3), round(c3), round(c2) ,round(c1) from sub1_bound")
self.check_result_auto("select round(round(round(round(round(round(round(round(round(round(c1)))))))))) nest_col_func from sub1_bound;" , "select round(c1) from sub1_bound" )
-
+
# check basic elem for table per row
tdSql.query("select round(c1+0.2) ,round(c2) , round(c3+0.3) , round(c4-0.3), round(c5/2), round(c6/2) from sub1_bound ")
tdSql.checkData(0, 0, 2147483647.000000000)
@@ -444,32 +444,32 @@ class TDTestCase:
self.check_result_auto( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select round(t1) ,round(c5) from stb1 where c1 > 0 order by tbname" )
self.check_result_auto( " select t1,c5 from stb1 where c1 > 0 order by tbname " , "select round(t1) , round(c5) from stb1 where c1 > 0 order by tbname" )
pass
-
-
+
+
def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: round basic query ============")
+ tdLog.printNoPrefix("==========step4: round basic query ============")
self.basic_round_function()
- tdLog.printNoPrefix("==========step5: round boundary query ============")
+ tdLog.printNoPrefix("==========step5: round boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step6: round filter query ============")
+ tdLog.printNoPrefix("==========step6: round filter query ============")
self.abs_func_filter()
diff --git a/tests/system-test/2-query/sqrt.py b/tests/system-test/2-query/sqrt.py
index e21f5b397e7a5753cebf70bbf3a946c076611263..425d59f1186615467f4aac8a085949029422b760 100644
--- a/tests/system-test/2-query/sqrt.py
+++ b/tests/system-test/2-query/sqrt.py
@@ -9,13 +9,13 @@ from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def init(self, conn, powSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -23,7 +23,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -65,14 +65,14 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def check_result_auto_sqrt(self ,origin_query , pow_query):
pow_result = tdSql.getResult(pow_query)
origin_result = tdSql.getResult(origin_query)
auto_result =[]
-
+
for row in origin_result:
row_check = []
for elem in row:
@@ -92,7 +92,7 @@ class TDTestCase:
if auto_result[row_index][col_index] == None and not (auto_result[row_index][col_index] == None and elem == None):
check_status = False
elif auto_result[row_index][col_index] != None and (auto_result[row_index][col_index] - elem > 0.00000001):
- check_status = False
+ check_status = False
else:
pass
if not check_status:
@@ -100,7 +100,7 @@ class TDTestCase:
sys.exit(1)
else:
tdLog.info("sqrt value check pass , it work as expected ,sql is \"%s\" "%pow_query )
-
+
def test_errors(self):
error_sql_lists = [
"select sqrt from t1",
@@ -134,42 +134,42 @@ class TDTestCase:
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
-
+
def support_types(self):
type_error_sql_lists = [
- "select sqrt(ts) from t1" ,
+ "select sqrt(ts) from t1" ,
"select sqrt(c7) from t1",
"select sqrt(c8) from t1",
"select sqrt(c9) from t1",
- "select sqrt(ts) from ct1" ,
+ "select sqrt(ts) from ct1" ,
"select sqrt(c7) from ct1",
"select sqrt(c8) from ct1",
"select sqrt(c9) from ct1",
- "select sqrt(ts) from ct3" ,
+ "select sqrt(ts) from ct3" ,
"select sqrt(c7) from ct3",
"select sqrt(c8) from ct3",
"select sqrt(c9) from ct3",
- "select sqrt(ts) from ct4" ,
+ "select sqrt(ts) from ct4" ,
"select sqrt(c7) from ct4",
"select sqrt(c8) from ct4",
"select sqrt(c9) from ct4",
- "select sqrt(ts) from stb1" ,
+ "select sqrt(ts) from stb1" ,
"select sqrt(c7) from stb1",
"select sqrt(c8) from stb1",
"select sqrt(c9) from stb1" ,
- "select sqrt(ts) from stbbb1" ,
+ "select sqrt(ts) from stbbb1" ,
"select sqrt(c7) from stbbb1",
"select sqrt(ts) from tbname",
"select sqrt(c9) from tbname"
]
-
+
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
-
-
+
+
type_sql_lists = [
"select sqrt(c1) from t1",
"select sqrt(c2) from t1",
@@ -199,16 +199,16 @@ class TDTestCase:
"select sqrt(c5) from stb1",
"select sqrt(c6) from stb1",
- "select sqrt(c6) as alisb from stb1",
- "select sqrt(c6) alisb from stb1",
+ "select sqrt(c6) as alisb from stb1",
+ "select sqrt(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
-
+
def basic_sqrt_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -249,7 +249,7 @@ class TDTestCase:
tdSql.checkData(5, 5, None)
self.check_result_auto_sqrt( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from t1", "select sqrt(abs(c1)), sqrt(abs(c2)) ,sqrt(abs(c3)), sqrt(abs(c4)), sqrt(abs(c5)) from t1")
-
+
# used for sub table
tdSql.query("select c2 ,sqrt(c2) from ct1")
tdSql.checkData(0, 1, 298.140906284)
@@ -265,7 +265,7 @@ class TDTestCase:
tdSql.checkData(5 , 2, None)
self.check_result_auto_sqrt( "select c1, c2, c3 , c4, c5 from ct1", "select sqrt(c1), sqrt(c2) ,sqrt(c3), sqrt(c4), sqrt(c5) from ct1")
-
+
# nest query for sqrt functions
tdSql.query("select c4 , sqrt(c4) ,sqrt(sqrt(c4)) , sqrt(sqrt(sqrt(c4))) from ct1;")
tdSql.checkData(0 , 0 , 88)
@@ -283,18 +283,18 @@ class TDTestCase:
tdSql.checkData(11 , 2 , None)
tdSql.checkData(11 , 3 , None)
- # used for stable table
-
+ # used for stable table
+
tdSql.query("select sqrt(c1) from stb1")
tdSql.checkRows(25)
-
+
# used for not exists table
tdSql.error("select sqrt(c1) from stbbb1")
tdSql.error("select sqrt(c1) from tbname")
tdSql.error("select sqrt(c1) from ct5")
- # mix with common col
+ # mix with common col
tdSql.query("select c1, sqrt(c1) from ct1")
tdSql.checkData(0 , 0 ,8)
tdSql.checkData(0 , 1 ,2.828427125)
@@ -314,7 +314,7 @@ class TDTestCase:
tdSql.checkData(0 , 1 ,None)
tdSql.checkData(0 , 2 ,None)
tdSql.checkData(0 , 3 ,None)
-
+
tdSql.checkData(3 , 0 , 6)
tdSql.checkData(3 , 1 ,2.449489743)
tdSql.checkData(3 , 2 ,2.449489743)
@@ -335,7 +335,7 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
-
+
# bug fix for count
tdSql.query("select count(c1) from ct4 ")
tdSql.checkData(0,0,9)
@@ -346,7 +346,7 @@ class TDTestCase:
tdSql.query("select count(*) from stb1 ")
tdSql.checkData(0,0,25)
- # # bug fix for compute
+ # # bug fix for compute
tdSql.query("select c1, sqrt(c1) -0 ,sqrt(c1-4)-0 from ct4 ")
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None)
@@ -397,16 +397,16 @@ class TDTestCase:
tdSql.checkRows(13)
# # bug for compute in functions
- # tdSql.query("select c1, abs(1/0) from ct1")
+ # tdSql.query("select c1, abs(1/0) from ct1")
# tdSql.checkData(0, 0, 8)
# tdSql.checkData(0, 1, 1)
- tdSql.query("select c1, sqrt(1) from ct1")
+ tdSql.query("select c1, sqrt(1) from ct1")
tdSql.checkData(0, 1, 1.000000000)
tdSql.checkRows(13)
# two cols start sqrt(x,y)
- tdSql.query("select c1,c2, sqrt(c2) from ct1")
+ tdSql.query("select c1,c2, sqrt(c2) from ct1")
tdSql.checkData(0, 2, 298.140906284)
tdSql.checkData(1, 2, 278.885281074)
tdSql.checkData(4, 2, 0.000000000)
@@ -445,10 +445,10 @@ class TDTestCase:
tdSql.checkData(0,3,1.000000000)
tdSql.checkData(0,4,0.900000000)
tdSql.checkData(0,5,1.000000000)
-
+
def pow_Arithmetic(self):
pass
-
+
def check_boundary_values(self):
tdSql.execute("drop database if exists bound_test")
@@ -475,11 +475,11 @@ class TDTestCase:
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto_sqrt( "select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ", "select sqrt(abs(c1)), sqrt(abs(c2)) ,sqrt(abs(c3)), sqrt(abs(c4)), sqrt(abs(c5)) from sub1_bound")
-
+
self.check_result_auto_sqrt( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select sqrt(c1), sqrt(c2) ,sqrt(c3), sqrt(c3), sqrt(c2) ,sqrt(c1) from sub1_bound")
self.check_result_auto_sqrt("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound" , "select sqrt(abs(c1)) from sub1_bound" )
-
+
# check basic elem for table per row
tdSql.query("select sqrt(abs(c1)) ,sqrt(abs(c2)) , sqrt(abs(c3)) , sqrt(abs(c4)), sqrt(abs(c5)), sqrt(abs(c6)) from sub1_bound ")
tdSql.checkData(0,0,math.sqrt(2147483647))
@@ -504,7 +504,7 @@ class TDTestCase:
tdSql.checkData(0,1,math.sqrt(9223372036854775807))
tdSql.checkData(0,2,math.sqrt(32767.000000000))
tdSql.checkData(0,3,math.sqrt(63.500000000))
-
+
def support_super_table_test(self):
tdSql.execute(" use db ")
self.check_result_auto_sqrt( " select c5 from stb1 order by ts " , "select sqrt(c5) from stb1 order by ts" )
@@ -522,42 +522,42 @@ class TDTestCase:
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: sqrt basic query ============")
+ tdLog.printNoPrefix("==========step4: sqrt basic query ============")
self.basic_sqrt_function()
- tdLog.printNoPrefix("==========step5: big number sqrt query ============")
+ tdLog.printNoPrefix("==========step5: big number sqrt query ============")
self.test_big_number()
- tdLog.printNoPrefix("==========step6: base number for sqrt query ============")
+ tdLog.printNoPrefix("==========step6: base number for sqrt query ============")
self.pow_base_test()
- tdLog.printNoPrefix("==========step7: sqrt boundary query ============")
+ tdLog.printNoPrefix("==========step7: sqrt boundary query ============")
self.check_boundary_values()
- tdLog.printNoPrefix("==========step8: sqrt filter query ============")
+ tdLog.printNoPrefix("==========step8: sqrt filter query ============")
self.abs_func_filter()
tdLog.printNoPrefix("==========step9: check sqrt result of stable query ============")
- self.support_super_table_test()
+ self.support_super_table_test()
+
-
def stop(self):
tdSql.close()
diff --git a/tests/system-test/2-query/statecount.py b/tests/system-test/2-query/statecount.py
index 162a5a61fed37ff6d0a3060fc4a80f47e2faf803..90e8bebab44cde582b56587deb145d847b57cf1a 100644
--- a/tests/system-test/2-query/statecount.py
+++ b/tests/system-test/2-query/statecount.py
@@ -11,7 +11,7 @@ from util.sql import *
from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
@@ -476,7 +476,7 @@ class TDTestCase:
self.check_unit_time()
self.query_precision()
-
+
def stop(self):
diff --git a/tests/system-test/2-query/stateduration.py b/tests/system-test/2-query/stateduration.py
index 23169553dca96990edab951bbabb457617832db3..6b504468145cab70c248a3dfd84dfb0fd5195882 100644
--- a/tests/system-test/2-query/stateduration.py
+++ b/tests/system-test/2-query/stateduration.py
@@ -25,10 +25,10 @@ class TDTestCase:
def run(self):
tdSql.prepare()
# timestamp = 1ms , time_unit = 1s
- tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
+ tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''')
for i in range(self.row_num):
- tdSql.execute("insert into test values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
+ tdSql.execute("insert into test values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
integer_list = [1,2,3,4,11,12,13,14]
float_list = [5,6]
@@ -72,10 +72,10 @@ class TDTestCase:
tdSql.error(f"select stateduration(col1,{i},5) from test")
# timestamp = 1s, time_unit =1s
- tdSql.execute('''create table test1(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
+ tdSql.execute('''create table test1(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''')
for i in range(self.row_num):
- tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
+ tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i*1000, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
for i in integer_list:
diff --git a/tests/system-test/2-query/timezone.py b/tests/system-test/2-query/timezone.py
index ce2cdc062e6f8b3ce04df6fe8e5ef2549726fdb1..3707d25c88a973ffe4c9a402318aeab14d313e03 100644
--- a/tests/system-test/2-query/timezone.py
+++ b/tests/system-test/2-query/timezone.py
@@ -18,24 +18,24 @@ class TDTestCase:
self.arithmetic_operators = ['+','-','*','/']
self.arithmetic_values = [0,1,100,15.5]
# name of normal table
- self.ntbname = 'ntb'
+ self.ntbname = 'ntb'
# name of stable
- self.stbname = 'stb'
+ self.stbname = 'stb'
# structure of column
- self.column_dict = {
+ self.column_dict = {
'ts':'timestamp',
'c1':'int',
'c2':'float',
'c3':'double'
}
# structure of tag
- self.tag_dict = {
+ self.tag_dict = {
't0':'int'
}
# number of child tables
- self.tbnum = 2
+ self.tbnum = 2
# values of tag,the number of values should equal to tbnum
- self.tag_values = [
+ self.tag_values = [
f'10',
f'100'
]
@@ -62,7 +62,7 @@ class TDTestCase:
time_zone = time_zone_1 + " " + time_zone_2
print("expected time zone: " + time_zone)
return time_zone
-
+
def tb_type_check(self,tb_type):
if tb_type in ['normal_table','child_table']:
tdSql.checkRows(len(self.values_list))
@@ -115,7 +115,7 @@ class TDTestCase:
timezone = self.get_system_timezone()
self.timezone_check_ntb(timezone)
self.timezone_check_stb(timezone)
-
+
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
diff --git a/tests/system-test/2-query/top.py b/tests/system-test/2-query/top.py
index 6120f81e6d34c06942a52c16f6b29b01618d335f..a7a433a8977d6daeb21c944d75535da3038c9674 100644
--- a/tests/system-test/2-query/top.py
+++ b/tests/system-test/2-query/top.py
@@ -45,7 +45,7 @@ class TDTestCase:
'col12': 'binary(20)',
'col13': 'nchar(20)'
}
-
+
self.param_list = [1,100]
def insert_data(self,column_dict,tbname,row_num):
@@ -107,7 +107,7 @@ class TDTestCase:
tdSql.execute(f"create database if not exists {dbname} vgroups 2")
tdSql.execute(f'use {dbname}')
tdSql.execute(self.setsql.set_create_stable_sql(stbname,self.column_dict,tag_dict))
-
+
for i in range(self.tbnum):
tdSql.execute(f"create table {stbname}_{i} using {stbname} tags({tag_values[0]})")
self.insert_data(self.column_dict,f'{stbname}_{i}',self.rowNum)
@@ -141,7 +141,7 @@ class TDTestCase:
self.top_check_ntb()
self.top_check_stb()
-
+
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
diff --git a/tests/system-test/2-query/unique.py b/tests/system-test/2-query/unique.py
index 4467dcb4710f225b6779b815ddf19d8f1e8eb8dd..fce0d21f4d0620d96c90c4273610b7def44e1f13 100644
--- a/tests/system-test/2-query/unique.py
+++ b/tests/system-test/2-query/unique.py
@@ -11,14 +11,14 @@ from util.sql import *
from util.cases import *
class TDTestCase:
- updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
+ updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
"jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
"wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def init(self, conn, logSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor())
-
+
def prepare_datas(self):
tdSql.execute(
'''create table stb1
@@ -26,7 +26,7 @@ class TDTestCase:
tags (t1 int)
'''
)
-
+
tdSql.execute(
'''
create table t1
@@ -68,7 +68,7 @@ class TDTestCase:
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
)
-
+
def test_errors(self):
error_sql_lists = [
"select unique from t1",
@@ -119,40 +119,40 @@ class TDTestCase:
"select unique(c1) , diff(c1) from stb1 partition by tbname",
#"select unique(c1) , abs(c1) from stb1 partition by tbname", # support
#"select unique(c1) , c1 from stb1 partition by tbname" # support
-
+
]
for error_sql in error_sql_lists:
tdSql.error(error_sql)
pass
-
+
def support_types(self):
other_no_value_types = [
- "select unique(ts) from t1" ,
+ "select unique(ts) from t1" ,
"select unique(c7) from t1",
"select unique(c8) from t1",
"select unique(c9) from t1",
- "select unique(ts) from ct1" ,
+ "select unique(ts) from ct1" ,
"select unique(c7) from ct1",
"select unique(c8) from ct1",
"select unique(c9) from ct1",
- "select unique(ts) from ct3" ,
+ "select unique(ts) from ct3" ,
"select unique(c7) from ct3",
"select unique(c8) from ct3",
"select unique(c9) from ct3",
- "select unique(ts) from ct4" ,
+ "select unique(ts) from ct4" ,
"select unique(c7) from ct4",
"select unique(c8) from ct4",
"select unique(c9) from ct4",
- "select unique(ts) from stb1 partition by tbname" ,
+ "select unique(ts) from stb1 partition by tbname" ,
"select unique(c7) from stb1 partition by tbname",
"select unique(c8) from stb1 partition by tbname",
- "select unique(c9) from stb1 partition by tbname"
+ "select unique(c9) from stb1 partition by tbname"
]
-
+
for type_sql in other_no_value_types:
tdSql.query(type_sql)
tdLog.info("support type ok , sql is : %s"%type_sql)
-
+
type_sql_lists = [
"select unique(c1) from t1",
"select unique(c2) from t1",
@@ -182,8 +182,8 @@ class TDTestCase:
"select unique(c5) from stb1 partition by tbname",
"select unique(c6) from stb1 partition by tbname",
- "select unique(c6) as alisb from stb1 partition by tbname",
- "select unique(c6) alisb from stb1 partition by tbname",
+ "select unique(c6) as alisb from stb1 partition by tbname",
+ "select unique(c6) alisb from stb1 partition by tbname",
]
for type_sql in type_sql_lists:
@@ -194,18 +194,18 @@ class TDTestCase:
origin_sql = unique_sql.replace("unique(","").replace(")","")
tdSql.query(unique_sql)
unique_result = tdSql.queryResult
-
+
unique_datas = []
for elem in unique_result:
unique_datas.append(elem[0])
unique_datas.sort(key=lambda x: (x is None, x))
-
+
tdSql.query(origin_sql)
origin_result = tdSql.queryResult
origin_datas = []
for elem in origin_result:
origin_datas.append(elem[0])
-
+
pre_unique = []
for elem in origin_datas:
if elem in pre_unique:
@@ -221,7 +221,7 @@ class TDTestCase:
def basic_unique_function(self):
- # basic query
+ # basic query
tdSql.query("select c1 from ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
@@ -242,19 +242,19 @@ class TDTestCase:
tdSql.checkRows(0)
tdSql.query("select unique(c6) from ct3")
- # will support _rowts mix with
+ # will support _rowts mix with
# tdSql.query("select unique(c6),_rowts from ct3")
-
+
# auto check for t1 table
# used for regular table
tdSql.query("select unique(c1) from t1")
-
+
tdSql.query("desc t1")
col_lists_rows = tdSql.queryResult
col_lists = []
for col_name in col_lists_rows:
col_lists.append(col_name[0])
-
+
for col in col_lists:
self.check_unique_table(f"select unique({col}) from t1")
@@ -269,17 +269,17 @@ class TDTestCase:
#tdSql.error("select unique(c1),tbname from ct1") #support
#tdSql.error("select unique(c1),t1 from ct1") #support
- # unique with common col
+ # unique with common col
#tdSql.error("select unique(c1) ,ts from ct1")
#tdSql.error("select unique(c1) ,c1 from ct1")
- # unique with scalar function
+ # unique with scalar function
#tdSql.error("select unique(c1) ,abs(c1) from ct1")
tdSql.error("select unique(c1) , unique(c2) from ct1")
#tdSql.error("select unique(c1) , abs(c2)+2 from ct1")
-
- # unique with aggregate function
+
+ # unique with aggregate function
tdSql.error("select unique(c1) ,sum(c1) from ct1")
tdSql.error("select unique(c1) ,max(c1) from ct1")
tdSql.error("select unique(c1) ,csum(c1) from ct1")
@@ -306,7 +306,7 @@ class TDTestCase:
tdSql.checkData(7, 0, 1)
tdSql.checkData(8, 0, 0)
- # unique with union all
+ # unique with union all
tdSql.query("select unique(c1) from ct4 union all select c1 from ct1")
tdSql.checkRows(23)
tdSql.query("select unique(c1) from ct4 union all select distinct(c1) from ct4")
@@ -314,8 +314,8 @@ class TDTestCase:
tdSql.query("select unique(c2) from ct4 union all select abs(c2)/2 from ct4")
tdSql.checkRows(22)
- # unique with join
- # prepare join datas with same ts
+ # unique with join
+ # prepare join datas with same ts
tdSql.execute(" use db ")
tdSql.execute(" create stable st1 (ts timestamp , num int) tags(ind int)")
@@ -371,7 +371,7 @@ class TDTestCase:
tdSql.checkRows(10)
tdSql.checkData(0, 0, None)
tdSql.checkData(1, 0, -7.000000000)
-
+
# bug for stable
#partition by tbname
@@ -380,8 +380,8 @@ class TDTestCase:
# tdSql.query(" select unique(c1) from stb1 partition by tbname ")
# tdSql.checkRows(21)
-
- # group by
+
+ # group by
tdSql.error("select unique(c1) from ct1 group by c1")
tdSql.error("select unique(c1) from ct1 group by tbname")
@@ -393,7 +393,7 @@ class TDTestCase:
tdSql.checkRows(4)
- # bug need fix
+ # bug need fix
# tdSql.query("select tbname , tail(c1,2) from stb1 partition by tbname")
# tdSql.checkRows(4)
@@ -411,7 +411,7 @@ class TDTestCase:
tdSql.checkRows(4)
- # # bug need fix
+ # # bug need fix
# tdSql.query(" select tbname , unique(c1) from stb1 where t1 = 0 partition by tbname ")
# tdSql.checkRows(2)
# tdSql.query(" select tbname , unique(c1) from stb1 where t1 = 0 partition by tbname order by tbname ")
@@ -430,7 +430,7 @@ class TDTestCase:
tdSql.query(" select unique(t1) from stb1 partition by tbname ")
tdSql.checkRows(2)
- # nest query
+ # nest query
tdSql.query(" select unique(c1) from (select _rowts , t1 ,c1 , tbname from stb1 ) ")
tdSql.checkRows(11)
tdSql.checkData(0,0,6)
@@ -439,7 +439,7 @@ class TDTestCase:
tdSql.checkRows(2)
tdSql.checkData(0,0,4)
tdSql.checkData(1,0,1)
-
+
def check_boundary_values(self):
tdSql.execute("drop database if exists bound_test")
@@ -467,11 +467,11 @@ class TDTestCase:
tdSql.execute(
f"insert into sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
-
+
tdSql.error(
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
-
+
tdSql.query("select unique(c2) from sub1_bound order by 1 desc")
tdSql.checkRows(5)
tdSql.checkData(0,0,9223372036854775807)
@@ -480,22 +480,22 @@ class TDTestCase:
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table ==============")
-
+
self.prepare_datas()
- tdLog.printNoPrefix("==========step2:test errors ==============")
+ tdLog.printNoPrefix("==========step2:test errors ==============")
self.test_errors()
-
- tdLog.printNoPrefix("==========step3:support types ============")
+
+ tdLog.printNoPrefix("==========step3:support types ============")
self.support_types()
- tdLog.printNoPrefix("==========step4: floor basic query ============")
+ tdLog.printNoPrefix("==========step4: floor basic query ============")
self.basic_unique_function()
- tdLog.printNoPrefix("==========step5: floor boundary query ============")
+ tdLog.printNoPrefix("==========step5: floor boundary query ============")
self.check_boundary_values()
diff --git a/tests/system-test/7-tmq/dataFromTsdbNWal.py b/tests/system-test/7-tmq/dataFromTsdbNWal.py
new file mode 100644
index 0000000000000000000000000000000000000000..227ce9d5a5c51e28ccbe009c7d472a18fbb297c6
--- /dev/null
+++ b/tests/system-test/7-tmq/dataFromTsdbNWal.py
@@ -0,0 +1,253 @@
+
+import taos
+import sys
+import time
+import socket
+import os
+import threading
+import math
+
+from util.log import *
+from util.sql import *
+from util.cases import *
+from util.dnodes import *
+from util.common import *
+sys.path.append("./7-tmq")
+from tmqCommon import *
+
+class TDTestCase:
+ def __init__(self):
+ self.vgroups = 1
+ self.ctbNum = 100
+ self.rowsPerTbl = 10000
+
+ def init(self, conn, logSql):
+ tdLog.debug(f"start to excute {__file__}")
+ tdSql.init(conn.cursor(), False)
+
+ def prepareTestEnv(self):
+ tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 1,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 100,
+ 'rowsPerTbl': 10000,
+ 'batchNum': 3000,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 10,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 1}
+
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ tmqCom.initConsumerTable()
+ tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdLog.info("create stb")
+ tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
+ tdLog.info("create ctb")
+ tmqCom.create_ctable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix=paraDict['ctbPrefix'],
+ ctbNum=paraDict["ctbNum"],ctbStartIdx=paraDict['ctbStartIdx'])
+
+ tdLog.info("insert data")
+ tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"],
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+
+ tdLog.info("flush db to let data falls into the disk")
+ tdSql.query("flush database %s"%(paraDict['dbName']))
+ return
+
+ def tmqCase1(self):
+ tdLog.printNoPrefix("======== test case 1: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 1,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 10,
+ 'rowsPerTbl': 10000,
+ 'batchNum': 100,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 3,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 1}
+
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ topicNameList = ['topic1']
+ expectRowsList = []
+ tmqCom.initConsumerTable()
+
+ tdLog.info("create topics from stb with filter")
+ queryString = "select * from %s.%s"%(paraDict['dbName'], paraDict['stbName'])
+ # sqlString = "create topic %s as stable %s" %(topicNameList[0], paraDict['stbName'])
+ sqlString = "create topic %s as %s" %(topicNameList[0], queryString)
+ tdLog.info("create topic sql: %s"%sqlString)
+ tdSql.execute(sqlString)
+ # tdSql.query(queryString)
+ # expectRowsList.append(tdSql.getRows())
+
+ # init consume info, and start tmq_sim, then check consume result
+ tdLog.info("insert consume info to consume processor")
+ consumerId = 0
+ expectrowcnt = paraDict["rowsPerTbl"] * paraDict["ctbNum"] * 2
+ topicList = topicNameList[0]
+ ifcheckdata = 1
+ ifManualCommit = 1
+ keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest'
+ tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit)
+
+ tdLog.info("start consume processor")
+ tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
+
+ # after start consume, continue insert some data
+ paraDict['batchNum'] = 100
+ paraDict['startTs'] = paraDict['startTs'] + self.rowsPerTbl
+ tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"],
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+
+ #
+ tdSql.query(queryString)
+ expectRowsList.append(tdSql.getRows())
+
+ tdLog.info("wait the consume result")
+ expectRows = 1
+ resultList = tmqCom.selectConsumeResult(expectRows)
+
+
+ tdLog.info("expect consume rows: %d, act consume rows: %d"%(expectRowsList[0], resultList[0]))
+ if expectRowsList[0] != resultList[0]:
+ tdLog.exit("%d tmq consume rows error!"%consumerId)
+
+ tmqCom.checkFileContent(consumerId, queryString)
+
+ time.sleep(10)
+ for i in range(len(topicNameList)):
+ tdSql.query("drop topic %s"%topicNameList[i])
+
+ tdLog.printNoPrefix("======== test case 1 end ...... ")
+
+ def tmqCase2(self):
+ tdLog.printNoPrefix("======== test case 2: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 1,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 10,
+ 'rowsPerTbl': 10000,
+ 'batchNum': 10,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 3,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 1}
+
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ topicNameList = ['topic1']
+ expectRowsList = []
+ tmqCom.initConsumerTable()
+
+ tdLog.info("create topics from stb with filter")
+ queryString = "select * from %s.%s"%(paraDict['dbName'], paraDict['stbName'])
+ # sqlString = "create topic %s as stable %s" %(topicNameList[0], paraDict['stbName'])
+ sqlString = "create topic %s as %s" %(topicNameList[0], queryString)
+ tdLog.info("create topic sql: %s"%sqlString)
+ tdSql.execute(sqlString)
+ tdSql.query(queryString)
+ expectRowsList.append(tdSql.getRows())
+ totalRowsInserted = expectRowsList[0]
+
+ # init consume info, and start tmq_sim, then check consume result
+ tdLog.info("insert consume info to consume processor")
+ consumerId = 1
+ expectrowcnt = math.ceil(paraDict["rowsPerTbl"] * paraDict["ctbNum"] / 3)
+ topicList = topicNameList[0]
+ ifcheckdata = 1
+ ifManualCommit = 1
+ keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest'
+ tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit)
+
+ tdLog.info("start consume processor 0")
+ tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
+ tdLog.info("wait the consume result")
+
+ expectRows = 1
+ resultList = tmqCom.selectConsumeResult(expectRows)
+
+ if not (expectrowcnt <= resultList[0] and totalRowsInserted >= resultList[0]):
+ tdLog.info("act consume rows: %d, expect consume rows between %d and %d"%(resultList[0], expectrowcnt, totalRowsInserted))
+ tdLog.exit("%d tmq consume rows error!"%consumerId)
+
+ firstConsumeRows = resultList[0]
+
+ # reinit consume info, and start tmq_sim, then check consume result
+ tmqCom.initConsumerTable()
+ consumerId = 2
+ expectrowcnt = math.ceil(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * 2/3)
+ tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit)
+
+ tdLog.info("start consume processor 1")
+ tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
+ tdLog.info("wait the consume result")
+
+ expectRows = 1
+ resultList = tmqCom.selectConsumeResult(expectRows)
+
+ actConsumeTotalRows = firstConsumeRows + resultList[0]
+
+ if not (expectrowcnt >= resultList[0] and totalRowsInserted == actConsumeTotalRows):
+ tdLog.info("act consume rows, first: %d, second: %d "%(firstConsumeRows, resultList[0]))
+ tdLog.info("and sum of two consume rows: %d should be equal to total inserted rows: %d"%(actConsumeTotalRows, totalRowsInserted))
+ tdLog.exit("%d tmq consume rows error!"%consumerId)
+
+ time.sleep(10)
+ for i in range(len(topicNameList)):
+ tdSql.query("drop topic %s"%topicNameList[i])
+
+ tdLog.printNoPrefix("======== test case 2 end ...... ")
+
+ def run(self):
+ tdSql.prepare()
+ self.prepareTestEnv()
+ self.tmqCase1()
+ # self.tmqCase2()
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success(f"{__file__} successfully executed")
+
+event = threading.Event()
+
+tdCases.addLinux(__file__, TDTestCase())
+tdCases.addWindows(__file__, TDTestCase())
diff --git a/tests/system-test/7-tmq/tmqCommon.py b/tests/system-test/7-tmq/tmqCommon.py
index 2030563a9a0cb47b6b8ac4ff4bd553634f5f5a5d..060e17c11f994ec1ce01628cc6936b145ef2fe84 100644
--- a/tests/system-test/7-tmq/tmqCommon.py
+++ b/tests/system-test/7-tmq/tmqCommon.py
@@ -371,7 +371,7 @@ class TMQCom:
elif (i % 3 == 0):
tagBinaryValue = 'changsha'
- sql += " %s.%s_%d using %s.%s tags (%d, %d, %d, '%s', '%s') values "%(dbName,ctbPrefix,i+ctbStartIdx,dbName,stbName,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx,tagBinaryValue,tagBinaryValue)
+ sql += " %s.%s%d using %s.%s tags (%d, %d, %d, '%s', '%s') values "%(dbName,ctbPrefix,i+ctbStartIdx,dbName,stbName,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx,tagBinaryValue,tagBinaryValue)
for j in range(rowsPerTbl):
sql += "(%d, %d, %d, %d, 'binary_%d', 'nchar_%d', now) "%(startTs+j, j,j, j,i+ctbStartIdx,rowsBatched)
rowsBatched += 1
@@ -379,7 +379,7 @@ class TMQCom:
tsql.execute(sql)
rowsBatched = 0
if j < rowsPerTbl - 1:
- sql = "insert into %s.%s_%d using %s.%s tags (%d, %d, %d, '%s', '%s') values " %(dbName,ctbPrefix,i+ctbStartIdx,dbName,stbName,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx,tagBinaryValue,tagBinaryValue)
+ sql = "insert into %s.%s%d using %s.%s tags (%d, %d, %d, '%s', '%s') values " %(dbName,ctbPrefix,i+ctbStartIdx,dbName,stbName,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx,tagBinaryValue,tagBinaryValue)
else:
sql = "insert into "
#end sql
@@ -444,6 +444,7 @@ class TMQCom:
# skip first line for it is schema
queryFile.readline()
+
lines = 0
while True:
dst = queryFile.readline()
diff --git a/tests/system-test/7-tmq/tmqUpdate-1ctb.py b/tests/system-test/7-tmq/tmqUpdate-1ctb.py
new file mode 100644
index 0000000000000000000000000000000000000000..8513092be92b058a8d5c6b203351c8ec12c96a47
--- /dev/null
+++ b/tests/system-test/7-tmq/tmqUpdate-1ctb.py
@@ -0,0 +1,259 @@
+
+import taos
+import sys
+import time
+import socket
+import os
+import threading
+from enum import Enum
+
+from util.log import *
+from util.sql import *
+from util.cases import *
+from util.dnodes import *
+sys.path.append("./7-tmq")
+from tmqCommon import *
+
+class TDTestCase:
+ def __init__(self):
+ self.snapshot = 0
+ self.vgroups = 4
+ self.ctbNum = 1
+ self.rowsPerTbl = 10000
+
+ def init(self, conn, logSql):
+ tdLog.debug(f"start to excute {__file__}")
+ tdSql.init(conn.cursor(), False)
+
+ def prepareTestEnv(self):
+ tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 4,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 1,
+ 'rowsPerTbl': 100000,
+ 'batchNum': 1200,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 3,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 0}
+
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ tmqCom.initConsumerTable()
+ tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdLog.info("create stb")
+ tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
+ tdLog.info("create ctb")
+ tmqCom.create_ctable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix=paraDict['ctbPrefix'],
+ ctbNum=paraDict["ctbNum"],ctbStartIdx=paraDict['ctbStartIdx'])
+ tdLog.info("insert data")
+ tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"],
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+ # tmqCom.insert_data_with_autoCreateTbl(tsql=tdSql,dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix="ctbx",
+ # ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ # startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+
+ # tdLog.info("restart taosd to ensure that the data falls into the disk")
+ # tdSql.query("flush database %s"%(paraDict['dbName']))
+ return
+
+ # 自动建表完成数据插入,启动消费
+ def tmqCase1(self):
+ tdLog.printNoPrefix("======== test case 1: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 4,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 1,
+ 'rowsPerTbl': 100000,
+ 'batchNum': 3000,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 5,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 0}
+ paraDict['snapshot'] = self.snapshot
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ # update to half tables
+ paraDict['rowsPerTbl'] = int(self.rowsPerTbl / 2)
+ # tmqCom.insert_data_with_autoCreateTbl(tsql=tdSql,dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix="ctbx",
+ # ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ # startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+ tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"],
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+
+ tdLog.info("create topics from stb1")
+ topicFromStb1 = 'topic_stb1'
+ queryString = "select ts, c1, c2 from %s.%s"%(paraDict['dbName'], paraDict['stbName'])
+ sqlString = "create topic %s as %s" %(topicFromStb1, queryString)
+ tdLog.info("create topic sql: %s"%sqlString)
+ tdSql.execute(sqlString)
+
+ # paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+ consumerId = 0
+ expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * 3/2)
+ topicList = topicFromStb1
+ ifcheckdata = 1
+ ifManualCommit = 1
+ keyList = 'group.id:cgrp1,\
+ enable.auto.commit:true,\
+ auto.commit.interval.ms:1000,\
+ auto.offset.reset:earliest'
+ tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit)
+
+ tdLog.info("start consume processor")
+ tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
+
+ tdLog.info("insert process end, and start to check consume result")
+ expectRows = 1
+ resultList = tmqCom.selectConsumeResult(expectRows)
+ totalConsumeRows = 0
+ for i in range(expectRows):
+ totalConsumeRows += resultList[i]
+
+ tdSql.query(queryString)
+ totalRowsInserted = tdSql.getRows()
+
+ tdLog.info("act consume rows: %d, expect consume rows: %d, act insert rows: %d"%(totalConsumeRows, expectrowcnt, totalRowsInserted))
+ if totalConsumeRows != expectrowcnt:
+ tdLog.exit("tmq consume rows error!")
+
+ tmqCom.checkFileContent(consumerId, queryString)
+
+ tdSql.query("drop topic %s"%topicFromStb1)
+ tdLog.printNoPrefix("======== test case 1 end ...... ")
+
+ def tmqCase2(self):
+ tdLog.printNoPrefix("======== test case 2: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 4,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 1,
+ 'rowsPerTbl': 10000,
+ 'batchNum': 5000,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 5,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 0}
+
+ paraDict['snapshot'] = self.snapshot
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ tdLog.info("restart taosd to ensure that the data falls into the disk")
+ tdSql.query("flush database %s"%(paraDict['dbName']))
+
+ # update to half tables
+ paraDict['startTs'] = paraDict['startTs'] + int(self.rowsPerTbl / 2)
+ paraDict['rowsPerTbl'] = int(self.rowsPerTbl / 2)
+ tmqCom.insert_data_with_autoCreateTbl(tsql=tdSql,dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix=paraDict["ctbPrefix"],
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+ # tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"],
+ # ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ # startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+
+ tmqCom.initConsumerTable()
+ tdLog.info("create topics from stb1")
+ topicFromStb1 = 'topic_stb1'
+ queryString = "select ts, c1, c2 from %s.%s"%(paraDict['dbName'], paraDict['stbName'])
+ sqlString = "create topic %s as %s" %(topicFromStb1, queryString)
+ tdLog.info("create topic sql: %s"%sqlString)
+ tdSql.execute(sqlString)
+
+ # paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+ consumerId = 1
+ expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * 2)
+ topicList = topicFromStb1
+ ifcheckdata = 1
+ ifManualCommit = 1
+ keyList = 'group.id:cgrp1,\
+ enable.auto.commit:true,\
+ auto.commit.interval.ms:1000,\
+ auto.offset.reset:earliest'
+ tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit)
+
+ tdLog.info("start consume processor")
+ tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
+
+ tdLog.info("insert process end, and start to check consume result")
+ expectRows = 1
+ resultList = tmqCom.selectConsumeResult(expectRows)
+ totalConsumeRows = 0
+ for i in range(expectRows):
+ totalConsumeRows += resultList[i]
+
+ tdSql.query(queryString)
+ totalRowsInserted = tdSql.getRows()
+
+ tdLog.info("act consume rows: %d, act insert rows: %d, expect consume rows: %d, "%(totalConsumeRows, totalRowsInserted, expectrowcnt))
+
+ if totalConsumeRows != expectrowcnt:
+ tdLog.exit("tmq consume rows error!")
+
+ # tmqCom.checkFileContent(consumerId, queryString)
+
+ tdSql.query("drop topic %s"%topicFromStb1)
+
+ tdLog.printNoPrefix("======== test case 2 end ...... ")
+
+ def run(self):
+ tdSql.prepare()
+ # self.prepareTestEnv()
+ # tdLog.printNoPrefix("=============================================")
+ # tdLog.printNoPrefix("======== snapshot is 0: only consume from wal")
+ # self.tmqCase1()
+ # self.tmqCase2()
+
+ self.prepareTestEnv()
+ tdLog.printNoPrefix("====================================================================")
+ tdLog.printNoPrefix("======== snapshot is 1: firstly consume from tsbs, and then from wal")
+ self.snapshot = 1
+ self.tmqCase1()
+ # self.tmqCase2()
+
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success(f"{__file__} successfully executed")
+
+event = threading.Event()
+
+tdCases.addLinux(__file__, TDTestCase())
+tdCases.addWindows(__file__, TDTestCase())
diff --git a/tests/system-test/7-tmq/tmqUpdate-multiCtb.py b/tests/system-test/7-tmq/tmqUpdate-multiCtb.py
new file mode 100644
index 0000000000000000000000000000000000000000..491feb68bd6bc668a6653dce86ca0e28a78a94f8
--- /dev/null
+++ b/tests/system-test/7-tmq/tmqUpdate-multiCtb.py
@@ -0,0 +1,276 @@
+
+import taos
+import sys
+import time
+import socket
+import os
+import threading
+from enum import Enum
+
+from util.log import *
+from util.sql import *
+from util.cases import *
+from util.dnodes import *
+sys.path.append("./7-tmq")
+from tmqCommon import *
+
+class TDTestCase:
+ def __init__(self):
+ self.snapshot = 0
+ self.vgroups = 4
+ self.ctbNum = 100
+ self.rowsPerTbl = 1000
+ self.autoCtbPrefix = 'aCtb'
+
+ def init(self, conn, logSql):
+ tdLog.debug(f"start to excute {__file__}")
+ tdSql.init(conn.cursor(), False)
+
+ def prepareTestEnv(self):
+ tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 4,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 1000,
+ 'rowsPerTbl': 1000,
+ 'batchNum': 10000,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 3,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 0}
+
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ tmqCom.initConsumerTable()
+ tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdLog.info("create stb")
+ tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
+ tdLog.info("create ctb")
+ tmqCom.create_ctable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix=paraDict['ctbPrefix'],
+ ctbNum=paraDict["ctbNum"],ctbStartIdx=paraDict['ctbStartIdx'])
+ tdLog.info("insert data")
+ tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"],
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+ tmqCom.insert_data_with_autoCreateTbl(tsql=tdSql,dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix=self.autoCtbPrefix,
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+
+ # tdLog.info("restart taosd to ensure that the data falls into the disk")
+ # tdSql.query("flush database %s"%(paraDict['dbName']))
+ return
+
+ # 自动建表完成数据插入,启动消费
+ def tmqCase1(self):
+ tdLog.printNoPrefix("======== test case 1: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 4,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 1000,
+ 'rowsPerTbl': 1000,
+ 'batchNum': 10000,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 5,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 0}
+ paraDict['snapshot'] = self.snapshot
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ # update to half tables
+ paraDict['ctbNum'] = int(self.ctbNum/2)
+ paraDict['rowsPerTbl'] = int(self.rowsPerTbl / 2)
+ tmqCom.insert_data_with_autoCreateTbl(tsql=tdSql,dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix=self.autoCtbPrefix,
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+ tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"],
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+
+ tdLog.info("create topics from stb1")
+ topicFromStb1 = 'topic_stb1'
+ queryString = "select ts, c1, c2 from %s.%s"%(paraDict['dbName'], paraDict['stbName'])
+ sqlString = "create topic %s as %s" %(topicFromStb1, queryString)
+ tdLog.info("create topic sql: %s"%sqlString)
+ tdSql.execute(sqlString)
+
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+ consumerId = 0
+ if self.snapshot == 0:
+ expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (2 + 1/2*1/2*2))
+ elif self.snapshot == 1:
+ expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (2))
+
+ topicList = topicFromStb1
+ ifcheckdata = 1
+ ifManualCommit = 1
+ keyList = 'group.id:cgrp1,\
+ enable.auto.commit:true,\
+ auto.commit.interval.ms:1000,\
+ auto.offset.reset:earliest'
+ tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit)
+
+ tdLog.info("start consume processor")
+ tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
+
+ tdLog.info("start to check consume result")
+ expectRows = 1
+ resultList = tmqCom.selectConsumeResult(expectRows)
+ totalConsumeRows = 0
+ for i in range(expectRows):
+ totalConsumeRows += resultList[i]
+
+ tdSql.query(queryString)
+ totalRowsInserted = tdSql.getRows()
+
+ tdLog.info("act consume rows: %d, expect consume rows: %d, act insert rows: %d"%(totalConsumeRows, expectrowcnt, totalRowsInserted))
+ if totalConsumeRows != expectrowcnt:
+ tdLog.exit("tmq consume rows error!")
+
+ # tmqCom.checkFileContent(consumerId, queryString)
+
+ tdSql.query("drop topic %s"%topicFromStb1)
+ tdLog.printNoPrefix("======== test case 1 end ...... ")
+
+ def tmqCase2(self):
+ tdLog.printNoPrefix("======== test case 2: ")
+ paraDict = {'dbName': 'dbt',
+ 'dropFlag': 1,
+ 'event': '',
+ 'vgroups': 4,
+ 'stbName': 'stb',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1},{'type': 'TIMESTAMP', 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}],
+ 'ctbPrefix': 'ctb',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 1000,
+ 'rowsPerTbl': 1000,
+ 'batchNum': 10000,
+ 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
+ 'pollDelay': 5,
+ 'showMsg': 1,
+ 'showRow': 1,
+ 'snapshot': 0}
+
+ paraDict['snapshot'] = self.snapshot
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ tdLog.info("restart taosd to ensure that the data falls into the disk")
+ tdSql.query("flush database %s"%(paraDict['dbName']))
+
+ # update to half tables
+ paraDict['ctbNum'] = int(self.ctbNum/2)
+ paraDict['rowsPerTbl'] = int(self.rowsPerTbl / 2)
+ paraDict['startTs'] = paraDict['startTs'] + int(self.rowsPerTbl / 2)
+ tmqCom.insert_data_with_autoCreateTbl(tsql=tdSql,dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix=self.autoCtbPrefix,
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx']+int(self.ctbNum/2))
+
+ tmqCom.insert_data_with_autoCreateTbl(tsql=tdSql,dbName=paraDict["dbName"],stbName=paraDict["stbName"],ctbPrefix="aCtby",
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx']+int(self.ctbNum/2))
+
+ tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"],
+ ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
+ startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx']+int(self.ctbNum/2))
+
+ tmqCom.initConsumerTable()
+ tdLog.info("create topics from stb1")
+ topicFromStb1 = 'topic_stb1'
+ queryString = "select ts, c1, c2 from %s.%s"%(paraDict['dbName'], paraDict['stbName'])
+ sqlString = "create topic %s as %s" %(topicFromStb1, queryString)
+ tdLog.info("create topic sql: %s"%sqlString)
+ tdSql.execute(sqlString)
+
+ # paraDict['ctbNum'] = self.ctbNum
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+ consumerId = 1
+ if self.snapshot == 0:
+ expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (2 + 1/2*1/2*2 + 1/2*1/2))
+ elif self.snapshot == 1:
+ expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (2 + 1/2*1/2))
+
+ topicList = topicFromStb1
+ ifcheckdata = 1
+ ifManualCommit = 1
+ keyList = 'group.id:cgrp1,\
+ enable.auto.commit:true,\
+ auto.commit.interval.ms:1000,\
+ auto.offset.reset:earliest'
+ tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit)
+
+ tdLog.info("start consume processor")
+ tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
+
+ tdLog.info("start to check consume result")
+ expectRows = 1
+ resultList = tmqCom.selectConsumeResult(expectRows)
+ totalConsumeRows = 0
+ for i in range(expectRows):
+ totalConsumeRows += resultList[i]
+
+ tdSql.query(queryString)
+ totalRowsInserted = tdSql.getRows()
+
+ tdLog.info("act consume rows: %d, act insert rows: %d, expect consume rows: %d, "%(totalConsumeRows, totalRowsInserted, expectrowcnt))
+
+ if totalConsumeRows != expectrowcnt:
+ tdLog.exit("tmq consume rows error!")
+
+ # tmqCom.checkFileContent(consumerId, queryString)
+
+ tdSql.query("drop topic %s"%topicFromStb1)
+
+ tdLog.printNoPrefix("======== test case 2 end ...... ")
+
+ def run(self):
+ tdSql.prepare()
+ self.prepareTestEnv()
+ tdLog.printNoPrefix("=============================================")
+ tdLog.printNoPrefix("======== snapshot is 0: only consume from wal")
+ self.tmqCase1()
+ self.tmqCase2()
+
+ self.prepareTestEnv()
+ tdLog.printNoPrefix("====================================================================")
+ tdLog.printNoPrefix("======== snapshot is 1: firstly consume from tsbs, and then from wal")
+ self.snapshot = 1
+ self.tmqCase1()
+ self.tmqCase2()
+
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success(f"{__file__} successfully executed")
+
+event = threading.Event()
+
+tdCases.addLinux(__file__, TDTestCase())
+tdCases.addWindows(__file__, TDTestCase())
diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh
index 3e1d6b217a27a58d8d73ad0160cb2c7fdeaafe27..8bafe3c966127203f02c991199e8743a8dfaafe6 100755
--- a/tests/system-test/fulltest.sh
+++ b/tests/system-test/fulltest.sh
@@ -11,7 +11,7 @@ python3 ./test.py -f 0-others/udfTest.py
python3 ./test.py -f 0-others/udf_create.py
python3 ./test.py -f 0-others/udf_restart_taosd.py
python3 ./test.py -f 0-others/cachelast.py
-
+python3 ./test.py -f 0-others/sysinfo.py
python3 ./test.py -f 0-others/user_control.py
python3 ./test.py -f 0-others/fsync.py
@@ -21,7 +21,7 @@ python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py
python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py
python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py
python3 ./test.py -f 1-insert/alter_stable.py
-#python3 ./test.py -f 1-insert/alter_table.py
+python3 ./test.py -f 1-insert/alter_table.py
python3 ./test.py -f 1-insert/insertWithMoreVgroup.py
python3 ./test.py -f 1-insert/table_comment.py
python3 ./test.py -f 1-insert/time_range_wise.py
@@ -178,6 +178,9 @@ python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py
#python3 ./test.py -f 7-tmq/tmqDnodeRestart.py
+#python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py
+python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb.py
+#python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py
#------------querPolicy 2-----------
@@ -353,4 +356,4 @@ python3 ./test.py -f 2-query/twa.py -Q 3
python3 ./test.py -f 2-query/irate.py -Q 3
python3 ./test.py -f 2-query/function_null.py -Q 3
python3 ./test.py -f 2-query/count_partition.py -Q 3
-python3 ./test.py -f 2-query/max_partition.py -Q 3
\ No newline at end of file
+python3 ./test.py -f 2-query/max_partition.py -Q 3
diff --git a/tests/system-test/test.py b/tests/system-test/test.py
index 0a891759d0afa5174ae32396188783e668efaaf0..b893f7af647b202489ea0168f65cdb99a6655270 100644
--- a/tests/system-test/test.py
+++ b/tests/system-test/test.py
@@ -37,12 +37,13 @@ def checkRunTimeError():
time.sleep(1)
timeCount = timeCount + 1
print("checkRunTimeError",timeCount)
- if (timeCount>900):
+ if (timeCount>600):
print("stop the test.")
os.system("TASKKILL /F /IM taosd.exe")
os.system("TASKKILL /F /IM taos.exe")
os.system("TASKKILL /F /IM tmq_sim.exe")
os.system("TASKKILL /F /IM mintty.exe")
+ os.system("TASKKILL /F /IM python.exe")
quit(0)
hwnd = win32gui.FindWindow(None, "Microsoft Visual C++ Runtime Library")
if hwnd:
@@ -228,6 +229,22 @@ if __name__ == "__main__":
tdDnodes.deploy(1,updateCfgDict)
tdDnodes.start(1)
tdCases.logSql(logSql)
+ if queryPolicy != 1:
+ queryPolicy=int(queryPolicy)
+ conn = taos.connect(
+ host,
+ config=tdDnodes.getSimCfgPath())
+ tdSql.init(conn.cursor())
+ tdSql.execute("create qnode on dnode 1")
+ tdSql.execute('alter local "queryPolicy" "%d"'%queryPolicy)
+ tdSql.query("show local variables;")
+ for i in range(tdSql.queryRows):
+ if tdSql.queryResult[i][0] == "queryPolicy" :
+ if int(tdSql.queryResult[i][1]) == int(queryPolicy):
+ tdLog.success('alter queryPolicy to %d successfully'%queryPolicy)
+ else :
+ tdLog.debug(tdSql.queryResult)
+ tdLog.exit("alter queryPolicy to %d failed"%queryPolicy)
else :
tdLog.debug("create an cluster with %s nodes and make %s dnode as independent mnode"%(dnodeNums,mnodeNums))
dnodeslist = cluster.configure_cluster(dnodeNums=dnodeNums,mnodeNums=mnodeNums)
@@ -370,3 +387,4 @@ if __name__ == "__main__":
tdLog.info("not need to query")
if conn is not None:
conn.close()
+ sys.exit(0)
diff --git a/tools/taos-tools b/tools/taos-tools
index 3f42d428eb6b90dea2651f4ccea66e44705c831b..bd496f76b64931c66da2f8b0f24143a98a881cde 160000
--- a/tools/taos-tools
+++ b/tools/taos-tools
@@ -1 +1 @@
-Subproject commit 3f42d428eb6b90dea2651f4ccea66e44705c831b
+Subproject commit bd496f76b64931c66da2f8b0f24143a98a881cde
diff --git a/tools/taosadapter b/tools/taosadapter
index c885e967e490105999b84d009a15168728dfafaf..df8678f070e3f707faf59baebec90065f6e1268b 160000
--- a/tools/taosadapter
+++ b/tools/taosadapter
@@ -1 +1 @@
-Subproject commit c885e967e490105999b84d009a15168728dfafaf
+Subproject commit df8678f070e3f707faf59baebec90065f6e1268b
diff --git a/tools/taosws-rs b/tools/taosws-rs
index 6dccac192a2ae7dd78718ab926201aab5419327a..7a94ffab45f08e16f09b3f430fe75d717054adb6 160000
--- a/tools/taosws-rs
+++ b/tools/taosws-rs
@@ -1 +1 @@
-Subproject commit 6dccac192a2ae7dd78718ab926201aab5419327a
+Subproject commit 7a94ffab45f08e16f09b3f430fe75d717054adb6