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

update table privilege error #10028

Closed
haplone opened this issue Apr 3, 2019 · 1 comment
Closed

update table privilege error #10028

haplone opened this issue Apr 3, 2019 · 1 comment
Labels
type/bug The issue is confirmed as a bug.

Comments

@haplone
Copy link
Contributor

haplone commented Apr 3, 2019

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.

use root execute these sqls:

CREATE USER 'haha'@'localhost' IDENTIFIED BY '123456';

create database ap;
create database tp;
grant all privileges on ap.* to haha@localhost;
grant select on tp.* to haha@localhost;
flush privileges;

create table tp.record( id int,name varchar(128),age int);
insert into tp.record (id,name,age) values (1,"john",18),(2,"lary",19),(3,'lily',18);

create table ap.record( id int,name varchar(128),age int);
insert into ap.record(id) values(1);

then use user haha update

update ap.record t inner join tp.record tt on t.id=tt.id  set t.name=tt.name;
  1. What did you expect to see?
Query OK, 1 row affected (0.002 sec)
Rows matched: 1  Changed: 1  Warnings: 0
  1. What did you see instead?
ERROR 1105 (HY000): privilege check fail
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
| Release Version: v3.0.0-beta.1-51-g6e3353b76
Git Commit Hash: 6e3353b76f17bdcb1bf55df205e6b3fa9f5a0f38
Git Branch: master
UTC Build Time: 2019-04-03 11:20:45
GoVersion: go version go1.11.4 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
| Release Version: v2.1.7-21-gb7b8acff4-dirty
Git Commit Hash: b7b8acff431f3ece1aa3b0d55807ceb1363cb05e
Git Branch: release-2.1
UTC Build Time: 2019-04-03 11:27:03
GoVersion: go version go1.11.4 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |

v2.1.7 is dirty just because I modified go.sum,or I get this error when make

go: verifying github.com/pingcap/kvproto@v0.0.0-20190226063853-f6c0b7ffff11: checksum mismatch
	downloaded: h1:e81flSfRbbMW5RUnz1cJl+8XKOVUCfF8FapFS8HnHLs=
	go.sum:     h1:iGNfAHgK0VHJobW4bPTlFmdnt3YWsEHdSTIcjut6ffk=

I think I can fix it, but I need some help with test.

@ghost
Copy link

ghost commented Jul 13, 2020

Confirming this has been fixed in master:

CREATE USER 'haha';
create database ap;
create database tp;
grant all privileges on ap.* to haha;
grant select on tp.* to haha;

create table tp.record( id int,name varchar(128),age int);
insert into tp.record (id,name,age) values (1,"john",18),(2,"lary",19),(3,'lily',18);

create table ap.record( id int,name varchar(128),age int);
insert into ap.record(id) values(1);

Then:

$ mysql -uhaha
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.7.25-TiDB-v4.0.0-beta.2-750-g8a661044c TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> update ap.record t inner join tp.record tt on t.id=tt.id  set t.name=tt.name;
Query OK, 1 row affected (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 0

I am going to close this issue now.

@ghost ghost closed this as completed Jul 13, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants