summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2003-10-16 11:33:44 -0400
committerunknown <vva@eagle.mysql.r18.ru>2003-10-16 11:33:44 -0400
commitff50211da5efe976c6d356d6e9642c5f10c2f928 (patch)
tree29d88a3efe7384330568f6370cd931e9f73e1adc /sql
parente83a7c2cf7b95247e639d9dc5318edfa91416e79 (diff)
downloadmariadb-git-ff50211da5efe976c6d356d6e9642c5f10c2f928.tar.gz
added checking for empty index name (fixed bug #1419)
include/mysqld_error.h: added error "Incorrect index name" mysql-test/r/create.result: added test for empty index name mysql-test/t/create.test: added test for empty index name sql/share/czech/errmsg.txt: added error "Incorrect index name" sql/share/danish/errmsg.txt: added error "Incorrect index name" sql/share/dutch/errmsg.txt: added error "Incorrect index name" sql/share/english/errmsg.txt: added error "Incorrect index name" sql/share/estonian/errmsg.txt: added error "Incorrect index name" sql/share/french/errmsg.txt: added error "Incorrect index name" sql/share/german/errmsg.txt: added error "Incorrect index name" sql/share/greek/errmsg.txt: added error "Incorrect index name" sql/share/hungarian/errmsg.txt: added error "Incorrect index name" sql/share/italian/errmsg.txt: added error "Incorrect index name" sql/share/japanese/errmsg.txt: added error "Incorrect index name" sql/share/korean/errmsg.txt: added error "Incorrect index name" sql/share/norwegian-ny/errmsg.txt: added error "Incorrect index name" sql/share/norwegian/errmsg.txt: added error "Incorrect index name" sql/share/polish/errmsg.txt: added error "Incorrect index name" sql/share/portuguese/errmsg.txt: added error "Incorrect index name" sql/share/romanian/errmsg.txt: added error "Incorrect index name" sql/share/russian/errmsg.txt: added error "Incorrect index name" sql/share/serbian/errmsg.txt: added error "Incorrect index name" sql/share/slovak/errmsg.txt: added error "Incorrect index name" sql/share/spanish/errmsg.txt: added error "Incorrect index name" sql/share/swedish/errmsg.txt: added error "Incorrect index name" sql/share/ukrainian/errmsg.txt: added error "Incorrect index name" sql/sql_table.cc: added checking for wrong index name
Diffstat (limited to 'sql')
-rw-r--r--sql/share/czech/errmsg.txt1
-rw-r--r--sql/share/danish/errmsg.txt1
-rw-r--r--sql/share/dutch/errmsg.txt1
-rw-r--r--sql/share/english/errmsg.txt1
-rw-r--r--sql/share/estonian/errmsg.txt1
-rw-r--r--sql/share/french/errmsg.txt1
-rw-r--r--sql/share/german/errmsg.txt1
-rw-r--r--sql/share/greek/errmsg.txt1
-rw-r--r--sql/share/hungarian/errmsg.txt1
-rw-r--r--sql/share/italian/errmsg.txt1
-rw-r--r--sql/share/japanese/errmsg.txt1
-rw-r--r--sql/share/korean/errmsg.txt1
-rw-r--r--sql/share/norwegian-ny/errmsg.txt1
-rw-r--r--sql/share/norwegian/errmsg.txt1
-rw-r--r--sql/share/polish/errmsg.txt1
-rw-r--r--sql/share/portuguese/errmsg.txt1
-rw-r--r--sql/share/romanian/errmsg.txt1
-rw-r--r--sql/share/russian/errmsg.txt1
-rw-r--r--sql/share/serbian/errmsg.txt1
-rw-r--r--sql/share/slovak/errmsg.txt1
-rw-r--r--sql/share/spanish/errmsg.txt1
-rw-r--r--sql/share/swedish/errmsg.txt1
-rw-r--r--sql/share/ukrainian/errmsg.txt1
-rw-r--r--sql/sql_table.cc5
24 files changed, 28 insertions, 0 deletions
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index e7cc54746b5..bb7cd90b4c4 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -291,3 +291,4 @@ character-set=latin2
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index 379865a775b..48a4fee22f8 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -285,3 +285,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index ffe76be0d42..98fb9278cc2 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -293,3 +293,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index c352b143ef1..9a266c41669 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -282,3 +282,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index 657c5a24539..e596863907f 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -287,3 +287,4 @@ character-set=latin7
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index ab7936aff48..a81b8859692 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -282,3 +282,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index f50169251f7..9554822a5ff 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -294,3 +294,4 @@ character-set=latin1
"Falscher Parameter oder falsche Kombination von Parametern für START SLAVE UNTIL",
"Es wird empfohlen, mit --skip-slave-start zu starten, wenn mit START SLAVE UNTIL eine Schritt-für-Schritt-Replikation ausgeführt wird. Ansonsten gibt es Probleme, wenn der Slave-Server unerwartet neu startet",
"SQL-Thread soll nicht gestartet werden. Daher werden UNTIL-Optionen ignoriert"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index 93f78bf2a93..073289562b3 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -282,3 +282,4 @@ character-set=greek
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index f12fbbc938b..c62a7c7b1ae 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -284,3 +284,4 @@ character-set=latin2
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index 8d44a83ed3b..004d7d00994 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -282,3 +282,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index dcd3db0d7a9..888ac449a8b 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -284,3 +284,4 @@ character-set=ujis
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index 363d81e4dea..a72d6c3fdee 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -282,3 +282,4 @@ character-set=euckr
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index e2427327c77..3c6dca27016 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -284,3 +284,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index 7083bd80085..bafc635a184 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -284,3 +284,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index f770b2e3030..0aa25aabb44 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -286,3 +286,4 @@ character-set=latin2
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index 3c265349cdf..33d8f68291d 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -283,3 +283,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index c1c495d39c3..ff46caf2c6c 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -286,3 +286,4 @@ character-set=latin2
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index 572d515453a..f8bdb8bf4a5 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -284,3 +284,4 @@ character-set=koi8r
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt
index a81b5f56838..cede04e36ed 100644
--- a/sql/share/serbian/errmsg.txt
+++ b/sql/share/serbian/errmsg.txt
@@ -277,3 +277,4 @@ character-set=cp1250
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index 6ca9bcecf1c..0759f68a1bb 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -290,3 +290,4 @@ character-set=latin2
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index 62d32757719..b9c1b297e43 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -284,3 +284,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index f06a760bb24..456b93fbc4d 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -282,3 +282,4 @@ character-set=latin1
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index 675e9899d58..dba62fd60c8 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -287,3 +287,4 @@ character-set=koi8u
"Wrong parameter or combination of parameters for START SLAVE UNTIL"
"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart"
"SQL thread is not to be started so UNTIL options are ignored"
+"Incorrect index name '%-.100s'",
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 5417a1b0368..3d07c7e04de 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -861,6 +861,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
key_info->name=(char*) key_name;
}
}
+ if (!key_info->name || check_column_name(key_info->name))
+ {
+ my_error(ER_WRONG_INDEX_NAME, MYF(0), key_info->name);
+ DBUG_RETURN(-1);
+ }
if (!(key_info->flags & HA_NULL_PART_KEY))
unique_key=1;
key_info->key_length=(uint16) key_length;