Re: [sqlite] SQLite version 3.6.23

2010-03-10 Thread Melton Low
That fixed it for me.

Thanks, Mel

On Wed, Mar 10, 2010 at 7:01 AM, D. Richard Hipp  wrote:

>
> On Mar 10, 2010, at 12:54 AM, Melton Low wrote:
>
> > I just tried to build 3.6.23 on a PPC Mac running OS X 10.4.
>
> Please try adding SQLITE_ENABLE_LOCKING_STYLE=0 to the compiler options.
>
> >
> >>
> >> I got an undefined symbol error and the make aborted.
> >
> > /bin/sh ./libtool --tag=CC --mode=link gcc -DSQLITE_THREADSAFE=1
> > -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2   -o libsqlite3.la
> > -rpath
> > /usr/local/lib -no-undefined -version-info 8:6:8 sqlite3.lo
> > gcc -dynamiclib  -o .libs/libsqlite3.0.8.6.dylib  .libs/sqlite3.o
> > -install_name  /usr/local/lib/libsqlite3.0.dylib -
> > compatibility_version 9
> > -current_version 9.6
> > ld: Undefined symbols:
> > _gethostuuid
> > /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/libtool: internal link
> > edit
> > command failed
> > make: *** [libsqlite3.la] Error 1
> >
> > I have attached the full configure and make output as an attachment.
> >
> > Your help would be appreciated.
> >
> > Mel
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> D. Richard Hipp
> d...@hwaci.com
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Fastest concurrent read-only performance (+ threads vsprocesses) [BUG?]

2010-03-10 Thread Luke Evans
Well, I guess this is looking more an more like a bug then.

I just went to the sqlite.org site to find out how I log a bug and it referred 
me back to here.  Perhaps this means I just need to *DECLARE BUG* here ;-)
Actually, I'll probably have some time soon to try out a profiler to see if I 
can figure out which mutexes are involved in causing the synchonising behaviour 
I seem to be experiencing.



> 
> I'm out of ideas about this. I understand that it shouldn't work this
> way and I don't understand why it does.
> Is it possible for you to run application in some sort of profiler?
> Obviously it should show that a lot of time is spent in waiting on
> some mutex and it will be able to show where this mutex is held
> from...
> 
> 
> Pavel
> 
> On Tue, Mar 9, 2010 at 1:02 PM, Luke Evans  wrote:
>> Hi guys,
>> 
>> Had to take a break for a couple of days from my SQLite experiments, but 
>> back on it now.
>> 
>> Pavel, regarding the question about VFS, I'm not using one to my knowledge 
>> and have set the "name of VFS module" to NULL in sqlite3_open_v2.  Maybe 
>> NULL means I'm using the standard VFS, but in any case, not a "non-standard" 
>> one.
>> I'm selecting from a real table.
>> 
>> Here are some more timings...
>> 
>> Shared cache ON.  6 of the same query issued (as before) within the 
>> multithreaded scenario.  All the queries bunch up and report complete more 
>> or less together.
>> 
>> 2010-03-09 09:32:33.013 SQLiteTest[16208:a0f] SQLite says multithreading is 
>> ON
>> 2010-03-09 09:32:33.015 SQLiteTest[16208:a0f] SQLite's multithreading value 
>> is 2
>> 2010-03-09 09:32:33.015 SQLiteTest[16208:a0f] SHARED CACHE IS ON
>> 2010-03-09 09:32:33.017 SQLiteTest[16208:1b03] Starting query on thread 
>> {name = (null), num = 3}
>> 2010-03-09 09:32:33.018 SQLiteTest[16208:5603] Starting query on thread 
>> {name = (null), num = 4}
>> 2010-03-09 09:32:33.017 SQLiteTest[16208:4403] Starting query on thread 
>> {name = (null), num = 2}
>> 2010-03-09 09:32:33.018 SQLiteTest[16208:5503] Starting query on thread 
>> {name = (null), num = 5}
>> 2010-03-09 09:32:33.019 SQLiteTest[16208:5703] Starting query on thread 
>> {name = (null), num = 6}
>> 2010-03-09 09:32:33.019 SQLiteTest[16208:5c03] Starting query on thread 
>> {name = (null), num = 7}
>> 2010-03-09 09:32:41.359 SQLiteTest[16208:5603] Finished query on thread 
>> {name = (null), num = 4} in 8.34s
>> 2010-03-09 09:32:41.359 SQLiteTest[16208:1b03] Finished query on thread 
>> {name = (null), num = 3} in 8.34s
>> 2010-03-09 09:32:41.359 SQLiteTest[16208:4403] Finished query on thread 
>> {name = (null), num = 2} in 8.34s
>> 2010-03-09 09:32:41.359 SQLiteTest[16208:5503] Finished query on thread 
>> {name = (null), num = 5} in 8.34s
>> 2010-03-09 09:32:41.360 SQLiteTest[16208:5703] Finished query on thread 
>> {name = (null), num = 6} in 8.34s
>> 2010-03-09 09:32:41.360 SQLiteTest[16208:5c03] Finished query on thread 
>> {name = (null), num = 7} in 8.34s
>> 2010-03-09 09:32:41.360 SQLiteTest[16208:a0f] Finished all queries in 8.34s
>> 
>> 
>> 
>> 6 of the same query executed in separate processes.
>> The query time is essentially the same as when you issue just a single query 
>> in the 'multithreaded' configuration above - as one would expect.
>> 
>> 2010-03-09 09:47:02.729 SQLiteTest[17083:a0f] SQLite says multithreading is 
>> ON
>> 2010-03-09 09:47:02.731 SQLiteTest[17083:a0f] SQLite's multithreading value 
>> is 2
>> SHARED CACHE IS OFFRead uncommitted is 1
>> SHARED CACHE IS OFFRead uncommitted is 1
>> SHARED CACHE IS OFFRead uncommitted is 1
>> SHARED CACHE IS OFFRead uncommitted is 1
>> SHARED CACHE IS OFFRead uncommitted is 1
>> SHARED CACHE IS OFFRead uncommitted is 1
>> Cache size is 10
>> Page size is 32768
>> Temp store is 2
>> Synchronous is 0
>> Cache size is 10
>> Page size is 32768
>> Temp store is 2
>> Synchronous is 0
>> Cache size is 10
>> Page size is 32768
>> Temp store is 2
>> Synchronous is 0
>> Cache size is 10
>> Page size is 32768
>> Temp store is 2
>> Synchronous is 0
>> Cache size is 10
>> Page size is 32768
>> Temp store is 2
>> Synchronous is 0
>> Cache size is 10
>> Page size is 32768
>> Temp store is 2
>> Synchronous is 0
>> On pid 17089, 3717 rows read in approx 2s
>> On pid 17088, 3717 rows read in approx 2s
>> On pid 17093, 3717 rows read in approx 2s
>> On pid 17090, 3717 rows read in approx 2s
>> On pid 17091, 3717 rows read in approx 2s
>> On pid 17092, 3717 rows read in approx 2s
>> 2010-03-09 09:47:04.323 SQLiteTest[17083:a0f] Finished all queries in 1.59s
>> 
>> 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE3 in backend RPC client/server environment

2010-03-10 Thread Hector
Platform: windows

I want to explore replacing b-tree database (ISAM/Index files) in our
backend RPC server with SQLITE3.   I'm relatively new to SQLITE3 and
just reading up on its multi-thread and pooling framework. I'm not
quite sure how to implement it, but it seems I should be able once
understood.

Some insights would be appreciated. Here is some backend.

We need to maintain API backward compatibility on the client side, for
example, the API had traversal functions such as:

BOOL wcGetFirstFileRec(TFileRecord &fr, DWORD &tid);
BOOL wcGetNextFileRec(TFileRecord &fr, DWORD &tid);
BOOL wcGetPrevFileRec(TFileRecord &fr, DWORD &tid);
BOOL wcGetLastFileRec(TFileRecord &fr, DWORD &tid);

The tid is a handle returned to the last position in the server's
btree page chain.  So as long as its persistent, a loop such as this
can be done:

TFileRecord fr = {0}
DWORD tid = 0;
if (wcGetFirstFileRec(ft,tid)) do {

} while (wcGetNextFileRec(ft,tid));

On the backend, if tid is not zero, then it jumps to the position in
the index page to get the next/prev record position and thus ISAM record.

While the plan is provide new API functions specific for bulk
operations over the wire,  we need to keep compatible with the
existing API.

So my question is, given there are two SQLITE3 objects:

 SQLITE3 *db   <-- pointer to the database
 SQLITE3_STM *stm  <-- pointer to query

what strategy do I look at to provide RPC thread context integrity on
the backend.  Each API function has a context handle so each thread
will have its own instance of context block to work with.

Right now the btree database is globally opened exclusively by the
server and reader/writer locking is used for the server-side API I/O.

This is why it appears I should be able to replace the database with
SQLITE3 and at the very least keep the concurrency integrity.

So my initial thought was to open the database globally as its done
now and then for each thread context, maintain a context handle mapped
list of SQLITE3_STM pointers as they are opened.  They will be created
when GetFirstFileRec() or GetLastFileRec() are called returning tid as
the index/handle to SQLITE3_STM pointer.  It will be passed back in
Next/Prev as the SQLITE3_STM pointer along to continue with a fetch call.

Anyway, I am not sure if this is the wrong approach with SQLITE3, or
will be duplicating work, or there is a workable strategy already for
SQLITE3 for multithread client/server frameworks.

Thanks in Advance

