зеркало из https://github.com/mozilla/gecko-dev.git
Bug 734177 - Enable foreign keys support in sqlite (r=gpascutto)
This commit is contained in:
Родитель
4809b53eb4
Коммит
fc48d6b881
|
@ -554,13 +554,23 @@ public class BrowserProvider extends ContentProvider {
|
|||
public void onOpen(SQLiteDatabase db) {
|
||||
debug("Opening browser.db: " + db.getPath());
|
||||
|
||||
Cursor cursor = null;
|
||||
if (Build.VERSION.SDK_INT >= 8) {
|
||||
try {
|
||||
cursor = db.rawQuery("PRAGMA foreign_keys=ON", null);
|
||||
} finally {
|
||||
if (cursor != null)
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
// From Honeycomb on, it's possible to run several db
|
||||
// commands in parallel using multiple connections.
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
db.enableWriteAheadLogging();
|
||||
} else {
|
||||
// Pre-Honeycomb, we can do some lesser optimizations.
|
||||
Cursor cursor = null;
|
||||
cursor = null;
|
||||
try {
|
||||
cursor = db.rawQuery("PRAGMA synchronous=NORMAL", null);
|
||||
} finally {
|
||||
|
|
Загрузка…
Ссылка в новой задаче