From 28d76eda8db0a0869d3fce4dedf707e49ae95c0e Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Fri, 19 Feb 2021 09:39:53 +0800 Subject: [PATCH] fix bug and add case --- src/client/src/tscSQLParser.c | 4 ++++ .../parser/create_tb_with_tag_name.sim | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index f470b27e7c..73fb6fb64c 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6415,6 +6415,10 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) { for (int32_t i = 0; i < nameSize; ++i) { SStrToken* sToken = taosArrayGet(pNameList, i); + if (TK_STRING == sToken->type) { + tscDequoteAndTrimToken(sToken); + } + tVariantListItem* pItem = taosArrayGet(pValList, i); findColumnIndex = false; diff --git a/tests/script/general/parser/create_tb_with_tag_name.sim b/tests/script/general/parser/create_tb_with_tag_name.sim index dd09fce777..bbd5fc11e1 100644 --- a/tests/script/general/parser/create_tb_with_tag_name.sim +++ b/tests/script/general/parser/create_tb_with_tag_name.sim @@ -138,5 +138,25 @@ if $data03 != NULL then return -1 endi +sql create table tb13 using st2 ("t1",'id') tags (2,1); + +sql select id,t1,t2,t3 from tb13; + +if $rows != 1 then + return -1 +endi + +if $data00 != 1 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +if $data02 != NULL then + return -1 +endi +if $data03 != NULL then + return -1 +endi system sh/exec.sh -n dnode1 -s stop -x SIGINT -- GitLab