mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
All segments of SPATIAL keys MUST be NOT NULL.
Allow NULL geometry fields.
This commit is contained in:
@ -478,11 +478,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
blob_columns++;
|
||||
break;
|
||||
case FIELD_TYPE_GEOMETRY:
|
||||
if (!(sql_field->flags & NOT_NULL_FLAG))
|
||||
{
|
||||
my_error(ER_BAD_NULL_ERROR, MYF(0), sql_field->field_name);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
sql_field->pack_flag=FIELDFLAG_GEOM |
|
||||
pack_length_to_packflag(sql_field->pack_length -
|
||||
portable_sizeof_char_ptr);
|
||||
@ -741,6 +736,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
MYF(0),column->field_name);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
if (key->type == Key::SPATIAL)
|
||||
{
|
||||
my_error(ER_SPATIAL_CANT_HAVE_NULL, MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
key_info->flags|= HA_NULL_PART_KEY;
|
||||
}
|
||||
if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER)
|
||||
|
Reference in New Issue
Block a user