Re: [sqlite] SQLite character comparisons

2008-01-24 Thread Stephen Oberholtzer
I feel compelled to throw in my $0.02 here. To everyone who thinks that SQLite should allow 'foo ' == 'foo': SQL was originally conceived as a query *language* -- a way for a human being to request a set of data from a database. It was specifically designed for ad-hoc queries. This little

Re: [sqlite] SQLite character comparisons

2008-01-21 Thread Dennis Cote
Fowler, Jeff wrote: Hello All, Not trying to be antagonistic, but I'm curious to know how many of you agree with Darren's sentiments on this issue. To restate briefly, ANSI SQL-92 specifies that when comparing two character fields, trailing spaces should be ignored. Correct me if I'm wrong

Re: [sqlite] SQLite character comparisons

2008-01-21 Thread drh
John Elrick [EMAIL PROTECTED] wrote: If we are ignoring trailing spaces, then by definition: ' ' = '' and for that matter: ' ' = ' ' Good point. I added these as test cases for the new RTRIM collation. http://www.sqlite.org/cvstrac/chngview?cn=4735 -- D. Richard Hipp

Re: [sqlite] SQLite character comparisons

2008-01-21 Thread John Elrick
Fowler, Jeff wrote: Hello All, Not trying to be antagonistic, but I'm curious to know how many of you agree with Darren's sentiments on this issue. To restate briefly, ANSI SQL-92 specifies that when comparing two character fields, trailing spaces should be ignored. My $0.02. If we are

RE: [sqlite] SQLite character comparisons

2008-01-21 Thread Fowler, Jeff
: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Monday, January 21, 2008 11:46 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLite character comparisons Fowler, Jeff wrote: Hello All, Not trying to be antagonistic, but I'm curious to know how many of you agree with Darren's sentiments

Re: [sqlite] SQLite character comparisons

2008-01-21 Thread Dennis Cote
Fowler, Jeff wrote: I may very well be mistaken - wouldn't be the first time!! I tried to access the actual specification from ANSI (www.ansi.org), but you either have to purchase them or access one of the drafts (which a couple folks in this thread have done), but the draft may or may not match

RE: [sqlite] SQLite character comparisons

2008-01-20 Thread Fowler, Jeff
be a concern. Regards, Jeff Fowler From: Darren Duncan [mailto:[EMAIL PROTECTED] Sent: Fri 1/18/2008 4:47 PM To: sqlite-users@sqlite.org Subject: RE: [sqlite] SQLite character comparisons At 4:11 PM -0500 1/18/08, Fowler, Jeff wrote: Better depends on who you ask

Re: [sqlite] SQLite character comparisons

2008-01-20 Thread Jay Sprenkle
On Jan 20, 2008 10:19 AM, Fowler, Jeff [EMAIL PROTECTED] wrote: Not trying to be antagonistic, but I'm curious to know how many of you agree with Darren's sentiments on this issue. Sqlite is DRH's project. Voting doesn't come into the picture anywhere. If you convince him to fix it then he

Re: [sqlite] SQLite character comparisons

2008-01-20 Thread Doug Currie
On Sunday, January 20, 2008 Fowler, Jeff wrote: briefly, ANSI SQL-92 specifies that when comparing two character fields, trailing spaces should be ignored. From SQL-92 (draft July 1992) section 4.6 When values of unequal length are compared, if the collating sequence for the comparison has

Re: [sqlite] SQLite character comparisons

2008-01-20 Thread John Stanton
From: Darren Duncan [mailto:[EMAIL PROTECTED] Sent: Fri 1/18/2008 4:47 PM To: sqlite-users@sqlite.org Subject: RE: [sqlite] SQLite character comparisons At 4:11 PM -0500 1/18/08, Fowler, Jeff wrote: Better depends on who you ask - I'd say it's worse, and I bet

Re: [sqlite] SQLite character comparisons

2008-01-20 Thread drh
Fowler, Jeff [EMAIL PROTECTED] wrote: I'm curious to know how many of you agree with Darren's sentiments on this issue Changing the behavior of SQLite to ignore trailing spaces is not an option for SQLite version 3, since to do so would result in a incompatible file format All indices

RE: [sqlite] SQLite character comparisons

2008-01-20 Thread Darren Duncan
At 11:19 AM -0500 1/20/08, Fowler, Jeff wrote: To restate briefly, ANSI SQL-92 specifies that when comparing two character fields, trailing spaces should be ignored. Correct me if I'm wrong Darren, but you feel this is a bad decision, and in fact SQLite's implementation of character comparison

RE: [sqlite] SQLite character comparisons

2008-01-20 Thread Fowler, Jeff
] Sent: Sun 1/20/2008 11:56 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLite character comparisons On Jan 20, 2008 10:19 AM, Fowler, Jeff [EMAIL PROTECTED] wrote: Not trying to be antagonistic, but I'm curious to know how many of you agree with Darren's sentiments on this issue

Re: [sqlite] SQLite character comparisons

2008-01-18 Thread Zbigniew Baniewski
On Fri, Jan 18, 2008 at 12:32:36PM -0800, Darren Duncan wrote: If trailing spaces were supposed to be insignificant for an equality test, then it should not be possible to define a string value containing trailing spaces at all. Yes, yes: quite right... the above reminds me something... ;) --

