Re: [sqlite] Caveat in parsing create table statement

2011-05-13 Thread Samuel Adam
CHECK ("other" IN (SELECT "id" FROM "One"))); Error: subqueries prohibited in CHECK constraints sqlite> It appears I remembered correctly. Yes, I also once had a use case for that; I solved it easily with a trigger. Not sure about the doc issue you also

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Samuel Adam
est" WHERE "col2" = 1); 2 sqlite> SELECT count() FROM ...> (SELECT "col1" FROM "Test" WHERE "col2" = 3); 0 That looks like a fairly “magic way” to me—and I have actually used that method with nontrivial queries. Am I missing somethin

Re: [sqlite] Issue 608 in sqlite-manager: select date('2011-04-29', quote(-3) || 'day'); shows null after upgrading of firefox to 3.6.17

2011-05-08 Thread Samuel Adam
neages: http://www.mail-archive.com/sqlite-users@sqlite.org/msg58853.html Very truly, SAMUEL ADAM ◊ http://certifound.com/ ◊ I read list mail sporadically. 763 Montgomery Road ◊ Hillsborough, NJ 08844-1304 ◊ United States April 15, 2011 Courtroom Video in re Adam v. Supreme Court of N.J.: http:/

Re: [sqlite] SQLite and SIGFPE

2011-02-20 Thread Samuel Adam
On Sun, 20 Feb 2011 14:51:12 -0500, Nico Williams <n...@cryptonector.com> wrote: > On Sun, Feb 20, 2011 at 6:24 AM, Samuel Adam <a...@certifound.com> wrote: [big snip] >> Any numerics experts (which I am not) or fp-software gurus care to chime >> in? *If* I

Re: [sqlite] How to use sqlite and pthread together?

2011-02-20 Thread Samuel Adam
On Sun, 20 Feb 2011 14:46:06 -0500, Nico Williams <n...@cryptonector.com> wrote: > On Sun, Feb 20, 2011 at 6:28 AM, Samuel Adam <a...@certifound.com> wrote: >> On Sat, 19 Feb 2011 17:12:31 -0500, Pavel Ivanov <paiva...@gmail.com> >> wrote: >> >>>

Re: [sqlite] Compiler warnings in R-Tree code under Visual StudioExpress

2011-02-20 Thread Samuel Adam
On Sat, 19 Feb 2011 10:37:42 -0500, Afriza N. Arief <afriza...@gmail.com> wrote: > On Sat, Feb 19, 2011 at 6:27 AM, Samuel Adam <a...@certifound.com> wrote: > >> A FAQ[2] isn’t enough, as we can see. >> >> To put it another way: Bug reporters should ha

Re: [sqlite] How to use sqlite and pthread together?

2011-02-20 Thread Samuel Adam
Windows applications which use worker processes for concurrency the same way my *nix server daemons do. There’s a reason for that. Lots to say about threads, but well—that will need await another thread. Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊ Hillsborou

Re: [sqlite] SQLite and SIGFPE

2011-02-20 Thread Samuel Adam
nt programming issue which may affect SQLite. Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊ Hillsborough, NJ 08844-1304 ◊ United States Legal advice from a non-lawyer: “If you are sued, don’t do what the Supreme Court of New Jersey, its agents, and its officers did

Re: [sqlite] How to use sqlite and pthread together?

2011-02-18 Thread Samuel Adam
e. (There exists a popular pthreads/win32 package; it is reputed slow, I cannot attest either way as thereto, and it may or may not be what the original poster was using.) Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊ Hillsborough, NJ 08844-1304 ◊ United Stat

[sqlite] SQLite and SIGFPE

2011-02-18 Thread Samuel Adam
thread at a time. Then I realized the obvious problem: I’m dealing with a signal handler. Duh. Back to square one. Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊ Hillsborough, NJ 08844-1304 ◊ United States Legal advice from a non-lawyer: “If you are sued, d

Re: [sqlite] EXT :Re: Compiler warnings in R-Tree code under Visual StudioExpress

2011-02-18 Thread Samuel Adam
[2,idem] and another document thereby referenced[3] explain SQLite’s position on compiler warnings, it is futile to expect that somebody who missed that would read a source code comment. Did I mention the FAQ[2,supra]? Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery R

Re: [sqlite] generating mini-calendar: DATE and quoting...

