[sqlite] Static sqlite3 library for Linux.

2018-02-14 Thread Petros Marinos
Greetings! While I am trying to build a static library of another tool which is dependent to sqlite, I need to use an sqlite3 static library as well. Still, in my Centos 7.4 system, I cannot find one. The error is shown below: /bin/ld: cannot find -lsqlite3 collect2: error: ld returned 1 exit

Re: [sqlite] Question about threadsafe

2018-02-14 Thread Simon Slavin
On 14 Feb 2018, at 6:19am, Nick wrote: > Writing in thread 1 will no block SELECTs in thread 2 as I use WAL. But the > INSERT within the transaction of thread 2 still returns SQLITE_BUSY. > I think I have used sqlite3_busy_timeout() in right way and I find that >

Re: [sqlite] Question about threadsafe

2018-02-14 Thread R Smith
I ran a test and I can still find "database is locked" even if I use busy_handler(threadsafe=2, 2 connections). When thread 1 executing a writing transaction, thread 2 runs the code below at the same time: sqlite3_exec("BEGIN") //SELECT sqlite3_prepare_v2("SELECT * FROM t1;"); sqlite3_step;

Re: [sqlite] Help with row values

2018-02-14 Thread Simon Slavin
On 14 Feb 2018, at 7:50am, Dominique Devienne wrote: > Thanks. That's interesting. But then, why use it in this context? > Why DRH wants to purposely bypass the index in this case? > How is that relevant to testing tuple / row-values comparisons? --DD In the original

Re: [sqlite] Static sqlite3 library for Linux

2018-02-14 Thread Arjen Markus
If you use the amalgamated source, there is only one file to be compiled. That can be as simple as: gcc -c sqlite3.c ar r libsqlite3.a sqlite3.o Any further dependencies are up to the linker. No need to worry about that. Regards, Arjen > -Original Message- > From:

Re: [sqlite] Need some tips on using FTS5 with SQLite

2018-02-14 Thread Wout Mertens
I too am interested in this answer, I still have to start using fts5. What would be interesting is to see the `EXPLAIN QUERY PLAN [query]` for each of your queries, so as to see what causes the slowness. On Thu, Feb 8, 2018, 7:14 PM John Found, wrote: > > I am using FTS5

[sqlite] Strange behavior with wal_checkpoint PRAGMA

2018-02-14 Thread Joshua Watt
Hello, I observed the following behavior when using the wal_checkpoint PRAGMA in TRUNCATE mode: SQLite version 3.22.0 2018-01-22 18:45:57 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> .open test.db

[sqlite] Static sqlite3 library for Linux

2018-02-14 Thread Petros Marinos
Greetings dears! While I am trying to build a static library of another tool which is dependent to sqlite, I need to use an sqlite3 static library as well. Still, in my Centos 7.4 system, I cannot find one. The error is shown below: /bin/ld: cannot find -lsqlite3 collect2: error: ld returned 1

Re: [sqlite] Static sqlite3 library for Linux.

2018-02-14 Thread Simon Slavin
On 13 Feb 2018, at 10:55am, Petros Marinos wrote: > Is there any chance that I can find a Linux flavour static sqlite3 library, > or do I have to build from source? > And if I have to build from source, is it recommended to use the > sqlite-autoconf or the sqlite-src pkg?

Re: [sqlite] Static sqlite3 library for Linux

2018-02-14 Thread Petros Marinos
Thank you Arjen and Simon for your answers, really helpful! While there was progress by following the two commands noted in Arjen’s answer and creating the libsqlite.a file, I stumbled upon the following errors: [LD] astdb2sqlite3.o db1-ast/libdb1.a -> astdb2sqlite3

[sqlite] Segmentation fault in 3.22 eval.c under PRAGMA empty_result_callbacks=1

2018-02-14 Thread petern
sqlite> .version SQLite 3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt1 zlib version 1.2.8 gcc-4.8.4 sqlite> .load eval.so sqlite> PRAGMA empty_result_callbacks=1; sqlite> SELECT eval('SELECT 1 WHERE 0'); ... Segmentation fault If a new protection line

Re: [sqlite] Static sqlite3 library for Linux

2018-02-14 Thread petern
Petros, FYI. gcc also has several different switches for object ouput: eg. "gcc -c -static ..." It might help to investigate these options during steps to compile sqlite.c and your main program to avoid dynamic/static symbol conflicts. -static On systems that support dynamic