PS: Researching this shows strategy where connection pools are used.
But I didn't see the integrity of this without having a cursor pool.
Does the SQLITE3 library maintain a list of cursors per connection?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE3 in backend RPC client/server environment

2010-03-10 Thread hector
Platform: windows

I want to explore replacing b-tree database (ISAM/Index files) in our 
backend RPC server with SQLITE3.   I'm relatively new to SQLITE3 and 
just reading up on its multi-thread and pooling framework. I'm not 
quite sure how to implement it, but it seems I should be able once 
understood.

Some insights would be appreciated. Here is some backend.

We need to maintain API backward compatibility on the client side, for 
example, the API had traversal functions such as:

BOOL wcGetFirstFileRec(TFileRecord &fr, DWORD &tid);
BOOL wcGetNextFileRec(TFileRecord &fr, DWORD &tid);
BOOL wcGetPrevFileRec(TFileRecord &fr, DWORD &tid);
BOOL wcGetLastFileRec(TFileRecord &fr, DWORD &tid);

The tid is a handle returned to the last position in the server's 
btree page chain.  So as long as its persistent, a loop such as this 
can be done:

TFileRecord fr = {0}
DWORD tid = 0;
if (wcGetFirstFileRec(ft,tid)) do {

} while (wcGetNextFileRec(ft,tid));

On the backend, if tid is not zero, then it jumps to the position in 
the index page to get the next/prev record position and thus ISAM record.

While the plan is provide new API functions specific for bulk 
operations over the wire,  we need to keep compatible with the 
existing API.

So my question is, given there are two SQLITE3 objects:

 SQLITE3 *db   <-- pointer to the database
 SQLITE3_STM *stm  <-- pointer to query

what strategy do I look at to provide RPC thread context integrity on 
the backend.  Each API function has a context handle so each thread 
will have its own instance of context block to work with.

Right now the btree database is globally opened exclusively by the 
server and reader/writer locking is used for the server-side API I/O.

This is why it appears I should be able to replace the database with 
SQLITE3 and at the very least keep the concurrency integrity.

So my initial thought was to open the database globally as its done 
now and then for each thread context, maintain a context handle mapped 
list of SQLITE3_STM pointers as they are opened.  They will be created 
when GetFirstFileRec() or GetLastFileRec() are called returning tid as 
the index/handle to SQLITE3_STM pointer.  It will be passed back in 
Next/Prev as the SQLITE3_STM pointer along to continue with a fetch call.

Anyway, I am not sure if this is the wrong approach with SQLITE3, or 
will be duplicating work, or there is a workable strategy already for 
SQLITE3 for multithread client/server frameworks.

Thanks in Advance

PS: Researching this shows strategy where connection pools are used. 
But I didn't see the integrity of this without having a cursor pool. 
Does the SQLITE3 library maintain a list of cursors per connection?

-- 
HLS



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Column types "safe" changes

2010-03-10 Thread Jean-Christophe Deschamps

>Why not just
>
> update tbl set col1 = col1;
>
>or perhaps
>
> update tbl set col1 = cast(col1 as text);
>
>I'm not sure the former will actually change anything, but the latter 
>should.

Yes my untold question was merely if simpler col = col way could be 
simply ignored.  You're right about the cast, it should work, thanks.



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23

2010-03-10 Thread Andreas Kupries
D. Richard Hipp wrote:
> On Mar 10, 2010, at 12:54 AM, Melton Low wrote:
> 
>> I just tried to build 3.6.23 on a PPC Mac running OS X 10.4.
> 
> Please try adding SQLITE_ENABLE_LOCKING_STYLE=0 to the compiler options.

>>> I got an undefined symbol error and the make aborted.
>> /bin/sh ./libtool --tag=CC --mode=link gcc -DSQLITE_THREADSAFE=1
>> -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2   -o libsqlite3.la  
>> -rpath

I got the same undefined symbol in our OS X builds.

Adding the
-DSQLITE_ENABLE_LOCKING_STYLE=0

fixed it for me, on both machines (Tiger, Leopard).

-- 
Sincerely,
 Andreas Kupries 
 Developer @
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with SQLite in BCB 4

2010-03-10 Thread Chimerian
Correction: I didnt delete this one ;)

