Database: Have buildStringCast() actually cast for MySQL, MSSQL
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 20 Feb 2019 19:41:55 +0000 (14:41 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 20 Feb 2019 19:52:20 +0000 (14:52 -0500)
commit7fbd971f2d8e803d689c7635d1564a5532d46618
treeba7f16933fcb59ccf1eaca83b64212e3fc6a07ab
parent8445510fbe64c5125ce85e544855b29a576b0282
Database: Have buildStringCast() actually cast for MySQL, MSSQL

While these databases allow implicit casts (at least from int to
string), in MySQL at least the implicit cast can prevent appropriate
index usage (see T216183). So let's have buildStringCast() actually do
the cast.

This also changes the base implementation in Wikimedia\Rdmbs\Database to
explicitly cast. Any other subclasses should check whether this new
version works for them.

Bug: T216247
Change-Id: I98c67c857b35de3191d47ab28810d8eb21ddbbc8
RELEASE-NOTES-1.33
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMssql.php
includes/libs/rdbms/database/DatabaseMysqlBase.php