Index: CMakeLists.txt
--- CMakeLists.txt.orig	2019-04-13 15:32:15.000000000 +0200
+++ CMakeLists.txt	2019-04-25 09:01:12.480468000 +0200
@@ -680,12 +680,10 @@
 ENDIF()
 
 IF(NOT WITHOUT_SERVER)
-  ADD_SUBDIRECTORY(testclients)
   ADD_SUBDIRECTORY(sql)
   OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
   IF(WITH_EMBEDDED_SERVER) 
    ADD_SUBDIRECTORY(libmysqld)
-   ADD_SUBDIRECTORY(libmysqld/examples)
   ENDIF(WITH_EMBEDDED_SERVER)
 ENDIF()
 
@@ -694,18 +692,9 @@
 ADD_SUBDIRECTORY(scripts)
 
 IF(NOT WITHOUT_SERVER)
-  ADD_SUBDIRECTORY(mysql-test)
-  ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
-  ADD_SUBDIRECTORY(support-files)
   IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt)
     ADD_SUBDIRECTORY(internal)
   ENDIF()
-  ADD_SUBDIRECTORY(packaging/rpm-common)
-  ADD_SUBDIRECTORY(packaging/rpm-oel)
-  ADD_SUBDIRECTORY(packaging/rpm-fedora)
-  ADD_SUBDIRECTORY(packaging/rpm-sles)
-  ADD_SUBDIRECTORY(packaging/rpm-docker)
-  ADD_SUBDIRECTORY(packaging/deb-in)
 ENDIF()
 
 INCLUDE(cmake/abi_check.cmake)
@@ -754,6 +743,7 @@
 #
 # RPM installs documentation directly from the source tree
 #
+IF(FALSE)
 IF(NOT INSTALL_LAYOUT MATCHES "RPM")
   INSTALL(FILES COPYING LICENSE.mysql 
   DESTINATION ${INSTALL_DOCREADMEDIR} 
@@ -776,6 +766,7 @@
     PATTERN "sp-imp-spec.txt" EXCLUDE
   )
 ENDIF()
+ENDIF()
 
 INCLUDE(CPack)
 
Index: cmake/boost.cmake
--- cmake/boost.cmake.orig	2019-04-13 15:32:15.000000000 +0200
+++ cmake/boost.cmake	2019-04-25 09:01:12.480623000 +0200
@@ -262,9 +262,9 @@
   COULD_NOT_FIND_BOOST()
 ENDIF()
 
-IF(NOT BOOST_MINOR_VERSION EQUAL 59)
+IF(NOT BOOST_MINOR_VERSION EQUAL 71)
   MESSAGE(WARNING "Boost minor version found is ${BOOST_MINOR_VERSION} "
-    "we need 59"
+    "we need 81"
     )
   COULD_NOT_FIND_BOOST()
 ENDIF()
Index: cmake/build_configurations/compiler_options.cmake
--- cmake/build_configurations/compiler_options.cmake.orig	2019-04-13 15:32:15.000000000 +0200
+++ cmake/build_configurations/compiler_options.cmake	2019-04-25 09:01:12.480757000 +0200
@@ -30,7 +30,7 @@
 
   # Default GCC flags
   IF(CMAKE_COMPILER_IS_GNUCC)
-    SET(COMMON_C_FLAGS               "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing")
+    SET(COMMON_C_FLAGS               "-g -fno-omit-frame-pointer -fno-strict-aliasing")
     # Disable inline optimizations for valgrind testing to avoid false positives
     IF(WITH_VALGRIND)
       SET(COMMON_C_FLAGS             "-fno-inline ${COMMON_C_FLAGS}")
@@ -54,7 +54,7 @@
     SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
   ENDIF()
   IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET(COMMON_CXX_FLAGS               "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing")
+    SET(COMMON_CXX_FLAGS               "-g -fno-omit-frame-pointer -fno-strict-aliasing")
     # GCC 6 has C++14 as default, set it explicitly to the old default.
     EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
                     OUTPUT_VARIABLE GXX_VERSION)
