Bug Hunting Session
Bug 121528 - FIREBIRD: Multiplication in a query with decimal or numeric values gives result without decimal separator
Summary: FIREBIRD: Multiplication in a query with decimal or numeric values gives resu...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: x86-64 (AMD64) All
: high major
Assignee: Xisco Faulí
URL:
Whiteboard: target:6.4.0 target:6.3.0.2 target:6.2.6
Keywords: bibisected, regression
: 124420 125165 (view as bug list)
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2018-11-19 16:36 UTC by Robert Großkopf
Modified: 2019-07-13 21:58 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Open the query in the attached database. Wrong values for multiplication since LO 6.1 (3.39 KB, application/vnd.oasis.opendocument.database)
2018-11-19 16:36 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2018-11-19 16:36:25 UTC
Created attachment 146800 [details]
Open the query in the attached database. Wrong values for multiplication since LO 6.1

Open the attached database.
Open the query "Abfrage1".
Z1 = 1,34
Z2 = 2,78
Z1*Z2 = 37252
This bug appears with LO 6.1, works right with LO 6.0.5.2 on OpenSUSE 64bit rpm Linux.

For every multiplication the decimal-separator seems to be ignored. The multiplication shows the right value *10000. 
(2*6 seems to be 120 000!, because the fields for "2" and "6" are defined with 2 decimal places.
Comment 1 Alex Thurgood 2018-11-20 10:57:51 UTC
Confirming with

Version: 6.1.2.1
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
Threads CPU : 8; OS : Mac OS X 10.14; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group threaded

works in LO6062 ==> regression
Comment 2 Drew Jensen 2018-11-20 12:48:20 UTC
Bibiset shows that the anomaly arrived with commit:
bf662904c4b60e93c6b86e06288d41996eed12a2

tdf#104734 Firebird: Add Binary (fix) type
There is no explicit binary type in Firebird. It can be accomplished
using the CHAR type with a special character set, which tells the
database that it is binary data and there is no collation. (called
OCTETS).

Because of that, we also need the character set to decide the exact
column type.

And also refactor some parts of the driver:
- Create class to determine internal type from firebird type, subtype,
scale and character set.
- Use internal type (DataType::XXX) in XDatabaseMetaData::getTypeInfo()
indirectly. (We want to return a Firebird type for each internal type,
not in the opposite direction.

author:	Tamas Bunth 2017-12-16 12:57:43 +0100

Add author to CC
Comment 3 Drew Jensen 2018-12-08 21:58:50 UTC
Using Ubuntu 18.04.1 and LO 6.2Beta1

Using the attached file created 3 new tables, copies of the original, but with the datatype changed during the copy from decimal to double, numeric and float.

NOTE - in the current Base GUI (import and table designer) double and float only allow one decimal place, while the decimal values used 2.

Using the same query against each of the tables:
double and float run as expected.
numeric has the exact problem decimal does

updated the summary to reflect.
Comment 4 Drew Jensen 2019-03-29 22:31:11 UTC
*** Bug 124420 has been marked as a duplicate of this bug. ***
Comment 5 Alex Thurgood 2019-05-09 10:12:25 UTC
*** Bug 125165 has been marked as a duplicate of this bug. ***
Comment 6 Xisco Faulí 2019-07-10 14:03:48 UTC
Patch in gerrit: https://gerrit.libreoffice.org/#/c/75357/
Comment 7 Commit Notification 2019-07-10 17:31:11 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/3278dfd0a2c09f8a8862277dffd9ef666d4862c6%5E%21

tdf#121528: Firebird stores scale as a negative number

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2019-07-11 07:56:50 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/147d65c471efd4c0d4299dbaeac70922fac0f4f3%5E%21

tdf#121528: Firebird stores scale as a negative number

It will be available in 6.3.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2019-07-13 21:58:38 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/d8ba2f6c559218191482489fa4d8e5b760ebbd5f%5E%21

tdf#121528: Firebird stores scale as a negative number

It will be available in 6.2.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.