ERROR: Upgrade failed: DB: Statement violates GTID consistency

I’m trying to upgrade from 2.4.8.4 to the latest version, and I’m getting the following error:

[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in /usr/home/luizborges/www/public_html/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
ERROR: Upgrade failed: DB: Statement violates GTID consistency: CREATE TABLE ... SELECT.

The client uses MySQL 8.0 and the server is using MySQL 5.7 with GTID enabled (and according to the admins, it has to remain enabled). A few google searches suggested that the problem is the SQL used and the best solution is to rewrite it.

What can I do?

Digging a little deeper I’ve found the culprit in [data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]

Here is the problematic query:
CREATE TABLE review_assignments_tmp AS (SELECT review_id FROM review_assignments WHERE cancelled = 1)

There is also the PHP Notice regarding variables as reference in /lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122

What to do?

Hi all,

This has also been posted at https://github.com/pkp/pkp-lib/issues/5133.

Regards,
Alec Smecher
Public Knowledge Project Team