From c7e64933d0832a346d4475fb7652301563373475 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 14 Jul 2022 10:43:54 +0800 Subject: [PATCH] fix: use calcTypeBytes for table altering --- source/libs/parser/src/parTranslater.c | 3 ++- tests/script/tsim/alter/table.sim | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index d12f1cfe7c..837d0f5773 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -5939,7 +5939,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; } diff --git a/tests/script/tsim/alter/table.sim b/tests/script/tsim/alter/table.sim index cc995d171f..348bef21fe 100644 --- a/tests/script/tsim/alter/table.sim +++ b/tests/script/tsim/alter/table.sim @@ -660,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