Issue Bug Closed

#102175MySQL dissalows using same table in a sub-query for an delete-query

Stefan Bürk 10/16/23, 05:59 updated 07/09/24, 15:19

Description

With #102171 a sub-query has been used to define
the records to delete. However, two things has
been missed:

  • To create placeholders in the sub-query, the
    correct outer QueryBuilder instance needs to
    be used.
  • MySQL don’t allow using the same table from
    the delete query in a sub-query, at least not
    directly.

The subquery should be moved to the proper place
and a additional subquery used to enforce the
result materliazation into a temporary table.

Reviews 1