Re: [sqlite] Seemingly random Access Violation errors

2012-10-04 Thread Joe Mistachkin

Matthew Dumbleton wrote:
>
> I have tried this change and I'm afraid it hasn't stopped the crashes.
>

I've further refined the locking semantics for the .NET Compact Framework
build here:

https://system.data.sqlite.org/index.html/info/ac5f4cc084

I think this should correct the problem, although I'm not actually able to
reproduce
the problem here.

--
Joe Mistachkin

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


Re: [sqlite] interesting deadlock.

2012-10-04 Thread Jonathan Engle
Ok, so here's a question (trying an experiment to see if this will work, but 
throwing it out here as well).

What if the source db handle for the backup is opened to use private cache?  
Will this have any effect at all or is it the cache mode of db2 (using your 
example below)?


On Sep 28, 2012, at 1:49 AM, Dan Kennedy wrote:

> On 09/28/2012 03:32 AM, Jonathan Engle wrote:
>> I've been picking away at this for the last few days and have it
>> narrowed down fairly well.
>> 
>> It looks like if I turn off shared cache, it works fine (same
>> application code).
>> 
>> If I run with SQL_DEBUG enabled, the first issue I run into in an
>> assertion in sqlite3BtreeEnter: assert(
>> sqlite3_mutex_held(p->db->mutex) ); The call stack from it is
>> 
>> sqlite3BackupUpdate backupOnePage sqlite3BtreeGetReserve(p->pSrc)
>> sqlite3BtreeEnter
>> 
>> Look up the stack, it looks like sqlite3BackupUpdate locks the mutex
>> on the destination database but not the source.
> 
> Say you have an active backup operation (one created by backup_init()
> but not yet completed) using source database handle db1. In
> non-shared-cache mode. The backup is half-way done - 50% of the source
> database pages have been copied to the destination.
> 
> If the source db is written by another process at this point, or using
> a database handle other than db1, the backup operation has to start over
> from the beginning on the next call to sqlite3_backup_step().
> 
> However, if the app writes to the source database using handle
> db1, SQLite will automatically update the backup database as well. So
> that the backup operation doesn't have to restart. That's the call to
> sqlite3BackupUpdate() above. As you say, the code assumes that the
> mutex on the source database handle (i.e. db1) is already held.
> 
> Turns out that this assumption is only true in non-shared-cache mode.
> Because of the way the code is structured, in shared-cache mode, this
> call to sqlite3BackupUpdate() will be made even if the source database
> is updated using a second database handle - db2. But the backup code
> still calls routines that assume the db1 mutex is held... Bug.
> 
> In the deadlock scenario, all the threads are blocked in
> lockBtreeMutex(). This routine is supposed to prevent deadlock
> by ensuring that mutexes are only obtained in a globally defined
> order. But that could malfunction in unpredictable ways if two threads
> were running the lockBtreeMutex() code on behalf of the same database
> connection simultaneously. The mutex on the database handle is
> supposed to prevent that from happening, but since the bug above
> allows lockBtreeMutex() to be called without actually holding
> the mutex it easily might.
> 
> I think the fix will likely be to have shared-cache mode work like
> non-shared-cache mode - force the backup to start over if the source
> database is written via a second database handle (i.e. db2).
> 
> Dan.
> 
> 
> 
> 
> 
>> Tried as a test adding locking the source db, bad results. Altered
>> the definition of asserts to make them not fatal, got a ton of
>> assertions then deadlocking again.
>> 
>> Haven't tried to make a sample program yet, but the gist of it would
>> be to have one (or more threads) doing lots of small transactions
>> updating the database while simultaneously having another thread
>> continuously making a backup of the db (unrealistic scenario, just
>> makes the race easier to see).
>> 
>> It may or may not matter whether or not encryption is used, or more
>> importantly whether SQLITE_HAS_CODEC is defined, since the portion of
>> code that's asserting is only there when SQLITE_HAS_CODEC is
>> defined.
>> 
>> At this point, I guess I'll just run without enabling shared cache,
>> which seems to work just fine (a little better with regards to
>> backups actually) and just hope this gets fixed in a future release.
>> 
>> Jon
>> 
>> 
>> 
>> It looks like it's unhappy that the mutex for the source database in
>> the
>> 
>> On Aug 25, 2012, at 1:33 PM, Jonathan Engle wrote:
>> 
>>> No, the deadlock is deeper than that, it's stuck trying to lock
>>> mutexes.  My current theory is that the thread trying to update the
>>> page in the backup destination database is what's causing trouble.
>>> 
>>> I also forgot to mention, each thread is using a different
>>> connection object and that it's using shared cache mode.
>>> 
>>> Jon On Aug 25, 2012, at 12:57 PM, Patrik Nilsson wrote:
>>> 
 Do you test for the backup errors, i.e. SQLITE_BUSY and
 SQLITE_LOCKED?
 
 Do you test for step errors, i.e.  SQLITE_BUSY?
 
 If you get the busy error, you can wait a while and try again or
 start over.
 
 /Patrik
 
 On 08/24/2012 05:46 PM, Jonathan Engle wrote:
