diff options
-rw-r--r-- | sql/item.h | 7 | ||||
-rw-r--r-- | sql/sql_type.h | 6 |
2 files changed, 3 insertions, 10 deletions
diff --git a/sql/item.h b/sql/item.h index a8e0e94c07b..d3b1189f80f 100644 --- a/sql/item.h +++ b/sql/item.h @@ -96,13 +96,6 @@ enum precedence { typedef Bounds_checked_array<Item*> Ref_ptr_array; -static inline uint32 -char_to_byte_length_safe(size_t char_length_arg, uint32 mbmaxlen_arg) -{ - ulonglong tmp= ((ulonglong) char_length_arg) * mbmaxlen_arg; - return tmp > UINT_MAX32 ? UINT_MAX32 : static_cast<uint32>(tmp); -} - bool mark_unsupported_function(const char *where, void *store, uint result); /* convenience helper for mark_unsupported_function() above */ diff --git a/sql/sql_type.h b/sql/sql_type.h index bc8b170c166..74ab47f637e 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -184,10 +184,10 @@ public: static inline uint32 -char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg) +char_to_byte_length_safe(size_t char_length_arg, uint32 mbmaxlen_arg) { - ulonglong tmp= ((ulonglong) char_length_arg) * mbmaxlen_arg; - return (tmp > UINT_MAX32) ? (uint32) UINT_MAX32 : (uint32) tmp; + ulonglong tmp= ((ulonglong) char_length_arg) * mbmaxlen_arg; + return tmp > UINT_MAX32 ? UINT_MAX32 : static_cast<uint32>(tmp); } /** |