Page MenuHomePhabricator

Add new PKs to tables.sql (mysql and sqlite)
Closed, ResolvedPublic

Description

Creating this task to specifically discuss how we should proceed to be able to merge: https://gerrit.wikimedia.org/r/#/c/370190/1 (we are coming from: T172485#3500757 and T17441#3500739
To sum up, we, DBAs, have finished converting UNIQUE into PRIMARY keys and we would like this to be reflected on tables.sql so future wikis are created with the same PKs that we have deployed in core.

I have been chatting with @Reedy and we thought it was better to discuss here rather than hijack other tasks as this is specifically for mediawiki core.
The statements we have used to alter the affected tables are:

ALTER TABLE /*_*/categorylinks DROP KEY /*i*/cl_from, ADD PRIMARY KEY (cl_from,cl_to);
ALTER TABLE /*_*/templatelinks DROP INDEX /*i*/tl_from, ADD PRIMARY KEY (tl_from,tl_namespace,tl_title);
ALTER TABLE /*_*/pagelinks DROP INDEX /*i*/pl_from, ADD PRIMARY KEY (pl_from,pl_namespace,pl_title);
ALTER TABLE /*_*/text DROP KEY /*i*/old_id, ADD PRIMARY KEY (old_id);
ALTER TABLE /*_*/imagelinks DROP KEY /*i*/il_from, ADD PRIMARY KEY (il_from,il_to);
ALTER TABLE /*_*/iwlinks DROP KEY /*i*/iwl_from, ADD PRIMARY KEY (iwl_from,iwl_prefix,iwl_title);
ALTER TABLE /*_*/langlinks DROP KEY /*i*/ll_from, ADD PRIMARY KEY (ll_from,ll_lang);
ALTER TABLE /*_*/log_search DROP KEY /*i*/ls_field_val, ADD PRIMARY KEY (ls_field,ls_value,ls_log_id);
ALTER TABLE /*_*/module_deps DROP KEY /*i*/md_module_skin, ADD PRIMARY KEY (md_module,md_skin);
ALTER TABLE /*_*/objectcache DROP KEY /*i*/keyname, ADD PRIMARY KEY (keyname);
ALTER TABLE /*_*/querycache_info DROP KEY /*i*/qci_type, ADD PRIMARY KEY (qci_type);
ALTER TABLE /*_*/site_stats DROP KEY /*i*/ss_row_id, ADD PRIMARY KEY (ss_row_id);
ALTER TABLE /*_*/transcache DROP KEY /*i*/tc_url_idx, ADD PRIMARY KEY (tc_url);
ALTER TABLE /*_*/user_former_groups DROP KEY /*i*/ufg_user_group, ADD PRIMARY KEY (ufg_user,ufg_group);
ALTER TABLE /*_*/user_properties DROP KEY /*i*/user_properties_user_property, ADD PRIMARY KEY (up_user,up_property);

If someone more experienced with mediawiki core and its patches and deployment can help here, it would be great.

To be done at a later date/after (USE|FORCE|IGNORE) INDEX statements that are using the tl_from or pl_from indexes...

ALTER TABLE /*_*/templatelinks DROP INDEX /*i*/tl_from;
ALTER TABLE /*_*/pagelinks DROP INDEX /*i*/pl_from;

Done in https://gerrit.wikimedia.org/r/370241

Event Timeline

Change 370190 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[mediawiki/core@master] tables.sql: Convert UNIQUE keys into PK

https://gerrit.wikimedia.org/r/370190

Reedy updated the task description. (Show Details)Aug 4 2017, 1:24 PM
Marostegui updated the task description. (Show Details)Aug 4 2017, 1:27 PM
Reedy updated the task description. (Show Details)Aug 4 2017, 1:42 PM
Reedy updated the task description. (Show Details)
Reedy updated the task description. (Show Details)

I thinks these 3 where the conflicting ones, where there was hints referenced them:

ALTER TABLE categorylinks add primary key (cl_from,cl_to), drop key cl_from;
ALTER TABLE templatelinks add primary key (tl_from,tl_namespace,tl_title);
ALTER TABLE pagelinks add primary key (pl_from,pl_namespace,pl_title);

