diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 74869eb889f96d3aafefcf01077797521cad7a42..288d73a929a41b0a78dedd5906af72ac142e0de1 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7706,9 +7706,11 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3); } } - - ret = tVariantDump(&(pItem->pVar), tagVal, pSchema->type, true); - + if(IS_JSON_DATA_TYPE(pSchema->type)){ + *((int8_t *)tagVal) = TSDB_DATA_BINARY_PLACEHOLDER; + }else { + ret = tVariantDump(&(pItem->pVar), tagVal, pSchema->type, true); + } // check again after the convert since it may be converted from binary to nchar. if (pSchema->type == TSDB_DATA_TYPE_BINARY || pSchema->type == TSDB_DATA_TYPE_NCHAR) { int16_t len = varDataTLen(tagVal); @@ -7766,9 +7768,11 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3); } } - - ret = tVariantDump(&(pItem->pVar), tagVal, pSchema->type, true); - + if(IS_JSON_DATA_TYPE(pSchema->type)){ + *((int8_t *)tagVal) = TSDB_DATA_BINARY_PLACEHOLDER; + }else { + ret = tVariantDump(&(pItem->pVar), tagVal, pSchema->type, true); + } // check again after the convert since it may be converted from binary to nchar. if (pSchema->type == TSDB_DATA_TYPE_BINARY || pSchema->type == TSDB_DATA_TYPE_NCHAR) { int16_t len = varDataTLen(tagVal);