From dee9b628aa7f21563b7215ea2d3a2626c9a0e4d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 20:18:14 +0800 Subject: [PATCH] branch-3.0: [Test](binlog) Check correctly for show create database #45472 (#45549) Cherry-picked from #45472 Co-authored-by: Uniqueyou --- regression-test/data/ddl_p0/test_recover.out | 216 ------------------ .../suites/ddl_p0/test_recover.groovy | 27 ++- 2 files changed, 18 insertions(+), 225 deletions(-) diff --git a/regression-test/data/ddl_p0/test_recover.out b/regression-test/data/ddl_p0/test_recover.out index 149c4c5459b5de..646ec068a0ea6b 100644 --- a/regression-test/data/ddl_p0/test_recover.out +++ b/regression-test/data/ddl_p0/test_recover.out @@ -27,33 +27,6 @@ test_recover_tb_new test_recover_tb test_recover_tb_new --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - -- !select -- test_recover_tb test_recover_tb_2 @@ -89,33 +62,6 @@ test_recover_tb_new test_recover_tb test_recover_tb_new --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - -- !select -- test_recover_tb test_recover_tb_2 @@ -151,33 +97,6 @@ test_recover_tb_new test_recover_tb test_recover_tb_new --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - -- !select -- test_recover_tb test_recover_tb_2 @@ -213,33 +132,6 @@ test_recover_tb_new test_recover_tb test_recover_tb_new --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - -- !select -- test_recover_tb test_recover_tb_2 @@ -275,33 +167,6 @@ test_recover_tb_new test_recover_tb test_recover_tb_new --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - -- !select -- test_recover_tb test_recover_tb_2 @@ -337,33 +202,6 @@ test_recover_tb_new test_recover_tb test_recover_tb_new --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - -- !select -- test_recover_tb test_recover_tb_2 @@ -399,33 +237,6 @@ test_recover_tb_new test_recover_tb test_recover_tb_new --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - -- !select -- test_recover_tb test_recover_tb_2 @@ -461,33 +272,6 @@ test_recover_tb_new test_recover_tb test_recover_tb_new --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - --- !select -- -test_recover_db CREATE DATABASE `test_recover_db` - --- !select -- -test_recover_db_new CREATE DATABASE `test_recover_db_new` - -- !select -- test_recover_tb test_recover_tb_2 diff --git a/regression-test/suites/ddl_p0/test_recover.groovy b/regression-test/suites/ddl_p0/test_recover.groovy index 4f17b0f644b0fb..a1c1b1917ae5d3 100644 --- a/regression-test/suites/ddl_p0/test_recover.groovy +++ b/regression-test/suites/ddl_p0/test_recover.groovy @@ -273,7 +273,8 @@ suite("test_recover") { // test drop/recover db - qt_select """ SHOW CREATE DATABASE `test_recover_db` """ + def showDatabase = sql """ SHOW CREATE DATABASE test_recover_db """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db`")) sql """ DROP DATABASE `test_recover_db` @@ -283,7 +284,8 @@ suite("test_recover") { RECOVER DATABASE `test_recover_db` """ - qt_select """ SHOW CREATE DATABASE `test_recover_db` """ + showDatabase = sql """ SHOW CREATE DATABASE test_recover_db """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db`")) sql """ CREATE TABLE `test_recover_db`.`test_recover_tb_1` ( @@ -312,7 +314,8 @@ suite("test_recover") { CREATE DATABASE `test_recover_db` """ - qt_select """ SHOW CREATE DATABASE `test_recover_db` """ + showDatabase = sql """ SHOW CREATE DATABASE `test_recover_db` """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db`")) sql """ DROP DATABASE `test_recover_db` @@ -321,7 +324,8 @@ suite("test_recover") { CREATE DATABASE `test_recover_db` """ - qt_select """ SHOW CREATE DATABASE `test_recover_db` """ + showDatabase = sql """ SHOW CREATE DATABASE `test_recover_db` """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db`")) sql """ DROP DATABASE `test_recover_db` @@ -331,7 +335,8 @@ suite("test_recover") { CREATE DATABASE `test_recover_db` """ - qt_select """ SHOW CREATE DATABASE `test_recover_db` """ + showDatabase = sql """ SHOW CREATE DATABASE `test_recover_db` """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db`")) sql """ CREATE TABLE `test_recover_db`.`test_recover_tb` ( @@ -359,7 +364,8 @@ suite("test_recover") { CREATE DATABASE `test_recover_db` """ - qt_select """ SHOW CREATE DATABASE `test_recover_db` """ + showDatabase = sql """ SHOW CREATE DATABASE `test_recover_db` """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db`")) sql """ DROP DATABASE `test_recover_db` @@ -369,7 +375,8 @@ suite("test_recover") { RECOVER DATABASE `test_recover_db` AS `test_recover_db_new` """ - qt_select """ SHOW CREATE DATABASE `test_recover_db_new` """ + showDatabase = sql """ SHOW CREATE DATABASE `test_recover_db_new` """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db_new`")) sql """ CREATE TABLE `test_recover_db_new`.`test_recover_tb_2` ( @@ -413,8 +420,10 @@ suite("test_recover") { ) """ - qt_select """ SHOW CREATE DATABASE `test_recover_db` """ - qt_select """ SHOW CREATE DATABASE `test_recover_db_new` """ + showDatabase = sql """ SHOW CREATE DATABASE `test_recover_db` """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db`")) + showDatabase = sql """ SHOW CREATE DATABASE `test_recover_db_new` """ + assertTrue(showDatabase[0][1].contains("CREATE DATABASE `test_recover_db_new`")) res = sql """SHOW CREATE TABLE `test_recover_db`.`test_recover_tb`""" assertTrue(res.size() != 0) qt_select """SHOW TABLES FROM `test_recover_db`"""