So this happened when I tried to mark deleted entries to have a 'deleted' value of '1' instead of deleting it.
I added a column to a database in my app using ALTER TABLE "+TABLE_NAME+" ADD COLUMN "+NEW_COLUMN_NAME+" "+type+";"); and made other appropriate changes in the database provider (when insert 0 is inserted), however, something weird happened.
After adding it, the following things happen:
SELECT * FROM TABLE_NAME- Returns all rows (as expected)SELECT * FROM TABLE_NAME WHERE NEW_COLUMN_NAME=1returns rows with NEW_COLUMN_NAME=1 (as expected). However,SELECT * FROM TABLE_NAME WHERE NEW_COLUMN_NAME=0returns newly inserted rows (as expected).SELECT * FROM TABLE_NAME WHERE NEW_COLUMN_NAME!=1returns ONLY newly inserted rows (not the old rows)SELECT * FROM TABLE_NAME WHERE NEW_COLUMN_NAME=nullreturns nothing.
does Android not comply with http://www.sqlite.org/lang_expr.html or did I miss something?
ran in Android 2.2 emulator.
Thanks.