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
3f871b33
Commit
3f871b33
authored
Jan 25, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-515 fixup: Cover dict_table_t::clear() during ADD INDEX
parent
3cef4f8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
6 deletions
+47
-6
mysql-test/suite/innodb/r/innodb-index-online.result
mysql-test/suite/innodb/r/innodb-index-online.result
+20
-1
mysql-test/suite/innodb/t/innodb-index-online.test
mysql-test/suite/innodb/t/innodb-index-online.test
+24
-2
storage/innobase/row/row0log.cc
storage/innobase/row/row0log.cc
+3
-3
No files found.
mysql-test/suite/innodb/r/innodb-index-online.result
View file @
3f871b33
...
...
@@ -17,7 +17,6 @@ SET DEBUG_SYNC = 'RESET';
SET DEBUG_SYNC = 'write_row_noreplace SIGNAL have_handle WAIT_FOR go_ahead';
INSERT INTO t1 VALUES(1,2,3);
connect con1,localhost,root,,;
connection con1;
SET DEBUG_SYNC = 'now WAIT_FOR have_handle';
SET lock_wait_timeout = 1;
ALTER TABLE t1 ADD UNIQUE INDEX(c2);
...
...
@@ -524,6 +523,26 @@ CREATE TABLE t2 (c VARCHAR(64)) ENGINE=InnoDB;
ALTER TABLE t2 ADD FOREIGN KEY (c) REFERENCES t1 (c);
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
DROP TABLE t2,t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
connect con1,localhost,root,,;
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL created WAIT_FOR inserted';
ALTER TABLE t1 ADD INDEX(b);
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR created';
BEGIN;
INSERT INTO t1 VALUES(1,1);
ROLLBACK;
SET DEBUG_SYNC = 'now SIGNAL inserted';
connection con1;
disconnect con1;
connection default;
SELECT * FROM t1;
a b
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
mysql-test/suite/innodb/t/innodb-index-online.test
View file @
3f871b33
...
...
@@ -28,7 +28,6 @@ SET DEBUG_SYNC = 'write_row_noreplace SIGNAL have_handle WAIT_FOR go_ahead';
INSERT
INTO
t1
VALUES
(
1
,
2
,
3
);
connect
(
con1
,
localhost
,
root
,,);
connection
con1
;
# This should block at the end because of the INSERT in connection default
# is holding a metadata lock.
...
...
@@ -434,7 +433,6 @@ connection con1;
SET
DEBUG_SYNC
=
'now WAIT_FOR c2g_created'
;
connect
(
con2
,
localhost
,
root
,,);
connection
con2
;
# This will conflict with the ALTER in connection default, above.
SET
lock_wait_timeout
=
10
;
...
...
@@ -492,11 +490,35 @@ reap;
SET
DEBUG_SYNC
=
'RESET'
;
disconnect
con1
;
CREATE
TABLE
t2
(
c
VARCHAR
(
64
))
ENGINE
=
InnoDB
;
--
error
ER_CANT_CREATE_TABLE
ALTER
TABLE
t2
ADD
FOREIGN
KEY
(
c
)
REFERENCES
t1
(
c
);
DROP
TABLE
t2
,
t1
;
CREATE
TABLE
t1
(
a
INT
PRIMARY
KEY
,
b
INT
)
ENGINE
=
InnoDB
;
connect
(
con1
,
localhost
,
root
,,);
SET
DEBUG_SYNC
=
'row_log_apply_before SIGNAL created WAIT_FOR inserted'
;
send
ALTER
TABLE
t1
ADD
INDEX
(
b
);
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR created'
;
BEGIN
;
INSERT
INTO
t1
VALUES
(
1
,
1
);
ROLLBACK
;
SET
DEBUG_SYNC
=
'now SIGNAL inserted'
;
connection
con1
;
reap
;
disconnect
con1
;
connection
default
;
SELECT
*
FROM
t1
;
CHECK
TABLE
t1
;
DROP
TABLE
t1
;
SET
DEBUG_SYNC
=
'RESET'
;
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--
source
include
/
wait_until_count_sessions
.
inc
...
...
storage/innobase/row/row0log.cc
View file @
3f871b33
...
...
@@ -4063,7 +4063,7 @@ row_log_apply(
@param index clustered index */
static
void
row_log_table_empty
(
dict_index_t
*
index
)
{
ut_ad
(
index
->
lock
.
have_
any
());
ut_ad
(
index
->
lock
.
have_
s
());
row_log_t
*
log
=
index
->
online_log
;
ulint
avail_size
;
if
(
byte
*
b
=
row_log_table_open
(
log
,
1
,
&
avail_size
))
...
...
@@ -4091,7 +4091,7 @@ void dict_table_t::clear(que_thr_t *thr)
break
;
case
ONLINE_INDEX_CREATION
:
index
->
lock
.
u
_lock
(
SRW_LOCK_CALL
);
index
->
lock
.
s
_lock
(
SRW_LOCK_CALL
);
if
(
dict_index_get_online_status
(
index
)
==
ONLINE_INDEX_CREATION
)
{
if
(
index
->
is_clust
())
...
...
@@ -4103,7 +4103,7 @@ void dict_table_t::clear(que_thr_t *thr)
row_log_online_op
(
index
,
nullptr
,
0
);
}
index
->
lock
.
u
_unlock
();
index
->
lock
.
s
_unlock
();
}
index
->
clear
(
thr
);
...
...
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