提交 ee38d1f1 编写于 作者: G Ganlin Zhao

fix time related function using taosParseTime generate random output

上级 cc672cfa
......@@ -2229,15 +2229,15 @@ void vectorMathFunc(int16_t functionId, tExprOperandInfo *pInputs, int32_t numIn
}
void convertStringToTimestamp(int16_t type, char *inputData, int64_t timePrec, int64_t *timeVal) {
int32_t charLen = varDataLen(inputData);
char *newColData;
if (type == TSDB_DATA_TYPE_BINARY) {
int32_t charLen = varDataLen(inputData);
char *newColData = calloc(1, charLen + 1);
newColData = calloc(1, charLen + 1);
memcpy(newColData, varDataVal(inputData), charLen);
taosParseTime(newColData, timeVal, charLen, timePrec, 0);
tfree(newColData);
} else if (type == TSDB_DATA_TYPE_NCHAR) {
int32_t charLen = varDataLen(inputData);
char *newColData = calloc(1, charLen / TSDB_NCHAR_SIZE + 1);
newColData = calloc(1, charLen / TSDB_NCHAR_SIZE + 1);
int len = taosUcs4ToMbs(varDataVal(inputData), charLen, newColData);
if (len < 0){
uError("convertStringToTimestamp taosUcs4ToMbs error");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册