Automatically wrapping queries with duplicate columns into CTEs or Derived Tables
The requirement is to automatically wrap existing queries with duplicate columns either into CTE queries or Derived Table based queries.
The derived table approach is not that easy as mariadb doesn't yet seem to support https://jira.mariadb.org/browse/MDEV-16901.
Defining a CTE with a column list when there are duplicate columns in the query itself also triggers a duplicate column error, which I believe should not happen as the column list is already specified.
Any alternatives or possibility of future fix?