[sqlite] #ifdef in parse.y?

2004-01-10 Thread Brad Campbell
G'day all,

In my quest to get regex support running I have modified parse.y to 
accept ~ as regex or bitnot depending on context.
I have put #ifdefs around all the regex code and setup an autoconf test 
for it so it can be compiled out, or is not compiled in if the OS does 
not support regex.

I really want to be able to compile out the parsing logic for it also if 
it's not supported or wanted. Can I do this with lemon?

Short of this I guess I can assign it to a noop if regex support is not 
compiled in.

It currently behaves very much like the regex in postgres but without 
the anchoring for indexes. At first glance a regex search appears to be 
faster than a LIKE also. If I can get profiling running I can get some 
firm numbers. At the moment if I compile with -DVDBE_PROFILE=1 I get a 
segfault on loading the database

This is with CVS sqlite as of about 30 minutes ago.

(gdb) run
Starting program: /usr/local/bin/sqlite datebook.db
Program received signal SIGSEGV, Segmentation fault.
sqliteVdbeExec (p=0x8054f70) at src/vdbe.c:517
517 pOp = >aOp[pc];
(gdb) bt
#0  sqliteVdbeExec (p=0x8054f70) at src/vdbe.c:517
#1  0x4002753f in sqliteExec (pParse=0xbfffe3e0) at src/build.c:97
#2  0x4003c315 in yy_reduce (yypParser=0x8054590, yyruleno=5) at parse.y:78
#3  0x4003f25d in sqliteParser (yyp=0x8054590, yymajor=107, yyminor={z = 
0xe6b80a30 , dyn = 1, n = 251}, 
pParse=0xe6b80a30) at parse.c:3990
#4  0x400482ca in sqliteRunParser (pParse=0xbfffe3e0, zSql=0x4006a780 
"SELECT type, name, rootpage, sql, 1 FROM sqlite_temp_master UNION ALL 
SELECT type, name, rootpage, sql, 0 FROM sqlite_master", 
pzErrMsg=0xbfffe5bc)
at src/tokenize.c:458
#5  0x400369e3 in sqliteInitOne (db=0x804e808, iDb=0, 
pzErrMsg=0xbfffe5bc) at src/main.c:337
#6  0x40036d9e in sqliteInit (db=0x804e808, pzErrMsg=0xbfffe5bc) at 
src/main.c:386
#7  0x40036fbe in sqlite_open (zFilename=0xbc7b "datebook.db", 
mode=438, pzErrMsg=0xbfffe5bc) at src/main.c:464
#8  0x08049d65 in open_db (p=0xbfffe610) at src/shell.c:510
#9  0x0804c0fb in main (argc=2, argv=0xbb84) at src/shell.c:1215

I'll keep working on it anyway.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [sqlite] AGS_SQLite_Wrapper VB

2004-01-10 Thread Greg Obleshchuk
Hi,
The returned result is a variant array.  You move through a array as you
normally do, by increasing a index counter.  You can write a class
around any array to emulate an ADO recordset if you want.

Regards
Greg

-Original Message-
From: ISA Programmi [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 11 January 2004 3:43 AM
To: [EMAIL PROTECTED]
Subject: [sqlite] AGS_SQLite_Wrapper VB


Hi all,

does someone could tell me how to
implement the record (rows) navigation
like "MoveNext", "MovePrevious",
"EOF" etc... using the AGS_SQLite
wrapper and VB6?

Thank you a lot in advance,

Giuliano Isacchi



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Many bugs with threads (errors and corruption)

2004-01-10 Thread D. Richard Hipp
Guillaume Fougnies wrote:
2) Disk image corruption (with indexes):
After a time of running, i get this error in return:
  "database disk image is malformed".
I have tracked this problem down to what appears to be a
bug in Linux threads.  For details see
  http://www.sqlite.org/cvstrac/tktview?tn=561

I am eager for people to double-check my analysis and/or
provide suggestions on how to work around the problem.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] Triggers

2004-01-10 Thread Kurt Welgehausen
Try
create trigger itemDelTrg after delete on Items for each row begin
delete from Stats where Stats.ID  = old.ID;
end;

Also consider
create trigger statInsTrg before insert on Stats for each row
when (select count(ID) from Items where ID = new.ID) = 0 begin
select raise(rollback, 'foreign-key violation');
end;

Also read  if you
haven't already.

Regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] cannot declare member function `static int

2004-01-10 Thread eno
My Implementation:
##
namespace F {
static int FSqLite :: callback(void *NotUsed, int argc, char 
**argv, char **azColName)
  {
return 0; // only for testing
  }
> [ ... ]

use
int FSqLite :: callback(void *NotUsed, int argc, char **argv, char 
**azColName)

instead.

/eno

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] AGS_SQLite_Wrapper VB

2004-01-10 Thread ISA Programmi
Hi all,

does someone could tell me how to
implement the record (rows) navigation
like "MoveNext", "MovePrevious",
"EOF" etc... using the AGS_SQLite
wrapper and VB6?

Thank you a lot in advance,

Giuliano Isacchi



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] How to update a whole column

2004-01-10 Thread Kurt Welgehausen
What you propose will work, but you haven't given enough
info for anyone to tell you whether it's the best solution.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] SQLite in OpenOffice?

2004-01-10 Thread Jonas Forsman / Axier.SE
Hi all,

wouldn't sqlite fit into the openoffice package as access fits into
Microsoft Office?


/ Jonas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] cannot declare member function `static int

2004-01-10 Thread Christian Kienle
Hi,

at the moment I try to write a few wrappers for the sqlite api.

Here we are:
##
#include 
#include 
using namespace std;
namespace F {
 class FSqLite : public FApplication {
  public:
   FSqLite() {}
   ~FSqLite() {}

   static int callback(void *NotUsed, int argc, char **argv, char 
**azColName);
   int sqLiteConnect( const char* stringFileName );
   void sqLiteQuery( const char* charSqlQuery );

   private:
string stringDatabaseName;
sqlite *db;
 };
}
##

My Implementation:
##
namespace F {
static int FSqLite :: callback(void *NotUsed, int argc, char 
**argv, char **azColName)
  {
return 0; // only for testing
  }

 int FSqLite :: sqLiteConnect( const char* stringFileName ) {
  //sqlite *db;

  char *zErrMsg = 0;

   db = sqlite_open(stringFileName, 0, );
   if( db == 0 ) {
// there was an error
return -1;
   }
   else {
stringDatabaseName = stringFileName;
return 0;
   }
 }

 void FSqLite :: sqLiteQuery( const char* charSqlQuery ) {
  int rc;
 // char *zErrMsg = 0;
 char *zErrMsg = 0;
  rc = sqlite_exec(db, charSqlQuery, callback, 0,  );
  //cout << stringDatabaseName;
 }
}
##

I get the following error:

g++ index.cpp -L/usr/local/lib -lsqlite -I/usr/lib/flib -o 
index.cgi
In file included from /usr/lib/flib/fsqlite.h:25,
 from index.cpp:5:
/usr/lib/flib/fsqlite.cpp:3: error: cannot declare member 
function `static int
   F::FSqLite::callback(void*, int, char**, char**)' to have 
static linkage
[EMAIL PROTECTED]:/srv/www/cgi-bin>

I dont know why :(

Hope to find help here...

Greets from germany

Christian
-- 
Linux is like a wigwam - no gates, no windows and an apache 
inside.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Using Mono client in Microsoft.Net

2004-01-10 Thread Richard Heyes
> Not sure if this has been posted before, but it took me a while to work
> out so might help someone.

Thanks for posting this. Had the same issue with my own .net wrapper and at
least now I know why!

-- 
Richard Heyes


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] a few questions about indexes

2004-01-10 Thread [EMAIL PROTECTED]

> ok.  As I am sure you realize it would be very useful to be able to 
> create case-insensitive indexes with:
> 
> create index idx_my_index on my_table(lower(my_column));

How can you be sure which index sqlite will use when there are more indices on a 
field?

> 
> culley
> 
> On Friday, January 9, 2004, at 05:25 PM, D. Richard Hipp wrote:
> 
> > culley harrelson wrote:
> >> 1. Are indexes case sensitive as in postgresql?

 >
> > Yes
> >
> >> 3. Any plans to allow index creation on functions (aka the date
> >> functions)?
> >
> > Yes.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] .Net provider performance

2004-01-10 Thread Tim Anderson
I've been comparing three .Net providers along with the JET OLEDB
provider. I have the same data in an MDB and also an Sqlite db.

The providers I've used so far, all on Windows, are:

- The Mono Sqlite client http://www.go-mono.com
- The AGS Sqlite provider http://www.ag-software.com/sqlite.aspx
- The SQLite.Net project here
http://sourceforge.net/projects/adodotnetsqlite/

The database is not huge. For the example query, there are two tables
joined using a subquery. Table A has 11,000 rows; Table B has 200,000
rows.

The performance of the three .Net providers is near-identical. On the
first run, with the system restarted to eliminate any caching by the
file system, it takes about 4 seconds to execute the query and fill a
datagrid with the results. On subsequent runs it takes about 0.25
seconds, showing the dramatic effect of the caching.
 
The JET provider is an interesting case. The first run takes about 9
seconds. However, subsequent runs are about 0.15 seconds.

Aside from indexing, I've not made any special effort to optimize.

I know how difficult it is to do performance tests, and I don't pretend
these notes have any authority. They are just offered as a point of
general interest.

Tim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]