Bug 104890 - Firebird: Function ABS gives wrong value, when length of field is less than 10
Summary: Firebird: Function ABS gives wrong value, when length of field is less than 10
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+ Master
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-23 17:36 UTC by robert
Modified: 2017-02-02 17:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Open the query. Have a look at the fields, which should show absolute numbers. (3.38 KB, application/vnd.oasis.opendocument.database)
2016-12-23 17:36 UTC, robert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert 2016-12-23 17:36:35 UTC
Created attachment 129903 [details]
Open the query. Have a look at the fields, which should show absolute numbers.

Open the attached document.
Open the query.
There are numeric and decimal fields of the Firebird 3.0-database.
To every field is asked for ABS("Fieldname").

The function works right, if the field-length is 10 or 11. Could be for all values greater than 9.

The function ignores the decimal places for field-length less than 10. There are reported hundredfold values instead.
Comment 1 Buovjaga 2016-12-31 18:07:45 UTC
Confirmed.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: fc0d4e6bc43d5f982452df07930f5ecf5927ad22
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on December 31st 2016
Comment 2 robert 2017-01-26 18:41:52 UTC
Have tested this again:

SELECT ABS(-23.45) FROM "Table"
gives 2345

SELECT ABS(CAST(-23.45 AS NUMERIC(10,2))) FROM "Table"
gives 23.45

You have to change the fieldtype and switch the length to min. 10 and the function will give the right value.

Tested with
Version: 5.4.0.0.alpha0+
Build ID: d9cfbabc7fe13752daf02e2a8cfa38c72a30fb29
CPU Threads: 4; OS Version: Linux 4.1; UI Render: default; VCL: kde4; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-01-22_23:06:33
Locale: de-DE (de_DE.UTF-8); Calc: group
Comment 3 robert 2017-02-02 17:53:05 UTC
Works now with fix of
https://bugs.documentfoundation.org/show_bug.cgi?id=105101