Permalink
Browse files

Don't wrap new password in PASSWORD() function, on newer MySQL servers.

Closes #325.
  • Loading branch information...
ansgarbecker committed Nov 26, 2018
1 parent aeba457 commit 2da1c6bcebb69ee6ff15533c9ee0aa1a4cf8e953
Showing with 4 additions and 1 deletion.
  1. +4 −1 source/usermanager.pas
@@ -1298,7 +1298,10 @@ procedure TUserManagerForm.btnSaveClick(Sender: TObject);
// Set password
if editPassword.Modified and (not PasswordSet) then begin
FConnection.Query('SET PASSWORD FOR ' + OrgUserHost + ' = PASSWORD('+esc(editPassword.Text)+')');
if (not FConnection.Parameters.IsMariaDB) and (FConnection.ServerVersionInt >= 50706) then
FConnection.Query('SET PASSWORD FOR ' + OrgUserHost + ' = '+esc(editPassword.Text))
else
FConnection.Query('SET PASSWORD FOR ' + OrgUserHost + ' = PASSWORD('+esc(editPassword.Text)+')');
end;
// Rename user

0 comments on commit 2da1c6b

Please sign in to comment.