From 1b8462ac58ccdc352dffb9c113bfc5e0cc52b789 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 27 Aug 2004 13:40:27 +0000 Subject: [PATCH] Table prefix bugs --- includes/LinksUpdate.php | 2 +- includes/ObjectCache.php | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 707cd5e5aa..4e15ce8f4a 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -101,7 +101,7 @@ class LinksUpdate { 'bl_from'=>$this->mId, 'bl_to'=>$blt)); } - $dbw->insertArray($brokenlinks,$arr,array('IGNORE')); + $dbw->insertArray( 'brokenlinks',$arr,array('IGNORE')); $dbw->query( $sql, $fname ); } diff --git a/includes/ObjectCache.php b/includes/ObjectCache.php index 53e947c249..101ae7fbcc 100644 --- a/includes/ObjectCache.php +++ b/includes/ObjectCache.php @@ -196,6 +196,7 @@ CREATE TABLE objectcache ( */ class /* abstract */ SqlBagOStuff extends BagOStuff { var $table; + function SqlBagOStuff($tablename = 'objectcache') { $this->table = $tablename; } @@ -242,9 +243,13 @@ class /* abstract */ SqlBagOStuff extends BagOStuff { return true; /* ? */ } + function getTableName() { + return $this->table; + } + function _query($sql) { $reps = func_get_args(); - $reps[0] = $this->table; + $reps[0] = $this->getTableName(); // ewwww for($i=0;$iquery($sql, 'MediaWikiBagOStuff:_doquery'); @@ -329,6 +336,14 @@ class MediaWikiBagOStuff extends SqlBagOStuff { $dbw =& wfGetDB( DB_MASTER ); return $dbw->strencode($s); } + function getTableName() { + if ( !$this->tableInitialised ) { + $dbw =& wfGetDB( DB_MASTER ); + $this->table = $dbw->tableName( $this->table ); + $this->tableInitialised = true; + } + return $this->table; + } } class TurckBagOStuff extends BagOStuff { -- 2.20.1