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
071c4ce8
Commit
071c4ce8
authored
Oct 17, 2013
by
Vicențiu Ciorbaru
Committed by
Sergei Golubchik
Oct 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed no longer needed RoleHostFK as it is not used to link to a Role.
Also removed code that loads that column into memory.
parent
ee1e6646
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
scripts/mysql_system_tables.sql
scripts/mysql_system_tables.sql
+1
-4
sql/sql_acl.cc
sql/sql_acl.cc
+8
-13
No files found.
scripts/mysql_system_tables.sql
View file @
071c4ce8
...
...
@@ -44,10 +44,7 @@ set @had_user_table= @@warning_count != 0;
CREATE
TABLE
IF
NOT
EXISTS
roles_mapping
(
HostFk
char
(
60
)
binary
DEFAULT
''
NOT
NULL
,
UserFk
char
(
16
)
binary
DEFAULT
''
NOT
NULL
,
RoleHostFK
char
(
60
)
binary
DEFAULT
''
NOT
NULL
,
RoleUserFk
char
(
16
)
binary
DEFAULT
''
NOT
NULL
,
CONSTRAINT
FOREIGN
KEY
(
HostFk
,
UserFk
)
REFERENCES
user
(
Host
,
User
),
CONSTRAINT
FOREIGN
KEY
(
RoleHostFk
,
RoleUserFk
)
REFERENCES
user
(
Host
,
User
)
RoleFk
char
(
16
)
binary
DEFAULT
''
NOT
NULL
);
...
...
sql/sql_acl.cc
View file @
071c4ce8
...
...
@@ -539,7 +539,6 @@ typedef struct st_role_grant
char
*
u_uname
;
char
*
u_hname
;
char
*
r_uname
;
char
*
r_hname
;
LEX_STRING
hashkey
;
}
ROLE_GRANT_PAIR
;
...
...
@@ -1237,28 +1236,24 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
sizeof
(
ROLE_GRANT_PAIR
));
mapping
->
u_hname
=
get_field
(
&
mem
,
table
->
field
[
0
]);
mapping
->
u_uname
=
get_field
(
&
mem
,
table
->
field
[
1
]);
mapping
->
r_hname
=
get_field
(
&
mem
,
table
->
field
[
2
]);
mapping
->
r_uname
=
get_field
(
&
mem
,
table
->
field
[
3
]);
mapping
->
r_uname
=
get_field
(
&
mem
,
table
->
field
[
2
]);
size_t
len
[
4
]
=
{
mapping
->
u_hname
?
strlen
(
mapping
->
u_hname
)
:
0
,
size_t
len
[
3
]
=
{
mapping
->
u_hname
?
strlen
(
mapping
->
u_hname
)
:
0
,
mapping
->
u_uname
?
strlen
(
mapping
->
u_uname
)
:
0
,
mapping
->
r_hname
?
strlen
(
mapping
->
r_hname
)
:
0
,
mapping
->
r_uname
?
strlen
(
mapping
->
r_uname
)
:
0
};
char
*
buff
=
(
char
*
)
alloc_root
(
&
mem
,
len
[
0
]
+
len
[
1
]
+
len
[
2
]
+
len
[
3
]
+
1
);
char
*
buff
=
(
char
*
)
alloc_root
(
&
mem
,
len
[
0
]
+
len
[
1
]
+
len
[
2
]
+
1
);
memcpy
(
buff
,
mapping
->
u_hname
,
len
[
0
]);
memcpy
(
buff
+
len
[
0
],
mapping
->
u_uname
,
len
[
1
]);
memcpy
(
buff
+
len
[
0
]
+
len
[
1
],
mapping
->
r_hname
,
len
[
2
]);
memcpy
(
buff
+
len
[
0
]
+
len
[
1
]
+
len
[
2
],
mapping
->
r_uname
,
len
[
3
]);
buff
[
len
[
0
]
+
len
[
1
]
+
len
[
2
]
+
len
[
3
]]
=
'\0'
;
memcpy
(
buff
+
len
[
0
]
+
len
[
1
]
+
len
[
2
],
mapping
->
r_uname
,
len
[
2
]);
buff
[
len
[
0
]
+
len
[
1
]
+
len
[
2
]]
=
'\0'
;
mapping
->
hashkey
.
str
=
buff
;
mapping
->
hashkey
.
length
=
len
[
0
]
+
len
[
1
]
+
len
[
2
]
+
len
[
3
]
;
mapping
->
hashkey
.
length
=
len
[
0
]
+
len
[
1
]
+
len
[
2
];
if
(
add_role_user_mapping
(
mapping
)
==
1
)
{
sql_print_error
(
"Invalid roles_mapping table entry
'%s@%s', '%s@
%s'"
,
sql_print_error
(
"Invalid roles_mapping table entry
user:'%s@%s', rolename:'
%s'"
,
mapping
->
u_uname
?
mapping
->
u_uname
:
""
,
mapping
->
u_hname
?
mapping
->
u_hname
:
""
,
mapping
->
r_uname
?
mapping
->
r_uname
:
""
,
mapping
->
r_hname
?
mapping
->
r_hname
:
""
);
mapping
->
r_uname
?
mapping
->
r_uname
:
""
);
continue
;
}
...
...
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