summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2017-05-07 18:26:10 +0300
committerMonty <monty@mariadb.org>2017-05-08 02:33:35 +0300
commit1e04ad284c6ac0a9ce433f827bc6dbfbd6029007 (patch)
treeff59557c55b06495d93a3420e8aac09588a87a9d /sql
parent276b0c8ef03046cc210e4eeab7231cb8d9f16bac (diff)
downloadmariadb-git-1e04ad284c6ac0a9ce433f827bc6dbfbd6029007.tar.gz
Fixed compiler warnings and warnings from build.tags
Other things - Ensure that ut_d() is set to EXPR if ut_ad() is DEBUG_ASSERT() If not, we will get a crash in purge_sys_t::~purge_sys_t() as this ut_ad() code expect's that the ut_d() codes has been executed
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc3
-rw-r--r--sql/item_jsonfunc.cc2
-rw-r--r--sql/opt_range.cc2
-rw-r--r--sql/slave.cc3
-rw-r--r--sql/sql_admin.cc2
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sys_vars.ic2
-rw-r--r--sql/table.cc6
-rw-r--r--sql/wsrep_binlog.cc2
9 files changed, 16 insertions, 8 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 891a0c0f594..18c55d872db 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -479,7 +479,6 @@ void Item_bool_rowready_func2::fix_length_and_dec()
int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg,
Item **a1, Item **a2)
{
- THD *thd= current_thd;
owner= owner_arg;
set_null= set_null && owner_arg;
a= a1;
@@ -488,7 +487,7 @@ int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg,
Type_handler_hybrid_field_type tmp;
if (tmp.aggregate_for_comparison(owner_arg->func_name(), tmp_args, 2, false))
{
- DBUG_ASSERT(thd->is_error());
+ DBUG_ASSERT(current_thd->is_error());
return 1;
}
m_compare_handler= tmp.type_handler();
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index c7639bc2513..fd5b4a98e0e 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -1258,6 +1258,7 @@ longlong Item_func_json_contains_path::val_int()
longlong result;
json_path_t p;
int n_found;
+ LINT_INIT(n_found);
if ((null_value= args[0]->null_value))
return 0;
@@ -1985,6 +1986,7 @@ String *Item_func_json_merge::val_str(String *str)
json_engine_t je1, je2;
String *js1= args[0]->val_json(&tmp_js1), *js2;
uint n_arg;
+ LINT_INIT(js2);
if (args[0]->null_value)
goto null_return;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 87cb16c96fe..284f4348080 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -7501,6 +7501,8 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param,
param->current_table);
#ifdef HAVE_SPATIAL
Field::geometry_type sav_geom_type;
+ LINT_INIT(sav_geom_type);
+
if (field_item->field->type() == MYSQL_TYPE_GEOMETRY)
{
sav_geom_type= ((Field_geom*) field_item->field)->geom_type;
diff --git a/sql/slave.cc b/sql/slave.cc
index b28bc1d8dc5..b2cbac44c1b 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3728,8 +3728,7 @@ int
apply_event_and_update_pos_for_parallel(Log_event* ev, THD* thd,
rpl_group_info *rgi)
{
- Relay_log_info* rli= rgi->rli;
- mysql_mutex_assert_not_owner(&rli->data_lock);
+ mysql_mutex_assert_not_owner(&rgi->rli->data_lock);
int reason= apply_event_and_update_pos_setup(ev, thd, rgi);
/*
In parallel replication, sql_slave_skip_counter is handled in the SQL
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index f3ecee89a79..31933e63b4e 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -394,7 +394,9 @@ static bool open_only_one_table(THD* thd, TABLE_LIST* table,
open_and_lock_tables(thd, table, TRUE, 0));
}
+#ifndef DBUG_OFF
dbug_err:
+#endif
thd->prepare_derived_at_open= FALSE;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 813c74b60b2..2ad8c2d5562 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2193,7 +2193,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
bool trans_tmp_table_deleted= 0, non_trans_tmp_table_deleted= 0;
bool non_tmp_table_deleted= 0;
bool is_drop_tmp_if_exists_added= 0;
- bool was_view= 0, was_table, is_sequence;
+ bool was_view= 0, was_table= 0, is_sequence;
String built_query;
String built_trans_tmp_query, built_non_trans_tmp_query;
DBUG_ENTER("mysql_rm_table_no_locks");
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic
index a157538d528..f9acfb3b657 100644
--- a/sql/sys_vars.ic
+++ b/sql/sys_vars.ic
@@ -612,7 +612,9 @@ public:
/* parse and feel list with default values */
if (thd)
{
+#ifndef DBUG_OFF
bool res=
+#endif
sysvartrack_validate_value(thd,
var->save_result.string_value.str,
var->save_result.string_value.length);
diff --git a/sql/table.cc b/sql/table.cc
index fa8ed3c2587..9c3613a879c 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1177,7 +1177,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
char *keynames, *names, *comment_pos;
const uchar *forminfo, *extra2;
const uchar *frm_image_end = frm_image + frm_length;
- uchar *record, *null_flags, *null_pos, *mysql57_vcol_null_pos;
+ uchar *record, *null_flags, *null_pos, *mysql57_vcol_null_pos= 0;
const uchar *disk_buff, *strpos;
ulong pos, record_offset;
ulong rec_buff_length;
@@ -2387,6 +2387,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
DBUG_ASSERT(field_nr < share->fields);
reg_field= share->field[field_nr];
}
+ else
+ reg_field= 0; // Safety
vcol_screen_pos+= FRM_VCOL_NEW_HEADER_SIZE;
vcol_info->set_vcol_type((enum_vcol_info_type) type);
@@ -7368,7 +7370,7 @@ int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
DBUG_ASSERT(vcol_info);
DBUG_ASSERT(vcol_info->expr);
- bool update, swap_values= 0;
+ bool update= 0, swap_values= 0;
switch (update_mode) {
case VCOL_UPDATE_FOR_READ:
update= !vcol_info->stored_in_db
diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc
index 42b7bc81261..ad5ef9c5c55 100644
--- a/sql/wsrep_binlog.cc
+++ b/sql/wsrep_binlog.cc
@@ -452,7 +452,7 @@ void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf,
File file;
IO_CACHE cache;
Log_event_writer writer(&cache, 0);
- Format_description_log_event *ev;
+ Format_description_log_event *ev= 0;
int len= my_snprintf(filename, PATH_MAX, "%s/GRA_%lld_%lld_v2.log",
wsrep_data_home_dir, (longlong) thd->thread_id,