Commit 72290c2e authored by Addshore's avatar Addshore 🏄
Browse files

Fix mysql server db check, was complaining about Countable

Bug: T287695
Change-Id: I5032fccc8b3fb0e3eb0ca922c2e4b927747b6ccb
parent 658ba309
......@@ -56,8 +56,12 @@ if( file_exists( $IP . '/data/' . $dockerDb . '.sqlite' ) ) {
// TODO cache this check somehow so that we don't need a query every time...
try{
$mysqlPdo = new PDO( "mysql:host=mysql;dbname=" . $dockerDb, 'root', 'toor' );
$mysqlCheck = $mysqlPdo->query("SHOW DATABASES LIKE " . $dockerDb);
if(count( $mysqlCheck ) === 1){
$mysqlCheck = $mysqlPdo->query("SHOW DATABASES LIKE \"" . $dockerDb . "\"");
if($mysqlCheck === false) {
var_dump(json_encode($mysqlPdo->errorInfo()));
die("Failed to get mysql databases list looking for {$dockerDb}.");
}
if(count($mysqlCheck->fetchAll()) === 1){
$dockerDbType = 'mysql';
}
} catch ( Exception $e ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment