Re: [sqlite] Looking for a w_char alternative for sqlite3_get_table

2009-09-01 Thread Nicolas Williams
On Tue, Sep 01, 2009 at 10:41:27AM +0200, A.J.Millan wrote: > * Make sure there was no 16-bit version of the sqlite3_get_table at > function -perhaps it would be a good idea to include it in the standard API. > The reason is the same who advised include the current version. It might be easier t

[sqlite] genfkey as loadable module (Re: Run genfkey on temp db from app)

2009-07-20 Thread Nicolas Williams
On Mon, Jul 20, 2009 at 08:34:52AM -0500, Jay A. Kreibich wrote: > If someone is going to take the time to refactor the genfkey code > into a stand-alone piece of code, I would like to suggest it is made > into it a loadable module, so that it can be used pretty much anywhere. That sounds li

Re: [sqlite] Do people think of SQLite as a file or as a database

2009-07-15 Thread Nicolas Williams
On Wed, Jul 15, 2009 at 07:11:51PM -0700, CadMapper wrote: > > This is not a technical question about SQLite. I want to you how people in > general think about SQLite. Is that a file or a database? When you talk > about it, do you refer to it as file or database? It's a database. It happens t

Re: [sqlite] plans for completion of INSERT OR REPLACE INTO?

2009-07-06 Thread Nicolas Williams
On Tue, Jul 07, 2009 at 12:17:36AM +0100, Simon Slavin wrote: > He didn't make up the rule. Nor did I. It's part of the standard for > mailing lists and usenet: > > This is way off-topic now, but, to be fair, RFC1855 is not a standard, it is an Informat

Re: [sqlite] plans for completion of INSERT OR REPLACE INTO?

2009-07-06 Thread Nicolas Williams
On Mon, Jul 06, 2009 at 02:49:07PM -0700, James Gregurich wrote: > 1) Why on earth would you want to scroll all the way to the bottom of > a long email to get the response simply for the sake of "We read > English top to bottom." Any quoted context must be read before the reply or else is not

Re: [sqlite] referential integrity and INSERT OR REPLACE

2009-07-06 Thread Nicolas Williams
On Sat, Jul 04, 2009 at 10:24:50AM +0200, Kees Nuyt wrote: > On Fri, 03 Jul 2009 14:38:43 -0700, James Gregurich > wrote: > > > > >nuts. that makes INSERT OR REPLACE worthless if you have tables > >dependent on one another. > > > > > >Is there any way to manually get a list of records for which

Re: [sqlite] sqlite3_auto_extension

2009-06-18 Thread Nicolas Williams
On Thu, Jun 18, 2009 at 04:53:13PM +0200, Jean-Christophe Deschamps wrote: > Having spent "some" time trying to have this function work with dll > extensions, I've come to the [I hope 'wrong'] conclusion that it's > unusable in such case. Indeed, the docs mentions "statically linked > extension

Re: [sqlite] Datatypes (D. Richard Hipp)

2009-06-16 Thread Nicolas Williams
D. Richard Hipp wrote: > It was done to fix a bug. > > SQLite allows arbitrary text as the "datatype" of a column. So you > could say (for example): > > CREATE TABLE t1(a "duh! ++ x hi, yall!(+123)" unique); > > And the datatype for t1.a would be "duh! ++ x hi, yall!(+123)". It > used to b

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Nicolas Williams
On Sat, Jun 13, 2009 at 01:43:15AM +0100, Dr. David Kirkby wrote: > Thank you for your help. The fact you told me I did not need to link > libpthread was crucial to solving this. > > I've found that just removing the libpthread from the generated Makefile > solves this. Glad to help. > The off

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Nicolas Williams
On Fri, Jun 12, 2009 at 11:46:01PM +0100, Dr. David Kirkby wrote: > > I spoke to a Solaris linker engineer, and we both suspect that: a) > > you're using gld, > > Yes, I am. > > GNU ld version 2.15 > > [...] > > I can try it with Solaris ld. OK, let us know how that goes. Also, if there's an

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Nicolas Williams
On Fri, Jun 12, 2009 at 04:34:50PM -0500, Nicolas Williams wrote: > On Fri, Jun 12, 2009 at 10:06:31PM +0100, Dr. David Kirkby wrote: > > [...] > > -lpthread -lc -Wl,-soname -Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6 > > > > If the order of libpthread and libc

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Nicolas Williams
On Fri, Jun 12, 2009 at 10:06:31PM +0100, Dr. David Kirkby wrote: > [...] > -lpthread -lc -Wl,-soname -Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6 > > If the order of libpthread and libc are exchanged, the library can be > built. In other words, libc needs to be linked before libpthread, no

Re: [sqlite] Types for strings, non-expert question

2009-06-02 Thread Nicolas Williams
On Mon, Jun 01, 2009 at 08:56:57PM -0700, Roger Binns wrote: > Dennis Cote wrote: > > Do you have a list of such changes that should be implemented in the > > next breaking release of SQLite? > > I assume you are talking about a major release (ie SQLite v4 not 3.7). > > > I'm thinking of things

