diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index e5b1d443f56ff0d9dac3ea02c690b3d4a621bf00..4983ad1817eff87d0d2dda1a81977685150a52f6 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -839,6 +839,19 @@ SHOW TABLE STATUS; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 MyISAM 10 Dynamic 0 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned DROP TABLE t1; +CREATE TABLE t1 (a int) +PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (NULL)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (NULL) ENGINE = MyISAM) +DROP TABLE t1; +CREATE TABLE t1 (a int) +PARTITION BY RANGE(a) +(PARTITION p0 VALUES LESS THAN (NULL)); +ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '))' at line 3 create table t1 (a int) partition by list (a) (partition `s1 s2` values in (0)); @@ -865,6 +878,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (NULL) ENGINE = MyISAM) DROP TABLE t1; +>>>>>>> create table t1 (s1 int auto_increment primary key) partition by list (s1) (partition p1 values in (1), diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 536ab68a6949ad78000c41bcb924a5be9d4163e7..272cdc27af603c4d6c67ed17d9d004920be5b83a 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -989,6 +989,11 @@ PARTITION BY LIST (a) SHOW CREATE TABLE t1; DROP TABLE t1; +--error 1064 +CREATE TABLE t1 (a int) +PARTITION BY RANGE(a) +(PARTITION p0 VALUES LESS THAN (NULL)); + # # Bug#18753 Partitions: auto_increment fails # diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 0d3ba97f8e9e1482ff83295edcc2942e3cdb2c9a..5702464a80d0d7f2b9a872de9bcf28c77522dcd9 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5826,6 +5826,9 @@ ER_NDB_CANT_SWITCH_BINLOG_FORMAT eng "The NDB cluster engine does not support changing the binlog format on the fly yet" ER_PARTITION_NO_TEMPORARY eng "Cannot create temporary table with partitions" +ER_NULL_IN_VALUES_LESS_THAN + eng "Not allowed to use NULL value in VALUES LESS THAN" + swe "Det är inte tillåtet att använda NULL-värden i VALUES LESS THAN" ER_WRONG_PARTITION_NAME eng "Incorrect partition name" swe "Felaktigt partitionsnamn" diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index f570cbcd782c3e026fe1cc1f3984b806a87c5db8..2f91472ad2dd926fe5fbce714b620dc33d458c71 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3721,6 +3721,11 @@ part_func_max: yyerror(ER(ER_PARTITION_MAXVALUE_ERROR)); YYABORT; } + if (Lex->part_info->curr_part_elem->has_null_value) + { + yyerror(ER(ER_NULL_IN_VALUES_LESS_THAN)); + YYABORT; + } } ;