Upgrade OJS 2.4 to 3.1 error can't specify target table for update in from clause

I’m testing upgrade OJS 2.4.8.4 to 3.1.2.0, but the error below occurs:

A database error has occurred: You can’t specify target table ‘submission_settings’ for update in FROM clause

PHP log:
[29-May-2019 10:47:54 America/Sao_Paulo] You can’t specify target table ‘submission_settings’ for update in FROM clause

Any suggestion?

Thank you,

Complementing, I now execute update in terminal, see the output of the error:

[code: Installer Installer::removeCancelledReviewAssignments]
[data: dbscripts/xml/upgrade/3.1.0_notifications.xml]
[data: dbscripts/xml/upgrade/3.1.0_notes.xml]
[data: dbscripts/xml/upgrade/3.1.0_galley_settings.xml]
[data: dbscripts/xml/upgrade/3.1.0_update.xml]
ERROR: Upgrade failed: DB: You can’t specify target table ‘submission_settings’ for update in FROM clause

Environment: PHP v7.1, Windows Server 2012R2, IIS, MySQL v5.7.10.

Any suggestion?

Thank you,

Hi @ronaress,

I’ve filed this for attention at Error on upgrade: You can’t specify target table ‘submission_settings’ for update... · Issue #4804 · pkp/pkp-lib · GitHub.

The issue is described in more general terms at subquery - MySQL Error 1093 - Can't specify target table for update in FROM clause - Stack Overflow (including a potential work-around: setting the MySQL option derived_merge to off while running the upgrade).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I ran the command below and did the OJS update, now it worked perfectly. Updated successfully for version 3.1.2.0.

SET global optimizer_switch = ‘derived_merge = off’;

After the update, I returned derived_merge to on.

SET global optimizer_switch = ‘derived_merge = on’;

Thank you

1 Like