Re: [sqlite] bus error with SQLite 3.5.6

2008-03-02 Thread P Kishor
posting an update here --

I DROPped the insert_fts TRIGGER, and now the db works fine. No more
crash on inserting a new row. So, the error was because of the trigger

CREATE TRIGGER insert_fts
AFTER INSERT ON pages
BEGIN
  INSERT INTO fts_pages (rowid, page_text)
  VALUES (new.page_id, new.page_text);
END;

Of course, now my fts table is not being updated automatically on insert.

Hope this helps in diagnosing the cause.

On 3/3/08, P Kishor <[EMAIL PROTECTED]> wrote:
> Dan,
>
>
>
>  On 3/2/08, Dan <[EMAIL PROTECTED]> wrote:
>  >
>  >  Hi,
>  >
>  >  I tried this script here with the latest CVS version and
>  >  it didn't crash:
>  >
>  >CREATE TABLE pages(page_id INTEGER PRIMARY KEY, page_name TEXT,
>  >  page_text TEXT);
>  >CREATE VIRTUAL TABLE fts_pages USING fts3(page_name, page_text);
>  >
>  >
>  >CREATE TRIGGER delete_fts
>  >AFTER DELETE ON pages
>  >BEGIN
>  >  DELETE FROM fts_pages WHERE rowid = old.page_id;
>  >END;
>  >
>  >CREATE TRIGGER insert_fts
>  >AFTER INSERT ON pages
>  >BEGIN
>  >  INSERT INTO fts_pages (rowid, page_text)
>  >  VALUES (new.page_id, new.page_text);
>  >END;
>  >
>  >CREATE TRIGGER update_fts
>  >AFTER UPDATE OF page_text ON pages
>  >BEGIN
>  >  UPDATE fts_pages
>  >  SET page_text = new.page_text
>  >  WHERE rowid = old.page_id;
>  >END;
>  >
>  >
>  >INSERT INTO pages (page_name, page_text) VALUES ('foo', 'bar');
>  >
>  >
>  > Can you test this in your environment?
>
>
> I am not sure what I should test in my environment. Did you mean to
>  send me some script? Or, are you asking me to try the latest version
>  from CVS?
>
>  If the former, I don't see any script. If the latter, compiling the
>  latest version via CVS would be very difficult for me as I have only
>  one machine and I can't install a new, test version of the db without
>  going through significant contortions.
>
>
>  > If this fails to produce
>  >  the crash, can you post the offending database? Or send it to
>  >  me if you don't want it made public.
>
>
> I am still getting a crash, and only on INSERT. Well, at least, I am
>  not getting a crash on UPDATE. Haven't tried DELETE.
>
>  I will try and package a small version of the db and send it to you
>  offline, if that is ok.
>
>
>  > Also, the exact sqlite version
>  >  might be helpful.
>  >
>
>
> I thought I had provided that above. Here you go
>
>  [11:00 PM] ~/Data/punkish$ sqlite3 --version
>  3.5.6
>
>
>  >  Alternatively, can you compile with debugging symbols enabled and
>  >  post a stack trace?
>  >
>
>
>
> Hmmm... that would entail recompiling an otherwise working program,
>  and the same difficulty as compiling the latest version from CVS.
>  Nevertheless, if you can point me to the instructions on compiling
>  with "debugging symbols enabled and post(ing) a stack trace," I will
>  try my best to do so.
>
>  Many thanks. My work is stuck for now as I consistenly get the error.
>  I am assuming the Crash Log that I posted was not much help, no?
>
>
>  >
>  >
>  >
>  >  On Mar 3, 2008, at 4:33 AM, P Kishor wrote:
>  >
>  >  > I have a fairly simple db with fts3
>  >  >
>  >  > TABLE pages (page_id INTEGER PRIMARY KEY, page_name TEXT, page_text
>  >  > TEXT);
>  >  >
>  >  > VIRTUAL TABLE fts_pages USING fts3 (page_name, page_text);
>  >  >
>  >  >  and the following triggers --
>  >  >
>  >  > CREATE TRIGGER delete_fts
>  >  > AFTER DELETE ON pages
>  >  > BEGIN
>  >  >   DELETE FROM fts_pages WHERE rowid = old.page_id;
>  >  > END;
>  >  >
>  >  > CREATE TRIGGER insert_fts
>  >  > AFTER INSERT ON pages
>  >  > BEGIN
>  >  >   INSERT INTO fts_pages (rowid, page_text)
>  >  >   VALUES (new.page_id, new.page_text);
>  >  > END;
>  >  >
>  >  > CREATE TRIGGER update_fts
>  >  > AFTER UPDATE OF page_text ON pages
>  >  > BEGIN
>  >  >   UPDATE fts_pages
>  >  >   SET page_text = new.page_text
>  >  >   WHERE rowid = old.page_id;
>  >  > END;
>  >  >
>  >  > When I enter a new row like so via the sqlite3  (version 3.5.6) shell
>  >  > on my MBP with OS X 10.5.2, I get the following error
>  >  >
>  >  > sqlite> INSERT INTO pages (page_name, page_text) VALUES ('foo',
>  >  > 'bar');
>  >  > Bus error
>  >  >
>  >  > and the sqlite3 shell quits out to the bash shell.
>  >  >
>  >  > A small journal file is left, and if I enter sqlite3 again, I get the
>  >  > message that the db is locked. I can proceed once I delete the journal
>  >  > file. I have the following crash log to report
>  >  >
>  >  > Process: sqlite3 [1464]
>  >  > Path:/usr/local/bin/sqlite3
>  >  > Identifier:  sqlite3
>  >  > Version: ??? (???)
>  >  > Code Type:   X86 (Native)
>  >  > Parent Process:  bash [291]
>  >  >
>  >  > Date///Time:   2008-03-02 15:24:45.729 -0600
>  >  > OS Version:  Mac OS X 10.5.2 (9C31)
>  >  > Report Version:  6
>  >  >
>  >  > Exception Type:  EXC_BAD_ACCESS (SIGBUS)
>  >  > Exception Codes: KERN_PROTECTION_FAILURE 

Re: [sqlite] bus error with SQLite 3.5.6

2008-03-02 Thread P Kishor
Dan,


