Permalink
Browse files

Update ADOdb to 5.19

- update the submodule
- back to ADODB_FETCH_ASSOC for oci8
- fix db_query_bound() $p_arr_parms null default issue

Fixes pull request #181
  • Loading branch information...
2 parents 64af35e + c726ff7 commit a2b23b3bc04b41c7925ea204a4b2dbd2b028b159 @dregad dregad committed Jul 9, 2014
Showing with 19 additions and 21 deletions.
  1. +1 −1 core/constant_inc.php
  2. +12 −14 core/database_api.php
  3. +1 −1 core/project_hierarchy_api.php
  4. +1 −1 core/summary_api.php
  5. +1 −1 core/user_api.php
  6. +1 −1 library/README.libs
  7. +1 −1 library/adodb
  8. +1 −1 manage_user_page.php
View
2 core/constant_inc.php
@@ -39,7 +39,7 @@
# installation
define( 'CONFIGURED_PASSWORD', "______" );
-define( 'DB_MIN_VERSION_ADODB', '5.19dev' ); # For mssql, oracle and pgsql
+define( 'DB_MIN_VERSION_ADODB', '5.19' ); # For mssql, oracle and pgsql
define( 'DB_MIN_VERSION_MSSQL', '9.0.0' );
define( 'DB_MIN_VERSION_MYSQL', '5.0.8' ); # See #16584
define( 'DB_MIN_VERSION_PGSQL', '8.4' ); # Earliest supported version as of Jan 2014
View
26 core/database_api.php
@@ -53,18 +53,9 @@
# @global bool $g_db_log_queries
$g_db_log_queries = ( 0 != ( config_get_global( 'log_level' ) & LOG_DATABASE ) );
-
# set adodb fetch mode
# @global bool $ADODB_FETCH_MODE
-if( db_is_oracle() ) {
- # 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;
-}
+$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
/**
* Mantis Database Parameters Count class
@@ -337,12 +328,19 @@ function db_query_bound( $p_query, array $p_arr_parms = null, $p_limit = -1, $p_
static $s_check_params;
if( $s_check_params === null ) {
- $s_check_params = ( db_is_pgsql() || $t_db_type == 'odbc_mssql' || $t_db_type == 'mssqlnative');
+ $s_check_params = ( db_is_pgsql() || $t_db_type == 'odbc_mssql' || $t_db_type == 'mssqlnative' );
}
$t_start = microtime( true );
- if( $p_arr_parms != null && $s_check_params ) {
+ # This ensures that we don't get an error from ADOdb if $p_arr_parms == null,
+ # as Execute() expects either an array or false if there are no parameters -
+ # null actually gets treated as array( 0 => null )
+ if( is_null( $p_arr_parms ) ) {
+ $p_arr_parms = array();
+ }
+
+ if( !empty( $p_arr_parms ) && $s_check_params ) {
$t_params = count( $p_arr_parms );
for( $i = 0;$i < $t_params;$i++ ) {
if( $p_arr_parms[$i] === false ) {
@@ -369,7 +367,7 @@ function db_query_bound( $p_query, array $p_arr_parms = null, $p_limit = -1, $p_
if( ON == $g_db_log_queries ) {
$t_lastoffset = 0;
$i = 0;
- if( !( is_null( $p_arr_parms ) || empty( $p_arr_parms ) ) ) {
+ if( !empty( $p_arr_parms ) ) {
while( preg_match( '/\?/', $p_query, $t_matches, PREG_OFFSET_CAPTURE, $t_lastoffset ) ) {
$t_matches = $t_matches[0];
# Realign the offset returned by preg_match as it is byte-based,
@@ -481,7 +479,7 @@ function db_fetch_array( IteratorAggregate &$p_result ) {
$p_result->MoveNext();
return $t_array;
} else {
- $t_row = $p_result->GetRowAssoc( false );
+ $t_row = $p_result->GetRowAssoc( ADODB_ASSOC_CASE_LOWER );
static $s_array_result;
static $s_array_fields;
View
2 core/project_hierarchy_api.php
@@ -172,7 +172,7 @@ function project_hierarchy_cache( $p_show_disabled = false ) {
WHERE $t_enabled_clause
ORDER BY p.name";
- $t_result = db_query_bound( $t_query, ( $p_show_disabled ? null : array( true ) ) );
+ $t_result = db_query_bound( $t_query, ( $p_show_disabled ? array() : array( true ) ) );
$g_cache_project_hierarchy = array();
$g_cache_project_inheritance = array();
View
2 core/summary_api.php
@@ -569,7 +569,7 @@ function summary_print_by_reporter() {
WHERE $t_specific_where
GROUP BY reporter_id
ORDER BY num DESC";
- $t_result = db_query_bound( $t_query, null, $t_reporter_summary_limit );
+ $t_result = db_query_bound( $t_query, array(), $t_reporter_summary_limit );
$t_reporters = array();
while( $t_row = db_fetch_array( $t_result ) ) {
View
2 core/user_api.php
@@ -1074,7 +1074,7 @@ function user_get_accessible_subprojects( $p_user_id, $p_project_id, $p_show_dis
WHERE $t_enabled_clause
ph.parent_id IS NOT NULL
ORDER BY p.name";
- $t_result = db_query_bound( $t_query, ( $p_show_disabled ? null : array( true ) ) );
+ $t_result = db_query_bound( $t_query, ( $p_show_disabled ? array() : array( true ) ) );
} else {
$t_query = "SELECT DISTINCT p.id, p.name, ph.parent_id
FROM $t_project_table p
View
2 library/README.libs
@@ -5,7 +5,7 @@ The version and status of each is summarized below:
-------------------------------------------------------------------
directory | project | version | status
-------------------------------------------------------------------
-adodb | adodb | v5.18a-49 | unpatched [1]
+adodb | adodb | v5.19 | unpatched [1]
disposable | disposable | 1.1.0 | unpatched
ezc | ez Components | 2009.2.1 | unpatched
phpmailer | PHPMailer | 5.2.6 | unpatched [1]
2 library/adodb
@@ -1 +1 @@
-Subproject commit c1abd33cf8f4c67a98f559a0028f39d8194b21f0
+Subproject commit 9346d288a1b7f7a50cc35b6a0e56d29e9d000ecf
View
2 manage_user_page.php
@@ -179,7 +179,7 @@
echo '</ul>';
echo '</div>';
-$t_where_params = null;
+$t_where_params = array();
if( $f_filter === 'ALL' ) {
$t_where = '(1 = 1)';
} else if( $f_filter === 'UNUSED' ) {

0 comments on commit a2b23b3

Please sign in to comment.