mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
- Added new type GET_STRALC to my_getopt.
- Fixed some bugs, wrongly freed pointers, in some clients. - Removed unneccessary code. - Fixed some other minor bugs and added some options into variables category, which had accidently been left out earlier. client/mysql.cc: Fixed some wrong freed pointers. Removed unneccessary code. Changed some types from GET_STR to GET_STRALC. client/mysqladmin.c: Fixed some wrong freed pointers. Removed unneccessary code. Changed some types from GET_STR to GET_STRALC. client/mysqlcheck.c: Fixed some wrong freed pointers. Removed unneccessary code. Changed some types from GET_STR to GET_STRALC. client/mysqldump.c: Fixed some wrong freed pointers. Removed unneccessary code. Changed some types from GET_STR to GET_STRALC. client/mysqlimport.c: Removed unneccessary code. Fixed a bug in option --ignore-lines client/mysqlshow.c: Removed unneccessary code. include/my_getopt.h: Added new type, GET_STRALC. The name stands for GET STRING ALLOC, which means that the struct member value and u_max_value are strings that must be alloced and freed when used. The normal GET_STR works similarly otherwise, except that it's arguments are just pointers to strings, not alloced ones. mysys/my_getopt.c: Added support for GET_STRALC
This commit is contained in:
@ -25,7 +25,7 @@
|
||||
** * *
|
||||
** *************************
|
||||
*/
|
||||
#define IMPORT_VERSION "3.1"
|
||||
#define IMPORT_VERSION "3.2"
|
||||
|
||||
#include "client_priv.h"
|
||||
#include "mysql_version.h"
|
||||
@ -90,8 +90,9 @@ static struct my_option my_long_options[] =
|
||||
(gptr*) ¤t_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ignore", 'i', "If duplicate unique key was found, keep old row.",
|
||||
(gptr*) &ignore, (gptr*) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.", 0, 0,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
|
||||
(gptr*) &opt_ignore_lines, (gptr*) &opt_ignore_lines, 0, GET_STR,
|
||||
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},
|
||||
@ -166,23 +167,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
switch(optid) {
|
||||
case 'c':
|
||||
opt_columns= argument;
|
||||
break;
|
||||
case OPT_DEFAULT_CHARSET:
|
||||
default_charset= argument;
|
||||
break;
|
||||
case OPT_CHARSETS_DIR:
|
||||
charsets_dir= argument;
|
||||
break;
|
||||
case 'h':
|
||||
current_host= argument;
|
||||
break;
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
case 'u':
|
||||
current_user= argument;
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
if (argument)
|
||||
{
|
||||
@ -196,12 +180,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
else
|
||||
tty_password= 1;
|
||||
break;
|
||||
case 'P':
|
||||
opt_mysql_port= (unsigned int) atoi(argument);
|
||||
break;
|
||||
case 'S':
|
||||
opt_mysql_unix_port= argument;
|
||||
break;
|
||||
#ifdef __WIN__
|
||||
case 'W':
|
||||
opt_mysql_unix_port=MYSQL_NAMEDPIPE;
|
||||
@ -216,24 +194,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
case '?':
|
||||
usage();
|
||||
exit(0);
|
||||
case (int) OPT_FTB:
|
||||
fields_terminated= argument;
|
||||
break;
|
||||
case (int) OPT_LTB:
|
||||
lines_terminated= argument;
|
||||
break;
|
||||
case (int) OPT_ENC:
|
||||
enclosed= argument;
|
||||
break;
|
||||
case (int) OPT_O_ENC:
|
||||
opt_enclosed= argument;
|
||||
break;
|
||||
case (int) OPT_ESC:
|
||||
escaped= argument;
|
||||
break;
|
||||
case (int) OPT_IGN_LINES:
|
||||
opt_ignore_lines= argument;
|
||||
break;
|
||||
#include "sslopt-case.h"
|
||||
}
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user