Re: [sqlite] BUG: crash in fts5MultiIterNext()

2016-11-12 Thread Dan Kennedy
pSeg is set, but xNext is null. There are items which match the query. This is with 3.15.1. Are you able to share the database that this crashes when querying? Dan Jan [excerpt from stack trace] * frame #1: 0x0001110c4e6d sqlite3`fts5MultiIterNext(p=0x608000303cc0, p

Re: [sqlite] sqlite ext3 settings

2016-11-10 Thread Dan Kennedy
/ext3-users/2010-July/msg0.html It seems to be that if your drive has write-caching enabled, you need barrier=1 to avoid risking corruption. Or you can get away with barrier=0 if write-caching is disabled. Also: http://www.sqlite.org/draft/lockingv3.html#ext3-barrier-problem Dan

Re: [sqlite] Merging FTS indexes

2016-11-08 Thread Dan Kennedy
haven't actually tried anything like this, but it seems quite possible if the databases all use distinct sets of rowids. The best docs for the fts5 data format are the comments at the top of source file "fts5_index.c". Dan. Thank

Re: [sqlite] Is msync necessary for SQLite?

2016-11-03 Thread Dan Kennedy
://www.sqlite.org/src/info/e9a51d2a580daa0f Dan. #if SQLITE_MAX_MMAP_SIZE0 /* Deal with as much of this write request as possible by transfering ** data from the memory mapping using memcpy(). */ if( offsetpFile-mmapSize ){ if( offset+amt = pFile-mmapSize ){ int size = -1; struct

Re: [sqlite] Is msync necessary for SQLite?

2016-11-03 Thread Dan Kennedy
to modify to the db file, even though it reads the file by memory mapping it. Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] VACUUM causes Out of memory error

2016-11-02 Thread Dan Kennedy
sqlite3.exe 3.15.0 binary on Win32. Bisection shows that the error entered the SQLite code base here, which is the first version which runs out of memory during VACUUM: http://www.sqlite.org/src/info/29d63059b4d2bb61 We can reproduce it here now too. There will likely be a fix soon... Dan

Re: [sqlite] sites inaccessible

2016-10-29 Thread Dan Kennedy
-scm.org curl: (7) Failed to connect to fossil-scm.org port 80: Connection refused Thanks for posting this. Restarted xinetd and things seem to be working again. Dan. https does work: $ curl https://www.fossil-scm.org Redirect to Location: https://www.fossil-scm.org/index.html/doc/trunk/www

Re: [sqlite] Adding comments to a ticket

2016-10-28 Thread Dan Kennedy
;Edit" link at the top of the page linked above. Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] WAL pragma question

2016-10-28 Thread Dan Kennedy
at 1 page. Starting to make sense now, thanks. It was that "hey, I'm all checkpointed and synched up but the file's still huge" bit there throwing me off. Of course I have to ask again here, am I understanding it correctly now? Yep, that's it. Dan. -Original Message- Fro

Re: [sqlite] Bus Error on OpenBSD

2016-10-28 Thread Dan Kennedy
ar whether or not the statement handle really has already been finalized. Dan. So I also did some googling on that topic, and it appears that during Perl's global destruction phase objects may not necessarily be destroyed in the right order. That is something I unfortunately don't have any easy co

Re: [sqlite] WAL pragma question

2016-10-28 Thread Dan Kennedy
sqlite> PRAGMA wal_checkpoint; 0|52|52 /* Still roughly 200KiB */ sqlite> INSERT INTO t1 VALUES(1, 1); /* Now truncated to 4KiB */ This is because the locking scheme only allows writers to modify the wal file, not checkpointers. Dan.

Re: [sqlite] Bug in latest sqlite Release vacuum crashes?

2016-10-26 Thread Dan Kennedy
mpile.html#temp_store Dan. Regards, cc Am 24. Oktober 2016 2:00:16 nachm. schrieb sqlite-users-requ...@mailinglists.sqlite.org: Send sqlite-users mailing list submissions to sqlite-users@mailinglists.sqlite.org To subscribe or unsubscribe via the World Wide Web, visi

Re: [sqlite] How does the pager know whether its memory cache is still valid?

2016-10-24 Thread Dan Kennedy
t uses a different mechanism. If some other process modifies the db and then your process opens a new read transaction, it discards any cached pages it has in memory. Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.or

