Bug 82403 - Base: CONCAT string function returns error when given more than two strings to concatenate (query builder)
Summary: Base: CONCAT string function returns error when given more than two strings ...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: Other All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-10 01:05 UTC by Doug
Modified: 2015-04-01 20:39 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
error message from concatenate (13.49 KB, image/png)
2014-08-10 01:05 UTC, Doug
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Doug 2014-08-10 01:05:37 UTC
Created attachment 104359 [details]
error message from concatenate

CONCAT string function in HSQLDB (default Base format) is supposed to handle *minimum* of two string arguments, up to indeterminate number, ie, CONCAT('a', 'b', 'c', 'd').  Query builder accepts the function, but on execution returns:

S1000 General error java.lang.ArrayIndexOutOfBoundsException: 2 in statement [SELECT CONCAT('a', 'b', 'c', 'd') FROM "Table1"]

See screenshot.  Base HSQLDB accepts *maximum* of two arguments for CONCAT function, is regression from documentation.

See HSQLDB documentation:
http://hsqldb.org/doc/guide/builtinfunctions-chapt.html#bfc_string_binary_functions

At this time, I am not encountering this same problem via native or JBDC MySQL connectors although that might be new (did the development releases fix?).

Steps to replicate:

1.  In default HSQLDB-formatted database, create query in design view.
2.  Create function field CONCAT('a', 'b', 'c', 'd')
3.  Execute query

Actual result:  General error.

Expected result:  table with one row 'abcd'

Obviously, there is a workaround at this time of stringing together multiple CONCAT functions, ie CONCAT(CONCAT(CONCAT('a', 'b'), 'c'), 'd'), but would be better to fix.
Comment 1 Robert Großkopf 2014-08-12 16:31:51 UTC
You are looking for the wrong HSQLDB-version. HSQLDB, integrated into LO (and OpenOffice / AOO) is Version 1.8.
Have a look here:
http://www.hsqldb.org/doc/1.8/guide/ch09.html
------------------
CONCAT(str1,str2)

    returns str1 + str2
-----------------
CONCAT works in the internal HSQLDB only with two values.
Try str1||str2||str3 and so on. Will give the result you wish.

This isn't a bug of LO and couldn't be fixed by LO. Only works with the functionality of HSQLDB 1.8. So I will put this bug to "Resolved" and "Notabug". Feel free to reopen, if you have other informations about the internal HSQLDB 1.8.