Skip to content

Commit

Permalink
branch-3.0: [Test](binlog) Check correctly for show create database #…
Browse files Browse the repository at this point in the history
…45472 (#45549)

Cherry-picked from #45472

Co-authored-by: Uniqueyou <[email protected]>
  • Loading branch information
github-actions[bot] and wyxxxcat authored Dec 23, 2024
1 parent 0205a8b commit dee9b62
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 225 deletions.
216 changes: 0 additions & 216 deletions regression-test/data/ddl_p0/test_recover.out
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
27 changes: 18 additions & 9 deletions regression-test/suites/ddl_p0/test_recover.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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` (
Expand Down Expand Up @@ -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`
Expand All @@ -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`
Expand All @@ -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` (
Expand Down Expand Up @@ -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`
Expand All @@ -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` (
Expand Down Expand Up @@ -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`"""
Expand Down

0 comments on commit dee9b62

Please sign in to comment.