I think the first already changed the use into an ignore, while the other didn't drop the key (which should be ideal) because they are still used on the code (but the index duplication uses a huge number of memory resources). It would be nice to fix everything at the same time.

Sorry, I was wrong, it is log_search, not categorylinks that had some troubles: T17441#3231645

Reedy added a subscriber: jcrespo.Aug 4 2017, 4:23 PM

I think the first already changed the use into an ignore, while the other didn't drop the key (which should be ideal) because they are still used on the code (but the index duplication uses a huge number of memory resources). It would be nice to fix everything at the same time.

For sure it would. There's a fair amount of work to get a patch together for this for sqlite and for mysql, so we'll get that done first, and then we can look at making the amends to the patchset to fix up the other usages in core (and extensions if necessary), and make any final adjustments to the schema change patches to do all the drops before it gets actually merged.

Certainly if anyone wants to find/list any ignore/force index calls in core, so we can integrate them easily, that'd be helpful

Going to make a start now

Reedy updated the task description. (Show Details)Aug 4 2017, 4:34 PM
Reedy added a comment.Aug 4 2017, 4:39 PM
echo "ALTER TABLE /*_*/categorylinks DROP KEY /*i*/cl_from, ADD PRIMARY KEY (cl_from,cl_to);" > patch-categorylinks-fix-pk.sql
echo "ALTER TABLE /*_*/templatelinks ADD PRIMARY KEY (tl_from,tl_namespace,tl_title);" > patch-templatelinks-fix-pk.sql
echo "ALTER TABLE /*_*/pagelinks ADD PRIMARY KEY (pl_from,pl_namespace,pl_title);" > patch-pagelinks-fix-pk.sql
echo "ALTER TABLE /*_*/text DROP KEY /*i*/old_id, ADD PRIMARY KEY (old_id);" > patch-text-fix-pk.sql
echo "ALTER TABLE /*_*/imagelinks DROP KEY /*i*/il_from, ADD PRIMARY KEY (il_from,il_to);" > patch-imagelinks-fix-pk.sql
echo "ALTER TABLE /*_*/iwlinks DROP KEY /*i*/iwl_from, ADD PRIMARY KEY (iwl_from,iwl_prefix,iwl_title);" > patch-iwlinks-fix-pk.sql
echo "ALTER TABLE /*_*/langlinks DROP KEY /*i*/ll_from, ADD PRIMARY KEY (ll_from,ll_lang);" > patch-langlinks-fix-pk.sql
echo "ALTER TABLE /*_*/log_search DROP KEY /*i*/ls_field_val, ADD PRIMARY KEY (ls_field,ls_value,ls_log_id);" > patch-log_search-fix-pk.sql
echo "ALTER TABLE /*_*/module_deps DROP KEY /*i*/md_module_skin, ADD PRIMARY KEY (md_module,md_skin);" > patch-module_deps-fix-pk.sql
echo "ALTER TABLE /*_*/objectcache DROP KEY /*i*/keyname, ADD PRIMARY KEY (keyname);" > patch-objectcache-fix-pk.sql
echo "ALTER TABLE /*_*/querycache_info DROP KEY /*i*/qci_type, ADD PRIMARY KEY (qci_type);" > patch-querycache_info-fix-pk.sql
echo "ALTER TABLE /*_*/site_stats DROP KEY /*i*/ss_row_id, ADD PRIMARY KEY (ss_row_id);" > patch-site_stats-fix-pk.sql
echo "ALTER TABLE /*_*/transcache DROP KEY /*i*/tc_url_idx, ADD PRIMARY KEY (tc_url);" > patch-transcache-fix-pk.sql
echo "ALTER TABLE /*_*/user_former_groups DROP KEY /*i*/ufg_user_group, ADD PRIMARY KEY (ufg_user,ufg_group);" > patch-user_former_groups-fix-pk.sql
echo "ALTER TABLE /*_*/user_properties DROP KEY /*i*/user_properties_user_property, ADD PRIMARY KEY (up_user,up_property);" > patch-user_properties-fix-pk.sql
Reedy added a comment.Aug 4 2017, 5:05 PM
Targets
    Occurrences of ''USE INDEX'' in Directory /Users/reedy/PhpstormProjects/MediaWiki/core with mask '*.php'
