Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f5c4d92d
Commit
f5c4d92d
authored
Jan 14, 2007
by
joerg@trift2
Browse files
Options
Browse Files
Download
Plain Diff
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/tmp-5.1
parents
16d53afc
90a80926
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
33 deletions
+89
-33
mysql-test/r/type_enum.result
mysql-test/r/type_enum.result
+26
-0
mysql-test/t/type_enum.test
mysql-test/t/type_enum.test
+23
-1
sql/table.cc
sql/table.cc
+0
-11
sql/unireg.cc
sql/unireg.cc
+40
-21
No files found.
mysql-test/r/type_enum.result
View file @
f5c4d92d
...
@@ -1754,3 +1754,29 @@ t1 CREATE TABLE `t1` (
...
@@ -1754,3 +1754,29 @@ t1 CREATE TABLE `t1` (
`f2` enum('') DEFAULT NULL
`f2` enum('') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table t1;
End of 4.1 tests
create table t1(russian enum('E','F','EF','FE') NOT NULL DEFAULT'E');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`russian` enum('E','F','EF','FE') 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','EF','F,E') NOT NULL DEFAULT'E');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`russian_deviant` enum('E','F','EF','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\','zz'));
ERROR 42000: Field separator argument is not what is expected; check the manual
End of 5.1 tests
...
...
mysql-test/t/type_enum.test
View file @
f5c4d92d
...
@@ -136,4 +136,26 @@ alter table t1 add f2 enum(0xFFFF);
...
@@ -136,4 +136,26 @@ 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
--
echo
End
of
4.1
tests
#
# Bug#24660 "enum" field type definition problem
#
create
table
t1
(
russian
enum
(
'E'
,
'F'
,
'EF'
,
'FE'
)
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'
,
'EF'
,
'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\','
zz
'
));
--
echo
End
of
5.1
tests
...
...
sql/table.cc
View file @
f5c4d92d
...
@@ -803,17 +803,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
...
@@ -803,17 +803,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
{
{
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
;
}
}
...
...
sql/unireg.cc
View file @
f5c4d92d
...
@@ -788,27 +788,46 @@ static bool pack_fields(File file, List<create_field> &create_fields,
...
@@ -788,27 +788,46 @@ 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
;
bzero
(
occ
,
sizeof
(
occ
));
for
(
i
=
0
;
(
val
=
(
unsigned
char
*
)
field
->
interval
->
type_names
[
i
]);
i
++
)
for
(
uint
j
=
0
;
j
<
field
->
interval
->
type_lengths
[
i
];
j
++
)
occ
[(
unsigned
int
)
(
val
[
j
])]
=
1
;
if
(
!
occ
[(
unsigned
char
)
NAMES_SEP_CHAR
])
sep
=
(
unsigned
char
)
NAMES_SEP_CHAR
;
else
if
(
!
occ
[(
unsigned
int
)
','
])
sep
=
','
;
else
{
{
char
*
val
=
(
char
*
)
*
pos
;
for
(
uint
i
=
1
;
i
<
256
;
i
++
)
uint
str_len
=
strlen
(
val
);
/*
Note, hack: in old frm NAMES_SEP_CHAR is used to separate
names in the interval (ENUM/SET). To allow names to contain
NAMES_SEP_CHAR, we replace it with a comma before writing frm.
Backward conversion is done during frm file opening,
See table.cc, openfrm() function
*/
for
(
uint
cnt
=
0
;
cnt
<
str_len
;
cnt
++
)
{
{
char
c
=
val
[
cnt
];
if
(
!
occ
[
i
])
if
(
c
==
NAMES_SEP_CHAR
)
{
val
[
cnt
]
=
','
;
sep
=
i
;
break
;
}
}
}
if
(
!
sep
)
/* disaster, enum uses all characters, none left as separator */
{
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
(
*
pos
);
tmp
.
append
(
NAMES_SEP_CHAR
);
tmp
.
append
(
sep
);
}
}
tmp
.
append
(
'\0'
);
// End of intervall
tmp
.
append
(
'\0'
);
// End of intervall
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment