Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b4fcd1a4
Commit
b4fcd1a4
authored
Jan 19, 2016
by
Vicențiu Ciorbaru
Committed by
Vicențiu Ciorbaru
Mar 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MDEV-7978] Updated syntax for SHOW CREATE USER
parent
5c32d5e6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
1 deletion
+26
-1
sql/mysqld.cc
sql/mysqld.cc
+1
-0
sql/sp_head.cc
sql/sp_head.cc
+1
-0
sql/sql_acl.cc
sql/sql_acl.cc
+4
-0
sql/sql_acl.h
sql/sql_acl.h
+1
-0
sql/sql_cmd.h
sql/sql_cmd.h
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+6
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+12
-0
No files found.
sql/mysqld.cc
View file @
b4fcd1a4
...
...
@@ -3917,6 +3917,7 @@ SHOW_VAR com_status_vars[]= {
{
"show_create_proc"
,
STMT_STATUS
(
SQLCOM_SHOW_CREATE_PROC
)},
{
"show_create_table"
,
STMT_STATUS
(
SQLCOM_SHOW_CREATE
)},
{
"show_create_trigger"
,
STMT_STATUS
(
SQLCOM_SHOW_CREATE_TRIGGER
)},
{
"show_create_user"
,
STMT_STATUS
(
SQLCOM_SHOW_CREATE_USER
)},
{
"show_databases"
,
STMT_STATUS
(
SQLCOM_SHOW_DATABASES
)},
{
"show_engine_logs"
,
STMT_STATUS
(
SQLCOM_SHOW_ENGINE_LOGS
)},
{
"show_engine_mutex"
,
STMT_STATUS
(
SQLCOM_SHOW_ENGINE_MUTEX
)},
...
...
sql/sp_head.cc
View file @
b4fcd1a4
...
...
@@ -216,6 +216,7 @@ sp_get_flags_for_command(LEX *lex)
case
SQLCOM_SHOW_CREATE_PROC
:
case
SQLCOM_SHOW_CREATE_EVENT
:
case
SQLCOM_SHOW_CREATE_TRIGGER
:
case
SQLCOM_SHOW_CREATE_USER
:
case
SQLCOM_SHOW_DATABASES
:
case
SQLCOM_SHOW_ERRORS
:
case
SQLCOM_SHOW_EXPLAIN
:
...
...
sql/sql_acl.cc
View file @
b4fcd1a4
...
...
@@ -7733,6 +7733,10 @@ static int show_grants_callback(ACL_USER_BASE *role, void *data)
return
0
;
}
bool
mysql_show_create_user
(
THD
*
thd
,
LEX_USER
*
lex_user
)
{
return
FALSE
;
}
void
mysql_show_grants_get_fields
(
THD
*
thd
,
List
<
Item
>
*
fields
,
const
char
*
name
)
...
...
sql/sql_acl.h
View file @
b4fcd1a4
...
...
@@ -244,6 +244,7 @@ ulong get_column_grant(THD *thd, GRANT_INFO *grant,
void
mysql_show_grants_get_fields
(
THD
*
thd
,
List
<
Item
>
*
fields
,
const
char
*
name
);
bool
mysql_show_grants
(
THD
*
thd
,
LEX_USER
*
user
);
bool
mysql_show_create_user
(
THD
*
thd
,
LEX_USER
*
user
);
int
fill_schema_enabled_roles
(
THD
*
thd
,
TABLE_LIST
*
tables
,
COND
*
cond
);
int
fill_schema_applicable_roles
(
THD
*
thd
,
TABLE_LIST
*
tables
,
COND
*
cond
);
void
get_privilege_desc
(
char
*
to
,
uint
max_length
,
ulong
access
);
...
...
sql/sql_cmd.h
View file @
b4fcd1a4
...
...
@@ -94,6 +94,7 @@ enum enum_sql_command {
SQLCOM_COMPOUND
,
SQLCOM_SHOW_GENERIC
,
SQLCOM_ALTER_USER
,
SQLCOM_SHOW_CREATE_USER
,
/*
When a command is added here, be sure it's also added in mysqld.cc
...
...
sql/sql_parse.cc
View file @
b4fcd1a4
...
...
@@ -417,6 +417,7 @@ void init_update_queries(void)
sql_command_flags
[
SQLCOM_SHOW_EXPLAIN
]
=
CF_STATUS_COMMAND
;
sql_command_flags
[
SQLCOM_SHOW_PROCESSLIST
]
=
CF_STATUS_COMMAND
;
sql_command_flags
[
SQLCOM_SHOW_GRANTS
]
=
CF_STATUS_COMMAND
;
sql_command_flags
[
SQLCOM_SHOW_CREATE_USER
]
=
CF_STATUS_COMMAND
;
sql_command_flags
[
SQLCOM_SHOW_CREATE_DB
]
=
CF_STATUS_COMMAND
;
sql_command_flags
[
SQLCOM_SHOW_CREATE
]
=
CF_STATUS_COMMAND
;
sql_command_flags
[
SQLCOM_SHOW_MASTER_STAT
]
=
CF_STATUS_COMMAND
;
...
...
@@ -4946,6 +4947,7 @@ mysql_execute_command(THD *thd)
break
;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
case
SQLCOM_SHOW_CREATE_USER
:
case
SQLCOM_SHOW_GRANTS
:
{
LEX_USER
*
grant_user
=
lex
->
grant_user
;
...
...
@@ -4962,7 +4964,10 @@ mysql_execute_command(THD *thd)
grant_user
->
user
.
str
==
current_user_and_current_role
.
str
||
!
check_access
(
thd
,
SELECT_ACL
,
"mysql"
,
NULL
,
NULL
,
1
,
0
))
{
res
=
mysql_show_grants
(
thd
,
grant_user
);
if
(
lex
->
sql_command
==
SQLCOM_SHOW_GRANTS
)
res
=
mysql_show_grants
(
thd
,
grant_user
);
else
res
=
mysql_show_create_user
(
thd
,
grant_user
);
}
break
;
}
...
...
sql/sql_yacc.yy
View file @
b4fcd1a4
...
...
@@ -12774,6 +12774,18 @@ show_param:
lex->sql_command= SQLCOM_SHOW_CREATE_TRIGGER;
lex->spname= $3;
}
| CREATE USER
{
Lex->sql_command= SQLCOM_SHOW_CREATE_USER;
if (!(Lex->grant_user= (LEX_USER*)thd->alloc(sizeof(LEX_USER))))
MYSQL_YYABORT;
Lex->grant_user->user= current_user_and_current_role;
}
| CREATE USER user
{
Lex->sql_command= SQLCOM_SHOW_CREATE_USER;
Lex->grant_user= $3;
}
| PROCEDURE_SYM STATUS_SYM wild_and_where
{
LEX *lex= Lex;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment