Merge branch '3.0' of github.com:taosdata/TDengine into fix/TD-31754

This commit is contained in:
54liuyao 2024-08-28 11:18:39 +08:00
commit 6a03870c61
3 changed files with 34 additions and 2 deletions

View File

@ -294,6 +294,8 @@ void taosRemoveOldFiles(const char *dirname, int32_t keepDays) {
int32_t len = (int32_t)strlen(filename);
if (len > 3 && strcmp(filename + len - 3, ".gz") == 0) {
len -= 3;
}else{
continue;
}
int64_t fileSec = 0;
@ -308,7 +310,7 @@ void taosRemoveOldFiles(const char *dirname, int32_t keepDays) {
int32_t days = (int32_t)(TABS(sec - fileSec) / 86400 + 1);
if (days > keepDays) {
(void)taosRemoveFile(filename);
// printf("file:%s is removed, days:%d keepDays:%d", filename, days, keepDays);
uInfo("file:%s is removed, days:%d keepDays:%d, sed:%"PRId64, filename, days, keepDays, fileSec);
} else {
// printf("file:%s won't be removed, days:%d keepDays:%d", filename, days, keepDays);
}

View File

@ -141,12 +141,42 @@ class TDTestCase(TBase):
tdSql.checkRows(1)
tdSql.checkData(0, 0, 102)
def FIX_TD_31684(self):
tdLog.info("check bug TD_31684 ...\n")
sqls = [
"drop database if exists td_31684",
"create database td_31684 cachemodel 'both' stt_trigger 1;",
"use td_31684;",
"create table t1 (ts timestamp, id int, name int) ;",
"insert into t1 values(now, 1, 1);",
"insert into t1 values(now, 1, 2);",
"insert into t1 values(now, 2, 3);",
"insert into t1 values(now, 3, 4);"
]
tdSql.executes(sqls)
sql1 = "select count(name) as total_name from t1 group by name"
sql2 = "select id as new_id, last(name) as last_name from t1 group by id order by new_id"
sql3 = "select id as new_id, count(id) as id from t1 group by id order by new_id"
tdSql.query(sql1)
tdSql.checkRows(4)
tdSql.query(sql2)
tdSql.checkRows(3)
tdSql.checkData(0, 1, 2)
tdSql.checkData(1, 1, 3)
tdSql.query(sql3)
tdSql.checkRows(3)
tdSql.checkData(0, 1, 2)
tdSql.checkData(2, 1, 1)
# run
def run(self):
tdLog.debug(f"start to excute {__file__}")
# TD BUGS
self.FIX_TD_30686()
self.FIX_TD_31684()
# TS BUGS
self.FIX_TS_5105()

View File

@ -1170,7 +1170,7 @@ void testDetailError() {
int32_t code = tmq_write_raw((TAOS*)1, raw);
ASSERT(code);
const char* err = tmq_err2str(code);
char* tmp = strstr(err, "Invalid parameters,detail:taos:0x1 or data");
char* tmp = strstr(err, "Invalid parameters,detail:taos:");
ASSERT(tmp != NULL);
}