As the SQL_CALC_FOUND_ROWS query modifier is being deprecated in MySQL 8 (refer to https://dev.mysql.com/doc/refman/8.0/en/information-function s.html#function_found-rows) I have had to perform the count in a separate query. I do this by enclosing the query in the followingSELECT count(*) FROM (
... your query ...
) AS x
If your query starts with 'SELECT *' and joins to one or more other tables, then any column name which appears in more than one table will be flagged as a duplicate. You can get around this by specifying 'SELECT <table>.*' so that it ignores columns on any JOINed tables.
I am surprised that the call to selectAllColumns() within the _sqlAssembleWhere() method of std.table.class.inc did not automatically replace '*' with a full list of column names. This is followed by a call to removeDuplicateFromSelect() which is supposed to remove any duplicate column names and so avoid this issue.