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:
Bjorn Bringert
2009-07-22 12:49:17 +01:00
parent 9fc20b0e38
commit 7f4c2ea378

View File

@@ -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);