Skip to content
Permalink
Browse files
Merge 10.1 into 10.2
  • Loading branch information
dr-m committed Apr 3, 2019
2 parents e3f44d8 + c0fca28 commit dbc7166
Show file tree
Hide file tree
Showing 40 changed files with 102 additions and 334 deletions.
@@ -85,6 +85,8 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "
%define restart_flag %{restart_flag_dir}/need-restart
%{?filter_setup:
%filter_provides_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$
%filter_requires_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$
%filter_from_provides /perl(\\\\(mtr\\\\|My::\\\\)/d
%filter_from_requires /\\\\(lib\\\\(ft\\\\|lzma\\\\|tokuportability\\\\)\\\\)\\\\|\\\\(perl(\\\\(.*mtr\\\\|My::\\\\|.*HandlerSocket\\\\|Mysql\\\\)\\\\)/d
%filter_setup
@@ -11,3 +11,30 @@ flush privileges;
drop role dwr_foo;
drop role dwr_bar;
drop role dwr_qux_dev;
use test;
create table db_copy as select * from mysql.db;
delete from mysql.db;
flush privileges;
create user u1@localhost;
create role r1;
create role r2;
grant r1 to u1@localhost;
grant select on test.* to r2;
grant select on m_.* to r2;
grant r2 to r1;
show grants for u1@localhost;
Grants for u1@localhost
GRANT r1 TO 'u1'@'localhost'
GRANT USAGE ON *.* TO 'u1'@'localhost'
show grants for r1;
Grants for r1
GRANT r2 TO 'r1'
GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT SELECT ON `test`.* TO 'r2'
GRANT SELECT ON `m_`.* TO 'r2'
drop user u1@localhost;
drop role r1, r2;
insert mysql.db select * from db_copy;
flush privileges;
drop table db_copy;
@@ -1,3 +1,4 @@
source include/not_embedded.inc;
#
# MDEV-17898 FLUSH PRIVILEGES crashes server with segfault
#
@@ -9,3 +10,27 @@ flush privileges;
drop role dwr_foo;
drop role dwr_bar;
drop role dwr_qux_dev;
use test;

#
# MDEV-18298 Crashes server with segfault during role grants
#
create table db_copy as select * from mysql.db;
delete from mysql.db;
flush privileges;

create user u1@localhost;
create role r1;
create role r2;
grant r1 to u1@localhost;
grant select on test.* to r2;
grant select on m_.* to r2;
grant r2 to r1;
show grants for u1@localhost;
show grants for r1;
drop user u1@localhost;
drop role r1, r2;

insert mysql.db select * from db_copy;
flush privileges;
drop table db_copy;
@@ -40,7 +40,7 @@ if(GSSAPI_LIBS AND GSSAPI_FLAVOR)
else(GSSAPI_LIBS AND GSSAPI_FLAVOR)

find_program(KRB5_CONFIG NAMES krb5-config heimdal-krb5-config PATHS
/opt/local/bin
/opt/local/bin /usr/lib/mit/bin
ONLY_CMAKE_FIND_ROOT_PATH # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex
)
mark_as_advanced(KRB5_CONFIG)
@@ -5947,7 +5947,7 @@ static bool merge_role_db_privileges(ACL_ROLE *grantee, const char *dbname,
ulong access= 0, update_flags= 0;
for (int *p= dbs.front(); p <= dbs.back(); p++)
{
if (first<0 || (!dbname && strcmp(acl_dbs.at(*p).db, acl_dbs.at(*p-1).db)))
if (first<0 || (!dbname && strcmp(acl_dbs.at(p[0]).db, acl_dbs.at(p[-1]).db)))
{ // new db name series
update_flags|= update_role_db(merged, first, access, grantee->user.str);
merged= -1;
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
Copyright (c) 2018, 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
@@ -497,7 +497,6 @@ buf_buddy_alloc_low(
{
buf_block_t* block;

ut_ad(lru);
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex));
ut_ad(i >= buf_buddy_get_slot(UNIV_ZIP_SIZE_MIN));
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
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
@@ -83,8 +83,6 @@ dtuple_set_n_fields(
dtuple_t* tuple, /*!< in: tuple */
ulint n_fields) /*!< in: number of fields */
{
ut_ad(tuple);

tuple->n_fields = n_fields;
tuple->n_fields_cmp = n_fields;
}
@@ -949,7 +949,6 @@ dict_index_get_nth_field_pos(
ulint n_fields;
ulint pos;

ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);

field2 = dict_index_get_nth_field(index2, n);
@@ -1058,8 +1057,6 @@ dict_table_col_in_clustered_key(
ulint pos;
ulint n_fields;

ut_ad(table);

col = dict_table_get_nth_col(table, n);

index = dict_table_get_first_index(table);
@@ -1229,9 +1226,7 @@ dict_table_add_system_columns(
dict_table_t* table, /*!< in/out: table */
mem_heap_t* heap) /*!< in: temporary heap */
{
ut_ad(table);
ut_ad(table->n_def ==
(table->n_cols - dict_table_get_n_sys_cols(table)));
ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!table->cached);

@@ -1999,7 +1994,6 @@ dict_table_change_id_in_cache(
dict_table_t* table, /*!< in/out: table object already in cache */
table_id_t new_id) /*!< in: new id to set */
{
ut_ad(table);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);

@@ -2026,7 +2020,6 @@ dict_table_remove_from_cache_low(
dict_foreign_t* foreign;
dict_index_t* index;

ut_ad(table);
ut_ad(dict_lru_validate());
ut_a(table->get_ref_count() == 0);
ut_a(table->n_rec_locks == 0);
@@ -2405,7 +2398,6 @@ dict_index_add_to_cache_w_vcol(
ulint n_ord;
ulint i;

ut_ad(index);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(index->n_def == index->n_fields);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
@@ -5290,7 +5282,6 @@ dict_foreign_parse_drop_constraints(
const char* id;
CHARSET_INFO* cs;

ut_a(trx);
ut_a(trx->mysql_thd);

cs = innobase_get_charset(trx->mysql_thd);
@@ -5456,9 +5447,8 @@ dict_index_check_search_tuple(
const dict_index_t* index, /*!< in: index tree */
const dtuple_t* tuple) /*!< in: tuple used in a search */
{
ut_a(index);
ut_a(dtuple_get_n_fields_cmp(tuple)
<= dict_index_get_n_unique_in_tree(index));
ut_ad(dtuple_get_n_fields_cmp(tuple)
<= dict_index_get_n_unique_in_tree(index));
return(TRUE);
}
#endif /* UNIV_DEBUG */
@@ -7011,8 +7001,6 @@ dict_index_zip_success(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
ut_ad(index);

ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7033,8 +7021,6 @@ dict_index_zip_failure(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
ut_ad(index);

ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7060,8 +7046,6 @@ dict_index_zip_pad_optimal_page_size(
ulint min_sz;
ulint sz;

ut_ad(index);

if (!zip_failure_threshold_pct) {
/* Disabled by user. */
return(UNIV_PAGE_SIZE);
@@ -283,7 +283,6 @@ dict_mem_table_add_col(
dict_col_t* col;
ulint i;

ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!heap == !name);

@@ -2097,8 +2097,8 @@ innobase_check_index_keys(
index
@param[in] altered_table MySQL table that is being altered
@param[in] key_part MySQL key definition
@param[out] index_field index field defition for key_part */
static MY_ATTRIBUTE((nonnull(2,3)))
@param[out] index_field index field definition for key_part */
static MY_ATTRIBUTE((nonnull))
void
innobase_create_index_field_def(
bool new_clustered,
@@ -2113,10 +2113,6 @@ innobase_create_index_field_def(

DBUG_ENTER("innobase_create_index_field_def");

ut_ad(key_part);
ut_ad(index_field);
ut_ad(altered_table);

field = new_clustered
? altered_table->field[key_part->fieldnr]
: key_part->field;
@@ -2178,8 +2174,6 @@ innobase_create_index_def(
DBUG_ENTER("innobase_create_index_def");
DBUG_ASSERT(!key_clustered || new_clustered);

ut_ad(altered_table);

index->fields = static_cast<index_field_t*>(
mem_heap_alloc(heap, n_fields * sizeof *index->fields));

@@ -6905,7 +6899,6 @@ innobase_rename_columns_try(
uint i = 0;
ulint num_v = 0;

DBUG_ASSERT(ctx);
DBUG_ASSERT(ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NAME);

@@ -7301,7 +7294,6 @@ innobase_update_foreign_try(
ulint i;

DBUG_ENTER("innobase_update_foreign_try");
DBUG_ASSERT(ctx);

foreign_id = dict_table_get_highest_foreign_id(ctx->new_table);

0 comments on commit dbc7166

Please sign in to comment.