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
c238a925
Commit
c238a925
authored
Oct 21, 2003
by
guilhem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
parents
e52a2f1a
c93f69e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+24
-3
No files found.
client/mysqlbinlog.cc
View file @
c238a925
...
...
@@ -52,7 +52,7 @@ static const char* host = 0;
static
int
port
=
MYSQL_PORT
;
static
const
char
*
sock
=
0
;
static
const
char
*
user
=
0
;
static
c
onst
char
*
pass
=
""
;
static
c
har
*
pass
=
0
;
static
ulonglong
position
=
0
;
static
short
binlog_flags
=
0
;
static
MYSQL
*
mysql
=
NULL
;
...
...
@@ -227,7 +227,7 @@ static struct my_option my_long_options[] =
{
"offset"
,
'o'
,
"Skip the first N entries."
,
(
gptr
*
)
&
offset
,
(
gptr
*
)
&
offset
,
0
,
GET_ULL
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"password"
,
'p'
,
"Password to connect to remote server."
,
0
,
0
,
0
,
GET_STR
,
REQUIRED
_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
GET_STR
,
OPT
_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"port"
,
'P'
,
"Use port to connect to the remote server."
,
(
gptr
*
)
&
port
,
(
gptr
*
)
&
port
,
0
,
GET_INT
,
REQUIRED_ARG
,
MYSQL_PORT
,
0
,
0
,
0
,
0
,
0
},
...
...
@@ -267,6 +267,11 @@ void sql_print_error(const char *format,...)
va_end
(
args
);
}
static
void
cleanup
()
{
my_free
(
pass
,
MYF
(
MY_ALLOW_ZERO_PTR
));
}
static
void
die
(
const
char
*
fmt
,
...)
{
va_list
args
;
...
...
@@ -275,6 +280,7 @@ static void die(const char* fmt, ...)
vfprintf
(
stderr
,
fmt
,
args
);
fprintf
(
stderr
,
"
\n
"
);
va_end
(
args
);
cleanup
();
exit
(
1
);
}
...
...
@@ -334,6 +340,7 @@ extern "C" my_bool
get_one_option
(
int
optid
,
const
struct
my_option
*
opt
__attribute__
((
unused
)),
char
*
argument
)
{
bool
tty_password
=
0
;
switch
(
optid
)
{
#ifndef DBUG_OFF
case
'#'
:
...
...
@@ -344,7 +351,17 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
one_database
=
1
;
break
;
case
'p'
:
pass
=
my_strdup
(
argument
,
MYF
(
0
));
if
(
argument
)
{
my_free
(
pass
,
MYF
(
MY_ALLOW_ZERO_PTR
));
char
*
start
=
argument
;
pass
=
my_strdup
(
argument
,
MYF
(
MY_FAE
));
while
(
*
argument
)
*
argument
++=
'x'
;
/* Destroy argument */
if
(
*
start
)
start
[
1
]
=
0
;
/* Cut length of argument */
}
else
tty_password
=
1
;
break
;
case
'r'
:
if
(
!
(
result_file
=
my_fopen
(
argument
,
O_WRONLY
|
O_BINARY
,
MYF
(
MY_WME
))))
...
...
@@ -360,6 +377,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
usage
();
exit
(
0
);
}
if
(
tty_password
)
pass
=
get_tty_password
(
NullS
);
return
0
;
}
...
...
@@ -778,6 +798,7 @@ int main(int argc, char** argv)
my_fclose
(
result_file
,
MYF
(
0
));
if
(
remote_opt
)
mysql_close
(
mysql
);
cleanup
();
free_defaults
(
defaults_argv
);
my_end
(
0
);
return
0
;
...
...
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