Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed May 14, 2019
2 parents be85d3e + 5099973 commit 874f8f3
Show file tree
Hide file tree
Showing 31 changed files with 384 additions and 338 deletions.
10 changes: 10 additions & 0 deletions mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,24 @@ the
www
select * from information_schema.innodb_ft_deleted;
DOC_ID
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_ft_deleted but the InnoDB storage engine is not installed
select * from information_schema.innodb_ft_being_deleted;
DOC_ID
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_ft_being_deleted but the InnoDB storage engine is not installed
select * from information_schema.innodb_ft_index_cache;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_ft_index_cache but the InnoDB storage engine is not installed
select * from information_schema.innodb_ft_index_table;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_ft_index_table but the InnoDB storage engine is not installed
select * from information_schema.innodb_ft_config;
KEY VALUE
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_ft_config but the InnoDB storage engine is not installed
select * from information_schema.innodb_buffer_page;
POOL_ID BLOCK_ID SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE PAGE_STATE IO_FIX IS_OLD FREE_PAGE_CLOCK
Warnings:
Expand Down
121 changes: 121 additions & 0 deletions mysql-test/suite/innodb_fts/r/innodb_ft_aux_table.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
CREATE TABLE t1 (v VARCHAR(100), FULLTEXT INDEX (v)) ENGINE=InnoDB;
insert into t1 VALUES('First record'),('Second record'),('Third record');
SET @save_ft_aux_table = @@GLOBAL.innodb_ft_aux_table;
connect con1,localhost,root,,;
SET GLOBAL innodb_ft_aux_table = 'test/t0';
ERROR 42000: Variable 'innodb_ft_aux_table' can't be set to the value of 'test/t0'
connection default;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD;
value
a
about
an
are
as
at
be
by
com
de
en
for
from
how
i
in
is
it
la
of
on
or
that
the
this
to
was
what
when
where
who
will
with
und
the
www
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
KEY VALUE
connection con1;
SET GLOBAL innodb_ft_aux_table = 'test/t1';
disconnect con1;
connection default;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
first 1 1 1 1 0
record 1 3 3 1 6
record 1 3 3 2 7
record 1 3 3 3 6
second 2 2 1 2 0
third 3 3 1 3 0
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
KEY VALUE
optimize_checkpoint_limit 180
synced_doc_id 0
stopword_table_name
use_stopword 1
SELECT @@GLOBAL.innodb_ft_aux_table;
@@GLOBAL.innodb_ft_aux_table
test/t1
RENAME TABLE t1 TO t2;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
first 1 1 1 1 0
record 1 3 3 1 6
record 1 3 3 2 7
record 1 3 3 3 6
second 2 2 1 2 0
third 3 3 1 3 0
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
KEY VALUE
optimize_checkpoint_limit 180
synced_doc_id 0
stopword_table_name
use_stopword 1
SELECT @@GLOBAL.innodb_ft_aux_table;
@@GLOBAL.innodb_ft_aux_table
test/t1
DROP TABLE t2;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
KEY VALUE
SELECT @@GLOBAL.innodb_ft_aux_table;
@@GLOBAL.innodb_ft_aux_table
test/t1
SET GLOBAL innodb_ft_aux_table = @save_ft_aux_table;
6 changes: 6 additions & 0 deletions mysql-test/suite/innodb_fts/t/innodb_ft_aux_table.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--innodb_ft_default_stopword
--innodb_ft_deleted
--innodb_ft_being_deleted
--innodb_ft_index_cache
--innodb_ft_index_table
--innodb_ft_config
43 changes: 43 additions & 0 deletions mysql-test/suite/innodb_fts/t/innodb_ft_aux_table.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--source include/have_innodb.inc

CREATE TABLE t1 (v VARCHAR(100), FULLTEXT INDEX (v)) ENGINE=InnoDB;

insert into t1 VALUES('First record'),('Second record'),('Third record');

SET @save_ft_aux_table = @@GLOBAL.innodb_ft_aux_table;

connect (con1,localhost,root,,);
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_ft_aux_table = 'test/t0';
connection default;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
connection con1;
SET GLOBAL innodb_ft_aux_table = 'test/t1';
disconnect con1;
connection default;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
SELECT @@GLOBAL.innodb_ft_aux_table;
RENAME TABLE t1 TO t2;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
SELECT @@GLOBAL.innodb_ft_aux_table;
DROP TABLE t2;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
SELECT @@GLOBAL.innodb_ft_aux_table;
SET GLOBAL innodb_ft_aux_table = @save_ft_aux_table;
4 changes: 2 additions & 2 deletions storage/innobase/dict/dict0crea.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, 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
Expand Down Expand Up @@ -2353,7 +2353,7 @@ dict_delete_tablespace_and_datafiles(
{
dberr_t err = DB_SUCCESS;

ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X));
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_X));
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(srv_sys_tablespaces_open);

Expand Down
10 changes: 5 additions & 5 deletions storage/innobase/dict/dict0defrag_bg.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2016, 2018, MariaDB Corporation.
Copyright (c) 2016, 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
Expand Down Expand Up @@ -244,7 +244,7 @@ dict_stats_save_defrag_summary(
return DB_SUCCESS;
}

rw_lock_x_lock(dict_operation_lock);
rw_lock_x_lock(&dict_operation_lock);
mutex_enter(&dict_sys->mutex);

ret = dict_stats_save_index_stat(index, now, "n_pages_freed",
Expand All @@ -255,7 +255,7 @@ dict_stats_save_defrag_summary(
NULL);

mutex_exit(&dict_sys->mutex);
rw_lock_x_unlock(dict_operation_lock);
rw_lock_x_unlock(&dict_operation_lock);

return (ret);
}
Expand Down Expand Up @@ -295,7 +295,7 @@ dict_stats_save_defrag_stats(
return DB_SUCCESS;
}

