Skip to content

Commit f8fa5fe

Browse files
committed
Commit merge resolve
2 parents 9dee994 + f7002c0 commit f8fa5fe

File tree

2,253 files changed

+165318
-72833
lines changed

Some content is hidden

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

2,253 files changed

+165318
-72833
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Explicitly declare text files you want to always be normalized and converted
55
# to native line endings on checkout.
66
*.c text
7+
*.ic text
78
*.cc text
89
*.cpp text
910
*.h text

.gitignore

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Edited by Olivier Bertrand
22
*-t
3-
*.a
43
*.ctest
5-
*.o
64
*.reject
7-
*.so
8-
*.so.*
95
*.spec
106
*~
117
*.bak
@@ -144,6 +140,8 @@ sql-bench/test-select
144140
sql-bench/test-table-elimination
145141
sql-bench/test-transactions
146142
sql-bench/test-wisconsin
143+
sql/lex_token.h
144+
sql/gen_lex_token
147145
sql/gen_lex_hash
148146
sql/lex_hash.h
149147
sql/mysql_tzinfo_to_sql
@@ -172,8 +170,6 @@ storage/myisam/myisamlog
172170
storage/myisam/myisampack
173171
storage/myisam/rt_test
174172
storage/myisam/sp_test
175-
storage/perfschema/gen_pfs_lex_token
176-
storage/perfschema/pfs_lex_token.h
177173
storage/tokudb/ft-index/buildheader/db.h
178174
storage/tokudb/ft-index/buildheader/make_tdb
179175
storage/tokudb/ft-index/buildheader/runcat.sh
@@ -199,10 +195,6 @@ storage/tokudb/ft-index/tools/tokudb_dump
199195
storage/tokudb/ft-index/tools/tokudb_gen
200196
storage/tokudb/ft-index/tools/tokudb_load
201197
storage/tokudb/ft-index/tools/tokuftdump
202-
storage/tokudb/ft-index/ft/ftverify
203-
storage/tokudb/ft-index/ft/tdb-recover
204-
storage/tokudb/ft-index/ft/tdb_logprint
205-
storage/tokudb/ft-index/ft/tokuftdump
206198
storage/tokudb/ft-index/xz/
207199
support-files/MySQL-shared-compat.spec
208200
support-files/binary-configure
@@ -236,6 +228,8 @@ storage/mroonga/vendor/groonga/src/grnslap
236228
storage/mroonga/vendor/groonga/src/groonga
237229
storage/mroonga/vendor/groonga/src/groonga-benchmark
238230
storage/mroonga/vendor/groonga/src/suggest/groonga-suggest-create-dataset
231+
storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result
232+
storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
239233
# C and C++
240234

241235
# Compiled Object files

BUILD/SETUP.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ fi
157157
# Set flags for various build configurations.
158158
# Used in -valgrind builds
159159
# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
160-
# LINT_INIT(), which is only useful for silencing spurious warnings
161-
# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
160+
# UNINIT_VAR(), which is only useful for silencing spurious warnings
161+
# of static analysis tools. We want UNINIT_VAR() to be a no-op in Valgrind.
162162
valgrind_flags="-DHAVE_valgrind -USAFEMALLOC"
163163
valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized"
164164
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"

CMakeLists.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,7 @@ IF(SECURITY_HARDENED)
206206
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
207207
MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
208208
MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4")
209-
210-
# sometimes _FORTIFY_SOURCE is predefined
211-
INCLUDE(CheckSymbolExists)
212-
CHECK_SYMBOL_EXISTS(_FORTIFY_SOURCE "" HAVE_FORTIFY_SOURCE)
213-
IF(NOT HAVE_FORTIFY_SOURCE)
214-
ADD_DEFINITIONS(-D_FORTIFY_SOURCE=2)
215-
ENDIF()
209+
MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
216210
ENDIF()
217211

218212
OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
@@ -236,7 +230,6 @@ MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
236230

237231
OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP})
238232
IF (WITH_INNODB_DISALLOW_WRITES)
239-
MESSAGE(STATUS "INNODB_DISALLOW_WRITES")
240233
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
241234
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
242235
ENDIF()
@@ -335,6 +328,11 @@ CHECK_JEMALLOC()
335328

