Merge pull request #25031 from taosdata/fix/TS-4544
fix:[TS-4544]do not get vgroup if subscribe query
This commit is contained in:
commit
ae6b16d809
|
@ -4547,7 +4547,7 @@ static int32_t translateWhere(STranslateContext* pCxt, SSelectStmt* pSelect) {
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = getQueryTimeRange(pCxt, pSelect->pWhere, &pSelect->timeRange);
|
code = getQueryTimeRange(pCxt, pSelect->pWhere, &pSelect->timeRange);
|
||||||
}
|
}
|
||||||
if (pSelect->pWhere != NULL) {
|
if (pSelect->pWhere != NULL && pCxt->pParseCxt->topicQuery == false) {
|
||||||
setTableVgroupsFromEqualTbnameCond(pCxt, pSelect);
|
setTableVgroupsFromEqualTbnameCond(pCxt, pSelect);
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -359,8 +359,34 @@ class TDTestCase:
|
||||||
finally:
|
finally:
|
||||||
consumer.close()
|
consumer.close()
|
||||||
|
|
||||||
|
def consume_ts_4544(self):
|
||||||
|
tdSql.execute(f'create database if not exists d1')
|
||||||
|
tdSql.execute(f'use d1')
|
||||||
|
tdSql.execute(f'create table stt(ts timestamp, i int) tags(t int)')
|
||||||
|
tdSql.execute(f'insert into tt1 using stt tags(1) values(now, 1) (now+1s, 2)')
|
||||||
|
tdSql.execute(f'insert into tt2 using stt tags(2) values(now, 1) (now+1s, 2)')
|
||||||
|
tdSql.execute(f'insert into tt3 using stt tags(3) values(now, 1) (now+1s, 2)')
|
||||||
|
tdSql.execute(f'insert into tt1 using stt tags(1) values(now+5s, 11) (now+10s, 12)')
|
||||||
|
|
||||||
|
tdSql.execute(f'create topic topic_in as select * from stt where tbname in ("tt2")')
|
||||||
|
consumer_dict = {
|
||||||
|
"group.id": "g1",
|
||||||
|
"td.connect.user": "root",
|
||||||
|
"td.connect.pass": "taosdata",
|
||||||
|
"auto.offset.reset": "earliest",
|
||||||
|
}
|
||||||
|
consumer = Consumer(consumer_dict)
|
||||||
|
|
||||||
|
try:
|
||||||
|
consumer.subscribe(["topic_in"])
|
||||||
|
except TmqError:
|
||||||
|
tdLog.exit(f"subscribe error")
|
||||||
|
|
||||||
|
consumer.close()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.consumeTest()
|
self.consumeTest()
|
||||||
|
self.consume_ts_4544()
|
||||||
|
|
||||||
tdSql.prepare()
|
tdSql.prepare()
|
||||||
self.checkWal1VgroupOnlyMeta()
|
self.checkWal1VgroupOnlyMeta()
|
||||||
|
|
Loading…
Reference in New Issue