Commit 0c81c7ea authored by monty@work.mysql.com's avatar monty@work.mysql.com

Merge

parents a17173c7 88e5ee01
...@@ -47541,6 +47541,7 @@ users use this code as the rest of the code and because of this we are ...@@ -47541,6 +47541,7 @@ users use this code as the rest of the code and because of this we are
not yet 100% confident in this code. not yet 100% confident in this code.
@menu @menu
* News-3.23.44:: Changes in release 3.23.44
* News-3.23.43:: Changes in release 3.23.43 * News-3.23.43:: Changes in release 3.23.43
* News-3.23.42:: Changes in release 3.23.42 * News-3.23.42:: Changes in release 3.23.42
* News-3.23.41:: Changes in release 3.23.41 * News-3.23.41:: Changes in release 3.23.41
...@@ -47588,7 +47589,17 @@ not yet 100% confident in this code. ...@@ -47588,7 +47589,17 @@ not yet 100% confident in this code.
* News-3.23.0:: Changes in release 3.23.0 * News-3.23.0:: Changes in release 3.23.0
@end menu @end menu
@node News-3.23.43, News-3.23.42, News-3.23.x, News-3.23.x @node News-3.23.44, News-3.23.43, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.44
@itemize @bullet
@item
When using replications, aborted queries that contained @code{%} could cause
a core dum.
@item
TCP_NODELAY was not used on some systems. (Speed problem).
@end itemize
@node News-3.23.43, News-3.23.42, News-3.23.44, News-3.23.x
@appendixsubsec Changes in release 3.23.43 @appendixsubsec Changes in release 3.23.43
@itemize @bullet @itemize @bullet
@item @item
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <my_pthread.h> /* because of signal() */ #include <my_pthread.h> /* because of signal() */
#endif #endif
#define ADMIN_VERSION "8.21" #define ADMIN_VERSION "8.22"
#define MAX_MYSQL_VAR 64 #define MAX_MYSQL_VAR 64
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3 #define MAX_TRUNC_LENGTH 3
...@@ -51,7 +51,7 @@ static void print_version(void); ...@@ -51,7 +51,7 @@ static void print_version(void);
static void usage(void); static void usage(void);
static my_bool sql_connect(MYSQL *mysql,const char *host, const char *user, static my_bool sql_connect(MYSQL *mysql,const char *host, const char *user,
const char *password,uint wait); const char *password,uint wait);
static my_bool execute_commands(MYSQL *mysql,int argc, char **argv); static int execute_commands(MYSQL *mysql,int argc, char **argv);
static int drop_db(MYSQL *mysql,const char *db); static int drop_db(MYSQL *mysql,const char *db);
static sig_handler endprog(int signal_number); static sig_handler endprog(int signal_number);
static void nice_time(ulong sec,char *buff); static void nice_time(ulong sec,char *buff);
...@@ -275,16 +275,24 @@ int main(int argc,char *argv[]) ...@@ -275,16 +275,24 @@ int main(int argc,char *argv[])
while (!interrupted) while (!interrupted)
{ {
new_line = 0; new_line = 0;
if (execute_commands(&mysql,argc,commands) && !option_force) if ((error=execute_commands(&mysql,argc,commands)))
{ {
if (option_wait && !interrupted) if (error > 0)
break; /* Wrong command error */
if (!option_force)
{ {
mysql_close(&mysql); if (option_wait && !interrupted)
if (!sql_connect(&mysql,host,user,opt_password,option_wait)) {
continue; /* Retry */ mysql_close(&mysql);
if (!sql_connect(&mysql,host,user,opt_password,option_wait))
{
sleep(1); /* Don't retry too rapidly */
continue; /* Retry */
}
}
error=1;
break;
} }
error=1;
break;
} }
if (interval) if (interval)
{ {
...@@ -301,7 +309,7 @@ int main(int argc,char *argv[]) ...@@ -301,7 +309,7 @@ int main(int argc,char *argv[])
my_free(user,MYF(MY_ALLOW_ZERO_PTR)); my_free(user,MYF(MY_ALLOW_ZERO_PTR));
free_defaults(argv); free_defaults(argv);
my_end(0); my_end(0);
exit(error); exit(error ? 1 : 0);
return 0; return 0;
} }
...@@ -383,8 +391,14 @@ static my_bool sql_connect(MYSQL *mysql,const char *host, const char *user, ...@@ -383,8 +391,14 @@ static my_bool sql_connect(MYSQL *mysql,const char *host, const char *user,
} }
} }
/*
Execute a command.
Return 0 on ok
-1 on retryable error
1 on fatal error
*/
static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) static int execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
char *status; char *status;
...@@ -404,7 +418,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -404,7 +418,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"CREATE DATABASE failed; error: '%-.200s'", my_printf_error(0,"CREATE DATABASE failed; error: '%-.200s'",
MYF(ME_BELL), mysql_error(mysql)); MYF(ME_BELL), mysql_error(mysql));
return 1; return -1;
} }
argc--; argv++; argc--; argv++;
break; break;
...@@ -417,7 +431,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -417,7 +431,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
return 1; return 1;
} }
if (drop_db(mysql,argv[1])) if (drop_db(mysql,argv[1]))
return 1; return -1;
argc--; argv++; argc--; argv++;
break; break;
} }
...@@ -433,7 +447,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -433,7 +447,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"shutdown failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"shutdown failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
mysql_close(mysql); /* Close connection to avoid error messages */ mysql_close(mysql); /* Close connection to avoid error messages */
if (got_pidfile) if (got_pidfile)
...@@ -450,7 +464,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -450,7 +464,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"reload failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"reload failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
break; break;
case ADMIN_REFRESH: case ADMIN_REFRESH:
...@@ -461,7 +475,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -461,7 +475,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
break; break;
case ADMIN_FLUSH_THREADS: case ADMIN_FLUSH_THREADS:
...@@ -469,7 +483,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -469,7 +483,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
break; break;
case ADMIN_VER: case ADMIN_VER:
...@@ -513,7 +527,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -513,7 +527,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"process list failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"process list failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
print_header(result); print_header(result);
while ((row=mysql_fetch_row(result))) while ((row=mysql_fetch_row(result)))
...@@ -552,7 +566,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -552,7 +566,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
} }
argc--; argv++; argc--; argv++;
if (error) if (error)
return error; return -1;
break; break;
} }
case ADMIN_DEBUG: case ADMIN_DEBUG:
...@@ -560,7 +574,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -560,7 +574,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"debug failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"debug failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
break; break;
case ADMIN_VARIABLES: case ADMIN_VARIABLES:
...@@ -574,7 +588,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -574,7 +588,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"unable to show variables; error: '%s'",MYF(ME_BELL), my_printf_error(0,"unable to show variables; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
print_header(res); print_header(res);
while ((row=mysql_fetch_row(res))) while ((row=mysql_fetch_row(res)))
...@@ -596,7 +610,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -596,7 +610,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0, "unable to show status; error: '%s'", MYF(ME_BELL), my_printf_error(0, "unable to show status; error: '%s'", MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
if (!opt_vertical) if (!opt_vertical)
print_header(res); print_header(res);
...@@ -646,7 +660,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -646,7 +660,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
break; break;
} }
...@@ -656,7 +670,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -656,7 +670,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
break; break;
} }
...@@ -666,7 +680,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -666,7 +680,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
break; break;
} }
...@@ -676,7 +690,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -676,7 +690,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
break; break;
} }
...@@ -684,7 +698,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -684,7 +698,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
char buff[128],crypted_pw[33]; char buff[128],crypted_pw[33];
if(argc < 2) if (argc < 2)
{ {
my_printf_error(0,"Too few arguments to change password",MYF(ME_BELL)); my_printf_error(0,"Too few arguments to change password",MYF(ME_BELL));
return 1; return 1;
...@@ -699,13 +713,13 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -699,13 +713,13 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0, "Can't turn off logging; error: '%s'", my_printf_error(0, "Can't turn off logging; error: '%s'",
MYF(ME_BELL),mysql_error(mysql)); MYF(ME_BELL),mysql_error(mysql));
return 1; return -1;
} }
if (mysql_query(mysql,buff)) if (mysql_query(mysql,buff))
{ {
my_printf_error(0,"unable to change password; error: '%s'", my_printf_error(0,"unable to change password; error: '%s'",
MYF(ME_BELL),mysql_error(mysql)); MYF(ME_BELL),mysql_error(mysql));
return 1; return -1;
} }
argc--; argv++; argc--; argv++;
break; break;
...@@ -716,7 +730,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -716,7 +730,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0, "Error starting slave: %s", MYF(ME_BELL), my_printf_error(0, "Error starting slave: %s", MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
else else
puts("Slave started"); puts("Slave started");
...@@ -726,7 +740,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -726,7 +740,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0, "Error stopping slave: %s", MYF(ME_BELL), my_printf_error(0, "Error stopping slave: %s", MYF(ME_BELL),
mysql_error(mysql)); mysql_error(mysql));
return 1; return -1;
} }
else else
puts("Slave stopped"); puts("Slave stopped");
...@@ -751,7 +765,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -751,7 +765,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{ {
my_printf_error(0,"mysqld doesn't answer to ping, error: '%s'", my_printf_error(0,"mysqld doesn't answer to ping, error: '%s'",
MYF(ME_BELL),mysql_error(mysql)); MYF(ME_BELL),mysql_error(mysql));
return 1; return -1;
} }
} }
mysql->reconnect=1; /* Automatic reconnect is default */ mysql->reconnect=1; /* Automatic reconnect is default */
......
...@@ -147,7 +147,7 @@ LEX *lex_start(THD *thd, uchar *buf,uint length) ...@@ -147,7 +147,7 @@ LEX *lex_start(THD *thd, uchar *buf,uint length)
lex->select->in_sum_expr=0; lex->select->in_sum_expr=0;
lex->select->expr_list.empty(); lex->select->expr_list.empty();
lex->select->ftfunc_list.empty(); lex->select->ftfunc_list.empty();
lex->convert_set=(lex->thd=thd)->convert_set; lex->convert_set=thd->convert_set;
lex->yacc_yyss=lex->yacc_yyvs=0; lex->yacc_yyss=lex->yacc_yyvs=0;
lex->ignore_space=test(thd->sql_mode & MODE_IGNORE_SPACE); lex->ignore_space=test(thd->sql_mode & MODE_IGNORE_SPACE);
return lex; return lex;
......
...@@ -168,7 +168,6 @@ typedef struct st_lex { ...@@ -168,7 +168,6 @@ typedef struct st_lex {
CONVERT *convert_set; CONVERT *convert_set;
LEX_USER *grant_user; LEX_USER *grant_user;
gptr yacc_yyss,yacc_yyvs; gptr yacc_yyss,yacc_yyvs;
THD *thd;
udf_func udf; udf_func udf;
HA_CHECK_OPT check_opt; // check/repair options HA_CHECK_OPT check_opt; // check/repair options
HA_CREATE_INFO create_info; HA_CREATE_INFO create_info;
......
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