Merge lp:~aauzi/midori/fix-1197518 into lp:midori

Proposed by André Auzi
Status: Merged
Approved by: Cris Dywan
Approved revision: 6245
Merged at revision: 6249
Proposed branch: lp:~aauzi/midori/fix-1197518
Merge into: lp:midori
Diff against target: 20 lines (+10/-0)
1 file modified
midori/midori-bookmarks.c (+10/-0)
To merge this branch: bzr merge lp:~aauzi/midori/fix-1197518
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+172885@code.launchpad.net

Commit message

Set FOREIGN_KEYS pragma on db initialization

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

As per me understanding, without this pragma foreign keys may be skipped depending on the sqlite3 build and the pragma also enables stricter error handling.

So this seems the right thing to do.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-bookmarks.c'
2--- midori/midori-bookmarks.c 2013-06-13 16:53:19 +0000
3+++ midori/midori-bookmarks.c 2013-07-03 19:48:25 +0000
4@@ -250,6 +250,16 @@
5
6 if (newfile_did_exist)
7 {
8+ const gchar* setup_stmt = "PRAGMA foreign_keys = ON;";
9+ /* initial setup */
10+ if (sqlite3_exec (db, setup_stmt, NULL, NULL, &sql_errmsg) != SQLITE_OK)
11+ {
12+ *errmsg = g_strdup_printf (_("Couldn't setup bookmarks: %s\n"),
13+ sql_errmsg ? sql_errmsg : "(err = NULL)");
14+ sqlite3_free (sql_errmsg);
15+ goto init_failed;
16+ }
17+
18 /* we are done */
19 goto init_success;
20 }

Subscribers

People subscribed via source and target branches

to all changes: