[sqlite] FTS5 issue on OS X

2015-10-22 Thread Gergely Lukacsy (glukacsy)
Oh yeah, bingo :)

Thanks?

Gergely

On 22/10/2015 17:05, "Scott Hess"  wrote:

>Dollars to donuts you're compiling SQLite but then linking against the
>system version.
>
>-scott
>
>
>On Thu, Oct 22, 2015 at 7:51 AM, Gergely Lukacsy (glukacsy) <
>glukacsy at cisco.com> wrote:
>
>> Hi Simon,
>>
>> Thanks for coming back to me.
>>
>> I ran sqlite3_compileoption_get in a loop to enumerate all options (I
>> assume this is the same as the pragma query suggested below) and I got
>>the
>> following:
>>
>> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomENABLE_FTS3
>> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomENABLE_FTS3_PARENTHESIS
>> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomENABLE_LOCKING_STYLE=1
>> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomENABLE_RTREE
>> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomOMIT_AUTORESET
>> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomOMIT_BUILTIN_TEST
>> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomOMIT_LOAD_EXTENSION
>> 2015-10-22T14:46:26.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomSYSTEM_MALLOC
>> 2015-10-22T14:46:26.000Z  [0x7fff7679d300] DBWrapper.cpp:33
>> DBInit:OptiomTHREADSAFE=2
>>
>>
>> I am really puzzled by this as its not that FTS is set to version 3, but
>> THREADSAFE=2 which is not what I am giving clang as an option. If I omit
>> -DSQLITE_ENABLE_FTS5 I see I can put garbage in the FTS5 specific parts
>>of
>> the amalgamation and it still compiles, with -DSQLITE_ENABLE_FTS5 it
>>fails
>> - indicating that the FTS5 specific parts are compiled and the
>> preprocessof flags honoured.
>>
>>
>> Regards,
>> Gergely
>>
>>
>> On 22/10/2015 14:51, "Simon Slavin"  wrote:
>>
>> >
>> >On 22 Oct 2015, at 2:38pm, Gergely Lukacsy (glukacsy)
>> > wrote:
>> >
>> >> ... I get an "error: no module: fts5" error message. This indicates
>> >>that I didn't compile SQLite with FTS5 support, but I am pretty sure
>> >>that I am using the right preprocessor flags
>> >
>> >Using that version of SQLite, can you execute the command
>> >
>> >PRAGMA compile_options;
>> >
>> >and tell us what it reports back ?  It will reply with a series of rows
>> >just like a SELECT command would.
>> >
>> >See  for
>> >further details.
>> >
>> >Simon.
>> >___
>> >sqlite-users mailing list
>> >sqlite-users at mailinglists.sqlite.org
>> >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users at mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>___
>sqlite-users mailing list
>sqlite-users at mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



[sqlite] FTS5 issue on OS X

2015-10-22 Thread Gergely Lukacsy (glukacsy)
Hi Simon, 

Thanks for coming back to me.

I ran sqlite3_compileoption_get in a loop to enumerate all options (I
assume this is the same as the pragma query suggested below) and I got the
following:

2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomENABLE_FTS3
2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomENABLE_FTS3_PARENTHESIS
2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomENABLE_LOCKING_STYLE=1
2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomENABLE_RTREE
2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomOMIT_AUTORESET
2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomOMIT_BUILTIN_TEST
2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomOMIT_LOAD_EXTENSION
2015-10-22T14:46:26.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomSYSTEM_MALLOC
2015-10-22T14:46:26.000Z  [0x7fff7679d300] DBWrapper.cpp:33
DBInit:OptiomTHREADSAFE=2


I am really puzzled by this as its not that FTS is set to version 3, but
THREADSAFE=2 which is not what I am giving clang as an option. If I omit
-DSQLITE_ENABLE_FTS5 I see I can put garbage in the FTS5 specific parts of
the amalgamation and it still compiles, with -DSQLITE_ENABLE_FTS5 it fails
- indicating that the FTS5 specific parts are compiled and the
preprocessof flags honoured.


Regards,
Gergely


On 22/10/2015 14:51, "Simon Slavin"  wrote:

>
>On 22 Oct 2015, at 2:38pm, Gergely Lukacsy (glukacsy)
> wrote:
>
>> ... I get an "error: no module: fts5" error message. This indicates
>>that I didn't compile SQLite with FTS5 support, but I am pretty sure
>>that I am using the right preprocessor flags
>
>Using that version of SQLite, can you execute the command
>
>PRAGMA compile_options;
>
>and tell us what it reports back ?  It will reply with a series of rows
>just like a SELECT command would.
>
>See  for
>further details.
>
>Simon.
>___
>sqlite-users mailing list
>sqlite-users at mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



