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

BUG#18750: Various problems with partition names, quotation marks

mysql-test/r/partition.result:
  Added new test cases
mysql-test/t/partition.test:
  Added new test cases
sql/partition_info.cc:
  Check partition names that they don't have trailing spaces
sql/share/errmsg.txt:
  Added error code for wrong partition names
sql/sql_partition.cc:
  New method to add partition name strings, ignore OPTION_SHOW_QUOTE_CREATE
sql/sql_show.cc:
  require_quotes had a bug with identifiers that consisted of only digits,
  these are allowed identifiers but must be quoted and require_quote didn't
  tell this.
sql/sql_yacc.yy:
  Partition names should identifers and not ident_or_text
This commit is contained in:
unknown
2006-04-10 13:48:58 -04:00
parent a514095a5d
commit 42d7e8c087
7 changed files with 79 additions and 3 deletions

View File

@ -1614,6 +1614,21 @@ static int add_key_partition(File fptr, List<char> field_list)
return err;
}
static int add_name_string(File fptr, const char *name)
{
int err;
String name_string("", 0, system_charset_info);
THD *thd= current_thd;
ulonglong save_options= thd->options;
thd->options= 0;
append_identifier(thd, &name_string, name,
strlen(name));
thd->options= save_options;
err= add_string_object(fptr, &name_string);
return err;
}
static int add_int(File fptr, longlong number)
{
llstr(number, buff);
@ -1912,7 +1927,7 @@ char *generate_partition_syntax(partition_info *part_info,
part_info->part_state_len= part_state_id+1;
}
err+= add_partition(fptr);
err+= add_string(fptr, part_elem->partition_name);
err+= add_name_string(fptr, part_elem->partition_name);
err+= add_space(fptr);
err+= add_partition_values(fptr, part_info, part_elem);
if (!part_info->is_sub_partitioned())
@ -1928,7 +1943,7 @@ char *generate_partition_syntax(partition_info *part_info,
{
part_elem= sub_it++;
err+= add_subpartition(fptr);
err+= add_string(fptr, part_elem->partition_name);
err+= add_name_string(fptr, part_elem->partition_name);
err+= add_space(fptr);
err+= add_partition_options(fptr, part_elem);
if (j != (no_subparts-1))