sql select count(*) from sliding_tb0 interval(30s) sliding(30s);
sql select _wstart, count(*) from sliding_tb0 interval(30s) sliding(30s);
if $row != 10 then
if $row != 10 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:00.000@ then
if $data00 != @00-01-01 00:00:00.000@ then
return -1
return -1
endi
endi
if $data01 != 1000 then
if $data01 != 1000 then
return -1
return -1
endi
endi
if $data10 != @00-01-01 00:00:30.000@ then
if $data10 != @00-01-01 00:00:30.000@ then
return -1
return -1
endi
endi
if $data11 != 1000 then
if $data11 != 1000 then
return -1
return -1
endi
endi
sql select stddev(c1) from sliding_tb0 interval(10a) sliding(10a)
sql select _wstart, stddev(c1) from sliding_tb0 interval(10a) sliding(10a);
if $row != 10000 then
if $row != 10000 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:00.000@ then
if $data00 != @00-01-01 00:00:00.000@ then
return -1
return -1
endi
endi
if $data01 != 0.000000000 then
if $data01 != 0.000000000 then
return -1
return -1
endi
endi
if $data90 != @00-01-01 00:00:00.270@ then
if $data90 != @00-01-01 00:00:00.270@ then
return -1
return -1
endi
endi
if $data91 != 0.000000000 then
if $data91 != 0.000000000 then
return -1
return -1
endi
endi
sql select stddev(c1),count(c2),first(c3),last(c4) from sliding_tb0 interval(10a) sliding(10a) order by ts desc;
sql select _wstart, stddev(c1),count(c2),first(c3),last(c4) from sliding_tb0 interval(10a) sliding(10a) order by _wstart desc;
if $row != 10000 then
if $row != 10000 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:04:59.970@ then
if $data00 != @00-01-01 00:04:59.970@ then
return -1
return -1
endi
endi
if $data01 != 0.000000000 then
if $data01 != 0.000000000 then
return -1
return -1
endi
endi
if $data02 != 1 then
if $data02 != 1 then
return -1
return -1
endi
endi
if $data03 != 99 then
if $data03 != 99 then
return -1
return -1
endi
endi
if $data04 != 99 then
if $data04 != 99 then
return -1
return -1
endi
endi
if $data90 != @00-01-01 00:04:59.700@ then
if $data90 != @00-01-01 00:04:59.700@ then
return -1
return -1
endi
endi
if $data91 != 0.000000000 then
if $data91 != 0.000000000 then
return -1
return -1
endi
endi
if $data92 != 1 then
if $data92 != 1 then
return -1
return -1
endi
endi
if $data93 != 90 then
if $data93 != 90 then
return -1
return -1
endi
endi
if $data94 != 90 then
if $data94 != 90 then
return -1
return -1
endi
endi
sql select count(c2),last(c4) from sliding_tb0 interval(30s) sliding(10s) order by ts asc;
sql select _wstart, count(c2),last(c4) from sliding_tb0 interval(30s) sliding(10s) order by _wstart asc;
if $row != 32 then
if $row != 32 then
return -1
return -1
endi
endi
if $data00 != @99-12-31 23:59:40.000@ then
if $data00 != @99-12-31 23:59:40.000@ then
print expect 12-31 23:59:40.000, actual: $data00
print expect 12-31 23:59:40.000, actual: $data00
return -1
return -1
endi
endi
if $data01 != 334 then
if $data01 != 334 then
return -1
return -1
endi
endi
if $data02 != 33 then
if $data02 != 33 then
return -1
return -1
endi
endi
sql select count(c2),stddev(c3),first(c4),last(c4) from sliding_tb0 where ts>'2000-01-01 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by ts asc;
sql select _wstart, count(c2),stddev(c3),first(c4),last(c4) from sliding_tb0 where ts>'2000-01-01 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by _wstart asc;
if $row != 2 then
if $row != 2 then
return -1
return -1
endi
endi
if $data04 != 99 then
if $data04 != 99 then
return -1
return -1
endi
endi
if $data01 != 999 then
if $data01 != 999 then
return -1
return -1
endi
endi
if $data02 != 28.837977152 then
if $data02 != 28.837977152 then
return -1
return -1
endi
endi
#interval offset + limit
#interval offset + limit
sql select count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) sliding(10a) order by ts desc limit 10 offset 990;
sql select _wstart, count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) sliding(10a) order by _wstart desc limit 10 offset 990;
if $row != 10 then
if $row != 10 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:04:30.270@ then
if $data00 != @00-01-01 00:04:30.270@ then
return -1
return -1
endi
endi
if $data01 != 1 then
if $data01 != 1 then
return -1
return -1
endi
endi
if $data02 != 9 then
if $data02 != 9 then
return -1
return -1
endi
endi
if $data03 != 0.000000000 then
if $data03 != 0.000000000 then
return -1
return -1
endi
endi
if $data90 != @00-01-01 00:04:30.000@ then
if $data90 != @00-01-01 00:04:30.000@ then
return -1
return -1
endi
endi
if $data91 != 1 then
if $data91 != 1 then
return -1
return -1
endi
endi
if $data92 != 0 then
if $data92 != 0 then
return -1
return -1
endi
endi
if $data93 != 0.000000000 then
if $data93 != 0.000000000 then
return -1
return -1
endi
endi
#interval offset test
#interval offset test
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(30s) order by ts asc limit 1000 offset 1;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(30s) order by _wstart asc limit 1000 offset 1;
if $row != 9 then
if $row != 9 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:30.000@ then
if $data00 != @00-01-01 00:00:30.000@ then
return -1
return -1
endi
endi
if $data01 != 1000 then
if $data01 != 1000 then
return -1
return -1
endi
endi
if $data02 != 99 then
if $data02 != 99 then
return -1
return -1
endi
endi
if $data80 != @00-01-01 00:04:30.000@ then
if $data80 != @00-01-01 00:04:30.000@ then
return -1
return -1
endi
endi
if $data81 != 1000 then
if $data81 != 1000 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 where ts>'2000-1-1 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by ts asc limit 1000 offset 0;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 where ts>'2000-1-1 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by _wstart asc limit 1000 offset 0;
if $row != 2 then
if $row != 2 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:00.000@ then
if $data00 != @00-01-01 00:00:00.000@ then
return -1
return -1
endi
endi
if $data01 != 999 then
if $data01 != 999 then
return -1
return -1
endi
endi
if $data02 != 99 then
if $data02 != 99 then
return -1
return -1
endi
endi
if $data03 != 28.837977152 then
if $data03 != 28.837977152 then
return -1
return -1
endi
endi
if $data10 != @00-01-01 00:00:30.000@ then
if $data10 != @00-01-01 00:00:30.000@ then
return -1
return -1
endi
endi
if $data11 != 34 then
if $data11 != 34 then
return -1
return -1
endi
endi
if $data12 != 33 then
if $data12 != 33 then
return -1
return -1
endi
endi
if $data13 != 9.810708435 then
if $data13 != 9.810708435 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 1;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 1;
if $row != 15 then
if $row != 15 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:00.000@ then
if $data00 != @00-01-01 00:00:00.000@ then
return -1
return -1
endi
endi
if $data01 != 1000 then
if $data01 != 1000 then
return -1
return -1
endi
endi
if $data02 != 99 then
if $data02 != 99 then
return -1
return -1
endi
endi
if $data03 != 28.866070048 then
if $data03 != 28.866070048 then
return -1
return -1
endi
endi
if $data90 != @00-01-01 00:03:00.000@ then
if $data90 != @00-01-01 00:03:00.000@ then
return -1
return -1
endi
endi
if $data91 != 1000 then
if $data91 != 1000 then
return -1
return -1
endi
endi
if $data92 != 99 then
if $data92 != 99 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 5;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 5;
if $row != 11 then
if $row != 11 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 6;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 6;
if $row != 10 then
if $row != 10 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 7;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 7;
if $row != 9 then
if $row != 9 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 8;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 8;
if $row != 8 then
if $row != 8 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 9;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 9;
if $row != 7 then
if $row != 7 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 10;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 10;
if $row != 6 then
if $row != 6 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 11;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 11;
if $row != 5 then
if $row != 5 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 12;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 12;
if $row != 4 then
if $row != 4 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 13;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 13;
if $row != 3 then
if $row != 3 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 14;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 14;
if $row != 2 then
if $row != 2 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 15;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 15;
if $row != 1 then
if $row != 1 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 16;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 16;
if $row != 0 then
if $row != 0 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) order by ts desc;
sql select _wstart, count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) order by _wstart desc;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by ts desc limit 1 offset 15;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by _wstart desc limit 1 offset 15;
if $row != 1 then
if $row != 1 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by ts desc limit 1 offset 16;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by _wstart desc limit 1 offset 16;
if $row != 0 then
if $row != 0 then
return -1
return -1
endi
endi
sql select count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) order by ts desc limit 10 offset 2;
sql select _wstart, count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) order by _wstart desc limit 10 offset 2;
if $data00 != @00-01-01 00:04:59.910@ then
if $data00 != @00-01-01 00:04:59.910@ then
return -1
return -1
endi
endi
sql select count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by ts asc limit 1000;
sql select _wstart, count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by _wstart asc limit 1000;
if $row != 3 then
if $row != 3 then
return -1
return -1
endi
endi
if $data00 != @99-12-31 23:59:40.000@ then
if $data00 != @99-12-31 23:59:40.000@ then
return -1
return -1
endi
endi
if $data02 != 9.521904571 then
if $data02 != 9.521904571 then
return -1
return -1
endi
endi
if $data05 != 33 then
if $data05 != 33 then
return -1
return -1
endi
endi
if $data10 != @99-12-31 23:59:50.000@ then
if $data10 != @99-12-31 23:59:50.000@ then
return -1
return -1
endi
endi
if $data12 != 9.521904571 then
if $data12 != 9.521904571 then
return -1
return -1
endi
endi
if $data15 != 33 then
if $data15 != 33 then
return -1
return -1
endi
endi
if $data25 != 33 then
if $data25 != 33 then
return -1
return -1
endi
endi
sql select count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by ts desc limit 1000;
sql select _wstart, count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by _wstart desc limit 1000;
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
system sh/prepare_udf.sh
sleep 100
sql connect
print ======================== dnode1 start
sql create function n01 as '/tmp/normal' outputtype int;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n01 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != INT then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n01;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n02 as '/tmp/normal' outputtype bool;
sql show functions;
if $rows != 1 then
print expect 1, actual $rows
return -1
endi
if $data00 != n02 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != BOOL then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n02;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n03 as '/tmp/normal' outputtype TINYINT;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n03 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != TINYINT then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n03;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n04 as '/tmp/normal' outputtype SMALLINT;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n04 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != SMALLINT then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n04;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n05 as '/tmp/normal' outputtype INT;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n05 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != INT then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n05;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n06 as '/tmp/normal' outputtype BIGINT;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n06 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != BIGINT then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n06;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n07 as '/tmp/normal' outputtype FLOAT;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n07 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != FLOAT then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n07;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n08 as '/tmp/normal' outputtype DOUBLE;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n08 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != DOUBLE then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n08;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n09 as '/tmp/normal' outputtype BINARY;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n09 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != BINARY(0) then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n09;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n10 as '/tmp/normal' outputtype BINARY(10);
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n10 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != BINARY(10) then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n10;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n11 as '/tmp/normal' outputtype TIMESTAMP;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n11 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != TIMESTAMP then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n11;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n12 as '/tmp/normal' outputtype NCHAR;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n12 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != NCHAR(0) then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n12;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n13 as '/tmp/normal' outputtype NCHAR(10);
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n13 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != NCHAR(10) then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n13;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n14 as '/tmp/normal' outputtype TINYINT UNSIGNED;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n14 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n14;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n15 as '/tmp/normal' outputtype SMALLINT UNSIGNED;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n15 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n15;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n16 as '/tmp/normal' outputtype INT UNSIGNED;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n16 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n16;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function n17 as '/tmp/normal' outputtype BIGINT UNSIGNED;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n17 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n17;
sql show functions;
if $rows != 0 then
return -1
endi
sql create aggregate function n18 as '/tmp/normal' outputtype BIGINT UNSIGNED;
sql show functions;
if $rows != 1 then
return -1
endi
if $data00 != n18 then
return -1
endi
if $data01 != /tmp/normal then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data05 != 5 then
return -1
endi
sql drop function n18;
sql show functions;
if $rows != 0 then
return -1
endi
sql create function t01 as '/tmp/normal' outputtype INT;
sql_error create function t01 as '/tmp/normal' outputtype SMALLINT;
sql drop function t01;
sql create function t01 as '/tmp/normal' outputtype INT;
sql create function t02 as '/tmp/normal' outputtype SMALLINT;
sql show functions;
if $rows != 2 then
return -1
endi
sql_error create function e1 as '/tmp/normal';
sql_error create function e2 as '/tmp/normal' outputtype;
sql_error create function e3 as '/tmp/normal' a;
sql_error create function e4 as '/tmp/normal' outputtype a;
sql_error create function e5 as '/tmp/normal' outputtype bool int;
sql_error create function as '/tmp/normal' outputtype;
sql_error create function e6 as '/tmp/empty' outputtype int;
sql_error create function e7 as '/tmp/big' outputtype int;
sql_error create function e8 as '/tmp/noexistfile' outputtype int;
sql_error create function e0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 as '/tmp/normal' outputtype int;