From 0e2e0fae606be0700dbd617d488a06755a806f8d Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 28 Jul 2010 11:08:26 +0200 Subject: [PATCH] MFB: Set emulate_database option for Oracle (Bug #9151). --- ansel/lib/Ansel.php | 5 ++++ framework/Share/lib/Horde/Share/Sql.php | 42 ++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/ansel/lib/Ansel.php b/ansel/lib/Ansel.php index 5f4a955a7..f1acedbd9 100644 --- a/ansel/lib/Ansel.php +++ b/ansel/lib/Ansel.php @@ -51,6 +51,11 @@ class Ansel $mdb->setOption('portability', MDB2_PORTABILITY_FIX_CASE | MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_RTRIM | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES); break; default: + switch ($mdb->phptype) { + case 'oci8': + $mdb->setOption('emulate_database', false); + break; + } $mdb->setOption('field_case', CASE_LOWER); $mdb->setOption('portability', MDB2_PORTABILITY_FIX_CASE | MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES); } diff --git a/framework/Share/lib/Horde/Share/Sql.php b/framework/Share/lib/Horde/Share/Sql.php index 52a6a5c6e..607f507e3 100644 --- a/framework/Share/lib/Horde/Share/Sql.php +++ b/framework/Share/lib/Horde/Share/Sql.php @@ -828,15 +828,20 @@ class Horde_Share_Sql extends Horde_Share $this->_write_db->setOption('portability', MDB2_PORTABILITY_FIX_CASE | MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_RTRIM | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES); break; - case 'pgsql': - /* The debug handler breaks PostgreSQL. In most cases it shouldn't - * be necessary, but this may mean we simply can't support use of - * multiple Postgres databases right now. See - * http://bugs.horde.org/ticket/7825 */ - $this->_write_db->setOption('debug', false); - // Fall through - default: + switch ($this->_write_db->phptype) { + case 'oci8': + $this->_write_db->setOption('emulate_database', false); + break; + + case 'pgsql': + /* The debug handler breaks PostgreSQL. In most cases it + * shouldn't be necessary, but this may mean we simply can't + * support use of multiple Postgres databases right now. See + * http://bugs.horde.org/ticket/7825 */ + $this->_write_db->setOption('debug', false); + break; + } $this->_write_db->setOption('field_case', CASE_LOWER); $this->_write_db->setOption('portability', MDB2_PORTABILITY_FIX_CASE | MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES); } @@ -858,15 +863,20 @@ class Horde_Share_Sql extends Horde_Share $this->_db->setOption('portability', MDB2_PORTABILITY_FIX_CASE | MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_RTRIM | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES); break; - case 'pgsql': - /* The debug handler breaks PostgreSQL. In most cases it shouldn't - * be necessary, but this may mean we simply can't support use of - * multiple Postgres databases right now. See - * http://bugs.horde.org/ticket/7825 */ - $this->_write_db->setOption('debug', false); - // Fall through - default: + switch ($this->_db->phptype) { + case 'oci8': + $this->_db->setOption('emulate_database', false); + break; + + case 'pgsql': + /* The debug handler breaks PostgreSQL. In most cases it + * shouldn't be necessary, but this may mean we simply + * can't support use of multiple Postgres databases right + * now. See http://bugs.horde.org/ticket/7825 */ + $this->_write_db->setOption('debug', false); + break; + } $this->_db->setOption('field_case', CASE_LOWER); $this->_db->setOption('portability', MDB2_PORTABILITY_FIX_CASE | MDB2_PORTABILITY_ERRORS | MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES); } -- 2.11.0