Skip to content

Commit 4787707

Browse files
committed
Merge branch 'mysql-5.7' into mysql-5.7-cluster-7.6
Change-Id: I573a6db28a036d9fa2582e68b382edf7ef8fe45c
2 parents b8a031d + 48a0edd commit 4787707

File tree

8 files changed

+92
-13
lines changed

8 files changed

+92
-13
lines changed

CMakeLists.txt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,38 @@
2424
IF(WIN32)
2525
# CMake 2.8.12 is needed for Visual Studio 2013
2626
# CMake 3.1.0 is needed for $<TARGET_PDB_FILE:${target}>
27-
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
27+
# We add ...3.10 to keep cmake 4 happy.
28+
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0...3.10)
2829
ELSE()
2930
# There's a bug in unzipping prior to 2.8.2
3031
# Debian 7 has the oldest cmake we need to support
31-
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
32+
# We add ...3.10 to keep cmake 4 happy.
33+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9...3.10)
3234
ENDIF()
3335

3436
# We use CMAKE_SHARED_LIBRARY_<Lang>_FLAGS. See cmake --help-policy CMP0018
3537
IF(CMAKE_VERSION VERSION_GREATER "2.8.8")
36-
CMAKE_POLICY(SET CMP0018 OLD)
38+
IF(CMAKE_VERSION VERSION_LESS "4")
39+
CMAKE_POLICY(SET CMP0018 OLD)
40+
ENDIF()
3741
ENDIF()
3842

3943
# We use PROPERTIES LINK_INTERFACE_LIBRARIES. See cmake --help-policy CMP0022
4044
IF(CMAKE_VERSION VERSION_EQUAL "2.8.12" OR
4145
CMAKE_VERSION VERSION_GREATER "2.8.12")
42-
CMAKE_POLICY(SET CMP0022 OLD)
46+
IF(CMAKE_VERSION VERSION_LESS "4")
47+
CMAKE_POLICY(SET CMP0022 OLD)
48+
ENDIF()
4349
ENDIF()
4450

4551
# We use get_target_property() for non-existent targets (CMP0045)
4652
# and INSTALL_NAME_DIR (CMP0042)
4753
IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR
4854
CMAKE_VERSION VERSION_GREATER "3.0.0")
49-
CMAKE_POLICY(SET CMP0045 OLD)
50-
CMAKE_POLICY(SET CMP0042 OLD)
55+
IF(CMAKE_VERSION VERSION_LESS "4")
56+
CMAKE_POLICY(SET CMP0045 OLD)
57+
CMAKE_POLICY(SET CMP0042 OLD)
58+
ENDIF()
5159
ENDIF()
5260

5361
# In CMake 3.12 and above, the
@@ -63,6 +71,11 @@ IF(POLICY CMP0075)
6371
CMAKE_POLICY(SET CMP0075 OLD)
6472
ENDIF()
6573

74+
# The exec_program command should not be called
75+
IF(POLICY CMP0153)
76+
CMAKE_POLICY(SET CMP0153 OLD)
77+
ENDIF()
78+
6679
MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
6780

6881
# Will set GIT_EXECUTABLE and GIT_FOUND

cmake/build_configurations/feature_set.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2012, 2023, Oracle and/or its affiliates.
1+
# Copyright (c) 2012, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -26,7 +26,11 @@ SET(FEATURE_SET "community" CACHE STRING
2626
)
2727

2828
IF(FEATURE_SET AND NOT WITHOUT_SERVER)
29-
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
29+
# embedded server cannot be built,
30+
# MERGE_CONVENIENCE_LIBRARIES depends on unsupported policies
31+
IF(CMAKE_VERSION VERSION_LESS "4")
32+
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
33+
ENDIF()
3034

3135
# Set these ON by default. They can be disabled with
3236
# -DWITHOUT_${eng}_STORAGE_ENGINE

extra/libevent/libevent-2.1.11-stable/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# start libevent.sln
2020
#
2121

22-
cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
22+
# cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
2323

2424
if (POLICY CMP0054)
2525
cmake_policy(SET CMP0054 NEW)

rapid/plugin/group_replication/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2014, 2023, Oracle and/or its affiliates.
1+
# Copyright (c) 2014, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -214,6 +214,14 @@ ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
214214
"-Wno-unused-variable -Wno-unused-function -Wno-conversion -Wno-switch")
215215
ENDIF()
216216

217+
IF(SOLARIS AND MY_COMPILER_IS_GNU)
218+
# rpcgen generates 'void bzero();'
219+
ADD_COMPILE_FLAGS(${XCOM_RPCGEN_SOURCES}
220+
COMPILE_FLAGS
221+
"-Wno-builtin-declaration-mismatch"
222+
)
223+
ENDIF()
224+
217225
IF (WIN32)
218226
SET(LIBRARIES_TO_LINK ${LZ4_LIBRARY} ${SSL_LIBRARIES} ${TIRPC_LIBRARIES} crypt32)
219227
ELSE()

