Bug #64600 | group_concat seperator parameter doesn't accept concat() returned value | ||
---|---|---|---|
Submitted: | 9 Mar 2012 9:56 | Modified: | 5 May 2012 15:27 |
Reporter: | Nicolas Pow | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.5.20 | OS: | Any |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
Tags: | concat, group_concat, SEPARATOR |
[9 Mar 2012 9:56]
Nicolas Pow
[9 Mar 2012 10:59]
Valeriy Kravchuk
This is easy to repeat, but our manual, http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html#function_group-concat, says: "The full syntax is as follows: GROUP_CONCAT([DISTINCT] expr [,expr ...] [ORDER BY {unsigned_integer | col_name | expr} [ASC | DESC] [,col_name ...]] [SEPARATOR str_val]) " Note "str_val" (and not just "str" or "expr") is used. So I'd say that string literal is assumed. This is what we have in sql_yacc.yy in the source code: opt_gconcat_separator: /* empty */ { $$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1); if ($$ == NULL) MYSQL_YYABORT; } | SEPARATOR_SYM text_string { $$ = $2; } ; See text_string above that is defined as: text_string: TEXT_STRING_literal ... We can make a feature request and/or documentation request out of this, but I think that formally it works as designed.
[9 Mar 2012 17:27]
Nicolas Pow
Thanks you a lot for these precisions and the quick and complete answer.
[9 Mar 2012 17:49]
Valeriy Kravchuk
Let's consider this as a documentation request. Manual should clearly say that string literal is expected.
[5 May 2012 15:27]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.