Skip to content

Commit

Permalink
Install: perform DB version check while connected as admin
Browse files Browse the repository at this point in the history
This avoids the issue where the call to ServerInfo() only works on MySQL
if the database is open, which may not be the case when testing with
database user (e.g. if user does not exist or does not have access)

Fixes #7635
  • Loading branch information
dregad committed Oct 17, 2013
1 parent 0aefc4d commit be00a3b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions admin/install.php
Expand Up @@ -379,6 +379,12 @@ function InsertData( $p_table, $p_data ) {
} else {
print_test_result( GOOD );
}

# due to a bug in ADODB, this call prompts warnings, hence the @
# the check only works on mysql if the database is open
$t_version_info = @$g_db->ServerInfo();
echo '<br /> Running ' . $f_db_type . ' version ' . nl2br( $t_version_info['description'] );

} else {
print_test_result( BAD, true, 'Does administrative user have access to the database? ( ' . db_error_msg() . ' )' );
}
Expand Down Expand Up @@ -420,9 +426,6 @@ function InsertData( $p_table, $p_data ) {
<td bgcolor="#ffffff">
Checking Database Server Version
<?php
# due to a bug in ADODB, this call prompts warnings, hence the @
# the check only works on mysql if the database is open
$t_version_info = @$g_db->ServerInfo();
echo '<br /> Running ' . $f_db_type . ' version ' . nl2br( $t_version_info['description'] );
?>
</td>
Expand Down

0 comments on commit be00a3b

Please sign in to comment.