Unverified 提交 b4d4c796 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #904 from katzyn/join

Remove unused parameters from readJoin() and readTableFilter()
...@@ -1348,7 +1348,7 @@ public class Parser { ...@@ -1348,7 +1348,7 @@ public class Parser {
return command; return command;
} }
private TableFilter readTableFilter(boolean fromOuter) { private TableFilter readTableFilter() {
Table table; Table table;
String alias = null; String alias = null;
if (readIf("(")) { if (readIf("(")) {
...@@ -1368,8 +1368,8 @@ public class Parser { ...@@ -1368,8 +1368,8 @@ public class Parser {
query, currentSelect); query, currentSelect);
} else { } else {
TableFilter top; TableFilter top;
top = readTableFilter(false); top = readTableFilter();
top = readJoin(top, currentSelect, false, false); top = readJoin(top, false);
top = getNested(top); top = getNested(top);
read(")"); read(")");
alias = readFromAlias(null); alias = readFromAlias(null);
...@@ -1717,8 +1717,7 @@ public class Parser { ...@@ -1717,8 +1717,7 @@ public class Parser {
return command; return command;
} }
private TableFilter readJoin(TableFilter top, Select command, private TableFilter readJoin(TableFilter top, boolean nested) {
boolean nested, boolean fromOuter) {
boolean joined = false; boolean joined = false;
TableFilter last = top; TableFilter last = top;
while (true) { while (true) {
...@@ -1727,8 +1726,8 @@ public class Parser { ...@@ -1727,8 +1726,8 @@ public class Parser {
readIf("OUTER"); readIf("OUTER");
read("JOIN"); read("JOIN");
// the right hand side is the 'inner' table usually // the right hand side is the 'inner' table usually
join = readTableFilter(fromOuter); join = readTableFilter();
join = readJoin(join, command, nested, true); join = readJoin(join, nested);
Expression on = null; Expression on = null;
if (readIf("ON")) { if (readIf("ON")) {
on = readExpression(); on = readExpression();
...@@ -1739,8 +1738,8 @@ public class Parser { ...@@ -1739,8 +1738,8 @@ public class Parser {
} else if (readIf("LEFT")) { } else if (readIf("LEFT")) {
readIf("OUTER"); readIf("OUTER");
read("JOIN"); read("JOIN");
join = readTableFilter(true); join = readTableFilter();
join = readJoin(join, command, true, true); join = readJoin(join, true);
Expression on = null; Expression on = null;
if (readIf("ON")) { if (readIf("ON")) {
on = readExpression(); on = readExpression();
...@@ -1750,16 +1749,16 @@ public class Parser { ...@@ -1750,16 +1749,16 @@ public class Parser {
throw getSyntaxError(); throw getSyntaxError();
} else if (readIf("INNER")) { } else if (readIf("INNER")) {
read("JOIN"); read("JOIN");
join = readTableFilter(fromOuter); join = readTableFilter();
top = readJoin(top, command, false, false); top = readJoin(top, false);
Expression on = null; Expression on = null;
if (readIf("ON")) { if (readIf("ON")) {
on = readExpression(); on = readExpression();
} }
top.addJoin(join, false, false, on); top.addJoin(join, false, false, on);
} else if (readIf("JOIN")) { } else if (readIf("JOIN")) {
join = readTableFilter(fromOuter); join = readTableFilter();
top = readJoin(top, command, false, false); top = readJoin(top, false);
Expression on = null; Expression on = null;
if (readIf("ON")) { if (readIf("ON")) {
on = readExpression(); on = readExpression();
...@@ -1767,11 +1766,11 @@ public class Parser { ...@@ -1767,11 +1766,11 @@ public class Parser {
top.addJoin(join, false, false, on); top.addJoin(join, false, false, on);
} else if (readIf("CROSS")) { } else if (readIf("CROSS")) {
read("JOIN"); read("JOIN");
join = readTableFilter(fromOuter); join = readTableFilter();
top.addJoin(join, false, false, null); top.addJoin(join, false, false, null);
} else if (readIf("NATURAL")) { } else if (readIf("NATURAL")) {
read("JOIN"); read("JOIN");
join = readTableFilter(fromOuter); join = readTableFilter();
Column[] tableCols = last.getTable().getColumns(); Column[] tableCols = last.getTable().getColumns();
Column[] joinCols = join.getTable().getColumns(); Column[] joinCols = join.getTable().getColumns();
String tableSchema = last.getTable().getSchema().getName(); String tableSchema = last.getTable().getSchema().getName();
...@@ -2105,7 +2104,7 @@ public class Parser { ...@@ -2105,7 +2104,7 @@ public class Parser {
private void parseSelectSimpleFromPart(Select command) { private void parseSelectSimpleFromPart(Select command) {
do { do {
TableFilter filter = readTableFilter(false); TableFilter filter = readTableFilter();
parseJoinTableFilter(filter, command); parseJoinTableFilter(filter, command);
} while (readIf(",")); } while (readIf(","));
...@@ -2150,7 +2149,7 @@ public class Parser { ...@@ -2150,7 +2149,7 @@ public class Parser {
} }
private void parseJoinTableFilter(TableFilter top, final Select command) { private void parseJoinTableFilter(TableFilter top, final Select command) {
top = readJoin(top, command, false, top.isJoinOuter()); top = readJoin(top, false);
command.addTableFilter(top, true); command.addTableFilter(top, true);
boolean isOuter = false; boolean isOuter = false;
while (true) { while (true) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论