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
a441b064
Commit
a441b064
authored
Sep 29, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.1 into 10.2
parents
84261653
83a520db
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
14 deletions
+42
-14
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/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+6
-0
storage/innobase/include/sync0rw.h
storage/innobase/include/sync0rw.h
+1
-7
storage/xtradb/handler/handler0alter.cc
storage/xtradb/handler/handler0alter.cc
+6
-0
storage/xtradb/include/sync0rw.h
storage/xtradb/include/sync0rw.h
+1
-7
No files found.
mysql-test/suite/innodb/r/foreign_key.result
View file @
a441b064
...
...
@@ -406,6 +406,20 @@ Opened_table_definitions 2
Opened_tables 2
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 @
a441b064
...
...
@@ -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/handler/handler0alter.cc
View file @
a441b064
...
...
@@ -5148,6 +5148,12 @@ prepare_inplace_alter_table_dict(
trx_free_for_mysql
(
ctx
->
trx
);
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/include/sync0rw.h
View file @
a441b064
...
...
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2017, 20
19
, MariaDB Corporation.
Copyright (c) 2017, 20
20
, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
...
...
@@ -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/xtradb/handler/handler0alter.cc
View file @
a441b064
...
...
@@ -3388,6 +3388,12 @@ prepare_inplace_alter_table_dict(
trx_free_for_mysql
(
ctx
->
trx
);
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/xtradb/include/sync0rw.h
View file @
a441b064
...
...
@@ -2,6 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
...
...
@@ -763,13 +764,6 @@ struct rw_lock_t {
/* last s-lock file/line is not guaranteed to be correct */
const
char
*
last_s_file_name
;
/*!< File name where last s-locked */
const
char
*
last_x_file_name
;
/*!< File name where last x-locked */
ibool
writer_is_wait_ex
;
/*!< This is TRUE if the writer field is
RW_LOCK_WAIT_EX; 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 */
unsigned
cline
:
14
;
/*!< Line where created */
unsigned
last_s_line
:
14
;
/*!< Line number where last time s-locked */
unsigned
last_x_line
:
14
;
/*!< Line number where last time x-locked */
...
...
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