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
d99be9ab
Commit
d99be9ab
authored
May 15, 2002
by
jani@rhols221.adsl.netsonic.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed GET_STRALC to GET_STR_ALLOC
parent
e68ebac9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
18 deletions
+19
-18
client/mysql.cc
client/mysql.cc
+5
-5
client/mysqladmin.c
client/mysqladmin.c
+1
-1
client/mysqlcheck.c
client/mysqlcheck.c
+1
-1
client/mysqldump.c
client/mysqldump.c
+1
-1
include/my_getopt.h
include/my_getopt.h
+1
-1
mysys/my_getopt.c
mysys/my_getopt.c
+7
-6
sql/mysqld.cc
sql/mysqld.cc
+3
-3
No files found.
client/mysql.cc
View file @
d99be9ab
...
...
@@ -459,7 +459,7 @@ static struct my_option my_long_options[] =
(
gptr
*
)
&
default_dbug_option
,
0
,
GET_STR
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#endif
{
"database"
,
'D'
,
"Database to use."
,
(
gptr
*
)
&
current_db
,
(
gptr
*
)
&
current_db
,
0
,
GET_STR
AL
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
(
gptr
*
)
&
current_db
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"execute"
,
'e'
,
"Execute command and quit. (Output like with --batch)."
,
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"vertical"
,
'E'
,
"Print the output of a query (rows) vertically."
,
...
...
@@ -481,7 +481,7 @@ static struct my_option my_long_options[] =
{
"no-beep"
,
'b'
,
"Turn off beep on error."
,
(
gptr
*
)
&
opt_nobeep
,
(
gptr
*
)
&
opt_nobeep
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"host"
,
'h'
,
"Connect to host."
,
(
gptr
*
)
&
current_host
,
(
gptr
*
)
&
current_host
,
0
,
GET_STR
AL
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
(
gptr
*
)
&
current_host
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"html"
,
'H'
,
"Produce HTML output."
,
(
gptr
*
)
&
opt_html
,
(
gptr
*
)
&
opt_html
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"xml"
,
'X'
,
"Produce XML output"
,
(
gptr
*
)
&
opt_xml
,
(
gptr
*
)
&
opt_xml
,
0
,
...
...
@@ -528,7 +528,7 @@ static struct my_option my_long_options[] =
(
gptr
*
)
&
opt_mysql_port
,
0
,
GET_UINT
,
REQUIRED_ARG
,
MYSQL_PORT
,
0
,
0
,
0
,
0
,
0
},
{
"prompt"
,
OPT_PROMPT
,
"Set the mysql prompt to this value."
,
(
gptr
*
)
&
current_prompt
,
(
gptr
*
)
&
current_prompt
,
0
,
GET_STR
AL
C
,
(
gptr
*
)
&
current_prompt
,
(
gptr
*
)
&
current_prompt
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"quick"
,
'q'
,
"Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file. "
,
...
...
@@ -539,7 +539,7 @@ static struct my_option my_long_options[] =
{
"silent"
,
's'
,
"Be more silent."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"socket"
,
'S'
,
"Socket file to use for connection."
,
(
gptr
*
)
&
opt_mysql_unix_port
,
(
gptr
*
)
&
opt_mysql_unix_port
,
0
,
GET_STR
AL
C
,
(
gptr
*
)
&
opt_mysql_unix_port
,
(
gptr
*
)
&
opt_mysql_unix_port
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#include "sslopt-longopts.h"
{
"table"
,
't'
,
"Output in table format."
,
(
gptr
*
)
&
output_tables
,
...
...
@@ -551,7 +551,7 @@ static struct my_option my_long_options[] =
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#ifndef DONT_ALLOW_USER_CHANGE
{
"user"
,
'u'
,
"User for login if not current user."
,
(
gptr
*
)
&
current_user
,
(
gptr
*
)
&
current_user
,
0
,
GET_STR
AL
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
(
gptr
*
)
&
current_user
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#endif
{
"safe-updates"
,
'U'
,
"Only allow UPDATE and DELETE that uses keys."
,
(
gptr
*
)
&
safe_updates
,
(
gptr
*
)
&
safe_updates
,
0
,
GET_BOOL
,
OPT_ARG
,
0
,
0
,
...
...
client/mysqladmin.c
View file @
d99be9ab
...
...
@@ -144,7 +144,7 @@ static struct my_option my_long_options[] =
#include "sslopt-longopts.h"
#ifndef DONT_ALLOW_USER_CHANGE
{
"user"
,
'u'
,
"User for login if not current user."
,
(
gptr
*
)
&
user
,
(
gptr
*
)
&
user
,
0
,
GET_STR
AL
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
(
gptr
*
)
&
user
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#endif
{
"verbose"
,
'v'
,
"Write more information."
,
(
gptr
*
)
&
opt_verbose
,
(
gptr
*
)
&
opt_verbose
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
client/mysqlcheck.c
View file @
d99be9ab
...
...
@@ -94,7 +94,7 @@ static struct my_option my_long_options[] =
{
"help"
,
'?'
,
"Display this help message and exit."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"host"
,
'h'
,
"Connect to host."
,
(
gptr
*
)
&
current_host
,
(
gptr
*
)
&
current_host
,
0
,
GET_STR
AL
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
(
gptr
*
)
&
current_host
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"medium-check"
,
'm'
,
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
client/mysqldump.c
View file @
d99be9ab
...
...
@@ -159,7 +159,7 @@ static struct my_option my_long_options[] =
{
"help"
,
'?'
,
"Display this help message and exit."
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"host"
,
'h'
,
"Connect to host."
,
(
gptr
*
)
&
current_host
,
(
gptr
*
)
&
current_host
,
0
,
GET_STR
AL
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
(
gptr
*
)
&
current_host
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"lines-terminated-by"
,
OPT_LTB
,
"Lines in the i.file are terminated by ..."
,
(
gptr
*
)
&
lines_terminated
,
(
gptr
*
)
&
lines_terminated
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
include/my_getopt.h
View file @
d99be9ab
...
...
@@ -17,7 +17,7 @@
C_MODE_START
enum
get_opt_var_type
{
GET_NO_ARG
,
GET_BOOL
,
GET_INT
,
GET_UINT
,
GET_LONG
,
GET_ULONG
,
GET_LL
,
GET_ULL
,
GET_STR
,
GET_STR
AL
C
};
GET_ULONG
,
GET_LL
,
GET_ULL
,
GET_STR
,
GET_STR
_ALLO
C
};
enum
get_opt_arg_type
{
NO_ARG
,
OPT_ARG
,
REQUIRED_ARG
};
struct
my_option
...
...
mysys/my_getopt.c
View file @
d99be9ab
...
...
@@ -50,7 +50,7 @@ char *disabled_my_option= (char*) "0";
#define ERR_ARGUMENT_REQUIRED 4
#define ERR_VAR_PREFIX_NOT_UNIQUE 5
#define ERR_UNKNOWN_VARIABLE 6
#define ERR_
MUST_BE_VARIABLE
7
#define ERR_
OUT_OF_MEMORY
7
#define ERR_UNKNOWN_SUFFIX 8
#define ERR_NO_PTR_TO_VARIABLE 9
...
...
@@ -424,12 +424,13 @@ static int setval (const struct my_option *opts, char *argument,
*
((
ulonglong
*
)
result_pos
)
=
getopt_ull
(
argument
,
opts
,
&
err
);
else
if
(
opts
->
var_type
==
GET_STR
)
*
((
char
**
)
result_pos
)
=
argument
;
else
if
(
opts
->
var_type
==
GET_STR
AL
C
)
else
if
(
opts
->
var_type
==
GET_STR
_ALLO
C
)
{
if
((
*
((
char
**
)
result_pos
)))
my_free
((
*
(
char
**
)
result_pos
),
MYF
(
MY_WME
|
MY_FAE
|
MY_ALLOW_ZERO_PTR
));
*
((
char
**
)
result_pos
)
=
my_strdup
(
argument
,
MYF
(
MY_WME
));
MYF
(
MY_WME
|
MY_FAE
));
if
(
!
(
*
((
char
**
)
result_pos
)
=
my_strdup
(
argument
,
MYF
(
MY_WME
))))
return
ERR_OUT_OF_MEMORY
;
}
if
(
err
)
return
ERR_UNKNOWN_SUFFIX
;
...
...
@@ -635,7 +636,7 @@ void my_print_help(const struct my_option *options)
}
printf
(
"--%s"
,
optp
->
name
);
col
+=
2
+
strlen
(
optp
->
name
);
if
(
optp
->
var_type
==
GET_STR
||
optp
->
var_type
==
GET_STR
AL
C
)
if
(
optp
->
var_type
==
GET_STR
||
optp
->
var_type
==
GET_STR
_ALLO
C
)
{
printf
(
"%s=name%s "
,
optp
->
arg_type
==
OPT_ARG
?
"["
:
""
,
optp
->
arg_type
==
OPT_ARG
?
"]"
:
""
);
...
...
@@ -702,7 +703,7 @@ void my_print_variables(const struct my_option *options)
length
=
strlen
(
optp
->
name
);
for
(;
length
<
name_space
;
length
++
)
putchar
(
' '
);
if
(
optp
->
var_type
==
GET_STR
||
optp
->
var_type
==
GET_STR
AL
C
)
if
(
optp
->
var_type
==
GET_STR
||
optp
->
var_type
==
GET_STR
_ALLO
C
)
{
if
(
*
((
char
**
)
optp
->
value
))
printf
(
"%s
\n
"
,
*
((
char
**
)
optp
->
value
));
...
...
sql/mysqld.cc
View file @
d99be9ab
...
...
@@ -2977,7 +2977,7 @@ static struct my_option my_long_options[] =
0
,
0
,
0
,
0
,
0
,
0
},
{
"log-bin"
,
OPT_BIN_LOG
,
"Log queries in new binary format (for replication)"
,
(
gptr
*
)
&
opt_bin_logname
,
(
gptr
*
)
&
opt_bin_logname
,
0
,
GET_STR
AL
C
,
(
gptr
*
)
&
opt_bin_logname
,
(
gptr
*
)
&
opt_bin_logname
,
0
,
GET_STR
_ALLO
C
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"log-bin-index"
,
OPT_BIN_LOG_INDEX
,
"File that holds the names for last binary log files"
,
...
...
@@ -3139,7 +3139,7 @@ static struct my_option my_long_options[] =
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"relay-log"
,
OPT_RELAY_LOG
,
"Undocumented"
,
(
gptr
*
)
&
opt_relay_logname
,
(
gptr
*
)
&
opt_relay_logname
,
0
,
GET_STR
AL
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"relay-log-index"
,
OPT_RELAY_LOG_INDEX
,
"Undocumented"
,
(
gptr
*
)
&
opt_relaylog_index_name
,
(
gptr
*
)
&
opt_relaylog_index_name
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
@@ -3208,7 +3208,7 @@ static struct my_option my_long_options[] =
(
gptr
*
)
&
relay_log_info_file
,
(
gptr
*
)
&
relay_log_info_file
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"slave-load-tmpdir"
,
OPT_SLAVE_LOAD_TMPDIR
,
"Undocumented"
,
(
gptr
*
)
&
slave_load_tmpdir
,
(
gptr
*
)
&
slave_load_tmpdir
,
0
,
GET_STR
AL
C
,
(
gptr
*
)
&
slave_load_tmpdir
,
(
gptr
*
)
&
slave_load_tmpdir
,
0
,
GET_STR
_ALLO
C
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"slave-skip-errors"
,
OPT_SLAVE_SKIP_ERRORS
,
"Tells the slave thread to continue replication when a query returns an error from the provided list"
,
...
...
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