Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change ADOdb fetch mode to ADODB_FETCH_NUM for Oracle
We were previously using ADODB_FETCH_BOTH, which is less efficient as
each field is returned twice in the recordset. Using ADODB_FETCH_NUM
reduces the memory footprint.

This is a workaround for issue #15426, allowing MantisBT to function
until ADOdb library is patched to fix the problem's root cause.
  • Loading branch information
dregad committed Oct 16, 2013
1 parent 92b919c commit 42152ec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/database_api.php
Expand Up @@ -63,8 +63,11 @@
* @global bool $ADODB_FETCH_MODE
*/
if( db_is_oracle() ) {
# To get non-empty field values in case of oci8 from GetRowAssoc() indexed result returning must be enabled
$ADODB_FETCH_MODE = ADODB_FETCH_BOTH;
# Due to oci8 returning column names in uppercase, the MantisBT
# default fetch mode (ADODB_FETCH_ASSOC) does not work properly
# in the current version of ADOdb (5.18) so we override it.
# See #15426
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
} else {
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
}
Expand Down

0 comments on commit 42152ec

Please sign in to comment.