X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdb%2FDatabaseSqlite.php;h=bb3028db1650135d9c692662f946b5dfd3e814a3;hb=ba06ccb394df994b6434f1d3434c6b21e064f963;hp=656547b52eb39bae2ea9384a0ebc7a0f580c5d8d;hpb=b60dded47b7c4437a21baea8ee0780243340abb6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 656547b52e..bb3028db16 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -25,7 +25,7 @@ /** * @ingroup Database */ -class DatabaseSqlite extends DatabaseBase { +class DatabaseSqlite extends Database { /** @var bool Whether full text is enabled */ private static $fulltextEnabled = null; @@ -799,15 +799,21 @@ class DatabaseSqlite extends DatabaseBase { return (int)$s; } elseif ( strpos( $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: + // 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: // https://bugs.php.net/bug.php?id=63419 // There was already a similar report for SQLite3::escapeString, bug #62361: // https://bugs.php.net/bug.php?id=62361 // There is an additional bug regarding sorting this data after insert // on older versions of sqlite shipped with ubuntu 12.04 - // https://bugzilla.wikimedia.org/show_bug.cgi?id=72367 - wfDebugLog( __CLASS__, __FUNCTION__ . ': Quoting value containing null byte. For consistency all binary data should have been first processed with self::encodeBlob()' ); + // https://phabricator.wikimedia.org/T74367 + wfDebugLog( + __CLASS__, + __FUNCTION__ . + ': Quoting value containing null byte. ' . + 'For consistency all binary data should have been ' . + 'first processed with self::encodeBlob()' + ); return "x'" . bin2hex( $s ) . "'"; } else { return $this->mConn->quote( $s ); @@ -985,7 +991,7 @@ class DatabaseSqlite extends DatabaseBase { $indexInfo = $this->query( 'PRAGMA INDEX_INFO(' . $this->addQuotes( $index->name ) . ')' ); $fields = array(); foreach ( $indexInfo as $indexInfoRow ) { - $fields[ $indexInfoRow->seqno ] = $indexInfoRow->name; + $fields[$indexInfoRow->seqno] = $indexInfoRow->name; } $sql .= '(' . implode( ',', $fields ) . ')'; @@ -1026,6 +1032,14 @@ class DatabaseSqlite extends DatabaseBase { return $endArray; } + + /** + * @return string + */ + public function __toString() { + return 'SQLite ' . (string)$this->mConn->getAttribute( PDO::ATTR_SERVER_VERSION ); + } + } // end DatabaseSqlite class /**