r39763 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39762‎ | r39763 | r39764 >
Date:13:10, 21 August 2008
Author:greg
Status:old
Tags:
Comment:
Force inserted bools to be ints, per Tim's suggestion on bug 15148.
This should be fine for now as Postgres uses SMALLINTs for BOOLs, to
match MySQLs BOOL/TINYINT aliasing and subsequent MW coding assumptions.
It's possible this will cause bad effects if inserted values are called
in a boolean context when they are going into a non-SMALLINT column, but we can handle
those as they come up.
Modified paths:
  • /trunk/phase3/includes/db/DatabasePostgres.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabasePostgres.php
@@ -1271,6 +1271,8 @@
12721272 function addQuotes( $s ) {
12731273 if ( is_null( $s ) ) {
12741274 return 'NULL';
 1275+ } else if ( is_bool( $s ) ) {
 1276+ return intval( $s );
12751277 } else if ($s instanceof Blob) {
12761278 return "'".$s->fetch($s)."'";
12771279 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r40515Fixed bug 15148, total breakage of Special:BlockIP on PostgreSQL:...tstarling07:05, 6 September 2008
r40517Fixed bug 15148, Special:BlockIP broken for PostgreSQL. Backport of r40515.tstarling07:14, 6 September 2008

Status & tagging log