Re: [sqlite] corrupt database recovery

2009-05-28 Thread Gene Allen
We weren't logging the encryption failure. The feof() does return true until you attempt to read PAST the end of a >> file. The "does" in the above line should be "doesn't" >> while code Yeah, this code was written as a 'do...while', instead of a 'while do.' -Original Message-

Re: [sqlite] corrupt database recovery

2009-05-28 Thread John Machin
On 29/05/2009 10:18 AM, John Machin wrote: > On 29/05/2009 9:34 AM, Gene Allen wrote: >> Yeah. >> >> Since my code works in blocks, read/compress/encrypt/write, loop. Almost >> all the real data was being written to the compressed file, however any >> finalization and flushing of the stream

Re: [sqlite] Slow Transaction Speed?

2009-05-28 Thread Jay A. Kreibich
On Thu, May 28, 2009 at 03:12:55PM -0700, Allen Fowler scratched on the wall: > > > just for anybody who is interested: > > > > > I translated Jim's function into window code and added > > a page of 1024 that will be written, instead of a single byte. > > On my Win-XP system I got 55 TPS, much

Re: [sqlite] corrupt database recovery

2009-05-28 Thread John Machin
On 29/05/2009 9:34 AM, Gene Allen wrote: > Yeah. > > Since my code works in blocks, read/compress/encrypt/write, loop. Almost > all the real data was being written to the compressed file, however any > finalization and flushing of the stream wasn't occurring (since the encrypt > was failing)

Re: [sqlite] corrupt database recovery

2009-05-28 Thread Allen Fowler
> > Since my code works in blocks, read/compress/encrypt/write, loop. Almost > all the real data was being written to the compressed file, however any > finalization and flushing of the stream wasn't occurring (since the encrypt > was failing) so the last bit of any SQLite database wouldn't

Re: [sqlite] add column creating null columns even with default?

2009-05-28 Thread John Machin
On 29/05/2009 2:53 AM, Simon Slavin wrote: > On 28 May 2009, at 9:00am, Damien Elmes wrote: > >> alter table cardModels add column allowEmptyAnswer boolean not null >> default 1 > >> sqlite> update cardModels set allowEmptyAnswer = 0; > > You're obviously used to other implementations of SQL.

Re: [sqlite] corrupt database recovery

2009-05-28 Thread Gene Allen
Yeah. Since my code works in blocks, read/compress/encrypt/write, loop. Almost all the real data was being written to the compressed file, however any finalization and flushing of the stream wasn't occurring (since the encrypt was failing) so the last bit of any SQLite database wouldn't be

[sqlite] TOCTOU pager bug in 3.6.14.2

2009-05-28 Thread Brian Dantes
See Ticket 3883 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] corrupt database recovery

2009-05-28 Thread Allen Fowler
> I think I found my defect: my old stress tests was based on doing > compression/encryptions/decryption/decompression passes on files of random > sizes; so I would do about a 10 million passes or so and say...that's pretty > good. > > Well...a more structured test exposed the problem and it

Re: [sqlite] Slow Transaction Speed?

2009-05-28 Thread Allen Fowler
> just for anybody who is interested: > > I translated Jim's function into window code and added > a page of 1024 that will be written, instead of a single byte. > On my Win-XP system I got 55 TPS, much faster than sqlite > seems to write a page but that might be related to the > additional

Re: [sqlite] SQlite performance on multi process env

2009-05-28 Thread Griggs, Donald
Subject: Re: [sqlite] SQlite performance on multi process env Hello, Zhrahman, Regarding: "... kindly suggest how to properly have the database shared in memory among n number of processes. So they can execute select operatins(read only no update on teh database) effeciently." If the

Re: [sqlite] SQlite performance on multi process env

2009-05-28 Thread Jay A. Kreibich
On Thu, May 28, 2009 at 10:53:34AM -0700, zhrahman scratched on the wall: > > Few other info > I am running it on Linux. So to make the long story short, kindly suggest > how to properly have the database shared in memory among n number of > processes. You can't. ":memory:" databases cannot

Re: [sqlite] Is this test failure serious: *malloc*.transient.42 failures (expected [1 1], got [0 {}])?

2009-05-28 Thread D. Richard Hipp
On May 28, 2009, at 4:12 PM, Nicolas Williams wrote: > >> To debug, set a breakpoint on sqlite3Fault(). That routine is called >> whenever an OOM fault is simulated. Run to the point of the OOM >> fault >> that is causing the problem. Figure out which malloc() is falling >> and >> why the

Re: [sqlite] Is this test failure serious: *malloc*.transient.42 failures (expected [1 1], got [0 {}])?

2009-05-28 Thread Nicolas Williams
On Thu, May 28, 2009 at 04:00:07PM -0400, D. Richard Hipp wrote: > These are tests that simulate a malloc() failure (aka "out-of-memory" > or OOM fault) to verify that nothing crashes or leaks following an OOM > fault and that an SQLITE_NOMEM error is reported back out at the top > level.

Re: [sqlite] corrupt database recovery

2009-05-28 Thread Gene Allen
I have not! but I just might...thanks for the tip. I think I found my defect: my old stress tests was based on doing compression/encryptions/decryption/decompression passes on files of random sizes; so I would do about a 10 million passes or so and say...that's pretty good. Well...a more

Re: [sqlite] Is this test failure serious: *malloc*.transient.42 failures (expected [1 1], got [0 {}])?

2009-05-28 Thread D. Richard Hipp
On May 28, 2009, at 3:32 PM, Nicolas Williams wrote: > I'm getting these failures in gmake fulltest output for SQLite3 > 3.6.14.2 > on Solaris x86 (32- and 64-bit): > > altermalloc-1.transient.42... > Expected: [1 1] > Got: [0 {}] > > Are these failures a problem? How would I start to

[sqlite] Default page size based on filesystem

2009-05-28 Thread Nicolas Williams
Looking at the changelog I see that in 3.6.12 SQLite3 gained the ability to set the default page size for new databases according to the filesystem's preference: # The default page size on windows is automatically adjusted to match the capabilities of the underlying filesystem. I had a patch

[sqlite] Is this test failure serious: *malloc*.transient.42 failures (expected [1 1], got [0 {}])?

2009-05-28 Thread Nicolas Williams
I'm getting these failures in gmake fulltest output for SQLite3 3.6.14.2 on Solaris x86 (32- and 64-bit): altermalloc-1.transient.42... Expected: [1 1] Got: [0 {}] ... attachmalloc-1.transient.42... Expected: [1 1] Got: [0 {}] ... malloc6-1.transient.42... Expected: [1 1] Got: [0

Re: [sqlite] SQlite performance on multi process env

2009-05-28 Thread John Elrick
zhrahman wrote: > Few other info > I am running it on Linux. So to make the long story short, kindly suggest > how to properly have the database shared in memory among n number of > processes. So they can execute select operatins(read only no update on teh > database) effeciently. >

Re: [sqlite] SQlite performance on multi process env

2009-05-28 Thread zhrahman
Few other info I am running it on Linux. So to make the long story short, kindly suggest how to properly have the database shared in memory among n number of processes. So they can execute select operatins(read only no update on teh database) effeciently. -- View this message in context:

Re: [sqlite] add column creating null columns even with default?

2009-05-28 Thread Simon Slavin
On 28 May 2009, at 9:00am, Damien Elmes wrote: > alter table cardModels add column allowEmptyAnswer boolean not null > default 1 > sqlite> update cardModels set allowEmptyAnswer = 0; You're obviously used to other implementations of SQL. 'boolean' isn't a legit type name:

Re: [sqlite] SQlite performance on multi process env

2009-05-28 Thread zhrahman
So yes the hard disk is shared. I tried to even load the database in memory. It is still horribly slow. I want to understand this. If I load the database in memory how can I make the memory sharable among 100 processes. I am running in quad core environement. So my goal here is to load the

Re: [sqlite] corrupt database recovery

