parent
de4a0047c5
commit
d34c70d172
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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(); }
|
Loading…
Reference in New Issue