Commit 758fbec6 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix clang 10 warnings

_ma_fetch_keypage(): Correct an assertion that used to always hold.
Thanks to clang -Wint-in-bool-context for flagging this.

double_to_datetime_with_warn(): Suppress -Wimplicit-int-float-conversion
by adding a cast. LONGLONG_MAX converted to double will actually be
LONGLONG_MAX+1.
parent 6a3fc110
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. /* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009, 2013 Monty Program Ab. Copyright (c) 2009, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -402,7 +402,7 @@ bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime, ...@@ -402,7 +402,7 @@ bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime,
if (neg) if (neg)
value= -value; value= -value;
if (value > LONGLONG_MAX) if (value > static_cast<double>(LONGLONG_MAX))
value= static_cast<double>(LONGLONG_MAX); value= static_cast<double>(LONGLONG_MAX);
longlong nr= static_cast<ulonglong>(floor(value)); longlong nr= static_cast<ulonglong>(floor(value));
......
/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB /* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -112,7 +113,7 @@ my_bool _ma_fetch_keypage(MARIA_PAGE *page, MARIA_HA *info, ...@@ -112,7 +113,7 @@ my_bool _ma_fetch_keypage(MARIA_PAGE *page, MARIA_HA *info,
if (lock != PAGECACHE_LOCK_LEFT_UNLOCKED) if (lock != PAGECACHE_LOCK_LEFT_UNLOCKED)
{ {
DBUG_ASSERT(lock == PAGECACHE_LOCK_WRITE || PAGECACHE_LOCK_READ); DBUG_ASSERT(lock == PAGECACHE_LOCK_WRITE || lock == PAGECACHE_LOCK_READ);
page_link.unlock= (lock == PAGECACHE_LOCK_WRITE ? page_link.unlock= (lock == PAGECACHE_LOCK_WRITE ?
PAGECACHE_LOCK_WRITE_UNLOCK : PAGECACHE_LOCK_WRITE_UNLOCK :
PAGECACHE_LOCK_READ_UNLOCK); PAGECACHE_LOCK_READ_UNLOCK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment