Bug #69079 | MySQL when using spaces in name of foreign key converts them to question marks | ||
---|---|---|---|
Submitted: | 26 Apr 2013 6:50 | Modified: | 26 Apr 2013 7:27 |
Reporter: | Виталий Евсюков | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 5.5.31,5.6.11 | OS: | Linux (Ubuntu 12.04) |
Assigned to: | CPU Architecture: | Any | |
Tags: | constraint, foreign key, names, spaces |
[26 Apr 2013 6:50]
Виталий Евсюков
[26 Apr 2013 7:25]
MySQL Verification Team
Hello Виталий Евсюков, Thank you for the report. Verified as described on reported and later versions. Thanks, Umesh
[26 Apr 2013 7:26]
MySQL Verification Team
How to repeat: drop table if exists t2; drop table if exists t1; create table t1(id int not null primary key)engine=innodb; create table t2(id int not null primary key)engine=innodb; ALTER TABLE t2 ADD CONSTRAINT `t2_ id` FOREIGN KEY (id) REFERENCES t1(id); show create table t2\G ######### mysql> select version(); +------------------+ | version() | +------------------+ | 5.6.11-debug-log | +------------------+ 1 row in set (0.00 sec) mysql> drop table if exists t2; Query OK, 0 rows affected (0.06 sec) mysql> drop table if exists t1; Query OK, 0 rows affected (2.64 sec) mysql> create table t1(id int not null primary key)engine=innodb; Query OK, 0 rows affected (0.07 sec) mysql> create table t2(id int not null primary key)engine=innodb; Query OK, 0 rows affected (0.10 sec) mysql> ALTER TABLE t2 ADD CONSTRAINT `t2_ id` FOREIGN KEY (id) REFERENCES t1(id); Query OK, 0 rows affected (0.12 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> show create table t2\G *************************** 1. row *************************** Table: t2 Create Table: CREATE TABLE `t2` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `t2_?id` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) mysql> ######### mysql> select version(); +--------------+ | version() | +--------------+ | 5.5.31-debug | +--------------+ 1 row in set (0.00 sec) mysql> drop table if exists t2; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> mysql> create table t1(id int not null primary key)engine=innodb; Query OK, 0 rows affected (0.10 sec) mysql> create table t2(id int not null primary key)engine=innodb; Query OK, 0 rows affected (0.03 sec) mysql> ALTER TABLE t2 ADD CONSTRAINT `t2_ id` FOREIGN KEY (id) REFERENCES t1(id); Query OK, 0 rows affected (0.08 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> show create table t2\G *************************** 1. row *************************** Table: t2 Create Table: CREATE TABLE `t2` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `t2_?id` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) mysql>
[26 Apr 2013 7:27]
MySQL Verification Team
Duplicate of http://bugs.mysql.com/bug.php?id=69062