Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -178,6 +178,8 @@ |
179 | 179 | var $ignore_DUP_VAL_ON_INDEX = false; |
180 | 180 | var $sequenceData = null; |
181 | 181 | |
| 182 | + var $defaultCharset = 'AL32UTF8'; |
| 183 | + |
182 | 184 | function DatabaseOracle($server = false, $user = false, $password = false, $dbName = false, |
183 | 185 | $failFunction = false, $flags = 0, $tablePrefix = 'get from global' ) |
184 | 186 | { |
— | — | @@ -222,7 +224,7 @@ |
223 | 225 | 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" ); |
224 | 226 | } |
225 | 227 | |
226 | | - putenv("NLS_LANG=AMERICAN_AMERICA.AL32UTF8"); |
| 228 | + //putenv("NLS_LANG=AMERICAN_AMERICA.AL32UTF8"); |
227 | 229 | |
228 | 230 | $this->close(); |
229 | 231 | $this->mServer = $server; |
— | — | @@ -234,12 +236,11 @@ |
235 | 237 | return; |
236 | 238 | } |
237 | 239 | |
238 | | - //error_reporting( E_ALL ); //whoever had this bright idea |
239 | 240 | $session_mode = $this->mFlags & DBO_SYSDBA ? OCI_SYSDBA : OCI_DEFAULT; |
240 | 241 | if ( $this->mFlags & DBO_DEFAULT ) |
241 | | - $this->mConn = oci_new_connect($user, $password, $dbName, null, $session_mode); |
| 242 | + $this->mConn = oci_new_connect($user, $password, $dbName, $this->defaultCharset, $session_mode); |
242 | 243 | else |
243 | | - $this->mConn = oci_connect($user, $password, $dbName, null, $session_mode); |
| 244 | + $this->mConn = oci_connect($user, $password, $dbName, $this->defaultCharset, $session_mode); |
244 | 245 | |
245 | 246 | if ($this->mConn == false) { |
246 | 247 | wfDebug("DB connection error\n"); |
— | — | @@ -253,7 +254,6 @@ |
254 | 255 | #removed putenv calls because they interfere with the system globaly |
255 | 256 | $this->doQuery('ALTER SESSION SET NLS_TIMESTAMP_FORMAT=\'DD-MM-YYYY HH24:MI:SS.FF6\''); |
256 | 257 | $this->doQuery('ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT=\'DD-MM-YYYY HH24:MI:SS.FF6\''); |
257 | | - |
258 | 258 | return $this->mConn; |
259 | 259 | } |
260 | 260 | |
— | — | @@ -292,9 +292,12 @@ |
293 | 293 | $olderr = error_reporting(E_ERROR); |
294 | 294 | $explain_id = date('dmYHis'); |
295 | 295 | error_reporting($olderr); |
| 296 | + |
296 | 297 | $sql = preg_replace('/^EXPLAIN /', 'EXPLAIN PLAN SET STATEMENT_ID = \''.$explain_id.'\' FOR', $sql, 1, $explain_count); |
297 | 298 | |
298 | 299 | |
| 300 | + $olderr = error_reporting(E_ERROR); |
| 301 | + |
299 | 302 | if (($this->mLastResult = $stmt = oci_parse($this->mConn, $sql)) === false) { |
300 | 303 | $e = oci_error($this->mConn); |
301 | 304 | $this->reportQueryError($e['message'], $e['code'], $sql, __FUNCTION__); |
— | — | @@ -772,12 +775,10 @@ |
773 | 776 | ++$this->mErrorCount; |
774 | 777 | |
775 | 778 | if ($ignore || $tempIgnore) { |
776 | | -//echo "error ignored! query = [$sql]\n"; |
777 | 779 | wfDebug("SQL ERROR (ignored): $error\n"); |
778 | 780 | $this->ignoreErrors( $ignore ); |
779 | 781 | } |
780 | 782 | else { |
781 | | -//echo "error!\n"; |
782 | 783 | $message = "A database error has occurred\n" . |
783 | 784 | "Query: $sql\n" . |
784 | 785 | "Function: $fname\n" . |