Skip to content

Commit be56800

Browse files
digitalistlenkis
authored andcommitted
Update libslave doc (position api changed)
(cherry picked from commit fa88d2b)
1 parent 44e2d5d commit be56800

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/tutorials/libslave.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ STEP 5: Look at the program:
8787
slave::Slave* sl = NULL;
8888
8989
void callback(const slave::RecordSet& event) {
90-
slave::Slave::binlog_pos_t sBinlogPos = sl->getLastBinlog();
90+
slave::Position sBinlogPos = sl->getLastBinlogPos();
9191
switch (event.type_event) {
9292
case slave::RecordSet::Update: std::cout << "UPDATE" << "\n"; break;
9393
case slave::RecordSet::Delete: std::cout << "DELETE" << "\n"; break;
@@ -104,6 +104,7 @@ STEP 5: Look at the program:
104104
int main(int argc, char** argv)
105105
{
106106
slave::MasterInfo masterinfo;
107+
slave::Position position("mysql-bin", 0);
107108
masterinfo.conn_options.mysql_host = "127.0.0.1";
108109
masterinfo.conn_options.mysql_port = 3306;
109110
masterinfo.conn_options.mysql_user = "root";
@@ -113,7 +114,7 @@ STEP 5: Look at the program:
113114
slave::DefaultExtState sDefExtState;
114115
slave::Slave slave(masterinfo, sDefExtState);
115116
sl = &slave;
116-
sDefExtState.setMasterLogNamePos("mysql-bin", 0);
117+
sDefExtState.setMasterPosition(position);
117118
slave.setCallback("test", "test", callback);
118119
slave.init();
119120
slave.createDatabaseStructure();

0 commit comments

Comments
 (0)