You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges';`)
tk.MustExec(`INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','', '', 'null', 'N', current_timestamp(), null);
`)
varp privileges.MySQLPrivilege
require.NoError(t, p.LoadUserTable(tk.Session()))
activeRoles:=make([]*auth.RoleIdentity, 0)
// MySQL mysql.user table schema is not identical to TiDB, check it doesn't break privilege.
To me it looks like this test was meant to test if authentication in TiDB would break if someone/something would accidentally sync the mysql.user table from MySQL. However the current version doesn't match a MySQL mysql.user table anymore.
If something like DM or any other tool would accidentaly sync the mysql.user table from MySQL to TiDB this would be a serious problem. So it might be good to test to make sure at least root can still authenticate.
Then we should test with the mysql.user structure from MySQL 5.7, 8.0 and 8.4. Maybe also MariaDB 11.x?
However if the table is synced then the data in it might be synced as well. This might work for caching_sha2_password or mysql_native_password. However root might use socket auth in some situations or be restricted to 127.0.0.1/::1 which might make this more difficult. And at least MariaDB has some different auth plugins that we don't support.
There is another solution, which I think might be better: Rely on skip_grant_tables. This should work for all root authentication issues including this one.
I don't think we would ever officially support syncing mysql.user from a non-TiDB upstream. So this would only be a best effort action to reduce the damage.
The test currently doesn't include versions of the mysql.user table from previous versions of TiDB.
The text was updated successfully, but these errors were encountered:
Bug Report
TestAbnormalMySQLTable:
tidb/pkg/privilege/privileges/cache_test.go
Lines 369 to 444 in 2ee8c99
To me it looks like this test was meant to test if authentication in TiDB would break if someone/something would accidentally sync the mysql.user table from MySQL. However the current version doesn't match a MySQL mysql.user table anymore.
The text was updated successfully, but these errors were encountered: