| 1 |
-- source include/have_innodb.inc |
| 2 |
|
| 3 |
let $force_pk=`select @@innodb_force_primary_key`; |
| 4 |
|
| 5 |
-- error 1173 |
| 6 |
create table t1(a integer) engine=innodb; |
| 7 |
show warnings; |
| 8 |
-- error 1173 |
| 9 |
create table t1(a integer unique key) engine=innodb; |
| 10 |
show warnings; |
| 11 |
-- error 1173 |
| 12 |
create table t1(a integer not null, b integer, |
| 13 |
unique key(a,b)) engine=innodb; |
| 14 |
show warnings; |
| 15 |
create table t1(a integer not null primary key) engine=innodb; |
| 16 |
show create table t1; |
| 17 |
show warnings; |
| 18 |
drop table t1; |
| 19 |
create table t1(a integer not null unique key) engine=innodb; |
| 20 |
show create table t1; |
| 21 |
show warnings; |
| 22 |
drop table t1; |
| 23 |
|
| 24 |
set global innodb_force_primary_key = 0; |
| 25 |
create table t1(a integer) engine=innodb; |
| 26 |
show warnings; |
| 27 |
insert into t1 values (1),(2),(3); |
| 28 |
|
| 29 |
set global innodb_force_primary_key = 1; |
| 30 |
select * from t1; |
| 31 |
-- error 1173 |
| 32 |
create table t2(a integer) engine=innodb; |
| 33 |
show warnings; |
| 34 |
drop table t1; |
| 35 |
|
| 36 |
# |
| 37 |
# MDEV-8582: innodb_force_primary_key option does not |
| 38 |
# force PK or unique key |
| 39 |
# |
| 40 |
--error 1173 |
| 41 |
create table t1 (i int not null, key(i)) engine=innodb; |
| 42 |
create table t1 (i int not null, unique key(i)) engine=innodb; |
| 43 |
show warnings; |
| 44 |
show create table t1; |
| 45 |
drop table t1; |
| 46 |
|
| 47 |
--disable_query_log |
| 48 |
eval set global innodb_force_primary_key=$force_pk; |
| 49 |
--enable_query_log |