Database::Database(char* filename)
{



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with SQLite in BCB 4

2010-03-10 Thread Chimerian
Solved. I found very interesting post on forum 
http://marc.info/?l=sqlite-users&m=117751256117132&w=2
So... I deleted some part of code:

unit1.cpp:

// DLL handle
HANDLE DLLHandle = LoadLibrary("sqlite3.dll");

// SQLite class
Database::Database(char* filename)
{
sqlite3_open = (int (__cdecl *)(const char *, 
sqlite3**))GetProcAddress(DLLHandle,"sqlite3_open");

sqlite3_close = (int (__cdecl 
*)(sqlite3*))GetProcAddress(DLLHandle,"sqlite3_close");

sqlite3_prepare_v2 = (int (__cdecl *)(sqlite3*, const char*, int, 
sqlite3_stmt**, const char**))GetProcAddress(DLLHandle,"sqlite3_prepare_v2");

sqlite3_column_count = (int 
(__cdecl*)(sqlite3_stmt*))GetProcAddress(DLLHandle,"sqlite3_column_count");

sqlite3_step = (int (__cdecl 
*)(sqlite3_stmt*))GetProcAddress(DLLHandle,"sqlite3_step");

sqlite3_column_text = (const unsigned char (__cdecl *)(sqlite3_stmt*, 
int iCol))GetProcAddress(DLLHandle,"sqlite3_column_text");

sqlite3_finalize = (int (__cdecl 
*)(sqlite3_stmt*))GetProcAddress(DLLHandle,"sqlite3_finalize");


and definitions (unit1.h)


private:
int (*sqlite3_open)(const char *, sqlite3**);
int (*sqlite3_prepare_v2)(sqlite3*, const char*, int, sqlite3_stmt**, 
const char**);
int (*sqlite3_column_count)(sqlite3_stmt*);
int (*sqlite3_step)(sqlite3_stmt*);
const unsigned char (*sqlite3_column_text)(sqlite3_stmt*, int iCol);
int (*sqlite3_finalize)(sqlite3_stmt*);
int (*sqlite3_close)(sqlite3*);

and added sqlite3.lib to project - now I dont get any errors.

Thanks for Your help - its nice to see so many answers for my question :)


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Column types "safe" changes

2010-03-10 Thread Igor Tandetnik
Jean-Christophe Deschamps 
wrote: 
> Beside the obvious update with every changed column mentionned,
> 
> update tbl set col1 = (select col1 from tbl y where y.rowid =
> tbl.rowid),
>...
>coln = (select coln from tbl y where y.rowid =
> tbl.rowid);
> 
> do you think of a easier way?

Why not just

update tbl set col1 = col1;

or perhaps

update tbl set col1 = cast(col1 as text);

I'm not sure the former will actually change anything, but the latter should.

Igor Tandetnik


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Column types "safe" changes

2010-03-10 Thread Jean-Christophe Deschamps

>And, of course, you'll have a table where some rows (old ones) contain 
>integers and others (new ones) contain text. SQLite is fine with this, 
>but your client software might not be prepared to deal with it. Some 
>comparisons might behave in surprising ways.

I imagine that in such case, the best bet is to run a "refresh all" 
procedure, updating each row identically, just to have the new affinity 
take effect.


Beside the obvious update with every changed column mentionned,

 update tbl set col1 = (select col1 from tbl y where y.rowid = 
tbl.rowid),
...
coln = (select coln from tbl y where y.rowid = 
tbl.rowid);

do you think of a easier way?



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Column types "safe" changes

2010-03-10 Thread Igor Tandetnik
Max Vlasov  wrote:
> As I recall sqlite probably doesn't case about string types included
> in the CREATE TABLE field list, so TEXT,  VARCHAR, VARCHAR(200) are
> identical from its point of view. Today I needed to increase the
> number of chars in VARCHAR statement since the library that uses
> sqlite actually does care about the value. So I did it with
> writable_schema pragma temporary change. Everything worked but just
> wondering, what kind of changes are safe if it is absolutely
> necessary?

Basically, any changes that don't affect the interpretation of bits already 
present in the database file.

> I suppose the order of fields and the presence of every
> one of them is absolutely necessary, but what about types changes
> like moving from INTEGER to TEXT?

Should be safe, unless there is an index involving the column. Column affinity 
affects comparisons, so the existing sorting order may be wrong for the new 
affinity.

And, of course, you'll have a table where some rows (old ones) contain integers 
and others (new ones) contain text. SQLite is fine with this, but your client 
software might not be prepared to deal with it. Some comparisons might behave 
in surprising ways.

Igor Tandetnik


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Column types "safe" changes

2010-03-10 Thread Max Vlasov
As I recall sqlite probably doesn't case about string types included in the
CREATE TABLE field list, so TEXT,  VARCHAR, VARCHAR(200) are identical from
its point of view. Today I needed to increase the number of chars in VARCHAR
statement since the library that uses sqlite actually does care about the
value. So I did it with writable_schema pragma temporary change. Everything
worked but just wondering, what kind of changes are safe if it is absolutely
necessary? I suppose the order of fields and the presence of every one of
them is absolutely necessary, but what about types changes like moving from
INTEGER to TEXT? Also is it possible to add to sqlite a limited ALTER TABLE
.. MODIFY support that could wrap all known "safe" changes and invoking
errors on all "unsafe" ones?

Max
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23

2010-03-10 Thread D. Richard Hipp

On Mar 10, 2010, at 12:54 AM, Melton Low wrote:

> I just tried to build 3.6.23 on a PPC Mac running OS X 10.4.

Please try adding SQLITE_ENABLE_LOCKING_STYLE=0 to the compiler options.

>
>>
>> I got an undefined symbol error and the make aborted.
>
> /bin/sh ./libtool --tag=CC --mode=link gcc -DSQLITE_THREADSAFE=1
> -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2   -o libsqlite3.la  
> -rpath
> /usr/local/lib -no-undefined -version-info 8:6:8 sqlite3.lo
> gcc -dynamiclib  -o .libs/libsqlite3.0.8.6.dylib  .libs/sqlite3.o
> -install_name  /usr/local/lib/libsqlite3.0.dylib - 
> compatibility_version 9
> -current_version 9.6
> ld: Undefined symbols:
> _gethostuuid
> /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/libtool: internal link  
> edit
> command failed
> make: *** [libsqlite3.la] Error 1
>
> I have attached the full configure and make output as an attachment.
>
> Your help would be appreciated.
>
> Mel
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp
d...@hwaci.com



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23 - date.c

2010-03-10 Thread Israel Lins Albuquerque
My apologies everybody. I'm wrong. 

forget what I said. 

-- 

Atenciosamente, 

Israel Lins Albuquerque 
Desenvolvimento 
Polibrás Brasil Software Ltda. 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23 - date.c

2010-03-10 Thread Paul Corke
On 10 March 2010 13:44, Israel Lins Albuquerque wrote:

> previous is the 3.6.22 and current is 3.6.23!

I think you have them the wrong way round...

head -3 sqlite3.c |tail -1 && grep "STR_FUNCTION(current_timestamp"
sqlite3.c

** version 3.6.23.  By combining all the individual C code files into
this
STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d %H:%M:%S", 0,
currentTimeFunc),


