提交 39c36dd2 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Remove some unused assignments

上级 b550c4b1
...@@ -735,10 +735,9 @@ public class Parser { ...@@ -735,10 +735,9 @@ public class Parser {
} }
private Column readTableColumn(TableFilter filter) { private Column readTableColumn(TableFilter filter) {
String tableAlias = null;
String columnName = readColumnIdentifier(); String columnName = readColumnIdentifier();
if (readIf(".")) { if (readIf(".")) {
tableAlias = columnName; String tableAlias = columnName;
columnName = readColumnIdentifier(); columnName = readColumnIdentifier();
if (readIf(".")) { if (readIf(".")) {
String schema = tableAlias; String schema = tableAlias;
...@@ -1969,9 +1968,8 @@ public class Parser { ...@@ -1969,9 +1968,8 @@ public class Parser {
} }
private Query parseSelect() { private Query parseSelect() {
Query command = null;
int paramIndex = parameters.size(); int paramIndex = parameters.size();
command = parseSelectUnion(); Query command = parseSelectUnion();
int size = parameters.size(); int size = parameters.size();
ArrayList<Parameter> params = new ArrayList<>(size); ArrayList<Parameter> params = new ArrayList<>(size);
for (int i = paramIndex; i < size; i++) { for (int i = paramIndex; i < size; i++) {
...@@ -2047,10 +2045,7 @@ public class Parser { ...@@ -2047,10 +2045,7 @@ public class Parser {
} }
ArrayList<SelectOrderBy> orderList = Utils.newSmallArrayList(); ArrayList<SelectOrderBy> orderList = Utils.newSmallArrayList();
do { do {
boolean canBeNumber = true; boolean canBeNumber = !readIf("=");
if (readIf("=")) {
canBeNumber = false;
}
SelectOrderBy order = new SelectOrderBy(); SelectOrderBy order = new SelectOrderBy();
Expression expr = readExpression(); Expression expr = readExpression();
if (canBeNumber && expr instanceof ValueExpression && if (canBeNumber && expr instanceof ValueExpression &&
...@@ -2164,7 +2159,7 @@ public class Parser { ...@@ -2164,7 +2159,7 @@ public class Parser {
return command; return command;
} }
if (readIf("WITH")) { if (readIf("WITH")) {
Query query = null; Query query;
try { try {
query = (Query) parseWith(); query = (Query) parseWith();
} catch (ClassCastException e) { } catch (ClassCastException e) {
...@@ -2696,7 +2691,7 @@ public class Parser { ...@@ -2696,7 +2691,7 @@ public class Parser {
} }
private JavaFunction readJavaFunction(Schema schema, String functionName, boolean throwIfNotFound) { private JavaFunction readJavaFunction(Schema schema, String functionName, boolean throwIfNotFound) {
FunctionAlias functionAlias = null; FunctionAlias functionAlias;
if (schema != null) { if (schema != null) {
functionAlias = schema.findFunction(functionName); functionAlias = schema.findFunction(functionName);
} else { } else {
...@@ -3765,12 +3760,11 @@ public class Parser { ...@@ -3765,12 +3760,11 @@ public class Parser {
return; return;
} }
case CHAR_DOLLAR_QUOTED_STRING: { case CHAR_DOLLAR_QUOTED_STRING: {
String result = null;
int begin = i - 1; int begin = i - 1;
while (types[i] == CHAR_DOLLAR_QUOTED_STRING) { while (types[i] == CHAR_DOLLAR_QUOTED_STRING) {
i++; i++;
} }
result = sqlCommand.substring(begin, i); String result = sqlCommand.substring(begin, i);
currentToken = "'"; currentToken = "'";
checkLiterals(true); checkLiterals(true);
currentValue = ValueString.get(StringUtils.cache(result), currentValue = ValueString.get(StringUtils.cache(result),
...@@ -5178,7 +5172,7 @@ public class Parser { ...@@ -5178,7 +5172,7 @@ public class Parser {
viewsCreated.add(parseSingleCommonTableExpression(isPersistent)); viewsCreated.add(parseSingleCommonTableExpression(isPersistent));
} while (readIf(",")); } while (readIf(","));
Prepared p = null; Prepared p;
// reverse the order of constructed CTE views - as the destruction order // reverse the order of constructed CTE views - as the destruction order
// (since later created view may depend on previously created views - // (since later created view may depend on previously created views -
// we preserve that dependency order in the destruction sequence ) // we preserve that dependency order in the destruction sequence )
...@@ -5226,7 +5220,6 @@ public class Parser { ...@@ -5226,7 +5220,6 @@ public class Parser {
private TableView parseSingleCommonTableExpression(boolean isPersistent) { private TableView parseSingleCommonTableExpression(boolean isPersistent) {
String cteViewName = readIdentifierWithSchema(); String cteViewName = readIdentifierWithSchema();
Schema schema = getSchema(); Schema schema = getSchema();
Table recursiveTable = null;
ArrayList<Column> columns = Utils.newSmallArrayList(); ArrayList<Column> columns = Utils.newSmallArrayList();
String[] cols = null; String[] cols = null;
...@@ -5241,7 +5234,7 @@ public class Parser { ...@@ -5241,7 +5234,7 @@ public class Parser {
} }
} }
Table oldViewFound = null; Table oldViewFound;
if (isPersistent) { if (isPersistent) {
oldViewFound = getSchema().findTableOrView(session, cteViewName); oldViewFound = getSchema().findTableOrView(session, cteViewName);
} else { } else {
...@@ -5273,7 +5266,7 @@ public class Parser { ...@@ -5273,7 +5266,7 @@ public class Parser {
* work (its removed after creation in this method). Only create table * work (its removed after creation in this method). Only create table
* data and table if we don't have a working CTE already. * data and table if we don't have a working CTE already.
*/ */
recursiveTable = TableView.createShadowTableForRecursiveTableExpression( Table recursiveTable = TableView.createShadowTableForRecursiveTableExpression(
isPersistent, session, cteViewName, schema, columns, database); isPersistent, session, cteViewName, schema, columns, database);
List<Column> columnTemplateList; List<Column> columnTemplateList;
String[] querySQLOutput = {null}; String[] querySQLOutput = {null};
...@@ -6171,7 +6164,7 @@ public class Parser { ...@@ -6171,7 +6164,7 @@ public class Parser {
// Oracle specifies (but will not require) an opening parenthesis // Oracle specifies (but will not require) an opening parenthesis
boolean hasOpeningBracket = readIf("("); boolean hasOpeningBracket = readIf("(");
String columnName = readColumnIdentifier(); String columnName = readColumnIdentifier();
AlterTableAlterColumn command = null; AlterTableAlterColumn command;
NullConstraintType nullConstraint = parseNotNullConstraint(); NullConstraintType nullConstraint = parseNotNullConstraint();
switch (nullConstraint) { switch (nullConstraint) {
case NULL_IS_ALLOWED: case NULL_IS_ALLOWED:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论