> Ran into this recently, it's happened on one machine running a
> beta test of our software.  This is a multi-threaded
> application, and I've run into a sequence of steps that
> deadlocks hard that as far as I can tell 

Re: [sqlite] Sqlite and SQL Server 2005

2012-10-04 Thread Simon Slavin

On 4 Oct 2012, at 9:11pm, Jorge  wrote:

> I am new in Sqlite. I would like to know what is the best option to update 
> data in two directions from Sqlite to SQL Server 2005

There are lots of languages that can talk to both databases.  PHP can do it and 
runs on many platforms.  Are you expecting to run on a particular kind of 
computer, or in a particular operating system ?  Can you program the SQL Server 
computer itself, or just use it as a server ?

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


[sqlite] SQLite version 3.7.14.1

2012-10-04 Thread D. Richard Hipp
SQLite version 3.7.14.1 is now available on the SQLite website

http://www.sqlite.org/

Version 3.7.14.1 is a patch release with minimal difference from 3.7.14.   The 
changes in version 3.7.14.1 include a one-line bug fix in the SQLite core (see 
www.sqlite.org/src/fdiff?v1=22783f4275f=e74f9ed463b), a larger fix for a 
long-standing bug in the TCL interface, and a work-around for a compiler bug 
that can come up when building WinRT applications for ARM.  The first bug, 
which can cause a segfault when trying to evaluate an obscure but perfectly 
valid  LEFT JOIN, was the primary reason for this patch release.  That 
particular bug was introduced in version 3.7.14.  So if you have already 
upgraded to version 3.7.14, you should upgrade again to 3.7.14.1.  But if you 
are still on 3.7.13 or earlier, the upgrade is not nearly so urgent.

As always, please let me know if you encounter any problems.

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] Sqlite and SQL Server 2005

2012-10-04 Thread Bart Smissaert
What is your coding language?
If VB then maybe via ODBC and ADO.

RBS


On Thu, Oct 4, 2012 at 9:11 PM, Jorge  wrote:
>> Hello,
> I am new in Sqlite. I would like to know what is the best option to update 
> data in two directions from Sqlite to SQL Server 2005
>
> Thx
>
>>
> ___
> 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


[sqlite] Sqlite and SQL Server 2005

2012-10-04 Thread Jorge
> Hello,
I am new in Sqlite. I would like to know what is the best option to update data 
in two directions from Sqlite to SQL Server 2005

Thx

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


Re: [sqlite] Bug report: null pointer dereference in SQLite 3.7.14 (SEGFAULT)

2012-10-04 Thread Bart Smissaert
Now that is a proper bug!
Makes Excel crash OK here.

RBS


