From 7ea860ad1111fdc1db9849444f1ab4a7d24e0337 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 21 Apr 2023 17:14:41 +0800 Subject: [PATCH] fix:[TD-23714] topic support capital --- source/client/src/clientTmq.c | 3 --- tests/system-test/7-tmq/stbTagFilter-1ctb.py | 4 ++-- tests/system-test/7-tmq/stbTagFilter-multiCtb.py | 4 ++-- tests/system-test/7-tmq/tmqDropStb.py | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index ceca06e309..fd6dc918a9 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -373,9 +373,6 @@ int32_t tmq_list_append(tmq_list_t* list, const char* src) { SArray* container = &list->container; if (src == NULL || src[0] == 0) return -1; char* topic = taosStrdup(src); - if (topic[0] != '`') { - strtolower(topic, src); - } if (taosArrayPush(container, &topic) == NULL) return -1; return 0; } diff --git a/tests/system-test/7-tmq/stbTagFilter-1ctb.py b/tests/system-test/7-tmq/stbTagFilter-1ctb.py index 7ee5fce5a8..d226b18d17 100644 --- a/tests/system-test/7-tmq/stbTagFilter-1ctb.py +++ b/tests/system-test/7-tmq/stbTagFilter-1ctb.py @@ -111,7 +111,7 @@ class TDTestCase: topicFromStb1 = 'topic_UpperCase_stb1' # queryString = "select ts, c1, c2 from %s.%s where t4 == 'shanghai' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName']) queryString = "select ts, c1, c2, t4 from %s.%s where t4 == 'shanghai' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName']) - sqlString = "create topic %s as %s" %(topicFromStb1, queryString) + sqlString = "create topic `%s` as %s" %(topicFromStb1, queryString) tdLog.info("create topic sql: %s"%sqlString) tdSql.execute(sqlString) @@ -196,7 +196,7 @@ class TDTestCase: topicFromStb1 = 'topic_UpperCase_stb1' queryString = "select ts, c1, c2 from %s.%s where t4 == 'shanghai' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName']) # queryString = "select ts, c1, c2, t4 from %s.%s where t4 == 'shanghai' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName']) - sqlString = "create topic %s as %s" %(topicFromStb1, queryString) + sqlString = "create topic `%s` as %s" %(topicFromStb1, queryString) tdLog.info("create topic sql: %s"%sqlString) tdSql.execute(sqlString) diff --git a/tests/system-test/7-tmq/stbTagFilter-multiCtb.py b/tests/system-test/7-tmq/stbTagFilter-multiCtb.py index 71b7fdef5d..5ae821ad72 100644 --- a/tests/system-test/7-tmq/stbTagFilter-multiCtb.py +++ b/tests/system-test/7-tmq/stbTagFilter-multiCtb.py @@ -111,7 +111,7 @@ class TDTestCase: topicFromStb1 = 'topic_UpperCase_stb1' queryString = "select ts, c1, c2 from %s.%s where t4 == 'beijing' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName']) # queryString = "select ts, c1, c2, t4 from %s.%s where t4 == 'beijing' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName']) - sqlString = "create topic %s as %s" %(topicFromStb1, queryString) + sqlString = "create topic `%s` as %s" %(topicFromStb1, queryString) tdLog.info("create topic sql: %s"%sqlString) tdSql.execute(sqlString) @@ -196,7 +196,7 @@ class TDTestCase: topicFromStb1 = 'topic_UpperCase_stb1' # queryString = "select ts, c1, c2 from %s.%s where t4 == 'beijing' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName']) queryString = "select ts, c1, c2, t4 from %s.%s where t4 == 'beijing' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName']) - sqlString = "create topic %s as %s" %(topicFromStb1, queryString) + sqlString = "create topic `%s` as %s" %(topicFromStb1, queryString) tdLog.info("create topic sql: %s"%sqlString) tdSql.execute(sqlString) diff --git a/tests/system-test/7-tmq/tmqDropStb.py b/tests/system-test/7-tmq/tmqDropStb.py index a94747e574..8680bdf09e 100644 --- a/tests/system-test/7-tmq/tmqDropStb.py +++ b/tests/system-test/7-tmq/tmqDropStb.py @@ -82,7 +82,7 @@ class TDTestCase: tdLog.info("create topics from db") topicName1 = 'UpperCasetopic_%s'%(self.paraDict['dbName']) - tdSql.execute("create topic %s as database %s" %(topicName1, self.paraDict['dbName'])) + tdSql.execute("create topic `%s` as database %s" %(topicName1, self.paraDict['dbName'])) topicList = topicName1 + ',' +topicName1 keyList = '%s,%s,%s,%s'%(self.groupId,self.autoCommit,self.autoCommitInterval,self.autoOffset) -- GitLab