Skip to content

Commit ba1a99c

Browse files
author
Tor Didriksen
committed
Bug#26825211 BACKPORT FIX FOR #25643811 TO 5.7
Backport relevant parts of patch for: Bug #25643811: MYSQL DOES NOT COMPILE WITH GCC 7 Change-Id: Iafc7bc70b3621e12b484694ff927fb15e21ac5d2
1 parent 984cc2d commit ba1a99c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+199
-116
lines changed

client/mysqlbinlog.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,8 +1310,6 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
13101310
if (head->error == -1)
13111311
goto err;
13121312
break;
1313-
1314-
destroy_evt= TRUE;
13151313
}
13161314

13171315
case binary_log::INTVAR_EVENT:
@@ -1536,6 +1534,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
15361534
goto end;
15371535
}
15381536
}
1537+
// Fall through.
15391538
case binary_log::ROWS_QUERY_LOG_EVENT:
15401539
case binary_log::WRITE_ROWS_EVENT:
15411540
case binary_log::DELETE_ROWS_EVENT:

client/mysqldump.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,7 @@ static void print_xml_comment(FILE *xml_file, size_t len,
21172117
case '-':
21182118
if (*(comment_string + 1) == '-') /* Only one hyphen allowed. */
21192119
break;
2120+
// Fall through.
21202121
default:
21212122
fputc(*comment_string, xml_file);
21222123
break;

cmake/maintainer.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -16,6 +16,15 @@
1616
# Common warning flags for GCC, G++, Clang and Clang++
1717
SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security -Wvla")
1818

19+
# The default =3 given by -Wextra is a bit too strict for our code.
20+
IF(CMAKE_COMPILER_IS_GNUCXX)
21+
MY_CHECK_CXX_COMPILER_FLAG("-Wimplicit-fallthrough=2"
22+
HAVE_IMPLICIT_FALLTHROUGH)
23+
IF(HAVE_IMPLICIT_FALLTHROUGH)
24+
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wimplicit-fallthrough=2")
25+
ENDIF()
26+
ENDIF()
27+
1928
# Common warning flags for GCC and Clang
2029
SET(MY_C_WARNING_FLAGS
2130
"${MY_WARNING_FLAGS} -Wwrite-strings -Wdeclaration-after-statement")

extra/lz4/lz4frame.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
10911091
dctxPtr->tmpInTarget = minFHSize; /* minimum to attempt decode */
10921092
dctxPtr->dStage = dstage_storeHeader;
10931093
}
1094+
// Fall through.
10941095

10951096
case dstage_storeHeader:
10961097
{

extra/replace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or
55
modify it under the terms of the GNU General Public License
@@ -177,6 +177,7 @@ char **argv[];
177177
break;
178178
case 'V':
179179
version=1;
180+
// Fall through.
180181
case 'I':
181182
case '?':
182183
help=1; /* Help text written */

libbinlogevents/src/binlog_event.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -169,7 +169,7 @@ Log_event_header(const char* buf, uint16_t binlog_version)
169169
extra_headers are not used in the current version.
170170
@endverbatim
171171
*/
172-
172+
// Fall through.
173173
default:
174174
memcpy(&flags, buf + FLAGS_OFFSET, sizeof(flags));
175175
flags= le16toh(flags);

libbinlogevents/src/statement_events.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -532,8 +532,8 @@ User_var_event(const char* buf, unsigned int event_len,
532532
(description_event->footer()->checksum_alg ==
533533
BINLOG_CHECKSUM_ALG_OFF));
534534
size_t data_written= (header()->data_written- checksum_verify);
535-
BAPI_ASSERT(((bytes_read == data_written) ? 0 : BINLOG_CHECKSUM_LEN)||
536-
((bytes_read == data_written - 1) ? 0 : BINLOG_CHECKSUM_LEN));
535+
BAPI_ASSERT(((bytes_read == data_written) ? false : true) ||
536+
((bytes_read == data_written - 1) ? false : true));
537537
#endif
538538
if ((header()->data_written - bytes_read) > 0)
539539
{

libmysqld/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -181,6 +181,16 @@ IF(HAVE_MISLEADING_INDENTATION)
181181
COMPILE_FLAGS "-Wno-misleading-indentation")
182182
ENDIF()
183183

184+
# gcc 7.2.0 complains:
185+
# boost/geometry/algorithms/detail/expand/indexed.hpp:81
186+
# *((void*)& box +24) may be used uninitialized
187+
MY_CHECK_CXX_COMPILER_FLAG("-Wmaybe-uninitialized" HAVE_MAYBE_UNINITIALIZED)
188+
IF(HAVE_MAYBE_UNINITIALIZED)
189+
ADD_COMPILE_FLAGS(
190+
../sql/geometry_rtree.cc
191+
COMPILE_FLAGS "-Wno-maybe-uninitialized")
192+
ENDIF()
193+
184194
# Handle out-of-source build from source package with possibly broken
185195
# bison. Copy bison output to from source to build directory, if not already
186196
# there

rapid/plugin/x/mysqlxtest_src/common/utils_mysql_parsing.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program is free software; you can redistribute it and/or
55
* modify it under the terms of the GNU General Public License as
@@ -118,8 +118,8 @@ namespace shcore
118118
if (!is_hidden_command && !have_content)
119119
head = tail; // Skip over the comment.
120120

121-
break;
122121
}
122+
break;
123123

124124
case '-': // Possible single line comment.
125125
{

rapid/plugin/x/mysqlxtest_src/mysqlx_protocol.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ void XProtocol::authenticate_mysql41(const std::string &user, const std::string
557557

558558
case Mysqlx::ServerMessages::ERROR:
559559
throw_server_error(*static_cast<Mysqlx::Error*>(message.get()));
560+
break;
560561

561562
default:
562563
throw Error(CR_MALFORMED_PACKET, "Unexpected message received from server during authentication");
@@ -577,6 +578,7 @@ void XProtocol::authenticate_mysql41(const std::string &user, const std::string
577578

578579
case Mysqlx::ServerMessages::ERROR:
579580
throw_server_error(*static_cast<Mysqlx::Error*>(message.get()));
581+
break;
580582

581583
case Mysqlx::ServerMessages::NOTICE:
582584
dispatch_notice(static_cast<Mysqlx::Notice::Frame*>(message.get()));
@@ -618,6 +620,7 @@ void XProtocol::authenticate_plain(const std::string &user, const std::string &p
618620

619621
case Mysqlx::ServerMessages::ERROR:
620622
throw_server_error(*static_cast<Mysqlx::Error*>(message.get()));
623+
break;
621624

622625
case Mysqlx::ServerMessages::NOTICE:
623626
dispatch_notice(static_cast<Mysqlx::Notice::Frame*>(message.get()));

0 commit comments

Comments
 (0)