ports/databases/mysql80-server/files/patch-mysys_my__default.cc
Jochen Neumeister 342c784ae3 databases/mysql80-{client, server}: Update to latest release 8.0.18
switch patch-files to mysql80-server to make it easy for maintain.

Bugfix:
- CMake now enables use of fastcov if it is available. fastcov is faster than lcov or gcov. This requires GCC and gcov versions of 9 or higher.
- The DISABLE_SHARED CMake option was unused and has been removed.
- The CMake code to find Protobuf executables now works on platforms that split these into multiple packages.
- The new ADD_GDB_INDEX CMake option determines whether to enable generation of a .gdb_index section in binaries, which makes loading them in a debugger faster. The option is disabled by default. It has no effect if a linker other than lld or GNU gold is used.
- For the INSTALL_LAYOUT CMake option, the SLES and WIN option values were not used and have been removed.
- The max_prepared_stmt_count system variable maximum value has been increased from 1 million (1,048,576) to 4 million (4,194,304). The default value remains unchanged at 16,382.
- MySQL 8.0 no longer supports building using wolfSSL. All MySQL builds now use OpenSSL.
- The RE2 library is no longer used by MySQL. The library is no longer bundled with source distributions and the WITH_RE2 CMake option is obsolete.

More Infos: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-18.html

A big thanks to @fluffy for his help with this update

MFH:		2020Q1
Security:	fc91f2ef-fd7b-11e9-a1c7-b499baebfeaf
Sponsored by:	Netzkommune GmbH
2020-01-08 16:47:12 +00:00

63 lines
2.0 KiB
C++

--- mysys/my_default.cc.orig 2019-09-20 08:30:51 UTC
+++ mysys/my_default.cc
@@ -203,7 +203,7 @@ bool no_defaults = false;
/* 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;
@@ -909,6 +909,14 @@ static int search_default_file_with_ext(Process_option
return 1; /* Ignore wrong files */
}
+ if (strstr(name, "/etc") == name)
+ {
+ fprintf(stderr,
+ "error: Config file %s in invalid location, please move to or merge with /usr/local%s\n",
+ name,name);
+ goto err;
+ }
+
while (mysql_file_getline(buff, sizeof(buff) - 1, fp, is_login_file)) {
line++;
/* Ignore comment and empty lines */
@@ -1228,7 +1236,8 @@ void my_print_default_files(const char *conf_file) {
end[(strlen(end) - 1)] = ' ';
else
strxmov(end, conf_file, *ext, " ", NullS);
- fputs(name, stdout);
+ if (strstr(name, "/etc") != name)
+ fputs(name, stdout);
}
}
}
@@ -1565,14 +1574,9 @@ static const char **init_default_directories(MEM_ROOT
#else
- errors += add_directory(alloc, "/etc/", dirs);
- errors += add_directory(alloc, "/etc/mysql/", dirs);
+ errors += add_directory(alloc, "/usr/local/etc/", dirs);
+ errors += add_directory(alloc, "/usr/local/etc/mysql/", dirs);
-#if defined(DEFAULT_SYSCONFDIR)
- if (DEFAULT_SYSCONFDIR[0])
- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
-#endif /* DEFAULT_SYSCONFDIR */
-
#endif
if ((env = getenv("MYSQL_HOME"))) errors += add_directory(alloc, env, dirs);
@@ -1635,7 +1639,7 @@ int check_file_permissions(const char *file_name, bool
#if !defined(_WIN32)
MY_STAT stat_info;
- if (!my_stat(file_name, &stat_info, MYF(0))) return 1;
+ if (!my_stat(file_name, &stat_info, MYF(0))) return 0;
/*
Ignore .mylogin.cnf file if not exclusively readable/writable
by current user.