summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2003-06-18 07:31:23 -0700
committerunknown <igor@rurik.mysql.com>2003-06-18 07:31:23 -0700
commit4d1b1a3266c980d961d33c54416d028279f77d0c (patch)
tree27ab3e463780703cee768e7eca750774895f6cb6 /sql
parent4a83fca1d7fcd5155b45350b90f0f220d3379aa6 (diff)
parenta33ccd9e2f21ab7986a80651b7c3b905550cdba4 (diff)
downloadmariadb-git-4d1b1a3266c980d961d33c54416d028279f77d0c.tar.gz
Merge
BitKeeper/etc/logging_ok: auto-union sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/Makefile.am2
-rw-r--r--sql/client_settings.h19
-rw-r--r--sql/field.h9
-rw-r--r--sql/item_cmpfunc.cc2
-rw-r--r--sql/log.cc4
-rw-r--r--sql/mysql_priv.h4
-rw-r--r--sql/mysqld.cc306
-rw-r--r--sql/protocol.cc25
-rw-r--r--sql/repl_failsafe.cc21
-rw-r--r--sql/set_var.cc4
-rw-r--r--sql/share/charsets/Index.xml4
-rw-r--r--sql/slave.cc49
-rw-r--r--sql/sql_acl.cc14
-rw-r--r--sql/sql_client.cc45
-rw-r--r--sql/sql_insert.cc15
-rw-r--r--sql/sql_parse.cc1
-rw-r--r--sql/sql_select.cc5
-rw-r--r--sql/sql_yacc.yy6
18 files changed, 287 insertions, 248 deletions
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 7c98f1a9315..fd02cc906d7 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -84,7 +84,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
slave.cc sql_repl.cc sql_union.cc sql_derived.cc \
- client.c mini_client_errors.c pack.c\
+ client.c sql_client.cc mini_client_errors.c pack.c\
stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc\
gstream.cc spatial.cc sql_help.cc protocol_cursor.cc
gen_lex_hash_SOURCES = gen_lex_hash.cc
diff --git a/sql/client_settings.h b/sql/client_settings.h
index 1963281d980..efae3f18a8b 100644
--- a/sql/client_settings.h
+++ b/sql/client_settings.h
@@ -17,18 +17,17 @@
#include <thr_alarm.h>
-extern char *mysql_unix_port;
-
-#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG \
- | CLIENT_LOCAL_FILES | CLIENT_SECURE_CONNECTION)
-
+#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
+ CLIENT_SECURE_CONNECTION | CLIENT_TRANSACTIONS | \
+ CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
#define init_sigpipe_variables
#define set_sigpipe(mysql)
#define reset_sigpipe(mysql)
-
-extern ulong slave_net_timeout;
-
-#ifdef HAVE_SMEM
+#define read_user_name(A) {}
+#define mysql_rpl_query_type(A,B) MYSQL_RPL_ADMIN
+#define mysql_master_send_query(A, B, C) 1
+#define mysql_slave_send_query(A, B, C) 1
+#define mysql_rpl_probe(mysql) 0
#undef HAVE_SMEM
-#endif
+#undef _CUSTOMCONFIG_
diff --git a/sql/field.h b/sql/field.h
index a1f19638658..a72ccfa8354 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -50,7 +50,7 @@ public:
LEX_STRING comment;
ulong query_id; // For quick test of used fields
/* Field is part of the following keys */
- key_map key_start,part_of_key,part_of_sortkey;
+ key_map key_start,part_of_key,part_of_sortkey;
enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL,
CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD,
BIT_FIELD, TIMESTAMP_FIELD,CAPITALIZE,BLOB_FIELD};
@@ -134,6 +134,7 @@ public:
virtual void sort_string(char *buff,uint length)=0;
virtual bool optimize_range(uint idx);
virtual bool store_for_compare() { return 0; }
+ virtual void free() {}
Field *new_field(MEM_ROOT *root, struct st_table *new_table)
{
Field *tmp= (Field*) memdup_root(root,(char*) this,size_of());
@@ -937,11 +938,11 @@ public:
int pack_cmp(const char *b, uint key_length);
uint packed_col_length(const char *col_ptr, uint length);
uint max_packed_col_length(uint max_length);
- inline void free() { value.free(); }
+ void free() { value.free(); }
inline void clear_temporary() { bzero((char*) &value,sizeof(value)); }
friend void field_conv(Field *to,Field *from);
uint size_of() const { return sizeof(*this); }
- bool has_charset(void) const
+ bool has_charset(void) const
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
};
@@ -949,7 +950,7 @@ public:
class Field_geom :public Field_blob {
public:
enum geometry_type geom_type;
-
+
Field_geom(char *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,uint blob_pack_length,
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 74036edf605..d4997f78a9e 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1652,7 +1652,9 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
List_iterator<Item> li(list);
Item *item;
+#ifndef EMBEDDED_LIBRARY
char buff[sizeof(char*)]; // Max local vars in function
+#endif
used_tables_cache=0;
const_item_cache=0;
diff --git a/sql/log.cc b/sql/log.cc
index 223df51d07f..dd544dcac93 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -209,9 +209,9 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
#ifdef EMBEDDED_LIBRARY
sprintf(buff, "%s, Version: %s, embedded library\n", my_progname, server_version);
#elif __NT__
- sprintf(buff, "%s, Version: %s, started with:\nTCP Port: %d, Named Pipe: %s\n", my_progname, server_version, mysql_port, mysql_unix_port);
+ sprintf(buff, "%s, Version: %s, started with:\nTCP Port: %d, Named Pipe: %s\n", my_progname, server_version, mysqld_port, mysqld_unix_port);
#else
- sprintf(buff, "%s, Version: %s, started with:\nTcp port: %d Unix socket: %s\n", my_progname,server_version,mysql_port,mysql_unix_port);
+ sprintf(buff, "%s, Version: %s, started with:\nTcp port: %d Unix socket: %s\n", my_progname,server_version,mysqld_port,mysqld_unix_port);
#endif
end=strmov(strend(buff),"Time Id Command Argument\n");
if (my_b_write(&log_file, (byte*) buff,(uint) (end-buff)) ||
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 345f44492bc..aca84f1bcb3 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -737,7 +737,7 @@ extern ulong specialflag, current_pid;
extern ulong expire_logs_days;
extern my_bool relay_log_purge;
extern uint test_flags,select_errors,ha_open_options;
-extern uint protocol_version,dropping_tables;
+extern uint protocol_version, mysqld_port, dropping_tables;
extern uint delay_key_write_options;
extern bool opt_endinfo, using_udf_functions, locked_in_memory;
extern bool opt_using_transactions, mysql_embedded;
@@ -752,7 +752,7 @@ extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern my_bool opt_readonly;
extern my_bool opt_enable_named_pipe;
extern my_bool opt_old_passwords, use_old_passwords;
-extern char *shared_memory_base_name;
+extern char *shared_memory_base_name, *mysqld_unix_port;
extern bool opt_enable_shared_memory;
extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 7c36a02f751..68fa0cca2d5 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -35,6 +35,7 @@
#include <nisam.h>
#include <thr_alarm.h>
#include <ft_global.h>
+#include <errmsg.h>
#define mysqld_charset &my_charset_latin1
@@ -254,7 +255,7 @@ my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam;
my_bool opt_readonly, use_temp_pool, relay_log_purge;
volatile bool mqh_used = 0;
-uint mysql_port, test_flags, select_errors, dropping_tables, ha_open_options;
+uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options;
uint delay_key_write_options, protocol_version;
uint volatile thread_count, thread_running, kill_cached_threads, wake_thread;
@@ -303,7 +304,7 @@ char mysql_real_data_home[FN_REFLEN],
char *language_ptr, *default_collation_name, *default_character_set_name;
char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
char server_version[SERVER_VERSION_LENGTH]=MYSQL_SERVER_VERSION;
-char *mysql_unix_port, *opt_mysql_tmpdir;
+char *mysqld_unix_port, *opt_mysql_tmpdir;
char *my_bind_addr_str;
const char **errmesg; /* Error messages */
const char *myisam_recover_options_str="OFF";
@@ -561,7 +562,7 @@ static void close_connections(void)
{
(void) shutdown(unix_sock,2);
(void) closesocket(unix_sock);
- (void) unlink(mysql_unix_port);
+ (void) unlink(mysqld_unix_port);
unix_sock= INVALID_SOCKET;
}
#endif
@@ -670,7 +671,7 @@ static void close_server_sock()
DBUG_PRINT("info",("calling closesocket on unix/IP socket"));
VOID(closesocket(tmp_sock));
#endif
- VOID(unlink(mysql_unix_port));
+ VOID(unlink(mysqld_unix_port));
}
DBUG_VOID_RETURN;
#endif
@@ -961,24 +962,24 @@ static void clean_up_mutexes()
static void set_ports()
{
char *env;
- if (!mysql_port && !opt_disable_networking)
+ if (!mysqld_port && !opt_disable_networking)
{ // Get port if not from commandline
struct servent *serv_ptr;
- mysql_port = MYSQL_PORT;
- if ((serv_ptr = getservbyname("mysql", "tcp")))
- mysql_port = ntohs((u_short) serv_ptr->s_port); /* purecov: inspected */
+ mysqld_port= MYSQL_PORT;
+ if ((serv_ptr= getservbyname("mysql", "tcp")))
+ mysqld_port= ntohs((u_short) serv_ptr->s_port); /* purecov: inspected */
if ((env = getenv("MYSQL_TCP_PORT")))
- mysql_port = (uint) atoi(env); /* purecov: inspected */
+ mysqld_port= (uint) atoi(env); /* purecov: inspected */
}
- if (!mysql_unix_port)
+ if (!mysqld_unix_port)
{
#ifdef __WIN__
- mysql_unix_port = (char*) MYSQL_NAMEDPIPE;
+ mysqld_unix_port= (char*) MYSQL_NAMEDPIPE;
#else
- mysql_unix_port = (char*) MYSQL_UNIX_ADDR;
+ mysqld_unix_port= (char*) MYSQL_UNIX_ADDR;
#endif
if ((env = getenv("MYSQL_UNIX_PORT")))
- mysql_unix_port = env; /* purecov: inspected */
+ mysqld_unix_port= env; /* purecov: inspected */
}
}
@@ -1088,9 +1089,9 @@ static void server_init(void)
set_ports();
- if (mysql_port != 0 && !opt_disable_networking && !opt_bootstrap)
+ if (mysqld_port != 0 && !opt_disable_networking && !opt_bootstrap)
{
- DBUG_PRINT("general",("IP Socket is %d",mysql_port));
+ DBUG_PRINT("general",("IP Socket is %d",mysqld_port));
ip_sock = socket(AF_INET, SOCK_STREAM, 0);
if (ip_sock == INVALID_SOCKET)
{
@@ -1101,14 +1102,14 @@ static void server_init(void)
bzero((char*) &IPaddr, sizeof(IPaddr));
IPaddr.sin_family = AF_INET;
IPaddr.sin_addr.s_addr = my_bind_addr;
- IPaddr.sin_port = (unsigned short) htons((unsigned short) mysql_port);
+ IPaddr.sin_port = (unsigned short) htons((unsigned short) mysqld_port);
(void) setsockopt(ip_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,sizeof(arg));
if (bind(ip_sock, my_reinterpret_cast(struct sockaddr *) (&IPaddr),
sizeof(IPaddr)) < 0)
{
DBUG_PRINT("error",("Got error: %d from bind",socket_errno));
sql_perror("Can't start server: Bind on TCP/IP port");
- sql_print_error("Do you already have another mysqld server running on port: %d ?",mysql_port);
+ sql_print_error("Do you already have another mysqld server running on port: %d ?",mysqld_port);
unireg_abort(1);
}
if (listen(ip_sock,(int) back_log) < 0)
@@ -1123,10 +1124,10 @@ static void server_init(void)
#ifdef __NT__
/* create named pipe */
- if (Service.IsNT() && mysql_unix_port[0] && !opt_bootstrap &&
+ if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
opt_enable_named_pipe)
{
- sprintf(szPipeName, "\\\\.\\pipe\\%s", mysql_unix_port );
+ sprintf(szPipeName, "\\\\.\\pipe\\%s", mysqld_unix_port );
ZeroMemory( &saPipeSecurity, sizeof(saPipeSecurity) );
ZeroMemory( &sdPipeDescriptor, sizeof(sdPipeDescriptor) );
if ( !InitializeSecurityDescriptor(&sdPipeDescriptor,
@@ -1172,9 +1173,9 @@ static void server_init(void)
/*
** Create the UNIX socket
*/
- if (mysql_unix_port[0] && !opt_bootstrap)
+ if (mysqld_unix_port[0] && !opt_bootstrap)
{
- DBUG_PRINT("general",("UNIX Socket is %s",mysql_unix_port));
+ DBUG_PRINT("general",("UNIX Socket is %s",mysqld_unix_port));
if ((unix_sock= socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
{
@@ -1183,8 +1184,8 @@ static void server_init(void)
}
bzero((char*) &UNIXaddr, sizeof(UNIXaddr));
UNIXaddr.sun_family = AF_UNIX;
- strmov(UNIXaddr.sun_path, mysql_unix_port);
- (void) unlink(mysql_unix_port);
+ strmov(UNIXaddr.sun_path, mysqld_unix_port);
+ (void) unlink(mysqld_unix_port);
(void) setsockopt(unix_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,
sizeof(arg));
umask(0);
@@ -1192,12 +1193,12 @@ static void server_init(void)
sizeof(UNIXaddr)) < 0)
{
sql_perror("Can't start server : Bind on unix socket"); /* purecov: tested */
- sql_print_error("Do you already have another mysqld server running on socket: %s ?",mysql_unix_port);
+ sql_print_error("Do you already have another mysqld server running on socket: %s ?",mysqld_unix_port);
unireg_abort(1); /* purecov: tested */
}
umask(((~my_umask) & 0666));
#if defined(S_IFSOCK) && defined(SECURE_SOCKETS)
- (void) chmod(mysql_unix_port,S_IFSOCK); /* Fix solaris 2.6 bug */
+ (void) chmod(mysqld_unix_port,S_IFSOCK); /* Fix solaris 2.6 bug */
#endif
if (listen(unix_sock,(int) back_log) < 0)
sql_print_error("Warning: listen() on Unix socket failed with error %d",
@@ -2024,6 +2025,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
#endif
unireg_init(opt_specialflag); /* Set up extern variabels */
init_errmessage(); /* Read error messages from file */
+ init_client_errs();
lex_init();
item_init();
set_var_init();
@@ -2426,7 +2428,7 @@ The server will not act as a slave.");
(void) my_delete(pidfile_name,MYF(MY_WME)); // Not needed anymore
#endif
if (unix_sock != INVALID_SOCKET)
- unlink(mysql_unix_port);
+ unlink(mysqld_unix_port);
exit(1);
}
if (!opt_noacl)
@@ -2458,8 +2460,8 @@ The server will not act as a slave.");
create_maintenance_thread();
printf(ER(ER_READY),my_progname,server_version,
- ((unix_sock == INVALID_SOCKET) ? (char*) "" : mysql_unix_port),
- mysql_port);
+ ((unix_sock == INVALID_SOCKET) ? (char*) "" : mysqld_unix_port),
+ mysqld_port);
fflush(stdout);
#if defined(__NT__) || defined(HAVE_SMEM)
@@ -3464,108 +3466,108 @@ enum options
struct my_option my_long_options[] =
{
- {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax", 0, 0, 0,
+ {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"basedir", 'b',
"Path to installation directory. All paths are usually resolved relative to this.",
(gptr*) &mysql_home_ptr, (gptr*) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef HAVE_BERKELEY_DB
- {"bdb-home", OPT_BDB_HOME, "Berkeley home directory", (gptr*) &berkeley_home,
+ {"bdb-home", OPT_BDB_HOME, "Berkeley home directory.", (gptr*) &berkeley_home,
(gptr*) &berkeley_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"bdb-lock-detect", OPT_BDB_LOCK,
- "Berkeley lock detect (DEFAULT, OLDEST, RANDOM or YOUNGEST, # sec)",
+ "Berkeley lock detect (DEFAULT, OLDEST, RANDOM or YOUNGEST, # sec).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"bdb-logdir", OPT_BDB_LOG, "Berkeley DB log file directory",
+ {"bdb-logdir", OPT_BDB_LOG, "Berkeley DB log file directory.",
(gptr*) &berkeley_logdir, (gptr*) &berkeley_logdir, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"bdb-no-recover", OPT_BDB_NO_RECOVER,
- "Don't try to recover Berkeley DB tables on start", 0, 0, 0, GET_NO_ARG,
+ "Don't try to recover Berkeley DB tables on start.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"bdb-no-sync", OPT_BDB_NOSYNC, "Don't synchronously flush logs", 0, 0, 0,
+ {"bdb-no-sync", OPT_BDB_NOSYNC, "Don't synchronously flush logs.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"bdb-shared-data", OPT_BDB_SHARED,
- "Start Berkeley DB in multi-process mode", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
+ "Start Berkeley DB in multi-process mode.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
- {"bdb-tmpdir", OPT_BDB_TMP, "Berkeley DB tempfile name",
+ {"bdb-tmpdir", OPT_BDB_TMP, "Berkeley DB tempfile name.",
(gptr*) &berkeley_tmpdir, (gptr*) &berkeley_tmpdir, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_BERKELEY_DB */
{"bdb", OPT_BDB, "Enable Berkeley DB (if this version of MySQL supports it). \
-Disable with --skip-bdb (will save memory)",
+Disable with --skip-bdb (will save memory).",
(gptr*) &opt_bdb, (gptr*) &opt_bdb, 0, GET_BOOL, NO_ARG, 1, 0, 0,
0, 0, 0},
{"big-tables", OPT_BIG_TABLES,
- "Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors)",
+ "Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"binlog-do-db", OPT_BINLOG_DO_DB,
"Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binlog-ignore-db", OPT_BINLOG_IGNORE_DB,
- "Tells the master that updates to the given database should not be logged tothe binary log",
+ "Tells the master that updates to the given database should not be logged tothe binary log.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"bind-address", OPT_BIND_ADDRESS, "IP address to bind to",
+ {"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.",
(gptr*) &my_bind_addr_str, (gptr*) &my_bind_addr_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts", 0, 0, 0,
+ {"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"console", OPT_CONSOLE, "Write error output on screen; Don't remove the console window on windows",
+ {"console", OPT_CONSOLE, "Write error output on screen; Don't remove the console window on windows.",
(gptr*) &opt_console, (gptr*) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
#ifdef __WIN__
{"standalone", OPT_STANDALONE,
- "Dummy option to start as a standalone program (NT)", 0, 0, 0, GET_NO_ARG,
+ "Dummy option to start as a standalone program (NT).", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"core-file", OPT_WANT_CORE, "Write core on errors", 0, 0, 0, GET_NO_ARG,
+ {"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"chroot", 'r', "Chroot mysqld daemon during startup.",
(gptr*) &mysqld_chroot, (gptr*) &mysqld_chroot, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are", (gptr*) &charsets_dir,
+ "Directory where character sets are.", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"datadir", 'h', "Path to the database root", (gptr*) &mysql_data_home,
+ {"datadir", 'h', "Path to the database root.", (gptr*) &mysql_data_home,
(gptr*) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
{"debug", '#', "Debug log.", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef SAFEMALLOC
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
- "Don't use the memory allocation checking", 0, 0, 0, GET_NO_ARG, NO_ARG,
+ "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
#endif
#ifdef HAVE_OPENSSL
{"des-key-file", OPT_DES_KEY_FILE,
- "Load keys for des_encrypt() and des_encrypt from given file",
+ "Load keys for des_encrypt() and des_encrypt from given file.",
(gptr*) &des_key_file, (gptr*) &des_key_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif /* HAVE_OPENSSL */
- {"default-character-set", 'C', "Set the default character set",
- (gptr*) &default_character_set_name, (gptr*) &default_character_set_name,
+ {"default-character-set", 'C', "Set the default character set.",
+ (gptr*) &default_character_set_name, (gptr*) &default_character_set_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"default-collation", OPT_DEFAULT_COLLATION, "Set the default collation",
+ {"default-collation", OPT_DEFAULT_COLLATION, "Set the default collation.",
(gptr*) &default_collation_name, (gptr*) &default_collation_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"default-table-type", OPT_TABLE_TYPE,
- "Set the default table type for tables", 0, 0,
+ "Set the default table type for tables.", 0, 0,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE",
+ {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE.",
0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL,
- "Don't flush key buffers between writes for any MyISAM table (Deprecated option, use --delay-key-write=all instead)",
+ "Don't flush key buffers between writes for any MyISAM table (Deprecated option, use --delay-key-write=all instead).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"enable-locking", OPT_ENABLE_LOCK,
- "Deprecated option, use --external-locking instead",
+ "Deprecated option, use --external-locking instead.",
(gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __NT__
- {"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT)",
+ {"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).",
(gptr*) &opt_enable_named_pipe, (gptr*) &opt_enable_named_pipe, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"enable-pstack", OPT_DO_PSTACK, "Print a symbolic stack trace on failure",
+ {"enable-pstack", OPT_DO_PSTACK, "Print a symbolic stack trace on failure.",
(gptr*) &opt_do_pstack, (gptr*) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
#ifdef HAVE_SMEM
@@ -3575,23 +3577,23 @@ Disable with --skip-bdb (will save memory)",
#endif
{"exit-info", 'T', "Used for debugging; Use at your own risk!", 0, 0, 0,
GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"flush", OPT_FLUSH, "Flush tables to disk between SQL commands", 0, 0, 0,
+ {"flush", OPT_FLUSH, "Flush tables to disk between SQL commands.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN,
"The maximum length of the result of function group_concat.",
- (gptr*) &global_system_variables.group_concat_max_len,
+ (gptr*) &global_system_variables.group_concat_max_len,
(gptr*) &max_system_variables.group_concat_max_len, 0, GET_ULONG,
REQUIRED_ARG, 1024, 4, (long) ~0, 0, 1, 0},
/* We must always support the next option to make scripts like mysqltest
easier to do */
- {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role", 0, 0, 0,
+ {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"innodb_data_file_path", OPT_INNODB_DATA_FILE_PATH,
- "Path to individual files and their sizes",
+ "Path to individual files and their sizes.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_INNOBASE_DB
{"innodb_data_home_dir", OPT_INNODB_DATA_HOME_DIR,
- "The common part for Innodb table spaces", (gptr*) &innobase_data_home_dir,
+ "The common part for Innodb table spaces.", (gptr*) &innobase_data_home_dir,
(gptr*) &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"innodb_log_group_home_dir", OPT_INNODB_LOG_GROUP_HOME_DIR,
@@ -3599,53 +3601,52 @@ Disable with --skip-bdb (will save memory)",
(gptr*) &innobase_log_group_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"innodb_log_arch_dir", OPT_INNODB_LOG_ARCH_DIR,
- "Where full logs should be archived", (gptr*) &innobase_log_arch_dir,
+ "Where full logs should be archived.", (gptr*) &innobase_log_arch_dir,
(gptr*) &innobase_log_arch_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"innodb_log_archive", OPT_INNODB_LOG_ARCHIVE,
- "Set to 1 if you want to have logs archived", 0, 0, 0, GET_LONG, OPT_ARG,
+ "Set to 1 if you want to have logs archived.", 0, 0, 0, GET_LONG, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"innodb_flush_log_at_trx_commit", OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
- "Set to 0 (write and flush once per second), 1 (write and flush at each commit) or 2 (write at commit, flush once per second)",
+ "Set to 0 (write and flush once per second), 1 (write and flush at each commit) or 2 (write at commit, flush once per second).",
(gptr*) &innobase_flush_log_at_trx_commit,
(gptr*) &innobase_flush_log_at_trx_commit,
0, GET_UINT, OPT_ARG, 1, 0, 2, 0, 0, 0},
{"innodb_flush_method", OPT_INNODB_FLUSH_METHOD,
- "With which method to flush data", (gptr*) &innobase_unix_file_flush_method,
+ "With which method to flush data.", (gptr*) &innobase_unix_file_flush_method,
(gptr*) &innobase_unix_file_flush_method, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"innodb_fast_shutdown", OPT_INNODB_FAST_SHUTDOWN,
- "Speeds up server shutdown process", (gptr*) &innobase_fast_shutdown,
+ "Speeds up server shutdown process.", (gptr*) &innobase_fast_shutdown,
(gptr*) &innobase_fast_shutdown, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT,
- "Percentage of dirty pages allowed in bufferpool", (gptr*) &srv_max_buf_pool_modified_pct,
+ "Percentage of dirty pages allowed in bufferpool.", (gptr*) &srv_max_buf_pool_modified_pct,
(gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0},
-
#endif /* End HAVE_INNOBASE_DB */
- {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
+ {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
- {"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup",
+ {"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup.",
(gptr*) &opt_init_file, (gptr*) &opt_init_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
- {"log", 'l', "Log connections and queries to file", (gptr*) &opt_logname,
+ {"log", 'l', "Log connections and queries to file.", (gptr*) &opt_logname,
(gptr*) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"language", 'L',
- "Client error messages in given language. May be given as a full path",
+ "Client error messages in given language. May be given as a full path.",
(gptr*) &language_ptr, (gptr*) &language_ptr, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"local-infile", OPT_LOCAL_INFILE,
- "Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0)",
+ "Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0).",
(gptr*) &opt_local_infile,
(gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
1, 0, 0, 0, 0, 0},
{"log-bin", OPT_BIN_LOG,
- "Log update queries in binary format",
+ "Log update queries in binary format.",
(gptr*) &opt_bin_logname, (gptr*) &opt_bin_logname, 0, GET_STR_ALLOC,
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",
+ "File that holds the names for last binary log files.",
(gptr*) &opt_binlog_index_name, (gptr*) &opt_binlog_index_name, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file",
+ {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.",
(gptr*) &myisam_log_filename, (gptr*) &myisam_log_filename, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-update", OPT_UPDATE_LOG,
@@ -3653,18 +3654,18 @@ Disable with --skip-bdb (will save memory)",
(gptr*) &opt_update_logname, (gptr*) &opt_update_logname, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-slow-queries", OPT_SLOW_QUERY_LOG,
- "Log slow queries to this log file. Defaults logging to hostname-slow.log",
+ "Log slow queries to this log file. Defaults logging to hostname-slow.log file.",
(gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"log-long-format", OPT_LONG_FORMAT,
- "Log some extra information to update log", 0, 0, 0, GET_NO_ARG, NO_ARG,
+ "Log some extra information to update log.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"log-slave-updates", OPT_LOG_SLAVE_UPDATES,
"Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.",
(gptr*) &opt_log_slave_updates, (gptr*) &opt_log_slave_updates, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"low-priority-updates", OPT_LOW_PRIORITY_UPDATES,
- "INSERT/DELETE/UPDATE has lower priority than selects",
+ "INSERT/DELETE/UPDATE has lower priority than selects.",
(gptr*) &global_system_variables.low_priority_updates,
(gptr*) &max_system_variables.low_priority_updates,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -3680,7 +3681,7 @@ Disable with --skip-bdb (will save memory)",
"The password the slave thread will authenticate with when connecting to the master. If not set, an empty password is assumed.The value in master.info will take precedence if it can be read.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"master-port", OPT_MASTER_PORT,
- "The port the master is listening on. If not set, the compiled setting of MYSQL_PORT is assumed. If you have not tinkered with configure options, this should be 3306. The value in master.info will take precedence if it can be read",
+ "The port the master is listening on. If not set, the compiled setting of MYSQL_PORT is assumed. If you have not tinkered with configure options, this should be 3306. The value in master.info will take precedence if it can be read.",
(gptr*) &master_port, (gptr*) &master_port, 0, GET_UINT, REQUIRED_ARG,
MYSQL_PORT, 0, 0, 0, 0, 0},
{"master-connect-retry", OPT_MASTER_CONNECT_RETRY,
@@ -3724,61 +3725,61 @@ Does nothing yet.",
"Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP or FORCE.",
(gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"memlock", OPT_MEMLOCK, "Lock mysqld in memory", (gptr*) &locked_in_memory,
+ {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (gptr*) &locked_in_memory,
(gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
{"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT,
- "Option used by mysql-test for debugging and testing of replication",
+ "Option used by mysql-test for debugging and testing of replication.",
(gptr*) &disconnect_slave_event_count,
(gptr*) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT,
- "Option used by mysql-test for debugging and testing of replication",
+ "Option used by mysql-test for debugging and testing of replication.",
(gptr*) &abort_slave_event_count, (gptr*) &abort_slave_event_count,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS,
- "Option used by mysql-test for debugging and testing of replication",
+ "Option used by mysql-test for debugging and testing of replication.",
(gptr*) &max_binlog_dump_events, (gptr*) &max_binlog_dump_events, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"sporadic-binlog-dump-fail", OPT_SPORADIC_BINLOG_DUMP_FAIL,
- "Option used by mysql-test for debugging and testing of replication",
+ "Option used by mysql-test for debugging and testing of replication.",
(gptr*) &opt_sporadic_binlog_dump_fail,
(gptr*) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
#endif /* HAVE_REPLICATION */
{"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT,
- "Simulate memory shortage when compiled with the --with-debug=full option",
+ "Simulate memory shortage when compiled with the --with-debug=full option.",
0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"new", 'n', "Use very new possible 'unsafe' functions",
+ {"new", 'n', "Use very new possible 'unsafe' functions.",
(gptr*) &global_system_variables.new_mode,
(gptr*) &max_system_variables.new_mode,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef NOT_YET
- {"no-mix-table-types", OPT_NO_MIX_TYPE, "Don't allow commands with uses two different table types",
+ {"no-mix-table-types", OPT_NO_MIX_TYPE, "Don't allow commands with uses two different table types.",
(gptr*) &opt_no_mix_types, (gptr*) &opt_no_mix_types, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
- {"old-protocol", 'o', "Use the old (3.20) protocol client/server protocol",
+ {"old-protocol", 'o', "Use the old (3.20) protocol client/server protocol.",
(gptr*) &protocol_version, (gptr*) &protocol_version, 0, GET_UINT, NO_ARG,
PROTOCOL_VERSION, 0, 0, 0, 0, 0},
{"old-rpl-compat", OPT_OLD_RPL_COMPAT,
- "Use old LOAD DATA format in the binary log (don't save data in file)",
+ "Use old LOAD DATA format in the binary log (don't save data in file).",
(gptr*) &opt_old_rpl_compat, (gptr*) &opt_old_rpl_compat, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef ONE_THREAD
{"one-thread", OPT_ONE_THREAD,
- "Only use one thread (for debugging under Linux)", 0, 0, 0, GET_NO_ARG,
+ "Only use one thread (for debugging under Linux).", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld",
+ {"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.",
(gptr*) &pidfile_name_ptr, (gptr*) &pidfile_name_ptr, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"log-error", OPT_ERROR_LOG_FILE, "Log error file",
+ {"log-error", OPT_ERROR_LOG_FILE, "Log error file.",
(gptr*) &log_error_file_ptr, (gptr*) &log_error_file_ptr, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection.", (gptr*) &mysql_port,
- (gptr*) &mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"reckless-slave", OPT_RECKLESS_SLAVE, "For debugging", 0, 0, 0, GET_NO_ARG,
+ {"port", 'P', "Port number to use for connection.", (gptr*) &mysqld_port,
+ (gptr*) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"reckless-slave", OPT_RECKLESS_SLAVE, "Used for debugging.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"replicate-do-db", OPT_REPLICATE_DO_DB,
"Tells the slave thread to restrict replication to the specified database. To specify more than one database, use the directive multiple times, once for each database. Note that this will only work if you do not use cross-database queries such as UPDATE some_db.some_table SET foo='bar' while having selected a different or no database. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-do-table=db_name.%.",
@@ -3787,7 +3788,7 @@ Does nothing yet.",
"Tells the slave thread to restrict replication to the specified table. To specify more than one table, use the directive multiple times, once for each table. This will work for cross-database updates, in contrast to replicate-do-db.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replicate-wild-do-table", OPT_REPLICATE_WILD_DO_TABLE,
- "Tells the slave thread to restrict replication to the tables that match the specified wildcard pattern. To specify more than one table, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-do-table=foo%.bar% will replicate only updates to tables in all databases that start with foo and whose table names start with bar",
+ "Tells the slave thread to restrict replication to the tables that match the specified wildcard pattern. To specify more than one table, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-do-table=foo%.bar% will replicate only updates to tables in all databases that start with foo and whose table names start with bar.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replicate-ignore-db", OPT_REPLICATE_IGNORE_DB,
"Tells the slave thread to not replicate to the specified database. To specify more than one database to ignore, use the directive multiple times, once for each database. This option will not work if you use cross database updates. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-ignore-table=db_name.%. ",
@@ -3799,37 +3800,37 @@ Does nothing yet.",
"Tells the slave thread to not replicate to the tables that match the given wildcard pattern. To specify more than one table to ignore, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-ignore-table=foo%.bar% will not do updates to tables in databases that start with foo and whose table names start with bar.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replicate-rewrite-db", OPT_REPLICATE_REWRITE_DB,
- "Updates to a database with a different name than the original. Example: replicate-rewrite-db=master_db_name->slave_db_name",
+ "Updates to a database with a different name than the original. Example: replicate-rewrite-db=master_db_name->slave_db_name.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
// In replication, we may need to tell the other servers how to connect
{"report-host", OPT_REPORT_HOST,
"Hostname or IP of the slave to be reported to to the master during slave registration. Will appear in the output of SHOW SLAVE HOSTS. Leave unset if you do not want the slave to register itself with the master. Note that it is not sufficient for the master to simply read the IP of the slave off the socket once the slave connects. Due to NAT and other routing issues, that IP may not be valid for connecting to the slave from the master or other hosts.",
(gptr*) &report_host, (gptr*) &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
0, 0, 0, 0},
- {"report-user", OPT_REPORT_USER, "Undocumented", (gptr*) &report_user,
+ {"report-user", OPT_REPORT_USER, "Undocumented.", (gptr*) &report_user,
(gptr*) &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"report-password", OPT_REPORT_PASSWORD, "Undocumented",
+ {"report-password", OPT_REPORT_PASSWORD, "Undocumented.",
(gptr*) &report_password, (gptr*) &report_password, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"report-port", OPT_REPORT_PORT,
"Port for connecting to slave reported to the master during slave registration. Set it only if the slave is listening on a non-default port or if you have a special tunnel from the master or other clients to the slave. If not sure, leave this option unset.",
(gptr*) &report_port, (gptr*) &report_port, 0, GET_UINT, REQUIRED_ARG,
MYSQL_PORT, 0, 0, 0, 0, 0},
- {"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented",
+ {"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented.",
(gptr*) &rpl_recovery_rank, (gptr*) &rpl_recovery_rank, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"relay-log", OPT_RELAY_LOG,
- "The location and name to use for relay logs",
+ {"relay-log", OPT_RELAY_LOG,
+ "The location and name to use for relay logs.",
(gptr*) &opt_relay_logname, (gptr*) &opt_relay_logname, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"relay-log-index", OPT_RELAY_LOG_INDEX,
+ {"relay-log-index", OPT_RELAY_LOG_INDEX,
"The location and name to use for the file that keeps a list of the last \
-relay logs",
+relay logs.",
(gptr*) &opt_relaylog_index_name, (gptr*) &opt_relaylog_index_name, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"old-passwords", OPT_OLD_PASSWORDS, "Use old password encryption method (needed for 4.0 and older clients)",
+ {"old-passwords", OPT_OLD_PASSWORDS, "Use old password encryption method (needed for 4.0 and older clients).",
(gptr*) &opt_old_passwords, (gptr*) &opt_old_passwords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef TO_BE_DELETED
{"safe-show-database", OPT_SAFE_SHOW_DB,
@@ -3837,11 +3838,11 @@ relay logs",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"safe-user-create", OPT_SAFE_USER_CREATE,
- "Don't allow new user creation by the user who has no write privileges to the mysql.user table",
+ "Don't allow new user creation by the user who has no write privileges to the mysql.user table.",
(gptr*) &opt_safe_user_create, (gptr*) &opt_safe_user_create, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"server-id", OPT_SERVER_ID,
- "Uniquely identifies the server instance in the community of replication partners",
+ "Uniquely identifies the server instance in the community of replication partners.",
(gptr*) &server_id, (gptr*) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"set-variable", 'O',
@@ -3849,15 +3850,15 @@ relay logs",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name",OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
+ "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO,
- "Show user and password in SHOW SLAVE STATUS",
+ "Show user and password in SHOW SLAVE STATUS.",
(gptr*) &opt_show_slave_auth_info, (gptr*) &opt_show_slave_auth_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"concurrent-insert", OPT_CONCURRENT_INSERT,
- "Use concurrent insert with MyISAM. Disable with prefix --skip-",
+ "Use concurrent insert with MyISAM. Disable with --skip-concurrent-insert.",
(gptr*) &myisam_concurrent_insert, (gptr*) &myisam_concurrent_insert,
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-grant-tables", OPT_SKIP_GRANT,
@@ -3865,20 +3866,20 @@ relay logs",
(gptr*) &opt_noacl, (gptr*) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
{"innodb", OPT_INNODB, "Enable InnoDB (if this version of MySQL supports it). \
-Disable with --skip-innodb (will save memory)",
+Disable with --skip-innodb (will save memory).",
(gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, 1, 0, 0,
0, 0, 0},
{"isam", OPT_ISAM, "Enable isam (if this version of MySQL supports it). \
-Disable with --skip-isam",
+Disable with --skip-isam.",
(gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, 1, 0, 0,
0, 0, 0},
{"skip-locking", OPT_SKIP_LOCK,
- "Deprecated option, use --skip-external-locking instead",
+ "Deprecated option, use --skip-external-locking instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names", 0, 0, 0,
+ {"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-name-resolve", OPT_SKIP_RESOLVE,
- "Don't resolve hostnames. All hostnames are IP's or 'localhost'",
+ "Don't resolve hostnames. All hostnames are IP's or 'localhost'.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-networking", OPT_SKIP_NETWORKING,
"Don't allow connection with TCP/IP.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0,
@@ -3886,36 +3887,36 @@ Disable with --skip-isam",
{"skip-new", OPT_SKIP_NEW, "Don't use new, possible wrong routines.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-show-database", OPT_SKIP_SHOW_DB,
- "Don't allow 'SHOW DATABASE' commands", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
+ "Don't allow 'SHOW DATABASE' commands.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
{"skip-slave-start", OPT_SKIP_SLAVE_START,
"If set, slave is not autostarted.", (gptr*) &opt_skip_slave_start,
(gptr*) &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-stack-trace", OPT_SKIP_STACK_TRACE,
- "Don't print a stack trace on failure", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
+ "Don't print a stack trace on failure.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
- {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Depricated option. Use --skip-symbolic-links instead",
+ {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Depricated option. Use --skip-symbolic-links instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-thread-priority", OPT_SKIP_PRIOR,
"Don't give threads different priorities.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
- {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE,
+ {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE,
"The location and name of the file that remembers where the SQL replication \
-thread is in the relay logs",
+thread is in the relay logs.",
(gptr*) &relay_log_info_file, (gptr*) &relay_log_info_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
- {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
+ {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
"The location where the slave should put its temporary files when \
-replicating a LOAD DATA INFILE command",
+replicating a LOAD DATA INFILE command.",
(gptr*) &slave_load_tmpdir, (gptr*) &slave_load_tmpdir, 0, GET_STR_ALLOC,
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",
+ "Tells the slave thread to continue replication when a query returns an error from the provided list.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"socket", OPT_SOCKET, "Socket file to use for connection",
- (gptr*) &mysql_unix_port, (gptr*) &mysql_unix_port, 0, GET_STR,
+ {"socket", OPT_SOCKET, "Socket file to use for connection.",
+ (gptr*) &mysqld_unix_port, (gptr*) &mysqld_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME,
"If set, setting SQL_LOG_BIN to a value will automatically set SQL_LOG_UPDATE to the same value and vice versa.",
@@ -3943,28 +3944,28 @@ replicating a LOAD DATA INFILE command",
(gptr*) &opt_mysql_tmpdir,
(gptr*) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"transaction-isolation", OPT_TX_ISOLATION,
- "Default transaction isolation level", 0, 0, 0, GET_STR, REQUIRED_ARG, 0,
+ "Default transaction isolation level.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
- {"external-locking", OPT_USE_LOCKING, "Use system (external) locking. With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running",
+ {"external-locking", OPT_USE_LOCKING, "Use system (external) locking. With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running.",
(gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"use-symbolic-links", 's', "Enable symbolic link support. Depricated option; Use --symbolic-links instead",
+ {"use-symbolic-links", 's', "Enable symbolic link support. Depricated option; Use --symbolic-links instead.",
(gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG,
IF_PURIFY(0,1), 0, 0, 0, 0, 0},
- {"--symbolic-links", 's', "Enable symbolic link support",
+ {"--symbolic-links", 's', "Enable symbolic link support.",
(gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG,
IF_PURIFY(0,1), 0, 0, 0, 0, 0},
- {"user", 'u', "Run mysqld daemon as user", 0, 0, 0, GET_STR, REQUIRED_ARG,
+ {"user", 'u', "Run mysqld daemon as user.", 0, 0, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
- {"version", 'V', "Output version information and exit", 0, 0, 0, GET_NO_ARG,
+ {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"version", 'v', "Synonym for option -v", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
+ {"version", 'v', "Synonym for option -V.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
- {"log-warnings", 'W', "Log some not critical warnings to the log file",
+ {"log-warnings", 'W', "Log some not critical warnings to the log file.",
(gptr*) &global_system_variables.log_warnings,
(gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
- {"warnings", 'W', "Deprecated ; Use --log-warnings instead",
+ {"warnings", 'W', "Deprecated ; Use --log-warnings instead.",
(gptr*) &global_system_variables.log_warnings,
(gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
@@ -3986,7 +3987,7 @@ replicating a LOAD DATA INFILE command",
(gptr*) &berkeley_max_lock, (gptr*) &berkeley_max_lock, 0, GET_ULONG,
REQUIRED_ARG, 10000, 0, (long) ~0, 0, 1, 0},
/* QQ: The following should be removed soon! */
- {"bdb_lock_max", OPT_BDB_MAX_LOCK, "Synonym for bdb_max_lock",
+ {"bdb_lock_max", OPT_BDB_MAX_LOCK, "Synonym for bdb_max_lock.",
(gptr*) &berkeley_max_lock, (gptr*) &berkeley_max_lock, 0, GET_ULONG,
REQUIRED_ARG, 10000, 0, (long) ~0, 0, 1, 0},
#endif /* HAVE_BERKELEY_DB */
@@ -3995,7 +3996,7 @@ replicating a LOAD DATA INFILE command",
(gptr*) &binlog_cache_size, (gptr*) &binlog_cache_size, 0, GET_ULONG,
REQUIRED_ARG, 32*1024L, IO_SIZE, ~0L, 0, IO_SIZE, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT,
- "The number of seconds the mysqld server is waiting for a connect packet before responding with Bad handshake",
+ "The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.",
(gptr*) &connect_timeout, (gptr*) &connect_timeout,
0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
{"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT,
@@ -4135,7 +4136,7 @@ replicating a LOAD DATA INFILE command",
(gptr*) &max_insert_delayed_threads, (gptr*) &max_insert_delayed_threads,
0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0},
{"max_error_count", OPT_MAX_ERROR_COUNT,
- "Max number of errors/warnings to store for a statement",
+ "Max number of errors/warnings to store for a statement.",
(gptr*) &global_system_variables.max_error_count,
(gptr*) &max_system_variables.max_error_count,
0, GET_ULONG, REQUIRED_ARG, DEFAULT_ERROR_COUNT, 1, 65535, 0, 1, 0},
@@ -4150,12 +4151,12 @@ replicating a LOAD DATA INFILE command",
(gptr*) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG,
~0L, 1, ~0L, 0, 1, 0},
{"max_length_for_sort_data", OPT_MAX_LENGTH_FOR_SORT_DATA,
- "Max number of bytes in sorted records",
+ "Max number of bytes in sorted records.",
(gptr*) &global_system_variables.max_length_for_sort_data,
(gptr*) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG,
REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
{"max_prepared_statements", OPT_MAX_PREP_STMT,
- "Max number of prepared_statements for a thread",
+ "Max number of prepared_statements for a thread.",
(gptr*) &global_system_variables.max_prep_stmt_count,
(gptr*) &max_system_variables.max_prep_stmt_count, 0, GET_ULONG,
REQUIRED_ARG, DEFAULT_PREP_STMT_COUNT, 0, ~0L, 0, 1, 0},
@@ -4183,19 +4184,19 @@ replicating a LOAD DATA INFILE command",
(gptr*) &max_system_variables.bulk_insert_buff_size,
0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, ~0L, 0, 1, 0},
{"myisam_block_size", OPT_MYISAM_BLOCK_SIZE,
- "Block size to be used for MyISAM index pages",
+ "Block size to be used for MyISAM index pages.",
(gptr*) &opt_myisam_block_size,
(gptr*) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG,
MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH,
0, MI_MIN_KEY_BLOCK_LENGTH, 0},
{"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
- "Used to help MySQL to decide when to use the slow but safe key cache index create method",
+ "Used to help MySQL to decide when to use the slow but safe key cache index create method.",
(gptr*) &global_system_variables.myisam_max_extra_sort_file_size,
(gptr*) &max_system_variables.myisam_max_extra_sort_file_size,
0, GET_ULL, REQUIRED_ARG, (ulonglong) MI_MAX_TEMP_LENGTH,
0, (ulonglong) MAX_FILE_SIZE, 0, 1, 0},
{"myisam_max_sort_file_size", OPT_MYISAM_MAX_SORT_FILE_SIZE,
- "Don't use the fast sort index method to created index if the temporary file would get bigger than this!",
+ "Don't use the fast sort index method to created index if the temporary file would get bigger than this.",
(gptr*) &global_system_variables.myisam_max_sort_file_size,
(gptr*) &max_system_variables.myisam_max_sort_file_size, 0,
GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE,
@@ -4284,12 +4285,12 @@ replicating a LOAD DATA INFILE command",
(gptr*) &relay_log_purge, 0, GET_BOOL, NO_ARG,
1, 0, 1, 0, 1, 0},
{"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
- "Maximum space to use for all relay logs",
+ "Maximum space to use for all relay logs.",
(gptr*) &relay_log_space_limit,
(gptr*) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
(longlong) ULONG_MAX, 0, 1, 0},
{"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL,
- "Use compression on master/slave protocol",
+ "Use compression on master/slave protocol.",
(gptr*) &opt_slave_compressed_protocol,
(gptr*) &opt_slave_compressed_protocol,
0, GET_BOOL, REQUIRED_ARG, 0, 0, 1, 0, 1, 0},
@@ -4299,7 +4300,7 @@ replicating a LOAD DATA INFILE command",
GET_ULONG, REQUIRED_ARG, SLAVE_NET_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
#endif /* HAVE_REPLICATION */
{"read-only", OPT_READONLY,
- "Make all tables readonly, with the expections for replications (slave) threads and users with the SUPER privilege",
+ "Make all tables readonly, with the expections for replications (slave) threads and users with the SUPER privilege.",
(gptr*) &opt_readonly,
(gptr*) &opt_readonly,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
@@ -4335,7 +4336,7 @@ replicating a LOAD DATA INFILE command",
(gptr*) &thread_stack, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK,
1024*32, ~0L, 0, 1024, 0},
{"wait_timeout", OPT_WAIT_TIMEOUT,
- "The number of seconds the server waits for activity on a connection before closing it",
+ "The number of seconds the server waits for activity on a connection before closing it.",
(gptr*) &global_system_variables.net_wait_timeout,
(gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
@@ -4346,13 +4347,12 @@ replicating a LOAD DATA INFILE command",
REQUIRED_ARG, 0, 0, 99, 0, 1, 0},
{ "default-week-format", OPT_DEFAULT_WEEK_FORMAT,
"The default week format used by WEEK() functions.",
- (gptr*) &global_system_variables.default_week_format,
- (gptr*) &max_system_variables.default_week_format,
+ (gptr*) &global_system_variables.default_week_format,
+ (gptr*) &max_system_variables.default_week_format,
0, GET_ULONG, REQUIRED_ARG, 0, 0, 3L, 0, 1, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-
struct show_var_st status_vars[]= {
{"Aborted_clients", (char*) &aborted_threads, SHOW_LONG},
{"Aborted_connects", (char*) &aborted_connects, SHOW_LONG},
@@ -4636,7 +4636,7 @@ static void mysql_init_variables(void)
max_sort_char= 0;
mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0;
errmesg= 0;
- mysql_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
+ mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
bzero((gptr) &com_stat, sizeof(com_stat));
@@ -5043,7 +5043,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case (int) OPT_SKIP_NETWORKING:
opt_disable_networking=1;
- mysql_port=0;
+ mysqld_port=0;
break;
case (int) OPT_SKIP_SHOW_DB:
opt_skip_show_db=1;
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 10fe2c1725e..1d730836d6e 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -103,8 +103,7 @@ void send_error(THD *thd, uint sql_errno, const char *err)
{
/* The first # is to make the protocol backward compatible */
buff[2]= '#';
- strmov(buff+3, mysql_errno_to_sqlstate(sql_errno));
- pos= buff + 2 + SQLSTATE_LENGTH +1;
+ pos= strmov(buff+3, mysql_errno_to_sqlstate(sql_errno));
}
length= (uint) (strmake(pos, err, MYSQL_ERRMSG_SIZE-1) - buff);
err=buff;
@@ -236,28 +235,6 @@ net_printf(THD *thd, uint errcode, ...)
DBUG_VOID_RETURN;
}
-/*
- Function called by my_net_init() to set some check variables
-*/
-
-#ifndef EMBEDDED_LIBRARY
-extern "C" {
-void my_net_local_init(NET *net)
-{
- net->max_packet= (uint) global_system_variables.net_buffer_length;
- net->read_timeout= (uint) global_system_variables.net_read_timeout;
- net->write_timeout=(uint) global_system_variables.net_write_timeout;
- net->retry_count= (uint) global_system_variables.net_retry_count;
- net->max_packet_size= max(global_system_variables.net_buffer_length,
- global_system_variables.max_allowed_packet);
-}
-}
-
-#else /* EMBEDDED_LIBRARY */
-void my_net_local_init(NET *net __attribute__(unused))
-{
-}
-#endif /* EMBEDDED_LIBRARY */
/*
Return ok to the client.
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index bbfd7866aa2..60af9a92c76 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -450,11 +450,11 @@ int show_new_master(THD* thd)
/*
Asks the master for the list of its other connected slaves.
- This is for failsafe replication :
- in order for failsafe replication to work, the servers involved in replication
- must know of each other. We accomplish this by having each slave report to the
- master how to reach it, and on connection, each slave receives information
- about where the other slaves are.
+ This is for failsafe replication:
+ in order for failsafe replication to work, the servers involved in
+ replication must know of each other. We accomplish this by having each
+ slave report to the master how to reach it, and on connection, each
+ slave receives information about where the other slaves are.
SYNOPSIS
update_slave_list()
@@ -466,8 +466,8 @@ int show_new_master(THD* thd)
hostname/port of the master, the username used by the slave to connect to
the master.
If the user used by the slave to connect to the master does not have the
- REPLICATION SLAVE privilege, it will pop in this function because SHOW SLAVE
- HOSTS will fail on the master.
+ REPLICATION SLAVE privilege, it will pop in this function because
+ SHOW SLAVE HOSTS will fail on the master.
RETURN VALUES
1 error
@@ -483,7 +483,6 @@ int update_slave_list(MYSQL* mysql, MASTER_INFO* mi)
int port_ind;
DBUG_ENTER("update_slave_list");
-
if (mysql_real_query(mysql,"SHOW SLAVE HOSTS",16) ||
!(res = mysql_store_result(mysql)))
{
@@ -668,8 +667,10 @@ int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi)
strmov(mysql->net.last_error, "Master is not configured");
DBUG_RETURN(1);
}
- mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *)&slave_net_timeout);
- mysql_options(mysql, MYSQL_SET_CHARSET_NAME, (char *)default_charset_info);
+ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout);
+ mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout);
+ mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname);
+ mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
if (!mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
mi->port, 0, 0))
DBUG_RETURN(1);
diff --git a/sql/set_var.cc b/sql/set_var.cc
index f71390d500d..a281fac530a 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -603,7 +603,7 @@ struct show_var_st init_vars[]= {
{"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
{"log_error", (char*) log_error_file, SHOW_CHAR},
- {"port", (char*) &mysql_port, SHOW_INT},
+ {"port", (char*) &mysqld_port, SHOW_INT},
{"protocol_version", (char*) &protocol_version, SHOW_INT},
{sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS},
{sys_pseudo_thread_id.name, (char*) &sys_pseudo_thread_id, SHOW_SYS},
@@ -635,7 +635,7 @@ struct show_var_st init_vars[]= {
{"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
{sys_slow_launch_time.name, (char*) &sys_slow_launch_time, SHOW_SYS},
#ifdef HAVE_SYS_UN_H
- {"socket", (char*) &mysql_unix_port, SHOW_CHAR_PTR},
+ {"socket", (char*) &mysqld_unix_port, SHOW_CHAR_PTR},
#endif
{sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
{sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml
index 6e091066654..c5a2ae5dfb6 100644
--- a/sql/share/charsets/Index.xml
+++ b/sql/share/charsets/Index.xml
@@ -208,7 +208,7 @@ To make maintaining easier please:
<alias>windows-1251</alias>
<alias>ms-cyr</alias>
<alias>ms-cyrillic</alias>
- <collation name="cp1251_bulgarian_ci" id="14" flag="primary">
+ <collation name="cp1251_bulgarian_ci" id="14">
<order>Belarusian</order>
<order>Bulgarian</order>
<order>Macedonian</order>
@@ -219,7 +219,7 @@ To make maintaining easier please:
</collation>
<collation name="cp1251_ukrainian_ci" id="23" order="Ukrainian"/>
<collation name="cp1251_bin" id="50" order="Binary" flag="binary"/>
- <collation name="cp1251_general_ci" id="51">
+ <collation name="cp1251_general_ci" id="51" flag="primary">
<order>Belarusian</order>
<order>Bulgarian</order>
<order>Macedonian</order>
diff --git a/sql/slave.cc b/sql/slave.cc
index 504bb0309cc..ccce8077cb8 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -71,7 +71,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
void* thread_killed_arg);
static int request_table_dump(MYSQL* mysql, const char* db, const char* table);
-static int create_table_from_dump(THD* thd, NET* net, const char* db,
+static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
const char* table_name);
static int check_master_version(MYSQL* mysql, MASTER_INFO* mi);
char* rewrite_db(char* db);
@@ -1049,10 +1049,10 @@ static int check_master_version(MYSQL* mysql, MASTER_INFO* mi)
}
-static int create_table_from_dump(THD* thd, NET* net, const char* db,
+static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
const char* table_name)
{
- ulong packet_len = my_net_read(net); // read create table statement
+ ulong packet_len;
char *query;
Vio* save_vio;
HA_CHECK_OPT check_opt;
@@ -1060,7 +1060,9 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
int error= 1;
handler *file;
ulong save_options;
+ NET *net= &mysql->net;
+ packet_len= my_net_read(net); // read create table statement
if (packet_len == packet_error)
{
send_error(thd, ER_MASTER_NET_READ);
@@ -1068,32 +1070,27 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
}
if (net->read_pos[0] == 255) // error from master
{
- net->read_pos[packet_len] = 0;
- net_printf(thd, ER_MASTER, net->read_pos + 3);
+ char *err_msg;
+ err_msg= (char*) net->read_pos + ((mysql->server_capabilities &
+ CLIENT_PROTOCOL_41) ?
+ 3+SQLSTATE_LENGTH+1 : 3);
+ net_printf(thd, ER_MASTER, err_msg);
return 1;
}
thd->command = COM_TABLE_DUMP;
+ thd->query_length= packet_len;
/* Note that we should not set thd->query until the area is initalized */
- if (!(query = sql_alloc(packet_len + 1)))
+ if (!(query = thd->strmake((char*) net->read_pos, packet_len)))
{
sql_print_error("create_table_from_dump: out of memory");
net_printf(thd, ER_GET_ERRNO, "Out of memory");
return 1;
}
- memcpy(query, net->read_pos, packet_len);
- query[packet_len]= 0;
- thd->query_length= packet_len;
- /*
- We make the following lock in an attempt to ensure that the compiler will
- not rearrange the code so that thd->query is set too soon
- */
- VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query= query;
- VOID(pthread_mutex_unlock(&LOCK_thread_count));
thd->current_tablenr = 0;
thd->query_error = 0;
thd->net.no_send_ok = 1;
-
+
/* we do not want to log create table statement */
save_options = thd->options;
thd->options &= ~(ulong) (OPTION_BIN_LOG);
@@ -1185,8 +1182,7 @@ int fetch_master_table(THD *thd, const char *db_name, const char *table_name,
errmsg= "Failed on table dump request";
goto err;
}
- if (create_table_from_dump(thd, &mysql->net, db_name,
- table_name))
+ if (create_table_from_dump(thd, mysql, db_name, table_name))
goto err; // create_table_from_dump will have sent the error already
error = 0;
@@ -2996,17 +2992,20 @@ static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
#ifndef DBUG_OFF
events_till_disconnect = disconnect_slave_event_count;
#endif
- uint client_flag=0;
+ ulong client_flag= CLIENT_REMEMBER_OPTIONS;
if (opt_slave_compressed_protocol)
client_flag=CLIENT_COMPRESS; /* We will use compression */
+ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout);
+ mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout);
+ mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname);
+ /* This one is not strictly needed but we have it here for completeness */
+ mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
+
while (!(slave_was_killed = io_slave_killed(thd,mi)) &&
- (reconnect ? mysql_reconnect(mysql) != 0:
- !(mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
- (char *)&thd->variables.net_read_timeout),
- mysql_options(mysql, MYSQL_SET_CHARSET_NAME, (char *)default_charset_info),
- mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
- mi->port, 0, client_flag))))
+ (reconnect ? mysql_reconnect(mysql) != 0 :
+ mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
+ mi->port, 0, client_flag) == 0))
{
/* Don't repeat last error */
if ((int)mysql_errno(mysql) != last_errno)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 49aad321702..1bdca7167e8 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -3337,15 +3337,19 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list)
}
tables[0].table->field[0]->store(user_name->host.str,(uint)
- user_name->host.length, system_charset_info);
+ user_name->host.length,
+ system_charset_info);
tables[0].table->field[1]->store(user_name->user.str,(uint)
- user_name->user.length, system_charset_info);
+ user_name->user.length,
+ system_charset_info);
if (!tables[0].table->file->index_read_idx(tables[0].table->record[0],0,
- (byte*) tables[0].table->field[0]->ptr,0,
+ (byte*) tables[0].table->
+ field[0]->ptr,0,
HA_READ_KEY_EXACT))
{
int error;
- if ((error = tables[0].table->file->delete_row(tables[0].table->record[0])))
+ if ((error = tables[0].table->file->delete_row(tables[0].table->
+ record[0])))
{
tables[0].table->file->print_error(error, MYF(0));
tables[0].table->file->index_end();
@@ -3355,7 +3359,7 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list)
}
tables[0].table->file->index_end();
}
-err:
+
VOID(pthread_mutex_unlock(&acl_cache->lock));
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
diff --git a/sql/sql_client.cc b/sql/sql_client.cc
new file mode 100644
index 00000000000..464596f0734
--- /dev/null
+++ b/sql/sql_client.cc
@@ -0,0 +1,45 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ This files defines some MySQL C API functions that are server specific
+*/
+
+#include <mysql_priv.h>
+
+/*
+ Function called by my_net_init() to set some check variables
+*/
+
+extern "C" {
+void my_net_local_init(NET *net)
+{
+#ifndef EMBEDDED_LIBRARY
+ net->max_packet= (uint) global_system_variables.net_buffer_length;
+ net->read_timeout= (uint) global_system_variables.net_read_timeout;
+ net->write_timeout=(uint) global_system_variables.net_write_timeout;
+ net->retry_count= (uint) global_system_variables.net_retry_count;
+ net->max_packet_size= max(global_system_variables.net_buffer_length,
+ global_system_variables.max_allowed_packet);
+#endif
+}
+}
+
+extern "C" {
+void mysql_once_init(void)
+{
+}
+}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index f65ef4b968a..091de9d406f 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -308,6 +308,11 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
}
thd->row_count++;
}
+
+ /*
+ Now all rows are inserted. Time to update logs and sends response to
+ user
+ */
if (lock_type == TL_WRITE_DELAYED)
{
if (!error)
@@ -341,7 +346,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
}
if (id && values_list.elements != 1)
thd->insert_id(id); // For update log
- else if (table->next_number_field)
+ else if (table->next_number_field && info.copied)
id=table->next_number_field->val_int(); // Return auto_increment value
/*
@@ -383,9 +388,15 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
thd->next_insert_id=0; // Reset this if wrongly used
if (duplic != DUP_ERROR)
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
+
+ /* Reset value of LAST_INSERT_ID if no rows where inserted */
+ if (!info.copied && thd->insert_id_used)
+ {
+ thd->insert_id(0);
+ id=0;
+ }
if (error)
goto abort;
-
if (values_list.elements == 1 && (!(thd->options & OPTION_WARNINGS) ||
!thd->cuted_fields))
send_ok(thd,info.copied+info.deleted,id);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index cffdd19b08d..4f54b0fc3ba 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2317,7 +2317,6 @@ mysql_execute_command(THD *thd)
break;
}
case SQLCOM_UPDATE:
- TABLE_LIST *table;
if (check_db_used(thd,tables))
goto error;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 61a64573eaa..248496d6b43 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -4791,7 +4791,7 @@ free_tmp_table(THD *thd, TABLE *entry)
(void) ha_delete_table(entry->db_type,entry->real_name);
/* free blobs */
for (Field **ptr=entry->field ; *ptr ; ptr++)
- delete *ptr;
+ (*ptr)->free();
my_free((gptr) entry->record[0],MYF(0));
free_io_cache(entry);
@@ -8061,7 +8061,6 @@ void free_underlaid_joins(THD *thd, SELECT_LEX *select)
bool JOIN::rollup_init()
{
uint i,j;
- ORDER *group;
Item **ref_array;
tmp_table_param.quick_group= 0; // Can't create groups in tmp table
@@ -8145,7 +8144,7 @@ bool JOIN::rollup_make_fields(List<Item> &all_fields, List<Item> &fields,
...
*/
- for (level=0 ; level < send_group_parts > 0 ; level++)
+ for (level=0 ; level < send_group_parts ; level++)
{
uint i;
uint pos= send_group_parts - level -1;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 0b18b7ffdc5..2eb65eab288 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1502,7 +1502,9 @@ keys_or_index:
opt_unique_or_fulltext:
/* empty */ { $$= Key::MULTIPLE; }
| UNIQUE_SYM { $$= Key::UNIQUE; }
- | SPATIAL_SYM { $$= Key::SPATIAL; };
+ | FULLTEXT_SYM { $$= Key::FULLTEXT;}
+ | SPATIAL_SYM { $$= Key::SPATIAL; }
+ ;
key_alg:
/* empty */ { $$= HA_KEY_ALG_UNDEF; }
@@ -3903,7 +3905,7 @@ purge_option:
}
Item *tmp= new Item_func_unix_timestamp($2);
Lex->sql_command = SQLCOM_PURGE_BEFORE;
- Lex->purge_time= tmp->val_int();
+ Lex->purge_time= (ulong) tmp->val_int();
}
;