summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-03-15 04:41:57 +0200
committerunknown <monty@mashka.mysql.fi>2003-03-15 04:41:57 +0200
commit11117565a3682ea800d1b988775cd05ef78b4fb8 (patch)
tree872ca3e7569fe0db0147fd6f118af292b828ffc0 /sql/sql_table.cc
parent13a5a24c6170921bb97796d96ca9f0ac20e5308e (diff)
parentfcf035a0d85bc49c8c071246ce22a19f2fea395b (diff)
downloadmariadb-git-11117565a3682ea800d1b988775cd05ef78b4fb8.tar.gz
merge with 3.23 to get:
- Fix for empty table/column names mysql-test/t/create.test: Auto merged sql/sql_parse.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/table.cc: Auto merged tests/grant.pl: Auto merged sql/filesort.cc: merge with 3.23 sql/sql_table.cc: merge with 3.23 tests/grant.res: merge with 3.23
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index adaedebfa28..0cdb0a7ff48 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -394,6 +394,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
}
if (!(sql_field->flags & NOT_NULL_FLAG))
null_fields++;
+ if (check_column_name(sql_field->field_name))
+ {
+ my_error(ER_WRONG_COLUMN_NAME, MYF(0), sql_field->field_name);
+ DBUG_RETURN(-1);
+ }
while ((dup_field=it2++) != sql_field)
{
if (my_strcasecmp(sql_field->field_name, dup_field->field_name) == 0)
@@ -830,12 +835,6 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
while ((item=it++))
{
create_field *cr_field;
- if (strlen(item->name) > NAME_LEN ||
- check_column_name(item->name))
- {
- my_error(ER_WRONG_COLUMN_NAME,MYF(0),item->name);
- DBUG_RETURN(0);
- }
Field *field;
if (item->type() == Item::FUNC_ITEM)
field=item->tmp_table_field(&tmp_table);