提交 a1a2fa0b authored 作者: christian.peter.io's avatar christian.peter.io

A table in the Recover tool script could not be imported if the script contained duplicate keys.

上级 31bdce51
...@@ -35,6 +35,7 @@ Change Log ...@@ -35,6 +35,7 @@ Change Log
</li><li>When a domain (user defined data type) contained a user defined function, the database could not be opened. </li><li>When a domain (user defined data type) contained a user defined function, the database could not be opened.
</li><li>CAST('011' AS INT) will no longer use decode the value as an octal number (using Integer.decode) but now use Integer.parseInt. </li><li>CAST('011' AS INT) will no longer use decode the value as an octal number (using Integer.decode) but now use Integer.parseInt.
The same logic applied to byte, short, and long. This also means that trying to convert hex numbers (0x...) with CAST now fails. The same logic applied to byte, short, and long. This also means that trying to convert hex numbers (0x...) with CAST now fails.
</li><li>A table in the Recover tool script could not be imported if the script contained duplicate keys.
</li></ul> </li></ul>
<h2>Version 1.2.144 (2010-10-15)</h2> <h2>Version 1.2.144 (2010-10-15)</h2>
......
...@@ -1120,9 +1120,11 @@ public class Recover extends Tool implements DataHandler { ...@@ -1120,9 +1120,11 @@ public class Recover extends Tool implements DataHandler {
writer.println("---- Schema ----------"); writer.println("---- Schema ----------");
Collections.sort(schema); Collections.sort(schema);
for (MetaRecord m : schema) { for (MetaRecord m : schema) {
String sql = m.getSQL(); int t = m.getObjectType();
// create, but not referential integrity constraints and so on if (t != DbObject.INDEX && t != DbObject.CONSTRAINT) {
if (sql.startsWith("CREATE ")) { // create, but not referential integrity constraints and so on
// because they could fail on duplicate keys
String sql = m.getSQL();
writer.println(sql + ";"); writer.println(sql + ";");
} }
} }
...@@ -1168,9 +1170,10 @@ public class Recover extends Tool implements DataHandler { ...@@ -1168,9 +1170,10 @@ public class Recover extends Tool implements DataHandler {
writer.println("DELETE FROM INFORMATION_SCHEMA.LOBS WHERE TABLE = " + LobStorage.TABLE_TEMP + ";"); writer.println("DELETE FROM INFORMATION_SCHEMA.LOBS WHERE TABLE = " + LobStorage.TABLE_TEMP + ";");
} }
for (MetaRecord m : schema) { for (MetaRecord m : schema) {
String sql = m.getSQL(); int t = m.getObjectType();
// everything except create if (t == DbObject.INDEX || t == DbObject.CONSTRAINT) {
if (!sql.startsWith("CREATE ")) { // create indexes and constraints
String sql = m.getSQL();
writer.println(sql + ";"); writer.println(sql + ";");
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论