Re: [sqlite] Database is Locked

2012-01-29 Thread Jan Hudec
On Sun, Jan 29, 2012 at 12:57:21 +0200, Shahar Weinstein wrote: I don't think that the TMP folder is the right direction but I'll check it anyway with the hosting company. No, *NOT* *HOSTING* *COMPANY*. Your code. I agree it's probably not the right direction though. besides that, I do know

Re: [sqlite] Database is Locked

2012-01-28 Thread Jan Hudec
On Sat, Jan 28, 2012 at 23:36:36 +0200, Shahar Weinstein wrote: I'm using System.Data.Sqlite the latest version that supports .NET 4 in an ordinary .NET website. when trying to issue a single update to the database I'm receiving the error message saying that the database file is locked. there

Re: [sqlite] Database is Locked

2012-01-28 Thread Jan Hudec
On Sun, Jan 29, 2012 at 00:43:07 +0200, Shahar Weinstein wrote: I know there is no permissions problems since after some time when I try the same action, it succeeds. in the website, I manage to read/write/delete in different locations of the code. Can it be that the database is really locked

Re: [sqlite] makefile for c

2012-01-24 Thread Jan Hudec
On Sun, Jan 15, 2012 at 15:17:37 -0600, Bill McCormick wrote: Tim Streater wrote, On 1/15/2012 3:00 PM: On 15 Jan 2012 at 20:44, Bill McCormickwpmccorm...@gmail.com wrote: What is the problem with the shared lib stuff? Black, Michael (IS) wrote, On 1/15/2012 2:27 PM: A simple one -- and

Re: [sqlite] VACUUM

2011-11-11 Thread Jan Hudec
On Fri, Nov 11, 2011 at 00:52:23 +0100, Fabian wrote: 2011/11/10 Richard Hipp d...@sqlite.org Because when you are inserting the Nth row, SQLite has no idea of how many more rows will follow or how big the subsequent rows will be, so it has no way to reserve contiguous space sufficient to

Re: [sqlite] NUL handling bugs (was Re: c-api document suggestion)

2011-09-26 Thread Jan Hudec
On Mon, Sep 26, 2011 at 12:44:08 -0400, David Garfield wrote: Using int instead of size_t A) unnaturally limits data length, possibly to 64K and B) doesn't well describe the data. Beyond that, it isn't necessarily a bug. The language needed size_t to provide a type guaranteed to be

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Jan Hudec
On Thu, Sep 15, 2011 at 18:58:00 +0100, Tim Streater wrote: On 15 Sep 2011 at 18:21, Jay A. Kreibich j...@kreibi.ch wrote: Why? It is a function call. One would expect all the parameters to be evaluated, and then the function called. In almost all languages, short-circuit evaluation

Re: [sqlite] help with a complicated join of two tables

2011-09-14 Thread Jan Hudec
On Mon, Sep 12, 2011 at 12:16:55 -0400, Igor Tandetnik wrote: On 9/12/2011 12:02 PM, Mr. Puneet Kishor wrote: On Sep 12, 2011, at 6:51 AM, Igor Tandetnik wrote: Something like this: select geo.id, min_age, max_age, age_bottom, age_top, name, color from geo left join intervals i on i.id =

Re: [sqlite] Encoding and Collation

2011-09-12 Thread Jan Hudec
On Sun, Sep 11, 2011 at 11:55:23 -0300, Antonio Maniero wrote: I doubt it that it would be ease to storing 8859 without string functions problems. The proper collation would be simple, of course, but probably I would need to re-implement all string functions too. Am I wrong? I can use utf8

Re: [sqlite] Bug in GCC - suggestions sought for a backup tool chain

2011-08-23 Thread Jan Hudec
On Mon, Aug 22, 2011 at 20:22:30 -0400, Richard Hipp wrote: (1) Compilers sometimes make mistakes. So it is important that you test your object code - not just your source code. That means running your test cases using exactly the same *.o files that you use for delivery. Fly what you test

Re: [sqlite] Field drop work around

2011-08-02 Thread Jan Hudec
On Tue, Aug 02, 2011 at 12:03:52 +0100, Jack Hughes wrote: Any ideas how I can remove unused fields from the database would be appreciated. I'd consider creating the new database from scratch and importing the data from the old one (by attaching it and doing insert ... select). That way you'd

