Re: [sqlite] Newbie starting off question

2011-09-23 Thread Stephan Beal
brary from many apps. > A tiny expansion to that: someone recently reported a problem when serving a singleton db instance from a DLL (he was getting 2 different instances of the singleton, IIRC), but that's not an sqlite3-specific problem. -- - stephan beal http://wanderinghors

Re: [sqlite] MC/DC coverage explained wrong in the home page?

2011-09-24 Thread Stephan Beal
se undefined behaviour, as described earlier). -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Problem with using WAL journal mode in embedded system (disk I/O error)

2011-09-26 Thread Stephan Beal
say "unlimited", is your db (or the amount of data being queried at one time) anywhere close to the size it gives out? From my (very limited) understanding of mmap(), it uses(?) the same address range as malloc() would [have if mmap() hadn't stolen it]. -- - stephan beal

Re: [sqlite] Still chasing "database schema has changed"

2011-09-26 Thread Stephan Beal
a process is independent of each other. At least that was my experience when i tried it out a few years ago. -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bi

Re: [sqlite] feed "endless" data into sqlite, thru a shell script

2011-09-27 Thread Stephan Beal
a signal is caught or whatever. -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How do you check if a sqlite database is open?

2011-10-04 Thread Stephan Beal
e if it's NULL (which you of course must initialize it to, or else it has an unspecified value). sqlite3 * db = NULL; int rc = sqlite3_open(, ); if(rc) { ... error ... ; sqlite3_close(db); } else { sqlite3 is open } After you close it, assign it to NULL again, and there's your "is ope

Re: [sqlite] Porting a simple logon script to SQLite3 from MySQL

2011-10-05 Thread Stephan Beal
l injection attack" and then read up on PDO::prepare() for how to avoid that problem: http://php.net/manual/en/pdo.prepare.php -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Statement failing

2011-10-08 Thread Stephan Beal
here something I'm obviously doing > wrong? > http://www.php.net/manual/en/pdo.query.php says: Executes an SQL statement, returning a result set as a PDOStatement object "an" is singular, and result set implies a single statement. -- - stephan beal http

Re: [sqlite] Statement failing

2011-10-09 Thread Stephan Beal
; to do just by reading the SQLite C documentation. > Amen. -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Error 14 - cannot open Database

2011-10-09 Thread Stephan Beal
is one. > Some things to try: Can you open the file with the command-line sqlite3 client? Is the file still there? Are the file permissions still correct (readable by your server's user id)? -- - stephan beal http://wanderinghorse.net/home/stephan/ __

Re: [sqlite] load database into memory java applet

2011-10-10 Thread Stephan Beal
t (whereas the version you post is providing the name "memory:", which is not correct). -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to make SQLite run safely on CIFS mounted file system?

2011-10-19 Thread Stephan Beal
On Tue, Oct 18, 2011 at 12:37 PM, Sune Ahlgren <sune_ahlg...@hotmail.com>wrote: > What can I do to make SQLite run safely on CIFS? > Nothing. Even MS Access cannot (or could not way back when i used it) be safely used on SMB/CIFS storage. -- ----- stephan beal http://wanderingho

Re: [sqlite] How to make SQLite run safely on CIFS mounted file system?

2011-10-19 Thread Stephan Beal
that file locking on networked filesystems has, historically speaking, always been problematic. Communicating the locks between separate machines, race conditions, unclean network connection errors, blah blah blah. That goes for all applications, not just databases. -- - stephan beal http://w

Re: [sqlite] How to make SQLite run safely on CIFS mounted file system?

2011-10-19 Thread Stephan Beal
On Wed, Oct 19, 2011 at 9:23 PM, Stephan Beal <sgb...@googlemail.com> wrote: > race conditions, unclean network connection errors, blah blah blah. That > goes for all applications, not just databases. > > And not just for CIFS, but NFS and other networked filesystems as well.

Re: [sqlite] How to make SQLite run safely on CIFS mounted file system?

2011-10-19 Thread Stephan Beal
when locking was enabled, even though it only made a few lock/unlock calls. -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] PHP + SQLite - Issues with update

2011-10-21 Thread Stephan Beal
On Fri, Oct 21, 2011 at 1:05 AM, Prashant Prabhudesai < prashantprabhude...@gmail.com> wrote: > $row = $res->fecth(); > ... After the script exits successfully I inspect the value in the Token column > Are you 100% sure the above command executes correctly? -- -

Re: [sqlite] Segmentation Fault on SQLITE3_exex

2011-10-28 Thread Stephan Beal
;; There's no reason why the overhead of sprintf() should be applied to a string which contains no formatting specifiers. -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.or

Re: [sqlite] Disk I/O Error

2011-11-01 Thread Stephan Beal
ago and someone (don't remember who) pointed out that platforms exist which can return >0 from read() when interrupted. My man page says: POSIX allows a read() that is interrupted after reading some data to return -1 (with errno set to EINTR) or to return the number of bytes already read. --

Re: [sqlite] does sqlite3_reset have a performance impact on queries?

2011-11-02 Thread Stephan Beal
() and s.size() instead of query.str().xxx(). -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] core dump happened in sqlite3_step for 30 statements in BEGIN TRANSACTION executing every 10 Millisecond

2011-11-02 Thread Stephan Beal
you can use std::ostringstream as a replacement for sprintf(): std::ostringstring q; q << "SELECT " << x << " ... "; dbStatements.push_back( q.str() ); -- - stephan beal http://wanderinghorse.net/home/stephan/ _

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Stephan Beal
standard. In any case (undefined or not), calling ostringstream::str() twice there is unnecessary, and downright inefficient if the user's STL does not use CoW (all of them do, AFAIK, but that's an implementation detail clients shouldn't count on). -- - stephan beal http://wanderinghors

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Stephan Beal
On Wed, Nov 2, 2011 at 1:11 PM, Stephan Beal <sgb...@googlemail.com> wrote: > about undefined behaviour is true in that case, but i am 100% convinced > that i've seen that usage cause problems before. Perhaps it was the > compiler in question (one of the MSVC variants) which mad

Re: [sqlite] PHP & SQLite examples

2011-11-14 Thread Stephan Beal
hich sqlite API you want to use. There are 2 or 3 active sqlite APIs for PHP (i personally prefer PDO but others on this list can/will likely recommend other APIs). -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ sqlite-users mailing list

[sqlite] Non-transitive numeric equality

2015-11-05 Thread Stephan Beal
an you could possible want on the reason: http://www.mail-archive.com/sqlite-users at mailinglists.sqlite.org/msg04466.html -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those

[sqlite] field name in UDF

2015-11-06 Thread Stephan Beal
d in, it would sometimes be helpful to > have the associated field (if any) that the value is associated with. > > Is there any way to retrieve that? > UDFs receive expanded/evaluated values, not fields: select quarter(t1.a+t2.a+t3.a+3.0) from t1, t2, t3...; what field would you expect t

[sqlite] field name in UDF

2015-11-06 Thread Stephan Beal
he values resolved by the surrounding evaluation engine. By the same token (no pun intended), in JavaScript: var x = 3; quarter(x); gets only the number 3, not any information about where that 3 comes from or how it was derived. -- - stephan beal http://wanderinghorse.net/home/stephan/ http

[sqlite] field name in UDF

2015-11-07 Thread Stephan Beal
nd users): UDFs are variadic, so you could pass an optional 2nd parameter with any information as a string to the final parameter, e.g.: select quarter(t.a, 't.a'), quarter(4,'four') from t; -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedo

[sqlite] A little light reading

2015-11-08 Thread Stephan Beal
paying attention in the design and/or implementation. That poor guy. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Array or set type or some other indexable data?

2015-11-12 Thread Stephan Beal
ame on > option4_map.name_id=option4_name.name_id \ > ... -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] [AGAIN] SQLite on network share

2015-11-13 Thread Stephan Beal
all MySQL on it and completely bypass the file-sharing problems and corruption which _will_ happen if you try to use sqlite3 on a shared network filesystem. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed bypr

[sqlite] Retrieving the table info fails

2015-11-16 Thread Stephan Beal
struct null not valid Aborted -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Retrieving the table info fails

2015-11-16 Thread Stephan Beal
On Mon, Nov 16, 2015 at 6:42 PM, Stephan Beal wrote: > On Mon, Nov 16, 2015 at 6:11 PM, Igor Korot wrote: > >> The variables referenced are defined as "std::string" and the code is in >> C++. >> > > the std::string(char const *) constructor does not, la

[sqlite] attempt at output with thousands separator via extension

2015-11-23 Thread Stephan Beal
> If I figure out some clever I will share for the benefit of other shell > junkies that like neat easily readable numeric output - all 6 of us :) > i think you mean all 6,0 of you ;). -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freed

[sqlite] Sqlite good on Windows XP but very very slow on Windows Seven

