Skip to content

Commit a03de96

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fix: add handling for MD5 on new MySQL and deprecate MD5 SQL function
1 parent a4c69c1 commit a03de96

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/private/Setup/MySQL.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,15 @@ public function setupDatabase(): void {
4848
$version = $row['Value'];
4949
[$major, ] = explode('.', strtolower($version));
5050
if ((int)$major >= 9) {
51-
$statement = $connection->prepare("INSTALL COMPONENT 'file://component_classic_hashing';");
52-
$statement->executeStatement();
51+
// check if the component is already loaded, if not load it
52+
$statement = $connection->prepare("SELECT COUNT(*) FROM mysql.component WHERE component_urn = 'file://component_classic_hashing';");
53+
$result = $statement->executeQuery();
54+
$count = $result->fetchOne();
55+
if ($count !== false && (int)$count === 0) {
56+
// not yet loaded
57+
$statement = $connection->prepare("INSTALL COMPONENT 'file://component_classic_hashing';");
58+
$statement->executeStatement();
59+
}
5360
}
5461
}
5562

0 commit comments

Comments
 (0)