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
7f3e6084
Commit
7f3e6084
authored
Jan 07, 2005
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added using table object reference in event creation
parent
95a2dbdd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
4 deletions
+51
-4
ndb/examples/ndbapi_event_example/ndbapi_event.cpp
ndb/examples/ndbapi_event_example/ndbapi_event.cpp
+5
-2
ndb/include/ndbapi/NdbDictionary.hpp
ndb/include/ndbapi/NdbDictionary.hpp
+25
-2
ndb/src/ndbapi/NdbDictionary.cpp
ndb/src/ndbapi/NdbDictionary.cpp
+13
-0
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+7
-0
ndb/src/ndbapi/NdbDictionaryImpl.hpp
ndb/src/ndbapi/NdbDictionaryImpl.hpp
+1
-0
No files found.
ndb/examples/ndbapi_event_example/ndbapi_event.cpp
View file @
7f3e6084
...
...
@@ -140,6 +140,7 @@ int main()
eventTableName
,
eventColumnName
,
noEventColumnName
);
int
j
=
0
;
while
(
j
<
5
)
{
...
...
@@ -238,8 +239,10 @@ int myCreateEvent(Ndb* myNdb,
NdbDictionary
::
Dictionary
*
myDict
=
myNdb
->
getDictionary
();
if
(
!
myDict
)
APIERROR
(
myNdb
->
getNdbError
());
NdbDictionary
::
Event
myEvent
(
eventName
);
myEvent
.
setTable
(
eventTableName
);
const
NdbDictionary
::
Table
*
table
=
myDict
->
getTable
(
eventTableName
);
if
(
!
table
)
APIERROR
(
myDict
->
getNdbError
());
NdbDictionary
::
Event
myEvent
(
eventName
,
*
table
);
myEvent
.
addTableEvent
(
NdbDictionary
::
Event
::
TE_ALL
);
// myEvent.addTableEvent(NdbDictionary::Event::TE_INSERT);
// myEvent.addTableEvent(NdbDictionary::Event::TE_UPDATE);
...
...
ndb/include/ndbapi/NdbDictionary.hpp
View file @
7f3e6084
...
...
@@ -928,16 +928,39 @@ public:
=
3
#endif
};
/*
* Constructor
* @param name Name of event
*/
Event
(
const
char
*
name
);
/*
* Constructor
* @param name Name of event
* @param table Reference retrieved from NdbDictionary
*/
Event
(
const
char
*
name
,
const
NdbDictionary
::
Table
&
table
);
virtual
~
Event
();
/**
* Set/get unique identifier for the event
*/
void
setName
(
const
char
*
name
);
const
char
*
getName
()
const
;
/**
* Define table on which events should be detected
*
* @note calling this method will default to detection
* of events on all columns. Calling subsequent
* addEventColumn calls will override this.
*
* @param table reference retrieved from NdbDictionary
*/
void
setTable
(
const
NdbDictionary
::
Table
&
table
);
/**
* Set table for which events should be detected
*
* @note preferred way is using setTable(const NdbDictionary::Table)
* or constructor with table object parameter
*/
void
setTable
(
const
char
*
tableName
);
/**
...
...
@@ -971,7 +994,7 @@ public:
*
* @param columnName Column name
*
* @note errors will
m
ot be detected until createEvent() is called
* @note errors will
n
ot be detected until createEvent() is called
*/
void
addEventColumn
(
const
char
*
columnName
);
/**
...
...
ndb/src/ndbapi/NdbDictionary.cpp
View file @
7f3e6084
...
...
@@ -585,6 +585,13 @@ NdbDictionary::Event::Event(const char * name)
setName
(
name
);
}
NdbDictionary
::
Event
::
Event
(
const
char
*
name
,
const
Table
&
table
)
:
m_impl
(
*
new
NdbEventImpl
(
*
this
))
{
setName
(
name
);
setTable
(
table
);
}
NdbDictionary
::
Event
::
Event
(
NdbEventImpl
&
impl
)
:
m_impl
(
impl
)
{
...
...
@@ -610,6 +617,12 @@ NdbDictionary::Event::getName() const
return
m_impl
.
getName
();
}
void
NdbDictionary
::
Event
::
setTable
(
const
Table
&
table
)
{
m_impl
.
setTable
(
table
);
}
void
NdbDictionary
::
Event
::
setTable
(
const
char
*
table
)
{
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
7f3e6084
...
...
@@ -551,6 +551,13 @@ const char *NdbEventImpl::getName() const
return
m_externalName
.
c_str
();
}
void
NdbEventImpl
::
setTable
(
const
NdbDictionary
::
Table
&
table
)
{
m_tableImpl
=
&
NdbTableImpl
::
getImpl
(
table
);
m_tableName
.
assign
(
m_tableImpl
->
getName
());
}
void
NdbEventImpl
::
setTable
(
const
char
*
table
)
{
...
...
ndb/src/ndbapi/NdbDictionaryImpl.hpp
View file @
7f3e6084
...
...
@@ -195,6 +195,7 @@ public:
void
setName
(
const
char
*
name
);
const
char
*
getName
()
const
;
void
setTable
(
const
NdbDictionary
::
Table
&
table
);
void
setTable
(
const
char
*
table
);
const
char
*
getTableName
()
const
;
void
addTableEvent
(
const
NdbDictionary
::
Event
::
TableEvent
t
);
...
...
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