From 70430650e9ad24953eee00d15efe27df4cde38c4 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 6 Sep 2011 20:51:10 +0000 Subject: [PATCH] Followup r96369: update child classes and a few callers --- includes/db/CloneDatabase.php | 4 ++-- includes/db/DatabaseIbm_db2.php | 2 +- includes/db/DatabaseOracle.php | 4 ++-- includes/db/DatabasePostgres.php | 8 ++++---- includes/db/DatabaseSqlite.php | 6 +++--- includes/search/SearchOracle.php | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 3357268dcf..f29e0b2e96 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -93,10 +93,10 @@ class CloneDatabase { # fix back and forth so tableName() works right. self::changePrefix( $this->oldTablePrefix ); - $oldTableName = $this->db->tableName( $tbl, false ); + $oldTableName = $this->db->tableName( $tbl, 'raw' ); self::changePrefix( $this->newTablePrefix ); - $newTableName = $this->db->tableName( $tbl, false ); + $newTableName = $this->db->tableName( $tbl, 'raw' ); if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres' ) ) ) { $this->db->dropTable( $tbl, __METHOD__ ); diff --git a/includes/db/DatabaseIbm_db2.php b/includes/db/DatabaseIbm_db2.php index 147b9d592c..056ad9b71a 100644 --- a/includes/db/DatabaseIbm_db2.php +++ b/includes/db/DatabaseIbm_db2.php @@ -748,7 +748,7 @@ class DatabaseIbm_db2 extends DatabaseBase { * @param $name Boolean * @return String */ - public function tableName( $name, $quoted = true ) { + public function tableName( $name, $format = 'quoted' ) { // we want maximum compatibility with MySQL schema return $name; } diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index cdc25f76c5..fa7a86f3ae 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -654,7 +654,7 @@ class DatabaseOracle extends DatabaseBase { return $retval; } - function tableName( $name, $quoted = true ) { + function tableName( $name, $format = 'quoted' ) { /* Replace reserved words with better ones Using uppercase because that's the only way Oracle can handle @@ -669,7 +669,7 @@ class DatabaseOracle extends DatabaseBase { break; } - return parent::tableName( strtoupper( $name ), $quoted ); + return parent::tableName( strtoupper( $name ), $format ); } function tableNameInternal( $name ) { diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 742a8b518b..f0655b544e 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -39,7 +39,7 @@ AND relname=%s AND attname=%s; SQL; - $table = $db->tableName( $table, false ); + $table = $db->tableName( $table, 'raw' ); $res = $db->query( sprintf( $q, $db->addQuotes( $wgDBmwschema ), @@ -622,7 +622,7 @@ class DatabasePostgres extends DatabaseBase { return $res; } - function tableName( $name, $quoted = true ) { + function tableName( $name, $format = 'quoted' ) { # Replace reserved words with better ones switch( $name ) { case 'user': @@ -630,7 +630,7 @@ class DatabasePostgres extends DatabaseBase { case 'text': return 'pagecontent'; default: - return parent::tableName( $name, $quoted ); + return parent::tableName( $name, $format ); } } @@ -737,7 +737,7 @@ class DatabasePostgres extends DatabaseBase { if ( !$schema ) { $schema = $wgDBmwschema; } - $table = $this->tableName( $table, false ); + $table = $this->tableName( $table, 'raw' ); $etable = $this->addQuotes( $table ); $eschema = $this->addQuotes( $schema ); $SQL = "SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n " diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 924fc87629..b2eb1c6bd8 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -319,15 +319,15 @@ class DatabaseSqlite extends DatabaseBase { * Use MySQL's naming (accounts for prefix etc) but remove surrounding backticks * * @param $name - * @param bool $quoted + * @param $format String * @return string */ - function tableName( $name, $quoted = true ) { + function tableName( $name, $format = 'quoted' ) { // table names starting with sqlite_ are reserved if ( strpos( $name, 'sqlite_' ) === 0 ) { return $name; } - return str_replace( '"', '', parent::tableName( $name, $quoted ) ); + return str_replace( '"', '', parent::tableName( $name, $format ) ); } /** diff --git a/includes/search/SearchOracle.php b/includes/search/SearchOracle.php index 85337ca17a..2d6fc3e2cc 100644 --- a/includes/search/SearchOracle.php +++ b/includes/search/SearchOracle.php @@ -257,9 +257,9 @@ class SearchOracle extends SearchEngine { // ALTER SESSION SET CURRENT_SCHEMA = ... // was used. $dbw->query( "CALL ctx_ddl.sync_index(" . - $dbw->addQuotes( $dbw->getDBname() . '.' . $dbw->tableName( 'si_text_idx', false ) ) . ")" ); + $dbw->addQuotes( $dbw->getDBname() . '.' . $dbw->tableName( 'si_text_idx', 'raw' ) ) . ")" ); $dbw->query( "CALL ctx_ddl.sync_index(" . - $dbw->addQuotes( $dbw->getDBname() . '.' . $dbw->tableName( 'si_title_idx', false ) ) . ")" ); + $dbw->addQuotes( $dbw->getDBname() . '.' . $dbw->tableName( 'si_title_idx', 'raw' ) ) . ")" ); } /** -- 2.20.1