Page MenuHomePhabricator

dewiki_p Bug in COLUMN cat_subcats of TABLE category
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

SELECT cat_subcats
FROM category
WHERE cat_title = 'Crurotarsi';

What happens?:
Following happens for two years now:
the result is 0, but there is 1 subcat: 'Crocodylomorpha' ; https://de.wikipedia.org/wiki/Kategorie:Crurotarsi

What should have happened instead?:
The query should be 1 instead for the subcat 'Crocodylomorpha' ; https://de.wikipedia.org/wiki/Kategorie:Crurotarsi

This bug is reproducable.


Similar bugs in dewiki_p:

SELECT cat_subcats
FROM category
WHERE cat_title = 'Historienfilm';

gives 0, but should give 1
https://de.wikipedia.org/wiki/Kategorie:Historienfilm

SELECT cat_subcats
FROM category
WHERE cat_title = 'Person_(Schotten,_Stadt)';

gives 0, but should give 1
https://de.wikipedia.org/wiki/Kategorie:Person_(Schotten,_Stadt)

SELECT cat_subcats
FROM category
WHERE cat_title = 'Person_(Bundesgesundheitsamt)';

gives 0, but should give 1
https://de.wikipedia.org/wiki/Kategorie:Person_(Bundesgesundheitsamt)

Event Timeline

doctaxon triaged this task as High priority.Sep 8 2021, 8:51 PM
Reedy claimed this task.
Reedy subscribed.
reedy@mwmaint2002:~$ mwscript recountCategories.php --wiki=dewiki --mode=subcats
Finding up to 500 drifted rows greater than cat_id 0...
Updating cat_subcats field on 28 rows...
Finding up to 500 drifted rows greater than cat_id 21022418...
Done! Updated the subcats counts of 28 categories.
Now run the script using the other --mode options if you haven't already.
reedy@mwmaint2002:~$ mwscript recountCategories.php --wiki=dewiki --mode=files
Finding up to 500 drifted rows greater than cat_id 0...
Done! Updated the files counts of 0 categories.
Now run the script using the other --mode options if you haven't already.
reedy@mwmaint2002:~$ mwscript recountCategories.php --wiki=dewiki --mode=pages
Finding up to 500 drifted rows greater than cat_id 0...
Updating cat_pages field on 3 rows...
Finding up to 500 drifted rows greater than cat_id 21014551...
Done! Updated the pages counts of 3 categories.
Now run the script using the other --mode options if you haven't already.
Also run 'php cleanupEmptyCategories.php --mode remove' to remove empty,
nonexistent categories from the category table.
wikiadmin@10.192.16.124(dewiki)> SELECT cat_subcats
    -> FROM category
    -> WHERE cat_title = 'Crurotarsi';
+-------------+
| cat_subcats |
+-------------+
|           1 |
+-------------+
1 row in set (0.00 sec)

wikiadmin@10.192.16.124(dewiki)> SELECT cat_subcats
    -> FROM category
    -> WHERE cat_title = 'Historienfilm';
+-------------+
| cat_subcats |
+-------------+
|           1 |
+-------------+
1 row in set (0.00 sec)

wikiadmin@10.192.16.124(dewiki)> SELECT cat_subcats
    -> FROM category
    -> WHERE cat_title = 'Person_(Schotten,_Stadt)';
+-------------+
| cat_subcats |
+-------------+
|           1 |
+-------------+
1 row in set (0.00 sec)

wikiadmin@10.192.16.124(dewiki)> SELECT cat_subcats
    -> FROM category
    -> WHERE cat_title = 'Person_(Bundesgesundheitsamt)';
+-------------+
| cat_subcats |
+-------------+
|           1 |
+-------------+
1 row in set (0.00 sec)

wikiadmin@10.192.16.124(dewiki)>

Thank you @Reedy

My opinion about this: these scripts should run automatically to keep the database tables up to date.

What is your opinion about this?

Kind regards

My opinion about this: these scripts should run automatically to keep the database tables up to date.

These drifts don't tend to happen too much, but they do happen occasionally. Even on a wiki of a decent size like dewiki they were pretty quick to run.

I don't see any reason why they can't be run on a semi-regular basis (monthly?) like we do with other maintenance scripts

Feel free to file a seperate task asking for that