mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge with 4.0.4
BitKeeper/etc/logging_ok: auto-union client/mysqldump.c: Auto merged include/Makefile.am: Auto merged include/my_base.h: Auto merged include/my_sys.h: Auto merged include/sslopt-case.h: Auto merged libmysql/libmysql.c: Auto merged libmysql/libmysql.def: Auto merged libmysqld/lib_sql.cc: Auto merged myisam/ft_boolean_search.c: Auto merged myisam/mi_check.c: Auto merged myisam/mi_create.c: Auto merged myisam/myisamchk.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/type_set.result: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/myisam.test: Auto merged sql/Makefile.am: Auto merged sql/filesort.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/handler.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/net_pkg.cc: Auto merged sql/net_serv.cc: Auto merged sql/opt_range.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/share/english/errmsg.txt: Auto merged sql/sql_table.cc: Auto merged sql/sql_udf.cc: Auto merged sql/sql_union.cc: Auto merged sql/unireg.h: Auto merged sql/sql_cache.cc: Code cleanup (removed ifdef)
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
#include <signal.h>
|
||||
#include <violite.h>
|
||||
|
||||
const char *VER= "12.14";
|
||||
const char *VER= "13.0";
|
||||
|
||||
/* Don't try to make a nice table if the data is too big */
|
||||
#define MAX_COLUMN_LENGTH 1024
|
||||
@@ -346,6 +346,7 @@ int main(int argc,char *argv[])
|
||||
if (!status.batch)
|
||||
ignore_errors=1; // Don't abort monitor
|
||||
signal(SIGINT, mysql_end); // Catch SIGINT to clean up
|
||||
signal(SIGQUIT, mysql_end); // Catch SIGQUIT to clean up
|
||||
|
||||
/*
|
||||
Run in interactive mode like the ingres/postgres monitor
|
||||
@@ -871,14 +872,14 @@ static COMMANDS *find_command (char *name,char cmd_char)
|
||||
}
|
||||
else
|
||||
{
|
||||
while (isspace(*name))
|
||||
while (my_isspace(system_charset_info,*name))
|
||||
name++;
|
||||
if (strchr(name,';') || strstr(name,"\\g"))
|
||||
return ((COMMANDS *) 0);
|
||||
if ((end=strcont(name," \t")))
|
||||
{
|
||||
len=(uint) (end - name);
|
||||
while (isspace(*end))
|
||||
while (my_isspace(system_charset_info,*end))
|
||||
end++;
|
||||
if (!*end)
|
||||
end=0; // no arguments to function
|
||||
@@ -890,7 +891,8 @@ static COMMANDS *find_command (char *name,char cmd_char)
|
||||
for (uint i= 0; commands[i].name; i++)
|
||||
{
|
||||
if (commands[i].func &&
|
||||
((name && !my_casecmp(name,commands[i].name,len) &&
|
||||
((name &&
|
||||
!my_strncasecmp(system_charset_info,name,commands[i].name,len) &&
|
||||
!commands[i].name[len] &&
|
||||
(!end || (end && commands[i].takes_params))) ||
|
||||
!name && commands[i].cmd_char == cmd_char))
|
||||
@@ -918,12 +920,13 @@ static bool add_line(String &buffer,char *line,char *in_string)
|
||||
|
||||
for (pos=out=line ; (inchar= (uchar) *pos) ; pos++)
|
||||
{
|
||||
if (isspace(inchar) && out == line && buffer.is_empty())
|
||||
if (my_isspace(system_charset_info,inchar) && out == line &&
|
||||
buffer.is_empty())
|
||||
continue;
|
||||
#ifdef USE_MB
|
||||
int l;
|
||||
if (use_mb(default_charset_info) &&
|
||||
(l = my_ismbchar(default_charset_info, pos, strend))) {
|
||||
if (use_mb(system_charset_info) &&
|
||||
(l = my_ismbchar(system_charset_info, pos, strend))) {
|
||||
while (l--)
|
||||
*out++ = *pos++;
|
||||
pos--;
|
||||
@@ -986,7 +989,7 @@ static bool add_line(String &buffer,char *line,char *in_string)
|
||||
}
|
||||
else if (!*in_string && (inchar == '#' ||
|
||||
inchar == '-' && pos[1] == '-' &&
|
||||
isspace(pos[2])))
|
||||
my_isspace(system_charset_info,pos[2])))
|
||||
break; // comment to end of line
|
||||
else
|
||||
{ // Add found char to buffer
|
||||
@@ -1362,9 +1365,9 @@ com_clear(String *buffer,char *line __attribute__((unused)))
|
||||
static int
|
||||
com_go(String *buffer,char *line __attribute__((unused)))
|
||||
{
|
||||
char buff[160],time_buff[32];
|
||||
char buff[200], time_buff[32], *pos;
|
||||
MYSQL_RES *result;
|
||||
ulong timer;
|
||||
ulong timer, warnings;
|
||||
uint error=0;
|
||||
|
||||
if (!status.batch)
|
||||
@@ -1393,7 +1396,8 @@ com_go(String *buffer,char *line __attribute__((unused)))
|
||||
(void) com_print(buffer,0);
|
||||
|
||||
if (skip_updates &&
|
||||
(buffer->length() < 4 || my_sortcmp(buffer->ptr(),"SET ",4)))
|
||||
(buffer->length() < 4 || my_sortcmp(system_charset_info,buffer->ptr(),
|
||||
"SET ",4)))
|
||||
{
|
||||
(void) put_info("Ignoring query to other database",INFO_INFO);
|
||||
return 0;
|
||||
@@ -1446,7 +1450,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
|
||||
{
|
||||
if (!mysql_num_rows(result) && ! quick)
|
||||
{
|
||||
sprintf(buff,"Empty set%s",time_buff);
|
||||
strmov(buff, "Empty set");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1461,20 +1465,30 @@ com_go(String *buffer,char *line __attribute__((unused)))
|
||||
print_tab_data(result);
|
||||
else
|
||||
print_table_data(result);
|
||||
sprintf(buff,"%ld %s in set%s",
|
||||
sprintf(buff,"%ld %s in set",
|
||||
(long) mysql_num_rows(result),
|
||||
(long) mysql_num_rows(result) == 1 ? "row" : "rows",
|
||||
time_buff);
|
||||
(long) mysql_num_rows(result) == 1 ? "row" : "rows");
|
||||
end_pager();
|
||||
}
|
||||
}
|
||||
else if (mysql_affected_rows(&mysql) == ~(ulonglong) 0)
|
||||
sprintf(buff,"Query OK%s",time_buff);
|
||||
strmov(buff,"Query OK");
|
||||
else
|
||||
sprintf(buff,"Query OK, %ld %s affected%s",
|
||||
sprintf(buff,"Query OK, %ld %s affected",
|
||||
(long) mysql_affected_rows(&mysql),
|
||||
(long) mysql_affected_rows(&mysql) == 1 ? "row" : "rows",
|
||||
time_buff);
|
||||
(long) mysql_affected_rows(&mysql) == 1 ? "row" : "rows");
|
||||
|
||||
pos=strend(buff);
|
||||
if ((warnings= mysql_warning_count(&mysql)))
|
||||
{
|
||||
*pos++= ',';
|
||||
*pos++= ' ';
|
||||
pos=int2str(warnings, pos, 10);
|
||||
pos=strmov(pos, " warning");
|
||||
if (warnings != 1)
|
||||
*pos++= 's';
|
||||
}
|
||||
strmov(pos, time_buff);
|
||||
put_info(buff,INFO_RESULT);
|
||||
if (mysql_info(&mysql))
|
||||
put_info(mysql_info(&mysql),INFO_RESULT);
|
||||
@@ -1771,8 +1785,9 @@ safe_put_field(const char *pos,ulong length)
|
||||
{
|
||||
#ifdef USE_MB
|
||||
int l;
|
||||
if (use_mb(default_charset_info) &&
|
||||
(l = my_ismbchar(default_charset_info, pos, end))) {
|
||||
if (use_mb(system_charset_info) &&
|
||||
(l = my_ismbchar(system_charset_info, pos, end)))
|
||||
{
|
||||
while (l--)
|
||||
tee_putc(*pos++, PAGER);
|
||||
pos--;
|
||||
@@ -1832,7 +1847,7 @@ com_tee(String *buffer, char *line __attribute__((unused)))
|
||||
|
||||
if (status.batch)
|
||||
return 0;
|
||||
while (isspace(*line))
|
||||
while (my_isspace(system_charset_info,*line))
|
||||
line++;
|
||||
if (!(param = strchr(line, ' '))) // if outfile wasn't given, use the default
|
||||
{
|
||||
@@ -1851,11 +1866,12 @@ com_tee(String *buffer, char *line __attribute__((unused)))
|
||||
}
|
||||
|
||||
/* eliminate the spaces before the parameters */
|
||||
while (isspace(*param))
|
||||
while (my_isspace(system_charset_info,*param))
|
||||
param++;
|
||||
end= strmake(file_name, param, sizeof(file_name) - 1);
|
||||
/* remove end space from command line */
|
||||
while (end > file_name && (isspace(end[-1]) || iscntrl(end[-1])))
|
||||
while (end > file_name && (my_isspace(system_charset_info,end[-1]) ||
|
||||
my_iscntrl(system_charset_info,end[-1])))
|
||||
end--;
|
||||
end[0]= 0;
|
||||
if (end == file_name)
|
||||
@@ -1895,7 +1911,7 @@ com_pager(String *buffer, char *line __attribute__((unused)))
|
||||
if (status.batch)
|
||||
return 0;
|
||||
/* Skip space from file name */
|
||||
while (isspace(*line))
|
||||
while (my_isspace(system_charset_info,*line))
|
||||
line++;
|
||||
if (!(param = strchr(line, ' '))) // if pager was not given, use the default
|
||||
{
|
||||
@@ -1911,10 +1927,11 @@ com_pager(String *buffer, char *line __attribute__((unused)))
|
||||
}
|
||||
else
|
||||
{
|
||||
while (isspace(*param))
|
||||
while (my_isspace(system_charset_info,*param))
|
||||
param++;
|
||||
end=strmake(pager_name, param, sizeof(pager_name)-1);
|
||||
while (end > pager_name && (isspace(end[-1]) || iscntrl(end[-1])))
|
||||
while (end > pager_name && (my_isspace(system_charset_info,end[-1]) ||
|
||||
my_iscntrl(system_charset_info,end[-1])))
|
||||
end--;
|
||||
end[0]=0;
|
||||
strmov(pager, pager_name);
|
||||
@@ -2050,7 +2067,7 @@ com_connect(String *buffer, char *line)
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
while (isspace(*line))
|
||||
while (my_isspace(system_charset_info,*line))
|
||||
line++;
|
||||
strnmov(buff,line,sizeof(buff)-1); // Don't destroy history
|
||||
if (buff[0] == '\\') // Short command
|
||||
@@ -2096,15 +2113,16 @@ static int com_source(String *buffer, char *line)
|
||||
FILE *sql_file;
|
||||
|
||||
/* Skip space from file name */
|
||||
while (isspace(*line))
|
||||
while (my_isspace(system_charset_info,*line))
|
||||
line++;
|
||||
if (!(param = strchr(line, ' '))) // Skip command name
|
||||
return put_info("Usage: \\. <filename> | source <filename>",
|
||||
INFO_ERROR, 0);
|
||||
while (isspace(*param))
|
||||
while (my_isspace(system_charset_info,*param))
|
||||
param++;
|
||||
end=strmake(source_name,param,sizeof(source_name)-1);
|
||||
while (end > source_name && (isspace(end[-1]) || iscntrl(end[-1])))
|
||||
while (end > source_name && (my_isspace(system_charset_info,end[-1]) ||
|
||||
my_iscntrl(system_charset_info,end[-1])))
|
||||
end--;
|
||||
end[0]=0;
|
||||
unpack_filename(source_name,source_name);
|
||||
@@ -2145,7 +2163,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
|
||||
char *tmp;
|
||||
char buff[256];
|
||||
|
||||
while (isspace(*line))
|
||||
while (my_isspace(system_charset_info,*line))
|
||||
line++;
|
||||
strnmov(buff,line,sizeof(buff)-1); // Don't destroy history
|
||||
if (buff[0] == '\\') // Short command
|
||||
@@ -2329,7 +2347,7 @@ com_status(String *buffer __attribute__((unused)),
|
||||
tee_fprintf(stdout, "Protocol version:\t%d\n", mysql_get_proto_info(&mysql));
|
||||
tee_fprintf(stdout, "Connection:\t\t%s\n", mysql_get_host_info(&mysql));
|
||||
tee_fprintf(stdout, "Client characterset:\t%s\n",
|
||||
default_charset_info->name);
|
||||
system_charset_info->name);
|
||||
tee_fprintf(stdout, "Server characterset:\t%s\n", mysql.charset->name);
|
||||
if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket)
|
||||
tee_fprintf(stdout, "TCP port:\t\t%d\n", mysql.port);
|
||||
@@ -2438,7 +2456,7 @@ static void remove_cntrl(String &buffer)
|
||||
{
|
||||
char *start,*end;
|
||||
end=(start=(char*) buffer.ptr())+buffer.length();
|
||||
while (start < end && !isgraph(end[-1]))
|
||||
while (start < end && !my_isgraph(system_charset_info,end[-1]))
|
||||
end--;
|
||||
buffer.length((uint) (end-start));
|
||||
}
|
||||
|
Reference in New Issue
Block a user