Subject errors with zero and index (FB 1.02 or IB 5.6)
Author bjorgeitteno
This is really strange. We have a database that was used for a couple
of
years with IB 5.6 and which is now converted to Firebird 1.02.
The phenomenon is present in both the IB and FB versions.

Data is imported from external ASCII table files.

The offending values are

+000000000 (A plus sign followed by 9 zeros, if the characters are
not
reproduced correctly)

...which should of course be converted to a Zero value (FLOAT type
field)
via an INSERT statement.

Now, when selecting on the target table using

"SELECT * FROM MY_TABLE WHERE MY_OFFENDING_FIELD = 0"

...it is treated correctly. When creating an index on
MY_OFFENDING_FIELD,
however, something strange happens. When selecting:


"SELECT MY_OFFENDING_FIELD FROM MY_TABLE ORDER BY
MY_OFFENDING_FIELD",
this returned:

MY_OFFENDING_FIELD
------------------------------------
0 *)
0 *)
0 *)
0 *)
-123
- 99
- 65
- 1
0
0
1
12

Field values marked "*)" are imported with the value +000000000,
while the
other Zeros are coded as 000000000. They are not NULL values, we've
checked
that (remember, it's treated correctly without the index).

If one drops the index and makes the same SELECT, it's ordered as
expected.

Ideas, anyone ?

Regards,

Bjørge Sæther