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
*/
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\"." );
}
}
$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(