Skip to content

Commit 5147b7d

Browse files
committed
Merge tag 'clone-5.6.40-build' into mysql-5.6-cluster-7.3
Change-Id: Ia241542c191f50cf59b99431fd719d31ff26556b
2 parents f30d3eb + 20bba95 commit 5147b7d

File tree

78 files changed

+962
-348
lines changed

Some content is hidden

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

78 files changed

+962
-348
lines changed

Docs/ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
You can find a detailed list of changes at
2+
to https://github.com/mysql/mysql-server/commits/5.6

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=5
22
MYSQL_VERSION_MINOR=6
3-
MYSQL_VERSION_PATCH=39
3+
MYSQL_VERSION_PATCH=40
44
MYSQL_VERSION_EXTRA=-ndb-7.3.21

client/mysqltest.cc

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2018, 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
@@ -50,6 +50,7 @@
5050
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
5151

5252
#include <algorithm>
53+
#include <sstream>
5354

5455
using std::min;
5556
using std::max;
@@ -768,12 +769,6 @@ class LogFile {
768769
while ((bytes= fread(buf, 1, sizeof(buf), m_file)) > 0)
769770
fwrite(buf, 1, bytes, stderr);
770771

771-
if (!lines)
772-
{
773-
fprintf(stderr,
774-
"\nMore results from queries before failure can be found in %s\n",
775-
m_file_name);
776-
}
777772
fflush(stderr);
778773

779774
DBUG_VOID_RETURN;
@@ -7849,8 +7844,8 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
78497844
/* Init dynamic strings for warnings */
78507845
if (!disable_warnings)
78517846
{
7852-
init_dynamic_string(&ds_prepare_warnings, NULL, 0, 256);
7853-
init_dynamic_string(&ds_execute_warnings, NULL, 0, 256);
7847+
init_dynamic_string(&ds_prepare_warnings, "", 0, 256);
7848+
init_dynamic_string(&ds_execute_warnings, "", 0, 256);
78547849
}
78557850

78567851
/*
@@ -7954,13 +7949,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
79547949
append_stmt_result(ds, stmt, fields, num_fields);
79557950

79567951
mysql_free_result(res); /* Free normal result set with meta data */
7957-
7958-
/*
7959-
Clear prepare warnings if there are execute warnings,
7960-
since they are probably duplicated.
7961-
*/
7962-
if (ds_execute_warnings.length || mysql->warning_count)
7963-
dynstr_set(&ds_prepare_warnings, NULL);
79647952
}
79657953
else
79667954
{
@@ -7992,8 +7980,26 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
79927980
dynstr_append_mem(ds, ds_warnings->str,
79937981
ds_warnings->length);
79947982
if (ds_prepare_warnings.length)
7995-
dynstr_append_mem(ds, ds_prepare_warnings.str,
7996-
ds_prepare_warnings.length);
7983+
{
7984+
/* Split the string to get each warning */
7985+
std::stringstream prepare_warnings(ds_prepare_warnings.str);
7986+
std::string prepare_warning;
7987+
/*
7988+
If the warning is already present in the execute phase,
7989+
do not append it
7990+
*/
7991+
while (std::getline(prepare_warnings, prepare_warning))
7992+
{
7993+
std::string execute_warnings(ds_execute_warnings.str);
7994+
if ((execute_warnings + "\n").find(prepare_warning + "\n") ==
7995+
std::string::npos)
7996+
{
7997+
dynstr_append_mem(ds, prepare_warning.c_str(),
7998+
prepare_warning.length());
7999+
dynstr_append_mem(ds, "\n", 1);
8000+
}
8001+
}
8002+
}
79978003
if (ds_execute_warnings.length)
79988004
dynstr_append_mem(ds, ds_execute_warnings.str,
79998005
ds_execute_warnings.length);

cmake/bison.cmake

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Copyright (c) 2009 Sun Microsystems, Inc.
2-
# Use is subject to license terms.
1+
# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
32
#
43
# This program is free software; you can redistribute it and/or modify
54
# it under the terms of the GNU General Public License as published by
@@ -12,18 +11,13 @@
1211
#
1312
# You should have received a copy of the GNU General Public License
1413
# along with this program; if not, write to the Free Software
15-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1615

17-
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
18-
# On Solaris, /opt/csw often contains a newer bison
19-
IF(NOT BISON_EXECUTABLE AND EXISTS /opt/csw/bin/bison)
20-
SET(BISON_EXECUTABLE /opt/csw/bin/bison)
21-
ENDIF()
22-
ENDIF()
2316
FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
2417
MARK_AS_ADVANCED(BISON_EXECUTABLE "")
18+
2519
IF(NOT BISON_EXECUTABLE)
26-
MESSAGE("Warning: Bison executable not found in PATH")
20+
MESSAGE(WARNING "Bison executable not found in PATH")
2721
ELSEIF(BISON_EXECUTABLE AND NOT BISON_USABLE)
2822
# Check version as well
2923
EXEC_PROGRAM(${BISON_EXECUTABLE} ARGS --version OUTPUT_VARIABLE BISON_VERSION_STR)
@@ -33,19 +27,26 @@ ELSEIF(BISON_EXECUTABLE AND NOT BISON_USABLE)
3327
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\1" BISON_VERSION_MAJOR "${FIRST_LINE}")
3428
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\2" BISON_VERSION_MINOR "${FIRST_LINE}")
3529
IF (BISON_VERSION_MAJOR LESS 2)
36-
MESSAGE("Warning: bison version is old. please update to version 2")
30+
MESSAGE(WARNING "Bison version is old. please update to version 2")
3731
ELSE()
3832
SET(BISON_USABLE 1 CACHE INTERNAL "Bison version 2 or higher")
3933
ENDIF()
4034
ENDIF()
4135

36+
37+
# Handle out-of-source build from source package with possibly broken
38+
# bison. Copy bison output to from source to build directory, if not already
39+
# there
40+
MACRO(COPY_BISON_OUTPUT input_cc input_h output_cc output_h)
41+
IF(EXISTS ${input_cc} AND NOT EXISTS ${output_cc})
42+
CONFIGURE_FILE(${input_cc} ${output_cc} COPYONLY)
43+
CONFIGURE_FILE(${input_h} ${output_h} COPYONLY)
44+
ENDIF()
45+
ENDMACRO()
46+
47+
4248
# Use bison to generate C++ and header file
4349
MACRO (RUN_BISON input_yy output_cc output_h)
44-
IF(BISON_TOO_OLD)
45-
IF(EXISTS ${output_cc} AND EXISTS ${output_h})
46-
SET(BISON_USABLE FALSE)
47-
ENDIF()
48-
ENDIF()
4950
IF(BISON_USABLE)
5051
ADD_CUSTOM_COMMAND(
5152
OUTPUT ${output_cc}
@@ -61,7 +62,7 @@ MACRO (RUN_BISON input_yy output_cc output_h)
6162
IF(EXISTS ${output_cc} AND EXISTS ${output_h})
6263
IF(${input_yy} IS_NEWER_THAN ${output_cc} OR ${input_yy} IS_NEWER_THAN ${output_h})
6364
# Possibly timestamps are messed up in source distribution.
64-
MESSAGE("Warning: no usable bison found, ${input_yy} will not be rebuilt.")
65+
MESSAGE(WARNING "No usable bison found, ${input_yy} will not be rebuilt.")
6566
ENDIF()
6667
ELSE()
6768
# Output files are missing, bail out.

include/mysql_com.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2018, 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
@@ -587,6 +587,7 @@ void my_thread_end(void);
587587

588588
#ifdef MY_GLOBAL_INCLUDED
589589
ulong STDCALL net_field_length(uchar **packet);
590+
ulong STDCALL net_field_length_checked(uchar **packet, ulong max_length);
590591
my_ulonglong net_field_length_ll(uchar **packet);
591592
uchar *net_store_length(uchar *pkg, ulonglong length);
592593
#endif

include/sql_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ struct st_mysql_client_plugin;
114114
extern struct st_mysql_client_plugin *mysql_client_builtins[];
115115
uchar * send_client_connect_attrs(MYSQL *mysql, uchar *buf);
116116
extern my_bool libmysql_cleartext_plugin_enabled;
117+
int is_file_or_dir_world_writable(const char *filepath);
117118

118119
#ifdef __cplusplus
119120
}

libmysqld/CMakeLists.txt

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2018, 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
@@ -29,14 +29,26 @@ INCLUDE_DIRECTORIES(
2929
${CMAKE_SOURCE_DIR}/sql/backup
3030
)
3131

32+
# We should generate these separately for libmysqld to avoid
33+
# compiling them for libmysqld while they are generated for sql.
34+
SET(GEN_YACC_SOURCES
35+
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
36+
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
37+
)
38+
3239
SET(GEN_SOURCES
33-
${CMAKE_BINARY_DIR}/sql/sql_yacc.h
34-
${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
3540
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc
36-
${CMAKE_BINARY_DIR}/sql/lex_hash.h
3741
)
3842

39-
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED TRUE)
43+
ADD_CUSTOM_COMMAND(
44+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
45+
COMMAND gen_lex_hash > lex_hash.h
46+
DEPENDS gen_lex_hash
47+
)
48+
49+
SET_SOURCE_FILES_PROPERTIES(${GEN_YACC_SOURCES}
50+
${GEN_SOURCES}
51+
PROPERTIES GENERATED TRUE)
4052

4153
FOREACH(file ${SQL_EXPORTED_SOURCES})
4254
LIST(APPEND IMPORTED_SOURCES "../sql/${file}")
@@ -48,6 +60,7 @@ SET(SQL_EMBEDDED_SOURCES
4860
libmysqld.c
4961
${GEN_SOURCES}
5062
${MYSYS_LIBWRAP_SOURCE}
63+
${GEN_YACC_SOURCES}
5164
../client/get_password.c
5265
../libmysql/errmsg.c
5366
../libmysql/libmysql.c
@@ -79,9 +92,45 @@ SET(SQL_EMBEDDED_SOURCES
7992
)
8093

8194

95+
96+
# Handle out-of-source build from source package with possibly broken
97+
# bison. Copy bison output to from source to build directory, if not already
98+
# there
99+
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/bison.cmake)
100+
COPY_BISON_OUTPUT(
101+
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
102+
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
103+
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
104+
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
105+
)
106+
107+
RUN_BISON(
108+
${CMAKE_SOURCE_DIR}/sql/sql_yacc.yy
109+
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
110+
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
111+
)
112+
113+
ADD_CUSTOM_COMMAND(
114+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
115+
COMMAND gen_lex_token > lex_token.h
116+
DEPENDS gen_lex_token
117+
)
118+
119+
SET_SOURCE_FILES_PROPERTIES(
120+
${CMAKE_CURRENT_BINARY_DIR}/sql/lex_token.h
121+
PROPERTIES GENERATED 1)
122+
123+
SET_SOURCE_FILES_PROPERTIES(
124+
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
125+
${CMAKE_SOURCE_DIR}/sql/sql_digest.cc
126+
PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
127+
)
128+
129+
ADD_CUSTOM_TARGET(GenYaccEmbeddedSource DEPENDS ${GEN_YACC_SOURCES})
130+
82131
ADD_CONVENIENCE_LIBRARY(sql_embedded ${SQL_EMBEDDED_SOURCES})
83132
DTRACE_INSTRUMENT(sql_embedded)
84-
ADD_DEPENDENCIES(sql_embedded GenError GenServerSource)
133+
ADD_DEPENDENCIES(sql_embedded GenError GenServerSource GenYaccEmbeddedSource)
85134

86135
# On Windows, static embedded server library is called mysqlserver.lib
87136
# On Unix, it is libmysqld.a
@@ -93,8 +142,8 @@ ENDIF()
93142

94143

95144
SET(LIBS
96-
dbug strings regex mysys mysys_ssl vio
97-
${ZLIB_LIBRARY} ${SSL_LIBRARIES}
145+
dbug strings regex mysys mysys_ssl vio
146+
${ZLIB_LIBRARY} ${SSL_LIBRARIES}
98147
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
99148
${MYSQLD_STATIC_PLUGIN_LIBS}
100149
sql_embedded
@@ -112,6 +161,8 @@ FOREACH(LIB ${LIBS})
112161
ENDIF()
113162
ENDFOREACH()
114163

164+
LIST(REMOVE_DUPLICATES EMBEDDED_LIBS)
165+
115166
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
116167
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded)
117168

@@ -145,7 +196,7 @@ IF(WITH_EMBEDDED_SHARED_LIBRARY)
145196
)
146197

