提交 7f4fa88a authored 作者: tledkov-gridgain's avatar tledkov-gridgain

#1405 Introduce LocalResult factory: fix review issues

上级 9b1c4408
...@@ -72,7 +72,7 @@ public class Explain extends Prepared { ...@@ -72,7 +72,7 @@ public class Explain extends Prepared {
Database db = session.getDatabase(); Database db = session.getDatabase();
ExpressionColumn expr = new ExpressionColumn(db, column); ExpressionColumn expr = new ExpressionColumn(db, column);
Expression[] expressions = { expr }; Expression[] expressions = { expr };
result = session.getDatabase().getResultFactory().create(session, expressions, 1); result = db.getResultFactory().create(session, expressions, 1);
if (maxrows >= 0) { if (maxrows >= 0) {
String plan; String plan;
if (executeCommand) { if (executeCommand) {
......
...@@ -128,7 +128,7 @@ public final class GeneratedKeys { ...@@ -128,7 +128,7 @@ public final class GeneratedKeys {
Database db = session.getDatabase(); Database db = session.getDatabase();
if (Boolean.FALSE.equals(generatedKeysRequest)) { if (Boolean.FALSE.equals(generatedKeysRequest)) {
clear(null); clear(null);
return session.getDatabase().getResultFactory().create(); return db.getResultFactory().create();
} }
ArrayList<ExpressionColumn> expressionColumns; ArrayList<ExpressionColumn> expressionColumns;
if (Boolean.TRUE.equals(generatedKeysRequest)) { if (Boolean.TRUE.equals(generatedKeysRequest)) {
...@@ -152,7 +152,7 @@ public final class GeneratedKeys { ...@@ -152,7 +152,7 @@ public final class GeneratedKeys {
} }
} else { } else {
clear(null); clear(null);
return session.getDatabase().getResultFactory().create(); return db.getResultFactory().create();
} }
} else if (generatedKeysRequest instanceof String[]) { } else if (generatedKeysRequest instanceof String[]) {
if (table != null) { if (table != null) {
...@@ -182,16 +182,16 @@ public final class GeneratedKeys { ...@@ -182,16 +182,16 @@ public final class GeneratedKeys {
} }
} else { } else {
clear(null); clear(null);
return session.getDatabase().getResultFactory().create(); return db.getResultFactory().create();
} }
} else { } else {
clear(null); clear(null);
return session.getDatabase().getResultFactory().create(); return db.getResultFactory().create();
} }
int columnCount = expressionColumns.size(); int columnCount = expressionColumns.size();
if (columnCount == 0) { if (columnCount == 0) {
clear(null); clear(null);
return session.getDatabase().getResultFactory().create(); return db.getResultFactory().create();
} }
LocalResult result = session.getDatabase().getResultFactory().create(session, LocalResult result = session.getDatabase().getResultFactory().create(session,
expressionColumns.toArray(new Expression[0]), columnCount); expressionColumns.toArray(new Expression[0]), columnCount);
......
...@@ -86,7 +86,7 @@ public class TableFunction extends Function { ...@@ -86,7 +86,7 @@ public class TableFunction extends Function {
ExpressionColumn col = new ExpressionColumn(db, c); ExpressionColumn col = new ExpressionColumn(db, c);
header[i] = col; header[i] = col;
} }
LocalResult result = session.getDatabase().getResultFactory().create(session, header, len); LocalResult result = db.getResultFactory().create(session, header, len);
if (distinctRows) { if (distinctRows) {
result.setDistinct(); result.setDistinct();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论