sql/item_func.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5108,7 +5108,7 @@ longlong Item_master_gtid_set_wait::val_int()
51085108
null_value= 1;
51095109
DBUG_RETURN(0);
51105110
}
5111-
mi= channel_map.get_mi(channel_str->ptr());
5111+
mi= channel_map.get_mi(channel_str->c_ptr_safe());
51125112
}
51135113
else
51145114
{

sql/sql_partition.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,12 @@ static bool handle_list_of_fields(List_iterator<char> it,
834834
for (i= 0; i < num_key_parts; i++)
835835
{
836836
Field *field= table->key_info[primary_key].key_part[i].field;
837+
// BLOB/TEXT columns are not allowed in partitioning keys.
838+
if (field->flags & BLOB_FLAG)
839+
{
840+
my_error(ER_BLOB_FIELD_IN_PART_FUNC_ERROR, MYF(0));
841+
DBUG_RETURN(TRUE);
842+
}
837843
field->flags|= GET_FIXED_FIELDS_FLAG;
838844
}
839845
}

sql/table.cc

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3241,8 +3241,15 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
32413241
{
32423242
Field *field= key_part->field= outparam->field[key_part->fieldnr-1];
32433243

3244+
/*
3245+
For spatial indexes, the key parts are assigned the length (4 *
3246+
sizeof(double)) in mysql_prepare_create_table() and the
3247+
field->key_length() is set to 0. This makes it appear like a prefixed
3248+
index. However, prefixed indexes are not allowed on Geometric columns.
3249+
Hence skipping new field creation for Geometric columns.
3250+
*/
32443251
if (field->key_length() != key_part->length &&
3245-
!(field->flags & BLOB_FLAG))
3252+
field->type() != MYSQL_TYPE_GEOMETRY)
32463253
{
32473254
/*
32483255
We are using only a prefix of the column as a key:
@@ -3512,6 +3519,37 @@ int closefrm(TABLE *table, bool free_share)
35123519
error=table->file->ha_close();
35133520
my_free((void *) table->alias);
35143521
table->alias= 0;
3522+
3523+
/*
3524+
Iterate through the Table's Key_info and free its key_part->field if the
3525+
field is of BLOB type.
3526+
3527+
When a prefixed key is present, a new Field object is created in
3528+
open_table_from_share(). These field objects get destroyed when the Table's
3529+
mem_root is cleared here later. In case of Field_blob objects,
3530+
Field_blob::value is allocated on the heap. Thus Field_blob objects are
3531+
freed here in order to destruct the Field_blob::value object.
3532+
*/
3533+
KEY *key_info= table->key_info;
3534+
if (key_info)
3535+
{
3536+
KEY_PART_INFO *key_part= key_info->key_part;
3537+
for (KEY *key_info_end= key_info + table->s->keys; key_info < key_info_end;
3538+
key_info++)
3539+
{
3540+
for (KEY_PART_INFO *key_part_end= key_part + key_info->actual_key_parts;
3541+
key_part < key_part_end; key_part++)
3542+
{
3543+
if (key_part->field && (key_part->field->flags & BLOB_FLAG) &&
3544+
key_part->field->type() != MYSQL_TYPE_GEOMETRY)
3545+
{
3546+
delete key_part->field;
3547+
key_part->field= 0;
3548+
}
3549+
}
3550+
}
3551+
}
3552+
35153553
if (table->field)
35163554
{
35173555
for (Field **ptr=table->field ; *ptr ; ptr++)

storage/innobase/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2023, Oracle and/or its affiliates.
1+
# Copyright (c) 2006, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -194,6 +194,16 @@ IF(MY_COMPILER_IS_GNU AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11)
194194
COMPILE_FLAGS "-Wno-free-nonheap-object")
195195
ENDIF()
196196

197+
# On linux: /usr/include/stdio.h:#define BUFSIZ 8192
198+
# On Solaris: /usr/include/iso/stdio_iso.h:#define BUFSIZ 1024
199+
IF(SOLARIS AND MY_COMPILER_IS_GNU)
200+
ADD_COMPILE_FLAGS(
201+
row/row0import.cc
202+
row/row0quiesce.cc
203+
COMPILE_FLAGS "-Wno-format-truncation"
204+
)
205+
ENDIF()
206+
197207
MY_CHECK_CXX_COMPILER_FLAG("-Wcast-function-type" HAVE_CAST_FUNCTION_TYPE)
198208
IF(HAVE_CAST_FUNCTION_TYPE)
199209
ADD_COMPILE_FLAGS(fts/fts0pars.cc

0 commit comments

Comments
 (0)