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
a86d23b9
Commit
a86d23b9
authored
Jul 01, 2003
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_671/mysql-4.0
parents
b5c092ba
20081b62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
50 deletions
+4
-50
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+4
-50
No files found.
client/mysqlbinlog.cc
View file @
a86d23b9
...
...
@@ -55,13 +55,11 @@ static ulonglong position = 0;
static
bool
use_remote
=
0
;
static
short
binlog_flags
=
0
;
static
MYSQL
*
mysql
=
NULL
;
static
const
char
*
table
=
0
;
static
void
dump_local_log_entries
(
const
char
*
logname
);
static
void
dump_remote_log_entries
(
const
char
*
logname
);
static
void
dump_log_entries
(
const
char
*
logname
);
static
void
dump_remote_file
(
NET
*
net
,
const
char
*
fname
);
static
void
dump_remote_table
(
NET
*
net
,
const
char
*
db
,
const
char
*
table
);
static
void
die
(
const
char
*
fmt
,
...);
static
MYSQL
*
safe_connect
();
...
...
@@ -96,8 +94,6 @@ static struct my_option my_long_options[] =
{
"short-form"
,
's'
,
"Just show the queries, no extra info"
,
(
gptr
*
)
&
short_form
,
(
gptr
*
)
&
short_form
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"table"
,
't'
,
"Get raw table dump using COM_TABLE_DUMB"
,
(
gptr
*
)
&
table
,
(
gptr
*
)
&
table
,
0
,
GET_STR_ALLOC
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"user"
,
'u'
,
"Connect to the remote server as username"
,
(
gptr
*
)
&
user
,
(
gptr
*
)
&
user
,
0
,
GET_STR_ALLOC
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
@@ -252,35 +248,6 @@ static void dump_log_entries(const char* logname)
dump_local_log_entries
(
logname
);
}
static
void
dump_remote_table
(
NET
*
net
,
const
char
*
db
,
const
char
*
table
)
{
char
buf
[
1024
];
char
*
p
=
buf
;
uint
table_len
=
(
uint
)
strlen
(
table
);
uint
db_len
=
(
uint
)
strlen
(
db
);
if
(
table_len
+
db_len
>
sizeof
(
buf
)
-
2
)
die
(
"Buffer overrun"
);
*
p
++
=
db_len
;
memcpy
(
p
,
db
,
db_len
);
p
+=
db_len
;
*
p
++
=
table_len
;
memcpy
(
p
,
table
,
table_len
);
if
(
simple_command
(
mysql
,
COM_TABLE_DUMP
,
buf
,
p
-
buf
+
table_len
,
1
))
die
(
"Error sending the table dump command"
);
for
(;;)
{
uint
packet_len
=
my_net_read
(
net
);
if
(
packet_len
==
0
)
break
;
// end of file
if
(
packet_len
==
packet_error
)
die
(
"Error reading packet in table dump"
);
my_fwrite
(
result_file
,
(
byte
*
)
net
->
read_pos
,
packet_len
,
MYF
(
MY_WME
));
fflush
(
result_file
);
}
}
static
int
check_master_version
(
MYSQL
*
mysql
)
{
MYSQL_RES
*
res
=
0
;
...
...
@@ -516,7 +483,7 @@ int main(int argc, char** argv)
MY_INIT
(
argv
[
0
]);
parse_args
(
&
argc
,
(
char
***
)
&
argv
);
if
(
!
argc
&&
!
table
)
if
(
!
argc
)
{
usage
();
return
-
1
;
...
...
@@ -525,22 +492,9 @@ int main(int argc, char** argv)
if
(
use_remote
)
mysql
=
safe_connect
();
if
(
table
)
{
if
(
!
use_remote
)
die
(
"You must specify connection parameter to get table dump"
);
char
*
db
=
(
char
*
)
table
;
char
*
tbl
=
(
char
*
)
strchr
(
table
,
'.'
);
if
(
!
tbl
)
die
(
"You must use database.table syntax to specify the table"
);
*
tbl
++
=
0
;
dump_remote_table
(
&
mysql
->
net
,
db
,
tbl
);
}
else
{
while
(
--
argc
>=
0
)
dump_log_entries
(
*
(
argv
++
));
}
while
(
--
argc
>=
0
)
dump_log_entries
(
*
(
argv
++
));
if
(
result_file
!=
stdout
)
my_fclose
(
result_file
,
MYF
(
0
));
if
(
use_remote
)
...
...
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