Upgrade 10.0.7 -> 10.0.8 failed 1093 You can't specify target table 'oc_share' for update in FROM clause

mysql
upgrade

#1

Hi!

I tried to upgrade my owncloud server from 10.0.7 to 10.0.8 via the upgrade button and. The upgrade failed (frozen maintenance mode screen). I then used occ on the command line (webserver user _www on my system to keep the privileges), alas no success either. There seems to be a problem with the mysql database but I'm lost here as I don't know what the error message means or what I can do about it.

Here's what the shell says:

hmegies:owncloud holger$ sudo -u _www php occ upgrade
Password:
ownCloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
2018-05-07T13:21:19+00:00 Set log level to debug
2018-05-07T13:21:19+00:00 Repair step: Repair MySQL database engine
2018-05-07T13:21:19+00:00 Repair step: Repair MySQL collation
2018-05-07T13:21:19+00:00 Repair info: All tables already have the correct collation -> nothing to do
2018-05-07T13:21:19+00:00 Repair step: Repair SQLite autoincrement
2018-05-07T13:21:19+00:00 Repair step: Repair orphaned reshare
2018-05-07T13:21:19+00:00 Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'DELETE FROM oc_share WHERE parent NOT IN (SELECT id FROM (SELECT id FROM oc_share ORDER BY id ASC) mysqlerr1093hack)':

SQLSTATE[HY000]: General error: 1093 You can't specify target table 'oc_share' for update in FROM clause
2018-05-07T13:21:19+00:00 Update failed
2018-05-07T13:21:19+00:00 Maintenance mode is kept active
2018-05-07T13:21:19+00:00 Reset log level
hmegies:owncloud holger$

I managed to return to my running version 10.0.7 from my backup.

Then I followed the instructions on manually upgrading on the command line as laid out here: https://doc.owncloud.org/server/10.0/admin_manual/maintenance/manual_upgrade.html (Power user upgrade)

Additionally I tried turning off the query optimizer as suggested here: https://github.com/owncloud/core/issues/31377#issuecomment-387093794

Still no success and always the same error message.

Does anyone have an idea what to do?

Thanks in advance