rw_lock_x_lock(dict_operation_lock);
rw_lock_x_lock(&dict_operation_lock);

mutex_enter(&dict_sys->mutex);
ret = dict_stats_save_index_stat(index, now, "n_page_split",
Expand Down Expand Up @@ -328,7 +328,7 @@ dict_stats_save_defrag_stats(

end:
mutex_exit(&dict_sys->mutex);
rw_lock_x_unlock(dict_operation_lock);
rw_lock_x_unlock(&dict_operation_lock);

return (ret);
}
32 changes: 13 additions & 19 deletions storage/innobase/dict/dict0dict.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ in S-mode; we cannot trust that MySQL protects implicit or background
operations a table drop since MySQL does not know of them; therefore
we need this; NOTE: a transaction which reserves this must keep book
on the mode in trx_t::dict_operation_lock_mode */
rw_lock_t* dict_operation_lock;
rw_lock_t dict_operation_lock;

/** Percentage of compression failures that are allowed in a single
round */
Expand Down Expand Up @@ -549,7 +549,7 @@ dict_table_close_and_drop(
dberr_t err = DB_SUCCESS;

ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X));
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_X));
ut_ad(trx->dict_operation != TRX_DICT_OP_NONE);
ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));

Expand Down Expand Up @@ -1078,9 +1078,6 @@ void
dict_init(void)
/*===========*/
{
dict_operation_lock = static_cast<rw_lock_t*>(
ut_zalloc_nokey(sizeof(*dict_operation_lock)));

dict_sys = static_cast<dict_sys_t*>(ut_zalloc_nokey(sizeof(*dict_sys)));

UT_LIST_INIT(dict_sys->table_LRU, &dict_table_t::table_LRU);
Expand All @@ -1097,7 +1094,7 @@ dict_init(void)
/ (DICT_POOL_PER_TABLE_HASH * UNIV_WORD_SIZE));

rw_lock_create(dict_operation_lock_key,
dict_operation_lock, SYNC_DICT_OPERATION);
&dict_operation_lock, SYNC_DICT_OPERATION);

if (!srv_read_only_mode) {
dict_foreign_err_file = os_file_create_tmpfile();
Expand Down Expand Up @@ -1325,7 +1322,7 @@ dict_table_can_be_evicted(
dict_table_t* table) /*!< in: table to test */
{
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X));
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_X));

ut_a(table->can_be_evicted);
ut_a(table->foreign_set.empty());
Expand Down Expand Up @@ -1393,7 +1390,7 @@ dict_make_room_in_cache(
ut_a(pct_check > 0);
ut_a(pct_check <= 100);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X));
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_X));
ut_ad(dict_lru_validate());

i = len = UT_LIST_GET_LEN(dict_sys->table_LRU);
Expand Down Expand Up @@ -2030,7 +2027,7 @@ dict_table_remove_from_cache_low(
trx_t* trx = trx_create();

ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X));
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_X));

/* Mimic row_mysql_lock_data_dictionary(). */
trx->dict_operation_lock_mode = RW_X_LATCH;
Expand Down Expand Up @@ -5956,7 +5953,7 @@ dict_index_set_merge_threshold(
ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));

rw_lock_x_lock(dict_operation_lock);
rw_lock_x_lock(&dict_operation_lock);
mutex_enter(&(dict_sys->mutex));

heap = mem_heap_create(sizeof(dtuple_t) + 2 * (sizeof(dfield_t)
Expand Down Expand Up @@ -6006,7 +6003,7 @@ dict_index_set_merge_threshold(
mem_heap_free(heap);

mutex_exit(&(dict_sys->mutex));
rw_lock_x_unlock(dict_operation_lock);
rw_lock_x_unlock(&dict_operation_lock);
}

#ifdef UNIV_DEBUG
Expand Down Expand Up @@ -6600,10 +6597,7 @@ dict_close(void)
mutex_exit(&dict_sys->mutex);
mutex_free(&dict_sys->mutex);

rw_lock_free(dict_operation_lock);

ut_free(dict_operation_lock);
dict_operation_lock = NULL;
rw_lock_free(&dict_operation_lock);

mutex_free(&dict_foreign_err_mutex);

Expand Down Expand Up @@ -7014,7 +7008,7 @@ dict_space_is_empty(
mtr_t mtr;
bool found = false;

rw_lock_x_lock(dict_operation_lock);
rw_lock_x_lock(&dict_operation_lock);
mutex_enter(&dict_sys->mutex);
mtr_start(&mtr);

Expand All @@ -7037,7 +7031,7 @@ dict_space_is_empty(

mtr_commit(&mtr);
mutex_exit(&dict_sys->mutex);
rw_lock_x_unlock(dict_operation_lock);
rw_lock_x_unlock(&dict_operation_lock);

return(!found);
}
Expand All @@ -7055,7 +7049,7 @@ dict_space_get_id(
ulint name_len = strlen(name);
ulint id = ULINT_UNDEFINED;

rw_lock_x_lock(dict_operation_lock);
rw_lock_x_lock(&dict_operation_lock);
mutex_enter(&dict_sys->mutex);
mtr_start(&mtr);

Expand Down Expand Up @@ -7086,7 +7080,7 @@ dict_space_get_id(

mtr_commit(&mtr);
mutex_exit(&dict_sys->mutex);
rw_lock_x_unlock(dict_operation_lock);
rw_lock_x_unlock(&dict_operation_lock);

return(id);
}
Expand Down
Loading

0 comments on commit 874f8f3

Please sign in to comment.