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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
8bb893f5
Commit
8bb893f5
authored
Dec 07, 2011
by
Jimmy Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Bug #13083023 - 60229: BROKEN COMPATIBILITY: ERROR WHILE CREATE TABLE
WITH FOREIGN KEY CONSTRAI
rb://844
approved by marko
parent
358a31df
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
0 deletions
+71
-0
mysql-test/suite/innodb/r/innodb_bug60229.result
mysql-test/suite/innodb/r/innodb_bug60229.result
+26
-0
mysql-test/suite/innodb/t/innodb_bug60229-master.opt
mysql-test/suite/innodb/t/innodb_bug60229-master.opt
+1
-0
mysql-test/suite/innodb/t/innodb_bug60229.test
mysql-test/suite/innodb/t/innodb_bug60229.test
+39
-0
storage/innobase/dict/dict0dict.c
storage/innobase/dict/dict0dict.c
+5
-0
No files found.
mysql-test/suite/innodb/r/innodb_bug60229.result
0 → 100644
View file @
8bb893f5
CREATE TABLE PERSON (
PERSON_ID VARCHAR(50) NOT NULL,
DOB VARCHAR(50) NOT NULL,
NAME NVARCHAR(255) NOT NULL,
CONSTRAINT PK_PERSON PRIMARY KEY (PERSON_ID, DOB)
)Engine=InnoDB;
CREATE TABLE PHOTO (
PERSON_ID VARCHAR(50) NOT NULL,
DOB VARCHAR(50) NOT NULL,
PHOTO_DETAILS VARCHAR(50) NULL,
CONSTRAINT PK_PHOTO PRIMARY KEY (PERSON_ID, DOB),
CONSTRAINT FK_PHOTO_2_PERSON FOREIGN KEY (PERSON_ID, DOB) REFERENCES PERSON (PERSON_ID, DOB)
)Engine=InnoDB;
CREATE TABLE ADDRESS (
PERSON_ID VARCHAR(50) NOT NULL,
DOB VARCHAR(50) NOT NULL,
ADDRESS_ID VARCHAR(50) NOT NULL,
ADDRESS_DETAILS NVARCHAR(250) NULL,
CONSTRAINT PK_ADDRESS PRIMARY KEY (PERSON_ID, DOB, ADDRESS_ID),
CONSTRAINT FK_ADDRESS_2_PERSON FOREIGN KEY (PERSON_ID, DOB) REFERENCES PERSON (PERSON_ID, DOB) ON DELETE CASCADE
)Engine=InnoDB;
INSERT INTO PERSON VALUES("10", "11011999", "John");
INSERT INTO PHOTO VALUES("10", "11011999", "new photo");
DROP TABLE PHOTO;
DROP TABLE ADDRESS;
DROP TABLE PERSON;
mysql-test/suite/innodb/t/innodb_bug60229-master.opt
0 → 100644
View file @
8bb893f5
--lower_case_table_names=0
mysql-test/suite/innodb/t/innodb_bug60229.test
0 → 100644
View file @
8bb893f5
#
# Bug #13083023 - 60229: BROKEN COMPATIBILITY: ERROR WHILE CREATE TABLE
# WITH FOREIGN KEY CONSTRAINT.
--
source
include
/
have_innodb
.
inc
CREATE
TABLE
PERSON
(
PERSON_ID
VARCHAR
(
50
)
NOT
NULL
,
DOB
VARCHAR
(
50
)
NOT
NULL
,
NAME
NVARCHAR
(
255
)
NOT
NULL
,
CONSTRAINT
PK_PERSON
PRIMARY
KEY
(
PERSON_ID
,
DOB
)
)
Engine
=
InnoDB
;
CREATE
TABLE
PHOTO
(
PERSON_ID
VARCHAR
(
50
)
NOT
NULL
,
DOB
VARCHAR
(
50
)
NOT
NULL
,
PHOTO_DETAILS
VARCHAR
(
50
)
NULL
,
CONSTRAINT
PK_PHOTO
PRIMARY
KEY
(
PERSON_ID
,
DOB
),
CONSTRAINT
FK_PHOTO_2_PERSON
FOREIGN
KEY
(
PERSON_ID
,
DOB
)
REFERENCES
PERSON
(
PERSON_ID
,
DOB
)
)
Engine
=
InnoDB
;
CREATE
TABLE
ADDRESS
(
PERSON_ID
VARCHAR
(
50
)
NOT
NULL
,
DOB
VARCHAR
(
50
)
NOT
NULL
,
ADDRESS_ID
VARCHAR
(
50
)
NOT
NULL
,
ADDRESS_DETAILS
NVARCHAR
(
250
)
NULL
,
CONSTRAINT
PK_ADDRESS
PRIMARY
KEY
(
PERSON_ID
,
DOB
,
ADDRESS_ID
),
CONSTRAINT
FK_ADDRESS_2_PERSON
FOREIGN
KEY
(
PERSON_ID
,
DOB
)
REFERENCES
PERSON
(
PERSON_ID
,
DOB
)
ON
DELETE
CASCADE
)
Engine
=
InnoDB
;
INSERT
INTO
PERSON
VALUES
(
"10"
,
"11011999"
,
"John"
);
INSERT
INTO
PHOTO
VALUES
(
"10"
,
"11011999"
,
"new photo"
);
DROP
TABLE
PHOTO
;
DROP
TABLE
ADDRESS
;
DROP
TABLE
PERSON
;
storage/innobase/dict/dict0dict.c
View file @
8bb893f5
...
...
@@ -3069,10 +3069,15 @@ dict_scan_table_name(
memcpy
(
ref
,
database_name
,
database_name_len
);
ref
[
database_name_len
]
=
'/'
;
memcpy
(
ref
+
database_name_len
+
1
,
table_name
,
table_name_len
+
1
);
}
else
{
#ifndef __WIN__
if
(
innobase_get_lower_case_table_names
()
==
1
)
{
innobase_casedn_str
(
ref
);
}
#else
innobase_casedn_str
(
ref
);
#endif
/* !__WIN__ */
*
table
=
dict_table_get_low
(
ref
);
}
...
...
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