Merge pull request #26333 from taosdata/fix/3.0/TS-5103
fix fill wrong timestamp value
This commit is contained in:
commit
b16bf11280
|
@ -84,7 +84,9 @@ static void doSetUserSpecifiedValue(SColumnInfoData* pDst, SVariant* pVar, int32
|
||||||
GET_TYPED_DATA(v, uint64_t, pVar->nType, &pVar->u);
|
GET_TYPED_DATA(v, uint64_t, pVar->nType, &pVar->u);
|
||||||
colDataSetVal(pDst, rowIndex, (char*)&v, isNull);
|
colDataSetVal(pDst, rowIndex, (char*)&v, isNull);
|
||||||
} else if (pDst->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
|
} else if (pDst->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
|
||||||
colDataSetVal(pDst, rowIndex, (const char*)¤tKey, isNull);
|
int64_t v = 0;
|
||||||
|
GET_TYPED_DATA(v, int64_t, pVar->nType, &pVar->u);
|
||||||
|
colDataSetVal(pDst, rowIndex, (const char*)&v, isNull);
|
||||||
} else if (pDst->info.type == TSDB_DATA_TYPE_NCHAR || pDst->info.type == TSDB_DATA_TYPE_VARCHAR ||
|
} else if (pDst->info.type == TSDB_DATA_TYPE_NCHAR || pDst->info.type == TSDB_DATA_TYPE_VARCHAR ||
|
||||||
pDst->info.type == TSDB_DATA_TYPE_VARBINARY) {
|
pDst->info.type == TSDB_DATA_TYPE_VARBINARY) {
|
||||||
colDataSetVal(pDst, rowIndex, pVar->pz, isNull);
|
colDataSetVal(pDst, rowIndex, pVar->pz, isNull);
|
||||||
|
|
|
@ -649,8 +649,8 @@ class TDTestCase:
|
||||||
tdSql.checkData(0,1,None)
|
tdSql.checkData(0,1,None)
|
||||||
|
|
||||||
tdSql.query(f"select ts , last_row(c1) ,c1 from (select ts , max(c1) c1 ,t1 from {dbname}.stb1 where ts >now -1h and ts <now+1h interval(10s) fill(value ,10, 10, 10))")
|
tdSql.query(f"select ts , last_row(c1) ,c1 from (select ts , max(c1) c1 ,t1 from {dbname}.stb1 where ts >now -1h and ts <now+1h interval(10s) fill(value ,10, 10, 10))")
|
||||||
tdSql.checkData(0,1,10)
|
tdSql.checkData(0,1,9)
|
||||||
tdSql.checkData(0,1,10)
|
tdSql.checkData(0,1,9)
|
||||||
|
|
||||||
tdSql.error(f"select ts , last_row(c1) ,c1 from (select count(c1) c1 from {dbname}.stb1 where ts >now -1h and ts <now+1h interval(10s) fill(value ,10, 10, 10))")
|
tdSql.error(f"select ts , last_row(c1) ,c1 from (select count(c1) c1 from {dbname}.stb1 where ts >now -1h and ts <now+1h interval(10s) fill(value ,10, 10, 10))")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue