Commit 0794c317 authored by unknown's avatar unknown

Merge


BitKeeper/deleted/.del-violite.c~984c09cffe14a11b:
  Auto merged
Docs/manual.texi:
  Auto merged
client/mysqladmin.c:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_lex.cc:
  SCCS merged
parents 7207ea50 ac57d641
......@@ -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.
@menu
* News-3.23.44:: Changes in release 3.23.44
* News-3.23.43:: Changes in release 3.23.43
* News-3.23.42:: Changes in release 3.23.42
* News-3.23.41:: Changes in release 3.23.41
......@@ -47588,7 +47589,17 @@ not yet 100% confident in this code.
* News-3.23.0:: Changes in release 3.23.0
@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
@itemize @bullet
@item
......@@ -23,7 +23,7 @@
#include <my_pthread.h> /* because of signal() */
#endif
#define ADMIN_VERSION "8.21"
#define ADMIN_VERSION "8.22"
#define MAX_MYSQL_VAR 64
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
......@@ -51,7 +51,7 @@ static void print_version(void);
static void usage(void);
static my_bool sql_connect(MYSQL *mysql,const char *host, const char *user,
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 sig_handler endprog(int signal_number);
static void nice_time(ulong sec,char *buff);
......@@ -275,16 +275,24 @@ int main(int argc,char *argv[])
while (!interrupted)
{
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 (!sql_connect(&mysql,host,user,opt_password,option_wait))
continue; /* Retry */
if (option_wait && !interrupted)
{
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)
{
......@@ -301,7 +309,7 @@ int main(int argc,char *argv[])
my_free(user,MYF(MY_ALLOW_ZERO_PTR));
free_defaults(argv);
my_end(0);
exit(error);
exit(error ? 1 : 0);
return 0;
}
......@@ -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;
......@@ -404,7 +418,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"CREATE DATABASE failed; error: '%-.200s'",
MYF(ME_BELL), mysql_error(mysql));
return 1;
return -1;
}
argc--; argv++;
break;
......@@ -417,7 +431,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
return 1;
}
if (drop_db(mysql,argv[1]))
return 1;
return -1;
argc--; argv++;
break;
}
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
mysql_close(mysql); /* Close connection to avoid error messages */
if (got_pidfile)
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
break;
case ADMIN_REFRESH:
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
break;
case ADMIN_FLUSH_THREADS:
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
break;
case ADMIN_VER:
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
print_header(result);
while ((row=mysql_fetch_row(result)))
......@@ -552,7 +566,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
}
argc--; argv++;
if (error)
return error;
return -1;
break;
}
case ADMIN_DEBUG:
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
break;
case ADMIN_VARIABLES:
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
print_header(res);
while ((row=mysql_fetch_row(res)))
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
if (!opt_vertical)
print_header(res);
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
break;
}
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
break;
}
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
break;
}
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
break;
}
......@@ -684,7 +698,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
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));
return 1;
......@@ -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'",
MYF(ME_BELL),mysql_error(mysql));
return 1;
return -1;
}
if (mysql_query(mysql,buff))
{
my_printf_error(0,"unable to change password; error: '%s'",
MYF(ME_BELL),mysql_error(mysql));
return 1;
return -1;
}
argc--; argv++;
break;
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
else
puts("Slave started");
......@@ -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),
mysql_error(mysql));
return 1;
return -1;
}
else
puts("Slave stopped");
......@@ -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'",
MYF(ME_BELL),mysql_error(mysql));
return 1;
return -1;
}
}
mysql->reconnect=1; /* Automatic reconnect is default */
......
......@@ -147,7 +147,7 @@ LEX *lex_start(THD *thd, uchar *buf,uint length)
lex->select->in_sum_expr=0;
lex->select->expr_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->ignore_space=test(thd->sql_mode & MODE_IGNORE_SPACE);
return lex;
......
......@@ -168,7 +168,6 @@ typedef struct st_lex {
CONVERT *convert_set;
LEX_USER *grant_user;
gptr yacc_yyss,yacc_yyvs;
THD *thd;
udf_func udf;
HA_CHECK_OPT check_opt; // check/repair options
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