Re: [sqlite] fsync on iOS

2014-01-16 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 16/01/14 11:43, Ward Willats wrote: > So it looks like fsync() is taking more than the 5 second timeout I've > set. This is not uncommon on mobile devices using flash based storage. There is a lot of volatility in read and write performance. I

Re: [sqlite] Saw something interesting in the debugger...

2014-01-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/01/14 08:53, Ward Willats wrote: > I found the UI thread and a worker thread, both in the DB, both in the > default busy handler, both taking a 1 second sleep. > > I expected to see a third thread in the DB doing some work while the > other two

Re: [sqlite] Is that same between rebinding every parameter and

2013-12-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30/12/13 06:18, Igor Tandetnik wrote: > sqlite3_clear_binding is very rarely needed, in my experience. In fact, > I have not yet encountered a reason to use it. I use it in my Python wrapper (APSW). The reason is because I have an automatic

Re: [sqlite] Does not detect invalid column name when subexpression optimized away

2013-12-19 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 19/12/13 15:36, RSmith wrote: > With this query you essentially ask the RDBMS to evaluate and supply > you with the result of (X and 0) - my guess is the optimiser pounces > directly on the fact that (X and 0) will always be 0 no matter what X > is

Re: [sqlite] "Last Modified" file attribute is not updated

2013-12-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/12/13 10:30, Felipe Farinon wrote: > I'm sorry to repost, but I just want to confirm that there is no > interest in fixing this, so that I can handle this with a workaround in > my application. Note that the effect will be to make SQLite slower

Re: [sqlite] Concrete example of corruption

2013-12-01 Thread Roger Binns
On 01/12/13 06:10, L. Wood wrote: > D. Richard Hipp, are there any plans to make this more robust in the > future, so reading/writing a corrupt database (with no -journal file > available) will return an *error* instead of causing further damage? There has been a ticket languishing for many

Re: [sqlite] Need suggestion for database scheama

2013-11-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/11/13 19:47, James K. Lowden wrote: > You might guess from my email domain name that I take an interest in > posts like yours. And it's pretty good first cut, no pun intended. > ;-) It is also worthwhile looking at musicbrainz

Re: [sqlite] Android - Occasional Error when closing a database

2013-10-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 29/10/13 06:23, Matthew Dumbleton wrote: > I have noticed that occasionally, after the data is entered and the > transaction ended, the close method call produces an error 'unable to > close due to unfinalised statements' and logCat shows the

Re: [sqlite] Write-ahead logging issue on Android

2013-10-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/10/13 18:37, Sascha Sertel wrote: > I have since tried to find out what the correct way is to point SQLite > to the right place for creating temporary files in Android, with no > luck.

Re: [sqlite] Namespacing sqlite3

2013-09-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/09/13 16:37, Neville Dastur wrote: > That's a very interesting concept. I've been doing it since 2004, and support all versions of Python from 2.3 onwards including 3.x. > Are you using http://www.cython.org/ or something else to "create" the

Re: [sqlite] Namespacing sqlite3

2013-09-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/09/13 12:56, Neville Dastur wrote: > Searching around on Google it seems that namespacing in c / obj-c is > not possible for the sqlite3 library. There is another approach that I use. I produce a Python C extension. The final shared library

Re: [sqlite] Compare Similar Cells

2013-09-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22/09/13 19:41, Kristopher Roy wrote: > I have a table of songs, several have similar titles I can't find where > to get started. I tried this but its not right. Select SongTitle, > COUNT(SongTitle) AS LIKE_COUNT FROM Songs I did work with a

Re: [sqlite] Hints for the query planner

2013-09-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/09/13 05:03, Gabor Grothendieck wrote: > Perhaps indexing the expression in question would be an alternative > that would keep the performance info separate from the select. I'd rather just do 'ANALYZE query' and have SQLite go off and do

Re: [sqlite] help needed for major SQLite problem