RE: [sqlite] SQLite character comparisons

2008-01-18 Thread Darren Duncan
At 4:11 PM -0500 1/18/08, Fowler, Jeff wrote: Better depends on who you ask - I'd say it's worse, and I bet most DBA's would agree. The ANSI standard is to ignore trailing spaces when comparing character strings in a WHERE clause, a HAVING clause, or a join. So I can take the exact same data,

Re: [sqlite] SQLite character comparisons

2008-01-18 Thread Zbigniew Baniewski
On Fri, Jan 18, 2008 at 02:13:51PM -0800, Darren Duncan wrote: Don't read too much into that statement; I'm was not raising the auto-trim thing. Yes, yes - I know... Roma locuta... -- pozdrawiam / regards

Re: [sqlite] SQLite character comparisons

2008-01-18 Thread Zbigniew Baniewski
On Fri, Jan 18, 2008 at 11:04:09PM +, Evans, Mark (Tandem) wrote: Think of NULL as value is unknown. With zero length blob/text, value is known: 0-length blob/text OK, I will :) -- pozdrawiam / regards

RE: [sqlite] SQLite character comparisons

2008-01-18 Thread Evans, Mark (Tandem)
Doh! Wrong thread. :) :) :) -Original Message- From: Zbigniew Baniewski [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 5:14 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLite character comparisons On Fri, Jan 18, 2008 at 11:04:09PM +, Evans, Mark (Tandem

Re: [sqlite] SQLite character comparisons

2008-01-18 Thread Darren Duncan
At 10:57 PM +0100 1/18/08, Zbigniew Baniewski wrote: On Fri, Jan 18, 2008 at 12:32:36PM -0800, Darren Duncan wrote: If trailing spaces were supposed to be insignificant for an equality test, then it should not be possible to define a string value containing trailing spaces at all. Yes,

RE: [sqlite] SQLite character comparisons

2008-01-18 Thread Fowler, Jeff
[mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 3:33 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLite character comparisons At 10:43 AM -0500 1/17/08, Fowler, Jeff wrote: Hello All, I've used SQL Server for over 15 years, Oracle off on when I have no choice, but SQLite

RE: [sqlite] SQLite character comparisons

2008-01-18 Thread Evans, Mark (Tandem)
Think of NULL as value is unknown. With zero length blob/text, value is known: 0-length blob/text Cheers, Mark -Original Message- From: Zbigniew Baniewski [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 4:51 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLite

Re: [sqlite] SQLite character comparisons

2008-01-18 Thread Darren Duncan
At 10:43 AM -0500 1/17/08, Fowler, Jeff wrote: Hello All, I've used SQL Server for over 15 years, Oracle off on when I have no choice, but SQLite for a couple weeks. I've just learned (today) that SQLite respects trailing spaces when comparing two character fields. I.e. 'SQLITE' 'SQLITE ' Is

RE: [sqlite] SQLite character comparisons

2008-01-17 Thread Fowler, Jeff
' and 'abc ' to be equivalent for most comparison operations. -Original Message- From: Zbigniew Baniewski [mailto:[EMAIL PROTECTED] Sent: Thursday, January 17, 2008 5:20 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLite character comparisons On Thu, Jan 17, 2008 at 10:43:20AM -0500

Re: [sqlite] SQLite character comparisons

2008-01-17 Thread Zbigniew Baniewski
On Thu, Jan 17, 2008 at 10:43:20AM -0500, Fowler, Jeff wrote: I've used SQL Server for over 15 years, Oracle off on when I have no choice, but SQLite for a couple weeks. I've just learned (today) that SQLite respects trailing spaces when comparing two character fields. I.e. 'SQLITE' 'SQLITE

Re: [sqlite] SQLite character comparisons

2008-01-17 Thread Zbigniew Baniewski
On Thu, Jan 17, 2008 at 05:25:30PM -0500, Fowler, Jeff wrote: By the way.. I found this snippet. If I read it right, it seems that IGNORING trailing spaces during string comparisons is ANSI standard. I'm not sure. I was always avoiding such problem by trim-ming everything to be inserted;