diff --git a/sql/handler.cc b/sql/handler.cc index 1e3c7aca9ee..f17d6ac390a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3050,7 +3050,7 @@ int handler::update_auto_increment() int2store(ptr, vers_auto_decrement--); break; case 1: - *ptr= vers_auto_decrement--; + *ptr= static_cast(vers_auto_decrement--); break; default: DBUG_ASSERT(false); diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 65416c30fd7..b6653310486 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -860,13 +860,13 @@ bool partition_info::vers_set_interval(const INTERVAL & i) DBUG_ASSERT(vers_info); // TODO: INTERVAL conversion to seconds leads to mismatch with calendar intervals (MONTH and YEAR) - vers_info->interval= + vers_info->interval= static_cast( i.second + i.minute * 60 + i.hour * 60 * 60 + i.day * 24 * 60 * 60 + i.month * 30 * 24 * 60 * 60 + - i.year * 365 * 30 * 24 * 60 * 60; + i.year * 365 * 30 * 24 * 60 * 60); if (vers_info->interval == 0) return true; diff --git a/sql/partition_info.h b/sql/partition_info.h index a8b1b386240..6b79fa82fb8 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -515,7 +515,7 @@ public: if (table->versioned_by_engine()) { // transaction is not yet pushed to VTQ, so we use now-time - my_time_t end_ts= my_time(0); + my_time_t end_ts= my_time_t(0); uchar buf[8]; Field_timestampf fld(buf, NULL, 0, Field::NONE, &table->vers_end_field()->field_name, NULL, 6); diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index e69736748bd..d87128f5c00 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -736,9 +736,6 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) } // System Versioning: fix system fields of versioned derived table -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat" -#pragma GCC diagnostic ignored "-Wformat-extra-args" if ((thd->stmt_arena->is_stmt_prepare() || !thd->stmt_arena->is_stmt_execute()) && sl->table_list.elements > 0) { @@ -799,7 +796,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) expli_table_err: my_printf_error( ER_VERS_DERIVED_PROHIBITED, - "Derived table is prohibited: system fields from multiple tables %`s, %`s in query!", MYF(0), + "Derived table is prohibited: system fields from multiple tables `%s`, `%s` in query!", MYF(0), expli_table->alias, table->alias); res= true; @@ -857,7 +854,6 @@ expli_table_err: sl->vers_import_outer= true; // FIXME: is needed? } } // if (sl->table_list.elements > 0) -#pragma GCC diagnostic pop // System Versioning end } diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 98b41f38fc6..da8205fac17 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3207,7 +3207,7 @@ int vers_get_partition_id(partition_info *part_info, mysql_mutex_unlock(&table->s->LOCK_rotation); // transaction is not yet pushed to VTQ, so we use now-time my_time_t end_ts= sys_trx_end->table->versioned_by_engine() ? - my_time(0) : sys_trx_end->get_timestamp(); + my_time_t(0) : sys_trx_end->get_timestamp(); if (part_info->vers_limit_exceed() || part_info->vers_interval_exceed(end_ts)) { part_info->vers_part_rotate(thd); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index f427e2e4ab8..6ea4633385b 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -457,9 +457,6 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, for (SELECT_LEX *sl= select_lex; sl; sl= sl->next_select()) { /* System Versioning: fix system fields of versioned view */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat" -#pragma GCC diagnostic ignored "-Wformat-extra-args" // Similar logic as in mysql_derived_prepare() // Leading versioning table detected implicitly (first one selected) TABLE_LIST *impli_table= NULL; @@ -480,7 +477,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, { my_printf_error( ER_VERS_VIEW_PROHIBITED, - "Creating VIEW %`s is prohibited: versioned VIEW %`s in query!", MYF(0), + "Creating VIEW `%s` is prohibited: versioned VIEW `%s` in query!", MYF(0), view->table_name, table->table_name); res= true; @@ -519,7 +516,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, { my_printf_error( ER_VERS_VIEW_PROHIBITED, - "Creating VIEW %`s is prohibited: multiple start system fields `%s.%s`, `%s.%s` in query!", MYF(0), + "Creating VIEW `%s` is prohibited: multiple start system fields `%s.%s`, `%s.%s` in query!", MYF(0), view->table_name, expli_table->alias, expli_start->field_name.str, @@ -535,7 +532,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, expli_table_err: my_printf_error( ER_VERS_VIEW_PROHIBITED, - "Creating VIEW %`s is prohibited: system fields from multiple tables %`s, %`s in query!", MYF(0), + "Creating VIEW `%s` is prohibited: system fields from multiple tables `%s`, `%s` in query!", MYF(0), view->table_name, expli_table->alias, table->alias); @@ -554,7 +551,7 @@ expli_table_err: { my_printf_error( ER_VERS_VIEW_PROHIBITED, - "Creating VIEW %`s is prohibited: multiple end system fields `%s.%s`, `%s.%s` in query!", MYF(0), + "Creating VIEW `%s` is prohibited: multiple end system fields `%s.%s`, `%s.%s` in query!", MYF(0), view->table_name, expli_table->alias, expli_end->field_name.str, @@ -586,7 +583,6 @@ expli_table_err: if (!expli_end && sl->vers_push_field(thd, impli_table, impli_end)) goto err; } -#pragma GCC diagnostic pop } /* System Versioning end */ view= lex->unlink_first_table(&link_to_local); diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic index 862d90eb8f9..3b257a43b79 100644 --- a/sql/sys_vars.ic +++ b/sql/sys_vars.ic @@ -2637,7 +2637,7 @@ private: bool update(set_var *var, st_vers_asof_timestamp &out) { bool res= false; - out.type= var->save_result.ulonglong_value; + out.type= static_cast(var->save_result.ulonglong_value); if (out.type == FOR_SYSTEM_TIME_AS_OF) { res= var->value->get_date(&out.ltime, 0); diff --git a/sql/table.cc b/sql/table.cc index 98ca7f2b8bf..7fe8bd85fb2 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4766,7 +4766,8 @@ bool TABLE_LIST::create_field_translation(THD *thd) if (is_view() && get_unit()->prepared && !field_translation_updated) { field_translation_updated= TRUE; - if (field_translation_end - field_translation < select->item_list.elements) + if (static_cast(field_translation_end - field_translation) < + select->item_list.elements) goto allocate; while ((item= it++)) { diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 46a08099ee2..be294bd3e36 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1714,7 +1714,7 @@ thd_start_time_in_secs( /*===================*/ THD* thd) /*!< in: thread handle, or NULL */ { - return(thd_start_time(thd)); + return(static_cast(thd_start_time(thd))); } /** Enter InnoDB engine after checking the max number of user threads diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 8163ae186cd..0b6e91b8e64 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -4060,7 +4060,7 @@ void vers_notify_vtq(trx_t* trx) dtuple_t* tuple = dtuple_create(heap, dict_table_get_n_cols(dict_sys->sys_vtq)); timeval begin_ts, commit_ts; - begin_ts.tv_sec = trx->start_time; + begin_ts.tv_sec = static_cast(trx->start_time); begin_ts.tv_usec = trx->start_time_micro % 1000000; mutex_enter(&trx_sys->mutex);