Merge branch '3.0' of github.com:taosdata/TDengine into fix/TD-31754
This commit is contained in:
commit
6a03870c61
|
@ -294,6 +294,8 @@ void taosRemoveOldFiles(const char *dirname, int32_t keepDays) {
|
||||||
int32_t len = (int32_t)strlen(filename);
|
int32_t len = (int32_t)strlen(filename);
|
||||||
if (len > 3 && strcmp(filename + len - 3, ".gz") == 0) {
|
if (len > 3 && strcmp(filename + len - 3, ".gz") == 0) {
|
||||||
len -= 3;
|
len -= 3;
|
||||||
|
}else{
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t fileSec = 0;
|
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);
|
int32_t days = (int32_t)(TABS(sec - fileSec) / 86400 + 1);
|
||||||
if (days > keepDays) {
|
if (days > keepDays) {
|
||||||
(void)taosRemoveFile(filename);
|
(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 {
|
} else {
|
||||||
// printf("file:%s won't be removed, days:%d keepDays:%d", filename, days, keepDays);
|
// printf("file:%s won't be removed, days:%d keepDays:%d", filename, days, keepDays);
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,12 +141,42 @@ class TDTestCase(TBase):
|
||||||
tdSql.checkRows(1)
|
tdSql.checkRows(1)
|
||||||
tdSql.checkData(0, 0, 102)
|
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
|
# run
|
||||||
def run(self):
|
def run(self):
|
||||||
tdLog.debug(f"start to excute {__file__}")
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
|
||||||
# TD BUGS
|
# TD BUGS
|
||||||
self.FIX_TD_30686()
|
self.FIX_TD_30686()
|
||||||
|
self.FIX_TD_31684()
|
||||||
|
|
||||||
# TS BUGS
|
# TS BUGS
|
||||||
self.FIX_TS_5105()
|
self.FIX_TS_5105()
|
||||||
|
|
|
@ -1170,7 +1170,7 @@ void testDetailError() {
|
||||||
int32_t code = tmq_write_raw((TAOS*)1, raw);
|
int32_t code = tmq_write_raw((TAOS*)1, raw);
|
||||||
ASSERT(code);
|
ASSERT(code);
|
||||||
const char* err = tmq_err2str(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);
|
ASSERT(tmp != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue