r112502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112501‎ | r112502 | r112503 >
Date:19:01, 27 February 2012
Author:freakolowsky
Status:deferred (Comments)
Tags:
Comment:
* partly fixes two issues exposed by bug 34280
** forcing recreate if creating user
** parent::createTables was setting DB to a wrong setting
Modified paths:
  • /trunk/phase3/includes/installer/OracleInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/OracleInstaller.php
@@ -230,6 +230,8 @@
231231 // user created or already existing, switching back to a normal connection
232232 // as the new user has all needed privileges to setup the rest of the schema
233233 // i will be using that user as _InstallUser from this point on
 234+ $this->db->close();
 235+ $this->db = false;
234236 $this->parent->setVar( '_InstallUser', $this->getVar( 'wgDBuser' ) );
235237 $this->parent->setVar( '_InstallPassword', $this->getVar( 'wgDBpassword' ) );
236238 $this->parent->setVar( '_InstallDBname', $this->getVar( 'wgDBuser' ) );
@@ -245,8 +247,8 @@
246248 */
247249 public function createTables() {
248250 $this->setupSchemaVars();
249 - $this->db->selectDB( $this->getVar( 'wgDBuser' ) );
250251 $this->db->setFlag( DBO_DDLMODE );
 252+ $this->parent->setVar( 'wgDBname', $this->getVar( 'wgDBuser' ) );
251253 $status = parent::createTables();
252254 $this->db->clearFlag( DBO_DDLMODE );
253255

Follow-up revisions

RevisionCommit summaryAuthorDate
r112504MFT r112502freakolowsky19:03, 27 February 2012
r112505MFT r112502freakolowsky19:05, 27 February 2012

Comments

#Comment by Aaron Schulz (talk | contribs)   19:37, 1 March 2012

You are setting a dbname to a dbuser?

#Comment by Freakolowsky (talk | contribs)   20:02, 1 March 2012

correctemondo ... Oracle DB settings logic 101:

  • server = TNS service id NOT the server
  • username = username used to log in
  • password = "setec atronomy"
  • dbname = schema name where objects are located

By default each user has it's own schema, but that may not necessarily be the case. Setting dbname = dbuser is just a failsafe to prevent selectDB calls after the installation (inserting default content & stuff) from using a wrong schema.

Status & tagging log