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
6ba2b184
Commit
6ba2b184
authored
Jun 21, 2006
by
pekka@clam.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#18102: fixes on NDB API level
parent
bb94cb24
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
776 additions
and
353 deletions
+776
-353
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+21
-23
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
+1
-3
storage/ndb/test/ndbapi/test_event_merge.cpp
storage/ndb/test/ndbapi/test_event_merge.cpp
+754
-327
No files found.
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
View file @
6ba2b184
...
@@ -1159,7 +1159,10 @@ NdbEventBuffer::nextEvent()
...
@@ -1159,7 +1159,10 @@ NdbEventBuffer::nextEvent()
NdbEventOperationImpl
*
op
=
data
->
m_event_op
;
NdbEventOperationImpl
*
op
=
data
->
m_event_op
;
DBUG_PRINT_EVENT
(
"info"
,
(
"available data=%p op=%p"
,
data
,
op
));
DBUG_PRINT_EVENT
(
"info"
,
(
"available data=%p op=%p"
,
data
,
op
));
// blob table ops must not be seen at this level
/*
* If merge is on, blob part sub-events must not be seen on this level.
* If merge is not on, there are no blob part sub-events.
*/
assert
(
op
->
theMainOp
==
NULL
);
assert
(
op
->
theMainOp
==
NULL
);
// set NdbEventOperation data
// set NdbEventOperation data
...
@@ -1175,13 +1178,6 @@ NdbEventBuffer::nextEvent()
...
@@ -1175,13 +1178,6 @@ NdbEventBuffer::nextEvent()
op
->
m_data_done_count
++
;
op
->
m_data_done_count
++
;
#endif
#endif
// NUL event is not returned
if
(
data
->
sdata
->
operation
==
NdbDictionary
::
Event
::
_TE_NUL
)
{
DBUG_PRINT_EVENT
(
"info"
,
(
"skip _TE_NUL"
));
continue
;
}
int
r
=
op
->
receive_event
();
int
r
=
op
->
receive_event
();
if
(
r
>
0
)
if
(
r
>
0
)
{
{
...
@@ -1203,6 +1199,12 @@ NdbEventBuffer::nextEvent()
...
@@ -1203,6 +1199,12 @@ NdbEventBuffer::nextEvent()
gci_ops
=
m_available_data
.
next_gci_ops
();
gci_ops
=
m_available_data
.
next_gci_ops
();
}
}
assert
(
gci_ops
&&
(
op
->
getGCI
()
==
gci_ops
->
m_gci
));
assert
(
gci_ops
&&
(
op
->
getGCI
()
==
gci_ops
->
m_gci
));
// to return TE_NUL it should be made into data event
if
(
data
->
sdata
->
operation
==
NdbDictionary
::
Event
::
_TE_NUL
)
{
DBUG_PRINT_EVENT
(
"info"
,
(
"skip _TE_NUL"
));
continue
;
}
DBUG_RETURN_EVENT
(
op
->
m_facade
);
DBUG_RETURN_EVENT
(
op
->
m_facade
);
}
}
// the next event belonged to an event op that is no
// the next event belonged to an event op that is no
...
@@ -1800,20 +1802,20 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
...
@@ -1800,20 +1802,20 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
else
else
{
{
// event with same op, PK found, merge into old buffer
// event with same op, PK found, merge into old buffer
Uint32
old_op
=
data
->
sdata
->
operation
;
if
(
unlikely
(
merge_data
(
sdata
,
ptr
,
data
)))
if
(
unlikely
(
merge_data
(
sdata
,
ptr
,
data
)))
{
{
op
->
m_has_error
=
3
;
op
->
m_has_error
=
3
;
DBUG_RETURN_EVENT
(
-
1
);
DBUG_RETURN_EVENT
(
-
1
);
}
}
Uint32
new_op
=
data
->
sdata
->
operation
;
// merge is on so we do not report blob part events
if
(
!
is_blob_event
)
{
// make Gci_ops reflect the merge by delete old and add new
// report actual operation, not composite
EventBufData_list
::
Gci_op
g
=
{
op
,
(
1
<<
old_op
)
};
// there is no way to "fix" the flags for a composite op
// bucket->m_data.del_gci_op(g); // XXX whats wrong? fix later
// since the flags represent multiple ops on multiple PKs
g
.
event_types
=
(
1
<<
new_op
)
;
EventBufData_list
::
Gci_op
g
=
{
op
,
(
1
<<
sdata
->
operation
)
}
;
bucket
->
m_data
.
add_gci_op
(
g
);
bucket
->
m_data
.
add_gci_op
(
g
);
}
}
}
DBUG_RETURN_EVENT
(
0
);
DBUG_RETURN_EVENT
(
0
);
}
}
...
@@ -2381,21 +2383,18 @@ void EventBufData_list::append_list(EventBufData_list *list, Uint64 gci)
...
@@ -2381,21 +2383,18 @@ void EventBufData_list::append_list(EventBufData_list *list, Uint64 gci)
}
}
void
void
EventBufData_list
::
add_gci_op
(
Gci_op
g
,
bool
del
)
EventBufData_list
::
add_gci_op
(
Gci_op
g
)
{
{
DBUG_ENTER_EVENT
(
"EventBufData_list::add_gci_op"
);
DBUG_ENTER_EVENT
(
"EventBufData_list::add_gci_op"
);
DBUG_PRINT_EVENT
(
"info"
,
(
"p.op: %p g.event_types: %x"
,
g
.
op
,
g
.
event_types
));
DBUG_PRINT_EVENT
(
"info"
,
(
"p.op: %p g.event_types: %x"
,
g
.
op
,
g
.
event_types
));
assert
(
g
.
op
!=
NULL
);
assert
(
g
.
op
!=
NULL
&&
g
.
op
->
theMainOp
==
NULL
);
// as in nextEvent
Uint32
i
;
Uint32
i
;
for
(
i
=
0
;
i
<
m_gci_op_count
;
i
++
)
{
for
(
i
=
0
;
i
<
m_gci_op_count
;
i
++
)
{
if
(
m_gci_op_list
[
i
].
op
==
g
.
op
)
if
(
m_gci_op_list
[
i
].
op
==
g
.
op
)
break
;
break
;
}
}
if
(
i
<
m_gci_op_count
)
{
if
(
i
<
m_gci_op_count
)
{
if
(
!
del
)
m_gci_op_list
[
i
].
event_types
|=
g
.
event_types
;
m_gci_op_list
[
i
].
event_types
|=
g
.
event_types
;
else
m_gci_op_list
[
i
].
event_types
&=
~
g
.
event_types
;
}
else
{
}
else
{
if
(
m_gci_op_count
==
m_gci_op_alloc
)
{
if
(
m_gci_op_count
==
m_gci_op_alloc
)
{
Uint32
n
=
1
+
2
*
m_gci_op_alloc
;
Uint32
n
=
1
+
2
*
m_gci_op_alloc
;
...
@@ -2413,7 +2412,6 @@ EventBufData_list::add_gci_op(Gci_op g, bool del)
...
@@ -2413,7 +2412,6 @@ EventBufData_list::add_gci_op(Gci_op g, bool del)
m_gci_op_alloc
=
n
;
m_gci_op_alloc
=
n
;
}
}
assert
(
m_gci_op_count
<
m_gci_op_alloc
);
assert
(
m_gci_op_count
<
m_gci_op_alloc
);
assert
(
!
del
);
#ifndef DBUG_OFF
#ifndef DBUG_OFF
i
=
m_gci_op_count
;
i
=
m_gci_op_count
;
#endif
#endif
...
...
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
View file @
6ba2b184
...
@@ -145,9 +145,7 @@ public:
...
@@ -145,9 +145,7 @@ public:
Gci_ops
*
first_gci_ops
();
Gci_ops
*
first_gci_ops
();
Gci_ops
*
next_gci_ops
();
Gci_ops
*
next_gci_ops
();
// case 1 above; add Gci_op to single list
// case 1 above; add Gci_op to single list
void
add_gci_op
(
Gci_op
g
,
bool
del
=
false
);
void
add_gci_op
(
Gci_op
g
);
// delete bit from existing flags
void
del_gci_op
(
Gci_op
g
)
{
add_gci_op
(
g
,
true
);
}
private:
private:
// case 2 above; move single list or multi list from
// case 2 above; move single list or multi list from
// one list to another
// one list to another
...
...
storage/ndb/test/ndbapi/test_event_merge.cpp
View file @
6ba2b184
This diff is collapsed.
Click to expand it.
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