Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grant table privileges faild after upgrade from v4.0.14 to v6.0.0 #33588

Closed
aytrack opened this issue Mar 30, 2022 · 2 comments · Fixed by #33599
Closed

grant table privileges faild after upgrade from v4.0.14 to v6.0.0 #33588

aytrack opened this issue Mar 30, 2022 · 2 comments · Fixed by #33599
Assignees
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug. type/regression

Comments

@aytrack
Copy link
Contributor

aytrack commented Mar 30, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. deploy a v4.0.14 cluster
  2. upgrade to v6.0.0
  3. execute sql
use test;
create table t(a int);
create user u1;
grant all on test.t to u1;

2. What did you expect to see? (Required)

grant successfully after upgrade

3. What did you see instead (Required)

grant failed and report error

MySQL root@172.16.4.131:test> grant all on test.t to u1;
(1406, 'Data Too Long, field len 20, data len 31')

4. What is your TiDB version? (Required)

MySQL root@172.16.4.131:test> select tidb_version()\G
Reconnecting...
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.0.0
Edition: Community
Git Commit Hash: 6f28ac47fa43565d57e47fd23946389cac4e3fd2
Git Branch: heads/refs/tags/v6.0.0
UTC Build Time: 2022-03-29 07:07:30
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/critical labels Mar 30, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 labels Mar 30, 2022
@aytrack
Copy link
Contributor Author

aytrack commented Mar 30, 2022

v4.0.14

MySQL root@127.0.0.1:(none)> use mysql;
You are now connected to database "mysql" as user "root"
Time: 0.001s
MySQL root@127.0.0.1:mysql> show create table mysql.tables_priv\G
***************************[ 1. row ]***************************
Table        | tables_priv
Create Table | CREATE TABLE `tables_priv` (
  `Host` char(60) NOT NULL,
  `DB` char(64) NOT NULL,
  `User` char(32) NOT NULL,
  `Table_name` char(64) NOT NULL,
  `Grantor` char(77) DEFAULT NULL,
  `Timestamp` timestamp DEFAULT CURRENT_TIMESTAMP,
  `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','Index','Alter','Create View','Show View','Trigger','References') DEFAULT NULL,
  `Column_priv` set('Select','Insert','Update') DEFAULT NULL,
  PRIMARY KEY (`Host`,`DB`,`User`,`Table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

1 row in set
Time: 0.012s
MySQL root@127.0.0.1:mysql> show create table mysql.columns_priv\G
***************************[ 1. row ]***************************
Table        | columns_priv
Create Table | CREATE TABLE `columns_priv` (
  `Host` char(60) NOT NULL,
  `DB` char(64) NOT NULL,
  `User` char(32) NOT NULL,
  `Table_name` char(64) NOT NULL,
  `Column_name` char(64) NOT NULL,
  `Timestamp` timestamp DEFAULT CURRENT_TIMESTAMP,
  `Column_priv` set('Select','Insert','Update') DEFAULT NULL,
  PRIMARY KEY (`Host`,`DB`,`User`,`Table_name`,`Column_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

1 row in set
Time: 0.001s
MySQL root@127.0.0.1:mysql> select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v4.0.14
Edition: Community
Git Commit Hash: 4f919b07f8f013e48521894c70cb69004f43c622
Git Branch: heads/refs/tags/v4.0.14
UTC Build Time: 2021-07-26 10:53:29
GoVersion: go1.16.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

v6.0.0

tidb git:(release-6.0) ✗ mycli -u root -h 172.16.4.131 -P 4100
MySQL root@172.16.4.131:(none)> show create table mysql.tables_priv\G
***************************[ 1. row ]***************************
Table        | tables_priv
Create Table | CREATE TABLE `tables_priv` (
  `Host` char(255) NOT NULL,
  `DB` char(64) NOT NULL,
  `User` char(32) NOT NULL,
  `Table_name` char(64) NOT NULL,
  `Grantor` char(77) DEFAULT NULL,
  `Timestamp` timestamp DEFAULT CURRENT_TIMESTAMP,
  `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','Index','Alter','Create View','Show View','Trigger','References') DEFAULT NULL,
  `Column_priv` set('Select','Insert','Update') DEFAULT NULL,
  PRIMARY KEY (`Host`,`DB`,`User`,`Table_name`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

1 row in set
Time: 0.053s
MySQL root@172.16.4.131:(none)> show create table mysql.columns_priv\G
***************************[ 1. row ]***************************
Table        | columns_priv
Create Table | CREATE TABLE `columns_priv` (
  `Host` char(255) NOT NULL,
  `DB` char(64) NOT NULL,
  `User` char(32) NOT NULL,
  `Table_name` char(64) NOT NULL,
  `Column_name` char(64) NOT NULL,
  `Timestamp` timestamp DEFAULT CURRENT_TIMESTAMP,
  `Column_priv` set('Select','Insert','Update','References') DEFAULT NULL,
  PRIMARY KEY (`Host`,`DB`,`User`,`Table_name`,`Column_name`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

1 row in set
Time: 0.049s
MySQL root@172.16.4.131:(none)> select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.0.0
Edition: Community
Git Commit Hash: 6f28ac47fa43565d57e47fd23946389cac4e3fd2
Git Branch: heads/refs/tags/v6.0.0
UTC Build Time: 2022-03-29 07:07:30
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@jebter jebter added affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 and removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. labels Mar 30, 2022
@ti-chi-bot ti-chi-bot removed may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 labels Mar 30, 2022
@zimulala zimulala self-assigned this Mar 30, 2022
@kennedy8312
Copy link

/type regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug. type/regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants