Opened 6 years ago

Last modified 6 years ago

#882 new defect

Error with operation on Number without scale

Reported by: bscott Owned by: haris
Priority: minor Milestone: 3.8.0
Component: KingOracle Provider Version: 3.8.0
Severity: 3 Keywords:
Cc: External ID:


Lets say you have a table with Col1 and col2 define as number without scale. I know it is not a good habit of doing that but it's not my database:-(

If i try a sql statement like this "Select col1 + col2 from MyTable?" This make the provider throw an exception

I have found the problem and i'v attached a little patch oci return a 0 scale and the provider try to fit a big double into an int16... boom

It would be great if we could include this patch into the 3.9 time frame

Attachments (1)

Number0.patch (899 bytes) - added by bscott 6 years ago.

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by bscott

Attachment: Number0.patch added

comment:1 Changed 6 years ago by gregboone

re: ub4 col_scale = 9999;

Why set the scale to the upper limit?

comment:2 Changed 6 years ago by bscott

This scale value is used in a function c_FdoOra_API3::OraTypeToFdoDataType? If the oci type is either numer or decimal the function test the scale if the scale <= 0 then its an int (either 16,32 or 64 according to the precision) otherwise its a decimal

So defaulting the scale to 9999 forces the translation to FdoDataType_Decimal on Oracle NUMBER()

there maybe a better way of doing this, but we would have to change the c_FdoOra_API3::OraTypeToFdoDataType?

Note: See TracTickets for help on using tickets.