Found Occurrences  (46 usages found)
    Usage in comments  (2 usages found)
        MediaWiki  (2 usages found)
            core/includes/api  (2 usages found)
                ApiQueryCategoryMembers.php  (1 usage found)
                    90 $this->addTables( [ 'page', 'categorylinks' ] ); // must be in this order for 'USE INDEX'
                ApiQueryExtLinksUsage.php  (1 usage found)
                    58 $this->addTables( [ 'page', 'externallinks' ] ); // must be in this order for 'USE INDEX'
    Usage in string constants  (44 usages found)
        MediaWiki  (44 usages found)
            core/includes  (2 usages found)
                CategoryViewer.php  (1 usage found)
                    342 'USE INDEX' => [ 'categorylinks' => 'cl_sortkey' ],
                Linker.php  (1 usage found)
                    1736 'USE INDEX' => [ 'revision' => 'page_timestamp' ],
            core/includes/actions  (2 usages found)
                HistoryAction.php  (2 usages found)
                    267 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit ]
                    425 'options' => [ 'USE INDEX' => [ 'revision' => 'page_timestamp' ] ],
            core/includes/api  (14 usages found)
                ApiQueryAllImages.php  (3 usages found)
                    278 $this->addOption( 'USE INDEX', [ 'image' => 'img_user_timestamp' ] );
                    280 $this->addOption( 'USE INDEX', [ 'image' => 'img_usertext_timestamp' ] );
                    283 $this->addOption( 'USE INDEX', [ 'image' => 'img_timestamp' ] );
                ApiQueryAllLinks.php  (1 usage found)
                    175 $this->addOption( 'USE INDEX', $this->useIndex );
                ApiQueryAllPages.php  (1 usage found)
                    210 $this->addOption( 'USE INDEX', 'name_title' );
                ApiQueryBacklinks.php  (1 usage found)
                    286 $this->addOption( 'USE INDEX', [ 'page' => 'PRIMARY' ] );
                ApiQueryBacklinksprop.php  (2 usages found)
                    269 $this->addOption( 'USE INDEX', [ $settings['linktable'] => $idxWithFromNS ] );
                    271 $this->addOption( 'USE INDEX', [ $settings['linktable'] => $idxNoFromNS ] );
                ApiQueryCategoryMembers.php  (2 usages found)
                    129 $this->addOption( 'USE INDEX', 'cl_timestamp' );
                    182 $this->addOption( 'USE INDEX', 'cl_sortkey' );
                ApiQueryDeletedrevs.php  (1 usage found)
                    252 'USE INDEX',
                ApiQueryExtLinksUsage.php  (1 usage found)
                    59 $this->addOption( 'USE INDEX', 'el_index' );
                ApiQueryLinks.php  (1 usage found)
                    140 $this->addOption( 'USE INDEX', $this->prefix . '_from' );
                ApiQueryUserContributions.php  (1 usage found)
                    367 $this->addOption( 'USE INDEX', $index );
            core/includes/db  (2 usages found)
                DatabaseOracle.php  (2 usages found)
                    1185 if ( isset( $options['USE INDEX'] ) && !is_array( $options['USE INDEX'] ) ) {
                    1186 $useIndex = $this->useIndexClause( $options['USE INDEX'] );
            core/includes/export  (4 usages found)
                WikiExporter.php  (4 usages found)
                    284 [ 'ORDER BY' => 'log_id', 'USE INDEX' => [ 'logging' => 'PRIMARY' ] ]
                    321 $opts['USE INDEX'] = [];
                    351 $opts['USE INDEX']['revision'] = 'rev_page_id';
                    381 $opts['USE INDEX']['page'] = 'PRIMARY';
            core/includes/filerepo/file  (1 usage found)
                LocalFile.php  (1 usage found)
                    1088 $opts['USE INDEX'] = [ 'oldimage' => 'oi_name_timestamp' ];
            core/includes/libs/rdbms/database  (4 usages found)
                Database.php  (4 usages found)
                    1275 if ( isset( $options['USE INDEX'] ) && is_string( $options['USE INDEX'] ) ) {
                    1276 $useIndex = $this->useIndexClause( $options['USE INDEX'] );
                    1350 $useIndexes = ( isset( $options['USE INDEX'] ) && is_array( $options['USE INDEX'] ) )
                    1351 ? $options['USE INDEX']
            core/includes/logging  (1 usage found)
                LogPager.php  (1 usage found)
                    312 $options['USE INDEX'] = [ 'logging' => 'PRIMARY' ];
            core/includes/page  (2 usages found)
                Article.php  (1 usage found)
                    1050 [ 'USE INDEX' => 'rc_timestamp' ]
                WikiPage.php  (1 usage found)
                    3102 [ 'USE INDEX' => 'page_timestamp',
            core/includes/revisiondelete  (1 usage found)
                RevDelRevisionList.php  (1 usage found)
                    74 'USE INDEX' => [ 'revision' => 'PRIMARY' ] // workaround for MySQL bug (T104313)
            core/includes/specials  (4 usages found)
                SpecialAllPages.php  (1 usage found)
                    211 'USE INDEX' => 'name_title',
                SpecialLinkSearch.php  (1 usage found)
                    214 'options' => [ 'USE INDEX' => $clause ]
                SpecialPrefixindex.php  (1 usage found)
                    206 'USE INDEX' => 'name_title',
                SpecialShortpages.php  (1 usage found)
                    52 $options = [ 'USE INDEX' => [ 'page' => 'page_redirect_namespace_len' ] ];
            core/includes/specials/pagers  (5 usages found)
                AllMessagesTablePager.php  (1 usage found)
                    208 [ 'USE INDEX' => 'name_title' ]
                CategoryPager.php  (1 usage found)
                    55 'options' => [ 'USE INDEX' => 'cat_title' ],
                ContribsPager.php  (1 usage found)
                    194 $options['USE INDEX'] = [ 'revision' => $index ];
                DeletedContribsPager.php  (1 usage found)
                    79 'options' => [ 'USE INDEX' => $index ]
                NewPagesPager.php  (1 usage found)
                    111 $options = [ 'USE INDEX' => [ 'recentchanges' => $rcIndexes ] ];
            core/maintenance  (1 usage found)
                rebuildFileCache.php  (1 usage found)
                    108 [ 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' ]
            core/tests/phpunit/includes/libs/rdbms/database  (1 usage found)
                DatabaseSQLTest.php  (1 usage found)
                    160 'options' => [ 'USE INDEX' => [ 'table' => 'X' ] ],
Targets
    Occurrences of ''FORCE INDEX'' in Directory /Users/reedy/PhpstormProjects/MediaWiki/core with mask '*.php'
Found Occurrences  (1 usage found)
    Usage in string constants  (1 usage found)
        MediaWiki  (1 usage found)
            core/tests/phpunit/includes/libs/rdbms/database  (1 usage found)
                DatabaseSQLTest.php  (1 usage found)
                    518 'selectOptions' => [ 'ORDER BY' => 'field', 'FORCE INDEX' => [ 'select_table1' => 'index1' ] ],
Targets
    Occurrences of 'IGNORE INDEX' in Directory /Users/reedy/PhpstormProjects/MediaWiki/core with mask '*.php'
Found Occurrences  (15 usages found)
    Usage in comments  (3 usages found)
        MediaWiki  (3 usages found)
            core/includes/libs/rdbms/database  (3 usages found)
                Database.php  (3 usages found)
                    1973 	 * which might have a JOIN and/or USE INDEX or IGNORE INDEX clause
                    2006 if ( isset( $ignore_index[$alias] ) ) { // has IGNORE INDEX?
                    2166 	 * IGNORE INDEX clause. Unlikely to be useful for anything but MySQL. This
    Usage in string constants  (12 usages found)
        MediaWiki  (12 usages found)
            core/includes  (2 usages found)
                Title.php  (2 usages found)
                    4083 'IGNORE INDEX' => 'rev_timestamp', // Probably needed for T159319
                    4131 'IGNORE INDEX' => 'rev_timestamp', // See T159319
            core/includes/db  (2 usages found)
                DatabaseOracle.php  (2 usages found)
                    1191 if ( isset( $options['IGNORE INDEX'] ) && !is_array( $options['IGNORE INDEX'] ) ) {
                    1192 $ignoreIndex = $this->ignoreIndexClause( $options['IGNORE INDEX'] );
            core/includes/libs/rdbms/database  (6 usages found)
                Database.php  (5 usages found)
                    1280 if ( isset( $options['IGNORE INDEX'] ) && is_string( $options['IGNORE INDEX'] ) ) {
                    1281 $ignoreIndex = $this->ignoreIndexClause( $options['IGNORE INDEX'] );
                    1354 isset( $options['IGNORE INDEX'] ) &&
                    1355 is_array( $options['IGNORE INDEX'] )
                    1357 ? $options['IGNORE INDEX']
                DatabaseMysqlBase.php  (1 usage found)
                    939 return "IGNORE INDEX (" . $this->indexName( $index ) . ")";
            core/includes/logging  (1 usage found)
                LogPager.php  (1 usage found)
                    311 $options['IGNORE INDEX'] = [ 'log_search' => 'ls_log_id' ];
            core/tests/phpunit/includes/libs/rdbms/database  (1 usage found)
                DatabaseSQLTest.php  (1 usage found)
                    169 'options' => [ 'IGNORE INDEX' => [ 'table' => 'X' ] ],
Reedy updated the task description. (Show Details)Aug 4 2017, 6:10 PM

And as SQLite doesn't use (IGNORE|FORCE|USE) INDEX, so we won't technically need to do a two step....

I'm gonna modify https://gerrit.wikimedia.org/r/#/c/370190/6 to drop the indexes in the same step

Though, as we're still transforming the mysql tables.sql... We're potentially going to create those indexes, so they'll still need dropping

However, I guess the unit test is going to still break... So we either need to add the two drops in the same gerrit patch..

Or just do the same for sqlite and mysql in both patches

MaxSem added a subscriber: MaxSem.Aug 4 2017, 6:30 PM
Reedy updated the task description. (Show Details)Aug 4 2017, 6:37 PM
Reedy added a comment.Aug 4 2017, 6:44 PM

However, I guess the unit test is going to still break... So we either need to add the two drops in the same gerrit patch..
Or just do the same for sqlite and mysql in both patches

Yeah, that's the case. Oh well.

Change 370241 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Also drop pagelinks.pl_from and templatelinks.tl_from indexes

https://gerrit.wikimedia.org/r/370241

Reedy added a subscriber: gerritbot.Aug 4 2017, 7:10 PM

Change 370241 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Also drop pagelinks.pl_from and templatelinks.tl_from indexes
https://gerrit.wikimedia.org/r/370241

Ok, so I fixed the issue in ApiQueryLinks, making it use PRIMARY for the links table it's bringing in. We don't need to IGNORE INDEX for the other two, as this works, pointing it at the right table

Do we merge 370241 into 370190 to stop it being a two pass change? :)

Needs a few modifications to 370190, which means less patches overall

Needs some RELEASE-NOTES overall too, but that's minor and can be done just before merging

Original unit test failures for prosperity. @jcrespo mentioned a log somewhere of errors. Need to make sure there's no other broken queries...

18:52:25 1) ApiQueryBasicTest::testProps
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  pl_from,pl_namespace,pl_title  FROM `unittest_pagelinks`  FORCE INDEX (pl_from)  WHERE pl_from = '7'  ORDER BY pl_namespace,pl_title LIMIT 11  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'pl_from' doesn't exist in table 'unittest_pagelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:61
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:253
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryTestBase.php:108
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryBasicTest.php:227
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 2) ApiQueryBasicTest::testAllTogether
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  pl_from,pl_namespace,pl_title  FROM `unittest_pagelinks`  FORCE INDEX (pl_from)  WHERE pl_from = '7'  ORDER BY pl_namespace,pl_title LIMIT 11  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'pl_from' doesn't exist in table 'unittest_pagelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:61
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:253
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryTestBase.php:108
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryBasicTest.php:256
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 3) ApiQueryBasicTest::testGenerator
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  pl_from,pl_namespace,pl_title  FROM `unittest_pagelinks`  FORCE INDEX (pl_from)  WHERE pl_from = '9'  ORDER BY pl_namespace,pl_title LIMIT 11  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'pl_from' doesn't exist in table 'unittest_pagelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:69
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiPageSet.php:180
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiPageSet.php:144
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:238
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryTestBase.php:108
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryBasicTest.php:297
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 4) ApiQueryContinue2Test::testA
18:52:25 Exception: g1p on 0
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:81
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php:64
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 Caused by
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  pl_from,pl_namespace,pl_title  FROM `unittest_pagelinks`  FORCE INDEX (pl_from)  WHERE pl_from IN ('14','15','16')   ORDER BY pl_from,pl_namespace,pl_title LIMIT 100  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'pl_from' doesn't exist in table 'unittest_pagelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:61
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:253
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:79
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php:64
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 5) ApiQueryContinueTest::testGen1Prop
18:52:25 Exception: G1P on 0
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:81
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:123
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 Caused by
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  pl_from,pl_namespace,pl_title  FROM `unittest_pagelinks`  FORCE INDEX (pl_from)  WHERE pl_from IN ('22','23','24','25','26')   ORDER BY pl_from,pl_namespace,pl_title LIMIT 100  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'pl_from' doesn't exist in table 'unittest_pagelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:61
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:253
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:79
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:123
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 6) ApiQueryContinueTest::testGen2Prop
18:52:25 Exception: G2P on 0
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:81
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:149
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 Caused by
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  pl_from,pl_namespace,pl_title  FROM `unittest_pagelinks`  FORCE INDEX (pl_from)  WHERE pl_from IN ('22','23','24','25','26')   ORDER BY pl_from,pl_namespace,pl_title LIMIT 100  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'pl_from' doesn't exist in table 'unittest_pagelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:61
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:253
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:79
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:149
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 7) ApiQueryContinueTest::testGen1Prop1List
18:52:25 Exception: G1P1L on 0
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:81
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:183
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 Caused by
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  pl_from,pl_namespace,pl_title  FROM `unittest_pagelinks`  FORCE INDEX (pl_from)  WHERE pl_from IN ('22','23','24','25','26')   ORDER BY pl_from,pl_namespace,pl_title LIMIT 100  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'pl_from' doesn't exist in table 'unittest_pagelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:61
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:253
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:79
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:183
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 8) ApiQueryContinueTest::testGen2Prop2List1Meta
18:52:25 Exception: G2P2L1M on 0
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:81
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:221
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 Caused by
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  pl_from,pl_namespace,pl_title  FROM `unittest_pagelinks`  FORCE INDEX (pl_from)  WHERE pl_from IN ('22','23','24','25','26')   ORDER BY pl_from,pl_namespace,pl_title LIMIT 100  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'pl_from' doesn't exist in table 'unittest_pagelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:61
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:253
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:79
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:221
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 9) ApiQueryContinueTest::testSameGenAndProp
18:52:25 Exception: G=P on 0
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:81
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:252
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
18:52:25 
18:52:25 Caused by
18:52:25 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
18:52:25 Query: SELECT  tl_from AS `pl_from`,tl_namespace AS `pl_namespace`,tl_title AS `pl_title`  FROM `unittest_templatelinks`  FORCE INDEX (tl_from)  WHERE tl_from = '22'  ORDER BY tl_namespace,tl_title LIMIT 100  
18:52:25 Function: ApiQueryLinks::run
18:52:25 Error: 1176 Key 'tl_from' doesn't exist in table 'unittest_templatelinks' (127.0.0.1:3306)
18:52:25 
18:52:25 
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1145
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:975
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/libs/rdbms/database/Database.php:1339
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryBase.php:386
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:143
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQueryLinks.php:69
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiPageSet.php:180
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiPageSet.php:144
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiQuery.php:238
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:1583
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/includes/api/ApiMain.php:515
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/ApiTestCase.php:99
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php:79
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:252
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:415
18:52:25 /home/jenkins/workspace/mediawiki-phpunit-hhvm-jessie/src/maintenance/doMaintenance.php:111
Reedy updated the task description. (Show Details)Aug 4 2017, 7:11 PM
Reedy added a comment.Aug 4 2017, 7:42 PM