Paul.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23 - date.c

2010-03-10 Thread Israel Lins Albuquerque
previous is the 3.6.22 and current is 3.6.23! 

The sqlite site says: 
'For CURRENT_TIME, the format is HH:MM:SS. For CURRENT_DATE, -MM-DD. The 
format for CURRENT_TIMESTAMP is "-MM-DD HH:MM:SS".' 

And looks for me this are changed to: 
For CURRENT_TIMESTAMP, -MM-DD. The format for CURRENT_DATE is "-MM-DD 
HH:MM:SS" 


- Mensagem original - 
De: "D. Richard Hipp"  
Para: "General Discussion of SQLite Database"  
Enviadas: Quarta-feira, 10 de Março de 2010 10:36:15 
Assunto: Re: [sqlite] SQLite version 3.6.23 - date.c 


On Mar 10, 2010, at 7:36 AM, Israel Lins Albuquerque wrote: 

> In this new version: 
> 
> 
> at file date.c line 1095 are changed? Why? 
> 
> previous version 
> STR_FUNCTION(current_date, 0, "%Y-%m-%d", 0, currentTimeFunc), 
> STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d %H:%M:%S", 0, 
> currentTimeFunc), 
> 
> new version 
> STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d", 0, currentTimeFunc), 
> STR_FUNCTION(current_date, 0, "%Y-%m-%d %H:%M:%S", 0, 
> currentTimeFunc), 
> 
> I fink this is a problem because: 
> SELECT CURRENT_DATE will return 2010-03-10 09:34:55 
> SELECT CURRENT_TIMESTAMP will return 2010-03-10 
> 
> Are this correct? 

I think you have it backwards. What you have labeled as "previous 
version" above is what the current code looks like and your "current 
version" is what it used to look like. See 
http://www.sqlite.org/src/ci/eb98265b59 
for a diff of the change. This was a bug fix. 

The code in question only comes into play when you compile with 
SQLITE_OMIT_DATETIME_FUNCS and so it doesn't matter for most people. 
We didn't discover the problem until recently when we were adding some 
tests that make use of SQLITE_OMIT_DATETIME_FUNCS. 


> 
> 
> Regards , 
> 
> Israel Lins Albuquerque 
> Developer 
> Polibrás Brasil Software Ltda. 
> 
> 
> ___ 
> sqlite-users mailing list 
> sqlite-users@sqlite.org 
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

D. Richard Hipp 
d...@hwaci.com 



___ 
sqlite-users mailing list 
sqlite-users@sqlite.org 
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 


-- 

Atenciosamente, 

Israel Lins Albuquerque 
Desenvolvimento 
Polibrás Brasil Software Ltda. 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23 - date.c

2010-03-10 Thread Israel Lins Albuquerque
previous is the 3.6.22 and current is 3.6.23! 

The sqlite site says: 
'For CURRENT_TIME, the format is HH:MM:SS. For CURRENT_DATE, -MM-DD. The 
format for CURRENT_TIMESTAMP is "-MM-DD HH:MM:SS".' 

And looks for me this are changed to: 
For CURRENT_DATE, CURRENT_TIMESTAMP. The format for -MM-DD is "-MM-DD 
HH:MM:SS". 

- Mensagem original - 
De: "D. Richard Hipp"  
Para: "General Discussion of SQLite Database"  
Enviadas: Quarta-feira, 10 de Março de 2010 10:36:15 
Assunto: Re: [sqlite] SQLite version 3.6.23 - date.c 


On Mar 10, 2010, at 7:36 AM, Israel Lins Albuquerque wrote: 

> In this new version: 
> 
> 
> at file date.c line 1095 are changed? Why? 
> 
> previous version 
> STR_FUNCTION(current_date, 0, "%Y-%m-%d", 0, currentTimeFunc), 
> STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d %H:%M:%S", 0, 
> currentTimeFunc), 
> 
> new version 
> STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d", 0, currentTimeFunc), 
> STR_FUNCTION(current_date, 0, "%Y-%m-%d %H:%M:%S", 0, 
> currentTimeFunc), 
> 
> I fink this is a problem because: 
> SELECT CURRENT_DATE will return 2010-03-10 09:34:55 
> SELECT CURRENT_TIMESTAMP will return 2010-03-10 
> 
> Are this correct? 

I think you have it backwards. What you have labeled as "previous 
version" above is what the current code looks like and your "current 
version" is what it used to look like. See 
http://www.sqlite.org/src/ci/eb98265b59 
for a diff of the change. This was a bug fix. 

The code in question only comes into play when you compile with 
SQLITE_OMIT_DATETIME_FUNCS and so it doesn't matter for most people. 
We didn't discover the problem until recently when we were adding some 
tests that make use of SQLITE_OMIT_DATETIME_FUNCS. 


> 
> 
> Regards , 
> 
> Israel Lins Albuquerque 
> Developer 
> Polibrás Brasil Software Ltda. 
> 
> 
> ___ 
> sqlite-users mailing list 
> sqlite-users@sqlite.org 
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

D. Richard Hipp 
d...@hwaci.com 



___ 
sqlite-users mailing list 
sqlite-users@sqlite.org 
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 


-- 

Atenciosamente, 

Israel Lins Albuquerque 
Desenvolvimento 
Polibrás Brasil Software Ltda. 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23 - date.c

2010-03-10 Thread D. Richard Hipp

On Mar 10, 2010, at 7:36 AM, Israel Lins Albuquerque wrote:

> In this new version:
>
>
> at file date.c line 1095 are changed? Why?
>
> previous version
> STR_FUNCTION(current_date, 0, "%Y-%m-%d", 0, currentTimeFunc),
> STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d %H:%M:%S", 0,  
> currentTimeFunc),
>
> new version
> STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d", 0, currentTimeFunc),
> STR_FUNCTION(current_date, 0, "%Y-%m-%d %H:%M:%S", 0,  
> currentTimeFunc),
>
> I fink this is a problem because:
> SELECT CURRENT_DATE will return 2010-03-10 09:34:55
> SELECT CURRENT_TIMESTAMP will return 2010-03-10
>
> Are this correct?

I think you have it backwards.  What you have labeled as "previous  
version" above is what the current code looks like and your "current  
version" is what it used to look like.  See 
http://www.sqlite.org/src/ci/eb98265b59 
  for a diff of the change. This was a bug fix.

The code in question only comes into play when you compile with  
SQLITE_OMIT_DATETIME_FUNCS and so it doesn't matter for most people.   
We didn't discover the problem until recently when we were adding some  
tests that make use of SQLITE_OMIT_DATETIME_FUNCS.


>
>
> Regards ,
>
> Israel Lins Albuquerque
> Developer
> Polibrás Brasil Software Ltda.
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp
d...@hwaci.com



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite

2010-03-10 Thread D. Richard Hipp

On Mar 10, 2010, at 1:44 AM, DbSchema Support wrote:

> Hello,
>
> Here is Roberto from DbSchema.
> Is it possible with Sqlite to add constraints using ALTER TABLE ... ?
> This would be required since not allways the Foreign keys are  
> specified when creating the table.
> I'm looking forward for an reply,
>

No. The ALTER TABLE command in SQLite only supports ALTER TABLE ...  
ADD COLUMN ... and ALTER TABLE ... RENAME   For any other changes,  
you'll need to (1) rename the original table, (2) create a new table  
in the desired form, (3) copy the content of the original table into  
the new table, and (4) drop the original table.



> Best regards,
> Roberto Luca
> -- http://www.dbschema.com

D. Richard Hipp
d...@hwaci.com



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] JAVA and sqllite.

2010-03-10 Thread D. Richard Hipp