147198
GET_TARGET_PROPERTY(libmysqld_link_flags libmysqld LINK_FLAGS)
148-
IF(NOT libmysqld_link_flag)
199+
IF(NOT libmysqld_link_flags)
149200
SET(libmysqld_link_flags)
150201
ENDIF()
151202
SET(libmysqld_link_flags

mysql-test/collections/default.experimental

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ binlog.binlog_multi_engine # joro : NDB tests marked as experiment
66
funcs_1.charset_collation_1 # depends on compile-time decisions
77

88
main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2
9-
main.mysqlslap @windows # Bug#11761520 2010-08-10 alik mysqlslap fails sporadically starting from Dahlia
109

1110
main.index_merge_innodb # BUG#11754168 2012-05-08 jorgen Doing an attempt at reenabling tests disabled by bug. EXPLAIN's row estimates varies for innodb so marked experimental for a while
1211

mysql-test/extra/rpl_tests/rpl_row_idempotency.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ select * from ti1 order by b /* must be (2),(3) */;
121121

122122
--echo *** slave must stop (Trying to delete a referenced foreing key)
123123
connection slave;
124+
--let $slave_sql_errno= convert_error(ER_ROW_IS_REFERENCED_2)
124125
source include/wait_for_slave_sql_to_stop.inc;
125126

126127
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
@@ -155,6 +156,7 @@ insert into ti2 set a=3, b=3 /* offending write event */;
155156

156157
--echo *** slave must stop (Trying to insert an invalid foreign key)
157158
connection slave;
159+
--let $slave_sql_errno= convert_error(ER_NO_REFERENCED_ROW_2)
158160
source include/wait_for_slave_sql_to_stop.inc;
159161

160162
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
@@ -194,6 +196,7 @@ insert into ti1 set b=1 /* offending write event */;
194196

195197
--echo *** slave must stop (Trying to insert a dupliacte key)
196198
connection slave;
199+
--let $slave_sql_errno= convert_error(ER_DUP_ENTRY)
197200
source include/wait_for_slave_sql_to_stop.inc;
198201

199202
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
@@ -229,6 +232,7 @@ DELETE FROM t1 WHERE a = -2;
229232

230233
--echo *** slave must stop (Key was not found)
231234
connection slave;
235+
--let $slave_sql_errno= convert_error(ER_KEY_NOT_FOUND)
232236
source include/wait_for_slave_sql_to_stop.inc;
233237

234238
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);

mysql-test/extra/rpl_tests/rpl_start_stop_slave.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ START SLAVE;
204204
--let $status_items= Last_IO_Errno, Last_IO_Error
205205
--source include/show_slave_status.inc
206206

207+
--let $slave_io_errno= convert_error(ER_MASTER_FATAL_ERROR_READING_BINLOG)
207208
--source include/stop_slave.inc
208209
RESET SLAVE;
209210

mysql-test/include/mtr_warnings.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
1+
-- Copyright (c) 2008, 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
@@ -251,6 +251,12 @@ INSERT INTO global_suppressions VALUES
251251
*/
252252
("Insecure configuration for --secure-file-priv:*"),
253253

254+
/*
255+
Bug#26585560, warning related to --pid-file
256+
*/
257+
("Insecure configuration for --pid-file:*"),
258+
("Few location(s) are inaccessible while checking PID filepath"),
259+
254260
("THE_LAST_SUPPRESSION")||
255261

256262

0 commit comments

Comments
 (0)