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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
51c631c2
Commit
51c631c2
authored
Oct 18, 2013
by
Vicențiu Ciorbaru
Committed by
Sergei Golubchik
Oct 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented syntax recognition for CREATE ROLE
parent
a57cdcd6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
0 deletions
+20
-0
sql/mysqld.cc
sql/mysqld.cc
+1
-0
sql/sql_lex.h
sql/sql_lex.h
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+8
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+10
-0
No files found.
sql/mysqld.cc
View file @
51c631c2
...
...
@@ -3432,6 +3432,7 @@ SHOW_VAR com_status_vars[]= {
{
"create_function"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
com_stat
[(
uint
)
SQLCOM_CREATE_SPFUNCTION
]),
SHOW_LONG_STATUS
},
{
"create_index"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
com_stat
[(
uint
)
SQLCOM_CREATE_INDEX
]),
SHOW_LONG_STATUS
},
{
"create_procedure"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
com_stat
[(
uint
)
SQLCOM_CREATE_PROCEDURE
]),
SHOW_LONG_STATUS
},
{
"create_role"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
com_stat
[(
uint
)
SQLCOM_CREATE_ROLE
]),
SHOW_LONG_STATUS
},
{
"create_server"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
com_stat
[(
uint
)
SQLCOM_CREATE_SERVER
]),
SHOW_LONG_STATUS
},
{
"create_table"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
com_stat
[(
uint
)
SQLCOM_CREATE_TABLE
]),
SHOW_LONG_STATUS
},
{
"create_trigger"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
com_stat
[(
uint
)
SQLCOM_CREATE_TRIGGER
]),
SHOW_LONG_STATUS
},
...
...
sql/sql_lex.h
View file @
51c631c2
...
...
@@ -169,6 +169,7 @@ enum enum_sql_command {
SQLCOM_SHOW_WARNS
,
SQLCOM_EMPTY_QUERY
,
SQLCOM_SHOW_ERRORS
,
SQLCOM_SHOW_STORAGE_ENGINES
,
SQLCOM_SHOW_PRIVILEGES
,
SQLCOM_HELP
,
SQLCOM_CREATE_USER
,
SQLCOM_DROP_USER
,
SQLCOM_RENAME_USER
,
SQLCOM_CREATE_ROLE
,
SQLCOM_REVOKE_ALL
,
SQLCOM_CHECKSUM
,
SQLCOM_CREATE_PROCEDURE
,
SQLCOM_CREATE_SPFUNCTION
,
SQLCOM_CALL
,
SQLCOM_DROP_PROCEDURE
,
SQLCOM_ALTER_PROCEDURE
,
SQLCOM_ALTER_FUNCTION
,
...
...
sql/sql_parse.cc
View file @
51c631c2
...
...
@@ -366,6 +366,7 @@ void init_update_queries(void)
sql_command_flags
[
SQLCOM_CREATE_USER
]
=
CF_CHANGES_DATA
;
sql_command_flags
[
SQLCOM_RENAME_USER
]
=
CF_CHANGES_DATA
;
sql_command_flags
[
SQLCOM_DROP_USER
]
=
CF_CHANGES_DATA
;
sql_command_flags
[
SQLCOM_CREATE_ROLE
]
=
CF_CHANGES_DATA
;
sql_command_flags
[
SQLCOM_GRANT
]
=
CF_CHANGES_DATA
;
sql_command_flags
[
SQLCOM_GRANT_ROLE
]
=
CF_CHANGES_DATA
;
sql_command_flags
[
SQLCOM_REVOKE
]
=
CF_CHANGES_DATA
;
...
...
@@ -416,6 +417,7 @@ void init_update_queries(void)
sql_command_flags
[
SQLCOM_CREATE_USER
]
|=
CF_AUTO_COMMIT_TRANS
;
sql_command_flags
[
SQLCOM_DROP_USER
]
|=
CF_AUTO_COMMIT_TRANS
;
sql_command_flags
[
SQLCOM_RENAME_USER
]
|=
CF_AUTO_COMMIT_TRANS
;
sql_command_flags
[
SQLCOM_CREATE_ROLE
]
|=
CF_AUTO_COMMIT_TRANS
;
sql_command_flags
[
SQLCOM_REVOKE_ALL
]
=
CF_AUTO_COMMIT_TRANS
;
sql_command_flags
[
SQLCOM_REVOKE
]
|=
CF_AUTO_COMMIT_TRANS
;
sql_command_flags
[
SQLCOM_GRANT
]
|=
CF_AUTO_COMMIT_TRANS
;
...
...
@@ -3753,6 +3755,12 @@ end_with_restore_list:
my_ok
(
thd
);
break
;
}
case
SQLCOM_CREATE_ROLE
:
{
/* TODO */
my_ok
(
thd
);
break
;
}
case
SQLCOM_REVOKE_ALL
:
{
if
(
check_access
(
thd
,
UPDATE_ACL
,
"mysql"
,
NULL
,
NULL
,
1
,
1
)
&&
...
...
sql/sql_yacc.yy
View file @
51c631c2
...
...
@@ -2218,6 +2218,10 @@ create:
{
Lex->sql_command = SQLCOM_CREATE_USER;
}
| CREATE ROLE_SYM clear_privileges role_list
{
Lex->sql_command = SQLCOM_CREATE_ROLE;
}
| CREATE LOGFILE_SYM GROUP_SYM logfile_group_info
{
Lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP;
...
...
@@ -14319,6 +14323,12 @@ grant_command:
;
role_list:
grant_role
{}
| role_list ',' grant_role
{}
grant_role:
IDENT_sys {$$=$1;}
| TEXT_STRING_sys {$$=$1;}
...
...
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