Re: [sqlite] Slow Transaction Speed?

2009-06-01 Thread Nicolas Williams
On Mon, Jun 01, 2009 at 03:09:46AM +0100, Simon Slavin wrote: > On 31 May 2009, at 11:56pm, John Stanton wrote: > > You will then understand the reason for absolute transactional > > integrity and why Sqlite must use fsync or similar and expects fsync > > to be a complete implementation which ensu

Re: [sqlite] GROUPY BY alias backward incompatibility

2009-06-01 Thread Nicolas Williams
On Thu, May 28, 2009 at 04:30:14PM +0200, Ralf Junker wrote: > select > (select count(*) from t t_inner > group by t_outer.c) -- t_outer !!! > from t t_outer; > > select > (select count(*) from t t_inner > group by t_inner.c) -- t_inner !!! > from

Re: [sqlite] Join performance in SQLite

2009-05-30 Thread Nicolas Williams
On Sat, May 30, 2009 at 07:01:31PM +0100, Simon Slavin wrote: > I'm interested in how sqlite works differently to the SQL systems > which keep a daemon running as a background task. One of the > advantages of having a daemon which persists between runs of an > application is that the daemon

Re: [sqlite] Is this test failure serious: *malloc*.transient.42 failures (expected [1 1], got [0 {}])?

2009-05-30 Thread Nicolas Williams
On Thu, May 28, 2009 at 04:38:50PM -0400, D. Richard Hipp wrote: > >> To debug, set a breakpoint on sqlite3Fault(). That routine is > >> called whenever an OOM fault is simulated. Run to the point of the > >> OOM fault that is causing the problem. Figure out which malloc() > >> is falling and

Re: [sqlite] Is this test failure serious: *malloc*.transient.42 failures (expected [1 1], got [0 {}])?

2009-05-28 Thread Nicolas Williams
On Thu, May 28, 2009 at 04:00:07PM -0400, D. Richard Hipp wrote: > These are tests that simulate a malloc() failure (aka "out-of-memory" > or OOM fault) to verify that nothing crashes or leaks following an OOM > fault and that an SQLITE_NOMEM error is reported back out at the top > level. Th

[sqlite] Default page size based on filesystem

2009-05-28 Thread Nicolas Williams
Looking at the changelog I see that in 3.6.12 SQLite3 gained the ability to set the default page size for new databases according to the filesystem's preference: # The default page size on windows is automatically adjusted to match the capabilities of the underlying filesystem. I had a patch t

[sqlite] Is this test failure serious: *malloc*.transient.42 failures (expected [1 1], got [0 {}])?

2009-05-28 Thread Nicolas Williams
I'm getting these failures in gmake fulltest output for SQLite3 3.6.14.2 on Solaris x86 (32- and 64-bit): altermalloc-1.transient.42... Expected: [1 1] Got: [0 {}] ... attachmalloc-1.transient.42... Expected: [1 1] Got: [0 {}] ... malloc6-1.transient.42... Expected: [1 1] Got: [0 {}

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Nicolas Williams
On Tue, Apr 07, 2009 at 08:28:24PM -0700, Vinnie wrote: > > > Note that both UTF-8 and UTF-16 are capable of representing > > the full range of Unicode characters. Conversion between the two is > > lossless. You seem to be under impression that UTF-8 is somehow > > deficient, only suitable for "le

Re: [sqlite] speeding up row by row lookup in a large db

2009-03-21 Thread Nicolas Williams
On Sat, Mar 21, 2009 at 01:55:32PM -0500, P Kishor wrote: > On Sat, Mar 21, 2009 at 1:25 PM, Nicolas Williams > wrote: > > On Sat, Mar 21, 2009 at 12:14:43PM -0500, P Kishor wrote: > >> If I can't improve 33 ms per query, then I can experiment with > > > >

Re: [sqlite] speeding up row by row lookup in a large db

2009-03-21 Thread Nicolas Williams
On Sat, Mar 21, 2009 at 12:14:43PM -0500, P Kishor wrote: > If I can't improve 33 ms per query, then I can experiment with 33ms per-query sounds like you're not caching enough of the database in memory. What's the cache size? Can you jack it up? Does the entire dataset fit in memory? If so, wh

Re: [sqlite] Use sqlite3_update_hook() to watch for changes

2009-03-20 Thread Nicolas Williams
On Fri, Mar 20, 2009 at 07:35:07PM -0700, Roger Binns wrote: > Ricky Huang wrote: > > My question is, does SQLite offer ways of hooking up a second > > application to changes in a shared DB without polling? > > Nope. However your operating system should provide a notification for > file changes

Re: [sqlite] Proposal for SQLite and non pure ASCII letters

2009-03-19 Thread Nicolas Williams
On Thu, Mar 19, 2009 at 09:52:55AM -0700, Noah Hart wrote: > I've been reading and thinking about this topic for a while, and would > like to add my thoughts. > > I realize that we don't "vote" on features, but I feel that this type > of idea has merit. > > It is true, that SQLite has user define

