Page MenuHomePhabricator

GROUP_CONCAT on rc_log_type ("recentchanges" table) returns only one value
Closed, InvalidPublic

Description

When I use GROUP_CONCAT via a grouping SQL query on recentchanges table (of idwiki_p database) to get rc_log_type, it only returns a single value; other columns like rc_log_action has no issue.

Quarry link: https://quarry.wmflabs.org/query/9551 (take note that rc_log_action returns comma separated values, even when the members are empty, meanwhile rc_log_type did not)

Is this intended or is it a bug?

Thanks.

Event Timeline

what if you add an extra WHERE AND rc_source = 'mw.log' and HAVING COUNT(*) > 1 to the end?

Note that rc_log_type IS NULL and rc_log_action = '' is a normal, common combination where rc_source != 'mw.log' - group_concat won't give you NULLs but it will comma-separate the empty strings

Hmm in that case, this is not a bug then.

My intention of that SQL query (with GROUP_CONCAT on both columns) is to write a tool to iterate for each article, what are the actions taken (be it new, edit, log, etc). It is fine then, I'll just write a condition to handle this inconsistencies. Thanks for the help.