On 3/2/08, Dan <[EMAIL PROTECTED]> wrote:
>
>  Hi,
>
>  I tried this script here with the latest CVS version and
>  it didn't crash:
>
>CREATE TABLE pages(page_id INTEGER PRIMARY KEY, page_name TEXT,
>  page_text TEXT);
>CREATE VIRTUAL TABLE fts_pages USING fts3(page_name, page_text);
>
>
>CREATE TRIGGER delete_fts
>AFTER DELETE ON pages
>BEGIN
>  DELETE FROM fts_pages WHERE rowid = old.page_id;
>END;
>
>CREATE TRIGGER insert_fts
>AFTER INSERT ON pages
>BEGIN
>  INSERT INTO fts_pages (rowid, page_text)
>  VALUES (new.page_id, new.page_text);
>END;
>
>CREATE TRIGGER update_fts
>AFTER UPDATE OF page_text ON pages
>BEGIN
>  UPDATE fts_pages
>  SET page_text = new.page_text
>  WHERE rowid = old.page_id;
>END;
>
>
>INSERT INTO pages (page_name, page_text) VALUES ('foo', 'bar');
>
>
> Can you test this in your environment?

I am not sure what I should test in my environment. Did you mean to
send me some script? Or, are you asking me to try the latest version
from CVS?

If the former, I don't see any script. If the latter, compiling the
latest version via CVS would be very difficult for me as I have only
one machine and I can't install a new, test version of the db without
going through significant contortions.

> If this fails to produce
>  the crash, can you post the offending database? Or send it to
>  me if you don't want it made public.

I am still getting a crash, and only on INSERT. Well, at least, I am
not getting a crash on UPDATE. Haven't tried DELETE.

I will try and package a small version of the db and send it to you
offline, if that is ok.

> Also, the exact sqlite version
>  might be helpful.
>

I thought I had provided that above. Here you go

[11:00 PM] ~/Data/punkish$ sqlite3 --version
3.5.6

>  Alternatively, can you compile with debugging symbols enabled and
>  post a stack trace?
>


Hmmm... that would entail recompiling an otherwise working program,
and the same difficulty as compiling the latest version from CVS.
Nevertheless, if you can point me to the instructions on compiling
with "debugging symbols enabled and post(ing) a stack trace," I will
try my best to do so.

Many thanks. My work is stuck for now as I consistenly get the error.
I am assuming the Crash Log that I posted was not much help, no?

>
>
>
>  On Mar 3, 2008, at 4:33 AM, P Kishor wrote:
>
>  > I have a fairly simple db with fts3
>  >
>  > TABLE pages (page_id INTEGER PRIMARY KEY, page_name TEXT, page_text
>  > TEXT);
>  >
>  > VIRTUAL TABLE fts_pages USING fts3 (page_name, page_text);
>  >
>  >  and the following triggers --
>  >
>  > CREATE TRIGGER delete_fts
>  > AFTER DELETE ON pages
>  > BEGIN
>  >   DELETE FROM fts_pages WHERE rowid = old.page_id;
>  > END;
>  >
>  > CREATE TRIGGER insert_fts
>  > AFTER INSERT ON pages
>  > BEGIN
>  >   INSERT INTO fts_pages (rowid, page_text)
>  >   VALUES (new.page_id, new.page_text);
>  > END;
>  >
>  > CREATE TRIGGER update_fts
>  > AFTER UPDATE OF page_text ON pages
>  > BEGIN
>  >   UPDATE fts_pages
>  >   SET page_text = new.page_text
>  >   WHERE rowid = old.page_id;
>  > END;
>  >
>  > When I enter a new row like so via the sqlite3  (version 3.5.6) shell
>  > on my MBP with OS X 10.5.2, I get the following error
>  >
>  > sqlite> INSERT INTO pages (page_name, page_text) VALUES ('foo',
>  > 'bar');
>  > Bus error
>  >
>  > and the sqlite3 shell quits out to the bash shell.
>  >
>  > A small journal file is left, and if I enter sqlite3 again, I get the
>  > message that the db is locked. I can proceed once I delete the journal
>  > file. I have the following crash log to report
>  >
>  > Process: sqlite3 [1464]
>  > Path:/usr/local/bin/sqlite3
>  > Identifier:  sqlite3
>  > Version: ??? (???)
>  > Code Type:   X86 (Native)
>  > Parent Process:  bash [291]
>  >
>  > Date///Time:   2008-03-02 15:24:45.729 -0600
>  > OS Version:  Mac OS X 10.5.2 (9C31)
>  > Report Version:  6
>  >
>  > Exception Type:  EXC_BAD_ACCESS (SIGBUS)
>  > Exception Codes: KERN_PROTECTION_FAILURE at 0x
>  > Crashed Thread:  0
>  >
>  > Thread 0 Crashed:
>  > 0   libsqlite3.0.dylib0x000ba7d8 sqlite3Step + 15862
>  > 1   libsqlite3.0.dylib0x000bde17 sqlite3_step + 75
>  > 2   libsqlite3.0.dylib0x000a333d sqlite3_exec + 209
>  > 3   sqlite3   0x6059 process_input + 1124
>  > 4   sqlite3   0x6c2a main + 2527
>  > 5   sqlite3   0x2596 start + 54
>  >
>  > Thread 0 crashed with X86 Thread State (32-bit):
>  >   eax: 0x00807480  ebx: 0x000b69f3  ecx: 0x0013d808  edx: 0x
>  >   edi: 0x0080b04c  esi: 0x0018  ebp: 0xbfffed98  esp: 0xbfffe930
>  >ss: 0x001f  efl: 0x00010206  eip: 0x000ba7d8   cs: 0x0017
>  >ds: 0x001f   es: 0x001f   fs: 0x   gs: 0x0037
>  >   cr2: 0x
>  >
>  > Binary 

Re: [sqlite] SQLite Crashes

2008-03-02 Thread Dan

On Mar 2, 2008, at 4:42 AM, Shawn Wilsher wrote:

> Hey all,
>
> Over at Mozilla we've been seeing a large amount of crashes in
> sqlite3_enable_shared_cache.  The stack frames don't make a whole lot
> of sense to me, so I thought I'd inform you and hope that you might
> have a better idea as to what is going on.  If you have any questions,
> feel free to ask.  If I don't know the answer, I'll get the people who
> should know involved.  We'd really like to try and resolve this issue,
> so insight on this matter would be greatly appreciated.
>
> http://tinyurl.com/2393qs
>
> We are presently using the latest version of sqlite.

Hi Shawn,

I put a pointer to the mozilla bug report here:

   http://www.sqlite.org/cvstrac/tktview?tn=2970

