Fix SQL generated by updateWithOnConflict()
Before, SQLiteDatabase.updateWithOnConflict() method generated syntactically invalid SQL if the ConflictAlgorithm was non-null. For example, it would generate "UPDATE OR REPLACEshortcuts SET ...", when it should be "UPDATE OR REPLACE shortcuts SET ...". Fixes http://b/issue?id=1995470
This commit is contained in:
@@ -1412,8 +1412,9 @@ public class SQLiteDatabase extends SQLiteClosable {
|
||||
StringBuilder sql = new StringBuilder(120);
|
||||
sql.append("UPDATE ");
|
||||
if (algorithm != null) {
|
||||
sql.append(" OR ");
|
||||
sql.append("OR ");
|
||||
sql.append(algorithm.value());
|
||||
sql.append(" ");
|
||||
}
|
||||
|
||||
sql.append(table);
|
||||
|
||||
Reference in New Issue
Block a user