Page MenuHomePhabricator

Triple equals comparison to RC_LOG et. al. on sqlite fails as sqlite returns a string.
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Load Special:CheckUser using 'Get edits' while using sqlite as the DB
  • Scroll to a edit which does not have an associated title

What happens?:
The title shows as '0' with a namespace.

What should have happened instead?:
There should be no title.

Software version (skip for WMF-hosted wikis like Wikipedia):
Checkuser on the master branch

Other information (browser name/version, screenshots, etc.):

image.png (807×1 px, 284 KB)

Event Timeline

var_export'ing the $row->cuc_title shows that the value is

'0'

Unless I've missed something in git blame, no recent enough patches have modified the code that CheckUser uses to render the title. I pulled in core a few days ago, but only noticed it now.

Caused by I59bef877da304cf14e9b92a52bc976c3581d9ec0

Dreamy_Jazz renamed this task from CU changes entries without a title show the title '0' to Triple equals comparison to RC_LOG et. al. on sqlite fails as sqlite returns a string..Aug 15 2022, 12:15 PM
Dreamy_Jazz removed a project: Regression.

I've dived into this a bit more. My sqlite DB has the default for cuc_type as the string '0'. This is likely something left over before CheckUser used the abstract schema.

Okay. Because when I created this sqlite DB the schema was before the abstract schema, it used the mysql.sql file. This had the line for cuc_type:

cuc_type tinyint(3) unsigned NOT NULL default '0',

Therefore, when the value is not set the default in sqlite DBs is '0'. Code needs to be added to the Hooks.php file to address this. In the mean time and until the values can be fixed, the double equal signs are going to have to stay at least for sqlite unfortunately.

Change 823151 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Revert some triple equal checks due to incompatabilities on sqlite

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

Change 823151 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Revert some triple equal checks due to incompatabilities on sqlite

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

Dreamy_Jazz claimed this task.

The mediawiki database layer returns everything as string, even it is integer in the database.

Ah. Okay. Thanks for that information.