Closed
Bug 975841
Opened 12 years ago
Closed 12 years ago
crash in org.mozilla.gecko.sqlite.SQLiteBridgeException: Can''t prepare statement: no such column: filter at org.mozilla.gecko.sqlite.SQLiteBridge.sqliteCallWithDb(Native Method)
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(fennec30+)
RESOLVED
FIXED
Firefox 30
| Tracking | Status | |
|---|---|---|
| fennec | 30+ | --- |
People
(Reporter: aaronmt, Assigned: lucasr)
References
Details
(Keywords: crash)
Crash Data
Attachments
(1 file, 1 obsolete file)
|
4.86 KB,
patch
|
Margaret
:
review+
|
Details | Diff | Splinter Review |
This bug was filed from the Socorro interface and is
report bp-88342b4c-12c3-4368-8ff6-1a1282140222.
=============================================================
org.mozilla.gecko.sqlite.SQLiteBridgeException: Can't prepare statement: no such column: filter
at org.mozilla.gecko.sqlite.SQLiteBridge.sqliteCallWithDb(Native Method)
at org.mozilla.gecko.sqlite.SQLiteBridge.internalQuery(SQLiteBridge.java:235)
at org.mozilla.gecko.sqlite.SQLiteBridge.rawQuery(SQLiteBridge.java:128)
at org.mozilla.gecko.sqlite.SQLiteBridge.query$18cfc304(SQLiteBridge.java:118)
at org.mozilla.gecko.db.SQLiteBridgeContentProvider.query(SQLiteBridgeContentProvider.java:377)
at org.mozilla.gecko.db.HomeProvider.query(HomeProvider.java:83)
at android.content.ContentProvider.query(ContentProvider.java:756)
at android.content.ContentProvider$Transport.query(ContentProvider.java:211)
at android.content.ContentResolver.query(ContentResolver.java:428)
at android.content.ContentResolver.query(ContentResolver.java:371)
at org.mozilla.gecko.home.DynamicPanel$PanelDatasetLoader.loadCursor(DynamicPanel.java:237)
at org.mozilla.gecko.home.SimpleCursorLoader.loadInBackground(SimpleCursorLoader.java:49)
at org.mozilla.gecko.home.SimpleCursorLoader.loadInBackground(SimpleCursorLoader.java:31)
at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:240)
at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:51)
at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:40)
at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:123)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:849)
| Reporter | ||
Updated•12 years ago
|
Assignee: nobody → lucasr.at.mozilla
tracking-fennec: --- → ?
| Assignee | ||
Comment 1•12 years ago
|
||
We added a column to the table in 942295 without any schema migration (I just assumed it's fine to just break stuff for now). But maybe we should do a proper migration here for convenience in Nightly? Margaret, thoughts?
Flags: needinfo?(margaret.leibovic)
| Assignee | ||
Comment 2•12 years ago
|
||
| Assignee | ||
Comment 3•12 years ago
|
||
Comment on attachment 8380625 [details] [diff] [review]
Bootstrap schema upgrade path in HomeProvide.jsm
Here's an initial take on the schema migration path for HomeProvider.jsm.
Attachment #8380625 -
Flags: review?(margaret.leibovic)
Comment 4•12 years ago
|
||
Comment on attachment 8380625 [details] [diff] [review]
Bootstrap schema upgrade path in HomeProvide.jsm
Review of attachment 8380625 [details] [diff] [review]:
-----------------------------------------------------------------
This is looking good, I'm just a bit concerned about some of the promises logic.
I would also love to see a testcase for this added to testHomeProvider.js. As a basic test, we could manually create an old database, then test to make sure the schema version is changed after making a basic storage API call. To be more advanced, we could check to make sure the new schema has the columns we expect.
Also, as a more general comment, I didn't originally think we should support schema migrations on Nightly, but this blow-it-away-and-start-over approach is nice, and we can just keep doing this if the schema continues to change.
::: mobile/android/modules/HomeProvider.jsm
@@ +230,5 @@
> + // version is undefined.
> + if (dbVersion === 0) {
> + yield createDatabase(db);
> + } else if (dbVersion < SCHEMA_VERSION) {
> + yield upgradeDatabase(db, dbVersion, SCHEMA_VERSION);
These helper methods don't return promises, so I don't think it's correct to use yield here like this. Instead, we should be using yield where we actually make the db.execute calls, since it looks like we can end up with unresolved promises in there.
To make this less confusing, we could also have the helper methods themselves return new tasks.
Attachment #8380625 -
Flags: review?(margaret.leibovic) → feedback+
Updated•12 years ago
|
Flags: needinfo?(margaret.leibovic)
Updated•12 years ago
|
tracking-fennec: ? → 30+
| Assignee | ||
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
I wouldn't mind using this to test migrations, but we could drop it for initial release. No need to add a migration pre-release.
| Assignee | ||
Comment 8•12 years ago
|
||
(In reply to :Margaret Leibovic from comment #4)
> Comment on attachment 8380625 [details] [diff] [review]
> Bootstrap schema upgrade path in HomeProvide.jsm
>
> Review of attachment 8380625 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> This is looking good, I'm just a bit concerned about some of the promises
> logic.
>
> I would also love to see a testcase for this added to testHomeProvider.js.
> As a basic test, we could manually create an old database, then test to make
> sure the schema version is changed after making a basic storage API call. To
> be more advanced, we could check to make sure the new schema has the columns
> we expect.
I'd love to add tests for our migrations here (same for BrowserProvider stuff). But where would we place such database file in order to copy it to the expected location before the test runs? The test infrastructure side of things is usually the most painful ones unfortunately...
> Also, as a more general comment, I didn't originally think we should support
> schema migrations on Nightly, but this blow-it-away-and-start-over approach
> is nice, and we can just keep doing this if the schema continues to change.
Yeah, I think we should put this in the add-on API docs: your add-on should be able to re-fetch data as needed if HomeProvider gets cleared for some reason.
> ::: mobile/android/modules/HomeProvider.jsm
> @@ +230,5 @@
> > + // version is undefined.
> > + if (dbVersion === 0) {
> > + yield createDatabase(db);
> > + } else if (dbVersion < SCHEMA_VERSION) {
> > + yield upgradeDatabase(db, dbVersion, SCHEMA_VERSION);
>
> These helper methods don't return promises, so I don't think it's correct to
> use yield here like this. Instead, we should be using yield where we
> actually make the db.execute calls, since it looks like we can end up with
> unresolved promises in there.
>
> To make this less confusing, we could also have the helper methods
> themselves return new tasks.
I actually intended to do this (helper methods to return new tasks) originally but forgot to do so before submitting the patch :-)
| Assignee | ||
Comment 9•12 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #7)
> I wouldn't mind using this to test migrations, but we could drop it for
> initial release. No need to add a migration pre-release.
Yeah, the only reason I wrote this patch is because this is causing crashers for people who are testing add-ons. And re-installing Nightly can be a little annoying. And this code should be useful in the long-term to implement whatever actual migrations we end up needing to do.
| Assignee | ||
Updated•12 years ago
|
Attachment #8380625 -
Attachment is obsolete: true
| Assignee | ||
Updated•12 years ago
|
Attachment #8384674 -
Flags: review?(margaret.leibovic)
Comment 10•12 years ago
|
||
Comment on attachment 8384674 [details] [diff] [review]
Bootstrap schema upgrade path in HomeProvide.jsm
Review of attachment 8384674 [details] [diff] [review]:
-----------------------------------------------------------------
Great!
::: mobile/android/modules/HomeProvider.jsm
@@ +17,4 @@
> Cu.import("resource://gre/modules/XPCOMUtils.jsm");
>
> /*
> * XXX: Add migration logic to getDatabaseConnection if you ever rev SCHEMA_VERSION.
You can probably get rid of this, now that we're introducing a migration path.
@@ +19,5 @@
> /*
> * XXX: Add migration logic to getDatabaseConnection if you ever rev SCHEMA_VERSION.
> *
> * SCHEMA_VERSION history:
> * 1: Create HomeProvider (bug 942288)
You should add a note in here about why we created version 2 :)
Attachment #8384674 -
Flags: review?(margaret.leibovic) → review+
| Assignee | ||
Comment 11•12 years ago
|
||
(In reply to :Margaret Leibovic from comment #10)
> Comment on attachment 8384674 [details] [diff] [review]
> Bootstrap schema upgrade path in HomeProvide.jsm
>
> Review of attachment 8384674 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Great!
>
> ::: mobile/android/modules/HomeProvider.jsm
> @@ +17,4 @@
> > Cu.import("resource://gre/modules/XPCOMUtils.jsm");
> >
> > /*
> > * XXX: Add migration logic to getDatabaseConnection if you ever rev SCHEMA_VERSION.
>
> You can probably get rid of this, now that we're introducing a migration
> path.
Done.
> @@ +19,5 @@
> > /*
> > * XXX: Add migration logic to getDatabaseConnection if you ever rev SCHEMA_VERSION.
> > *
> > * SCHEMA_VERSION history:
> > * 1: Create HomeProvider (bug 942288)
>
> You should add a note in here about why we created version 2 :)
Done.
| Assignee | ||
Comment 12•12 years ago
|
||
Comment 13•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•