These stack traces don't make any sense to me either. The definition
of sqlite3_enable_shared_cache() in SQLite cvs is:

   int sqlite3_enable_shared_cache(int enable){
 sqlite3SharedCacheEnabled = enable;
 return SQLITE_OK;
   }

sqlite3SharedCacheEnable is a file scoped int.

Some of the stack traces have sqlite3_enable_shared_cache() being called
from Mozilla code, but some others show it being called from other
parts of SQLite that make no sense to me. This one is particularly
odd:

   http://crash-stats.mozilla.com/report/index/8b54f1c5-e8aa-11dc- 
b466-001a4bd43e5c

Stack overflow possibly? Will keep thinking this.

Regards,
Dan.

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


Re: [sqlite] bus error with SQLite 3.5.6

2008-03-02 Thread Dan

Hi,

I tried this script here with the latest CVS version and
it didn't crash:

   CREATE TABLE pages(page_id INTEGER PRIMARY KEY, page_name TEXT,  
page_text TEXT);
   CREATE VIRTUAL TABLE fts_pages USING fts3(page_name, page_text);

   CREATE TRIGGER delete_fts
   AFTER DELETE ON pages
   BEGIN
 DELETE FROM fts_pages WHERE rowid = old.page_id;
   END;

   CREATE TRIGGER insert_fts
   AFTER INSERT ON pages
   BEGIN
 INSERT INTO fts_pages (rowid, page_text)
 VALUES (new.page_id, new.page_text);
   END;

   CREATE TRIGGER update_fts
   AFTER UPDATE OF page_text ON pages
   BEGIN
 UPDATE fts_pages
 SET page_text = new.page_text
 WHERE rowid = old.page_id;
   END;

   INSERT INTO pages (page_name, page_text) VALUES ('foo', 'bar');

Can you test this in your environment? If this fails to produce
the crash, can you post the offending database? Or send it to
me if you don't want it made public. Also, the exact sqlite version
might be helpful.

Alternatively, can you compile with debugging symbols enabled and
post a stack trace?

Thanks,
Dan.




On Mar 3, 2008, at 4:33 AM, P Kishor wrote:

> I have a fairly simple db with fts3
>
> TABLE pages (page_id INTEGER PRIMARY KEY, page_name TEXT, page_text  
> TEXT);
>
> VIRTUAL TABLE fts_pages USING fts3 (page_name, page_text);
>
>  and the following triggers --
>
> CREATE TRIGGER delete_fts
> AFTER DELETE ON pages
> BEGIN
>   DELETE FROM fts_pages WHERE rowid = old.page_id;
> END;
>
> CREATE TRIGGER insert_fts
> AFTER INSERT ON pages
> BEGIN
>   INSERT INTO fts_pages (rowid, page_text)
>   VALUES (new.page_id, new.page_text);
> END;
>
> CREATE TRIGGER update_fts
> AFTER UPDATE OF page_text ON pages
> BEGIN
>   UPDATE fts_pages
>   SET page_text = new.page_text
>   WHERE rowid = old.page_id;
> END;
>
> When I enter a new row like so via the sqlite3  (version 3.5.6) shell
> on my MBP with OS X 10.5.2, I get the following error
>
> sqlite> INSERT INTO pages (page_name, page_text) VALUES ('foo',  
> 'bar');
> Bus error
>
> and the sqlite3 shell quits out to the bash shell.
>
> A small journal file is left, and if I enter sqlite3 again, I get the
> message that the db is locked. I can proceed once I delete the journal
> file. I have the following crash log to report
>
> Process: sqlite3 [1464]
> Path:/usr/local/bin/sqlite3
> Identifier:  sqlite3
> Version: ??? (???)
> Code Type:   X86 (Native)
> Parent Process:  bash [291]
>
> Date///Time:   2008-03-02 15:24:45.729 -0600
> OS Version:  Mac OS X 10.5.2 (9C31)
> Report Version:  6
>
> Exception Type:  EXC_BAD_ACCESS (SIGBUS)
> Exception Codes: KERN_PROTECTION_FAILURE at 0x
> Crashed Thread:  0
>
> Thread 0 Crashed:
> 0   libsqlite3.0.dylib0x000ba7d8 sqlite3Step + 15862
> 1   libsqlite3.0.dylib0x000bde17 sqlite3_step + 75
> 2   libsqlite3.0.dylib0x000a333d sqlite3_exec + 209
> 3   sqlite3   0x6059 process_input + 1124
> 4   sqlite3   0x6c2a main + 2527
> 5   sqlite3   0x2596 start + 54
>
> Thread 0 crashed with X86 Thread State (32-bit):
>   eax: 0x00807480  ebx: 0x000b69f3  ecx: 0x0013d808  edx: 0x
>   edi: 0x0080b04c  esi: 0x0018  ebp: 0xbfffed98  esp: 0xbfffe930
>ss: 0x001f  efl: 0x00010206  eip: 0x000ba7d8   cs: 0x0017
>ds: 0x001f   es: 0x001f   fs: 0x   gs: 0x0037
>   cr2: 0x
>
> Binary Images:
> 0x1000 - 0x7fe7 +sqlite3 ??? (???) /usr/local/bin/sqlite3
>0x21000 -0x37fea  libedit.2.dylib ??? (???)
>  /usr/lib/libedit.2.dylib
>0x6a000 -0xc8fff +libsqlite3.0.dylib ??? (???)
> /usr/local/lib/libsqlite3.0.dylib
> 0x8fe0 - 0x8fe2da53  dyld 96.2 (???)
> <7af47d3b00b2268947563c7fa8c59a07> /usr/lib/dyld
> 0x9001c000 - 0x90020fff  libmathCommon.A.dylib ??? (???)
> /usr/lib/system/libmathCommon.A.dylib
> 0x908cb000 - 0x908d2fe9  libgcc_s.1.dylib ??? (???)
>  /usr/lib/libgcc_s.1.dylib
> 0x9126b000 - 0x9129aff7  libncurses.5.4.dylib ??? (???)
> <3b2ac2ca8190942b6b81d2a7012ea859> /usr/lib/libncurses.5.4.dylib
> 0x923c8000 - 0x92527ff3  libSystem.B.dylib ??? (???)
> <4899376234e55593b22fc370935f8cdf> /usr/lib/libSystem.B.dylib
> 0x - 0x1780  libSystem.B.dylib ??? (???) /usr/lib/ 
> libSystem.B.dylib
>
> Any advice?
> ___
> 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] Multiple databases

