mirror of
https://github.com/MariaDB/server.git
synced 2026-05-03 13:45:34 +02:00
Merge 10.1 into 10.2
This commit is contained in:
commit
8f643e2063
320 changed files with 8039 additions and 6155 deletions
|
|
@ -3061,7 +3061,6 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
|||
{
|
||||
unsigned int num_fields= mysql_num_fields(result);
|
||||
my_ulonglong num_rows= mysql_num_rows(result);
|
||||
mysql_fetch_fields(result);
|
||||
if (num_fields==3 && num_rows==1)
|
||||
{
|
||||
if (!(cur= mysql_fetch_row(result)))
|
||||
|
|
|
|||
|
|
@ -1130,7 +1130,7 @@ static int check_version_match(void)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char self_name[FN_REFLEN];
|
||||
char self_name[FN_REFLEN + 1];
|
||||
|
||||
MY_INIT(argv[0]);
|
||||
|
||||
|
|
@ -1138,7 +1138,7 @@ int main(int argc, char **argv)
|
|||
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
|
||||
#endif
|
||||
{
|
||||
strncpy(self_name, argv[0], FN_REFLEN);
|
||||
strmake_buf(self_name, argv[0]);
|
||||
}
|
||||
|
||||
if (init_dynamic_string(&ds_args, "", 512, 256) ||
|
||||
|
|
|
|||
|
|
@ -616,6 +616,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
|
|||
|
||||
static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||
{
|
||||
int ret = 0;
|
||||
const char *status;
|
||||
/*
|
||||
MySQL documentation relies on the fact that mysqladmin will
|
||||
|
|
@ -1106,7 +1107,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
if (strcmp(typed_password, verified) != 0)
|
||||
{
|
||||
my_printf_error(0,"Passwords don't match",MYF(ME_BELL));
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto password_done;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1133,7 +1135,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
{
|
||||
my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'",
|
||||
error_flags, mysql_error(mysql));
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto password_done;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1144,7 +1147,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
"Could not get old_passwords setting from "
|
||||
"server; error: '%s'",
|
||||
error_flags, mysql_error(mysql));
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto password_done;
|
||||
}
|
||||
if (!mysql_num_rows(res))
|
||||
old= 1;
|
||||
|
|
@ -1169,15 +1173,15 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
{
|
||||
my_printf_error(0, "Can't turn off logging; error: '%s'",
|
||||
error_flags, mysql_error(mysql));
|
||||
return -1;
|
||||
ret = -1;
|
||||
}
|
||||
else
|
||||
if (mysql_query(mysql,buff))
|
||||
{
|
||||
if (mysql_errno(mysql)!=1290)
|
||||
{
|
||||
my_printf_error(0,"unable to change password; error: '%s'",
|
||||
error_flags, mysql_error(mysql));
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1191,9 +1195,10 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
" --skip-grant-tables).\n"
|
||||
"Use: \"mysqladmin flush-privileges password '*'\""
|
||||
" instead", error_flags);
|
||||
return -1;
|
||||
}
|
||||
ret = -1;
|
||||
}
|
||||
password_done:
|
||||
/* free up memory from prompted password */
|
||||
if (typed_password != argv[1])
|
||||
{
|
||||
|
|
@ -1300,7 +1305,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2480,7 +2480,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
|
||||
|
||||
size_t tlen = strlen(logname);
|
||||
if (tlen > UINT_MAX)
|
||||
if (tlen > sizeof(buf) - 10)
|
||||
{
|
||||
error("Log name too long.");
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
|
|
|
|||
|
|
@ -2851,6 +2851,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
|||
|
||||
my_free(scv_buff);
|
||||
|
||||
if (path)
|
||||
my_fclose(sql_file, MYF(MY_WME));
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
else
|
||||
|
|
@ -5941,8 +5943,7 @@ static my_bool get_view_structure(char *table, char* db)
|
|||
dynstr_free(&ds_view);
|
||||
}
|
||||
|
||||
if (switch_character_set_results(mysql, default_charset))
|
||||
DBUG_RETURN(1);
|
||||
switch_character_set_results(mysql, default_charset);
|
||||
|
||||
/* If a separate .sql file was opened, close it now */
|
||||
if (sql_file != md_result_file)
|
||||
|
|
|
|||
|
|
@ -1720,13 +1720,12 @@ void log_msg(const char *fmt, ...)
|
|||
int cat_file(DYNAMIC_STRING* ds, const char* filename)
|
||||
{
|
||||
int fd;
|
||||
size_t len;
|
||||
int len;
|
||||
char buff[16384];
|
||||
|
||||
if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
|
||||
return 1;
|
||||
while((len= my_read(fd, (uchar*)&buff,
|
||||
sizeof(buff)-1, MYF(0))) > 0)
|
||||
while((len= (int)my_read(fd, (uchar*)&buff, sizeof(buff)-1, MYF(0))) > 0)
|
||||
{
|
||||
char *p= buff, *start= buff,*end=buff+len;
|
||||
while (p < end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue