r40533 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40532‎ | r40533 | r40534 >
Date:13:59, 6 September 2008
Author:tstarling
Status:old
Tags:
Comment:
Implemented blob support for SQLite. Allows null characters to be inserted into the database. Avoids total breakage of the objectcache table. For trunk and 1.13.
Modified paths:
  • /branches/REL1_13/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_13/phase3/includes/db/DatabaseSqlite.php (modified) (history)

Diff [purge]

Index: branches/REL1_13/phase3/includes/db/DatabaseSqlite.php
@@ -289,15 +289,22 @@
290290 }
291291
292292 function encodeBlob($b) {
293 - return $this->strencode($b);
 293+ return new Blob( $b );
294294 }
295295
296296 function decodeBlob($b) {
 297+ if ($b instanceof Blob) {
 298+ $b = $b->fetch();
 299+ }
297300 return $b;
298301 }
299302
300303 function addQuotes($s) {
301 - return $this->mConn->quote($s);
 304+ if ( $s instanceof Blob ) {
 305+ return "x'" . bin2hex( $s->fetch() ) . "'";
 306+ } else {
 307+ return $this->mConn->quote($s);
 308+ }
302309 }
303310
304311 function quote_ident($s) { return $s; }
Index: branches/REL1_13/phase3/RELEASE-NOTES
@@ -27,6 +27,7 @@
2828 * (bug 13770) Fixed DOM module detection for installations with both dom
2929 and domxml.
3030 * (bug 15148) Fixed Special:BlockIP for PostgreSQL
 31+* Fixed SQLite support for non-memcached installations
3132 * Localisation updates, Achinese (ace) added.
3233
3334 == Changes since 1.13.0rc2 ==