summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2003-05-13 19:16:30 +0200
committerunknown <pem@mysql.com>2003-05-13 19:16:30 +0200
commit563c32ccd1f5a212dfb270097c1dbd1cdc1be907 (patch)
tree21315a755f5391934d3a15d07985511dd08bc06e /sql/sql_table.cc
parent4ccf66df87bfe9290d686e7abd585d3ffe1c1370 (diff)
downloadmariadb-git-563c32ccd1f5a212dfb270097c1dbd1cdc1be907.tar.gz
Fix of bug 390: primary key now implies (silently) NOT NULL for key fields.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc5
1 files changed, 3 insertions, 2 deletions
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))
{