Skip to content
Permalink
Browse files

MDEV-20425: Fix -Wimplicit-fallthrough

With --skip-debug-assert, DBUG_ASSERT(false) will allow execution to
continue. Hence, we will need /* fall through */ after them.

Some DBUG_ASSERT(0) were replaced by break; when the switch () statement
was followed by DBUG_ASSERT(0).
  • Loading branch information...
dr-m committed Aug 30, 2019
1 parent a379f15 commit f42a23178edee5dd1fb6e0f76bbe88ea2a98a045
@@ -1,4 +1,4 @@
/* Copyright (C) 2010, 2017, MariaDB Corporation Ab
/* Copyright (C) 2010, 2019, 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
@@ -132,7 +132,8 @@ static bool set_one_value(ha_create_table_option *opt,
switch (opt->type)
{
case HA_OPTION_TYPE_SYSVAR:
DBUG_ASSERT(0); // HA_OPTION_TYPE_SYSVAR's are replaced in resolve_sysvars()
// HA_OPTION_TYPE_SYSVAR's are replaced in resolve_sysvars()
break; // to DBUG_ASSERT(0)
case HA_OPTION_TYPE_ULL:
{
ulonglong *val= (ulonglong*)value_ptr(base, opt);
@@ -1,7 +1,7 @@
#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2008, 2017, MariaDB Corporation.
Copyright (c) 2008, 2019, 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
@@ -461,6 +461,7 @@ inline bool is_temporal_type_with_date(enum_field_types type)
case MYSQL_TYPE_DATETIME2:
case MYSQL_TYPE_TIMESTAMP2:
DBUG_ASSERT(0); // field->real_type() should not get to here.
/* fall through */
default:
return false;
}
@@ -2911,6 +2911,7 @@ void st_select_lex_unit::print(String *str, enum_query_type query_type)
{
default:
DBUG_ASSERT(0);
/* fall through */
case UNION_TYPE:
str->append(STRING_WITH_LEN(" union "));
if (union_all)
@@ -3579,6 +3579,7 @@ mysql_execute_command(THD *thd)
case GET_NO_ARG:
case GET_DISABLED:
DBUG_ASSERT(0);
/* fall through */
case 0:
case GET_FLAGSET:
case GET_ENUM:
@@ -2569,6 +2569,7 @@ static const LEX_CSTRING *view_algorithm(TABLE_LIST *table)
return &merge;
default:
DBUG_ASSERT(0); // never should happen
/* fall through */
case VIEW_ALGORITHM_UNDEFINED:
return &undefined;
}
@@ -9114,7 +9114,7 @@ bool vers_select_conds_t::eq(const vers_select_conds_t &conds) const
case SYSTEM_TIME_ALL:
return true;
case SYSTEM_TIME_BEFORE:
DBUG_ASSERT(0);
break;
case SYSTEM_TIME_AS_OF:
return start.eq(conds.start);
case SYSTEM_TIME_FROM_TO:
@@ -826,6 +826,7 @@ static void fil_flush_low(fil_space_t* space, bool metadata = false)
switch (space->purpose) {
case FIL_TYPE_TEMPORARY:
ut_ad(0); // we already checked for this
/* fall through */
case FIL_TYPE_TABLESPACE:
case FIL_TYPE_IMPORT:
fil_n_pending_tablespace_flushes++;
@@ -2135,7 +2135,7 @@ innobase_col_to_mysql(
case DATA_SYS:
/* These column types should never be shipped to MySQL. */
ut_ad(0);

/* fall through */
case DATA_FLOAT:
case DATA_DOUBLE:
case DATA_DECIMAL:
@@ -754,7 +754,7 @@ mtr_t::Command::prepare_write()
switch (m_impl->m_log_mode) {
case MTR_LOG_SHORT_INSERTS:
ut_ad(0);
/* fall through (write no redo log) */
/* fall through */
case MTR_LOG_NO_REDO:
case MTR_LOG_NONE:
ut_ad(m_impl->m_log.size() == 0);
@@ -1790,6 +1790,7 @@ row_log_table_apply_insert(
break;
default:
ut_ad(0);
/* fall through */
case DB_INVALID_NULL:
ut_ad(row == NULL);
return(error);
@@ -2078,6 +2079,7 @@ row_log_table_apply_update(
break;
default:
ut_ad(0);
/* fall through */
case DB_INVALID_NULL:
ut_ad(row == NULL);
return(error);
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation.
Copyright (c) 2017, 2019, 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 the Free Software
@@ -583,6 +583,7 @@ row_undo_ins(
switch (node->rec_type) {
default:
ut_ad(!"wrong undo record type");
/* fall through */
case TRX_UNDO_INSERT_REC:
/* Skip the clustered index (the first index) */
node->index = dict_table_get_next_index(node->index);

0 comments on commit f42a231

Please sign in to comment.
You can’t perform that action at this time.