2015-10-17 Thread Stephan Beal
r hypotheses: if you are on the same hardware which was running XP, the hardware might simply be too old to perform well (for anything) on Win7. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed b

[sqlite] SQLite list user phishing Alexa

2015-10-18 Thread Stephan Beal
ut very very slow on Windows Seven", a > post I replied to today. > -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] SQLite list user phishing Alexa

2015-10-18 Thread Stephan Beal
aping the ML archives. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] SQLite list user phishing Alexa

2015-10-18 Thread Stephan Beal
On Sun, Oct 18, 2015 at 12:30 PM, Richard Hipp wrote: > On 10/18/15, Stephan Beal wrote: > > It didn't appear to come directly from the list - i suspect someone is > > scraping the ML archives. > > > > Are the messages you are receiving passing through the sqlit

[sqlite] sqlite 3.8.11 - binary size

2015-10-22 Thread Stephan Beal
> We carefully monitor the size of the compiled SQLite binary. A graph > of that size is shown at > > https://www.sqlite.org/binary-size.jpg > > The 627.4KB for 3.8.11 is within reason, depending on what compiler > you are using. But SQLite has *never* been as small as 44.8 KB. Is > that a

[sqlite] Simple Math Question

2015-10-22 Thread Stephan Beal
esults at a specific precision. See: http://floating-point-gui.de/ the first example of which demonstrates the problem you are seeing. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Any database unique ID across multiple connections ?

2015-09-24 Thread Stephan Beal
have multiple connections to a single :memory: db. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Odd download file names

2015-09-30 Thread Stephan Beal
ce that option works with any fossil CLI commands. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] You may add sha256 checksum for files in the download page?

2016-04-02 Thread Stephan Beal
Does anyone have a good reason why SHA1 is still > needed ? > FWIW: https://en.wikipedia.org/wiki/SHA-2 "Although (as of 2015) no example of a SHA-1 collision has been published yet..." -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Fr

[sqlite] Expecting syntax error on delete

2016-04-10 Thread Stephan Beal
; > $stat = $p->exec($sql); > ('abc' & 'def') does not produce a syntax error: sqlite> select 'abc' & 'def'; 0 so your SQL was well-formed, just not what you wanted. Your IN(...) effectively resolved to IN(0). -- - stephan beal http://wanderinghorse.net/home/stephan/

[sqlite] BUG?

2016-04-22 Thread Stephan Beal
compared to i64. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] BUG?

2016-04-22 Thread Stephan Beal
On Fri, Apr 22, 2016 at 8:43 AM, Clemens Ladisch wrote: > Stephan Beal wrote: > > On Thu, Apr 21, 2016 at 4:12 PM, jrhgame wrote: > >> SELECT julianday('2016-04-15 12:10:10') ==>2457494.00706 > >> SELECT datetime(2457494.00706) ==>2016-04-15 12:1

[sqlite] BUG?

