[sqlite] Libstringmetrics

2015-03-12 Thread Milan Roubal
Your SQL pass, so it is somewhere in the library. The problem is how to find in the big data where exactly. I am now going one character by each other, because it is probably only one specific record kind doing that. I was able to compile the library under linux and running strace looks like

[sqlite] Libstringmetrics

2015-03-12 Thread Milan Roubal
So I was able to identify the record doing the problem. I have tried to find what is so special on that record and it is size 20 characters. When I have this 3 examples with last name lenght 19, 20 and 21 characters only the size 20 crash. .load ./libstringmetrics.so select a.firstname,

[sqlite] Libstringmetrics

2015-03-12 Thread Andrea Peri
Hi Milan, thx for your patch. SQLITE_STATIC --> SQLITE_TRANSIENT I try to apply it for testing: but seem nothing change . However I leave it in the code to allow you to test. I submit also a new dll. Regards, Andrea. 2015-03-11 16:07 GMT+01:00 Milan Roubal : > Dear Andrea, > thank you for the

[sqlite] UPDATE Problem

2015-03-12 Thread Peter Haworth
I have a table, Transactions, with a column , Value, of type NUMERIC. The Value column is supposed to have 2 decimal places in all rows but some have only one. To correct this I issued the following command: UPDATE Transactions SET Value=Value||0 WHERE substr(Value,-2,1)='.' No errors on

[sqlite] Libstringmetrics

