Merge pull request #29634 from taosdata/fix/main/TS-5941
fix:[TS-5941] fix interpolate varchar/nchar data error
This commit is contained in:
commit
0a42d32112
|
@ -63,7 +63,7 @@ static void doKeepPrevRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock
|
|||
pkey->isNull = false;
|
||||
char* val = colDataGetData(pColInfoData, rowIndex);
|
||||
if (IS_VAR_DATA_TYPE(pkey->type)) {
|
||||
memcpy(pkey->pData, val, varDataLen(val));
|
||||
memcpy(pkey->pData, val, varDataTLen(val));
|
||||
} else {
|
||||
memcpy(pkey->pData, val, pkey->bytes);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ static void doKeepNextRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock
|
|||
if (!IS_VAR_DATA_TYPE(pkey->type)) {
|
||||
memcpy(pkey->pData, val, pkey->bytes);
|
||||
} else {
|
||||
memcpy(pkey->pData, val, varDataLen(val));
|
||||
memcpy(pkey->pData, val, varDataTLen(val));
|
||||
}
|
||||
} else {
|
||||
pkey->isNull = true;
|
||||
|
|
|
@ -1015,3 +1015,108 @@ taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '
|
|||
|
||||
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
|
||||
|
||||
taos> select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(prev);
|
||||
_irowts | interp(c1) | t1 |
|
||||
===========================================================================
|
||||
2020-02-01 00:00:05.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:06.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:07.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:08.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:09.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:10.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:11.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:12.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:13.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:14.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:15.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:16.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:17.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:18.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:19.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:20.000 | 15 | testts5941 |
|
||||
|
||||
taos> select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(next);
|
||||
_irowts | interp(c1) | t1 |
|
||||
===========================================================================
|
||||
2020-02-01 00:00:00.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:01.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:02.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:03.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:04.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:05.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:06.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:07.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:08.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:09.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:10.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:11.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:12.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:13.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:14.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:15.000 | 15 | testts5941 |
|
||||
|
||||
taos> select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(linear);
|
||||
_irowts | interp(c1) | t1 |
|
||||
===========================================================================
|
||||
2020-02-01 00:00:05.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:06.000 | 6 | testts5941 |
|
||||
2020-02-01 00:00:07.000 | 7 | testts5941 |
|
||||
2020-02-01 00:00:08.000 | 8 | testts5941 |
|
||||
2020-02-01 00:00:09.000 | 9 | testts5941 |
|
||||
2020-02-01 00:00:10.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:11.000 | 11 | testts5941 |
|
||||
2020-02-01 00:00:12.000 | 12 | testts5941 |
|
||||
2020-02-01 00:00:13.000 | 13 | testts5941 |
|
||||
2020-02-01 00:00:14.000 | 14 | testts5941 |
|
||||
2020-02-01 00:00:15.000 | 15 | testts5941 |
|
||||
|
||||
taos> select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(null);
|
||||
_irowts | interp(c1) | t1 |
|
||||
===========================================================================
|
||||
2020-02-01 00:00:00.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:01.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:02.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:03.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:04.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:05.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:06.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:07.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:08.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:09.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:10.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:11.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:12.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:13.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:14.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:15.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:16.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:17.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:18.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:19.000 | NULL | testts5941 |
|
||||
2020-02-01 00:00:20.000 | NULL | testts5941 |
|
||||
|
||||
taos> select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(value, 1);
|
||||
_irowts | interp(c1) | t1 |
|
||||
===========================================================================
|
||||
2020-02-01 00:00:00.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:01.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:02.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:03.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:04.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:05.000 | 5 | testts5941 |
|
||||
2020-02-01 00:00:06.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:07.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:08.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:09.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:10.000 | 10 | testts5941 |
|
||||
2020-02-01 00:00:11.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:12.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:13.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:14.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:15.000 | 15 | testts5941 |
|
||||
2020-02-01 00:00:16.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:17.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:18.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:19.000 | 1 | testts5941 |
|
||||
2020-02-01 00:00:20.000 | 1 | testts5941 |
|
||||
|
||||
|
|
|
|
@ -63,3 +63,8 @@ select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-0
|
|||
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
|
||||
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
|
||||
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
|
||||
select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(prev);
|
||||
select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(next);
|
||||
select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(linear);
|
||||
select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(null);
|
||||
select _irowts, interp(c1), t1 from test.ts5941_child range('2020-02-01 00:00:00', '2020-02-01 00:00:20') every(1s) fill(value, 1);
|
||||
|
|
|
@ -40,6 +40,9 @@ class TDTestCase(TBase):
|
|||
)
|
||||
tdSql.execute("create table if not exists test.td32861(ts timestamp, c1 int);")
|
||||
|
||||
tdSql.execute("create stable if not exists test.ts5941(ts timestamp, c1 int, c2 int) tags (t1 varchar(30));")
|
||||
tdSql.execute("create table if not exists test.ts5941_child using test.ts5941 tags ('testts5941');")
|
||||
|
||||
tdLog.printNoPrefix("==========step2:insert data")
|
||||
|
||||
tdSql.execute(f"insert into test.td32727 values ('2020-02-01 00:00:05', 5, 5, 5, 5, 5.0, 5.0, true, 'varchar', 'nchar', 5, 5, 5, 5)")
|
||||
|
@ -56,6 +59,9 @@ class TDTestCase(TBase):
|
|||
('2020-01-01 00:00:15', 15),
|
||||
('2020-01-01 00:00:21', 21);"""
|
||||
)
|
||||
tdSql.execute(f"insert into test.ts5941_child values ('2020-02-01 00:00:05', 5, 5)")
|
||||
tdSql.execute(f"insert into test.ts5941_child values ('2020-02-01 00:00:10', 10, 10)")
|
||||
tdSql.execute(f"insert into test.ts5941_child values ('2020-02-01 00:00:15', 15, 15)")
|
||||
|
||||
def test_normal_query_new(self, testCase):
|
||||
# read sql from .sql file and execute
|
||||
|
|
Loading…
Reference in New Issue