summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <ram@mysql.r18.ru>2003-02-26 20:25:48 +0400
committerunknown <ram@mysql.r18.ru>2003-02-26 20:25:48 +0400
commit0cd6596fa4c5068c22e5dfa7002182bd4f88eafd (patch)
treefdab876dd3d590d72bcc4999871c2cf77c42518e
parent29cc3529dbcba9fd190e01142bde5785be8dcc0b (diff)
downloadmariadb-git-0cd6596fa4c5068c22e5dfa7002182bd4f88eafd.tar.gz
All segments of SPATIAL keys MUST be NOT NULL.
Allow NULL geometry fields. include/mysqld_error.h: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/czech/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/danish/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/dutch/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/english/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/estonian/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/french/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/german/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/greek/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/hungarian/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/italian/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/japanese/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/korean/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/norwegian-ny/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/norwegian/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/polish/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/portuguese/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/romanian/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/russian/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/serbian/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/slovak/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/spanish/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/swedish/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL" sql/share/ukrainian/errmsg.txt: new error message: "All parts of a SPATIAL KEY must be NOT NULL"
-rw-r--r--include/mysqld_error.h3
-rw-r--r--sql/share/czech/errmsg.txt3
-rw-r--r--sql/share/danish/errmsg.txt3
-rw-r--r--sql/share/dutch/errmsg.txt3
-rw-r--r--sql/share/english/errmsg.txt3
-rw-r--r--sql/share/estonian/errmsg.txt3
-rw-r--r--sql/share/french/errmsg.txt3
-rw-r--r--sql/share/german/errmsg.txt1
-rw-r--r--sql/share/greek/errmsg.txt3
-rw-r--r--sql/share/hungarian/errmsg.txt3
-rw-r--r--sql/share/italian/errmsg.txt3
-rw-r--r--sql/share/japanese/errmsg.txt3
-rw-r--r--sql/share/korean/errmsg.txt3
-rw-r--r--sql/share/norwegian-ny/errmsg.txt3
-rw-r--r--sql/share/norwegian/errmsg.txt3
-rw-r--r--sql/share/polish/errmsg.txt3
-rw-r--r--sql/share/portuguese/errmsg.txt3
-rw-r--r--sql/share/romanian/errmsg.txt3
-rw-r--r--sql/share/russian/errmsg.txt3
-rw-r--r--sql/share/serbian/errmsg.txt3
-rw-r--r--sql/share/slovak/errmsg.txt3
-rw-r--r--sql/share/spanish/errmsg.txt3
-rw-r--r--sql/share/swedish/errmsg.txt3
-rw-r--r--sql/share/ukrainian/errmsg.txt3
-rw-r--r--sql/sql_table.cc10
25 files changed, 52 insertions, 28 deletions
diff --git a/include/mysqld_error.h b/include/mysqld_error.h
index 377f714bfff..d2d2ded41af 100644
--- a/include/mysqld_error.h
+++ b/include/mysqld_error.h
@@ -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
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index 1ab299495b9..98ccf03cfed 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -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"
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index c0a36a38935..3db793aaf3b 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -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"
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index 677762403f6..5ba6227a456 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -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"
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 84d100cfae9..cc0810aeee1 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -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"
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index 43eb5de89a5..6b82b6088d5 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -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"
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index 518af36ea53..bafabdecc33 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -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"
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index e4ff723e01d..2368beb5ad5 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -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"
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index 9dd3d0a254b..9c4da850024 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -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"
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index 7fec6ddb040..e95313a7afc 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -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"
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index 3687fde0591..ea764ccff17 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -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"
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index 612af3e1069..d5efb9c2b1e 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -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"
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index 107dcbdbe07..e0d7971d09d 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -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"
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index 9c9e33edca9..07461b51674 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -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"
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index 805d54c422a..b6d3d44db95 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -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"
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index 578d206fda8..449a146a54c 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -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"
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index ac46736c7da..f296ecda5a4 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -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"
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index 3df02805a14..9991468ecc8 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -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"
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index e0bae3166db..61de4241b85 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -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"
diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt
index 75cfd73f3f0..e8d25da659f 100644
--- a/sql/share/serbian/errmsg.txt
+++ b/sql/share/serbian/errmsg.txt
@@ -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"
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index f699e811352..79174a65a36 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -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"
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index 0965d1ab3eb..cadc96e347d 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -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"
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index 7ea172996c6..afdf47549c0 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -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"
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index 8b981351d8b..7ca891988b6 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -255,4 +255,5 @@
"Every derived table must have it's own alias"
"Select %u was скасовано при оптимiзацii",
"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"
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 699818b19fd..a8428d4f3da 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -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)