2013-09-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/09/13 08:58, C M wrote: > If you think APSW would provide more details about just what went > wrong other than "SQLite logic error or missing database" (which, I > feel, doesn't tell me much at all), then I could potentially try it. I'm in the

Re: [sqlite] help needed for major SQLite problem

2013-09-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 He needs to give the exception traceback which will show what is happening at the time. A common mistake with newish Python programmers is to catch all exceptions, and then keep going which also hides the exception tracebacks. On 01/09/13 15:12,

Re: [sqlite] help needed for major SQLite problem

2013-09-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/09/13 14:34, C M wrote: > Do you know how I can do that with Python? For example, I tried this: > > status = cursor.execute("some SQL statement here") print "The status > is: ", status > > But it prints the cursor object: > >> The status is

Re: [sqlite] Path Length Limit on Windows

2013-08-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22/08/13 07:38, Markus Schaber wrote: > http://www.mail-archive.com/sqlite-users@sqlite.org/msg18707.html > seems to indicate that SQLite is not using those APIs. On the other > hand, that post is of 2006. There has been an open ticket about this

Re: [sqlite] Database locking without locking database file

2013-08-14 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 14/08/13 06:06, Ralf Ramsauer wrote: > Neither cifs. I worked on a CIFS server (visionfs)[1]. They are a convoluted complicated mess. During the OLE2 era, Microsoft's apps abused locking as a means of inter-process communication. It got very

Re: [sqlite] sqlite3 error string size!!!

2013-08-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/08/13 01:45, techi eth wrote: > What is the maximum size error string returned by sqlite3_errmsg() > function You need to make a copy of the string since it can be changed at any time, including by other threads. In practise it will usually be

Re: [sqlite] Slow Query on large database Help

2013-08-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/08/13 11:54, Christopher W. Steenwyk wrote: > I have been working on a large database and its queries now for > several weeks and just can't figure out why my query is so slow. I've > attached the schema, my query, and the results of EXPLAIN

Re: [sqlite] Guidance with Python and nested cursors

2013-07-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/07/13 18:37, Keith Medcalf wrote: > cr1 = cn.cursor() cr2 = cn.cursor() > > cr1.execute('select ...') while True: row = cr1.fetchone() if not row: > break While that is normal DBAPI, it is far more verbose and unpythonic than the SQLite

Re: [sqlite] function auxiliary data

2013-07-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/07/13 04:03, Riccardo Vianello wrote: > I'm not sure I can do the same with pysqlite), pysqlite forces a minimum statement cache size of 5. > but since sqlite3_reset doesn't clear the binding It can't in general since you can immediately

Re: [sqlite] function auxiliary data

2013-07-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [I'm the APSW author] On 17/07/13 00:59, Riccardo Vianello wrote: > In a test performed using APSW I disabled the statements cache and the > code behaved as expected also with parameters binding. This brought me > to think that the metadata

Re: [sqlite] UnQLite

2013-07-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/07/13 20:51, Nico Williams wrote: > QBE is nice and simple, but lacks expressive power. The Mongo query syntax with an example JSON object: { "a": 10, "b": {"c": 3}, "d": ["one", "two", "three"]} To find all a==10: {"a" : 10 } To find all

Re: [sqlite] UnQLite

2013-07-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/07/13 16:19, Simon Slavin wrote: > What has generally become important to me is being able to supply arbitrary JSON as a "record", be able to query it, and get the same arbitrary JSON back out. In addition to unqlite, some

Re: [sqlite] BUG REPORT: function instr() with chinese characters

2013-07-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/07/13 01:20, ?? wrote: > I am using the sqlite-shell-win32-x86-3071700, in WindowsXP SP3 I did the same queries on Linux and got very different answers that appear to be correct. I'd suggest using SQLite programmatically since the Windows

Re: [sqlite] DLL Size differences and other info requested

2013-07-03 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/07/13 16:38, Stephen Chrzanowski wrote: > I just reduced my built file size to BELOW what comes "out of the box" > from sqlite.org. I've turned off all optimizations and ran a full > build. I'm now sitting at the 599k mark. You probably want

Re: [sqlite] Another 2 questions about SQLite

2013-06-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30/06/13 20:17, Igor Korot wrote: > Well I'm not familiar with SQLite internals, but one thing for sure: > why go thru the process if you can avoid it? You are trying to do premature optimization. Note the "Lite" in the SQLite. It is already

Re: [sqlite] Large Database Windows vs Linux

2013-06-28 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28/06/13 13:17, RSmith wrote: > Best guess is some other system is trying to also look into that file, > making the Windows file manager stutter quite possibly the Win7 > Preview pane, a 3rd party file indexer service, an anti-virus system or >

Re: [sqlite] Is there available sample "featured" SQLite database file?

2013-06-28 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28/06/13 01:12, Sqlite Dog wrote: > I'm wondering is there available sample "feature-tight" > "limit-striking" SQLite database (or SQL script) for GUI manager > testing purposes? You can certainly measure coverage of sqlite3.c itself when running

Re: [sqlite] Should I do analyze?

2013-06-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 25/06/13 22:46, Navaneeth.K.N wrote: > I am wondering should I do ANALYZE also as the last command? Will that > make the query planner happy and choose faster plans? Will that improve > the runtime performance? Since you know what your queries

Re: [sqlite] First Day of Week Inconsistency

2013-06-19 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 19/06/13 09:20, Denis Burke wrote: > Is it possible to modify %W to treat Sunday as the first day of the > week? Traditionally strftime %W uses Monday to start each week while %U uses Sunday. It looks like SQLite doesn't implement the latter.

Re: [sqlite] Upgrade/Install sqlite3 on Ubuntu server

2013-06-16 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 16/06/13 17:55, Simon Slavin wrote: >> Here’s a nice Python wrapper: >> >> > > Woops. That’s Windows, you’re Ubuntu. Don’t you have the sqlite3 > Python module APSW is not Windows. It is provided as source for

Re: [sqlite] Prepared statement invariants

2013-06-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 14/06/13 10:31, Maxim Khitrov wrote: > I'm writing SQLite bindings for Go [1]. I'm the author of SQLite bindings for Python - APSW. One choice I made was to mimic SQLite semantics into Python - essentially if it is a function call/expensive

Re: [sqlite] Limit of attached databases

2013-06-04 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/06/13 08:14, Eleytherios Stamatogiannakis wrote: > We have tried with both views and VTs but SQLite does not create > automatic indexes on them at all. So right now, to be able to have > automatic indexes from SQLite's side we materialize all

Re: [sqlite] Import skip first line

2013-06-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/06/13 07:26, Bart Smissaert wrote: > Is there a way to use the other features, but not this one, say if the > table is already there? The autoimport code is one function so you get all of it, or none of it. The same is true of the import code

Re: [sqlite] Import skip first line

2013-05-31 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 31/05/13 05:34, Bart Smissaert wrote: > Importing a. csv file via the. import command of sqlite3.exe. As the > first line holds the field names I want to skip that. There is no > problem achieving this in code, but could I do this purely via

Re: [sqlite] How people test db failures

2013-05-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/05/13 22:31, Igor Korot wrote: > Or the simplest one - the database is moved ... That is sufficient to break the database. A SQLite database is not just the database file, it is also the journal and WAL. If you don't move all as a single unit

Re: [sqlite] How people test db failures

2013-05-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/05/13 20:03, Igor Korot wrote: > How do people prove to their customers that no matter what the > software will either finish gracefully or will not break, crash or > anything to that matter? That is easy - use SQLite. Put your work inside

Re: [sqlite] How people test db failures

2013-05-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/05/13 12:00, Igor Korot wrote: > So, how people check whether db failure result in graceful program > termination/proper flow? I use a macro that takes this form: #define TESTPOINT(name, normal, failure) I use it like this:

Re: [sqlite] Writing in a blob

2013-04-22 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22/04/13 04:39, Paolo Bolzoni wrote: > But I noticed that sqlite3_blob_write cannot increase the size of the > pointed open blob. So I ask, there is a way to treat a blob as a stream > so I can write or read values in it with ease? This is

Re: [sqlite] SQLite version 3.7.16.2

2013-04-13 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/04/13 14:55, jose isaias cabrera wrote: > Can this problem also from a DB file shared via Windows Shared folder An effective way to corrupt your data is to use a networked filesystem. They do not provide the exact required semantics as a local

Re: [sqlite] Sqlite in Google Summer of Code 2013

2013-04-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15/02/13 04:56, Dann Luciano wrote: > ... or json results in sqlite. Just formatting results as JSON is uninteresting and trivial. It is a one liner in Python for example. I use MongoDB for the vast majority of my database work these days. The

Re: [sqlite] Database modeling question

2013-04-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/04/13 13:42, Alem Biscan wrote: > For a job interview I am required among other things to create a phone > book application. It would be easy to spend a year on that! You are probably better off showing something short, simple and

[sqlite] Trivial doc issue for functions

2013-03-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 http://www.sqlite.org/lang_corefunc.html The hex line is out of alphabetical order and should be two lines earlier. Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux)

Re: [sqlite] Timeline for full ALTER TABLE support?

2013-03-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26/03/13 14:40, Tim Gustafson wrote: > Is there a timeline or road map anywhere that could inform us as to > when we might see that feature added? In addition to what others have said, if SQLite did implement full ALTER TABLE support it is

Re: [sqlite] Query optimizer suboptimal planning with virtual tables

2013-03-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15/03/13 05:25, Clemens Ladisch wrote: > If you had no xBestIndex implementation, SQLite would crash. He is using APSW (a Python wrapper). It provides a default implementation if the developer does not. Here is the documentation:

Re: [sqlite] SQLite 3.7.16 beta

2013-03-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/03/13 17:28, Richard Hipp wrote: > The next release is currently scheduled for Monday, 2013-03-18. > > Please let us know as soon as possible if you see or suspect any issues > in the current beta. Thanks. I can provide the opposite data. My

Re: [sqlite] Announcement of Copy - A cross platform syncing app, that uses SQLite as its backend

2013-03-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/03/13 12:27, Jason Dictos wrote: > Overall SQLite has been the perfect solution to our situation. Thanks for the details. What programming language do you use? (Dropbox uses Python.) > Early on we figured out quite quickly not leverage the

Re: [sqlite] Announcement of Copy - A cross platform syncing app, that uses SQLite as its backend

2013-03-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/03/13 09:56, Jason Dictos wrote: > This app we wrote couldn't have happened without SQLite, I would be interested in hearing about the experience with SQLite, especially anything relevant to other developers. One of your competitors is Dropbox

Re: [sqlite] .dump - what isn't preserved?

2013-03-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/03/13 04:24, Dave McKee wrote: > What else isn't losslessly maintained in a dump -> load cycle? Various database settings and any strings with nuls in them. Also the sqlite shell expects to be loaded into a clean database. For example it

Re: [sqlite] Thread sync issue

2013-02-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/02/13 00:14, Roger Binns wrote: > On 23/02/13 21:23, Ashok Pitambar wrote: >> Sqlite doc says it thread safe ... > > http://www.sqlite.org/threadsafe.html > > What makes you think the doc is wrong? One big gotcha: er

Re: [sqlite] Thread sync issue

2013-02-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23/02/13 21:23, Ashok Pitambar wrote: > Sqlite doc says it thread safe ... http://www.sqlite.org/threadsafe.html What makes you think the doc is wrong? Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux)

Re: [sqlite] Do not read File change counter

2013-02-21 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 21/02/13 06:51, Joost Voogt wrote: > ... it would be nice, to minimize the amount of reads and gain > performance, ... Even if that happened, how much performance would you expect to be gained? If the bytes are frequently read they will end up in

Re: [sqlite] import TXT file

2013-02-21 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 21/02/13 02:34, Gert Van Assche wrote: > Does anyone see something obvious I'm doing wrong? There is no need to bash the SQLite shell into what you are trying to do. You can write your own code to read your file and insert each row into the

Re: [sqlite] "default value of column [name] is not constant." error in table creation when using double quoted string literal in parenthesis

2013-02-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/02/13 14:27, Simon Slavin wrote: > Any chance of killing it in SQLite 4 ? Continuing to beat a truly dead horse, it would be nice to help developers fix their existing codebase via something like an additional "lint mode".

Re: [sqlite] using the same sqlite parameter more than once causes premature memory deallocation

2013-02-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/02/13 06:01, abbood wrote: > i tried using the memory diagnostics tools in Xcode/Instruments -- > Zombies, GuardMalloc, and Malloc Stack Logging.. but they didn't tell > me much.. i'm assuming valgrind is better? They are fairly lightweight and

Re: [sqlite] sqlite3 Python interface

2013-02-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/02/13 10:00, James Vanns wrote: > I can find no further Python DBI/sqlite3 API documentation to suggest > either way. I tried it and it fails I guess that's it :( A flag needs to be set in the open call which pysqlite doesn't do. Heck the

Re: [sqlite] Load a Sqlite Database on Disk as an In-memory Database

2013-02-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/02/13 23:33, Alex Cheng wrote: > I want to write a program to load a sqlite database on disk as an > in-memory database, for sake of reducing number of disk I/O operations. > Do you know how to achieve it? You may not need to actually do that.

Re: [sqlite] Determine if an index has been created

2013-02-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/02/13 02:12, Paul Sanderson wrote: > I will know the name of the index - I just need to check that it has > been created. Just use pragma index_info on the index name. If it doesn't exist then you get no rows returned and if it does exist then

Re: [sqlite] SQLite3 Bug Report: The shell accepts some dot commands ending in semicolons while rejecting others.

2013-01-28 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28/01/13 21:11, Larry Brasfield wrote: > If anybody truly cares enough to make this behave better, it is > encapsulated in a function named "booleanValue(char *zArg)". For > myself, since it takes "0" and "1", which are easy to type, the present >

Re: [sqlite] identify virtual tables?

2013-01-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 25/01/13 12:57, Petite Abeille wrote: > and lower( sql ) like '% virtual %' It is worth pointing out that SQLite normalises the create table text for a table in the sqlite_master table. ie it always begins "CREATE VIRTUAL TABLE"

Re: [sqlite] using the same sqlite parameter more than once causes premature memory deallocation

2013-01-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 25/01/13 23:45, abbood wrote: > i fixed it!! you were right! it's not to do with the guts of sql.. > rather it's to do with my incorrect sql statement.. Huh? There is no SQL statement, valid or not, that can cause memory errors. It looks like

Re: [sqlite] Substring Search Across Many Columns

2013-01-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 25/01/13 12:59, Paul Vercellotti wrote: > As I understand, it's tricky to get FTS to do substring matching, no? > What's the best way to do that? In what way is it tricky? There are several examples of doing it in the doc I pointed to. Even when

Re: [sqlite] Substring Search Across Many Columns

2013-01-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 25/01/13 11:30, Paul Vercellotti wrote: > I'm trying to match a substring (case-insensitive) across multiple > columns and want it to go fast; it's very slow to do a query like '... > WHERE name LIKE "%fish%" OR desc LIKE "%red%" OR title LIKE >

Re: [sqlite] using the same sqlite parameter more than once causes premature memory deallocation

2013-01-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/01/13 17:37, abbood wrote: > Btw I'm curious how did you find out about this auto release thing? Can > you add more detail about that? I used a debugger to set a breakpoint in malloc_error_debug as the message says. That gave a stack trace of

Re: [sqlite] using the same sqlite parameter more than once causes premature memory deallocation

2013-01-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/01/13 00:24, abbood wrote: > then it crashes with the following error: malloc: *** error for object > 0x9b6350: pointer being freed was not allocated *** set a breakpoint > in malloc_error_break to debug Coincidentally enough I am debugging

Re: [sqlite] SQLITE starvation.

2013-01-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 16/01/13 07:59, Shuki Sasson wrote: > When we run the test we see that two threads are trying hundreds of > time to get through the begin unsuccessfully. Look at the code for the default busy handler (sqliteDefaultBusyCallback). It keeps retrying

Re: [sqlite] sqlite version of android 4.0.3

2013-01-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/01/13 16:23, sqlitekyounoii wrote: > I want to know sqlite version of android 4.0.3 My 4.0 device is 4.0.4 but I doubt they changed it. The version number is 3.7.4 and the source id is 2011-02-23 14:33:31

Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/01/13 00:22, Eduardo Morras wrote: > opened before the fork, and after it the childs use the database connection. I don't want to corrupt the database, https://sqlite.org/faq.html#q6 You can't use the database across forks. Parent and child

Re: [sqlite] 1.1GB database - 7.8 million records

2012-12-31 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 31/12/12 12:33, Michael Black wrote: > Journaling off might work if you don't have any indexes. You should create the indexes after inserting the data. If you don't you end up with index data and row data intermingled in the database which makes

Re: [sqlite] 1.1GB database - 7.8 million records

2012-12-31 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 31/12/12 10:35, Michael Black wrote: > One transaction like you did is best. > > I recently ran a test which ran pretty well with a commit every 1M > records. Doing every 100,000 records slowed things down dramatically. If you are creating the

Re: [sqlite] How to verify referential integrity of SQLite database

2012-12-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/12/12 12:36, Richard Hipp wrote: > Does anybody know of any reason why we should not do this? I would love if this was combined with an optional per page checksum that detects corruption early. Roger -BEGIN PGP SIGNATURE- Version:

Re: [sqlite] table backup

2012-12-11 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/12/12 03:46, dd wrote: > But in customers place, I am getting corruptions. Chances are that whatever corrupts your databases would also corrupt the backups. Here is something the Windows team found:

Re: [sqlite] Unql

2012-12-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/12/12 19:01, dcharno wrote: > What ever happened to Unql and is there any chance it will be revived? > It seemed like it would have been incredible useful. Warning: My opinion only Unql seemed to be especially pointless. Being somewhat

Re: [sqlite] table backup

2012-12-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/12/12 21:44, dd wrote: > Sometimes, sqlite databse corrupts. That is the problem you need to fix. If you have a system that is unreliable then it will also corrupt your backups. http://www.sqlite.org/lockingv3.html#how_to_corrupt

Re: [sqlite] table backup

2012-12-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/12/12 10:35, dd wrote: > i mean, for every write operation in a table. You should specify some of your other constraints and exactly what it is you are trying to achieve (*not* how you are trying to achieve it). The solutions range from

Re: [sqlite] Bug: Segmentation fault in libsqlite3.so.0.8.6[b69a4000+ac000]

2012-12-04 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/12/12 14:43, Paul Menzel wrote: > The following code caused the segmentation fault. By far the most likely cause is some other library or the app itself stomping on SQLite's memory. SQLite is on every Android device, every iOS device,

Re: [sqlite] list: Please allow signed messages.

2012-12-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/12/12 13:47, Paul Menzel wrote: > please allow signed messages to be sent to the list. > > I got: »The message's content type was not explicitly allowed« This works. Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux)

[sqlite] Deprecation of asyncvfs

2012-12-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The documentation also needs to say asyncvfs is out of favour, in particular on this page: http://www.sqlite.org/asyncvfs.html Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux)

Re: [sqlite] Windows (slow) vs. iOS/OSX (fast) Performance

2012-11-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30/11/12 13:31, David de Regt wrote: > Only possible agent is MSE, MSE is the best behaved. Norton and similar are especially bad. > ... and process monitor doesn't show it eating IO Sadly that rules out easy fixes :-) > I tried changing block

Re: [sqlite] Windows (slow) vs. iOS/OSX (fast) Performance

2012-11-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30/11/12 09:41, David de Regt wrote: > Is there something ridiculous about the windows file system performance > that hoses sqlite's open/read/write/close transaction cycle? There are multiple possible confounding factors. One is that you could

Re: [sqlite] "natrual" join (not "natural")

2012-11-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/11/12 18:25, Mark Brand wrote: > You mentioned that this extra AS might help avoid ambiguities and > errors. The only example of this you mentioned was where aliases names > with spaces are not quoted. Do you have cases of this in mind that >

Re: [sqlite] "natrual" join (not "natural")

2012-11-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/11/12 15:46, Mark Brand wrote: > A warning for "missing" AS would create noise and serve no purpose. Then ignore/don't use it for your perfect code! Other developers do use their own code (that could have been written years ago), other code

Re: [sqlite] "natrual" join (not "natural")

2012-11-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/11/12 14:32, Mark Brand wrote: > My point is that the proposed lint mode should worry more about 2) than > 1). I didn't think they are mutually exclusive. The class of probable errors detected overlaps. > ... as Oracle at least doesn't allow

