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
a6eef237
Commit
a6eef237
authored
Apr 12, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
parents
527b4636
0d50ab1c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
171 additions
and
150 deletions
+171
-150
storage/ndb/include/kernel/AttributeHeader.hpp
storage/ndb/include/kernel/AttributeHeader.hpp
+1
-0
storage/ndb/include/ndbapi/NdbDictionary.hpp
storage/ndb/include/ndbapi/NdbDictionary.hpp
+1
-0
storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
+1
-2
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/include/HugoOperations.hpp
storage/ndb/test/include/HugoOperations.hpp
+2
-0
storage/ndb/test/ndbapi/testBasic.cpp
storage/ndb/test/ndbapi/testBasic.cpp
+62
-0
storage/ndb/test/run-test/daily-basic-tests.txt
storage/ndb/test/run-test/daily-basic-tests.txt
+4
-0
storage/ndb/test/src/HugoAsynchTransactions.cpp
storage/ndb/test/src/HugoAsynchTransactions.cpp
+23
-35
storage/ndb/test/src/HugoOperations.cpp
storage/ndb/test/src/HugoOperations.cpp
+33
-60
storage/ndb/test/src/HugoTransactions.cpp
storage/ndb/test/src/HugoTransactions.cpp
+29
-53
No files found.
storage/ndb/include/kernel/AttributeHeader.hpp
View file @
a6eef237
...
...
@@ -47,6 +47,7 @@ public:
STATIC_CONST
(
FRAGMENT_VARSIZED_MEMORY
=
0xFFF4
);
// 0xFFF3 to be used for read packed when merged
STATIC_CONST
(
ANY_VALUE
=
0xFFF2
);
STATIC_CONST
(
COPY_ROWID
=
0xFFF1
);
// NOTE: in 5.1 ctors and init take size in bytes
...
...
storage/ndb/include/ndbapi/NdbDictionary.hpp
View file @
a6eef237
...
...
@@ -535,6 +535,7 @@ public:
static
const
Column
*
ROWID
;
static
const
Column
*
ROW_GCI
;
static
const
Column
*
ANY_VALUE
;
static
const
Column
*
COPY_ROWID
;
int
getSizeInBytes
()
const
;
#endif
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
View file @
a6eef237
...
...
@@ -105,8 +105,7 @@ void Dbtup::removeActiveOpList(Operationrec* const regOperPtr,
/**
* Release copy tuple
*/
if
(
regOperPtr
->
op_struct
.
op_type
!=
ZDELETE
&&
!
regOperPtr
->
m_copy_tuple_location
.
isNull
())
if
(
!
regOperPtr
->
m_copy_tuple_location
.
isNull
())
c_undo_buffer
.
free_copy_tuple
(
&
regOperPtr
->
m_copy_tuple_location
);
if
(
regOperPtr
->
op_struct
.
in_active_list
)
{
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
View file @
a6eef237
...
...
@@ -1214,6 +1214,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 @
a6eef237
...
...
@@ -383,6 +383,11 @@ NdbColumnImpl::create_pseudo(const char * name){
col
->
m_impl
.
m_attrId
=
AttributeHeader
::
ANY_VALUE
;
col
->
m_impl
.
m_attrSize
=
4
;
col
->
m_impl
.
m_arraySize
=
1
;
}
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
();
}
...
...
@@ -5288,3 +5293,4 @@ 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
::
ANY_VALUE
=
0
;
const
NdbDictionary
::
Column
*
NdbDictionary
::
Column
::
COPY_ROWID
=
0
;
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp
View file @
a6eef237
...
...
@@ -330,6 +330,8 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char *
NdbColumnImpl
::
create_pseudo
(
"NDB$ROW_GCI"
);
NdbDictionary
::
Column
::
ANY_VALUE
=
NdbColumnImpl
::
create_pseudo
(
"NDB$ANY_VALUE"
);
NdbDictionary
::
Column
::
COPY_ROWID
=
NdbColumnImpl
::
create_pseudo
(
"NDB$COPY_ROWID"
);
}
NdbMutex_Unlock
(
g_ndb_connection_mutex
);
...
...
@@ -397,6 +399,9 @@ Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl()
NdbDictionary
::
Column
::
ROWID
=
0
;
NdbDictionary
::
Column
::
ROW_GCI
=
0
;
NdbDictionary
::
Column
::
ANY_VALUE
=
0
;
delete
NdbDictionary
::
Column
::
COPY_ROWID
;
NdbDictionary
::
Column
::
COPY_ROWID
=
0
;
}
NdbMutex_Unlock
(
g_ndb_connection_mutex
);
...
...
storage/ndb/test/include/HugoOperations.hpp
View file @
a6eef237
...
...
@@ -83,6 +83,8 @@ public:
int
equalForAttr
(
NdbOperation
*
,
int
attrId
,
int
rowId
);
int
equalForRow
(
NdbOperation
*
,
int
rowid
);
int
setValues
(
NdbOperation
*
,
int
rowId
,
int
updateId
);
...
...
storage/ndb/test/ndbapi/testBasic.cpp
View file @
a6eef237
...
...
@@ -1318,6 +1318,64 @@ runDeleteRead(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"
...
...
@@ -1594,6 +1652,10 @@ TESTCASE("DeleteRead",
INITIALIZER
(
runDeleteRead
);
FINALIZER
(
runClearTable2
);
}
TESTCASE
(
"Bug27756"
,
"Verify what happens when we fill the db"
){
STEP
(
runBug27756
);
}
NDBT_TESTSUITE_END
(
testBasic
);
#if 0
...
...
storage/ndb/test/run-test/daily-basic-tests.txt
View file @
a6eef237
...
...
@@ -239,6 +239,10 @@ max-time: 500
cmd: testBasic
args: -n Bug25090 T1
max-time: 1000
cmd: testBasic
args: -n Bug27756
max-time: 500
cmd: testIndex
args: -n Bug25059 -r 3000 T1
...
...
storage/ndb/test/src/HugoAsynchTransactions.cpp
View file @
a6eef237
...
...
@@ -188,14 +188,11 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
// Read
// Define primary keys
check
=
pOp
->
readTupleExclusive
();
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
equalForAttr
(
pOp
,
a
,
cReadRecords
)
!=
0
){
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
return
NDBT_FAILED
;
}
}
if
(
equalForRow
(
pOp
,
cReadRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
return
NDBT_FAILED
;
}
// Define attributes to read
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
...
...
@@ -259,15 +256,12 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
}
// Set search condition for the record
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
cReadRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
return
NDBT_FAILED
;
}
// Update the record
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
...
...
@@ -396,15 +390,12 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
case
NO_READ
:
// Define primary keys
check
=
pOp
->
readTuple
();
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
){
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
cRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
return
NDBT_FAILED
;
}
// Define attributes to read
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
((
rows
[
cIndex
]
->
attributeStore
(
a
)
=
...
...
@@ -425,15 +416,12 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
cRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
return
NDBT_FAILED
;
}
break
;
default:
// Should not happen...
...
...
storage/ndb/test/src/HugoOperations.cpp
View file @
a6eef237
...
...
@@ -111,14 +111,8 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
r
+
recordNo
)
!=
0
)
return
NDBT_FAILED
;
if
(
pIndexScanOp
)
pIndexScanOp
->
end_of_bound
(
r
);
...
...
@@ -143,7 +137,6 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
int
recordNo
,
int
numRecords
,
int
updatesValue
){
int
a
;
allocRows
(
numRecords
);
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
...
@@ -172,14 +165,8 @@ HugoOperations::setValues(NdbOperation* pOp, int rowId, int updateId)
{
// Define primary keys
int
a
;
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
rowId
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
rowId
)
!=
0
)
return
NDBT_FAILED
;
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
...
...
@@ -198,7 +185,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
int
numRecords
,
int
updatesValue
){
int
a
,
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
NdbOperation
*
pOp
=
getOperation
(
pTrans
,
NdbOperation
::
InsertRequest
);
if
(
pOp
==
NULL
)
{
...
...
@@ -240,14 +227,8 @@ int HugoOperations::pkWriteRecord(Ndb* pNdb,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
r
+
recordNo
)
!=
0
)
return
NDBT_FAILED
;
// Define attributes to update
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
...
...
@@ -266,7 +247,7 @@ int HugoOperations::pkWritePartialRecord(Ndb* pNdb,
int
recordNo
,
int
numRecords
){
int
a
,
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
...
...
@@ -281,14 +262,8 @@ int HugoOperations::pkWritePartialRecord(Ndb* pNdb,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
r
+
recordNo
)
!=
0
)
return
NDBT_FAILED
;
}
return
NDBT_OK
;
}
...
...
@@ -297,7 +272,7 @@ int HugoOperations::pkDeleteRecord(Ndb* pNdb,
int
recordNo
,
int
numRecords
){
int
a
,
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
NdbOperation
*
pOp
=
getOperation
(
pTrans
,
NdbOperation
::
DeleteRequest
);
if
(
pOp
==
NULL
)
{
...
...
@@ -312,14 +287,8 @@ int HugoOperations::pkDeleteRecord(Ndb* pNdb,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
r
+
recordNo
)
!=
0
)
return
NDBT_FAILED
;
}
return
NDBT_OK
;
}
...
...
@@ -521,6 +490,22 @@ HugoOperations::~HugoOperations(){
}
}
int
HugoOperations
::
equalForRow
(
NdbOperation
*
pOp
,
int
row
)
{
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
equalForAttr
(
pOp
,
a
,
row
)
!=
0
)
{
ERR
(
pOp
->
getNdbError
());
return
NDBT_FAILED
;
}
}
}
return
NDBT_OK
;
}
int
HugoOperations
::
equalForAttr
(
NdbOperation
*
pOp
,
int
attrId
,
...
...
@@ -679,14 +664,8 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
r
+
recordNo
)
!=
0
)
return
NDBT_FAILED
;
// Define attributes to read
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
...
...
@@ -723,14 +702,8 @@ HugoOperations::indexUpdateRecord(Ndb*,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
return
NDBT_FAILED
;
}
}
}
if
(
equalForRow
(
pOp
,
r
+
recordNo
)
!=
0
)
return
NDBT_FAILED
;
// Define attributes to update
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
...
...
storage/ndb/test/src/HugoTransactions.cpp
View file @
a6eef237
...
...
@@ -520,10 +520,9 @@ HugoTransactions::loadTable(Ndb* pNdb,
bool
oneTrans
,
int
value
,
bool
abort
){
int
check
,
a
;
int
check
;
int
retryAttempt
=
0
;
int
retryMax
=
5
;
NdbOperation
*
pOp
;
bool
first_batch
=
true
;
const
int
org
=
batch
;
...
...
@@ -667,10 +666,9 @@ HugoTransactions::loadTable(Ndb* pNdb,
int
HugoTransactions
::
fillTable
(
Ndb
*
pNdb
,
int
batch
){
int
check
,
a
,
b
;
int
check
;
int
retryAttempt
=
0
;
int
retryMax
=
5
;
NdbOperation
*
pOp
;
const
int
org
=
batch
;
const
int
cols
=
tab
.
getNoOfColumns
();
...
...
@@ -791,7 +789,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
int
reads
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
check
,
a
;
int
check
;
if
(
batch
==
0
)
{
g_info
<<
"ERROR: Argument batch == 0 in pkReadRecords(). Not allowed."
<<
endl
;
...
...
@@ -910,8 +908,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
int
updated
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
check
,
a
,
b
;
NdbOperation
*
pOp
;
int
check
,
b
;
allocRows
(
batch
);
...
...
@@ -1097,14 +1094,10 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
}
if
(
equalForRow
(
pOp
,
r
)
!=
0
)
{
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
// Read update value
...
...
@@ -1153,14 +1146,10 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
// PKs
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pUpdOp
,
a
,
r
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
}
if
(
equalForRow
(
pOp
,
r
)
!=
0
)
{
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
// Update col
...
...
@@ -1236,8 +1225,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
int
deleted
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
check
,
a
;
NdbOperation
*
pOp
;
int
check
;
g_info
<<
"|- Deleting records..."
<<
endl
;
while
(
r
<
records
){
...
...
@@ -1335,8 +1323,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
// and lock som other records
int
r
=
0
;
int
retryAttempt
=
0
;
int
check
,
a
,
b
;
NdbOperation
*
pOp
;
int
check
;
NdbOperation
::
LockMode
lm
=
NdbOperation
::
LM_Exclusive
;
// Calculate how many records to lock in each batch
...
...
@@ -1522,14 +1509,10 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
}
if
(
equalForRow
(
pOp
,
r
+
b
)
!=
0
)
{
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
// Define attributes to read
...
...
@@ -1663,14 +1646,10 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
// Define primary keys
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
}
if
(
equalForRow
(
pOp
,
r
+
b
)
!=
0
)
{
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
// Define attributes to read
...
...
@@ -1733,16 +1712,13 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
return
NDBT_FAILED
;
}
if
(
!
ordered
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pUpdOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
}
}
if
(
!
ordered
)
{
if
(
equalForRow
(
pOp
,
r
+
b
)
!=
0
)
{
closeTransaction
(
pNdb
);
return
NDBT_FAILED
;
}
}
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
...
...
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