Merge pull request #20234 from taosdata/fix/TD-22868
fix:set timestamp precision
This commit is contained in:
commit
eeca7653b9
|
@ -2003,7 +2003,7 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
|
|||
switch (pColInfoData->info.type) {
|
||||
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||
memset(pBuf, 0, sizeof(pBuf));
|
||||
formatTimestamp(pBuf, *(uint64_t*)var, TSDB_TIME_PRECISION_MILLI);
|
||||
formatTimestamp(pBuf, *(uint64_t*)var, pColInfoData->info.precision);
|
||||
len += snprintf(dumpBuf + len, size - len, " %25s |", pBuf);
|
||||
if (len >= size - 1) return dumpBuf;
|
||||
break;
|
||||
|
|
|
@ -1211,7 +1211,8 @@ static EDealRes translateValueImpl(STranslateContext* pCxt, SValueNode* pVal, SD
|
|||
} else {
|
||||
res = translateNormalValue(pCxt, pVal, targetDt, strict);
|
||||
}
|
||||
pVal->node.resType = targetDt;
|
||||
pVal->node.resType.type = targetDt.type;
|
||||
pVal->node.resType.bytes = targetDt.bytes;
|
||||
pVal->node.resType.scale = pVal->unit;
|
||||
pVal->translate = true;
|
||||
if (!strict && TSDB_DATA_TYPE_UBIGINT == pVal->node.resType.type && pVal->datum.u <= INT64_MAX) {
|
||||
|
|
|
@ -915,6 +915,7 @@ int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_
|
|||
|
||||
SDataType t = {.type = type};
|
||||
t.bytes = IS_VAR_DATA_TYPE(t.type)? input->columnData->info.bytes:tDataTypes[type].bytes;
|
||||
t.precision = input->columnData->info.precision;
|
||||
|
||||
int32_t code = sclCreateColumnInfoData(&t, input->numOfRows, output);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
|
|
Loading…
Reference in New Issue