Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] add test for check show create table sql #45002

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions regression-test/suites/check_before_quit/check_before_quit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,31 @@ suite("check_before_quit", "nonConcurrent,p0") {

Thread.sleep(2000)
}

// check create table sql
List<List<Object>> allDataBases = sql "show databases;"
logger.info("show all databases: ${allDataBases}")

def num = allDataBases.size()

for (int i = 0; i < allDataBases.size(); i++) {
def db = allDataBases[i][0]
if (db == "__internal_schema" || db == "information_schema" || db == "mysql") {
continue
}
List<List<Object>> allTables = sql "show tables from ${db}"
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}"
logger.info("create table sql info: ${createTableSql}")
sql "drop table if exists ${tbl}"
sql(createTableSql[0][1])
def createTableSqlResult = sql "show create table ${tbl}"
logger.info("create table sql result info: ${createTableSqlResult}")
assertEquals(createTableSqlResult, createTableSql)
}
}

assertTrue(clear)
}
Loading