On 10/3/12, Klaus Keppler  wrote:
> Hi,
>
> after upgrading from SQLite 3.7.13 to 3.7.14 our application crashed
> with a SEGFAULT located within SQLite.
> I boiled down the SQL statement and the tables used, and was able to
> reproduce this also with the SQLite standalone binary available at
> http://www.sqlite.org/sqlite-shell-linux-x86-3071400.zip
> (Debian 6, AMD64).
>
> I assume that the new optimizations on the query planner are causing
> this problem; with 3.7.13 everything works fine.
>
>
> HOW TO REPRODUCE:
> -- create these tables and fill with data:
> CREATE TABLE GROUPCUSTOMERS (
>  GC_GROUPID INTEGER NOT NULL,
>  GC_CUSTOMERID INTEGER NOT NULL,
>  GC_OBJECTTYPE INTEGER
> );
> INSERT INTO GROUPCUSTOMERS VALUES (1, 1, NULL);
>
> CREATE TABLE GROUPPERMISSIONS (
>  GP_GROUPID INTEGER NOT NULL,
>  GP_MODULEID INTEGER NOT NULL,
>  GP_PERMISSIONID INTEGER NOT NULL
> );
> INSERT INTO GROUPPERMISSIONS VALUES (1, 1, 1);
>
> CREATE TABLE GROUPUSERS (
>  GU_GROUPID INTEGER NOT NULL,
>  GU_USERID INTEGER NOT NULL,
>  GU_OBJECTTYPE INTEGER
> );
>
> -- then run this query:
> SELECT * FROM
>   ( SELECT GP_MODULEID AS CP_MODULEID, GP_PERMISSIONID AS CP_PERMISSIONID
>   FROM GROUPCUSTOMERS, GROUPPERMISSIONS
>   WHERE (GC_GROUPID = GP_GROUPID)
>   ) AS A1
>   LEFT JOIN
>   ( SELECT GP_MODULEID AS UP_MODULEID, GP_PERMISSIONID AS UP_PERMISSIONID
>   FROM GROUPUSERS, GROUPPERMISSIONS
>   WHERE (GU_GROUPID = GP_GROUPID)
>   ) AS A2
>   ON (CP_MODULEID = UP_MODULEID)
>  OR (UP_PERMISSIONID = 0)
>   ;
>
> => SEGFAULT
>
> -- note that it is important to have these two records inserted,
> -- without them the SQL will work.
>
> -- AND: when running "ANALYZE" before running the SQL statement, the
> -- query also succeeds!
>
> In our application, the error occured at the sqlite3VdbeExec function at
>   "case OP_NullRow:" on the line "u.bn.pC->nullRow = 1;"
> u.pn.pC is NULL at this point.
> (tested with GDB and the original (bloated) SQL statement from within
> our application)
> We did NOT use the flag SQLITE_ENABLE_STAT3.
>
> For any questions don't hezitate to contact me.
>
> Best regards
>
> -Klaus Keppler
>
>
>
> --
> __
> Keppler IT GmbH - Die Hostingexperten.
>
> Dipl.-Inf. Klaus KepplerTel. (09131) 691-480
> Geschäftsführer Fax: (09131) 691-489
>
> Am Weichselgarten 7 UStID.-Nr. DE259788698
> 91058 Erlangen  Amtsgericht Fürth, HRB 11477
> www.keppler-it.de   Sitz d. Gesellschaft: Erlangen
> __
> ___
> 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] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-04 Thread David Richardson
Yes, that is the problem: How to do this with entity framework? 

Entity framework does all the class making from the model (ORM). great tool. 
But I find it weird that nobody has stumble upon this problem. I cannot find a 
conclusive answer on this.
you know:
NO(, It is not possible. because[...] . or it will be possible in the next 
build)
YES(, override this and this and there you go)

all the answer are vague on the matter or left alone. So that is why I'm here.




 From: "Duquette, William H (318K)" 
To: David Richardson ; General Discussion of SQLite 
Database  
Sent: Thursday, October 4, 2012 11:57 AM
Subject: Re: [sqlite] Fw: sqlite  + EF4 + 'on cascade delete' = not working
 

On 10/4/12 8:26 AM, "David Richardson"  wrote:

Yes, I've read about it. I try to implemented it but it did not seem to work. I 
even read somewhere that you can add this to the connectionstring but no luck 
with them.
>
>
>I tried all these solutions:
>http://stackoverflow.com/questions/2477872/problem-with-cascade-delete-using-entity-framework-and-system-data-sqlite
>
>http://stackoverflow.com/questions/7674318/cascade-on-delete-not-cascading-with-ef
>
>http://stackoverflow.com/questions/4981353/how-to-enable-foreign-key-cascade-delete-by-default-in-sqlite
>
>
>
>But none of these worked. Either I'm implementing it wrong or there is a bug. 
>So i was expecting an out-of-the-box solution to this issue. So do you have an 
>working example on how to do this the right way? 

I just eval "PRAGMA foreign_keys = ON" as soon as I open the connection, and 
the cascading deletes in the schema all take place as expected.

However, I'm not using Entity Framework 4 or anything like it; there's 
evidently something else going on.

Will

>
> From: "Duquette, William H (318K)" 
>To: David Richardson ; General Discussion of SQLite 
>Database  
>Sent: Thursday, October 4, 2012 10:39 AM
>Subject: Re: [sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working
>
>On 10/4/12 7:29 AM, "David Richardson"  wrote:
>
>
>>I¹m having some sort of
>>bug with system.data.sqlite. I¹ve been trying for weeks now!  I¹ve
>>installed (System.Data.SQLite 1.0.81.0) and
>>i¹m using sqlite in combination with Entity Framework 4. Mostly it does
>>what I
>>want. The only problem I¹m having is that when I try to delete it should
>>cascade , but 'on cascade delete¹ does NOT work. I change
>>the connectionstring to SQL Server 2008 instance and entity framework
>>works
>>perfect! So there is something missing here. Or am I doing something
>>wrong?
>
>
>Have you enabled foreign keys using the "foreign_keys" pragma?  This
>currently needs to be done each time you connect to the database.
>
>Will
>--
>Will Duquette -- william.h.duque...@jpl.nasa.gov
>Athena Development Lead -- Jet Propulsion Laboratory
>"It's amazing what you can do with the right tools."
>
>
>
>
>
>
>
>
>
>
>> 
>>I cannot find any
>>information on the internet on how to do this with system.data.sqlite
>>properly. 
>> 
>>Is this a bug?
>>___
>>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] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-04 Thread Duquette, William H (318K)
On 10/4/12 8:26 AM, "David Richardson" 
> wrote:

Yes, I've read about it. I try to implemented it but it did not seem to work. I 
even read somewhere that you can add this to the connectionstring but no luck 
with them.

I tried all these solutions:
http://stackoverflow.com/questions/2477872/problem-with-cascade-delete-using-entity-framework-and-system-data-sqlite
http://stackoverflow.com/questions/7674318/cascade-on-delete-not-cascading-with-ef
http://stackoverflow.com/questions/4981353/how-to-enable-foreign-key-cascade-delete-by-default-in-sqlite

But none of these worked. Either I'm implementing it wrong or there is a bug. 
So i was expecting an out-of-the-box solution to this issue. So do you have an 
working example on how to do this the right way?

I just eval "PRAGMA foreign_keys = ON" as soon as I open the connection, and 
the cascading deletes in the schema all take place as expected.

However, I'm not using Entity Framework 4 or anything like it; there's 
evidently something else going on.

Will


From: "Duquette, William H (318K)" 
>
To: David Richardson >; 
General Discussion of SQLite Database 
>
Sent: Thursday, October 4, 2012 10:39 AM
Subject: Re: [sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working

On 10/4/12 7:29 AM, "David Richardson" 
> wrote:


>I¹m having some sort of
>bug with system.data.sqlite. I¹ve been trying for weeks now!  I¹ve
>installed (System.Data.SQLite 1.0.81.0) and
>i¹m using sqlite in combination with Entity Framework 4. Mostly it does
>what I
>want. The only problem I¹m having is that when I try to delete it should
>cascade , but 'on cascade delete¹ does NOT work. I change
>the connectionstring to SQL Server 2008 instance and entity framework
>works
>perfect! So there is something missing here. Or am I doing something
>wrong?


Have you enabled foreign keys using the "foreign_keys" pragma?  This
currently needs to be done each time you connect to the database.

Will
--
Will Duquette -- 
william.h.duque...@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
"It's amazing what you can do with the right tools."










>
>I cannot find any
>information on the internet on how to do this with system.data.sqlite
>properly.
>
>Is this a bug?
>___
>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] Size