2011-02-10 Thread Samuel Adam
ECT date( '2011-01-01', digit || 'days' ) AS d FROM digits; s/'days'/' days'/ (Thanks for the tip on quotes; I should have added http://www.sqlite.org/lang_expr.html and http://www.sqlite.org/lang_keywords.html .) Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊

Re: [sqlite] generating mini-calendar: DATE and quoting...

2011-02-10 Thread Samuel Adam
l http://www.sqlite.org/lang_select.html (and a few others) Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊ Hillsborough, NJ 08844-1304 ◊ United States Legal advice from a non-lawyer: “If you are sued, don’t do what the Supreme Court of New Jersey, its agents, and it

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-10 Thread Samuel Adam
On Thu, 10 Feb 2011 16:38:40 -0500, Stephan Beal <sgb...@googlemail.com> wrote: > On Sun, Feb 6, 2011 at 2:36 PM, Samuel Adam <a...@certifound.com> wrote: > >> >>* Make sure the binding is done as BLOB and not TEXT. PDO >> prob

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-10 Thread Samuel Adam
On Thu, 10 Feb 2011 15:21:57 -0500, Yves Goergen <nospam.l...@unclassified.de> wrote: > On 07.02.2011 23:47 CE(S)T, Samuel Adam wrote: >> On Mon, 07 Feb 2011 03:16:54 -0500, Philip Graham Willoughby >> <phil.willoug...@strawberrycat.com> wrote: >>> What abo

Re: [sqlite] Bi-directional unique

2011-02-10 Thread Samuel Adam
On Wed, 09 Feb 2011 20:14:19 -0500, Igor Tandetnik <itandet...@mvps.org> wrote: > On 2/9/2011 7:29 PM, Samuel Adam wrote: […snip garbage…] > > It seems (1, 2) and (2, 1) would result in distinct xk values, thus > defeating the point of the exercise. It is again possible to

Re: [sqlite] Bi-directional unique

2011-02-09 Thread Samuel Adam
that order may be part of the data; so it really depends on application requirements. And the XOR could also be done in pure SQL with SQLite patched to have a ^ operator. Due credit: I of course cribbed from the quoted idea to correct my previous error. Very truly, Samuel Adam ◊ <http://certif

Re: [sqlite] Bi-directional unique

2011-02-09 Thread Samuel Adam
On Wed, 09 Feb 2011 18:51:45 -0500, Samuel Adam <a...@certifound.com> wrote: > On Wed, 09 Feb 2011 18:39:14 -0500, David Bicking <dbic...@yahoo.com> > wrote: > >> I don't think this will work. xor(6,1) = 7 and xor(4,3) = 7, so you >> would fail to insert proper

Re: [sqlite] Bi-directional unique

2011-02-09 Thread Samuel Adam
o just 1 2 or 3 as in the > examples. You are right, as xoring on my fingers would have verified. In polite terms, evidently I just demonstrated publicly math as not my forté || today as not my day. Apologies for the noise. Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery

Re: [sqlite] Bi-directional unique

2011-02-09 Thread Samuel Adam
uarantee that "y" = "k"^"x" unless you use the modified table, anyway. Bear in mind, this suggestion stems from a personal bias toward clever XOR tricks; at that, I once wrote a set of endian-swab functions with no (explicit) temporary variables, purely using XO

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-07 Thread Samuel Adam
CAST ("Data" AS BLOB); Y’know the urban legend about the folks at the restaurant who design a complicated plan for switching the contents of salt and pepper shakers which have their hats juxtaposed, and then a passer-by suggests just switching the caps? Thank you, Mr. Willoughby

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-06 Thread Samuel Adam
On Sun, 06 Feb 2011 11:54:37 -0500, Samuel Adam <a...@certifound.com> wrote: > On Sun, 06 Feb 2011 11:41:03 -0500, Teg <t...@djii.com> wrote: > >> Hello Yves, >> >> You could alway mime/uu/yenc encode it into text before insert, and do >> the reverse w

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-06 Thread Samuel Adam
-bit workarounds. Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊ Hillsborough, NJ 08844-1304 ◊ United States Legal advice from a non-lawyer: “If you are sued, don’t do what the Supreme Court of New Jersey, its agents, and its officers did.” http://www.youtube.com/w

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-06 Thread Samuel Adam
On Sun, 06 Feb 2011 10:53:05 -0500, Yves Goergen <nospam.l...@unclassified.de> wrote: > On 06.02.2011 14:36 CE(S)T, Samuel Adam wrote: [snip] >> * Make sure the binding is done as BLOB and not TEXT. PDO probably has >> its own flags defined for this. This is the p

Re: [sqlite] EXT :Re: LENGTH on a BLOB field stops at NUL byte

2011-02-06 Thread Samuel Adam
one of them). None of them offers full access to all the useful features provided by SQLite3’s C API. Sorting out which library and version is being used in each place can be a pain, too, as briefly seen (but not really explored) in a thread I was involved in last week. Very truly, Samuel A

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-06 Thread Samuel Adam
e quoted doc should say “text value” rather than “string”.) Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊ Hillsborough, NJ 08844-1304 ◊ United States Legal advice from a non-lawyer: “If you are sued, don’t do what the Supreme Court of New Jersey, its agents, an

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-06 Thread Samuel Adam
On Sun, 06 Feb 2011 08:10:49 -0500, Yves Goergen <nospam.l...@unclassified.de> wrote: > On 06.02.2011 13:52 CE(S)T, Samuel Adam wrote: >> For the original poster: To prevent problems like this, if it will >> always >> be a BLOB then add a constraint to your tabl

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-06 Thread Samuel Adam
slow down INSERTs a bit; data integrity is more important, as you have just seen. Very truly, Samuel Adam ◊ <http://certifound.com/> 763 Montgomery Road ◊ Hillsborough, NJ 08844-1304 ◊ United States Legal advice from a non-lawyer: “If you are sued, don’t do what the Supreme Court of New Je

Re: [sqlite] Bug? 3.7.5 RC2 FTS4 division by zero exception

2011-01-31 Thread Samuel Adam
also occur when the zero occurs naturally, or is that codepath not exercised? Perhaps an assert() is in order. Very truly, Samuel Adam <a...@certifound.com> 763 Montgomery Road Hillsborough, NJ 08844-1304 • United States http://certifound.com/ _

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 15:33:24 -0500, Gabe da Silveira <g...@websaviour.com> wrote: > On Mon, Jan 31, 2011 at 7:42 PM, Samuel Adam <a...@certifound.com> wrote: > >> I suggested rewriting your schema. Non-TEXT data which will not be >> subjected to a MATCH search i

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 14:05:15 -0500, Gabe da Silveira <g...@websaviour.com> wrote: [...] > On Mon, Jan 31, 2011 at 1:24 PM, Samuel Adam <a...@certifound.com> wrote: [...] >>* Is the database being populated with parameter binding, or >> not?

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 13:37:35 -0500, Samuel Adam <a...@certifound.com> wrote: > The FTS3 > columns declared INTEGER indeed seem to behave as regular INTEGER columns > in regular, non-MATCH queries (although I did not test to see if affinity > would coerce a '1' to IN

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
t-Type of mails. Is that intended? It rather uglifies things.) Very truly, Samuel Adam <a...@certifound.com> 763 Montgomery Road Hillsborough, NJ 08844-1304 • United States http://certifound.com/ ___ sqlite-users mailing list sqlite-users@sqlite.org http:

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 12:34:24 -0500, Samuel Adam <a...@certifound.com> wrote: > According to the docs, results from those queries should be reversed. I > suspect that Mr. da Silveira’s different platforms actually have > different SQLite versions, and that one versio

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
test. count = 999 sqlite> SELECT * FROM "Test" WHERE "id" = '101'; sqlite> According to the docs, results from those queries should be reversed. I suspect that Mr. da Silveira’s different platforms actually have different SQLite versions, and that one version is co

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 11:46:21 -0500, Samuel Adam <a...@certifound.com> wrote: > On Mon, 31 Jan 2011 11:05:13 -0500, Simon Slavin <slav...@bigfraud.org> > wrote: > >> In the definition given in the original post, which I quoted, the table >> was defined as fol

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
ng on, to address the original poster’s question: sqlite> SELECT * FROM "Test" WHERE "id" = 101; id = 101 Content = This is a test. sqlite> SELECT * FROM "Test" WHERE "id" = '101'; sqlite> You were right; I was wrong. I saw FTS3 and s

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 08:44:22 -0500, Simon Slavin <slav...@bigfraud.org> wrote: > On 31 Jan 2011, at 1:24pm, Samuel Adam wrote: [snip] >> Actually since this is an FTS3 table, the form with the quotes is the >> correct one. As Mr. da Silveira alluded later in his post, i

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
nt to check to see where your PHP is getting its sqlite3 with fts3 support. Better approach: Cut PHP from the equation and examine the databases in the sqlite3 shell. Core function typeof() might be helpful to see if the tables actually contain different data, as they most pro

