}
/**
- * Quotes a string using `backticks` for things like database, table, and field
- * names, other databases which use something other than backticks can replace
- * this with something else
+ * Quotes an identifier using `backticks` or "double quotes" depending on the database type.
+ * MySQL uses `backticks` while basically everything else uses double quotes.
+ * Since MySQL is the odd one out here the double quotes are our generic
+ * and we implement backticks in DatabaseMysql.
*/
public function addIdentifierQuotes( $s ) {
- return "`" . $this->strencode( $s ) . "`";
+ return '"' . str_replace( '"', '""', $s ) . '"';
}
/**
}
}
- public function addIdentifierQuotes( $s ) {
- return '"' . str_replace( '"', '""', $s ) . '"';
- }
-
/**
* Verifies that a DB2 column/field type is numeric
*
}
}
- function addIdentifierQuotes( $s ) {
- return "'" . str_replace( "'", "''", $s ) . "'";
- }
-
function selectDB( $db ) {
return ( $this->query( "SET DATABASE $db" ) !== false );
}
return $sQuoted;
}
+ /**
+ * MySQL uses `backticks` for identifier quoting instead of the sql standard "double quotes".
+ */
+ public function addIdentifierQuotes( $s ) {
+ return "`" . $this->strencode( $s ) . "`";
+ }
+
function ping() {
$ping = mysql_ping( $this->mConn );
if ( $ping ) {
return "'" . $this->strencode( $s ) . "'";
}
- function addIdentifierQuotes( $s ) {
- return '"' . str_replace( '"', '""', $s ) . '"';
- }
-
function selectRow( $table, $vars, $conds, $fname = 'DatabaseOracle::selectRow', $options = array(), $join_conds = array() ) {
global $wgContLang;
return "'" . pg_escape_string( $this->mConn, $s ) . "'";
}
- function addIdentifierQuotes( $s ) {
- return '"' . str_replace( '"', '""', $s ) . '"';
- }
-
/**
* Postgres specific version of replaceVars.
* Calls the parent version in Database.php
}
}
- function addIdentifierQuotes( $s ) {
- return '"' . str_replace( '"', '""', $s ) . '"';
- }
-
function buildLike() {
$params = func_get_args();
if ( count( $params ) > 0 && is_array( $params[0] ) ) {