2009-05-28 Thread Ken
Gene, Im sure others have suggested, but have you tried running your code through valgrind? Can you remove the custom VFS ? --- On Wed, 5/27/09, Gene Allen wrote: > From: Gene Allen > Subject: Re: [sqlite] corrupt database recovery > To:

Re: [sqlite] GROUPY BY alias backward incompatibility

2009-05-28 Thread Virgilio Alexandre Fornazin
Curious... even it does not make sense, it pass also on oracle 11g (sql server actively refused to run) SQL Server 2008: SELECT (SELECT COUNT(*) FROM T t_inner GROUP BY t_outer.c) FROM T t_outer -- Msg 164, Level 15, State 1, Line 1 -- Each GROUP BY expression must contain at least one column

Re: [sqlite] GROUPY BY alias backward incompatibility

2009-05-28 Thread Ralf Junker
At 15:37 28.05.2009, D. Richard Hipp wrote: >Have you tried these two queries on other SQL database engines besides >SQLite? What do PostgreSQL and MySQL make of them? MySQL (5.0.21) reports no erros on either of both queries: select (select count(*) from t t_inner group by

Re: [sqlite] SQLite3 question

2009-05-28 Thread John Machin
On 28/05/2009 10:53 PM, Igor Tandetnik wrote: > "Oza, Hiral_Dineshbhai" > wrote in > message > news:24ea477c0c5854409ba742169a5d71c406bd4...@mailhyd2.hyd.deshaw.com >> Can you please let me know meaning of 'Cell' in Btrees used in >> sqlite3. > > Can you point to

Re: [sqlite] GROUPY BY alias backward incompatibility

2009-05-28 Thread D. Richard Hipp
On May 28, 2009, at 7:01 AM, Ralf Junker wrote: > > drop table if exists t; > create table t (c); > select >(select count() from t as t_inner > group by t_outer.c) > from t as t_outer; > > This behaviour changed in version 3.5.4. From then on, SQLite issues > an "SQL error near

Re: [sqlite] GROUPY BY alias backward incompatibility

2009-05-28 Thread Ralf Junker
At 13:27 28.05.2009, D. Richard Hipp wrote: >On May 28, 2009, at 7:01 AM, Ralf Junker wrote: > >> Hello! >> >> Up to version 3.5.3, SQLite would happily execute this SQL without >> complaints: >> >> drop table if exists t; >> >> create table t (c); >> >> select >>(select count() from t

Re: [sqlite] GROUPY BY alias backward incompatibility

2009-05-28 Thread Ralf Junker
At 13:27 28.05.2009, D. Richard Hipp wrote: >On May 28, 2009, at 7:01 AM, Ralf Junker wrote: > >> Hello! >> >> Up to version 3.5.3, SQLite would happily execute this SQL without >> complaints: >> >> drop table if exists t; >> >> create table t (c); >> >> select >>(select count() from t

Re: [sqlite] SQLite3 question

2009-05-28 Thread Igor Tandetnik
"Oza, Hiral_Dineshbhai" wrote in message news:24ea477c0c5854409ba742169a5d71c406bd4...@mailhyd2.hyd.deshaw.com > Can you please let me know meaning of 'Cell' in Btrees used in > sqlite3. Can you point to the text where you saw sqlite3, B-trees and the word

Re: [sqlite] SQLite3 question

2009-05-28 Thread D. Richard Hipp
On May 28, 2009, at 8:43 AM, Oza, Hiral_Dineshbhai wrote: > > Can you please let me know meaning of 'Cell' in Btrees used in > sqlite3. See line 43 of the btreeInt.h source file for the definition. You will want to read the previous 42 lines of that same file for context. D. Richard Hipp

Re: [sqlite] SQL question - not sure if it's possible at all

2009-05-28 Thread Dennis Volodomanov
Igor Tandetnik wrote: > Well, there's no way to tell how records with the same Date are going to > end up ordered in the original query. If you impose some deterministic > order there, e.g. with > > ORDER BY Date, Id > > then you can do something like this: > > select count(*) > from Data d,

[sqlite] SQLite3 question

2009-05-28 Thread Oza, Hiral_Dineshbhai
Hi, I am new to this list, so I am not sure whether this is the right forum to get this information... Can you please let me know meaning of 'Cell' in Btrees used in sqlite3. Thank you. -Hiral ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] SQL question - not sure if it's possible at all

2009-05-28 Thread Igor Tandetnik
"Dennis Volodomanov" wrote in message news:4a1e80dd.9040...@psunrise.com > Igor Tandetnik wrote: >>> and let's say, "Data" has an "ID" field (primary index). >>> >>> Is it possible to find out the *position* in the returned result set >>> of a Data with a given ID? >>> >> >>

Re: [sqlite] SQL question - not sure if it's possible at all

2009-05-28 Thread Dennis Volodomanov
Igor Tandetnik wrote: >> and let's say, "Data" has an "ID" field (primary index). >> >> Is it possible to find out the *position* in the returned result set >> of a Data with a given ID? >> > > select count(*) from Data > where PlotOnGraph=1 > and Date < (select Date from Data where

[sqlite] SQL question - not sure if it's possible at all

2009-05-28 Thread Dennis Volodomanov
Hello all, I'm not sure if this can be done in SQL, but if it can, I'd appreciate your help. Let's say I've got this query: SELECT * FROM (SELECT * FROM Data WHERE PlotOnGraph=1 ORDER BY Date ASC) LIMIT ?2 OFFSET ?1 and let's say, "Data" has an "ID" field (primary index). Is it possible to

Re: [sqlite] GROUPY BY alias backward incompatibility

2009-05-28 Thread D. Richard Hipp
On May 28, 2009, at 7:01 AM, Ralf Junker wrote: > Hello! > > Up to version 3.5.3, SQLite would happily execute this SQL without > complaints: > > drop table if exists t; > > create table t (c); > > select >(select count() from t t_inner > group by t_outer.c) > from t t_outer; >

[sqlite] GROUPY BY alias backward incompatibility

2009-05-28 Thread Ralf Junker
Hello! Up to version 3.5.3, SQLite would happily execute this SQL without complaints: drop table if exists t; create table t (c); select (select count() from t t_inner group by t_outer.c) from t t_outer; This behaviour changed in version 3.5.4. From then on, SQLite issues an

[sqlite] Corrupted database with Atomic write sector ?

2009-05-28 Thread SuperCommit
Hi, We have performance issues with SQLite running on our file system (remote FS using Atomic Write Sector). In fact we are limited with the number of write by second allowed by our file system, let’s say we have 10 write/s After a series of benchmarks the log file (journal) seems to be the

Re: [sqlite] Slow Transaction Speed?

2009-05-28 Thread Marcus Grimm
just for anybody who is interested: I translated Jim's function into window code and added a page of 1024 that will be written, instead of a single byte. On my Win-XP system I got 55 TPS, much faster than sqlite seems to write a page but that might be related to the additional overhead sqlite

Re: [sqlite] Foreign Keys and Indexes

2009-05-28 Thread s . breitholz
> s.breith...@staubli.com wrote: > > So when I have a query over serveral tables normally the primay key > > is set as index when the table is joined. > > Only if you actually join on primary key column(s). Doing so is common, > but not mandatory. > > > If I need to add a where > > clause > >

[sqlite] add column creating null columns even with default?

2009-05-28 Thread Damien Elmes
Hi, My application issues an 'add column' statement to an sqlite database, like: alter table cardModels add column allowEmptyAnswer boolean not null default 1 alter table cardModels add column typeAnswer text not null default Most of the time this works, but sometimes users send me a database

Re: [sqlite] SQlite performance on multi process env

2009-05-28 Thread Sylvain Pointeau
the hard disk is shared so it is a critical resource,as well as 100 processes doesn't seem realistic on a single processor, dual core or not. so I can understand your result, I find even them not too bad ... Cheers, Sylvain On Thu, May 28, 2009 at 12:38 AM, zhrahman