summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-08-06 03:21:12 +0300
committerunknown <monty@mashka.mysql.fi>2002-08-06 03:21:12 +0300
commit4c1712e40171e2861359878ea885e14936298acf (patch)
tree84cfa628ebdfccaa671b06ac35934e917f3a9d3e /sql/mysqld.cc
parent3cf7c3e68bae80f753196e8bb38d8cced9adb324 (diff)
downloadmariadb-git-4c1712e40171e2861359878ea885e14936298acf.tar.gz
Changed initialization of RND() to be less predictable.
Use MYSQL_CONFIG_NAME instead of "my" as the configuration file name. Docs/manual.texi: Changelog include/mysql_version.h.in: Use MYSQL_CONFIG_NAME instead of "my" as the configuration file name.
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 251dda77d34..d73ec9fc0d6 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1690,7 +1690,7 @@ int main(int argc, char **argv)
exit( 1 );
}
#endif
- load_defaults("my",load_default_groups,&argc,&argv);
+ load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv);
defaults_argv=argv;
mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
#if defined( __WIN__) || defined(OS2)
@@ -2250,7 +2250,15 @@ static void create_new_thread(THD *thd)
for (uint i=0; i < 8 ; i++) // Generate password teststring
thd->scramble[i]= (char) (rnd(&sql_rand)*94+33);
thd->scramble[8]=0;
- thd->rand=sql_rand;
+ /*
+ We need good random number initialization for new thread
+ Just coping global one will not work
+ */
+ {
+ ulong tmp=(ulong) (rnd(&sql_rand) * 3000000);
+ randominit(&(thd->rand), tmp + (ulong) start_time,
+ tmp + (ulong) thread_id);
+ }
thd->real_id=pthread_self(); // Keep purify happy
/* Start a new thread to handle connection */
@@ -3386,7 +3394,7 @@ Starts the MySQL server\n");
--skip-innodb Don't use Innodb (will save memory)\n\
");
#endif /* HAVE_INNOBASE_DB */
- print_defaults("my",load_default_groups);
+ print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
#include "sslopt-usage.h"