[sqlite] Efficient Paths in Practice Through a 21-bit Codespace (Re: SQLITE 3.7.3 bug report (shell) - output in column mode does not align UTF8-strings correctly)

2010-11-26 Thread Samuel Adam
On Fri, 26 Nov 2010 08:40:42 -0500, Jean-Christophe Deschamps <j...@q-e-d.org> wrote: > At 14:26 26/11/2010, [Samuel Adam <a...@certifound.com>] wrote: > >> N.b., there is a severe bug (pointers calculated based on truncated >> 16-bit >> values above plan

Re: [sqlite] SQLITE 3.7.3 bug report (shell) - output in column mode does not align UTF8-strings correctly

2010-11-26 Thread Samuel Adam
y. I write off the whole episode as a victory for spammers. Very truly, Samuel Adam <a...@certifound.com> 763 Montgomery Road Hillsborough, NJ 08844-1304 United States http://certifound.com/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Ratio of test code to database code

2010-11-12 Thread Samuel Adam
lease answer this urgent question, as I am bad at math and I’d like to get to the bottom of it. free(OT); return 0; } Samuel Adam <a...@certifound.com> 763 Montgomery Road Hillsborough, NJ 08844-1304 United States http://certifound.com/ ([0] …with extraneous spaces because I

Re: [sqlite] Ratio of test code to database code

2010-11-10 Thread Samuel Adam
s the mother of “pauca sed matura”. Samuel Adam <a...@certifound.com> 763 Montgomery Road Hillsborough, NJ 08844-1304 United States http://certifound.com/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Best way to represent UUID

2010-11-08 Thread Samuel Adam
uld overwhelm the speed advantage of a hypothetical faster-than-memcmp() function. Those are the only two SQLite3 datatypes capable of holding a 16-byte value. Samuel Adam <a...@certifound.com> 763 Montgomery Road Hillsborough, NJ 08844-1304 United States http://certifound.com/ ___

Re: [sqlite] Size query

2010-11-03 Thread Samuel Adam
On Wed, 03 Nov 2010 19:17:48 -0400, Samuel Adam <a...@certifound.com> wrote: > SQLite uses its own variable-length integer representation > internally, occupying between 1 and 64 bits per value; if this is for a Sorry to reply to my own post; I wish to be precise. By “internally

Re: [sqlite] Size query

2010-11-03 Thread Samuel Adam
k thereof) in NULL values should probably also be done in your protocol’s representation. Samuel Adam <a...@certifound.com> 763 Montgomery Road Hillsborough, NJ 08844-1304 United States http://certifound.com/ ___ sqlite-users mailing list sqli

Re: [sqlite] Size query

2010-11-03 Thread Samuel Adam
TEXT, then return the size in characters; since the cast will only return values <127, the result will be in bytes for UTF-8 and half the byte-size for UTF-16. Casting to BLOB will not fix this, as the value is still first cast to TEXT. Samuel Adam <a...@certifound.com> 763 Montgome

[sqlite] Crash SQLite [version: 3.6.23.1; tested: shell]

2010-05-17 Thread Samuel Adam
re request: DECIMAL type (such as IEEE 754-2008 BCD format). Why? Humans use decimal; computers ought be made to serve humans, not vice versa; and if you put a penny into a database, you should be able to get a penny back out. Very truly, Samuel Adam http://certifound.com/+A 763 Mon

Re: [sqlite] Unique index on REAL values and equality check

2009-12-13 Thread Samuel Adam
On Sun, 13 Dec 2009 17:02:05 -0500, Alexey Pechnikov <pechni...@mobigroup.ru> wrote: > Hello! > > On Monday 14 December 2009 00:24:42 Samuel Adam wrote: >> Smells like a decimal/binary rounding error. > > It'is not the answer to my question. Why the unique _index_

Re: [sqlite] Unique index on REAL values and equality check

2009-12-13 Thread Samuel Adam
ut let’s take one thing at a time; on a different but related note, things like this should never exist: http://www.sqlite.org/faq.html#q16 I am aware that platform support is awful, of course. Samuel Adam ___ sqlite-users mailing list sqlite-user

Re: [sqlite] Feature request: compile-time foreign keys setting (patch attached)

2009-12-11 Thread Samuel Adam
dustry news. (The other was the release of Windows 7.) That speaks both to the state of the software industry, and to the critical import of foreign key enforcement. Samuel Adam > As a simple patch that I hope can be merged into the next release (made > against the sources for 3.6.21)...