diff --git a/libraries/classes/Database/Routines.php b/libraries/classes/Database/Routines.php index c6a2a09fd0a4..1b515f70c501 100644 --- a/libraries/classes/Database/Routines.php +++ b/libraries/classes/Database/Routines.php @@ -405,8 +405,7 @@ public function flushPrivileges($flushPrivileges) { if ($flushPrivileges) { // Flush the Privileges - $flushPrivQuery = 'FLUSH PRIVILEGES;'; - $this->dbi->query($flushPrivQuery); + $this->dbi->tryQuery('FLUSH PRIVILEGES;'); $message = Message::success( __( diff --git a/libraries/classes/Operations.php b/libraries/classes/Operations.php index c7f8f9b5a1d3..842d3a0ddb0a 100644 --- a/libraries/classes/Operations.php +++ b/libraries/classes/Operations.php @@ -345,8 +345,7 @@ public function adjustPrivilegesMoveDb($oldDb, $newname): void $this->dbi->query($query_proc_specific); // Finally FLUSH the new privileges - $flush_query = 'FLUSH PRIVILEGES;'; - $this->dbi->query($flush_query); + $this->dbi->tryQuery('FLUSH PRIVILEGES;'); } /** @@ -442,8 +441,7 @@ public function adjustPrivilegesCopyDb($oldDb, $newname): void } // Finally FLUSH the new privileges - $flush_query = 'FLUSH PRIVILEGES;'; - $this->dbi->query($flush_query); + $this->dbi->tryQuery('FLUSH PRIVILEGES;'); } /** @@ -816,8 +814,7 @@ public function adjustPrivilegesRenameOrMoveTable($oldDb, $oldTable, $newDb, $ne $this->dbi->query($query_col_specific); // Finally FLUSH the new privileges - $flush_query = 'FLUSH PRIVILEGES;'; - $this->dbi->query($flush_query); + $this->dbi->tryQuery('FLUSH PRIVILEGES;'); } /** @@ -871,8 +868,7 @@ public function adjustPrivilegesCopyTable($oldDb, $oldTable, $newDb, $newTable): } // Finally FLUSH the new privileges - $flush_query = 'FLUSH PRIVILEGES;'; - $this->dbi->query($flush_query); + $this->dbi->tryQuery('FLUSH PRIVILEGES;'); } /** diff --git a/libraries/classes/Server/Privileges.php b/libraries/classes/Server/Privileges.php index 1c8652b693b7..1e33c37dde51 100644 --- a/libraries/classes/Server/Privileges.php +++ b/libraries/classes/Server/Privileges.php @@ -2477,8 +2477,7 @@ public function updateMessageForReload(): ?Message { $message = null; if (isset($_GET['flush_privileges'])) { - $sqlQuery = 'FLUSH PRIVILEGES;'; - $this->dbi->query($sqlQuery); + $this->dbi->tryQuery('FLUSH PRIVILEGES;'); $message = Message::success( __('The privileges were reloaded successfully.') );