diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 20b8bf5c46..1a9700907e 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -38,10 +38,10 @@ typedef struct SRawExprNode { } SRawExprNode; typedef struct SDataType { - uint16_t type; - uint8_t precision; - uint8_t scale; - int32_t bytes; + uint8_t type; + uint8_t precision; + uint8_t scale; + int32_t bytes; } SDataType; typedef struct SExprNode { diff --git a/include/util/tjson.h b/include/util/tjson.h index 24bdc31bad..6922930c13 100644 --- a/include/util/tjson.h +++ b/include/util/tjson.h @@ -76,7 +76,6 @@ int32_t tjsonGetSmallIntValue(const SJson* pJson, const char* pName, int16_t* pV int32_t tjsonGetTinyIntValue(const SJson* pJson, const char* pName, int8_t* pVal); int32_t tjsonGetUBigIntValue(const SJson* pJson, const char* pName, uint64_t* pVal); int32_t tjsonGetUIntValue(const SJson* pJson, const char* pName, uint32_t* pVal); -int32_t tjsonGetUSmallIntValue(const SJson* pJson, const char* pName, uint16_t* pVal); int32_t tjsonGetUTinyIntValue(const SJson* pJson, const char* pName, uint8_t* pVal); int32_t tjsonGetBoolValue(const SJson* pJson, const char* pName, bool* pVal); int32_t tjsonGetDoubleValue(const SJson* pJson, const char* pName, double* pVal); diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 2051da1181..099cd0d3b3 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -2972,7 +2972,7 @@ static int32_t dataTypeToJson(const void* pObj, SJson* pJson) { static int32_t jsonToDataType(const SJson* pJson, void* pObj) { SDataType* pNode = (SDataType*)pObj; - int32_t code = tjsonGetUSmallIntValue(pJson, jkDataTypeType, &pNode->type); + int32_t code = tjsonGetUTinyIntValue(pJson, jkDataTypeType, &pNode->type); if (TSDB_CODE_SUCCESS == code) { code = tjsonGetUTinyIntValue(pJson, jkDataTypePrecision, &pNode->precision); } diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index fadce124af..ad80508c64 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -619,7 +619,7 @@ static int32_t dataTypeToMsg(const void* pObj, STlvEncoder* pEncoder) { static int32_t msgToDataTypeInline(STlvDecoder* pDecoder, void* pObj) { SDataType* pNode = (SDataType*)pObj; - int32_t code = tlvDecodeValueU16(pDecoder, &pNode->type); + int32_t code = tlvDecodeValueI8(pDecoder, &pNode->type); if (TSDB_CODE_SUCCESS == code) { code = tlvDecodeValueU8(pDecoder, &pNode->precision); } @@ -641,7 +641,7 @@ static int32_t msgToDataType(STlvDecoder* pDecoder, void* pObj) { tlvForEach(pDecoder, pTlv, code) { switch (pTlv->type) { case DATA_TYPE_CODE_TYPE: - code = tlvDecodeU16(pTlv, &pNode->type); + code = tlvDecodeI8(pTlv, &pNode->type); break; case DATA_TYPE_CODE_PRECISION: code = tlvDecodeU8(pTlv, &pNode->precision); diff --git a/source/util/src/tjson.c b/source/util/src/tjson.c index 6741c3038f..27d14d05b1 100644 --- a/source/util/src/tjson.c +++ b/source/util/src/tjson.c @@ -250,13 +250,6 @@ int32_t tjsonGetUIntValue(const SJson* pJson, const char* pName, uint32_t* pVal) return code; } -int32_t tjsonGetUSmallIntValue(const SJson* pJson, const char* pName, uint16_t* pVal) { - uint64_t val = 0; - int32_t code = tjsonGetUBigIntValue(pJson, pName, &val); - *pVal = val; - return code; -} - int32_t tjsonGetUTinyIntValue(const SJson* pJson, const char* pName, uint8_t* pVal) { uint64_t val = 0; int32_t code = tjsonGetUBigIntValue(pJson, pName, &val); @@ -382,4 +375,4 @@ bool tjsonValidateJson(const char* jIn) { return true; } -const char* tjsonGetError() { return cJSON_GetErrorPtr(); } +const char* tjsonGetError() { return cJSON_GetErrorPtr(); } \ No newline at end of file