Currently I only know that this problem exist in my wiki, not sure whether will others experience same problem during their upgrade or not.
I have** $wgSharedDB = 'wikidata'; ** in localsettings and the database user used for upgrade have full Permissions for database "mainwiki" & "wikidata".
I tried to upgrade the wikidatabase by:
php /wiki/maintenance/update.php --dbuser root --dbpass ****************** --conf /wiki/LocalSettings.php --doshared --wiki mainwiki
and it return following error message:
> Creating interwiki table ...[1d159d68c65e6cbd8a3b399a] [no req] DBQueryError from line 1054 of /wiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
> Query: CREATE TABLE `wikidata`.`interwiki` (
> iw_prefix varchar(32) NOT NULL,
> iw_url blob NOT NULL,
> iw_local BOOL NOT NULL,
> UNIQUE KEY iw_prefix (iw_prefix)
> ) ENGINE=InnoDB
>
> Function: Database::sourceFile( /wiki/maintenance/archives/patch-interwiki.sql )
> Error: 1050 Table 'interwiki' already exists (localhost:3306)
>
> Backtrace:
> #0 /wiki/includes/libs/rdbms/database/Database.php(912): Database->reportQueryError(string, integer, string, string, boolean)
> #1 /wiki/includes/libs/rdbms/database/Database.php(3136): Database->query(string, string)
> #2 /wiki/includes/libs/rdbms/database/Database.php(3084): Database->sourceStream(unknown type, NULL, NULL, string, NULL)
> #3 /wiki/includes/installer/DatabaseUpdater.php(690): Database->sourceFile(string)
> #4 /wiki/includes/installer/MysqlUpdater.php(364): DatabaseUpdater->applyPatch(string, boolean, string)
> #5 /wiki/includes/installer/DatabaseUpdater.php(472): MysqlUpdater->doInterwikiUpdate()
>
> #6 /wiki/includes/installer/DatabaseUpdater.php(433): DatabaseUpdater->runUpdates(array, boolean)
> #7 /wiki/maintenance/update.php(172): DatabaseUpdater->doUpdates(array)
> #8 /wiki/maintenance/doMaintenance.php(111): UpdateMediaWiki->execute()
> #9 /wiki/maintenance/update.php(217): require_once(string)
> #10 {main}
It seems that the update.php were failed to detect the exist of tables in shared database, which resulting attempts to create tables that already exist in shared database.
(wrong sql patch used include but not limited to: patch-antispoof.mysql.sql, patch-interwiki.sql, patch-user_groups.sql, and patch-user_properties.sql )