mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/home/tnurnberg/24660/41-24660
into mysql.com:/home/tnurnberg/24660/50-24660
This commit is contained in:
@ -1754,3 +1754,28 @@ t1 CREATE TABLE `t1` (
|
|||||||
`f2` enum('<27><>') default NULL
|
`f2` enum('<27><>') default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1(russian enum('E','F','E<>F','F<>E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`russian` enum('E','F','E<>F','F<>E') NOT NULL default 'E'
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`denormal` enum('E','F','E,F','F,E') NOT NULL default 'E'
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1(russian_deviant enum('E','F','E<>F','F,E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`russian_deviant` enum('E','F','E<>F','F,E') NOT NULL default 'E'
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
|
||||||
|
|
||||||
|
!"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\<5C>','zz<7A><7A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
|
||||||
|
ERROR 42000: Field separator argument is not what is expected; check the manual
|
||||||
|
@ -136,4 +136,24 @@ alter table t1 add f2 enum(0xFFFF);
|
|||||||
show create table t1;
|
show create table t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
#
|
||||||
|
# Bug#24660 "enum" field type definition problem
|
||||||
|
#
|
||||||
|
create table t1(russian enum('E','F','E<>F','F<>E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
create table t1(russian_deviant enum('E','F','E<>F','F,E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
# ER_WRONG_FIELD_TERMINATORS
|
||||||
|
--error 1083
|
||||||
|
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
|
||||||
|
|
||||||
|
!"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\<5C>','zz<7A><7A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
|
||||||
|
|
||||||
|
11
sql/table.cc
11
sql/table.cc
@ -471,17 +471,6 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
|
|||||||
{
|
{
|
||||||
char *val= (char*) interval->type_names[count];
|
char *val= (char*) interval->type_names[count];
|
||||||
interval->type_lengths[count]= strlen(val);
|
interval->type_lengths[count]= strlen(val);
|
||||||
/*
|
|
||||||
Replace all ',' symbols with NAMES_SEP_CHAR.
|
|
||||||
See the comment in unireg.cc, pack_fields() function
|
|
||||||
for details.
|
|
||||||
*/
|
|
||||||
for (uint cnt= 0 ; cnt < interval->type_lengths[count] ; cnt++)
|
|
||||||
{
|
|
||||||
char c= val[cnt];
|
|
||||||
if (c == ',')
|
|
||||||
val[cnt]= NAMES_SEP_CHAR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
interval->type_lengths[count]= 0;
|
interval->type_lengths[count]= 0;
|
||||||
}
|
}
|
||||||
|
@ -714,29 +714,48 @@ static bool pack_fields(File file, List<create_field> &create_fields,
|
|||||||
{
|
{
|
||||||
if (field->interval_id > int_count)
|
if (field->interval_id > int_count)
|
||||||
{
|
{
|
||||||
int_count=field->interval_id;
|
unsigned char sep= 0;
|
||||||
tmp.append(NAMES_SEP_CHAR);
|
unsigned char occ[256];
|
||||||
for (const char **pos=field->interval->type_names ; *pos ; pos++)
|
uint i;
|
||||||
{
|
unsigned char *val= NULL;
|
||||||
char *val= (char*) *pos;
|
|
||||||
uint str_len= strlen(val);
|
bzero(occ, sizeof(occ));
|
||||||
/*
|
|
||||||
Note, hack: in old frm NAMES_SEP_CHAR is used to separate
|
for (i=0; (val= (unsigned char*) field->interval->type_names[i]); i++)
|
||||||
names in the interval (ENUM/SET). To allow names to contain
|
for (uint j = 0; j < field->interval->type_lengths[i]; j++)
|
||||||
NAMES_SEP_CHAR, we replace it with a comma before writing frm.
|
occ[(unsigned int) (val[j])]= 1;
|
||||||
Backward conversion is done during frm file opening,
|
|
||||||
See table.cc, openfrm() function
|
if (!occ[(unsigned char)NAMES_SEP_CHAR])
|
||||||
*/
|
sep= (unsigned char) NAMES_SEP_CHAR;
|
||||||
for (uint cnt= 0 ; cnt < str_len ; cnt++)
|
else if (!occ[(unsigned int)','])
|
||||||
|
sep= ',';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (uint i=1; i<256; i++)
|
||||||
{
|
{
|
||||||
char c= val[cnt];
|
if(!occ[i])
|
||||||
if (c == NAMES_SEP_CHAR)
|
{
|
||||||
val[cnt]= ',';
|
sep= i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tmp.append(*pos);
|
|
||||||
tmp.append(NAMES_SEP_CHAR);
|
if(!sep) /* disaster, enum uses all characters, none left as separator */
|
||||||
}
|
{
|
||||||
tmp.append('\0'); // End of intervall
|
my_message(ER_WRONG_FIELD_TERMINATORS,ER(ER_WRONG_FIELD_TERMINATORS),
|
||||||
|
MYF(0));
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int_count= field->interval_id;
|
||||||
|
tmp.append(sep);
|
||||||
|
for (const char **pos=field->interval->type_names ; *pos ; pos++)
|
||||||
|
{
|
||||||
|
tmp.append(*pos);
|
||||||
|
tmp.append(sep);
|
||||||
|
}
|
||||||
|
tmp.append('\0'); // End of intervall
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (my_write(file,(byte*) tmp.ptr(),tmp.length(),MYF_RW))
|
if (my_write(file,(byte*) tmp.ptr(),tmp.length(),MYF_RW))
|
||||||
|
Reference in New Issue
Block a user