2016-04-22 Thread Stephan Beal
On Fri, Apr 22, 2016 at 9:18 AM, Rowan Worth wrote: > On 22 April 2016 at 14:54, Stephan Beal wrote: > > but i beg to differ that that works in 100% of cases. > > > > Lets see, for a 64-bit float we have 53 bits of significand. The number > ...of ambiguity. Pretty sur

[sqlite] json1 not escaping CRLF characters

2016-02-04 Thread Stephan Beal
-- From: Douglas Crockford To: Stephan Beal Subject: Re: Is escaping of forward slashes required? It is allowed, not required. It is allowed so that JSON can be safely embedded in HTML, which can freak out when seeing strings containing "

[sqlite] json_group_array

2016-02-05 Thread Stephan Beal
ckoverflow.com/questions/30585552/how-to-represent-an-array-with-empty-elements-in-json tl;dr: "jsonlint" also says empty array elements aren't allowed. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only g

[sqlite] How to enter Unicode character?

2016-02-08 Thread Stephan Beal
ogle for "utf8 character tables" and copy/paste them. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] How to enter Unicode character?

2016-02-08 Thread Stephan Beal
; > right? > That's what Unix would do. So... on Windows, probably not ;). -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Fossil sqlite clone problem

2016-02-09 Thread Stephan Beal
e: fossil pull --verily in the past that's helped people reporting problems about a repo silently failing to pull past a certain version. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed by

[sqlite] Fossil sqlite clone problem

2016-02-09 Thread Stephan Beal
On Tue, Feb 9, 2016 at 5:38 PM, Stephan Beal wrote: > fossil pull --verily > > in the past that's helped people reporting problems about a repo silently > failing to pull past a certain version. > OTOH, if that tag is checked out, which your output indicates is the cas

[sqlite] Fossil sqlite clone problem

2016-02-09 Thread Stephan Beal
n that was the newest. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Unicode issue on windows consoles. Was: Version 3.11.0 beta

2016-02-11 Thread Stephan Beal
utf8.c It also takes care of some weird Appleness cases. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Possible error using length on UTF-8 characters

2016-02-17 Thread Stephan Beal
ings do not normally contain NUL characters, the length(X) function will usually return the total number of characters in the string X. For a blob value X, length(X) returns the number of bytes in the blob. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Free

[sqlite] Possible error using length on UTF-8 characters

2016-02-17 Thread Stephan Beal
at, but someone on this list does and will likely answer very soon. (Yes, i'm looking at you, Simon!) -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Possible error using length on UTF-8 characters

2016-02-17 Thread Stephan Beal
you've stored the data as a BLOB, not TEXT. You need to confirm that you haven't stored the field as a blob. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect worl

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
< cal.sql 2016|1|31 2016|2|29 2016|3|31 2016|4|30 2016|5|31 2016|6|30 2016|7|31 2016|8|31 2016|9|30 2016|10|31 2016|11|30 2016|12|31 Obviously still lots to do here. (Again, _please_ don't post spoilers for calendar CTE solutions (in this thread)!) Have fun! -- - stephan beal http://wa

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
o! > > Look at the year 1752 -- you may notice something odd happened that > September. :-) > Yeah, i should have mentioned that i'm simplifying to the range of dates "sometime within my lifetime." Anything else is irrelevant for my presentation ;). -- - stephan beal htt

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
Sunday=7 (instead of 0) because that's just how we roll in Germany.) -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
the first 3 fields used to draw > the graph - play with those parameters for fun. > i wouldn't even know what to do with them :/. > (I hope the mail system don't mess up the format too much...) > Nope - came across loud and clear. -- - stephan beal http://wanderinghorse.net/hom

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
sn't half as problematic as i expected. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
On Thu, Feb 18, 2016 at 9:16 PM, Stephan Beal wrote: > Okay, i've hit a small stump and i'm looking for a hint without giving it > away: > > January and February 2016: > > [stephan at host:~/tmp]$ sqlite3 < cal.sql > 1 2 3 > 4 5 6 7 8 9 10 >

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
26 27 28 Thank you!!! Not half bad, if i may say so :). i will post the complete solution (for a given definition of "solution") once i've cleaned it up notably... and figure out how the last part of it actually works. :/ Look for it over the weekend. Thanks again! --

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
On Thu, Feb 18, 2016 at 9:50 PM, Stephan Beal wrote: > i could do with the \r, but CHAR(10) does indeed do the trick: > withOUT the \r... > > -- > Feb 2016 > 1 2 3 4 5 6 7 > 8 9 10 11 12 13 14 > 15 16 17 18 19 20 21 > 22 23 2

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
On Thu, Feb 18, 2016 at 9:52 PM, Stephan Beal wrote: > -- >> Feb 2016 >> 1 2 3 4 5 6 7 >> 8 9 10 11 12 13 14 >> 15 16 17 18 19 20 21 >> 22 23 24 25 26 27 28 >> >> Thank you!!! >> >> Not half bad

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
On Thu, Feb 18, 2016 at 10:19 PM, Richard Hipp wrote: > On 2/18/16, Stephan Beal wrote: > > > > Thanks again to all for the feedback and suggestions! > > > > After your talk, can we publish your calendar CTE as another example > in the SQLite documentation?

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
On Thu, Feb 18, 2016 at 10:22 PM, Stephan Beal wrote: > On Thu, Feb 18, 2016 at 10:19 PM, Richard Hipp wrote: > >> On 2/18/16, Stephan Beal wrote: >> > >> > Thanks again to all for the feedback and suggestions! >> > >> >> After your talk,

