Skip to content

Commit

Permalink
add mtmv case (selectdb#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsy3993 authored May 23, 2024
1 parent 794fd66 commit 8b0c839
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions regression-test/suites/db-sync/test_db_sync.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,17 @@ suite("test_db_sync") {
"""
}

logger.info("=== Test : mtmv create ===")
sql "CREATE MATERIALIZED VIEW mv1
BUILD IMMEDIATE REFRESH AUTO ON SCHEDULE EVERY 1 hour
DISTRIBUTED BY RANDOM BUCKETS 3
PROPERTIES ('replication_num' = '1')
AS
SELECT t1.test, t2.last
FROM (SELECT * FROM ${tableUnique0} where id > 1) t1
LEFT OUTER JOIN ${tableAggregate0} as t2
ON t1.test = t2.test"

sql "ALTER DATABASE ${context.dbName} SET properties (\"binlog.enable\" = \"true\")"

String response
Expand Down Expand Up @@ -300,6 +311,9 @@ suite("test_db_sync") {
assertTrue(checkShowTimesOf("SHOW TABLES LIKE '${keywordTableName}'",
notExist, 30, "target"))

logger.info("=== Test : query mtmv case ===")
assertTrue(checkSelectTimesOf("SELECT * FROM mv1", 3, 45))

logger.info("=== Test 4: pause and resume ===")
httpTest {
uri "/pause"
Expand Down

0 comments on commit 8b0c839

Please sign in to comment.