ptanov / sofia-public-transport-navigator

This Android application helps people in choosing the bus station on which to wait. In real time it gives information about the estimated time of arrival for the selected station.
11 stars 5 forks source link

Wrong sql query is generated for float values #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When locale converts float with commas instead of dots:
android.database.sqlite.SQLiteException: near ",": syntax error: , while 
compiling: SELECT _id, code, lat, lon, label FROM stations ORDER BY 
(ABS(lat-(42,649617))+ABS(lon-(23,341456))) ASC LIMIT 10
at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
at 
android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.
java:42)
at 
android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1
356)
at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)
at 
eu.tanov.android.sptn.providers.StationProvider.query(StationProvider.java:132)
at android.content.ContentProvider$Transport.query(ContentProvider.java:187)
at android.content.ContentResolver.query(ContentResolver.java:262)
at android.app.Activity.managedQuery(Activity.java:1550)
at 
eu.tanov.android.sptn.map.StationsOverlay$StationsQuery.createCursor(StationsOve
rlay.java:65)
at 
eu.tanov.android.sptn.map.StationsOverlay$BaseQuery.run(StationsOverlay.java:88)
at java.lang.Thread.run(Thread.java:1019)

Locale should be explicitly set in
StationsOverlay.StationsQuery.sortOrder()

Original issue reported on code.google.com by 1.Pla...@gmail.com on 9 Jan 2012 at 8:27

GoogleCodeExporter commented 9 years ago
Fixed locale when creating order by of query - US locale used instead of default

Original comment by 1.Pla...@gmail.com on 9 Jan 2012 at 8:50