Steps to reproduce
- Run php .\maintenance\update.php --quick (have also tried php .\maintenance\update.php --quick --force)
What happens
A SQL syntax error is returned while running patch-cleanup-push_subscription-foreign-keys-indexes.sql (Echo) — added in rECHOd35c502b60cd: schema: Drop foreign keys from table echo_push_subscription (T306473)
Running extensions/Echo/maintenance/updateEchoSchemaForSuppression.php... ...Update 'UpdateEchoSchemaForSuppression' already logged as completed. Use --force to run it again. done. ...echo_event table does not contain event_page_namespace field. ...echo_event table does not contain event_page_title field. ...echo_notification table does not contain notification_bundle_base field. ...echo_notification table does not contain notification_bundle_display_hash field. ...echo_notification_user_hash_timestamp key doesn't exist. ...echo_push_provider table already exists. ...echo_push_subscription table already exists. ...echo_push_topic table already exists. Modifying table echo_push_subscription...Wikimedia\Rdbms\DBQueryError from line 1748 of A:\wikimedia\mediawiki-local\includes\libs\rdbms\database\Database.php: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS `echo_push_subscription_ibfk_1`' at line 1 Function: Wikimedia\Rdbms\Database::sourceFile( A:\wikimedia\mediawiki-local\extensions\Echo/sql/mysql/patch-cleanup-push_subscription-foreign-keys-indexes.sql ) Query: ALTER TABLE `echo_push_subscription` DROP FOREIGN KEY IF EXISTS `echo_push_subscription_ibfk_1` #0 A:\wikimedia\mediawiki-local\includes\libs\rdbms\database\Database.php(1732): Wikimedia\Rdbms\Database->getQueryException('You have an err...', 1064, 'ALTER TABLE `ec...', 'Wikimedia\\Rdbms...') #1 A:\wikimedia\mediawiki-local\includes\libs\rdbms\database\Database.php(1706): Wikimedia\Rdbms\Database->getQueryExceptionAndLog('You have an err...', 1064, 'ALTER TABLE `ec...', 'Wikimedia\\Rdbms...') #2 A:\wikimedia\mediawiki-local\includes\libs\rdbms\database\Database.php(1082): Wikimedia\Rdbms\Database->reportQueryError('You have an err...', 1064, 'ALTER TABLE `ec...', 'Wikimedia\\Rdbms...', false) #3 A:\wikimedia\mediawiki-local\includes\libs\rdbms\database\Database.php(3429): Wikimedia\Rdbms\Database->query('ALTER TABLE `ec...', 'Wikimedia\\Rdbms...') #4 A:\wikimedia\mediawiki-local\includes\libs\rdbms\database\Database.php(3368): Wikimedia\Rdbms\Database->sourceStream(Resource id #971, NULL, NULL, 'Wikimedia\\Rdbms...', NULL) #5 A:\wikimedia\mediawiki-local\includes\libs\rdbms\database\DBConnRef.php(109): Wikimedia\Rdbms\Database->sourceFile('A:\\wikimedia\\me...') #6 A:\wikimedia\mediawiki-local\includes\libs\rdbms\database\DBConnRef.php(799): Wikimedia\Rdbms\DBConnRef->__call('sourceFile', Array) #7 A:\wikimedia\mediawiki-local\includes\installer\DatabaseUpdater.php(718): Wikimedia\Rdbms\DBConnRef->sourceFile('A:\\wikimedia\\me...') #8 A:\wikimedia\mediawiki-local\includes\installer\DatabaseUpdater.php(1034): DatabaseUpdater->applyPatch('A:\\wikimedia\\me...', true, 'Modifying table...') #9 A:\wikimedia\mediawiki-local\includes\installer\DatabaseUpdater.php(547): DatabaseUpdater->modifyTable('echo_push_subsc...', 'A:\\wikimedia\\me...', true) #10 A:\wikimedia\mediawiki-local\includes\installer\DatabaseUpdater.php(515): DatabaseUpdater->runUpdates(Array, true) #11 A:\wikimedia\mediawiki-local\maintenance\update.php(202): DatabaseUpdater->doUpdates(Array) #12 A:\wikimedia\mediawiki-local\maintenance\includes\MaintenanceRunner.php(309): UpdateMediaWiki->execute() #13 A:\wikimedia\mediawiki-local\maintenance\doMaintenance.php(85): MediaWiki\Maintenance\MaintenanceRunner->run() #14 A:\wikimedia\mediawiki-local\maintenance\update.php(312): require_once('A:\\wikimedia\\me...') #15 {main}
What should have happened instead
Update runs successfully
Software
MediaWiki 1.39.0-alpha (1862dd5) PHP 8.0.3 (apache2handler) MySQL 5.7.24 ICU 68.1
Extensions
All had a git pull prior to running this.
wfLoadExtension( 'Echo' ); wfLoadExtension( 'LoginNotify' ); wfLoadExtension( 'AbuseFilter' ); wfLoadExtension( 'CheckUser' ); wfLoadExtension( 'Interwiki' ); wfLoadExtension( 'QuickSurveys' ); wfLoadExtension( 'WikiEditor' ); wfLoadExtension( 'CodeMirror' ); wfLoadExtension( 'CodeEditor' ); wfLoadExtension( 'Phonos' ); wfLoadExtension( 'EventLogging' ); wfLoadExtension( 'GlobalPreferences' ); wfLoadExtension( 'PageTriage' );
Table echo_push_subscription
CREATE TABLE `echo_push_subscription` ( `eps_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `eps_user` INT(10) UNSIGNED NOT NULL, `eps_token` BLOB NOT NULL, `eps_token_sha256` BINARY(64) NOT NULL, `eps_provider` TINYINT(3) UNSIGNED NOT NULL, `eps_updated` TIMESTAMP NOT NULL, `eps_data` BLOB NULL DEFAULT NULL, `eps_topic` TINYINT(3) UNSIGNED NULL DEFAULT NULL, PRIMARY KEY (`eps_id`) USING BTREE, UNIQUE INDEX `eps_token_sha256` (`eps_token_sha256`) USING BTREE, INDEX `eps_provider` (`eps_provider`) USING BTREE, INDEX `eps_topic` (`eps_topic`) USING BTREE, INDEX `echo_push_subscription_user_id` (`eps_user`) USING BTREE, INDEX `echo_push_subscription_token` (`eps_token`(10)) USING BTREE, CONSTRAINT `echo_push_subscription_ibfk_1` FOREIGN KEY (`eps_provider`) REFERENCES `echo_push_provider` (`epp_id`) ON UPDATE RESTRICT ON DELETE RESTRICT, CONSTRAINT `echo_push_subscription_ibfk_2` FOREIGN KEY (`eps_topic`) REFERENCES `echo_push_topic` (`ept_id`) ON UPDATE RESTRICT ON DELETE RESTRICT ) COLLATE='binary' ENGINE=InnoDB;