Skip to content

Commit 4771ae4

Browse files
committed
Merge branch 'github/10.1' into 10.2
2 parents 60f51af + 0c25e58 commit 4771ae4

File tree

466 files changed

+9384
-3636
lines changed

Some content is hidden

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

466 files changed

+9384
-3636
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ ENDIF()
4949
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
5050
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel")
5151

52-
# MAX_INDEXES - Set the maximum number of indexes per table, default 64U
52+
# MAX_INDEXES - Set the maximum number of indexes per table, default 64
5353
IF (NOT MAX_INDEXES)
54-
SET(MAX_INDEXES 64U)
54+
SET(MAX_INDEXES 64)
5555
ENDIF(NOT MAX_INDEXES)
5656

5757
IF (${MAX_INDEXES} GREATER 128)

CREDITS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ organization registered in the USA.
33

44
The current main sponsors of the MariaDB Foundation are:
55

6-
Alibaba Cloud https://intl.aliyun.com (2017)
6+
Alibaba Cloud https://www.alibabacloud.com/ (2017)
77
Booking.com https://www.booking.com (2013)
8+
Microsoft https://microsoft.com/ (2017)
89
Tencent Cloud https://cloud.tencent.com (2017)
910
Development Bank of Singapore https://dbs.com (2016)
1011
IBM https://www.ibm.com (2017)

client/mysql.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,7 @@ int main(int argc,char *argv[])
11401140
current_prompt = my_strdup(default_prompt,MYF(MY_WME));
11411141
prompt_counter=0;
11421142
aborted= 0;
1143+
sf_leaking_memory= 1; /* no memory leak reports yet */
11431144

11441145
outfile[0]=0; // no (default) outfile
11451146
strmov(pager, "stdout"); // the default, if --pager wasn't given
@@ -1205,6 +1206,7 @@ int main(int argc,char *argv[])
12051206
my_end(0);
12061207
exit(1);
12071208
}
1209+
sf_leaking_memory= 0;
12081210
glob_buffer.realloc(512);
12091211
completion_hash_init(&ht, 128);
12101212
init_alloc_root(&hash_mem_root, 16384, 0, MYF(0));
@@ -1799,10 +1801,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
17991801
#ifndef EMBEDDED_LIBRARY
18001802
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
18011803
opt->name)) <= 0)
1802-
{
1803-
sf_leaking_memory= 1; /* no memory leak reports here */
18041804
exit(1);
1805-
}
18061805
#endif
18071806
break;
18081807
case OPT_SERVER_ARG:
@@ -4597,8 +4596,11 @@ static char *get_arg(char *line, get_arg_mode mode)
45974596
}
45984597
for (start=ptr ; *ptr; ptr++)
45994598
{
4600-
if ((*ptr == '\\' && ptr[1]) || // escaped character
4601-
(!short_cmd && qtype && *ptr == qtype && ptr[1] == qtype)) // quote
4599+
/* if short_cmd use historical rules (only backslash) otherwise SQL rules */
4600+
if (short_cmd
4601+
? (*ptr == '\\' && ptr[1]) // escaped character
4602+
: (*ptr == '\\' && ptr[1] && qtype != '`') || // escaped character
4603+
(qtype && *ptr == qtype && ptr[1] == qtype)) // quote
46024604
{
46034605
// Remove (or skip) the backslash (or a second quote)
46044606
if (mode != CHECK)

client/mysqltest.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,6 @@ static void cleanup_and_exit(int exit_code)
15661566
}
15671567
}
15681568

1569-
sf_leaking_memory= 0; /* all memory should be freed by now */
15701569
exit(exit_code);
15711570
}
15721571

@@ -7293,10 +7292,7 @@ get_one_option(int optid, const struct my_option *opt, char *argument)
72937292
#ifndef EMBEDDED_LIBRARY
72947293
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
72957294
opt->name)) <= 0)
7296-
{
7297-
sf_leaking_memory= 1; /* no memory leak reports here */
72987295
exit(1);
7299-
}
73007296
#endif
73017297
break;
73027298
case '?':

cmake/build_configurations/mysql_release.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2018, MariaDB Corporation
23
#
34
# This program is free software; you can redistribute it and/or modify
45
# it under the terms of the GNU General Public License as published by

