Subject | Re: [ib-support] Re: Strange query results, based on where clause |
---|---|
Author | Woody |
Post date | 2002-03-05T16:57:01Z |
From: "rogervellacott" <rvellacott@...>
types for comparison. There is no guarantee that a string field holds a
valid number. It is wrong, therefore, IMO, to force the engine to look at
them the same. When programming, you can't compare a number to a string
without converting one of them to the other's data type so it doesn't make
sense to me that this "logic" is glossed over in the background when
performing queries. Although, it does seem convenient at times for this to
happen, I have seen too many times in the past where convenience caused
future bugs to appear. I tend to think that this "bug" should be fixed to
always provide an error if trying to compare two totally different data
types.
Woody (TMW)
> Perhaps the engine can detect whether we are comparing a number to aThis just circumvents the real problem which, IMO, is using the wrong data
> string, and if so, rather than raise an error, just suppress any use
> of an index for those fields.
>
types for comparison. There is no guarantee that a string field holds a
valid number. It is wrong, therefore, IMO, to force the engine to look at
them the same. When programming, you can't compare a number to a string
without converting one of them to the other's data type so it doesn't make
sense to me that this "logic" is glossed over in the background when
performing queries. Although, it does seem convenient at times for this to
happen, I have seen too many times in the past where convenience caused
future bugs to appear. I tend to think that this "bug" should be fixed to
always provide an error if trying to compare two totally different data
types.
Woody (TMW)