mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
If one compiled with too long MYSQL_SERVER_SUFFIX this caused a memory
overrun that caused some test to fail. Fixed by ensuring we don't overwrite "server_version"
This commit is contained in:
parent
a1ddf01489
commit
d0c5efc4a7
1 changed files with 9 additions and 6 deletions
|
@ -7386,7 +7386,7 @@ static int mysql_init_variables(void)
|
|||
global_query_id= thread_id= 1L;
|
||||
my_atomic_rwlock_init(&global_query_id_lock);
|
||||
my_atomic_rwlock_init(&thread_running_lock);
|
||||
strmov(server_version, MYSQL_SERVER_VERSION);
|
||||
strnmov(server_version, MYSQL_SERVER_VERSION, sizeof(server_version)-1);
|
||||
threads.empty();
|
||||
thread_cache.empty();
|
||||
key_caches.empty();
|
||||
|
@ -8113,17 +8113,20 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
|
|||
|
||||
void set_server_version(void)
|
||||
{
|
||||
char *end= strxmov(server_version, MYSQL_SERVER_VERSION,
|
||||
MYSQL_SERVER_SUFFIX_STR, NullS);
|
||||
char *version_end= server_version+sizeof(server_version)-1;
|
||||
char *end= strxnmov(server_version, sizeof(server_version)-1,
|
||||
MYSQL_SERVER_VERSION,
|
||||
MYSQL_SERVER_SUFFIX_STR, NullS);
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
end= strmov(end, "-embedded");
|
||||
end= strnmov(end, "-embedded", (version_end-end));
|
||||
#endif
|
||||
#ifndef DBUG_OFF
|
||||
if (!strstr(MYSQL_SERVER_SUFFIX_STR, "-debug"))
|
||||
end= strmov(end, "-debug");
|
||||
end= strnmov(end, "-debug", (version_end-end));
|
||||
#endif
|
||||
if (opt_log || opt_slow_log || opt_bin_log)
|
||||
strmov(end, "-log"); // This may slow down system
|
||||
strnmov(end, "-log", (version_end-end)); // This may slow down system
|
||||
*end= 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue