1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

added checking for old cuted value in Field_enum::store

(bug #2023)


mysql-test/r/type_enum.result:
  added tests for wrong enum values (bug #2023)
mysql-test/t/type_enum.test:
  added tests for wrong enum values (bug #2023)
This commit is contained in:
unknown
2003-12-12 21:26:44 -04:00
parent 22c12eaeb2
commit 51c54cd774
3 changed files with 22 additions and 1 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 (from && length < 6) // Can't be more than 99999 enums
{
/* This is for reading numbers with LOAD DATA INFILE */
char buff[7], *end;