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
a2375bdb
Commit
a2375bdb
authored
Sep 08, 2014
by
Murthy Narkedimilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding patch for security bug 19471516
parent
6f012e07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
mysql-test/suite/innodb/r/foreign-keys.result
mysql-test/suite/innodb/r/foreign-keys.result
+16
-0
mysql-test/suite/innodb/t/foreign-keys.test
mysql-test/suite/innodb/t/foreign-keys.test
+26
-0
storage/innobase/dict/dict0dict.c
storage/innobase/dict/dict0dict.c
+10
-0
No files found.
mysql-test/suite/innodb/r/foreign-keys.result
0 → 100644
View file @
a2375bdb
#
# Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE
# ADD FOREIGN KEY
#
CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT,
PRIMARY KEY (`department_id`)) engine=innodb;
CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT,
`title_reporter_fk` INT, PRIMARY KEY (`title_id`));
CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`));
ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES
`people` (`people_id`);
ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people`
(`people_id`);
ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people`
(`people_id`);
drop table title, department, people;
mysql-test/suite/innodb/t/foreign-keys.test
0 → 100644
View file @
a2375bdb
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_debug
.
inc
--
echo
#
--
echo
# Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE
--
echo
# ADD FOREIGN KEY
--
echo
#
CREATE
TABLE
`department`
(
`department_id`
INT
,
`department_people_fk`
INT
,
PRIMARY
KEY
(
`department_id`
))
engine
=
innodb
;
CREATE
TABLE
`title`
(
`title_id`
INT
,
`title_manager_fk`
INT
,
`title_reporter_fk`
INT
,
PRIMARY
KEY
(
`title_id`
));
CREATE
TABLE
`people`
(
`people_id`
INT
,
PRIMARY
KEY
(
`people_id`
));
ALTER
TABLE
`department`
ADD
FOREIGN
KEY
(
`department_people_fk`
)
REFERENCES
`people`
(
`people_id`
);
ALTER
TABLE
`title`
ADD
FOREIGN
KEY
(
`title_manager_fk`
)
REFERENCES
`people`
(
`people_id`
);
ALTER
TABLE
`title`
ADD
FOREIGN
KEY
(
`title_reporter_fk`
)
REFERENCES
`people`
(
`people_id`
);
drop
table
title
,
department
,
people
;
storage/innobase/dict/dict0dict.c
View file @
a2375bdb
...
...
@@ -1123,6 +1123,11 @@ dict_table_rename_in_cache(
/* The id will be changed. So remove old one */
rbt_delete
(
foreign
->
foreign_table
->
foreign_rbt
,
foreign
->
id
);
if
(
foreign
->
referenced_table
)
{
rbt_delete
(
foreign
->
referenced_table
->
referenced_rbt
,
foreign
->
id
);
}
if
(
ut_strlen
(
foreign
->
foreign_table_name
)
<
ut_strlen
(
table
->
name
))
{
/* Allocate a longer name buffer;
...
...
@@ -1273,6 +1278,11 @@ dict_table_rename_in_cache(
rbt_insert
(
foreign
->
foreign_table
->
foreign_rbt
,
foreign
->
id
,
&
foreign
);
if
(
foreign
->
referenced_table
)
{
rbt_insert
(
foreign
->
referenced_table
->
referenced_rbt
,
foreign
->
id
,
&
foreign
);
}
foreign
=
UT_LIST_GET_NEXT
(
foreign_list
,
foreign
);
}
...
...
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