From 609ad548356c595e8a2f8fbf70ea8ae7a0965e18 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 21 Aug 2008 13:10:19 +0000 Subject: [PATCH] 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. --- includes/db/DatabasePostgres.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index bf948c9d46..70a635bdf7 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -1271,6 +1271,8 @@ END; function addQuotes( $s ) { if ( is_null( $s ) ) { return 'NULL'; + } else if ( is_bool( $s ) ) { + return intval( $s ); } else if ($s instanceof Blob) { return "'".$s->fetch($s)."'"; } -- 2.20.1