
freakolowsky at svn
Nov 17, 2009, 1:41 AM
Post #1 of 1
(64 views)
Permalink
|
|
SVN: [59168] trunk/phase3/includes/db/DatabaseOracle.php
|
|
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/59168 Revision: 59168 Author: freakolowsky Date: 2009-11-17 09:41:26 +0000 (Tue, 17 Nov 2009) Log Message: ----------- replaced charset definition to php var instead of forced env var Modified Paths: -------------- trunk/phase3/includes/db/DatabaseOracle.php Modified: trunk/phase3/includes/db/DatabaseOracle.php =================================================================== --- trunk/phase3/includes/db/DatabaseOracle.php 2009-11-17 08:19:35 UTC (rev 59167) +++ trunk/phase3/includes/db/DatabaseOracle.php 2009-11-17 09:41:26 UTC (rev 59168) @@ -178,6 +178,8 @@ var $ignore_DUP_VAL_ON_INDEX = false; var $sequenceData = null; + var $defaultCharset = 'AL32UTF8'; + function DatabaseOracle($server = false, $user = false, $password = false, $dbName = false, $failFunction = false, $flags = 0, $tablePrefix = 'get from global' ) { @@ -222,7 +224,7 @@ throw new DBConnectionError( $this, "Oracle functions missing, have you compiled PHP with the --with-oci8 option?\n (Note: if you recently installed PHP, you may need to restart your webserver and database)\n" ); } - putenv("NLS_LANG=AMERICAN_AMERICA.AL32UTF8"); + //putenv("NLS_LANG=AMERICAN_AMERICA.AL32UTF8"); $this->close(); $this->mServer = $server; @@ -234,12 +236,11 @@ return; } - //error_reporting( E_ALL ); //whoever had this bright idea $session_mode = $this->mFlags & DBO_SYSDBA ? OCI_SYSDBA : OCI_DEFAULT; if ( $this->mFlags & DBO_DEFAULT ) - $this->mConn = oci_new_connect($user, $password, $dbName, null, $session_mode); + $this->mConn = oci_new_connect($user, $password, $dbName, $this->defaultCharset, $session_mode); else - $this->mConn = oci_connect($user, $password, $dbName, null, $session_mode); + $this->mConn = oci_connect($user, $password, $dbName, $this->defaultCharset, $session_mode); if ($this->mConn == false) { wfDebug("DB connection error\n"); @@ -253,7 +254,6 @@ #removed putenv calls because they interfere with the system globaly $this->doQuery('ALTER SESSION SET NLS_TIMESTAMP_FORMAT=\'DD-MM-YYYY HH24:MI:SS.FF6\''); $this->doQuery('ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT=\'DD-MM-YYYY HH24:MI:SS.FF6\''); - return $this->mConn; } @@ -292,9 +292,12 @@ $olderr = error_reporting(E_ERROR); $explain_id = date('dmYHis'); error_reporting($olderr); + $sql = preg_replace('/^EXPLAIN /', 'EXPLAIN PLAN SET STATEMENT_ID = \''.$explain_id.'\' FOR', $sql, 1, $explain_count); + $olderr = error_reporting(E_ERROR); + if (($this->mLastResult = $stmt = oci_parse($this->mConn, $sql)) === false) { $e = oci_error($this->mConn); $this->reportQueryError($e['message'], $e['code'], $sql, __FUNCTION__); @@ -772,12 +775,10 @@ ++$this->mErrorCount; if ($ignore || $tempIgnore) { -//echo "error ignored! query = [$sql]\n"; wfDebug("SQL ERROR (ignored): $error\n"); $this->ignoreErrors( $ignore ); } else { -//echo "error!\n"; $message = "A database error has occurred\n" . "Query: $sql\n" . "Function: $fname\n" . _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS [at] lists https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
|