cmake/check_compiler_flag.cmake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ MACRO (MY_CHECK_CXX_COMPILER_FLAG flag)
3232
SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}")
3333
ENDMACRO()
3434

35-
FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag)
35+
FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag_to_set)
3636
# At the moment this is gcc-only.
3737
# Let's avoid expensive compiler tests on Windows:
3838
IF(WIN32)
3939
RETURN()
4040
ENDIF()
41-
MY_CHECK_C_COMPILER_FLAG(${flag})
42-
MY_CHECK_CXX_COMPILER_FLAG(${flag})
43-
STRING(REGEX REPLACE "[-,= +]" "_" result "${flag}")
41+
STRING(REGEX REPLACE "^-Wno-" "-W" flag_to_check ${flag_to_set})
42+
MY_CHECK_C_COMPILER_FLAG(${flag_to_check})
43+
MY_CHECK_CXX_COMPILER_FLAG(${flag_to_check})
44+
STRING(REGEX REPLACE "[-,= +]" "_" result "${flag_to_check}")
4445
FOREACH(lang C CXX)
4546
IF (have_${lang}_${result})
4647
IF(ARGN)
4748
FOREACH(type ${ARGN})
48-
SET(CMAKE_${lang}_FLAGS_${type} "${CMAKE_${lang}_FLAGS_${type}} ${flag}" PARENT_SCOPE)
49+
SET(CMAKE_${lang}_FLAGS_${type} "${CMAKE_${lang}_FLAGS_${type}} ${flag_to_set}" PARENT_SCOPE)
4950
ENDFOREACH()
5051
ELSE()
51-
SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} ${flag}" PARENT_SCOPE)
52+
SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} ${flag_to_set}" PARENT_SCOPE)
5253
ENDIF()
5354
ENDIF()
5455
ENDFOREACH()
5556
ENDFUNCTION()
56-

cmake/maintainer.cmake

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,32 @@
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

1616
# Common warning flags for GCC, G++, Clang and Clang++
17-
SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security -Wno-init-self")
18-
MY_CHECK_C_COMPILER_FLAG("-Wvla") # Requires GCC 4.3+ or Clang
19-
IF(have_C__Wvla)
20-
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla")
21-
ENDIF()
22-
23-
MY_CHECK_C_COMPILER_FLAG("-Wno-format-truncation")
24-
IF(HAVE_C__Wno_format_truncation)
25-
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wno-format-truncation")
26-
ENDIF()
27-
28-
# Common warning flags for GCC and Clang
29-
SET(MY_C_WARNING_FLAGS
30-
"${MY_WARNING_FLAGS} -Wwrite-strings -Wdeclaration-after-statement")
31-
32-
# Common warning flags for G++ and Clang++
33-
SET(MY_CXX_WARNING_FLAGS
34-
"${MY_WARNING_FLAGS} -Woverloaded-virtual -Wno-unused-parameter")
35-
36-
# Extra warning flags for Clang++
37-
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
38-
SET(MY_CXX_WARNING_FLAGS
39-
"${MY_CXX_WARNING_FLAGS} -Wno-null-conversion -Wno-unused-private-field")
40-
ENDIF()
41-
42-
# Turn on Werror (warning => error) when using maintainer mode.
43-
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
44-
SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror")
45-
SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror")
46-
ENDIF()
47-
48-
# Set warning flags for GCC/Clang
49-
IF(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
50-
SET(MY_MAINTAINER_C_WARNINGS "${MY_C_WARNING_FLAGS}")
51-
ENDIF()
52-
# Set warning flags for G++/Clang++
53-
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
54-
SET(MY_MAINTAINER_CXX_WARNINGS "${MY_CXX_WARNING_FLAGS}")
55-
ENDIF()
17+
SET(MY_WARNING_FLAGS
18+
-Wall
19+
-Wdeclaration-after-statement
20+
-Wextra
21+
-Wformat-security
22+
-Wno-format-truncation
23+
-Wno-init-self
24+
-Wno-nonnull-compare
25+
-Wno-null-conversion
26+
-Wno-unused-parameter
27+
-Wno-unused-private-field
28+
-Woverloaded-virtual
29+
-Wvla
30+
-Wwrite-strings
31+
)
5632

5733
IF(MYSQL_MAINTAINER_MODE MATCHES "ON")
58-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_MAINTAINER_C_WARNINGS}")
59-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_MAINTAINER_CXX_WARNINGS}")
34+
SET(WHERE)
6035
ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
61-
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${MY_MAINTAINER_C_WARNINGS}")
62-
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MY_MAINTAINER_CXX_WARNINGS}")
36+
SET(WHERE DEBUG)
6337
ENDIF()
6438

