提交 35698da9 编写于 作者: G Ganlin Zhao

enh(query): add cast from binary/nchar -> timestamp for date-time string

上级 02994550
......@@ -934,9 +934,14 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp
break;
}
case TSDB_DATA_TYPE_TIMESTAMP: {
int64_t timeVal;
if (inputType == TSDB_DATA_TYPE_BINARY || inputType == TSDB_DATA_TYPE_NCHAR) {
//convert to 0
*(int64_t *)output = 0;
int32_t ret = convertStringToTimestamp(inputType, input, TSDB_TIME_PRECISION_MILLI, &timeVal);
if (ret != TSDB_CODE_SUCCESS) {
*(int64_t *)output = 0;
} else {
*(int64_t *)output = timeVal;
}
} else {
GET_TYPED_DATA(*(int64_t *)output, int64_t, inputType, input);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册