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
89ea5ee6
Commit
89ea5ee6
authored
Aug 29, 2002
by
nick@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sync_slave_with_master [connection].
Equivalent to: save_master_pos; connection slave; sync_with_master;
parent
10dd73d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
client/mysqltest.c
client/mysqltest.c
+25
-7
No files found.
BitKeeper/etc/logging_ok
View file @
89ea5ee6
...
...
@@ -76,3 +76,4 @@ zak@balfor.local
zak@linux.local
zgreant@mysql.com
miguel@hegel.br
nick@mysql.com
client/mysqltest.c
View file @
89ea5ee6
...
...
@@ -185,7 +185,9 @@ Q_LET, Q_ECHO,
Q_WHILE
,
Q_END_BLOCK
,
Q_SYSTEM
,
Q_RESULT
,
Q_REQUIRE
,
Q_SAVE_MASTER_POS
,
Q_SYNC_WITH_MASTER
,
Q_ERROR
,
Q_SYNC_WITH_MASTER
,
Q_SYNC_SLAVE_WITH_MASTER
,
Q_ERROR
,
Q_SEND
,
Q_REAP
,
Q_DIRTY_CLOSE
,
Q_REPLACE
,
Q_PING
,
Q_EVAL
,
...
...
@@ -233,6 +235,7 @@ const char *command_names[]=
"require"
,
"save_master_pos"
,
"sync_with_master"
,
"sync_slave_with_master"
,
"error"
,
"send"
,
"reap"
,
...
...
@@ -966,14 +969,13 @@ int do_echo(struct st_query* q)
}
int
do_sync_with_master
(
struct
st_query
*
q
)
int
do_sync_with_master
2
(
const
char
*
p
)
{
MYSQL_RES
*
res
;
MYSQL_ROW
row
;
MYSQL
*
mysql
=
&
cur_con
->
mysql
;
char
query_buf
[
FN_REFLEN
+
128
];
int
offset
=
0
;
char
*
p
=
q
->
first_argument
;
int
rpl_parse
;
if
(
!
master_pos
.
file
[
0
])
...
...
@@ -1005,6 +1007,10 @@ int do_sync_with_master(struct st_query* q)
return
0
;
}
int
do_sync_with_master
(
struct
st_query
*
q
)
{
return
do_sync_with_master2
(
q
->
first_argument
);
}
int
do_save_master_pos
()
{
...
...
@@ -1298,10 +1304,9 @@ void free_replace()
DBUG_VOID_RETURN
;
}
int
select_connection
(
struct
st_query
*
q
)
int
select_connection
(
char
*
p
)
{
char
*
p
=
q
->
first_argument
,
*
name
;
char
*
name
;
struct
connection
*
con
;
DBUG_ENTER
(
"select_connection"
);
DBUG_PRINT
(
"enter"
,(
"name: '%s'"
,
p
));
...
...
@@ -2403,7 +2408,7 @@ int main(int argc, char** argv)
processed
=
1
;
switch
(
q
->
type
)
{
case
Q_CONNECT
:
do_connect
(
q
);
break
;
case
Q_CONNECTION
:
select_connection
(
q
);
break
;
case
Q_CONNECTION
:
select_connection
(
q
->
first_argument
);
break
;
case
Q_DISCONNECT
:
case
Q_DIRTY_CLOSE
:
close_connection
(
q
);
break
;
...
...
@@ -2492,6 +2497,19 @@ int main(int argc, char** argv)
break
;
case
Q_SAVE_MASTER_POS
:
do_save_master_pos
();
break
;
case
Q_SYNC_WITH_MASTER
:
do_sync_with_master
(
q
);
break
;
case
Q_SYNC_SLAVE_WITH_MASTER
:
{
do_save_master_pos
();
if
(
*
q
->
first_argument
)
select_connection
(
q
->
first_argument
);
else
{
char
buf
[]
=
"slave"
;
select_connection
(
buf
);
}
do_sync_with_master2
(
""
);
break
;
}
case
Q_COMMENT
:
/* Ignore row */
case
Q_COMMENT_WITH_COMMAND
:
case
Q_PING
:
...
...
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