Commit ce291052 authored by arjen@fred.bitbike.com's avatar arjen@fred.bitbike.com

Merge arjen@work.mysql.com:/home/bk/mysql-4.0

into fred.bitbike.com:/home/arjen/mysql-4.0
parents e41fc926 3893920c
......@@ -11,6 +11,7 @@ bell@sanja.is.com.ua
davida@isil.mysql.com
heikki@donna.mysql.fi
heikki@hundin.mysql.fi
jani@dsl-jkl1657.dial.inet.fi
jani@hynda.mysql.fi
jani@janikt.pp.saunalahti.fi
jani@rhols221.adsl.netsonic.fi
......@@ -40,6 +41,7 @@ paul@teton.kitebird.com
root@x3.internalnet
sasha@mysql.sashanet.com
serg@serg.mysql.com
serg@sergbook.mysql.com
sinisa@rhols221.adsl.netsonic.fi
tfr@sarvik.tfr.cafe.ee
tim@bitch.mysql.fi
......@@ -56,4 +58,3 @@ tonu@x3.internalnet
venu@work.mysql.com
zak@balfor.local
zak@linux.local
jani@dsl-jkl1657.dial.inet.fi
......@@ -22563,6 +22563,8 @@ used.)
@item -q, --quick
Don't buffer query, dump directly to stdout. Uses @code{mysql_use_result()}
to do this.
@item -Q, --quote-names
Quote table and column names within @samp{`} characters.
@item -r, --result-file=...
Direct output to a given file. This option should be used in MSDOS,
because it prevents new line '\n' from being converted to '\n\r' (new
......@@ -30477,10 +30479,10 @@ mysql> SELECT "a" ="A ";
@node Logical Operators, Control flow functions, Comparison Operators, Non-typed Operators
@subsubsection Logical Operators
@findex Logical functions
@findex Functions, logical
@findex Logical operators
@findex Operators, logical
All logical functions return @code{1} (TRUE), @code{0} (FALSE) or
All logical operators evaluate to @code{1} (TRUE), @code{0} (FALSE) or
@code{NULL} (unknown, which is in most cases the same as FALSE):
@table @code
......@@ -30488,9 +30490,9 @@ All logical functions return @code{1} (TRUE), @code{0} (FALSE) or
@findex ! (logical NOT)
@item NOT
@itemx !
Logical NOT. Returns @code{1} if the argument is @code{0}, otherwise returns
@code{0}.
Exception: @code{NOT NULL} returns @code{NULL}:
Logical NOT. Evaluates to @code{1} if the operand is @code{0}, otherwise
evaluates to @code{0}.
Exception: @code{NOT NULL} evaluates to @code{NULL}:
@example
mysql> SELECT NOT 1;
-> 0
......@@ -30501,14 +30503,14 @@ mysql> SELECT ! (1+1);
mysql> SELECT ! 1+1;
-> 1
@end example
The last example returns @code{1} because the expression evaluates
The last example produces @code{1} because the expression evaluates
the same way as @code{(!1)+1}.
@findex OR, logical
@findex || (logical OR)
@item OR
@itemx ||
Logical OR. Returns @code{1} if either argument is not @code{0} and not
Logical OR. Evaluates to @code{1} if either operand is not @code{0} and not
@code{NULL}:
@example
mysql> SELECT 1 || 0;
......@@ -30524,13 +30526,16 @@ mysql> SELECT 1 || NULL;
@findex && (logical AND)
@item AND
@itemx &&
Logical AND. Returns @code{0} if either argument is @code{0} or @code{NULL},
otherwise returns @code{1}:
Logical AND. For non-@code{NULL} operands, evaluates to @code{1} if both
operands are non-zero and to @code{0} otherwise.
Produces @code{NULL} if either operand is @code{NULL}:
@example
mysql> SELECT 1 && NULL;
-> 0
mysql> SELECT 1 && 1;
-> 1
mysql> SELECT 1 && 0;
-> 0
mysql> SELECT 1 && NULL;
-> NULL
@end example
@end table
......@@ -32295,10 +32300,10 @@ following specifiers may be used in the @code{format} string:
@item @code{%s} @tab Seconds (@code{00}..@code{59})
@item @code{%p} @tab @code{AM} or @code{PM}
@item @code{%w} @tab Day of the week (@code{0}=Sunday..@code{6}=Saturday)
@item @code{%U} @tab Week (@code{0}..@code{53}), where Sunday is the first day of the week
@item @code{%u} @tab Week (@code{0}..@code{53}), where Monday is the first day of the week
@item @code{%V} @tab Week (@code{1}..@code{53}), where Sunday is the first day of the week. Used with '%X'
@item @code{%v} @tab Week (@code{1}..@code{53}), where Monday is the first day of the week. Used with '%x'
@item @code{%U} @tab Week (@code{00}..@code{53}), where Sunday is the first day of the week
@item @code{%u} @tab Week (@code{00}..@code{53}), where Monday is the first day of the week
@item @code{%V} @tab Week (@code{01}..@code{53}), where Sunday is the first day of the week. Used with '%X'
@item @code{%v} @tab Week (@code{01}..@code{53}), where Monday is the first day of the week. Used with '%x'
@item @code{%%} @tab A literal @samp{%}.
@end multitable
......@@ -36186,16 +36191,15 @@ SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
Sets the transaction isolation level for the global, whole session or
the next transaction.
The default behavior is to set the isolation level for the next (not started)
transaction.
If you set the @code{GLOBAL} privilege it will affect all new created threads.
You will need the @strong{process} privilege to do do this.
Setting the @code{SESSION} privilege will affect the following and all
future transactions.
The default behavior is to set the isolation level for the next (not
started) transaction. If you use the @code{GLOBAL} keyword, the statement
sets the default transaction level globally for all new connections
created from that point on. You will need the @strong{process}
privilege to do do this. Using the @code{SESSION} keyword sets the
default transaction level for all future transactions performed on the
current connection.
You can set the default isolation level for @code{mysqld} with
You can set the default global isolation level for @code{mysqld} with
@code{--transaction-isolation=...}. @xref{Command-line options}.
@node Fulltext Search, Query Cache, Transactional Commands, Reference
......@@ -49676,7 +49680,7 @@ not yet 100% confident in this code.
@node News-3.23.51, News-3.23.50, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.51
@itemize @bullet
Fixed the result from @code{IF()} is case in-sensitive if the 2 and
Fixed the result from @code{IF()} to be case insensitive if the second and
third arguments are case-sensitive.
@end itemize
......@@ -49684,7 +49688,7 @@ third arguments are case-sensitive.
@appendixsubsec Changes in release 3.23.50
@itemize @bullet
@item
Fixed problem with @code{crash-me} and gcc 3.0.4.
Fixed problem with @code{crash-me} and @code{gcc} 3.0.4.
@item
Fixed that @code{@@@@unknown_variable} doesn't hang server.
@item
......@@ -41,7 +41,7 @@
#include <signal.h>
#include <violite.h>
const char *VER= "12.4";
const char *VER= "12.5";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
......@@ -458,8 +458,8 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log.", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"database", 'D', "Database to use.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0,
0, 0, 0, 0},
{"database", 'D', "Database to use.", (gptr*) &current_db,
(gptr*) &current_db, 0, GET_STRALC, 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.",
......@@ -478,10 +478,10 @@ static struct my_option my_long_options[] =
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"no-beep", 'b', "Turn off beep on error.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
{"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, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(gptr*) &current_host, 0, GET_STRALC, 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,
......@@ -527,8 +527,9 @@ static struct my_option my_long_options[] =
{"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
(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.", 0, 0, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
(gptr*) &current_prompt, (gptr*) &current_prompt, 0, GET_STRALC,
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. ",
(gptr*) &quick, (gptr*) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
......@@ -538,7 +539,8 @@ 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.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STRALC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h"
{"table", 't', "Output in table format.", (gptr*) &output_tables,
(gptr*) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
......@@ -549,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, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(gptr*) &current_user, 0, GET_STRALC, 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,
......@@ -602,16 +604,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
switch(optid) {
case OPT_DEFAULT_CHARSET:
default_charset= argument;
break;
case OPT_CHARSETS_DIR:
strmov(mysql_charsets_dir, argument);
charsets_dir = mysql_charsets_dir;
break;
case OPT_LOCAL_INFILE:
using_opt_local_infile=1;
opt_local_infile= test(!optarg || atoi(optarg)>0);
opt_local_infile= test(!argument || atoi(argument)>0);
break;
case OPT_TEE:
if (argument == disabled_my_option)
......@@ -646,20 +645,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
printf("WARNING: option depricated; use --disable-pager instead.\n");
opt_nopager= 1;
break;
case OPT_PROMPT:
my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
current_prompt=my_strdup(optarg,MYF(MY_FAE));
break;
case 'A':
rehash= 0;
break;
case 'b':
opt_nobeep = 1;
break;
case 'D':
my_free(current_db, MYF(MY_ALLOW_ZERO_PTR));
current_db= my_strdup(argument, MYF(MY_WME));
break;
case 'e':
status.batch= 1;
status.add_to_history= 0;
......@@ -668,16 +656,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 1;
ignore_errors= 0;
break;
case 'h':
my_free(current_host, MYF(MY_ALLOW_ZERO_PTR));
current_host= my_strdup(argument, MYF(MY_WME));
break;
#ifndef DONT_ALLOW_USER_CHANGE
case 'u':
my_free(current_user, MYF(MY_ALLOW_ZERO_PTR));
current_user= my_strdup(argument, MYF(MY_WME));
break;
#endif
case 'o':
if (argument == disabled_my_option)
one_database= 0;
......@@ -726,13 +704,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_silent++; // more silent
}
break;
case 'P':
opt_mysql_port= (unsigned int) atoi(argument);
break;
case 'S':
my_free(opt_mysql_unix_port, MYF(MY_ALLOW_ZERO_PTR));
opt_mysql_unix_port= my_strdup(argument, MYF(0));
break;
case 'W':
#ifdef __WIN__
opt_mysql_unix_port= my_strdup(MYSQL_NAMEDPIPE, MYF(0));
......
......@@ -24,7 +24,7 @@
#include <my_pthread.h> /* because of signal() */
#endif
#define ADMIN_VERSION "8.31"
#define ADMIN_VERSION "8.32"
#define MAX_MYSQL_VAR 64
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
......@@ -136,14 +136,15 @@ static struct my_option my_long_options[] =
{"silent", 's', "Silently exit if one can't connect to server",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(gptr*) &unix_port, (gptr*) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"sleep", 'i', "Execute commands again and again with a sleep between.",
(gptr*) &interval, (gptr*) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
#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, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(gptr*) &user, 0, GET_STRALC, 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},
......@@ -174,10 +175,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int error = 0;
switch(optid) {
case 'h':
host = argument;
break;
case 'q': /* Allow old 'q' option */
case 'p':
if (argument)
{
......@@ -191,23 +188,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
else
tty_password=1;
break;
#ifndef DONT_ALLOW_USER_CHANGE
case 'u':
user= my_strdup(argument,MYF(0));
break;
#endif
case 'i':
interval=atoi(argument);
break;
case 'P':
tcp_port= (unsigned int) atoi(argument);
break;
case 's':
option_silent++;
break;
case 'S':
unix_port= argument;
break;
case 'W':
#ifdef __WIN__
unix_port=MYSQL_NAMEDPIPE;
......
......@@ -16,7 +16,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
#define CHECK_VERSION "2.1"
#define CHECK_VERSION "2.2"
#include "client_priv.h"
#include <my_getopt.h>
......@@ -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, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(gptr*) &current_host, 0, GET_STRALC, 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},
......@@ -199,12 +199,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'a':
what_to_do = DO_ANALYZE;
break;
case OPT_DEFAULT_CHARSET:
default_charset = argument;
break;
case OPT_CHARSETS_DIR:
charsets_dir = argument;
break;
case 'c':
what_to_do = DO_CHECK;
break;
......@@ -216,10 +210,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage();
exit(0);
case 'h':
my_free(current_host, MYF(MY_ALLOW_ZERO_PTR));
current_host = my_strdup(argument, MYF(MY_WME));
break;
case 'm':
what_to_do = DO_CHECK;
opt_medium_check = 1;
......@@ -227,11 +217,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'o':
what_to_do = DO_OPTIMIZE;
break;
#ifndef DONT_ALLOW_USER_CHANGE
case 'u':
current_user = argument;
break;
#endif
case 'p':
if (argument)
{
......@@ -245,15 +230,9 @@ 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 'r':
what_to_do = DO_REPAIR;
break;
case 'S':
opt_mysql_unix_port = argument;
break;
case 'W':
#ifdef __WIN__
opt_mysql_unix_port = MYSQL_NAMEDPIPE;
......
......@@ -35,7 +35,7 @@
** and adapted to mysqldump 05/11/01 by Jani Tolonen
*/
#define DUMP_VERSION "9.03"
#define DUMP_VERSION "9.04"
#include <my_global.h>
#include <my_sys.h>
......@@ -97,8 +97,9 @@ static struct my_option my_long_options[] =
"Dump all the databases. This will be same as --databases with all databases selected.",
(gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"all", 'a', "Include all MySQL specific create options.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"all", 'a', "Include all MySQL specific create options.",
(gptr*) &create_options, (gptr*) &create_options, 0, GET_BOOL, NO_ARG, 0,
0, 0, 0, 0, 0},
{"add-drop-table", OPT_DROP, "Add a 'drop table' before each create.",
(gptr*) &opt_drop, (gptr*) &opt_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
......@@ -111,8 +112,8 @@ static struct my_option my_long_options[] =
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"complete-insert", 'c', "Use complete insert statements.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag,
(gptr*) &cFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
......@@ -158,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, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
(gptr*) &current_host, 0, GET_STRALC, 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},
......@@ -176,9 +177,9 @@ static struct my_option my_long_options[] =
(gptr*) &opt_create_db, (gptr*) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"no-create-info", 't', "Don't write table creation info.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data", 'd', "No row information.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
(gptr*) &tFlag, (gptr*) &tFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data", 'd', "No row information.", (gptr*) &dFlag, (gptr*) &dFlag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is depricated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
......@@ -301,24 +302,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_master_data=1;
opt_first_slave=1;
break;
case 'a':
create_options=1;
break;
case OPT_DEFAULT_CHARSET:
default_charset= argument;
break;
case OPT_CHARSETS_DIR:
charsets_dir= argument;
break;
case 'h':
my_free(current_host,MYF(MY_ALLOW_ZERO_PTR));
current_host=my_strdup(argument,MYF(MY_WME));
break;
#ifndef DONT_ALLOW_USER_CHANGE
case 'u':
current_user=argument;
break;
#endif
case 'p':
if (argument)
{
......@@ -332,36 +315,23 @@ 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 'r':
if (!(md_result_file = my_fopen(argument, O_WRONLY | O_BINARY,
MYF(MY_WME))))
exit(1);
break;
case 'S':
opt_mysql_unix_port= argument;
break;
case 'W':
#ifdef __WIN__
opt_mysql_unix_port=MYSQL_NAMEDPIPE;
#endif
break;
case 'T':
path= argument;
opt_disable_keys=0;
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
break;
case 'c': cFlag=1; break;
case 'd': dFlag=1; break;
case 't': tFlag=1; break;
case 'V': print_version(); exit(0);
case 'w':
where=argument;
break;
case 'X':
opt_xml = 1;
opt_disable_keys=0;
......@@ -370,21 +340,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_OPTIMIZE:
extended_insert=opt_drop=opt_lock=lock_tables=quick=create_options=
opt_disable_keys=1;
......
......@@ -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*) &current_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;
......
......@@ -16,7 +16,7 @@
/* Show databases, tables or columns */
#define SHOW_VERSION "9.1"
#define SHOW_VERSION "9.2"
#include <my_global.h>
#include "client_priv.h"
......@@ -198,15 +198,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
switch(optid) {
case 'c':
charsets_dir= argument;
break;
case 'v':
opt_verbose++;
break;
case 'h':
host = argument;
break;
case 'p':
if (argument)
{
......@@ -220,17 +214,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
else
tty_password=1;
break;
#ifndef DONT_ALLOW_USER_CHANGE
case 'u':
user=argument;
break;
#endif
case 'P':
opt_mysql_port= (unsigned int) atoi(argument);
break;
case 'S':
opt_mysql_unix_port= argument;
break;
case 'W':
#ifdef __WIN__
opt_mysql_unix_port=MYSQL_NAMEDPIPE;
......
......@@ -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_ULONG, GET_LL, GET_ULL, GET_STR, GET_STRALC };
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
struct my_option
......
......@@ -196,7 +196,7 @@ static struct my_option my_long_options[] =
{"keys-used", 'k',
"Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts!",
(gptr*) &check_param.keys_in_use, (gptr*) &check_param.keys_in_use, 0,
GET_LL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
{"medium-check", 'm',
"Faster than extended-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
......
--des-key-file=$MYSQL_TEST_DIR/std_data/des_key_file
--loose-des-key-file=$MYSQL_TEST_DIR/std_data/des_key_file
......@@ -19,6 +19,7 @@
#include <stdlib.h>
#include <my_getopt.h>
#include <assert.h>
#include <my_sys.h>
static int findopt (char *optpat, uint length,
const struct my_option **opt_res,
......@@ -423,6 +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_STRALC)
{
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));
}
if (err)
return ERR_UNKNOWN_SUFFIX;
}
......@@ -627,7 +635,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)
if (optp->var_type == GET_STR || optp->var_type == GET_STRALC)
{
printf("%s=name%s ", optp->arg_type == OPT_ARG ? "[" : "",
optp->arg_type == OPT_ARG ? "]" : "");
......@@ -694,7 +702,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)
if (optp->var_type == GET_STR || optp->var_type == GET_STRALC)
{
if (*((char**) optp->value))
printf("%s\n", *((char**) optp->value));
......@@ -741,7 +749,10 @@ void my_print_variables(const struct my_option *options)
if (!optp->def_value && !*((ulonglong*) optp->value))
printf("(No default value)\n");
else
printf("%s\n", longlong2str(*((ulonglong*) optp->value), buff, 10));
{
longlong2str(*((ulonglong*) optp->value), buff, 10);
printf("%s\n", buff);
}
}
}
}
......
......@@ -2977,8 +2977,8 @@ 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, OPT_ARG, 0,
0, 0, 0, 0, 0},
(gptr*) &opt_bin_logname, (gptr*) &opt_bin_logname, 0, GET_STRALC,
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",
(gptr*) &opt_binlog_index_name, (gptr*) &opt_binlog_index_name, 0, GET_STR,
......@@ -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, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
GET_STRALC, 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,
(gptr*) &slave_load_tmpdir, (gptr*) &slave_load_tmpdir, 0, GET_STRALC,
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. Normally, replication will discontinue when an error is encountered, giving the user a chance to resolve the inconsistency in the data manually. Do not use this option unless you fully understand why you are getting the errors. If there are no bugs in your replication setup and client programs, and no bugs in MySQL itself, you should never get an abort with error. Indiscriminate use of this option will result in slaves being hopelessly out of sync with the master and you having no idea how the problem happened. For error codes, you should use the numbers provided by the error message in your slave error log and in the output of SHOW SLAVE STATUS. Full list of error messages can be found in the source distribution in `Docs/mysqld_error.txt'. You can (but should not) also use a very non-recommended value of all which will ignore all error messages and keep barging along regardless. Needless to say, if you use it, we make no promises regarding your data integrity. Please do not complain if your data on the slave is not anywhere close to what it is on the master in this case -- you have been warned. Example: slave-skip-errors=1062,1053 or slave-skip-errors=all",
......@@ -3974,7 +3974,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case 'l':
opt_log=1;
opt_logname=argument; // Use hostname.log if null
break;
case 'h':
strmake(mysql_real_data_home,argument, sizeof(mysql_real_data_home)-1);
......@@ -3988,9 +3987,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'o':
protocol_version=PROTOCOL_VERSION-1;
break;
case 'P':
mysql_port= (unsigned int) atoi(argument);
break;
case OPT_LOCAL_INFILE:
opt_local_infile= test(!argument || atoi(argument) != 0);
break;
......@@ -4002,24 +3998,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
safemalloc_mem_limit = atoi(argument);
#endif
break;
case OPT_RPL_RECOVERY_RANK:
rpl_recovery_rank=atoi(argument);
break;
case OPT_SLAVE_LOAD_TMPDIR:
slave_load_tmpdir = my_strdup(argument, MYF(MY_FAE));
break;
case OPT_SOCKET:
mysql_unix_port= argument;
break;
case 'r':
mysqld_chroot=argument;
break;
case 't':
mysql_tmpdir=argument;
break;
case 'u':
mysqld_user=argument;
break;
case 'v':
case 'V':
print_version();
......@@ -4037,45 +4015,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case (int) OPT_ISAM_LOG:
opt_myisam_log=1;
if (argument)
myisam_log_filename=argument;
break;
case (int) OPT_UPDATE_LOG:
opt_update_log=1;
opt_update_logname=argument; // Use hostname.# if null
break;
case (int) OPT_RELAY_LOG_INDEX:
opt_relaylog_index_name = argument;
break;
case (int) OPT_RELAY_LOG:
x_free(opt_relay_logname);
if (argument && argument[0])
opt_relay_logname=my_strdup(argument,MYF(0));
break;
case (int) OPT_BIN_LOG_INDEX:
opt_binlog_index_name = argument;
break;
case (int) OPT_BIN_LOG:
opt_bin_log=1;
x_free(opt_bin_logname);
if (argument && argument[0])
opt_bin_logname=my_strdup(argument,MYF(0));
break;
// needs to be handled (as no-op) in non-debugging mode for test suite
case (int)OPT_DISCONNECT_SLAVE_EVENT_COUNT:
#ifndef DBUG_OFF
disconnect_slave_event_count = atoi(argument);
#endif
break;
case (int)OPT_ABORT_SLAVE_EVENT_COUNT:
#ifndef DBUG_OFF
abort_slave_event_count = atoi(argument);
#endif
break;
case (int) OPT_MAX_BINLOG_DUMP_EVENTS:
#ifndef DBUG_OFF
max_binlog_dump_events = atoi(argument);
#endif
break;
case (int) OPT_INIT_RPL_ROLE:
{
......@@ -4197,7 +4142,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
case (int) OPT_SLOW_QUERY_LOG:
opt_slow_log=1;
opt_slow_logname=argument;
break;
case (int)OPT_RECKLESS_SLAVE:
opt_reckless_slave = 1;
......@@ -4297,9 +4241,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case (int) OPT_PID_FILE:
strmake(pidfile_name, argument, sizeof(pidfile_name)-1);
break;
case (int) OPT_INIT_FILE:
opt_init_file=argument;
break;
#ifdef __WIN__
case (int) OPT_STANDALONE: /* Dummy option for NT */
break;
......@@ -4331,7 +4272,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
}
case OPT_SERVER_ID:
server_id = atoi(argument);
server_id_supplied = 1;
break;
case OPT_DELAY_KEY_WRITE:
......@@ -4365,21 +4305,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
}
#ifdef HAVE_BERKELEY_DB
case OPT_BDB_LOG:
berkeley_logdir=argument;
break;
case OPT_BDB_HOME:
berkeley_home=argument;
break;
case OPT_BDB_NOSYNC:
berkeley_env_flags|=DB_TXN_NOSYNC;
break;
case OPT_BDB_NO_RECOVER:
berkeley_init_flags&= ~(DB_RECOVER);
break;
case OPT_BDB_TMP:
berkeley_tmpdir=argument;
break;
case OPT_BDB_LOCK:
{
int type;
......@@ -4420,15 +4351,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
break;
#ifdef HAVE_INNOBASE_DB
case OPT_INNODB_DATA_HOME_DIR:
innobase_data_home_dir=argument;
break;
case OPT_INNODB_LOG_GROUP_HOME_DIR:
innobase_log_group_home_dir=argument;
break;
case OPT_INNODB_LOG_ARCH_DIR:
innobase_log_arch_dir=argument;
break;
case OPT_INNODB_LOG_ARCHIVE:
innobase_log_archive= argument ? test(atoi(argument)) : 1;
break;
......@@ -4438,9 +4360,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case OPT_INNODB_FAST_SHUTDOWN:
innobase_fast_shutdown= argument ? test(atoi(argument)) : 1;
break;
case OPT_INNODB_FLUSH_METHOD:
innobase_unix_file_flush_method=argument;
break;
#endif /* HAVE_INNOBASE_DB */
case OPT_MYISAM_RECOVER:
{
......@@ -4476,48 +4395,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
ISO_READ_COMMITTED);
break;
}
case OPT_MASTER_HOST:
master_host=argument;
break;
case OPT_MASTER_USER:
master_user=argument;
break;
case OPT_MASTER_PASSWORD:
master_password=argument;
break;
case OPT_MASTER_INFO_FILE:
master_info_file=argument;
break;
case OPT_RELAY_LOG_INFO_FILE:
relay_log_info_file=argument;
break;
case OPT_MASTER_PORT:
master_port= atoi(argument);
break;
case OPT_MASTER_SSL_KEY:
master_ssl_key=argument;
break;
case OPT_MASTER_SSL_CERT:
master_ssl_cert=argument;
break;
case OPT_REPORT_HOST:
report_host=argument;
break;
case OPT_REPORT_USER:
report_user=argument;
break;
case OPT_REPORT_PASSWORD:
report_password=argument;
break;
case OPT_REPORT_PORT:
report_port= atoi(argument);
break;
case OPT_MASTER_CONNECT_RETRY:
master_connect_retry= atoi(argument);
break;
case OPT_MASTER_RETRY_COUNT:
master_retry_count= atoi(argument);
break;
case OPT_SKIP_SAFEMALLOC:
#ifdef SAFEMALLOC
sf_malloc_quick=1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment