@@ -1436,12 +1436,7 @@ public function isSuperUser(): bool
14361436 return false ;
14371437 }
14381438
1439- $ result = $ this ->tryQuery ('SELECT 1 FROM mysql.user LIMIT 1 ' );
1440- $ isSuperUser = false ;
1441-
1442- if ($ result ) {
1443- $ isSuperUser = (bool ) $ result ->numRows ();
1444- }
1439+ $ isSuperUser = (bool ) $ this ->fetchValue ('SELECT 1 FROM mysql.user LIMIT 1 ' );
14451440
14461441 SessionCache::set ('is_superuser ' , $ isSuperUser );
14471442
@@ -1477,11 +1472,7 @@ public function isGrantUser(): bool
14771472
14781473 [$ user , $ host ] = $ this ->getCurrentUserAndHost ();
14791474 $ query = QueryGenerator::getInformationSchemaDataForGranteeRequest ($ user , $ host );
1480- $ result = $ this ->tryQuery ($ query );
1481-
1482- if ($ result ) {
1483- $ hasGrantPrivilege = (bool ) $ result ->numRows ();
1484- }
1475+ $ hasGrantPrivilege = (bool ) $ this ->fetchValue ($ query );
14851476
14861477 SessionCache::set ('is_grantuser ' , $ hasGrantPrivilege );
14871478
@@ -1517,11 +1508,7 @@ public function isCreateUser(): bool
15171508
15181509 [$ user , $ host ] = $ this ->getCurrentUserAndHost ();
15191510 $ query = QueryGenerator::getInformationSchemaDataForCreateRequest ($ user , $ host );
1520- $ result = $ this ->tryQuery ($ query );
1521-
1522- if ($ result ) {
1523- $ hasCreatePrivilege = (bool ) $ result ->numRows ();
1524- }
1511+ $ hasCreatePrivilege = (bool ) $ this ->fetchValue ($ query );
15251512
15261513 SessionCache::set ('is_createuser ' , $ hasCreatePrivilege );
15271514
0 commit comments