Skip to content

Commit

Permalink
Fix up errors during connection on installer
Browse files Browse the repository at this point in the history
  • Loading branch information
jdarwood007 committed Nov 22, 2023
1 parent cff5f4f commit e242dc3
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Sources/Db/APIs/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -2020,23 +2020,27 @@ protected function __construct(array $options = [])
$this->prefixReservedTables();
}

$this->get_version();
$this->supports_pcre = version_compare($this->version, strpos($this->version, 'MariaDB') !== false ? '10.0.5' : '8.0.4', '>=');
if (empty($this->connection) && !$non_fatal)
{
$this->get_version();
$this->supports_pcre = version_compare($this->version, strpos($this->version, 'MariaDB') !== false ? '10.0.5' : '8.0.4', '>=');
}

// For backward compatibility.
if (!is_object(self::$db_connection)) {
self::$db_connection = $this->connection;
}

// Ensure database has UTF-8 as its default input charset.
$this->query(
'',
'
SET NAMES {string:db_character_set}',
[
'db_character_set' => $this->character_set,
],
);
if (empty($this->connection) && !$non_fatal)
$this->query(
'',
'
SET NAMES {string:db_character_set}',
[
'db_character_set' => $this->character_set,
],
);
}

/**
Expand Down

0 comments on commit e242dc3

Please sign in to comment.