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
42802452
Commit
42802452
authored
Sep 12, 2021
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: reduce error injection noise in partitioning
parent
b7bba721
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
250 additions
and
96 deletions
+250
-96
mysql-test/suite/atomic/alter_partition,innodb.rdiff
mysql-test/suite/atomic/alter_partition,innodb.rdiff
+197
-0
mysql-test/suite/atomic/alter_partition.result
mysql-test/suite/atomic/alter_partition.result
+3
-3
mysql-test/suite/atomic/alter_partition.test
mysql-test/suite/atomic/alter_partition.test
+4
-4
sql/sql_partition.cc
sql/sql_partition.cc
+40
-80
sql/sql_table.cc
sql/sql_table.cc
+3
-5
sql/sql_table.h
sql/sql_table.h
+3
-4
No files found.
mysql-test/suite/atomic/alter_partition,innodb.rdiff
0 → 100644
View file @
42802452
--- alter_partition.result
+++ alter_partition,innodb.reject
@@ -12,12 +12,9 @@
end $
# QUERY: ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
# CRASH: crash_create_before_create_frm
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -33,12 +30,9 @@
12
22
# CRASH: crash_alter_partition_after_create_frm
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -54,12 +48,9 @@
12
22
# CRASH: crash_alter_partition_after_write_frm
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -75,12 +66,9 @@
12
22
# CRASH: crash_convert_partition_1
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -96,12 +84,9 @@
12
22
# CRASH: crash_convert_partition_2
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -117,12 +102,9 @@
12
22
# CRASH: crash_convert_partition_3
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -138,12 +120,9 @@
12
22
# CRASH: crash_convert_partition_4
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -159,12 +138,9 @@
12
22
# CRASH: crash_convert_partition_5
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -180,12 +156,9 @@
12
22
# CRASH: crash_convert_partition_6
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -201,12 +174,9 @@
12
22
# CRASH: crash_convert_partition_7
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -222,12 +192,9 @@
12
22
# CRASH: crash_convert_partition_8
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1.MYD
-t1#P#p1.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#p1.ibd
+t1#P#pn.ibd
t1.frm
t1.par
Table Create Table
@@ -243,15 +210,12 @@
12
22
# CRASH: crash_convert_partition_9
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#pn.MYD
-t1#P#pn.MYI
+t1#P#p0.ibd
+t1#P#pn.ibd
t1.frm
t1.par
-tp1.MYD
-tp1.MYI
tp1.frm
+tp1.ibd
master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
Table Create Table
t1 CREATE TABLE `t1` (
mysql-test/suite/atomic/alter_partition.result
View file @
42802452
...
...
@@ -11,7 +11,7 @@ insert into t1 values (2), (12), (22);
flush tables;
end $
# QUERY: ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
# CRASH:
ddl_log
_create_before_create_frm
# CRASH:
crash
_create_before_create_frm
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p1.MYD
...
...
@@ -32,7 +32,7 @@ x
2
12
22
# CRASH:
ddl_log
_alter_partition_after_create_frm
# CRASH:
crash
_alter_partition_after_create_frm
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p1.MYD
...
...
@@ -53,7 +53,7 @@ x
2
12
22
# CRASH:
ddl_log
_alter_partition_after_write_frm
# CRASH:
crash
_alter_partition_after_write_frm
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p1.MYD
...
...
mysql-test/suite/atomic/alter_partition.test
View file @
42802452
...
...
@@ -37,9 +37,9 @@ if ($MTR_COMBINATION_ROW)
let
$MYSQLD_DATADIR
=
`SELECT @@datadir`
;
let
$crash_count
=
12
;
let
$crash_points
=
'
ddl_log
_create_before_create_frm'
,
'
ddl_log
_alter_partition_after_create_frm'
,
'
ddl_log
_alter_partition_after_write_frm'
,
let
$crash_points
=
'
crash
_create_before_create_frm'
,
'
crash
_alter_partition_after_create_frm'
,
'
crash
_alter_partition_after_write_frm'
,
'crash_convert_partition_1'
,
'crash_convert_partition_2'
,
'crash_convert_partition_3'
,
...
...
@@ -104,7 +104,7 @@ while ($r < $statement_count)
RESET
MASTER
;
--
exec
echo
"restart"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
--
disable_reconnect
--
eval
set
@@
debug_dbug
=
"+d,
$crash
"
,
@
debug_crash_counter
=
1
--
eval
set
@@
debug_dbug
=
"+d,
$crash
"
let
$errno
=
0
;
--
error
0
,
2013
--
eval
$statement
;
...
...
sql/sql_partition.cc
View file @
42802452
This diff is collapsed.
Click to expand it.
sql/sql_table.cc
View file @
42802452
...
...
@@ -810,10 +810,9 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
DBUG_ASSERT
(
!
create_info
->
tmp_table
());
if
(
ddl_log_create_table
(
thd
,
part_info
,
create_info
->
db_type
,
&
new_path
,
&
alter_ctx
->
new_db
,
&
alter_ctx
->
new_name
,
true
)
||
ERROR_INJECT
_ERROR
(
"fail_
create_before_create_frm"
))
ERROR_INJECT
(
"
create_before_create_frm"
))
DBUG_RETURN
(
TRUE
);
debug_crash_here
(
"ddl_log_create_before_create_frm"
);
if
(
mysql_prepare_create_table
(
thd
,
create_info
,
lpt
->
alter_info
,
&
lpt
->
db_options
,
file
,
&
lpt
->
key_info_buffer
,
&
lpt
->
key_count
,
...
...
@@ -832,18 +831,17 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
thd
->
work_part_info
=
work_part_info
;
create_info
->
db_type
=
db_type
;
debug_crash_here
(
"ddl_log_
alter_partition_after_create_frm"
);
ERROR_INJECT
(
"
alter_partition_after_create_frm"
);
error
=
writefile
(
frm_name
,
alter_ctx
->
new_db
.
str
,
alter_ctx
->
new_name
.
str
,
create_info
->
tmp_table
(),
frm
.
str
,
frm
.
length
);
my_free
((
void
*
)
frm
.
str
);
if
(
unlikely
(
error
)
||
ERROR_INJECT
_ERROR
(
"fail_
alter_partition_after_write_frm"
))
if
(
unlikely
(
error
)
||
ERROR_INJECT
(
"
alter_partition_after_write_frm"
))
{
mysql_file_delete
(
key_file_frm
,
frm_name
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
debug_crash_here
(
"ddl_log_alter_partition_after_write_frm"
);
DBUG_RETURN
(
false
);
}
if
(
flags
&
WFRM_BACKUP_ORIGINAL
)
...
...
sql/sql_table.h
View file @
42802452
...
...
@@ -20,10 +20,9 @@
#include <my_sys.h> // pthread_mutex_t
#include "m_string.h" // LEX_CUSTRING
#define ERROR_INJECT_CRASH(code) \
(DBUG_IF(code) && (DBUG_SUICIDE(), false))
#define ERROR_INJECT_ERROR(code) \
(DBUG_IF(code) && (my_error(ER_UNKNOWN_ERROR, MYF(0)), 1))
#define ERROR_INJECT(code) \
((DBUG_IF("crash_" code) && (DBUG_SUICIDE(), 0)) || \
(DBUG_IF("fail_" code) && (my_error(ER_UNKNOWN_ERROR, MYF(0)), 1)))
class
Alter_info
;
class
Alter_table_ctx
;
...
...
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