2008-03-02 Thread Dan

On Mar 3, 2008, at 12:55 AM, Kee Wee wrote:

>
> I would be very interested to follow-up this subject closely,
> as we are actually performing the same kind of work as you are  
> looking for.
>
> One of the answer you got was that it is not possible to reuse a  
> prepared
> statement from one database to another.
> This answer was too quick, and did not include any explanation ->  
> so I would
> rather prefer to ask again the question, and obtain why it is not  
> possible.
>
> I would say that the test I have performed until now make this thing
> possible.
> I agree that this requires to tweak a little bit the way SQLite is  
> working
> (without recompiling anything, only using the internal members of  
> the opaque
> structures).
>
> If VDBE programmers think that I am getting too deep inside the VDBE
> internal structures to handle this problem, (or that it is too  
> risky for
> data integrity), please feel free to comment vigorously on this  
> subject.
>
> The work performed was to swap Database Handles.
> Following code is included in XMLRAD DacSQLite3 to address exactly  
> this
> problem:
>
> procedure StmtSwapVdbe(Statement: TDISQLite3StatementHandle; NewDB:
> Pointer);
> var
>   Vdbe: PVdbe;
> begin
>   Vdbe := PVdbe(Statement);
>   if Vdbe.db = NewDB then
> Exit;
>   // Uninstall Vdbe from its actual Vdbe.db
>   if Vdbe.pPrev <> nil then
> Vdbe.pPrev.pNext := Vdbe.pNext
>   else
> Vdbe.db.pVdbe := Vdbe.pNext;
>   if Vdbe.pNext <> nil then
> Vdbe.pNext.pPrev := Vdbe.pPrev;
>
>   // Install Vdbe to the NewDB
>   Vdbe.db := NewDB;
>   if Vdbe.db.pVdbe <> nil then
> Vdbe.db.pVdbe.pPrev := Vdbe;
>   Vdbe.pNext := Vdbe.db.pVdbe;
>   Vdbe.pPrev := nil;
>   Vdbe.db.pVdbe := Vdbe;
> end;
>
> Once again, if any programmer of the VDBE could comment on this, I  
> am even
> willing to pay money to get audit of the code, and get confirmation  
> that
> this technique is valid and does not put at risk data integrity of
> databases.

It think this risks database corruption.

Vdbe programs hard-code the schema-version number and the
locations of tables and indexes in the database file. These
might be different for different databases, even those with
the same schema. If the table/index locations are different
but the schema cookie is the same, you are risking database
corruption.

Also, prepared statement structures contain some pointers
back to the database handle that was used to create them.
Not sure what the implications of this are, but it doesn't
seem safe.

There might be other reasons this is dangerous too.

Dan.






> -- 
> View this message in context: http://www.nabble.com/Multiple- 
> databases-tp15035409p15790869.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

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


Re: [sqlite] Checking that a row exists?

2008-03-02 Thread Gilles Ganault
On Thu, 21 Feb 2008 11:40:45 -0700, Dennis Cote
<[EMAIL PROTECTED]> wrote:
>select exists (SELECT * FROM sqlite_master WHERE type='table' AND 
>lower(name)=?)
>
>This will always return one row with one column with a value that is 
>either 0 or 1.

Thanks guys for the help.

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


Re: [sqlite] [newbie] SQLite and VB.Net?

2008-03-02 Thread Gilles Ganault
On Sun, 2 Mar 2008 21:07:03 -0500, "Samuel Neff"
<[EMAIL PROTECTED]> wrote:
> I would go the ADO.NET route 'cause it'll fit into your .NET application much
>better.  The overhead is minimal compared to the normal cost of running
>database queries (in any database).

The reason I'm concerned about using ADO.Net instead of hitting the
SQLite library directly, is that this adds dependencies in addition to
the .Net framework. Our customers are anything but computer-savvy, and
most don't have anyone technical around in case things don't work, so
that I'd like to minimize dependencies as much as possible.

Also, what about performance when using the SQLite library directly
vs. going through ADO.Net?

Hopefully, I'll have VS2005/2008 and SQLite up and running by the end
of the week, so I can check for myself.

Thank you.

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


Re: [sqlite] [newbie] SQLite and VB.Net?

2008-03-02 Thread Samuel Neff
The System.Data.SQLite wrapper that others have mentioned is wonderful.  I
would go the ADO.NET route 'cause it'll fit into your .NET application much
better.  The overhead is minimal compared to the normal cost of running
database queries (in any database).

However, if you really want to skip ADO.NET,you can use the transparent
wrappers that are included in System.Data.SQLite directly.  I believe they
have the exact same API as the core C library but can be called directly
from .NET.  Robert put a lot of work writing C wrappers for the sqlite
library that can be called from .NET, something to do with changing the call
specs but I don't know the details.  No reason to re-invent the wheel.  :-)

Also, the System.Data.SQLite wrapper allows you to easily write custom
functions in .NET, scalar, aggregate, and collation.  Doing that without his
wrapper would be a lot more work.

HTH,

Sam


On Sun, Mar 2, 2008 at 5:36 PM, nonags <[EMAIL PROTECTED]> wrote:

> Gilles
>
> I am a .Net developer and I use an excellent implementation
> System.Data.SQLite http://sqlite.phxsoftware.com/
>
> Regards
>
>

-- 
-
We're Hiring! Seeking passionate Flex, C#, or C++ (RTSP, H264) developer.
 Position is in the Washington D.C. metro area. Contact
[EMAIL PROTECTED]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [newbie] SQLite and VB.Net?

2008-03-02 Thread nonags
Gilles

I am a .Net developer and I use an excellent implementation
System.Data.SQLite http://sqlite.phxsoftware.com/

Regards



On Mon, Mar 3, 2008 at 7:50 AM, Gilles Ganault <[EMAIL PROTECTED]>
wrote:

> On Sun, 2 Mar 2008 08:13:18 -0800 (PST), Jalil Vaidya
> <[EMAIL PROTECTED]> wrote:
> >There are ADO.NET  providers available for SQLite.
>
> Thanks guys for the input.
>
> ___
> 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] bus error with SQLite 3.5.6

2008-03-02 Thread P Kishor
I have a fairly simple db with fts3

TABLE pages (page_id INTEGER PRIMARY KEY, page_name TEXT, page_text TEXT);

VIRTUAL TABLE fts_pages USING fts3 (page_name, page_text);

 and the following triggers --

