1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix of bug 390: primary key now implies (silently) NOT NULL for key fields.

This commit is contained in:
unknown
2003-05-13 19:16:30 +02:00
parent 4ccf66df87
commit 563c32ccd1
5 changed files with 24 additions and 11 deletions

View File

@ -25,13 +25,9 @@ create table t1 (a int not null auto_increment,primary key (a)) type=heap;
The used table type doesn't support AUTO_INCREMENT columns
create table t1 (a int not null,b text) type=heap;
The used table type doesn't support BLOB/TEXT columns
create table t1 (a int ,primary key(a)) type=heap;
All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead
drop table if exists t1;
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap;
The used table type doesn't support AUTO_INCREMENT columns
create table t1 (ordid int(8), primary key (ordid));
All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead
create table not_existing_database.test (a int);
Got one of the listed errors
create table `a/a` (a int);
@ -171,3 +167,12 @@ t1 CREATE TABLE `t1` (
) TYPE=MyISAM
SET SESSION table_type=default;
drop table t1;
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
insert into t1 values ("a", 1), ("b", 2);
insert into t1 values ("c", NULL);
Column 'k2' cannot be null
insert into t1 values (NULL, 3);
Column 'k1' cannot be null
insert into t1 values (NULL, NULL);
Column 'k1' cannot be null
drop table t1;