Last modified: 2010-05-15 15:38:40 UTC
I had trouble getting $wgSharedDB working and I uncovered an error on Database.php. Line 984 reade: "if ( isset( $wgSharedDB ) && 'user' == $name ) {" when it should read something like: if (isset( $wgSharedDB ) && $this->mTablePrefix.'user' == $name ) { It is not comparing the table prefixes After the code edit it works on my installation. Thanks, Leonard Original Code function tableName( $name ) { global $wgSharedDB; # Skip quoted literals if ( $name{0} != '`' ) { if ( $this->mTablePrefix !== '' && strpos( '.', $name ) === false ) { $name = "{$this->mTablePrefix}$name"; } if ( isset( $wgSharedDB ) && 'user' == $name ) { $name = "`$wgSharedDB`.`$name`"; } else { # Standard quoting $name = "`$name`"; } } return $name; } What I did for my purpose function tableName( $name ) { global $wgSharedDB; # Skip quoted literals if ( $name{0} != '`' ) { if ( $this->mTablePrefix !== '' && strpos( '.', $name ) === false ) { $name = "{$this->mTablePrefix}$name"; } if (isset( $wgSharedDB ) && $this->mTablePrefix.'user' == $name ) { $name = "`$wgSharedDB`.`$name`"; } else { # Standard quoting $name = "`$name`"; } } return $name; }
Created attachment 503 [details] patch for HEAD The patch adds the tablePrefix to the comparison string (using the same quoted string like two lines above with $name replaced by user).
Created attachment 504 [details] patch for REL14 patch for REL14 does the same as for HEAD
Fix applied to CVS HEAD and REL1_4.