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
51b79a84
Commit
51b79a84
authored
Sep 01, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jonas/src/mysql-4.1-ndb
into mysql.com:/home/jonas/src/wl2025
parents
76629f52
58c30f2b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
221 additions
and
176 deletions
+221
-176
ndb/include/kernel/signaldata/DumpStateOrd.hpp
ndb/include/kernel/signaldata/DumpStateOrd.hpp
+3
-0
ndb/src/common/debugger/EventLogger.cpp
ndb/src/common/debugger/EventLogger.cpp
+5
-2
ndb/src/kernel/blocks/dbtc/Dbtc.hpp
ndb/src/kernel/blocks/dbtc/Dbtc.hpp
+34
-9
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+56
-45
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+1
-1
ndb/test/ndbapi/slow_select.cpp
ndb/test/ndbapi/slow_select.cpp
+122
-119
No files found.
ndb/include/kernel/signaldata/DumpStateOrd.hpp
View file @
51b79a84
...
...
@@ -95,6 +95,9 @@ public:
TcDumpAllApiConnectRec
=
2506
,
TcSetTransactionTimeout
=
2507
,
TcSetApplTransactionTimeout
=
2508
,
StartTcTimer
=
2509
,
StopTcTimer
=
2510
,
StartPeriodicTcTimer
=
2511
,
CmvmiDumpConnections
=
2600
,
CmvmiDumpLongSignalMemory
=
2601
,
CmvmiSetRestartOnErrorInsert
=
2602
,
...
...
ndb/src/common/debugger/EventLogger.cpp
View file @
51b79a84
...
...
@@ -624,7 +624,8 @@ EventLogger::getText(int type,
"%sTrans. Count = %u, Commit Count = %u, "
"Read Count = %u, Simple Read Count = %u,
\n
"
"Write Count = %u, AttrInfo Count = %u, "
"Concurrent Operations = %u, Abort Count = %u"
,
"Concurrent Operations = %u, Abort Count = %u
\n
"
" Scans: %u Range scans: %u"
,
theNodeId
,
theData
[
1
],
theData
[
2
],
...
...
@@ -633,7 +634,9 @@ EventLogger::getText(int type,
theData
[
5
],
theData
[
6
],
theData
[
7
],
theData
[
8
]);
theData
[
8
],
theData
[
9
],
theData
[
10
]);
break
;
case
EventReport
:
:
OperationReportCounters
:
::
snprintf
(
m_text
,
sizeof
(
m_text
),
...
...
ndb/src/kernel/blocks/dbtc/Dbtc.hpp
View file @
51b79a84
...
...
@@ -33,6 +33,7 @@
#include <signaldata/TrigAttrInfo.hpp>
#include <signaldata/TcIndx.hpp>
#include <signaldata/TransIdAI.hpp>
#include <signaldata/EventReport.hpp>
#include <trigger_definitions.h>
#include <SignalCounter.hpp>
...
...
@@ -1676,16 +1677,40 @@ private:
ApiConnectRecordPtr
tmpApiConnectptr
;
UintR
tcheckGcpId
;
UintR
cconcurrentOp
;
UintR
cattrinfoCount
;
UintR
ctransCount
;
UintR
ccommitCount
;
UintR
creadCount
;
UintR
csimpleReadCount
;
UintR
cwriteCount
;
UintR
cabortCount
;
struct
TransCounters
{
enum
{
Off
,
Timer
,
Started
}
c_trans_status
;
UintR
cattrinfoCount
;
UintR
ctransCount
;
UintR
ccommitCount
;
UintR
creadCount
;
UintR
csimpleReadCount
;
UintR
cwriteCount
;
UintR
cabortCount
;
UintR
cconcurrentOp
;
Uint32
c_scan_count
;
Uint32
c_range_scan_count
;
void
reset
()
{
cattrinfoCount
=
ctransCount
=
ccommitCount
=
creadCount
=
csimpleReadCount
=
cwriteCount
=
cabortCount
=
c_scan_count
=
c_range_scan_count
=
0
;
}
Uint32
report
(
Signal
*
signal
){
signal
->
theData
[
0
]
=
EventReport
::
TransReportCounters
;
signal
->
theData
[
1
]
=
ctransCount
;
signal
->
theData
[
2
]
=
ccommitCount
;
signal
->
theData
[
3
]
=
creadCount
;
signal
->
theData
[
4
]
=
csimpleReadCount
;
signal
->
theData
[
5
]
=
cwriteCount
;
signal
->
theData
[
6
]
=
cattrinfoCount
;
signal
->
theData
[
7
]
=
cconcurrentOp
;
signal
->
theData
[
8
]
=
cabortCount
;
signal
->
theData
[
9
]
=
c_scan_count
;
signal
->
theData
[
10
]
=
c_range_scan_count
;
return
11
;
}
}
c_counters
;
Uint16
cownNodeid
;
Uint16
terrorCode
;
...
...
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
View file @
51b79a84
...
...
@@ -221,28 +221,14 @@ void Dbtc::execCONTINUEB(Signal* signal)
/* -------------------------------------------------------------------- */
// Report information about transaction activity once per second.
/* -------------------------------------------------------------------- */
if
(
signal
->
theData
[
1
]
==
0
)
{
signal
->
theData
[
0
]
=
EventReport
::
TransReportCounters
;
signal
->
theData
[
1
]
=
ctransCount
;
signal
->
theData
[
2
]
=
ccommitCount
;
signal
->
theData
[
3
]
=
creadCount
;
signal
->
theData
[
4
]
=
csimpleReadCount
;
signal
->
theData
[
5
]
=
cwriteCount
;
signal
->
theData
[
6
]
=
cattrinfoCount
;
signal
->
theData
[
7
]
=
cconcurrentOp
;
signal
->
theData
[
8
]
=
cabortCount
;
sendSignal
(
CMVMI_REF
,
GSN_EVENT_REP
,
signal
,
9
,
JBB
);
}
//if
ctransCount
=
0
;
ccommitCount
=
0
;
creadCount
=
0
;
csimpleReadCount
=
0
;
cwriteCount
=
0
;
cattrinfoCount
=
0
;
cabortCount
=
0
;
signal
->
theData
[
0
]
=
TcContinueB
::
ZTRANS_EVENT_REP
;
signal
->
theData
[
1
]
=
0
;
sendSignalWithDelay
(
cownref
,
GSN_CONTINUEB
,
signal
,
5000
,
2
);
if
(
c_counters
.
c_trans_status
==
TransCounters
::
Timer
){
Uint32
len
=
c_counters
.
report
(
signal
);
sendSignal
(
CMVMI_REF
,
GSN_EVENT_REP
,
signal
,
len
,
JBB
);
c_counters
.
reset
();
signal
->
theData
[
0
]
=
TcContinueB
::
ZTRANS_EVENT_REP
;
sendSignalWithDelay
(
cownref
,
GSN_CONTINUEB
,
signal
,
5000
,
1
);
}
return
;
case
TcContinueB
:
:
ZCONTINUE_TIME_OUT_FRAG_CONTROL
:
jam
();
...
...
@@ -693,9 +679,10 @@ void Dbtc::execNDB_STTOR(Signal* signal)
jam
();
intstartphase3x010Lab
(
signal
);
/* SEIZE CONNECT RECORD IN EACH LQH*/
// Start transaction event reporting.
c_counters
.
c_trans_status
=
TransCounters
::
Timer
;
c_counters
.
reset
();
signal
->
theData
[
0
]
=
TcContinueB
::
ZTRANS_EVENT_REP
;
signal
->
theData
[
1
]
=
1
;
sendSignalWithDelay
(
cownref
,
GSN_CONTINUEB
,
signal
,
10
,
2
);
sendSignalWithDelay
(
cownref
,
GSN_CONTINUEB
,
signal
,
10
,
1
);
return
;
case
ZINTSPH6
:
jam
();
...
...
@@ -2245,7 +2232,7 @@ void Dbtc::initApiConnectRec(Signal* signal,
{
const
TcKeyReq
*
const
tcKeyReq
=
(
TcKeyReq
*
)
&
signal
->
theData
[
0
];
UintR
TfailureNr
=
cfailure_nr
;
UintR
TtransCount
=
ctransCount
;
UintR
TtransCount
=
c
_counters
.
c
transCount
;
UintR
Ttransid0
=
tcKeyReq
->
transId1
;
UintR
Ttransid1
=
tcKeyReq
->
transId2
;
...
...
@@ -2273,7 +2260,7 @@ void Dbtc::initApiConnectRec(Signal* signal,
if
(
releaseIndexOperations
)
releaseAllSeizedIndexOperations
(
regApiPtr
);
ctransCount
=
TtransCount
+
1
;
c
_counters
.
c
transCount
=
TtransCount
+
1
;
}
//Dbtc::initApiConnectRec()
int
...
...
@@ -2298,7 +2285,7 @@ Dbtc::seizeTcRecord(Signal* signal)
TcConnectRecord
*
const
regTcPtr
=
&
localTcConnectRecord
[
TfirstfreeTcConnect
];
UintR
TconcurrentOp
=
cconcurrentOp
;
UintR
TconcurrentOp
=
c
_counters
.
c
concurrentOp
;
UintR
TlastTcConnect
=
regApiPtr
->
lastTcConnect
;
UintR
TtcConnectptrIndex
=
tcConnectptr
.
i
;
TcConnectRecordPtr
tmpTcConnectptr
;
...
...
@@ -2306,7 +2293,7 @@ Dbtc::seizeTcRecord(Signal* signal)
cfirstfreeTcConnect
=
regTcPtr
->
nextTcConnect
;
tcConnectptr
.
p
=
regTcPtr
;
cconcurrentOp
=
TconcurrentOp
+
1
;
c
_counters
.
c
concurrentOp
=
TconcurrentOp
+
1
;
regTcPtr
->
prevTcConnect
=
TlastTcConnect
;
regTcPtr
->
nextTcConnect
=
RNIL
;
regTcPtr
->
accumulatingTriggerData
.
i
=
RNIL
;
...
...
@@ -2576,7 +2563,7 @@ void Dbtc::execTCKEYREQ(Signal* signal)
UintR
TapiConnectptrIndex
=
apiConnectptr
.
i
;
UintR
TsenderData
=
tcKeyReq
->
senderData
;
UintR
TattrLen
=
tcKeyReq
->
getAttrinfoLen
(
tcKeyReq
->
attrLen
);
UintR
TattrinfoCount
=
cattrinfoCount
;
UintR
TattrinfoCount
=
c
_counters
.
c
attrinfoCount
;
regTcPtr
->
apiConnect
=
TapiConnectptrIndex
;
regTcPtr
->
clientData
=
TsenderData
;
...
...
@@ -2597,7 +2584,7 @@ void Dbtc::execTCKEYREQ(Signal* signal)
}
regCachePtr
->
attrlength
=
TattrLen
;
cattrinfoCount
=
TattrinfoCount
+
TattrLen
;
c
_counters
.
c
attrinfoCount
=
TattrinfoCount
+
TattrLen
;
UintR
TtabptrIndex
=
localTabptr
.
i
;
UintR
TtableSchemaVersion
=
tcKeyReq
->
tableSchemaVersion
;
...
...
@@ -2689,17 +2676,17 @@ void Dbtc::execTCKEYREQ(Signal* signal)
regCachePtr
->
attrinfo15
[
3
]
=
Tdata5
;
if
(
TOperationType
==
ZREAD
)
{
Uint
8
TreadCount
=
creadCount
;
Uint
32
TreadCount
=
c_counters
.
creadCount
;
jam
();
regCachePtr
->
opLock
=
0
;
creadCount
=
TreadCount
+
1
;
c
_counters
.
c
readCount
=
TreadCount
+
1
;
}
else
if
(
TOperationType
==
ZREAD_EX
){
Uint
8
TreadCount
=
creadCount
;
Uint
32
TreadCount
=
c_counters
.
creadCount
;
jam
();
TOperationType
=
ZREAD
;
regTcPtr
->
operation
=
ZREAD
;
regCachePtr
->
opLock
=
ZUPDATE
;
creadCount
=
TreadCount
+
1
;
c
_counters
.
c
readCount
=
TreadCount
+
1
;
}
else
{
if
(
regApiPtr
->
commitAckMarker
==
RNIL
){
jam
();
...
...
@@ -2720,7 +2707,7 @@ void Dbtc::execTCKEYREQ(Signal* signal)
}
UintR
Tattrlength
=
regCachePtr
->
attrlength
;
UintR
TwriteCount
=
cwriteCount
;
UintR
TwriteCount
=
c
_counters
.
c
writeCount
;
UintR
Toperationsize
=
coperationsize
;
/* --------------------------------------------------------------------
* THIS IS A TEMPORARY TABLE, DON'T UPDATE coperationsize.
...
...
@@ -2730,7 +2717,7 @@ void Dbtc::execTCKEYREQ(Signal* signal)
if
(
localTabptr
.
p
->
storedTable
)
{
coperationsize
=
((
Toperationsize
+
Tattrlength
)
+
TkeyLength
)
+
17
;
}
cwriteCount
=
TwriteCount
+
1
;
c
_counters
.
c
writeCount
=
TwriteCount
+
1
;
switch
(
TOperationType
)
{
case
ZUPDATE
:
jam
();
...
...
@@ -3312,10 +3299,10 @@ void Dbtc::releaseSimpleRead(Signal* signal)
* Therefore decrese no LQHKEYCONF(REF) we are waiting for
*/
ApiConnectRecord
*
const
regApiPtr
=
apiConnectptr
.
p
;
UintR
TsimpleReadCount
=
csimpleReadCount
;
UintR
TsimpleReadCount
=
c
_counters
.
c
simpleReadCount
;
UintR
Tlqhkeyreqrec
=
regApiPtr
->
lqhkeyreqrec
;
csimpleReadCount
=
TsimpleReadCount
+
1
;
c
_counters
.
c
simpleReadCount
=
TsimpleReadCount
+
1
;
regApiPtr
->
lqhkeyreqrec
=
Tlqhkeyreqrec
-
1
;
/**
...
...
@@ -3373,7 +3360,7 @@ void Dbtc::releaseTcCon()
{
TcConnectRecord
*
const
regTcPtr
=
tcConnectptr
.
p
;
UintR
TfirstfreeTcConnect
=
cfirstfreeTcConnect
;
UintR
TconcurrentOp
=
cconcurrentOp
;
UintR
TconcurrentOp
=
c
_counters
.
c
concurrentOp
;
UintR
TtcConnectptrIndex
=
tcConnectptr
.
i
;
regTcPtr
->
tcConnectstate
=
OS_CONNECTED
;
...
...
@@ -3382,7 +3369,7 @@ void Dbtc::releaseTcCon()
regTcPtr
->
isIndexOp
=
false
;
regTcPtr
->
indexOp
=
RNIL
;
cfirstfreeTcConnect
=
TtcConnectptrIndex
;
cconcurrentOp
=
TconcurrentOp
-
1
;
c
_counters
.
c
concurrentOp
=
TconcurrentOp
-
1
;
}
//Dbtc::releaseTcCon()
void
Dbtc
::
execPACKED_SIGNAL
(
Signal
*
signal
)
...
...
@@ -4466,7 +4453,7 @@ void Dbtc::sendApiCommit(Signal* signal)
return
;
}
//if
UintR
TapiConnectFilesize
=
capiConnectFilesize
;
UintR
TcommitCount
=
ccommitCount
;
UintR
TcommitCount
=
c
_counters
.
c
commitCount
;
UintR
TapiIndex
=
apiConnectptr
.
i
;
UintR
TnewApiIndex
=
regApiPtr
->
apiCopyRecord
;
UintR
TapiFailState
=
regApiPtr
->
apiFailState
;
...
...
@@ -4474,7 +4461,7 @@ void Dbtc::sendApiCommit(Signal* signal)
tmpApiConnectptr
.
p
=
apiConnectptr
.
p
;
tmpApiConnectptr
.
i
=
TapiIndex
;
ccommitCount
=
TcommitCount
+
1
;
c
_counters
.
c
commitCount
=
TcommitCount
+
1
;
apiConnectptr
.
i
=
TnewApiIndex
;
ptrCheckGuard
(
apiConnectptr
,
TapiConnectFilesize
,
localApiConnectRecord
);
copyApi
(
signal
);
...
...
@@ -8597,6 +8584,10 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr,
ptr
.
p
->
scanFragConcurrency
=
noOprecPerFrag
;
ptr
.
p
->
m_apiPtr
=
cdata
[
i
];
}
//for
(
*
(
scanptr
.
p
->
rangeScan
?
&
c_counters
.
c_range_scan_count
:
&
c_counters
.
c_scan_count
))
++
;
}
//Dbtc::initScanrec()
void
Dbtc
::
scanTabRefLab
(
Signal
*
signal
,
Uint32
errCode
)
...
...
@@ -9213,6 +9204,7 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal)
* We will send a SCAN_TABREF to indicate a time-out occurred.
*********************************************************************/
DEBUG
(
"scanTabRefLab: ZSCANTIME_OUT_ERROR2"
);
ndbout_c
(
"apiConnectptr(%d) -> abort"
,
apiConnectptr
.
i
);
ndbrequire
(
false
);
//B2 indication of strange things going on
scanTabRefLab
(
signal
,
ZSCANTIME_OUT_ERROR2
);
return
;
...
...
@@ -9882,7 +9874,7 @@ void Dbtc::initialiseTcConnect(Signal* signal)
ptrAss
(
tcConnectptr
,
tcConnectRecord
);
tcConnectptr
.
p
->
nextTcConnect
=
RNIL
;
cfirstfreeTcConnect
=
titcTmp
;
cconcurrentOp
=
0
;
c
_counters
.
c
concurrentOp
=
0
;
}
//Dbtc::initialiseTcConnect()
/* ------------------------------------------------------------------------- */
...
...
@@ -9953,7 +9945,7 @@ void Dbtc::releaseAbortResources(Signal* signal)
{
TcConnectRecordPtr
rarTcConnectptr
;
cabortCount
++
;
c
_counters
.
c
abortCount
++
;
if
(
apiConnectptr
.
p
->
cachePtr
!=
RNIL
)
{
cachePtr
.
i
=
apiConnectptr
.
p
->
cachePtr
;
ptrCheckGuard
(
cachePtr
,
ccacheFilesize
,
cacheRecord
);
...
...
@@ -10127,7 +10119,7 @@ void Dbtc::seizeTcConnect(Signal* signal)
tcConnectptr
.
i
=
cfirstfreeTcConnect
;
ptrCheckGuard
(
tcConnectptr
,
ctcConnectFilesize
,
tcConnectRecord
);
cfirstfreeTcConnect
=
tcConnectptr
.
p
->
nextTcConnect
;
cconcurrentOp
++
;
c
_counters
.
c
concurrentOp
++
;
tcConnectptr
.
p
->
isIndexOp
=
false
;
}
//Dbtc::seizeTcConnect()
...
...
@@ -10539,6 +10531,25 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal)
set_appl_timeout_value
(
signal
->
theData
[
1
]);
}
}
if
(
dumpState
->
args
[
0
]
==
DumpStateOrd
::
StartTcTimer
){
c_counters
.
c_trans_status
=
TransCounters
::
Started
;
c_counters
.
reset
();
}
if
(
dumpState
->
args
[
0
]
==
DumpStateOrd
::
StopTcTimer
){
c_counters
.
c_trans_status
=
TransCounters
::
Off
;
Uint32
len
=
c_counters
.
report
(
signal
);
sendSignal
(
CMVMI_REF
,
GSN_EVENT_REP
,
signal
,
len
,
JBB
);
c_counters
.
reset
();
}
if
(
dumpState
->
args
[
0
]
==
DumpStateOrd
::
StartPeriodicTcTimer
){
c_counters
.
c_trans_status
=
TransCounters
::
Timer
;
c_counters
.
reset
();
signal
->
theData
[
0
]
=
TcContinueB
::
ZTRANS_EVENT_REP
;
sendSignalWithDelay
(
cownref
,
GSN_CONTINUEB
,
signal
,
5000
,
1
);
}
}
//Dbtc::execDUMP_STATE_ORD()
void
Dbtc
::
execSET_VAR_REQ
(
Signal
*
signal
)
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
51b79a84
...
...
@@ -957,7 +957,7 @@ MgmtSrvr::restart(bool nostart, bool initalStart, bool abort,
while
(
getNextNodeId
(
&
nodeId
,
NDB_MGM_NODE_TYPE_NDB
)
&&
nodes
.
get
(
nodeId
))
{
enum
ndb_mgm_node_status
s
;
s
=
NDB_MGM_NODE_STATUS_NO_CONTACT
;
while
(
s
==
NDB_MGM_NODE_STATUS_NO_CONTACT
&&
waitTime
>
0
)
{
while
(
s
!=
NDB_MGM_NODE_STATUS_NOT_STARTED
&&
waitTime
>
0
)
{
Uint32
startPhase
=
0
,
version
=
0
,
dynamicId
=
0
,
nodeGroup
=
0
;
Uint32
connectCount
=
0
;
bool
system
;
...
...
ndb/test/ndbapi/slow_select.cpp
View file @
51b79a84
...
...
@@ -41,152 +41,155 @@ main(void){
require
(
g_ndb
.
waitUntilReady
()
==
0
);
g_trans
=
g_ndb
.
startTransaction
();
require
(
g_trans
);
while
(
true
){
g_trans
=
g_ndb
.
startTransaction
();
require
(
g_trans
);
size_t
i
,
j
;
const
size_t
cnt
=
sizeof
(
g_scans
)
/
sizeof
(
g_scans
[
0
]);
start
=
NdbTick_CurrentMillisecond
();
for
(
i
=
0
;
i
<
cnt
;
i
++
){
ndbout_c
(
"starting scan on: %s %s"
,
g_scans
[
i
].
m_table
,
g_scans
[
i
].
m_index
);
g_scans
[
i
].
m_scan
=
g_trans
->
getNdbIndexScanOperation
(
g_scans
[
i
].
m_index
,
g_scans
[
i
].
m_table
);
NdbIndexScanOperation
*
scan
=
g_scans
[
i
].
m_scan
;
require
(
scan
);
g_scans
[
i
].
m_result
=
scan
->
readTuples
(
NdbScanOperation
::
LM_CommittedRead
,
0
,
0
,
true
);
require
(
g_scans
[
i
].
m_result
);
}
size_t
i
,
j
;
const
size_t
cnt
=
sizeof
(
g_scans
)
/
sizeof
(
g_scans
[
0
]);
start
=
NdbTick_CurrentMillisecond
();
for
(
i
=
0
;
i
<
cnt
;
i
++
){
ndbout_c
(
"starting scan on: %s %s"
,
g_scans
[
i
].
m_table
,
g_scans
[
i
].
m_index
);
g_scans
[
i
].
m_scan
=
g_trans
->
getNdbIndexScanOperation
(
g_scans
[
i
].
m_index
,
g_scans
[
i
].
m_table
);
NdbIndexScanOperation
*
scan
=
g_scans
[
i
].
m_scan
;
require
(
scan
);
g_scans
[
i
].
m_result
=
scan
->
readTuples
(
NdbScanOperation
::
LM_CommittedRead
,
0
,
0
,
true
);
require
(
g_scans
[
i
].
m_result
);
}
require
(
!
g_scans
[
0
].
m_scan
->
setBound
((
Uint32
)
0
,
NdbIndexScanOperation
::
BoundEQ
,
&
g_affiliateid
,
sizeof
(
g_affiliateid
)));
require
(
!
g_scans
[
0
].
m_scan
->
setBound
((
Uint32
)
0
,
NdbIndexScanOperation
::
BoundEQ
,
&
g_affiliateid
,
sizeof
(
g_affiliateid
)));
#if 0
require(!g_scans[1].m_scan->setBound((Uint32)0,
NdbIndexScanOperation::BoundLE,
&g_formatids[0],
sizeof(g_formatids[0])));
require(!g_scans[1].m_scan->setBound((Uint32)0,
NdbIndexScanOperation::BoundLE,
&g_formatids[0],
sizeof(g_formatids[0])));
#endif
NdbScanFilter
sf
(
g_scans
[
1
].
m_scan
);
sf
.
begin
(
NdbScanFilter
::
OR
);
sf
.
eq
(
2
,
g_formatids
[
0
]);
sf
.
eq
(
2
,
g_formatids
[
1
]);
sf
.
eq
(
2
,
g_formatids
[
2
]);
sf
.
end
();
// affiliatestometa
require
(
g_scans
[
0
].
m_scan
->
getValue
(
"uniquekey"
));
require
(
g_scans
[
0
].
m_scan
->
getValue
(
"xml"
));
// media
require
(
g_scans
[
1
].
m_scan
->
getValue
(
"path"
));
require
(
g_scans
[
1
].
m_scan
->
getValue
(
"mediaid"
));
require
(
g_scans
[
1
].
m_scan
->
getValue
(
"formatid"
));
NdbScanFilter
sf
(
g_scans
[
1
].
m_scan
);
sf
.
begin
(
NdbScanFilter
::
OR
);
sf
.
eq
(
2
,
g_formatids
[
0
]);
sf
.
eq
(
2
,
g_formatids
[
1
]);
sf
.
eq
(
2
,
g_formatids
[
2
]);
sf
.
end
();
// affiliatestometa
require
(
g_scans
[
0
].
m_scan
->
getValue
(
"uniquekey"
));
require
(
g_scans
[
0
].
m_scan
->
getValue
(
"xml"
));
// media
require
(
g_scans
[
1
].
m_scan
->
getValue
(
"path"
));
require
(
g_scans
[
1
].
m_scan
->
getValue
(
"mediaid"
));
require
(
g_scans
[
1
].
m_scan
->
getValue
(
"formatid"
));
// meta
require
(
g_scans
[
2
].
m_scan
->
getValue
(
"name"
));
require
(
g_scans
[
2
].
m_scan
->
getValue
(
"xml"
));
// meta
require
(
g_scans
[
2
].
m_scan
->
getValue
(
"name"
));
require
(
g_scans
[
2
].
m_scan
->
getValue
(
"xml"
));
// artiststometamap
require
(
g_scans
[
3
].
m_scan
->
getValue
(
"artistid"
,
(
char
*
)
&
g_artistid
));
// artiststometamap
require
(
g_scans
[
3
].
m_scan
->
getValue
(
"artistid"
,
(
char
*
)
&
g_artistid
));
// subgenrestometamap
require
(
g_scans
[
4
].
m_scan
->
getValue
(
"subgenreid"
,
(
char
*
)
&
g_subgenreid
));
// subgenrestometamap
require
(
g_scans
[
4
].
m_scan
->
getValue
(
"subgenreid"
,
(
char
*
)
&
g_subgenreid
));
for
(
i
=
0
;
i
<
cnt
;
i
++
){
g_scans
[
i
].
m_scan
->
getValue
(
"metaid"
,
(
char
*
)
&
g_scans
[
i
].
metaid
);
}
for
(
i
=
0
;
i
<
cnt
;
i
++
){
g_scans
[
i
].
m_scan
->
getValue
(
"metaid"
,
(
char
*
)
&
g_scans
[
i
].
metaid
);
}
g_trans
->
execute
(
NoCommit
,
AbortOnError
,
1
);
g_trans
->
execute
(
NoCommit
,
AbortOnError
,
1
);
Uint32
max_val
=
0
;
Uint32
match_val
=
0
;
Uint32
max_val
=
0
;
Uint32
match_val
=
0
;
S_Scan
*
F
[
5
],
*
Q
[
5
],
*
nextF
[
5
];
Uint32
F_sz
=
0
,
Q_sz
=
0
;
for
(
i
=
0
;
i
<
cnt
;
i
++
){
F_sz
++
;
F
[
i
]
=
&
g_scans
[
i
];
}
S_Scan
*
F
[
5
],
*
Q
[
5
],
*
nextF
[
5
];
Uint32
F_sz
=
0
,
Q_sz
=
0
;
for
(
i
=
0
;
i
<
cnt
;
i
++
){
F_sz
++
;
F
[
i
]
=
&
g_scans
[
i
];
}
Uint32
match_count
=
0
;
while
(
F_sz
>
0
){
Uint32
prev_F_sz
=
F_sz
;
F_sz
=
0
;
bool
found
=
false
;
//for(i = 0; i<cnt; i++)
//ndbout_c("%s - %d", g_scans[i].m_table, g_scans[i].metaid);
Uint32
match_count
=
0
;
while
(
F_sz
>
0
){
Uint32
prev_F_sz
=
F_sz
;
F_sz
=
0
;
bool
found
=
false
;
//for(i = 0; i<cnt; i++)
//ndbout_c("%s - %d", g_scans[i].m_table, g_scans[i].metaid);
for
(
i
=
0
;
i
<
prev_F_sz
;
i
++
){
int
res
=
F
[
i
]
->
m_result
->
nextResult
();
if
(
res
==
-
1
)
abort
();
for
(
i
=
0
;
i
<
prev_F_sz
;
i
++
){
int
res
=
F
[
i
]
->
m_result
->
nextResult
();
if
(
res
==
-
1
)
abort
();
if
(
res
==
1
){
continue
;
}
if
(
res
==
1
){
continue
;
}
Uint32
metaid
=
F
[
i
]
->
metaid
;
F
[
i
]
->
row_count
++
;
Uint32
metaid
=
F
[
i
]
->
metaid
;
F
[
i
]
->
row_count
++
;
if
(
metaid
==
match_val
){
//ndbout_c("flera");
nextF
[
F_sz
++
]
=
F
[
i
];
require
(
F_sz
>=
0
&&
F_sz
<=
cnt
);
F
[
i
]
->
match_count
++
;
Uint32
comb
=
1
;
for
(
j
=
0
;
j
<
cnt
;
j
++
){
comb
*=
(
&
g_scans
[
j
]
==
F
[
i
]
?
1
:
g_scans
[
j
].
match_count
);
if
(
metaid
==
match_val
){
//ndbout_c("flera");
nextF
[
F_sz
++
]
=
F
[
i
];
require
(
F_sz
>=
0
&&
F_sz
<=
cnt
);
F
[
i
]
->
match_count
++
;
Uint32
comb
=
1
;
for
(
j
=
0
;
j
<
cnt
;
j
++
){
comb
*=
(
&
g_scans
[
j
]
==
F
[
i
]
?
1
:
g_scans
[
j
].
match_count
);
}
match_count
+=
comb
;
found
=
true
;
continue
;
}
match_count
+=
comb
;
found
=
true
;
continue
;
}
if
(
metaid
<
max_val
){
nextF
[
F_sz
++
]
=
F
[
i
];
require
(
F_sz
>=
0
&&
F_sz
<=
cnt
);
continue
;
if
(
metaid
<
max_val
){
nextF
[
F_sz
++
]
=
F
[
i
];
require
(
F_sz
>=
0
&&
F_sz
<=
cnt
);
continue
;
}
if
(
metaid
>
max_val
){
for
(
j
=
0
;
j
<
Q_sz
;
j
++
)
nextF
[
F_sz
++
]
=
Q
[
j
];
require
(
F_sz
>=
0
&&
F_sz
<=
cnt
);
Q_sz
=
0
;
max_val
=
metaid
;
}
Q
[
Q_sz
++
]
=
F
[
i
];
require
(
Q_sz
>=
0
&&
Q_sz
<=
cnt
);
}
if
(
metaid
>
max_val
){
for
(
j
=
0
;
j
<
Q_sz
;
j
++
)
if
(
F_sz
==
0
&&
Q_sz
>
0
){
match_val
=
max_val
;
for
(
j
=
0
;
j
<
Q_sz
;
j
++
){
nextF
[
F_sz
++
]
=
Q
[
j
];
Q
[
j
]
->
match_count
=
1
;
}
require
(
F_sz
>=
0
&&
F_sz
<=
cnt
);
require
(
Q_sz
>=
0
&&
Q_sz
<=
cnt
);
Q_sz
=
0
;
max_val
=
metaid
;
}
Q
[
Q_sz
++
]
=
F
[
i
];
require
(
Q_sz
>=
0
&&
Q_sz
<=
cnt
);
}
if
(
F_sz
==
0
&&
Q_sz
>
0
){
match_val
=
max_val
;
for
(
j
=
0
;
j
<
Q_sz
;
j
++
){
nextF
[
F_sz
++
]
=
Q
[
j
];
Q
[
j
]
->
match_count
=
1
;
match_count
++
;
lookup
();
}
else
if
(
!
found
&&
F_sz
+
Q_sz
<
cnt
){
F_sz
=
0
;
}
require
(
F_sz
>=
0
&&
F_sz
<=
cnt
);
require
(
Q_sz
>=
0
&&
Q_sz
<=
cnt
);
Q_sz
=
0
;
match_count
++
;
lookup
();
}
else
if
(
!
found
&&
F_sz
+
Q_sz
<
cnt
){
F_sz
=
0
;
for
(
i
=
0
;
i
<
F_sz
;
i
++
)
F
[
i
]
=
nextF
[
i
];
}
require
(
F_sz
>=
0
&&
F_sz
<=
cnt
);
for
(
i
=
0
;
i
<
F_sz
;
i
++
)
F
[
i
]
=
nextF
[
i
];
}
start
=
NdbTick_CurrentMillisecond
()
-
start
;
ndbout_c
(
"Elapsed: %lldms"
,
start
);
start
=
NdbTick_CurrentMillisecond
()
-
start
;
ndbout_c
(
"Elapsed: %lldms"
,
start
);
ndbout_c
(
"rows: %d"
,
match_count
);
for
(
i
=
0
;
i
<
cnt
;
i
++
){
ndbout_c
(
"%s : %d"
,
g_scans
[
i
].
m_table
,
g_scans
[
i
].
row_count
);
ndbout_c
(
"rows: %d"
,
match_count
);
for
(
i
=
0
;
i
<
cnt
;
i
++
){
ndbout_c
(
"%s : %d"
,
g_scans
[
i
].
m_table
,
g_scans
[
i
].
row_count
);
}
g_trans
->
close
();
}
}
...
...
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