Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-22 Thread mon siong

Both processes on a single computer accessing a local file system. The sqlite 
file is store in USB drive , and I notice if the database corrupt , the journal 
or shm file is also corrupt .  
 

On Thursday, June 23, 2016 12:48 PM, Scott Robison 
 wrote:
 

 On Jun 22, 2016 9:25 PM, "mon siong"  wrote:
>
>
> PHP use 3.7.7.1 and my c program use 3.8.4.3 . Different version of
sqlite is fine ?
> I tried WAL and Delete Journal Mode , both type cause the db to corrupt .
>
> Under which scenario, two different global variables will be used ?

Is either process accessing the files over a networked file system or are
both processes on a single computer accessing a local file system?

>
>
>    On Thursday, June 23, 2016 11:13 AM, Simon Slavin <
slav...@bigfraud.org> wrote:
>
>
>
> On 23 Jun 2016, at 3:52am, mon siong  wrote:
>
> > PHP is using sqlite3 library (http://php.net/manual/en/book.sqlite3.php)
> > and C program is handle the sqlite using Serialized.
> >
> > Both of them are accessing the same DB at the same time . This can
cause DB corrupt ?
>
> No.  These two work correctly together.  You should get no corruption
from using these two together.
>
> Are you using any PRAGMA commands ?
>
> What is the result of "PRAGMA journal_mode" ?
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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


Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-22 Thread Scott Robison
On Jun 22, 2016 9:25 PM, "mon siong"  wrote:
>
>
> PHP use 3.7.7.1 and my c program use 3.8.4.3 . Different version of
sqlite is fine ?
> I tried WAL and Delete Journal Mode , both type cause the db to corrupt .
>
> Under which scenario, two different global variables will be used ?

Is either process accessing the files over a networked file system or are
both processes on a single computer accessing a local file system?

>
>
> On Thursday, June 23, 2016 11:13 AM, Simon Slavin <
slav...@bigfraud.org> wrote:
>
>
>
> On 23 Jun 2016, at 3:52am, mon siong  wrote:
>
> > PHP is using sqlite3 library (http://php.net/manual/en/book.sqlite3.php)
> > and C program is handle the sqlite using Serialized.
> >
> > Both of them are accessing the same DB at the same time . This can
cause DB corrupt ?
>
> No.  These two work correctly together.  You should get no corruption
from using these two together.
>
> Are you using any PRAGMA commands ?
>
> What is the result of "PRAGMA journal_mode" ?
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-22 Thread Scott Hess
On Wed, Jun 22, 2016 at 8:13 PM, Simon Slavin  wrote:
> On 23 Jun 2016, at 3:52am, mon siong  wrote:
>> PHP is using sqlite3 library (http://php.net/manual/en/book.sqlite3.php)
>> and C program is handle the sqlite using Serialized.
>>
>> Both of them are accessing the same DB at the same time . This can cause DB 
>> corrupt ?
>
> No.  These two work correctly together.  You should get no corruption from 
> using these two together.

I wonder if it would be worthwhile to provide a PRAGMA (or function)
which returned a blob derived from the VFS pointer, perhaps hashed.
Then you could very easily verify if multiple higher-level libraries
are sharing the same underlying sqlite library, because that operation
would return the same result in both cases.

I'm suggesting to derive from the VFS pointer because if separate
sqlite libraries were sharing the same Unix VFS I think the POSIX
locking problem would not occur.  sqlite_source_id() is _really_
close, but technically could be identical for distinct sqlite
libraries linked into the same process.

Sorry if I'm too tired to make sense,
scott
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] System.Data.SQLite version 1.0.102.0 released

2016-06-22 Thread Joe Mistachkin

System.Data.SQLite version 1.0.102.0 (with SQLite 3.13.0) is now available
on the System.Data.SQLite website:

 https://system.data.sqlite.org/

Further information about this release can be seen at:

 https://system.data.sqlite.org/index.html/doc/trunk/www/news.wiki

Please post on the SQLite mailing list (sqlite-users at sqlite.org) if you
encounter any problems with this release.

--
Joe Mistachkin

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


Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-22 Thread mon siong

PHP use 3.7.7.1 and my c program use 3.8.4.3 . Different version of sqlite is 
fine ?
I tried WAL and Delete Journal Mode , both type cause the db to corrupt . 

Under which scenario, two different global variables will be used ? 
 

On Thursday, June 23, 2016 11:13 AM, Simon Slavin  
wrote:
 

 
On 23 Jun 2016, at 3:52am, mon siong  wrote:

> PHP is using sqlite3 library (http://php.net/manual/en/book.sqlite3.php)
> and C program is handle the sqlite using Serialized. 
> 
> Both of them are accessing the same DB at the same time . This can cause DB 
> corrupt ? 

No.  These two work correctly together.  You should get no corruption from 
using these two together.

Are you using any PRAGMA commands ?

What is the result of "PRAGMA journal_mode" ?

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


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


Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-22 Thread Simon Slavin

On 23 Jun 2016, at 3:52am, mon siong  wrote:

> PHP is using sqlite3 library (http://php.net/manual/en/book.sqlite3.php)
> and C program is handle the sqlite using Serialized. 
> 
> Both of them are accessing the same DB at the same time . This can cause DB 
> corrupt ? 

No.  These two work correctly together.  You should get no corruption from 
using these two together.

Are you using any PRAGMA commands ?

What is the result of "PRAGMA journal_mode" ?

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


[sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-22 Thread mon siong
 Hello
My sqlite database corrupt recently, I suspecting this is due to the two 
different instances of SQLIte running on unix . And two different global 
variables is used .
(By refering to the thread: 
http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/2016-May/066648.html)

We are using PHP to read and writes the database , and at the same time a 
multithread c program is performing read and write to the same database .

PHP is using sqlite3 library (http://php.net/manual/en/book.sqlite3.php)
and C program is handle the sqlite using Serialized. 

Both of them are accessing the same DB at the same time . This can cause DB 
corrupt ? 

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


[sqlite] SQLITE_OMIT_VIRTUALTABLE compilation error

2016-06-22 Thread Benjamin Delpy
Hello,

When using SQLITE_OMIT_VIRTUALTABLE compilation option, there is a
compilation error in where.c!whereLoopAddAll (with whereLoopAddVirtual()) ){
)

I think you must enclose it in :

#ifndef SQLITE_OMIT_VIRTUALTABLE
if( IsVirtual(pItem->pTab) ){
  struct SrcList_item *p;
  for(p=[1]; pfg.jointype & (JT_LEFT|JT_CROSS)) ){
  mUnusable |= sqlite3WhereGetMask(>sMaskSet, p->iCursor);
}
  }
  rc = whereLoopAddVirtual(pBuilder, mPrereq, mUnusable);
}else
#endif

...like in the where.c!whereLoopAddOr

Benjamin `gentilkiwi`
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users