Re: [sqlite] "natrual" join (not "natural")

2012-11-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/11/12 12:33, Mark Brand wrote: > The optionality of "AS" when aliasing column names is not strange. You are missing the point :-) I am not arguing for syntax changes or anything else in the core of SQLite or SQL. Instead in an additional

Re: [sqlite] "natrual" join (not "natural")

2012-10-31 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 31/10/12 07:27, Jonas Malaco Filho wrote: > Maybe there could be a strict switch. There is a ticket for a "lint" mode that would help catch common issues where there are possibly problems. This is another example of something appropriate for it

Re: [sqlite] Decimal point and localisation

2012-10-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 27/10/12 12:43, Steinar Midtskogen wrote: > But why can't sqlite observe LC_NUMERIC for the output - no ambiguity > would then arise? Because the SQLite library does not know where the output is going. If you ask for a number to be provided as a

Re: [sqlite] Database Memory Stream

2012-10-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/10/12 05:47, Chris Sonon wrote: > I would like to house my database in a ZIP file and extract the > database to a memory stream and then open it directly from the memory > stream? Is this possible? If so, how? You can get a zipvfs from the

Re: [sqlite] Problems in VFS file read

2012-10-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30/09/12 19:16, Roger Binns wrote: > Looking through the code for both VFS I don't see any attempt to check > the amount parameter is positive, and in both cases it silently gets > passed to a routine expecting unsigned (size_t or DWOR

