I'm not blaming anyone. I just think it should be mentioned in the docs.
Mike
-Ursprüngliche Nachricht-
Von: John Stanton [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 29. November 2007 20:12
An: sqlite-users@sqlite.org
Betreff: Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_ro
I've already posted here question about getting SQLITE_BUSY when calling
sqlite3_prepare in single thread application dependent on database size.
Now I get more detailed diagnostic.
I have simple database but with considerable amount of records in some
tables. Sql commands looks like:
Begin trans
On Mon, 2007-10-29 at 17:49 +0100, Ralf Junker wrote:
> >> I wonder if it is possible to retrieve bound host parameters from a
> >> prepared SQL statement? I am
> >> thinking of the opposite of the sqlite3_bind... family of functions like:
> >>
> >> int sqlite3_bound_int (sqlite3_stmt*, int*);
Why are you using the INSERT OR IGNORE? If you read the
http://www.sqlite.org/lang_conflict.html it states that the IGNORE will
not return any errors. Isn't the default behavior INSERT OR ABORT (or
just plain INSERT) what you are looking for?
The default INSERT will return an error (SQLITE_CONST
First of all I must say that I enjoyed reading your presentation at
http://www.sqlite.org/php2004/page-001.html on the internals of SQLite and
the performance tips.
I could not find any information on the processing of LEFT JOIN queries
though...
As SQLite only does loop-joins, I wonder how I sho
I downloaded the source tarball for 3.5.1 and followed the instructions in
README. The build dir is sqlite-3.5.1/../bld.
Then cd'd into a subdir of ~ and tried to create a db:
$ sqlite3 mysite.db
sqlite3: error while loading shared libraries: libsqlite3.so.0: cannot
open shared object file: No suc
I'm hope somebody can help me get unstuck here -
I'm trying to use an aggregate function in a select statement but it appears
that you can't use one as a column -
SELECT number, name, (SELECT COUNT(*) FROM pet WHERE employee.number =
pet.number) AS pets FROM employee
I can't come up with another
"james stuart" <[EMAIL PROTECTED]> wrote:
> I'm hope somebody can help me get unstuck here -
>
> I'm trying to use an aggregate function in a select statement but it appears
> that you can't use one as a column -
>
> SELECT number, name, (SELECT COUNT(*) FROM pet WHERE employee.number =
> pet.num
We rely on the SQLite memory management to enforce the memory usage in our
application (running on Windows CE). This has worked quite well for us, but
have found that when we hit the limit, in some circumstances, performance
drops significantly.
Looking into the internals of SQLite, it seems tha
if you do
$ ldconfig -v
or
$ ldconfig -v | grep libsqlite3
search for libsqlite3.so.0 in the list.. is it available
are you running a 64bit OS version?
if yes - depending on the client app - you need the 32bit version if client app
is 32bit
Filip
[EMAIL PROTECTED] wrote: -
To: sq
Hello Dan Kennedy,
>> True, but we would need to access unsupported API to do so.
>> And as we know only too well, unsupported API is subject to
>> change without notice any time ;-). Therefore I would rather
>> not write these myself but ask for the possibility to add them
>> to the library o
Hello Joe Wilson,
>> True, but we would need to access unsupported API to do so. And as we know
>> only too well,
>> unsupported API is subject to change without notice any time ;-). Therefore
>> I would rather not
>> write these myself but ask for the possibility to add them to the library
>>
> SELECT number, name, (SELECT COUNT(*) FROM pet WHERE employee.number =
> pet.number) AS pets FROM employee
That seems like it should work, provided the tables have the definitions
implied by the query. What error are you getting?
Or you could try something like this completely off-the-cuff-an
Daniel,
My usecase is the following: I maintain a lot of tables, which are simply
catalogs of predefined or user entered values. I wanted to reduce the amount
of code and memory to maintain those tables, as the user can enter values as
free text in a lot of web forms and also choose from previousl
patters <[EMAIL PROTECTED]> wrote:
> We rely on the SQLite memory management to enforce the memory usage in our
> application (running on Windows CE). This has worked quite well for us, but
> have found that when we hit the limit, in some circumstances, performance
> drops significantly.
>
> Look
As currently implemented, SQLite3 requires no initialization.
You just start calling SQLite3 interfaces and they work. We
can pull off this trick on Unix because pthread mutexes can
be initialized statically at compile-time.
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
On win32, w
I always create and XXX_Initialize() (and also XXX_Finalize() for resources
cleanup) in
all libraries I created, because:
- You can perform initializations that cannot be done at compile time;
- You can create your internal structures in the required order (C++ has the
problem of initialization /
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 30, 2007 7:19 AM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] Proposed sqlite3_initialize() interface
>
> As currently implemented, SQLite3 requires no initialization.
> You just start c
DRH,
I looked at the memory management code mem3.c. I noticed a mutex to protect
allocations/deallocations and was wondering what the impact on performance to a
multi threaded DB applicaiton would be?
Other memory allcation schemes seem to allow each thread to manage memory
independently of t
Sorry, I didn't read the whole story before answering. You are right,
the documentation on sqlite3_last_insert_rowid should contain some
comment about the conflicts.
I guess that, after working with SQLite for a long time, obvious things
are not obvious to everyone and are easily forgotten in do
"Robert Simpson" <[EMAIL PROTECTED]> wrote:
>
> Is there a reason this can't be checked/done in sqlit3_open() via an
> InterlockedCompareExchange() operation on the static integer, and if the
> mutexes don't exist and can't be created, you just return a different error
> code?
>
That's the other
Ken <[EMAIL PROTECTED]> wrote:
> DRH,
>
> I looked at the memory management code mem3.c. I noticed a
> mutex to protect allocations/deallocations and was wondering
> what the impact on performance to a multi threaded DB
> applicaiton would be?
I guess that depends on your mutex implementation
Hi Richard,
This might be worth a read. This paper discusses limitations of custom
memory allocators:
Reconsidering Custom Memory Allocation
http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf
This post by Emery Berger outlines the problems with Apache Portable
Runtime (APR) memory p
> $ ldconfig -v
> search for libsqlite3.so.0 in the list.. is it available
Thanks. It's in /usr/local/lib, and the sqlite3 interface is working
now. It didn't create the .db file when I exited though. Is it supposed
to create an empty file, or do I have to add data first?
> are you running a
Joe Wilson <[EMAIL PROTECTED]> wrote:
> Hi Richard,
>
> This might be worth a read. This paper discusses limitations of custom
> memory allocators:
>
> Reconsidering Custom Memory Allocation
> http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf
>
Interesting paper. Thanks for the li
I think the proposed sqlite3_initialize() is a good idea and the
library might be a bit smaller/faster as well due to removal of
initialization checks in various functions.
Any concern about operating systems that already ship with a shared
sqlite3 library? Or is that what shared library versio
Hi guys,
I am experiencing a very strange issue in sqlite 3.4.2 (only with the
Win32 version, OSX and linux works fine).
Here it is what's happen:
// create table
CREATE TABLE One( a varchar primary key, b1 integer, b2 integer, b3
integer, z varchar )
CREATE UNIQUE INDEX idx_One ON One( b1
On Oct 30, 2007, at 7:18 AM, [EMAIL PROTECTED] wrote:
As currently implemented, SQLite3 requires no initialization.
You just start calling SQLite3 interfaces and they work. We
can pull off this trick on Unix because pthread mutexes can
be initialized statically at compile-time.
static pthre
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
[EMAIL PROTECTED] wrote:
> It is also an error to
> invoke sqlite3_initialize() more than once.
That is a pretty nasty restriction to have. If you link multiple other
libraries into your program, each of which also uses SQLite then you'd
somehow hav
Marco Bambini <[EMAIL PROTECTED]> wrote:
>
> I am experiencing a very strange issue in sqlite 3.4.2 (only with the
> Win32 version, OSX and linux works fine).
>
> I wonder if there was a bug in the 3.4.2 version that I should fix...
> Please note that I cannot upgrade to the latest 3.5.x versio
The only real way to prevent allocation fragmentation is to move
blocks of memory around - i.e., return and manilpulate handles to
pointers instead of the pointers themselves. But this adds a lot
of runtime overhead and is not C friendly.
Anything else is just a compromise. Predictive and statisti
I think that sqlite3_initialize should be allowed to be called more
than once.
With the help of a static flag, only the first time it is executed
the proper initialize functions will be invoked, successive calls to
the sqlite3_initialize should just be a NOP operation...
---
Marco Bambini
h
> Alternatively, you don't actually need the interface for 99.99% of users
out there (Windows, Linux, Mac)
> so you could make it unnecessary for them, but do require it for the
various esoteric embedded systems.
> That would justify still calling it SQLite version 3.
That was my first thought, ju
The transferred bindings are still opaque, aren't they?
--- Dan Kennedy <[EMAIL PROTECTED]> wrote:
> Depends how desperate you are. Say you want to query statement
> object X that has 4 variables, you could do this:
>
> pTmp = sqlite3_prepare("SELECT ?, ?, ?, ?");
> sqlite3_transfer_bindings
I would endorse the use of an initialization functions as being clean
and efficient and one of the simplest and most logical of optimizations,
eliminating common expressions.
Since your typical application program has an initialization phase it is
trivial to add the new API function to legacy
--- Marco Bambini <[EMAIL PROTECTED]> wrote:
> I think that sqlite3_initialize should be allowed to be called more
> than once.
> With the help of a static flag, only the first time it is executed
> the proper initialize functions will be invoked, successive calls to
> the sqlite3_initialize
Joe Wilson <[EMAIL PROTECTED]> wrote:
> The only real way to prevent allocation fragmentation is to move
> blocks of memory around -
Not true. You can prevent fragmentation, for example, by
not allocating objects beside each other that will be destroyed
at different times. Or, you can pick a sin
On Oct 30, 2007 7:18 AM, <[EMAIL PROTECTED]> wrote:
> This is still just an idea. If you think that adding a new
> required sqlite3_initialize() interface would cause serious
> hardship for your use of SQLite, please speak up now.
I think this would cause some hardship for dynamically-loaded
lib
Richard, i noticed this ticket in the system:
http://www.sqlite.org/cvstrac/tktview?tn=2417,8
And wondered if its something that is getting any serious thought or
something that is just a faint possibility?
-
To unsubsc
Hello Joe,
Tuesday, October 30, 2007, 12:01:37 PM, you wrote:
JW> I think the proposed sqlite3_initialize() is a good idea and the
JW> library might be a bit smaller/faster as well due to removal of
JW> initialization checks in various functions.
JW> Any concern about operating systems that al
Dr. Hipp,
On the fly initialization is a big concern for me because I have the
misfortune to live in a massively multi-threaded environment. So I am
very much in favor of this change. I see that there are already some
other proposals out there, but would urge you to make the interface
chang
"Dan Petitt" <[EMAIL PROTECTED]> wrote:
> > Alternatively, you don't actually need the interface for
> > 99.99% of users out there (Windows, Linux, Mac) so you
> > could make it unnecessary for them, but do require it for the
> > various esoteric embedded systems. That would justify still
> > call
"Dan Petitt" <[EMAIL PROTECTED]> wrote:
> Richard, i noticed this ticket in the system:
> http://www.sqlite.org/cvstrac/tktview?tn=2417,8
>
> And wondered if its something that is getting any serious thought or
> something that is just a faint possibility?
>
Seems to be an incompatibly file form
--- [EMAIL PROTECTED] wrote:
> Joe Wilson <[EMAIL PROTECTED]> wrote:
> > The only real way to prevent allocation fragmentation is to move
> > blocks of memory around -
>
> Not true. You can prevent fragmentation, for example, by
> not allocating objects beside each other that will be destroyed
>
--- Teg <[EMAIL PROTECTED]> wrote:
> You'll just end up exchanging an "are you initialized" flag for a "have
> you called the initialization routine" flag. I don't see it changing
> the size or complexity. Either way, SQLite either has to ensure it's
> initialized OR that someone has called the ini
[EMAIL PROTECTED] wrote:
Joe Wilson <[EMAIL PROTECTED]> wrote:
The only real way to prevent allocation fragmentation is to move
blocks of memory around -
Not true. You can prevent fragmentation, for example, by
not allocating objects beside each other that will be destroyed
at different times
Roger Binns wrote:
> [EMAIL PROTECTED] wrote:
> > It is also an error to
> > invoke sqlite3_initialize() more than once.
>
> That is a pretty nasty restriction to have. If you link multiple
other
> libraries into your program, each of which also uses SQLite then you'd
> somehow have to arrange th
Hello Joe,
Tuesday, October 30, 2007, 2:08:55 PM, you wrote:
JW> --- Teg <[EMAIL PROTECTED]> wrote:
>> You'll just end up exchanging an "are you initialized" flag for a "have
>> you called the initialization routine" flag. I don't see it changing
>> the size or complexity. Either way, SQLite eith
DRH,
I seemed to recall posting that ticket.
I don't have any good solutions for the txn journal lookup at the moment.
Maybe a form of block chaining from the sourcing DB to the txn journal offset.
Each txn journal modification would point to the prior versions offset. So
that multiple cha
Joe Wilson <[EMAIL PROTECTED]> wrote:
> --- [EMAIL PROTECTED] wrote:
> > Joe Wilson <[EMAIL PROTECTED]> wrote:
> > > The only real way to prevent allocation fragmentation is to move
> > > blocks of memory around -
> >
> > Not true. You can prevent fragmentation, for example, by
> > not allocating
--- [EMAIL PROTECTED] wrote:
> Mostly I am interested in making sure that malloc(1000) does not
> fail even though you have 5 bytes free and they just happen
> to be scattered about as 100 discontinguous blocks of 500 bytes
> each.
It's a good goal. You can reduce the likelihood of failure p
[EMAIL PROTECTED] wrote:
>
> Hello Joe,
>
> Tuesday, October 30, 2007, 2:08:55 PM, you wrote:
>
> JW> --- Teg <[EMAIL PROTECTED]> wrote:
> >> You'll just end up exchanging an "are you initialized" flag for a
"have
> >> you called the initialization routine" flag. I don't see it
changing
> >> the
--- Teg <[EMAIL PROTECTED]> wrote:
> I was speaking of internally, inside SQlite. I'm sure you expect to
> get an error if you call into SQLite without calling the initialize
> routine first. Instead of returning an error, why not initialize right there
> instead?
Because of the overhead in the mu
Joe Wilson <[EMAIL PROTECTED]> wrote:
> --- [EMAIL PROTECTED] wrote:
> > Mostly I am interested in making sure that malloc(1000) does not
> > fail even though you have 5 bytes free and they just happen
> > to be scattered about as 100 discontinguous blocks of 500 bytes
> > each.
>
> It's a g
At 19:41 30/10/2007, you wrote:
Mostly I am interested in making sure that malloc(1000) does not
fail even though you have 5 bytes free and they just happen
to be scattered about as 100 discontinguous blocks of 500 bytes
each.
On the embebed device i worked (i made only the micro-os with sq
The journal file sounds like the wrong place to put it, the journal seems to
be the place to store information that needs writing to the database on
completion; storing some read-only information in the same file seems at
odds with its current purpose.
Perhaps a separate file(s) might be more appr
On 10/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On win32, we have to initialize mutexes at run-time, but this
> can be done within a contrived mutex that we build off of
> a static integer using InterlockedIncrement(). And mutex
> initialization apparently never fails on win32, so we
--- [EMAIL PROTECTED] wrote:
> Joe Wilson <[EMAIL PROTECTED]> wrote:
> > --- [EMAIL PROTECTED] wrote:
> > > Mostly I am interested in making sure that malloc(1000) does not
> > > fail even though you have 5 bytes free and they just happen
> > > to be scattered about as 100 discontinguous blocks
I'm trying to correct several little problems in a DB I have and I've
now tried three [maybe four] freeware DB managers and not one includes
a search function. I have a table with 800+ rows and I'd like to find
particular records so I can edit them, and not having a search is
proving to be a r
> -Original Message-
> From: Bernie Cosell [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 30, 2007 1:58 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] DB managers that do searches?
>
> I'm trying to correct several little problems in a DB I have and I've
> now tried three [maybe
Hi Bernie,
regarding: "...and not having a search is a real hassle"
I'm not at all sure I understand.
SQLITE (and all the DB managers I know of that incorporate it) supports
most of the SQL 92 language, which allows rather sophisticated searching
via the SELECT statement.
It's not normally the
I wrote:
> On 10/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > On win32, we have to initialize mutexes at run-time, but this
> > can be done within a contrived mutex that we build off of
> > a static integer using InterlockedIncrement(). And mutex
> > initialization apparently never f
To help the conversation along a bit, phpMyAdmin is a web-based
administrative and design interface for MySQL. I don't use it so I
don't know exactly what kind of searching the OP is looking for
either, but at least we know the type of tool :)
-
Joe Wilson wrote:
The transferred bindings are still opaque, aren't they?
--- Dan Kennedy <[EMAIL PROTECTED]> wrote:
Depends how desperate you are. Say you want to query statement
object X that has 4 variables, you could do this:
pTmp = sqlite3_prepare("SELECT ?, ?, ?, ?");
sqlite3_tra
--- [EMAIL PROTECTED] wrote:
> Joe Wilson <[EMAIL PROTECTED]> wrote:
> > Is this memory pooling going to be compile-time optional?
> >
> > I find that library-specific memory pools are awkward because each
> > library tends to have its own schemes that don't play well with each
> > other. If you u
--- Dennis Cote <[EMAIL PROTECTED]> wrote:
> Joe Wilson wrote:
> > The transferred bindings are still opaque, aren't they?
> >
> > --- Dan Kennedy <[EMAIL PROTECTED]> wrote:
> >
> >> Depends how desperate you are. Say you want to query statement
> >> object X that has 4 variables, you could do
Dan,
The journal file contains the "before" image of a modified database block not
the after image.
during write operations: before images are written to the journal file for
recovery.
Then the actual change is written to the .db file.
A commit is an atomic operation due to unlinking the j
[EMAIL PROTECTED] wrote:
But there are other operating systems using SQLite that do
not work this way. They need a way to initialize mutexes
(and possibly other objects such as malloc) prior to running
any SQLite interface. And the initialization needs to be able
to fail and return an error cod
On Tue, 30 Oct 2007 14:18:48 +, [EMAIL PROTECTED] wrote:
>To accomodate this need, we are considering an incompatible
>API change to SQLite. We are thinking of requiring that an
>application invoke:
>
>int sqlite3_initialize(...);
>
>prior to using any other SQLite interface.
In my env
On Tue, 30 Oct 2007 17:28:35 +0700, Dan Kennedy
<[EMAIL PROTECTED]> wrote:
>...
>Say you want to query statement object
>X that has 4 variables, you could do this:
>
> pTmp = sqlite3_prepare("SELECT ?, ?, ?, ?");
> sqlite3_transfer_bindings(X, pTmp);
> /* Use sqlite3_step() etc. to fish values
[Default] On Tue, 30 Oct 2007 16:57:55 -0400, "Bernie Cosell"
<[EMAIL PROTECTED]> wrote:
>I'm trying to correct several little problems in a DB I have and I've
>now tried three [maybe four] freeware DB managers and not one includes
>a search function. I have a table with 800+ rows and I'd like
Bernie Cosell wrote:
I'm trying to correct several little problems in a DB I have and I've
now tried three [maybe four] freeware DB managers and not one includes
a search function.
Do you mean sorting a table on a text column, typing in a few
characters, and then going to the row that matche
On Oct 30, 2007, at 10:18 AM, [EMAIL PROTECTED] wrote:
To accomodate this need, we are considering an incompatible
API change to SQLite. We are thinking of requiring that an
application invoke:
int sqlite3_initialize(...);
I am not sure about the systems that you are trying to support
gcc support this, msvc++ and other compilers does not.
-Original Message-
From: Russell Leighton [mailto:[EMAIL PROTECTED]
Sent: terça-feira, 30 de outubro de 2007 23:32
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Proposed sqlite3_initialize() interface
On Oct 30, 2007, at 10:18 A
On 30 Oct 2007 at 14:27, Trevor Talbot wrote:
> To help the conversation along a bit, phpMyAdmin is a web-based
> administrative and design interface for MySQL. I don't use it so I
> don't know exactly what kind of searching the OP is looking for
> either, but at least we know the type of tool :)
On 30 Oct 2007 at 14:05, James Dennett wrote:
> > -Original Message-
> > From: Bernie Cosell [mailto:[EMAIL PROTECTED]
> > I'm trying to correct several little problems in a DB I have and I've
> > now tried three [maybe four] freeware DB managers and not one includes
> > a search function
On 30 Oct 2007 at 23:31, Kees Nuyt wrote:
> [Default] On Tue, 30 Oct 2007 16:57:55 -0400, "Bernie Cosell"
> <[EMAIL PROTECTED]> wrote:
>
> >I'm trying to correct several little problems in a DB I have and I've
> >now tried three [maybe four] freeware DB managers and not one includes
> >a search
On Oct 30, 2007 6:32 PM, Russell Leighton <[EMAIL PROTECTED]> wrote:
>
> On Oct 30, 2007, at 10:18 AM, [EMAIL PROTECTED] wrote:
>
> >
> > To accomodate this need, we are considering an incompatible
> > API change to SQLite. We are thinking of requiring that an
> > application invoke:
> >
> > i
78 matches
Mail list logo