Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zrlw authored and lizongbo committed Dec 18, 2023
1 parent ccc90d0 commit cac5726
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void test_0() throws Exception {


public void test_14() throws Exception {
exec_test("bvt/parser/mysql-16.txt");
exec_test("bvt/parser/mysql-14.txt");
}

public void test_16() throws Exception {
Expand Down
28 changes: 25 additions & 3 deletions core/src/test/resources/bvt/parser/mysql-14.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@ WHERE collect_date >= '2012-04-08'
AND pageId= 'SOURCING_HOME'
GROUP BY pageId
---------------------------
SELECT 'Monty!' REGEXP '.*'
---------------------------
SELECT ? REGEXP ?
INSERT INTO m_browser_common_base_aggr (gmt_create, gmt_modify, collect_date_str, page_id, geo_type
, geo_value, count_load_time, min_load_time, max_load_time, avg_load_time)
SELECT Now() AS gmt_create, Now() AS gmt_modify, '2012-04-08' AS collect_date_str, pageId AS page_id, 'all_country' AS geo_type
, '(ALLCOUNTRIES)' AS geo_value
, Count(IF(loadTime IS NULL
OR loadTime < 0
OR loadTime >= 30000, NULL, loadTime)) AS count_load_time
, Min(IF(loadTime IS NULL
OR loadTime < 0
OR loadTime >= 30000, NULL, loadTime)) AS min_load_time
, Max(IF(loadTime IS NULL
OR loadTime < 0
OR loadTime >= 30000, NULL, loadTime)) AS max_load_time
, Sum(IF(loadTime IS NULL
OR loadTime < 0
OR loadTime >= 30000, NULL, loadTime)) / Count(IF(loadTime IS NULL
OR loadTime < 0
OR loadTime >= 30000, NULL, loadTime)) AS avg_load_time
FROM m_browser_common
WHERE collect_date >= '2012-04-08'
AND collect_date < '2012-04-09'
AND pageId IS NOT NULL
AND country_code IS NOT NULL
AND pageId = 'SOURCING_HOME'
GROUP BY pageId
2 changes: 1 addition & 1 deletion core/src/test/resources/bvt/parser/mysql-16.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `druidtestdb` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;
---------------------------
CREATE DATABASE IF NOT EXISTS `druidtestdb`;
CREATE DATABASE IF NOT EXISTS `druidtestdb` CHARACTER SET utf8 COLLATE utf8_bin;

0 comments on commit cac5726

Please sign in to comment.