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