2012-10-04 Thread Clemens Ladisch
Alami Omar wrote:
> it seems that in a sqlite format 3 file (that i have), the offset
> 28 value is not valid(not equal to the file size)

Please read the link you were given.  This size is in pages.

> what i am trying to do, is extract an SQLite Format 3 file from
> the hex code of another file [...]
> The header is at offset: 0x00102194.

Just extract everything beginning from there and then run VACUUM.


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


Re: [sqlite] Seemingly random Access Violation errors

2012-10-04 Thread Matthew Dumbleton


I have tried this change and I'm afraid it hasn't stopped the crashes.
Just to confirm though, I copied the code changes to 'UnsafeNativeMethods.cs' 
into the 1.0.82.0 project by hand as I couldn't see anywhere to download the 
new source code as a whole.  
Was this correct or did I miss something? (Don't know if there are other 
crucial changes elsewhere in the source code.)


> From: sql...@mistachkin.com
> To: sqlite-users@sqlite.org
> Date: Thu, 4 Oct 2012 04:27:47 -0700
> Subject: Re: [sqlite] Seemingly random Access Violation errors
> 
> 
> Matthew Dumbleton wrote:
> >
> > Attached is a small project that should recreate the issues I'm having. 
> >
> 
> Could you try the following change and let us know if it works for you?
> 
>   http://system.data.sqlite.org/index.html/ci/b8212344a0
> 
> --
> Joe Mistachkin
> 
> ___
> 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] Bug report: null pointer dereference in SQLite 3.7.14 (SEGFAULT)

2012-10-04 Thread Richard Hipp
Trouble ticket is here:  http://www.sqlite.org/src/info/d02e1406a5

Tnx for the test script.

On Wed, Oct 3, 2012 at 2:57 PM, Klaus Keppler  wrote:

