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
b83200e6
Commit
b83200e6
authored
Oct 09, 2006
by
pekka@orca.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#20446: test case and cleanups (not fix)
parent
a845df49
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
279 additions
and
250 deletions
+279
-250
ndb/src/kernel/blocks/dbtux/Dbtux.hpp
ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+10
-127
ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
+19
-19
ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
+4
-4
ndb/test/ndbapi/testOIBasic.cpp
ndb/test/ndbapi/testOIBasic.cpp
+237
-99
ndb/test/run-test/daily-basic-tests.txt
ndb/test/run-test/daily-basic-tests.txt
+9
-1
No files found.
ndb/src/kernel/blocks/dbtux/Dbtux.hpp
View file @
b83200e6
...
...
@@ -121,41 +121,17 @@ private:
// forward declarations
struct
DescEnt
;
/*
* Pointer to array of Uint32.
*/
struct
Data
{
private:
Uint32
*
m_data
;
public:
Data
();
Data
(
Uint32
*
data
);
Data
&
operator
=
(
Uint32
*
data
);
operator
Uint32
*
()
const
;
Data
&
operator
+=
(
size_t
n
);
AttributeHeader
&
ah
()
const
;
};
friend
class
Data
;
// Pointer to array of Uint32 represents attribute data and bounds
/*
* Pointer to array of constant Uint32.
*/
struct
ConstData
;
friend
struct
ConstData
;
struct
ConstData
{
private:
const
Uint32
*
m_data
;
public:
ConstData
();
ConstData
(
const
Uint32
*
data
);
ConstData
&
operator
=
(
const
Uint32
*
data
);
operator
const
Uint32
*
()
const
;
ConstData
&
operator
+=
(
size_t
n
);
const
AttributeHeader
&
ah
()
const
;
// non-const pointer can be cast to const pointer
ConstData
(
Data
data
);
ConstData
&
operator
=
(
Data
data
);
};
typedef
Uint32
*
Data
;
inline
AttributeHeader
&
ah
(
Data
data
)
{
return
*
reinterpret_cast
<
AttributeHeader
*>
(
data
);
}
typedef
const
Uint32
*
ConstData
;
inline
const
AttributeHeader
&
ah
(
ConstData
data
)
{
return
*
reinterpret_cast
<
const
AttributeHeader
*>
(
data
);
}
// AttributeHeader size is assumed to be 1 word
STATIC_CONST
(
AttributeHeaderSize
=
1
);
...
...
@@ -737,99 +713,6 @@ private:
static
unsigned
max
(
unsigned
x
,
unsigned
y
);
};
// Dbtux::Data
inline
Dbtux
::
Data
::
Data
()
:
m_data
(
0
)
{
}
inline
Dbtux
::
Data
::
Data
(
Uint32
*
data
)
:
m_data
(
data
)
{
}
inline
Dbtux
::
Data
&
Dbtux
::
Data
::
operator
=
(
Uint32
*
data
)
{
m_data
=
data
;
return
*
this
;
}
inline
Dbtux
::
Data
::
operator
Uint32
*
()
const
{
return
m_data
;
}
inline
Dbtux
::
Data
&
Dbtux
::
Data
::
operator
+=
(
size_t
n
)
{
m_data
+=
n
;
return
*
this
;
}
inline
AttributeHeader
&
Dbtux
::
Data
::
ah
()
const
{
return
*
reinterpret_cast
<
AttributeHeader
*>
(
m_data
);
}
// Dbtux::ConstData
inline
Dbtux
::
ConstData
::
ConstData
()
:
m_data
(
0
)
{
}
inline
Dbtux
::
ConstData
::
ConstData
(
const
Uint32
*
data
)
:
m_data
(
data
)
{
}
inline
Dbtux
::
ConstData
&
Dbtux
::
ConstData
::
operator
=
(
const
Uint32
*
data
)
{
m_data
=
data
;
return
*
this
;
}
inline
Dbtux
::
ConstData
::
operator
const
Uint32
*
()
const
{
return
m_data
;
}
inline
Dbtux
::
ConstData
&
Dbtux
::
ConstData
::
operator
+=
(
size_t
n
)
{
m_data
+=
n
;
return
*
this
;
}
inline
const
AttributeHeader
&
Dbtux
::
ConstData
::
ah
()
const
{
return
*
reinterpret_cast
<
const
AttributeHeader
*>
(
m_data
);
}
inline
Dbtux
::
ConstData
::
ConstData
(
Data
data
)
:
m_data
(
static_cast
<
Uint32
*>
(
data
))
{
}
inline
Dbtux
::
ConstData
&
Dbtux
::
ConstData
::
operator
=
(
Data
data
)
{
m_data
=
static_cast
<
Uint32
*>
(
data
);
return
*
this
;
}
// Dbtux::TupLoc
inline
...
...
ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
View file @
b83200e6
...
...
@@ -34,7 +34,7 @@ Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, ConstData searchKey, Cons
// skip to right position in search key only
for
(
unsigned
i
=
0
;
i
<
start
;
i
++
)
{
jam
();
searchKey
+=
AttributeHeaderSize
+
searchKey
.
ah
(
).
getDataSize
();
searchKey
+=
AttributeHeaderSize
+
ah
(
searchKey
).
getDataSize
();
}
// number of words of entry data left
unsigned
len2
=
maxlen
;
...
...
@@ -46,16 +46,16 @@ Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, ConstData searchKey, Cons
break
;
}
len2
-=
AttributeHeaderSize
;
if
(
!
searchKey
.
ah
(
).
isNULL
())
{
if
(
!
entryData
.
ah
(
).
isNULL
())
{
if
(
!
ah
(
searchKey
).
isNULL
())
{
if
(
!
ah
(
entryData
).
isNULL
())
{
jam
();
// verify attribute id
const
DescAttr
&
descAttr
=
descEnt
.
m_descAttr
[
start
];
ndbrequire
(
searchKey
.
ah
(
).
getAttributeId
()
==
descAttr
.
m_primaryAttrId
);
ndbrequire
(
entryData
.
ah
(
).
getAttributeId
()
==
descAttr
.
m_primaryAttrId
);
ndbrequire
(
ah
(
searchKey
).
getAttributeId
()
==
descAttr
.
m_primaryAttrId
);
ndbrequire
(
ah
(
entryData
).
getAttributeId
()
==
descAttr
.
m_primaryAttrId
);
// sizes
const
unsigned
size1
=
searchKey
.
ah
(
).
getDataSize
();
const
unsigned
size2
=
min
(
entryData
.
ah
(
).
getDataSize
(),
len2
);
const
unsigned
size1
=
ah
(
searchKey
).
getDataSize
();
const
unsigned
size2
=
min
(
ah
(
entryData
).
getDataSize
(),
len2
);
len2
-=
size2
;
// compare
NdbSqlUtil
::
Cmp
*
const
cmp
=
c_sqlCmp
[
start
];
...
...
@@ -74,15 +74,15 @@ Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, ConstData searchKey, Cons
break
;
}
}
else
{
if
(
!
entryData
.
ah
(
).
isNULL
())
{
if
(
!
ah
(
entryData
).
isNULL
())
{
jam
();
// NULL < not NULL
ret
=
-
1
;
break
;
}
}
searchKey
+=
AttributeHeaderSize
+
searchKey
.
ah
(
).
getDataSize
();
entryData
+=
AttributeHeaderSize
+
entryData
.
ah
(
).
getDataSize
();
searchKey
+=
AttributeHeaderSize
+
ah
(
searchKey
).
getDataSize
();
entryData
+=
AttributeHeaderSize
+
ah
(
entryData
).
getDataSize
();
start
++
;
}
return
ret
;
...
...
@@ -130,17 +130,17 @@ Dbtux::cmpScanBound(const Frag& frag, unsigned idir, ConstData boundInfo, unsign
// get and skip bound type (it is used after the loop)
type
=
boundInfo
[
0
];
boundInfo
+=
1
;
if
(
!
boundInfo
.
ah
(
).
isNULL
())
{
if
(
!
entryData
.
ah
(
).
isNULL
())
{
if
(
!
ah
(
boundInfo
).
isNULL
())
{
if
(
!
ah
(
entryData
).
isNULL
())
{
jam
();
// verify attribute id
const
Uint32
index
=
boundInfo
.
ah
(
).
getAttributeId
();
const
Uint32
index
=
ah
(
boundInfo
).
getAttributeId
();
ndbrequire
(
index
<
frag
.
m_numAttrs
);
const
DescAttr
&
descAttr
=
descEnt
.
m_descAttr
[
index
];
ndbrequire
(
entryData
.
ah
(
).
getAttributeId
()
==
descAttr
.
m_primaryAttrId
);
ndbrequire
(
ah
(
entryData
).
getAttributeId
()
==
descAttr
.
m_primaryAttrId
);
// sizes
const
unsigned
size1
=
boundInfo
.
ah
(
).
getDataSize
();
const
unsigned
size2
=
min
(
entryData
.
ah
(
).
getDataSize
(),
len2
);
const
unsigned
size1
=
ah
(
boundInfo
).
getDataSize
();
const
unsigned
size2
=
min
(
ah
(
entryData
).
getDataSize
(),
len2
);
len2
-=
size2
;
// compare
NdbSqlUtil
::
Cmp
*
const
cmp
=
c_sqlCmp
[
index
];
...
...
@@ -159,14 +159,14 @@ Dbtux::cmpScanBound(const Frag& frag, unsigned idir, ConstData boundInfo, unsign
}
}
else
{
jam
();
if
(
!
entryData
.
ah
(
).
isNULL
())
{
if
(
!
ah
(
entryData
).
isNULL
())
{
jam
();
// NULL < not NULL
return
-
1
;
}
}
boundInfo
+=
AttributeHeaderSize
+
boundInfo
.
ah
(
).
getDataSize
();
entryData
+=
AttributeHeaderSize
+
entryData
.
ah
(
).
getDataSize
();
boundInfo
+=
AttributeHeaderSize
+
ah
(
boundInfo
).
getDataSize
();
entryData
+=
AttributeHeaderSize
+
ah
(
entryData
).
getDataSize
();
boundCount
-=
1
;
}
// all attributes were equal
...
...
ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
View file @
b83200e6
...
...
@@ -221,7 +221,7 @@ Dbtux::setKeyAttrs(const Frag& frag)
const
DescAttr
&
descAttr
=
descEnt
.
m_descAttr
[
i
];
Uint32
size
=
AttributeDescriptor
::
getSizeInWords
(
descAttr
.
m_attrDesc
);
// set attr id and fixed size
keyAttrs
.
ah
(
)
=
AttributeHeader
(
descAttr
.
m_primaryAttrId
,
size
);
ah
(
keyAttrs
)
=
AttributeHeader
(
descAttr
.
m_primaryAttrId
,
size
);
keyAttrs
+=
1
;
// set comparison method pointer
const
NdbSqlUtil
::
Type
&
sqlType
=
NdbSqlUtil
::
getTypeBinary
(
descAttr
.
m_typeId
);
...
...
@@ -251,8 +251,8 @@ Dbtux::readKeyAttrs(const Frag& frag, TreeEnt ent, unsigned start, Data keyData)
ConstData
data
=
keyData
;
Uint32
totalSize
=
0
;
for
(
Uint32
i
=
start
;
i
<
frag
.
m_numAttrs
;
i
++
)
{
Uint32
attrId
=
data
.
ah
(
).
getAttributeId
();
Uint32
dataSize
=
data
.
ah
(
).
getDataSize
();
Uint32
attrId
=
ah
(
data
).
getAttributeId
();
Uint32
dataSize
=
ah
(
data
).
getDataSize
();
debugOut
<<
i
<<
" attrId="
<<
attrId
<<
" size="
<<
dataSize
;
data
+=
1
;
for
(
Uint32
j
=
0
;
j
<
dataSize
;
j
++
)
{
...
...
@@ -290,7 +290,7 @@ Dbtux::copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2
unsigned
len2
=
maxlen2
;
while
(
n
!=
0
)
{
jam
();
const
unsigned
dataSize
=
data1
.
ah
(
).
getDataSize
();
const
unsigned
dataSize
=
ah
(
data1
).
getDataSize
();
// copy header
if
(
len2
==
0
)
return
;
...
...
ndb/test/ndbapi/testOIBasic.cpp
View file @
b83200e6
This diff is collapsed.
Click to expand it.
ndb/test/run-test/daily-basic-tests.txt
View file @
b83200e6
...
...
@@ -607,7 +607,15 @@ args:
max-time: 5000
cmd: testOIBasic
args:
args: -case abcdefz
max-time: 2000
cmd: testOIBasic
args: -case gz
max-time: 2000
cmd: testOIBasic
args: -case hz
max-time: 2500
cmd: testBitfield
...
...
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