r80128 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80127‎ | r80128 | r80129 >
Date:23:01, 12 January 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Spaces to tabs
Modified paths:
  • /trunk/phase3/includes/installer/PostgresInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/PostgresInstaller.php
@@ -219,8 +219,8 @@
220220 $conn = $status->value;
221221
222222 $dbName = $this->getVar( 'wgDBname' );
223 - $SQL = "SELECT 1 FROM pg_catalog.pg_database WHERE datname = " . $conn->addQuotes( $dbName );
224 - $rows = $conn->numRows( $conn->query( $SQL ) );
 223+ $SQL = "SELECT 1 FROM pg_catalog.pg_database WHERE datname = " . $conn->addQuotes( $dbName );
 224+ $rows = $conn->numRows( $conn->query( $SQL ) );
225225 if( !$rows ) {
226226 $schema = $this->getVar( 'wgDBmwschema' );
227227 $user = $this->getVar( 'wgDBuser' );
@@ -233,14 +233,14 @@
234234 $conn->query( "CREATE DATABASE $safedb OWNER $safeuser", __METHOD__ );
235235
236236 $conn = new DatabasePostgres(
237 - $this->getVar( 'wgDBserver' ),
238 - $this->getVar( 'wgDBuser' ),
239 - $this->getVar( 'wgDBpassword' ),
240 - $dbName,
241 - false,
242 - 0,
243 - $this->getVar( 'wgDBprefix' )
244 - );
 237+ $this->getVar( 'wgDBserver' ),
 238+ $this->getVar( 'wgDBuser' ),
 239+ $this->getVar( 'wgDBpassword' ),
 240+ $dbName,
 241+ false,
 242+ 0,
 243+ $this->getVar( 'wgDBprefix' )
 244+ );
245245
246246 $result = $conn->schemaExists( $schema );
247247 if( !$result ) {
@@ -250,16 +250,16 @@
251251 }
252252 } else {
253253 $safeschema2 = $conn->addQuotes( $schema );
254 - $SQL = "SELECT 'GRANT ALL ON '||pg_catalog.quote_ident(relname)||' TO $safeuser;'\n".
255 - "FROM pg_catalog.pg_class p, pg_catalog.pg_namespace n\n".
256 - "WHERE relnamespace = n.oid AND n.nspname = $safeschema2\n".
257 - "AND p.relkind IN ('r','S','v')\n";
258 - $SQL .= "UNION\n";
259 - $SQL .= "SELECT 'GRANT ALL ON FUNCTION '||pg_catalog.quote_ident(proname)||'('||\n".
260 - "pg_catalog.oidvectortypes(p.proargtypes)||') TO $safeuser;'\n".
261 - "FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n\n".
262 - "WHERE p.pronamespace = n.oid AND n.nspname = $safeschema2";
263 - $res = $conn->query( $SQL );
 254+ $SQL = "SELECT 'GRANT ALL ON '||pg_catalog.quote_ident(relname)||' TO $safeuser;'\n".
 255+ "FROM pg_catalog.pg_class p, pg_catalog.pg_namespace n\n" .
 256+ "WHERE relnamespace = n.oid AND n.nspname = $safeschema2\n" .
 257+ "AND p.relkind IN ('r','S','v')\n";
 258+ $SQL .= "UNION\n";
 259+ $SQL .= "SELECT 'GRANT ALL ON FUNCTION '||pg_catalog.quote_ident(proname)||'('||\n".
 260+ "pg_catalog.oidvectortypes(p.proargtypes)||') TO $safeuser;'\n" .
 261+ "FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n\n" .
 262+ "WHERE p.pronamespace = n.oid AND n.nspname = $safeschema2";
 263+ $res = $conn->query( $SQL );
264264 $conn->query( "SET search_path = $safeschema" );
265265 }
266266 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r81182MFT a bunch of installer fixes. r80238, r80128, r80124, r80083, r80080, r800...demon01:59, 29 January 2011

Comments

#Comment by Reedy (talk | contribs)   23:09, 12 January 2011

I'm guessing this should just be backported to prevent stupid whitespace conflicts....

Status & tagging log