Steps to replicate the issue (include links if applicable):
- Go to Special:CargoQuery
- Enter a table into "Table(s)", IF(_pageNamespace = NULL, 'A', `RAND`())=out into "Field(s)", and 1 into "Limit"
- Submit the query
What happens?
I get a random number:
What should have happened instead?
I should've gotten "Error: The SQL function "RAND()" is not allowed."
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
- MediaWiki: 1.42.1 (61e9a5b); 21:29, 12 July 2024
- PHP: 8.2.20 (fpm-fcgi)
- MariaDB: 10.11.6-MariaDB-1:10.11.6+maria~deb12-log
- Cargo: 3.6 (e926bd0); 07:23, 15 July 2024
Other information (browser name/version, screenshots, etc.):
I know that this (at least) affects Miraheze, so I'll add affects-Miraheze and will subscribe a Miraheze tech team member.
This was tested on a Miraheze-hosted wiki, but the wiki in question does not allow RAND():
Miraheze issue tracker task: https://issue-tracker.miraheze.org/T12371