Re: [sqlite] Possible Bug in VTable handling in SQLite 3.14.2

2016-10-14 Thread Dan Kennedy
methods are called. Do the VM programs (EXPLAIN output) for whatever statements you're testing with contain the OP_Transaction? Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] LIMIT doesn't return expected rows

2016-10-11 Thread Dan Kennedy
SQLite documentation suggests that ORDER BY should be performed /before/ LIMIT. This is correct. In an SQL SELECT, the sorting is done before the limiting. Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.o

Re: [sqlite] Strange problem (pehaps bug) with sqlite + json

2016-09-23 Thread Dan Kennedy
the table in the first place if it's possible. Dan. Regards Gilles Here is the script without double quote drop table if exists records; create table if not exists records( activityId integer primary key, activityDate text, activityType integer,message text) ; insert into records

Re: [sqlite] A problem with 'pragma table_info(...)'

2016-09-21 Thread Dan Kennedy
k you will get the behaviour you describe. Some docs here (search the page for "PRAGMA"): https://www.sqlite.org/huawei-th3/uv/th3-392.c?mimetype=application/octet-stream Dan. I don't know what to think anymore. It looks like will have to parse the SQL Create statement, eventually.. D

Re: [sqlite] A problem with 'pragma table_info(...)'

2016-09-21 Thread Dan Kennedy
behaviour. Does "PRAGMA table_info('sqlite_master');" return any results? What does "PRAGMA compile_options;" say? Dan. To: sqlite-users@mailinglists.sqlite.org From: clem...@ladisch.de Date: Wed, 21 Sep 2016 08:27:32 +0200 Subject: Re: [sqlite] A problem with 'pragma tabl

Re: [sqlite] [BUG REPORT] Transaction that has the key violation is very slow

2016-09-21 Thread Dan Kennedy
an immediate FK constraint: https://www.sqlite.org/foreignkeys.html#fk_deferred Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Random IOERR_SHORT_READ in sqlite3_prepare_v2

2016-09-14 Thread Dan Kennedy
sh. I think strace data would be helpful though. Dan. Environment: * Databases are in WAL journal mode * synchronous=NORMAL * wal_autocheckpoint is OFF. Checkpointing is done in a separate thread with PRAGMA wal_checkpoint(PASSIVE) and wal_checkpoint(TRUNCATE) if the WAL file is bigger than a cer

Re: [sqlite] schema_version and Vacuum or Backup API

2016-09-09 Thread Dan Kennedy
the same function name) Two calls. Dan. On Thursday, 8 September, 2016 08:17, Richard Hipp said: On 9/8/16, Stephen Chrzanowski <pontia...@gmail.com> wrote: However, the rabbit I was hoping to pull out of the hat was that the change in version numbers be done automatically when

Re: [sqlite] Best way to "split" a large DB into two DBs

2016-09-07 Thread Dan Kennedy
On 09/08/2016 12:57 AM, Clay Gerrard wrote: On Wed, Sep 7, 2016 at 10:08 AM, Dan Kennedy <danielk1...@gmail.com> wrote: [...] then attach it and your main db to the same handle so that you can use an "INSERT INTO ... SELECT ..." statement Can you elaborate or provide any ref

Re: [sqlite] Best way to "split" a large DB into two DBs

2016-09-07 Thread Dan Kennedy
n "INSERT INTO ... SELECT ..." statement of the form above, things might run a bit faster. Dan. Even though it's not my app, I know there are indexes and triggers on those tables (but the triggers are mostly on deletes, so don't really apply here), and I suggested adding those

Re: [sqlite] bug in SQLITE_CHECKPOINT_PASSIVE?

2016-09-05 Thread Dan Kennedy
On 09/06/2016 02:54 AM, Allen wrote: I'm doing some stress testing of an app that uses sqlite-amalgamation-3140100 compiled under gcc 4.8.5 (x86_64-posix-seh-rev0, Built by MinGW-W64 project) on Windows 7 x64 with the compile options: #define SQLITE_MAX_MMAP_SIZE0 #define

Re: [sqlite] page_size on ATTACH-ed databases

2016-08-13 Thread Dan Kennedy
econd.page_size; 4096 sqlite> PRAGMA second.journal_mode = wal; wal sqlite> CREATE TABLE second.t1(a, b); sqlite> PRAGMA second.page_size; 4096 sqlite> PRAGMA main.page_size; 512 Dan. Thanks -- Ward (In real life, we also set journal_mode=WAL on both databases

Re: [sqlite] FTS4/5 ranking function differences

2016-08-11 Thread Dan Kennedy
hat do you think the API should look like? Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] FTS4/5 ranking function differences

2016-08-10 Thread Dan Kennedy
u could add the "weight" as an UNINDEXED column to the fts5 documents table. Then access it via the auxiliary function xColumn() API. Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug in CREATE INDEX

2016-08-08 Thread Dan Kennedy
On 08/09/2016 12:48 AM, Kevin O'Gorman wrote: On Sun, Aug 7, 2016 at 11:11 PM, Dan Kennedy <danielk1...@gmail.com> wrote: On 08/08/2016 02:03 AM, Dominique Pellé wrote: Kevin O'Gorman wrote: CREATE INDEX has two problems: 1) poor default location of temporary storage. 2) gets

Re: [sqlite] Bug in CREATE INDEX

2016-08-08 Thread Dan Kennedy
://sqlite.org/pragma.html#pragma_threads Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] newbie has waited days for a DB build to complete. what's up with this.

2016-08-06 Thread Dan Kennedy
On 08/06/2016 09:52 AM, Kevin O'Gorman wrote: On Fri, Aug 5, 2016 at 2:03 PM, Dan Kennedy <danielk1...@gmail.com> wrote: On 08/06/2016 03:28 AM, Kevin O'Gorman wrote: On Fri, Aug 5, 2016 at 1:08 PM, David Raymond <david.raym...@tomtom.com> wrote: .. Apart from the defa

Re: [sqlite] newbie has waited days for a DB build to complete. what's up with this.

2016-08-05 Thread Dan Kennedy
On 08/06/2016 03:28 AM, Kevin O'Gorman wrote: On Fri, Aug 5, 2016 at 1:08 PM, David Raymond wrote: There's a depreciated pragma, PRAGMA temp_store_directory = 'directory-name'; that apears to still work ok for now at least.

Re: [sqlite] Strange SQLite bug(?!)

2016-08-02 Thread Dan Kennedy
On 08/02/2016 01:01 PM, skywind mailing lists wrote: HI, it seems to be that I am not allowed to add zip files to these e-mails. Thanks for reporting this. Should now be fixed here: http://sqlite.org/src/info/e64a4173d2899acf Dan. This is what I am doing to create the database

Re: [sqlite] sqlite3_scrub_backup() -> database disk image is malformed

2016-07-26 Thread Dan Kennedy
that it is as small as possible. Dan. Ralf [1] http://www.sqlite.org/src/artifact?ci=trunk=ext/misc/scrub.c --- #include #include "sqlite3.h" sqlite3 *db; static void check(int r, int e) { if (r != e) { printf ("ER

Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-23 Thread Dan Kennedy
that some other process may come along and modify the permanent table, violating the FK constraint in the temporary schema. Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Error or Crash using OR in MATCH clause

2016-07-21 Thread Dan Kennedy
: http://sqlite.org/src/info/64ca1a835a89fd21 The fix will be part of 3.14. Dan. Simplest example [using SQLite program]: --- DROP TABLE IF EXISTS VTest; CREATE virtual TABLE VTest USING FTS5(Title, AUthor, tokenize ='porter unicode61

Re: [sqlite] [Question]SQLite cannot remove journal file as soon as UPDATE transaction finishes?

2016-07-11 Thread Dan Kennedy
With older versions, using "PRAGMA journal_mode=PERSIST" or "PRAGMA journal_mode=TRUNCATE" provides the same level of durability. Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/c

Re: [sqlite] Database is locked

2016-07-10 Thread Dan Kennedy
statement handle hanging around somewhere. After sqlite3_close() fails, use this: https://www.sqlite.org/c3ref/next_stmt.html to loop through any unfinalized statement handles. If you find such a handle, this: https://www.sqlite.org/c3ref/sql.html can be useful for figur

Re: [sqlite] Extending Porter Tokenizer

