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
9ae608d2
Commit
9ae608d2
authored
Oct 01, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
79e32e47
d99f7872
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
51 additions
and
62 deletions
+51
-62
mysql-test/suite/innodb/r/foreign_key.result
mysql-test/suite/innodb/r/foreign_key.result
+14
-0
mysql-test/suite/innodb/t/foreign_key.test
mysql-test/suite/innodb/t/foreign_key.test
+14
-0
storage/innobase/btr/btr0defragment.cc
storage/innobase/btr/btr0defragment.cc
+1
-6
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+0
-3
storage/innobase/fts/fts0opt.cc
storage/innobase/fts/fts0opt.cc
+7
-3
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+4
-31
storage/innobase/handler/ha_innodb.h
storage/innobase/handler/ha_innodb.h
+1
-2
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+6
-0
storage/innobase/ibuf/ibuf0ibuf.cc
storage/innobase/ibuf/ibuf0ibuf.cc
+4
-1
storage/innobase/include/btr0defragment.h
storage/innobase/include/btr0defragment.h
+0
-2
storage/innobase/include/fts0types.h
storage/innobase/include/fts0types.h
+0
-2
storage/innobase/include/sync0rw.h
storage/innobase/include/sync0rw.h
+0
-6
storage/innobase/include/sync0sync.h
storage/innobase/include/sync0sync.h
+0
-1
storage/innobase/include/sync0types.h
storage/innobase/include/sync0types.h
+0
-1
storage/innobase/sync/sync0debug.cc
storage/innobase/sync/sync0debug.cc
+0
-3
storage/innobase/sync/sync0sync.cc
storage/innobase/sync/sync0sync.cc
+0
-1
No files found.
mysql-test/suite/innodb/r/foreign_key.result
View file @
9ae608d2
...
...
@@ -406,6 +406,20 @@ Opened_table_definitions 5
Opened_tables 5
drop function foo;
drop table t2, t1;
CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk)) ENGINE=InnoDB;
XA START 'xid';
INSERT INTO t1 VALUES (1,2);
CREATE TABLE x AS SELECT * FROM t1;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
connect con1,localhost,root,,test;
SET foreign_key_checks= OFF, innodb_lock_wait_timeout= 1;
ALTER TABLE t1 ADD FOREIGN KEY f (a) REFERENCES t1 (pk), LOCK=EXCLUSIVE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
disconnect con1;
connection default;
XA END 'xid';
XA ROLLBACK 'xid';
DROP TABLE t1;
# Start of 10.2 tests
#
# MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
...
...
mysql-test/suite/innodb/t/foreign_key.test
View file @
9ae608d2
...
...
@@ -407,6 +407,20 @@ show status like '%opened_tab%';
drop
function
foo
;
drop
table
t2
,
t1
;
CREATE
TABLE
t1
(
pk
INT
,
a
INT
,
PRIMARY
KEY
(
pk
))
ENGINE
=
InnoDB
;
XA
START
'xid'
;
INSERT
INTO
t1
VALUES
(
1
,
2
);
--
error
ER_XAER_RMFAIL
CREATE
TABLE
x
AS
SELECT
*
FROM
t1
;
--
connect
(
con1
,
localhost
,
root
,,
test
)
SET
foreign_key_checks
=
OFF
,
innodb_lock_wait_timeout
=
1
;
--
error
ER_LOCK_WAIT_TIMEOUT
ALTER
TABLE
t1
ADD
FOREIGN
KEY
f
(
a
)
REFERENCES
t1
(
pk
),
LOCK
=
EXCLUSIVE
;
# Cleanup
--
disconnect
con1
--
connection
default
XA
END
'xid'
;
XA
ROLLBACK
'xid'
;
DROP
TABLE
t1
;
#
# End of 10.1 tests
#
...
...
storage/innobase/btr/btr0defragment.cc
View file @
9ae608d2
...
...
@@ -154,8 +154,6 @@ synchronized defragmentation. */
os_event_t
btr_defragment_add_index
(
dict_index_t
*
index
,
/*!< index to be added */
bool
async
,
/*!< whether this is an async
defragmentation */
dberr_t
*
err
)
/*!< out: error code */
{
mtr_t
mtr
;
...
...
@@ -188,10 +186,7 @@ btr_defragment_add_index(
return
NULL
;
}
btr_pcur_t
*
pcur
=
btr_pcur_create_for_mysql
();
os_event_t
event
=
NULL
;
if
(
!
async
)
{
event
=
os_event_create
(
0
);
}
os_event_t
event
=
os_event_create
(
0
);
btr_pcur_open_at_index_side
(
true
,
index
,
BTR_SEARCH_LEAF
,
pcur
,
true
,
0
,
&
mtr
);
btr_pcur_move_to_next
(
pcur
,
&
mtr
);
...
...
storage/innobase/fts/fts0fts.cc
View file @
9ae608d2
...
...
@@ -286,7 +286,6 @@ fts_cache_destroy(fts_cache_t* cache)
{
rw_lock_free
(
&
cache
->
lock
);
rw_lock_free
(
&
cache
->
init_lock
);
mutex_free
(
&
cache
->
optimize_lock
);
mutex_free
(
&
cache
->
deleted_lock
);
mutex_free
(
&
cache
->
doc_id_lock
);
os_event_destroy
(
cache
->
sync
->
event
);
...
...
@@ -622,8 +621,6 @@ fts_cache_create(
mutex_create
(
LATCH_ID_FTS_DELETE
,
&
cache
->
deleted_lock
);
mutex_create
(
LATCH_ID_FTS_OPTIMIZE
,
&
cache
->
optimize_lock
);
mutex_create
(
LATCH_ID_FTS_DOC_ID
,
&
cache
->
doc_id_lock
);
/* This is the heap used to create the cache itself. */
...
...
storage/innobase/fts/fts0opt.cc
View file @
9ae608d2
...
...
@@ -2604,9 +2604,13 @@ fts_optimize_remove_table(
os_event_destroy
(
event
);
ut_d
(
mutex_enter
(
&
fts_optimize_wq
->
mutex
));
#ifdef UNIV_DEBUG
if
(
!
fts_opt_start_shutdown
)
{
mutex_enter
(
&
fts_optimize_wq
->
mutex
);
ut_ad
(
!
table
->
fts
->
in_queue
);
ut_d
(
mutex_exit
(
&
fts_optimize_wq
->
mutex
));
mutex_exit
(
&
fts_optimize_wq
->
mutex
);
}
#endif
/* UNIV_DEBUG */
}
/** Send sync fts cache for the table.
...
...
storage/innobase/handler/ha_innodb.cc
View file @
9ae608d2
...
...
@@ -596,7 +596,6 @@ static PSI_mutex_info all_innodb_mutexes[] = {
PSI_KEY
(
flush_list_mutex
),
PSI_KEY
(
fts_bg_threads_mutex
),
PSI_KEY
(
fts_delete_mutex
),
PSI_KEY
(
fts_optimize_mutex
),
PSI_KEY
(
fts_doc_id_mutex
),
PSI_KEY
(
log_flush_order_mutex
),
PSI_KEY
(
hash_table_mutex
),
...
...
@@ -14430,25 +14429,14 @@ ha_innobase::analyze(THD*, HA_CHECK_OPT*)
/*****************************************************************//**
Defragment table.
@return error number */
UNIV_INTERN
int
ha_innobase
::
defragment_table
(
/*==========================*/
const
char
*
name
,
/*!< in: table name */
const
char
*
index_name
,
/*!< in: index name */
bool
async
)
/*!< in: whether to wait until finish */
inline
int
ha_innobase
::
defragment_table
(
const
char
*
name
)
{
char
norm_name
[
FN_REFLEN
];
dict_table_t
*
table
=
NULL
;
dict_index_t
*
index
=
NULL
;
ibool
one_index
=
(
index_name
!=
0
);
int
ret
=
0
;
dberr_t
err
=
DB_SUCCESS
;
if
(
!
srv_defragment
)
{
return
ER_FEATURE_DISABLED
;
}
normalize_table_name
(
norm_name
,
name
);
table
=
dict_table_open_on_name
(
norm_name
,
FALSE
,
...
...
@@ -14476,10 +14464,6 @@ ha_innobase::defragment_table(
continue
;
}
if
(
one_index
&&
strcasecmp
(
index_name
,
index
->
name
)
!=
0
)
{
continue
;
}
if
(
btr_defragment_find_index
(
index
))
{
// We borrow this error code. When the same index is
// already in the defragmentation queue, issue another
...
...
@@ -14495,7 +14479,7 @@ ha_innobase::defragment_table(
break
;
}
os_event_t
event
=
btr_defragment_add_index
(
index
,
async
,
&
err
);
os_event_t
event
=
btr_defragment_add_index
(
index
,
&
err
);
if
(
err
!=
DB_SUCCESS
)
{
push_warning_printf
(
...
...
@@ -14511,7 +14495,7 @@ ha_innobase::defragment_table(
break
;
}
if
(
!
async
&&
event
)
{
if
(
event
)
{
while
(
os_event_wait_time
(
event
,
1000000
))
{
if
(
thd_killed
(
current_thd
))
{
btr_defragment_remove_index
(
index
);
...
...
@@ -14525,19 +14509,9 @@ ha_innobase::defragment_table(
if
(
ret
)
{
break
;
}
if
(
one_index
)
{
one_index
=
FALSE
;
break
;
}
}
dict_table_close
(
table
,
FALSE
,
FALSE
);
if
(
ret
==
0
&&
one_index
)
{
ret
=
ER_NO_SUCH_INDEX
;
}
return
ret
;
}
...
...
@@ -14563,8 +14537,7 @@ ha_innobase::optimize(
bool
try_alter
=
true
;
if
(
!
m_prebuilt
->
table
->
is_temporary
()
&&
srv_defragment
)
{
int
err
=
defragment_table
(
m_prebuilt
->
table
->
name
.
m_name
,
NULL
,
false
);
int
err
=
defragment_table
(
m_prebuilt
->
table
->
name
.
m_name
);
if
(
err
==
0
)
{
try_alter
=
false
;
...
...
storage/innobase/handler/ha_innodb.h
View file @
9ae608d2
...
...
@@ -211,8 +211,7 @@ class ha_innobase final: public handler
int
delete_table
(
const
char
*
name
)
override
;
int
rename_table
(
const
char
*
from
,
const
char
*
to
)
override
;
int
defragment_table
(
const
char
*
name
,
const
char
*
index_name
,
bool
async
);
inline
int
defragment_table
(
const
char
*
name
);
int
check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
override
;
char
*
update_table_comment
(
const
char
*
comment
)
override
;
...
...
storage/innobase/handler/handler0alter.cc
View file @
9ae608d2
...
...
@@ -7253,6 +7253,12 @@ prepare_inplace_alter_table_dict(
}
trx_commit_for_mysql
(
ctx
->
prebuilt
->
trx
);
for
(
uint
i
=
0
;
i
<
ctx
->
num_to_add_fk
;
i
++
)
{
if
(
ctx
->
add_fk
[
i
])
{
dict_foreign_free
(
ctx
->
add_fk
[
i
]);
}
}
delete
ctx
;
ha_alter_info
->
handler_ctx
=
NULL
;
...
...
storage/innobase/ibuf/ibuf0ibuf.cc
View file @
9ae608d2
...
...
@@ -4407,7 +4407,10 @@ ibuf_merge_or_delete_for_page(
/* No changes are buffered for this page. */
space
->
release
();
if
(
UNIV_UNLIKELY
(
srv_shutdown_state
)
&&
!
srv_fast_shutdown
)
{
&&
!
srv_fast_shutdown
&&
(
!
block
||
btr_page_get_index_id
(
block
->
frame
)
!=
DICT_IBUF_ID_MIN
+
IBUF_SPACE_ID
))
{
/* Prevent an infinite loop on slow
shutdown, in case the bitmap bits are
wrongly clear even though buffered
...
...
storage/innobase/include/btr0defragment.h
View file @
9ae608d2
...
...
@@ -64,8 +64,6 @@ is a synchronized defragmentation. */
os_event_t
btr_defragment_add_index
(
dict_index_t
*
index
,
/*!< index to be added */
bool
async
,
/*!< whether this is an async
defragmentation */
dberr_t
*
err
);
/*!< out: error code */
/******************************************************************//**
When table is dropped, this function is called to mark a table as removed in
...
...
storage/innobase/include/fts0types.h
View file @
9ae608d2
...
...
@@ -131,8 +131,6 @@ struct fts_cache_t {
intialization, it has different
SYNC level as above cache lock */
ib_mutex_t
optimize_lock
;
/*!< Lock for OPTIMIZE */
ib_mutex_t
deleted_lock
;
/*!< Lock covering deleted_doc_ids */
ib_mutex_t
doc_id_lock
;
/*!< Lock covering Doc ID */
...
...
storage/innobase/include/sync0rw.h
View file @
9ae608d2
...
...
@@ -577,12 +577,6 @@ struct rw_lock_t
/** number of granted SX locks. */
volatile
ulint
sx_recursive
;
/** This is TRUE if the writer field is RW_LOCK_X_WAIT; this field
is located far from the memory update hotspot fields which are at
the start of this struct, thus we can peek this field without
causing much memory bus traffic */
bool
writer_is_wait_ex
;
/** The value is typically set to thread id of a writer thread making
normal rw_locks recursive. In case of asynchronous IO, when a non-zero
value of 'pass' is passed then we keep the lock non-recursive.
...
...
storage/innobase/include/sync0sync.h
View file @
9ae608d2
...
...
@@ -60,7 +60,6 @@ extern mysql_pfs_key_t fil_system_mutex_key;
extern
mysql_pfs_key_t
flush_list_mutex_key
;
extern
mysql_pfs_key_t
fts_bg_threads_mutex_key
;
extern
mysql_pfs_key_t
fts_delete_mutex_key
;
extern
mysql_pfs_key_t
fts_optimize_mutex_key
;
extern
mysql_pfs_key_t
fts_doc_id_mutex_key
;
extern
mysql_pfs_key_t
fts_pll_tokenize_mutex_key
;
extern
mysql_pfs_key_t
hash_table_mutex_key
;
...
...
storage/innobase/include/sync0types.h
View file @
9ae608d2
...
...
@@ -292,7 +292,6 @@ enum latch_id_t {
LATCH_ID_FLUSH_LIST
,
LATCH_ID_FTS_BG_THREADS
,
LATCH_ID_FTS_DELETE
,
LATCH_ID_FTS_OPTIMIZE
,
LATCH_ID_FTS_DOC_ID
,
LATCH_ID_FTS_PLL_TOKENIZE
,
LATCH_ID_HASH_TABLE_MUTEX
,
...
...
storage/innobase/sync/sync0debug.cc
View file @
9ae608d2
...
...
@@ -1302,9 +1302,6 @@ sync_latch_meta_init()
LATCH_ADD_MUTEX
(
FTS_DELETE
,
SYNC_FTS_OPTIMIZE
,
fts_delete_mutex_key
);
LATCH_ADD_MUTEX
(
FTS_OPTIMIZE
,
SYNC_FTS_OPTIMIZE
,
fts_optimize_mutex_key
);
LATCH_ADD_MUTEX
(
FTS_DOC_ID
,
SYNC_FTS_OPTIMIZE
,
fts_doc_id_mutex_key
);
LATCH_ADD_MUTEX
(
FTS_PLL_TOKENIZE
,
SYNC_FTS_TOKENIZE
,
...
...
storage/innobase/sync/sync0sync.cc
View file @
9ae608d2
...
...
@@ -45,7 +45,6 @@ mysql_pfs_key_t fil_system_mutex_key;
mysql_pfs_key_t
flush_list_mutex_key
;
mysql_pfs_key_t
fts_bg_threads_mutex_key
;
mysql_pfs_key_t
fts_delete_mutex_key
;
mysql_pfs_key_t
fts_optimize_mutex_key
;
mysql_pfs_key_t
fts_doc_id_mutex_key
;
mysql_pfs_key_t
fts_pll_tokenize_mutex_key
;
mysql_pfs_key_t
hash_table_mutex_key
;
...
...
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