Skip to content

Commit e43156e

Browse files
author
Alexander Barkov
committed
Removing the duplicate copy of char_to_byte_length_safe().
It appeared during a merge from 10.2 to bb-10.2-ext.
1 parent a4a48a3 commit e43156e

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

sql/item.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ enum precedence {
9696

9797
typedef Bounds_checked_array<Item*> Ref_ptr_array;
9898

99-
static inline uint32
100-
char_to_byte_length_safe(size_t char_length_arg, uint32 mbmaxlen_arg)
101-
{
102-
ulonglong tmp= ((ulonglong) char_length_arg) * mbmaxlen_arg;
103-
return tmp > UINT_MAX32 ? UINT_MAX32 : static_cast<uint32>(tmp);
104-
}
105-
10699
bool mark_unsupported_function(const char *where, void *store, uint result);
107100

108101
/* convenience helper for mark_unsupported_function() above */

sql/sql_type.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ class DTCollation {
184184

185185

186186
static inline uint32
187-
char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg)
187+
char_to_byte_length_safe(size_t char_length_arg, uint32 mbmaxlen_arg)
188188
{
189-
ulonglong tmp= ((ulonglong) char_length_arg) * mbmaxlen_arg;
190-
return (tmp > UINT_MAX32) ? (uint32) UINT_MAX32 : (uint32) tmp;
189+
ulonglong tmp= ((ulonglong) char_length_arg) * mbmaxlen_arg;
190+
return tmp > UINT_MAX32 ? UINT_MAX32 : static_cast<uint32>(tmp);
191191
}
192192

193193
/**

0 commit comments

Comments
 (0)