Skip to content

Commit d6c5e7e

Browse files
committed
Merge branch '10.1' of https://github.com/MariaDB/server into ok-debpkg-10.1
2 parents b9fee60 + 67dbfab commit d6c5e7e

File tree

943 files changed

+17417
-9192
lines changed

Some content is hidden

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

943 files changed

+17417
-9192
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*.dat -text -whitespace
1616

1717
storage/connect/mysql-test/connect/std_data/*.txt -text
18+
pcre/testdata/greppatN4 -text
1819

1920
# Denote all files that are truly binary and should not be modified.
2021
*.png binary

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
277277
*.vcproj.*
278278
*.vcproj.*.*
279279
*.vcproj.*.*.*
280+
*.vcxproj
281+
*.vcxproj.*
282+
*.vcxproj.*.*
283+
*.vcxproj.*.*.*
280284

281285
# Build results
282286
[Dd]ebug/

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ IF(WIN32)
401401
ADD_SUBDIRECTORY(win/upgrade_wizard)
402402
ADD_SUBDIRECTORY(win/packaging)
403403
ENDIF()
404-
ADD_SUBDIRECTORY(packaging/solaris)
405404

406405

407406
INCLUDE(for_clients)

client/mysql_upgrade.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ int main(int argc, char **argv)
11091109
printf("This installation of MySQL is already upgraded to %s, "
11101110
"use --force if you still need to run mysql_upgrade\n",
11111111
MYSQL_SERVER_VERSION);
1112-
die(NULL);
1112+
goto end;
11131113
}
11141114

11151115
if (opt_version_check && check_version_match())
@@ -1138,6 +1138,7 @@ int main(int argc, char **argv)
11381138

11391139
DBUG_ASSERT(phase == phases_total);
11401140

1141+
end:
11411142
free_used_memory();
11421143
my_end(my_end_arg);
11431144
exit(0);

client/mysqlbinlog.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ static Exit_status check_header(IO_CACHE* file,
22402240
Format_description_log_event *new_description_event;
22412241
my_b_seek(file, tmp_pos); /* seek back to event's start */
22422242
if (!(new_description_event= (Format_description_log_event*)
2243-
Log_event::read_log_event(file, glob_description_event,
2243+
Log_event::read_log_event(file, 0, glob_description_event,
22442244
opt_verify_binlog_checksum)))
22452245
/* EOF can't be hit here normally, so it's a real error */
22462246
{
@@ -2274,7 +2274,7 @@ static Exit_status check_header(IO_CACHE* file,
22742274
{
22752275
Log_event *ev;
22762276
my_b_seek(file, tmp_pos); /* seek back to event's start */
2277-
if (!(ev= Log_event::read_log_event(file, glob_description_event,
2277+
if (!(ev= Log_event::read_log_event(file, 0, glob_description_event,
22782278
opt_verify_binlog_checksum)))
22792279
{
22802280
/* EOF can't be hit here normally, so it's a real error */
@@ -2388,7 +2388,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
23882388
char llbuff[21];
23892389
my_off_t old_off = my_b_tell(file);
23902390

2391-
Log_event* ev = Log_event::read_log_event(file, glob_description_event,
2391+
Log_event* ev = Log_event::read_log_event(file, 0, glob_description_event,
23922392
opt_verify_binlog_checksum);
23932393
if (!ev)
23942394
{
@@ -2575,6 +2575,11 @@ void *sql_alloc(size_t size)
25752575
return alloc_root(&s_mem_root, size);
25762576
}
25772577

2578+
struct encryption_service_st encryption_handler=
2579+
{
2580+
0, 0, 0, 0, 0, 0, 0
2581+
};
2582+
25782583
/*
25792584
We must include this here as it's compiled with different options for
25802585
the server

client/mysqlimport.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
/* Global Thread counter */
39-
uint counter;
39+
uint counter= 0;
4040
pthread_mutex_t counter_mutex;
4141
pthread_cond_t count_threshhold;
4242

@@ -489,6 +489,11 @@ static void safe_exit(int error, MYSQL *mysql)
489489
{
490490
if (error && ignore_errors)
491491
return;
492+
493+
/* in multi-threaded mode protect from concurrent safe_exit's */
494+
if (counter)
495+
pthread_mutex_lock(&counter_mutex);
496+
492497
if (mysql)
493498
mysql_close(mysql);
494499

client/mysqlslap.c

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
Copyright (c) 2005, 2012, Oracle and/or its affiliates.
2+
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
3+
Copyright (c) 2010, 2015, MariaDB
34
45
This program is free software; you can redistribute it and/or modify
56
it under the terms of the GNU General Public License as published by
@@ -242,7 +243,7 @@ void print_conclusions_csv(conclusions *con);
242243
void generate_stats(conclusions *con, option_string *eng, stats *sptr);
243244
uint parse_comma(const char *string, uint **range);
244245
uint parse_delimiter(const char *script, statement **stmt, char delm);
245-
uint parse_option(const char *origin, option_string **stmt, char delm);
246+
int parse_option(const char *origin, option_string **stmt, char delm);
246247
static int drop_schema(MYSQL *mysql, const char *db);
247248
uint get_random_string(char *buf);
248249
static statement *build_table_string(void);
@@ -1264,7 +1265,13 @@ get_options(int *argc,char ***argv)
12641265
if (num_int_cols_opt)
12651266
{
12661267
option_string *str;
1267-
parse_option(num_int_cols_opt, &str, ',');
1268+
if(parse_option(num_int_cols_opt, &str, ',') == -1)
1269+
{
1270+
fprintf(stderr, "Invalid value specified for the option "
1271+
"'number-int-cols'\n");
1272+
option_cleanup(str);
1273+
return 1;
1274+
}
12681275
num_int_cols= atoi(str->string);
12691276
if (str->option)
12701277
num_int_cols_index= atoi(str->option);
@@ -1275,7 +1282,13 @@ get_options(int *argc,char ***argv)
12751282
if (num_char_cols_opt)
12761283
{
12771284
option_string *str;
1278-
parse_option(num_char_cols_opt, &str, ',');
1285+
if(parse_option(num_char_cols_opt, &str, ',') == -1)
1286+
{
1287+
fprintf(stderr, "Invalid value specified for the option "
1288+
"'number-char-cols'\n");
1289+
option_cleanup(str);
1290+
return 1;
1291+
}
12791292
num_char_cols= atoi(str->string);
12801293
if (str->option)
12811294
num_char_cols_index= atoi(str->option);
@@ -1512,7 +1525,13 @@ get_options(int *argc,char ***argv)
15121525
printf("Parsing engines to use.\n");
15131526

15141527
if (default_engine)
1515-
parse_option(default_engine, &engine_options, ',');
1528+
{
1529+
if(parse_option(default_engine, &engine_options, ',') == -1)
1530+
{
1531+
fprintf(stderr, "Invalid value specified for the option 'engine'\n");
1532+
return 1;
1533+
}
1534+
}
15161535

15171536
if (tty_password)
15181537
opt_password= get_tty_password(NullS);
@@ -1989,7 +2008,7 @@ pthread_handler_t run_task(void *p)
19892008
DBUG_RETURN(0);
19902009
}
19912010

1992-
uint
2011+
int
19932012
parse_option(const char *origin, option_string **stmt, char delm)
19942013
{
19952014
char *retstr;
@@ -2014,6 +2033,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
20142033
char buffer[HUGE_STRING_LENGTH]= "";
20152034
char *buffer_ptr;
20162035

2036+
/*
2037+
Return an error if the length of the any of the comma seprated value
2038+
exceeds HUGE_STRING_LENGTH.
2039+
*/
2040+
if ((size_t)(retstr - ptr) > HUGE_STRING_LENGTH)
2041+
return -1;
2042+
20172043
count++;
20182044
strncpy(buffer, ptr, (size_t)(retstr - ptr));
20192045
/*
@@ -2053,6 +2079,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
20532079
{
20542080
char *origin_ptr;
20552081

2082+
/*
2083+
Return an error if the length of the any of the comma seprated value
2084+
exceeds HUGE_STRING_LENGTH.
2085+
*/
2086+
if (strlen(ptr) > HUGE_STRING_LENGTH)
2087+
return -1;
2088+
20562089
if ((origin_ptr= strchr(ptr, ':')))
20572090
{
20582091
char *option_ptr;
@@ -2063,13 +2096,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
20632096
option_ptr= (char *)ptr + 1 + tmp->length;
20642097

20652098
/* Move past the : and the first string */
2066-
tmp->option_length= (size_t)((ptr + length) - option_ptr);
2099+
tmp->option_length= strlen(option_ptr);
20672100
tmp->option= my_strndup(option_ptr, tmp->option_length,
20682101
MYF(MY_FAE));
20692102
}
20702103
else
20712104
{
2072-
tmp->length= (size_t)((ptr + length) - ptr);
2105+
tmp->length= strlen(ptr);
20732106
tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE));
20742107
}
20752108

cmake/check_compiler_flag.cmake

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ SET(fail_patterns
99
FAIL_REGEX "unrecognized .*option"
1010
FAIL_REGEX "ignoring unknown option"
1111
FAIL_REGEX "warning:.*ignored"
12+
FAIL_REGEX "warning:.*is valid for.*but not for"
1213
FAIL_REGEX "warning:.*redefined"
1314
FAIL_REGEX "[Ww]arning: [Oo]ption"
1415
)
1516

16-
MACRO (MY_CHECK_C_COMPILER_FLAG flag result)
17+
MACRO (MY_CHECK_C_COMPILER_FLAG flag)
18+
STRING(REGEX REPLACE "[-,= ]" "_" result "HAVE_C_${flag}")
1719
SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
1820
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
1921
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${result}
2022
${fail_patterns})
2123
SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}")
2224
ENDMACRO()
2325

24-
MACRO (MY_CHECK_CXX_COMPILER_FLAG flag result)
26+
MACRO (MY_CHECK_CXX_COMPILER_FLAG flag)
27+
STRING(REGEX REPLACE "[-,= ]" "_" result "HAVE_CXX_${flag}")
2528
SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
2629
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
2730
CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result}
@@ -35,10 +38,11 @@ FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag)
3538
IF(WIN32)
3639
RETURN()
3740
ENDIF()
38-
MY_CHECK_C_COMPILER_FLAG(${flag} HAVE_C_${flag})
39-
MY_CHECK_CXX_COMPILER_FLAG(${flag} HAVE_CXX_${flag})
41+
MY_CHECK_C_COMPILER_FLAG(${flag})
42+
MY_CHECK_CXX_COMPILER_FLAG(${flag})
43+
STRING(REGEX REPLACE "[-,= ]" "_" result "${flag}")
4044
FOREACH(lang C CXX)
41-
IF (HAVE_${lang}_${flag})
45+
IF (HAVE_${lang}_${result})
4246
IF(ARGN)
4347
FOREACH(type ${ARGN})
4448
SET(CMAKE_${lang}_FLAGS_${type} "${CMAKE_${lang}_FLAGS_${type}} ${flag}" PARENT_SCOPE)

cmake/maintainer.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
# Common warning flags for GCC, G++, Clang and Clang++
1717
SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security -Wno-init-self")
18-
MY_CHECK_C_COMPILER_FLAG("-Wvla" HAVE_WVLA) # Requires GCC 4.3+ or Clang
19-
IF(HAVE_WVLA)
18+
MY_CHECK_C_COMPILER_FLAG("-Wvla") # Requires GCC 4.3+ or Clang
19+
IF(HAVE_C__Wvla)
2020
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla")
2121
ENDIF()
2222

cmake/ssl.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ MACRO (MYSQL_CHECK_SSL)
147147
IF (WITH_SSL_PATH)
148148
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
149149
ENDIF()
150-
MESSAGE(STATUS "suffixes <${CMAKE_FIND_LIBRARY_SUFFIXES}>")
151150
FIND_LIBRARY(OPENSSL_LIBRARIES
152151
NAMES ssl ssleay32 ssleay32MD
153152
HINTS ${OPENSSL_ROOT_DIR}/lib)

0 commit comments

Comments
 (0)