Merge "Add test cases for digit grouping (commafy) in Polish"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 11 Oct 2017 01:46:04 +0000 (01:46 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 11 Oct 2017 01:46:04 +0000 (01:46 +0000)
includes/libs/rdbms/database/DatabaseMssql.php
includes/libs/rdbms/database/DatabaseMysql.php
includes/libs/rdbms/database/DatabaseMysqli.php
includes/libs/rdbms/database/DatabasePostgres.php
includes/libs/rdbms/database/DatabaseSqlite.php

index 4ebc623..8a69eec 100644 (file)
@@ -1065,7 +1065,6 @@ class DatabaseMssql extends Database {
         */
        public function strencode( $s ) {
                // Should not be called by us
-
                return str_replace( "'", "''", $s );
        }
 
index d81d909..58b0926 100644 (file)
@@ -203,7 +203,7 @@ class DatabaseMysql extends DatabaseMysqlBase {
        protected function mysqlRealEscapeString( $s ) {
                $conn = $this->getBindingHandle();
 
-               return mysql_real_escape_string( $s, $conn );
+               return mysql_real_escape_string( (string)$s, $conn );
        }
 }
 
index 4c3cbdd..c1a5698 100644 (file)
@@ -316,7 +316,7 @@ class DatabaseMysqli extends DatabaseMysqlBase {
        protected function mysqlRealEscapeString( $s ) {
                $conn = $this->getBindingHandle();
 
-               return $conn->real_escape_string( $s );
+               return $conn->real_escape_string( (string)$s );
        }
 
        /**
index 5719a1f..5a7da49 100644 (file)
@@ -1175,7 +1175,7 @@ SQL;
 
        public function strencode( $s ) {
                // Should not be called by us
-               return pg_escape_string( $this->getBindingHandle(), $s );
+               return pg_escape_string( $this->getBindingHandle(), (string)$s );
        }
 
        public function addQuotes( $s ) {
@@ -1196,7 +1196,7 @@ SQL;
                        return 'DEFAULT';
                }
 
-               return "'" . pg_escape_string( $conn, $s ) . "'";
+               return "'" . pg_escape_string( $conn, (string)$s ) . "'";
        }
 
        /**
index 870fc3e..2b06607 100644 (file)
@@ -790,7 +790,7 @@ class DatabaseSqlite extends Database {
                        return "x'" . bin2hex( $s->fetch() ) . "'";
                } elseif ( is_bool( $s ) ) {
                        return (int)$s;
-               } elseif ( strpos( $s, "\0" ) !== false ) {
+               } elseif ( strpos( (string)$s, "\0" ) !== false ) {
                        // SQLite doesn't support \0 in strings, so use the hex representation as a workaround.
                        // This is a known limitation of SQLite's mprintf function which PDO
                        // should work around, but doesn't. I have reported this to php.net as bug #63419:
@@ -806,9 +806,9 @@ class DatabaseSqlite extends Database {
                                'For consistency all binary data should have been ' .
                                'first processed with self::encodeBlob()'
                        );
-                       return "x'" . bin2hex( $s ) . "'";
+                       return "x'" . bin2hex( (string)$s ) . "'";
                } else {
-                       return $this->mConn->quote( $s );
+                       return $this->mConn->quote( (string)$s );
                }
        }