Merge pull request #18812 from kamyweb/role_based_auth

Add role based auth for MySQL 8.x and compatibles
This commit is contained in:
Maurício Meneghini Fauth 2024-03-03 01:48:58 -03:00 committed by GitHub
commit 856d316332
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 15 deletions

View File

@ -6755,11 +6755,6 @@ parameters:
count: 1
path: src/DatabaseInterface.php
-
message: "#^Only booleans are allowed in an if condition, PhpMyAdmin\\\\Dbal\\\\ResultInterface\\|false given\\.$#"
count: 2
path: src/DatabaseInterface.php
-
message: "#^Only booleans are allowed in an if condition, int\\|false given\\.$#"
count: 2

View File

@ -1517,11 +1517,7 @@ class DatabaseInterface implements DbalInterface
if (! $hasGrantPrivilege) {
foreach ($this->getCurrentRolesAndHost() as [$role, $roleHost]) {
$query = QueryGenerator::getInformationSchemaDataForGranteeRequest($role, $roleHost ?? '');
$result = $this->tryQuery($query);
if ($result) {
$hasGrantPrivilege = (bool) $result->numRows();
}
$hasGrantPrivilege = (bool) $this->fetchValue($query);
if ($hasGrantPrivilege) {
break;
@ -1568,11 +1564,7 @@ class DatabaseInterface implements DbalInterface
if (! $hasCreatePrivilege) {
foreach ($this->getCurrentRolesAndHost() as [$role, $roleHost]) {
$query = QueryGenerator::getInformationSchemaDataForCreateRequest($role, $roleHost ?? '');
$result = $this->tryQuery($query);
if ($result) {
$hasCreatePrivilege = (bool) $result->numRows();
}
$hasCreatePrivilege = (bool) $this->fetchValue($query);
if ($hasCreatePrivilege) {
break;