[ 
https://issues.apache.org/jira/browse/OPENJPA-3036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136386#comment-18136386
 ] 

ASF subversion and git services commented on OPENJPA-3036:
----------------------------------------------------------

Commit d53fcfa2d9abc9e62f865048fcb2454d9ebdb42c in openjpa's branch 
refs/heads/OPENJPA-3056 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=d53fcfa2d ]

[OPENJPA-3056] Match bulk delete keys in a derived table on MariaDB before 11.1

MariaDB before 11.1 rejects a multi-table DELETE whose subquery reads the
target table (error 1093). Set AllowsBulkTargetInSubselect to false there,
so the keys are matched in a derived table as on MySQL (OPENJPA-3036).


> MySQL: bulk UPDATE with a subquery on the same table
> ----------------------------------------------------
>
>                 Key: OPENJPA-3036
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3036
>             Project: OpenJPA
>          Issue Type: Sub-task
>            Reporter: Richard Zowalla
>            Priority: Major
>             Fix For: 4.2.0
>
>
> MySQL does not allow the updated table in a subquery of the same statement:
> {noformat}You can't specify target table 't0' for update in FROM clause
> {prepstmnt UPDATE PRODUCT_TABLE t0 INNER JOIN PRODUCT_DETAILS t2 ON t0.ID = 
> t2.ID SET t0.QUANTITY = (t0.QUANTITY * ?) WHERE (EXISTS (SELECT t1.ID FROM 
> PRODUCT_TABLE t1 WHERE (t0.ID = ?)))} [code=1093]{noformat}
> The usual way around it is to wrap the subquery in a derived table.
> Failing test: {{Client.subquery}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to