> Hi,
>
> after upgrading from SQLite 3.7.13 to 3.7.14 our application crashed with
> a SEGFAULT located within SQLite.
> I boiled down the SQL statement and the tables used, and was able to
> reproduce this also with the SQLite standalone binary available at
> http://www.sqlite.org/sqlite-**shell-linux-x86-3071400.zip
> (Debian 6, AMD64).
>
> I assume that the new optimizations on the query planner are causing this
> problem; with 3.7.13 everything works fine.
>
>
> HOW TO REPRODUCE:
> -- create these tables and fill with data:
> CREATE TABLE GROUPCUSTOMERS (
> GC_GROUPID INTEGER NOT NULL,
> GC_CUSTOMERID INTEGER NOT NULL,
> GC_OBJECTTYPE INTEGER
> );
> INSERT INTO GROUPCUSTOMERS VALUES (1, 1, NULL);
>
> CREATE TABLE GROUPPERMISSIONS (
> GP_GROUPID INTEGER NOT NULL,
> GP_MODULEID INTEGER NOT NULL,
> GP_PERMISSIONID INTEGER NOT NULL
> );
> INSERT INTO GROUPPERMISSIONS VALUES (1, 1, 1);
>
> CREATE TABLE GROUPUSERS (
> GU_GROUPID INTEGER NOT NULL,
> GU_USERID INTEGER NOT NULL,
> GU_OBJECTTYPE INTEGER
> );
>
> -- then run this query:
> SELECT * FROM
>  ( SELECT GP_MODULEID AS CP_MODULEID, GP_PERMISSIONID AS CP_PERMISSIONID
>  FROM GROUPCUSTOMERS, GROUPPERMISSIONS
>  WHERE (GC_GROUPID = GP_GROUPID)
>  ) AS A1
>  LEFT JOIN
>  ( SELECT GP_MODULEID AS UP_MODULEID, GP_PERMISSIONID AS UP_PERMISSIONID
>  FROM GROUPUSERS, GROUPPERMISSIONS
>  WHERE (GU_GROUPID = GP_GROUPID)
>  ) AS A2
>  ON (CP_MODULEID = UP_MODULEID)
> OR (UP_PERMISSIONID = 0)
>  ;
>
> => SEGFAULT
>
> -- note that it is important to have these two records inserted,
> -- without them the SQL will work.
>
> -- AND: when running "ANALYZE" before running the SQL statement, the
> -- query also succeeds!
>
> In our application, the error occured at the sqlite3VdbeExec function at
>  "case OP_NullRow:" on the line "u.bn.pC->nullRow = 1;"
> u.pn.pC is NULL at this point.
> (tested with GDB and the original (bloated) SQL statement from within our
> application)
> We did NOT use the flag SQLITE_ENABLE_STAT3.
>
> For any questions don't hezitate to contact me.
>
> Best regards
>
>-Klaus Keppler
>
>
>
> --
> __**__**__
> Keppler IT GmbH - Die Hostingexperten.
>
> Dipl.-Inf. Klaus KepplerTel. (09131) 691-480
> Geschäftsführer Fax: (09131) 691-489
>
> Am Weichselgarten 7 UStID.-Nr. DE259788698
> 91058 Erlangen  Amtsgericht Fürth, HRB 11477
> www.keppler-it.de   Sitz d. Gesellschaft: Erlangen
> __**__**__
> __**_
> 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


Re: [sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-04 Thread David Richardson
Yes, I've read about it. I try to implemented it but it did not seem to work. I 
even read somewhere that you can add this to the connectionstring but no luck 
with them.

I tried all these solutions:
http://stackoverflow.com/questions/2477872/problem-with-cascade-delete-using-entity-framework-and-system-data-sqlite

http://stackoverflow.com/questions/7674318/cascade-on-delete-not-cascading-with-ef

http://stackoverflow.com/questions/4981353/how-to-enable-foreign-key-cascade-delete-by-default-in-sqlite


But none of these worked. Either I'm implementing it wrong or there is a bug. 
So i was expecting an out-of-the-box solution to this issue. So do you have an 
working example on how to do this the right way?


 From: "Duquette, William H (318K)" 
To: David Richardson ; General Discussion of SQLite 
Database  
Sent: Thursday, October 4, 2012 10:39 AM
Subject: Re: [sqlite] Fw: sqlite  + EF4 + 'on cascade delete' = not working
 
On 10/4/12 7:29 AM, "David Richardson"  wrote:


>I¹m having some sort of
>bug with system.data.sqlite. I¹ve been trying for weeks now!  I¹ve
>installed (System.Data.SQLite 1.0.81.0) and
>i¹m using sqlite in combination with Entity Framework 4. Mostly it does
>what I
>want. The only problem I¹m having is that when I try to delete it should
>cascade , but 'on cascade delete¹ does NOT work. I change
>the connectionstring to SQL Server 2008 instance and entity framework
>works
>perfect! So there is something missing here. Or am I doing something
>wrong?


Have you enabled foreign keys using the "foreign_keys" pragma?  This
currently needs to be done each time you connect to the database.

Will
--
Will Duquette -- william.h.duque...@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
"It's amazing what you can do with the right tools."










> 
>I cannot find any
>information on the internet on how to do this with system.data.sqlite
>properly. 
> 
>Is this a bug?
>___
>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] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-04 Thread Duquette, William H (318K)
On 10/4/12 7:29 AM, "David Richardson"  wrote:


