summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/item.h b/sql/item.h
index 27fb716e0c9..67640ce5f4d 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2,7 +2,7 @@
#define SQL_ITEM_INCLUDED
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -97,10 +97,10 @@ enum precedence {
typedef Bounds_checked_array<Item*> Ref_ptr_array;
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);
}
bool mark_unsupported_function(const char *where, void *store, uint result);
@@ -523,7 +523,7 @@ class Copy_query_with_rewrite
bool copy_up_to(size_t bytes)
{
DBUG_ASSERT(bytes >= from);
- return dst->append(src + from, bytes - from);
+ return dst->append(src + from, uint32(bytes - from));
}
public:
@@ -1835,7 +1835,7 @@ public:
max_length= char_to_byte_length_safe(max_char_length_arg, cs->mbmaxlen);
collation.collation= cs;
}
- void fix_char_length(uint32 max_char_length_arg)
+ void fix_char_length(size_t max_char_length_arg)
{
max_length= char_to_byte_length_safe(max_char_length_arg,
collation.collation->mbmaxlen);