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
500192ae
Commit
500192ae
authored
Dec 12, 2003
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge vvagin@bk-internal.mysql.com:/home/bk/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_2023/mysql-4.0
parents
b4f34fdd
5eb8fa9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
mysql-test/r/type_enum.result
mysql-test/r/type_enum.result
+10
-0
mysql-test/t/type_enum.test
mysql-test/t/type_enum.test
+11
-0
sql/field.cc
sql/field.cc
+2
-2
No files found.
mysql-test/r/type_enum.result
View file @
500192ae
...
...
@@ -1636,3 +1636,13 @@ t1 CREATE TABLE `t1` (
`a` enum('','a','b') NOT NULL default 'b'
) TYPE=MyISAM
drop table t1;
create table t1 (a enum ('0','1'));
insert into t1 set a='foobar';
select * from t1;
a
update t1 set a = replace(a,'x','y');
select * from t1;
a
drop table t1;
mysql-test/t/type_enum.test
View file @
500192ae
...
...
@@ -21,3 +21,14 @@ drop table t1;
create
table
t1
(
a
enum
(
' '
,
'a'
,
'b '
)
not
null
default
'b '
);
show
create
table
t1
;
drop
table
t1
;
#
# Tests of wrong enum values (bug #2023)
#
create
table
t1
(
a
enum
(
'0'
,
'1'
));
insert
into
t1
set
a
=
'foobar'
;
select
*
from
t1
;
update
t1
set
a
=
replace
(
a
,
'x'
,
'y'
);
select
*
from
t1
;
drop
table
t1
;
\ No newline at end of file
sql/field.cc
View file @
500192ae
...
...
@@ -4623,7 +4623,7 @@ void Field_enum::store(const char *from,uint length)
uint
tmp
=
find_enum
(
typelib
,
from
,
length
);
if
(
!
tmp
)
{
if
(
length
<
6
)
// Can't be more than 99999 enums
if
(
length
<
6
)
// Can't be more than 99999 enums
{
/* This is for reading numbers with LOAD DATA INFILE */
char
buff
[
7
],
*
end
;
...
...
@@ -4721,7 +4721,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
{
uint
tmp
=
(
uint
)
Field_enum
::
val_int
();
if
(
!
tmp
||
tmp
>
typelib
->
count
)
val_ptr
->
length
(
0
);
val_ptr
->
set
((
char
*
)
""
,
0
);
else
val_ptr
->
set
((
const
char
*
)
typelib
->
type_names
[
tmp
-
1
],
(
uint
)
strlen
(
typelib
->
type_names
[
tmp
-
1
]));
...
...
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