Page MenuHomePhabricator

Inconsistencies in Database dewiki.p
Closed, ResolvedPublic

Description

USE dewiki_p;
/* Info: the category page 'See_in_den_Vestfoldbergen' (namespace 14) is a subcategory page of 'Vestfoldberge' (namespace 14) */
SELECT page_namespace FROM page WHERE page_title = 'See_in_den_Vestfoldbergen';
/* gives --> 14 */
SELECT cat_subcats FROM category WHERE cat_title = 'Vestfoldberge';
/* gives --> 0 */
/* !!! How can that give 0, if 'See_in_den_Vestfoldbergen' is a subcat of 'Vestfoldberge'? !!! */

My question is, why are there two different results in both the database tables 'page' and 'category'.

There are some more erroneous pairs in dewiki_p:

  1. https://de.wikipedia.org/w/index.php?title=Kategorie:Katsushika&action=info has 1 subcategory but SELECT cat_subcats gives 0.
  2. https://de.wikipedia.org/w/index.php?title=Kategorie:Norton_County&action=info has 1 subcategory but SELECT cat_subcats gives 0.
  3. https://de.wikipedia.org/w/index.php?title=Kategorie:Erfrischungsgetränk&action=info has 1 subcategory but SELECT cat_subcats gives 0.
  4. https://de.wikipedia.org/w/index.php?title=Kategorie:FIA-Langstrecken-Weltmeisterschaft_2018/19&action=info has 1 subcategory but SELECT cat_subcats gives 0.
  5. https://de.wikipedia.org/w/index.php?title=Kategorie:Organisation_(Benton_County,_Washington)&action=info has 1 subcategory but SELECT cat_subcats gives 0.
  6. https://de.wikipedia.org/w/index.php?title=Kategorie:Organisation_(Christchurch)&action=info has 1 subcategory but SELECT cat_subcats gives 0.
  7. https://de.wikipedia.org/w/index.php?title=Kategorie:Person_(Tyler,_Texas)&action=info has 1 subcategory but SELECT cat_subcats gives 0.

... and some more

Event Timeline

@Bugreporter: IMHO this task is not a duplicate of T228585, because the problem/the bug is not mentioned there.

Marostegui subscribed.

Removing the DBA tag as this is not an actionable for the DBAs. We have no context on whether the data is showing what it should or not. That requires some MW expert.

I tested several eventualities, and could find out: database table 'categories', column 'cat_subcats' starts by -1. If there are 2 subcategory pages, then 'cat_subcats' returns 1.

Urbanecm subscribed.

@Bugreporter: IMHO this task is not a duplicate of T228585, because the problem/the bug is not mentioned there.

Agreed

Mentioned in SAL (#wikimedia-operations) [2019-11-18T12:47:04Z] <Urbanecm> Run mwscript recountCategories.php --wiki=dewiki --mode=subcats (T238500)

Mentioned in SAL (#wikimedia-operations) [2019-11-18T12:48:03Z] <Urbanecm> Run mwscript recountCategories.php --wiki=dewiki --mode=pages (T238500)

Mentioned in SAL (#wikimedia-operations) [2019-11-18T12:48:17Z] <Urbanecm> Run mwscript recountCategories.php --wiki=dewiki --mode=files (T238500)

Urbanecm claimed this task.

Recounted, listed examples seems to be fine. Reopen if there's an issue!

@Urbanecm: Thank you, but what about all the other language wikis?

@Urbanecm: I should reopen, if there is one more issue. Please take a look at https://de.wikipedia.org/w/index.php?title=Kategorie:Crurotarsi - it has one subcategory that is also not counted/or added to -1.

The script itself has an issue, I've tried to re-run it once, but no changes. FIlled as T238634.