2016-07-10 Thread Dan Kennedy
this is possible with FTS4? No way to do that with FTS4 unfortunately. I think you'll either need to switch to FTS5 or make a copy of the porter stemmer code and modify it to suit your purpose. Dan. - Abhinav ___ sqlite-user

Re: [sqlite] Problem with savepoints

2016-07-06 Thread Dan Kennedy
build or configure SQLite to create statement/savepoint journals as soon as they are required: https://www.sqlite.org/compile.html#stmtjrnl_spill Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org

Re: [sqlite] Problem with savepoints

2016-07-06 Thread Dan Kennedy
On 07/06/2016 10:52 PM, Jeff Archer wrote: On Wed, Jul 6, 2016 at 10:46 AM, Dan Kennedy <danielk1...@gmail.com> wrote: On 07/06/2016 09:09 PM, Jeff Archer wrote: Hi All, I am a long time SQLite user but have generally used it from C++ in the past. In this project however, I am atte

Re: [sqlite] Problem with savepoints

2016-07-06 Thread Dan Kennedy
: -DSQLITE_TEMP_STORE=3 https://www.sqlite.org/compile.html#temp_store Or execute "PRAGMA temp_store = memory" after opening your db connection. Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.o

Re: [sqlite] about Precompiled Binaries for Android

2016-06-18 Thread Dan Kennedy
On 06/18/2016 07:06 AM, 风 wrote: hi, sqlite.org provided the Precompiled Binaries for Android(*.aar), where to download the source code ? (.java, jni) http://www.sqlite.org/android/doc/trunk/www/index.wiki ___ sqlite-users mailing list

Re: [sqlite] Preventing certain query keywords from getting stemmed

2016-05-30 Thread Dan Kennedy
ay would be to write a custom tokenizer. https://www.sqlite.org/fts5.html#section_7_1 Dan. - Abhinav ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/l

Re: [sqlite] BUG: FTS5 query containing OR + order by rank

2016-05-30 Thread Dan Kennedy
the db is not corrupt but a bug in FTS5 is causing it to report so. Now fixed here: http://sqlite.org/src/info/64ca1a835a89fd21 Dan. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Sync journal's directory per transaction? or until database closed? in PERSIST mode

2016-05-26 Thread Dan Kennedy
o journal file on disk following system recovery. Database corruption. For this reason SQLite always closes the journal file at the end of a transaction on UNIX. On windows, where it is not possible to delete a file if another process has it open, SQLite holds the journa

[sqlite] System.Data.SQLite fails on rtree index creation (NuGet install)

2016-05-24 Thread Dan Kennedy
t;> > Could you run the SQL query "ANALYZE;" on the database and see if that > clears > the issue? On the off chance that it doesn't completely clear the issue but does change the error message to one that makes more sense, can you post the new error here? Thanks. Dan.

[sqlite] Calling FTS tokeniser functions manually

2016-05-13 Thread Dan Kennedy
here is example code in the fts5_test_tok.c file: http://sqlite.org/src/artifact/db08af63673c3a7d The example code creates a virtual table module that looks useful enough: CREATE VIRTUAL TABLE ttt USING fts5tokenize('porter'); then: SELECT * FROM ft1_v_row WHERE term IN (SELECT token FROM ttt('running man')); should probably work. More information in fts5_test_tok.c. Dan.

[sqlite] sqlite3_auto_extension + custom FTS5 tokenizer

2016-05-12 Thread Dan Kennedy
hat already has an fts5 extension registered with it is a no-op. That might not happen until after the 3.13 release though. Dan.

[sqlite] Fastest way to backup/copy database?

2016-05-05 Thread Dan Kennedy
abase handle that is being used as the source db by the backup API, then the backup is not restarted. In this case if any pages that have already been transferred to the backup db are modified the new versions are written into the backup db at the same time as the source is updated. Dan. >

[sqlite] Outer Join with Where terms - possible optimization

2016-04-29 Thread Dan Kennedy
es everything to the left of the LEFT (or CROSS) JOIN before everything to the right of it. Dan.

[sqlite] Multiple in-memory database table query

2016-04-23 Thread Dan Kennedy
worked with wal mode but stored all files in memory instead of writing them out to the file-system. I don't think anyone has published anything like that yet though. > > What is "wrong" with shared cache that people keep saying don't use it? > Dan, Richard, is shared cache broken

