Skip to content

Commit 213ece2

Browse files
committed
Merge 10.1 into 10.1
This is joint work with Oleksandr Byelkin.
2 parents c1e1764 + d9d83f1 commit 213ece2

File tree

101 files changed

+2761
-7443
lines changed

Some content is hidden

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

101 files changed

+2761
-7443
lines changed

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,14 @@ ENDIF()
241241

242242
MY_CHECK_AND_SET_COMPILER_FLAG(-ggdb3 DEBUG)
243243

244-
OPTION(ENABLED_LOCAL_INFILE
245-
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
244+
SET(ENABLED_LOCAL_INFILE "AUTO" CACHE STRING "If we should should enable LOAD DATA LOCAL by default (OFF/ON/AUTO)")
245+
IF (ENABLED_LOCAL_INFILE MATCHES "^(0|FALSE)$")
246+
SET(ENABLED_LOCAL_INFILE OFF)
247+
ELSEIF(ENABLED_LOCAL_INFILE MATCHES "^(1|TRUE)$")
248+
SET(ENABLED_LOCAL_INFILE ON)
249+
ELSEIF (NOT ENABLED_LOCAL_INFILE MATCHES "^(ON|OFF|AUTO)$")
250+
MESSAGE(FATAL_ERROR "ENABLED_LOCAL_INFILE must be one of OFF, ON, AUTO")
251+
ENDIF()
246252

247253
OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF)
248254
MARK_AS_ADVANCED(WITH_FAST_MUTEXES)

client/mysqltest.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6075,7 +6075,6 @@ void do_connect(struct st_command *command)
60756075
#endif
60766076
if (opt_compress || con_compress)
60776077
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
6078-
mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
60796078
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
60806079
charset_info->csname);
60816080
if (opt_charsets_dir)
@@ -6175,6 +6174,11 @@ void do_connect(struct st_command *command)
61756174
if (con_slot == next_con)
61766175
next_con++; /* if we used the next_con slot, advance the pointer */
61776176
}
6177+
else // Failed to connect. Free the memory.
6178+
{
6179+
mysql_close(con_slot->mysql);
6180+
con_slot->mysql= NULL;
6181+
}
61786182

61796183
dynstr_free(&ds_connection_name);
61806184
dynstr_free(&ds_host);
@@ -9175,7 +9179,6 @@ int main(int argc, char **argv)
91759179
(void *) &opt_connect_timeout);
91769180
if (opt_compress)
91779181
mysql_options(con->mysql,MYSQL_OPT_COMPRESS,NullS);
9178-
mysql_options(con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
91799182
mysql_options(con->mysql, MYSQL_SET_CHARSET_NAME,
91809183
charset_info->csname);
91819184
if (opt_charsets_dir)

cmake/build_configurations/mysql_release.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ IF(FEATURE_SET)
8383
ENDIF()
8484
ENDIF()
8585

86-
OPTION(ENABLED_LOCAL_INFILE "" ON)
8786
SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
8887
IF(WIN32)
8988
SET(WITH_LIBARCHIVE STATIC CACHE STRING "")

cmake/ssl.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,20 @@ MACRO (MYSQL_CHECK_SSL)
177177
ENDIF()
178178

179179
INCLUDE(CheckSymbolExists)
180+
INCLUDE(CheckCSourceCompiles)
180181
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
181182
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
182183
HAVE_SHA512_DIGEST_LENGTH)
184+
CHECK_C_SOURCE_COMPILES("
185+
#include <openssl/dh.h>
186+
int main()
187+
{
188+
DH dh;
189+
return sizeof(dh.version);
190+
}" OLD_OPENSSL_API)
183191
SET(CMAKE_REQUIRED_INCLUDES)
184192
IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND
185-
OPENSSL_MAJOR_VERSION STRLESS "101" AND
193+
OLD_OPENSSL_API AND
186194
CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
187195

188196
SET(SSL_SOURCES "")

config.h.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,11 @@
544544
/*
545545
MySQL features
546546
*/
547-
#cmakedefine ENABLED_LOCAL_INFILE 1
547+
#define LOCAL_INFILE_MODE_OFF 0
548+
#define LOCAL_INFILE_MODE_ON 1
549+
#define LOCAL_INFILE_MODE_AUTO 2
550+
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_@ENABLED_LOCAL_INFILE@
551+
548552
#cmakedefine ENABLED_PROFILING 1
549553
#cmakedefine EXTRA_DEBUG 1
550554
#cmakedefine CYBOZU 1

include/my_valgrind.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
4343
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
4444
#else
45-
# define MEM_UNDEFINED(a,len) ((void) 0)
45+
# define MEM_UNDEFINED(a,len) ((void) (a), (void) (len))
4646
# define MEM_NOACCESS(a,len) ((void) 0)
4747
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
4848
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
@@ -51,7 +51,7 @@
5151
#ifndef DBUG_OFF
5252
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
5353
#else
54-
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp __attribute__((unused))= (B); MEM_UNDEFINED(A,trash_tmp); } while (0)
54+
#define TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
5555
#endif
5656
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
5757
#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)

include/mysql.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ typedef struct st_mysql
287287

288288
/* session-wide random string */
289289
char scramble[SCRAMBLE_LENGTH+1];
290-
my_bool unused1;
290+
my_bool auto_local_infile;
291291
void *unused2, *unused3, *unused4, *unused5;
292292

293293
LIST *stmts; /* list of all statements */

include/mysql.h.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
my_bool free_me;
351351
my_bool reconnect;
352352
char scramble[20 +1];
353-
my_bool unused1;
353+
my_bool auto_local_infile;
354354
void *unused2, *unused3, *unused4, *unused5;
355355
LIST *stmts;
356356
const struct st_mysql_methods *methods;

mysql-test/disabled.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ innodb-wl5522-debug-zip : broken upstream
2121
innodb_bug12902967 : broken upstream
2222
file_contents : MDEV-6526 these files are not installed anymore
2323
max_statement_time : cannot possibly work, depends on timing
24+
partition_open_files_limit : open_files_limit check broken by MDEV-18360

0 commit comments

Comments
 (0)