39+
FOREACH(F ${MY_WARNING_FLAGS})
40+
MY_CHECK_AND_SET_COMPILER_FLAG(${F} ${WHERE})
41+
ENDFOREACH()
42+
6543
IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
6644
STRING(REPLACE " -E " " -E -dDI " CMAKE_C_CREATE_PREPROCESSED_SOURCE ${CMAKE_C_CREATE_PREPROCESSED_SOURCE})
6745
ENDIF()

config.h.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
#cmakedefine HAVE_CLOCK_GETTIME 1
132132
#cmakedefine HAVE_CRYPT 1
133133
#cmakedefine HAVE_CUSERID 1
134+
#cmakedefine HAVE_DLADDR 1
134135
#cmakedefine HAVE_DLERROR 1
135136
#cmakedefine HAVE_DLOPEN 1
136137
#cmakedefine HAVE_FCHMOD 1

configure.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ CHECK_FUNCTION_EXISTS (cuserid HAVE_CUSERID)
329329
CHECK_FUNCTION_EXISTS (ftruncate HAVE_FTRUNCATE)
330330
CHECK_FUNCTION_EXISTS (compress HAVE_COMPRESS)
331331
CHECK_FUNCTION_EXISTS (crypt HAVE_CRYPT)
332+
CHECK_FUNCTION_EXISTS (dladdr HAVE_DLADDR)
332333
CHECK_FUNCTION_EXISTS (dlerror HAVE_DLERROR)
333334
CHECK_FUNCTION_EXISTS (dlopen HAVE_DLOPEN)
334335
CHECK_FUNCTION_EXISTS (fchmod HAVE_FCHMOD)
@@ -379,7 +380,6 @@ CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK)
379380
CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK)
380381
CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP)
381382
CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV)
382-
CHECK_FUNCTION_EXISTS (readdir_r HAVE_READDIR_R)
383383
CHECK_FUNCTION_EXISTS (readlink HAVE_READLINK)
384384
CHECK_FUNCTION_EXISTS (realpath HAVE_REALPATH)
385385
CHECK_FUNCTION_EXISTS (rename HAVE_RENAME)
@@ -416,6 +416,16 @@ IF(HAVE_SYS_EVENT_H)
416416
CHECK_FUNCTION_EXISTS (kqueue HAVE_KQUEUE)
417417
ENDIF()
418418

419+
# readdir_r might exist, but be marked deprecated
420+
SET(CMAKE_REQUIRED_FLAGS -Werror)
421+
CHECK_CXX_SOURCE_COMPILES(
422+
"#include <dirent.h>
423+
int main() {
424+
readdir_r(0,0,0);
425+
return 0;
426+
}" HAVE_READDIR_R)
427+
SET(CMAKE_REQUIRED_FLAGS)
428+
419429
#--------------------------------------------------------------------
420430
# Support for WL#2373 (Use cycle counter for timing)
421431
#--------------------------------------------------------------------

debian/additions/debian-start.inc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function check_root_accounts() {
7272

7373
logger -p daemon.info -i -t$0 "Checking for insecure root accounts."
7474

75-
ret=$( echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='';" | $MYSQL --skip-column-names )
75+
ret=$( echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='' and plugin in ('', 'mysql_native_password', 'mysql_old_password');" | $MYSQL --skip-column-names )
7676
if [ "$ret" -ne "0" ]; then
7777
logger -p daemon.warn -i -t$0 "WARNING: mysql.user contains $ret root accounts without password!"
7878
fi

0 commit comments

Comments
 (0)