summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-03-13 08:37:22 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-03-13 08:37:22 +0200
commit9f858f38c03d2671a94d3ff8e8d726f0d2f7023c (patch)
tree768a1792884a27dc569dc01492550936aca9aac1 /sql
parent2e8b0c56a0f78508e62d1527eda2d7c3d9ebdf9a (diff)
downloadmariadb-git-9f858f38c03d2671a94d3ff8e8d726f0d2f7023c.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_time.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index 5a251cfd733..a6fe937df4b 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -1,5 +1,5 @@
/* 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
it under the terms of the GNU General Public License as published by
@@ -403,7 +403,7 @@ bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime,
if (neg)
value= -value;
- if (value > LONGLONG_MAX)
+ if (value > static_cast<double>(LONGLONG_MAX))
value= static_cast<double>(LONGLONG_MAX);
longlong nr= static_cast<ulonglong>(floor(value));