I am experiencing an incorrect rowid value with sqlite and fts3.
Basically, the first two rows are inserted and the rowId is 1 and 2
respectively. The third insert however returns 4 instead of 3.
I dropped the following log message in my contentprovider when
inserting a row:
SQLiteDatabase database =
databaseHelper.getWritableDatabase();
long rowId = database.insert(NOTES_TABLE, Note.NOTE, values);
Log.d("NoteProvider", "RowId inserted was " + rowId);
The output of that log message is:
02-21 21:10:12.773: DEBUG/NoteProvider(2486): RowId inserted was 1
02-21 21:10:20.623: DEBUG/NoteProvider(2486): RowId inserted was 2
02-21 21:10:25.883: DEBUG/NoteProvider(2486): RowId inserted was 4
So what happened to 3?
Also, I exported the sqlite database so I could look at in a SqLite
browser and the content table shows 1, 2 and 3.
So 3 was created but 4 was returned.
I ran my testing up to 10, and the rowId was sequential afterwards,
but still off by 1.
The database create script is:
database.execSQL("CREATE VIRTUAL TABLE " + NOTES_TABLE + "
USING fts3 ("
+ Note.TITLE + ", "
+ Note.NOTE + ", "
+ Note.CREATED_DATE + ", "
+ Note.MODIFIED_DATE + ");");
I am assuming I have done something horribly wrong, but cannot figure
out what it is.
Can anyone help me out?
** This is a repost of my question on stackoverflow.
http://stackoverflow.com/questions/5078788/incorrect-rowid-with-sqlite-using-fts3-on-android-2-2
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en