diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index f470b27e7cd11892e046539645cf57b20dcab3ef..73fb6fb64c44b0d0be890787fdb0197c3648cbd3 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 dd09fce777063bccd36b751facfa69058c17b037..bbd5fc11e1eb662053860bca4f0d4210c1d1fbbc 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