Re: [sqlite] Error (config.log) while compiling SQLite

2005-09-07 Thread Richard Nagle


>you didn't happen to ftp any files in the incorrect mode did you?
>ascii rather than binary perhaps for the tar/tar.gz file?
>

Just downloaded the source, from sqlite.org
and that it. why?

-Rick



Re: [sqlite] Question about SQLite and spatial data

2005-09-07 Thread Puneet Kishor

I work with spatial data, so I will take a stab at answering this.

On Sep 7, 2005, at 2:35 PM, Rajan, Vivek K wrote:


I have a need to store spatial and connectivity data (think verilog
netlist with x, y coordinate information) in a persistence on-disk 
file.
I am looking at different SQL-based databases and am wondering if 
anyone

has recommendations/opinions on how good SQLite is for:

  - Storing spatial data. An examples, documentation and support links

  - Performing spatial queries and indexing for very large hierarchical
data set



there is nothing special about spatial data when it comes to storing. 
What is special is making sense of it, either when inserting it or when 
retrieving it. Unless it is coming from a GPS stream, in which case it 
is just a bunch of numbers, spatial data usually describes geographic 
features in terms of points, lines, and polygons.


Some trick is involved in converting such spatial features into strings 
of linked numbers that can be stored in the database, and then some 
more trick is involved in performing spatial queries such as buffers 
(SELECT cols FROM tab WHERE somecol IS WITHIN 2 meters OF 
someothercol), overlays (SELECT cols FROM tab WHERE somecol IS 
CONTAINED IN someothercol), etc. Once you have selected the features, 
you need some way to display them -- therein lies the third trick.