Index: cmake/plugin.cmake
--- cmake/plugin.cmake.orig	2019-04-25 09:01:12.480926000 +0200
+++ cmake/plugin.cmake	2019-04-25 09:06:23.606782000 +0200
@@ -271,9 +271,6 @@
       MYSQL_INSTALL_TARGETS(${target}
         DESTINATION ${INSTALL_PLUGINDIR}
         COMPONENT ${INSTALL_COMPONENT})
-      INSTALL_DEBUG_TARGET(${target}
-        DESTINATION ${INSTALL_PLUGINDIR}/debug
-        COMPONENT ${INSTALL_COMPONENT})
       # Add installed files to list for RPMs
       FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files
               "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n"
Index: include/CMakeLists.txt
--- include/CMakeLists.txt.orig	2019-04-13 15:32:15.000000000 +0200
+++ include/CMakeLists.txt	2019-04-25 09:01:12.481101000 +0200
@@ -38,6 +38,7 @@
 
 SET(HEADERS 
   ${HEADERS_ABI} 
+  hash.h
   my_dbug.h 
   m_string.h
   my_sys.h 
Index: include/my_compare.h
--- include/my_compare.h.orig	2019-04-13 15:32:15.000000000 +0200
+++ include/my_compare.h	2019-04-25 09:01:12.481213000 +0200
@@ -40,7 +40,7 @@
   But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
 */
 
-#define HA_MAX_KEY_LENGTH           1000        /* Max length in bytes */
+#define HA_MAX_KEY_LENGTH           4000        /* Max length in bytes */
 #define HA_MAX_KEY_SEG              16          /* Max segments for key */
 
 #define HA_MAX_POSSIBLE_KEY_BUFF    (HA_MAX_KEY_LENGTH + 24+ 6+6)
Index: include/my_global.h
--- include/my_global.h.orig	2019-04-13 15:32:15.000000000 +0200
+++ include/my_global.h	2019-04-25 09:01:12.481395000 +0200
@@ -673,7 +673,7 @@
 }
 #endif /* _WIN32 */
 
