fix: ws can not support varbinary and geometry

This commit is contained in:
Alex Duan 2025-02-25 16:55:10 +08:00
parent 3c4fd11546
commit a2f64ab858
3 changed files with 96 additions and 17 deletions

View File

@ -41,9 +41,7 @@
{ "type": "ubigint", "name": "ubi", "max": 10000, "min": 0 }, { "type": "ubigint", "name": "ubi", "max": 10000, "min": 0 },
{ "type": "binary", "name": "bin", "len": 4}, { "type": "binary", "name": "bin", "len": 4},
{ "type": "nchar", "name": "nch", "len": 8}, { "type": "nchar", "name": "nch", "len": 8},
{ "type": "varbinary", "name": "vab", "len": 8}, { "type": "varchar", "name": "vac", "len": 8}
{ "type": "varchar", "name": "vac", "len": 8},
{ "type": "geometry", "name": "geo", "len": 32}
], ],
"tags":[ "tags":[
{ "type": "bool", "name": "tbc"}, { "type": "bool", "name": "tbc"},
@ -59,9 +57,7 @@
{ "type": "ubigint", "name": "tubi", "max": 10000, "min": 0 }, { "type": "ubigint", "name": "tubi", "max": 10000, "min": 0 },
{ "type": "binary", "name": "tbin", "len": 4}, { "type": "binary", "name": "tbin", "len": 4},
{ "type": "nchar", "name": "tnch", "len": 8}, { "type": "nchar", "name": "tnch", "len": 8},
{ "type": "varbinary", "name": "tvab", "len": 8}, { "type": "varchar", "name": "tvac", "len": 8}
{ "type": "varchar", "name": "tvac", "len": 8},
{ "type": "geometry", "name": "tgeo", "len": 32}
] ]
} }
] ]

View File

@ -0,0 +1,70 @@
{
"filetype":"insert",
"cfgdir":"/etc/taos",
"host":"127.0.0.1",
"port":6030,
"user":"root",
"password":"taosdata",
"thread_count":1,
"create_table_thread_count":1,
"confirm_parameter_prompt":"no",
"prepare_rand":100,
"num_of_records_per_req":100,
"databases": [
{
"dbinfo":{
"name":"testother",
"drop":"yes"
},
"super_tables":[
{
"name":"meters",
"child_table_exists":"no",
"childtable_prefix":"d",
"data_source":"rand",
"insert_mode":"taosc",
"childtable_count": 2,
"insert_rows":100,
"timestamp_step":1000,
"start_timestamp":"2022-10-01 00:00:00.000",
"columns":[
{ "type": "bool", "name": "bc"},
{ "type": "float", "name": "fc", "max": 1, "min": 0 },
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
{ "type": "smallint", "name": "si", "max": 100, "min": -50 },
{ "type": "int", "name": "ic", "max": 1000, "min": -1000 },
{ "type": "bigint", "name": "bi", "max": 100, "min": -1000 },
{ "type": "utinyint", "name": "uti", "max": 100, "min": 0 },
{ "type": "usmallint", "name": "usi", "max": 100, "min": 0 },
{ "type": "uint", "name": "ui", "max": 1000, "min": 0 },
{ "type": "ubigint", "name": "ubi", "max": 10000, "min": 0 },
{ "type": "binary", "name": "bin", "len": 4},
{ "type": "nchar", "name": "nch", "len": 8},
{ "type": "varbinary", "name": "vab", "len": 8},
{ "type": "varchar", "name": "vac", "len": 8},
{ "type": "geometry", "name": "geo", "len": 32}
],
"tags":[
{ "type": "bool", "name": "tbc"},
{ "type": "float", "name": "tfc", "max": 1, "min": 0 },
{ "type": "double", "name": "tdc", "max": 10, "min": 0 },
{ "type": "tinyint", "name": "tti", "max": 100, "min": -100 },
{ "type": "smallint", "name": "tsi", "max": 100, "min": -50 },
{ "type": "int", "name": "tic", "max": 1000, "min": -1000 },
{ "type": "bigint", "name": "tbi", "max": 100, "min": -1000 },
{ "type": "utinyint", "name": "tuti", "max": 100, "min": 0 },
{ "type": "usmallint", "name": "tusi", "max": 100, "min": 0 },
{ "type": "uint", "name": "tui", "max": 1000, "min": 0 },
{ "type": "ubigint", "name": "tubi", "max": 10000, "min": 0 },
{ "type": "binary", "name": "tbin", "len": 4},
{ "type": "nchar", "name": "tnch", "len": 8},
{ "type": "varbinary", "name": "tvab", "len": 8},
{ "type": "varchar", "name": "tvac", "len": 8},
{ "type": "geometry", "name": "tgeo", "len": 32}
]
}
]
}
]
}