Re: [sqlite] Field drop work around

2011-08-02 Thread Jan Hudec
On Tue, Aug 02, 2011 at 12:41:55 +, Black, Michael (IS) wrote: Since SQLite is type agnostic Actually no, it's not. The optimizer usually does much better job if the types are declared (I've seen many cases where it failed to use index when some column was untyped). Plus there are unique

[sqlite] sqlite3_soft_heap_limit affecting results? (debugging help request)

2011-07-27 Thread Jan Hudec
Hello, At $work we have an Android application that uses sqlite3 (compiled from amalgamation version 3.7.6.3 with a little tweak to get fdatasync() defined). In the application we set soft heap limit. Now today we noticed that something fails when the heap limit is 2MiB, but works fine when we

Re: [sqlite] Script-friendly execution of sqlite3.exe for initializing a DB

2011-07-18 Thread Jan Hudec
On Thu, Jul 14, 2011 at 16:20:56 -0500, Marvin Bellamy wrote: I want to run sqlite3 from a script (actually from a ToolTask in the MSBuild environment) and get it to create a database without dropping into interactive mode. It looks like ToolTasks don't like the redirection operator (they're

Re: [sqlite] Compiling sqlite

2011-07-13 Thread Jan Hudec
On Tue, Jul 12, 2011 at 17:37:57 +0300, Baruch Burstein wrote: The website (http://www.sqlite.org/about.html) says that sqlite can be compiled to under 300K. I am using mingw32, and with no configuration did I manage to get sqlite3.o below 400k. What compiler/compiler options are used to reach

Re: [sqlite] Is there any existing to open .db-wal file?

2011-07-12 Thread Jan Hudec
On Tue, Jul 12, 2011 at 13:13:25 +0900, 박성근 wrote: I am trying to investigate .db-wal file gathered from sudden power off. Why do you want to investigate it? When you open the db again and checkpoint it, sqlite will apply all the transactions that managed to finish before the power-off to the

Re: [sqlite] Sqlite help

2011-07-10 Thread Jan Hudec
On Tue, Jul 05, 2011 at 00:30:31 +0200, Wolfgang Enzinger wrote: Am Mon, 4 Jul 2011 14:45:07 -0700 (PDT) schrieb ceekayCK: unfortunately send me a .doc file You're at a loss there. Your friend could as well print this file and send you the printer output, essentially that would make no

Re: [sqlite] Compile sqlite3 with g++? Do I need a wrapper?

2011-06-28 Thread Jan Hudec
On Tue, Jun 28, 2011 at 11:07:50 +, Black, Michael (IS) wrote: I'd recommend NOT relying on the system sqlite3. That way you can control your changes. Let me express very, very strong disagreement with that. In Linux you should *always* use system sqlite and specify minimal required

Re: [sqlite] help needed to optimize a query

2011-06-28 Thread Jan Hudec
On Tue, Jun 28, 2011 at 17:33:23 +0300, Lazarus 101 wrote: Hi guys, i'm working on an Android app and using sqlite to store some data and i need some help with a query. I have the following table structure: FILES file_id INTEGER NOT NULL, Do file_ids repeat? If

Re: [sqlite] How to recover the SQLITE_CORRUPT error in C programming ?

2011-06-27 Thread Jan Hudec
On Mon, Jun 27, 2011 at 16:15:16 +0800, baiydavid wrote: Thanks for you help. when an SQLITE_CORRUPT error is returned, we can use .dump command to exports the data into a sql script, and then exec this sql in a new database, But how to dump the data into a sql script with C

Re: [sqlite] 3.7.7, URI filenames, and UNC paths

2011-06-26 Thread Jan Hudec
On Fri, Jun 24, 2011 at 11:28:56 -0400, Cheetah wrote: The documentation clearly states that using an authority other than localhost is not permitted. However, AFAICT, the standard form of a file: URI on windows for a UNC path uses exactly that. That's in accord with the URL specification.

Re: [sqlite] Turn off journal if no transaction

2011-06-25 Thread Jan Hudec
On Fri, Jun 24, 2011 at 22:41:16 -0700, Eugene Ong wrote: I don't use transactions in my app, There is no way not to use transactions. If you don't start transaction explicitly, implicit transaction will be started for each statement. This ensures that when a statement fails (e.g. because of

[sqlite] Ordered group by

2011-06-23 Thread Jan Hudec
Hello All, Is there a way to do group by query with well defined order of calls to the aggregate function? The problem is as follows. I have some objects in a database identified with obj_id. For each object, there are some arrays, represented in the normalized form like: create table array

Re: [sqlite] Query with UNION on large table

2011-06-23 Thread Jan Hudec
On Wed, Jun 22, 2011 at 10:25:52 -0700, Rense Corten wrote: CREATE TABLE table2 AS SELECT n1,n2 FROM (SELECT n1, n2 FROM table1 UNION SELECT n2 AS n1, n1 AS n2 FROM table1) WHERE(n1n2) GROUP BY n1,n2; Have you tried explaining it (prefix the whole query with explain query plan and run it)?

Re: [sqlite] Ordered group by

2011-06-23 Thread Jan Hudec
On Thu, Jun 23, 2011 at 12:48:51 -0400, Igor Tandetnik wrote: On 6/23/2011 11:37 AM, Jan Hudec wrote: Is there a way to do group by query with well defined order of calls to the aggregate function? Not reliably. So I want to denormalize the database by doing: create temporary

Re: [sqlite] Query with UNION on large table

2011-06-23 Thread Jan Hudec
On Thu, Jun 23, 2011 at 11:20:22 -0700, Rense Corten wrote: Wow, I'm almost embarrassed by how helpful you are, gentlemen. Thanks a lot. As to RAM: I'm trying this on two different machines, one with 12 Gb and one with 32 Gb RAM. I won't be able to get more in the near future. Something that

Re: [sqlite] TRANSACTIONs

2011-06-02 Thread Jan Hudec
On Wed, Jun 01, 2011 at 19:23:16 +0100, Simon Slavin wrote: On 1 Jun 2011, at 7:12pm, Jan Hudec wrote: Do not update a table if there is some select statement currently Actually insert, update and delete are OK. Drop and alter table are a problem. Pavel is right. He left out some

Re: [sqlite] Error (LOCKFILE_EXCLUSIVE_LOCK) at building sqlite project for pocket pc

2011-06-02 Thread Jan Hudec
On Wed, Jun 01, 2011 at 12:09:35 -0700, hmas wrote: Actually, I managed to make it work by selecting Windows Mobile 5.0 Pocket PC SDK instead of Pocket PC 2003 for the SDK in the procedure described in my first post. Than it might be that WM5.0 already supports that interface while PPC2003

Re: [sqlite] What is so slow on dropping tables?

2011-06-01 Thread Jan Hudec
On Tue, May 31, 2011 at 16:44:13 -0500, Nico Williams wrote: On Tue, May 31, 2011 at 4:22 PM, Simon Slavin slav...@bigfraud.org wrote: Split the DROP into two stages: DELETE FROM myTable; DROP TABLE myTable; Which one takes all the time ?  If it's the second one, then perhaps just

Re: [sqlite] Create DB file and then Create Table - Table FAILS.

2011-06-01 Thread Jan Hudec
On Wed, Jun 01, 2011 at 12:21:15 -0400, Richard Hipp wrote: On Wed, Jun 1, 2011 at 12:19 PM, Stephan Beal sgb...@googlemail.com wrote: On Wed, Jun 1, 2011 at 5:18 AM, Don Ireland sql...@donireland.com wrote: GenBookMRU_3 TEXT, GenBookMRU_4 TEXT); i might be very wrong here, but i

Re: [sqlite] Big difference in performance between Python and gcc

2011-06-01 Thread Jan Hudec
On Wed, Jun 01, 2011 at 09:25:04 +0200, Alessandro Marzocchi wrote: However I was surprised as the performance got a lot worse, with execution times being more than 3 times more. I tried everything I could think of and also peeked at python module's source but i couldn't find any way to get C

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Jan Hudec
On Wed, Jun 01, 2011 at 10:17:02 -0400, Pavel Ivanov wrote:  From within a BEGIN TRANSACTION and END TRANSACTION block, should I not update the same row in a table more than once? You can update it as many times as you need.  What are the exact limitations on what I can do during a

Re: [sqlite] Error (LOCKFILE_EXCLUSIVE_LOCK) at building sqlite project for pocket pc

2011-06-01 Thread Jan Hudec
On Wed, Jun 01, 2011 at 09:13:30 -0700, hmas wrote: Here is what I've read: = FYI, Compiling for Pocket PC 2003 stopped to work since version 3.7.1 and 3.7.2. So using 3.6.23.1 for now until it gets fixed.

Re: [sqlite] [BUG] Silent change in intergeral overflow handling in 3.7.6

2011-05-31 Thread Jan Hudec
Richard Hipp drh@... writes: On Wed, May 25, 2011 at 4:40 AM, Jan Hudec bulb@... wrote: I need condition object_id = side_id ~(1 63) but that's not valid syntax. Yeah it is. Try, for example: SELECT 1234 ~(163); SELECT (-1234) ~(163); Wow, thanks. It's

Re: [sqlite] Bug in sqlite3_bind_parameter_name

2011-05-31 Thread Jan Hudec
On Tue, May 31, 2011 at 08:00:40 -0400, Richard Hipp wrote: On Mon, May 30, 2011 at 11:27 PM, Patrick Earl pate...@patearl.net wrote: SELECT this_.studentId as studentId143_0_, this_.Name as Name143_0_, this_.address_city as address3_143_0_, this_.address_state as

[sqlite] What is so slow on dropping tables?

2011-05-31 Thread Jan Hudec
Hellow folks, At $work we have an application that processes *huge* (tens of millions of rows in some of the larger tables, sometimes over 30GiB file size). This application changes and when it does, it drops some tables and calculates them again. What is somewhat surprising is that dropping the

Re: [sqlite] What is so slow on dropping tables?

2011-05-31 Thread Jan Hudec
On Tue, May 31, 2011 at 14:29:11 -0500, Nico Williams wrote: Just a guess: finding all the pages to free requires traversing the internal nodes of the table's b-tree, which requires reading a fair subset of the table's b-tree, which might be a lot of I/O. At 150MB/s it would take almost two

Re: [sqlite] What is so slow on dropping tables?

2011-05-31 Thread Jan Hudec
On Tue, May 31, 2011 at 12:30:59 -0700, Roger Binns wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/31/2011 12:18 PM, Jan Hudec wrote: and calculates them again. Have you considered using virtual tables so that the calculations are done on access as needed rather than up

Re: [sqlite] [BUG] Silent change in intergeral overflow handling in 3.7.6

2011-05-26 Thread Jan Hudec
Igor Tandetnik itandetnik@... writes: Jan Hudec bulb@... wrote: (it would be nicest if sqlite could get bitwise not one day). -x-1 is equivalent, assuming two's complement representation. Gotcha! No, it's not. -1-x is equivalent, but -x-1 is not: sqlite select -1-(163), -(163)-1

[sqlite] [BUG] Silent change in intergeral overflow handling in 3.7.6

2011-05-25 Thread Jan Hudec
still does, so I can convert it, but it's error-prone situation). Regards, Jan -- - Jan Hudec b...@ucw.cz ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman

Re: [sqlite] [BUG] Silent change in intergeral overflow handling in 3.7.6

2011-05-25 Thread Jan Hudec
Radovan Antloga radovan.antloga@... writes: http://www.sqlite.org/releaselog/3_7_6.html Ok, I see it's mentioned there. Given that it changes semantics I would have expected it to be mentioned more prominently though. Now may I ask why it was done? Are there some known real world cases where

Re: [sqlite] [BUG] Silent change in intergeral overflow handling in 3.7.6

2011-05-25 Thread Jan Hudec
Richard Hipp drh@... writes: On Wed, May 25, 2011 at 4:40 AM, Jan Hudec bulb@... wrote: Hello All, Semantics of operations on integers changed between 3.7.5 and 3.7.6. It does not seem to be mentioned in change log (http://www.sqlite.org/news.html), 4th bullet here: http