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
a80f5fdb
Commit
a80f5fdb
authored
Dec 08, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
ce8716a1
2fd0acd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
mysql-test/suite/rpl/t/rpl_gtid_crash.test
mysql-test/suite/rpl/t/rpl_gtid_crash.test
+1
-0
sql/sql_acl.cc
sql/sql_acl.cc
+9
-9
No files found.
mysql-test/suite/rpl/t/rpl_gtid_crash.test
View file @
a80f5fdb
...
@@ -186,6 +186,7 @@ EOF
...
@@ -186,6 +186,7 @@ EOF
wait
wait
EOF
EOF
START
SLAVE
;
START
SLAVE
;
--
error
0
,
2006
,
2013
SET
GLOBAL
debug_dbug
=
"+d,crash_commit_after"
;
SET
GLOBAL
debug_dbug
=
"+d,crash_commit_after"
;
--
connection
server_1
--
connection
server_1
...
...
sql/sql_acl.cc
View file @
a80f5fdb
...
@@ -2411,12 +2411,12 @@ template<typename T> uint find_first_user(T* arr, uint len, const char *user)
...
@@ -2411,12 +2411,12 @@ template<typename T> uint find_first_user(T* arr, uint len, const char *user)
return
(
!
found
||
low
==
len
||
strcmp
(
arr
[
low
].
get_username
(),
user
)
!=
0
)
?
UINT_MAX
:
low
;
return
(
!
found
||
low
==
len
||
strcmp
(
arr
[
low
].
get_username
(),
user
)
!=
0
)
?
UINT_MAX
:
low
;
}
}
static
uin
t
acl_find_user_by_name
(
const
char
*
user
)
static
size_
t
acl_find_user_by_name
(
const
char
*
user
)
{
{
return
find_first_user
<
ACL_USER
>
((
ACL_USER
*
)
acl_users
.
buffer
,
acl_users
.
elements
,
user
);
return
find_first_user
<
ACL_USER
>
((
ACL_USER
*
)
acl_users
.
buffer
,
acl_users
.
elements
,
user
);
}
}
static
uin
t
acl_find_db_by_username
(
const
char
*
user
)
static
size_
t
acl_find_db_by_username
(
const
char
*
user
)
{
{
return
find_first_user
<
ACL_DB
>
(
acl_dbs
.
front
(),
acl_dbs
.
elements
(),
user
);
return
find_first_user
<
ACL_DB
>
(
acl_dbs
.
front
(),
acl_dbs
.
elements
(),
user
);
}
}
...
@@ -2754,7 +2754,7 @@ static bool acl_update_db(const char *user, const char *host, const char *db,
...
@@ -2754,7 +2754,7 @@ static bool acl_update_db(const char *user, const char *host, const char *db,
bool
updated
=
false
;
bool
updated
=
false
;
for
(
uin
t
i
=
acl_find_db_by_username
(
user
);
i
<
acl_dbs
.
elements
();
i
++
)
for
(
size_
t
i
=
acl_find_db_by_username
(
user
);
i
<
acl_dbs
.
elements
();
i
++
)
{
{
ACL_DB
*
acl_db
=
&
acl_dbs
.
at
(
i
);
ACL_DB
*
acl_db
=
&
acl_dbs
.
at
(
i
);
if
(
!
strcmp
(
user
,
acl_db
->
user
))
if
(
!
strcmp
(
user
,
acl_db
->
user
))
...
@@ -3532,9 +3532,9 @@ static ACL_USER *find_user_or_anon(const char *host, const char *user, const cha
...
@@ -3532,9 +3532,9 @@ static ACL_USER *find_user_or_anon(const char *host, const char *user, const cha
static
ACL_USER
*
find_user_exact
(
const
char
*
host
,
const
char
*
user
)
static
ACL_USER
*
find_user_exact
(
const
char
*
host
,
const
char
*
user
)
{
{
mysql_mutex_assert_owner
(
&
acl_cache
->
lock
);
mysql_mutex_assert_owner
(
&
acl_cache
->
lock
);
uin
t
start
=
acl_find_user_by_name
(
user
);
size_
t
start
=
acl_find_user_by_name
(
user
);
for
(
uin
t
i
=
start
;
i
<
acl_users
.
elements
;
i
++
)
for
(
size_
t
i
=
start
;
i
<
acl_users
.
elements
;
i
++
)
{
{
ACL_USER
*
acl_user
=
dynamic_element
(
&
acl_users
,
i
,
ACL_USER
*
);
ACL_USER
*
acl_user
=
dynamic_element
(
&
acl_users
,
i
,
ACL_USER
*
);
if
(
i
>
start
&&
strcmp
(
acl_user
->
user
.
str
,
user
))
if
(
i
>
start
&&
strcmp
(
acl_user
->
user
.
str
,
user
))
...
@@ -3553,9 +3553,9 @@ static ACL_USER * find_user_wild(const char *host, const char *user, const char
...
@@ -3553,9 +3553,9 @@ static ACL_USER * find_user_wild(const char *host, const char *user, const char
{
{
mysql_mutex_assert_owner
(
&
acl_cache
->
lock
);
mysql_mutex_assert_owner
(
&
acl_cache
->
lock
);
uin
t
start
=
acl_find_user_by_name
(
user
);
size_
t
start
=
acl_find_user_by_name
(
user
);
for
(
uin
t
i
=
start
;
i
<
acl_users
.
elements
;
i
++
)
for
(
size_
t
i
=
start
;
i
<
acl_users
.
elements
;
i
++
)
{
{
ACL_USER
*
acl_user
=
dynamic_element
(
&
acl_users
,
i
,
ACL_USER
*
);
ACL_USER
*
acl_user
=
dynamic_element
(
&
acl_users
,
i
,
ACL_USER
*
);
if
(
i
>
start
&&
strcmp
(
acl_user
->
user
.
str
,
user
))
if
(
i
>
start
&&
strcmp
(
acl_user
->
user
.
str
,
user
))
...
@@ -9531,7 +9531,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
...
@@ -9531,7 +9531,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
elements
=
acl_users
.
elements
;
elements
=
acl_users
.
elements
;
break
;
break
;
case
DB_ACL
:
case
DB_ACL
:
elements
=
acl_dbs
.
elements
(
);
elements
=
int
(
acl_dbs
.
elements
()
);
break
;
break
;
case
COLUMN_PRIVILEGES_HASH
:
case
COLUMN_PRIVILEGES_HASH
:
grant_name_hash
=
&
column_priv_hash
;
grant_name_hash
=
&
column_priv_hash
;
...
@@ -11174,7 +11174,7 @@ static int show_database_grants(THD *thd, SHOW_VAR *var, char *buff,
...
@@ -11174,7 +11174,7 @@ static int show_database_grants(THD *thd, SHOW_VAR *var, char *buff,
{
{
var
->
type
=
SHOW_UINT
;
var
->
type
=
SHOW_UINT
;
var
->
value
=
buff
;
var
->
value
=
buff
;
*
(
uint
*
)
buff
=
acl_dbs
.
elements
(
);
*
(
uint
*
)
buff
=
uint
(
acl_dbs
.
elements
()
);
return
0
;
return
0
;
}
}
...
...
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