diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 41bfe3456173fe3c87eac7a09fcaf3ae42dea38d..2b962333d588117ba54f363b7da586b6f04e3d47 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -394,7 +394,7 @@ static int32_t tsCheckTimestamp(STableDataBlocks *pDataBlocks, const char *start TSKEY k = *(TSKEY *)start; - if (k == 0) { + if (k == INT64_MIN) { if (pDataBlocks->tsSource == TSDB_USE_CLI_TS) { return -1; } else if (pDataBlocks->tsSource == -1) { diff --git a/src/common/src/texpr.c b/src/common/src/texpr.c index f50b829baa7c6dadea99bd81874cef57140f4fc0..1008c4cf8f77ca77f59a57aea189cdebef9c9129 100644 --- a/src/common/src/texpr.c +++ b/src/common/src/texpr.c @@ -41,41 +41,46 @@ static uint8_t UNUSED_FUNC isQueryOnPrimaryKey(const char *primaryColumnName, co static void reverseCopy(char* dest, const char* src, int16_t type, int32_t numOfRows) { switch(type) { - case TSDB_DATA_TYPE_TINYINT: { + case TSDB_DATA_TYPE_TINYINT: + case TSDB_DATA_TYPE_UTINYINT:{ int8_t* p = (int8_t*) dest; int8_t* pSrc = (int8_t*) src; for(int32_t i = 0; i < numOfRows; ++i) { p[i] = pSrc[numOfRows - i - 1]; } - break; + return; } - case TSDB_DATA_TYPE_SMALLINT: { + + case TSDB_DATA_TYPE_SMALLINT: + case TSDB_DATA_TYPE_USMALLINT:{ int16_t* p = (int16_t*) dest; int16_t* pSrc = (int16_t*) src; for(int32_t i = 0; i < numOfRows; ++i) { p[i] = pSrc[numOfRows - i - 1]; } - break; + return; } - case TSDB_DATA_TYPE_INT: { + case TSDB_DATA_TYPE_INT: + case TSDB_DATA_TYPE_UINT: { int32_t* p = (int32_t*) dest; int32_t* pSrc = (int32_t*) src; for(int32_t i = 0; i < numOfRows; ++i) { p[i] = pSrc[numOfRows - i - 1]; } - break; + return; } - case TSDB_DATA_TYPE_BIGINT: { + case TSDB_DATA_TYPE_BIGINT: + case TSDB_DATA_TYPE_UBIGINT: { int64_t* p = (int64_t*) dest; int64_t* pSrc = (int64_t*) src; for(int32_t i = 0; i < numOfRows; ++i) { p[i] = pSrc[numOfRows - i - 1]; } - break; + return; } case TSDB_DATA_TYPE_FLOAT: { float* p = (float*) dest; @@ -84,7 +89,7 @@ static void reverseCopy(char* dest, const char* src, int16_t type, int32_t numOf for(int32_t i = 0; i < numOfRows; ++i) { p[i] = pSrc[numOfRows - i - 1]; } - break; + return; } case TSDB_DATA_TYPE_DOUBLE: { double* p = (double*) dest; @@ -93,7 +98,7 @@ static void reverseCopy(char* dest, const char* src, int16_t type, int32_t numOf for(int32_t i = 0; i < numOfRows; ++i) { p[i] = pSrc[numOfRows - i - 1]; } - break; + return; } default: assert(0); } diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 82b5fb3e008265bae5e3c4a2045239b6534b1226..b9529aac8ec572083406f0d902d48f424ef4547b 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -418,7 +418,7 @@ static char* formatTimestamp(char* buf, int64_t val, int precision) { #ifdef WINDOWS if (tt < 0) tt = 0; #endif - if (tt < 0 && ms != 0) { + if (tt <= 0 && ms < 0) { tt--; if (precision == TSDB_TIME_PRECISION_MICRO) { ms += 1000000; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index b2d97e2d6935096ed5171d5284cfcb1987e36535..18a421fa55f7f58336fc4310a5449634193f9fe9 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4173,8 +4173,10 @@ static SSDataBlock* doTableScan(void* param) { assert(ret); } - pResultRowInfo->curIndex = 0; - pResultRowInfo->prevSKey = pResultRowInfo->pResult[0]->win.skey; + if (pResultRowInfo->size > 0) { + pResultRowInfo->curIndex = 0; + pResultRowInfo->prevSKey = pResultRowInfo->pResult[0]->win.skey; + } qDebug("QInfo:%p start to repeat scan data blocks due to query func required, qrange:%" PRId64 "-%" PRId64, pRuntimeEnv->qinfo, cond.twindow.skey, cond.twindow.ekey); diff --git a/tests/script/general/parser/testSuite.sim b/tests/script/general/parser/testSuite.sim index c2ce5df12e9e4d60824950f21ac8afb9d64b5235..f05474d15804fba661f650d69632c454415eba64 100644 --- a/tests/script/general/parser/testSuite.sim +++ b/tests/script/general/parser/testSuite.sim @@ -1,112 +1,58 @@ run general/parser/alter.sim -sleep 100 run general/parser/alter1.sim -sleep 100 run general/parser/alter_stable.sim -sleep 100 run general/parser/auto_create_tb.sim -sleep 100 run general/parser/auto_create_tb_drop_tb.sim -sleep 100 run general/parser/col_arithmetic_operation.sim -sleep 100 run general/parser/columnValue.sim -sleep 100 run general/parser/commit.sim -sleep 100 run general/parser/create_db.sim -sleep 100 run general/parser/create_mt.sim -sleep 100 run general/parser/create_tb.sim -sleep 100 run general/parser/dbtbnameValidate.sim -sleep 100 run general/parser/fill.sim -sleep 100 run general/parser/fill_stb.sim -sleep 100 #run general/parser/fill_us.sim # -sleep 100 run general/parser/first_last.sim -sleep 100 run general/parser/import_commit1.sim -sleep 100 run general/parser/import_commit2.sim -sleep 100 run general/parser/import_commit3.sim -sleep 100 #run general/parser/import_file.sim -sleep 100 run general/parser/insert_tb.sim -sleep 100 run general/parser/tags_dynamically_specifiy.sim -sleep 100 run general/parser/interp.sim -sleep 100 run general/parser/lastrow.sim -sleep 100 run general/parser/limit.sim -sleep 100 run general/parser/limit1.sim -sleep 100 run general/parser/limit1_tblocks100.sim -sleep 100 run general/parser/limit2.sim -sleep 100 run general/parser/mixed_blocks.sim -sleep 100 run general/parser/nchar.sim -sleep 100 run general/parser/null_char.sim -sleep 100 run general/parser/selectResNum.sim -sleep 100 run general/parser/select_across_vnodes.sim -sleep 100 run general/parser/select_from_cache_disk.sim -sleep 100 run general/parser/set_tag_vals.sim -sleep 100 run general/parser/single_row_in_tb.sim -sleep 100 run general/parser/slimit.sim -sleep 100 run general/parser/slimit1.sim -sleep 100 run general/parser/slimit_alter_tags.sim -sleep 100 run general/parser/tbnameIn.sim -sleep 100 run general/parser/slimit_alter_tags.sim # persistent failed -sleep 100 run general/parser/join.sim -sleep 100 run general/parser/join_multivnode.sim -sleep 100 +run general/parser/join_manyblocks.sim run general/parser/projection_limit_offset.sim -sleep 100 run general/parser/select_with_tags.sim -sleep 100 run general/parser/groupby.sim -sleep 100 run general/parser/tags_filter.sim -sleep 100 run general/parser/topbot.sim -sleep 100 run general/parser/union.sim -sleep 100 run general/parser/constCol.sim -sleep 100 run general/parser/where.sim -sleep 100 run general/parser/timestamp.sim -sleep 100 run general/parser/sliding.sim -sleep 100 run general/parser/function.sim -sleep 100 run general/parser/stableOp.sim -sleep 100 run general/parser/slimit_alter_tags.sim diff --git a/tests/script/general/parser/where.sim b/tests/script/general/parser/where.sim index ace1ca6f5bf1f62ecc78c676da4a9b4624f12a5c..157c41ce58ddf4775c0715f35ccd77e46a7dd221 100644 --- a/tests/script/general/parser/where.sim +++ b/tests/script/general/parser/where.sim @@ -350,5 +350,13 @@ if $rows != 0 then return -1 endi +print ==========================>td-3318 +sql create table tu(ts timestamp, k int, b binary(12)) +sql insert into tu values(now, 1, 'abc') +sql select stddev(k) from tu where b <>'abc' interval(1s) +if $rows != 0 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/jenkins/basic.txt b/tests/script/jenkins/basic.txt index fc56e34dca875e61cd3fc611a6757ea76e9901c9..f6e2267f6d923bdb99ee337a887adf7e91d242ea 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -162,6 +162,10 @@ cd ../../../debug; make ./test.sh -f general/parser/topbot.sim ./test.sh -f general/parser/function.sim ./test.sh -f general/parser/select_distinct_tag.sim +./test.sh -f general/parser/join_manyblocks.sim +./test.sh -f general/parser/stableOp.sim +./test.sh -f general/parser/timestamp.sim +./test.sh -f general/parser/sliding.sim ./test.sh -f general/stable/disk.sim ./test.sh -f general/stable/dnode3.sim