Open wojciechsura opened 1 year ago
LIMIT
should appear before OFFSET
, ie:
SELECT * FROM `Operations` WHERE (`ForeignUser` IS NULL AND `Id` >= 0) ORDER BY `Id` LIMIT 1 OFFSET 0
@j256 this is strange, ehh?
Huh. The code definitively appends the limit before the offset:
Seems like it has been this way for a long time too – at least 4 years. Hey @wojciechsura , can we get the entire exception?
Wait. I see a possible problem. The SqliteDatabaseType
in JDBC has the limit being LIMIT offset-number, limit-number
. I wonder if this code should be in the BaseSqliteDatabaseType
.
I can't figure out if Android supports OFFSET
keyword or the LIMIT o,l
format. Or both. Regardless I don't understand how OFFSET
got ahead of LIMIT
. Maybe something is translating the query somehow?
I have the following code:
Running this code on Android 30 yields the following exception:
SELECT * FROM
OperationsWHERE (
ForeignUserIS NULL AND
Id>= 0) ORDER BY
IdOFFSET 0 LIMIT 1
However, the query fails with the following exception and cause:
I'm using
com.j256.ormlite:ormlite-android:6.1
on Android 30 (Samsung Galaxy S9+).