I have this SQLite table in my Android application:
CREATE TABLE " + TABLE_NAME + " (" +
_ID + " INTEGER PRIMARY KEY AUTOINCREMENT" +
COMMA + COLUMN_NAME_SID + " INTEGER" +
COMMA + COLUMN_NAME_TITLE + " TEXT NOT NULL" +
COMMA + COLUMN_NAME_IS_MINE + " BOOLEAN NOT NULL" +
COMMA + COLUMN_NAME_CREATED_AT + " DATETIME" +
COMMA + COLUMN_NAME_CODE + " TEXT UNIQUE" +
COMMA + COLUMN_NAME_MSG + " INTEGER NOT NULL DEFAULT 0" +
" );";
When I update a record with the same data, the number of changed rows (rows affected) is always 1.
SQLiteDatabase db = m_helper.getWritableDatabase();
String where = COLUMN_NAME_SID + "=" + sid;
ContentValues values = new ContentValues();
values.put(COLUMN_NAME_MSG, msg);
int rowsAffected = db.update(TABLE_NAME, values, where, null);
db.close();
// rowsAffected is always 1!
In other DBMS (like Mysql), when I perform an update with the same data on a specific record, the number of changed rows is 0. In SQLite on Android is different?