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
a3802ecb
Commit
a3802ecb
authored
Dec 02, 2017
by
Eugene Kosov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IB: assertion failure on delete with foreign [#366]
parent
5c820a71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
+44
-4
mysql-test/suite/versioning/r/foreign.result
mysql-test/suite/versioning/r/foreign.result
+16
-0
mysql-test/suite/versioning/t/foreign.test
mysql-test/suite/versioning/t/foreign.test
+26
-0
storage/innobase/row/row0upd.cc
storage/innobase/row/row0upd.cc
+2
-4
No files found.
mysql-test/suite/versioning/r/foreign.result
View file @
a3802ecb
...
...
@@ -170,3 +170,19 @@ update parent set id=2;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))
drop table child;
drop table parent;
create or replace table a (
cola int(10) primary key,
v_cola int(10) as (cola mod 10) virtual
) engine=innodb with system versioning;
create index v_cola on a (v_cola);
create or replace table b(
cola int(10),
v_cola int(10)
) engine=innodb with system versioning;
alter table b add constraint `v_cola_fk`
foreign key (v_cola) references a (v_cola);
insert into a(cola) values (12);
insert into b(cola, v_cola) values (10,2);
delete from a;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`b`, CONSTRAINT `v_cola_fk` FOREIGN KEY (`v_cola`) REFERENCES `a` (`v_cola`))
drop table b, a;
mysql-test/suite/versioning/t/foreign.test
View file @
a3802ecb
...
...
@@ -203,3 +203,29 @@ update parent set id=2;
drop
table
child
;
drop
table
parent
;
###################
# crash on DELETE #
###################
create
or
replace
table
a
(
cola
int
(
10
)
primary
key
,
v_cola
int
(
10
)
as
(
cola
mod
10
)
virtual
)
engine
=
innodb
with
system
versioning
;
create
index
v_cola
on
a
(
v_cola
);
create
or
replace
table
b
(
cola
int
(
10
),
v_cola
int
(
10
)
)
engine
=
innodb
with
system
versioning
;
alter
table
b
add
constraint
`v_cola_fk`
foreign
key
(
v_cola
)
references
a
(
v_cola
);
insert
into
a
(
cola
)
values
(
12
);
insert
into
b
(
cola
,
v_cola
)
values
(
10
,
2
);
--
error
ER_ROW_IS_REFERENCED_2
delete
from
a
;
drop
table
b
,
a
;
storage/innobase/row/row0upd.cc
View file @
a3802ecb
...
...
@@ -2227,10 +2227,8 @@ row_upd_store_row(
NULL
,
NULL
,
NULL
,
ext
,
node
->
heap
);
if
(
node
->
table
->
n_v_cols
)
{
row_upd_store_v_row
(
node
,
node
->
is_delete
==
PLAIN_DELETE
?
NULL
:
node
->
update
,
thd
,
mysql_table
);
row_upd_store_v_row
(
node
,
node
->
is_delete
?
NULL
:
node
->
update
,
thd
,
mysql_table
);
}
if
(
node
->
is_delete
==
PLAIN_DELETE
)
{
...
...
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