Yosnoop has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59046


Change subject: Add quotes properly in the PostgreSQL
......................................................................

Add quotes properly in the PostgreSQL

Due to a change in PostgreSQL 9.2
http://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.2#Remove_hstore.27s_.3D.3E_operator

We have the following error in, e.g. "Contributions", pages:
A database query syntax error has occurred. This may indicate a bug in the
software. The last attempted database query was:

    (SQL query hidden)

from within function "Block::newLoad". Database returned error "42883: ERROR:
operator does not exist: text <= integer LINE 1: ...(ipb_range_start LIKE '%' )
AND (ipb_range_start <= 0) AND ... ^ HINT: No operator matches the given name
and argument type(s). You might need to add explicit type casts. ".

Change-Id: I4a014d67d01c35bdac5aac4cc35a2f5f02cfc0d9
---
M includes/db/DatabasePostgres.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/59046/1

diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php
index 52fab13..17bde36 100644
--- a/includes/db/DatabasePostgres.php
+++ b/includes/db/DatabasePostgres.php
@@ -1336,7 +1336,7 @@
                if ( is_null( $s ) ) {
                        return 'NULL';
                } elseif ( is_bool( $s ) ) {
-                       return intval( $s );
+                       return "'" . intval( $s ) . "'";
                } elseif ( $s instanceof Blob ) {
                        return "'" . $s->fetch( $s ) . "'";
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/59046
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a014d67d01c35bdac5aac4cc35a2f5f02cfc0d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Yosnoop <yosn...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to