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
337ea589
Commit
337ea589
authored
Jan 30, 2020
by
Sachin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new commit
parent
6da5b791
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
mysql-test/suite/rpl/t/r_ttt.test
mysql-test/suite/rpl/t/r_ttt.test
+1
-1
mysql-test/suite/rpl/t/r_ttt2.test
mysql-test/suite/rpl/t/r_ttt2.test
+13
-10
sql/sql_parse.cc
sql/sql_parse.cc
+7
-0
sql/sql_table.cc
sql/sql_table.cc
+4
-2
No files found.
mysql-test/suite/rpl/t/r_ttt.test
View file @
337ea589
...
...
@@ -10,7 +10,7 @@ start slave;
--
connection
master
set
global
binlog_split_alter
=
true
;
#
set global binlog_split_alter=true;
create
table
t1
(
a
int
primary
key
,
b
int
)
engine
=
innodb
;
insert
into
t1
values
(
1
,
1
),(
2
,
2
);
create
table
t2
(
a
int
primary
key
,
b
int
)
engine
=
innodb
;
...
...
mysql-test/suite/rpl/t/r_ttt2.test
View file @
337ea589
...
...
@@ -16,20 +16,23 @@ connect (con1,localhost,root,,);
connect
(
con2
,
localhost
,
root
,,);
--
connection
con1
--
send
alter
table
t1
add
column
c
int
,
force
,
algorithm
=
inplace
;
--
connection
con2
--
send
alter
table
t2
add
column
c
int
,
force
,
algorithm
=
inplace
;
#
--connection con2
#
--send alter table t2 add column c int, force, algorithm=inplace;
--
connection
con1
--
reap
--
connection
con2
--
reap
create
table
t3
(
a
int
primary
key
,
b
int
)
engine
=
innodb
;
#
--connection con1
#
--reap
#
--connection con2
#
--reap
#
create table t3( a int primary key, b int) engine=innodb;
show
binlog
events
;
#
show binlog events;
--
sleep
5
--
connection
slave
--
sleep
30
show
binlog
events
;
stop
slave
;
show
create
table
t1
;
#--sleep 30
#show binlog events;
--
sleep
60000
--
connection
master
...
...
sql/sql_parse.cc
View file @
337ea589
...
...
@@ -5767,6 +5767,13 @@ mysql_execute_command(THD *thd)
}
//thd->rgi_slave->mark_start_commit();
//thd->wakeup_subsequent_commits(0);
/*
Wait for other thread to commit/rollback the alter
*/
mysql_mutex_lock
(
&
mi
->
start_alter_lock
);
while
(
info
->
state
<=
start_alter_state
::
ROLLBACK_ALTER
)
mysql_cond_wait
(
&
mi
->
start_alter_cond
,
&
mi
->
start_alter_lock
);
mysql_mutex_unlock
(
&
mi
->
start_alter_lock
);
thd
->
rpt
->
__finish_event_group
(
thd
->
rgi_slave
);
// ha_commit_trans(thd, true);
// trans_commit_implicit(thd);
...
...
sql/sql_table.cc
View file @
337ea589
...
...
@@ -7677,7 +7677,8 @@ static bool mysql_inplace_alter_table(THD *thd,
goto
cleanup
;
if
(
write_start_alter
(
thd
,
partial_alter
,
send_query
))
DBUG_RETURN
(
true
);
my_sleep
(
10000000
);
if
(
thd
->
slave_thread
&&
!
strcmp
(
"t1"
,
table
->
alias
.
c_ptr
()))
my_sleep
(
1000000000
);
DEBUG_SYNC
(
thd
,
"alter_table_inplace_after_lock_upgrade"
);
THD_STAGE_INFO
(
thd
,
stage_alter_inplace_prepare
);
...
...
@@ -10276,7 +10277,8 @@ do_continue:;
//If issues by binlog/master complete the prepare phase of alter and then commit
if
(
write_start_alter
(
thd
,
&
partial_alter
,
send_query
))
DBUG_RETURN
(
true
);
my_sleep
(
10000000
);
if
(
thd
->
slave_thread
&&
!
strcmp
(
"t1"
,
table
->
alias
.
c_ptr
()))
my_sleep
(
1000000000
);
if
(
ha_create_table
(
thd
,
alter_ctx
.
get_tmp_path
(),
alter_ctx
.
new_db
.
str
,
alter_ctx
.
new_name
.
str
,
create_info
,
&
frm
))
...
...
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