336329
CHECK_PCRE()
337330

331+
IF(CMAKE_CROSSCOMPILING)
332+
SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build")
333+
INCLUDE(${IMPORT_EXECUTABLES})
334+
ENDIF()
335+
338336
#
339337
# Setup maintainer mode options. Platform checks are
340338
# not run with the warning options as to not perturb fragile checks
@@ -413,7 +411,7 @@ ADD_SUBDIRECTORY(support-files)
413411
IF(NOT CMAKE_CROSSCOMPILING)
414412
SET(EXPORTED comp_err comp_sql factorial)
415413
IF(NOT WITHOUT_SERVER)
416-
SET(EXPORTED ${EXPORTED} gen_lex_hash gen_pfs_lex_token)
414+
SET(EXPORTED ${EXPORTED} gen_lex_hash gen_lex_token)
417415
ENDIF()
418416
# minimal target to build only binaries for export
419417
ADD_CUSTOM_TARGET(import_executables DEPENDS ${EXPORTED})
@@ -427,7 +425,8 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
427425
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
428426
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
429427
CONFIGURE_FILE(
430-
${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY)
428+
${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in
429+
${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY)
431430

432431
IF(DEB)
433432
CONFIGURE_FILE(
@@ -439,7 +438,7 @@ ENDIF(DEB)
439438
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
440439
# Source: This can be done during the cmake phase, all information is
441440
# available, but should be repeated on each "make" just in case someone
442-
# does "cmake ; make ; bzr pull ; make".
441+
# does "cmake ; make ; git pull ; make".
443442
CREATE_INFO_SRC(${CMAKE_BINARY_DIR}/Docs)
444443
ADD_CUSTOM_TARGET(INFO_SRC ALL
445444
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/info_src.cmake

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=10
22
MYSQL_VERSION_MINOR=1
3-
MYSQL_VERSION_PATCH=3
3+
MYSQL_VERSION_PATCH=5
44
MYSQL_VERSION_EXTRA=

client/mysql.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,9 +3040,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
30403040
init_pager();
30413041
char last_char= 0;
30423042

3043-
int num_name= 0, num_cat= 0;
3044-
LINT_INIT(num_name);
3045-
LINT_INIT(num_cat);
3043+
int UNINIT_VAR(num_name), UNINIT_VAR(num_cat);
30463044

30473045
if (num_fields == 2)
30483046
{
@@ -3179,7 +3177,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
31793177
}
31803178

31813179
/* Remove garbage for nicer messages */
3182-
LINT_INIT(buff[0]);
3180+
LINT_INIT_STRUCT(buff[0]);
31833181
remove_cntrl(*buffer);
31843182

31853183
if (buffer->is_empty())
@@ -4698,8 +4696,7 @@ com_status(String *buffer __attribute__((unused)),
46984696
const char *status_str;
46994697
char buff[40];
47004698
ulonglong id;
4701-
MYSQL_RES *result;
4702-
LINT_INIT(result);
4699+
MYSQL_RES *UNINIT_VAR(result);
47034700

47044701
if (mysql_real_query_for_lazy(
47054702
C_STRING_WITH_LEN("select DATABASE(), USER() limit 1")))
@@ -5258,8 +5255,7 @@ static void init_username()
52585255
my_free(full_username);
52595256
my_free(part_username);
52605257

5261-
MYSQL_RES *result;
5262-
LINT_INIT(result);
5258+
MYSQL_RES *UNINIT_VAR(result);
52635259
if (!mysql_query(&mysql,"select USER()") &&
52645260
(result=mysql_use_result(&mysql)))
52655261
{

client/mysql_upgrade.c

Lines changed: 99 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2006, 2013, Oracle and/or its affiliates.
3-
Copyright (c) 2010, 2013, Monty Program Ab.
3+
Copyright (c) 2010, 2015, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@
3636
# endif
3737
#endif
3838

39+
static int phase = 0;
40+
static int phases_total = 6;
3941
static char mysql_path[FN_REFLEN];
4042
static char mysqlcheck_path[FN_REFLEN];
4143

@@ -45,6 +47,8 @@ static my_bool opt_not_used, opt_silent;
4547
static uint my_end_arg= 0;
4648
static char *opt_user= (char*)"root";
4749

50+
static my_bool upgrade_from_mysql;
51+
4852
static DYNAMIC_STRING ds_args;
4953
static DYNAMIC_STRING conn_args;
5054

@@ -206,12 +210,12 @@ static void die(const char *fmt, ...)
206210
}
207211

208212

209-
static int verbose(const char *fmt, ...)
213+
static void verbose(const char *fmt, ...)
210214
{
211215
va_list args;
212216

213217
if (opt_silent)
214-
return 0;
218+
return;
215219

216220
/* Print the verbose message */
217221
va_start(args, fmt);
@@ -222,7 +226,6 @@ static int verbose(const char *fmt, ...)
222226
fflush(stdout);
223227
}
224228
va_end(args);
225-
return 0;
226229
}
227230

228231

@@ -754,10 +757,21 @@ static void print_conn_args(const char *tool_name)
754757
in the server using "mysqlcheck --check-upgrade .."
755758
*/
756759

757-
static int run_mysqlcheck_upgrade(const char *arg1, const char *arg2)
760+
static int run_mysqlcheck_upgrade(my_bool mysql_db_only)
758761
{
762+
const char *what= mysql_db_only ? "mysql database" : "tables";
763+
const char *arg1= mysql_db_only ? "--databases" : "--all-databases";
764+
const char *arg2= mysql_db_only ? "mysql" : "--skip-database=mysql";
765+
int retch;
766+
if (opt_systables_only && !mysql_db_only)
767+
{
768+
verbose("Phase %d/%d: Checking and upgrading %s... Skipped",
769+
++phase, phases_total, what);
770+
return 0;
771+
}
772+
verbose("Phase %d/%d: Checking and upgrading %s", ++phase, phases_total, what);
759773
print_conn_args("mysqlcheck");
760-
return run_tool(mysqlcheck_path,
774+
retch= run_tool(mysqlcheck_path,
761775
NULL, /* Send output from mysqlcheck directly to screen */
762776
"--no-defaults",
763777
ds_args.str,
@@ -771,12 +785,77 @@ static int run_mysqlcheck_upgrade(const char *arg1, const char *arg2)
771785
arg1, arg2,
772786
"2>&1",
773787
NULL);
788+
return retch;
774789
}
775790

791+
#define EVENTS_STRUCT_LEN 7000
792+
793+
static my_bool is_mysql()
794+
{
795+
my_bool ret= TRUE;
796+
DYNAMIC_STRING ds_events_struct;
797+
798+
if (init_dynamic_string(&ds_events_struct, NULL,
799+
EVENTS_STRUCT_LEN, EVENTS_STRUCT_LEN))
800+
die("Out of memory");
801+
802+
if (run_query("show create table mysql.event",
803+
&ds_events_struct, FALSE) ||
804+
strstr(ds_events_struct.str, "IGNORE_BAD_TABLE_OPTIONS") != NULL)
805+
ret= FALSE;
806+
else
807+
verbose("MySQL upgrade detected");
808+
809+
dynstr_free(&ds_events_struct);
810+
return(ret);
811+
}
812+
813+
static int run_mysqlcheck_views(void)
814+
{
815+
const char *upgrade_views="--process-views=YES";
816+
if (upgrade_from_mysql)
817+
{
818+
/*
819+
this has to ignore opt_systables_only, because upgrade_from_mysql
820+
is determined by analyzing systables. if we honor opt_systables_only
821+
here, views won't be fixed by subsequent mysql_upgrade runs
822+
*/
823+
upgrade_views="--process-views=UPGRADE_FROM_MYSQL";
824+
verbose("Phase %d/%d: Fixing views from mysql", ++phase, phases_total);
825+
}
826+
else if (opt_systables_only)
827+
{
828+
verbose("Phase %d/%d: Fixing views... Skipped", ++phase, phases_total);
829+
return 0;
830+
}
831+
else
832+
verbose("Phase %d/%d: Fixing views", ++phase, phases_total);
833+
834+
print_conn_args("mysqlcheck");
835+
return run_tool(mysqlcheck_path,
836+
NULL, /* Send output from mysqlcheck directly to screen */
837+
"--no-defaults",
838+
ds_args.str,
839+
"--all-databases", "--repair",
840+
upgrade_views,
841+
"--skip-process-tables",
842+
opt_verbose ? "--verbose": "",
843+
opt_silent ? "--silent": "",
844+
opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
845+
"2>&1",
846+
NULL);
847+
}
776848

777849
static int run_mysqlcheck_fixnames(void)
778850
{
779-
verbose("Phase 3/5: Fixing table and database names");
851+
if (opt_systables_only)
852+
{
853+
verbose("Phase %d/%d: Fixing table and database names ... Skipped",
854+
++phase, phases_total);
855+
return 0;
856+
}
857+
verbose("Phase %d/%d: Fixing table and database names",
858+
++phase, phases_total);
780859
print_conn_args("mysqlcheck");
781860
return run_tool(mysqlcheck_path,
782861
NULL, /* Send output from mysqlcheck directly to screen */
@@ -864,6 +943,9 @@ static int run_sql_fix_privilege_tables(void)
864943
if (init_dynamic_string(&ds_result, "", 512, 512))
865944
die("Out of memory");
866945

946+
verbose("Phase %d/%d: Running 'mysql_fix_privilege_tables'",
947+
++phase, phases_total);
948+
867949
/*
868950
Individual queries can not be executed independently by invoking
869951
a forked mysql client, because the script uses session variables
@@ -1033,23 +1115,19 @@ int main(int argc, char **argv)
10331115
if (opt_version_check && check_version_match())
10341116
die("Upgrade failed");
10351117

1118+
upgrade_from_mysql= is_mysql();
1119+
10361120
/*
10371121
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
10381122
*/
1039-
verbose("Phase 1/5: Checking mysql database");
1040-
if (run_mysqlcheck_upgrade("--databases", "mysql"))
1041-
die("Upgrade failed" );
1042-
verbose("Phase 2/5: Running 'mysql_fix_privilege_tables'...");
1043-
if (run_sql_fix_privilege_tables())
1123+
if (run_mysqlcheck_upgrade(TRUE) ||
1124+
run_mysqlcheck_views() ||
1125+
run_sql_fix_privilege_tables() ||
1126+
run_mysqlcheck_fixnames() ||
1127+
run_mysqlcheck_upgrade(FALSE))
10441128
die("Upgrade failed" );
10451129

1046-
if (!opt_systables_only &&
1047-
(run_mysqlcheck_fixnames() ||
1048-
verbose("Phase 4/5: Checking and upgrading tables") ||
1049-
run_mysqlcheck_upgrade("--all-databases","--skip-database=mysql")))
1050-
die("Upgrade failed" );
1051-
1052-
verbose("Phase 5/5: Running 'FLUSH PRIVILEGES'...");
1130+
verbose("Phase %d/%d: Running 'FLUSH PRIVILEGES'", ++phase, phases_total);
10531131
if (run_query("FLUSH PRIVILEGES", NULL, TRUE))
10541132
die("Upgrade failed" );
10551133

@@ -1058,6 +1136,8 @@ int main(int argc, char **argv)
10581136
/* Create a file indicating upgrade has been performed */
10591137
create_mysql_upgrade_info_file();
10601138

1139+
DBUG_ASSERT(phase == phases_total);
1140+
10611141
free_used_memory();
10621142
my_end(my_end_arg);
10631143
exit(0);

client/mysqladmin.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
3-
Copyright (c) 2010, 2014, Monty Program Ab.
3+
Copyright (c) 2010, 2015, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -1246,6 +1246,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
12461246
static char **mask_password(int argc, char ***argv)
12471247
{
12481248
char **temp_argv;
1249+
if (!argc)
1250+
return NULL;
1251+
12491252
temp_argv= (char **)(my_malloc(sizeof(char *) * argc, MYF(MY_WME)));
12501253
argc--;
12511254
while (argc > 0)

0 commit comments

Comments
 (0)