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
46f76f3d
Commit
46f76f3d
authored
Nov 11, 2020
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Progress
Test
parent
c859f941
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
229 additions
and
2 deletions
+229
-2
mysql-test/include/foreign_fail.inc
mysql-test/include/foreign_fail.inc
+4
-2
mysql-test/suite/innodb/r/f.result
mysql-test/suite/innodb/r/f.result
+156
-0
mysql-test/suite/innodb/t/f.test
mysql-test/suite/innodb/t/f.test
+62
-0
sql/datadict.cc
sql/datadict.cc
+7
-0
No files found.
mysql-test/include/f
k_fail_t2
.inc
→
mysql-test/include/f
oreign_fail
.inc
View file @
46f76f3d
...
...
@@ -29,7 +29,6 @@ if ($show_statement1)
eval
$show_statement1
;
}
show
create
table
t1
;
--
eval
set
@@
debug_dbug
=
$debug_dbug
# accept all errors
--
disable_abort_on_error
...
...
@@ -39,6 +38,9 @@ show create table t1;
--
echo
# State after failure
--
replace_result
#p# #p#
--
list_files
$datadir
/
test
show
create
table
t1
;
if
(
$show_statement2
)
{
eval
$show_statement2
;
}
set
session
debug_dbug
=@
save_dbug
;
mysql-test/suite/innodb/r/f.result
0 → 100644
View file @
46f76f3d
call mtr.add_suppression("Failed to execute action for entry");
create or replace procedure make_tables()
begin
create table t1 (x int primary key);
create table t2 (y int primary key);
create table t3 (z int primary key);
create table t4 (
a int primary key,
x int references t1(x),
y int references t2(y),
z int references t3(z));
insert t1 values (1);
insert t2 values (2);
insert t3 values (3);
insert t4 values (0, 1, 2, 3);
end $
create or replace procedure drop_tables()
begin
drop table if exists t4;
drop table if exists t3;
drop table if exists t2;
drop table if exists t1;
end $
set @save_dbug=@@debug_dbug;
call make_tables;
check tables t1, t2, t3, t4;
Table Op Msg_type Msg_text
test.t1 check Note Found 1 referenced keys
test.t1 check status OK
test.t2 check Note Found 1 referenced keys
test.t2 check status OK
test.t3 check Note Found 1 referenced keys
test.t3 check status OK
test.t4 check Note Found 3 foreign keys
test.t4 check status OK
# State before failure
db.opt
t1.MYD
t1.MYI
t1.frm
t2.MYD
t2.MYI
t2.frm
t3.MYD
t3.MYI
t3.frm
t4.MYD
t4.MYI
t4.frm
check tables t1, t2, t3, t4;
Table Op Msg_type Msg_text
test.t1 check Note Found 1 referenced keys
test.t1 check status OK
test.t2 check Note Found 1 referenced keys
test.t2 check status OK
test.t3 check Note Found 1 referenced keys
test.t3 check status OK
test.t4 check Note Found 3 foreign keys
test.t4 check status OK
set @@debug_dbug= "+d,fail_fk_backup_frm";
drop table t4;
ERROR HY000: Unknown error
# State after failure
db.opt
t1.MYD
t1.MYI
t1.frm
t2.MYD
t2.MYI
t2.frm
t3.MYD
t3.MYI
t3.frm
t4.MYD
t4.MYI
t4.frm
check tables t1, t2, t3, t4;
Table Op Msg_type Msg_text
test.t1 check Note Found 1 referenced keys
test.t1 check status OK
test.t2 check Note Found 1 referenced keys
test.t2 check status OK
test.t3 check Note Found 1 referenced keys
test.t3 check status OK
test.t4 check Note Found 3 foreign keys
test.t4 check status OK
set session debug_dbug=@save_dbug;
call drop_tables;
set @save_dbug=@@debug_dbug;
call make_tables;
check tables t1, t2, t3, t4;
Table Op Msg_type Msg_text
test.t1 check Note Found 1 referenced keys
test.t1 check status OK
test.t2 check Note Found 1 referenced keys
test.t2 check status OK
test.t3 check Note Found 1 referenced keys
test.t3 check status OK
test.t4 check Note Found 3 foreign keys
test.t4 check status OK
# State before failure
db.opt
t1.MYD
t1.MYI
t1.frm
t2.MYD
t2.MYI
t2.frm
t3.MYD
t3.MYI
t3.frm
t4.MYD
t4.MYI
t4.frm
check tables t1, t2, t3, t4;
Table Op Msg_type Msg_text
test.t1 check Note Found 1 referenced keys
test.t1 check status OK
test.t2 check Note Found 1 referenced keys
test.t2 check status OK
test.t3 check Note Found 1 referenced keys
test.t3 check status OK
test.t4 check Note Found 3 foreign keys
test.t4 check status OK
set @@debug_dbug= "+d,fail_fk_install_shadow_frm";
drop table t4;
ERROR HY000: Unknown error
# State after failure
db.opt
t1.MYD
t1.MYI
t1.frm
t2.MYD
t2.MYI
t2.frm
t3.MYD
t3.MYI
t3.frm
t4.MYD
t4.MYI
t4.frm
check tables t1, t2, t3, t4;
Table Op Msg_type Msg_text
test.t1 check Note Found 1 referenced keys
test.t1 check status OK
test.t2 check Note Found 1 referenced keys
test.t2 check status OK
test.t3 check Note Found 1 referenced keys
test.t3 check status OK
test.t4 check Note Found 3 foreign keys
test.t4 check status OK
set session debug_dbug=@save_dbug;
call drop_tables;
drop procedure make_tables;
drop procedure drop_tables;
set session debug_dbug=@save_dbug;
mysql-test/suite/innodb/t/f.test
0 → 100644
View file @
46f76f3d
--
source
include
/
have_innodb
.
inc
# In fail_fk_backup_frm the log is already written but rename is not done
call
mtr
.
add_suppression
(
"Failed to execute action for entry"
);
--
let
$DATADIR
=
`SELECT @@datadir;`
--
let
$create_statement2
=
--
let
$insert_statement
=
--
let
$insert_statement2
=
--
delimiter
$
create
or
replace
procedure
make_tables
()
begin
create
table
t1
(
x
int
primary
key
);
create
table
t2
(
y
int
primary
key
);
create
table
t3
(
z
int
primary
key
);
create
table
t4
(
a
int
primary
key
,
x
int
references
t1
(
x
),
y
int
references
t2
(
y
),
z
int
references
t3
(
z
));
insert
t1
values
(
1
);
insert
t2
values
(
2
);
insert
t3
values
(
3
);
insert
t4
values
(
0
,
1
,
2
,
3
);
end
$
create
or
replace
procedure
drop_tables
()
begin
drop
table
if
exists
t4
;
drop
table
if
exists
t3
;
drop
table
if
exists
t2
;
drop
table
if
exists
t1
;
end
$
--
delimiter
;
let
$create_statement
=
call
make_tables
;
let
$show_statement0
=
check
tables
t1
,
t2
,
t3
,
t4
;
let
$show_statement1
=
check
tables
t1
,
t2
,
t3
,
t4
;
let
$show_statement2
=
check
tables
t1
,
t2
,
t3
,
t4
;
let
$debug_dbug
=
"+d,fail_fk_backup_frm"
;
let
$fail_statement
=
drop
table
t4
;
--
source
include
/
foreign_fail
.
inc
call
drop_tables
;
let
$debug_dbug
=
"+d,fail_fk_install_shadow_frm"
;
let
$fail_statement
=
drop
table
t4
;
--
source
include
/
foreign_fail
.
inc
call
drop_tables
;
#set @save_dbug=@@debug_dbug;
#let $create_statement= create or replace table t1 (id int primary key);
#let $create_statement2= create or replace table t2 (id int);
#let $insert_statement= insert into t1 values(1);
#let $insert_statement2= insert into t2 values(1);
#set session debug_dbug="+d,crash_fk_alter_1";
#let $crash_statement= alter table t2 add foreign key (id) references t1(id), algorithm=copy;
#--source suite/parts/inc/partition_crash_t2.inc
drop
procedure
make_tables
;
drop
procedure
drop_tables
;
set
session
debug_dbug
=@
save_dbug
;
sql/datadict.cc
View file @
46f76f3d
...
...
@@ -597,6 +597,13 @@ bool FK_backup::fk_install_shadow_frm(ddl_log_info &log_info)
strxnmov
(
frm_name
,
sizeof
(
frm_name
),
path
,
reg_ext
,
NullS
);
if
(
!
mysql_file_stat
(
key_file_frm
,
shadow_frm_name
,
&
stat_info
,
MYF
(
MY_WME
)))
return
true
;
#ifndef DBUG_OFF
if
(
!
log_info
.
dbg_first
&&
(
ERROR_INJECT
(
"fail_fk_install_shadow_frm"
,
"crash_fk_install_shadow_frm"
)))
{
return
true
;
}
#endif
if
(
mysql_file_rename
(
key_file_frm
,
shadow_frm_name
,
frm_name
,
MYF
(
MY_WME
)))
return
true
;
if
(
deactivate_ddl_log_entry
(
delete_shadow_entry
->
entry_pos
))
...
...
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