MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8

This commit is contained in:
Alexander Barkov 2018-06-21 15:17:15 +04:00
parent 635c5e3281
commit fe3f9fa918
3 changed files with 35 additions and 1 deletions

View File

@ -1063,3 +1063,19 @@ DROP TABLE t1;
#
# End of 5.5 tests
#
#
# Start of 10.2 test
#
#
# MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8
#
CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` longtext CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# End of 10.2 test
#

View File

@ -680,3 +680,21 @@ DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # Start of 10.2 test
--echo #
--echo #
--echo # MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8
--echo #
CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8);
SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # End of 10.2 test
--echo #

View File

@ -9777,7 +9777,7 @@ void Column_definition::create_length_to_internal_length(void)
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_VARCHAR:
length*= charset->mbmaxlen;
DBUG_ASSERT(length <= UINT_MAX32);
set_if_smaller(length, UINT_MAX32);
key_length= (uint32)length;
pack_length= calc_pack_length(sql_type, key_length);
break;