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
134b8536
Commit
134b8536
authored
Jul 22, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
parents
2e293683
80437546
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
8 deletions
+44
-8
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+11
-0
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+24
-8
storage/ndb/test/ndbapi/testPartitioning.cpp
storage/ndb/test/ndbapi/testPartitioning.cpp
+9
-0
No files found.
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
View file @
134b8536
...
@@ -6220,6 +6220,17 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal)
...
@@ -6220,6 +6220,17 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal)
noOfFragments
=
1
;
noOfFragments
=
1
;
set_default_node_groups
(
signal
,
noOfFragments
);
set_default_node_groups
(
signal
,
noOfFragments
);
break
;
break
;
case
DictTabInfo
:
:
DistrKeyHash
:
jam
();
case
DictTabInfo
:
:
DistrKeyLin
:
jam
();
if
(
noOfFragments
==
0
)
{
jam
();
noOfFragments
=
csystemnodes
;
set_default_node_groups
(
signal
,
noOfFragments
);
}
break
;
default:
default:
jam
();
jam
();
if
(
noOfFragments
==
0
)
if
(
noOfFragments
==
0
)
...
...
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
134b8536
...
@@ -505,20 +505,36 @@ NdbTableImpl::buildColumnHash(){
...
@@ -505,20 +505,36 @@ NdbTableImpl::buildColumnHash(){
Uint32
Uint32
NdbTableImpl
::
get_nodes
(
Uint32
hashValue
,
const
Uint16
**
nodes
)
const
NdbTableImpl
::
get_nodes
(
Uint32
hashValue
,
const
Uint16
**
nodes
)
const
{
{
if
(
m_replicaCount
>
0
)
Uint32
fragmentId
;
if
(
m_replicaCount
==
0
)
return
0
;
switch
(
m_fragmentType
)
{
{
Uint32
fragmentId
=
hashValue
&
m_hashValueMask
;
case
NdbDictionary
:
:
Object
::
FragAllSmall
:
if
(
fragmentId
<
m_hashpointerValue
)
case
NdbDictionary
:
:
Object
::
FragAllMedium
:
case
NdbDictionary
:
:
Object
::
FragAllLarge
:
case
NdbDictionary
:
:
Object
::
FragSingle
:
case
NdbDictionary
:
:
Object
::
DistrKeyLin
:
{
{
fragmentId
=
hashValue
&
m_hashValueMask
;
if
(
fragmentId
<
m_hashpointerValue
)
fragmentId
=
hashValue
&
((
m_hashValueMask
<<
1
)
+
1
);
fragmentId
=
hashValue
&
((
m_hashValueMask
<<
1
)
+
1
);
break
;
}
case
NdbDictionary
:
:
Object
::
DistrKeyHash
:
{
fragmentId
=
hashValue
%
m_fragmentCount
;
break
;
}
default:
return
0
;
}
}
Uint32
pos
=
fragmentId
*
m_replicaCount
;
Uint32
pos
=
fragmentId
*
m_replicaCount
;
if
(
pos
+
m_replicaCount
<=
m_fragments
.
size
())
if
(
pos
+
m_replicaCount
<=
m_fragments
.
size
())
{
{
*
nodes
=
m_fragments
.
getBase
()
+
pos
;
*
nodes
=
m_fragments
.
getBase
()
+
pos
;
return
m_replicaCount
;
return
m_replicaCount
;
}
}
}
return
0
;
return
0
;
}
}
...
...
storage/ndb/test/ndbapi/testPartitioning.cpp
View file @
134b8536
...
@@ -94,6 +94,15 @@ add_distribution_key(Ndb*, NdbDictionary::Table& tab, int when)
...
@@ -94,6 +94,15 @@ add_distribution_key(Ndb*, NdbDictionary::Table& tab, int when)
}
}
}
}
}
}
Uint32
linear_hash_ind
=
rand
()
&
1
;
NdbDictionary
::
Table
::
FragmentType
ftype
;
if
(
linear_hash_ind
)
ftype
=
NdbDictionary
::
Table
::
DistrKeyLin
;
else
ftype
=
NdbDictionary
::
Table
::
DistrKeyHash
;
tab
.
setFragmentType
(
ftype
);
ndbout
<<
(
NDBT_Table
&
)
tab
<<
endl
;
ndbout
<<
(
NDBT_Table
&
)
tab
<<
endl
;
return
0
;
return
0
;
...
...
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