@@ -1453,7 +1453,7 @@ public function isGrantUser(): bool
14531453
14541454 if (! $ hasGrantPrivilege ) {
14551455 foreach ($ this ->getCurrentRolesAndHost () as [$ role , $ roleHost ]) {
1456- $ query = QueryGenerator::getInformationSchemaDataForGranteeRequest ($ role , $ roleHost ?? '' , $ collation );
1456+ $ query = QueryGenerator::getInformationSchemaDataForGranteeRequest ($ role , $ roleHost , $ collation );
14571457 $ hasGrantPrivilege = (bool ) $ this ->fetchValue ($ query );
14581458
14591459 if ($ hasGrantPrivilege ) {
@@ -1502,7 +1502,7 @@ public function isCreateUser(): bool
15021502
15031503 if (! $ hasCreatePrivilege ) {
15041504 foreach ($ this ->getCurrentRolesAndHost () as [$ role , $ roleHost ]) {
1505- $ query = QueryGenerator::getInformationSchemaDataForCreateRequest ($ role , $ roleHost ?? '' , $ collation );
1505+ $ query = QueryGenerator::getInformationSchemaDataForCreateRequest ($ role , $ roleHost , $ collation );
15061506 $ hasCreatePrivilege = (bool ) $ this ->fetchValue ($ query );
15071507
15081508 if ($ hasCreatePrivilege ) {
@@ -1556,7 +1556,7 @@ public function getCurrentRolesAndHost(): array
15561556 $ roles = $ this ->getCurrentRoles ();
15571557
15581558 $ this ->currentRoleAndHost = array_map (static function (string $ role ) {
1559- return explode ('@ ' , $ role );
1559+ return str_contains ( $ role , ' @ ' ) ? explode ('@ ' , $ role ) : [ $ role , '' ] ;
15601560 }, $ roles );
15611561 }
15621562
0 commit comments