From 033b6b9646da6b71c5bb9dd6803a662bcf510a99 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Sun, 11 Mar 2007 03:59:37 +0000 Subject: [PATCH] revive experimental Oracle support fix use of limitResult(); must pass actual SQL, not empty string --- includes/AutoLoader.php | 1 + includes/Database.php | 13 +++++++++---- includes/DatabasePostgres.php | 9 +++++---- includes/EditPage.php | 2 ++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 81a6859c2e..16950cf565 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -41,6 +41,7 @@ function __autoload($className) { 'DatabaseMysql' => 'includes/Database.php', 'ResultWrapper' => 'includes/Database.php', 'DatabasePostgres' => 'includes/DatabasePostgres.php', + 'DatabaseOracle' => 'includes/DatabaseOracle.php', 'DateFormatter' => 'includes/DateFormatter.php', 'DifferenceEngine' => 'includes/DifferenceEngine.php', '_DiffOp' => 'includes/DifferenceEngine.php', diff --git a/includes/Database.php b/includes/Database.php index 21fa09d7f7..5d56064a81 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -997,10 +997,11 @@ class Database { if ( isset( $options['GROUP BY'] ) ) $tailOpts .= " GROUP BY {$options['GROUP BY']}"; if ( isset( $options['ORDER BY'] ) ) $tailOpts .= " ORDER BY {$options['ORDER BY']}"; - if (isset($options['LIMIT'])) { - $tailOpts .= $this->limitResult('', $options['LIMIT'], - isset($options['OFFSET']) ? $options['OFFSET'] : false); - } + //if (isset($options['LIMIT'])) { + // $tailOpts .= $this->limitResult('', $options['LIMIT'], + // isset($options['OFFSET']) ? $options['OFFSET'] + // : false); + //} if ( isset( $noKeyOptions['FOR UPDATE'] ) ) $tailOpts .= ' FOR UPDATE'; if ( isset( $noKeyOptions['LOCK IN SHARE MODE'] ) ) $tailOpts .= ' LOCK IN SHARE MODE'; @@ -1070,6 +1071,10 @@ class Database { $sql = "SELECT $startOpts $vars $from $useIndex $tailOpts"; } + if (isset($options['LIMIT'])) + $sql = $this->limitResult($sql, $options['LIMIT'], + isset($options['OFFSET']) ? $options['OFFSET'] : false); + return $this->query( $sql, $fname ); } diff --git a/includes/DatabasePostgres.php b/includes/DatabasePostgres.php index 68f2e02c69..bc85a7b885 100644 --- a/includes/DatabasePostgres.php +++ b/includes/DatabasePostgres.php @@ -919,10 +919,11 @@ class DatabasePostgres extends Database { if ( isset( $options['GROUP BY'] ) ) $tailOpts .= " GROUP BY {$options['GROUP BY']}"; if ( isset( $options['ORDER BY'] ) ) $tailOpts .= " ORDER BY {$options['ORDER BY']}"; - if (isset($options['LIMIT'])) { - $tailOpts .= $this->limitResult('', $options['LIMIT'], - isset($options['OFFSET']) ? $options['OFFSET'] : false); - } + //if (isset($options['LIMIT'])) { + // $tailOpts .= $this->limitResult('', $options['LIMIT'], + // isset($options['OFFSET']) ? $options['OFFSET'] + // : false); + //} if ( isset( $noKeyOptions['FOR UPDATE'] ) ) $tailOpts .= ' FOR UPDATE'; if ( isset( $noKeyOptions['LOCK IN SHARE MODE'] ) ) $tailOpts .= ' LOCK IN SHARE MODE'; diff --git a/includes/EditPage.php b/includes/EditPage.php index a57f18a8a5..8aca2d637c 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -732,6 +732,8 @@ class EditPage { $this->mArticle->clear(); # Force reload of dates, etc. $this->mArticle->forUpdate( true ); # Lock the article + wfDebug("timestamp: {$this->mArticle->getTimestamp()}, edittime: {$this->edittime}\n"); + if( $this->mArticle->getTimestamp() != $this->edittime ) { $this->isConflict = true; if( $this->section == 'new' ) { -- 2.20.1