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
02f33cd9
Commit
02f33cd9
authored
Dec 09, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
parents
1aba19d1
4cf675a2
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
57 additions
and
62 deletions
+57
-62
ndb/include/kernel/AttributeHeader.hpp
ndb/include/kernel/AttributeHeader.hpp
+2
-0
ndb/include/ndbapi/NdbDictionary.hpp
ndb/include/ndbapi/NdbDictionary.hpp
+1
-0
ndb/include/util/Bitmask.hpp
ndb/include/util/Bitmask.hpp
+0
-2
ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
+1
-0
ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
+13
-33
ndb/src/ndbapi/NdbDictionary.cpp
ndb/src/ndbapi/NdbDictionary.cpp
+4
-1
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+11
-0
ndb/src/ndbapi/NdbRecAttr.cpp
ndb/src/ndbapi/NdbRecAttr.cpp
+3
-0
ndb/test/src/HugoCalculator.cpp
ndb/test/src/HugoCalculator.cpp
+17
-15
ndb/test/src/HugoOperations.cpp
ndb/test/src/HugoOperations.cpp
+4
-10
ndb/test/src/NDBT_Tables.cpp
ndb/test/src/NDBT_Tables.cpp
+1
-1
No files found.
ndb/include/kernel/AttributeHeader.hpp
View file @
02f33cd9
...
...
@@ -38,6 +38,8 @@ public:
STATIC_CONST
(
ROW_COUNT
=
0xFFFD
);
STATIC_CONST
(
COMMIT_COUNT
=
0xFFFC
);
STATIC_CONST
(
ROW_SIZE
=
0xFFFA
);
/** Initialize AttributeHeader at location aHeaderPtr */
static
AttributeHeader
&
init
(
void
*
aHeaderPtr
,
Uint32
anAttributeId
,
Uint32
aDataSize
);
...
...
ndb/include/ndbapi/NdbDictionary.hpp
View file @
02f33cd9
...
...
@@ -388,6 +388,7 @@ public:
static
const
Column
*
FRAGMENT
;
static
const
Column
*
ROW_COUNT
;
static
const
Column
*
COMMIT_COUNT
;
static
const
Column
*
ROW_SIZE
;
#endif
private:
...
...
ndb/include/util/Bitmask.hpp
View file @
02f33cd9
...
...
@@ -814,7 +814,6 @@ inline void
BitmaskImpl
::
getField
(
unsigned
size
,
const
Uint32
src
[],
unsigned
pos
,
unsigned
len
,
Uint32
dst
[])
{
assert
(
len
>
0
);
assert
(
pos
+
len
<
(
size
<<
5
));
src
+=
(
pos
>>
5
);
...
...
@@ -834,7 +833,6 @@ inline void
BitmaskImpl
::
setField
(
unsigned
size
,
Uint32
dst
[],
unsigned
pos
,
unsigned
len
,
const
Uint32
src
[])
{
assert
(
len
>
0
);
assert
(
pos
+
len
<
(
size
<<
5
));
dst
+=
(
pos
>>
5
);
...
...
ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
View file @
02f33cd9
...
...
@@ -344,6 +344,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal)
ljam
();
Uint32
bitCount
=
AttributeDescriptor
::
getArraySize
(
attrDescriptor
);
fragOperPtr
.
p
->
currNullBit
+=
bitCount
;
break
;
}
}
default:
...
...
ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
View file @
02f33cd9
...
...
@@ -1000,6 +1000,9 @@ Dbtup::read_psuedo(Uint32 attrId, Uint32* outBuffer){
case
AttributeHeader
:
:
FRAGMENT
:
*
outBuffer
=
operPtr
.
p
->
fragId
>>
1
;
// remove "hash" bit
return
1
;
case
AttributeHeader
:
:
ROW_SIZE
:
*
outBuffer
=
tabptr
.
p
->
tupheadsize
<<
2
;
return
1
;
case
AttributeHeader
:
:
ROW_COUNT
:
case
AttributeHeader
:
:
COMMIT_COUNT
:
signal
->
theData
[
0
]
=
operPtr
.
p
->
userpointer
;
...
...
@@ -1021,14 +1024,8 @@ Dbtup::readBitsNotNULL(Uint32* outBuffer,
Uint32
attrDes2
)
{
Tablerec
*
const
regTabPtr
=
tabptr
.
p
;
Uint32
pos
=
AttributeOffset
::
getNullFlagPos
(
attrDes2
);
Uint32
bitCount
=
AttributeDescriptor
::
getArraySize
(
attrDescriptor
);
Uint32
offsetInTuple
=
AttributeOffset
::
getNullFlagOffset
(
attrDes2
);
Uint32
offsetInWord
=
AttributeOffset
::
getNullFlagBitOffset
(
attrDes2
);
ndbrequire
(
offsetInTuple
<
regTabPtr
->
tupNullWords
);
offsetInTuple
+=
regTabPtr
->
tupNullIndex
;
ndbrequire
(
offsetInTuple
<
tCheckOffset
);
Uint32
pos
=
offsetInTuple
<<
5
+
offsetInWord
;
Uint32
indexBuf
=
tOutBufIndex
;
Uint32
newIndexBuf
=
indexBuf
+
((
bitCount
+
31
)
>>
5
);
Uint32
maxRead
=
tMaxRead
;
...
...
@@ -1059,17 +1056,12 @@ Dbtup::readBitsNULLable(Uint32* outBuffer,
Uint32
attrDes2
)
{
Tablerec
*
const
regTabPtr
=
tabptr
.
p
;
Uint32
pos
=
AttributeOffset
::
getNullFlagPos
(
attrDes2
);
Uint32
bitCount
=
AttributeDescriptor
::
getArraySize
(
attrDescriptor
);
Uint32
offsetInTuple
=
AttributeOffset
::
getNullFlagOffset
(
attrDes2
);
Uint32
offsetInWord
=
AttributeOffset
::
getNullFlagBitOffset
(
attrDes2
);
ndbrequire
(
offsetInTuple
<
regTabPtr
->
tupNullWords
);
offsetInTuple
+=
regTabPtr
->
tupNullIndex
;
ndbrequire
(
offsetInTuple
<
tCheckOffset
);
Uint32
indexBuf
=
tOutBufIndex
;
Uint32
newIndexBuf
=
indexBuf
+
(
bitCount
+
31
)
>>
5
;
Uint32
newIndexBuf
=
indexBuf
+
(
(
bitCount
+
31
)
>>
5
)
;
Uint32
maxRead
=
tMaxRead
;
Uint32
pos
=
offsetInWord
<<
5
+
offsetInTuple
;
if
(
BitmaskImpl
::
get
(
regTabPtr
->
tupNullWords
,
tTupleHeader
+
regTabPtr
->
tupNullIndex
,
...
...
@@ -1108,15 +1100,9 @@ Dbtup::updateBitsNotNULL(Uint32* inBuffer,
Uint32
inBufLen
=
tInBufLen
;
AttributeHeader
ahIn
(
inBuffer
[
indexBuf
]);
Uint32
nullIndicator
=
ahIn
.
isNULL
();
Uint32
pos
=
AttributeOffset
::
getNullFlagPos
(
attrDes2
);
Uint32
bitCount
=
AttributeDescriptor
::
getArraySize
(
attrDescriptor
);
Uint32
newIndex
=
indexBuf
+
1
+
((
bitCount
+
31
)
>>
5
);
Uint32
nullFlagOffset
=
AttributeOffset
::
getNullFlagOffset
(
attrDes2
);
Uint32
nullFlagBitOffset
=
AttributeOffset
::
getNullFlagBitOffset
(
attrDes2
);
Uint32
nullWordOffset
=
nullFlagOffset
+
regTabPtr
->
tupNullIndex
;
ndbrequire
((
nullFlagOffset
<
regTabPtr
->
tupNullWords
)
&&
(
nullWordOffset
<
tCheckOffset
));
Uint32
nullBits
=
tTupleHeader
[
nullWordOffset
];
Uint32
pos
=
(
nullFlagOffset
<<
5
)
+
nullFlagBitOffset
;
if
(
newIndex
<=
inBufLen
)
{
if
(
!
nullIndicator
)
{
...
...
@@ -1149,14 +1135,8 @@ Dbtup::updateBitsNULLable(Uint32* inBuffer,
AttributeHeader
ahIn
(
inBuffer
[
tInBufIndex
]);
Uint32
indexBuf
=
tInBufIndex
;
Uint32
nullIndicator
=
ahIn
.
isNULL
();
Uint32
nullFlagOffset
=
AttributeOffset
::
getNullFlagOffset
(
attrDes2
);
Uint32
nullFlagBitOffset
=
AttributeOffset
::
getNullFlagBitOffset
(
attrDes2
);
Uint32
nullWordOffset
=
nullFlagOffset
+
regTabPtr
->
tupNullIndex
;
ndbrequire
((
nullFlagOffset
<
regTabPtr
->
tupNullWords
)
&&
(
nullWordOffset
<
tCheckOffset
));
Uint32
nullBits
=
tTupleHeader
[
nullWordOffset
];
Uint32
pos
=
AttributeOffset
::
getNullFlagPos
(
attrDes2
);
Uint32
bitCount
=
AttributeDescriptor
::
getArraySize
(
attrDescriptor
);
Uint32
pos
=
(
nullFlagOffset
<<
5
)
+
nullFlagBitOffset
;
if
(
!
nullIndicator
)
{
BitmaskImpl
::
clear
(
regTabPtr
->
tupNullWords
,
...
...
ndb/src/ndbapi/NdbDictionary.cpp
View file @
02f33cd9
...
...
@@ -922,6 +922,9 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col)
case
NdbDictionary
:
:
Column
::
Undefined
:
out
<<
"Undefined"
;
break
;
case
NdbDictionary
:
:
Column
::
Bit
:
out
<<
"Bit("
<<
col
.
getLength
()
<<
")"
;
break
;
default:
out
<<
"Type"
<<
(
Uint32
)
col
.
getType
();
break
;
...
...
@@ -942,4 +945,4 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col)
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
FRAGMENT
=
0
;
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
ROW_COUNT
=
0
;
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
COMMIT_COUNT
=
0
;
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
ROW_SIZE
=
0
;
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
02f33cd9
...
...
@@ -218,6 +218,11 @@ NdbColumnImpl::create_psuedo(const char * name){
col
->
m_impl
.
m_attrId
=
AttributeHeader
::
COMMIT_COUNT
;
col
->
m_impl
.
m_attrSize
=
8
;
col
->
m_impl
.
m_arraySize
=
1
;
}
else
if
(
!
strcmp
(
name
,
"NDB$ROW_SIZE"
)){
col
->
setType
(
NdbDictionary
::
Column
::
Unsigned
);
col
->
m_impl
.
m_attrId
=
AttributeHeader
::
ROW_SIZE
;
col
->
m_impl
.
m_attrSize
=
4
;
col
->
m_impl
.
m_arraySize
=
1
;
}
else
{
abort
();
}
...
...
@@ -1157,6 +1162,7 @@ columnTypeMapping[] = {
{
DictTabInfo
::
ExtTimespec
,
NdbDictionary
::
Column
::
Timespec
},
{
DictTabInfo
::
ExtBlob
,
NdbDictionary
::
Column
::
Blob
},
{
DictTabInfo
::
ExtText
,
NdbDictionary
::
Column
::
Text
},
{
DictTabInfo
::
ExtBit
,
NdbDictionary
::
Column
::
Bit
},
{
-
1
,
-
1
}
};
...
...
@@ -1266,6 +1272,11 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
col
->
m_attrType
=
attrDesc
.
AttributeType
;
col
->
m_attrSize
=
(
1
<<
attrDesc
.
AttributeSize
)
/
8
;
col
->
m_arraySize
=
attrDesc
.
AttributeArraySize
;
if
(
attrDesc
.
AttributeSize
==
0
)
{
col
->
m_attrSize
=
4
;
col
->
m_arraySize
=
(
attrDesc
.
AttributeArraySize
+
31
)
>>
5
;
}
col
->
m_pk
=
attrDesc
.
AttributeKeyFlag
;
col
->
m_distributionKey
=
attrDesc
.
AttributeDKey
;
...
...
ndb/src/ndbapi/NdbRecAttr.cpp
View file @
02f33cd9
...
...
@@ -169,6 +169,9 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
case
NdbDictionary
:
:
Column
::
Bigunsigned
:
out
<<
r
.
u_64_value
();
break
;
case
NdbDictionary
:
:
Column
::
Bit
:
out
<<
hex
<<
"H'"
<<
r
.
u_32_value
()
<<
dec
;
break
;
case
NdbDictionary
:
:
Column
::
Unsigned
:
out
<<
r
.
u_32_value
();
break
;
...
...
ndb/test/src/HugoCalculator.cpp
View file @
02f33cd9
...
...
@@ -137,13 +137,16 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{
if
(
i
!=
m_updatesCol
&&
id
!=
m_idCol
)
{
const
NdbDictionary
::
Column
*
attr
=
m_tab
.
getColumn
(
i
);
Uint32
len
=
attr
->
getLength
();
switch
(
attr
->
getType
()){
case
NdbDictionary
:
:
Column
::
Bit
:
len
=
4
*
((
len
+
31
)
>>
5
);
case
NdbDictionary
:
:
Column
::
Char
:
case
NdbDictionary
:
:
Column
::
Varchar
:
case
NdbDictionary
:
:
Column
::
Binary
:
case
NdbDictionary
:
:
Column
::
Varbinary
:
{
int
result
=
0
;
char
*
buf
=
new
char
[
attr
->
getLength
()
+
1
];
char
*
buf
=
new
char
[
len
+
1
];
const
char
*
res
=
calcValue
(
id
,
i
,
updates
,
buf
);
if
(
res
==
NULL
){
if
(
!
pRow
->
attributeStore
(
i
)
->
isNULL
()){
...
...
@@ -180,7 +183,6 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{
}
}
delete
[]
buf
;
if
(
result
!=
0
)
return
result
;
}
break
;
...
...
@@ -194,7 +196,7 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{
g_err
<<
"|- The row:
\"
"
<<
(
*
pRow
)
<<
"
\"
"
<<
endl
;
return
-
1
;
}
break
;
return
0
;
}
case
NdbDictionary
:
:
Column
::
Bigint
:
case
NdbDictionary
:
:
Column
::
Bigunsigned
:
{
...
...
@@ -207,6 +209,7 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{
g_err
<<
"|- The row:
\"
"
<<
(
*
pRow
)
<<
"
\"
"
<<
endl
;
return
-
1
;
}
return
0
;
}
break
;
case
NdbDictionary
:
:
Column
::
Float
:
{
...
...
@@ -218,17 +221,16 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{
g_err
<<
"|- The row:
\"
"
<<
(
*
pRow
)
<<
"
\"
"
<<
endl
;
return
-
1
;
}
return
0
;
}
break
;
case
NdbDictionary
:
:
Column
::
Undefined
:
default:
assert
(
false
);
break
;
}
}
}
return
0
;
assert
(
0
);
return
-
1
;
}
int
...
...
ndb/test/src/HugoOperations.cpp
View file @
02f33cd9
...
...
@@ -407,7 +407,7 @@ HugoOperations::~HugoOperations(){
int
HugoOperations
::
equalForAttr
(
NdbOperation
*
pOp
,
int
attrId
,
int
rowId
){
int
check
=
0
;
int
check
=
-
1
;
const
NdbDictionary
::
Column
*
attr
=
tab
.
getColumn
(
attrId
);
if
(
attr
->
getPrimaryKey
()
==
false
){
g_info
<<
"Can't call equalForAttr on non PK attribute"
<<
endl
;
...
...
@@ -415,6 +415,7 @@ int HugoOperations::equalForAttr(NdbOperation* pOp,
}
switch
(
attr
->
getType
()){
case
NdbDictionary
:
:
Column
::
Bit
:
case
NdbDictionary
:
:
Column
::
Char
:
case
NdbDictionary
:
:
Column
::
Varchar
:
case
NdbDictionary
:
:
Column
::
Binary
:
...
...
@@ -440,11 +441,6 @@ int HugoOperations::equalForAttr(NdbOperation* pOp,
g_info
<<
"Float not allowed as PK value"
<<
endl
;
check
=
-
1
;
break
;
default:
g_info
<<
"default"
<<
endl
;
check
=
-
1
;
break
;
}
return
check
;
}
...
...
@@ -453,10 +449,11 @@ int HugoOperations::setValueForAttr(NdbOperation* pOp,
int
attrId
,
int
rowId
,
int
updateId
){
int
check
=
0
;
int
check
=
-
1
;
const
NdbDictionary
::
Column
*
attr
=
tab
.
getColumn
(
attrId
);
switch
(
attr
->
getType
()){
case
NdbDictionary
:
:
Column
::
Bit
:
case
NdbDictionary
:
:
Column
::
Char
:
case
NdbDictionary
:
:
Column
::
Varchar
:
case
NdbDictionary
:
:
Column
::
Binary
:
...
...
@@ -492,9 +489,6 @@ int HugoOperations::setValueForAttr(NdbOperation* pOp,
check
=
pOp
->
setValue
(
attr
->
getName
(),
(
float
)
calc
.
calcValue
(
rowId
,
attrId
,
updateId
));
break
;
default:
check
=
-
1
;
break
;
}
return
check
;
}
...
...
ndb/test/src/NDBT_Tables.cpp
View file @
02f33cd9
...
...
@@ -48,7 +48,7 @@ const
NDBT_Attribute
T2Attribs
[]
=
{
NDBT_Attribute
(
"KOL1"
,
NdbDictionary
::
Column
::
Bigunsigned
,
1
,
true
),
NDBT_Attribute
(
"KOL2"
,
NdbDictionary
::
Column
::
Unsigned
),
NDBT_Attribute
(
"KOL3"
,
NdbDictionary
::
Column
::
Unsigned
),
NDBT_Attribute
(
"KOL3"
,
NdbDictionary
::
Column
::
Bit
,
23
),
NDBT_Attribute
(
"KOL4"
,
NdbDictionary
::
Column
::
Unsigned
,
1
,
false
,
true
),
// Nullable
NDBT_Attribute
(
"KOL5"
,
NdbDictionary
::
Column
::
Unsigned
)
...
...
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