提交 30327315 authored 作者: Thomas Mueller's avatar Thomas Mueller

Temporary linked tables are now supported.

上级 d76b3a99
...@@ -3325,20 +3325,29 @@ public class Parser { ...@@ -3325,20 +3325,29 @@ public class Parser {
boolean force = readIf("FORCE"); boolean force = readIf("FORCE");
if (readIf("LOCAL")) { if (readIf("LOCAL")) {
read("TEMPORARY"); read("TEMPORARY");
if (readIf("LINKED")) {
return parseCreateLinkedTable(true, false, force);
}
read("TABLE"); read("TABLE");
return parseCreateTable(true, false, false); return parseCreateTable(true, false, false);
} else if (readIf("GLOBAL")) { } else if (readIf("GLOBAL")) {
read("TEMPORARY"); read("TEMPORARY");
if (readIf("LINKED")) {
return parseCreateLinkedTable(true, true, force);
}
read("TABLE"); read("TABLE");
return parseCreateTable(true, true, false); return parseCreateTable(true, true, false);
} else if (readIf("TEMP") || readIf("TEMPORARY")) { } else if (readIf("TEMP") || readIf("TEMPORARY")) {
if (readIf("LINKED")) {
return parseCreateLinkedTable(true, true, force);
}
read("TABLE"); read("TABLE");
return parseCreateTable(true, true, false); return parseCreateTable(true, true, false);
} else if (readIf("MEMORY")) { } else if (readIf("MEMORY")) {
read("TABLE"); read("TABLE");
return parseCreateTable(false, false, false); return parseCreateTable(false, false, false);
} else if (readIf("LINKED")) { } else if (readIf("LINKED")) {
return parseCreateLinkedTable(force); return parseCreateLinkedTable(false, false, force);
} else if (readIf("CACHED")) { } else if (readIf("CACHED")) {
read("TABLE"); read("TABLE");
return parseCreateTable(false, false, true); return parseCreateTable(false, false, true);
...@@ -4431,11 +4440,13 @@ public class Parser { ...@@ -4431,11 +4440,13 @@ public class Parser {
} }
} }
private CreateLinkedTable parseCreateLinkedTable(boolean force) throws SQLException { private CreateLinkedTable parseCreateLinkedTable(boolean temp, boolean globalTemp, boolean force) throws SQLException {
read("TABLE"); read("TABLE");
boolean ifNotExists = readIfNoExists(); boolean ifNotExists = readIfNoExists();
String tableName = readIdentifierWithSchema(); String tableName = readIdentifierWithSchema();
CreateLinkedTable command = new CreateLinkedTable(session, getSchema()); CreateLinkedTable command = new CreateLinkedTable(session, getSchema());
command.setTemporary(temp);
command.setGlobalTemporary(globalTemp);
command.setForce(force); command.setForce(force);
command.setIfNotExists(ifNotExists); command.setIfNotExists(ifNotExists);
command.setTableName(tableName); command.setTableName(tableName);
...@@ -4454,6 +4465,8 @@ public class Parser { ...@@ -4454,6 +4465,8 @@ public class Parser {
if (readIf("EMIT")) { if (readIf("EMIT")) {
read("UPDATES"); read("UPDATES");
command.setEmitUpdates(true); command.setEmitUpdates(true);
} else if (readIf("READONLY")) {
command.setReadOnly(true);
} }
return command; return command;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论