-#ifndef HAVE_STRUCT_TIMESPEC /* Windows before VS2015 */
+#if !defined(HAVE_STRUCT_TIMESPEC) && !defined(__FreeBSD__) /* Windows before VS2015 */
 /*
   Declare a union to make sure FILETIME is properly aligned
   so it can be used directly as a 64 bit value. The value
@@ -698,7 +698,7 @@
 
 static inline void set_timespec_nsec(struct timespec *abstime, ulonglong nsec)
 {
-#ifdef HAVE_STRUCT_TIMESPEC
+#if defined(HAVE_STRUCT_TIMESPEC) || defined(__FreeBSD__)
   ulonglong now= my_getsystime() + (nsec / 100);
   ulonglong tv_sec= now / 10000000ULL;
 #if SIZEOF_TIME_T < SIZEOF_LONG_LONG
@@ -734,7 +734,7 @@
 */
 static inline int cmp_timespec(struct timespec *ts1, struct timespec *ts2)
 {
-#ifdef HAVE_STRUCT_TIMESPEC
+#if defined(HAVE_STRUCT_TIMESPEC) || defined(__FreeBSD__)
   if (ts1->tv_sec > ts2->tv_sec ||
       (ts1->tv_sec == ts2->tv_sec && ts1->tv_nsec > ts2->tv_nsec))
     return 1;
@@ -752,7 +752,7 @@
 
 static inline ulonglong diff_timespec(struct timespec *ts1, struct timespec *ts2)
 {
-#ifdef HAVE_STRUCT_TIMESPEC
+#if defined(HAVE_STRUCT_TIMESPEC) || defined(__FreeBSD__)
   return (ts1->tv_sec - ts2->tv_sec) * 1000000000ULL +
     ts1->tv_nsec - ts2->tv_nsec;
 #else
Index: include/my_thread_os_id.h
--- include/my_thread_os_id.h.orig	2019-04-13 15:32:15.000000000 +0200
+++ include/my_thread_os_id.h	2019-04-25 09:01:12.481505000 +0200
@@ -82,7 +82,7 @@
 #else
 #ifdef HAVE_INTEGER_PTHREAD_SELF
   /* Unknown platform, fallback. */
-  return pthread_self();
+  return (my_thread_os_id_t)pthread_self();
 #else
   /* Feature not available. */
   return 0;
Index: include/myisam.h
--- include/myisam.h.orig	2019-04-13 15:32:15.000000000 +0200
+++ include/myisam.h	2019-04-25 09:01:12.481653000 +0200
@@ -45,7 +45,7 @@
   The following defines can be increased if necessary.
   But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.
 */
-#define MI_MAX_KEY_LENGTH           1000            /* Max length in bytes */
+#define MI_MAX_KEY_LENGTH           4000            /* Max length in bytes */
 #define MI_MAX_KEY_SEG              16              /* Max segments for key */
 
 #define MI_MAX_KEY_BUFF  (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)
Index: man/CMakeLists.txt
--- man/CMakeLists.txt.orig	2019-04-13 15:32:15.000000000 +0200
+++ man/CMakeLists.txt	2019-04-25 09:01:12.481767000 +0200
@@ -15,8 +15,6 @@
 
 # Copy man pages
 FILE(GLOB MAN1_FILES *.1)
-FILE(GLOB MAN1_EXCLUDE make_win_bin_dist.1)
-FILE(GLOB MAN1_NDB ndb*.1)
 FILE(GLOB MAN8_FILES *.8)
 FILE(GLOB MAN8_NDB ndb*.8)
 IF(MAN1_FILES)
Index: mysys/CMakeLists.txt
--- mysys/CMakeLists.txt.orig	2019-04-13 15:32:15.000000000 +0200
+++ mysys/CMakeLists.txt	2019-04-25 09:01:12.481879000 +0200
@@ -74,14 +74,3 @@
   TARGET_LINK_LIBRARIES(mysys pthread)
 ENDIF()
 
-ADD_EXECUTABLE(thr_lock thr_lock.c)
-TARGET_LINK_LIBRARIES(thr_lock mysys)
-SET_TARGET_PROPERTIES(thr_lock PROPERTIES COMPILE_FLAGS "-DMAIN")
-ADD_EXECUTABLE(queues queues.c)
-TARGET_LINK_LIBRARIES(queues mysys)
-SET_TARGET_PROPERTIES(queues PROPERTIES COMPILE_FLAGS "-DMAIN")
-ADD_TEST(queues_test queues)
-
-ADD_EXECUTABLE(base64_test base64.c)
-SET_TARGET_PROPERTIES(base64_test PROPERTIES COMPILE_FLAGS "-DMAIN")
-TARGET_LINK_LIBRARIES(base64_test mysys)
Index: mysys/charset-def.c
--- mysys/charset-def.c.orig	2019-04-13 15:32:15.000000000 +0200
+++ mysys/charset-def.c	2019-04-25 09:01:12.482008000 +0200
@@ -13,6 +13,8 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
 
+#include "my_global.h"
+
 #include "mysys_priv.h"
 #include "my_sys.h"
 
Index: mysys/thr_lock.c
--- mysys/thr_lock.c.orig	2019-04-13 15:32:15.000000000 +0200
+++ mysys/thr_lock.c	2019-04-25 09:01:12.482242000 +0200
@@ -69,6 +69,7 @@
 
 #include "mysys_priv.h"
 #include "my_sys.h"
+#include "my_thread.h"
 #include "thr_lock.h"
 #include "mysql/psi/mysql_table.h"
 #include <m_string.h>
Index: mysys_ssl/my_default.cc
--- mysys_ssl/my_default.cc.orig	2019-04-13 15:32:15.000000000 +0200
+++ mysys_ssl/my_default.cc	2019-04-25 09:01:12.482489000 +0200
@@ -114,7 +114,7 @@
 
 /* Which directories are searched for options (and in which order) */
 
-#define MAX_DEFAULT_DIRS 6
+#define MAX_DEFAULT_DIRS 7
 #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1)  /* Terminate with NULL */
 static const char **default_directories = NULL;
 
@@ -1492,7 +1492,7 @@
   MY_STAT stat_info;
 
   if (!my_stat(file_name,&stat_info,MYF(0)))
-    return 1;
+    return 0;
   /*
     Ignore .mylogin.cnf file if not exclusively readable/writable
     by current user.
Index: plugin/keyring/CMakeLists.txt
--- plugin/keyring/CMakeLists.txt.orig	2019-04-13 15:32:15.000000000 +0200
+++ plugin/keyring/CMakeLists.txt	2019-04-25 09:01:12.482602000 +0200
@@ -35,6 +35,7 @@
                  ${KEYRING_FILE_SOURCES}
                  MODULE_ONLY
                  MODULE_OUTPUT_NAME "keyring_file")
+add_library(keyring_file buffer.cc buffered_file_io.cc file_io.cc hash_to_buffer_serializer.cc keyring.cc)
 
 IF(SSL_DEFINES)
   ADD_DEFINITIONS(${SSL_DEFINES})
Index: plugin/keyring/keyring.cc
--- plugin/keyring/keyring.cc.orig	2019-04-13 15:32:15.000000000 +0200
+++ plugin/keyring/keyring.cc	2019-04-25 09:01:12.482717000 +0200
@@ -13,6 +13,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
 
+#include <my_config.h>
 #include <my_global.h>
 #include <mysql/plugin_keyring.h>
 #include "keyring.h"
Index: plugin/password_validation/validate_password.cc
--- plugin/password_validation/validate_password.cc.orig	2019-04-13 15:32:15.000000000 +0200
+++ plugin/password_validation/validate_password.cc	2019-04-25 09:01:12.482895000 +0200
@@ -18,6 +18,8 @@
 #include <mysql/plugin_validate_password.h>
 #include <mysql/service_my_plugin_log.h>
 #include <mysql/service_mysql_string.h>
+/* solve clash between libc++ bitset::test() and test macro from my_global.h */
+#undef test
 #include <set>
 #include <iostream>
 #include <fstream>
Index: scripts/CMakeLists.txt
--- scripts/CMakeLists.txt.orig	2019-04-13 15:32:15.000000000 +0200
+++ scripts/CMakeLists.txt	2019-04-25 09:01:12.483038000 +0200
@@ -346,8 +346,8 @@
   GET_TARGET_PROPERTY(LIBMYSQL_OS_SHLIB_VERSION mysqlclient VERSION)
   GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME mysqlclient OUTPUT_NAME)
 ELSE()
-  GET_TARGET_PROPERTY(LIBMYSQL_OS_SHLIB_VERSION libmysql VERSION)
-  GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME libmysql OUTPUT_NAME)
+  GET_TARGET_PROPERTY(LIBMYSQL_OS_SHLIB_VERSION mysqlclient VERSION)
+  GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME mysqlclient OUTPUT_NAME)
 ENDIF()
 # See WITH_EMBEDDED_SHARED_LIBRARY, "mysqld" is generated from mysqlserver
 IF(WITH_EMBEDDED_SERVER)
