From de31de5d11940a3b9cae0e9b96607bda67177241 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Fri, 25 Oct 2024 09:59:30 +0800 Subject: [PATCH] fix: parse blank count error --- tools/shell/src/shellAuto.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index a12efb7e96..05a996dafc 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -1731,13 +1731,19 @@ bool fieldOptionsArea(char* p) { int32_t cnt = 0; while(p2) { p2 = strchr(p2, ' '); - if(p2) { - cnt ++; + if (p2) { + if ((p2 - 1)[0] != ',') { + // blank if before comma, not calc count. like st(ts timestamp, age int + BLANK + TAB only two blank + cnt ++; + } + + // continue blank is one blank while (p2[1] != 0 && p2[1] == ' ') { // move next if blank again p2 += 1; } - } + p2 += 1; + } } // like create table st(ts timestamp TAB-KEY or st(ts timestamp , age int TAB-KEY