For PostgreSQL...

Tables that already have a PK:
log_search
text (or rather pagecontent)
querycache_info.qci_type, site_stats.ss_row_id, transcache.tc_url have type UNIQUE

From https://www.postgresql.org/docs/8.1/static/ddl-constraints.html

Technically, a primary key constraint is simply a combination of a unique constraint and a not-null constraint. So, the following two table definitions accept the same data:

CREATE TABLE products (
    product_no integer UNIQUE NOT NULL,
    name text,
    price numeric
);
CREATE TABLE products (
    product_no integer PRIMARY KEY,
    name text,
    price numeric
);

So site_stats.ss_row_id and transcache.tc_url are effectively a PK, with slightly different syntax

Reedy added a comment.Aug 4 2017, 8:00 PM

For Oracle Database

Tables that already have a PK:
text (or rather pagecontent)
log_search

Change 370241 abandoned by Reedy:
Also drop pagelinks.pl_from and templatelinks.tl_from indexes

Reason:
squashing

https://gerrit.wikimedia.org/r/370241

Change 370190 merged by jenkins-bot:
[mediawiki/core@master] Convert UNIQUE keys into PRIMARY KEY

https://gerrit.wikimedia.org/r/370190

Reedy closed this task as Resolved.Aug 29 2017, 5:47 PM
Reedy claimed this task.
Reedy added a comment.Aug 29 2017, 5:53 PM
Renaming index cl_from into PRIMARY to table categorylinks ...done.
Renaming index tl_from into PRIMARY to table templatelinks ...done.
Renaming index pl_from into PRIMARY to table pagelinks ...done.
...index PRIMARY already set on text table.
Renaming index il_from into PRIMARY to table imagelinks ...done.
Renaming index iwl_from into PRIMARY to table iwlinks ...done.
Renaming index ll_from into PRIMARY to table langlinks ...done.
Renaming index ls_field_val into PRIMARY to table log_search ...done.
Renaming index md_module_skin into PRIMARY to table module_deps ...done.
...index PRIMARY already set on objectcache table.
Renaming index qci_type into PRIMARY to table querycache_info ...done.
Renaming index ss_row_id into PRIMARY to table site_stats ...done.
Renaming index tc_url_idx into PRIMARY to table transcache ...done.
Renaming index ufg_user_group into PRIMARY to table user_former_groups ...done.
Renaming index user_properties_user_property into PRIMARY to table user_properties ...done.

I don't actually remember adding them to objectcache or text... But maybe I did during testing

mysql> show indexes from mw_text;
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table   | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| mw_text |          0 | PRIMARY  |            1 | old_id      | A         |         580 |     NULL | NULL   |      | BTREE      |         |               |
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
1 row in set (0.00 sec)

mysql> show indexes from mw_objectcache;
+----------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table          | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+----------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| mw_objectcache |          0 | PRIMARY  |            1 | keyname     | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| mw_objectcache |          1 | exptime  |            1 | exptime     | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
+----------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.01 sec)
Reedy renamed this task from Add new PKs to tables.sql to Add new PKs to tables.sql (mysql and sqlite).Aug 29 2017, 5:54 PM
Reedy removed a project: Patch-For-Review.
Reedy removed projects: Oracle Database, MSSQL, PostgreSQL.
Reedy updated the task description. (Show Details)Aug 29 2017, 6:01 PM