Index: scripts/mysql_config.sh
--- scripts/mysql_config.sh.orig	2019-04-13 15:32:15.000000000 +0200
+++ scripts/mysql_config.sh	2019-04-25 09:01:12.483156000 +0200
@@ -111,12 +111,12 @@
 
 # Create options 
 libs="@QUOTED_CMAKE_CXX_LINK_FLAGS@-L$pkglibdir@RPATH_OPTION@"
-libs="$libs -l@LIBMYSQL_OS_OUTPUT_NAME@ @CONFIG_CLIENT_LIBS@"
+libs="$libs -l@LIBMYSQL_OS_OUTPUT_NAME@ -lstdc++ @CONFIG_CLIENT_LIBS@"
 embedded_libs="@QUOTED_CMAKE_CXX_LINK_FLAGS@-L$pkglibdir@RPATH_OPTION@"
 embedded_libs="$embedded_libs -l@LIBEMBED_OS_OUTPUT_NAME@ @CONFIG_EMBEDD_LIBS@"
 
-cflags="-I$pkgincludedir @CFLAGS@"
-cxxflags="-I$pkgincludedir @CXXFLAGS@"
+cflags="-pthread -I$pkgincludedir @CFLAGS@"
+cxxflags="-pthread -I$pkgincludedir @CXXFLAGS@"
 include="-I$pkgincludedir"
 
 
