MantisBT: master 94908539

Author Committer Branch Timestamp Parent
dregad dregad master 2023-07-26 16:58 master 60cc1d7e
Affected Issues  0032787: Facilitate identification of user accounts sharing the same email
Changeset

Fix query to find users with duplicate emails

With MySQL in only_full_group_by sql_mode, the query used in admin
checks to find users with duplicate emails (which was written and tested
with a PostgreSQL database) is throwing

ERROR 1055 (42000): Expression 0000001 of HAVING clause is not in GROUP BY
clause and contains nonaggregated column 'bugtracker.mantis_user_table.email'
which is not functionally dependent on columns in GROUP BY clause; this
is incompatible with sql_mode=only_full_group_by.

Adding a sub-query fixes the problem, and the updated query works fine
with PostgreSQL too (SQL Server and Oracle not tested).

Issue 0032787

mod - admin/check/check_email_inc.php Diff File