You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by w4...@apache.org on 2024/07/15 11:10:49 UTC
(doris) 02/02: [chore](cases) Add the db name of the restored view checking case
This is an automated email from the ASF dual-hosted git repository.
w41ter pushed a commit to branch fix_show_restored_view
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 60c1984319dcfcabc4fafd574c17821011db484d
Author: w41ter <w4...@gmail.com>
AuthorDate: Mon Jul 15 11:09:49 2024 +0000
[chore](cases) Add the db name of the restored view checking case
---
...groovy => test_backup_restore_with_view.groovy} | 24 ++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/regression-test/suites/backup_restore/test_backup_restore_with.groovy b/regression-test/suites/backup_restore/test_backup_restore_with_view.groovy
similarity index 74%
rename from regression-test/suites/backup_restore/test_backup_restore_with.groovy
rename to regression-test/suites/backup_restore/test_backup_restore_with_view.groovy
index cacb9df6de5..f8d1cf0ac24 100644
--- a/regression-test/suites/backup_restore/test_backup_restore_with.groovy
+++ b/regression-test/suites/backup_restore/test_backup_restore_with_view.groovy
@@ -18,6 +18,7 @@
suite("test_backup_restore_with_view", "backup_restore") {
String suiteName = "backup_restore_with_view"
String dbName = "${suiteName}_db"
+ String dbName1 = "${suiteName}_db_1"
String repoName = "${suiteName}_repo"
String snapshotName = "${suiteName}_snapshot"
String tableName = "${suiteName}_table"
@@ -26,6 +27,7 @@ suite("test_backup_restore_with_view", "backup_restore") {
def syncer = getSyncer()
syncer.createS3Repository(repoName)
sql "CREATE DATABASE IF NOT EXISTS ${dbName}"
+ sql "CREATE DATABASE IF NOT EXISTS ${dbName1}"
int numRows = 10;
sql "DROP TABLE IF EXISTS ${dbName}.${tableName} FORCE"
@@ -66,11 +68,11 @@ suite("test_backup_restore_with_view", "backup_restore") {
def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
assertTrue(snapshot != null)
- sql "DROP TABLE ${dbName}.${tableName} FORCE"
- sql "DROP VIEW ${dbName}.${viewName}"
+ sql "DROP TABLE IF EXISTS ${dbName1}.${tableName} FORCE"
+ sql "DROP VIEW IF EXISTS ${dbName1}.${viewName}"
sql """
- RESTORE SNAPSHOT ${dbName}.${snapshotName}
+ RESTORE SNAPSHOT ${dbName1}.${snapshotName}
FROM `${repoName}`
PROPERTIES
(
@@ -79,14 +81,24 @@ suite("test_backup_restore_with_view", "backup_restore") {
)
"""
- syncer.waitAllRestoreFinish(dbName)
+ syncer.waitAllRestoreFinish(dbName1)
+
+ qt_sql "SELECT * FROM ${dbName1}.${tableName} ORDER BY id ASC"
+ qt_sql "SELECT * FROM ${dbName1}.${viewName} ORDER BY id ASC"
+ def show_view_result = sql_return_maparray "SHOW VIEW FROM ${tableName} FROM ${dbName1}"
+ logger.info("show view result: ${show_view_result}")
+ assertTrue(show_view_result.length == 1);
+ def show_view = show_view_result[0]['Create View']
+ assertTrue(show_view.contains("${dbName1}"))
+ assertTrue(show_view.contains("${tableName}"))
- qt_sql "SELECT * FROM ${dbName}.${tableName} ORDER BY id ASC"
- qt_sql "SELECT * FROM ${dbName}.${viewName} ORDER BY id ASC"
sql "DROP TABLE ${dbName}.${tableName} FORCE"
sql "DROP VIEW ${dbName}.${viewName}"
sql "DROP DATABASE ${dbName} FORCE"
+ sql "DROP TABLE ${dbName1}.${tableName} FORCE"
+ sql "DROP VIEW ${dbName1}.${viewName}"
+ sql "DROP DATABASE ${dbName1} FORCE"
sql "DROP REPOSITORY `${repoName}`"
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org