未验证 提交 855990ee 编写于 作者: W wade zhang 提交者: GitHub

Merge pull request #11144 from taosdata/fix/TD-14418

[TD-14418]<fix>: TO_UNIXTIMESTAMP(q_nchar), core
......@@ -2231,14 +2231,12 @@ 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;
char *newColData = calloc(1, charLen + 1);
if (type == TSDB_DATA_TYPE_BINARY) {
newColData = calloc(1, charLen + 1);
memcpy(newColData, varDataVal(inputData), charLen);
taosParseTime(newColData, timeVal, charLen, (int32_t)timePrec, 0);
tfree(newColData);
} else if (type == TSDB_DATA_TYPE_NCHAR) {
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.
先完成此消息的编辑!
想要评论请 注册