From: Antoine Musso Date: Mon, 7 Jun 2004 11:19:03 +0000 (+0000) Subject: typo, looks like objectcache need rewrite cause postgresql doesnt have a FROM_UNIXTIM... X-Git-Tag: 1.5.0alpha1~3000 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=99afe8250ef15eccc1b303d9fc4302dcab6e70d4;p=lhc%2Fweb%2Fwiklou.git typo, looks like objectcache need rewrite cause postgresql doesnt have a FROM_UNIXTIME() function --- diff --git a/includes/DatabasePostgreSQL.php b/includes/DatabasePostgreSQL.php index b8869ad94e..3633d63d96 100644 --- a/includes/DatabasePostgreSQL.php +++ b/includes/DatabasePostgreSQL.php @@ -169,6 +169,7 @@ class Database { wfDebug( "SQL: $sqlx\n" ); } if( $this->mBufferResults ) { + print $sql."
\n"; $ret = pg_query( $this->mConn , $sql); } else { // TODO FIXME : php doesnt get a postgre unbuffered query @@ -218,7 +219,7 @@ class Database { function numRows( $res ) { @$n = pg_num_rows( $res ); if( pg_result_error($this->mConn) ) { - wfDebugDieBacktrace( "SQL error: " . htmlspecialchars( pg_result_error($this->mConn) ); + wfDebugDieBacktrace( "SQL error: " . htmlspecialchars( pg_result_error($this->mConn) ) ); } return $n; } @@ -239,7 +240,7 @@ class Database { # If errors are explicitly ignored, returns success function set( $table, $var, $value, $cond, $fname = "Database::set" ) { - $sql = "UPDATE '$table' SET '$var' = '" . + $sql = "UPDATE \"$table\" SET \"$var\" = '" . wfStrencode( $value ) . "' WHERE ($cond)"; return !!$this->query( $sql, DB_WRITE, $fname ); } @@ -249,7 +250,7 @@ class Database { # If errors are explicitly ignored, returns FALSE on failure function get( $table, $var, $cond, $fname = "Database::get" ) { - $sql = "SELECT '$var' FROM '$table' WHERE ($cond)"; + $sql = "SELECT \"$var\" FROM \"$table\" WHERE ($cond)"; $result = $this->query( $sql, DB_READ, $fname ); $ret = ""; @@ -270,7 +271,7 @@ class Database { { $vars = implode( ",", $vars ); $where = Database::makeList( $conds, LIST_AND ); - $sql = "SELECT '$vars' FROM '$table' WHERE $where LIMIT 1"; + $sql = "SELECT \"$vars\" FROM \"$table\" WHERE $where LIMIT 1"; $res = $this->query( $sql, $fname ); if ( $res === false || !$this->numRows( $res ) ) { return false;