From d578f386325e37fddbce5a9a5d75badf713bbfd5 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 7 May 2007 13:41:49 +0000 Subject: [PATCH] Compromise: don't reference log_id on MySQL. --- includes/LogPage.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/includes/LogPage.php b/includes/LogPage.php index cb57fd4e38..b8ef781e1f 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -55,21 +55,27 @@ class LogPage { $dbw = wfGetDB( DB_MASTER ); $uid = $wgUser->getID(); + $log_id = $dbw->nextSequenceValue( 'log_log_id_seq' ); $this->timestamp = $now = wfTimestampNow(); - $dbw->insert( 'logging', - array( - 'log_type' => $this->type, - 'log_action' => $this->action, - 'log_timestamp' => $dbw->timestamp( $now ), - 'log_user' => $uid, - 'log_namespace' => $this->target->getNamespace(), - 'log_title' => $this->target->getDBkey(), - 'log_comment' => $this->comment, - 'log_params' => $this->params - ), $fname + $data = array( + 'log_type' => $this->type, + 'log_action' => $this->action, + 'log_timestamp' => $dbw->timestamp( $now ), + 'log_user' => $uid, + 'log_namespace' => $this->target->getNamespace(), + 'log_title' => $this->target->getDBkey(), + 'log_comment' => $this->comment, + 'log_params' => $this->params ); + # log_id doesn't exist on Wikimedia servers yet, and it's a tricky + # schema update to do. Hack it for now to ignore the field on MySQL. + if ( !is_null( $log_id ) ) { + $data['log_id'] = $log_id; + } + $dbw->insert( 'logging', $data, $fname ); + # And update recentchanges if ( $this->updateRecentChanges ) { $titleObj = SpecialPage::getTitleFor( 'Log', $this->type ); -- 2.20.1