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
84296d55
Commit
84296d55
authored
Jan 18, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - use reentrant functions in HugoCalulator
parent
b3055966
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
ndb/test/src/HugoCalculator.cpp
ndb/test/src/HugoCalculator.cpp
+8
-8
No files found.
ndb/test/src/HugoCalculator.cpp
View file @
84296d55
...
...
@@ -72,13 +72,14 @@ HugoCalculator::Int64 calcValue(int record, int attrib, int updates) const;
HugoCalculator::float calcValue(int record, int attrib, int updates) const;
HugoCalculator::double calcValue(int record, int attrib, int updates) const;
#endif
const
char
*
HugoCalculator
::
calcValue
(
int
record
,
int
attrib
,
int
updates
,
char
*
buf
,
int
len
)
const
{
unsigned
seed
;
const
NdbDictionary
::
Column
*
attr
=
m_tab
.
getColumn
(
attrib
);
Uint32
val
;
do
...
...
@@ -98,16 +99,15 @@ HugoCalculator::calcValue(int record,
if
(
attr
->
getPrimaryKey
())
{
srand
(
record
+
attrib
);
val
=
(
record
+
attrib
);
seed
=
record
+
attrib
;
}
else
{
srand
(
record
+
attrib
+
updates
);
val
=
rand
();
seed
=
record
+
attrib
+
updates
;
}
}
while
(
0
);
val
=
rand_r
(
&
seed
);
if
(
attr
->
getNullable
()
&&
(((
val
>>
16
)
&
255
)
>
220
))
return
NULL
;
...
...
@@ -115,14 +115,14 @@ HugoCalculator::calcValue(int record,
int
pos
=
4
;
while
(
pos
+
4
<
len
)
{
val
=
rand
(
);
val
=
rand
_r
(
&
seed
);
memcpy
(
buf
+
pos
,
&
val
,
4
);
pos
++
;
}
if
(
pos
<
len
)
{
val
=
rand
(
);
val
=
rand
_r
(
&
seed
);
memcpy
(
buf
+
pos
,
&
val
,
(
len
-
pos
));
}
...
...
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