diff options
author | unknown <elliot@mysql.com> | 2006-04-28 12:15:29 -0400 |
---|---|---|
committer | unknown <elliot@mysql.com> | 2006-04-28 12:15:29 -0400 |
commit | dd68976a249cf73d6bf67faa37108438b26e800c (patch) | |
tree | a1a6f77b937a2fd005b4ab4083ce3d0757c2f12e /mysql-test/r/null.result | |
parent | e92e1dace7529271a401273bdf265adf863b6c77 (diff) | |
download | mariadb-git-dd68976a249cf73d6bf67faa37108438b26e800c.tar.gz |
BUG#19145: mysqld crashes if you set the default value of an enum field to NULL
Now test for NULLness the pointers returned from objects created from the
default value. Pushing patch on behalf of cmiller.
mysql-test/r/null.result:
Add test case
mysql-test/t/null.test:
Add test case
sql/sql_table.cc:
No longer blindly dereference pointer of the string representation of the
values, where "NULL" is NUL. Raise INVALID DEFAULT error messages where
appropriate.
Note that the -O1 optimization flag made debugging this extremely tricky, with
misleading results, and that removing it from the Makefile during debugging can
be invaluable.
Diffstat (limited to 'mysql-test/r/null.result')
-rw-r--r-- | mysql-test/r/null.result | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 3e233eb512a..4d90aac0e68 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -269,3 +269,45 @@ field('str1', null, 'STR1') as c05, c01 c02 c03 c04 c05 c08 c09 str str 0 1 2 1 1 set names latin1; +create table bug19145a (e enum('a','b','c') default 'b' , s set('x', 'y', 'z') default 'y' ) engine=MyISAM; +create table bug19145b (e enum('a','b','c') default null, s set('x', 'y', 'z') default null) engine=MyISAM; +create table bug19145c (e enum('a','b','c') not null default 'b' , s set('x', 'y', 'z') not null default 'y' ) engine=MyISAM; +create table bug19145setnotnulldefaultnull (e enum('a','b','c') default null, s set('x', 'y', 'z') not null default null) engine=MyISAM; +ERROR 42000: Invalid default value for 's' +create table bug19145enumnotnulldefaultnull (e enum('a','b','c') not null default null, s set('x', 'y', 'z') default null) engine=MyISAM; +ERROR 42000: Invalid default value for 'e' +alter table bug19145a alter column e set default null; +alter table bug19145a alter column s set default null; +alter table bug19145a add column (i int); +alter table bug19145b alter column e set default null; +alter table bug19145b alter column s set default null; +alter table bug19145b add column (i int); +alter table bug19145c alter column e set default null; +ERROR 42000: Invalid default value for 'e' +alter table bug19145c alter column s set default null; +ERROR 42000: Invalid default value for 's' +alter table bug19145c add column (i int); +show create table bug19145a; +Table Create Table +bug19145a CREATE TABLE `bug19145a` ( + `e` enum('a','b','c') default NULL, + `s` set('x','y','z') default NULL, + `i` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create table bug19145b; +Table Create Table +bug19145b CREATE TABLE `bug19145b` ( + `e` enum('a','b','c') default NULL, + `s` set('x','y','z') default NULL, + `i` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create table bug19145c; +Table Create Table +bug19145c CREATE TABLE `bug19145c` ( + `e` enum('a','b','c') NOT NULL default 'b', + `s` set('x','y','z') NOT NULL default 'y', + `i` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table bug19145a; +drop table bug19145b; +drop table bug19145c; |