Introduce InterwikiLookupAdapter on top of SiteLookup
[lhc/web/wiklou.git] / includes / db / DatabaseSqlite.php
index 9d0a0f7..ef08ab0 100644 (file)
@@ -832,6 +832,15 @@ class DatabaseSqlite extends Database {
                return parent::buildLike( $params ) . "ESCAPE '\' ";
        }
 
+       /**
+        * @param string $field Field or column to cast
+        * @return string
+        * @since 1.28
+        */
+       public function buildStringCast( $field ) {
+               return 'CAST ( ' . $field . ' AS TEXT )';
+       }
+
        /**
         * @return string
         */
@@ -911,7 +920,7 @@ class DatabaseSqlite extends Database {
        public function lock( $lockName, $method, $timeout = 5 ) {
                if ( !is_dir( "{$this->dbDir}/locks" ) ) { // create dir as needed
                        if ( !is_writable( $this->dbDir ) || !mkdir( "{$this->dbDir}/locks" ) ) {
-                               throw new DBError( "Cannot create directory \"{$this->dbDir}/locks\"." );
+                               throw new DBError( $this, "Cannot create directory \"{$this->dbDir}/locks\"." );
                        }
                }
 
@@ -953,7 +962,7 @@ class DatabaseSqlite extends Database {
                        $this->addQuotes( $oldName ) . " AND type='table'", $fname );
                $obj = $this->fetchObject( $res );
                if ( !$obj ) {
-                       throw new MWException( "Couldn't retrieve structure for table $oldName" );
+                       throw new RuntimeException( "Couldn't retrieve structure for table $oldName" );
                }
                $sql = $obj->sql;
                $sql = preg_replace(