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
2b60afe8
Commit
2b60afe8
authored
Nov 14, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: TRT fix for crash_commit_after [#305, #302]
Tests affected: innodb.group_commit_crash (verbosity improved)
parent
ab049501
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
22 deletions
+43
-22
mysql-test/suite/innodb/r/group_commit_crash.result
mysql-test/suite/innodb/r/group_commit_crash.result
+28
-12
mysql-test/suite/innodb/t/group_commit_crash.test
mysql-test/suite/innodb/t/group_commit_crash.test
+14
-9
sql/handler.cc
sql/handler.cc
+1
-1
No files found.
mysql-test/suite/innodb/r/group_commit_crash.result
View file @
2b60afe8
...
@@ -5,14 +5,15 @@ d CHAR(255),
...
@@ -5,14 +5,15 @@ d CHAR(255),
id INT,
id INT,
PRIMARY KEY(id)) ENGINE=InnoDB;
PRIMARY KEY(id)) ENGINE=InnoDB;
create table t2 like t1;
create table t2 like t1;
create procedure setcrash(IN i INT)
create function getcrash(i INT)
returns VARCHAR(255)
begin
begin
CASE i
CASE i
WHEN 1 THEN
SET SESSION debug_dbug="d,
crash_commit_after_prepare";
WHEN 1 THEN
RETURN "
crash_commit_after_prepare";
WHEN 2 THEN
SET SESSION debug_dbug="d,
crash_commit_after_log";
WHEN 2 THEN
RETURN "
crash_commit_after_log";
WHEN 3 THEN
SET SESSION debug_dbug="d,
crash_commit_before_unlog";
WHEN 3 THEN
RETURN "
crash_commit_before_unlog";
WHEN 4 THEN
SET SESSION debug_dbug="d,
crash_commit_after";
WHEN 4 THEN
RETURN "
crash_commit_after";
WHEN 5 THEN
SET SESSION debug_dbug="d,
crash_commit_before";
WHEN 5 THEN
RETURN "
crash_commit_before";
ELSE BEGIN END;
ELSE BEGIN END;
END CASE;
END CASE;
end //
end //
...
@@ -31,9 +32,12 @@ SET binlog_format= mixed;
...
@@ -31,9 +32,12 @@ SET binlog_format= mixed;
RESET MASTER;
RESET MASTER;
START TRANSACTION;
START TRANSACTION;
insert into t1 select * from t2;
insert into t1 select * from t2;
call setcrash(5);
SET @crash= getcrash(5);
SET SESSION debug_dbug=concat("d,", @crash);
COMMIT;
COMMIT;
Got one of the listed errors
Got one of the listed errors
CRASH_POINT
crash_commit_before
SELECT * FROM t1 ORDER BY id;
SELECT * FROM t1 ORDER BY id;
a b c d id
a b c d id
SHOW BINLOG EVENTS LIMIT 4,1;
SHOW BINLOG EVENTS LIMIT 4,1;
...
@@ -43,9 +47,12 @@ SET binlog_format= mixed;
...
@@ -43,9 +47,12 @@ SET binlog_format= mixed;
RESET MASTER;
RESET MASTER;
START TRANSACTION;
START TRANSACTION;
insert into t1 select * from t2;
insert into t1 select * from t2;
call setcrash(4);
SET @crash= getcrash(4);
SET SESSION debug_dbug=concat("d,", @crash);
COMMIT;
COMMIT;
Got one of the listed errors
Got one of the listed errors
CRASH_POINT
crash_commit_after
SELECT * FROM t1 ORDER BY id;
SELECT * FROM t1 ORDER BY id;
a b c d id
a b c d id
a b c d 1
a b c d 1
...
@@ -66,9 +73,12 @@ SET binlog_format= mixed;
...
@@ -66,9 +73,12 @@ SET binlog_format= mixed;
RESET MASTER;
RESET MASTER;
START TRANSACTION;
START TRANSACTION;
insert into t1 select * from t2;
insert into t1 select * from t2;
call setcrash(3);
SET @crash= getcrash(3);
SET SESSION debug_dbug=concat("d,", @crash);
COMMIT;
COMMIT;
Got one of the listed errors
Got one of the listed errors
CRASH_POINT
crash_commit_before_unlog
SELECT * FROM t1 ORDER BY id;
SELECT * FROM t1 ORDER BY id;
a b c d id
a b c d id
a b c d 1
a b c d 1
...
@@ -89,9 +99,12 @@ SET binlog_format= mixed;
...
@@ -89,9 +99,12 @@ SET binlog_format= mixed;
RESET MASTER;
RESET MASTER;
START TRANSACTION;
START TRANSACTION;
insert into t1 select * from t2;
insert into t1 select * from t2;
call setcrash(2);
SET @crash= getcrash(2);
SET SESSION debug_dbug=concat("d,", @crash);
COMMIT;
COMMIT;
Got one of the listed errors
Got one of the listed errors
CRASH_POINT
crash_commit_after_log
SELECT * FROM t1 ORDER BY id;
SELECT * FROM t1 ORDER BY id;
a b c d id
a b c d id
a b c d 1
a b c d 1
...
@@ -112,9 +125,12 @@ SET binlog_format= mixed;
...
@@ -112,9 +125,12 @@ SET binlog_format= mixed;
RESET MASTER;
RESET MASTER;
START TRANSACTION;
START TRANSACTION;
insert into t1 select * from t2;
insert into t1 select * from t2;
call setcrash(1);
SET @crash= getcrash(1);
SET SESSION debug_dbug=concat("d,", @crash);
COMMIT;
COMMIT;
Got one of the listed errors
Got one of the listed errors
CRASH_POINT
crash_commit_after_prepare
SELECT * FROM t1 ORDER BY id;
SELECT * FROM t1 ORDER BY id;
a b c d id
a b c d id
SHOW BINLOG EVENTS LIMIT 4,1;
SHOW BINLOG EVENTS LIMIT 4,1;
...
@@ -122,4 +138,4 @@ Log_name Pos Event_type Server_id End_log_pos Info
...
@@ -122,4 +138,4 @@ Log_name Pos Event_type Server_id End_log_pos Info
delete from t1;
delete from t1;
DROP TABLE t1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t2;
DROP
PROCEDURE s
etcrash;
DROP
FUNCTION g
etcrash;
mysql-test/suite/innodb/t/group_commit_crash.test
View file @
2b60afe8
...
@@ -17,14 +17,15 @@ CREATE TABLE t1(a CHAR(255),
...
@@ -17,14 +17,15 @@ CREATE TABLE t1(a CHAR(255),
PRIMARY
KEY
(
id
))
ENGINE
=
InnoDB
;
PRIMARY
KEY
(
id
))
ENGINE
=
InnoDB
;
create
table
t2
like
t1
;
create
table
t2
like
t1
;
delimiter
//;
delimiter
//;
create
procedure
setcrash
(
IN
i
INT
)
create
function
getcrash
(
i
INT
)
returns
VARCHAR
(
255
)
begin
begin
CASE
i
CASE
i
WHEN
1
THEN
SET
SESSION
debug_dbug
=
"d,
crash_commit_after_prepare"
;
WHEN
1
THEN
RETURN
"
crash_commit_after_prepare"
;
WHEN
2
THEN
SET
SESSION
debug_dbug
=
"d,
crash_commit_after_log"
;
WHEN
2
THEN
RETURN
"
crash_commit_after_log"
;
WHEN
3
THEN
SET
SESSION
debug_dbug
=
"d,
crash_commit_before_unlog"
;
WHEN
3
THEN
RETURN
"
crash_commit_before_unlog"
;
WHEN
4
THEN
SET
SESSION
debug_dbug
=
"d,
crash_commit_after"
;
WHEN
4
THEN
RETURN
"
crash_commit_after"
;
WHEN
5
THEN
SET
SESSION
debug_dbug
=
"d,
crash_commit_before"
;
WHEN
5
THEN
RETURN
"
crash_commit_before"
;
ELSE
BEGIN
END
;
ELSE
BEGIN
END
;
END
CASE
;
END
CASE
;
end
//
end
//
...
@@ -53,8 +54,8 @@ while ($numtests)
...
@@ -53,8 +54,8 @@ while ($numtests)
# Write file to make mysql-test-run.pl expect crash
# Write file to make mysql-test-run.pl expect crash
--
exec
echo
"restart"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
--
exec
echo
"restart"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
eval
call
s
etcrash
(
$numtests
);
eval
SET
@
crash
=
g
etcrash
(
$numtests
);
SET
SESSION
debug_dbug
=
concat
(
"d,"
,
@
crash
);
# Run the crashing query
# Run the crashing query
--
error
2006
,
2013
--
error
2006
,
2013
COMMIT
;
COMMIT
;
...
@@ -62,6 +63,10 @@ while ($numtests)
...
@@ -62,6 +63,10 @@ while ($numtests)
# Poll the server waiting for it to be back online again.
# Poll the server waiting for it to be back online again.
--
source
include
/
wait_until_connected_again
.
inc
--
source
include
/
wait_until_connected_again
.
inc
--
disable_query_log
eval
SET
@
crash
=
getcrash
(
$numtests
);
SELECT
@
crash
as
CRASH_POINT
;
--
enable_query_log
# table and binlog should be in sync.
# table and binlog should be in sync.
SELECT
*
FROM
t1
ORDER
BY
id
;
SELECT
*
FROM
t1
ORDER
BY
id
;
--
replace_column
2
# 5 #
--
replace_column
2
# 5 #
...
@@ -75,4 +80,4 @@ while ($numtests)
...
@@ -75,4 +80,4 @@ while ($numtests)
# final cleanup
# final cleanup
DROP
TABLE
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
DROP
TABLE
t2
;
DROP
PROCEDURE
s
etcrash
;
DROP
FUNCTION
g
etcrash
;
sql/handler.cc
View file @
2b60afe8
...
@@ -1428,7 +1428,7 @@ int ha_commit_trans(THD *thd, bool all)
...
@@ -1428,7 +1428,7 @@ int ha_commit_trans(THD *thd, bool all)
if
(
trt
.
update
())
if
(
trt
.
update
())
goto
err
;
goto
err
;
if
(
all
)
if
(
all
)
trans_commit_stmt
(
thd
);
commit_one_phase_2
(
thd
,
false
,
&
thd
->
transaction
.
stmt
,
false
);
break
;
break
;
}
}
}
}
...
...
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