CREATE TRIGGER delete_fts
AFTER DELETE ON pages
BEGIN
  DELETE FROM fts_pages WHERE rowid = old.page_id;
END;

CREATE TRIGGER insert_fts
AFTER INSERT ON pages
BEGIN
  INSERT INTO fts_pages (rowid, page_text)
  VALUES (new.page_id, new.page_text);
END;

CREATE TRIGGER update_fts
AFTER UPDATE OF page_text ON pages
BEGIN
  UPDATE fts_pages
  SET page_text = new.page_text
  WHERE rowid = old.page_id;
END;

When I enter a new row like so via the sqlite3  (version 3.5.6) shell
on my MBP with OS X 10.5.2, I get the following error

sqlite> INSERT INTO pages (page_name, page_text) VALUES ('foo', 'bar');
Bus error

and the sqlite3 shell quits out to the bash shell.

A small journal file is left, and if I enter sqlite3 again, I get the
message that the db is locked. I can proceed once I delete the journal
file. I have the following crash log to report

Process: sqlite3 [1464]
Path:/usr/local/bin/sqlite3
Identifier:  sqlite3
Version: ??? (???)
Code Type:   X86 (Native)
Parent Process:  bash [291]

Date/Time:   2008-03-02 15:24:45.729 -0600
OS Version:  Mac OS X 10.5.2 (9C31)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x
Crashed Thread:  0

Thread 0 Crashed:
0   libsqlite3.0.dylib  0x000ba7d8 sqlite3Step + 15862
1   libsqlite3.0.dylib  0x000bde17 sqlite3_step + 75
2   libsqlite3.0.dylib  0x000a333d sqlite3_exec + 209
3   sqlite3 0x6059 process_input + 1124
4   sqlite3 0x6c2a main + 2527
5   sqlite3 0x2596 start + 54

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x00807480  ebx: 0x000b69f3  ecx: 0x0013d808  edx: 0x
  edi: 0x0080b04c  esi: 0x0018  ebp: 0xbfffed98  esp: 0xbfffe930
   ss: 0x001f  efl: 0x00010206  eip: 0x000ba7d8   cs: 0x0017
   ds: 0x001f   es: 0x001f   fs: 0x   gs: 0x0037
  cr2: 0x

Binary Images:
0x1000 - 0x7fe7 +sqlite3 ??? (???) /usr/local/bin/sqlite3
   0x21000 -0x37fea  libedit.2.dylib ??? (???)
 /usr/lib/libedit.2.dylib
   0x6a000 -0xc8fff +libsqlite3.0.dylib ??? (???)
/usr/local/lib/libsqlite3.0.dylib
0x8fe0 - 0x8fe2da53  dyld 96.2 (???)
<7af47d3b00b2268947563c7fa8c59a07> /usr/lib/dyld
0x9001c000 - 0x90020fff  libmathCommon.A.dylib ??? (???)
/usr/lib/system/libmathCommon.A.dylib
0x908cb000 - 0x908d2fe9  libgcc_s.1.dylib ??? (???)
 /usr/lib/libgcc_s.1.dylib
0x9126b000 - 0x9129aff7  libncurses.5.4.dylib ??? (???)
<3b2ac2ca8190942b6b81d2a7012ea859> /usr/lib/libncurses.5.4.dylib
0x923c8000 - 0x92527ff3  libSystem.B.dylib ??? (???)
<4899376234e55593b22fc370935f8cdf> /usr/lib/libSystem.B.dylib
0x - 0x1780  libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib

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


Re: [sqlite] sqlite3: handling of indices

2008-03-02 Thread Neville Franks
I think you are misinterpreting this. It says:

"Every time the database is opened, all CREATE INDEX statements are
read from the sqlite_master table and used to regenerate SQLite's
internal representation of the index layout."

This does not say it recreates the index, just the internal
representation.

Indices are stored in the database file. I don't know what leads you
to think otherwise.

The file size may not increase if you just add a few records and the
if the clm which is indexed is narrow (short words).

Basically you concerns are unfounded.


Monday, March 3, 2008, 7:58:50 AM, you wrote:

ML> Hello sqlite-users,

ML> is it true, that in sqlite3 indices are not stored in the database-file?

ML> When reading the section
ML> http://sqlite.org/lang_createindex.html it
ML> seems that CREATE INDEX statements are only stored in the sqlite_master
ML> table and the index will be generated every time the database is opened.

