WL#6409: deprecate PASSWORD() and extend ALTER USER syntax to manage authentication attributes.

Affects: Server-5.7   —   Status: Complete

The PASSWORD() function was introduced as a way to manually update the
mysql.user table. This is generally a bad idea and we want to leave the task of
updating the passwords to a dedicated statement which automatically find which
authentication plugin is being used and adjust the password algorithm accordingly.

The proposal is to introduce a new statement, SET CREDENTIALS, which does
exactly which while deprecating SET PASSWORD and the PASSWORD() function.

The new statement would look like this:

SET CREDENTIALS [FOR user] [TO 'password'] [WITH plugin [AS 'auth_string']]
    [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]

If  is omitted the current_user is used instead.

Statement is eligible for password obfuscation in rewrite module
(sql/sql_rewrite.cc), and should not be added to mysql client history.

Note that this mechanism should support conversion of an existing account from
one authentication plugin to another.  Because some authentication plugins do
not require passwords, this must be optional.  Additionally, the plugin name and
auth_string may be optionally supplied.