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
00d339c4
Commit
00d339c4
authored
Dec 12, 2003
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added checking for old cuted value in Field_enum::store
(bug #2023)
parent
fddab846
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
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
+1
-1
No files found.
mysql-test/r/type_enum.result
View file @
00d339c4
...
@@ -1636,3 +1636,13 @@ t1 CREATE TABLE `t1` (
...
@@ -1636,3 +1636,13 @@ t1 CREATE TABLE `t1` (
`a` enum('','a','b') NOT NULL default 'b'
`a` enum('','a','b') NOT NULL default 'b'
) TYPE=MyISAM
) TYPE=MyISAM
drop table t1;
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 @
00d339c4
...
@@ -21,3 +21,14 @@ drop table t1;
...
@@ -21,3 +21,14 @@ drop table t1;
create
table
t1
(
a
enum
(
' '
,
'a'
,
'b '
)
not
null
default
'b '
);
create
table
t1
(
a
enum
(
' '
,
'a'
,
'b '
)
not
null
default
'b '
);
show
create
table
t1
;
show
create
table
t1
;
drop
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 @
00d339c4
...
@@ -4623,7 +4623,7 @@ void Field_enum::store(const char *from,uint length)
...
@@ -4623,7 +4623,7 @@ void Field_enum::store(const char *from,uint length)
uint
tmp
=
find_enum
(
typelib
,
from
,
length
);
uint
tmp
=
find_enum
(
typelib
,
from
,
length
);
if
(
!
tmp
)
if
(
!
tmp
)
{
{
if
(
length
<
6
)
// Can't be more than 99999 enums
if
(
from
&&
length
<
6
)
// Can't be more than 99999 enums
{
{
/* This is for reading numbers with LOAD DATA INFILE */
/* This is for reading numbers with LOAD DATA INFILE */
char
buff
[
7
],
*
end
;
char
buff
[
7
],
*
end
;
...
...
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