diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-09-16 14:52:42 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-10-17 07:37:39 +0200 |
commit | d76f5774fe70c51577cfbfdddcbfb3309d51f06e (patch) | |
tree | 579994269a0b9d569e0ac2b4ca024e8027dc4551 /storage | |
parent | 3b7aa3017b65dcf11d33617e954e1cb471703582 (diff) | |
download | mariadb-git-d76f5774fe70c51577cfbfdddcbfb3309d51f06e.tar.gz |
MDEV-13459 Warnings, when compiling with gcc-7.x
mostly caused by -Wimplicit-fallthrough
Diffstat (limited to 'storage')
-rw-r--r-- | storage/federated/ha_federated.cc | 3 | ||||
-rw-r--r-- | storage/federatedx/federatedx_io_mysql.cc | 9 | ||||
-rw-r--r-- | storage/federatedx/ha_federatedx.cc | 2 | ||||
-rw-r--r-- | storage/heap/hp_create.c | 2 | ||||
-rw-r--r-- | storage/heap/hp_extra.c | 1 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 5 | ||||
-rw-r--r-- | storage/innobase/include/data0type.ic | 2 | ||||
-rw-r--r-- | storage/innobase/include/page0zip.ic | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0mysql.c | 5 | ||||
-rw-r--r-- | storage/innobase/row/row0purge.c | 4 | ||||
-rw-r--r-- | storage/innobase/row/row0sel.c | 1 | ||||
-rw-r--r-- | storage/maria/ma_extra.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_key_recover.c | 1 | ||||
-rw-r--r-- | storage/maria/ma_recovery.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_extra.c | 3 | ||||
-rw-r--r-- | storage/sphinx/ha_sphinx.cc | 12 | ||||
-rw-r--r-- | storage/tokudb/CMakeLists.txt | 1 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 5 | ||||
-rw-r--r-- | storage/xtradb/include/data0type.ic | 2 | ||||
-rw-r--r-- | storage/xtradb/include/page0zip.ic | 2 | ||||
-rw-r--r-- | storage/xtradb/row/row0mysql.c | 4 | ||||
-rw-r--r-- | storage/xtradb/row/row0purge.c | 4 | ||||
-rw-r--r-- | storage/xtradb/row/row0sel.c | 1 |
23 files changed, 47 insertions, 29 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index adf4f0f4db2..8680c3aac25 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1421,6 +1421,7 @@ bool ha_federated::create_where_from_key(String *to, } break; } + /* fall through */ case HA_READ_KEY_OR_NEXT: DBUG_PRINT("info", ("federated HA_READ_KEY_OR_NEXT %d", i)); if (emit_key_part_name(&tmp, key_part) || @@ -1440,6 +1441,7 @@ bool ha_federated::create_where_from_key(String *to, goto err; break; } + /* fall through */ case HA_READ_KEY_OR_PREV: DBUG_PRINT("info", ("federated HA_READ_KEY_OR_PREV %d", i)); if (emit_key_part_name(&tmp, key_part) || @@ -2973,6 +2975,7 @@ int ha_federated::extra(ha_extra_function operation) break; case HA_EXTRA_PREPARE_FOR_DROP: table_will_be_deleted = TRUE; + break; default: /* do nothing */ DBUG_PRINT("info",("unhandled operation: %d", (uint) operation)); diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc index a2eaa345a18..ef3b1388200 100644 --- a/storage/federatedx/federatedx_io_mysql.cc +++ b/storage/federatedx/federatedx_io_mysql.cc @@ -263,9 +263,8 @@ ulong federatedx_io_mysql::savepoint_release(ulong sp) savept= dynamic_element(&savepoints, savepoints.elements - 1, SAVEPT *); if (savept->level < sp) break; - if ((savept->flags & (SAVEPOINT_REALIZED | - SAVEPOINT_RESTRICT)) == SAVEPOINT_REALIZED) - last= savept; + if ((savept->flags & (SAVEPOINT_REALIZED | SAVEPOINT_RESTRICT)) == SAVEPOINT_REALIZED) + last= savept; savepoints.elements--; } @@ -291,8 +290,8 @@ ulong federatedx_io_mysql::savepoint_rollback(ulong sp) while (savepoints.elements) { savept= dynamic_element(&savepoints, savepoints.elements - 1, SAVEPT *); - if (savept->level <= sp) - break; + if (savept->level <= sp) + break; savepoints.elements--; } diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index c9b07a8f3c3..bafae614fab 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -1340,6 +1340,7 @@ bool ha_federatedx::create_where_from_key(String *to, } break; } + /* fall through */ case HA_READ_KEY_OR_NEXT: DBUG_PRINT("info", ("federatedx HA_READ_KEY_OR_NEXT %d", i)); if (emit_key_part_name(&tmp, key_part) || @@ -1359,6 +1360,7 @@ bool ha_federatedx::create_where_from_key(String *to, goto err; break; } + /* fall through */ case HA_READ_KEY_OR_PREV: DBUG_PRINT("info", ("federatedx HA_READ_KEY_OR_PREV %d", i)); if (emit_key_part_name(&tmp, key_part) || diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c index 2b705b0e3d7..0b5dc841ada 100644 --- a/storage/heap/hp_create.c +++ b/storage/heap/hp_create.c @@ -94,7 +94,7 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info, case HA_KEYTYPE_VARBINARY1: /* Case-insensitiveness is handled in coll->hash_sort */ keyinfo->seg[j].type= HA_KEYTYPE_VARTEXT1; - /* fall_through */ + /* fall through */ case HA_KEYTYPE_VARTEXT1: keyinfo->flag|= HA_VAR_LENGTH_KEY; length+= 2; diff --git a/storage/heap/hp_extra.c b/storage/heap/hp_extra.c index c83efd5af61..9a19f818d3b 100644 --- a/storage/heap/hp_extra.c +++ b/storage/heap/hp_extra.c @@ -34,6 +34,7 @@ int heap_extra(register HP_INFO *info, enum ha_extra_function function) switch (function) { case HA_EXTRA_RESET_STATE: heap_reset(info); + /* fall through */ case HA_EXTRA_NO_READCHECK: info->opt_flag&= ~READ_CHECK_USED; /* No readcheck */ break; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 780f3a6f82f..3aabfc319c6 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5129,7 +5129,7 @@ ha_innobase::innobase_lock_autoinc(void) break; } } - /* Fall through to old style locking. */ + /* fall through */ case AUTOINC_OLD_STYLE_LOCKING: error = row_lock_table_autoinc_for_mysql(prebuilt); @@ -7080,7 +7080,7 @@ create_options_are_valid( case ROW_TYPE_DYNAMIC: CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE; CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE; - /* fall through since dynamic also shuns KBS */ + /* fall through */ /* since dynamic also shuns KBS */ case ROW_TYPE_COMPACT: case ROW_TYPE_REDUNDANT: if (kbs_specified) { @@ -7326,6 +7326,7 @@ ha_innobase::create( thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, "InnoDB: assuming ROW_FORMAT=COMPACT."); + /* fall through */ case ROW_TYPE_DEFAULT: case ROW_TYPE_COMPACT: flags = DICT_TF_COMPACT; diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic index 410970ac50e..515b6b249ef 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.ic @@ -477,7 +477,7 @@ dtype_get_fixed_size_low( #else /* !UNIV_HOTBACKUP */ return(len); #endif /* !UNIV_HOTBACKUP */ - /* fall through for variable-length charsets */ + /* fall through */ /* for variable-length charsets */ case DATA_VARCHAR: case DATA_BINARY: case DATA_DECIMAL: diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.ic index e26fa3e3d94..a2fa13c94df 100644 --- a/storage/innobase/include/page0zip.ic +++ b/storage/innobase/include/page0zip.ic @@ -170,7 +170,7 @@ page_zip_rec_needs_ext( ignored if zip_size == 0 */ ulint zip_size) /*!< in: compressed page size in bytes, or 0 */ { - ut_ad(rec_size > comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES); + ut_ad(rec_size > (comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES)); ut_ad(ut_is_2pow(zip_size)); ut_ad(comp || !zip_size); diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 6206bef6b56..8804e2c4e03 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -3495,7 +3495,7 @@ check_next_foreign: row_mysql_handle_errors(&err, trx, NULL, NULL); - /* Fall through to raise error */ + /* fall through */ default: /* No other possible error returns */ @@ -4315,7 +4315,8 @@ loop: fputs(" InnoDB: Warning: CHECK TABLE on ", stderr); dict_index_name_print(stderr, prebuilt->trx, index); fprintf(stderr, " returned %lu\n", ret); - /* fall through (this error is ignored by CHECK TABLE) */ + /* this error is ignored by CHECK TABLE */ + /* fall through */ case DB_END_OF_INDEX: func_exit: mem_free(buf); diff --git a/storage/innobase/row/row0purge.c b/storage/innobase/row/row0purge.c index 5f3e4175544..7b25612ba4b 100644 --- a/storage/innobase/row/row0purge.c +++ b/storage/innobase/row/row0purge.c @@ -407,8 +407,8 @@ row_purge_remove_sec_if_poss_leaf( goto func_exit; } } - /* fall through (the index entry is still needed, - or the deletion succeeded) */ + /* the index entry is still needed, or the deletion succeeded */ + /* fall through */ case ROW_NOT_DELETED_REF: /* The index entry is still needed. */ case ROW_BUFFERED: diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index e027a382cee..f5f8153e116 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -2675,6 +2675,7 @@ row_sel_field_store_in_mysql_format( case DATA_SYS: /* These column types should never be shipped to MySQL. */ ut_ad(0); + /* fall through */ case DATA_CHAR: case DATA_FIXBINARY: diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c index 0847f3c729c..3ee70059e6f 100644 --- a/storage/maria/ma_extra.c +++ b/storage/maria/ma_extra.c @@ -157,6 +157,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function, if (info->s->data_file_type != DYNAMIC_RECORD) break; /* Remove read/write cache if dynamic rows */ + /* fall through */ case HA_EXTRA_NO_CACHE: if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) { @@ -313,7 +314,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function, share->state.open_count= 1; share->changed= 1; _ma_mark_file_changed_now(share); - /* Fall trough */ + /* fall through */ case HA_EXTRA_PREPARE_FOR_RENAME: { my_bool do_flush= test(function != HA_EXTRA_PREPARE_FOR_DROP); diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c index 502ac2b8809..48f01b8f8dd 100644 --- a/storage/maria/ma_key_recover.c +++ b/storage/maria/ma_key_recover.c @@ -1169,6 +1169,7 @@ uint _ma_apply_redo_index(MARIA_HA *info, goto err; } page_length= page.size; + break; } case KEY_OP_NONE: default: diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index b2e8705b15e..75a8f4f4559 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -3059,7 +3059,7 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const case LOGREC_REDO_INDEX: case LOGREC_REDO_INDEX_FREE_PAGE: index_page_redo_entry= 1; - /* Fall trough*/ + /* fall through*/ case LOGREC_REDO_INSERT_ROW_HEAD: case LOGREC_REDO_INSERT_ROW_TAIL: case LOGREC_REDO_PURGE_ROW_HEAD: diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index dab1f66ed6d..9c5c1ad0c0d 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -150,6 +150,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) if (info->s->data_file_type != DYNAMIC_RECORD) break; /* Remove read/write cache if dynamic rows */ + /* fall through */ case HA_EXTRA_NO_CACHE: if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED)) { @@ -262,7 +263,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) //share->deleting= TRUE; share->global_changed= FALSE; /* force writing changed flag */ _mi_mark_file_changed(info); - /* Fall trough */ + /* fall through */ case HA_EXTRA_PREPARE_FOR_RENAME: mysql_mutex_lock(&THR_LOCK_myisam); share->last_version= 0L; /* Impossible version */ diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc index 9edf6ea6570..b7a333c1715 100644 --- a/storage/sphinx/ha_sphinx.cc +++ b/storage/sphinx/ha_sphinx.cc @@ -1661,13 +1661,16 @@ bool CSphSEQuery::ParseField ( char * sField ) char * sLat = sValue; char * p = sValue; - if (!( p = strchr ( p, ',' ) )) break; *p++ = '\0'; + if (!( p = strchr ( p, ',' ) )) break; + *p++ = '\0'; char * sLong = p; - if (!( p = strchr ( p, ',' ) )) break; *p++ = '\0'; + if (!( p = strchr ( p, ',' ) )) break; + *p++ = '\0'; char * sLatVal = p; - if (!( p = strchr ( p, ',' ) )) break; *p++ = '\0'; + if (!( p = strchr ( p, ',' ) )) break; + *p++ = '\0'; char * sLongVal = p; m_sGeoLatAttr = chop(sLat); @@ -1736,7 +1739,8 @@ bool CSphSEQuery::ParseField ( char * sField ) while ( sRest ) { char * sId = sRest; - if (!( sRest = strchr ( sRest, ':' ) )) break; *sRest++ = '\0'; + if (!( sRest = strchr ( sRest, ':' ) )) break; + *sRest++ = '\0'; if (!( sRest - sId )) break; char * sValue = sRest; diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 2052d448a43..ab6bb0a8504 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -100,6 +100,7 @@ endmacro(append_cflags_if_supported) set_cflags_if_supported(-Wno-missing-field-initializers) append_cflags_if_supported(-Wno-vla) +append_cflags_if_supported(-Wno-implicit-fallthrough) ADD_SUBDIRECTORY(ft-index) diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 66fcc2799bb..00f345d4bc1 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -6144,7 +6144,7 @@ ha_innobase::innobase_lock_autoinc(void) break; } } - /* Fall through to old style locking. */ + /* fall through */ case AUTOINC_OLD_STYLE_LOCKING: error = row_lock_table_autoinc_for_mysql(prebuilt); @@ -8190,7 +8190,7 @@ create_options_are_valid( case ROW_TYPE_DYNAMIC: CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE; CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE; - /* fall through since dynamic also shuns KBS */ + /* fall through */ /* since dynamic also shuns KBS */ case ROW_TYPE_COMPACT: case ROW_TYPE_REDUNDANT: if (kbs_specified) { @@ -8436,6 +8436,7 @@ ha_innobase::create( thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, "InnoDB: assuming ROW_FORMAT=COMPACT."); + /* fall through */ case ROW_TYPE_DEFAULT: case ROW_TYPE_COMPACT: flags = DICT_TF_COMPACT; diff --git a/storage/xtradb/include/data0type.ic b/storage/xtradb/include/data0type.ic index 410970ac50e..5848e5d6548 100644 --- a/storage/xtradb/include/data0type.ic +++ b/storage/xtradb/include/data0type.ic @@ -477,7 +477,7 @@ dtype_get_fixed_size_low( #else /* !UNIV_HOTBACKUP */ return(len); #endif /* !UNIV_HOTBACKUP */ - /* fall through for variable-length charsets */ + /* fall through */ case DATA_VARCHAR: case DATA_BINARY: case DATA_DECIMAL: diff --git a/storage/xtradb/include/page0zip.ic b/storage/xtradb/include/page0zip.ic index e26fa3e3d94..a2fa13c94df 100644 --- a/storage/xtradb/include/page0zip.ic +++ b/storage/xtradb/include/page0zip.ic @@ -170,7 +170,7 @@ page_zip_rec_needs_ext( ignored if zip_size == 0 */ ulint zip_size) /*!< in: compressed page size in bytes, or 0 */ { - ut_ad(rec_size > comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES); + ut_ad(rec_size > (comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES)); ut_ad(ut_is_2pow(zip_size)); ut_ad(comp || !zip_size); diff --git a/storage/xtradb/row/row0mysql.c b/storage/xtradb/row/row0mysql.c index 0182752132a..5b01adf7c82 100644 --- a/storage/xtradb/row/row0mysql.c +++ b/storage/xtradb/row/row0mysql.c @@ -3635,7 +3635,7 @@ check_next_foreign: row_mysql_handle_errors(&err, trx, NULL, NULL); - /* Fall through to raise error */ + /* fall through */ /* to raise error */ default: /* No other possible error returns */ @@ -4455,7 +4455,7 @@ loop: fputs(" InnoDB: Warning: CHECK TABLE on ", stderr); dict_index_name_print(stderr, prebuilt->trx, index); fprintf(stderr, " returned %lu\n", ret); - /* fall through (this error is ignored by CHECK TABLE) */ + /* fall through */ /* this error is ignored by CHECK TABLE */ case DB_END_OF_INDEX: func_exit: mem_free(buf); diff --git a/storage/xtradb/row/row0purge.c b/storage/xtradb/row/row0purge.c index 4186da884b6..77d60edb71f 100644 --- a/storage/xtradb/row/row0purge.c +++ b/storage/xtradb/row/row0purge.c @@ -407,8 +407,8 @@ row_purge_remove_sec_if_poss_leaf( goto func_exit; } } - /* fall through (the index entry is still needed, - or the deletion succeeded) */ + /* the index entry is still needed, or the deletion succeeded */ + /* fall through */ case ROW_NOT_DELETED_REF: /* The index entry is still needed. */ case ROW_BUFFERED: diff --git a/storage/xtradb/row/row0sel.c b/storage/xtradb/row/row0sel.c index 592ae963382..3b2568c6834 100644 --- a/storage/xtradb/row/row0sel.c +++ b/storage/xtradb/row/row0sel.c @@ -2678,6 +2678,7 @@ row_sel_field_store_in_mysql_format( case DATA_SYS: /* These column types should never be shipped to MySQL. */ ut_ad(0); + /* fall through */ case DATA_CHAR: case DATA_FIXBINARY: |