[MDEV-33056] Clarify GROUP_CONCAT wording Created: 2023-12-18  Updated: 2024-01-08  Resolved: 2024-01-08

Status: Closed
Project: MariaDB Server
Component/s: Documentation
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Ian Gilfillan Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: None


 Description   

Question from Zulip:

"Based on the KB documentation, what do you expect the following GROUP_CONCAT expression to return?

I quote the KB:

This function returns a string result with the concatenated non-NULL values from a group. It returns NULL if there are no non-NULL values.

Now for this SQL:

create table t1 (a int, b char);
insert into t1 values (1, 'a'), (2, NULL)
SELECT GROUP_CONCAT(a, b) FROM t1;

While after running the SQL statements it makes sense, when first reading the docs I wasn't sure whether to expect something like:

1a, 2NULL
or
1a
or
1a,2

because the word group might be associated with "expressions group". I suggest we clarify by saying: if any expr in GROUP_CONCAT evaluates to NULL, that tuple is not present in the list returned by GROUP_CONCAT.

Alternatively change the word "concatenated" with a comma separated list of values. The values are a concatenation of all expressions in GROUP_CONCAT where all expressions evaluate
to non-null for that particular ROW in the GROUP."


Generated at Thu Feb 08 10:36:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.