[Fix](ut)(show) added UT cases for show backup stmt (#28604)

* Added UT for show backup
 * fixed some toSql() space and missing CLAUSE
 * Updated Doc with relevant syntax
This commit is contained in:
Nitin-Kashyap
2023-12-31 14:49:57 +07:00
committed by GitHub
parent 4634c723d7
commit 6c74313f60
4 changed files with 178 additions and 26 deletions

View File

@ -136,13 +136,13 @@ public class ShowBackupStmt extends ShowStmt {
@Override
public String toSql() {
StringBuilder builder = new StringBuilder();
builder.append("SHOW BACKUP");
if (dbName != null) {
builder.append(" FROM `").append(dbName).append("` ");
builder.append("SHOW BACKUP ");
if (Strings.isNullOrEmpty(dbName)) {
builder.append("FROM `").append(dbName).append("` ");
}
if (where != null) {
builder.append(where.toSql());
builder.append("WHERE ").append(where.toSql());
}
return builder.toString();