mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Reverted wrong bug fix (Bug#11228)
mysql-test/r/key.result: Fixed result after removing wrong bug fix mysql-test/t/key.test: Added SHOW CREATE TABLE, which is the proper way to check for table definitions sql/table.cc: Reverted wrong bug fix. The intention with the original code was to show that MySQL treats the first given unique key as a primary key. Clients can use the marked primary key as a real primary key to validate row changes in case of conflicting updates. The ODBC driver (and other drivers) may also use this fact to optimize/check updates and handle conflicts. The marked key also shows what some engines, like InnoDB or NDB, will use as it's internal primary key. For checking if someone has declared a true PRIMARY KEY, one should use 'SHOW CREATE TABLE'
This commit is contained in:
@ -332,8 +332,16 @@ UNIQUE i1idx (i1),
|
||||
UNIQUE i2idx (i2));
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
i1 int(11) UNI 0
|
||||
i1 int(11) PRI 0
|
||||
i2 int(11) UNI 0
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i1` int(11) NOT NULL default '0',
|
||||
`i2` int(11) NOT NULL default '0',
|
||||
UNIQUE KEY `i1idx` (`i1`),
|
||||
UNIQUE KEY `i2idx` (`i2`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
c1 int,
|
||||
|
@ -330,6 +330,7 @@ create table t1 (
|
||||
UNIQUE i1idx (i1),
|
||||
UNIQUE i2idx (i2));
|
||||
desc t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user