提交 5fc0e234 编写于 作者: haoranc's avatar haoranc

test:supplement muti-branch for query fuction testcase

上级 86576930
......@@ -1651,7 +1651,7 @@ static int32_t translateMode(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
static int32_t translateDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
int32_t numOfParams = LIST_LENGTH(pFunc->pParameterList);
if (numOfParams == 0 || numOfParams > 2) {
if (numOfParams > 2) {
return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName);
}
......
......@@ -93,8 +93,19 @@ class TDTestCase:
tdSql.error(f"select diff(col12) from {dbname}.stb_1")
tdSql.error(f"select diff(col13) from {dbname}.stb_1")
tdSql.error(f"select diff(col14) from {dbname}.stb_1")
tdSql.error(f"select diff(col14) from {dbname}.stb_1")
tdSql.error(f"select diff(col1,col1,col1) from {dbname}.stb_1")
tdSql.error(f"select diff(col1,1,col1) from {dbname}.stb_1")
tdSql.error(f"select diff(col1,col1,col) from {dbname}.stb_1")
tdSql.error(f"select diff(col1,col1) from {dbname}.stb_1")
tdSql.error(f"select diff(col1,'123') from {dbname}.stb_1")
tdSql.error(f"select diff(col1,1.23) from {dbname}.stb_1")
tdSql.error(f"select diff(col1,-1) from {dbname}.stb_1")
tdSql.query(f"select ts,diff(col1),ts from {dbname}.stb_1")
tdSql.query(f"select diff(ts) from {dbname}.stb_1")
tdSql.checkRows(10)
tdSql.query(f"select diff(col1) from {dbname}.stb_1")
tdSql.checkRows(10)
......
......@@ -1312,24 +1312,26 @@ class TDTestCase:
# ts can't be used at outer query
tdSql.query("select elapsed(ts,1s) from (select ts from regular_table_1 );")
tdSql.query("select elapsed(ts,1s) from (select ts from stable_1 );")
# case : TD-12164
tdSql.error("select elapsed(ts,1s) from (select qint ts from regular_table_1 );")
tdSql.error("select elapsed(tbname ,1s) from (select qint tbname from regular_table_1 );")
tdSql.error("select elapsed(tsc ,1s) from (select q_int tsc from regular_table_1) ;")
tdSql.error("select elapsed(tsv ,1s) from (select elapsed(ts,1s) tsv from regular_table_1);")
tdSql.error("select elapsed(ts ,1s) from (select elapsed(ts,1s) ts from regular_table_1);")
tdSql.error("select elapsed(ts,1s) from (select qint ts from stable_1 );")
tdSql.error("select elapsed(tbname ,1s) from (select qint tbname from stable_1 );")
tdSql.error("select elapsed(tsc ,1s) from (select q_int tsc from stable_1) ;")
tdSql.error("select elapsed(tsv ,1s) from (select elapsed(ts,1s) tsv from stable_1);")
tdSql.error("select elapsed(ts ,1s) from (select elapsed(ts,1s) ts from stable_1);")
# # bug fix
tdSql.error("select elapsed(tsc ,1s) from (select tscol tsc from regular_table_1) ;")
tdSql.error("select elapsed(tsc ,1s) from (select tscol tsc from stable_1) ;")
#TD-19911
tdSql.error("select elapsed(ts,1s,123) from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed() from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed(tscol,1s) from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed(ts,1n) from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed(ts,1y) from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed(ts,1s,123) from (select ts,tbname from stable_1 order by ts asc );")
tdSql.error("select elapsed() from (select ts,tbname from stable_1 order by ts asc );")
tdSql.error("select elapsed(tscol,1s) from (select ts,tbname from stable_1 order by ts asc );")
tdSql.error("select elapsed(ts,1n) from (select ts,tbname from stable_1 order by ts asc );")
tdSql.error("select elapsed(ts,1y) from (select ts,tbname from stable_1 order by ts asc );")
tdSql.error("select elapsed(ts,tscol) from (select ts,tbname from stable_1 order by ts asc );")
tdSql.error("select elapsed(bin_chars,tscol) from (select ts,tbname from stable_1 order by ts asc );")
# case TD-12276
tdSql.query("select elapsed(ts,1s) from (select ts,tbname from regular_table_1 order by ts asc );")
......
......@@ -454,13 +454,26 @@ class TDTestCase:
tdSql.checkData(2, 0, '{"lower_bin":6, "upper_bin":9, "count":3}')
# if (4 != numOfParams)
# tdSql.error("select HISTOGRAM(c_int, \"linear_bin\", \"{\"start\": -200, \"width\": 100, \"count\": 20, \"infinity\": false}\", 1 , InvalidNumber) from db.nt1 where c_int < 10")
tdSql.error('SELECT HISTOGRAM(c_int, "linear_bin", "{"start": -200, "width": 100, "count": 20, "infinity": false}", 0 ,InvalidNumber ) from %s.nt1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "linear_bin", "{"start": -200, "width": 100, "count": 20, "infinity": false}" ) from %s.nt1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, 54321, "[0,3,6,9]", 1 ) from %s.nt1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "USER_INPUT", 54321, 0 ) from %s.nt1'%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "USER_INPUT", "[0,3,6,9]", InvalidNumber ) from %s.nt1'%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "USER_INPUT", "[0,3,6,9]", -100 ) from %s.nt1'%dbname)
# tdSql.error("select HISTOGRAM(c_int, \"linear_bin\", \"{\"start\": -200, \"width\": 100, \"count\": 20, \"infinity\": false}\", 1 , InvalidNumber) from db.stb1 where c_int < 10")
tdSql.error('SELECT HISTOGRAM(c_int, "linear_bin", \'{"start": -200, "width": 100, "count": 20, "infinity": false}\', 0 ,InvalidNumber ) from %s.stb1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "linear_bin", \'{"start": -200, "width": 100, "count": 20, "infinity": false}\' ) from %s.stb1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, 54321, "[0,3,6,9]", 1 ) from %s.stb1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "USER_INPUT", 54321, 0 ) from %s.stb1'%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "USER_INPUT", "[0,3,6,9]", InvalidNumber ) from %s.stb1'%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "USER_INPUT", "[0,3,6,9]", -100 ) from %s.stb1'%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, c_int, "[0,3,6,9]", 1 ) from %s.stb1'%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "USER_INPUT", c_int, 1 ) from %s.stb1'%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "USER_INPUT", "[0,3,6,9]", c_int ) from %s.stb1'%dbname)
tdSql.query('SELECT HISTOGRAM(123, "USER_INPUT", "[0,3,6,9]", 0 ) from %s.stb1'%dbname)
tdSql.error('SELECT HISTOGRAM(c_binary, "USER_INPUT", "[0,3,6,9]", 0 ) from %s.stb1'%dbname)
tdSql.error('SELECT HISTOGRAM("c_binary", "USER_INPUT", "[0,3,6,9]", 0 ) from %s.stb1'%dbname)
tdSql.query('SELECT HISTOGRAM(123, "linear_bin", \'{"start": 1, "width": 10, "count": 20, "infinity": false}\',0 ) from %s.stb1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_binary, "linear_bin", \'{"start": 1, "width": 10, "count": 20, "infinity": false}\',0 ) from %s.stb1 '%dbname)
tdSql.error('SELECT HISTOGRAM("c_binary", "linear_bin", \'{"start": 1, "width": 10, "count": 20, "infinity": false}\',0 ) from %s.stb1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "c_int", \'{"start": 1, "width": 10, "count": 20, "infinity": false}\',0 ) from %s.stb1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "linear_bin", c_int,0 ) from %s.stb1 '%dbname)
tdSql.error('SELECT HISTOGRAM(c_int, "linear_bin", \'{"start": 1, "width": 10, "count": 20, "infinity": false}\',c_int ) from %s.stb1 '%dbname)
def all_test(self, dbname=DBNAME):
......
......@@ -437,6 +437,10 @@ class TDTestCase:
tdSql.checkData(0,0,4)
tdSql.checkData(1,0,1)
# TD-19911
tdSql.error("select unique(mode(12)) from (select _rowts , t1 , tbname from db.stb1 );")
tdSql.error("select unique(mode(t1,1)) from (select _rowts , t1 , tbname from db.stb1 );")
def check_boundary_values(self, dbname="bound_test"):
tdSql.execute(f"drop database if exists {dbname}")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册