>I¹m having some sort of
>bug with system.data.sqlite. I¹ve been trying for weeks now!  I¹ve
>installed (System.Data.SQLite 1.0.81.0) and
>i¹m using sqlite in combination with Entity Framework 4. Mostly it does
>what I
>want. The only problem I¹m having is that when I try to delete it should
>cascade , but 'on cascade delete¹ does NOT work. I change
>the connectionstring to SQL Server 2008 instance and entity framework
>works
>perfect! So there is something missing here. Or am I doing something
>wrong?


Have you enabled foreign keys using the "foreign_keys" pragma?  This
currently needs to be done each time you connect to the database.

Will
--
Will Duquette -- william.h.duque...@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
"It's amazing what you can do with the right tools."










> 
>I cannot find any
>information on the internet on how to do this with system.data.sqlite
>properly. 
> 
>Is this a bug?
>___
>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


[sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-04 Thread David Richardson
Hi all,

I'm not sure if this mail was received by the community (on sunday the 31st of 
semptember 2012). I haven't heard anything yet. So I'm sending it again.

Regards,

David Richardson 

- Forwarded Message -
From: David Richardson 
To: "sqlite-users@sqlite.org"  
Sent: Sunday, September 30, 2012 5:24 PM
Subject: sqlite  + EF4 + 'on cascade delete' = not working
 

Hi community
 
I’m having some sort of
bug with system.data.sqlite. I’ve been trying for weeks now!  I’ve installed 
(System.Data.SQLite 1.0.81.0) and
i’m using sqlite in combination with Entity Framework 4. Mostly it does what I
want. The only problem I’m having is that when I try to delete it should 
cascade , but 'on cascade delete’ does NOT work. I change
the connectionstring to SQL Server 2008 instance and entity framework works
perfect! So there is something missing here. Or am I doing something wrong?
 
I cannot find any
information on the internet on how to do this with system.data.sqlite properly. 
 
Is this a bug?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Size

2012-10-04 Thread Alami Omar
Thank you for your answers Mr.Simon Davies and Mr.Simon Slavin, but it
seems that in a sqlite format 3 file (that i have), the offset  28 value is
not valid(not equal to the file size) and surely not equal to offset 92 (00
00 00 00), what i am trying to do, is extract an SQLite Format 3 file from
the hex code of another file, but i can't extract it correctly sadly, here
is the file  if anyone desires
to take a look (would really apreciate it, couldn't attach it because it'll
wait for moderation approval, but i can truly garatntee, the file is safe
no viruses nothing to be worried about, scan
results).
The header is at offset: 0x00102194.

Thank you, Omar.

2012/10/4 Simon Slavin 

>
> On 4 Oct 2012, at 2:06pm, Alami Omar  wrote:
>
> > Hello, does SQLite format files have any size(fie size of the sqlite
> file)
> > info on the header ? Thank you.
>
> You can find file content information here:
>
> http://www.sqlite.org/fileformat.html
>
> There's no specific location with the length in bytes, you have to
> multiply @16 and @28 and add some header space (I think).
>
> Simon.
> ___
> 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] Size

2012-10-04 Thread Simon Slavin

On 4 Oct 2012, at 2:06pm, Alami Omar  wrote:

> Hello, does SQLite format files have any size(fie size of the sqlite file)
> info on the header ? Thank you.

You can find file content information here:

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

There's no specific location with the length in bytes, you have to multiply @16 
and @28 and add some header space (I think).

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


Re: [sqlite] Size

2012-10-04 Thread Simon Davies
On 4 October 2012 14:06, Alami Omar  wrote:
> Hello, does SQLite format files have any size(fie size of the sqlite file)
> info on the header ? Thank you.

http://www.sqlite.org/fileformat.html#filesize

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


Re: [sqlite] System.Data.SQLite for Visual Studio 2012

2012-10-04 Thread Steffen Mangold
Joe Mistachkin wrote:
>
> Yes.  The code is currently on trunk.  Please see:
>
>   http://system.data.sqlite.org/index.html/doc/trunk/www/news.wiki

Thank you. :)

Regards

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


Re: [sqlite] System.Data.SQLite for Visual Studio 2012

2012-10-04 Thread Joe Mistachkin

Steffen Mangold wrote:
>
> is there a new ADO.NET setup version for Visual Studio 2012 planed?
>

Yes.  The code is currently on trunk.  Please see:

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

--
Joe Mistachkin

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


[sqlite] System.Data.SQLite for Visual Studio 2012

2012-10-04 Thread Steffen Mangold
Hi,

is there a new ADO.NET setup version for Visual Studio 2012 planed?


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


[sqlite] Bug report: null pointer dereference in SQLite 3.7.14 (SEGFAULT)

2012-10-04 Thread Klaus Keppler

Hi,

after upgrading from SQLite 3.7.13 to 3.7.14 our application crashed 
with a SEGFAULT located within SQLite.
I boiled down the SQL statement and the tables used, and was able to 
reproduce this also with the SQLite standalone binary available at 
http://www.sqlite.org/sqlite-shell-linux-x86-3071400.zip

(Debian 6, AMD64).

I assume that the new optimizations on the query planner are causing 
this problem; with 3.7.13 everything works fine.



HOW TO REPRODUCE:
-- create these tables and fill with data:
CREATE TABLE GROUPCUSTOMERS (
GC_GROUPID INTEGER NOT NULL,
GC_CUSTOMERID INTEGER NOT NULL,
GC_OBJECTTYPE INTEGER
);
INSERT INTO GROUPCUSTOMERS VALUES (1, 1, NULL);

CREATE TABLE GROUPPERMISSIONS (
GP_GROUPID INTEGER NOT NULL,
GP_MODULEID INTEGER NOT NULL,
GP_PERMISSIONID INTEGER NOT NULL
);
INSERT INTO GROUPPERMISSIONS VALUES (1, 1, 1);

CREATE TABLE GROUPUSERS (
GU_GROUPID INTEGER NOT NULL,
GU_USERID INTEGER NOT NULL,
GU_OBJECTTYPE INTEGER
);

-- then run this query:
SELECT * FROM
 ( SELECT GP_MODULEID AS CP_MODULEID, GP_PERMISSIONID AS CP_PERMISSIONID
 FROM GROUPCUSTOMERS, GROUPPERMISSIONS
 WHERE (GC_GROUPID = GP_GROUPID)
 ) AS A1
 LEFT JOIN
 ( SELECT GP_MODULEID AS UP_MODULEID, GP_PERMISSIONID AS UP_PERMISSIONID
 FROM GROUPUSERS, GROUPPERMISSIONS
 WHERE (GU_GROUPID = GP_GROUPID)
 ) AS A2
 ON (CP_MODULEID = UP_MODULEID)
OR (UP_PERMISSIONID = 0)
 ;

=> SEGFAULT

-- note that it is important to have these two records inserted,
-- without them the SQL will work.

-- AND: when running "ANALYZE" before running the SQL statement, the
-- query also succeeds!

In our application, the error occured at the sqlite3VdbeExec function at 
 "case OP_NullRow:" on the line "u.bn.pC->nullRow = 1;"

u.pn.pC is NULL at this point.
(tested with GDB and the original (bloated) SQL statement from within 
our application)

We did NOT use the flag SQLITE_ENABLE_STAT3.

For any questions don't hezitate to contact me.

Best regards

   -Klaus Keppler



--
__
Keppler IT GmbH - Die Hostingexperten.

Dipl.-Inf. Klaus KepplerTel. (09131) 691-480
Geschäftsführer Fax: (09131) 691-489

Am Weichselgarten 7 UStID.-Nr. DE259788698
91058 Erlangen  Amtsgericht Fürth, HRB 11477
www.keppler-it.de   Sitz d. Gesellschaft: Erlangen
__
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Seemingly random Access Violation errors

2012-10-04 Thread Joe Mistachkin

Matthew Dumbleton wrote:
>
> Attached is a small project that should recreate the issues I'm having. 
>

Could you try the following change and let us know if it works for you?

http://system.data.sqlite.org/index.html/ci/b8212344a0

--
Joe Mistachkin

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