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
f16b8a19
Commit
f16b8a19
authored
Jan 30, 2008
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#34160
make sure release of not added ptr does not corrupt hashtable
parent
4230b1b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
ndb/src/kernel/vm/DLHashTable.hpp
ndb/src/kernel/vm/DLHashTable.hpp
+18
-4
ndb/src/kernel/vm/DLHashTable2.hpp
ndb/src/kernel/vm/DLHashTable2.hpp
+18
-4
No files found.
ndb/src/kernel/vm/DLHashTable.hpp
View file @
f16b8a19
...
...
@@ -45,8 +45,8 @@ public:
/**
* Seize element from pool - return i
*
* Note
must be either added using <b>add</b> or released
*
using <b>release</b>
* Note
*must* be added using <b>add</b> (even before hash.release)
*
or be released using pool
*/
bool
seize
(
Ptr
<
T
>
&
);
...
...
@@ -374,7 +374,14 @@ DLHashTable<T>::remove(Ptr<T> & ptr){
prevP
->
nextHash
=
next
;
}
else
{
const
Uint32
hv
=
ptr
.
p
->
hashValue
()
&
mask
;
hashValues
[
hv
]
=
next
;
if
(
hashValues
[
hv
]
==
ptr
.
i
)
{
hashValues
[
hv
]
=
next
;
}
else
{
// Will add assert in 5.1
}
}
if
(
next
!=
RNIL
){
...
...
@@ -395,7 +402,14 @@ DLHashTable<T>::release(Ptr<T> & ptr){
prevP
->
nextHash
=
next
;
}
else
{
const
Uint32
hv
=
ptr
.
p
->
hashValue
()
&
mask
;
hashValues
[
hv
]
=
next
;
if
(
hashValues
[
hv
]
==
ptr
.
i
)
{
hashValues
[
hv
]
=
next
;
}
else
{
// Will add assert in 5.1
}
}
if
(
next
!=
RNIL
){
...
...
ndb/src/kernel/vm/DLHashTable2.hpp
View file @
f16b8a19
...
...
@@ -43,8 +43,8 @@ public:
/**
* Seize element from pool - return i
*
* Note
must be either added using <b>add</b> or released
*
using <b>release</b>
* Note
*must* be added using <b>add</b> (even before hash.release)
*
or be released using pool
*/
bool
seize
(
Ptr
<
T
>
&
);
...
...
@@ -375,7 +375,14 @@ DLHashTable2<T, U>::remove(Ptr<T> & ptr){
prevP
->
nextHash
=
next
;
}
else
{
const
Uint32
hv
=
ptr
.
p
->
hashValue
()
&
mask
;
hashValues
[
hv
]
=
next
;
if
(
hashValues
[
hv
]
==
ptr
.
i
)
{
hashValues
[
hv
]
=
next
;
}
else
{
// Will add assert in 5.1
}
}
if
(
next
!=
RNIL
){
...
...
@@ -396,7 +403,14 @@ DLHashTable2<T, U>::release(Ptr<T> & ptr){
prevP
->
nextHash
=
next
;
}
else
{
const
Uint32
hv
=
ptr
.
p
->
hashValue
()
&
mask
;
hashValues
[
hv
]
=
next
;
if
(
hashValues
[
hv
]
==
ptr
.
i
)
{
hashValues
[
hv
]
=
next
;
}
else
{
// Will add assert in 5.1
}
}
if
(
next
!=
RNIL
){
...
...
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