[MDEV-17136] Set Password command doesn't update Password Column in mysql.user table Created: 2018-09-05  Updated: 2018-12-03  Resolved: 2018-09-05

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 10.3.9
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Pramod Mahto Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: need_feedback
Environment:

All


Issue Links:
Duplicate
is duplicated by MDEV-16774 SET PASSWORD and ALTER USER with slig... Closed

 Description   

MariaDB 10.3.9 : Updating user password with SET PASSWORD command won't update the mysql.user "password" column with new password value. While Alter user command working perfectly.

 
MariaDB server version : 10.3.9 
MariaDB [(none)]> create user 'test123'@'localhost' identified by 'test123';
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [(none)]> set password for test123@localhost=password('test123');
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [(none)]> select user,host,password from mysql.user where user='test123';
+---------+-----------+----------+
| user    | host      | password |
+---------+-----------+----------+
| test123 | localhost |          |
+---------+-----------+----------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> set password for 'test123'@'localhost'=password('test1234');
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [(none)]> select user,host,password from mysql.user where user='test123';
+---------+-----------+----------+
| user    | host      | password |
+---------+-----------+----------+
| test123 | localhost |          |
+---------+-----------+----------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> alter user 'test123'@'localhost' identified by 'test1234';
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [(none)]> select user,host,password from mysql.user where user='test123';
+---------+-----------+-------------------------------------------+
| user    | host      | password                                  |
+---------+-----------+-------------------------------------------+
| test123 | localhost | *3D3B92F242033365AE5BC6A8E6FC3E1679F4140A |
+---------+-----------+-------------------------------------------+
1 row in set (0.000 sec)
 
While checking with previous MariaDB server version : 10.2.14 its working fine.
 
MariaDB [(none)]> create user 'test123'@'localhost' identified by 'test123';
Query OK, 0 rows affected (0.01 sec)
 
MariaDB [(none)]> set password for test123@localhost=password('test123');
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> select user,host,password from mysql.user where user='test123';
+---------+-----------+-------------------------------------------+
| user    | host      | password                                  |
+---------+-----------+-------------------------------------------+
| test123 | localhost | *676243218923905CF94CB52A3C9D3EB30CE8E20D |
+---------+-----------+-------------------------------------------+
1 row in set (0.00 sec)
 



 Comments   
Comment by Elena Stepanova [ 2018-09-05 ]

This is a duplicate of MDEV-16774, please track it there.

Comment by Sergei Golubchik [ 2018-09-05 ]

This was an intentional change.

SET PASSWORD is documented to set the password for a user, which it does.

It is not documented to set the password column in the user table, it's an internal implementation detail which can be changed any time. One should not rely on the undocumented implementation details.

Generated at Thu Feb 08 08:34:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.