Skip to content

Commit 515b014

Browse files
Copilotswissspidy
andcommitted
Fall back to client binary version when database server is unavailable
Co-authored-by: swissspidy <[email protected]>
1 parent dae93cf commit 515b014

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

utils/behat-tags.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,10 @@ function get_db_type_and_version() {
9898
exec( $cmd, $output, $return_code );
9999
$version_string = isset( $output[0] ) ? $output[0] : '';
100100

101-
// If the connection failed, return defaults.
101+
// If the connection failed, fall back to client binary version.
102102
if ( 0 !== $return_code || empty( $version_string ) ) {
103-
return array(
104-
'type' => 'mysql',
105-
'version' => '',
106-
);
103+
$client_version_cmd = sprintf( '%s --version 2>/dev/null', escapeshellcmd( $client_binary ) );
104+
$version_string = exec( $client_version_cmd );
107105
}
108106

109107
// Detect database type from server version string.

0 commit comments

Comments
 (0)