Fix for tinyint(1)'s not accepting ''

These boolean values go through DatabaseBase::makeList,
which passes them along to DatabaseBase::addQuotes, which
shoves the value through DatabaseMysqlBase::strencode,
which in turn passes it on to DatabaseMysqli::mysqlRealEscapeString,
which eventually calls mysqli::real_escape_string on it.

This last one will turn trues into '1' and falses into ''.
MySQL (or at least my version, 5.6.17 Homebrew) complains about
receiving incorrect integer value '' for these tinyint(1) columns.

Bug: T67807
Change-Id: Iaef98c08589370f9288c1f3c80803b1a16b2506e
This commit is contained in:
Matthias Mullie 2014-05-27 15:29:27 +02:00 committed by Nikerabbit
parent ff18e8a06c
commit 8a9fccbcc8

View file

@ -151,6 +151,14 @@ class AbuseFilterViewEdit extends AbuseFilterView {
$newRow['af_throttled'] = $newRow['af_throttled'] && !$newRow['af_enabled'];
$newRow['af_id'] = $new_id; // ID.
// T67807
// integer 1's & 0's might be better understood than booleans
$newRow['af_enabled'] = (int) $newRow['af_enabled'];
$newRow['af_hidden'] = (int) $newRow['af_hidden'];
$newRow['af_throttled'] = (int) $newRow['af_throttled'];
$newRow['af_deleted'] = (int) $newRow['af_deleted'];
$newRow['af_global'] = (int) $newRow['af_global'];
$dbw->replace( 'abuse_filter', array( 'af_id' ), $newRow, __METHOD__ );
if ( $is_new ) {