mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
fix win32 warnings
This commit is contained in:
committed by
Aleksey Midenkov
parent
a899e52d08
commit
0d3b8ed048
@ -3050,7 +3050,7 @@ int handler::update_auto_increment()
|
||||
int2store(ptr, vers_auto_decrement--);
|
||||
break;
|
||||
case 1:
|
||||
*ptr= vers_auto_decrement--;
|
||||
*ptr= static_cast<uchar>(vers_auto_decrement--);
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(false);
|
||||
|
@ -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<my_time_t>(
|
||||
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;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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<enum_var_type>(var->save_result.ulonglong_value);
|
||||
if (out.type == FOR_SYSTEM_TIME_AS_OF)
|
||||
{
|
||||
res= var->value->get_date(&out.ltime, 0);
|
||||
|
@ -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<uint>(field_translation_end - field_translation) <
|
||||
select->item_list.elements)
|
||||
goto allocate;
|
||||
while ((item= it++))
|
||||
{
|
||||
|
@ -1714,7 +1714,7 @@ thd_start_time_in_secs(
|
||||
/*===================*/
|
||||
THD* thd) /*!< in: thread handle, or NULL */
|
||||
{
|
||||
return(thd_start_time(thd));
|
||||
return(static_cast<ulint>(thd_start_time(thd)));
|
||||
}
|
||||
|
||||
/** Enter InnoDB engine after checking the max number of user threads
|
||||
|
@ -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<long>(trx->start_time);
|
||||
begin_ts.tv_usec = trx->start_time_micro % 1000000;
|
||||
|
||||
mutex_enter(&trx_sys->mutex);
|
||||
|
Reference in New Issue
Block a user