Bug 61871 - EDITING: Query of a multiplication with fields of two tables don't refresh.
Summary: EDITING: Query of a multiplication with fields of two tables don't refresh.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Queries
  Show dependency treegraph
 
Reported: 2013-03-05 18:21 UTC by Robert Großkopf
Modified: 2018-12-03 18:43 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Two queries - one doesn't refresh the multiplication, the other does. (4.20 KB, application/vnd.oasis.opendocument.base)
2013-03-05 18:21 UTC, Robert Großkopf
Details
Query without update in "sum" after enter a new row. (20.95 KB, image/png)
2013-03-06 21:16 UTC, Robert Großkopf
Details
Query with update in "sum" after entering a new row. (19.37 KB, image/png)
2013-03-06 21:17 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 2013-03-05 18:21:36 UTC
Created attachment 75979 [details]
Two queries - one doesn't refresh the multiplication, the other does.

Following query in the attached database don't refresh the field "sum", when a new input in "count" and "goods_ID" is made:
SELECT "sale".*, "goods".*, "goods"."price" * "sale"."count" AS "sum" FROM "sale", "goods" WHERE "sale"."goods_ID" = "goods"."ID"
All fields of "sale" and "goods" are shown, not the content of the multiplication-field "sum".

This query works:
SELECT "a".*, ( SELECT "price" * "a"."count" FROM "goods" WHERE "a"."goods_ID" = "ID" ) AS "sum" FROM "sale" AS "a"
All fields of "sale" are shown, new values could be added and the "sum" is refreshed automatically in the correlated subquery. But this query doesn't work in LO 4.* - there isn't shown any content of a subquery, see bug
https://bugs.freedesktop.org/show_bug.cgi?id=61166
Comment 1 Lionel Elie Mamane 2013-03-06 17:21:44 UTC
Cannot reproduce with 4.0.2.0+ (my own development tree, which has some of my commits to 4.1 backported)

Or maybe I didn't understand what you meant. Please post more detailed instructions.

For me, both queries refresh correctly when I press the "refresh" button on the toolbar (a round arrow in antitrigonometric direction, that is the same direction as the hands of a watch).

1) I open both tables and both queries
2) I add lines to "sale" table (pay attention that the line is added only after the pencil at the left disappears)
3) I press refresh on both queries
4) they both have a new line

The same with changing a line instead of adding one.
Comment 2 Robert Großkopf 2013-03-06 20:08:21 UTC
(In reply to comment #1)
Hi Lionel,
> 
> For me, both queries refresh correctly when I press the "refresh" button on
> the toolbar (a round arrow in antitrigonometric direction, that is the same
> direction as the hands of a watch).

When you press the button it works. But when you move through the data by tab and with keys the field "sum" would not be refreshed when saving the data.
> 
> 1) I open both tables and both queries
> 2) I add lines to "sale" table (pay attention that the line is added only
> after the pencil at the left disappears)
> 3) I press refresh on both queries

3) I wouldn't do. I wanted to use this query for a form and will add data in a tablecontrol by keyboard and without mouse ...
> 4) they both have a new line

New line is right, but with tab saving by jumping to the next record the field "sum" will be empty.
Comment 3 Lionel Elie Mamane 2013-03-06 20:21:38 UTC
(In reply to comment #2)
> (In reply to comment #1)

>> For me, both queries refresh correctly when I press the "refresh" button on
>> the toolbar (a round arrow in antitrigonometric direction, that is the same
>> direction as the hands of a watch).

> When you press the button it works. But when you move through the data by
> tab and with keys the field "sum" would not be refreshed when saving the
> data.

Still cannot reproduce, with LibreOffice 3.5.4.2 (Debian package).

From the Query view, I change the "count" field, then press the down arrow (or tab as many times as necessary to go to next record/line). In both queries, the sum field of the line I just left is updated.

Please give excruciatingly detailed reproduction steps.
Comment 4 Robert Großkopf 2013-03-06 21:15:37 UTC
Open query sum_no_sum_refresh. 
Input new "count", "goods_ID" (max. value 2). 
Go to next row with the arrow-keys or with tab. 
The field "sum" is empty - here with LO 3.5.*, 3.6.*, 4.0.* (all rpm-32bit) - also with win7, LO 3.6.*. The field shows 0 with LO 3.3.4.

Open query sum_with_sum_refresh. Do the same. "sum" would filled in the field, when you enter the next new row.

I will attach two screenshots of the queries - one without value in the field "sum", one of the other query.
Comment 5 Robert Großkopf 2013-03-06 21:16:36 UTC
Created attachment 76047 [details]
Query without update in "sum" after enter a new row.
Comment 6 Robert Großkopf 2013-03-06 21:17:17 UTC
Created attachment 76048 [details]
Query with update in "sum" after entering a new row.
Comment 7 Lionel Elie Mamane 2013-03-06 21:40:07 UTC
OK, I get it now, reproduced.
Comment 8 Alex Thurgood 2015-01-03 17:39:04 UTC Comment hidden (no-value)
Comment 9 QA Administrators 2016-01-17 20:04:00 UTC Comment hidden (obsolete)
Comment 10 Robert Großkopf 2016-01-29 15:07:52 UTC
Bug still exists with LO 5.1.0.3, OpenSUSE 42.1 Leap, 64bit rpm Linux.
Comment 11 Robert Großkopf 2016-03-05 18:20:36 UTC
Have tested this one with the first LO 3.3.0 - same bug. So I set the version to "Inherited FROM OOo"
Comment 12 QA Administrators 2017-03-06 15:36:28 UTC Comment hidden (obsolete)
Comment 13 Robert Großkopf 2017-03-08 17:51:19 UTC
Bug still exists with LO 5.3.1.1, OpenSUSE 42.1 Leap, 64bit rpm Linux.
Comment 14 QA Administrators 2018-03-09 03:46:05 UTC Comment hidden (obsolete)
Comment 15 Robert Großkopf 2018-03-09 07:12:14 UTC
Bug still exists with LO 6.0.2.1, OpenSUSE 42.3 Leap, 64bit rpm Linux.