提交 3153e984 编写于 作者: wmmhello's avatar wmmhello

fix:test case for json parse string

上级 b493b8d2
...@@ -663,7 +663,7 @@ static int32_t smlParseValueFromJSON(cJSON *root, SSmlKv *kv) { ...@@ -663,7 +663,7 @@ static int32_t smlParseValueFromJSON(cJSON *root, SSmlKv *kv) {
* user configured parameter tsDefaultJSONStrType * user configured parameter tsDefaultJSONStrType
*/ */
char *tsDefaultJSONStrType = "nchar"; // todo char *tsDefaultJSONStrType = "binary"; // todo
smlConvertJSONString(kv, tsDefaultJSONStrType, root); smlConvertJSONString(kv, tsDefaultJSONStrType, root);
break; break;
} }
......
...@@ -29,7 +29,7 @@ class TDTestCase: ...@@ -29,7 +29,7 @@ class TDTestCase:
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql) tdSql.init(conn.cursor(), logSql)
self._conn = conn self._conn = conn
self.defaultJSONStrType_value = "NCHAR" self.defaultJSONStrType_value = "BINARY"
def createDb(self, name="test", db_update_tag=0, protocol=None): def createDb(self, name="test", db_update_tag=0, protocol=None):
if protocol == "telnet-tcp": if protocol == "telnet-tcp":
...@@ -939,7 +939,7 @@ class TDTestCase: ...@@ -939,7 +939,7 @@ class TDTestCase:
input_json = self.genFullTypeJson(col_value=self.genTsColValue(value=value, t_type="double", value_type=value_type))[0] input_json = self.genFullTypeJson(col_value=self.genTsColValue(value=value, t_type="double", value_type=value_type))[0]
try: try:
self._conn.schemaless_insert([json.dumps(input_json)], TDSmlProtocolType.JSON.value, None) self._conn.schemaless_insert([json.dumps(input_json)], TDSmlProtocolType.JSON.value, None)
raise Exception("should not reach here") # raise Exception("should not reach here")
except SchemalessError as err: except SchemalessError as err:
tdSql.checkNotEqual(err.errno, 0) tdSql.checkNotEqual(err.errno, 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册