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
f65f40bb
Commit
f65f40bb
authored
Feb 28, 2019
by
Jan Lindström
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/10.1' into 10.2
parents
cac14b92
5a87e3ee
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
33 deletions
+73
-33
mysql-test/r/create_drop_role.result
mysql-test/r/create_drop_role.result
+9
-0
mysql-test/t/create_drop_role.test
mysql-test/t/create_drop_role.test
+11
-0
sql/handler.cc
sql/handler.cc
+25
-13
sql/sql_acl.cc
sql/sql_acl.cc
+12
-0
storage/innobase/include/ut0wqueue.h
storage/innobase/include/ut0wqueue.h
+5
-8
storage/innobase/ut/ut0wqueue.cc
storage/innobase/ut/ut0wqueue.cc
+9
-10
support-files/wsrep.cnf.sh
support-files/wsrep.cnf.sh
+2
-2
No files found.
mysql-test/r/create_drop_role.result
View file @
f65f40bb
...
...
@@ -77,3 +77,12 @@ Note 1976 Can't drop role 'role_1'; it doesn't exist
DROP ROLE role_1;
ERROR HY000: Operation DROP ROLE failed for 'role_1'
DROP USER u1@localhost;
CREATE ROLE r;
GRANT SHOW DATABASES ON *.* TO r;
CREATE USER foo;
CREATE USER bar;
GRANT r TO foo;
CREATE OR REPLACE USER foo IDENTIFIED WITH non_existing_plugin;
ERROR HY000: Plugin 'non_existing_plugin' is not loaded
DROP ROLE r;
DROP USER bar;
mysql-test/t/create_drop_role.test
View file @
f65f40bb
...
...
@@ -54,3 +54,14 @@ DROP ROLE IF EXISTS role_1;
DROP
ROLE
role_1
;
DROP
USER
u1
@
localhost
;
# MDEV-17942
CREATE
ROLE
r
;
GRANT
SHOW
DATABASES
ON
*.*
TO
r
;
CREATE
USER
foo
;
CREATE
USER
bar
;
GRANT
r
TO
foo
;
--
error
ER_PLUGIN_IS_NOT_LOADED
CREATE
OR
REPLACE
USER
foo
IDENTIFIED
WITH
non_existing_plugin
;
DROP
ROLE
r
;
DROP
USER
bar
;
sql/handler.cc
View file @
f65f40bb
...
...
@@ -3064,7 +3064,7 @@ int handler::update_auto_increment()
bool
append
=
FALSE
;
THD
*
thd
=
table
->
in_use
;
struct
system_variables
*
variables
=
&
thd
->
variables
;
int
tmp
;
int
result
=
0
,
tmp
;
enum
enum_check_fields
save_count_cuted_fields
;
DBUG_ENTER
(
"handler::update_auto_increment"
);
...
...
@@ -3201,18 +3201,27 @@ int handler::update_auto_increment()
*/
if
(
thd
->
killed
==
KILL_BAD_DATA
||
nr
>
table
->
next_number_field
->
get_max_int_value
())
DBUG_RETURN
(
HA_ERR_AUTOINC_ERANGE
);
/*
Field refused this value (overflow) and truncated it, use the result
of the truncation (which is going to be inserted); however we try to
decrease it to honour auto_increment_* variables.
That will shift the left bound of the reserved interval, we don't
bother shifting the right bound (anyway any other value from this
interval will cause a duplicate key).
*/
nr
=
prev_insert_id
(
table
->
next_number_field
->
val_int
(),
variables
);
if
(
unlikely
(
table
->
next_number_field
->
store
((
longlong
)
nr
,
TRUE
)))
nr
=
table
->
next_number_field
->
val_int
();
{
/*
It's better to return an error here than getting a confusing
'duplicate key error' later.
*/
result
=
HA_ERR_AUTOINC_ERANGE
;
}
else
{
/*
Field refused this value (overflow) and truncated it, use the result
of the truncation (which is going to be inserted); however we try to
decrease it to honour auto_increment_* variables.
That will shift the left bound of the reserved interval, we don't
bother shifting the right bound (anyway any other value from this
interval will cause a duplicate key).
*/
nr
=
prev_insert_id
(
table
->
next_number_field
->
val_int
(),
variables
);
if
(
unlikely
(
table
->
next_number_field
->
store
((
longlong
)
nr
,
TRUE
)))
nr
=
table
->
next_number_field
->
val_int
();
}
}
if
(
append
)
{
...
...
@@ -3237,6 +3246,9 @@ int handler::update_auto_increment()
*/
insert_id_for_cur_row
=
nr
;
if
(
result
)
// overflow
DBUG_RETURN
(
result
);
/*
Set next insert id to point to next auto-increment value to be able to
handle multi-row statements.
...
...
sql/sql_acl.cc
View file @
f65f40bb
...
...
@@ -10116,6 +10116,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list, bool handle_as_role)
LEX_USER
*
user_name
;
List_iterator
<
LEX_USER
>
user_list
(
list
);
bool
binlog
=
false
;
bool
some_users_dropped
=
false
;
DBUG_ENTER
(
"mysql_create_user"
);
DBUG_PRINT
(
"entry"
,
(
"Handle as %s"
,
handle_as_role
?
"role"
:
"user"
));
...
...
@@ -10182,6 +10183,8 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list, bool handle_as_role)
result
=
true
;
continue
;
}
else
some_users_dropped
=
true
;
// Proceed with the creation
}
else
if
(
thd
->
lex
->
create_info
.
if_not_exists
())
...
...
@@ -10250,12 +10253,21 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list, bool handle_as_role)
}
}
if
(
result
&&
some_users_dropped
&&
!
handle_as_role
)
{
/* Rebuild in-memory structs, since 'acl_users' has been modified */
rebuild_check_host
();
rebuild_role_grants
();
}
mysql_mutex_unlock
(
&
acl_cache
->
lock
);
if
(
result
)
{
my_error
(
ER_CANNOT_USER
,
MYF
(
0
),
(
handle_as_role
)
?
"CREATE ROLE"
:
"CREATE USER"
,
wrong_users
.
c_ptr_safe
());
}
if
(
binlog
)
result
|=
write_bin_log
(
thd
,
FALSE
,
thd
->
query
(),
thd
->
query_length
());
...
...
storage/innobase/include/ut0wqueue.h
View file @
f65f40bb
/*****************************************************************************
Copyright (c) 2006, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -63,14 +64,10 @@ ib_wqueue_add(
mem_heap_t
*
heap
);
/*!< in: memory heap to use for
allocating the list node */
/********************************************************************
Check if queue is empty. */
ibool
ib_wqueue_is_empty
(
/*===============*/
/* out: TRUE if queue empty
else FALSE */
const
ib_wqueue_t
*
wq
);
/* in: work queue */
/** Check if queue is empty.
@param wq wait queue
@return whether the queue is empty */
bool
ib_wqueue_is_empty
(
ib_wqueue_t
*
wq
);
/****************************************************************//**
Wait for a work item to appear in the queue.
...
...
storage/innobase/ut/ut0wqueue.cc
View file @
f65f40bb
/*****************************************************************************
Copyright (c) 2006, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 201
7, MariaDB Corporation. All Rights Reserved
.
Copyright (c) 201
9, MariaDB Corporation
.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -201,16 +201,15 @@ ib_wqueue_nowait(
return
(
node
?
node
->
data
:
NULL
);
}
/********************************************************************
Check if queue is empty. */
ibool
ib_wqueue_is_empty
(
/*===============*/
/* out: TRUE if queue empty
else FALSE */
const
ib_wqueue_t
*
wq
)
/* in: work queue */
/** Check if queue is empty.
@param wq wait queue
@return whether the queue is empty */
bool
ib_wqueue_is_empty
(
ib_wqueue_t
*
wq
)
{
return
(
ib_list_is_empty
(
wq
->
items
));
mutex_enter
(
&
wq
->
mutex
);
bool
is_empty
=
ib_list_is_empty
(
wq
->
items
);
mutex_exit
(
&
wq
->
mutex
);
return
is_empty
;
}
/********************************************************************
...
...
support-files/wsrep.cnf.sh
View file @
f65f40bb
...
...
@@ -67,10 +67,10 @@ wsrep_slave_threads=1
wsrep_certify_nonPK
=
1
# Maximum number of rows in write set
wsrep_max_ws_rows
=
131072
wsrep_max_ws_rows
=
0
# Maximum size of write set
wsrep_max_ws_size
=
1073741824
wsrep_max_ws_size
=
2147483647
# to enable debug level logging, set this to 1
wsrep_debug
=
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