ML> Can sqlite3 be forced to store the index itself in the database-file?
ML> (In SQLite2 indices were stored directly in the file, wheren't they?)

ML> When creating an index on a database the filesize does not increase so I
ML> suppose the index is not stored in the file.

ML> Background: 
ML> 1. The database will be used "read-only", a regeneration of the index is
ML> not necessary.
ML> 2. The database will be accessed via jdbc, a regeneration of indices
ML> with every opening of the file causes to many "regeneration".

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



-- 
Best regards,
  Neville Franks, http://www.surfulater.com http://blog.surfulater.com
 

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


[sqlite] sqlite3: handling of indices

2008-03-02 Thread Michael Lukaschek
Hello sqlite-users,

is it true, that in sqlite3 indices are not stored in the database-file?

When reading the section http://sqlite.org/lang_createindex.html it
seems that CREATE INDEX statements are only stored in the sqlite_master
table and the index will be generated every time the database is opened.

Can sqlite3 be forced to store the index itself in the database-file?
(In SQLite2 indices were stored directly in the file, wheren't they?)

When creating an index on a database the filesize does not increase so I
suppose the index is not stored in the file.

Background: 
1. The database will be used "read-only", a regeneration of the index is
not necessary.
2. The database will be accessed via jdbc, a regeneration of indices
with every opening of the file causes to many "regeneration".

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


Re: [sqlite] [newbie] SQLite and VB.Net?

2008-03-02 Thread Gilles Ganault
On Sun, 2 Mar 2008 08:13:18 -0800 (PST), Jalil Vaidya
<[EMAIL PROTECTED]> wrote:
>There are ADO.NET providers available for SQLite.

Thanks guys for the input.

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


Re: [sqlite] Select Problem

2008-03-02 Thread 7150
P Kishor wrote:

> 
> try
> 
> SELECT * FROM dictionary WHERE Word = '"eleven"';



>>  I am sure this is due to the fact that I am an idiot, but I could use
>>  some help.
>>



It worked.

I was correct. I am an idiot.

Thank you for the help. Lesson learned.

George

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


Re: [sqlite] Select Problem

2008-03-02 Thread P Kishor
On 3/2/08, 7150 <[EMAIL PROTECTED]> wrote:
> I have created a database: norsk.db
>
>  a table: dictionary
>
>  sqlite> .schema
>  CREATE TABLE dictionary(Ord varchar(255), Word varchar(255), GV
>  varchar(255), Part varchar(255), PrTDS varchar(255), PaTIP varchar(255),
>  PPDP varchar(255));
>  sqlite>
>
>  The table contents were imported from a UTF-8 csv file. There are nearly
>  4000 records.
>
>  [EMAIL PROTECTED]:~/sql$ sqlite3 norsk.db
>  SQLite version 3.4.2
>  Enter ".help" for instructions
>  sqlite>
>
>  Here is a select operation that works:
>
>  sqlite> select * from dictionary where Part = "";
>  "annenhver"|"every other"|
>  "april"|"April"|
>  "armbrøst  ?"||
>  "august"|"August"|
>  "bedrukket"|"finished drinking"|
>  "bespist"|"finished eating"|
>  "bortafor"|"beyond, on the other side"|
>  "desember"|"December"|
>  "elleve"|"eleven"|
>  "ellevte"|"eleventh"|
>  "ett"|"one"|
>  "Europa"|"Europe"|
>  "februar"|"February"|
>  "fem"|"five"|
>  "femte"|"fifth"|
>  "femten"|"fifteen"|
>  "femti"|"fifty"|
>  "femtiende"|"fiftieth"|
>  "fire"|"four"|
>  "fjerde"|"fourth"|
>  "fjorten"|"fourteen"|
>  "fjortende"|"fourteenth"|
>  "fredag"|"Friday"|
>  "fridag"|"Friday"|
>  "førti"|"forty"|
>  "førtiende"|"fortieth"|
>  "gruble ?"|"brood, mull over, muse, ponder"|||"grubler"|"grublet"|
>  "hundre"|"hundred"|
>  "ja"|"yes"|
>  "januar"|"January"|
>  "juli"|"July"|
>  "juni"|"June"|
>  "kalosjer ?"|"boots, galoshes"|
>  "kattugle"|"tawny owl"|
>  "kjent"|"little bit, mite, smidgen"|
>  "lørdag"|"Saturday"|
>  "mai"|"May"|
>  "maks"|"max"|
>  "mandag"|"Monday"|
>  "mars"|"March"|
>  "mjo ?"||
>  "nedbør"|"precipitation"|"en"||"nedbøren"||
>  "nedentil ?"|"underneath"|
>  "nei"|"no"|
>  "ni"|"nine"|
>  "niende"|"ninth"|
>  "nitiende"|"ninetieth"|
>  "nitten"|"nineteen"|
>  "nittende"|"nineteenth"|
>  "nitti"|"ninety"|
>  "nord"|"north"|
>  "nord-norge"|"Northern Norway"|
>  "november"|"November"|
>  "null"|"zero"|
>  "oktober"|"October"|
>  "onsdag"|"Wednesday"|
>  "røre"|"mixture"|"et/a"||"røret/røra"|"rører"|"rørene"
>  "seks"|"six"|
>  "seksten"|"sixteen"|
>  "sekstende"|"sixteenth"|
>  "seksti"|"sixty"|
>  "sekstiende"|"sixtieth"|
>  "senest"|"since"|
>  "september"|"September"|
>  "skjer ?"|"happen"|
>  "skrevs"|"astraddle, astride, striding"|"adv."
>  "smaragdene"||
>  "striks"|"strict; exacting, scrupulous"|||"adj."||
>  "sverige"|"Sweden"|
>  "sytten"|"seventeen"|
>  "syttende"|"seventeenth"|
>  "sytti"|"seventy"|
>  "syttiende"|"seventieth"|
>  "søndag"|"Sunday"|
>  "sør"|"south"|
>  "sørover"|"southwards"|
>  "ta imot ?"|"accept, receive"|
>  "ti"|"ten"|
>  "tiende"|"tenth"|
>  "tirsdag"|"Tuesday"|
>  "tjue"|"twenty"|
>  "tjuende"|"twentieth"|
>  "to"|"two"|
>  "tolv"|"twelve"|
>  "tolvte"|"twelfth"|
>  "tom ?"|"empty, vacant, deserted"|"adj."
>  "torsdag"|"Thursday"|
>  "tre"|"three"|
>  "tretten"|"thirteen"|
>  "trettende"|"thirteenth"|
>  "tretti"|"thirty"|
>  "trettiende"|"thirtieth"|
>  "trøndelag"|"area to north and south of Trondheim"|
>  "tusen"|"thousand"|
>  "ukevis ?"||
>  "æbødigst"|"yours faithfully"|
>  "åffer ?"|"why"|
>  "åtte"|"eight"|
>  "åttende"|"eighth"|
>  "åtti"|"eighty"|
>  "åttiende"|"eightieth"|
>  sqlite>
>
>  In the above example, I am selecting records with a particular blank field.
>
>  If I attempt to select for anything but blank, I get nothing:
>
>  sqlite> select * from dictionary where Word = "eleven";

try

SELECT * FROM dictionary WHERE Word = '"eleven"';

that reads

' followed by "eleven" followed by '

>  sqlite>
>
>  You will note that "eleven" is in record nine from the preceding selection.
>
>  I am sure this is due to the fact that I am an idiot, but I could use
>  some help.
>
>  Has anyone any ideas?
>
>  Does it have anything to do with UTF-8?
>
>  Thank you,
>
>  George
>
>
>  --
>
>  ---
>  http://www.litenverden.org
>  ___
>  sqlite-users mailing list
>  sqlite-users@sqlite.org
>  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Select Problem

2008-03-02 Thread 7150
I have created a database: norsk.db

a table: dictionary

sqlite> .schema
CREATE TABLE dictionary(Ord varchar(255), Word varchar(255), GV 
varchar(255), Part varchar(255), PrTDS varchar(255), PaTIP varchar(255), 
PPDP varchar(255));
sqlite>

The table contents were imported from a UTF-8 csv file. There are nearly 
4000 records.

[EMAIL PROTECTED]:~/sql$ sqlite3 norsk.db
SQLite version 3.4.2
Enter ".help" for instructions
sqlite>

Here is a select operation that works:

sqlite> select * from dictionary where Part = "";
"annenhver"|"every other"|
"april"|"April"|
"armbrøst  ?"||
"august"|"August"|
"bedrukket"|"finished drinking"|
"bespist"|"finished eating"|
"bortafor"|"beyond, on the other side"|
"desember"|"December"|
"elleve"|"eleven"|
"ellevte"|"eleventh"|
"ett"|"one"|
"Europa"|"Europe"|
"februar"|"February"|
"fem"|"five"|
"femte"|"fifth"|
"femten"|"fifteen"|
"femti"|"fifty"|
"femtiende"|"fiftieth"|
"fire"|"four"|
"fjerde"|"fourth"|
"fjorten"|"fourteen"|
"fjortende"|"fourteenth"|
"fredag"|"Friday"|
"fridag"|"Friday"|
"førti"|"forty"|
"førtiende"|"fortieth"|
"gruble ?"|"brood, mull over, muse, ponder"|||"grubler"|"grublet"|
"hundre"|"hundred"|
"ja"|"yes"|
"januar"|"January"|
"juli"|"July"|
"juni"|"June"|
"kalosjer ?"|"boots, galoshes"|
"kattugle"|"tawny owl"|
"kjent"|"little bit, mite, smidgen"|
"lørdag"|"Saturday"|
"mai"|"May"|
"maks"|"max"|
"mandag"|"Monday"|
"mars"|"March"|
"mjo ?"||
"nedbør"|"precipitation"|"en"||"nedbøren"||
"nedentil ?"|"underneath"|
"nei"|"no"|
"ni"|"nine"|
"niende"|"ninth"|
"nitiende"|"ninetieth"|
"nitten"|"nineteen"|
"nittende"|"nineteenth"|
"nitti"|"ninety"|
"nord"|"north"|
"nord-norge"|"Northern Norway"|
"november"|"November"|
"null"|"zero"|
"oktober"|"October"|
"onsdag"|"Wednesday"|
"røre"|"mixture"|"et/a"||"røret/røra"|"rører"|"rørene"
"seks"|"six"|
"seksten"|"sixteen"|
"sekstende"|"sixteenth"|
"seksti"|"sixty"|
"sekstiende"|"sixtieth"|
"senest"|"since"|
"september"|"September"|
"skjer ?"|"happen"|
"skrevs"|"astraddle, astride, striding"|"adv."
"smaragdene"||
"striks"|"strict; exacting, scrupulous"|||"adj."||
"sverige"|"Sweden"|
"sytten"|"seventeen"|
"syttende"|"seventeenth"|
"sytti"|"seventy"|
"syttiende"|"seventieth"|
"søndag"|"Sunday"|
"sør"|"south"|
"sørover"|"southwards"|
"ta imot ?"|"accept, receive"|
"ti"|"ten"|
"tiende"|"tenth"|
"tirsdag"|"Tuesday"|
"tjue"|"twenty"|
"tjuende"|"twentieth"|
"to"|"two"|
"tolv"|"twelve"|
"tolvte"|"twelfth"|
"tom ?"|"empty, vacant, deserted"|"adj."
"torsdag"|"Thursday"|
"tre"|"three"|
"tretten"|"thirteen"|
"trettende"|"thirteenth"|
"tretti"|"thirty"|
"trettiende"|"thirtieth"|
"trøndelag"|"area to north and south of Trondheim"|
"tusen"|"thousand"|
"ukevis ?"||
"æbødigst"|"yours faithfully"|
"åffer ?"|"why"|
"åtte"|"eight"|
"åttende"|"eighth"|
"åtti"|"eighty"|
"åttiende"|"eightieth"|
sqlite>

In the above example, I am selecting records with a particular blank field.

If I attempt to select for anything but blank, I get nothing:

sqlite> select * from dictionary where Word = "eleven";
sqlite>

You will note that "eleven" is in record nine from the preceding selection.

I am sure this is due to the fact that I am an idiot, but I could use 
some help.

Has anyone any ideas?

Does it have anything to do with UTF-8?

Thank you,

George

-- 

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


Re: [sqlite] Multiple databases

2008-03-02 Thread Kee Wee

I would be very interested to follow-up this subject closely,
as we are actually performing the same kind of work as you are looking for.

One of the answer you got was that it is not possible to reuse a prepared
statement from one database to another.
This answer was too quick, and did not include any explanation -> so I would
rather prefer to ask again the question, and obtain why it is not possible.

I would say that the test I have performed until now make this thing
possible.
I agree that this requires to tweak a little bit the way SQLite is working
(without recompiling anything, only using the internal members of the opaque
structures).

If VDBE programmers think that I am getting too deep inside the VDBE
internal structures to handle this problem, (or that it is too risky for
data integrity), please feel free to comment vigorously on this subject.

The work performed was to swap Database Handles.
Following code is included in XMLRAD DacSQLite3 to address exactly this
problem:

procedure StmtSwapVdbe(Statement: TDISQLite3StatementHandle; NewDB:
Pointer);
var
  Vdbe: PVdbe;
begin
  Vdbe := PVdbe(Statement);
  if Vdbe.db = NewDB then
Exit;
  // Uninstall Vdbe from its actual Vdbe.db
  if Vdbe.pPrev <> nil then
Vdbe.pPrev.pNext := Vdbe.pNext
  else
Vdbe.db.pVdbe := Vdbe.pNext;
  if Vdbe.pNext <> nil then
Vdbe.pNext.pPrev := Vdbe.pPrev;

  // Install Vdbe to the NewDB
  Vdbe.db := NewDB;
  if Vdbe.db.pVdbe <> nil then
Vdbe.db.pVdbe.pPrev := Vdbe;
  Vdbe.pNext := Vdbe.db.pVdbe;
  Vdbe.pPrev := nil;
  Vdbe.db.pVdbe := Vdbe;
end;

Once again, if any programmer of the VDBE could comment on this, I am even
willing to pay money to get audit of the code, and get confirmation that
this technique is valid and does not put at risk data integrity of
databases.

-- 
View this message in context: 
http://www.nabble.com/Multiple-databases-tp15035409p15790869.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] since when was fts3 included in binary?

2008-03-02 Thread Steven Fisher
On 2-Mar-2008, at 3:55 AM, Rael Bauer wrote:

>  It seems that fts3 is now (3.5.6) included in the windows  
> binary .dll. I'd like to know since when was fts3 included in the  
> binary?
>
>  Also, since when did the amalgamation include the fts3 sources?

According to the web page, 3.5.3.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [newbie] SQLite and VB.Net?

2008-03-02 Thread Jalil Vaidya
There are ADO.NET providers available for SQLite. That would be the way to go 
if you want to use SQLite in .NET (any language). Check out these links:

http://sqlite.phxsoftware.com/
http://adodotnetsqlite.sourceforge.net/
http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers - Scroll down to .NET 
section

Disclaimer: I haven't used any of these providers so I cannot comment on it.

HTH,

Jalil Vaidya
 
01001010
0111
01101100
01101001
01101100

- Original Message 
From: Brad House <[EMAIL PROTECTED]>
To: General Discussion of SQLite Database 
Sent: Sunday, March 2, 2008 9:29:33 AM
Subject: Re: [sqlite] [newbie] SQLite and VB.Net?

> I don't know anything about .Net, and I'd like to build a quick app
> with Visual Studio 2005 or 2008 to check how well it performs with
> SQLite. If performance and deployment prove to be good enough, we'll
> use VB.Net for new projects and finally dump VB6.

I have almost no experience with .Net (or any other microsoft-specific
technologies), but we've had to advise some clients on how to use
a library we provide from within Vb.Net and the InteropServices worked
for them.  Not sure if they'd meet your needs or not, but you might
give them a shot, it's as close to native as you'll get.

Basic structure I think goes like this (though it should be easy
to google):

Imports System.Runtime.InteropServices

Declare Ansi Function sqlite3_open Lib "sqlite3.dll" _
(ByVal filename As String, ByRef db As IntPtr) _
As Integer
Public SQLITE3_OK = 0


Dim db As IntPtr
If sqlite3_open("my_sqlite3.db", db) != SQLITE3_O
K
Console.WriteLine("Failed to open")
End If

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





  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how do I know for sure that my data hit the disk?

2008-03-02 Thread Igor Tandetnik
"Adam Megacz" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> "Igor Tandetnik" <[EMAIL PROTECTED]> writes:
>>> I have an application that absolutely must not return from a certain
>>> call until the results of an update are safely committed to disk.
>
>> Open a separate connection to the same database, perform the update
>> on this connection.
>
> I am in an environment where the underlying operating system does not
> provide reliable interprocess file locking (in fact, it flat-out
> lies).  Is this still safe?

Wouldn't you have two connections within the same process, in your 
scenario? As I understand, within the same process SQLite doesn't rely 
on POSIX locks and instead uses in-memory data structures shared by all 
connections.

There was a similar discussion recently - see

http://thread.gmane.org/gmane.comp.db.sqlite.general/35784/

Igor Tandetnik 



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


Re: [sqlite] [newbie] SQLite and VB.Net?

2008-03-02 Thread Brad House
>   I don't know anything about .Net, and I'd like to build a quick app
> with Visual Studio 2005 or 2008 to check how well it performs with
> SQLite. If performance and deployment prove to be good enough, we'll
> use VB.Net for new projects and finally dump VB6.

I have almost no experience with .Net (or any other microsoft-specific
technologies), but we've had to advise some clients on how to use
a library we provide from within Vb.Net and the InteropServices worked
for them.  Not sure if they'd meet your needs or not, but you might
give them a shot, it's as close to native as you'll get.

Basic structure I think goes like this (though it should be easy
to google):

Imports System.Runtime.InteropServices

Declare Ansi Function sqlite3_open Lib "sqlite3.dll" _
(ByVal filename As String, ByRef db As IntPtr) _
As Integer
Public SQLITE3_OK = 0


Dim db As IntPtr
If sqlite3_open("my_sqlite3.db", db) != SQLITE3_O
K
Console.WriteLine("Failed to open")
End If

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


[sqlite] since when was fts3 included in binary?

2008-03-02 Thread Rael Bauer
Hi,
   
  It seems that fts3 is now (3.5.6) included in the windows binary .dll. I'd 
like to know since when was fts3 included in the binary?
   
  Also, since when did the amalgamation include the fts3 sources?
   
  Thank you
  Rael 
   
   

   
-
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Can I manually Lock a database?

2008-03-02 Thread Luca Olivetti
En/na Jerry Krinock ha escrit:

> How can I manually lock the database using the C API?  I can't find  
> any "lock" function.

In think you could just execute a "BEGIN EXCLUSIVE" query, then do your 
thing then execute a "COMMIT" (or a "ROLLBACK" if something failed).

Bye

-- 
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004  Fax +34 93 5883007
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Can I manually Lock a database?

2008-03-02 Thread Clay Dowling
Jerry Krinock wrote:
> That's easy enough to detect with API from the OS, but a conflict can  
> still occur if they launch and start reading while I am in the middle  
> of writing something I don't want to stop.  I need to lock the  
> database so that they get SQLITE_BUSY until I'm done.
> 
> How can I manually lock the database using the C API?  I can't find  
> any "lock" function.

http://www.openbsd.org/cgi-bin/man.cgi?query=flock

That only works if you're on a UNIX based OS, but it's the right trick
to use there.

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


Re: [sqlite] how do I know for sure that my data hit the disk?

2008-03-02 Thread Adam Megacz

"Igor Tandetnik" <[EMAIL PROTECTED]> writes:
>> I have an application that absolutely must not return from a certain
>> call until the results of an update are safely committed to disk.

> Open a separate connection to the same database, perform the update on 
> this connection.

I am in an environment where the underlying operating system does not
provide reliable interprocess file locking (in fact, it flat-out
lies).  Is this still safe?

  - a

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


[sqlite] vacuum doesn't clean all errors with 3.5.6, it did under 3.3.8

2008-03-02 Thread Luca Olivetti
Hello,
due to my recent problem
http://thread.gmane.org/gmane.comp.db.sqlite.general/35992

I tried to download 3.5.6 and compiled it with --enable-threadsafe.
While with 3.3.8 a vacuum cleared all errors reported by "PRAGMA 
integrity_check", 3.5.6 doesn't:

$ sqlite3 almacen.db.malo
SQLite version 3.5.6
Enter ".help" for instructions
sqlite> pragma integrity_check;
*** in database main ***
Main freelist: 1 of 1 pages missing from overflow list starting at 0
wrong # of entries in index fifo_referencias
wrong # of entries in index sqlite_autoindex_fifo_fis_1
sqlite> vacuum;
sqlite> pragma integrity_check;
wrong # of entries in index fifo_referencias
wrong # of entries in index sqlite_autoindex_fifo_fis_1

Is this expected? If so, how can I fix these errors? (yes, I know that I 
could dump and restore, but I need something more automated).

Bye
-- 
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004  Fax +34 93 5883007
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users