On Mar 10, 2010, at 4:04 AM, Fredrik Svensson wrote:

> Hi!
>
> I would like to use sqllite in my java project but to my surprise i  
> see no java support?
>
> Is there a away to use sqllite in java?

There are about a dozen different solutions.  Please do a web search  
for "java sqlite" or "jdbc sqlite" to get a list.

>
> Many thanks.
>
> //F.

D. Richard Hipp
d...@hwaci.com



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] About Sqlite Virtual Table

2010-03-10 Thread D. Richard Hipp
Your question has been forwarded to the sqlite-users@sqlite.org  
mailing list.

On Mar 10, 2010, at 4:29 AM, bibo lv wrote:

> Hi:
> I use sqlite as an open source in my software。When virtual  
> table is used,
> it is not the same as 'real table'. For example the sql :
>  "select * from (select * from table1 where obj = 'a'),  (select *  
> from table2 where obj = 'b')"
> when table1 and table2 are real tables, the result shows as we  
> expect, unfortunately when
> they are virtual tables using fts3 to create, the  result is not  
> right.
>Further more, when i debug fts3 with sql --
> 1."select * from virtual_table where a = ''1' and b ='2'"
> 2."select * from virtual_table where a = ''1' or b ='2'"
>  i can not fetch the values of a and b using 1 but fail using 2 in  
> xFilter.
> Can you tell me how can i deal with the problems.

D. Richard Hipp
d...@hwaci.com



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23 - date.c

2010-03-10 Thread Wilson, Ronald
> In this new version:
> 
> 
> at file date.c line 1095 are changed? Why?
> 
> previous version
> STR_FUNCTION(current_date, 0, "%Y-%m-%d", 0, currentTimeFunc),
> STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d %H:%M:%S", 0,
> currentTimeFunc),
> 
> new version
> STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d", 0, currentTimeFunc),
> STR_FUNCTION(current_date, 0, "%Y-%m-%d %H:%M:%S", 0, currentTimeFunc),
> 
> I fink this is a problem because:
> SELECT CURRENT_DATE will return 2010-03-10 09:34:55
> SELECT CURRENT_TIMESTAMP will return 2010-03-10
> 
> Are this correct?
> 
> 
> Regards ,
> 
> Israel Lins Albuquerque
> Developer
> Polibrás Brasil Software Ltda.

Looks like that was fixed in January:

http://www.sqlite.org/src/artifact/485a4409a3

RW

Ron Wilson, Engineering Project Lead
(o) 434.455.6453, (m) 434.851.1612, www.harris.com

HARRIS CORPORATION   |   RF Communications Division assuredcommunications™
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Question about lemon

2010-03-10 Thread Andy Gibbs

Hello,
Is it alright to ask a quick question about the lemon parser in this mailing 
list, or is there a dedicated one which I should post this to instead?
I'm using lemon to create a parser for a simple c/basic-like grammar, and have 
among other rules, the following defined (I've trimmed it down to what I 
believe are the important bits for this email, so hopefully its all there):
cmd   ::= WHILE expr DO cmd_list END.cmd   ::= CASE case_list END.cmd   
::= SET set_list.cmd_list  ::= cmd_list cmd SEMI.cmd_list  ::= cmd 
SEMI.case_list ::= case_list case_cond cmd_list.case_list ::= case_cond 
cmd_list.case_cond ::= WHEN expr THEN.case_cond ::= ELSE.set_list  ::= set_list 
COMMA set_item.set_list  ::= set_item.set_item  ::= ID ASSIGN expr.
This in itself works correctly, parsing such code as...
SET a := 0;WHILE a < 12 DO  some_other_statement;  CASE WHEN a = 5 THEN
another_statement;yet_another_statement;  WHEN a = 11 THENdo_something; 
 END;  SET a := a+1;END;
