1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Check for empty table/column names

This commit is contained in:
monty@mashka.mysql.fi
2003-03-14 17:08:42 +02:00
parent 6c81552dd3
commit 5ee1dbbe58
6 changed files with 35 additions and 10 deletions

View File

@ -244,6 +244,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)
@ -688,13 +693,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=create_tmp_field(&tmp_table,item,item->type(),
(Item_result_field***) 0, &tmp_field,0,0);
if (!field ||