提交 2d649ea2 authored 作者: noelgrandin@gmail.com's avatar noelgrandin@gmail.com

Fix "USE schema" command for MySQL compatibility, patch by mfulton

上级 0c05828b
......@@ -38,6 +38,7 @@ Change Log
</li><li>Fix bug which could generate deadlocks when multiple connections accessed the same table.
</li><li>Some places in the code were not respecting the value set in the "SET MAX_MEMORY_ROWS x" command
</li><li>Fix bug which could generate a NegativeArraySizeException when performing large (>40M) row union operations
</li><li>Fix "USE schema" command for MySQL compatibility, patch by mfulton
</li></ul>
<h2>Version 1.4.182 Beta (2014-10-17)</h2>
......
......@@ -5083,14 +5083,11 @@ public class Parser {
}
private Prepared parseUse() {
if (readIf("SCHEMA")) {
readIfEqualOrTo();
Set command = new Set(session, SetTypes.SCHEMA);
command.setString(readAliasIdentifier());
return command;
}
throw getSyntaxError();
}
private Set parseSetCollation() {
Set command = new Set(session, SetTypes.COLLATION);
......
......@@ -231,12 +231,10 @@ public class TestCompatibility extends TestBase {
private void testMySQL() throws SQLException {
Statement stat = conn.createStatement();
stat.execute("create schema test_schema");
stat.execute("use schema test_schema");
assertResult("TEST_SCHEMA", stat,
"select schema()");
stat.execute("use schema public");
assertResult("PUBLIC", stat,
"select schema()");
stat.execute("use test_schema");
assertResult("TEST_SCHEMA", stat, "select schema()");
stat.execute("use public");
assertResult("PUBLIC", stat, "select schema()");
stat.execute("SELECT 1");
stat.execute("DROP TABLE IF EXISTS TEST");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论