Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a8bae6fe
Commit
a8bae6fe
authored
Oct 17, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved rand initialization from mysqld.cc to sql_class.cc:THD::THD()
parent
95e9d143
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
sql/mysqld.cc
sql/mysqld.cc
+2
-10
sql/sql_class.cc
sql/sql_class.cc
+14
-0
No files found.
sql/mysqld.cc
View file @
a8bae6fe
...
...
@@ -288,7 +288,7 @@ int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice
*/
static
bool
kill_in_progress
=
FALSE
;
st
atic
struct
rand_struct
sql_rand
;
st
ruct
rand_struct
sql_rand
;
// used by sql_class.cc:THD::THD()
static
int
cleanup_done
;
static
char
**
defaults_argv
;
char
glob_hostname
[
FN_REFLEN
];
...
...
@@ -2423,15 +2423,7 @@ 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
;
/*
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 */
...
...
sql/sql_class.cc
View file @
a8bae6fe
...
...
@@ -37,6 +37,8 @@
#include <mysys_err.h>
#include <assert.h>
extern
struct
rand_struct
sql_rand
;
/*****************************************************************************
** Instansiate templates
*****************************************************************************/
...
...
@@ -158,6 +160,18 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
transaction
.
trans_log
.
end_of_file
=
max_binlog_cache_size
;
}
#endif
/*
We need good random number initialization for new thread
Just coping global one will not work
*/
{
pthread_mutex_lock
(
&
LOCK_thread_count
);
ulong
tmp
=
(
ulong
)
(
rnd
(
&
sql_rand
)
*
3000000
);
randominit
(
&
rand
,
tmp
+
(
ulong
)
start_time
,
tmp
+
(
ulong
)
thread_id
);
pthread_mutex_unlock
(
&
LOCK_thread_count
);
}
}
/* Do operations that may take a long time */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment