* @return string
*/
public function addIdentifierQuotes( $s ) {
- return "`" . $this->strencode( $s ) . "`";
+ // Characters in the range \u0001-\uFFFF are valid in a quoted identifier
+ // Remove NUL bytes and escape backticks by doubling
+ return '`' . str_replace( array( "\0", '`' ), array( '', '``' ), $s ) . '`';
}
/**
*/
class MySQLField implements Field {
private $name, $tablename, $default, $max_length, $nullable,
- $is_pk, $is_unique, $is_multiple, $is_key, $type;
+ $is_pk, $is_unique, $is_multiple, $is_key, $type, $binary;
function __construct( $info ) {
$this->name = $info->name;
$this->is_multiple = $info->multiple_key;
$this->is_key = ( $this->is_pk || $this->is_unique || $this->is_multiple );
$this->type = $info->type;
+ $this->binary = isset( $info->binary ) ? $info->binary : false;
}
/**
function isMultipleKey() {
return $this->is_multiple;
}
+
+ function isBinary() {
+ return $this->binary;
+ }
}
class MySQLMasterPos implements DBMasterPos {