From 4f68b81ba72c44a1050a7176a9044c6da892c23c Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Sun, 12 Jan 2025 16:18:09 +0800 Subject: [PATCH] [Test](check) add check for materialized view (#46713) --- .../check_before_quit/check_before_quit.groovy | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/regression-test/suites/check_before_quit/check_before_quit.groovy b/regression-test/suites/check_before_quit/check_before_quit.groovy index 995c81f057917d..ad35ce3db7106b 100644 --- a/regression-test/suites/check_before_quit/check_before_quit.groovy +++ b/regression-test/suites/check_before_quit/check_before_quit.groovy @@ -253,10 +253,21 @@ suite("check_before_quit", "nonConcurrent,p0") { logger.info("show all tabkes: ${allTables}") for (int j = 0;j < allTables.size();j ++) { def tbl = allTables[j][0] - def createTableSql = sql "show create table ${db}.${tbl}" + def createTableSql = "" + try { + createTableSql = sql "show create table ${db}.${tbl}" + logger.info("create table sql: ${createTableSql}") + } catch (Exception e) { + if (e.getMessage().contains("not support async materialized view")) { + createTableSql = sql "show create materialized view ${tbl}" + logger.info("create materialized view sql: ${createTableSql}") + } + } if (createTableSql[0][1].contains("CREATE VIEW")) { sql "drop view if exists ${tbl}" - }else { + } else if (createTableSql[0][1].contains("CREATE MATERIALIZED VIEW")) { + sql "drop materialized view if exists ${tbl}" + } else { sql "drop table if exists ${tbl}" } sql(createTableSql[0][1])