Bug 101137 - Operator & (text concatenation) in array mode broken
Summary: Operator & (text concatenation) in array mode broken
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:5.3.0 target:5.2.2 target:5.2.1
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-07-26 16:46 UTC by Wolfgang Jäger
Modified: 2019-06-03 10:20 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example demonstrating the issue. (11.60 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-07-26 16:46 UTC, Wolfgang Jäger
Details
Reworked demonstration of the bug (11.69 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-08-18 10:14 UTC, Wolfgang Jäger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Jäger 2016-07-26 16:46:15 UTC
Created attachment 126418 [details]
Example demonstrating the issue.

{=CONCAT(A1:A10&B1:B10)} and  

{=TEXTJOIN("||";FALSE();A1:A10&B1:B10)} 

entered for evaluation in array mode do not evaluate an element of the subexpression (which should return an array) if at least one of the operands of the &-operation placed there is a reference to a blank cell. 

See attached demo.
Comment 1 Buovjaga 2016-08-05 16:16:39 UTC
So what am I looking at here? They all have the same result. Can you illustrate the problem in a way that the dumbest person in the room understands it?
Comment 2 Wolfgang Jäger 2016-08-18 10:09:52 UTC
(In reply to Buovjaga from comment #1)
> So what am I looking at here? They all have the same result. Can you
> illustrate the problem in a way that the dumbest person in the room
> understands it?

The dumbest person in the room I am in, is nearly unevitably myself. This may also be the reason for my failure to understand your (Buovjaga) reply. 
I thought the attached example should clearly demonstrate the issue. 

I cannot explain the many "flaws" (serious errors in fact) of the new functions under discussion here in detail in words. The errors I found are now more clearly demonstrated and explained in the new attachment. At least I hope so. The new example was made with V5.2.0.4.

If my hope should fail, please ctritisise my statements to more detail. Thanks! 

If someone does not observe the described errors, please also tell me clearly. 

To the deciders: Please do not release a version containing such stuff!
Comment 3 Wolfgang Jäger 2016-08-18 10:14:24 UTC
Created attachment 126887 [details]
Reworked demonstration of the bug
Comment 4 Buovjaga 2016-08-18 10:25:47 UTC
Thanks. Now you included "Expected: "A005A006#" Gotten: "A005#A006#"", which is enough for me.

Win 7 Pro 64-bit, Version: 5.2.0.4 (x64)
Build ID: 066b007f5ebcc236395c7d282ba488bca6720265
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
Locale: fi-FI (fi_FI)
Comment 5 Eike Rathke 2016-08-22 18:49:25 UTC
Actually what this is about is the evaluation of =A1:A10&B1:B10 in array mode, unrelated to CONCAT or TEXTJOIN (whether those should produce an array or not is topic in bug 99625).

This can easily be seen when in attachment 126887 [details] entering =A1:A10&B1:B10 with Shift+Ctrl+Enter for example at C42. The resulting 10 cells don't match the concatenated Ax&Bx for each line.
Comment 6 Wolfgang Jäger 2016-08-22 19:25:30 UTC
(In reply to Eike Rathke from comment #5)
> ...
> 
> This can easily be seen when in attachment 126887 [details] entering
> =A1:A10&B1:B10 with Shift+Ctrl+Enter for example at C42. The resulting 10
> cells don't match the concatenated Ax&Bx for each line.

You are right, of course. I had not noticed that - and would mot have thought of it. A strange observation I just made when trying the suggested test: 
{=IF(A1:A10="";"";A1:A10)&IF(B1:B10="";"";B1:B10)}
does produce the expected results.
Comment 7 Commit Notification 2016-08-22 22:32:25 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=31d39c24e1ff2d3602e0212eeeecd8de88da6d38

Resolves: tdf#101137 handle empty elements in matrix concatenation

It will be available in 5.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2016-08-22 23:02:04 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=129c0d6363e58f6d32dc9583edb6a0edd07521f9

unit test for matrix concatenation with empty elements, tdf#101137

It will be available in 5.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Eike Rathke 2016-08-22 23:13:53 UTC
Pending review
https://gerrit.libreoffice.org/28335 for 5-2
https://gerrit.libreoffice.org/28336 for 5-2-1
Comment 10 Commit Notification 2016-08-23 09:50:17 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=aee6678b0fcc28ce0accd1429b525af95346a6b2&h=libreoffice-5-2

Resolves: tdf#101137 handle empty elements in matrix concatenation

It will be available in 5.2.2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2016-08-24 23:32:41 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-2-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=00c587abdf6c6a9e6c50f8f8cf51ba2cc47a74f9&h=libreoffice-5-2-1

Resolves: tdf#101137 handle empty elements in matrix concatenation

It will be available in 5.2.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 12 Wolfgang Jäger 2019-06-03 10:20:36 UTC
Fix verified since with different versions up to 6.3.0.0.alpha1.

Set to VERIFIED