From 1f1d4946570d67cfa0b52c37b9f3c6b2576e907e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 30 Mar 2021 18:08:00 +0800 Subject: [PATCH] [td-2819] refactor codes. --- src/client/src/tscSubquery.c | 4 +- src/client/src/tscUtil.c | 2 +- tests/script/general/parser/testSuite.sim | 90 +++++++++++------------ 3 files changed, 49 insertions(+), 47 deletions(-) diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 26820b9154..1c5c36806a 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -723,7 +723,9 @@ static void issueTsCompQuery(SSqlObj* pSql, SJoinSupporter* pSupporter, SSqlObj* if (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) { SExprInfo *pExpr = tscSqlExprGet(pQueryInfo, 0); int16_t tagColId = tscGetJoinTagColIdByUid(&pSupporter->tagCond, pTableMetaInfo->pTableMeta->id.uid); - pExpr->base.param->i64 = tagColId; + pExpr->base.param[0].i64 = tagColId; + pExpr->base.param[0].nLen = sizeof(int64_t); + pExpr->base.param[0].nType = TSDB_DATA_TYPE_BIGINT; pExpr->base.numOfParams = 1; } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index ff34b23f20..02b82cfe01 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -460,7 +460,7 @@ void tscSetResRawPtr(SSqlRes* pRes, SQueryInfo* pQueryInfo) { int32_t offset = 0; - for (int32_t i = 0; i < pRes->numOfCols; ++i) { + for (int32_t i = 0; i < pQueryInfo->fieldsInfo.numOfOutput; ++i) { SInternalField* pInfo = (SInternalField*)TARRAY_GET_ELEM(pQueryInfo->fieldsInfo.internalField, i); pRes->urow[i] = pRes->data + offset * pRes->numOfRows; diff --git a/tests/script/general/parser/testSuite.sim b/tests/script/general/parser/testSuite.sim index 1a3bb3a2ec..f05474d158 100644 --- a/tests/script/general/parser/testSuite.sim +++ b/tests/script/general/parser/testSuite.sim @@ -1,50 +1,50 @@ -#run general/parser/alter.sim -#run general/parser/alter1.sim -#run general/parser/alter_stable.sim -#run general/parser/auto_create_tb.sim -#run general/parser/auto_create_tb_drop_tb.sim -#run general/parser/col_arithmetic_operation.sim -#run general/parser/columnValue.sim -#run general/parser/commit.sim -#run general/parser/create_db.sim -#run general/parser/create_mt.sim -#run general/parser/create_tb.sim -#run general/parser/dbtbnameValidate.sim -#run general/parser/fill.sim -#run general/parser/fill_stb.sim -##run general/parser/fill_us.sim # -#run general/parser/first_last.sim -#run general/parser/import_commit1.sim -#run general/parser/import_commit2.sim -#run general/parser/import_commit3.sim -##run general/parser/import_file.sim -#run general/parser/insert_tb.sim -#run general/parser/tags_dynamically_specifiy.sim -#run general/parser/interp.sim -#run general/parser/lastrow.sim -#run general/parser/limit.sim -#run general/parser/limit1.sim -#run general/parser/limit1_tblocks100.sim -#run general/parser/limit2.sim -#run general/parser/mixed_blocks.sim -#run general/parser/nchar.sim -#run general/parser/null_char.sim -#run general/parser/selectResNum.sim -#run general/parser/select_across_vnodes.sim -#run general/parser/select_from_cache_disk.sim -#run general/parser/set_tag_vals.sim -#run general/parser/single_row_in_tb.sim -#run general/parser/slimit.sim -#run general/parser/slimit1.sim -#run general/parser/slimit_alter_tags.sim -#run general/parser/tbnameIn.sim -#run general/parser/slimit_alter_tags.sim # persistent failed -#run general/parser/join.sim -#run general/parser/join_multivnode.sim -#run general/parser/join_manyblocks.sim +run general/parser/alter.sim +run general/parser/alter1.sim +run general/parser/alter_stable.sim +run general/parser/auto_create_tb.sim +run general/parser/auto_create_tb_drop_tb.sim +run general/parser/col_arithmetic_operation.sim +run general/parser/columnValue.sim +run general/parser/commit.sim +run general/parser/create_db.sim +run general/parser/create_mt.sim +run general/parser/create_tb.sim +run general/parser/dbtbnameValidate.sim +run general/parser/fill.sim +run general/parser/fill_stb.sim +#run general/parser/fill_us.sim # +run general/parser/first_last.sim +run general/parser/import_commit1.sim +run general/parser/import_commit2.sim +run general/parser/import_commit3.sim +#run general/parser/import_file.sim +run general/parser/insert_tb.sim +run general/parser/tags_dynamically_specifiy.sim +run general/parser/interp.sim +run general/parser/lastrow.sim +run general/parser/limit.sim +run general/parser/limit1.sim +run general/parser/limit1_tblocks100.sim +run general/parser/limit2.sim +run general/parser/mixed_blocks.sim +run general/parser/nchar.sim +run general/parser/null_char.sim +run general/parser/selectResNum.sim +run general/parser/select_across_vnodes.sim +run general/parser/select_from_cache_disk.sim +run general/parser/set_tag_vals.sim +run general/parser/single_row_in_tb.sim +run general/parser/slimit.sim +run general/parser/slimit1.sim +run general/parser/slimit_alter_tags.sim +run general/parser/tbnameIn.sim +run general/parser/slimit_alter_tags.sim # persistent failed +run general/parser/join.sim +run general/parser/join_multivnode.sim +run general/parser/join_manyblocks.sim run general/parser/projection_limit_offset.sim run general/parser/select_with_tags.sim -#run general/parser/groupby.sim +run general/parser/groupby.sim run general/parser/tags_filter.sim run general/parser/topbot.sim run general/parser/union.sim -- GitLab