[sqlite] determining is-leap-year in sqlite

2016-02-18 Thread Stephan Beal
On Thu, Feb 18, 2016 at 10:42 PM, Stephan Beal wrote: > Here we go: > > http://fossil.wanderinghorse.net/download/cal.sql > sorry, one more: it was just updated with minor doc improvements and better syntax conformance (i had used a lot of double-quotes simply out of recent scr

[sqlite] determining is-leap-year in sqlite

2016-02-19 Thread Stephan Beal
On Fri, Feb 19, 2016 at 12:36 AM, k wrote: > On 18/02/2016 21:55, Stephan Beal wrote: > >> >>> http://fossil.wanderinghorse.net/download/cal.sql >>> >>> >> Excellent CTE query, thanks, but one question: the query uses > group_concat() and the d

[sqlite] determining is-leap-year in sqlite

2016-02-19 Thread Stephan Beal
On Fri, Feb 19, 2016 at 1:53 AM, Stephan Beal wrote: > It can now optionally mark the current date (but this feature slowed it > down from 'instant' to 'just under a second or so', possibly due to SQL > inefficiencies on my part). > Trimming the list of years from 100 years to no

[sqlite] determining is-leap-year in sqlite

2016-02-19 Thread Stephan Beal
27 > 28 29 > LOL! i needed about 6 hours (and 6 times the code) to do that! Extremely impressive! -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a

[sqlite] User-defined SQL functions

2016-02-21 Thread Stephan Beal
[SQLITE_DETERMINISTIC] flag is recommended where possible. Note that it says within a single statement, not a transaction. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who

[sqlite] MIN/MAX of column loses decltype

2016-02-22 Thread Stephan Beal
ftime() uses them and the Fossil SCM (which hosts sqlite) uses them: https://www.sqlite.org/lang_datefunc.html -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist o

[sqlite] Can SQLite know from the statement string if it is row producing or not?

2016-01-09 Thread Stephan Beal
gt; > I need to know before stepping, but it can do that. > > For a SELECT which returns no rows I presume it returns the number of > columns asked for. It does. i use this in a db abstraction layer to fetch column names without needing to fetch data. -- - stephan beal http://wanderi

[sqlite] hard links and SQLite