[sqlite] Multiple in-memory database table query

2016-04-22 Thread Dan Kennedy
shared" then db1, db2 and db3 will all refer to the same in-memory database. Which will fail, as you cannot attach the same db to a single handle more than once. But, if your process has two separate database handles and they both attach "file:data.db?mode=memory=shared" then both handles will be connected to the same in-memory database. Dan.

[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-21 Thread Dan Kennedy
to check that only valid values are inserted into the table though (and the corresponding trigger for updates, and for updates and deletes on the referenced table). Dan. > ? > > -- > Cecil Westerhof > ___ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Is it possible that dropping a big table takes very long

2016-04-18 Thread Dan Kennedy
> ) > ); > Are there any other tables in the db with foreign keys that refer to the table being dropped? If so, try with foreign keys disabled: PRAGMA foreign_keys = 0; Dan.

[sqlite] FTS5 query that to match all rows.

2016-04-14 Thread Dan Kennedy
On 04/13/2016 11:24 PM, John Found wrote: > What FTS5 query should I use in order to match all rows in the table? > Can you use "SELECT * FROM fts_table;"? Dan.

[sqlite] FTS5 problem ? more than 3,000 queries !

2016-04-04 Thread Dan Kennedy
nd obtaining this requires a separate query on the %_sz table for each row. So if the MATCH expression matches 3000 rows, FTS5 makes 3000 SQL queries to obtain the size data. Dan. > > Cheers ! > > > > CREATE TABLE "items" ( > 'id' integer PRIMARY KEY, >

[sqlite] Debugging variable left in fts5_index.c?

2016-03-30 Thread Dan Kennedy
19-3820 Thanks for reporting this. As you suspect, I accidentally left debugging code in. Will be removed in the next release. Dan.

[sqlite] Broken database after experiments with fts.

2016-03-30 Thread Dan Kennedy
d is included to illustrate a problem only. > > In ``vtab.c:sqlite3VtabBeginParse()'', at the beginning insert two lines: > == > sqlite3MultiWrite(pParse); > sqlite3MayAbort(pParse); > == I think that's the right thing to do as well. See here: http://sqlite.org/src/info/d0a3853b37230c12 The fix should appear as part of the 3.13 release (not 3.12 - the version that was tagged earlier this morning). Dan.

[sqlite] report a bug

2016-03-23 Thread Dan Kennedy
tokenizer returns more than one token, then these are handled in the same way as a phrase expression by fts5. So SQL1 is equivalent to: ... MATCH "??? + ??? + + ??" whereas SQL2 is: ... MATCH "(??? + ???) AND ( + ??)" Maybe there should be an option for languages like Thai to tell FTS5 to handle this kind of thing as: ... MATCH "??? AND ??? AND AND ??" Dan.

[sqlite] FTS5 "constraint failed"

2016-03-23 Thread Dan Kennedy
x_items) VALUES('rebuild'); > Error: constraint failed > > The table has 12,000,000 records and it show the error message after 10 > seconds working, any clue on what can be happening ? Thanks for testing this. What does "SELECT sqlite_version();" return if you run it in the same shell? Thanks, Dan.

[sqlite] ASK matchinfo performance

2016-03-17 Thread Dan Kennedy
query, as one of the values returned by 'x' is the total number of matches in all rows. In FTS3 there is no way to get this information without iterating through all matching rows. FTS5 is more faster and more flexible, IMO. Dan.

[sqlite] ICU and FTS5

2016-03-10 Thread Dan Kennedy
enizer would need to be adapted or rewritten to work with FTS5. Dan.

[sqlite] [BUG] 3.11.0: FTS3/4 index emptied by 'optimize' inside transaction

2016-03-10 Thread Dan Kennedy
; INSERT INTO fts (fts) VALUES ('optimize'); > COMMIT; > SELECT rowid FROM fts WHERE fts MATCH 'test'; > -- cut -- > > Thanks for reporting this. Now fixed here: http://sqlite.org/src/info/79338b991bf01e81 Dan.

[sqlite] Creating & Dropping memory databases

2016-03-09 Thread Dan Kennedy
On 03/09/2016 12:48 AM, Simon Slavin wrote: > On 8 Mar 2016, at 4:35pm, Dan Kennedy wrote: > >> I don't think it does that. sqlite3_shutdown() is for embedded platforms to >> shutdown sub-systems initialized by sqlite3_initialize(). Calling it with >> open connections

