Skip to content

Commit

Permalink
Merge pull request #16243 from taosdata/cases/TS-1788-V26
Browse files Browse the repository at this point in the history
fix(subscribe): TS-1788-V26 remove strtolower for sql
  • Loading branch information
DuanKuanJun authored Aug 19, 2022
2 parents d9c580a + c41546d commit 7a896f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/client/src/tscSub.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ static SSub* tscCreateSubscription(STscObj* pObj, const char* topic, const char*
goto fail;
}

strtolower(pSql->sqlstr, pSql->sqlstr);
pRes->qId = 0;
pRes->numOfRows = 1;
pCmd->resColumnId = TSDB_RES_COL_ID;
Expand Down
16 changes: 16 additions & 0 deletions tests/pytest/subscribe/singlemeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,24 @@ def run(self):
tdSub.consume()
tdSub.checkRows(11)


# TS-1788: Subscribe a case sensitive table
tdLog.info("create a table and insert 10 rows.")
tdSql.execute("create table `T1`(ts timestamp, a int, b int);")
for i in range(0, 10):
tdSql.execute("insert into `T1` values (%d, %d, %d);" % (now + i, i, i))

sqlstr = "select * from `T1`"
topic = "topic1"
now = int(time.time() * 1000)

tdSub.init(self.conn.subscribe(True, topic, sqlstr, 0))
tdSub.consume()
tdSub.checkRows(10)

tdSub.close(True)


def stop(self):
tdSub.close(False)
tdSql.close()
Expand Down

0 comments on commit 7a896f2

Please sign in to comment.