Bug 123477

Summary: Array formula with COLUMN() function evaluates to #VALUE error
Product: LibreOffice Reporter: Eric Horch <ehorch>
Component: CalcAssignee: Eike Rathke <erack>
Status: VERIFIED FIXED    
Severity: normal CC: erack, himajin100000, oliver.brinzing, telesto, xiscofauli
Priority: medium Keywords: bibisected, bisected, regression
Version: 6.0.0.0.alpha1+   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=123479
https://bugs.documentfoundation.org/show_bug.cgi?id=58874
Whiteboard: target:6.3.0 target:6.2.2
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108253    
Attachments: Example of bad evaluation of array formula containing COLUMN() function

Description Eric Horch 2019-02-15 06:18:16 UTC
Created attachment 149305 [details]
Example of bad evaluation of array formula containing COLUMN() function

The attached workbook has an example of an array formula that contains the FIND() function which takes as one of its arguments the output of the OFFSET() function which in turn takes the COLUMN() function as one of its arguments.

This formula used to return a number (the index of the search substring) in 5.4 but with 6.2, it returns #VALUE.
Comment 1 Telesto 2019-02-15 10:37:10 UTC
Repro
Version: 6.3.0.0.alpha0+
Build ID: e0745a11597e5d57eb8001a295314e86810a6027
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-02-12_04:16:22
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL

but not with
Versie: 4.4.7.2 
Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600
Locale: nl_NL
Comment 2 Xisco FaulĂ­ 2019-02-15 11:55:38 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=b086633566cbcc5e73add5d195ce0ab207ea8f7c

author	Eike Rathke <erack@redhat.com>	2017-05-19 21:44:17 +0200
committer	Eike Rathke <erack@redhat.com>	2017-05-22 11:00:56 +0200
commit b086633566cbcc5e73add5d195ce0ab207ea8f7c (patch)
tree c5a1eb9c17e4c3a0942dbee30ba996d75ac50224
parent 3a3064fcb4778b050398d98598d6ed61e8298134 (diff)
Create RefList at JumpMatrix if current function returns Reference, tdf#58874

Bisected with: bibisect-linux64-6.0

Adding Cc: to Eike Rathke
Comment 3 Eike Rathke 2019-02-22 20:18:10 UTC
Investigating.
Comment 4 Commit Notification 2019-02-23 00:25:11 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#123477 let array/matrix formula act as ForceArray on calls

It will be available in 6.3.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 5 Eike Rathke 2019-02-23 00:26:05 UTC
Pending review https://gerrit.libreoffice.org/68238 for 6-2
Comment 6 Eike Rathke 2019-02-25 21:05:31 UTC
Fwiw, I tried to backport the fix to 6-1 but it depends on too many things introduced for 6-2 that I consider too risky to also backport for the second last 6.1.6 release.
Comment 7 Commit Notification 2019-02-27 10:09:17 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Unit test for array formula and OFFSET() non-ReferenceOrRefArray, tdf#123477

It will be available in 6.3.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-02-27 15:17:42 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

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

Resolves: tdf#123477 let array/matrix formula act as ForceArray on calls

It will be available in 6.2.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 Xisco FaulĂ­ 2019-03-12 15:18:31 UTC
Verified in

Version: 6.3.0.0.alpha0+
Build ID: 8aa579830b20072af8d6e149d6b279362fe98b91
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Eike, thanks for fixing this issue!