What you need is an application layer that (1) performs the above 
mentioned tricks; (2) and another  application that displays your 
results. Such an application layer can be fairly db neutral, as ESRI's 
Spatial Data Engine (ArcSDE) is (http://www.esri.com) but it requires 
SQL Server or Oracle, or it can be a db-specific implementation such as 
PostGIS. PostGIS is a recommended and preferred weapon of choice. As 
the name indicates, it works with PostGres, is free and open source, 
and is most excellent (http://postgis.refractions.net). Combine PostGIS 
with the free and opensource MapServer (http://mapserver.gis.umn.edu) 
and you have a most excellent solution. I worked with PostGIS and 
MapServer, and I can say the above from firsthand experience.


The latest version of MySQL has built-in spatial capabilities, but I 
haven't seen them in action, only in docs, and if you Google, you can 
also find a custom MySQL-based spatial data engine that someone wrote.



--
Puneet Kishor



[sqlite] empty file name / checkin 1085

2005-09-07 Thread Kiel W.

SQLite Version: 3.2.5
Platform: Windows XP

I happen to have a bug in my wrapper that allowed an empty filename to 
be passed on to sqlite3.  I noticed from check-in 1085 that it opens a 
temporary database, and seems to be acceptable behavior to go on with 
life.  I'm guessing this is an in memory database, but can it be 
referenced in anyway, or is this just a /dev/null ?  Equivalent to 
:memory: maybe?  Figured it might be useful in someway...


I've pasted some C code to demonstrated what I ran into for the curious. 
It runs fine, and no assert()'s are triggered.


   int errorCode = SQLITE_OK;
   sqlite3* db;
   sqlite3_stmt* stmt;
  
   errorCode = sqlite3_open("", );

   assert(errorCode == SQLITE_OK);

   errorCode = sqlite3_prepare(db, "CREATE TABLE foo( aNumber INTEGER 
);", -1, , NULL);

   assert(errorCode == SQLITE_OK);

   errorCode = sqlite3_step( stmt );
   assert(errorCode == SQLITE_DONE);

   errorCode = sqlite3_finalize( stmt );
   assert(errorCode == SQLITE_OK);

   sqlite3_close(db);


Re: [sqlite] Compiled MacOS X version of 3.2.x

2005-09-07 Thread L. S.

Why don't you try compiling it with gcc, in a shell?

Richard Nagle wrote:

Does anyone have a 3.2.x with all the updates, for importing spreadsheets, tab 
delimited files..etc
already compiled for MacOS X (10.3.9 ) G4

Thanks -
Richard

PS: Yes, I did download the sorce code, and have xcode 1.5 installed with all 
the updates,
there is a major compiling error, going on, even after a complete wipe of HD, 
and re-install,
the same problem is still there.

PSS: So, enclosed, can't compile it, until C problem get fixs.
PSSS: if you want a peek at the config.log to see what I mean, email me off 
list.







Re: [sqlite] Error (config.log) while compiling SQLite

2005-09-07 Thread Reid Thompson

Richard Nagle wrote:


Below is a snip it
of compiling sqlite using MacOS X 10.3.9
& Xcode 1.5 with XCODE updates of gcc

This would be the second time,
I wipe the hard drive, and re-install ALL,
and try this again, with the same results.

So, far no-one, was able to find the cause,
of these errors... and garbage characters.

If YOU Know, please email on or off list.


Richard



9ˆ ÈÇÓ2h?fêÁ…î˜küˆàjwöÈØŒCC•!_D?'ç''È›¿ç\D,Sy=9çòÜ"oÜ/©„? 
Ä"EÔp¯#¥U™©
o}¨ª´´d•›[1^î¢Ke?#˜fOÿåNÇ7_  p??ÍÆ•?=ìC>‡l01tv?¿(ËO…X¯¿XnÙ?m‚€$?"‹>+Xp°´!=UD¯°c?/„zD…›(«ƒv
?Ó*‡ÒöwF;>ë?mR\'<]ï„8;"zíçB?z…gåæ¿,©
¡ÃœuXÜÂòáù[Z!'[EMAIL PROTECTED])¯
G>…A´î¿>:‰=Ö:z€='äÓ€<=æzå*OÉÚÚìûú;
q?¨??Ö°¸Å>$R—?»Ëãô.A¨é&"á>:˜Îàæ@(>=( 
Q—±p€JJÃàÿ÷ËT6a0y7ÃÇ»ªƒ:,6[ö_y'RïfÏNØ°´´a'([ë$‚="Ÿ?•Ë"U]?Wöä߀!¸?–ÿÈXflÌ?
G¬æÑ( ?çË S;PATH: /bin
PATH: /sbin
PATH: /usr/bin
PATH: /usr/sbin
9ˆ ÈÇÓ2h?fêÁ…î˜küˆàjwöÈØŒCC•!_D?'ç''È›¿ç\D,Sy=configure:1607: 
checking build system type
configure:1625: result: powerpc-apple-darwin7.9.0
configure:1633: checking host system type
configure:1647: result: powerpc-apple-darwin7.9.0
configure:1701: checking for gcc
configure:1717: found /usr/bin/gcc
configure:1727: result: gcc
configure:1971: checking for C compiler version
configure:1974: gcc --version &5
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1671)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:1977: $? = 0
configure:1979: gcc -v &5
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1671)
configure:1982: $? = 0
configure:1984: gcc -V &5
gcc: `-V' option must have argument
configure:1987: $? = 1
configure:2010: checking for C compiler default output file name
configure:2013: gccconftest.c  >&5
conftest.c:1: error: stray '\1' in program
conftest.c:1: error: parse error before numeric constant
conftest.c:1: error: stray '\366' in program
conftest.c:1: error: stray '\312' in program
conftest.c:1: error: stray '\7' in program
conftest.c:1: error: stray '\351' in program
conftest.c:1: error: stray '\202' in program
conftest.c:1: error: stray '\356' in program
conftest.c:1:9: invalid suffix "h" on integer constant
conftest.c:1: error: stray '\270' in program
conftest.c:1: error: stray '\220' in program
conftest.c:1: error: stray '\347' in program
conftest.c:1: error: stray '\311' in program
conftest.c:1: error: stray '\224' in program
conftest.c:1: error: stray '\367' in program
conftest.c:1: error: stray '\377' in program
conftest.c:2: error: stray '\1' in program
conftest.c:2: error: stray '\366' in program
conftest.c:2: error: stray '\312' in program
conftest.c:2: error: stray '\7' in program
conftest.c:2: error: stray '\351' in program
conftest.c:2: error: stray '\202' in program
conftest.c:2: error: stray '\356' in program
conftest.c:2:9: invalid suffix "h" on integer constant
conftest.c:2: error: stray '\270' in program





 


you didn't happen to ftp any files in the incorrect mode did you?
ascii rather than binary perhaps for the tar/tar.gz file?


Re: [sqlite] Please test on Win95/98/ME

2005-09-07 Thread Dirk Zabel

Ralf Junker schrieb:


I don't like using the MSLU because its a dependency that up until now SQLite 
has not had.  Since the unicows.dll is not part of a standard Windows 
installation, it would require developers to redistribute that DLL in addition 
to the sqlite DLL.
   



I very much agree with Robert for the reasons he has given. The beauty of 
SQLite is that it is simple and small. Linking to a non OS dependencies would 
take that beauty away.

The approach of the latest os_win.c is absolutely correct and a standard 
procedure for all cross-Windows applications with Unicode support, even 
Microsoft's. It just needs a few improvements to get it working reliably on 
Win95. The Win95 Unicode deficiencies are part of that system and there is 
nothing SQLite can do about it.

Please keep SQLite simple and small and do not add additional dependencies!

Regards,

Ralf 



 

I strongly support this request. Really: the strength and beauty of 
sqlite is that I can produce a standalone binary which does not require 
any system-dependent installation, just copy! PLEASE don't give this away!

Regards
 Dirk



Re: [sqlite] need to write during a long read

2005-09-07 Thread Mark Drago
On Tue, 2005-09-06 at 16:07 -0400, D. Richard Hipp wrote:
> On Tue, 2005-09-06 at 15:49 -0400, Mark Drago wrote:
> 
> > 2. I could continue to write to the database in the single thread, but
> > if the write fails, add the data to a queue and continue.  Then, when
> > another piece of data has to be logged, and it succeeds, empty the queue
> > and write all of the data from it into the sqlite DB. 
> 
> This is what I would do.  Except I would make the queue a
> separate SQLite database which was connected to the primary
> database using ATTACH.
> 
> Suppose the "queue" database is named "pending.db".  Then
> when you open the primary database always immediately do
> this:
> 
> ATTACH DATABASE 'pending.db' AS pending;
> 
> Then when you want to make a log entry do the following
> statements:
> 
>INSERT INTO pending.log VALUES(...);
>INSERT INTO main.log SELECT * FROM pending.log;
>DELETE FROM pending.log;
> 
> When doing the above, abort after the first failure.
> If the database is locked then the second statement will
> fail, the DELETE will never occur and information will
> accumulate in the "pending" database.  If the second
> statement succeeds, then the information is subsequently
> deleted from the pending database.
> 
> If you really want to make sure that the transfer from
> pending to main is atomic, enclose the last two statements
> in a transaction.

Thanks a bunch for this idea.  I've implemented this and I'm getting an
odd error.  The scenario is thus:

I insert the log into the attached database:
INSERT INTO pending.log VALUES(...);

I then begin a transaction:
BEGIN TRANSACTION;

If this does not return a SQLITE_OK, I just leave the log in the queue
and hopefully the next log attempt will be able to work it out.

Once in the transaction, I run the INSERT INTO log SELECT * FROM ...:
INSERT INTO main.log SELECT * FROM pending.log;

If this does not return a SQLITE_OK, I run 'ROLLBACK TRANSACTION;' and
leave that log data in the pending db.

Provided the move from the queue to the main log succeeds, I delete the
entries from the pending log:
DELETE FROM pending.log;

If this does not return a SQLITE_OK, I run 'ROLLBACK TRANSACTION;' and
leave that log data in the pending db.

Provided the delete succeeded, I run 'COMMIT TRANSACTION;' and all
should be well.


The problem I'm seeing is that (I'm half guessing) after I run a
rollback, when I try and run 'begin transaction' I get: 'cannot start a
transaction within a transaction'.  As far as I can tell there is no way
to get out of this part of my code without running either a rollback or
a commit.  I've executed 'pragma synchronous=off' on this database as
I'll be writing to it very often and the data isn't life-or-death
important.  I don't think this should impact anything, but I figured I
would share.  Any ideas?

Mark.


signature.asc
Description: This is a digitally signed message part


[sqlite] sqlite error output

2005-09-07 Thread Alexander van der Merwe

Hi,

I have a huge (> 40 000 lines) insert-script I want to run.

Some of the lines may have something wrong with them, and I want to 
check if there are are any errors on importing the data.


Is there a way to tell SQLite only to output the errors, instead of the 
'successful' inserts?


Thanx,


RE: [sqlite] need to write during a long read

2005-09-07 Thread Mark Drago
On Wed, 2005-09-07 at 20:25 +0100, Brandon, Nicholas wrote:
> 
> >take longer than 5 seconds.  These reads are being done by PHP using the
> >PDO driver for sqlite3.  My understanding of the problem is that the PHP
> >reader is holding a SHARED lock for longer than 5 seconds, so while the
> >C program can acquire a PENDING lock, it can not get the EXCLUSIVE lock
> >inside of 5 seconds and thus times out.
> 
> I've also used the PDO driver in the past and it took me a while to realise
> that the SHARED lock was not being released by PDO/SQlite under after it
> tried to retrieve the next row and failed. So in the following example loop:
> 
> (Run SQL select statement)
> while (fetchArray())
> {
> 
>/* Long time spent processing here */
> 
> }
> 
> The SHARED lock is held until the end of the while loop instead of releasing
> before the loop (which I was expecting). Obviously if you have a significant
> amount of processing in the loop, its not difficult to get writer
> starvation.
> 
> A question to those who know - when (in terms of which C API call) does
> SQLite release the SHARED lock after a read?
> 
> And a general survey to everyone... in your applications, what is the
> 'standard' practice to handle a SELECT statement that may return more than a
> few rows? Can temporary tables be used without still holding the
> database-level lock?
> 
> Sorry Mark, I've noticed I've diverged from your question a tad.

Nick,

Thanks for bringing this up.  We are doing a bunch of processing on each
row of data that comes out.  We're likely going to experiment with
sucking all of the rows into an array and working on it afterwards to
see if that benefits things at all.

Mark.

> Thanks
> Nick



signature.asc
Description: This is a digitally signed message part


[sqlite] Question about SQLite and spatial data

2005-09-07 Thread Rajan, Vivek K
I have a need to store spatial and connectivity data (think verilog
netlist with x, y coordinate information) in a persistence on-disk file.
I am looking at different SQL-based databases and am wondering if anyone
has recommendations/opinions on how good SQLite is for:

  - Storing spatial data. An examples, documentation and support links

  - Performing spatial queries and indexing for very large hierarchical
data set

 

Please advice.

 

Rajan



RE: [sqlite] need to write during a long read

2005-09-07 Thread Brandon, Nicholas


>take longer than 5 seconds.  These reads are being done by PHP using the
>PDO driver for sqlite3.  My understanding of the problem is that the PHP
>reader is holding a SHARED lock for longer than 5 seconds, so while the
>C program can acquire a PENDING lock, it can not get the EXCLUSIVE lock
>inside of 5 seconds and thus times out.

I've also used the PDO driver in the past and it took me a while to realise
that the SHARED lock was not being released by PDO/SQlite under after it
tried to retrieve the next row and failed. So in the following example loop:

(Run SQL select statement)
while (fetchArray())
{

   /* Long time spent processing here */

}

The SHARED lock is held until the end of the while loop instead of releasing
before the loop (which I was expecting). Obviously if you have a significant
amount of processing in the loop, its not difficult to get writer
starvation.

A question to those who know - when (in terms of which C API call) does
SQLite release the SHARED lock after a read?

And a general survey to everyone... in your applications, what is the
'standard' practice to handle a SELECT statement that may return more than a
few rows? Can temporary tables be used without still holding the
database-level lock?

Sorry Mark, I've noticed I've diverged from your question a tad.

Thanks
Nick



This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.



[sqlite] Re: (diff/patch) Problems with threadsafe opt correction #2623

2005-09-07 Thread Guillaume Fougnies
Hello,

In attachement, there's a diff/patch against os_unix.c
in version 3.2.5.
Its allows threads to access successively to a DB handle
and remove the heavy restriction of the SQLITE_MISUSE.
In case of simultaneous access, threads get SQLITE_BUSY
until the OsFile is unlocked.

I test it a bit, it works well with my code and my bad
unix threaded file locks.
Can anybody test it too?

Best regards,

Mon, Sep 05, 2005 at 02:18:41PM -0400: D. Richard Hipp wrote:
> On Mon, 2005-09-05 at 19:58 +0200, René Tegel wrote:
> 
> > As far as i can tell now the windows version of 3.2.5 seems not affected.
> > 
> 
> The restriction that a DB handle can only be used from a single
> thread is currently only enforced on Unix, because Unix boxes
> are the only place where using DB handles in multiple threads is
> a problem.

--
Guillaume FOUGNIES
Eulerian Technologies
--- ../../sqlite-3.2.5/src/os_unix.c2005-08-25 14:48:33.0 +0200
+++ os_unix.c   2005-09-07 20:17:38.0 +0200
@@ -82,7 +82,8 @@
 */
 #ifdef SQLITE_UNIX_THREADS
 # define SET_THREADID(X)   X->tid = pthread_self()
-# define CHECK_THREADID(X) (!pthread_equal(X->tid, pthread_self()))
+# define CHECK_THREADID(X) ( threadsOverrideEachOthersLocks>0 && \
+   check_threadid(X) )
 #else
 # define SET_THREADID(X)
 # define CHECK_THREADID(X) 0
@@ -275,6 +276,26 @@ struct threadTestData {
   int result;/* Result of the locking operation */
 };
 
+/*
+** Check if the thread is allowed to use the OsFile
+**
+** If another thread opened the OsFile and this OsFile
+** is now lock clear, the new thread is allowed to work
+** with. Its tid is set.
+** This routine is be protected by the global mutex.
+*/
+static int check_threadid(OsFile *id) {
+  if ( pthread_equal(id->tid, pthread_self()) ) {
+return 0;
+  }
+  if ( id->pLock->locktype == NO_LOCK ) {
+SET_THREADID(id);
+return 0;
+  }
+  return 1;
+}
+
+
 #ifdef SQLITE_LOCK_TRACE
 /*
 ** Print out information about all locking operations.
@@ -914,9 +935,14 @@ int sqlite3OsCheckReservedLock(OsFile *i
   int r = 0;
 
   assert( id->isOpen );
-  if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
   sqlite3OsEnterMutex(); /* Needed because id->pLock is shared across threads 
*/
 
+#ifdef SQLITE_UNIX_THREADS
+  if( CHECK_THREADID(id) ) {
+r = 1;
+  }
+#endif
+
   /* Check if a thread in this process holds such a lock */
   if( id->pLock->locktype>SHARED_LOCK ){
 r = 1;
@@ -1032,7 +1058,6 @@ int sqlite3OsLock(OsFile *id, int lockty
   TRACE7("LOCK%d %s was %s(%s,%d) pid=%d\n", id->h, 
locktypeName(locktype), 
   locktypeName(id->locktype), locktypeName(pLock->locktype), pLock->cnt
   ,getpid() );
-  if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
 
   /* If there is already a lock of this type or more restrictive on the
   ** OsFile, do nothing. Don't use the end_lock: exit path, as
@@ -1053,6 +1078,13 @@ int sqlite3OsLock(OsFile *id, int lockty
   */
   sqlite3OsEnterMutex();
 
+#ifdef SQLITE_UNIX_THREADS
+  if( CHECK_THREADID(id) ){
+rc = SQLITE_BUSY;
+goto end_lock;
+  }
+#endif
+
   /* If some thread using this PID has a lock via a different OsFile*
   ** handle that precludes the requested lock, return BUSY.
   */
@@ -1188,13 +1220,20 @@ int sqlite3OsUnlock(OsFile *id, int lock
   assert( id->isOpen );
   TRACE7("UNLOCK  %d %d was %d(%d,%d) pid=%d\n", id->h, locktype, 
id->locktype, 
   id->pLock->locktype, id->pLock->cnt, getpid());
-  if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
 
   assert( locktype<=SHARED_LOCK );
   if( id->locktype<=locktype ){
 return SQLITE_OK;
   }
   sqlite3OsEnterMutex();
+
+#ifdef SQLITE_UNIX_THREADS
+  if( CHECK_THREADID(id) ){
+/* This should never happen */
+rc = SQLITE_IOERR;
+  }
+#endif
+
   pLock = id->pLock;
   assert( pLock->cnt!=0 );
   if( id->locktype>SHARED_LOCK ){
@@ -1265,7 +1304,6 @@ int sqlite3OsUnlock(OsFile *id, int lock
 */
 int sqlite3OsClose(OsFile *id){
   if( !id->isOpen ) return SQLITE_OK;
-  if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
   sqlite3OsUnlock(id, NO_LOCK);
   if( id->dirfd>=0 ) close(id->dirfd);
   id->dirfd = -1;


Re: [sqlite] v3 number handling and relational design help...

2005-09-07 Thread Cam Crews
> > I'd like to create another table with
> > "AverageSalaries" combining the ID's from (a) and (b)
> > into a unique 8 byte ID.  I'm thinking that the
> > columns would be "SuperID" (8 bytes integer created by
> > combining each ID from the city table with the ID from
> > each job table and "AveSalary" which is the average
> > salary for that job in the given city (based on the
> 
> That seems bizarre.  Typical RDBMS practice would be to just use a
> two-column composite primary key.

yes, a composite primary key is to be recommended - I would imagine
construction of this hybrid key would slow the process of insertion
into your database while not improving data retrieval significantly
(in looking for one key rather than two).  You could view your
"Average Saleries" table as a temporary table, and having your
averages stored there should speed performance up without any extra
key tinkering...

Just thinking more into the notion of constructing a hybrid ID on your
own - this would greatly reduce the number of available keys for table
A and table B.  Consider if the implementation took 4 bytes from each
table to build a composite 8 byte key.  Limiting a primary key to 4
bytes restricts it to ~4.3 Billion (2^32) possible rows for that
table.  This may seem like alot (and should be for the purposes of
sqlite!), but with a full 8 byte key you have ~18 Quadrillion (2^64)
possible keys available, which is 4,294,967,296 times more, if I'm not
mistaken.

> It just seems that with as many as
> ten thousand item in each of these tables, it would be
> much quicker to create this "combinedID" rather than
> select the item from a table based on comparing ID's
> from two other tables individually.  By combining the
> 2 4-byte ID's, I can create a unique 8-byte ID which
> should be accessed quicker.

Indexing your table properly should eliminate the need to do this. 
The speed of looking up keys shouldn't be slowing your application
down for an indexed table...  When you think about it, the hybrid key
won't speed up the actual data acquisition involving the transfering
of rows from your database to memory for output/processing.  And then
you'd have the problem of having to de-compose the hybrid key if you
had to re-locate the originating table IDs, which would create alot
more overhead than any pefromance gains...
Clever idea, though.

ccl


[sqlite] Error (config.log) while compiling SQLite

2005-09-07 Thread Richard Nagle

Below is a snip it
of compiling sqlite using MacOS X 10.3.9
& Xcode 1.5 with XCODE updates of gcc

This would be the second time,
I wipe the hard drive, and re-install ALL,
and try this again, with the same results.

So, far no-one, was able to find the cause,
of these errors... and garbage characters.

If YOU Know, please email on or off list.


Richard



9ˆ ÈÇÓ2h?fêÁ…
î˜küˆàjwöÈØŒCC•!_D?'ç''ț¿ç\D,Sy=9çòÜ"oÜ/©„? 
Ä"EÔp¯#¥U™©
o}¨ª´´d•›[1^î¢Ke?#˜fOÿåNÇ7_  p??Íƕ?=ìC>‡l01tv?¿(ËO…X¯¿XnÙ?m‚€$?"‹>+Xp°´!=UD¯°c?/„zD…›(«ƒv
?Ó*‡ÒöwF;>ë?mR\'<]ï„8;"zíçB?z…gåæ¿,©
¡ÃœuXÜÂòáù[Z!'[EMAIL PROTECTED])¯
G>…A´î¿>:‰=Ö:z€='äӀ<=æzå*OÉÚÚìûú;
q?¨??Ö°¸Å>$R—?»Ëãô.A¨é&"á>:˜Îàæ@(>=( 
Q—±p€JJÃàÿ÷ËT6a0y7ÃÇ»ªƒ:,6[ö_y'RïfÏNØ°´´a'([ë$‚="Ÿ?•Ë"U]?Wöä߀!¸?–ÿÈXflÌ?
G¬æÑ( ?çË S;PATH: /bin
PATH: /sbin
PATH: /usr/bin
PATH: /usr/sbin
9ˆ ÈÇÓ2h?fêÁ…î˜küˆàjwöÈØŒCC•!_D?'ç''ț¿ç\D,Sy=configure:1607: 
checking build system type
configure:1625: result: powerpc-apple-darwin7.9.0
configure:1633: checking host system type
configure:1647: result: powerpc-apple-darwin7.9.0
configure:1701: checking for gcc
configure:1717: found /usr/bin/gcc
configure:1727: result: gcc
configure:1971: checking for C compiler version
configure:1974: gcc --version &5
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1671)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:1977: $? = 0
configure:1979: gcc -v &5
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1671)
configure:1982: $? = 0
configure:1984: gcc -V &5
gcc: `-V' option must have argument
configure:1987: $? = 1
configure:2010: checking for C compiler default output file name
configure:2013: gccconftest.c  >&5
conftest.c:1: error: stray '\1' in program
conftest.c:1: error: parse error before numeric constant
conftest.c:1: error: stray '\366' in program
conftest.c:1: error: stray '\312' in program
conftest.c:1: error: stray '\7' in program
conftest.c:1: error: stray '\351' in program
conftest.c:1: error: stray '\202' in program
conftest.c:1: error: stray '\356' in program
conftest.c:1:9: invalid suffix "h" on integer constant
conftest.c:1: error: stray '\270' in program
conftest.c:1: error: stray '\220' in program
conftest.c:1: error: stray '\347' in program
conftest.c:1: error: stray '\311' in program
conftest.c:1: error: stray '\224' in program
conftest.c:1: error: stray '\367' in program
conftest.c:1: error: stray '\377' in program
conftest.c:2: error: stray '\1' in program
conftest.c:2: error: stray '\366' in program
conftest.c:2: error: stray '\312' in program
conftest.c:2: error: stray '\7' in program
conftest.c:2: error: stray '\351' in program
conftest.c:2: error: stray '\202' in program
conftest.c:2: error: stray '\356' in program
conftest.c:2:9: invalid suffix "h" on integer constant
conftest.c:2: error: stray '\270' in program







Re: [sqlite] v3 number handling and relational design help...

2005-09-07 Thread Jay Siegel
--- Andrew Piskorski <[EMAIL PROTECTED]> wrote:

> That seems bizarre.  Typical RDBMS practice would be
> to just use a
> two-column composite primary key.
> 
> 
> Did you measure a serious performance problem when
> joining on two
> separate columns?
> 

You're right.  It feels bizarre to me too.  And no, I
haven't measured the performance - I still have much
development to do.  It just seems that with as many as
ten thousand item in each of these tables, it would be
much quicker to create this "combinedID" rather than
select the item from a table based on comparing ID's
from two other tables individually.  By combining the
2 4-byte ID's, I can create a unique 8-byte ID which
should be accessed quicker.  I might be wrong.  My
application isn't a normal query type of application
and will be doing as many as 500 of these operations
based on something that a user requests.

Thanks for your feedback.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: [sqlite] v3 number handling and relational design help...

2005-09-07 Thread Andrew Piskorski
On Wed, Sep 07, 2005 at 07:23:59AM -0700, Jay Siegel wrote:

> I'd like to create another table with
> "AverageSalaries" combining the ID's from (a) and (b)
> into a unique 8 byte ID.  I'm thinking that the
> columns would be "SuperID" (8 bytes integer created by
> combining each ID from the city table with the ID from
> each job table and "AveSalary" which is the average
> salary for that job in the given city (based on the

That seems bizarre.  Typical RDBMS practice would be to just use a
two-column composite primary key.

> ID's).  The reason for combining the ID's is to create
> a unique ID that can be a key for quick access.
> 
> Again, this is a simplistic example but demonstrates
> the issue I'm dealing with among multiple tables.  Is
> this combining of ID's the best way to handle this
> "join" when performance is required?  Can an 8 bytes

Did you measure a serious performance problem when joining on two
separate columns?

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/


Re: [sqlite] Compiled MacOS X version of 3.2.x

2005-09-07 Thread Puneet Kishor


On Sep 7, 2005, at 9:45 AM, Richard Nagle wrote:



Does anyone have a 3.2.x with all the updates, for importing 
spreadsheets, tab delimited files..etc

already compiled for MacOS X (10.3.9 ) G4

Thanks -
Richard

PS: Yes, I did download the sorce code, and have xcode 1.5 installed 
with all the updates,
there is a major compiling error, going on, even after a complete wipe 
of HD, and re-install,

the same problem is still there.



Richard,

I am using 3.2.1 on Panther 10.3.9. I don't know what you mean by "all 
the updates" because there afaik, there is no such concept. You 
download a version and compile it and that is what you have. I have 
3.2.1.


I can mail it to you, however, I would encourage you to post your 
errors in brief here as many knowledgeable folks would be able to help 
you solve it. Besides, that knowledge will likely help others in the 
future.


Fwiw, 3.2.1 compiled flawlessly on my computer, with nary an error. It 
even found the existing Readline 5.0 (which also compiled flawless with 
nary an error). You might do yourself a big favor by solving what is 
causing the hiccup on your machine, because there shouldn't be any at 
all.


--
Puneet Kishor



Re: [sqlite] v3 number handling and relational design help...

2005-09-07 Thread D. Richard Hipp
On Wed, 2005-09-07 at 07:23 -0700, Jay Siegel wrote:
> 1. Is numeric column storage maintained in an
> endian-independent way?  

Numbers are stored on disk in big-endian byte order.

> Can an 8 bytes
> numeric key be used or must if be treated as an 8 byte
> text field?
> 

SQLite uses 64-bit signed integers (8 bytes).
-- 
D. Richard Hipp <[EMAIL PROTECTED]>



[sqlite] Compiled MacOS X version of 3.2.x

2005-09-07 Thread Richard Nagle

Does anyone have a 3.2.x with all the updates, for importing spreadsheets, tab 
delimited files..etc
already compiled for MacOS X (10.3.9 ) G4

Thanks -
Richard

PS: Yes, I did download the sorce code, and have xcode 1.5 installed with all 
the updates,
there is a major compiling error, going on, even after a complete wipe of HD, 
and re-install,
the same problem is still there.

PSS: So, enclosed, can't compile it, until C problem get fixs.
PSSS: if you want a peek at the config.log to see what I mean, email me off 
list.




[sqlite] test (email)

2005-09-07 Thread Richard Nagle

Just testing to see if message is received.
Rick








[sqlite] v3 number handling and relational design help...

2005-09-07 Thread Jay Siegel
I have two questions.  I'm starting a large project
with SQLite on multiple platforms.  I'm hoping I can
get some ideas about two issues:

1. Is numeric column storage maintained in an
endian-independent way?  I need to port SQLite to a
platform that is in Motorola format (big endian) but
haven't done it yet.  In the meantime, I'm writing the
application on an Intel format (little endian)
platform with an existing SQLite implementation.  If
byte swapping of numeric column data is required, I'd
like to do it on the Intel platform because it is the
faster one.  Databases will be shared between
platforms and it isn't obvious from the documentation
how numeric values are handled (or I haven't found
it!).

2. I'm finding myself in instances where I'd like to
generate a key into a table based on ID's from other
tables.  The reason for this is performance.  A
simplistic example would be:

a) A city table exists with two columns, "ID" (4 byte
integer) and "CityName" (text) where ID is a unique ID
for each city name.

b) A job table exists with two columns, "ID" (4 byte
integer) and "JobTitle" (text) where ID is a unique ID
for each job title.


I'd like to create another table with
"AverageSalaries" combining the ID's from (a) and (b)
into a unique 8 byte ID.  I'm thinking that the
columns would be "SuperID" (8 bytes integer created by
combining each ID from the city table with the ID from
each job table and "AveSalary" which is the average
salary for that job in the given city (based on the
ID's).  The reason for combining the ID's is to create
a unique ID that can be a key for quick access.

Again, this is a simplistic example but demonstrates
the issue I'm dealing with among multiple tables.  Is
this combining of ID's the best way to handle this
"join" when performance is required?  Can an 8 bytes
numeric key be used or must if be treated as an 8 byte
text field?

Thanks for any help.  I hope to be able to provide
feedback to the list when I get more of my own
experience with SQLite.





__
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/


Re: [sqlite] All transactions are Database locks?

2005-09-07 Thread Kurt Welgehausen
> Are all transactions database locks (not table locks)?

Yes.

> If I prepare a select statement and start stepping on Table A on process one
> and pause before finializing and do an update on Table B with process two or
> even the same process I will get a database is locked error?

Yes.

> Does everyone make databases with one table each ... ?

No. Fetch your data, finalize the select, then do your
update(s). If it's important that the database not be
changed by another process between the select and the
update, wrap the whole sequence in a transaction (begin
immediate).

 

Regards


RE: [sqlite] ??: Re: [sqlite] How to reduce the flash erasing tim es when I using sqlite

2005-09-07 Thread David Fiddes
Hi,

> What about jffs2? I had added it to my system.

I'm using jffs2 in an embedded linux-arm application I'm putting together
with sqlite. I'm still in the early stages so don't have much sqlite
specific info. We have found that the wear leveling/garbage collection in
jffs2 works a lot better if you have a lot of spare space on your
filesystem. This avoids sectors being erased repeatedly.

I would have thought that if you keep the number of transactions down it
would help enormously. With the number of updates/inserts you are trying to
do you may need to think about storing the database in memory and synching
with the backing store on a regular basis.

hope this helps,

Dave


Re: [sqlite] records sorted or not

2005-09-07 Thread Cory Nelson
AFAIK if you do not give an ORDER BY clause the db can give it to you
in any order it feels like.

On 9/6/05, Tom Deblauwe <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> If I do a select query, and that query uses an index, will the results
> come out sorted like the index?  Or is that random?
> 
> Kind regards,
> Tom
> 
> 
> 


-- 
Cory Nelson
http://www.int64.org


Re: [sqlite] Please test on Win95/98/ME

2005-09-07 Thread Ralf Junker

>I don't like using the MSLU because its a dependency that up until now SQLite 
>has not had.  Since the unicows.dll is not part of a standard Windows 
>installation, it would require developers to redistribute that DLL in addition 
>to the sqlite DLL.

I very much agree with Robert for the reasons he has given. The beauty of 
SQLite is that it is simple and small. Linking to a non OS dependencies would 
take that beauty away.

The approach of the latest os_win.c is absolutely correct and a standard 
procedure for all cross-Windows applications with Unicode support, even 
Microsoft's. It just needs a few improvements to get it working reliably on 
Win95. The Win95 Unicode deficiencies are part of that system and there is 
nothing SQLite can do about it.

Please keep SQLite simple and small and do not add additional dependencies!

Regards,

Ralf 



Re: [sqlite] How to reduce the flash erasing times when I using sqlite

2005-09-07 Thread Roger Binns

The flash will die after a
while. How can I solve this problem. Thankyou.


The simplest solution is to use a filesystem with builtin
wear levelling.  (Some flash chips also have it builtin
such as those from M-Systems).

You can get file systems that do wear levelling for 
most embedded operating systems.


Roger


Re: [sqlite] Please test on Win95/98/ME

2005-09-07 Thread Roger Binns
Yes, and distributing the DLL may not be an option for some developers 
(mostly Open Source developers).  The EULA for UnicoWS.dll specifies, 
among other things:


The intentions from the Microsoft chap who pushed unicows and
the license on the technical side:

 http://blogs.msdn.com/michkap/archive/2005/01/13/352001.aspx

A fully open source equivalent:

 http://libunicows.sourceforge.net/

Roger



[sqlite] records sorted or not

2005-09-07 Thread Tom Deblauwe

Hello,

If I do a select query, and that query uses an index, will the results 
come out sorted like the index?  Or is that random?


Kind regards,
Tom




[sqlite] How to reduce the flash erasing times when I using sqlite

2005-09-07 Thread SH L
I found sqlite will update some fixed places
frequently in  the database file when insert,update or
even create operation happens.It means that if my
database file in flash and I do high-frequency insert
or update(about 3000/day).The flash will die after a
while.How can I solve this problem. Thankyou.



___ 
雅虎免费G邮箱-No.1的防毒防垃圾超大邮箱 
http://cn.mail.yahoo.com


[sqlite] All transactions are Database locks?

2005-09-07 Thread Matt Froncek
Are all transactions database locks (not table locks)?

If I prepare a select statement and start stepping on Table A on process one
and pause before finializing and do an update on Table B with process two or
even the same process I will get a database is locked error? Do I understand
that this is how SQLite works or am I doing something wrong?

Does everyone make databases with one table each or what?

Matt Froncek
QODBC Development Support / FLEXquarters Solutions Consultant
QODBC Driver for QuickBooks - Unleash your data at www.qodbc.com