Commit 2870719c authored by ram@mysql.r18.ru's avatar ram@mysql.r18.ru

All segments of SPATIAL keys MUST be NOT NULL.

Allow NULL geometry fields.
parent 36834768
......@@ -266,4 +266,5 @@
#define ER_SELECT_REDUCED 1247
#define ER_TABLENAME_NOT_ALLOWED_HERE 1248
#define ER_NOT_SUPPORTED_AUTH_MODE 1249
#define ER_ERROR_MESSAGES 250
#define ER_SPATIAL_CANT_HAVE_NULL 1250
#define ER_ERROR_MESSAGES 251
......@@ -259,4 +259,5 @@ v/*
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -253,4 +253,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -261,4 +261,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -250,4 +250,5 @@
"Every derived table must have it's own alias",
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -255,4 +255,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -250,4 +250,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -261,3 +261,4 @@
"Select %u wurde während der Optimierung reduziert.",
"Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde kann nicht in %-.32s verwendet werden",
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client",
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -250,4 +250,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -252,4 +252,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -250,4 +250,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -252,4 +252,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -250,4 +250,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -252,4 +252,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -252,4 +252,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -254,4 +254,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -250,4 +250,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -254,4 +254,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -253,4 +253,5 @@
"Every derived table must have it's own alias"
"Select %u ",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -246,4 +246,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -258,4 +258,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -251,4 +251,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -250,4 +250,5 @@
"Every derived table must have it's own alias"
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -255,4 +255,5 @@
"Every derived table must have it's own alias"
"Select %u was iii",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
\ No newline at end of file
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment