diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 60fc6c2ef4c784735118cc43b81e17f2d43ccddc..bd657c9c3c0d327f40f98e60d03aa641daf7b513 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6074,7 +6074,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { } if(pItem->pVar.nType != TSDB_DATA_TYPE_BINARY){ tscError("json type error, should be string"); - return invalidOperationMsg(pMsg, "json type error, should be string"); + return invalidOperationMsg(pMsg, msg25); } code = parseJsontoTagData(pItem->pVar.pz, &kvRowBuilder, pMsg, pTagsSchema->colId); if (code != TSDB_CODE_SUCCESS) { @@ -7698,7 +7698,7 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) { tVariantListItem* pItem = taosArrayGet(pValList, 0); if(pItem->pVar.nType != TSDB_DATA_TYPE_BINARY){ tscError("json type error, should be string"); - return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "json type error, should be string"); + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); } ret = parseJsontoTagData(pItem->pVar.pz, &kvRowBuilder, tscGetErrorMsgPayload(pCmd), pTagSchema[0].colId); if (ret != TSDB_CODE_SUCCESS) { diff --git a/tests/pytest/stable/json_tag.py b/tests/pytest/stable/json_tag.py index edd6649f29817e7c7461412880198839fd9562c8..072d05b720d01d01a1af0c785e7d042728ca3e06 100644 --- a/tests/pytest/stable/json_tag.py +++ b/tests/pytest/stable/json_tag.py @@ -34,8 +34,12 @@ class TDTestCase: "create table if not exists db_json_tag_test.jsons1(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json)") tdSql.execute( "CREATE TABLE if not exists db_json_tag_test.jsons1_1 using db_json_tag_test.jsons1 tags('{\"loc\":\"fff\",\"id\":5}')") + tdSql.execute( + "CREATE TABLE if not exists db_json_tag_test.jsons1_3 using db_json_tag_test.jsons1 tags(3333)") tdSql.execute( "insert into jsons1_2 using db_json_tag_test.jsons1 tags('{\"num\":5,\"location\":\"beijing\"}' values (now, 1, 'sss')") + tdSql.execute( + "insert into jsons1_4 using db_json_tag_test.jsons1 tags(3)") print("==============step2") tdLog.info("select table")