Index: scripts/mysqlclient.pc.in
--- scripts/mysqlclient.pc.in.orig	2019-04-13 15:32:15.000000000 +0200
+++ scripts/mysqlclient.pc.in	2019-04-25 09:01:12.483254000 +0200
@@ -20,7 +20,7 @@
 Name: @LIBMYSQL_OS_OUTPUT_NAME@
 Description: MySQL client library
 Version: @LIBMYSQL_OS_SHLIB_VERSION@
-Cflags: -I${includedir} @CFLAGS@
+Cflags: -pthread -I${includedir} @CFLAGS@
 Libs: -L${libdir} -l@LIBMYSQL_OS_OUTPUT_NAME@
-Libs.private: @QUOTED_CMAKE_CXX_LINK_FLAGS@ @CONFIG_LIBS_PRIVATE@
+Libs.private: @QUOTED_CMAKE_CXX_LINK_FLAGS@ -lstdc++ @CONFIG_LIBS_PRIVATE@
 Requires.private: @CONFIG_REQUIRES_PRIVATE@
Index: sql/item_geofunc_internal.cc
--- sql/item_geofunc_internal.cc.orig	2019-04-13 15:32:15.000000000 +0200
+++ sql/item_geofunc_internal.cc	2019-04-25 09:01:12.483414000 +0200
@@ -34,11 +34,13 @@
   {
     my_error(ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION, MYF(0), funcname);
   }
+#if 0
   catch (const boost::geometry::detail::self_get_turn_points::self_ip_exception &)
   {
     my_error(ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION, MYF(0),
              funcname);
   }
+#endif
   catch (const boost::geometry::empty_input_exception &)
   {
     my_error(ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION, MYF(0), funcname);
Index: sql/share/CMakeLists.txt
--- sql/share/CMakeLists.txt.orig	2019-04-13 15:32:15.000000000 +0200
+++ sql/share/CMakeLists.txt	2019-04-25 09:01:12.483523000 +0200
@@ -14,30 +14,7 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 SET (dirs 
-danish
-german 
-slovak
-dutch
-greek
-norwegian
-spanish
 english
-hungarian
-norwegian-ny
-swedish
-italian
-polish
-ukrainian
-japanese
-portuguese
-romanian
-estonian 
-korean
-russian
-czech
-french
-serbian
-bulgarian
 )
 
 SET(files 
Index: sql/sql_view.cc
--- sql/sql_view.cc.orig	2019-04-13 15:32:15.000000000 +0200
+++ sql/sql_view.cc	2019-04-25 09:01:12.483812000 +0200
@@ -778,46 +778,46 @@
 */
 static File_option view_parameters[]=
 {{{ C_STRING_WITH_LEN("query")},
-  my_offsetof(TABLE_LIST, select_stmt),
+  static_cast<int>(my_offsetof(TABLE_LIST, select_stmt)),
   FILE_OPTIONS_ESTRING},
  {{ C_STRING_WITH_LEN("md5")},
-  my_offsetof(TABLE_LIST, md5),
+  static_cast<int>(my_offsetof(TABLE_LIST, md5)),
   FILE_OPTIONS_STRING},
  {{ C_STRING_WITH_LEN("updatable")},
-  my_offsetof(TABLE_LIST, updatable_view),
+  static_cast<int>(my_offsetof(TABLE_LIST, updatable_view)),
   FILE_OPTIONS_ULONGLONG},
  {{ C_STRING_WITH_LEN("algorithm")},
-  my_offsetof(TABLE_LIST, algorithm),
+  static_cast<int>(my_offsetof(TABLE_LIST, algorithm)),
   FILE_OPTIONS_ULONGLONG},
  {{ C_STRING_WITH_LEN("definer_user")},
-  my_offsetof(TABLE_LIST, definer.user),
+  static_cast<int>(my_offsetof(TABLE_LIST, definer.user)),
   FILE_OPTIONS_STRING},
  {{ C_STRING_WITH_LEN("definer_host")},
-  my_offsetof(TABLE_LIST, definer.host),
+  static_cast<int>(my_offsetof(TABLE_LIST, definer.host)),
   FILE_OPTIONS_STRING},
  {{ C_STRING_WITH_LEN("suid")},
-  my_offsetof(TABLE_LIST, view_suid),
+  static_cast<int>(my_offsetof(TABLE_LIST, view_suid)),
   FILE_OPTIONS_ULONGLONG},
  {{ C_STRING_WITH_LEN("with_check_option")},
-  my_offsetof(TABLE_LIST, with_check),
+  static_cast<int>(my_offsetof(TABLE_LIST, with_check)),
   FILE_OPTIONS_ULONGLONG},
  {{ C_STRING_WITH_LEN("timestamp")},
-  my_offsetof(TABLE_LIST, timestamp),
+  static_cast<int>(my_offsetof(TABLE_LIST, timestamp)),
   FILE_OPTIONS_TIMESTAMP},
  {{ C_STRING_WITH_LEN("create-version")},
-  my_offsetof(TABLE_LIST, file_version),
+  static_cast<int>(my_offsetof(TABLE_LIST, file_version)),
   FILE_OPTIONS_ULONGLONG},
  {{ C_STRING_WITH_LEN("source")},
-  my_offsetof(TABLE_LIST, source),
+  static_cast<int>(my_offsetof(TABLE_LIST, source)),
   FILE_OPTIONS_ESTRING},
  {{(char*) STRING_WITH_LEN("client_cs_name")},
-  my_offsetof(TABLE_LIST, view_client_cs_name),
+  static_cast<int>(my_offsetof(TABLE_LIST, view_client_cs_name)),
   FILE_OPTIONS_STRING},
  {{(char*) STRING_WITH_LEN("connection_cl_name")},
-  my_offsetof(TABLE_LIST, view_connection_cl_name),
+  static_cast<int>(my_offsetof(TABLE_LIST, view_connection_cl_name)),
   FILE_OPTIONS_STRING},
  {{(char*) STRING_WITH_LEN("view_body_utf8")},
-  my_offsetof(TABLE_LIST, view_body_utf8),
+  static_cast<int>(my_offsetof(TABLE_LIST, view_body_utf8)),
   FILE_OPTIONS_ESTRING},
  {{NullS, 0},			0,
   FILE_OPTIONS_STRING}
Index: sql/sys_vars.cc
--- sql/sys_vars.cc.orig	2019-04-13 15:32:15.000000000 +0200
+++ sql/sys_vars.cc	2019-04-25 09:01:12.484472000 +0200
@@ -1741,7 +1741,7 @@
        "connection before closing it",
        SESSION_VAR(net_interactive_timeout),
        CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
+       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
 
 static Sys_var_ulong Sys_join_buffer_size(
        "join_buffer_size",
@@ -2621,7 +2621,7 @@
        "Number of seconds to wait for more data from a connection before "
        "aborting the read",
        SESSION_VAR(net_read_timeout), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1),
+       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1),
        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
        ON_UPDATE(fix_net_read_timeout));
 
@@ -2645,7 +2645,7 @@
        "Number of seconds to wait for a block to be written to a connection "
        "before aborting the write",
        SESSION_VAR(net_write_timeout), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1),
+       VALID_RANGE(1, INT_MAX32/1000), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1),
        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
        ON_UPDATE(fix_net_write_timeout));
 
@@ -4369,7 +4369,7 @@
        "The number of seconds the server waits for activity on a "
        "connection before closing it",
        SESSION_VAR(net_wait_timeout), CMD_LINE(REQUIRED_ARG),
-       VALID_RANGE(1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT)),
+       VALID_RANGE(1, INT_MAX32/1000),
        DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
 
 static Sys_var_plugin Sys_default_storage_engine(
