summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-07-31 22:59:58 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-07-31 22:59:58 +0200
commit7841a7eb09208f52fcbab7e80e38c7ca29b1339e (patch)
tree7f9c4d80d3b86a33c54ff0090865ada4d4ed577d /sql/item_func.cc
parent77992bc710bbc16798c12da7081769817f87791a (diff)
parent1423cf5e3dcb3c50047f086a5933fe77006cf242 (diff)
downloadmariadb-git-7841a7eb09208f52fcbab7e80e38c7ca29b1339e.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index d50fb22a154..d73782dd94e 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -5726,7 +5726,7 @@ void Item_func_get_system_var::update_null_value()
bool Item_func_get_system_var::fix_length_and_dec()
{
- char *cptr;
+ const char *cptr;
maybe_null= TRUE;
max_length= 0;
@@ -5760,9 +5760,12 @@ bool Item_func_get_system_var::fix_length_and_dec()
case SHOW_CHAR:
case SHOW_CHAR_PTR:
mysql_mutex_lock(&LOCK_global_system_variables);
- cptr= var->show_type() == SHOW_CHAR ?
- (char*) var->value_ptr(current_thd, var_type, &component) :
- *(char**) var->value_ptr(current_thd, var_type, &component);
+ cptr= var->show_type() == SHOW_CHAR ?
+ reinterpret_cast<const char*>(var->value_ptr(current_thd, var_type,
+ &component)) :
+ *reinterpret_cast<const char* const*>(var->value_ptr(current_thd,
+ var_type,
+ &component));
if (cptr)
max_length= (uint32)system_charset_info->cset->numchars(system_charset_info,
cptr,
@@ -5775,7 +5778,10 @@ bool Item_func_get_system_var::fix_length_and_dec()
case SHOW_LEX_STRING:
{
mysql_mutex_lock(&LOCK_global_system_variables);
- LEX_STRING *ls= ((LEX_STRING*)var->value_ptr(current_thd, var_type, &component));
+ const LEX_STRING *ls=
+ reinterpret_cast<const LEX_STRING*>(var->value_ptr(current_thd,
+ var_type,
+ &component));
max_length= (uint32)system_charset_info->cset->numchars(system_charset_info,
ls->str,
ls->str + ls->length);