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
36138be0
Commit
36138be0
authored
Aug 31, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interpreter fix + tets prg
parent
880b78dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
1 deletion
+121
-1
ndb/src/ndbapi/NdbOperationInt.cpp
ndb/src/ndbapi/NdbOperationInt.cpp
+3
-0
ndb/test/ndbapi/Makefile.am
ndb/test/ndbapi/Makefile.am
+2
-1
ndb/test/ndbapi/slow_select.cpp
ndb/test/ndbapi/slow_select.cpp
+116
-0
No files found.
ndb/src/ndbapi/NdbOperationInt.cpp
View file @
36138be0
...
...
@@ -732,6 +732,9 @@ int
NdbOperation
::
read_attr
(
const
NdbColumnImpl
*
anAttrObject
,
Uint32
RegDest
)
{
INT_DEBUG
((
"read_attr %d %u"
,
anAttrObject
->
m_attrId
,
RegDest
));
if
(
initial_interpreterCheck
()
==
-
1
)
return
-
1
;
int
tAttrId
=
read_attrCheck
(
anAttrObject
);
if
(
tAttrId
==
-
1
)
goto
read_attr_error1
;
...
...
ndb/test/ndbapi/Makefile.am
View file @
36138be0
...
...
@@ -30,7 +30,7 @@ testSystemRestart \
testTimeout
\
testTransactions
\
testDeadlock
\
test_event
test_event
ndbapi_slow_select
#flexTimedAsynch
#testBlobs
...
...
@@ -66,6 +66,7 @@ testTimeout_SOURCES = testTimeout.cpp
testTransactions_SOURCES
=
testTransactions.cpp
testDeadlock_SOURCES
=
testDeadlock.cpp
test_event_SOURCES
=
test_event.cpp
ndbapi_slow_select_SOURCES
=
slow_select.cpp
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/include/kernel
...
...
ndb/test/ndbapi/slow_select.cpp
0 → 100644
View file @
36138be0
#include <NdbApi.hpp>
#include <NdbOut.hpp>
#include <NdbTick.h>
struct
S_Scan
{
const
char
*
m_table
;
const
char
*
m_index
;
NdbIndexScanOperation
*
m_scan
;
NdbResultSet
*
m_result
;
};
static
S_Scan
g_scans
[]
=
{
{
"affiliatestometa"
,
"ind_affiliatestometa"
,
0
,
0
},
{
"media"
,
"ind_media"
,
0
,
0
},
{
"meta"
,
"PRIMARY"
,
0
,
0
},
{
"artiststometamap"
,
"PRIMARY"
,
0
,
0
},
{
"subgenrestometamap"
,
"metaid"
,
0
,
0
}
};
#define require(x) if(!x) abort()
Uint32
g_affiliateid
=
2
;
Uint32
g_formatids
[]
=
{
8
,
31
,
76
};
Uint32
g_formattypeid
=
2
;
Uint64
start
;
int
main
(
void
){
Ndb
g_ndb
(
"test"
);
g_ndb
.
init
(
1024
);
require
(
g_ndb
.
waitUntilReady
()
==
0
);
NdbConnection
*
g_trans
=
g_ndb
.
startTransaction
();
require
(
g_trans
);
size_t
i
;
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
[
1
].
m_scan
->
setBound
((
Uint32
)
0
,
NdbIndexScanOperation
::
BoundLE
,
&
g_formatids
[
0
],
sizeof
(
g_formatids
[
0
])));
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
();
Uint32
metaid
[
5
];
for
(
i
=
0
;
i
<
cnt
;
i
++
){
g_scans
[
i
].
m_scan
->
getValue
(
"metaid"
,
(
char
*
)
&
metaid
[
0
]);
}
g_trans
->
execute
(
NoCommit
,
AbortOnError
,
1
);
Uint32
rows
[]
=
{
0
,
0
,
0
,
0
,
0
};
Uint32
done
[]
=
{
2
,
2
,
2
,
2
,
2
};
Uint32
run
=
0
;
do
{
run
=
0
;
for
(
i
=
0
;
i
<
cnt
;
i
++
){
int
res
;
switch
(
done
[
i
]){
case
0
:
rows
[
i
]
++
;
res
=
g_scans
[
i
].
m_result
->
nextResult
(
false
);
break
;
case
1
:
run
++
;
res
=
1
;
break
;
case
2
:
res
=
g_scans
[
i
].
m_result
->
nextResult
(
true
);
break
;
default:
ndbout_c
(
"done[%d] = %d"
,
i
,
done
[
i
]);
ndbout
<<
g_scans
[
i
].
m_scan
->
getNdbError
()
<<
endl
;
abort
();
}
done
[
i
]
=
res
;
}
}
while
(
run
<
cnt
);
start
=
NdbTick_CurrentMillisecond
()
-
start
;
ndbout_c
(
"Elapsed: %lldms"
,
start
);
for
(
i
=
0
;
i
<
cnt
;
i
++
){
ndbout_c
(
"rows[%d]: %d"
,
i
,
rows
[
i
]);
}
}
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