mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
BUG#18752: Also handle NULL values in VALUES LESS THAN
mysql-test/r/partition.result: Added test case to verify that VALUES LESS THAN (NULL) isn't allowed mysql-test/t/partition.test: Added test case to verify that VALUES LESS THAN (NULL) isn't allowed sql/share/errmsg.txt: Added new error message sql/sql_yacc.yy: Added error check for null value
This commit is contained in:
parent
41fa40e8c2
commit
79002cd02e
4 changed files with 17 additions and 0 deletions
|
@ -848,4 +848,8 @@ 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
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -965,4 +965,9 @@ 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));
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
|
|
@ -5826,3 +5826,6 @@ 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"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in a new issue