SQLite Android Bindings
View Ticket
Not logged in
Ticket UUID: aed11eb1c8168ce6e0a18208c860609b9866e4ff
Title: LIMIT with OFFSET in select statement is not working properly in android platform
Status: Open Type: Code_Defect
Severity: Critical Priority:
Subsystem: Resolution:
Last Modified: 2018-05-15 16:59:11
Version Found In: 3.23.1
User Comments:
anonymous added on 2018-05-15 16:59:11:
select * from <table_name> limit 100 offset 200; 

Expected result is it should return rows from 201 to 300. But in android it is returning rows from 2 to 101. 

But the above query return expected result in Mac os.

Do we need to enable any flags while compiling sqlite3 for android ? Below are the flags i used while compiling sqlite3 for android.

# If using SEE, uncomment the following:
# LOCAL_CFLAGS += -DSQLITE_HAS_CODEC

#Define HAVE_USLEEP, otherwise ALL sleep() calls take at least 1000ms
LOCAL_CFLAGS += -DHAVE_USLEEP=1

# Enable SQLite extensions.
LOCAL_CFLAGS += -DSQLITE_ENABLE_FTS5 
LOCAL_CFLAGS += -DSQLITE_ENABLE_RTREE
LOCAL_CFLAGS += -DSQLITE_ENABLE_JSON1
LOCAL_CFLAGS += -DSQLITE_ENABLE_FTS3

# This is important - it causes SQLite to use memory for temp files. Since 
# Android has no globally writable temp directory, if this is not defined the
# application throws an exception when it tries to create a temp file.
#
LOCAL_CFLAGS += -DSQLITE_TEMP_STORE=3

LOCAL_CFLAGS += -U__APPLE__
LOCAL_CFLAGS += -DHAVE_STRCHRNUL=0
LOCAL_CFLAGS += -DSQLITE_USE_URI=1