Re: [sqlite] Bug Report: DateTime incorrect for Windows
Shane Harrelson writes: > ... > I suspect that one of these "quirks" in your build environment is being > exposed by the code in winCurrentTime().Perhaps you could debug through > the code and find where the calculations are going wrong? In this way we > could provide more help. > Shane, I apologize for my quick snap response. I have debugged the code and have identified what is happening. The calculation in my environment results in 0 (zero) for this: static const sqlite3_int64 max32BitValue = (sqlite3_int64)20 + (sqlite3_int64)20 + (sqlite3_int64)294967296; Which breaks all of the following datetime calculations. When compiled with the type sqlite3_uint64 then it works correctly. I am working on a much simpler winCurrentTime solution but I'm stilling creating all test cases to verify the algorithm before posting. 4eanlss ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Maybe just a Question
Ray Irvine wrote: > I have found the following: > > BEGIN; UPDATE entry SET Spinnaker="No" ,Singlehand="Doublehand" > ,Doublehand="Third" ,Multi="Multihull" ,Furler=" " WHERE ROWID="45"; > COMMIT In SQL, string literals should be enclosed in single quotes. Column and table names may be enclosed in double quotes (double quotes are required if the column name is not a valid identifier, optional otherwise). As an extension, SQLite treats a string in double quotes as a literal if it cannot find a matching column or table name. Thus, in your statement, "Doublehand" represents the column entry.Doublehand - not a string literal 'Doublehand'. I strongly suggest you get into the habit of using single quotes for string literals, and using double quotes only in those very rare cases when they are actually required. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Maybe just a Question
I have found the following: BEGIN; UPDATE entry SET Spinnaker="No" ,Singlehand="Doublehand" ,Doublehand="Third" ,Multi="Multihull" ,Furler=" " WHERE ROWID="45"; COMMIT Results in the value of the column Singlehand to be set to the current value on the column Doublehand for this ROWID. Experiment show that when the value of the Column (say A) is the same as the name of another column (say B), the first column (A) is set to the current value of the second (B). THis is all being run on an IMAC using MACOS X version 10.6.2. I have not run these test on another a system. Is there something that I am missing? Thank you for your assistance. Best Regards, Ray Ray Irvine Crew's Nest - #1383 c34irvine1...@comcast.net http://www.flickr.com/photos/crews_nest/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] WIKI login
On Feb 25, 2010, at 4:08 PM, Steve Topov wrote: > I wanted to update information about our products SQLPro - > http://www.vive.net/products/sqlpro.htm and DataPro - > http://www.vive.net/products/datapro.htm in ManagementTools and > ConverterTools. Fair enough. I've reenable access to the CVSTrac wiki at http://www.sqlite.org/cvstrac/wiki 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] WIKI login
I wanted to update information about our products SQLPro - http://www.vive.net/products/sqlpro.htm and DataPro - http://www.vive.net/products/datapro.htm in ManagementTools and ConverterTools. Steve Topov Vive Corp. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of D. Richard Hipp Sent: Thursday, February 25, 2010 12:34 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] WIKI login On Feb 25, 2010, at 3:29 PM, Steve Topov wrote: > How can I get User name and password to login to Wiki? We don't have a open wiki right now. The old CVSTrac wiki at http://www.sqlite.org/cvstrac/wiki is no longer monitored and was starting to pick up spam, so I turned off write permission on it for everyone. We have never opened up the Fossil wiki at http://www.sqlite.org/src/wiki for anonymous contribution, preferring instead to do all our own documentation. What did you want to write about? > > Steve Topov > ___ > 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] WIKI login
On Feb 25, 2010, at 3:29 PM, Steve Topov wrote: > How can I get User name and password to login to Wiki? We don't have a open wiki right now. The old CVSTrac wiki at http://www.sqlite.org/cvstrac/wiki is no longer monitored and was starting to pick up spam, so I turned off write permission on it for everyone. We have never opened up the Fossil wiki at http://www.sqlite.org/src/wiki for anonymous contribution, preferring instead to do all our own documentation. What did you want to write about? > > Steve Topov > ___ > 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] WIKI login
How can I get User name and password to login to Wiki? Steve Topov ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Sqlite Step Strange Results
On Feb 25, 2010, at 10:19 AM, Rob Read wrote: > We are using sqlite in a low memory environment and as such have > been using > the MEMSYS5 memory allocator. This has been working great to confine > our > memory usage to the buffer that gets passed during start time. I have > recently run into some strange results while doing a step to insert > a blob > into the database. If I set my cache size, using the pragma, to > 1500 then > the step fails with SQLITE_NOMEM, but if I do this same process and > decrease > the cache size to 1000 then the step succeeds. This might sound like > a easy > problem to fix in that my page cache is taking up the memory that > the step > needs to complete the insert, but if I check the memory usage by > calling > sqlite3_memory_used(), in both situations I have plenty of memory > available > to complete the transfer. If anyone could shed some light on this > issue I > would appreciate it. > Probably this is due to memory fragmentation. In a low-memory environment, you should use sqlite3_config(SQLITE_CONFIG_PAGECACHE,...) to set up a separate buffer for use by the page cache. The page cache is the primary memory user, so allocate most of your memory budget to it. And since all page cache allocations are the same size, you won't get fragmentation there. You can normally get by with much less memory for the general-purpose heap, depending on how many prepared statements you are holding at once and how complex your schema is. > > > Robert Read > > Lead Software Engineer > > Saltillo Corporation > > > > > > ___ > 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] Prepared statements and locking
> So is such behavior documented and can be used or should I still avoid > keeping such "live" statements in db-shared enviroment? It's documented that sqlite3_finalize AND sqlite3_reset release all locks acquired by the statement. So after resetting the statement you can keep it as long as you want, it won't block out any other process from accessing the database. Pavel On Thu, Feb 25, 2010 at 10:35 AM, Max Vlasov wrote: > Hi, > > I thought that prepared statements in non-finalized state isn't compatible > with locking mechanism in db sharing environment i.e. if I want for any of > several processes not to hang waiting for EXCLUSIVE lock none of others > should use non-finalized prepared statements. But today I found that they > can coexist, but sqlite3_reset should be called (even if I'm not planning > new data reading). My simple test confirmed this: a writing process waited > getting SQLTE_BUSY results indefinitely and when another process called > sqlite3_reset (I'm sure this is the only sqlite api call performed fired by > button press), the first one successfully ended writing. > > So is such behavior documented and can be used or should I still avoid > keeping such "live" statements in db-shared enviroment? > > Platform: Windows > > Thanks > > Max > ___ > 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] Sqlite Step Strange Results
Could it be because of fragmentation issues? When you allow more cache pages to be allocated you allow more fragmentation to be introduced. And although in total there could be enough memory available there could still be no solid block of sufficient size available. >From the comment in mem5.c: ** Let n be the size of the largest allocation divided by the minimum ** allocation size (after rounding all sizes up to a power of 2.) Let M ** be the maximum amount of memory ever outstanding at one time. Let ** N be the total amount of memory available for allocation. Robson ** proved that this memory allocator will never breakdown due to ** fragmentation as long as the following constraint holds: ** ** N >= M*(1 + log2(n)/2) - n + 1 ** ** The sqlite3_status() logic tracks the maximum values of n and M so ** that an application can, at any time, verify this constraint. Pavel On Thu, Feb 25, 2010 at 10:19 AM, Rob Read wrote: > We are using sqlite in a low memory environment and as such have been using > the MEMSYS5 memory allocator. This has been working great to confine our > memory usage to the buffer that gets passed during start time. I have > recently run into some strange results while doing a step to insert a blob > into the database. If I set my cache size, using the pragma, to 1500 then > the step fails with SQLITE_NOMEM, but if I do this same process and decrease > the cache size to 1000 then the step succeeds. This might sound like a easy > problem to fix in that my page cache is taking up the memory that the step > needs to complete the insert, but if I check the memory usage by calling > sqlite3_memory_used(), in both situations I have plenty of memory available > to complete the transfer. If anyone could shed some light on this issue I > would appreciate it. > > > > Robert Read > > Lead Software Engineer > > Saltillo Corporation > > > > > > ___ > 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
[sqlite] Prepared statements and locking
Hi, I thought that prepared statements in non-finalized state isn't compatible with locking mechanism in db sharing environment i.e. if I want for any of several processes not to hang waiting for EXCLUSIVE lock none of others should use non-finalized prepared statements. But today I found that they can coexist, but sqlite3_reset should be called (even if I'm not planning new data reading). My simple test confirmed this: a writing process waited getting SQLTE_BUSY results indefinitely and when another process called sqlite3_reset (I'm sure this is the only sqlite api call performed fired by button press), the first one successfully ended writing. So is such behavior documented and can be used or should I still avoid keeping such "live" statements in db-shared enviroment? Platform: Windows Thanks Max ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Sqlite Step Strange Results
We are using sqlite in a low memory environment and as such have been using the MEMSYS5 memory allocator. This has been working great to confine our memory usage to the buffer that gets passed during start time. I have recently run into some strange results while doing a step to insert a blob into the database. If I set my cache size, using the pragma, to 1500 then the step fails with SQLITE_NOMEM, but if I do this same process and decrease the cache size to 1000 then the step succeeds. This might sound like a easy problem to fix in that my page cache is taking up the memory that the step needs to complete the insert, but if I check the memory usage by calling sqlite3_memory_used(), in both situations I have plenty of memory available to complete the transfer. If anyone could shed some light on this issue I would appreciate it. Robert Read Lead Software Engineer Saltillo Corporation ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] dynamic typing misunderstanding
On Wed, Feb 24, 2010 at 5:54 PM, eternelmangekyosharingan wrote: > I'm sorry but I don't get your answer. > Can you provide further explanations, please ? Well, it is entirely possible that I have not understood your question, and from Igor and Dan's answers, it seems even more so that I am on the wrong track understanding what you are asking. My point was, why should sqlite3 return 'text' as typeof(a) when you are doing the following? insert into t1 values(123456789.123456789); Per SQL rules, text has to be quoted in single-quotes, else it is interpreted as a column name or an expression. sqlite> create table t1(a); sqlite> insert into t1 values (123); sqlite> insert into t1 values (231.3453); sqlite> insert into t1 values ('231.4325'); sqlite> insert into t1 values (two thirty one); SQL error: near "thirty": syntax error sqlite> insert into t1 values (two); SQL error: no such column: two sqlite> select * from t1; a -- 123 231.3453 231.4325 sqlite> select typeof(a), a from t1; typeof(a) a -- -- integer 123 real231.3453 text231.4325 The above behavior is so basic and consistent with both how SQL and sqlite behave that I don't understand where your query is coming from... given that folks much more competent than I have replied with all manner of complex answers, actually now I am eager to know what exactly you are asking. It will help me understand what I misunderstood about your question. > > On Thu, Feb 25, 2010 at 12:40 AM, P Kishor wrote: > >> On Wed, Feb 24, 2010 at 5:22 PM, eternelmangekyosharingan >> wrote: >> > Hello all, >> > >> > I create the following table: >> > sqlite> create table t1(a); >> > sqlite> insert into t1 values(123456789.123456789); >> > >> > I ran the following commands: >> > sqlite> select * from t1; >> > 123456789.123457 >> > sqlite> select typeof(a) from t1; >> > real >> > >> > What I expected to get is: >> > sqlite> select * from t1; >> > 123456789.123456789 >> > sqlite> select typeof(a) from t1; >> > text >> > >> > since the conversion of 123456789.123456789 to real induce some loss. >> > >> > >> > Can someone help me out to understand the dynamic typing of sqlite ? >> > >> >> >> sqlite> create table t1(a); >> sqlite> insert into t1 values ('123456789.123456789'); >> sqlite> select * from t1; >> a >> --- >> 123456789.123456789 >> sqlite> select typeof(a) from t1; >> typeof(a) >> -- >> text >> sqlite> insert into t1 values (123456789.123456789); >> sqlite> select * from t1; >> a >> --- >> 123456789.123456789 >> 123456789.123457 >> sqlite> select typeof(a) from t1; >> typeof(a) >> -- >> text >> real >> sqlite> >> >> >> -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu --- Assertions are politics; backing up assertions with evidence is science === ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"
On 2/24/10 19:19 , "D. Richard Hipp" wrote: > > On Feb 24, 2010, at 1:12 PM, Mike Shal wrote: >>> >>> This compiler is llvm. Check it out at http://llvm.org >>> You can test for this mistake on the demo page at http://llvm.org/ >>> demo >>> > > > FWIW, there are currently two places in SQLite where we have had to > complicate the code in order to work around bugs in LLVM. > > D. Richard Hipp > d...@hwaci.com Yes LLVM and especially Clang are rather young. It's not surprising they do have bugs. Hopefully, the issues that you encountered with SQLite will let them fix those bugs and improve. Overall however, I am very impressed by what the LLVM has been able to accomplish in just a a few years. For example, LLVM is behind: - the latest Objective C 2.0 Mac OS X compiler - the Arm compiler with Objective-C support for the iPhone - The MacRuby interpreter and native compiler for the Ruby language - The Smalltalk system part of the Étoilé project. The main lacking point (for me) now is C++ support. It's planned for the end of this year. I hope they can make it. Jean-Denis ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"
On 2/24/10 19:12 , "Mike Shal" wrote: > On 2/24/10, Jean-Denis Muys wrote: >> >> On 2/24/10 9:36 , "Simon Davies" wrote: >> >>> Rogue semicolon on line >>> if( sqlite3_close( db ) != SQLITE_OK ); >>> >>> Regards, >>> Simon >> >> >> I have been bitten by such silly mistakes often enough! >> >> This is why I have switched to a compiler with sanity checks. On this line >> of code, it warns: >> >> "if statement has empty body" >> >> This compiler is llvm. Check it out at http://llvm.org >> You can test for this mistake on the demo page at http://llvm.org/demo >> > > What compiler were you using before? Gcc warns about this too, though > you have to explicitly enable the warning using -W (or -Wempty-body > for just that particular warning). > > I suppose you could argue whether or not it's right to have that > warning on by default, but I've found warnings are generally a matter > of personal preference. If you don't make spurious semicolon mistakes, > you probably don't need that warning on. I make tons of such mistakes, > so I use a variant of the BDECFLAGS. That helps catch most of the > stupid things I do :) > I yes I switched from GCC, but not for that particular warning. The three features of LLVM/Clang technology that won me over are the generally much better error messages, link-time optimization and the static code analyzer. In any case, though I did not make any claim regarding its handling of this issue, I stand corrected on GCC. And yes I do try to keep warnings on as much as possible. Jean-Denis ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] dynamic typing misunderstanding
Igor Tandetnik wrote: > eternelmangekyosharingan > > wrote: > >> I create the following table: >> sqlite> create table t1(a); >> sqlite> insert into t1 values(123456789.123456789); >> >> I ran the following commands: >> sqlite> select * from t1; >> 123456789.123457 >> sqlite> select typeof(a) from t1; >> real >> >> What I expected to get is: >> sqlite> select * from t1; >> 123456789.123456789 >> sqlite> select typeof(a) from t1; >> text >> >> since the conversion of 123456789.123456789 to real induce some loss. >> > > http://www.sqlite.org/datatype3.html > For conversions between TEXT and REAL storage classes, SQLite considers the > conversion to be lossless and reversible if the first 15 significant decimal > digits of the number are preserved. > > So no, by SQLite's definition, there is no loss. > That definition doesn't work for denormals: sqlite> CREATE TABLE T (x REAL); sqlite> INSERT INTO T VALUES ('5.12345678901234567890e-324'); sqlite> SELECT x, TYPEOF(x) FROM T; 4.94065645841247e-324|real ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users