When the setting for sharding is on, the script actually flush all
values to the first row. Since this is being ran regularly in
production, it has been causing drifts between values and reality.
Tested locally, works fine.
Bug: T315693
Change-Id: Id9fe16eecd153b4ba2b7d28baadec3a9a44b4ee1
Use name constants instead of string literals in calls to Config::get
and ServiceOptions::get, when referring to core configuration variables.
This protects against typos and makes the decumentation and schema
declaration of the config settings discoverable.
This is the first batch, only touching files directly under /includes/
Change-Id: I7252e636c7c86d950d9257b33491af492c6dd5eb
Queries that query a value "1" are expected to return either
that "1" (possibly as a string), or false. It's safe to simply
cast this to bool and use it as it is.
Queries for COUNT(*) are expected to return that number,
possibly as a string. It's not possible for such a query to
return false. And even if, casting to 0 is fine.
I found an existing code style where the table name and the
"1" are on the same line as the selectField() method name, and
applied it to all similar queries.
Change-Id: I9453196281871c03ef03f653f43762eb9284342f
It does not make sense to assign the unique ID when merging rows.
Since is was using the same value as the old row, it was a no-op
in terms of that column,
Change-Id: I11dfc92831bcb6387d114107a5a86c4bee493e67
We have three methods for page counting currently supported for wikitext
non-redirect pages; 'any' counts any page that exists, 'link' counts any
page that has any outbound links, and 'comma' which searches for any ','
in the text having loaded it. This last option is much slower than these
other two, and is only used on a very small number of installations. Now
by dropping support for this method we can simplify this code and so run
it more often. Note that non-wikitext pages already did not support this
count method.
Installations with this setting set to 'comma', or any other string will
now work as if it was configured with 'any'.
Bug: T188472
Change-Id: I965927edcd2485ec4b49b2d80fdf216dbf19520b
* Instead of returning all zeroes, just use zero for the
negative values in the row.
* Allow large numbers since the fields are BIGINT.
* Clean up the return types to truly be integers.
* Respect the $groups argument in SiteStatsInit::getDB().
Bug: T186947
Change-Id: I51fdc45124c12aba114540fc0ec66a3e63d61e09
* Mark method visibility
* Remove unused code/methods
* Use WAN cache process cache in pagesInNs()
* Remove "m" prefix from SiteStatsInit fields
* Avoid use of $wg variables
Change-Id: Iab4001f02c9b2e8667ca4bac033fd4f6ef272148