From 563c32ccd1f5a212dfb270097c1dbd1cdc1be907 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 May 2003 19:16:30 +0200 Subject: Fix of bug 390: primary key now implies (silently) NOT NULL for key fields. --- sql/sql_table.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 745d9ea1084..90239c1c7ea 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -598,8 +598,9 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, { if (key->type == Key::PRIMARY) { - my_error(ER_PRIMARY_CANT_HAVE_NULL, MYF(0)); - DBUG_RETURN(-1); + /* Implicitly set primary key fields to NOT NULL for ISO conf. */ + sql_field->flags|= NOT_NULL_FLAG; + sql_field->pack_flag&= ~FIELDFLAG_MAYBE_NULL; } if (!(file->table_flags() & HA_NULL_KEY)) { -- cgit v1.2.1