Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle: FLOAT not handled correctly in view and save #2104

Closed
palbr opened this issue Aug 30, 2017 · 5 comments
Closed

Oracle: FLOAT not handled correctly in view and save #2104

palbr opened this issue Aug 30, 2017 · 5 comments
Labels
Milestone

Comments

@palbr
Copy link

palbr commented Aug 30, 2017

In an Oracle database, I have a table with column defined as FLOAT:

CREATE TABLE mytable (
   price FLOAT,
   productname VARCHAR2(100)
);

(Defining no explicit precision for price should give me the default precision of 126.)

I add a new row with data:

  • price = 321,1234567890123456789
  • productname = "1 kg Kryptonite"

Problem 1: After closing the inline edit with Enter, the price value changes to 321,1234436035!
01 after add row

Problem 2: I commit this change with the "Save" button and refresh the tables view. Now the price value changed to 321,12344!
02 after commit and refresh

The same process works fine using Oracle SQL Developer, so I guess it is not a problem of my database setup, but with DBeaver handling FLOATs.

Problem 3: Inserting a price value of 321,1234567890123456789 in Oracle SQL Developer is shown as 321,123456789 in DBeaver. But copying this value to the clipboard pastes 321.1234567890123456789 in my texteditor.
This FLOAT should be displayed as 321,123456789... (with dots at the end), to indicate that there are more digits, which are just not shown.
If I enlarge the column width, more digits could be shown. At the moment, DBeaver sticks with 9 digits after the decimal separator whatever I change the columnwidth to.

I am using DBeaver 4.1.3, which is a great peace of software! Thanks a lot for developing it.

@palbr
Copy link
Author

palbr commented Aug 30, 2017

Additional info:
Inserting via SQL statement works fine in DBeaver:

INSERT INTO mytable(price, productname)
VALUES(444.1234567890123456789, 'Insert Test');

So it seems to be a GUI issue.

Using SQL statements could be used as workaround.

@serge-rider
Copy link
Member

You can configure numbers representation on Data Format preference page (you can have different representations for different connections).
image

Unfortunately there is no single floating numbers format which will be good for everyone. Most of people don't want to see more than 3-4 fraction digits.

@palbr
Copy link
Author

palbr commented Sep 5, 2017

Thanks for your reply! I didn't know about these display settings. But unfortunately it does not explain/solve my problem.

The default setting for "max fraction digits" is 10 in my global settings (I do not use connection specific display settings), but in the end my FLOAT value was truncated to 5 fraction digits (321,12344).

Explicitly setting "max fraction digits" to 20 did not change this behaviour:
Inserting 321,1234567890123456789 is changed to 321,1234436035156 on Enter and changed to 321,12344 on commit.

Please note that the fraction digits are not just truncated/rounded, but changed:

value   321,1234567890123456789
becomes 321,1234436035156
                ^^^^^^^^^  changed fraction digits

So I still guess, there is some bug in this process.

serge-rider added a commit that referenced this issue Sep 6, 2017
@serge-rider serge-rider added bug and removed question labels Sep 6, 2017
@serge-rider serge-rider modified the milestones: 4.2.0, 4.2.1 Sep 6, 2017
@serge-rider
Copy link
Member

Thanks for details. It is a bug in big decimal values binding.
I.e. the problem is in value edit/save (unnecessary rounding happens) but not in value representation.

Will be fixed in the next version.

@palbr
Copy link
Author

palbr commented Sep 6, 2017

You are great! Thanks for the quick fixing. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants