Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mantisbt/mantisbt
base: 49d4e76c05cd
...
head fork: mantisbt/mantisbt
compare: a00ebde130ba
  • 5 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 14, 2014
@dregad dregad Update ADOdb to latest 5.19dev
Using development release as it contains fixes over official 5.18 which
are required for MantisBT to work properly, and John Lim (ADOdb author)
is not responding to repeated requests to release 5.19.
34b961d
@dregad dregad Added constant for ADOdb minimum version
Modified installer and admin checks page to use the new constant
5981daa
@dregad dregad Fix admin checks for mysqli table and field collation
The mysqli driver returns field names in lowercase for SHOW TABLE STATUS
whereas mysql uses an uppercase first letter.

Fixes #16968
a21a678
@dregad dregad Install: fix variable names in generated config file
The config_inc.php file generated by the installer had incorrect
variable names for the table prefix and suffix, missing the 'g_'.

Fixes #16966
031bb1f
@dregad dregad Admin checks: added test for db_table_plugin_prefix
We now display the current value (like we do for the other 2 variables),
and display a warning when it is empty.

Fixes #16969
a00ebde
View
65 admin/check/check_database_inc.php
@@ -51,7 +51,7 @@
# This bug has been fixed in ADOdb 5.11 (May 5, 2010) but we still
# need to use the backwards compatible approach to detect ADOdb <5.11.
if( preg_match( '/^[Vv]([0-9\.]+)/', $ADODB_vers, $t_matches ) == 1 ) {
- $t_adodb_version_check_ok = version_compare( $t_matches[1], '5.10', '>=' );
+ $t_adodb_version_check_ok = version_compare( $t_matches[1], DB_MIN_VERSION_ADODB, '>=' );
$t_adodb_version_info = 'ADOdb version ' . htmlentities( $t_matches[1] ) . ' was found.';
}
@@ -63,7 +63,7 @@
);
}
check_print_test_row(
- 'Version of <a href="http://en.wikipedia.org/wiki/ADOdb">ADOdb</a> available is at least 5.11',
+ 'Version of <a href="http://en.wikipedia.org/wiki/ADOdb">ADOdb</a> available is at least ' . DB_MIN_VERSION_ADODB,
$t_adodb_version_check_ok,
$t_adodb_version_info
);
@@ -346,26 +346,61 @@
htmlentities( $t_table_prefix )
);
+$t_table_plugin_prefix = config_get_global( 'db_table_plugin_prefix' );
+check_print_info_row(
+ 'Prefix added to each Plugin table name',
+ htmlentities( $t_table_plugin_prefix )
+);
+
$t_table_suffix = config_get_global( 'db_table_suffix' );
check_print_info_row(
'Suffix added to each MantisBT table name',
htmlentities( $t_table_suffix )
);
+check_print_test_warn_row(
+ 'Plugin table prefix should not be empty',
+ !empty($t_table_plugin_prefix),
+ array(
+ false => 'Defining $g_db_table_plugin_prefix allows easy identification of plugin-specific vs MantisBT core tables',
+ )
+);
+
if( db_is_mysql() ) {
$t_table_prefix_regex_safe = preg_quote( $t_table_prefix, '/' );
$t_table_suffix_regex_safe = preg_quote( $t_table_suffix, '/' );
+ # Field names from MySQL data dictionary
+ # mysql returns fields with uppercase first letter, whereas
+ # mysqli uses all lowercase.
+ switch( $g_db_type ) {
+ case 'mysql':
+ $t_field_name = 'Name';
+ $t_field_comment = 'Comment';
+ $t_field_collation = 'Collation';
+ $t_field_field = 'Field';
+ $t_field_type = 'Type';
+ break;
+ case 'mysqli':
+ $t_field_name = 'name';
+ $t_field_comment = 'comment';
+ $t_field_collation = 'collation';
+ $t_field_field = 'field';
+ $t_field_type = 'type';
+ break;
+ }
+
$t_result = db_query_bound( 'SHOW TABLE STATUS' );
while( $t_row = db_fetch_array( $t_result ) ) {
- if( $t_row['Comment'] !== 'VIEW' &&
- preg_match( "/^$t_table_prefix_regex_safe.+?$t_table_suffix_regex_safe\$/", $t_row['Name'] ) ) {
+ if( $t_row[$t_field_comment] !== 'VIEW' &&
+ preg_match( "/^$t_table_prefix_regex_safe.+?$t_table_suffix_regex_safe\$/", $t_row[$t_field_name] )
+ ) {
check_print_test_row(
- 'Table <em>' . htmlentities( $t_row['Name'] ) . '</em> is using UTF-8 collation',
- substr( $t_row['Collation'], 0, 5 ) === 'utf8_',
- array( false => 'Table ' . htmlentities( $t_row['Name'] )
- . ' is using ' . htmlentities( $t_row['Collation'] )
+ 'Table <em>' . htmlentities( $t_row[$t_field_name] ) . '</em> is using UTF-8 collation',
+ substr( $t_row[$t_field_collation], 0, 5 ) === 'utf8_',
+ array( false => 'Table ' . htmlentities( $t_row[$t_field_name] )
+ . ' is using ' . htmlentities( $t_row[$t_field_collation] )
. ' collation where UTF-8 collation is required.' )
);
}
@@ -375,19 +410,19 @@
if( preg_match( "/^$t_table_prefix_regex_safe.+?$t_table_suffix_regex_safe\$/", $t_table ) ) {
$t_result = db_query_bound( 'SHOW FULL FIELDS FROM ' . $t_table );
while( $t_row = db_fetch_array( $t_result ) ) {
- if ( $t_row['Collation'] === null ) {
+ if ( $t_row[$t_field_collation] === null ) {
continue;
}
check_print_test_row(
- 'Text column <em>' . htmlentities( $t_row['Field'] )
- . '</em> of type <em>' . $t_row['Type']
+ 'Text column <em>' . htmlentities( $t_row[$t_field_field] )
+ . '</em> of type <em>' . $t_row[$t_field_type]
. '</em> on table <em>' . htmlentities( $t_table )
. '</em> is is using UTF-8 collation',
- substr( $t_row['Collation'], 0, 5 ) === 'utf8_',
- array( false => 'Text column ' . htmlentities( $t_row['Field'] )
- . ' of type ' . $t_row['Type']
+ substr( $t_row[$t_field_collation], 0, 5 ) === 'utf8_',
+ array( false => 'Text column ' . htmlentities( $t_row[$t_field_field] )
+ . ' of type ' . $t_row[$t_field_type]
. ' on table ' . htmlentities( $t_table )
- . ' is using ' . htmlentities( $t_row['Collation'] )
+ . ' is using ' . htmlentities( $t_row[$t_field_collation] )
. ' collation where UTF-8 collation is required.' )
);
}
View
20 admin/install.php
@@ -306,21 +306,11 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
print_test( 'Checking PHP support for database type', db_check_database_support( $f_db_type ), true, 'database is not supported by PHP. Check that it has been compiled into your server.' );
# ADOdb library version check
- # PostgreSQL, Oracle and MSSQL require at least 5.18.
- # @TODO dregad 20131001 req is 5.19 actually, but must wait until official release
- # MySQL should be fine with 5.10
+ # PostgreSQL, Oracle and MSSQL require at least 5.19. MySQL should be fine
+ # with 5.10 but to simplify we align to the requirement of the others.
$t_adodb_version = substr( $ADODB_vers, 1, strpos( $ADODB_vers, ' ' ) - 1 );
- switch( $f_db_type ) {
- case 'mssqlnative':
- case 'oci8' :
- case 'pgsql' :
- $t_adodb_min = '5.18';
- break;
- default:
- $t_adodb_min = '5.10';
- }
- print_test( "Checking ADOdb Library version is at least $t_adodb_min",
- version_compare( $t_adodb_version, $t_adodb_min, '>=' ),
+ print_test( "Checking ADOdb Library version is at least " . DB_MIN_VERSION_ADODB,
+ version_compare( $t_adodb_version, DB_MIN_VERSION_ADODB, '>=' ),
true,
'Current version: ' . $ADODB_vers
);
@@ -1026,7 +1016,7 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
foreach( $t_prefix_defaults['other'] as $t_key => $t_value ) {
$t_new_value = ${'f_' . $t_key};
if( $t_new_value != $t_value ) {
- $t_config .= '$' . str_pad( $t_key, 25 ) . "= '" . ${'f_' . $t_key} . "';\n";
+ $t_config .= '$g_' . str_pad( $t_key, 25 ) . "= '" . ${'f_' . $t_key} . "';\n";
$t_insert_line = true;
}
}
View
1  core/constant_inc.php
@@ -39,6 +39,7 @@
# installation
define( 'CONFIGURED_PASSWORD', "______" );
+define( 'DB_MIN_VERSION_ADODB', '5.19dev' ); # 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
2  library/adodb
@@ -1 +1 @@
-Subproject commit 41266592ce64dbccb6619b540a555690e5201976
+Subproject commit 1208307846b90c9d5594f3163451c5039c45bbef

No commit comments for this range

Something went wrong with that request. Please try again.