Skip to content

Commit 9c6405f

Browse files
committed
Commit resolved conflicts
2 parents f4fe138 + 79140b0 commit 9c6405f

File tree

2,447 files changed

+98161
-33333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,447 files changed

+98161
-33333
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ storage/connect/mysql-test/connect/std_data/*.dat binary
2020
# Denote all files that are truly binary and should not be modified.
2121
*.png binary
2222
*.jpg binary
23+
*.frm binary
24+
*.MYD binary
25+
*.MYI binary
2326

2427
*.c diff=cpp
2528
*.h diff=cpp

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ IF(WIN32)
401401
ADD_SUBDIRECTORY(win/upgrade_wizard)
402402
ADD_SUBDIRECTORY(win/packaging)
403403
ENDIF()
404-
ADD_SUBDIRECTORY(packaging/solaris)
405404

406405

407406
INCLUDE(for_clients)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=10
22
MYSQL_VERSION_MINOR=1
3-
MYSQL_VERSION_PATCH=5
3+
MYSQL_VERSION_PATCH=8
44
MYSQL_VERSION_EXTRA=

client/mysql_upgrade.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ int main(int argc, char **argv)
11091109
printf("This installation of MySQL is already upgraded to %s, "
11101110
"use --force if you still need to run mysql_upgrade\n",
11111111
MYSQL_SERVER_VERSION);
1112-
die(NULL);
1112+
goto end;
11131113
}
11141114

11151115
if (opt_version_check && check_version_match())
@@ -1138,6 +1138,7 @@ int main(int argc, char **argv)
11381138

11391139
DBUG_ASSERT(phase == phases_total);
11401140

1141+
end:
11411142
free_used_memory();
11421143
my_end(my_end_arg);
11431144
exit(0);

client/mysqlbinlog.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ static Exit_status check_header(IO_CACHE* file,
22402240
Format_description_log_event *new_description_event;
22412241
my_b_seek(file, tmp_pos); /* seek back to event's start */
22422242
if (!(new_description_event= (Format_description_log_event*)
2243-
Log_event::read_log_event(file, glob_description_event,
2243+
Log_event::read_log_event(file, 0, glob_description_event,
22442244
opt_verify_binlog_checksum)))
22452245
/* EOF can't be hit here normally, so it's a real error */
22462246
{
@@ -2274,7 +2274,7 @@ static Exit_status check_header(IO_CACHE* file,
22742274
{
22752275
Log_event *ev;
22762276
my_b_seek(file, tmp_pos); /* seek back to event's start */
2277-
if (!(ev= Log_event::read_log_event(file, glob_description_event,
2277+
if (!(ev= Log_event::read_log_event(file, 0, glob_description_event,
22782278
opt_verify_binlog_checksum)))
22792279
{
22802280
/* EOF can't be hit here normally, so it's a real error */
@@ -2388,7 +2388,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
23882388
char llbuff[21];
23892389
my_off_t old_off = my_b_tell(file);
23902390

2391-
Log_event* ev = Log_event::read_log_event(file, glob_description_event,
2391+
Log_event* ev = Log_event::read_log_event(file, 0, glob_description_event,
23922392
opt_verify_binlog_checksum);
23932393
if (!ev)
23942394
{
@@ -2575,6 +2575,11 @@ void *sql_alloc(size_t size)
25752575
return alloc_root(&s_mem_root, size);
25762576
}
25772577

2578+
struct encryption_service_st encryption_handler=
2579+
{
2580+
0, 0, 0, 0, 0, 0, 0
2581+
};
2582+
25782583
/*
25792584
We must include this here as it's compiled with different options for
25802585
the server

client/mysqlcheck.c

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ static char *opt_plugin_dir= 0, *opt_default_auth= 0;
5454
static int first_error = 0;
5555
static char *opt_skip_database;
5656
DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
57+
DYNAMIC_ARRAY views4repair;
5758
static char *shared_memory_base_name=0;
5859
static uint opt_protocol=0;
5960

@@ -878,11 +879,19 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
878879
switch (what_to_do) {
879880
case DO_CHECK:
880881
op = "CHECK";
881-
if (opt_quick) end = strmov(end, " QUICK");
882-
if (opt_fast) end = strmov(end, " FAST");
883-
if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */
884-
if (opt_extended) end = strmov(end, " EXTENDED");
885-
if (opt_check_only_changed) end = strmov(end, " CHANGED");
882+
if (view)
883+
{
884+
if (opt_fast || opt_check_only_changed)
885+
DBUG_RETURN(0);
886+
}
887+
else
888+
{
889+
if (opt_quick) end = strmov(end, " QUICK");
890+
if (opt_fast) end = strmov(end, " FAST");
891+
if (opt_extended) end = strmov(end, " EXTENDED");
892+
if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */
893+
if (opt_check_only_changed) end = strmov(end, " CHANGED");
894+
}
886895
if (opt_upgrade) end = strmov(end, " FOR UPGRADE");
887896
break;
888897
case DO_REPAIR:
@@ -967,6 +976,7 @@ static void print_result()
967976
uint length_of_db;
968977
uint i;
969978
my_bool found_error=0, table_rebuild=0;
979+
DYNAMIC_ARRAY *array4repair= &tables4repair;
970980
DBUG_ENTER("print_result");
971981

972982
res = mysql_use_result(sock);
@@ -1003,9 +1013,10 @@ static void print_result()
10031013
else
10041014
{
10051015
char *table_name= prev + (length_of_db+1);
1006-
insert_dynamic(&tables4repair, table_name);
1016+
insert_dynamic(array4repair, table_name);
10071017
}
10081018
}
1019+
array4repair= &tables4repair;
10091020
found_error=0;
10101021
table_rebuild=0;
10111022
prev_alter[0]= 0;
@@ -1021,8 +1032,11 @@ static void print_result()
10211032
we have to run upgrade on it. In this case we write a nicer message
10221033
than "Please do "REPAIR TABLE""...
10231034
*/
1024-
if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR TABLE"))
1035+
if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR "))
1036+
{
10251037
printf("%-50s %s", row[0], "Needs upgrade");
1038+
array4repair= strstr(row[3], "VIEW") ? &views4repair : &tables4repair;
1039+
}
10261040
else
10271041
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
10281042
if (opt_auto_repair && strcmp(row[2],"note"))
@@ -1053,7 +1067,7 @@ static void print_result()
10531067
else
10541068
{
10551069
char *table_name= prev + (length_of_db+1);
1056-
insert_dynamic(&tables4repair, table_name);
1070+
insert_dynamic(array4repair, table_name);
10571071
}
10581072
}
10591073
mysql_free_result(res);
@@ -1173,6 +1187,8 @@ int main(int argc, char **argv)
11731187
if (opt_auto_repair &&
11741188
(my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,
11751189
64, MYF(0)) ||
1190+
my_init_dynamic_array(&views4repair, sizeof(char)*(NAME_LEN*2+2),16,
1191+
64, MYF(0)) ||
11761192
my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,
11771193
64, MYF(0)) ||
11781194
my_init_dynamic_array(&alter_table_cmds, MAX_ALTER_STR_SIZE, 0, 1,
@@ -1203,15 +1219,24 @@ int main(int argc, char **argv)
12031219
rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i));
12041220
for (i = 0; i < alter_table_cmds.elements ; i++)
12051221
run_query((char*) dynamic_array_ptr(&alter_table_cmds, i), 1);
1222+
if (!opt_silent && views4repair.elements)
1223+
puts("\nRepairing views");
1224+
for (i = 0; i < views4repair.elements ; i++)
1225+
{
1226+
char *name= (char*) dynamic_array_ptr(&views4repair, i);
1227+
handle_request_for_tables(name, fixed_name_length(name), TRUE);
1228+
}
12061229
}
12071230
ret= MY_TEST(first_error);
12081231

12091232
end:
12101233
dbDisconnect(current_host);
12111234
if (opt_auto_repair)
12121235
{
1236+
delete_dynamic(&views4repair);
12131237
delete_dynamic(&tables4repair);
12141238
delete_dynamic(&tables4rebuild);
1239+
delete_dynamic(&alter_table_cmds);
12151240
}
12161241
end1:
12171242
my_free(opt_password);

client/mysqldump.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
9797
static char *alloc_query_str(ulong size);
9898

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

206+
#define MED_ENGINES "MRG_MyISAM, MRG_ISAM, CONNECT, OQGRAPH, SPIDER, VP, FEDERATED"
207+
206208
HASH ignore_table;
207209

208210
static struct my_option my_long_options[] =
@@ -431,6 +433,9 @@ static struct my_option my_long_options[] =
431433
NO_ARG, 0, 0, 0, 0, 0, 0},
432434
{"no-data", 'd', "No row information.", &opt_no_data,
433435
&opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
436+
{"no-data-med", 0, "No row information for engines that "
437+
"Manage External Data (" MED_ENGINES ").", &opt_no_data_med,
438+
&opt_no_data_med, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
434439
{"no-set-names", 'N', "Same as --skip-set-charset.",
435440
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
436441
{"opt", OPT_OPTIMIZE,
@@ -5506,12 +5511,12 @@ char check_if_ignore_table(const char *table_name, char *table_type)
55065511
/*
55075512
If these two types, we do want to skip dumping the table
55085513
*/
5509-
if (!opt_no_data &&
5510-
(!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") ||
5511-
!strcmp(table_type,"MRG_ISAM") ||
5512-
!strcmp(table_type,"CONNECT") ||
5513-
!strcmp(table_type,"FEDERATED")))
5514-
result= IGNORE_DATA;
5514+
if (!opt_no_data && opt_no_data_med)
5515+
{
5516+
const char *found= strstr(" " MED_ENGINES ",", table_type);
5517+
if (found && found[-1] == ' ' && found[strlen(table_type)] == ',')
5518+
result= IGNORE_DATA;
5519+
}
55155520
}
55165521
mysql_free_result(res);
55175522
DBUG_RETURN(result);

client/mysqlimport.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
/* Global Thread counter */
39-
uint counter;
39+
uint counter= 0;
4040
pthread_mutex_t counter_mutex;
4141
pthread_cond_t count_threshhold;
4242

@@ -489,6 +489,11 @@ static void safe_exit(int error, MYSQL *mysql)
489489
{
490490
if (error && ignore_errors)
491491
return;
492+
493+
/* in multi-threaded mode protect from concurrent safe_exit's */
494+
if (counter)
495+
pthread_mutex_lock(&counter_mutex);
496+
492497
if (mysql)
493498
mysql_close(mysql);
494499

client/mysqlslap.c

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
Copyright (c) 2005, 2012, Oracle and/or its affiliates.
2+
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
3+
Copyright (c) 2010, 2015, MariaDB
34
45
This program is free software; you can redistribute it and/or modify
56
it under the terms of the GNU General Public License as published by
@@ -242,7 +243,7 @@ void print_conclusions_csv(conclusions *con);
242243
void generate_stats(conclusions *con, option_string *eng, stats *sptr);
243244
uint parse_comma(const char *string, uint **range);
244245
uint parse_delimiter(const char *script, statement **stmt, char delm);
245-
uint parse_option(const char *origin, option_string **stmt, char delm);
246+
int parse_option(const char *origin, option_string **stmt, char delm);
246247
static int drop_schema(MYSQL *mysql, const char *db);
247248
uint get_random_string(char *buf);
248249
static statement *build_table_string(void);
@@ -1264,7 +1265,13 @@ get_options(int *argc,char ***argv)
12641265
if (num_int_cols_opt)
12651266
{
12661267
option_string *str;
1267-
parse_option(num_int_cols_opt, &str, ',');
1268+
if(parse_option(num_int_cols_opt, &str, ',') == -1)
1269+
{
1270+
fprintf(stderr, "Invalid value specified for the option "
1271+
"'number-int-cols'\n");
1272+
option_cleanup(str);
1273+
return 1;
1274+
}
12681275
num_int_cols= atoi(str->string);
12691276
if (str->option)
12701277
num_int_cols_index= atoi(str->option);
@@ -1275,7 +1282,13 @@ get_options(int *argc,char ***argv)
12751282
if (num_char_cols_opt)
12761283
{
12771284
option_string *str;
1278-
parse_option(num_char_cols_opt, &str, ',');
1285+
if(parse_option(num_char_cols_opt, &str, ',') == -1)
1286+
{
1287+
fprintf(stderr, "Invalid value specified for the option "
1288+
"'number-char-cols'\n");
1289+
option_cleanup(str);
1290+
return 1;
1291+
}
12791292
num_char_cols= atoi(str->string);
12801293
if (str->option)
12811294
num_char_cols_index= atoi(str->option);
@@ -1512,7 +1525,13 @@ get_options(int *argc,char ***argv)
15121525
printf("Parsing engines to use.\n");
15131526

15141527
if (default_engine)
1515-
parse_option(default_engine, &engine_options, ',');
1528+
{
1529+
if(parse_option(default_engine, &engine_options, ',') == -1)
1530+
{
1531+
fprintf(stderr, "Invalid value specified for the option 'engine'\n");
1532+
return 1;
1533+
}
1534+
}
15161535

15171536
if (tty_password)
15181537
opt_password= get_tty_password(NullS);
@@ -1989,7 +2008,7 @@ pthread_handler_t run_task(void *p)
19892008
DBUG_RETURN(0);
19902009
}
19912010

1992-
uint
2011+
int
19932012
parse_option(const char *origin, option_string **stmt, char delm)
19942013
{
19952014
char *retstr;
@@ -2014,6 +2033,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
20142033
char buffer[HUGE_STRING_LENGTH]= "";
20152034
char *buffer_ptr;
20162035

2036+
/*
2037+
Return an error if the length of the any of the comma seprated value
2038+
exceeds HUGE_STRING_LENGTH.
2039+
*/
2040+
if ((size_t)(retstr - ptr) > HUGE_STRING_LENGTH)
2041+
return -1;
2042+
20172043
count++;
20182044
strncpy(buffer, ptr, (size_t)(retstr - ptr));
20192045
/*
@@ -2053,6 +2079,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
20532079
{
20542080
char *origin_ptr;
20552081

2082+
/*
2083+
Return an error if the length of the any of the comma seprated value
2084+
exceeds HUGE_STRING_LENGTH.
2085+
*/
2086+
if (strlen(ptr) > HUGE_STRING_LENGTH)
2087+
return -1;
2088+
20562089
if ((origin_ptr= strchr(ptr, ':')))
20572090
{
20582091
char *option_ptr;
@@ -2063,13 +2096,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
20632096
option_ptr= (char *)ptr + 1 + tmp->length;
20642097

20652098
/* Move past the : and the first string */
2066-
tmp->option_length= (size_t)((ptr + length) - option_ptr);
2099+
tmp->option_length= strlen(option_ptr);
20672100
tmp->option= my_strndup(option_ptr, tmp->option_length,
20682101
MYF(MY_FAE));
20692102
}
20702103
else
20712104
{
2072-
tmp->length= (size_t)((ptr + length) - ptr);
2105+
tmp->length= strlen(ptr);
20732106
tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE));
20742107
}
20752108

0 commit comments

Comments
 (0)