Skip to content

Commit

Permalink
Commit resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Buggynours committed Sep 18, 2015
2 parents f4fe138 + 79140b0 commit 9c6405f
Show file tree
Hide file tree
Showing 2,447 changed files with 98,161 additions and 33,333 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ storage/connect/mysql-test/connect/std_data/*.dat binary
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.frm binary
*.MYD binary
*.MYI binary

*.c diff=cpp
*.h diff=cpp
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ IF(WIN32)
ADD_SUBDIRECTORY(win/upgrade_wizard)
ADD_SUBDIRECTORY(win/packaging)
ENDIF()
ADD_SUBDIRECTORY(packaging/solaris)


INCLUDE(for_clients)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=1
MYSQL_VERSION_PATCH=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=
3 changes: 2 additions & 1 deletion client/mysql_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ int main(int argc, char **argv)
printf("This installation of MySQL is already upgraded to %s, "
"use --force if you still need to run mysql_upgrade\n",
MYSQL_SERVER_VERSION);
die(NULL);
goto end;
}

if (opt_version_check && check_version_match())
Expand Down Expand Up @@ -1138,6 +1138,7 @@ int main(int argc, char **argv)

DBUG_ASSERT(phase == phases_total);

end:
free_used_memory();
my_end(my_end_arg);
exit(0);
Expand Down
11 changes: 8 additions & 3 deletions client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ static Exit_status check_header(IO_CACHE* file,
Format_description_log_event *new_description_event;
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(new_description_event= (Format_description_log_event*)
Log_event::read_log_event(file, glob_description_event,
Log_event::read_log_event(file, 0, glob_description_event,
opt_verify_binlog_checksum)))
/* EOF can't be hit here normally, so it's a real error */
{
Expand Down Expand Up @@ -2274,7 +2274,7 @@ static Exit_status check_header(IO_CACHE* file,
{
Log_event *ev;
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(ev= Log_event::read_log_event(file, glob_description_event,
if (!(ev= Log_event::read_log_event(file, 0, glob_description_event,
opt_verify_binlog_checksum)))
{
/* EOF can't be hit here normally, so it's a real error */
Expand Down Expand Up @@ -2388,7 +2388,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
char llbuff[21];
my_off_t old_off = my_b_tell(file);

Log_event* ev = Log_event::read_log_event(file, glob_description_event,
Log_event* ev = Log_event::read_log_event(file, 0, glob_description_event,
opt_verify_binlog_checksum);
if (!ev)
{
Expand Down Expand Up @@ -2575,6 +2575,11 @@ void *sql_alloc(size_t size)
return alloc_root(&s_mem_root, size);
}

struct encryption_service_st encryption_handler=
{
0, 0, 0, 0, 0, 0, 0
};

/*
We must include this here as it's compiled with different options for
the server
Expand Down
41 changes: 33 additions & 8 deletions client/mysqlcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static int first_error = 0;
static char *opt_skip_database;
DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
DYNAMIC_ARRAY views4repair;
static char *shared_memory_base_name=0;
static uint opt_protocol=0;

Expand Down Expand Up @@ -878,11 +879,19 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
switch (what_to_do) {
case DO_CHECK:
op = "CHECK";
if (opt_quick) end = strmov(end, " QUICK");
if (opt_fast) end = strmov(end, " FAST");
if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */
if (opt_extended) end = strmov(end, " EXTENDED");
if (opt_check_only_changed) end = strmov(end, " CHANGED");
if (view)
{
if (opt_fast || opt_check_only_changed)
DBUG_RETURN(0);
}
else
{
if (opt_quick) end = strmov(end, " QUICK");
if (opt_fast) end = strmov(end, " FAST");
if (opt_extended) end = strmov(end, " EXTENDED");
if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */
if (opt_check_only_changed) end = strmov(end, " CHANGED");
}
if (opt_upgrade) end = strmov(end, " FOR UPGRADE");
break;
case DO_REPAIR:
Expand Down Expand Up @@ -967,6 +976,7 @@ static void print_result()
uint length_of_db;
uint i;
my_bool found_error=0, table_rebuild=0;
DYNAMIC_ARRAY *array4repair= &tables4repair;
DBUG_ENTER("print_result");

res = mysql_use_result(sock);
Expand Down Expand Up @@ -1003,9 +1013,10 @@ static void print_result()
else
{
char *table_name= prev + (length_of_db+1);
insert_dynamic(&tables4repair, table_name);
insert_dynamic(array4repair, table_name);
}
}
array4repair= &tables4repair;
found_error=0;
table_rebuild=0;
prev_alter[0]= 0;
Expand All @@ -1021,8 +1032,11 @@ static void print_result()
we have to run upgrade on it. In this case we write a nicer message
than "Please do "REPAIR TABLE""...
*/
if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR TABLE"))
if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR "))
{
printf("%-50s %s", row[0], "Needs upgrade");
array4repair= strstr(row[3], "VIEW") ? &views4repair : &tables4repair;
}
else
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
if (opt_auto_repair && strcmp(row[2],"note"))
Expand Down Expand Up @@ -1053,7 +1067,7 @@ static void print_result()
else
{
char *table_name= prev + (length_of_db+1);
insert_dynamic(&tables4repair, table_name);
insert_dynamic(array4repair, table_name);
}
}
mysql_free_result(res);
Expand Down Expand Up @@ -1173,6 +1187,8 @@ int main(int argc, char **argv)
if (opt_auto_repair &&
(my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0)) ||
my_init_dynamic_array(&views4repair, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0)) ||
my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0)) ||
my_init_dynamic_array(&alter_table_cmds, MAX_ALTER_STR_SIZE, 0, 1,
Expand Down Expand Up @@ -1203,15 +1219,24 @@ int main(int argc, char **argv)
rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i));
for (i = 0; i < alter_table_cmds.elements ; i++)
run_query((char*) dynamic_array_ptr(&alter_table_cmds, i), 1);
if (!opt_silent && views4repair.elements)
puts("\nRepairing views");
for (i = 0; i < views4repair.elements ; i++)
{
char *name= (char*) dynamic_array_ptr(&views4repair, i);
handle_request_for_tables(name, fixed_name_length(name), TRUE);
}
}
ret= MY_TEST(first_error);

end:
dbDisconnect(current_host);
if (opt_auto_repair)
{
delete_dynamic(&views4repair);
delete_dynamic(&tables4repair);
delete_dynamic(&tables4rebuild);
delete_dynamic(&alter_table_cmds);
}
end1:
my_free(opt_password);
Expand Down
19 changes: 12 additions & 7 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
static char *alloc_query_str(ulong size);

static void field_escape(DYNAMIC_STRING* in, const char *from);
static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_med= 1,
quick= 1, extended_insert= 1,
lock_tables=1,ignore_errors=0,flush_logs=0,flush_privileges=0,
opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
Expand Down Expand Up @@ -203,6 +203,8 @@ const char *compatible_mode_names[]=
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
"", compatible_mode_names, NULL};

#define MED_ENGINES "MRG_MyISAM, MRG_ISAM, CONNECT, OQGRAPH, SPIDER, VP, FEDERATED"

HASH ignore_table;

static struct my_option my_long_options[] =
Expand Down Expand Up @@ -431,6 +433,9 @@ static struct my_option my_long_options[] =
NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data", 'd', "No row information.", &opt_no_data,
&opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data-med", 0, "No row information for engines that "
"Manage External Data (" MED_ENGINES ").", &opt_no_data_med,
&opt_no_data_med, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"no-set-names", 'N', "Same as --skip-set-charset.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"opt", OPT_OPTIMIZE,
Expand Down Expand Up @@ -5506,12 +5511,12 @@ char check_if_ignore_table(const char *table_name, char *table_type)
/*
If these two types, we do want to skip dumping the table
*/
if (!opt_no_data &&
(!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") ||
!strcmp(table_type,"MRG_ISAM") ||
!strcmp(table_type,"CONNECT") ||
!strcmp(table_type,"FEDERATED")))
result= IGNORE_DATA;
if (!opt_no_data && opt_no_data_med)
{
const char *found= strstr(" " MED_ENGINES ",", table_type);
if (found && found[-1] == ' ' && found[strlen(table_type)] == ',')
result= IGNORE_DATA;
}
}
mysql_free_result(res);
DBUG_RETURN(result);
Expand Down
7 changes: 6 additions & 1 deletion client/mysqlimport.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


