summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/log.cc2
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--sql/sql_help.cc2
-rw-r--r--sql/sql_partition.cc4
-rw-r--r--sql/sql_union.cc9
5 files changed, 5 insertions, 14 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 68ae6fd724e..ae0cb813742 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1362,7 +1362,7 @@ void LOGGER::deactivate_log_handler(THD *thd, uint log_type)
file_log= file_log_handler->get_mysql_log();
break;
default:
- assert(0); // Impossible
+ MY_ASSERT_UNREACHABLE();
}
if (!(*tmp_opt))
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 5583e9a29f1..49224444f5c 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -6068,7 +6068,7 @@ static int handle_grant_struct(uint struct_no, bool drop,
host= acl_proxy_user->get_host();
break;
default:
- assert(0);
+ MY_ASSERT_UNREACHABLE();
}
if (! user)
user= "";
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 4e3df950134..7d106fbe936 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -699,7 +699,7 @@ bool mysqld_help(THD *thd, const char *mask)
if (count_topics == 0)
{
- int key_id;
+ int UNINIT_VAR(key_id);
if (!(select=
prepare_select_for_name(thd,mask,mlen,tables,tables[3].table,
used_fields[help_keyword_name].field,
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 0629d9f3737..e909431a7fa 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -7528,8 +7528,8 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
}
}
else
- assert(0);
-
+ MY_ASSERT_UNREACHABLE();
+
can_match_multiple_values= (flags || !min_value || !max_value ||
memcmp(min_value, max_value, field_len));
if (can_match_multiple_values &&
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index acc0f704c44..98f20e09949 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -176,7 +176,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
SELECT_LEX *sl, *first_sl= first_select();
select_result *tmp_result;
bool is_union_select;
- TABLE *empty_table= 0;
DBUG_ENTER("st_select_lex_unit::prepare");
describe= test(additional_options & SELECT_DESCRIBE);
@@ -278,14 +277,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
types= first_sl->item_list;
else if (sl == first_sl)
{
- /*
- We need to create an empty table object. It is used
- to create tmp_table fields in Item_type_holder.
- The main reason of this is that we can't create
- field object without table.
- */
- DBUG_ASSERT(!empty_table);
- empty_table= (TABLE*) thd->calloc(sizeof(TABLE));
types.empty();
List_iterator_fast<Item> it(sl->item_list);
Item *item_tmp;