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
7050d08f
Commit
7050d08f
authored
Jun 07, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0
parents
ac76e6db
7e031804
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
425 additions
and
94 deletions
+425
-94
mysql-test/t/ndb_restore.test
mysql-test/t/ndb_restore.test
+1
-1
ndb/include/transporter/TransporterRegistry.hpp
ndb/include/transporter/TransporterRegistry.hpp
+7
-0
ndb/src/common/transporter/SCI_Transporter.cpp
ndb/src/common/transporter/SCI_Transporter.cpp
+5
-4
ndb/src/common/transporter/SCI_Transporter.hpp
ndb/src/common/transporter/SCI_Transporter.hpp
+2
-1
ndb/src/common/transporter/SHM_Buffer.hpp
ndb/src/common/transporter/SHM_Buffer.hpp
+17
-0
ndb/src/common/transporter/SHM_Transporter.cpp
ndb/src/common/transporter/SHM_Transporter.cpp
+6
-0
ndb/src/common/transporter/SHM_Transporter.hpp
ndb/src/common/transporter/SHM_Transporter.hpp
+2
-0
ndb/src/common/transporter/SendBuffer.cpp
ndb/src/common/transporter/SendBuffer.cpp
+1
-1
ndb/src/common/transporter/SendBuffer.hpp
ndb/src/common/transporter/SendBuffer.hpp
+1
-1
ndb/src/common/transporter/TCP_Transporter.cpp
ndb/src/common/transporter/TCP_Transporter.cpp
+5
-0
ndb/src/common/transporter/TCP_Transporter.hpp
ndb/src/common/transporter/TCP_Transporter.hpp
+1
-0
ndb/src/common/transporter/Transporter.hpp
ndb/src/common/transporter/Transporter.hpp
+2
-0
ndb/src/common/transporter/TransporterRegistry.cpp
ndb/src/common/transporter/TransporterRegistry.cpp
+12
-0
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+1
-0
ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp
ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp
+3
-0
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+2
-2
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+6
-2
ndb/src/ndbapi/NdbOperationExec.cpp
ndb/src/ndbapi/NdbOperationExec.cpp
+11
-5
ndb/test/ndbapi/testNdbApi.cpp
ndb/test/ndbapi/testNdbApi.cpp
+112
-0
ndb/test/run-test/daily-basic-tests.txt
ndb/test/run-test/daily-basic-tests.txt
+4
-0
ndb/test/run-test/ndb-autotest.sh
ndb/test/run-test/ndb-autotest.sh
+202
-55
ndb/test/tools/hugoLoad.cpp
ndb/test/tools/hugoLoad.cpp
+4
-2
ndb/test/tools/hugoPkUpdate.cpp
ndb/test/tools/hugoPkUpdate.cpp
+4
-3
ndb/test/tools/hugoScanRead.cpp
ndb/test/tools/hugoScanRead.cpp
+4
-3
ndb/test/tools/hugoScanUpdate.cpp
ndb/test/tools/hugoScanUpdate.cpp
+5
-3
ndb/tools/Makefile.am
ndb/tools/Makefile.am
+2
-1
ndb/tools/restore/Restore.cpp
ndb/tools/restore/Restore.cpp
+3
-10
No files found.
mysql-test/t/ndb_restore.test
View file @
7050d08f
...
...
@@ -214,4 +214,4 @@ drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
# Test BUG#10287
#
--
exec
$NDB_TOOLS_DIR
/
ndb_select_all
-
d
sys
-
D
,
SYSTAB_0
|
grep
520093696
--
exec
$NDB_TOOLS_DIR
/
ndb_select_all
-
-
no
-
defaults
-
d
sys
-
D
,
SYSTAB_0
|
grep
520093696
ndb/include/transporter/TransporterRegistry.hpp
View file @
7050d08f
...
...
@@ -203,6 +203,13 @@ public:
bool
createSCITransporter
(
struct
TransporterConfiguration
*
config
);
bool
createSHMTransporter
(
struct
TransporterConfiguration
*
config
);
bool
createOSETransporter
(
struct
TransporterConfiguration
*
config
);
/**
* Get free buffer space
*
* Get #free bytes in send buffer for <em>node</node>
*/
Uint32
get_free_buffer
(
Uint32
node
)
const
;
/**
* prepareSend
...
...
ndb/src/common/transporter/SCI_Transporter.cpp
View file @
7050d08f
...
...
@@ -1025,7 +1025,8 @@ SCI_Transporter::initSCI() {
DBUG_RETURN
(
true
);
}
Uint32
SCI_Transporter
::
get_free_buffer
()
const
{
return
(
m_TargetSegm
[
m_ActiveAdapterId
].
writer
)
->
get_free_buffer
();
}
ndb/src/common/transporter/SCI_Transporter.hpp
View file @
7050d08f
...
...
@@ -133,7 +133,8 @@ public:
* remote segment is mapped. Otherwize false.
*/
bool
getConnectionStatus
();
virtual
Uint32
get_free_buffer
()
const
;
private:
SCI_Transporter
(
TransporterRegistry
&
t_reg
,
const
char
*
local_host
,
...
...
ndb/src/common/transporter/SHM_Buffer.hpp
View file @
7050d08f
...
...
@@ -157,6 +157,7 @@ public:
inline
Uint32
getWriteIndex
()
const
{
return
m_writeIndex
;}
inline
Uint32
getBufferSize
()
const
{
return
m_bufferSize
;}
inline
Uint32
get_free_buffer
()
const
;
inline
void
copyIndexes
(
SHM_Writer
*
standbyWriter
);
...
...
@@ -212,5 +213,21 @@ SHM_Writer::updateWritePtr(Uint32 sz){
m_writeIndex
=
tWriteIndex
;
*
m_sharedWriteIndex
=
tWriteIndex
;
}
inline
Uint32
SHM_Writer
::
get_free_buffer
()
const
{
Uint32
tReadIndex
=
*
m_sharedReadIndex
;
Uint32
tWriteIndex
=
m_writeIndex
;
Uint32
free
;
if
(
tReadIndex
<=
tWriteIndex
){
free
=
m_bufferSize
+
tReadIndex
-
tWriteIndex
;
}
else
{
free
=
tReadIndex
-
tWriteIndex
;
}
return
free
;
}
#endif
ndb/src/common/transporter/SHM_Transporter.cpp
View file @
7050d08f
...
...
@@ -365,3 +365,9 @@ SHM_Transporter::doSend()
kill
(
m_remote_pid
,
g_ndb_shm_signum
);
}
}
Uint32
SHM_Transporter
::
get_free_buffer
()
const
{
return
writer
->
get_free_buffer
();
}
ndb/src/common/transporter/SHM_Transporter.hpp
View file @
7050d08f
...
...
@@ -139,6 +139,8 @@ protected:
int
m_remote_pid
;
Uint32
m_last_signal
;
Uint32
m_signal_threshold
;
virtual
Uint32
get_free_buffer
()
const
;
private:
bool
_shmSegCreated
;
...
...
ndb/src/common/transporter/SendBuffer.cpp
View file @
7050d08f
...
...
@@ -60,7 +60,7 @@ SendBuffer::bufferSize() {
}
Uint32
SendBuffer
::
bufferSizeRemaining
()
{
SendBuffer
::
bufferSizeRemaining
()
const
{
return
(
sizeOfBuffer
-
dataSize
);
}
...
...
ndb/src/common/transporter/SendBuffer.hpp
View file @
7050d08f
...
...
@@ -51,7 +51,7 @@ public:
bool
initBuffer
(
Uint32
aRemoteNodeId
);
// Number of bytes remaining in the buffer
Uint32
bufferSizeRemaining
();
Uint32
bufferSizeRemaining
()
const
;
// Number of bytes of data in the buffer
int
bufferSize
();
...
...
ndb/src/common/transporter/TCP_Transporter.cpp
View file @
7050d08f
...
...
@@ -253,6 +253,11 @@ TCP_Transporter::sendIsPossible(struct timeval * timeout) {
#endif
}
Uint32
TCP_Transporter
::
get_free_buffer
()
const
{
return
m_sendBuffer
.
bufferSizeRemaining
();
}
Uint32
*
TCP_Transporter
::
getWritePtr
(
Uint32
lenBytes
,
Uint32
prio
){
...
...
ndb/src/common/transporter/TCP_Transporter.hpp
View file @
7050d08f
...
...
@@ -101,6 +101,7 @@ private:
*/
virtual
void
updateReceiveDataPtr
(
Uint32
bytesRead
);
virtual
Uint32
get_free_buffer
()
const
;
protected:
/**
* Setup client/server and perform connect/accept
...
...
ndb/src/common/transporter/Transporter.hpp
View file @
7050d08f
...
...
@@ -86,6 +86,8 @@ public:
m_socket_client
->
set_port
(
port
);
};
virtual
Uint32
get_free_buffer
()
const
=
0
;
protected:
Transporter
(
TransporterRegistry
&
,
TransporterType
,
...
...
ndb/src/common/transporter/TransporterRegistry.cpp
View file @
7050d08f
...
...
@@ -558,6 +558,18 @@ TransporterRegistry::removeTransporter(NodeId nodeId) {
theTransporters
[
nodeId
]
=
NULL
;
}
Uint32
TransporterRegistry
::
get_free_buffer
(
Uint32
node
)
const
{
Transporter
*
t
;
if
(
likely
((
t
=
theTransporters
[
node
])
!=
0
))
{
return
t
->
get_free_buffer
();
}
return
0
;
}
SendStatus
TransporterRegistry
::
prepareSend
(
const
SignalHeader
*
const
signalHeader
,
Uint8
prio
,
...
...
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
View file @
7050d08f
...
...
@@ -5072,6 +5072,7 @@ Dbdih::invalidateNodeLCP(Signal* signal, Uint32 nodeId, TabRecordPtr tabPtr)
* And reset nextLcp
*/
replicaPtr
.
p
->
nextLcp
=
0
;
replicaPtr
.
p
->
noCrashedReplicas
=
0
;
}
//if
}
//for
}
//for
...
...
ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp
View file @
7050d08f
...
...
@@ -133,6 +133,9 @@ void Dbtup::sendReadAttrinfo(Signal* signal,
Uint32
ToutBufIndex
,
const
Operationrec
*
const
regOperPtr
)
{
if
(
ToutBufIndex
==
0
)
return
;
const
BlockReference
recBlockref
=
regOperPtr
->
recBlockref
;
const
Uint32
sig0
=
regOperPtr
->
tcOperationPtr
;
const
Uint32
sig1
=
regOperPtr
->
transid1
;
...
...
ndb/src/mgmsrv/ConfigInfo.cpp
View file @
7050d08f
...
...
@@ -1668,7 +1668,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false
,
ConfigInfo
::
CI_INT
,
"256K"
,
"
16
K"
,
"
64
K"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
...
...
@@ -1856,7 +1856,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false
,
ConfigInfo
::
CI_INT
,
"1M"
,
"4K"
,
"
6
4K"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
7050d08f
...
...
@@ -1649,7 +1649,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
abort
();
}
int
distKeys
=
impl
.
m_noOfDistributionKeys
;
int
distKeys
=
impl
.
m_noOfDistributionKeys
&&
impl
.
m_noOfDistributionKeys
<
impl
.
m_noOfKeys
;
assert
(
distKeys
==
0
||
distKeys
==
1
);
for
(
i
=
0
;
i
<
sz
;
i
++
){
const
NdbColumnImpl
*
col
=
impl
.
m_columns
[
i
];
if
(
col
==
0
)
...
...
@@ -1661,7 +1665,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
tmpAttr
.
AttributeId
=
i
;
tmpAttr
.
AttributeKeyFlag
=
col
->
m_pk
;
tmpAttr
.
AttributeNullableFlag
=
col
->
m_nullable
;
tmpAttr
.
AttributeDKey
=
col
->
m_distributionKey
;
tmpAttr
.
AttributeDKey
=
distKeys
*
col
->
m_distributionKey
;
tmpAttr
.
AttributeExtType
=
(
Uint32
)
col
->
m_type
;
tmpAttr
.
AttributeExtPrecision
=
((
unsigned
)
col
->
m_precision
&
0xFFFF
);
...
...
ndb/src/ndbapi/NdbOperationExec.cpp
View file @
7050d08f
...
...
@@ -104,8 +104,9 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
{
Uint32
tTransId1
,
tTransId2
;
Uint32
tReqInfo
;
Uint32
tInterpretInd
=
theInterpretIndicator
;
Uint8
tInterpretInd
=
theInterpretIndicator
;
Uint8
tDirtyIndicator
=
theDirtyIndicator
;
Uint32
tTotalCurrAI_Len
=
theTotalCurrAI_Len
;
theErrorLine
=
0
;
if
(
tInterpretInd
!=
1
)
{
...
...
@@ -123,7 +124,13 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
if
(
tStatus
!=
GetValue
)
{
setErrorCodeAbort
(
4116
);
return
-
1
;
}
//if
}
else
if
(
unlikely
(
tDirtyIndicator
&&
tTotalCurrAI_Len
==
0
))
{
getValue
(
NdbDictionary
::
Column
::
FRAGMENT
);
tTotalCurrAI_Len
=
theTotalCurrAI_Len
;
assert
(
theTotalCurrAI_Len
);
}
}
else
{
setErrorCodeAbort
(
4005
);
return
-
1
;
...
...
@@ -132,6 +139,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
if
(
prepareSendInterpreted
()
==
-
1
)
{
return
-
1
;
}
//if
tTotalCurrAI_Len
=
theTotalCurrAI_Len
;
}
//if
//-------------------------------------------------------------
...
...
@@ -140,7 +148,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
//-------------------------------------------------------------
TcKeyReq
*
const
tcKeyReq
=
CAST_PTR
(
TcKeyReq
,
theTCREQ
->
getDataPtrSend
());
Uint32
tTotalCurrAI_Len
=
theTotalCurrAI_Len
;
Uint32
tTableId
=
m_currentTable
->
m_tableId
;
Uint32
tSchemaVersion
=
m_currentTable
->
m_version
;
...
...
@@ -188,7 +195,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
tcKeyReq
->
setStartFlag
(
tReqInfo
,
tStartIndicator
);
tcKeyReq
->
setInterpretedFlag
(
tReqInfo
,
tInterpretIndicator
);
Uint8
tDirtyIndicator
=
theDirtyIndicator
;
OperationType
tOperationType
=
theOperationType
;
Uint32
tTupKeyLen
=
theTupKeyLen
;
Uint8
abortOption
=
...
...
ndb/test/ndbapi/testNdbApi.cpp
View file @
7050d08f
...
...
@@ -866,6 +866,112 @@ int runUpdateWithoutKeys(NDBT_Context* ctx, NDBT_Step* step){
return
result
;
}
int
runReadWithoutGetValue
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
const
NdbDictionary
::
Table
*
pTab
=
ctx
->
getTab
();
HugoOperations
hugoOps
(
*
pTab
);
Ndb
*
pNdb
=
GETNDB
(
step
);
Uint32
lm
;
for
(
Uint32
cm
=
0
;
cm
<
2
;
cm
++
)
{
for
(
lm
=
0
;
lm
<=
NdbOperation
::
LM_CommittedRead
;
lm
++
)
{
NdbConnection
*
pCon
=
pNdb
->
startTransaction
();
if
(
pCon
==
NULL
){
pNdb
->
closeTransaction
(
pCon
);
return
NDBT_FAILED
;
}
NdbOperation
*
pOp
=
pCon
->
getNdbOperation
(
pTab
->
getName
());
if
(
pOp
==
NULL
){
ERR
(
pCon
->
getNdbError
());
pNdb
->
closeTransaction
(
pCon
);
return
NDBT_FAILED
;
}
if
(
pOp
->
readTuple
((
NdbOperation
::
LockMode
)
lm
)
!=
0
){
pNdb
->
closeTransaction
(
pCon
);
ERR
(
pOp
->
getNdbError
());
return
NDBT_FAILED
;
}
for
(
int
a
=
0
;
a
<
pTab
->
getNoOfColumns
();
a
++
){
if
(
pTab
->
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
hugoOps
.
equalForAttr
(
pOp
,
a
,
1
)
!=
0
){
ERR
(
pCon
->
getNdbError
());
pNdb
->
closeTransaction
(
pCon
);
return
NDBT_FAILED
;
}
}
}
// Dont' call any getValues
// Execute should work
int
check
=
pCon
->
execute
(
cm
==
0
?
NoCommit
:
Commit
);
if
(
check
==
0
){
ndbout
<<
"execute worked"
<<
endl
;
}
else
{
ERR
(
pCon
->
getNdbError
());
result
=
NDBT_FAILED
;
}
pNdb
->
closeTransaction
(
pCon
);
}
}
/**
* Now test scans
*/
for
(
lm
=
0
;
lm
<=
NdbOperation
::
LM_CommittedRead
;
lm
++
)
{
NdbConnection
*
pCon
=
pNdb
->
startTransaction
();
if
(
pCon
==
NULL
){
pNdb
->
closeTransaction
(
pCon
);
return
NDBT_FAILED
;
}
NdbScanOperation
*
pOp
=
pCon
->
getNdbScanOperation
(
pTab
->
getName
());
if
(
pOp
==
NULL
){
ERR
(
pCon
->
getNdbError
());
pNdb
->
closeTransaction
(
pCon
);
return
NDBT_FAILED
;
}
if
((
pOp
->
readTuples
((
NdbOperation
::
LockMode
)
lm
))
!=
0
){
pNdb
->
closeTransaction
(
pCon
);
ERR
(
pOp
->
getNdbError
());
return
NDBT_FAILED
;
}
// Dont' call any getValues
// Execute should work
int
check
=
pCon
->
execute
(
NoCommit
);
if
(
check
==
0
){
ndbout
<<
"execute worked"
<<
endl
;
}
else
{
ERR
(
pCon
->
getNdbError
());
result
=
NDBT_FAILED
;
}
int
res
;
while
((
res
=
pOp
->
nextResult
())
==
0
);
pNdb
->
closeTransaction
(
pCon
);
if
(
res
!=
1
)
result
=
NDBT_FAILED
;
}
return
result
;
}
int
runCheckGetNdbErrorOperation
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
const
NdbDictionary
::
Table
*
pTab
=
ctx
->
getTab
();
...
...
@@ -1000,6 +1106,12 @@ TESTCASE("NdbErrorOperation",
"Test that NdbErrorOperation is properly set"
){
INITIALIZER
(
runCheckGetNdbErrorOperation
);
}
TESTCASE
(
"ReadWithoutGetValue"
,
"Test that it's possible to perform read wo/ getvalue's
\n
"
){
INITIALIZER
(
runLoadTable
);
INITIALIZER
(
runReadWithoutGetValue
);
FINALIZER
(
runClearTable
);
}
NDBT_TESTSUITE_END
(
testNdbApi
);
int
main
(
int
argc
,
const
char
**
argv
){
...
...
ndb/test/run-test/daily-basic-tests.txt
View file @
7050d08f
...
...
@@ -512,6 +512,10 @@ max-time: 500
cmd: testNdbApi
args: -n UpdateWithoutValues T6
max-time: 500
cmd: testNdbApi
args: -n ReadWithoutGetValue
#max-time: 500
#cmd: testInterpreter
#args: T1
...
...
ndb/test/run-test/ndb-autotest.sh
View file @
7050d08f
This diff is collapsed.
Click to expand it.
ndb/test/tools/hugoLoad.cpp
View file @
7050d08f
...
...
@@ -30,10 +30,12 @@ int main(int argc, const char** argv){
const
char
*
_tabname
=
NULL
;
int
_help
=
0
;
int
_batch
=
512
;
const
char
*
db
=
0
;
struct
getargs
args
[]
=
{
{
"records"
,
'r'
,
arg_integer
,
&
_records
,
"Number of records"
,
"recs"
},
{
"batch"
,
'b'
,
arg_integer
,
&
_batch
,
"Number of operations in each transaction"
,
"batch"
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
}
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
...
...
@@ -59,7 +61,7 @@ int main(int argc, const char** argv){
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
Ndb
MyNdb
(
&
con
,
db
?
db
:
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoPkUpdate.cpp
View file @
7050d08f
...
...
@@ -33,7 +33,7 @@ int main(int argc, const char** argv){
int
_loops
=
1
;
int
_abort
=
0
;
int
_batch
=
0
;
const
char
*
_tabname
=
NULL
;
const
char
*
_tabname
=
NULL
,
*
db
=
0
;
int
_help
=
0
;
struct
getargs
args
[]
=
{
...
...
@@ -41,7 +41,8 @@ int main(int argc, const char** argv){
{
"loops"
,
'l'
,
arg_integer
,
&
_loops
,
"number of times to run this program(0=infinite loop)"
,
"loops"
},
// { "batch", 'b', arg_integer, &_batch, "batch value", "batch" },
{
"records"
,
'r'
,
arg_integer
,
&
_records
,
"Number of records"
,
"records"
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
}
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
}
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
optind
=
0
;
...
...
@@ -62,7 +63,7 @@ int main(int argc, const char** argv){
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
Ndb
MyNdb
(
&
con
,
db
?
db
:
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoScanRead.cpp
View file @
7050d08f
...
...
@@ -33,7 +33,7 @@ int main(int argc, const char** argv){
int
_loops
=
1
;
int
_abort
=
0
;
int
_parallelism
=
1
;
const
char
*
_tabname
=
NULL
;
const
char
*
_tabname
=
NULL
,
*
db
=
0
;
int
_help
=
0
;
int
lock
=
NdbOperation
::
LM_Read
;
int
sorted
=
0
;
...
...
@@ -45,7 +45,8 @@ int main(int argc, const char** argv){
{
"records"
,
'r'
,
arg_integer
,
&
_records
,
"Number of records"
,
"recs"
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
},
{
"lock"
,
'm'
,
arg_integer
,
&
lock
,
"lock mode"
,
""
},
{
"sorted"
,
's'
,
arg_flag
,
&
sorted
,
"sorted"
,
""
}
{
"sorted"
,
's'
,
arg_flag
,
&
sorted
,
"sorted"
,
""
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
}
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
optind
=
0
;
...
...
@@ -66,7 +67,7 @@ int main(int argc, const char** argv){
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
Ndb
MyNdb
(
&
con
,
db
?
db
:
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoScanUpdate.cpp
View file @
7050d08f
...
...
@@ -33,7 +33,7 @@ int main(int argc, const char** argv){
int
_loops
=
1
;
int
_parallelism
=
1
;
int
_ver2
=
0
;
const
char
*
_tabname
=
NULL
;
const
char
*
_tabname
=
NULL
,
*
db
=
0
;
int
_help
=
0
;
struct
getargs
args
[]
=
{
...
...
@@ -42,7 +42,8 @@ int main(int argc, const char** argv){
{
"records"
,
'r'
,
arg_integer
,
&
_records
,
"Number of records"
,
"recs"
},
{
"ver2"
,
'2'
,
arg_flag
,
&
_ver2
,
"Use version 2 of scanUpdateRecords"
,
""
},
{
"ver2"
,
'1'
,
arg_negative_flag
,
&
_ver2
,
"Use version 1 of scanUpdateRecords (default)"
,
""
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
}
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
}
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
optind
=
0
;
...
...
@@ -63,7 +64,7 @@ int main(int argc, const char** argv){
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
Ndb
MyNdb
(
&
con
,
db
?
db
:
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
...
...
@@ -100,6 +101,7 @@ int main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
i
++
;
//NdbSleep_MilliSleep(300);
}
return
NDBT_ProgramExit
(
NDBT_OK
);
...
...
ndb/tools/Makefile.am
View file @
7050d08f
...
...
@@ -30,7 +30,8 @@ ndb_restore_SOURCES = restore/restore_main.cpp \
restore/consumer.cpp
\
restore/consumer_restore.cpp
\
restore/consumer_printer.cpp
\
restore/Restore.cpp
restore/Restore.cpp
\
../test/src/NDBT_ResultRow.cpp
$(tools_common_sources)
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/type_ndbapitools.mk.am
...
...
ndb/tools/restore/Restore.cpp
View file @
7050d08f
...
...
@@ -925,19 +925,12 @@ operator<<(NdbOut& ndbout, const LogEntry& logE)
return
ndbout
;
}
#include <NDBT.hpp>
NdbOut
&
operator
<<
(
NdbOut
&
ndbout
,
const
TableS
&
table
){
ndbout
<<
endl
<<
"Table: "
<<
table
.
getTableName
()
<<
endl
;
for
(
int
j
=
0
;
j
<
table
.
getNoOfAttributes
();
j
++
)
{
const
AttributeDesc
*
desc
=
table
[
j
];
ndbout
<<
desc
->
m_column
->
getName
()
<<
": "
<<
(
Uint32
)
desc
->
m_column
->
getType
();
ndbout
<<
" key: "
<<
(
Uint32
)
desc
->
m_column
->
getPrimaryKey
();
ndbout
<<
" array: "
<<
desc
->
arraySize
;
ndbout
<<
" size: "
<<
desc
->
size
<<
endl
;
}
// for
ndbout
<<
(
*
(
NDBT_Table
*
)
table
.
m_dictTable
)
<<
endl
;
return
ndbout
;
}
...
...
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