However, I would like to be able to add the rule:
cmd ::= set_item.
so that the "SET" keyword becomes optional in the above code (i.e. so that I 
can write "a := 0;" instead of "SET a := 0;").  When I do this however, the 
parser then fails to parse CASE constructs.
I believe I know where the problem lies: I am using the %fallback directive 
which includes a number of keywords that fallback to "ID", and in this list is 
the "END" keyword.  Ideally I would like to leave the fallback list as it is, 
if possible, and in fact I'd much rather not add the additional rule than 
change this!
What interests me is that the WHILE construct still parses correctly.  An 
output from the parser trace gives the following:
...Stack: WHILE expr DO cmd SEMIInput ENDReduce [cmd_list ::= cmd SEMI].Shift 
8Stack: WHILE expr DO cmd_list ENDInput SEMIReduce [cmd ::= WHILE expr DO 
cmd_list END].Shift 410Stack: cmdShift 515Stack: cmd SEMI...
But with the CASE construct, I get:
...Stack: CASE case_list case_cond cmd SEMIInput ENDReduce [cmd_list ::= cmd 
SEMI].Shift 10Stack: CASE case_list case_cond cmd_listFALLBACK END => IDShift 
713Stack: CASE case_list case_cond cmd_list ENDInput SEMISyntax error!
My understanding is that it simply isn't able to reduce "CASE case_list 
case_cond cmd_list END" to "CASE case_list END" and then "cmd" and so instead 
takes "END" to be the left-hand-side of the "set_item" rule as a continuation 
of "cmd_list", gets a semi-colon as the next character which according to that 
rule would be a syntax error.
My question -- sorry this is such a long post -- is, what is it about the 
grammar for WHILE which allows it to work, and CASE that causes it to fail?  It 
is because there is an extra "list" level in the grammar ("case_list" -> 
"cmd_list", instead of just "cmd_list")?  Is there any way I can change the 
grammar to do what I hope to do, or is this a limitation of lemon?  I've tried 
adding a rule "cmd ::= CASE case_cond cmd_list END" but this causes a parsing 
conflict error message in lemon. I've also had a look into the lemon source 
code to see if I could find an answer there, but I'm afraid its engineering 
brilliance is beyond me!
Thank you very much for any help that can be offered.
Andy  
_
Do you have a story that started on Hotmail? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.6.23 - date.c

2010-03-10 Thread Israel Lins Albuquerque
In this new version: 


at file date.c line 1095 are changed? Why? 

previous version 
STR_FUNCTION(current_date, 0, "%Y-%m-%d", 0, currentTimeFunc), 
STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d %H:%M:%S", 0, currentTimeFunc), 

new version 
STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d", 0, currentTimeFunc), 
STR_FUNCTION(current_date, 0, "%Y-%m-%d %H:%M:%S", 0, currentTimeFunc), 

I fink this is a problem because: 
SELECT CURRENT_DATE will return 2010-03-10 09:34:55 
SELECT CURRENT_TIMESTAMP will return 2010-03-10 

Are this correct? 


Regards , 

Israel Lins Albuquerque 
Developer 
Polibrás Brasil Software Ltda. 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] why SQLITE_BUSY when read the database

2010-03-10 Thread a1rex
>Do The words mean that while one process is writing the database other

>processes could not read the database at the same time?

The reader fails since it cannot obtain SHARED lock required for 
reading.
It cannot obtain that lock since the writer already 
managed to obtain PENDING or EXCLUSIVE lock.



  __
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  
Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] why SQLITE_BUSY when read the database

2010-03-10 Thread a1rex


>Do The words mean that while one process is writing the database other
>processes could not read the database at the same time?

In short:: YES


  __
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot 
with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail 
today or register for free at http://mail.yahoo.ca
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] why SQLITE_BUSY when read the database

2010-03-10 Thread liubin liu

why SQLITE_BUSY when read the database

My application suffered a problem that sqlite3_step(*) of SELECT returns
SQLITE_BUSY.

I know "Multiple processes can be doing a SELECT at the same time. But only
one process can be making changes to the database at any moment in time,
however." from the sqlite3's faq in the link
http://www.sqlite.org/faq.html#q5";.

Do The words mean that while one process is writing the database other
processes could not read the database at the same time?
-- 
View this message in context: 
http://old.nabble.com/why-SQLITE_BUSY-when-read-the-database-tp27848863p27848863.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] trademark issue? - (was Re: Announcing the Madis project)

2010-03-10 Thread Darren Duncan
Dennis Cote wrote:
> On 10-03-09 8:47 PM, Darren Duncan wrote:
>> (Incidentally, I *have* registered my trademark.  But that is a non-issue 
>> here.)
>>
> Darren,
> 
> Aren't you required to put the registered trademark symbol, ®, on each 
> use of your trademarked name or logo? I didn't see it (or the ™symbol 
> for an unregistered trademark for that matter) on your website, so I 
> assumed you hadn't registered the trademark.
> 
> Dennis Cote

As far as I know, I'm not *required* to use the (R) symbol, but rather I am 
simply *allowed* to do so.  Likewise with the (TM) symbol.

If you know otherwise that displaying the symbol is required, please give a url.

I figured that simply declaring:

   MULDIS and MULDIS MULTIVERSE OF DISCOURSE are trademarks of Muldis Data 
Systems Inc.

... in my website footer is sufficient to get the point across, that I have an 
important investment in the terms.

In fact, using that specific text was suggested to me by the trademark lawyer I 
used.

I went and registered for extra protection, but common law protection also goes 
a long way by itself, so it didn't seem important to specify registration in my 
notices by default.

Anyway, this is off-topic for the SQLite list, so I suggest writing me in 
private if you wish to continue discussing it, unless you have some reason to 
say so on the list instead.

Especially since I'm not pursuing MADIS as a concern and have closed that case.

-- Darren Duncan
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users