[sqlite] Compiling sqlite3 CVS version: ./configure --enable-threadsafe failed

2004-08-13 Thread sporkey
If I compile the CVS version with the following option.

  ./configure --enable-threadsafe

I get an error when running Make, unless I add "-lpthread"
to the Makefile as follows. 

  LIBREADLINE = -lreadline -lncurses -lpthread

For some reason, configure isn't adding in the "-lpthread" linker
option to the Makefile.

gcc (GCC) 3.2.2 20030222 

Regards,

Mike Chirico



Re: [sqlite] QNX and PPC

2004-08-13 Thread Jakub Adamek
Hello, if anyone was watching my efforts, I have just won!
The PowerPC machine I am using had the folder /tmp mapped into shared 
memory and the file-locking did not work with it. I changed the 
sqlite3OsTempFileName() function and everything is fine.

I only wonder, what is the file SQLite creates in /tmp? My program calls 
"CREATE TABLE", "INSERT" and "SELECT". Why does SQLite need some 
temporary file?

Jakub
Jakub Adamek wrote:
Still not running on Power PC QNX. I tried to comment out locking in 
os.c and the test program works fine. So the problem is really hidden in 
the findLockInfo() & co. functions. Does somebody have some experience?

Thanks,
Jakub
Jakub Adamek wrote:
Thank you for your help. I am trying to cross-compile SQLite 2.8.15 on 
QNX-x86 to QNX-PPC. Is it possible to do so with some params for 
configure?

I tried to create the Makefile for QNX-x86 by just running 
"./configure" and to change it by hand:

TCC = qcc -g -O2 -V gcc_ntoppc -fno-inline -fno-pack-struct -EB 
-DOS_UNIX=1 -DOS_WIN=0 -DHAVE_USLEEP=1 -I. -I${TOP}/src

LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC)
LTLINK = $(LIBTOOL) --mode=link --tag=CC $(TCC)
LTINSTALL = $(LIBTOOL) --mode=install --tag=CC $(INSTALL)
but the libtool linker failed with "/usr/bin/ntox86-ld: warning: 
powerpc:common architecture of input file '.libs/attach.o' is 
incompatible with i386 output'

thus I had to change the "libtool" script, replacing "gcc" with "qcc 
-V gcc_ntoppc". Which does not seem an elegant solution.

Jakub
Christian Smith wrote:
On Mon, 9 Aug 2004, Jakub Adamek wrote:

Hi Armin,
thank you for your notes. Could you please tell me more about "That's
the case"? Is it possible to use SQLite on PPC or not possible? Did you
hear about a big-endian port of SQLite?


I've used SQLite on SPARC, PowerPC and PA-RISC, all big endian, with no
problems.
The SQLite database file is platform independent, being endian agnostic
and 32/64 bit clean.
BTW, you may want to upgrade to a later version of SQLite, 2.8.15 being
the latest 2.x release.

Thanks,
Jakub
Armin Steinhoff wrote:

[EMAIL PROTECTED] schrieb am 06.08.04 19:40:55:

Hello everybody,


does someone have any experience with building for the QNX operating
system? And for the Power PC processor?


QNX 6.2.1 is a real-time Linux but it behaves strangely sometimes.


No .. it doesn't behave 'strangely" at all :)

It has not gcc but a qcc compiler.


qcc is only a frontend of the gcc ... so QNX has gcc.

Our testing program runs correctly on
the x86 PC. It creates a database, a table, inserts and selects data.
But the same program cross-compiled on the same computer for PPC 
ends at
the first "CREATE TABLE" statement with SQLITE_BUSY.


I am using SQLite 2.8.6. Is it possible that the little-or-big-endian
thing could cause this trouble?


That's the case ..
Regards
  Armin Steinhoff



Or do you have any other ideas?


Thank you very much,
Jakub



Aufnehmen, abschicken, nah sein - So einfach ist
WEB.DE Video-Mail: http://freemail.web.de/?mc=021200




[sqlite] Inserting Qutoed Text

2004-08-13 Thread Michael MacFadden
Hi,
I am trying to insert some text into a table, but the text has some 
quote characters in it.  For example, lets say I have the following table.

CREATE TABLE test ( col1 INTEGER PRIMARY KEY NOT NULL, col2 
varchar(255)  NOT NULL default '' );

Performing the following insert won't work:
INSERT INTO test ( col2 ) VALUES ('This doesn't work');
because of the ' in the word "doesn't".  So I tried escaping the single 
quote by doing this.

INSERT INTO test ( col2 ) VALUES ('This doesn\'t work');
However this didn't work either.  I tried putting double quotes around 
the value like this:

INSERT INTO test ( col2 ) VALUES ("This doesn't work");
This particular insert worked, however there are cases where I would 
need to insert text with a double quote as well so I tried the following 
two inserts:

INSERT INTO test ( col2 ) VALUES ("Test insert with a " in the middle ");
INSERT INTO test ( col2 ) VALUES ("Test insert with a \" in the middle ");
I already have this working in MySQL and PostgreSQL and am trying to add 
support for SQLite.  I am definitely a novice of SQLite.  Is there some 
way to properly escape single and or double quotes, or do I have some 
obvious syntactical error?  Any help would be great.  Thanks.

~Mike



Re: [sqlite] Status of FOREIGN KEY implementation

2004-08-13 Thread David M. Cook
On Wed, Aug 11, 2004 at 05:09:49PM -0700, Cliff Hudson wrote:

> engine in a mobile device.  Foreign key constraints are one of the features
> I would like to see in any database engine we eventually use.  According to
> the web site, this feature is not yet implemented, and the mailing list

This doesn't answer your question, but you can use triggers to implement
things like "on delete cascade", e.g.

  CREATE TRIGGER recording_disc_id_delete DELETE ON disc
  BEGIN
  DELETE FROM recording WHERE disc_id=old.id;
  END;

If you have a lot of tables, you could use a scripting language to generate
the triggers based on sqlite metadata.  For some metadata PRAGMAs see:

  http://sqlite.org/lang.html#pragma

Dave Cook


[sqlite] Re: sqlite3_busy_timeout ignored while doing multi-threaded updates ?

2004-08-13 Thread George Ionescu
More information on this:

Busy handler's return value is indeed ignored: in sqlite3pager_begin I've seen 
this:

..
#if 0
  int busy = 1;
  do {
rc = sqlite3OsLock(>fd, RESERVED_LOCK);
  }while( rc==SQLITE_BUSY && 
  pPager->pBusyHandler && 
  pPager->pBusyHandler->xFunc && 
  pPager->pBusyHandler->xFunc(pPager->pBusyHandler->pArg, busy++)
  );
#endif
..

Will this behavior be implemented in the next release?

Regards,
George Ionescu