Re: [sqlite] DateTime Objects

2009-02-28 Thread Nicolas Williams
On Sat, Feb 28, 2009 at 12:47:07PM -0800, jonwood wrote: > > Database is for manipulating data. Your UI application is for presenting > > it nicely to the user. After all, you don't complain that SQLite, say, > > doesn't have functions for formatting numbers in user-friendly manner > > (e.g. 123

Re: [sqlite] DateTime Objects

2009-02-28 Thread Nicolas Williams
On Sat, Feb 28, 2009 at 06:14:05PM -0800, jonwood wrote: > >So I would just rock it and not worry about it too much. If you're really > >that hard up on saving CPU cycles, they might be better gained elsewhere. > > I just like to be efficient and thought I'd check in to see if I was missing > anyt

Re: [sqlite] Newb-ish performance questions

2009-02-22 Thread Nicolas Williams
On Sun, Feb 22, 2009 at 01:29:09PM +0100, Kees Nuyt wrote: > > PRAGMA page_size = 2000; /*this doesn't make any difference*/ > > PRAGMA page_size will only make a difference if you use it > when creating the database (before the first table is > created), or just before a VACUUM statement. > D

Re: [sqlite] Saving and loading SQLite pages from a buffer

2009-02-04 Thread Nicolas Williams
On Wed, Feb 04, 2009 at 05:19:13PM -0500, D. Richard Hipp wrote: > http://www.sqlite.org/draft/c3ref/backup_finish.html Does this work at the page level? Or can one have pre-created the destination DB with a different page size than the source DB? Nico -- ___

Re: [sqlite] Progress update while Prepare() is executing

2009-01-26 Thread Nicolas Williams
On Sun, Jan 25, 2009 at 01:32:57PM +0100, Kees Nuyt wrote: > If the replace statement is the same every time, you only > have to prepare it once. As drh said, to be able to help you > more, we need the schema and more detailed code. > > prepare() > begin() > while data_available{ > bind() >

Re: [sqlite] Progress update while Prepare() is executing

2009-01-26 Thread Nicolas Williams
On Sun, Jan 25, 2009 at 01:32:57PM +0100, Kees Nuyt wrote: > The progress indicator of both REPLACE and SELECT can be > driven by the while { step() } loops in your program. > A progress callback is not of much use here, except for the > first step(), because the first step() returns after any > i

Re: [sqlite] Date datatype

2009-01-21 Thread Nicolas Williams
On Wed, Jan 21, 2009 at 11:30:58AM -0500, Igor Tandetnik wrote: > One advantage of the string format is that it's visible to the "naked > eye" - when working with the database using generic tools (e.g. for > administration or troubleshooting). It's a pain to run ad-hoc queries > when the databas

Re: [sqlite] fulltest *malloc* test failures

2009-01-16 Thread Nicolas Williams
On Fri, Jan 16, 2009 at 02:46:54PM -0500, D. Richard Hipp wrote: > >> Yes. FTS3 is not robust against malloc failures. FTS3 will > >> sometimes segfault following a malloc failure. This is a known > >> issue. We are working on it. > > > > Is that true only when one uses FTS3? > > > > Or is it t

Re: [sqlite] fulltest *malloc* test failures

2009-01-16 Thread Nicolas Williams
Is it safe to ship 3.6.10 with FTS3 compiled in? Oh, I've found ticket #2762, which helps explain what I'm seeing. Basically, SQLite 3.6.9 (haven't tried 3.6.10 yet, though obviously I must) and earlier had bugs in FTS3 where FTS3 was using malloc()/ free()/... directly from libc instead of sqlit

Re: [sqlite] fulltest *malloc* test failures

2009-01-16 Thread Nicolas Williams
On Fri, Jan 16, 2009 at 02:22:35PM -0500, D. Richard Hipp wrote: > > On Jan 16, 2009, at 2:07 PM, Nicolas Williams wrote: > > > On Sat, Jan 17, 2009 at 02:04:47AM +0700, Dan wrote: > >>> What do those mean? Are these errors a problem? > >> > >> Are

Re: [sqlite] fulltest *malloc* test failures

2009-01-16 Thread Nicolas Williams
On Sat, Jan 17, 2009 at 02:04:47AM +0700, Dan wrote: > > What do those mean? Are these errors a problem? > > Are you compiling with SQLITE_ENABLE_FTS3 defined? Yes. Would that make a difference? ___ sqlite-users mailing list sqlite-users@sqlite.org ht

Re: [sqlite] fulltest *malloc* test failures

2009-01-16 Thread Nicolas Williams
On Fri, Jan 16, 2009 at 01:14:28PM -0500, D. Richard Hipp wrote: > > What do those mean? Are these errors a problem? > > These are simulated malloc() failures. They are important for > embedded devices (which tend to run out of memory) but not so much on > Solaris. When was the last time yo

[sqlite] fulltest *malloc* test failures

2009-01-16 Thread Nicolas Williams
Failures on these tests: malloc-1.transient.40 malloc-10.transient.40 malloc-14.transient.40 malloc-17.transient.41 malloc-20.transi ent.40 malloc-26.transient.40 malloc-1.transient.40... Expected: [1 1] Got: [0 {1 2.3 4.5 hi there^@ 6 7.0 0.8

Re: [sqlite] SQLite version 3.6.10 - Warning

2009-01-16 Thread Nicolas Williams
On Fri, Jan 16, 2009 at 09:43:36AM +0100, Christophe Leske wrote: > sqlite> .o cl1.sql ^^ This says: send output of queries to a file called "cl1.sql". > sqlite> .dump cl1% And this says: dump the named table. > sqlite> select * from cl1; And the output of this will still go

Re: [sqlite] SQLite version 3.6.10

2009-01-15 Thread Nicolas Williams
On Thu, Jan 15, 2009 at 10:07:29AM -0800, Brown, Daniel wrote: > The frequent releases are not a problem as far as I am concerned. I'd > rather have bugs fixed quickly when they are discovered, than wait > months for releases containing needed fixes like other libraries. We > use the loose pre-ge

Re: [sqlite] SQLite version 3.6.10

2009-01-15 Thread Nicolas Williams
I wholly agree that release frequency should mirror the frequency of serious bugs and their fixes. SQLite3 rarely has serious bugs. Two in one week (one dating to a much earlier version) is out of the ordinary for SQLite3, but not particularly worrisome. And agree with your comments about testin

Re: [sqlite] Getting the "position" (like LIMIT) for a query

2009-01-11 Thread Nicolas Williams
On Sat, Jan 10, 2009 at 04:26:56PM -0600, Nicolas Williams wrote: > Incidentally, I think many, if not all queries that have an outer table > scan, and many, if not all joins that have an inner table scan but not > an outer table scan, could be programmatically modified to create a &g

Re: [sqlite] Getting the "position" (like LIMIT) for a query

2009-01-10 Thread Nicolas Williams
On Sat, Jan 10, 2009 at 04:33:19PM -0500, Igor Tandetnik wrote: > "Lukas Haase" wrote in > message news:gkat07$n2...@ger.gmane.org > > "SELECT keyword FROM keywords ORDER BY keyword LIMIT %d, %d", iFrom, > > iTo-iFrom." > > > > I use an SQLite database to fill a virtual list control in Windows.

Re: [sqlite] 600ms for simple query: How to optimize it?

2009-01-10 Thread Nicolas Williams
On Sat, Jan 10, 2009 at 02:58:57PM +0100, Lukas Haase wrote: > > What is it that you think a LEFT JOIN does? > > (A LEFT JOIN B) joins together table A and B while all records are taken > from A and only records that match both are takes from B. If a record > from A has no corresponding data i

Re: [sqlite] Impossible to declare field type BIGINT PRIMARY KEY

2008-12-15 Thread Nicolas Williams
On Mon, Dec 15, 2008 at 04:34:29PM +, Nathan Catlow wrote: > > Secondly, AUTOINCREMENT in SQLite only works on an INTEGER PRIMARY > > KEY, not on any other kind of primary key or on any non-primary-key > > field. BIGINT PRIMARY KEY is not an INTEGER PRIMARY KEY and so > > AUTOINCREMENT won't w

Re: [sqlite] About ticket #3452

2008-10-24 Thread Nicolas Williams
On Fri, Oct 24, 2008 at 03:10:30PM -0700, Roger Binns wrote: > Nicolas Williams wrote: > > I've not run Evolution with SQLite3, so I don't know if it shares the > > cache. I'll ask the user in question to check. > > You'll need to ask the developer :-)

Re: [sqlite] About ticket #3452

2008-10-24 Thread Nicolas Williams
On Thu, Oct 23, 2008 at 04:04:58PM -0700, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Nicolas Williams wrote: > > (FYI, Evolution has/had a separate performance problem in that it opens > > a SQLite3 DB handle for the same DB every tim

[sqlite] About ticket #3452

2008-10-23 Thread Nicolas Williams
I filed ticket #3452 the other day, worked up a patch. The patch does three things: - Adds a real unixSectorSize() implementation where fstatvfs(2) is available. The host filesystem's f_bsize will be returned instead of SQLITE_DEFAULT_SECTOR_SIZE. - Changes SQLITE_MAX_DEFAULT_PAGE_SIZE

Re: [sqlite] SQLite version 3.6.4 planned for 2008-10-15

2008-10-10 Thread Nicolas Williams
On Fri, Oct 10, 2008 at 10:45:11AM +0300, Cariotoglou Mike wrote: > well, since you asked, BNF is indeed more difficult to read, BUT it is > machine-readable, which means validation tools and parsers can be built. If that's what you want then there's already the grammar that Lemon uses to generate

Re: [sqlite] Specifing which index to use. Was: Performance/bug in multikey 'group by' in 3.6.2

2008-09-26 Thread Nicolas Williams
On Fri, Sep 26, 2008 at 12:54:36PM -0400, Russell Leighton wrote: > I need a 2 key index for some queries and also want to aggregate on > these 2 columns. I need this index BUT I have many large sqlite dbs I > iterate over and they won't fit in the filesystem cache. Run time when > the index

Re: [sqlite] Specifing which index to use. Was: Performance/bug in multikey 'group by' in 3.6.2

2008-09-24 Thread Nicolas Williams
On Wed, Sep 24, 2008 at 01:35:40AM -0400, Alex Scotti wrote: > On Sep 24, 2008, at 1:13 AM, Alex Scotti wrote: > > On Sep 23, 2008, at 2:35 PM, Jay A. Kreibich wrote: > >> It doesn't "blatantly" anything. Indexes are outside of the > >> Relational Model and have nothing to do with it. They're

Re: [sqlite] Specifing which index to use. Was: Performance/bug in multikey 'group by' in 3.6.2

2008-09-23 Thread Nicolas Williams
On Tue, Sep 23, 2008 at 01:35:44PM -0500, Jay A. Kreibich wrote: > If there was a point I was trying to make, it was that something > being "un-RDBMS like" in itself doesn't make it a bad thing. After > all, the very concept of indexes themselves is (from a Relational > Model theory viewpo

Re: [sqlite] Importing schema from mysql

2008-09-15 Thread Nicolas Williams
On Mon, Sep 15, 2008 at 11:10:42PM +0200, Giorgio Sironi wrote: > 2008/9/15 P Kishor <[EMAIL PROTECTED]>: > > What is wrong with SQL? Dump the db in SQL, and import it into SQLite. > > I'm not talking about the data, since once the database is in place > there's no need to change it; the problem i

Re: [sqlite] How to use PRIMARY KEY AUTOINCREMENT when modelling weak entities?

2008-09-05 Thread Nicolas Williams
On Fri, Sep 05, 2008 at 09:31:43PM +0200, Andreas Ntaflos wrote: > In the Room table the primary key is a combination of two attributes. How > could I auto-increment the roomID? "roomID INTEGER AUTOINCREMENT" is > syntactically incorrect and the AUTOINCREMENT keyword seems to cannot appear > any

Re: [sqlite] Manifest Typing performance impact?

2008-08-27 Thread Nicolas Williams
On Wed, Aug 27, 2008 at 03:50:56PM +0100, Hardy, Andrew wrote: > Is there any way to log conversions to highlite any issues that would > have been hilighted by failure with strict typing? If the conversions are nicely isolated into functions (static and otherwise) could use the DTrace 'pid' provid

Re: [sqlite] sqlite3_stmt declaration

2008-08-25 Thread Nicolas Williams
On Mon, Aug 25, 2008 at 02:30:44PM -0700, Brown, Daniel wrote: > I'm attempting to wrap SQLite with Managed C++ and I'm getting some > compiler warnings as the compiler/linker is have trouble finding the > declaration of the structure 'sqlite3_stmt', I've tried looking for it > manually but I can't

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-21 Thread Nicolas Williams
On Thu, Aug 21, 2008 at 04:02:32PM -0600, Dennis Cote wrote: > I built a copy of my test database using a 4096 byte page size and it > reduced the database file size from 17.5 MB to 12.2 MB. When I repeat > the tests using this database file I get the same 18102 KB of memory > used, but a slight

Re: [sqlite] Reducing SQLite Memory footprint(!)

2008-08-21 Thread Nicolas Williams
On Thu, Aug 21, 2008 at 10:32:23AM -0400, Jeffrey Becker wrote: > Just out of curiosity what happens if you call > "PRAGMA page_size=4096" > before running the import? I wonder too, what does the page cache do when doing full table scans? If the cache has an LRU/LFU page eviction algorithm then fu

Re: [sqlite] View with Dynamic Fields ?

2008-07-09 Thread Nicolas Williams
On Wed, Jul 09, 2008 at 12:32:27PM -0700, Andrea Connell wrote: > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Cote > > > > Andrea Connell wrote: > > > I am still holding a shred of hope for a trigger that can recreate the > > > view whenever the questions table is m

Re: [sqlite] regarding internal design of SQLite

2008-07-08 Thread Nicolas Williams
On Tue, Jul 08, 2008 at 07:44:03PM -0400, Alex Katebi wrote: > No I don't mean offline use. I mean it would be nice to have links on the > sqlite.org for all documents and resources. I thought there was: http://sqlite.org/docs.html (which is linked to from the home page). Nico -- _

Re: [sqlite] View with Dynamic Fields ?

2008-07-08 Thread Nicolas Williams
On Tue, Jul 08, 2008 at 09:09:05AM -0700, Andrea Connell wrote: > I'm not sure if what I want is possible to do in SQL, but I -am- sure > that one of you will know. > Given two tables - one with questions to ask applicants and one with an > applicant's answer to a particular question - I want to m

Re: [sqlite] printf-8.2 test failure on Solaris on SPARC 64-bit

2008-06-22 Thread Nicolas Williams
On Fri, Jun 20, 2008 at 10:15:09PM -0400, Eric Minbiole wrote: > I agree that you are on the right track-- the format doesn't portably > match the values. However, I think the %lu part is correct-- "long" is > the only C type guaranteed to be at least 32 bits. Instead, I think the > issue is t

[sqlite] printf-8.2 test failure on Solaris on SPARC 64-bit

2008-06-20 Thread Nicolas Williams
I ran into this with SQLite3 3.5.4: printf-8.2... Expected: [2147483647 2147483648 4294967295] Got: [2147483647 18446744071562067968 18446744073709551615] The code looks like: ... do_test printf-8.2 { sqlite3_mprintf_int {%lu %lu %lu} 0x7fff 0x8000 0x } {2147483647 214748

[sqlite] On wheel re-invention (Re: Writing double into a socket file)

2008-06-11 Thread Nicolas Williams
On Tue, Jun 10, 2008 at 12:35:14PM -0400, Alex Katebi wrote: > Peter, >I am using my own implementation. I found RPC and others too complicated > to use and it did not give me enough control on the transport layer. I need > my socket to be non-blocking and I am using epoll( ) which is very > ef

[sqlite] Version number in sqlite3.pc file

2008-06-04 Thread Nicolas Williams
I'm told that Firefox expects the full version number in the sqlite3.pc file, not just "3.5". Is this true? If so, why does configure.ac strip out the micro number? (configure.ac does this: VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`] and substitutes the resulting $VERS

Re: [sqlite] Proposed SQLite C/C++ interface behavior change.

2008-05-14 Thread Nicolas Williams
On Tue, May 13, 2008 at 08:22:07PM -0400, D. Richard Hipp wrote: > Perhaps a better approach would be to modify sqlite3_close() to return > SQLITE_MISUSE if called with unfinalized prepared statements and also > fail and assert() in that case. That way, applications would crash > during deve

Re: [sqlite] SQLITE3 datatype

2008-05-07 Thread Nicolas Williams
The key point, in all this thread, is that SQLite3 does not, in fact, support a "BIGINT" value type as such, though it does allow the use of that string as a column type affinity. Nico -- ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqli

Re: [sqlite] cidr data type

2008-04-19 Thread Nicolas Williams
On Fri, Apr 18, 2008 at 08:59:17PM -0500, John Stanton wrote: > Use a function and convert the IP address from dotted format to a 32 bit > unsigned integer. You can AND and OR these to establish inclusion and > exclusion. That doesn't get you the prefix length. If you represent the mask/prefix

Re: [sqlite] cidr data type

2008-04-18 Thread Nicolas Williams
On Fri, Apr 18, 2008 at 04:34:07PM -0500, Nicolas Williams wrote: > You could have functions to convert to/from display notation, and then > the internal storage format could be an integer, or even as a bit string ^^^ Here I had in mind a

Re: [sqlite] cidr data type

2008-04-18 Thread Nicolas Williams
On Fri, Apr 18, 2008 at 11:08:24PM +0200, Christof Meerwald wrote: > does SQLite have anything similar to PostgreSQL's cidr data type (see > http://www.postgresql.org/docs/8.3/interactive/datatype-net-types.html). No. > Currently, I am thinking of storing start and end IP addresses as a blob in >

Re: [sqlite] Dealing with monetary huge values in sqlite

2008-04-13 Thread Nicolas Williams
On Sun, Apr 13, 2008 at 07:37:33PM +0200, Aladdin Lampé wrote: > In my opinion (please tell me if I'm wrong), your method only works if > you want to *display* the values in your column, and if the decimal > precision doesn't change form line to line. > > I would like to be able to perform operati

Re: [sqlite] 3.5.7 & TCL: "undefined symbol: sqlite3StrICmp"

2008-04-04 Thread Nicolas Williams
On Fri, Apr 04, 2008 at 01:43:24PM -0700, Steven Fisher wrote: > On 04-Apr-2008, at 1:17 PM, Nicolas Williams wrote: > > Sure there is: > > > >const char *sqlite3_column_decltype(sqlite3_stmt*,int); > >int sqlite3_column_type(sqlite3_stmt*, int iCol); > >

Re: [sqlite] 3.5.7 & TCL: "undefined symbol: sqlite3StrICmp"

2008-04-04 Thread Nicolas Williams
On Fri, Apr 04, 2008 at 01:06:58PM -0700, Steven Fisher wrote: > > It's not necessarily the same as strcasecmp(). You can have per- > > column collations. > > Column names, not column contents. :) I don't like to have my C code > rely on the order of columns from a query. You can avoid dependi

Re: [sqlite] 3.5.7 & TCL: "undefined symbol: sqlite3StrICmp"

2008-04-04 Thread Nicolas Williams
On Fri, Apr 04, 2008 at 12:48:05PM -0700, Steven Fisher wrote: > On 03-Apr-2008, at 11:22 PM, Matthew L. Creech wrote: > > We need to either rename it so > > that it's part of the library's exported API, or do something > > different in tclsqlite.c. > > I would really like to have a few of sqlite3

Re: [sqlite] 3.5.7 & TCL: "undefined symbol: sqlite3StrICmp"

2008-04-04 Thread Nicolas Williams
On Fri, Apr 04, 2008 at 08:48:53AM -0400, D. Richard Hipp wrote: > The way we build the TCL interface that is on the download > page is that the TCL interface code becomes part of the > amalgamation and the whole thing is compiled as a single > translation unit. I cannot imagine why anyone would w

Re: [sqlite] Count(1)

2008-04-04 Thread Nicolas Williams
On Fri, Apr 04, 2008 at 11:19:53AM -0400, Samuel Neff wrote: > Is it really a full table scan or just an index scan (at least in the case > where no data is needed from the table as in the original sample that had no > join or where clause). Either way it's O(N) instead of O(1), which is what the

Re: [sqlite] Testing the rowid algorithm. Was: Generating new rowid alg o

2008-03-11 Thread Nicolas Williams
On Tue, Mar 11, 2008 at 02:54:32PM -0400, John Elrick wrote: > [EMAIL PROTECTED] wrote: > > Our solution to this problem is that we allow the test script > > to monkey with the state of the Pseudo-Random Number Generator > > (PRNG) that SQLite uses to generate random rowids. On a test > > build, w

[sqlite] Core dump in asyncOpen() (bus error -- misaligned pointer)

2008-03-07 Thread Nicolas Williams
984 static int asyncOpen( 985 sqlite3_vfs *pAsyncVfs, --->986 const char *zName, 987 sqlite3_file *pFile, 988 int flags, 989 int *pOutFlags 990 ){ ... -->1009 int nName = strlen(zName)+1; ... 1016 nByte = ( 1017 sizeof(AsyncFileData) +/*

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-02-22 Thread Nicolas Williams
On Fri, Feb 22, 2008 at 11:51:08AM -0500, Samuel Neff wrote: > I don't agree with the XML anaology. As I understand it, recursion in SQL > is referring to self-referencing tables that create a parent/child > relationship. This generally does not apply to XML since XML is > hierarchical but usual

Re: [sqlite] Transaction log writing performance

2008-02-22 Thread Nicolas Williams
On Fri, Feb 22, 2008 at 04:44:25PM +, [EMAIL PROTECTED] wrote: > Marco Bambini <[EMAIL PROTECTED]> wrote: > > > > So, is safe so to set PRAGMA synchronous=NORMAL; under MacOS X? > > > > I am told probably not, though Apple has never issued a definitive > statement on the question. It may be

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-02-22 Thread Nicolas Williams
On Fri, Feb 22, 2008 at 09:24:06AM -0700, Dennis Cote wrote: > As Nicolas said, SQL:1999 defines a standard method of doing this. It > uses a WITH RECURSIVE clause as a prefix to a SELECT. It hasn't been > widely implemented, but I believe that IBM's DB2 supports this mechanism. Ah, good to know

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-02-22 Thread Nicolas Williams
On Fri, Feb 22, 2008 at 11:14:41AM -0500, John Elrick wrote: > > IIUC ANSI SQL has a WITH keyword and support for recursive queries. > > > > SQLite doesn't support this, of course. But it could (whether it will > > is another story). > > A recursive trigger would handle this issue nicely...a way

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-02-22 Thread Nicolas Williams
On Fri, Feb 22, 2008 at 10:46:00AM -0500, Igor Tandetnik wrote: > John Elrick <[EMAIL PROTECTED]> wrote: > > I'm a bit stumped and was curious if anyone had an elegant solution > > for this problem. Assuming the following simplified example, my goal > > is to cascade the deletes until all parent/c

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread Nicolas Williams
On Wed, Feb 20, 2008 at 04:50:47PM +, [EMAIL PROTECTED] wrote: > Private messages on this subject suggest that I have misunderstood > the question. What exactly do you mean by "instances" of SQLite? Two instances of libsqlite3.a linked into different parts of the process. > If you create two

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread Nicolas Williams
On Wed, Feb 20, 2008 at 04:23:29PM +, [EMAIL PROTECTED] wrote: > Nicolas Williams <[EMAIL PROTECTED]> wrote: > > does SQLite know about POSIX file locks on the same files from > > other instances of itself? > > Yes. That's the whole point of POSIX advis

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread Nicolas Williams
On Wed, Feb 20, 2008 at 10:58:05AM -0500, Igor Tandetnik wrote: > Sam Carleton <[EMAIL PROTECTED]> wrote: > > I am working on a application that is currently access the SQLite > > database via PHP that is running under Apache as a module. The > > application also has a custom written Apache module

Re: [sqlite] Given sqlite3_enable_load_extension(), why omit loadable extensions?

2008-02-19 Thread Nicolas Williams
On Wed, Feb 20, 2008 at 12:09:16AM +0100, Michael Ruck wrote: > This is most likely done to reduce compiled code size. For a lot of systems > this code probably is wasted space, as the feature is not used everywhere. > For embedded systems the ability to simply cut features at compile time to > red

[sqlite] Given sqlite3_enable_load_extension(), why omit loadable extensions?

2008-02-19 Thread Nicolas Williams
I searched and found that SQLITE_OMIT_LOAD_EXTENSION is defined by default to protect applications that might otherwise unwittingly allow SQL that loads extensions. I understand that, but, by default extensions cannot be loaded until sqlite3_enable_load_extension() is called to enable them. So wh

Re: [sqlite] sqlite3_column_type

2008-02-14 Thread Nicolas Williams
On Thu, Feb 14, 2008 at 02:42:16PM -0500, Igor Tandetnik wrote: > Michael Pitchford > <[EMAIL PROTECTED]> wrote: > > I'm having an issue with sqlite3_column_type in the current version > > of sqlite (3.5.6 at the time of this email). Unless I explicitly call > > sqlite3_step() on the statement, i

Re: [sqlite] Why attach databases?

2008-02-07 Thread Nicolas Williams
On Thu, Feb 07, 2008 at 06:17:19PM -0500, Samuel R. Neff wrote: > A blanket "stay away" is pretty extreme. I would rather be able to have True. One use case discussed before would be to archive history data from one DB to another, then reset the history tables in the first one. _

Re: [sqlite] Why attach databases?

2008-02-07 Thread Nicolas Williams
Given the restrictions on views and triggers (they cannot make reference to tables from more than one database) I'd say "stay away from ATTACH where possible" -- don't create new uses of it without good reason. ___ sqlite-users mailing list sqlite-users@s

Re: [sqlite] SQLite Web Site

2008-02-06 Thread Nicolas Williams
On Wed, Feb 06, 2008 at 02:46:31PM -0800, L. S. wrote: > O-o-o-okay! That explains it. > I do vaguely remember that issue being discussed, some time ago. > Well... I'm in Cali', and I'm out of luck on this Palm/Blazer. I can load the SQLite web page in Opera Mini on my phone... ___

Re: [sqlite] Solaris make test compilation error

2008-02-05 Thread Nicolas Williams
BTW, in Solaris Nevada (build 44) sched_yield() has moved into libc. Which is why SQLite 3.5.5 builds without errors on Solaris Nevada. Auxiliary filters remain in librt so that linking with -lrt will work on all versions of Solaris. Nico -- ___ sqlite

Re: [sqlite] Mailing List Changes

2008-02-04 Thread Nicolas Williams
On Tue, Feb 05, 2008 at 01:30:01AM +, [EMAIL PROTECTED] wrote: > And yet nearly everyone I know loaths that behavior. The > overwhelming majority of users prefer mailing list replies > to go back to the mailing list *only*. Users need to learn to do "list reply" or "reply all" :) Getting dup

Re: [sqlite] Solaris bus error

2008-01-31 Thread Nicolas Williams
On Thu, Jan 31, 2008 at 04:38:27PM -0800, Ken wrote: > Solaris Nevada is an x86 system if I'm reading the Hardware > Compatibility List correctly. No, it's an unreleased version of Solaris (the basis for the next release after Solaris 10). It runs on x86 and SPARC, but I was trying this on my lap

Re: [sqlite] Solaris bus error

2008-01-31 Thread Nicolas Williams
I didn't get any core dumps in Solaris Nevada, but seven tests failed: Failures on these tests: vtab6-2.2 vtab6-2.4 vtab6-2.5 vtab6-2.6 vtab6-7.1 vtab6-9.1.1 vtab6-9.2 Nico -- - To unsubscribe, send email to [EMAIL PROT

Re: [sqlite] Solaris make test compilation error

2008-01-31 Thread Nicolas Williams
On Thu, Jan 31, 2008 at 02:32:45PM -0800, James Dennett wrote: > > > Undefined first referenced > > > symbol in file > > > sched_yield /var/tmp//cckDMcyL.o > > > ld: fatal: Symbol referencing errors. No output written to > >

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread Nicolas Williams
On Mon, Jan 28, 2008 at 06:22:08PM +0100, Ralf Junker wrote: > I believe that this API would also ease implementations of Unicode > LIKE and GLOB. That's what I was thinking of. The Unicode extensions work by redefining the like, glob and regexp functions, and by adding collations. But surely th

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread Nicolas Williams
On Mon, Jan 28, 2008 at 10:07:01AM +0100, Ralf Junker wrote: > Hello Bharath Booshan L, > > >>select * from t where filepath regexp '/MyMovie(\.[^\.]+)*$'; > > > >Will this query use index, if we had one, on filepath? > > No. It will do a full table scan. But it could, no? I suppose that to mak

Re: [sqlite] Query problem

2008-01-24 Thread Nicolas Williams
On Wed, Jan 23, 2008 at 10:24:53PM -0800, Scott Hess wrote: > Seems to me that GLOB is a poor substitute for REGEXP. At the shell If, as I suspect, many more users can enter simple globs than can enter simple regexps, then providing a GLOB operator and function in SQLite is very useful indeed. O

<    1   2   3   >