2015-03-12 Thread Simon Slavin
> On 11 Mar 2015, at 10:54pm, Milan Roubal wrote: > > .load ./libstringmetrics.so > select a.firstname, b.firstname, a.lastname, b.lastname, > stringmetrics("qgrams_distance","similarity",a.firstname, b.firstname,"") > first_dist, > stringmetrics("qgrams_distance","similarity",a.lastname,

[sqlite] UPDATE Problem

2015-03-12 Thread Dinu Marina
Hi Peter, From https://www.sqlite.org/datatype3.html: "When text data is inserted into a NUMERIC column, the storage class of the text is converted to INTEGER or REAL (in order of preference) if such conversion is lossless and reversible"; basically any fraction you insert into a NUMERIC

[sqlite] UPDATE Problem

2015-03-12 Thread R.Smith
On 2015-03-12 01:27 AM, Peter Haworth wrote: > I have a table, Transactions, with a column , Value, of type NUMERIC. The > Value column is supposed to have 2 decimal places in all rows but some have > only one. SQLite has no formatting inherent to the column value, there is no such thing as

[sqlite] Libstringmetrics

2015-03-12 Thread Milan Roubal
On 2015-03-12 00:33, Simon Slavin wrote: >> On 11 Mar 2015, at 10:54pm, Milan Roubal wrote: >> >> .load ./libstringmetrics.so >> select a.firstname, b.firstname, a.lastname, b.lastname, >> stringmetrics("qgrams_distance","similarity",a.firstname, >> b.firstname,"") first_dist, >>

[sqlite] Libstringmetrics

2015-03-12 Thread Simon Slavin
> On 11 Mar 2015, at 11:50pm, Milan Roubal wrote: > >> SELECT stringmetrics("qgrams_distance","similarity","Roubal", >> "RoubalRoubalRoubalRo",""); > crash Then that's the one to use for debugging. It is extremely simple and contains no database access at all so now you know the problem has

[sqlite] Libstringmetrics

2015-03-12 Thread Milan Roubal
Thank you very much for all feedback! the last example crashed also so I have tried with try and error to trace it down into the library and it looks like the problem are this 2 lines in file src/libsimmetrics/simmetrics/tokenizer.c tmp = calloc((init_len + qtype->qgram_len),

[sqlite] Releasing a read (SHARED) lock

2015-03-12 Thread Barry
Hello everybody, I have a situation where two processes are accessing the same SQLite database. One process only reads from the database, one process reads and writes. These processes keep a single database connection open for the lifetime of the process. It seems to me that once the reader

[sqlite] Libstringmetrics

2015-03-12 Thread Andrea Peri
Of course. Thx for report and patch. However I will contact the original author of the simmetrics library https://github.com/jokillsya/libsimmetrics to report him this error and the patch. A. 2015-03-12 2:12 GMT+01:00 Milan Roubal : > Thank you very much for all feedback! the last example

[sqlite] Libstringmetrics

2015-03-12 Thread Andrea Peri
Hi Lina, I tested your patch and it resolve the crash. I submit the patch in the master and generate a new dll for windows. Thx for patching. A. 2015-03-12 8:48 GMT+01:00 Andrea Peri : > Of course. > Thx for report and patch. > > However I will contact the original author of the simmetrics

[sqlite] Libstringmetrics

2015-03-12 Thread Andrea Peri
oops, sorry for wrong typo. "Hi Milan," is the correct. :) Again, A. 2015-03-12 9:08 GMT+01:00 Andrea Peri : > Hi Lina, > > I tested your patch and it resolve the crash. > > I submit the patch in the master and generate a new dll for windows. > > Thx for patching. > > A. > > > 2015-03-12 8:48

[sqlite] PRAGMA Synchronous safety

2015-03-12 Thread Mario M. Westphal
> If those databases are small then running "PRAGMA integrity_check" on them > should be very fast. My application does that. This is how users find out that their settings database has become corrupted. So far it is just reported and then the config database is restored from last working

[sqlite] PRAGMA Synchronous safety

2015-03-12 Thread Mario M. Westphal
> Why are you using shared cache, especially with WAL? Are your devices memory > constrained? I was under the impression that shared cache has performance benefits when used in a MT environment.

[sqlite] PRAGMA Synchronous safety

2015-03-12 Thread Mario M. Westphal
I have enabled the error callback and it logs everything except SQLITE_SCHEMA and SQLITE_OK. In the log files I have received so far, none of these were reported (I use special headers to identify SQLite errors because log files are often several hundred MB in size). I?m waiting for a

[sqlite] C++ ORM

2015-03-12 Thread Alejandro Santos
On Mon, Mar 9, 2015 at 10:38 PM, Scott Robison wrote: > A co-worker who is working on a project is interested in finding out if > there is an effective ORM for C++ / SQLite. I've not used one so I'm > turning to the list to see if anyone has a recommendation. > > Note: He's okay using SQLite

[sqlite] Releasing a read (SHARED) lock

2015-03-12 Thread R.Smith
On 2015-03-12 04:38 AM, Barry wrote: > Hello everybody, > > I have a situation where two processes are accessing the same SQLite > database. One process only reads from the database, one process reads and > writes. > > These processes keep a single database connection open for the lifetime of >

[sqlite] Weird (slow) TEMP B-TREE ORDER BY

2015-03-12 Thread Dinu Marina
Hi Richard, Like said, we've already tried: CREATE TEMP TABLE x AS (...query without outer sort...); CREATE xind ON x (price); SELECT * FROM x ORDER BY 2 but it also takes 30 seconds; for some really esoteric reason, CREATE TABLE x AS ... takes all of those 30s, even though the execution plan

[sqlite] PRAGMA Synchronous safety

2015-03-12 Thread Mario M. Westphal
One thing to add: I was sometimes successful to remote-repair a corrupted database by telling the user how to use sqlite3.exe and calling REINDEX. After learning that, I added this to my diagnosis routine so if integrity_check() returns something that?s not ?ok?, my application runs a

[sqlite] PRAGMA Synchronous safety

2015-03-12 Thread Richard Hipp
On 3/12/15, Mario M. Westphal wrote: > One thing to add: > > > > I was sometimes successful to remote-repair a corrupted database by telling > the user how to use sqlite3.exe and calling REINDEX. > > > > After learning that, I added this to my diagnosis routine so if > integrity_check() returns

[sqlite] PRAGMA Synchronous safety

2015-03-12 Thread Mario M. Westphal
I dump the output to the log file so when a user sends me a log after the diagnosis reported a ?repaired? damage, I see one or more entries like: ?row 2481 missing from index idx_settings_sndidmnun? I will see if I can collect more log files in the coming months.

[sqlite] PRAGMA Synchronous safety

2015-03-12 Thread Simon Slavin
On 12 Mar 2015, at 2:51pm, Mario M. Westphal wrote: > I dump the output to the log file so when a user sends me a log after the > diagnosis reported a ?repaired? damage, I see one or more entries like: > > ?row 2481 missing from index idx_settings_sndidmnun? > > I will see if I can collect

[sqlite] Memory leak?

2015-03-12 Thread Matthias Schmitt
Hello, I know, I am touching a hot iron, when claiming that sqlite might have a memory leak. But I am trying to debug memory leaks related to sqlite now since 4 days and I am running against walls. Here is my problem: - I am writing an iPhone app using iOS 8.2, Xcode 4.2, sqlite 3.8.8.3. -

[sqlite] Memory leak?

2015-03-12 Thread Simon Slavin
On 12 Mar 2015, at 4:21pm, Matthias Schmitt wrote: > - The memory leak appears in the iPhone simulator more often, than on an > original iPhone device, but it appears always. > > - The leak appears with totally different type of queries. It might be, that > a leak appears in a specific query

[sqlite] Memory leak?

2015-03-12 Thread Richard Hipp
On 3/12/15, Matthias Schmitt wrote: > Hello, > > I know, I am touching a hot iron, when claiming that sqlite might have a > memory leak. But I am trying to debug memory leaks related to sqlite now > since 4 days and I am running against walls. > Here is my problem: > > - I am writing an iPhone

[sqlite] UPDATE Problem

2015-03-12 Thread Peter Haworth
Thanks to all for explaining my confusion. The printf solution seems like the best way to handle this since I don't need to worry about how many decimal places are in the number.

[sqlite] Memory leak?

2015-03-12 Thread R.Smith
On 2015-03-12 06:21 PM, Matthias Schmitt wrote: > Hello, > > I know, I am touching a hot iron, when claiming that sqlite might have a > memory leak. But I am trying to debug memory leaks related to sqlite now > since 4 days and I am running against walls. Hi Matthias, Firstly, there are no

[sqlite] Releasing a read (SHARED) lock

2015-03-12 Thread Dinu Marina
You should be also aware of a more common pitfall: unclosed result sets. Any lock is held until you read PAST the last row or you call stmt_finalize (or the equivalent abstraction in your DBAL). Always close select statements. On Mar 12, 2015 11:40 AM, "R.Smith" wrote: > > > On 2015-03-12 04:38

[sqlite] Releasing a read (SHARED) lock

2015-03-12 Thread Dinu Marina
There is also a more obscure side-effect exhibited by sqlite only: if you issue consecutive unfinalized select statements, it never releases the write lock (although they should be atomic), but it does trip the deadlock mechanism; any writer in the wait will receive SQLITE_BUSY at the very

[sqlite] System.Data.SQLite and spellfix under VB.net

2015-03-12 Thread sonypsx
Hello, may i ask again ... Can somebody help to successfully compile spellfix.c for windows? Errors see below! Cheers sonypsx -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von sonypsx

[sqlite] System.Data.SQLite and spellfix under VB.net

2015-03-12 Thread Hick Gunter
The zip should contain 4 files shell.c sqlite3.c sqlite3.h sqlite3ext.h sqlite-amalgamation-3080803.zip -Urspr?ngliche Nachricht- Von: sonypsx [mailto:sonypsx at gmx.net] Gesendet: Donnerstag, 12. M?rz 2015 18:56 An: 'General Discussion of SQLite Database' Betreff: Re: [sqlite]

[sqlite] fix rowid's of fts table

2015-03-12 Thread Rael Bauer
Hi, I have a normal table, and a fts table that are joined by rowid's. E.g. when I add a row to the normal table, I add some values into the fts table as well, and set the rowid based on the normal table rowid (as recommended). Now I have restructured the normal table (i.e. delete column) using

[sqlite] fix rowid's of fts table

2015-03-12 Thread Clemens Ladisch
Rael Bauer wrote: > Now I have restructured the normal table (i.e. delete column) using the > algorithm mentioned here a couple of times (insert into normal select > (columns) from normal_OLD, etc..) > > This "resets" the rowid's of the normal table. If you rely on the rowid values, you should

[sqlite] fix rowid's of fts table

2015-03-12 Thread Simon Davies
On 12 March 2015 at 20:20, Rael Bauer wrote: > > Hi, > . . . > Now I have restructured the normal table (i.e. delete column) using the > algorithm mentioned here a couple of times (insert into normal select > (columns) from normal_OLD, etc..) > > This "resets" the rowid's of the normal table.

[sqlite] Releasing a read (SHARED) lock

2015-03-12 Thread Richard Hipp
On 3/12/15, Barry wrote: > On 13 March 2015 at 01:21, Dinu Marina wrote: > >> You should be also aware of a more common pitfall: unclosed result sets. >> Any lock is held until you read PAST the last row or you call >> stmt_finalize >> (or the equivalent abstraction in your DBAL). Always close

[sqlite] Optimization Opportunity?

2015-03-12 Thread Keith Medcalf
>> Actually query one appears slightly faster, >> Searching the PK index is faster as that is always a COVERING index. > >I was under the impression that the opposite is true, but I wasn't sure >about that. The primary key is only a covering index if you are only accessing fields comprising the

[sqlite] System.Data.SQLite and spellfix under VB.net

2015-03-12 Thread Keith Medcalf
Make sure that you have all the necessary .h files in the same directory as the spellfix.c source code (the #include's use " " rather than < >, which means look in the current directory, not the include path). Use the following command line in the directory containing source (.c) and header