A bug in Sybase's query parser/ numeric conversion code



Hi all. This issue was also raised in a previous post about a convert
oddity:

select convert(numeric(16,2), 5.3299),convert(numeric(16,2), '5.329')

returns


5.32 5.33


The problem is in the truncation/round-down of the first conversion,
compared
to the round-up of the second value that is actually lower. It's
definitely a DBMS
issue and not a client one, because if you select:

select convert(varchar(30), convert(numeric(16,2), 5.3299))

you still get 5.32

if you change the values to 5.999, you get

5.99 and 6.00


Joe Weinstein at BEA Systems

.