fjlopezs / mytracks

Automatically exported from code.google.com/p/mytracks
0 stars 0 forks source link

cupcake and donut get sql errors when they reuse sqlitequerybuilder #311

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Received an upgrade notice on phone that newer version of Mytracks was 
available, Installed the upgrade.
2.Launched application on phone and pressed the menu button and causes a force 
close error

What is the expected output? What do you see instead?
Sorry!
The application My Tracks (processcom.google.android.maps.mytracks) has stopped 
unexpectly. Please Try again. Force-Close

What version of MyTracks are you using? On what version of Android? On what
phone?
version: 1.1.0 Device model: Motorola_i1 Firmware version: 1.5 Kernel version: 
2.6.27

If possible please provide a log.  Either upload here or send to mytracks-
support@google.com.
Detailed instructions can be found here:
http://code.google.com/p/mytracks/wiki/HowToReportErrors

Please provide any additional information here:

Original issue reported on code.google.com by imacke...@gmail.com on 10 Feb 2011 at 5:32

Attachments:

GoogleCodeExporter commented 9 years ago
The error seems to be here:

02-10 11:58:19.553 I/MyTracks( 1249): Build query: SELECT * FROM tracks WHERE 
(_id=(select max(_id) from tracks)) ORDER BY _id
02-10 11:58:19.593 W/MyTracksLib( 1249): Caught an unexpected exception.
02-10 11:58:19.593 W/MyTracksLib( 1249): 
android.database.sqlite.SQLiteException: near ")": syntax error: , while 
compiling: SELECT * FROM tracks WHERE (_id=(select max(_id) from tracks))) AND 
(_id=(select max(_id) from tracks)) ORDER BY _id
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.database.sqlite.SQLiteProgram.native_compile(Native Method)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:59)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.
java:49)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1
118)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:312)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:262)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
com.google.android.apps.mytracks.content.MyTracksProvider.query(MyTracksProvider
.java:376)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.content.ContentProvider$Transport.query(ContentProvider.java:129)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.content.ContentResolver.query(ContentResolver.java:149)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
com.google.android.apps.mytracks.content.MyTracksProviderUtilsImpl.getLastTrack(
MyTracksProviderUtilsImpl.java:781)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
com.google.android.apps.mytracks.MyTracks.onPrepareOptionsMenu(MyTracks.java:389
)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
android.app.Activity.onPrepareOptionsMenu(Activity.java:2172)
02-10 11:58:19.593 W/MyTracksLib( 1249): at 
com.google.android.apps.mytracks.MyTracksMap.onPrepareOptionsMenu(MyTracksMap.ja
va:849)

Original comment by sandordo...@google.com on 10 Feb 2011 at 5:56

GoogleCodeExporter commented 9 years ago
Issue 310 has been merged into this issue.

Original comment by sandordo...@google.com on 10 Feb 2011 at 6:06

GoogleCodeExporter commented 9 years ago
I can duplicate this on Cupcake (1.5), but not on Donut.

Original comment by simmonmt@google.com on 10 Feb 2011 at 7:58

GoogleCodeExporter commented 9 years ago
Sorry simmonmt, but I not sure what your post means?

Original comment by imacke...@gmail.com on 10 Feb 2011 at 8:07

GoogleCodeExporter commented 9 years ago
This appears to be the root cause: 
http://code.google.com/p/android/issues/detail?can=2&q=1587&id=1587

We're apparently being punished for trying to code defensively, in that it's 
our attempt to dump the query to the log that's screwing up the query builder 
-- but only in cupcake.

Original comment by simmonmt@google.com on 10 Feb 2011 at 8:19

GoogleCodeExporter commented 9 years ago
Since I'm cupcake, I guess I'm waiting for a new release in order to get this 
resolved then?

Original comment by imacke...@gmail.com on 10 Feb 2011 at 8:26

GoogleCodeExporter commented 9 years ago
You could also, you know, wait for me to finish working on the bug.  It may 
well be that I have a workaround.

Original comment by simmonmt@google.com on 10 Feb 2011 at 8:29

GoogleCodeExporter commented 9 years ago
Sorry, newbie. I have full faith in you.

Original comment by imacke...@gmail.com on 10 Feb 2011 at 8:32

GoogleCodeExporter commented 9 years ago
There are actually two issues here.  The first is the reuse of the 
SQLiteQueryBuilder, which triggers Android bug 1587.  The second is the 
inability to find the icons for the main menu.  You can see that in the log 
after the SQL exception.  The icon problem is being tracked as issue 313.

Original comment by simmonmt@google.com on 10 Feb 2011 at 8:55

GoogleCodeExporter commented 9 years ago

Original comment by simmonmt@google.com on 10 Feb 2011 at 8:55

GoogleCodeExporter commented 9 years ago
A fix for this issue is in simmonmt-staging5

Original comment by simmonmt@google.com on 10 Feb 2011 at 9:01

GoogleCodeExporter commented 9 years ago

Original comment by simmonmt@google.com on 10 Feb 2011 at 9:34

GoogleCodeExporter commented 9 years ago
simmonmt, sorry for being a bother. I went to your simmonmt-statging5 and I 
don't see anything. You've created a fix, I'm at loss on how to get it applied 
to my phone.

Original comment by imacke...@gmail.com on 10 Feb 2011 at 10:07

GoogleCodeExporter commented 9 years ago
Thanks simmonmt, I think I figured it out. I installed mytracks_1.1.1.apk and 
everything seems to be working fine now

Original comment by imacke...@gmail.com on 11 Feb 2011 at 8:03

GoogleCodeExporter commented 9 years ago
I've fixed the SQL bug in 
http://code.google.com/r/bartn-mytracks/source/detail?r=cef9c121fa9524b6cd5b6826
679a18924cf93d76 and verified on G1 (1.6).

Original comment by ba...@google.com on 11 Feb 2011 at 8:10

GoogleCodeExporter commented 9 years ago
Fix works and verified on 1.5 and Motorola Dext

Many thanks

Alan

Original comment by alan.m.h...@gmail.com on 11 Feb 2011 at 9:38

GoogleCodeExporter commented 9 years ago
Bart, I don't understand what you've done here.

I fixed the SQL bug in 5fe4ec0213.  Then you undid my fix in ddf19ab694.
 Then you fixed it again in cef9c121fa.

Matt

Original comment by simmonmt@google.com on 11 Feb 2011 at 12:14

GoogleCodeExporter commented 9 years ago
Issue 309 has been merged into this issue.

Original comment by simmonmt@google.com on 15 Feb 2011 at 11:38