revive experimental Oracle support
authorRiver Tarnell <river@users.mediawiki.org>
Sun, 11 Mar 2007 03:59:37 +0000 (03:59 +0000)
committerRiver Tarnell <river@users.mediawiki.org>
Sun, 11 Mar 2007 03:59:37 +0000 (03:59 +0000)
fix use of limitResult(); must pass actual SQL, not empty string

includes/AutoLoader.php
includes/Database.php
includes/DatabasePostgres.php
includes/EditPage.php

index 81a6859..16950cf 100644 (file)
@@ -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',
index 21fa09d..5d56064 100644 (file)
@@ -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 );
        }
 
index 68f2e02..bc85a7b 100644 (file)
@@ -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';
index a57f18a..8aca2d6 100644 (file)
@@ -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' ) {