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

IT mysqltest role and role2 failed #30279

Closed
aytrack opened this issue Nov 30, 2021 · 4 comments · Fixed by #30294
Closed

IT mysqltest role and role2 failed #30279

aytrack opened this issue Nov 30, 2021 · 4 comments · Fixed by #30294
Assignees
Labels
component/test severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Nov 30, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

#30204 was change the login user identify
in ci https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_integration_common_test/detail/tidb_ghpr_integration_common_test/8049/pipeline

run test [role] err: sql:SHOW GRANTS FOR current_user() USING `replication`;: failed to run query 
SHOW GRANTS FOR current_user() USING `replication`;around line 216,
we need(291):
SHOW GRANTS FOR current_user() USING `replication`;
Grants for joe@localhost
GRANT USAGE ON *.* TO 'joe'@'localhost'
GRANT UPDATE ON role.* TO 'joe'@'localhost'
GRANT SELECT,DELETE ON role.t_external TO 'joe'@'localhost'
GRANT 'replication'@'%', 'wp_administrators'@'%' TO 'joe'@'localhost'
but got(291):
SHOW GRANTS FOR current_user() USING `replication`;
Grants for joe@127.0.0.1
GRANT USAGE ON *.* TO 'joe'@'localhost'
GRANT UPDATE ON role.* TO 'joe'@'localhost'
GRANT SELECT,DELETE ON role.t_external TO 'joe'@'localhost'
GRANT 'replication'@'%', 'wp_administrators'@'%' TO 'joe'@'localhost'\n\n"

run test [role2] err: sql:SHOW GRANTS FOR CURRENT_USER() USING r1;: failed to run query 
"SHOW GRANTS FOR CURRENT_USER() USING r1;\" \n around line 23, \nwe need(139):
SHOW GRANTS FOR CURRENT_USER() USING r1
Grants for u1@localhost
GRANT 'r1'@'%' TO 'u1'@'localhost'
GRANT USAGE ON *.* TO 'u1'@'localhost'
but got(139):
SHOW GRANTS FOR CURRENT_USER() USING r1;
Grants for u1@127.0.0.1
GRANT 'r1'@'%' TO 'u1'@'localhost'
GRANT USAGE ON *.* TO 'u1'@'localhost'"

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@aytrack aytrack added type/bug The issue is confirmed as a bug. component/test sig/sql-infra SIG: SQL Infra severity/major labels Nov 30, 2021
@aytrack
Copy link
Contributor Author

aytrack commented Nov 30, 2021

and this may lead to grant_dynamic failed because the u1@localhost already exists.

[2021-11-30T09:10:03.016Z] time="2021-11-30T17:10:02+08:00" level=error msg="run test [grant_dynamic] err: sql:CREATE USER 'u1'@'localhost' IDENTIFIED BY '123';: run \"CREATE USER 'u1'@'localhost' IDENTIFIED BY '123';\" at line 5 err Error 1396: Operation CREATE USER failed for 'u1'@'localhost'"

@bb7133
Copy link
Member

bb7133 commented Nov 30, 2021

Is this related to the concurrent execution of mysql test?

@morgo
Copy link
Contributor

morgo commented Nov 30, 2021

It is caused by an output difference:

  • Grants for u1@localhost
  • Grants for u1@127.0.0.1

Functionality is the same.

I'll take a look.

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants