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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
9b428b9e
Commit
9b428b9e
authored
Sep 25, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge dator6.(none):/home/mikael/mysql_clones/mysql-5.1-ndb
into dator6.(none):/home/mikael/mysql_clones/bug30996
parents
8e3581c7
10fbce08
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
2 deletions
+78
-2
storage/ndb/include/util/ndb_rand.h
storage/ndb/include/util/ndb_rand.h
+33
-0
storage/ndb/src/common/util/Makefile.am
storage/ndb/src/common/util/Makefile.am
+2
-1
storage/ndb/src/common/util/ndb_rand.c
storage/ndb/src/common/util/ndb_rand.c
+40
-0
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+3
-1
No files found.
storage/ndb/include/util/ndb_rand.h
0 → 100644
View file @
9b428b9e
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef NDB_RAND_H
#define NDB_RAND_H
#define NDB_RAND_MAX 32767
#ifdef __cplusplus
extern
"C"
{
#endif
int
ndb_rand
(
void
);
void
ndb_srand
(
unsigned
seed
);
#ifdef __cplusplus
}
#endif
#endif
storage/ndb/src/common/util/Makefile.am
View file @
9b428b9e
...
@@ -24,7 +24,8 @@ libgeneral_la_SOURCES = \
...
@@ -24,7 +24,8 @@ libgeneral_la_SOURCES = \
uucode.c random.c version.c
\
uucode.c random.c version.c
\
strdup.c
\
strdup.c
\
ConfigValues.cpp ndb_init.c basestring_vsnprintf.c
\
ConfigValues.cpp ndb_init.c basestring_vsnprintf.c
\
Bitmask.cpp
Bitmask.cpp
\
ndb_rand.c
EXTRA_PROGRAMS
=
testBitmask
EXTRA_PROGRAMS
=
testBitmask
testBitmask_SOURCES
=
testBitmask.cpp
testBitmask_SOURCES
=
testBitmask.cpp
...
...
storage/ndb/src/common/util/ndb_rand.c
0 → 100644
View file @
9b428b9e
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_rand.h>
static
unsigned
long
next
=
1
;
/**
* ndb_rand
*
* constant time, cheap, pseudo-random number generator.
*
* NDB_RAND_MAX assumed to be 32767
*
* This is the POSIX example for "generating the same sequence on
* different machines". Although that is not one of our requirements.
*/
int
ndb_rand
(
void
)
{
next
=
next
*
1103515245
+
12345
;
return
((
unsigned
)(
next
/
65536
)
%
32768
);
}
void
ndb_srand
(
unsigned
seed
)
{
next
=
seed
;
}
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
View file @
9b428b9e
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <RefConvert.hpp>
#include <RefConvert.hpp>
#include <ndb_limits.h>
#include <ndb_limits.h>
#include <my_sys.h>
#include <my_sys.h>
#include <ndb_rand.h>
#include <signaldata/EventReport.hpp>
#include <signaldata/EventReport.hpp>
#include <signaldata/TcKeyReq.hpp>
#include <signaldata/TcKeyReq.hpp>
...
@@ -6278,7 +6279,8 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr)
...
@@ -6278,7 +6279,8 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr)
jam
();
jam
();
if
(
api_timer
!=
0
)
{
if
(
api_timer
!=
0
)
{
Uint32
error
=
ZTIME_OUT_ERROR
;
Uint32
error
=
ZTIME_OUT_ERROR
;
time_out_value
=
time_out_param
+
(
api_con_ptr
&
mask_value
);
time_out_value
=
time_out_param
+
(
ndb_rand
()
&
mask_value
);
ndbout_c
(
"timeout value: %u %u"
,
time_out_value
,
time_out_value
-
time_out_param
);
if
(
unlikely
(
old_mask_value
))
// abort during single user mode
if
(
unlikely
(
old_mask_value
))
// abort during single user mode
{
{
apiConnectptr
.
i
=
api_con_ptr
;
apiConnectptr
.
i
=
api_con_ptr
;
...
...
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