summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-11-01 14:37:31 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-11-01 14:37:31 +0200
commit2ec7b870531d70f3c7686af2d6bc2c33e7c23bc7 (patch)
treee34961a67eca9e9de984784f6d60961568cbbb7e /sql
parent003cb2f42477772ae43228c0bc0f8492246b9340 (diff)
parent6b7918d524d5fc1f63f520cf88784fef13a43c25 (diff)
downloadmariadb-git-2ec7b870531d70f3c7686af2d6bc2c33e7c23bc7.tar.gz
Merge 10.2 into bb-10.2-ext
Diffstat (limited to 'sql')
-rw-r--r--sql/item_jsonfunc.cc4
-rw-r--r--sql/log_event.cc2
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/sys_vars.cc4
4 files changed, 10 insertions, 8 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index b30d32c36ac..ddc1da5b6d2 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -1353,6 +1353,8 @@ longlong Item_func_json_contains_path::val_int()
bzero(p_found, (arg_count-2) * sizeof(bool));
n_found= arg_count - 2;
}
+ else
+ n_found= 0; /* Jost to prevent 'uninitialized value' warnings */
result= 0;
while (json_get_path_next(&je, &p) == 0)
@@ -2059,7 +2061,7 @@ String *Item_func_json_merge::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
json_engine_t je1, je2;
- String *js1= args[0]->val_json(&tmp_js1), *js2;
+ String *js1= args[0]->val_json(&tmp_js1), *js2=NULL;
uint n_arg;
LINT_INIT(js2);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d1cfb4fe814..ebcfe98521a 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -8675,7 +8675,7 @@ User_var_log_event(const char* buf, uint event_len,
Old events will not have this extra byte, thence,
we keep the flags set to UNDEF_F.
*/
- uint bytes_read= (uint)((val + val_len) - buf_start);
+ size_t bytes_read= ((val + val_len) - buf_start);
if ((data_written - bytes_read) > 0)
{
flags= (uint) *(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 218594b82b4..ab48ec99ad6 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -2157,15 +2157,15 @@ static void mysqld_exit(int exit_code)
shutdown_performance_schema(); // we do it as late as possible
#endif
set_malloc_size_cb(NULL);
- if (!opt_debugging && !my_disable_leak_check)
+ if (opt_endinfo && global_status_var.global_memory_used)
+ fprintf(stderr, "Warning: Memory not freed: %ld\n",
+ (long) global_status_var.global_memory_used);
+ if (!opt_debugging && !my_disable_leak_check && exit_code == 0)
{
DBUG_ASSERT(global_status_var.global_memory_used == 0);
}
cleanup_tls();
DBUG_LEAVE;
- if (opt_endinfo && global_status_var.global_memory_used)
- fprintf(stderr, "Warning: Memory not freed: %ld\n",
- (long) global_status_var.global_memory_used);
sd_notify(0, "STATUS=MariaDB server is down");
exit(exit_code); /* purecov: inspected */
}
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index a2df923b2ad..d8bf044f53b 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1255,8 +1255,8 @@ static bool update_cached_long_query_time(sys_var *self, THD *thd,
static Sys_var_double Sys_long_query_time(
"long_query_time",
"Log all queries that have taken more than long_query_time seconds "
- "to execute to file. The argument will be treated as a decimal value "
- "with microsecond precision",
+ "to execute to the slow query log file. The argument will be treated "
+ "as a decimal value with microsecond precision",
SESSION_VAR(long_query_time_double),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(10),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),