[sqlite] Problems in VFS file read

2012-09-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 One of the parameters to read is the amount of data to read. Since SQLite avoids standard types like size_t, a signed int is used instead. I observed a difference in behaviour between the Unix VFS and the Windows VFS - the former returns an error

Re: [sqlite] Size of WAL file and cache

2012-09-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26/09/12 01:15, Sebastian Krysmanski wrote: > 1. I understand that the WAL file is stored on the disk. During a transaction the old pages and the new pages will both be present at some point no matter what mode is used. Consequently you should

Re: [sqlite] dynamic bulk import

2012-09-22 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22/09/12 13:41, Keith Medcalf wrote: > Take a look at the apsw (Another Python SQLite Wrapper) shell which has > an .autoimport command that may do what you want. Thanks for pointing out APSW (I'm the author). It is only necessary to use the APSW

Re: [sqlite] Virtual tables are driving me insane!

2012-09-21 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 21/09/12 14:44, Jörgen Hägglund wrote: > At this point I get an access violation in SQLite3.dll (reading of > address 0008) You are reading the third member of a structure that is NULL. You should use a debugger that catches this sort of

Re: [sqlite] Covering index scan optimization

2012-09-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15/09/12 18:23, Simon Slavin wrote: > PRAGMA lint_mode=ON I'm sure there is some ideal to preserve the "Lite" part of the name and a lint mode would be quite intrusive. I can imagine a separate compilation mode (eg another #define), or some

Re: [sqlite] Covering index scan optimization

2012-09-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15/09/12 11:57, Richard Hipp wrote: > ... and that this change merely exposes their brokenness. I won't > dispute that. Nevertheless, with this changes, those applications will > stop working. There is the lint mode request:

Re: [sqlite] Covering index scan optimization

2012-09-14 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >> Is there a chance that the change will go into SQLite mainline? > > Not without a copyright release. And it may require more especially if you are an employee. See the bottom section of http://www.sqlite.org/copyright.html And of course it is

Re: [sqlite] How to determine the effective cache size

2012-09-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28/08/12 12:48, Foster, Kristina (CIV) wrote: > Thank you for the clarification. I was wondering if I missed something > with the command line or Python interface. I will stay tuned for the > sqlite3_db_status method in future releases. A new

[sqlite] Error code inconsistency

2012-09-03 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The functions sqlite3_status and sqlite3_db_status do substantially the same thing (in different scopes) and have exactly the same signature and semantics. However the error code they return is gratuitously different when provided with a (currently

Re: [sqlite] How do you load a ".csv" and skip the first line?

2012-09-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/09/12 12:19, joe.fis...@tanguaylab.com wrote: > Is there some way to load a ".csv" file into a SQLite database table > when the first row (record) of the file contains headers? You may want to consider using the APSW shell. It has a

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