Merge pull request #25127 from taosdata/td28365

add test case for jira td28365 by charles
This commit is contained in:
Alex Duan 2024-03-20 11:10:23 +08:00 committed by GitHub
commit 3cbd30b98d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View File

@ -591,6 +591,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4348-td-27939.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/backslash_g.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/test_ts4467.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/geometry.py
,,n,system-test,python3 ./test.py -f 2-query/queryQnode.py
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode1mnode.py

View File

@ -171,6 +171,25 @@ class TDTestCase:
for i in range(tdSql.queryRows):
tdSql.checkData(i, 0, expectedResults[5][i+1])
def test_td28365(self):
# verify TD-28365
tdSql.execute("create database db2;")
tdSql.execute("use db2;")
tdSql.execute("create table st (ts timestamp, c1 int) tags(id int, location geometry(512));")
tdSql.execute("create table ct1 using st tags(1, 'POINT (3.000000 6.000000)')")
tdSql.execute("insert into ct1 values(now, 1)")
tdSql.execute("create table ct2 using st tags(2, 'LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)')")
tdSql.execute("insert into ct2 values(now, 2)")
tdSql.execute("create table ct3 using st tags(3, 'POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))')")
tdSql.execute("insert into ct3 values(now, 3)")
tdSql.query("select ST_AsText(location) from st order by location;")
tdSql.checkEqual(tdSql.queryRows, 3)
tdLog.debug(tdSql.queryResult)
# check geometry data
tdSql.checkEqual(tdSql.queryResult[0][0], "POINT (3.000000 6.000000)")
tdSql.checkEqual(tdSql.queryResult[1][0], "LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)")
tdSql.checkEqual(tdSql.queryResult[2][0], "POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))")
def run(self):
tdSql.prepare()
@ -248,6 +267,7 @@ class TDTestCase:
[1, self.point] # in where clause
]
self.geomRelationFunc_test('ST_ContainsProperly', expectedResults)
self.test_td28365()
def stop(self):
tdSql.close()