final Object[] rowCompleted = completeRow(row, currentRow);
if (newRowId == currentRowId && Arrays.equals(rowCompleted, currentRow))
return;
final ISqlJetMemoryPointer pData;
final SqlJetEncoding encoding = btree.getDb().getOptions().getEncoding();
if (!tableDef.isRowIdPrimaryKey()) {
pData = SqlJetBtreeRecord.getRecord(encoding, rowCompleted).getRawRecord();
} else {
final int primaryKeyColumnNumber = tableDef.getColumnNumber(tableDef.getRowIdPrimaryKeyColumnName());
if (primaryKeyColumnNumber == -1 || primaryKeyColumnNumber >= rowCompleted.length)
throw new SqlJetException(SqlJetErrorCode.ERROR);
rowCompleted[primaryKeyColumnNumber] = null;
pData = SqlJetBtreeRecord.getRecord(encoding, rowCompleted).getRawRecord();
rowCompleted[primaryKeyColumnNumber] = newRowId;
}
if (doActionWithIndexes(Action.UPDATE, onConflict, newRowId, rowCompleted)) {
final boolean changeRowId = newRowId != currentRowId;
if (changeRowId) {
getCursor().delete();
}
getCursor().insert(null, newRowId, pData, pData.remaining(), 0, changeRowId);
goToRow(newRowId);
}
}