Details
Description
connect con1,localhost,foo,,db1; |
show grants;
|
Grants for foo@localhost |
GRANT USAGE ON *.* TO `foo`@`localhost` |
GRANT CREATE ON `db1`.* TO `foo`@`localhost` |
GRANT CREATE ON `db2`.* TO `foo`@`localhost` |
create table t(t int); |
show columns in t; |
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't' |
- Database should be shown too:
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'db1.t'
Attachments
Issue Links
- relates to
-
MDEV-28455 CREATE TEMPORARY TABLES privilege is insufficient for SHOW COLUMNS
-
- Closed
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue relates to |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Anel Husakovic [ anel ] | Vicențiu Ciorbaru [ cvicentiu ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Vicențiu Ciorbaru [ cvicentiu ] | Anel Husakovic [ anel ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Anel Husakovic [ anel ] | Vicențiu Ciorbaru [ cvicentiu ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Remote Link | This issue links to "PR 2192 (Web Link)" [ 34112 ] |
Assignee | Vicențiu Ciorbaru [ cvicentiu ] | Anel Husakovic [ anel ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Anel Husakovic [ anel ] | Vicențiu Ciorbaru [ cvicentiu ] |
Status | Stalled [ 10000 ] | In Review [ 10002 ] |
Assignee | Vicențiu Ciorbaru [ cvicentiu ] | Anel Husakovic [ anel ] |
Fix Version/s | 10.3.37 [ 28404 ] | |
Fix Version/s | 10.4.27 [ 28405 ] | |
Fix Version/s | 10.5.18 [ 28421 ] | |
Fix Version/s | 10.6.11 [ 28441 ] | |
Fix Version/s | 10.7.7 [ 28442 ] | |
Fix Version/s | 10.8.6 [ 28443 ] | |
Fix Version/s | 10.9.4 [ 28444 ] | |
Fix Version/s | 10.10.2 [ 28410 ] | |
Fix Version/s | 10.11.1 [ 28454 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Review [ 10002 ] | Closed [ 6 ] |
Hi Anel!
Looks like you forgot the null pointer check like I told you here:
https://mariadb.zulipchat.com/#narrow/stream/252587-AskMonty/topic/MDEV-28548/near/282130265
Here is my suggestion:
@@ -7
763,9 +7763,13 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
status_var_increment(thd->status_var.access_denied_errors);
String str;
- str.append(tl->get_db_name());
- str.append('.');
- str.append(tl->get_table_name());
+ if (tl)
+ {
+ str.append(tl->get_db_name());
+ str.append('.');
+ str.append(tl->get_table_name());
+ }
Also, as a stylistic / readability change, can you please rename all occurrences of your String str to be: String db_and_table.
Ok to push after this.