From e377d4e94fdc456a5d05d7d06fe606c3a7fe692a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 17 May 2022 20:50:34 +0800 Subject: [PATCH] fix: should not memset after realloc --- source/common/src/tdatablock.c | 1 - tests/script/tsim/insert/basic0.sim | 37 ++++++++++++++--------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index dc4e6f7452..43dcf2dfa9 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1135,7 +1135,6 @@ int32_t colInfoDataEnsureCapacity(SColumnInfoData* pColumn, size_t existRows, ui assert(pColumn->info.bytes); tmp = taosMemoryRealloc(pColumn->pData, numOfRows * pColumn->info.bytes); - memset(tmp, 0, numOfRows * pColumn->info.bytes); if (tmp == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/tests/script/tsim/insert/basic0.sim b/tests/script/tsim/insert/basic0.sim index 4ead52c79d..722bc0f907 100644 --- a/tests/script/tsim/insert/basic0.sim +++ b/tests/script/tsim/insert/basic0.sim @@ -253,16 +253,15 @@ endi # The order of data from different sub tables in the super table is random, # so this detection may fail randomly -print $data01 $data02 $data03 -# if $data01 != 10 then -# return -1 -# endi -# if $data02 != 2.00000 then -# return -1 -# endi -# if $data03 != 3.000000000 then -# return -1 -# endi +if $data01 != 10 then + return -1 +endi +if $data02 != 2.00000 then + return -1 +endi +if $data03 != 3.000000000 then + return -1 +endi #print =============== select count(column) from supter table #sql select count(ts), count(c1), count(c2), count(c3) from stb @@ -511,15 +510,15 @@ if $rows != 9 then endi # The order of data from different sub tables in the super table is random, # so this detection may fail randomly -#if $data01 != 10 then -# return -1 -#endi -#if $data02 != 2.00000 then -# return -1 -#endi -#if $data03 != 3.000000000 then -# return -1 -#endi +if $data01 != 10 then + return -1 +endi +if $data02 != 2.00000 then + return -1 +endi +if $data03 != 3.000000000 then + return -1 +endi #print =============== select count(column) from supter table #sql select count(ts), count(c1), count(c2), count(c3) from stb -- GitLab