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
967eb52b
Commit
967eb52b
authored
Apr 12, 2007
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#27756
testcase only new pseudo column NDB$COPY_ROWID
parent
3411ba8b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
0 deletions
+80
-0
storage/ndb/include/kernel/AttributeHeader.hpp
storage/ndb/include/kernel/AttributeHeader.hpp
+2
-0
storage/ndb/include/ndbapi/NdbDictionary.hpp
storage/ndb/include/ndbapi/NdbDictionary.hpp
+1
-0
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
+4
-0
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+6
-0
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp
+5
-0
storage/ndb/test/ndbapi/testBasic.cpp
storage/ndb/test/ndbapi/testBasic.cpp
+62
-0
No files found.
storage/ndb/include/kernel/AttributeHeader.hpp
View file @
967eb52b
...
...
@@ -46,6 +46,8 @@ public:
STATIC_CONST
(
ROW_GCI
=
0xFFF5
);
STATIC_CONST
(
FRAGMENT_VARSIZED_MEMORY
=
0xFFF4
);
STATIC_CONST
(
COPY_ROWID
=
0xFFF1
);
// NOTE: in 5.1 ctors and init take size in bytes
/** Initialize AttributeHeader at location aHeaderPtr */
...
...
storage/ndb/include/ndbapi/NdbDictionary.hpp
View file @
967eb52b
...
...
@@ -534,6 +534,7 @@ public:
static
const
Column
*
RECORDS_IN_RANGE
;
static
const
Column
*
ROWID
;
static
const
Column
*
ROW_GCI
;
static
const
Column
*
COPY_ROWID
;
int
getSizeInBytes
()
const
;
#endif
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
View file @
967eb52b
...
...
@@ -1198,6 +1198,10 @@ Dbtup::read_pseudo(Uint32 attrId,
return
2
;
}
return
0
;
case
AttributeHeader
:
:
COPY_ROWID
:
outBuffer
[
0
]
=
operPtr
.
p
->
m_copy_tuple_location
.
m_page_no
;
outBuffer
[
0
]
=
operPtr
.
p
->
m_copy_tuple_location
.
m_page_idx
;
return
2
;
default:
return
0
;
}
...
...
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
967eb52b
...
...
@@ -378,6 +378,11 @@ NdbColumnImpl::create_pseudo(const char * name){
col
->
m_impl
.
m_attrSize
=
8
;
col
->
m_impl
.
m_arraySize
=
1
;
col
->
m_impl
.
m_nullable
=
true
;
}
else
if
(
!
strcmp
(
name
,
"NDB$COPY_ROWID"
)){
col
->
setType
(
NdbDictionary
::
Column
::
Bigunsigned
);
col
->
m_impl
.
m_attrId
=
AttributeHeader
::
COPY_ROWID
;
col
->
m_impl
.
m_attrSize
=
4
;
col
->
m_impl
.
m_arraySize
=
2
;
}
else
{
abort
();
}
...
...
@@ -5089,3 +5094,4 @@ const NdbDictionary::Column * NdbDictionary::Column::DISK_REF = 0;
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
RECORDS_IN_RANGE
=
0
;
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
ROWID
=
0
;
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
ROW_GCI
=
0
;
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
COPY_ROWID
=
0
;
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp
View file @
967eb52b
...
...
@@ -326,6 +326,8 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char *
NdbColumnImpl
::
create_pseudo
(
"NDB$ROWID"
);
NdbDictionary
::
Column
::
ROW_GCI
=
NdbColumnImpl
::
create_pseudo
(
"NDB$ROW_GCI"
);
NdbDictionary
::
Column
::
COPY_ROWID
=
NdbColumnImpl
::
create_pseudo
(
"NDB$COPY_ROWID"
);
}
NdbMutex_Unlock
(
g_ndb_connection_mutex
);
...
...
@@ -391,6 +393,9 @@ Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl()
NdbDictionary
::
Column
::
RECORDS_IN_RANGE
=
0
;
NdbDictionary
::
Column
::
ROWID
=
0
;
NdbDictionary
::
Column
::
ROW_GCI
=
0
;
delete
NdbDictionary
::
Column
::
COPY_ROWID
;
NdbDictionary
::
Column
::
COPY_ROWID
=
0
;
}
NdbMutex_Unlock
(
g_ndb_connection_mutex
);
...
...
storage/ndb/test/ndbapi/testBasic.cpp
View file @
967eb52b
...
...
@@ -1272,6 +1272,64 @@ runBug25090(NDBT_Context* ctx, NDBT_Step* step){
return
NDBT_OK
;
}
int
runBug27756
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
)
{
Ndb
*
pNdb
=
GETNDB
(
step
);
NdbDictionary
::
Dictionary
*
dict
=
pNdb
->
getDictionary
();
HugoOperations
ops
(
*
ctx
->
getTab
());
int
loops
=
ctx
->
getNumLoops
();
const
int
rows
=
ctx
->
getNumRecords
();
Vector
<
Uint64
>
copies
;
while
(
loops
--
)
{
ops
.
startTransaction
(
pNdb
);
ops
.
pkInsertRecord
(
pNdb
,
1
,
1
);
ops
.
execute_NoCommit
(
pNdb
);
NdbTransaction
*
pTrans
=
ops
.
getTransaction
();
NdbOperation
*
op
=
pTrans
->
getNdbOperation
(
ctx
->
getTab
()
->
getName
());
op
->
interpretedUpdateTuple
();
ops
.
equalForRow
(
op
,
1
);
NdbRecAttr
*
attr
=
op
->
getValue
(
NdbDictionary
::
Column
::
COPY_ROWID
);
ops
.
execute_NoCommit
(
pNdb
);
copies
.
push_back
(
attr
->
u_64_value
());
ndbout_c
(
"copy at: %llx"
,
copies
.
back
());
ops
.
execute_NoCommit
(
pNdb
);
ops
.
pkDeleteRecord
(
pNdb
,
1
,
1
);
ops
.
execute_NoCommit
(
pNdb
);
if
(
loops
&
1
)
{
ops
.
execute_Rollback
(
pNdb
);
ops
.
closeTransaction
(
pNdb
);
}
else
{
ops
.
execute_Commit
(
pNdb
);
ops
.
closeTransaction
(
pNdb
);
ops
.
clearTable
(
pNdb
,
100
);
}
}
for
(
Uint32
i
=
0
;
i
<
copies
.
size
();
i
++
)
if
(
copies
[
i
]
!=
copies
.
back
())
{
ndbout_c
(
"Memleak detected"
);
return
NDBT_FAILED
;
}
return
NDBT_OK
;
}
template
class
Vector
<
Uint64
>;
NDBT_TESTSUITE
(
testBasic
);
TESTCASE
(
"PkInsert"
,
"Verify that we can insert and delete from this table using PK"
...
...
@@ -1542,6 +1600,10 @@ TESTCASE("Bug25090",
"Verify what happens when we fill the db"
){
STEP
(
runBug25090
);
}
TESTCASE
(
"Bug27756"
,
"Verify what happens when we fill the db"
){
STEP
(
runBug27756
);
}
NDBT_TESTSUITE_END
(
testBasic
);
#if 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