提交 6edfc680 authored 作者: noelgrandin's avatar noelgrandin

as per Thomas' suggestion, change syntax to use the more familiar…

as per Thomas' suggestion, change syntax to use the more familiar comma-separated list without brackets
上级 2358ead2
......@@ -147,10 +147,8 @@ SCRIPT [ SIMPLE ] [ NODATA ] [ NOPASSWORDS ] [ NOSETTINGS ]
[ TO fileNameString [ scriptCompression ]
[ CIPHER cipher PASSWORD string ] ]
[ CHARSET charsetString ]
[ TABLE tableName ]
[ TABLE ( tableName, ... ) ]
[ SCHEMA schemaName ]
[ SCHEMA ( schemaName, ... ) ]
[ TABLE tableName [, ...] ]
[ SCHEMA schemaName [, ...] ]
","
Creates a SQL script from the database.
......
......@@ -4692,27 +4692,16 @@ public class Parser {
boolean data = true, passwords = true, settings = true, dropTables = false, simple = false;
if (readIf("SCHEMA")) {
java.util.Set<String> schemaNames = new HashSet<String>();
if (readIf("(")) {
do {
schemaNames.add(readUniqueIdentifier());
} while (readIf(","));
read(")");
} else {
do {
schemaNames.add(readUniqueIdentifier());
}
} while (readIf(","));
command.setSchemaNames(schemaNames);
} else if (readIf("TABLE")) {
Collection<Table> tables = new ArrayList<Table>();
if (readIf("(")) {
do {
Table table = readTableOrView();
tables.add(table);
} while (readIf(","));
read(")");
} else {
do {
Table table = readTableOrView();
tables.add(table);
}
} while (readIf(","));
command.setTables(tables);
}
if (readIf("SIMPLE")) {
......
......@@ -93,7 +93,7 @@ public class TestRunscript extends TestBase implements Trigger {
}
rs.close();
stat.execute("create schema include_schema2");
stat.execute("script schema (include_schema1, include_schema2)");
stat.execute("script schema include_schema1, include_schema2");
rs = stat.getResultSet();
assertResultRowCount(3, rs); // User and one row pr schema = 3
rs.close();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论