-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve #29 Support additional sqlite open flags
- Loading branch information
Showing
3 changed files
with
39 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6f2070b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@npurushe - this is a very late comment and I may be misunderstanding something, but as I work through upgrading AnkiDroid dependencies, I'm stumped taking requery/sqlite-android past 3.16 because this commit removes NO_LOCALIZED_COLLATORS, which is still present in the system implementation and is used by our project:
https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase#NO_LOCALIZED_COLLATORS
If I were to stop opening our database with this flag, would that imply that databases created prior to the change with the flag will potentially have different locale settings than are being used to query it? Is that inconsistency problematic or is it safe to remove the flag and carry on?
I saw no discussion anywhere with searching so I'm guessing it's not a problem but we have a huge installed base with lots of languages and versions...
Thanks!
Update:
I tried simply stripping the flag from the open call and on existing databases, I get this:
07-03 07:56:59.001 4420-4452/com.ichi2.anki I/CollectionHelper: openCollection: /storage/emulated/0/AnkiDroid/collection.anki2
07-03 07:56:59.024 4420-4452/com.ichi2.anki E/SQLiteLog: (21) misuse at line 142191 of [ada05cfa86]
07-03 07:56:59.025 4420-4452/com.ichi2.anki E/SQLiteDatabase: Failed to open database '/storage/emulated/0/AnkiDroid/collection.anki2'.
android.database.sqlite.SQLiteMisuseException: unknown error (code 21): Could not open database
I suppose I'm missing a generic way to inject underlying flags into the requery-level open database call and I'll research that...
6f2070b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikehardy Can you please open an issue with this information. Thanks!
6f2070b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing