Re: [sqlite] FTS4 compress/uncompress functions

2011-04-12 Thread Dan Kennedy
On 04/13/2011 06:22 AM, Alexey Pechnikov wrote:
> Which functions will be correct? As example, affinity for uncompress
> functions can be as "blob" as "text". Now this is not important but
> some tests will be nice for future compability.

You mean what type of value should compress() return?

Any type. So long as uncompress() can transform the value back
to the original text.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Help with error codes

2011-04-12 Thread jeff archer
>drh   Tue Apr 12 22:23:38 GMT 2011
>
>Set your breakpoint on the function winAccess if you want to try to debug
>this.

If only it were that easy.  Its intermittent and attaching a debugger seems to 
mask the problem.  It's never been seen with only a single process and occurs 
more when there are more simultaneous processes.  To process 26 images with 8 
processes we are launching 8 processes for the first 8 images, then when each 
process terminates a new process is launghed on the next image until all are 
processed.

I am using a BEGIN IMMEDIATE transaction at the beginning of each process to 
check and maybe update the database.  This is to have write lock already if 
update is required and to serialize access to the database for making the check 
and potentially updating some config data.

I'm not really thinking of a good way to approach this.  I would greatly 
appreciate if anyone has any ideas.

Jeff Archer
Nanotronics Imaging
jsarc...@nanotronicsimaging.com
<330>819.4615 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] FTS4 compress/uncompress functions

2011-04-12 Thread Alexey Pechnikov
Which functions will be correct? As example, affinity for uncompress
functions can be as "blob" as "text". Now this is not important but
some tests will be nice for future compability.

-- 
Best regards, Alexey Pechnikov.
http://pechnikov.tel/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Help with error codes

2011-04-12 Thread Richard Hipp
On Tue, Apr 12, 2011 at 6:06 PM, jeff archer  wrote:

> I have a process which analyzes an image then writes results to database.
> (sqlite 3.7.4)
> When I run multiple of these in parallel, each on its own image but all on
> the
> same database, and all on same machine (Windows 7) I get an error from
> sqlite3_step() when attempting to execute "BEGIN IMMEDIATE".  I get
> proportionaly more errors when I run more processes in parallel.  A high
> percentage of the error occurs just after successful open when trying to
> check
> for some existing values to confirm this is correct file.
>
> The error looks like it is always from sqlite3_step() on the "BEGIN
> IMMEDIATE"
> I am getting a return from sqlite3_step() of 3338.
> sqlite3_errmsg16() is returning "disk I/O error"
> sqlite3_prepare16_v2 returned success.
>
>
3338 is the extended error code.  In your case it means that a call to
GetFileAttributesExW() failed for some reason other than
ERROR_FILE_NOT_FOUND.  I have no idea why that might be.

Set your breakpoint on the function winAccess if you want to try to debug
this.



> And now that I am digging into this I am not sure I have this correct.
> Am I supposed to get my error code from sqlite3_step() because I have now
> also
> noticed sqlite3_extended_errcode()?
> Is 3338 an extended error code?Do I need to use sqlite3_open_v2 to get the
> extended error code?
>
>  Jeff Archer
> Nanotronics Imaging
> jsarc...@nanotronicsimaging.com
> <330>819.4615
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Help with error codes

2011-04-12 Thread jeff archer
I have a process which analyzes an image then writes results to database.  
(sqlite 3.7.4)
When I run multiple of these in parallel, each on its own image but all on the 
same database, and all on same machine (Windows 7) I get an error from 
sqlite3_step() when attempting to execute "BEGIN IMMEDIATE".  I get 
proportionaly more errors when I run more processes in parallel.  A high 
percentage of the error occurs just after successful open when trying to check 
for some existing values to confirm this is correct file.

The error looks like it is always from sqlite3_step() on the "BEGIN IMMEDIATE"
I am getting a return from sqlite3_step() of 3338.
sqlite3_errmsg16() is returning "disk I/O error"
sqlite3_prepare16_v2 returned success.

And now that I am digging into this I am not sure I have this correct.
Am I supposed to get my error code from sqlite3_step() because I have now also 
noticed sqlite3_extended_errcode()?
Is 3338 an extended error code?Do I need to use sqlite3_open_v2 to get the 
extended error code?

 Jeff Archer