[sqlite] FTS5 issue on OS X

2015-10-22 Thread Simon Slavin

On 22 Oct 2015, at 2:38pm, Gergely Lukacsy (glukacsy)  
wrote:

> ... I get an "error: no module: fts5" error message. This indicates that I 
> didn't compile SQLite with FTS5 support, but I am pretty sure that I am using 
> the right preprocessor flags 

Using that version of SQLite, can you execute the command

PRAGMA compile_options;

and tell us what it reports back ?  It will reply with a series of rows just 
like a SELECT command would.

See  for further 
details.

Simon.


[sqlite] FTS5 issue on OS X

2015-10-22 Thread Gergely Lukacsy (glukacsy)
Hi,

I am using Sqlite in a codebase shared between Windows and OS X and 
specifically I am using FTS4 for searching our DB for free text strings. I have 
just upgraded to the latest 3.9.1 and thought to give a try to FTS5, but 
encountered an issue. It works fine on Windows, but on OS X the moment I try to 
create the FTS5 virtual table...

"CREATE VIRTUAL TABLE IF NOT EXISTS MessageSearch USING fts5(MESSAGE_ID 
UNINDEXED,CONVERSATION_ID UNINDEXED,MESSAGE_PUBLISHED_TIME 
UNINDEXED,MESSAGE_DATA, prefix='3,4,5')"

... I get an "error: no module: fts5" error message. This indicates that I 
didn't compile SQLite with FTS5 support, but I am pretty sure that I am using 
the right preprocessor flags (I am using the single C file amalgamation). For 
reference here is the entire build script I am using:

clang -c -O2 -DSQLITE_ENABLE_FTS5 -DSQLITE_THREADSAFE=0 -o sqlite3.o sqlite3.c

ar rcs darwin/libsqlite3.a sqlite3.o


I confirmed that the fts5.c part and the fts5 initialisation functions are all 
compiled into the .o.


Any idea what am I doing wrong? The main thing why I am puzzled is that it 
works without issues on Windows.


Regards,

Gergely



[sqlite] FTS5 issue on OS X

2015-10-22 Thread Scott Hess
Dollars to donuts you're compiling SQLite but then linking against the
system version.

-scott


On Thu, Oct 22, 2015 at 7:51 AM, Gergely Lukacsy (glukacsy) <
glukacsy at cisco.com> wrote:

> Hi Simon,
>
> Thanks for coming back to me.
>
> I ran sqlite3_compileoption_get in a loop to enumerate all options (I
> assume this is the same as the pragma query suggested below) and I got the
> following:
>
> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomENABLE_FTS3
> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomENABLE_FTS3_PARENTHESIS
> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomENABLE_LOCKING_STYLE=1
> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomENABLE_RTREE
> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomOMIT_AUTORESET
> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomOMIT_BUILTIN_TEST
> 2015-10-22T14:46:24.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomOMIT_LOAD_EXTENSION
> 2015-10-22T14:46:26.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomSYSTEM_MALLOC
> 2015-10-22T14:46:26.000Z  [0x7fff7679d300] DBWrapper.cpp:33
> DBInit:OptiomTHREADSAFE=2
>
>
> I am really puzzled by this as its not that FTS is set to version 3, but
> THREADSAFE=2 which is not what I am giving clang as an option. If I omit
> -DSQLITE_ENABLE_FTS5 I see I can put garbage in the FTS5 specific parts of
> the amalgamation and it still compiles, with -DSQLITE_ENABLE_FTS5 it fails
> - indicating that the FTS5 specific parts are compiled and the
> preprocessof flags honoured.
>
>
> Regards,
> Gergely
>
>
> On 22/10/2015 14:51, "Simon Slavin"  wrote:
>
> >
> >On 22 Oct 2015, at 2:38pm, Gergely Lukacsy (glukacsy)
> > wrote:
> >
> >> ... I get an "error: no module: fts5" error message. This indicates
> >>that I didn't compile SQLite with FTS5 support, but I am pretty sure
> >>that I am using the right preprocessor flags
> >
> >Using that version of SQLite, can you execute the command
> >
> >PRAGMA compile_options;
> >
> >and tell us what it reports back ?  It will reply with a series of rows
> >just like a SELECT command would.
> >
> >See  for
> >further details.
> >
> >Simon.
> >___
> >sqlite-users mailing list
> >sqlite-users at mailinglists.sqlite.org
> >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>