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
1968895e
Commit
1968895e
authored
Oct 27, 2009
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.0-bugteam->5.1-bugteam merge
parents
0ce16dbf
58b7761e
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
194 additions
and
26 deletions
+194
-26
mysql-test/include/have_case_insensitive_fs.inc
mysql-test/include/have_case_insensitive_fs.inc
+4
-0
mysql-test/r/case_insensitive_fs.require
mysql-test/r/case_insensitive_fs.require
+2
-0
mysql-test/r/grant.result
mysql-test/r/grant.result
+2
-2
mysql-test/r/grant_lowercase_fs.result
mysql-test/r/grant_lowercase_fs.result
+16
-0
mysql-test/r/lowercase_fs_off.result
mysql-test/r/lowercase_fs_off.result
+45
-0
mysql-test/r/ps_grant.result
mysql-test/r/ps_grant.result
+3
-3
mysql-test/r/system_mysql_db.result
mysql-test/r/system_mysql_db.result
+1
-1
mysql-test/t/grant_lowercase_fs.test
mysql-test/t/grant_lowercase_fs.test
+30
-0
mysql-test/t/lowercase_fs_off.test
mysql-test/t/lowercase_fs_off.test
+62
-0
scripts/mysql_system_tables.sql
scripts/mysql_system_tables.sql
+1
-1
scripts/mysql_system_tables_fix.sql
scripts/mysql_system_tables_fix.sql
+4
-0
sql/sql_acl.cc
sql/sql_acl.cc
+24
-19
No files found.
mysql-test/include/have_case_insensitive_fs.inc
0 → 100644
View file @
1968895e
--
require
r
/
case_insensitive_fs
.
require
--
disable_query_log
show
variables
like
'lower_case_file_system'
;
--
enable_query_log
mysql-test/r/case_insensitive_fs.require
0 → 100644
View file @
1968895e
Variable_name Value
lower_case_file_system ON
mysql-test/r/grant.result
View file @
1968895e
...
...
@@ -1007,8 +1007,8 @@ DROP TABLE mysqltest1.t2;
SHOW GRANTS;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
RENAME TABLE t1 TO t2;
RENAME TABLE t2 TO t1;
ALTER TABLE t1 RENAME TO t2;
...
...
@@ -1018,8 +1018,8 @@ REVOKE DROP, INSERT ON mysqltest1.t2 FROM mysqltest_1@localhost;
SHOW GRANTS;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
RENAME TABLE t1 TO t2;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
ALTER TABLE t1 RENAME TO t2;
...
...
mysql-test/r/grant_lowercase_fs.result
0 → 100644
View file @
1968895e
create database db1;
GRANT CREATE ON db1.* to user_1@localhost;
GRANT SELECT ON db1.* to USER_1@localhost;
CREATE TABLE t1(f1 int);
SELECT * FROM t1;
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1'
SELECT * FROM t1;
f1
CREATE TABLE t2(f1 int);
ERROR 42000: CREATE command denied to user 'USER_1'@'localhost' for table 't2'
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
DROP USER user_1@localhost;
DROP USER USER_1@localhost;
DROP DATABASE db1;
use test;
mysql-test/r/lowercase_fs_off.result
View file @
1968895e
...
...
@@ -10,3 +10,48 @@ create database D1;
ERROR 42000: Access denied for user 'sample'@'localhost' to database 'D1'
drop user 'sample'@'localhost';
drop database if exists d1;
CREATE DATABASE d1;
USE d1;
CREATE TABLE T1(f1 INT);
CREATE TABLE t1(f1 INT);
GRANT SELECT ON T1 to user_1@localhost;
select * from t1;
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1'
select * from T1;
f1
GRANT SELECT ON t1 to user_1@localhost;
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'user_1'@'localhost' NULL d1 T1 SELECT NO
'user_1'@'localhost' NULL d1 t1 SELECT NO
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
DROP USER user_1@localhost;
DROP DATABASE d1;
USE test;
CREATE DATABASE db1;
USE db1;
CREATE PROCEDURE p1() BEGIN END;
CREATE FUNCTION f1(i INT) RETURNS INT RETURN i+1;
GRANT USAGE ON db1.* to user_1@localhost;
GRANT EXECUTE ON PROCEDURE db1.P1 to user_1@localhost;
GRANT EXECUTE ON FUNCTION db1.f1 to user_1@localhost;
GRANT UPDATE ON db1.* to USER_1@localhost;
call p1();
call P1();
select f1(1);
f1(1)
2
call p1();
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.p1'
call P1();
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.p1'
select f1(1);
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.f1'
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
DROP FUNCTION f1;
DROP PROCEDURE p1;
DROP USER user_1@localhost;
DROP USER USER_1@localhost;
DROP DATABASE db1;
use test;
mysql-test/r/ps_grant.result
View file @
1968895e
...
...
@@ -32,19 +32,19 @@ identified by 'looser' ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
drop table mysqltest.t9 ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
prepare s_t1 from 'select a as my_col from t1' ;
execute s_t1 ;
my_col
...
...
mysql-test/r/system_mysql_db.result
View file @
1968895e
...
...
@@ -161,7 +161,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
`Routine_name` char(64) C
OLLATE utf8_bin
NOT NULL DEFAULT '',
`Routine_name` char(64) C
HARACTER SET utf8
NOT NULL DEFAULT '',
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
...
...
mysql-test/t/grant_lowercase_fs.test
0 → 100644
View file @
1968895e
--
source
include
/
have_case_insensitive_fs
.
inc
--
source
include
/
not_embedded
.
inc
#
# Bug#41049 does syntax "grant" case insensitive?
#
create
database
db1
;
GRANT
CREATE
ON
db1
.*
to
user_1
@
localhost
;
GRANT
SELECT
ON
db1
.*
to
USER_1
@
localhost
;
connect
(
con1
,
localhost
,
user_1
,,
db1
);
CREATE
TABLE
t1
(
f1
int
);
--
error
1142
SELECT
*
FROM
t1
;
connect
(
con2
,
localhost
,
USER_1
,,
db1
);
SELECT
*
FROM
t1
;
--
error
1142
CREATE
TABLE
t2
(
f1
int
);
connection
default
;
disconnect
con1
;
disconnect
con2
;
REVOKE
ALL
PRIVILEGES
,
GRANT
OPTION
FROM
user_1
@
localhost
;
REVOKE
ALL
PRIVILEGES
,
GRANT
OPTION
FROM
USER_1
@
localhost
;
DROP
USER
user_1
@
localhost
;
DROP
USER
USER_1
@
localhost
;
DROP
DATABASE
db1
;
use
test
;
mysql-test/t/lowercase_fs_off.test
View file @
1968895e
...
...
@@ -29,3 +29,65 @@ disconnect master;
connection
default
;
# End of 4.1 tests
#
# Bug#41049 does syntax "grant" case insensitive?
#
CREATE
DATABASE
d1
;
USE
d1
;
CREATE
TABLE
T1
(
f1
INT
);
CREATE
TABLE
t1
(
f1
INT
);
GRANT
SELECT
ON
T1
to
user_1
@
localhost
;
connect
(
con1
,
localhost
,
user_1
,,
d1
);
--
error
ER_TABLEACCESS_DENIED_ERROR
select
*
from
t1
;
select
*
from
T1
;
connection
default
;
GRANT
SELECT
ON
t1
to
user_1
@
localhost
;
connection
con1
;
select
*
from
information_schema
.
table_privileges
;
connection
default
;
disconnect
con1
;
REVOKE
ALL
PRIVILEGES
,
GRANT
OPTION
FROM
user_1
@
localhost
;
DROP
USER
user_1
@
localhost
;
DROP
DATABASE
d1
;
USE
test
;
CREATE
DATABASE
db1
;
USE
db1
;
CREATE
PROCEDURE
p1
()
BEGIN
END
;
CREATE
FUNCTION
f1
(
i
INT
)
RETURNS
INT
RETURN
i
+
1
;
GRANT
USAGE
ON
db1
.*
to
user_1
@
localhost
;
GRANT
EXECUTE
ON
PROCEDURE
db1
.
P1
to
user_1
@
localhost
;
GRANT
EXECUTE
ON
FUNCTION
db1
.
f1
to
user_1
@
localhost
;
GRANT
UPDATE
ON
db1
.*
to
USER_1
@
localhost
;
connect
(
con1
,
localhost
,
user_1
,,
db1
);
call
p1
();
call
P1
();
select
f1
(
1
);
connect
(
con2
,
localhost
,
USER_1
,,
db1
);
--
error
ER_PROCACCESS_DENIED_ERROR
call
p1
();
--
error
ER_PROCACCESS_DENIED_ERROR
call
P1
();
--
error
ER_PROCACCESS_DENIED_ERROR
select
f1
(
1
);
connection
default
;
disconnect
con1
;
disconnect
con2
;
REVOKE
ALL
PRIVILEGES
,
GRANT
OPTION
FROM
user_1
@
localhost
;
REVOKE
ALL
PRIVILEGES
,
GRANT
OPTION
FROM
USER_1
@
localhost
;
DROP
FUNCTION
f1
;
DROP
PROCEDURE
p1
;
DROP
USER
user_1
@
localhost
;
DROP
USER
USER_1
@
localhost
;
DROP
DATABASE
db1
;
use
test
;
# End of 5.0 tests
scripts/mysql_system_tables.sql
View file @
1968895e
...
...
@@ -62,7 +62,7 @@ CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint sign
CREATE
TABLE
IF
NOT
EXISTS
proc
(
db
char
(
64
)
collate
utf8_bin
DEFAULT
''
NOT
NULL
,
name
char
(
64
)
DEFAULT
''
NOT
NULL
,
type
enum
(
'FUNCTION'
,
'PROCEDURE'
)
NOT
NULL
,
specific_name
char
(
64
)
DEFAULT
''
NOT
NULL
,
language
enum
(
'SQL'
)
DEFAULT
'SQL'
NOT
NULL
,
sql_data_access
enum
(
'CONTAINS_SQL'
,
'NO_SQL'
,
'READS_SQL_DATA'
,
'MODIFIES_SQL_DATA'
)
DEFAULT
'CONTAINS_SQL'
NOT
NULL
,
is_deterministic
enum
(
'YES'
,
'NO'
)
DEFAULT
'NO'
NOT
NULL
,
security_type
enum
(
'INVOKER'
,
'DEFINER'
)
DEFAULT
'DEFINER'
NOT
NULL
,
param_list
blob
NOT
NULL
,
returns
longblob
DEFAULT
''
NOT
NULL
,
body
longblob
NOT
NULL
,
definer
char
(
77
)
collate
utf8_bin
DEFAULT
''
NOT
NULL
,
created
timestamp
,
modified
timestamp
,
sql_mode
set
(
'REAL_AS_FLOAT'
,
'PIPES_AS_CONCAT'
,
'ANSI_QUOTES'
,
'IGNORE_SPACE'
,
'NOT_USED'
,
'ONLY_FULL_GROUP_BY'
,
'NO_UNSIGNED_SUBTRACTION'
,
'NO_DIR_IN_CREATE'
,
'POSTGRESQL'
,
'ORACLE'
,
'MSSQL'
,
'DB2'
,
'MAXDB'
,
'NO_KEY_OPTIONS'
,
'NO_TABLE_OPTIONS'
,
'NO_FIELD_OPTIONS'
,
'MYSQL323'
,
'MYSQL40'
,
'ANSI'
,
'NO_AUTO_VALUE_ON_ZERO'
,
'NO_BACKSLASH_ESCAPES'
,
'STRICT_TRANS_TABLES'
,
'STRICT_ALL_TABLES'
,
'NO_ZERO_IN_DATE'
,
'NO_ZERO_DATE'
,
'INVALID_DATES'
,
'ERROR_FOR_DIVISION_BY_ZERO'
,
'TRADITIONAL'
,
'NO_AUTO_CREATE_USER'
,
'HIGH_NOT_PRECEDENCE'
,
'NO_ENGINE_SUBSTITUTION'
,
'PAD_CHAR_TO_FULL_LENGTH'
)
DEFAULT
''
NOT
NULL
,
comment
char
(
64
)
collate
utf8_bin
DEFAULT
''
NOT
NULL
,
character_set_client
char
(
32
)
collate
utf8_bin
,
collation_connection
char
(
32
)
collate
utf8_bin
,
db_collation
char
(
32
)
collate
utf8_bin
,
body_utf8
longblob
,
PRIMARY
KEY
(
db
,
name
,
type
))
engine
=
MyISAM
character
set
utf8
comment
=
'Stored Procedures'
;
CREATE
TABLE
IF
NOT
EXISTS
procs_priv
(
Host
char
(
60
)
binary
DEFAULT
''
NOT
NULL
,
Db
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
User
char
(
16
)
binary
DEFAULT
''
NOT
NULL
,
Routine_name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
Routine_type
enum
(
'FUNCTION'
,
'PROCEDURE'
)
NOT
NULL
,
Grantor
char
(
77
)
DEFAULT
''
NOT
NULL
,
Proc_priv
set
(
'Execute'
,
'Alter Routine'
,
'Grant'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
Timestamp
timestamp
(
14
),
PRIMARY
KEY
(
Host
,
Db
,
User
,
Routine_name
,
Routine_type
),
KEY
Grantor
(
Grantor
)
)
engine
=
MyISAM
CHARACTER
SET
utf8
COLLATE
utf8_bin
comment
=
'Procedure privileges'
;
CREATE
TABLE
IF
NOT
EXISTS
procs_priv
(
Host
char
(
60
)
binary
DEFAULT
''
NOT
NULL
,
Db
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
User
char
(
16
)
binary
DEFAULT
''
NOT
NULL
,
Routine_name
char
(
64
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
Routine_type
enum
(
'FUNCTION'
,
'PROCEDURE'
)
NOT
NULL
,
Grantor
char
(
77
)
DEFAULT
''
NOT
NULL
,
Proc_priv
set
(
'Execute'
,
'Alter Routine'
,
'Grant'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
Timestamp
timestamp
(
14
),
PRIMARY
KEY
(
Host
,
Db
,
User
,
Routine_name
,
Routine_type
),
KEY
Grantor
(
Grantor
)
)
engine
=
MyISAM
CHARACTER
SET
utf8
COLLATE
utf8_bin
comment
=
'Procedure privileges'
;
-- Create general_log if CSV is enabled.
...
...
scripts/mysql_system_tables_fix.sql
View file @
1968895e
...
...
@@ -337,6 +337,10 @@ ALTER TABLE procs_priv
MODIFY
Proc_priv
set
(
'Execute'
,
'Alter Routine'
,
'Grant'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
;
ALTER
IGNORE
TABLE
procs_priv
MODIFY
Routine_name
char
(
64
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
;
ALTER
TABLE
procs_priv
ADD
Routine_type
enum
(
'FUNCTION'
,
'PROCEDURE'
)
COLLATE
utf8_general_ci
NOT
NULL
AFTER
Routine_name
;
...
...
sql/sql_acl.cc
View file @
1968895e
...
...
@@ -263,8 +263,7 @@ my_bool acl_init(bool dont_read_acl_tables)
acl_cache
=
new
hash_filo
(
ACL_CACHE_SIZE
,
0
,
0
,
(
hash_get_key
)
acl_entry_get_key
,
(
hash_free_key
)
free
,
lower_case_file_system
?
system_charset_info
:
&
my_charset_bin
);
&
my_charset_utf8_bin
);
if
(
dont_read_acl_tables
)
{
DBUG_RETURN
(
0
);
/* purecov: tested */
...
...
@@ -2251,12 +2250,13 @@ public:
ulong
sort
;
size_t
key_length
;
GRANT_NAME
(
const
char
*
h
,
const
char
*
d
,
const
char
*
u
,
const
char
*
t
,
ulong
p
);
GRANT_NAME
(
TABLE
*
form
);
const
char
*
t
,
ulong
p
,
bool
is_routine
);
GRANT_NAME
(
TABLE
*
form
,
bool
is_routine
);
virtual
~
GRANT_NAME
()
{};
virtual
bool
ok
()
{
return
privs
!=
0
;
}
void
set_user_details
(
const
char
*
h
,
const
char
*
d
,
const
char
*
u
,
const
char
*
t
);
const
char
*
u
,
const
char
*
t
,
bool
is_routine
);
};
...
...
@@ -2275,7 +2275,8 @@ public:
void
GRANT_NAME
::
set_user_details
(
const
char
*
h
,
const
char
*
d
,
const
char
*
u
,
const
char
*
t
)
const
char
*
u
,
const
char
*
t
,
bool
is_routine
)
{
/* Host given by user */
update_hostname
(
&
host
,
strdup_root
(
&
memex
,
h
));
...
...
@@ -2290,7 +2291,7 @@ void GRANT_NAME::set_user_details(const char *h, const char *d,
if
(
tname
!=
t
)
{
tname
=
strdup_root
(
&
memex
,
t
);
if
(
lower_case_table_names
)
if
(
lower_case_table_names
||
is_routine
)
my_casedn_str
(
files_charset_info
,
tname
);
}
key_length
=
strlen
(
d
)
+
strlen
(
u
)
+
strlen
(
t
)
+
3
;
...
...
@@ -2299,22 +2300,22 @@ void GRANT_NAME::set_user_details(const char *h, const char *d,
}
GRANT_NAME
::
GRANT_NAME
(
const
char
*
h
,
const
char
*
d
,
const
char
*
u
,
const
char
*
t
,
ulong
p
)
const
char
*
t
,
ulong
p
,
bool
is_routine
)
:
db
(
0
),
tname
(
0
),
privs
(
p
)
{
set_user_details
(
h
,
d
,
u
,
t
);
set_user_details
(
h
,
d
,
u
,
t
,
is_routine
);
}
GRANT_TABLE
::
GRANT_TABLE
(
const
char
*
h
,
const
char
*
d
,
const
char
*
u
,
const
char
*
t
,
ulong
p
,
ulong
c
)
:
GRANT_NAME
(
h
,
d
,
u
,
t
,
p
),
cols
(
c
)
:
GRANT_NAME
(
h
,
d
,
u
,
t
,
p
,
FALSE
),
cols
(
c
)
{
(
void
)
hash_init2
(
&
hash_columns
,
4
,
system_charset_info
,
0
,
0
,
0
,
(
hash_get_key
)
get_key_column
,
0
,
0
);
}
GRANT_NAME
::
GRANT_NAME
(
TABLE
*
form
)
GRANT_NAME
::
GRANT_NAME
(
TABLE
*
form
,
bool
is_routine
)
{
update_hostname
(
&
host
,
get_field
(
&
memex
,
form
->
field
[
0
]));
db
=
get_field
(
&
memex
,
form
->
field
[
1
]);
...
...
@@ -2332,6 +2333,9 @@ GRANT_NAME::GRANT_NAME(TABLE *form)
if
(
lower_case_table_names
)
{
my_casedn_str
(
files_charset_info
,
db
);
}
if
(
lower_case_table_names
||
is_routine
)
{
my_casedn_str
(
files_charset_info
,
tname
);
}
key_length
=
(
strlen
(
db
)
+
strlen
(
user
)
+
strlen
(
tname
)
+
3
);
...
...
@@ -2343,7 +2347,7 @@ GRANT_NAME::GRANT_NAME(TABLE *form)
GRANT_TABLE
::
GRANT_TABLE
(
TABLE
*
form
,
TABLE
*
col_privs
)
:
GRANT_NAME
(
form
)
:
GRANT_NAME
(
form
,
FALSE
)
{
uchar
key
[
MAX_KEY_LENGTH
];
...
...
@@ -3338,7 +3342,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
}
grant_name
=
new
GRANT_NAME
(
Str
->
host
.
str
,
db_name
,
Str
->
user
.
str
,
table_name
,
rights
);
rights
,
TRUE
);
if
(
!
grant_name
)
{
result
=
TRUE
;
...
...
@@ -3549,10 +3553,10 @@ static my_bool grant_load_procs_priv(TABLE *p_table)
MEM_ROOT
**
save_mem_root_ptr
=
my_pthread_getspecific_ptr
(
MEM_ROOT
**
,
THR_MALLOC
);
DBUG_ENTER
(
"grant_load_procs_priv"
);
(
void
)
hash_init
(
&
proc_priv_hash
,
system_charset_info
,
(
void
)
hash_init
(
&
proc_priv_hash
,
&
my_charset_utf8_bin
,
0
,
0
,
0
,
(
hash_get_key
)
get_grant_table
,
0
,
0
);
(
void
)
hash_init
(
&
func_priv_hash
,
system_charset_info
,
(
void
)
hash_init
(
&
func_priv_hash
,
&
my_charset_utf8_bin
,
0
,
0
,
0
,
(
hash_get_key
)
get_grant_table
,
0
,
0
);
p_table
->
file
->
ha_index_init
(
0
,
1
);
...
...
@@ -3566,7 +3570,7 @@ static my_bool grant_load_procs_priv(TABLE *p_table)
{
GRANT_NAME
*
mem_check
;
HASH
*
hash
;
if
(
!
(
mem_check
=
new
(
memex_ptr
)
GRANT_NAME
(
p_table
)))
if
(
!
(
mem_check
=
new
(
memex_ptr
)
GRANT_NAME
(
p_table
,
TRUE
)))
{
/* This could only happen if we are out memory */
goto
end_unlock
;
...
...
@@ -3650,7 +3654,7 @@ static my_bool grant_load(THD *thd, TABLE_LIST *tables)
thd
->
variables
.
sql_mode
&=
~
MODE_PAD_CHAR_TO_FULL_LENGTH
;
(
void
)
hash_init
(
&
column_priv_hash
,
system_charset_info
,
(
void
)
hash_init
(
&
column_priv_hash
,
&
my_charset_utf8_bin
,
0
,
0
,
0
,
(
hash_get_key
)
get_grant_table
,
(
hash_free_key
)
free_grant_table
,
0
);
...
...
@@ -5452,7 +5456,8 @@ static int handle_grant_struct(uint struct_no, bool drop,
host name
*/
grant_name
->
set_user_details
(
user_to
->
host
.
str
,
grant_name
->
db
,
user_to
->
user
.
str
,
grant_name
->
tname
);
user_to
->
user
.
str
,
grant_name
->
tname
,
TRUE
);
/*
Since username is part of the hash key, when the user name
...
...
@@ -6139,7 +6144,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
for
(
counter
=
0
,
revoked
=
0
;
counter
<
hash
->
records
;
)
{
GRANT_NAME
*
grant_proc
=
(
GRANT_NAME
*
)
hash_element
(
hash
,
counter
);
if
(
!
my_strcasecmp
(
system_charset_info
,
grant_proc
->
db
,
sp_db
)
&&
if
(
!
my_strcasecmp
(
&
my_charset_utf8_bin
,
grant_proc
->
db
,
sp_db
)
&&
!
my_strcasecmp
(
system_charset_info
,
grant_proc
->
tname
,
sp_name
))
{
LEX_USER
lex_user
;
...
...
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