[sqlite] Creating & Dropping memory databases

2016-03-08 Thread Dan Kennedy
On 03/08/2016 09:14 AM, Simon Slavin wrote: > On 8 Mar 2016, at 2:10am, Stephen Chrzanowski wrote: > >> Out of curiosity, from a memory management standpoint, if I create a memory >> database, populate simple tables and such, to what falls the responsibility >> with cleaning up the memory used?

[sqlite] Changing the default page_size in 3.12.0

2016-03-05 Thread Dan Kennedy
RESTRICT here: http://sqlite.org/foreignkeys.html#fk_actions Dan.

[sqlite] Porting Sqlite to Embedded Platform

2016-03-03 Thread Dan Kennedy
says. But it looks like the code is out of sync with the comments. I think you'll need to update fsRead(), fsWrite() and fsSync() to work with the media instead of a file-system file. And fsOpen() to initialize it. Dan.

[sqlite] [SqlLite Support] Crash when query data from databse

2016-03-01 Thread Dan Kennedy
t's the problem fixed here: http://sqlite.org/android/info/20f8872529890bbf Upgrading to the latest code from http://sqlite.org/android/ should fix things. Dan. > > 5-13 19:43:39.407 12875-13552/com.ringcentral.android A/art? > art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPL

[sqlite] Possible bug in the SQL parser

2016-02-27 Thread Dan Kennedy
NION ALL SELECT "b" > ) > SELECT tB.id FROM tA INNER JOIN tB ON (tA.name = tB.name); > > > There is no _id_ column in the tB table, yet the statement doesn't produce > any error and in fact will return the ids of table tA. This doesn't seem > correct to me. > >

[sqlite] Crash when running complex FT5 queries

2016-02-25 Thread Dan Kennedy
C > > SparkWindows.exe!sqlite3_step?() C Thanks for reporting this. I don't think the stack trace above is valid though. Can you retry with a debugging build? Also, does the same query on the same database crash if you use the shell tool to execute it? Dan.

[sqlite] Why skip invoking busy handler whilepBt->inTransaction!=TRANS_NONE

2016-02-25 Thread Dan Kennedy
On 02/25/2016 09:53 AM, sanhua.zh wrote: > So can this be understood as, if I run my code in WAL, I can invoke busy > handler even it in TRAN_READ? No. The busy-handler is not invoked when trying to upgrade from a read to a write transaction. Regardless of journal mode

[sqlite] Why skip invoking busy handler while pBt->inTransaction!=TRANS_NONE

2016-02-24 Thread Dan Kennedy
id invoke the busy-handler in step 3, the two processes would each be waiting for the other to give up. Not much point to that. In wal-mode it's a little different. The transaction opened in step 1 could be committed, but attempting to open the write-transaction in step 3 followin

[sqlite] SQLite-jdbc Bug - database table is locked

2016-02-24 Thread Dan Kennedy
OCKED error. Here: https://www.sqlite.org/mark/rescode.html?DROP%20TABLE*reader#locked Dan. > Following simple code will illustrate the Bug clearly. > public class Class1 { > public static void main(String[] args) throws Exception { > Class.forName("

[sqlite] User-defined SQL functions

2016-02-23 Thread Dan Kennedy
On 02/23/2016 07:36 PM, E.Pasma wrote: > 22 feb 2016, Dan Kennedy: > >> On 02/23/2016 01:33 AM, E.Pasma wrote: >>> >>> I reproduced the memory leak and added a test in the sql script. >>> An alternative fix, instead of adding the missing break, is: >>

[sqlite] User-defined SQL functions

2016-02-23 Thread Dan Kennedy
t; break; > > Thus sqlite3_value_blob is used to get both text or blob value (like > in sqlite3.c at line ~93615 in routine attachFunc). > > If no response I opt for the alternative fix and place it at > http://h1972688.stratoserver.net/sqlite_mprint/160223 Suggest testing with text values and a utf-16 database. Dan.

[sqlite] FTS4 inquiry (non-printable characters, column delimiters)

2016-02-22 Thread Dan Kennedy
gt; perform searches with the colon character as part of a string. For > example, when searching on NETWORK MAC addresses. At the same time, I don't > want to lose the ability to utilize column specifiers. I think quoted strings are passed to the tokenizer without interpretation. So if your tokenizer considers ":" to be a token character, you might be able to do: ... MATCH '"01:23:45:67:89:AB"' ... or similar. Dan.

[sqlite] FTS design document

2016-02-22 Thread Dan Kennedy
The FTS5 code is cleaner than FTS3/4. I guess to decode it, start by understanding SQLite's virtual table interface, then look at fts5Int.h to figure out how the code fits together, then the on-disk format documented near the top of fts5_inde

[sqlite] INSERT OR IGNORE query inside of a body of trigger, fired by INSERT OR REPLACE query, works as if it was INSERT OR REPLACE.

2016-02-17 Thread Dan Kennedy
; clause inside > a query within a body of trigger suddenly works as if it was 'OR REPLACE'. The ON CONFLICT clause of the outer statement overrides the ON CONFLICT clause of the statement within the trigger: https://www.sqlite.org/mark/lang_createtrigger.html?However+if+an*used+instead (scroll the page down a bit to see the highlighted statement) Dan.

[sqlite] Correlated subquery throwing an error

2016-02-15 Thread Dan Kennedy
2-1253 I think this is an SQL standard thing. It's what Postgres does too. Which is probably why SQLite is this way. LIMIT and OFFSET expressions cannot refer to any columns, correlated or otherwise. Dan.

[sqlite] query Benchmark

2016-02-12 Thread Dan Kennedy
d line causes it to output some helpful information after running each query. Including page cache hits and misses. And some stuff about malloc() usage. We usually use the valgrind tool callgrind or cachegrind to repeatably measure CPU load here. Dan.

[sqlite] Recover corrupt database

2016-01-28 Thread Dan Kennedy
l > just be a faithful page replication and the result will still be > corrupted. Most likely, yes. As you have surmised, the backup API does a page-by-page copy. Dan.

[sqlite] Documentation Typo in FTS Example

2015-12-30 Thread Dan Kennedy
t2 VALUES(3, 'g h', 'i j', 'k l'); > > > The two inserts will fail, since t2 has 5 columns but 4 values were > supplied. Thanks for this. Now fixed in source control. Dan.

[sqlite] The Lock-Byte Page

2015-12-28 Thread Dan Kennedy
atter that database files are usually less than 2^30 bytes in size. All the (main?) platforms support locking regions of a file that have not yet been populated. Dan.

[sqlite] Malloc getting segmentation fault in sqlite

2015-12-24 Thread Dan Kennedy
ation under valgrind - either on the ARM platform or on a workstation. It will very likely tell you what is going wrong. http://valgrind.org/ Dan.

[sqlite] Index on computed value?

2015-12-16 Thread Dan Kennedy
es inside another column on > the main table. > > > Is there any way to accomplish that? Something like CREATE TABLE t1(x BLOB); CREATE INDEX i1 ON t1( substr(x, 1, 4) ); https://www.sqlite.org/expridx.html Dan.

[sqlite] about attach database

2015-12-16 Thread Dan Kennedy
is deferred until it is first required in this case). So an apples/apples comparison might be to open/ATTACH the database and then run a simple query that forces SQLite to read the database schema if it has not already - say "SELECT * FROM sqlite_master". Dan.

[sqlite] Problem when upgrading from FTS3/4 toFTS5modules(revisited)

2015-12-14 Thread Dan Kennedy
On 12/13/2015 08:05 PM, ajm at zator.com wrote: >> Mensaje original >> De: Dan Kennedy >> Para: sqlite-users at mailinglists.sqlite.org >> Fecha: Fri, 11 Dec 2015 22:54:45 +0700 >> Asunto: Re: [sqlite] Problem when upgrading from FTS3/4 >>

[sqlite] Problem when upgrading from FTS3/4 to FTS5modules(revisited)

2015-12-11 Thread Dan Kennedy
On 12/11/2015 08:22 PM, ajm at zator.com wrote: >> Mensaje original >> De: Dan Kennedy >> Para: sqlite-users at mailinglists.sqlite.org >> Fecha: Fri, 11 Dec 2015 15:28:33 +0700 >> Asunto: Re: [sqlite] Problem when upgrading from FTS3/4 to >&

[sqlite] Problem when upgrading from FTS3/4 to FTS5 modules(revisited)

2015-12-11 Thread Dan Kennedy
of "SELECT * FROM sqlite_master" or the output >> of the .schema shell tool command)? >> > Dan: > > Here is the schema: That all looks Ok. If you use the shell tool to execute the "DROP TABLE IF EXISTS ftsm" command does it report an error as well? Thanks, D

[sqlite] Problem when upgrading from FTS3/4 to FTS5 modules (revisited)

2015-12-11 Thread Dan Kennedy
and has problems when the dbase is in use. > > Some clues? Not really sure why it might fail there. Can you post the entire database schema (results of "SELECT * FROM sqlite_master" or the output of the .schema shell tool command)? Thanks, Dan.

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dan Kennedy
On 11/27/2015 12:13 PM, Igor Korot wrote: > Hi, > Is there any way to have "sqlite3_errmsg" function return a wide char string? > Or do a conversion in a portable way? Will sqlite3_errmsg16() work for you? https://www.sqlite.org/c3ref/errcode.html Dan.

[sqlite] FTS5 prefix index documentation may be incorrect

2015-11-25 Thread Dan Kennedy
/src/info/11eb8e877e2ba859 Dan. > > Examples: > > sqlite> CREATE VIRTUAL TABLE ft USING fts5(a, b, prefix='2 3'); > Error: malformed prefix=... directive > sqlite> CREATE VIRTUAL TABLE ft USING fts5(a, b, prefix=2, prefix=3); > Error: multiple prefix=... directives > >

[sqlite] SQLITE vs. OSX mmap == inevitable catalog corruption?

2015-11-18 Thread Dan Kennedy
yesterday, SQLite uses a read-only mapping in mmap mode. The db file is written using plain old write(), just as in non-mmap mode: http://sqlite.org/src/info/67c5d3c646c8198c It would be interesting to know if this clears the problem in your environment. Dan.

[sqlite] Delta Compression in RBU

2015-11-13 Thread Dan Kennedy
creation and application code checked in to the sqlite source project are public domain. The original authors of the code re-licensed it. Dan.

[sqlite] Another unexpected source of SQLITE_BUSY_SNAPSHOT

2015-11-11 Thread Dan Kennedy
On 11/11/2015 01:19 AM, Florian Weimer wrote: > * Dan Kennedy: > >> On 10/18/2015 10:27 PM, Florian Weimer wrote: >>> My first surprise was SQLITE_BUSY_SNAPSHOT from BEGIN IMMEDIATE (see >>> ?SQLITE_BUSY_SNAPSHOT from BEGIN IMMEDIATE?). I have found another >&g

[sqlite] Database corruption using zipvfs on android 64 bits (x86_64)

2015-11-07 Thread Dan Kennedy
ill be worth running such a script under valgrind to search for uninitialized variable problems etc. I can't see any bugfixes in the changelog since 3.8.8 to do with corrupt databases, but it might be worth upgrading to the latest zipvfs and sqlite to check if the problem is still present anyway. Regards, Dan.

[sqlite] FTS5 rank configuration option

2015-11-06 Thread Dan Kennedy
ent database connections seem to use the standard default > ranking. Is this by design? Thanks for reporting this. Might be fixed here: http://sqlite.org/src/info/33e6606f5e497e81 Dan. > ___ > sqlite-users mailing list > sqlite-users at mailin

[sqlite] FTS5 External Content Table - REPLACE - SQL logic error or missing database

2015-11-06 Thread Dan Kennedy
download the SQLite trunk, either via fossil or via a link like: http://www.sqlite.org/src/tarball/SQLite-trunk.tgz?uuid=trunk Then run [./configure && make amalgamation-tarball] to build an autoconf package. Regards, Dan. > > ___

[sqlite] FTS5 explicitly set delimiter

2015-11-02 Thread Dan Kennedy
haracters such > as tokenchars '!@#$%' and so on. I think you'll have to do the above, yes. Dan.

[sqlite] FTS5 explicitly set delimiter

2015-11-01 Thread Dan Kennedy
s://www.sqlite.org/fts5.html#section_4_3_1 Dan.

<    1   2   3   4   5   6   7   8   9   10   >