Stringsql="Insert into t3 using weather tags('广东') values('2020-01-01 01:0:00.000', 22.22),('2020-01-01 02:00:00.000', 22.22) t4 using weather tags('天津') values('2020-01-01 01:0:00.000', 33.33),('2020-01-01 02:00:00.000', 33.33)";
executeUpdate(sql);
}
@Test
publicvoidtestCase018(){
Stringsql="select * from restful_test.t1";
executeQuery(sql);
}
@Test
publicvoidtestCase019(){
Stringsql="select * from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase020(){
Stringsql="select ts, temperature from restful_test.t1";
executeQuery(sql);
}
@Test
publicvoidtestCase021(){
Stringsql="select ts, temperature from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase022(){
Stringsql="select temperature, ts from restful_test.t1";
executeQuery(sql);
}
@Test
publicvoidtestCase023(){
Stringsql="select temperature, ts from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase024(){
Stringsql="import into restful_test.t5 using weather tags('石家庄') values('2020-01-01 00:01:00.000', 22.22)";
executeUpdate(sql);
}
@Test
publicvoidtestCase025(){
Stringsql="import into restful_test.t6 using weather tags('沈阳') values('2020-01-01 00:01:00.000', 22.22),('2020-01-01 00:02:00.000', 22.22)";
executeUpdate(sql);
}
@Test
publicvoidtestCase026(){
Stringsql="import into restful_test.t7 using weather tags('长沙') values('2020-01-01 00:01:00.000', 22.22) restful_test.t8 using weather tags('吉林') values('2020-01-01 00:01:00.000', 22.22)";
executeUpdate(sql);
}
@Test
publicvoidtestCase027(){
Stringsql="import into restful_test.t9 using weather tags('武汉') values('2020-01-01 00:01:00.000', 22.22) ,('2020-01-02 00:01:00.000', 22.22) restful_test.t10 using weather tags('哈尔滨') values('2020-01-01 00:01:00.000', 22.22),('2020-01-02 00:01:00.000', 22.22)";
executeUpdate(sql);
}
@Test
publicvoidtestCase028(){
Stringsql="select location, temperature, ts from restful_test.weather where temperature > 1";
executeQuery(sql);
}
@Test
publicvoidtestCase029(){
Stringsql="select location, temperature, ts from restful_test.weather where temperature < 1";
executeQuery(sql);
}
@Test
publicvoidtestCase030(){
Stringsql="select location, temperature, ts from restful_test.weather where ts > now";
executeQuery(sql);
}
@Test
publicvoidtestCase031(){
Stringsql="select location, temperature, ts from restful_test.weather where ts < now";
executeQuery(sql);
}
@Test
publicvoidtestCase032(){
Stringsql="select count(*) from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase033(){
Stringsql="select first(*) from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase034(){
Stringsql="select last(*) from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase035(){
Stringsql="select last_row(*) from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase036(){
Stringsql="select ts, ts as primary_key from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase037(){
Stringsql="select database()";
execute("use restful_test");
executeQuery(sql);
}
@Test
publicvoidtestCase038(){
Stringsql="select client_version()";
executeQuery(sql);
}
@Test
publicvoidtestCase039(){
Stringsql="select server_status()";
executeQuery(sql);
}
@Test
publicvoidtestCase040(){
Stringsql="select server_status() as status";
executeQuery(sql);
}
@Test
publicvoidtestCase041(){
Stringsql="select tbname, location from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase042(){
Stringsql="select count(tbname) from restful_test.weather";
executeQuery(sql);
}
@Test
publicvoidtestCase043(){
Stringsql="select * from restful_test.weather where ts < now - 1h";
executeQuery(sql);
}
@Test
publicvoidtestCase044(){
Stringsql="select * from restful_test.weather where ts < now - 1h and location like '%'";
executeQuery(sql);
}
@Test
publicvoidtestCase045(){
Stringsql="select * from restful_test.weather where ts < now - 1h order by ts";
executeQuery(sql);
}
@Test
publicvoidtestCase046(){
Stringsql="select last(*) from restful_test.weather where ts < now - 1h group by tbname order by tbname";
executeQuery(sql);
}
@Test
publicvoidtestCase047(){
Stringsql="select * from restful_test.weather limit 2";
executeQuery(sql);
}
@Test
publicvoidtestCase048(){
Stringsql="select * from restful_test.weather limit 2 offset 5";
executeQuery(sql);
}
@Test
publicvoidtestCase049(){
Stringsql="select * from restful_test.t1, restful_test.t3 where t1.ts = t3.ts ";
executeQuery(sql);
}
@Test
publicvoidtestCase050(){
Stringsql="select * from restful_test.t1, restful_test.t3 where t1.ts = t3.ts and t1.location = t3.location";
executeQuery(sql);
}
@Test
publicvoidtestCase051(){
Stringsql="select * from restful_test.t1 tt, restful_test.t3 yy where tt.ts = yy.ts";