Re: [sqlite] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Lennart Ramberg
... or might it even be so, that good praxis is when using field
names, to always use the AS clause, even if no table-alias are used?
Like:
rs=db.SQLSelect("SELECT x AS x FROM t")
zstring=rs.Field("x").StringValue

Lennart Ramberg

On Fri, Jul 31, 2009 at 3:12 PM, Lennart
Ramberg wrote:
> Thanks for quick responses,
>
> Actually, removing DISTINCT removes the problem, but anyway, as I
> understand, I should always use the AS clause when using alias to be
> on the safe side, right?
>
> Lennart Ramberg
>
> On Fri, Jul 31, 2009 at 2:40 PM, Igor Tandetnik wrote:
>> Lennart Ramberg wrote:
>>> dim rs as RecordSet
>>> rs=dbEta.SQLSelect("SELECT DISTINCT V.resanr,C.namn"_
>>>  +" FROM Voyages V,Category C WHERE C.kategorinr=V.kategorinr")
>>>
>>> dim namnstr as string
>>>
>>> namnstr=rs.Field("namn").StringValue   'I get a NilObjectException
>>> here in 3.6.0 ...
>>> namnstr=rs.Field("C.namn").StringValue   '... but not here.
>>
>> Unless explicitly specified with AS clause in the statement, column
>> names are implementation-defined and subject to change without notice. I
>> believe the algorithm did change between 3.6.0 and 3.6.3. But you
>> shouln't have been relying on them in the first place.
>>
>>> Yes, at sqlite.org I read:
>>> "SQLite version 3.6.3 fixes a bug in SELECT DISTINCT that was
>>> introduced by the previous version."
>>> So that shouldn't be it, since it was introduced in 3.6.2, right?
>>
>> I don't believe this issue has anything to do with DISTINCT. I'm pretty
>> sure the problem will remain if you remove DISTINCT.
>>
>> Igor Tandetnik
>>
>>
>>
>> ___
>> 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] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Lennart Ramberg
Thanks for quick responses,

Actually, removing DISTINCT removes the problem, but anyway, as I
understand, I should always use the AS clause when using alias to be
on the safe side, right?

Lennart Ramberg

On Fri, Jul 31, 2009 at 2:40 PM, Igor Tandetnik wrote:
> Lennart Ramberg wrote:
>> dim rs as RecordSet
>> rs=dbEta.SQLSelect("SELECT DISTINCT V.resanr,C.namn"_
>>  +" FROM Voyages V,Category C WHERE C.kategorinr=V.kategorinr")
>>
>> dim namnstr as string
>>
>> namnstr=rs.Field("namn").StringValue   'I get a NilObjectException
>> here in 3.6.0 ...
>> namnstr=rs.Field("C.namn").StringValue   '... but not here.
>
> Unless explicitly specified with AS clause in the statement, column
> names are implementation-defined and subject to change without notice. I
> believe the algorithm did change between 3.6.0 and 3.6.3. But you
> shouln't have been relying on them in the first place.
>
>> Yes, at sqlite.org I read:
>> "SQLite version 3.6.3 fixes a bug in SELECT DISTINCT that was
>> introduced by the previous version."
>> So that shouldn't be it, since it was introduced in 3.6.2, right?
>
> I don't believe this issue has anything to do with DISTINCT. I'm pretty
> sure the problem will remain if you remove DISTINCT.
>
> Igor Tandetnik
>
>
>
> ___
> 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] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Igor Tandetnik
Lennart Ramberg wrote:
> dim rs as RecordSet
> rs=dbEta.SQLSelect("SELECT DISTINCT V.resanr,C.namn"_
>  +" FROM Voyages V,Category C WHERE C.kategorinr=V.kategorinr")
>
> dim namnstr as string
>
> namnstr=rs.Field("namn").StringValue   'I get a NilObjectException
> here in 3.6.0 ...
> namnstr=rs.Field("C.namn").StringValue   '... but not here.

Unless explicitly specified with AS clause in the statement, column 
names are implementation-defined and subject to change without notice. I 
believe the algorithm did change between 3.6.0 and 3.6.3. But you 
shouln't have been relying on them in the first place.

> Yes, at sqlite.org I read:
> "SQLite version 3.6.3 fixes a bug in SELECT DISTINCT that was
> introduced by the previous version."
> So that shouldn't be it, since it was introduced in 3.6.2, right?

I don't believe this issue has anything to do with DISTINCT. I'm pretty 
sure the problem will remain if you remove DISTINCT.

Igor Tandetnik



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


Re: [sqlite] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Mike Eggleston
On Fri, 31 Jul 2009, Lennart Ramberg might have said:

> Hello,
> 
> I'm new to this list and what prompted me to sign up was a SELECT
> DISTINCT problem I experience in REALbasic (Linux), which has SQLite
> built-in.
> 
> REALbasic downgraded their latest version from SQLIte 3.6.3 to 3.6.0
> Now, 3.6.0 behaves differently than 3.3.6 and 3.6.3 in the following manner:
> (excuse me for using RB code, but I think it is readable)
> 
> dim rs as RecordSet
> rs=dbEta.SQLSelect("SELECT DISTINCT V.resanr,C.namn"_
>   +" FROM Voyages V,Category C WHERE C.kategorinr=V.kategorinr")
> 
> dim namnstr as string
> 
> namnstr=rs.Field("namn").StringValue   'I get a NilObjectException
> here in 3.6.0 ...
> namnstr=rs.Field("C.namn").StringValue   '... but not here.
> 
> namnstr=rs.Field("C.namn").StringValue   'I get a NilObjectException
> here in 3.3.6 and 3.6.3 ...
> namnstr=rs.Field("namn").StringValue   '... but not here.
> 
> There are workarounds, but is this a bug in SQLite 3.6.0?
> 
> Yes, at sqlite.org I read:
> "SQLite version 3.6.3 fixes a bug in SELECT DISTINCT that was
> introduced by the previous version."
> So that shouldn't be it, since it was introduced in 3.6.2, right?
> 
> Thanks
> Lennart Ramberg

Just a thought. Have you tried the same sql select statement in the
sqlite3 command line tool? Does the tool report the same different values?

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


[sqlite] SELECT DISTINCT bug in SQLite 3.6.0?

2009-07-31 Thread Lennart Ramberg
Hello,

I'm new to this list and what prompted me to sign up was a SELECT
DISTINCT problem I experience in REALbasic (Linux), which has SQLite
built-in.

REALbasic downgraded their latest version from SQLIte 3.6.3 to 3.6.0
Now, 3.6.0 behaves differently than 3.3.6 and 3.6.3 in the following manner:
(excuse me for using RB code, but I think it is readable)

dim rs as RecordSet
rs=dbEta.SQLSelect("SELECT DISTINCT V.resanr,C.namn"_
  +" FROM Voyages V,Category C WHERE C.kategorinr=V.kategorinr")

dim namnstr as string

namnstr=rs.Field("namn").StringValue   'I get a NilObjectException
here in 3.6.0 ...
namnstr=rs.Field("C.namn").StringValue   '... but not here.

namnstr=rs.Field("C.namn").StringValue   'I get a NilObjectException
here in 3.3.6 and 3.6.3 ...
namnstr=rs.Field("namn").StringValue   '... but not here.

There are workarounds, but is this a bug in SQLite 3.6.0?

Yes, at sqlite.org I read:
"SQLite version 3.6.3 fixes a bug in SELECT DISTINCT that was
introduced by the previous version."
So that shouldn't be it, since it was introduced in 3.6.2, right?

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