wiki.techinc.nl/tests/phpunit/includes/specialpage
Tim Starling 673d496f2d Have Database::addQuotes() pass through bare integers without quoting
Quotes started being added to integers in r4984 (August 2004). Before
that, is_numeric() was used to determine whether to add quotes, so
quotes were omitted from numeric strings, which is obviously wrong.

The idea here is to use the type of the variable to hint to the database
as to whether quotes are needed. The results are somewhat inconsistent,
since some callers do not convert numeric strings obtained from user
input to integers. That makes it a more conservative change. Callers can
opt out of unquoted integers by casting them to string.

The reason for doing this is that quoting integers turns out to be not
as harmless as originally assumed. We found a case of it confusing the
MariaDB query planner, causing inappropriate indexes to be used.

I also made addQuotes() consistently return a string, instead of
returning an integer for boolean values. This was already the case for
MySQL, but it seems like a good idea everywhere.

Bug: T238378
Change-Id: I70473280f542ee5ecd79e187f580807410fbd548
2019-11-18 11:40:28 +11:00
..
AbstractChangesListSpecialPageTestCase.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
ChangesListSpecialPageTest.php Have Database::addQuotes() pass through bare integers without quoting 2019-11-18 11:40:28 +11:00
FormSpecialPageTestCase.php Stop accessing User::mBlock and User::mBlockedby from tests 2019-10-15 15:05:53 +00:00
SpecialPageFactoryTest.php Support the creation of special pages with services injected 2019-09-08 12:57:54 +02:00
SpecialPageTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
SpecialPageTestHelper.php Add test cases to SpecialPageFactoryTest for registration via callback 2014-11-01 02:06:24 +01:00