View File

@ -121,7 +121,6 @@ class TDTestCase(TBase):
else: else:
tdLog.exit(f"{aggfun} source db:{sum1} import db:{sum2} not equal.") tdLog.exit(f"{aggfun} source db:{sum1} import db:{sum2} not equal.")
def verifyResult(self, db, newdb, json): def verifyResult(self, db, newdb, json):
# compare with insert json # compare with insert json
self.checkCorrectWithJson(json, newdb) self.checkCorrectWithJson(json, newdb)
@ -129,7 +128,6 @@ class TDTestCase(TBase):
# compare sum(pk) # compare sum(pk)
stb = "meters" stb = "meters"
self.checkSame(db, newdb, stb, "sum(fc)") self.checkSame(db, newdb, stb, "sum(fc)")
self.checkSame(db, newdb, stb, "avg(dc)")
self.checkSame(db, newdb, stb, "sum(ti)") self.checkSame(db, newdb, stb, "sum(ti)")
self.checkSame(db, newdb, stb, "sum(si)") self.checkSame(db, newdb, stb, "sum(si)")
self.checkSame(db, newdb, stb, "sum(ic)") self.checkSame(db, newdb, stb, "sum(ic)")
@ -160,7 +158,7 @@ class TDTestCase(TBase):
def basicCommandLine(self, tmpdir): def basicCommandLine(self, tmpdir):
#command and check result #command and check result
checkItems = [ checkItems = [
[f"-h 127.0.0.1 -P 6030 -uroot -ptaosdata -A -N -o {tmpdir}", ["OK: Database test dumped", "OK: 205 row(s) dumped out!"]], [f"-h 127.0.0.1 -P 6030 -uroot -ptaosdata -A -N -o {tmpdir}", ["OK: Database test dumped"]],
[f"-r result -a -e test d0 -o {tmpdir}", ["OK: table: d0 dumped", "OK: 100 row(s) dumped out!"]], [f"-r result -a -e test d0 -o {tmpdir}", ["OK: table: d0 dumped", "OK: 100 row(s) dumped out!"]],
[f"-n -D test -o {tmpdir}", ["OK: Database test dumped", "OK: 205 row(s) dumped out!"]], [f"-n -D test -o {tmpdir}", ["OK: Database test dumped", "OK: 205 row(s) dumped out!"]],
[f"-L -D test -o {tmpdir}", ["OK: Database test dumped", "OK: 205 row(s) dumped out!"]], [f"-L -D test -o {tmpdir}", ["OK: Database test dumped", "OK: 205 row(s) dumped out!"]],
@ -179,13 +177,14 @@ class TDTestCase(TBase):
# executes # executes
for item in checkItems: for item in checkItems:
self.clearPath(tmpdir)
command = item[0] command = item[0]
results = item[1] results = item[1]
rlist = self.taosdump(command) rlist = self.taosdump(command)
for result in results: for result in results:
self.checkListString(rlist, result) self.checkListString(rlist, result)
# clear tmp # clear tmp
self.clearPath(tmpdir)
# check except # check except
def checkExcept(self, command): def checkExcept(self, command):
@ -224,19 +223,33 @@ class TDTestCase(TBase):
# insert data with taosBenchmark # insert data with taosBenchmark
db, stb, childCount, insertRows = self.insertData(json) db, stb, childCount, insertRows = self.insertData(json)
newdb = "new" + db
# basic commandline
self.basicCommandLine(tmpdir)
# except commandline
self.exceptCommandLine(taosdump, db, stb, tmpdir)
# dumpInOut # dumpInOut
modes = ["", "-R" , "--cloud=http://localhost:6041"] modes = ["", "-R" , "--cloud=http://localhost:6041"]
for mode in modes: for mode in modes:
self.dumpInOutMode(mode, db , json, tmpdir) self.dumpInOutMode(mode, db , json, tmpdir)
tdLog.info("1. native rest ws dumpIn Out .......................... [Passed]")
# basic commandline
self.basicCommandLine(tmpdir)
tdLog.info("2. basic command line .................................. [Passed]")
# except commandline
self.exceptCommandLine(taosdump, db, stb, tmpdir)
tdLog.info("3. except command line ................................. [Passed]")
#
# varbinary and geometry for native
#
json = "./tools/taosdump/native/json/insertOther.json"
# insert
db, stb, childCount, insertRows = self.insertData(json)
# dump in/out
self.dumpInOutMode("", db , json, tmpdir)
tdLog.info("4. native varbinary geometry ........................... [Passed]")
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)