提交 49f0cff9 authored 作者: XEHA6284's avatar XEHA6284

fix indentation

上级 a3631c89
...@@ -217,7 +217,7 @@ public class Insert extends Prepared implements ResultTarget { ...@@ -217,7 +217,7 @@ public class Insert extends Prepared implements ResultTarget {
if (handleOnDuplicate(de, r)) { if (handleOnDuplicate(de, r)) {
// MySQL returns 2 for updated row // MySQL returns 2 for updated row
// TODO: detect no-op change // TODO: detect no-op change
rowNumber++; rowNumber++;
} else { } else {
// INSERT IGNORE case // INSERT IGNORE case
rowNumber--; rowNumber--;
...@@ -395,16 +395,19 @@ public class Insert extends Prepared implements ResultTarget { ...@@ -395,16 +395,19 @@ public class Insert extends Prepared implements ResultTarget {
ArrayList<String> variableNames = new ArrayList<>( ArrayList<String> variableNames = new ArrayList<>(
duplicateKeyAssignmentMap.size()); duplicateKeyAssignmentMap.size());
Expression[] row = (currentRow == null) ? list.get(getCurrentRowNumber() - 1) Expression[] row = (currentRow == null) ? list.get(getCurrentRowNumber() - 1)
: new Expression[columns.length]; : new Expression[columns.length];
for (int i = 0; i < columns.length; i++) { for (int i = 0; i < columns.length; i++) {
String key = table.getSchema().getName() + "." + String key = table.getSchema().getName() + "." +
table.getName() + "." + columns[i].getName(); table.getName() + "." + columns[i].getName();
variableNames.add(key); variableNames.add(key);
Value value;
if (currentRow != null) { if (currentRow != null) {
row[i] = ValueExpression.get(currentRow[i]); value = currentRow[i];
row[i] = ValueExpression.get(value);
} else {
value = row[i].getValue(session);
} }
session.setVariable(key, session.setVariable(key, value);
(currentRow == null) ? row[i].getValue(session) : currentRow[i]);
} }
StatementBuilder buff = new StatementBuilder("UPDATE "); StatementBuilder buff = new StatementBuilder("UPDATE ");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论