mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Add Create_routine_priv, Alter_routine_priv, and Execute_priv privileges
to the 'host' privilege table. (Bug #8166) scripts/mysql_fix_privilege_tables.sql: Add Create_routine_priv, Alter_routine_priv, and Execute_priv to host table scripts/mysql_create_system_tables.sh: Add Create_routine_priv, Alter_routine_priv, and Execute_priv to host table mysql-test/r/system_mysql_db.result: Update results
This commit is contained in:
parent
2eeaddebf8
commit
1968527da9
3 changed files with 10 additions and 0 deletions
|
@ -63,6 +63,9 @@ host CREATE TABLE `host` (
|
|||
`Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_view_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Show_view_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_routine_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_routine_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Execute_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
PRIMARY KEY (`Host`,`Db`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
|
||||
show create table user;
|
||||
|
|
|
@ -105,6 +105,9 @@ then
|
|||
c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h PRIMARY KEY Host (Host,Db)"
|
||||
c_h="$c_h ) engine=MyISAM"
|
||||
c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
|
|
|
@ -202,21 +202,25 @@ SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%';
|
|||
# Create PROCEDUREs privileges (v5.0)
|
||||
#
|
||||
ALTER TABLE db ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv;
|
||||
ALTER TABLE host ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv;
|
||||
ALTER TABLE user ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv;
|
||||
|
||||
#
|
||||
# Alter PROCEDUREs privileges (v5.0)
|
||||
#
|
||||
ALTER TABLE db ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
|
||||
ALTER TABLE host ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
|
||||
ALTER TABLE user ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
|
||||
|
||||
ALTER TABLE db ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;
|
||||
ALTER TABLE host ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;
|
||||
|
||||
#
|
||||
# Assign create/alter routine privileges to people who have create privileges
|
||||
#
|
||||
UPDATE user SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv where user<>"" AND @hadCreateRoutinePriv = 0;
|
||||
UPDATE db SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where user<>"" AND @hadCreateRoutinePriv = 0;
|
||||
UPDATE host SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where @hadCreateRoutinePriv = 0;
|
||||
|
||||
#
|
||||
# Add max_user_connections resource limit
|
||||
|
|
Loading…
Reference in a new issue