提交 f9b16e0d authored 作者: noelgrandin's avatar noelgrandin

Issue 487: support the MySQL "SET foreign_key_checks = 0" command

上级 28932210
...@@ -59,6 +59,7 @@ Change Log ...@@ -59,6 +59,7 @@ Change Log
Now they are hidden only if the database is not H2. Patch from "mgcodeact"/"cumer d" Now they are hidden only if the database is not H2. Patch from "mgcodeact"/"cumer d"
</li><li>MySQL compatibiltity, support the "AUTO_INCREMENT=3" part of the CREATE TABLE statement. </li><li>MySQL compatibiltity, support the "AUTO_INCREMENT=3" part of the CREATE TABLE statement.
</li><li>Issue 486: MySQL compatibiltity, support the "DEFAULT CHARSET" part of the CREATE TABLE statement. </li><li>Issue 486: MySQL compatibiltity, support the "DEFAULT CHARSET" part of the CREATE TABLE statement.
</li><li>Issue 487: support the MySQL "SET foreign_key_checks = 0" command
</li></ul> </li></ul>
<h2>Version 1.3.172 (2013-05-25)</h2> <h2>Version 1.3.172 (2013-05-25)</h2>
......
...@@ -4706,6 +4706,10 @@ public class Parser { ...@@ -4706,6 +4706,10 @@ public class Parser {
// HSQLDB compatibility // HSQLDB compatibility
currentToken = SetTypes.getTypeName(SetTypes.MAX_LOG_SIZE); currentToken = SetTypes.getTypeName(SetTypes.MAX_LOG_SIZE);
} }
if (isToken("FOREIGN_KEY_CHECKS")) {
// MySQL compatibility
currentToken = SetTypes.getTypeName(SetTypes.REFERENTIAL_INTEGRITY);
}
int type = SetTypes.getType(currentToken); int type = SetTypes.getType(currentToken);
if (type < 0) { if (type < 0) {
throw getSyntaxError(); throw getSyntaxError();
......
...@@ -267,6 +267,10 @@ public class TestCompatibility extends TestBase { ...@@ -267,6 +267,10 @@ public class TestCompatibility extends TestBase {
stat.execute("CREATE TABLE TEST_5(ID INT PRIMARY KEY) ENGINE=InnoDb auto_increment=3 default charset=UTF8"); stat.execute("CREATE TABLE TEST_5(ID INT PRIMARY KEY) ENGINE=InnoDb auto_increment=3 default charset=UTF8");
stat.execute("CREATE TABLE TEST_6(ID INT PRIMARY KEY) ENGINE=InnoDb auto_increment=3 charset=UTF8"); stat.execute("CREATE TABLE TEST_6(ID INT PRIMARY KEY) ENGINE=InnoDb auto_increment=3 charset=UTF8");
// this maps to SET REFERENTIAL_INTEGRITY TRUE/FALSE
stat.execute("SET foreign_key_checks = 0");
stat.execute("SET foreign_key_checks = 1");
// Check if mysql comments are supported, ensure clean connection // Check if mysql comments are supported, ensure clean connection
conn.close(); conn.close();
conn = getConnection("compatibility;MODE=MYSQL"); conn = getConnection("compatibility;MODE=MYSQL");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论