Re: [sqlite] Can this be done in one query?

2012-09-09 Thread Petite Abeille
On Sep 9, 2012, at 6:51 AM, Darren Duncan wrote: > You will need to use a subquery to do what you want, because you want to do a > join on the results of a group by. This is one example of syntax: > > select * from audtbl where (RowID, ChangeDate) in >(select

[sqlite] Alter table constraint question

2012-09-09 Thread Andrea Peri
Hi, I'm an user of sqlite with the spatial extension "spatialite". I see the sqlite db allow to define a constraints when are in the creating phase of the table. But is not possible to add or drop a constraint after the table is created. In the GIS data the availability of the constraints is a

Re: [sqlite] bus error on sparc machines

2012-09-09 Thread Tal Tabakman
Hi I have a crash when running a sqlite based app on solaris machines in 64 bits mode. the crash is actually a bus error when executing an sqlite_exec. As recommended in this forum ,when running with gdb, I found that the crash is in this line: pIndex->azColl[i] = zColl; This is the stack

Re: [sqlite] Alter table constraint question

2012-09-09 Thread Peter Haworth
Hi Andrea, There are several commercial products that will provide this capability along with many other schema maintenance functions not available in sqlite itself. I have one such available, SQLiteAdmin, at www.lcsql.com. Pete lcSQL Software On Sun, Sep 9, 2012 at 9:00

Re: [sqlite] bus error on sparc machines

2012-09-09 Thread Simon Slavin
On 9 Sep 2012, at 12:49pm, Tal Tabakman wrote: > "CREATE > INDEX IDX_OBJ on entries (obj_id, path);;" Just on the offchance, please try it with just one semi-colon, and again with no semi-colons. I don't think that's the problem, but it might show up something

Re: [sqlite] Alter table constraint question

2012-09-09 Thread Peter Aronson
As pointed out, there are products out there that will add or drop constraints (by doing all the tedious table creation/rename/drop under the covers) for SQLite. The other approach is to do what SpatiaLite does in general -- use triggers instead of check constraints but for the same purpose

Re: [sqlite] bus error on sparc machines

2012-09-09 Thread Pavel Ivanov
> However, bus errors are often the result of something in your own code, or of > not checking the result codes returned by all your previous SQLite3 calls. Simon, You are confusing bus errors with segmentation faults. They are different things and bus errors inside SQLite can never be caused

[sqlite] sqlite3DbMallocRaw problem

2012-09-09 Thread David Levinson
All, In the sqlite3DbMallocRaw() function I just encountered a failure where pBuf is undefined and causes a crash on "db->lookaside.pFree = pBuf->pNext". I see that pBuf is created (not initialized) and then later a check is made for pBuf (null) -> pNext and poof my app crashes. I have no

Re: [sqlite] sqlite3DbMallocRaw problem

2012-09-09 Thread David Levinson
All, I wanted to revise my last email regarding the failure within sqlite3DbMallocRaw() ... The point of failure is "db->lookaside.pFree = pBuf->pNext;" and it appears that pBuf points to an invalid memory location since Windows report a memory access violation. Does anyone know how to

[sqlite] Documentation correction (FAQ for deleted records)

2012-09-09 Thread Kenn White
Hello, On the current FAQ, item #20 (http://www.sqlite.org/faq.html#q20) and possibly #20 needs updating: 20. "...If SQLITE_SECURE_DELETE is not used and VACUUM has not been run, then some of the deleted content might still be in the database file, in areas marked for reuse. But, again, there

[sqlite] Possible bug - journal_mode DELETE/TRUNCATE

2012-09-09 Thread Daniel Frimerman
I am fairly new to sqlite and as a result of not reading the manual and not doing some performance testing, I got punished somewhat. I did not anticipate that on journal_mode=DELETE and synchronous=FULL, I would get no more than 5 inserts (in auto-commit mode) per second. It crippled a certain

Re: [sqlite] sqlite3DbMallocRaw problem

2012-09-09 Thread Pavel Ivanov
If pBuf points to an invalid memory it's possible that you use already closed connection or already finalized statement. Or maybe your application corrupts SQLite's memory. Try to run your program under a memory debugger. Pavel On Sat, Sep 8, 2012 at 10:11 AM, David Levinson

Re: [sqlite] sqlite3DbMallocRaw problem

2012-09-09 Thread Richard Hipp
On Sat, Sep 8, 2012 at 12:40 PM, David Levinson wrote: > All, > > In the sqlite3DbMallocRaw() function I just encountered a failure where > pBuf is undefined and causes a crash on "db->lookaside.pFree = > pBuf->pNext". I see that pBuf is created (not initialized) and then

Re: [sqlite] Possible bug - journal_mode DELETE/TRUNCATE

2012-09-09 Thread Pavel Ivanov
Note: attachments are stripped out of this list. So if you want for anybody else to see your zip file you need to put it on some website and post link here. About the problem you have: I wonder how are you sure that there should be 50 rows in the database and not 49? If you are resetting the OS

Re: [sqlite] bus error on sparc machines

2012-09-09 Thread Richard Hipp
On Sun, Sep 9, 2012 at 7:49 AM, Tal Tabakman wrote: > Hi > > I have a crash when running a sqlite based app on solaris machines in 64 > bits mode. the crash is actually a bus error when executing an sqlite_exec. > There was a bug that effected Sparc back in version

Re: [sqlite] Possible bug - journal_mode DELETE/TRUNCATE

2012-09-09 Thread Daniel Frimerman
My apologies about the attachment; should have known better. This should be better: https://dl.dropbox.com/u/50838941/SQLite3_Test.zip I only get the problem with DELETE and TRUNCATE journal_mode (synchronous set to NORMAL or FULL), but not with PERSIST (synchronous set to NORMAL or FULL) or WAL

Re: [sqlite] Possible bug - journal_mode DELETE/TRUNCATE

2012-09-09 Thread Simon Slavin
On 9 Sep 2012, at 9:15pm, Daniel Frimerman wrote: > The reason I think there has to be 50 rows is because on FULL mode for > example, the I/O buffers are flushed, and it's consistently missing 1 > record as opposed to any other number of records. I insert 50 records,

[sqlite] bus error on sparc machines

2012-09-09 Thread Tal Tabakman
Hi, this is a copy paste from the sqlite3 heade /** ** This file is an amalgamation of many separate C source files from SQLite ** version 3.7.9. By combining all the individual C code files into this ** single large

Re: [sqlite] Possible bug - journal_mode DELETE/TRUNCATE

2012-09-09 Thread Daniel Frimerman
Actually, I am not using sqlite at the API level. That's why prepared a bunch of batch files that reproduce the issue with sqlite command line shell. To answer your question, the queries complete in sqlite3 command line, and they also complete successfully using the API, albeit, through a

Re: [sqlite] bus error on sparc machines

2012-09-09 Thread Kees Nuyt
On Mon, 10 Sep 2012 00:07:53 +0300, Tal Tabakman wrote: > Hi, > this is a copy paste from the sqlite3 heade > /** > ** This file is an amalgamation of many separate C source files from SQLite

Re: [sqlite] Can this be done in one query?

2012-09-09 Thread Darren Duncan
Petite, well yes, the syntax you gave, subquery in the from clause, is functionally equivalent to the one I gave; either way we are returning the foo records that match the result of the subquery. In other words, I agree with you, and could have written it the way you did, but I considered my

[sqlite] [Question] Does it necessary to sync directory on persist journal mode?

2012-09-09 Thread Yongil Jang
Dear sqlite-users, I have a question about directory sync. Question: In case of journal file already exists on disk with persist journal mode, does it necessary to sync directory for first fsync(unixSync) call? AFAIK, directory sync should be called when a file is created or

Re: [sqlite] Possible bug - journal_mode DELETE/TRUNCATE

2012-09-09 Thread Dan Kennedy
On 09/10/2012 03:15 AM, Daniel Frimerman wrote: My apologies about the attachment; should have known better. This should be better: https://dl.dropbox.com/u/50838941/SQLite3_Test.zip I only get the problem with DELETE and TRUNCATE journal_mode (synchronous set to NORMAL or FULL), but not with