summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/field.h b/sql/field.h
index 061232ea1ef..bf115b38816 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -4071,15 +4071,16 @@ public:
}
void create_length_to_internal_length_simple()
{
- key_length= pack_length= type_handler()->calc_pack_length(length);
+ key_length= pack_length= type_handler()->calc_pack_length((uint32) length);
}
void create_length_to_internal_length_string()
{
length*= charset->mbmaxlen;
if (real_field_type() == MYSQL_TYPE_VARCHAR && compression_method())
length++;
- key_length= length;
- pack_length= type_handler()->calc_pack_length(length);
+ DBUG_ASSERT(length <= UINT_MAX32);
+ key_length= (uint) length;
+ pack_length= type_handler()->calc_pack_length((uint32) length);
}
void create_length_to_internal_length_typelib()
{