Nanotronics Imaging
jsarc...@nanotronicsimaging.com
<330>819.4615 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sorting Question

2011-04-12 Thread caurues

Thank you Igor!  Now I understand.

Caureus



Igor Tandetnik wrote:
> 
> caurues  wrote:
>> I am hoping I can get an answer to my question. I want to sort a column
>> in
>> ascending order, but I want null values to sort to the bottom. A simple
>> ORDER BY ColumnA ASC sorts the column in ascending order with null vales
>> appearing on top. The following code, however, works correctly, but I
>> have
>> no idea why: ORDER BY ColumnA IS NULL ASC, ColumnA ASC.
> 
> You are not limited to sorting just by a column name - you can sort by any
> expression. In particular, the expression (ColumnA IS NULL) evaluates to 0
> when the column is not null, and to 1 when it is. Then these zeros and
> ones are sorted in ascending order. This has the net effect of putting
> non-null values first and null values at the end.
> -- 
> Igor Tandetnik
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Sorting-Question-tp31378319p31383160.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] completion of sql words

2011-04-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/12/2011 11:16 AM, Sylvain Pointeau wrote:
> I just tried APSW on max os x,
> but how to get the auto-completion to work?
> it does not work for me...

It requires the Python readline module to work as that is what lets you edit
the command line and provides the callback when tab is pressed.  Due to
readline's licensing there is funky stuff going on on Mac.

If the above clues do not help then please send me private email and I'll
work with you to get this working for you.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2kqWUACgkQmOOfHg372QR52QCgxUSubT9bjoMeogKHIcbLbRjg
oBEAn1MSZD7gbRQqU5XvJimMQEl7EM22
=YbVV
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] completion of sql words

2011-04-12 Thread Sylvain Pointeau
Hello,

I just tried APSW on max os x,
but how to get the auto-completion to work?
it does not work for me...

Best regards,
Sylvain

On Sat, Apr 9, 2011 at 11:50 PM, Roger Binns  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 04/09/2011 02:03 PM, Edzard Pasma wrote:
> > I just made an alias in the shell (Unix-) for this tool:
> >
> > alias apsw='python -c "import apsw;apsw.main()"'
>
> I keep trying to make it so you can do "python -m apsw " and the code
> is
> structured to allow that, but in my investigations it seems like Python
> internals will only do it for a module written in Python and not one
> written
> in C.
>
> > Also reported an issue
>
> Anyone who is interested can follow along at the following link.  The APSW
> shell supports a superset of SQLite shell's invocation and hence the
> behaviours are a little inconsistent:
>
>  http://code.google.com/p/apsw/issues/detail?id=115
>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2g1JgACgkQmOOfHg372QTjRQCcDVMaLLR27OQWCVI/4R7yTVZ3
> j/sAoK8RD+R6VextcxboId7GI9O1jNRY
> =QjF4
> -END PGP SIGNATURE-
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Corruption on many Windows XP hosts

2011-04-12 Thread James Green
Incidentally running pragma integrity_check on one of the samples I
have been given returns:

*** in database main ***
On tree page 1824 cell 0: invalid page number 218103808
On page 73608 at right child: 2nd reference to page 92497
Page 92110 is never used
Page 92494 is never used
Page 92496 is never used
Page 92499 is never used
Page 92508 is never used
Page 92511 is never used
Page 92512 is never used
Page 92513 is never used
Error: database disk image is malformed

James
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem setting journal_mode=WAL

2011-04-12 Thread Pavel Ivanov
> If the 'COMMIT' reports that no transaction is active, why is the
> JOURNAL_MODE pragma still complaining about it being within a transaction?
> Am I missing something here?

Probably you have some not finalized SELECT statements still active.
To check that you can call sqlite3_close - it will fail in such case
too.


Pavel


On Tue, Apr 12, 2011 at 9:17 AM, Jaco Breitenbach
 wrote:
> Dear experts,
>
> My application makes use of several data files attached to the SQLite
> database.  Data files are attached on demand as they become necessary.  I'm
> experimenting with the WAL journalling mode as a speed/performance
> optimisation.  Unfortunately I'm having some difficulty setting the journal
> mode to WAL on the attached databases.
>
> Here is some diagnostic output:
> Setting database 'DC2_DB_20110412' journal mode to WAL.
> sqlite3_exec('0x1f8f57a8','COMMIT',NULL,NULL,'cannot commit - no transaction
> is active') = SQLITE_ERROR
> sqlite3_exec('0x1f8f57a8','PRAGMA
> DC2_DB_20110412.JOURNAL_MODE=WAL',NULL,NULL,'cannot change into wal mode
> from within a transaction') = SQLITE_ERROR
>
> The two sqlite3_exec() statements are executed directly after each other.
> If the 'COMMIT' reports that no transaction is active, why is the
> JOURNAL_MODE pragma still complaining about it being within a transaction?
> Am I missing something here?
>
> I'm working with SQLite 3.7.3.
>
> Best regards,
> Jaco
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.7.6

2011-04-12 Thread D . Richard Hipp

On Apr 12, 2011, at 8:49 AM, D. Richard Hipp wrote:

> SQLite version 3.7.6 is not available from the website:  
> http://www.sqlite.org/

The "not" in the sentence above should be "now", of course.  Sorry for the typo.

> 
> Version 3.7.6 is a regularly scheduled bi-monthly maintenance release.  
> Updating from version 3.7.5 is optional.  Updating from versions prior to 
> 3.7.5 is recommended.
> 
> A summary of changes in SQLite version 3.7.6 can be seen at
> 
>http://www.sqlite.org/releaselog/3_7_6.html
> 
> Please send email to the sqlite-users@sqlite.org mailing list, or directly to 
> me, if you encounter any problems.  Thanks.
> 
> D. Richard Hipp
> d...@hwaci.com
> 
> 
> 

D. Richard Hipp
d...@hwaci.com



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Corruption on many Windows XP hosts

2011-04-12 Thread James Green
On 12 April 2011 11:27, Simon Slavin  wrote:
>
> On 12 Apr 2011, at 10:15am, James Green wrote:
[ ... ]
> Was it built threadsafe ?  See
>
> http://www.sqlite.org/threadsafe.html

Apparently so - the odbc drivers use -DTHREADSAFE=1 when building sqlite.

[ ... ]

> You don't mention which parts of the documentation you're aware of, so I'll 
> point to the above and section 6 of
>
> 

I can confirm the following:

1. Power loss is not causing this
2. The database file is held locally (not on a network share of any sort)
3. We are not using transactions

Any further queries welcomed.

Thanks,

James
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Problem setting journal_mode=WAL

2011-04-12 Thread Jaco Breitenbach
Dear experts,

My application makes use of several data files attached to the SQLite
database.  Data files are attached on demand as they become necessary.  I'm
experimenting with the WAL journalling mode as a speed/performance
optimisation.  Unfortunately I'm having some difficulty setting the journal
mode to WAL on the attached databases.

Here is some diagnostic output:
Setting database 'DC2_DB_20110412' journal mode to WAL.
sqlite3_exec('0x1f8f57a8','COMMIT',NULL,NULL,'cannot commit - no transaction
is active') = SQLITE_ERROR
sqlite3_exec('0x1f8f57a8','PRAGMA
DC2_DB_20110412.JOURNAL_MODE=WAL',NULL,NULL,'cannot change into wal mode
from within a transaction') = SQLITE_ERROR

The two sqlite3_exec() statements are executed directly after each other.
If the 'COMMIT' reports that no transaction is active, why is the
JOURNAL_MODE pragma still complaining about it being within a transaction?
Am I missing something here?

I'm working with SQLite 3.7.3.

Best regards,
Jaco
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.7.6

2011-04-12 Thread Oliver Peters
  writes:

> 
> SQLite version 3.7.6 is not available from the website:  
> http://www.sqlite.org/
[...]

really not ;-) ?

Please don't disappoint your followers.

greetings
Oliver

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite version 3.7.6

2011-04-12 Thread D . Richard Hipp
SQLite version 3.7.6 is not available from the website:  http://www.sqlite.org/

Version 3.7.6 is a regularly scheduled bi-monthly maintenance release.  
Updating from version 3.7.5 is optional.  Updating from versions prior to 3.7.5 
is recommended.

A summary of changes in SQLite version 3.7.6 can be seen at

http://www.sqlite.org/releaselog/3_7_6.html

Please send email to the sqlite-users@sqlite.org mailing list, or directly to 
me, if you encounter any problems.  Thanks.

D. Richard Hipp
d...@hwaci.com



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sorting Question

2011-04-12 Thread Igor Tandetnik
caurues  wrote:
> I am hoping I can get an answer to my question. I want to sort a column in
> ascending order, but I want null values to sort to the bottom. A simple
> ORDER BY ColumnA ASC sorts the column in ascending order with null vales
> appearing on top. The following code, however, works correctly, but I have
> no idea why: ORDER BY ColumnA IS NULL ASC, ColumnA ASC.

You are not limited to sorting just by a column name - you can sort by any 
expression. In particular, the expression (ColumnA IS NULL) evaluates to 0 when 
the column is not null, and to 1 when it is. Then these zeros and ones are 
sorted in ascending order. This has the net effect of putting non-null values 
first and null values at the end.
-- 
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sorting Question

2011-04-12 Thread caurues

I am hoping I can get an answer to my question. I want to sort a column in
ascending order, but I want null values to sort to the bottom. A simple
ORDER BY ColumnA ASC sorts the column in ascending order with null vales
appearing on top. The following code, however, works correctly, but I have
no idea why: ORDER BY ColumnA IS NULL ASC, ColumnA ASC. Can someone please
explain why? I also tried ORDER BY ColumnA IS NULL ASC and this code sorted
only the null values to the bottom of the remaining unsorted list, which I
do not understand. I guess what I am not understanding is why the result of
filtering within an ORDER BY clause appears at the bottom of my list.
-- 
View this message in context: 
http://old.nabble.com/Sorting-Question-tp31378319p31378319.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Corruption on many Windows XP hosts

2011-04-12 Thread Simon Slavin

On 12 Apr 2011, at 10:15am, James Green wrote:

> We recently began shipping a third component - a Java app which again
> connected by ODBC. However, it used threads and the database fell over
> inside of hours. We found and fixed mulitple thread safety issues and
> the rate of corruption reduced signficantly. However the corruption
> issue remained albeit smaller in frequency.
> 
> In the past month or so we have tested more intensively with
> sqliteodbc-0.88 (sqlite 3.7.4 and 3.7.5 with our own build).

Was it built threadsafe ?  See

http://www.sqlite.org/threadsafe.html

> We can
> still corrupt the database however. So a couple of weeks ago we
> switched to using WAL mode which so far hasn't had any corruption to
> my knowledge.
> 
> I suspect that we are avoiding the root cause by switching the
> behaviour of sqlite on disk. My question is does anyone have pointers
> to help us isolate the problems we are seeing. We can obviously
> provide further detail to your questions.

You don't mention which parts of the documentation you're aware of, so I'll 
point to the above and section 6 of



just in case.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Corruption on many Windows XP hosts

2011-04-12 Thread James Green
We have an application that we distribute to our clients each of whom
run Windows - often it's a desktop XP machine. Our app consists of a
set of Delphi services and a PHP web front end each of which use ODBC
for database connectivity.

The vast majority of installations have shipped with sqliteodbc-0.83
(sqlite 3.6.14.2). Over several weeks a number of these installations
have broken down - our support staff have noticed problems with the
sqlite databases which turn out to be corrupt.

We recently began shipping a third component - a Java app which again
connected by ODBC. However, it used threads and the database fell over
inside of hours. We found and fixed mulitple thread safety issues and
the rate of corruption reduced signficantly. However the corruption
issue remained albeit smaller in frequency.

In the past month or so we have tested more intensively with
sqliteodbc-0.88 (sqlite 3.7.4 and 3.7.5 with our own build). We can
still corrupt the database however. So a couple of weeks ago we
switched to using WAL mode which so far hasn't had any corruption to
my knowledge.

I suspect that we are avoiding the root cause by switching the
behaviour of sqlite on disk. My question is does anyone have pointers
to help us isolate the problems we are seeing. We can obviously
provide further detail to your questions.

Many thanks,

James
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Disable lock controls on Windows

2011-04-12 Thread Marco Turco
Hi all,

As I remember it is possible to disable the Sqlite locking method in the
Unix compiled lib but is it possible also to disable the locking in the
Windows compiled lib of Sqlite ?

There are locking problems in some "exotic" hardware configuration for which
I should manage the locking method from myself using a semaphone file.

 

Any suggest ? Thanks in advance.

 

Regards,

 

Marco Turco

IT Business Devl Manager

Software XP LLP

 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users