2016-01-11 Thread Stephan Beal
ng. :) > sqlite exposes the functionality of fetching a temp file name using its mechanism, but i don't recall at the moment how it's done. A quick google isn't revealing it but i recall using it but finding out that it doesn't work with the :memory: VFS. -- - stephan beal http://wanderinghorse.net/ho

[sqlite] hard links and SQLite

2016-01-11 Thread Stephan Beal
On Mon, Jan 11, 2016 at 7:57 PM, Stephan Beal wrote: > On Mon, Jan 11, 2016 at 7:55 PM, Warren Young wrote: > >> On POSIX systems, you can securely create a temp file that only your user >> can see via the mkstemp(3) C library call. SQLite will happily open the >&g

[sqlite] Database Corrupt While Disk Full

2016-01-14 Thread Stephan Beal
g 3 different error codes (all of them serious). That misuse is what corrupted it. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Database Corrupt While Disk Full

2016-01-14 Thread Stephan Beal
neric recovery strategy aside from throwing the DB away and building it anew. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Database Corrupt While Disk Full

2016-01-14 Thread Stephan Beal
On Thu, Jan 14, 2016 at 2:09 PM, Stephan Beal wrote: > FULL means the drive is full. Most apps can't do much about that. It > generally needs to be resolved by user action - freeing up space. > Alternately, FULL can mean that the current VFS cannot allocate space, even though it's u

[sqlite] .read bug

2016-01-21 Thread Stephan Beal
The problem is that you are using unusual quotes. Use only standard double-quotes for identifiers and single-quotes for strings. Your example uses "fancy" quotes commonly seen in word processors. - stephan Sent from a mobile device, possibly from bed. Please excuse brevity, typos, and

[sqlite] Get X number of random integer numbers between A and B

2016-01-22 Thread Stephan Beal
619|3 380|4 412|5 263|6 563|7 877|8 573|9 468|10 just swap out the 'conf' part with 1000. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] Get X number of random integer numbers between A and B

2016-01-22 Thread Stephan Beal
On Fri, Jan 22, 2016 at 12:22 PM, Stephan Beal wrote: > > > On Fri, Jan 22, 2016 at 12:11 PM, Bart Smissaert > wrote: > >> Say I want 1 random numbers between 100 and 1000 how can I do that >> without >> selecting from a table? >> I know I can do: >

[sqlite] Bug: Successfully committed transaction rolled back after power failure

2016-01-25 Thread Stephan Beal
s. The bookmark database is still completely intact - it > just went backwards in time a little. > Or, alternately, it _never went forward_ in time. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only gua

[sqlite] sqldiff.c : 2 benign warnings in 64 bits builds

2016-01-26 Thread Stephan Beal
way. > fwiw, in case this matters: size_t has an unspecified size and it's not in C89. It's defined by C99 in stddef.h -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insis

[sqlite] sqldiff.c : 2 benign warnings in 64 bits builds

2016-01-26 Thread Stephan Beal
On Tue, Jan 26, 2016 at 6:40 PM, Scott Robison wrote: > On Tue, Jan 26, 2016 at 8:21 AM, Stephan Beal > wrote: > > fwiw, in case this matters: size_t has an unspecified size and it's not > in > > C89. It's defined by C99 in stddef.h > > > > size_t (and ptrdiff_t

[sqlite] Random-access sequences

2016-03-01 Thread Stephan Beal
51616 or about 1.8e+19). This limit is unreachable since the maximum database size of 140 terabytes will be reached first. A 140 terabytes database can hold no more than approximately 1e+13 rows, and then only if there are no indices and if each row contains very little data. -- - stephan beal http://w

[sqlite] How does your sqlite script binding handle aggregate UDFs?

2016-03-05 Thread Stephan Beal
ls. How are script bindings handling such situations? Where are they initializing and resetting any "accumulator data" in their aggregates? Any insights and suggestions would be appreciated. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sl

[sqlite] How does your sqlite script binding handle aggregate UDFs?

2016-03-05 Thread Stephan Beal
re which keeps sqlite from making the final() aggregate call. Currently i reset my accumulation state in the final() bits, but if final() is never called, then the _next_ time someone calls the aggregate, it will still have accumulated state from the previous attempt which failed partway through. -

[sqlite] How does your sqlite script binding handle aggregate UDFs?

2016-03-05 Thread Stephan Beal
On Sat, Mar 5, 2016 at 11:21 PM, Stephan Beal wrote: > On Sat, Mar 5, 2016 at 10:43 PM, Domingo Alvarez Duarte < > sqlite-mail at dev.dadbiz.es> wrote: > >> Hello ! >> >> There is an user pointer that you pass and you can get it back using >> http

[sqlite] How does your sqlite script binding handle aggregate UDFs?

2016-03-06 Thread Stephan Beal
On Sat, Mar 5, 2016 at 11:58 PM, Richard Hipp wrote: > On 3/5/16, Stephan Beal wrote: > > On Sat, Mar 5, 2016 at 10:43 PM, Domingo Alvarez Duarte < > > > > The scenario i'm concerned about is that sqlite calls my aggregate N > times, > > then an error is trigg

[sqlite] How does your sqlite script binding handle aggregate UDFs?

2016-03-06 Thread Stephan Beal
On Sat, Mar 5, 2016 at 9:22 PM, Stephan Beal wrote: > Aggregates are _currently_ modeled as a single function which gets called > just like normal function, but in the aggregate's "final" call the engine > calls the aggregate function with no arguments (this is how th

[sqlite] compile switches: SQLITE_OMIT_ATTACH & SQLITE_OMIT_VIRTUALTABLE

2016-03-09 Thread Stephan Beal
of SQLITE_OMIT_* options. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

[sqlite] CAST STRING => INTEGER

2016-03-14 Thread Stephan Beal
to use integers above 9223372036854775807 is something that is better > not to be done. > Also beware that some scripting languages only support 48 bits of integer precision, so 64 bits may or may not be usable in any given scripting language environment. -- - stephan beal http://wanderingh

[sqlite] dump only data, change schema, reload

2016-03-23 Thread Stephan Beal
original table create table original_table (...); -- w/ new schema insert into original_table (a,b,c) select a,b,c from foo; -- assuming no transformation needs to take place drop table foo; -- though you'll probably want to keep the old copy "just in case" -- - stephan beal http://

[sqlite] SQLite with wall enabled what's wrong C demo

2016-03-24 Thread Stephan Beal
de there. If you'll check those codes, you may be able to find out immediately what the problem is. A Golden Rule of C APIs is: if you ignore the result codes, the API may ignore you. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. Bu

[sqlite] strftime accepts an illegal time string

2016-05-05 Thread Stephan Beal
t again, etc i think this is easier: check if the year as 365 or 366 days: sqlite> select strftime('%j', '2016-12-31'); 366 sqlite> select strftime('%j', '2015-12-31'); 365 with the usual caveats for dates in the far past. -- - stephan beal http://wanderinghorse.net/home/stephan/ http

[sqlite] determining is-leap-year in sqlite

2016-05-08 Thread Stephan Beal
. The system clock is correct on your x64 machine, i assume? (Even if it's wrong, that doesn't explain the days being shifted left by 1.) -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct

[sqlite] determining is-leap-year in sqlite

2016-05-08 Thread Stephan Beal
On Sun, May 8, 2016 at 10:53 AM, Stephan Beal wrote: > The system clock is correct on your x64 machine, i assume? (Even if it's > wrong, that doesn't explain the days being shifted left by 1.) > One idea comes to mind: perhaps it doesn't consistently deal with timezones everywhere, a

[sqlite] determining is-leap-year in sqlite

2016-05-09 Thread Stephan Beal
That suggests that the script is not consistently telling sqlite which TZ to use in all calculations. i will take a look at it as time allows. Probably just need to be sure to consistently pass the final argument to strftime(). - stephan (Sent from a mobile device, possibly from bed. Please

<    1   2   3   4   5   6   7   >