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 6, 2023
1 parent 8606269 commit ee4d909
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Sources/Db/APIs/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -1930,20 +1930,24 @@ protected function __construct(array $options = array())
$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}',
array(
'db_character_set' => $this->character_set,
)
);
if (empty($this->connection) && !$non_fatal)
$this->query('', '
SET NAMES {string:db_character_set}',
array(
'db_character_set' => $this->character_set,
)
);
}

/**
Expand Down

0 comments on commit ee4d909

Please sign in to comment.