/* Global Thread counter */
uint counter;
uint counter= 0;
pthread_mutex_t counter_mutex;
pthread_cond_t count_threshhold;

Expand Down Expand Up @@ -489,6 +489,11 @@ static void safe_exit(int error, MYSQL *mysql)
{
if (error && ignore_errors)
return;

/* in multi-threaded mode protect from concurrent safe_exit's */
if (counter)
pthread_mutex_lock(&counter_mutex);

if (mysql)
mysql_close(mysql);

Expand Down
49 changes: 41 additions & 8 deletions client/mysqlslap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright (c) 2005, 2012, Oracle and/or its affiliates.
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
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
Expand Down Expand Up @@ -242,7 +243,7 @@ void print_conclusions_csv(conclusions *con);
void generate_stats(conclusions *con, option_string *eng, stats *sptr);
uint parse_comma(const char *string, uint **range);
uint parse_delimiter(const char *script, statement **stmt, char delm);
uint parse_option(const char *origin, option_string **stmt, char delm);
int parse_option(const char *origin, option_string **stmt, char delm);
static int drop_schema(MYSQL *mysql, const char *db);
uint get_random_string(char *buf);
static statement *build_table_string(void);
Expand Down Expand Up @@ -1264,7 +1265,13 @@ get_options(int *argc,char ***argv)
if (num_int_cols_opt)
{
option_string *str;
parse_option(num_int_cols_opt, &str, ',');
if(parse_option(num_int_cols_opt, &str, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option "
"'number-int-cols'\n");
option_cleanup(str);
return 1;
}
num_int_cols= atoi(str->string);
if (str->option)
num_int_cols_index= atoi(str->option);
Expand All @@ -1275,7 +1282,13 @@ get_options(int *argc,char ***argv)
if (num_char_cols_opt)
{
option_string *str;
parse_option(num_char_cols_opt, &str, ',');
if(parse_option(num_char_cols_opt, &str, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option "
"'number-char-cols'\n");
option_cleanup(str);
return 1;
}
num_char_cols= atoi(str->string);
if (str->option)
num_char_cols_index= atoi(str->option);
Expand Down Expand Up @@ -1512,7 +1525,13 @@ get_options(int *argc,char ***argv)
printf("Parsing engines to use.\n");

if (default_engine)
parse_option(default_engine, &engine_options, ',');
{
if(parse_option(default_engine, &engine_options, ',') == -1)
{
fprintf(stderr, "Invalid value specified for the option 'engine'\n");
return 1;
}
}

if (tty_password)
opt_password= get_tty_password(NullS);
Expand Down Expand Up @@ -1989,7 +2008,7 @@ pthread_handler_t run_task(void *p)
DBUG_RETURN(0);
}

uint
int
parse_option(const char *origin, option_string **stmt, char delm)
{
char *retstr;
Expand All @@ -2014,6 +2033,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
char buffer[HUGE_STRING_LENGTH]= "";
char *buffer_ptr;

/*
Return an error if the length of the any of the comma seprated value
exceeds HUGE_STRING_LENGTH.
*/
if ((size_t)(retstr - ptr) > HUGE_STRING_LENGTH)
return -1;

count++;
strncpy(buffer, ptr, (size_t)(retstr - ptr));
/*
Expand Down Expand Up @@ -2053,6 +2079,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
{
char *origin_ptr;

/*
Return an error if the length of the any of the comma seprated value
exceeds HUGE_STRING_LENGTH.
*/
if (strlen(ptr) > HUGE_STRING_LENGTH)
return -1;

if ((origin_ptr= strchr(ptr, ':')))
{
char *option_ptr;
Expand All @@ -2063,13 +2096,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
option_ptr= (char *)ptr + 1 + tmp->length;

/* Move past the : and the first string */
tmp->option_length= (size_t)((ptr + length) - option_ptr);
tmp->option_length= strlen(option_ptr);
tmp->option= my_strndup(option_ptr, tmp->option_length,
MYF(MY_FAE));
}
else
{
tmp->length= (size_t)((ptr + length) - ptr);
tmp->length= strlen(ptr);
tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE));
}

Expand Down
Loading

0 comments on commit 9c6405f

Please sign in to comment.