Skip to content

Commit fe3f9fa

Browse files
committed
MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8
1 parent 635c5e3 commit fe3f9fa

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

mysql-test/r/type_blob.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,3 +1063,19 @@ DROP TABLE t1;
10631063
#
10641064
# End of 5.5 tests
10651065
#
1066+
#
1067+
# Start of 10.2 test
1068+
#
1069+
#
1070+
# MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8
1071+
#
1072+
CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8);
1073+
SHOW CREATE TABLE t1;
1074+
Table Create Table
1075+
t1 CREATE TABLE `t1` (
1076+
`a` longtext CHARACTER SET utf8 DEFAULT NULL
1077+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1078+
DROP TABLE t1;
1079+
#
1080+
# End of 10.2 test
1081+
#

mysql-test/t/type_blob.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,3 +680,21 @@ DROP TABLE t1;
680680
--echo #
681681
--echo # End of 5.5 tests
682682
--echo #
683+
684+
685+
--echo #
686+
--echo # Start of 10.2 test
687+
--echo #
688+
689+
--echo #
690+
--echo # MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8
691+
--echo #
692+
693+
CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8);
694+
SHOW CREATE TABLE t1;
695+
DROP TABLE t1;
696+
697+
698+
--echo #
699+
--echo # End of 10.2 test
700+
--echo #

sql/field.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9777,7 +9777,7 @@ void Column_definition::create_length_to_internal_length(void)
97779777
case MYSQL_TYPE_STRING:
97789778
case MYSQL_TYPE_VARCHAR:
97799779
length*= charset->mbmaxlen;
9780-
DBUG_ASSERT(length <= UINT_MAX32);
9780+
set_if_smaller(length, UINT_MAX32);
97819781
key_length= (uint32)length;
97829782
pack_length= calc_pack_length(sql_type, key_length);
97839783
break;

0 commit comments

Comments
 (0)