Skip to content

Commit 5db2195

Browse files
author
Nirbhay Choubey
committed
Merge tag 'mariadb-10.0.28' into 10.0-galera
2 parents c9ded85 + eca8c32 commit 5db2195

File tree

307 files changed

+10671
-5195
lines changed

Some content is hidden

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

307 files changed

+10671
-5195
lines changed

CREDITS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Visma http://visma.com (2015 - 2016)
1010
Acronis http://acronis.com (2016)
1111
Nexedi https://www.nexedi.com (2016)
1212
Automattic https://automattic.com (2014 - 2016)
13+
Tencent Game DBA http://tencentdba.com/about (2016)
1314
Verkkokauppa.com https://www.verkkokauppa.com (2015 - 2016)
1415
Virtuozzo https://virtuozzo.com (2016)
1516

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
MYSQL_VERSION_MAJOR=10
22
MYSQL_VERSION_MINOR=0
3-
MYSQL_VERSION_PATCH=27
3+
MYSQL_VERSION_PATCH=28

client/mysql.cc

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ static void end_pager();
245245
static void init_tee(const char *);
246246
static void end_tee();
247247
static const char* construct_prompt();
248-
static char *get_arg(char *line, my_bool get_next_arg);
248+
enum get_arg_mode { CHECK, GET, GET_NEXT};
249+
static char *get_arg(char *line, get_arg_mode mode);
249250
static void init_username();
250251
static void add_int_to_prompt(int toadd);
251252
static int get_result_width(MYSQL_RES *res);
@@ -2257,7 +2258,7 @@ static COMMANDS *find_command(char *name)
22572258
if (!my_strnncoll(&my_charset_latin1, (uchar*) name, len,
22582259
(uchar*) commands[i].name, len) &&
22592260
(commands[i].name[len] == '\0') &&
2260-
(!end || commands[i].takes_params))
2261+
(!end || (commands[i].takes_params && get_arg(name, CHECK))))
22612262
{
22622263
index= i;
22632264
break;
@@ -3177,7 +3178,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
31773178
char buff[256], *param;
31783179
CHARSET_INFO * new_cs;
31793180
strmake_buf(buff, line);
3180-
param= get_arg(buff, 0);
3181+
param= get_arg(buff, GET);
31813182
if (!param || !*param)
31823183
{
31833184
return put_info("Usage: \\C charset_name | charset charset_name",
@@ -4263,12 +4264,12 @@ com_connect(String *buffer, char *line)
42634264
#ifdef EXTRA_DEBUG
42644265
tmp[1]= 0;
42654266
#endif
4266-
tmp= get_arg(buff, 0);
4267+
tmp= get_arg(buff, GET);
42674268
if (tmp && *tmp)
42684269
{
42694270
my_free(current_db);
42704271
current_db= my_strdup(tmp, MYF(MY_WME));
4271-
tmp= get_arg(buff, 1);
4272+
tmp= get_arg(buff, GET_NEXT);
42724273
if (tmp)
42734274
{
42744275
my_free(current_host);
@@ -4371,7 +4372,7 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
43714372
char buff[256], *tmp;
43724373

43734374
strmake_buf(buff, line);
4374-
tmp= get_arg(buff, 0);
4375+
tmp= get_arg(buff, GET);
43754376

43764377
if (!tmp || !*tmp)
43774378
{
@@ -4402,7 +4403,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
44024403

44034404
bzero(buff, sizeof(buff));
44044405
strmake_buf(buff, line);
4405-
tmp= get_arg(buff, 0);
4406+
tmp= get_arg(buff, GET);
44064407
if (!tmp || !*tmp)
44074408
{
44084409
put_info("USE must be followed by a database name", INFO_ERROR);
@@ -4487,23 +4488,22 @@ com_nowarnings(String *buffer __attribute__((unused)),
44874488
}
44884489

44894490
/*
4490-
Gets argument from a command on the command line. If get_next_arg is
4491-
not defined, skips the command and returns the first argument. The
4492-
line is modified by adding zero to the end of the argument. If
4493-
get_next_arg is defined, then the function searches for end of string
4494-
first, after found, returns the next argument and adds zero to the
4495-
end. If you ever wish to use this feature, remember to initialize all
4496-
items in the array to zero first.
4491+
Gets argument from a command on the command line. If mode is not GET_NEXT,
4492+
skips the command and returns the first argument. The line is modified by
4493+
adding zero to the end of the argument. If mode is GET_NEXT, then the
4494+
function searches for end of string first, after found, returns the next
4495+
argument and adds zero to the end. If you ever wish to use this feature,
4496+
remember to initialize all items in the array to zero first.
44974497
*/
44984498

4499-
char *get_arg(char *line, my_bool get_next_arg)
4499+
static char *get_arg(char *line, get_arg_mode mode)
45004500
{
45014501
char *ptr, *start;
4502-
my_bool quoted= 0, valid_arg= 0;
4502+
bool short_cmd= false;
45034503
char qtype= 0;
45044504

45054505
ptr= line;
4506-
if (get_next_arg)
4506+
if (mode == GET_NEXT)
45074507
{
45084508
for (; *ptr; ptr++) ;
45094509
if (*(ptr + 1))
@@ -4514,7 +4514,7 @@ char *get_arg(char *line, my_bool get_next_arg)
45144514
/* skip leading white spaces */
45154515
while (my_isspace(charset_info, *ptr))
45164516
ptr++;
4517-
if (*ptr == '\\') // short command was used
4517+
if ((short_cmd= *ptr == '\\')) // short command was used
45184518
ptr+= 2;
45194519
else
45204520
while (*ptr &&!my_isspace(charset_info, *ptr)) // skip command
@@ -4527,24 +4527,28 @@ char *get_arg(char *line, my_bool get_next_arg)
45274527
if (*ptr == '\'' || *ptr == '\"' || *ptr == '`')
45284528
{
45294529
qtype= *ptr;
4530-
quoted= 1;
45314530
ptr++;
45324531
}
45334532
for (start=ptr ; *ptr; ptr++)
45344533
{
4535-
if (*ptr == '\\' && ptr[1]) // escaped character
4534+
if ((*ptr == '\\' && ptr[1]) || // escaped character
4535+
(!short_cmd && qtype && *ptr == qtype && ptr[1] == qtype)) // quote
45364536
{
4537-
// Remove the backslash
4538-
strmov_overlapp(ptr, ptr+1);
4537+
// Remove (or skip) the backslash (or a second quote)
4538+
if (mode != CHECK)
4539+
strmov_overlapp(ptr, ptr+1);
4540+
else
4541+
ptr++;
45394542
}
4540-
else if ((!quoted && *ptr == ' ') || (quoted && *ptr == qtype))
4543+
else if (*ptr == (qtype ? qtype : ' '))
45414544
{
4542-
*ptr= 0;
4545+
qtype= 0;
4546+
if (mode != CHECK)
4547+
*ptr= 0;
45434548
break;
45444549
}
45454550
}
4546-
valid_arg= ptr != start;
4547-
return valid_arg ? start : NullS;
4551+
return ptr != start && !qtype ? start : NullS;
45484552
}
45494553

45504554

client/mysqldump.c

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,7 @@ static int dump_all_tablespaces();
575575
static int dump_tablespaces_for_tables(char *db, char **table_names, int tables);
576576
static int dump_tablespaces_for_databases(char** databases);
577577
static int dump_tablespaces(char* ts_where);
578-
static void print_comment(FILE *sql_file, my_bool is_error, const char *format,
579-
...);
580-
578+
static void print_comment(FILE *, my_bool, const char *, ...);
581579

582580
/*
583581
Print the supplied message if in verbose mode
@@ -655,6 +653,30 @@ static void short_usage(FILE *f)
655653
}
656654

657655

656+
/** returns a string fixed to be safely printed inside a -- comment
657+
658+
that is, any new line in it gets prefixed with --
659+
*/
660+
static const char *fix_for_comment(const char *ident)
661+
{
662+
static char buf[1024];
663+
char c, *s= buf;
664+
665+
while ((c= *s++= *ident++))
666+
{
667+
if (s >= buf + sizeof(buf) - 10)
668+
{
669+
strmov(s, "...");
670+
break;
671+
}
672+
if (c == '\n')
673+
s= strmov(s, "-- ");
674+
}
675+
676+
return buf;
677+
}
678+
679+
658680
static void write_header(FILE *sql_file, char *db_name)
659681
{
660682
if (opt_xml)
@@ -677,8 +699,8 @@ static void write_header(FILE *sql_file, char *db_name)
677699
DUMP_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE,
678700
MACHINE_TYPE);
679701
print_comment(sql_file, 0, "-- Host: %s Database: %s\n",
680-
current_host ? current_host : "localhost",
681-
db_name ? db_name : "");
702+
fix_for_comment(current_host ? current_host : "localhost"),
703+
fix_for_comment(db_name ? db_name : ""));
682704
print_comment(sql_file, 0,
683705
"-- ------------------------------------------------------\n"
684706
);
@@ -2224,7 +2246,8 @@ static uint dump_events_for_db(char *db)
22242246

22252247
/* nice comments */
22262248
print_comment(sql_file, 0,
2227-
"\n--\n-- Dumping events for database '%s'\n--\n", db);
2249+
"\n--\n-- Dumping events for database '%s'\n--\n",
2250+
fix_for_comment(db));
22282251

22292252
/*
22302253
not using "mysql_query_with_error_report" because we may have not
@@ -2436,7 +2459,8 @@ static uint dump_routines_for_db(char *db)
24362459

24372460
/* nice comments */
24382461
print_comment(sql_file, 0,
2439-
"\n--\n-- Dumping routines for database '%s'\n--\n", db);
2462+
"\n--\n-- Dumping routines for database '%s'\n--\n",
2463+
fix_for_comment(db));
24402464

24412465
/*
24422466
not using "mysql_query_with_error_report" because we may have not
@@ -2731,11 +2755,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
27312755
if (strcmp (table_type, "VIEW") == 0) /* view */
27322756
print_comment(sql_file, 0,
27332757
"\n--\n-- Temporary table structure for view %s\n--\n\n",
2734-
result_table);
2758+
fix_for_comment(result_table));
27352759
else
27362760
print_comment(sql_file, 0,
27372761
"\n--\n-- Table structure for table %s\n--\n\n",
2738-
result_table);
2762+
fix_for_comment(result_table));
27392763

27402764
if (opt_drop)
27412765
{
@@ -2977,7 +3001,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
29773001

29783002
print_comment(sql_file, 0,
29793003
"\n--\n-- Table structure for table %s\n--\n\n",
2980-
result_table);
3004+
fix_for_comment(result_table));
29813005
if (opt_drop)
29823006
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table);
29833007
if (!opt_xml)
@@ -3684,21 +3708,21 @@ static void dump_table(char *table, char *db)
36843708
{
36853709
print_comment(md_result_file, 0,
36863710
"\n--\n-- Dumping data for table %s\n--\n",
3687-
result_table);
3711+
fix_for_comment(result_table));
36883712

36893713
dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * FROM ");
36903714
dynstr_append_checked(&query_string, result_table);
36913715

36923716
if (where)
36933717
{
3694-
print_comment(md_result_file, 0, "-- WHERE: %s\n", where);
3718+
print_comment(md_result_file, 0, "-- WHERE: %s\n", fix_for_comment(where));
36953719

36963720
dynstr_append_checked(&query_string, " WHERE ");
36973721
dynstr_append_checked(&query_string, where);
36983722
}
36993723
if (order_by)
37003724
{
3701-
print_comment(md_result_file, 0, "-- ORDER BY: %s\n", order_by);
3725+
print_comment(md_result_file, 0, "-- ORDER BY: %s\n", fix_for_comment(order_by));
37023726

37033727
dynstr_append_checked(&query_string, " ORDER BY ");
37043728
dynstr_append_checked(&query_string, order_by);
@@ -4208,7 +4232,7 @@ static int dump_tablespaces(char* ts_where)
42084232
if (first)
42094233
{
42104234
print_comment(md_result_file, 0, "\n--\n-- Logfile group: %s\n--\n",
4211-
row[0]);
4235+
fix_for_comment(row[0]));
42124236

42134237
fprintf(md_result_file, "\nCREATE");
42144238
}
@@ -4277,7 +4301,8 @@ static int dump_tablespaces(char* ts_where)
42774301
first= 1;
42784302
if (first)
42794303
{
4280-
print_comment(md_result_file, 0, "\n--\n-- Tablespace: %s\n--\n", row[0]);
4304+
print_comment(md_result_file, 0, "\n--\n-- Tablespace: %s\n--\n",
4305+
fix_for_comment(row[0]));
42814306
fprintf(md_result_file, "\nCREATE");
42824307
}
42834308
else
@@ -4481,7 +4506,8 @@ static int init_dumping(char *database, int init_func(char*))
44814506
char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
44824507

44834508
print_comment(md_result_file, 0,
4484-
"\n--\n-- Current Database: %s\n--\n", qdatabase);
4509+
"\n--\n-- Current Database: %s\n--\n",
4510+
fix_for_comment(qdatabase));
44854511

44864512
/* Call the view or table specific function */
44874513
init_func(qdatabase);
@@ -5672,7 +5698,7 @@ static my_bool get_view_structure(char *table, char* db)
56725698

56735699
print_comment(sql_file, 0,
56745700
"\n--\n-- Final view structure for view %s\n--\n\n",
5675-
result_table);
5701+
fix_for_comment(result_table));
56765702

56775703
/* Table might not exist if this view was dumped with --tab. */
56785704
fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", opt_quoted_table);

client/mysqltest.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,10 +3373,6 @@ void do_exec(struct st_command *command)
33733373
#endif
33743374
#endif
33753375

3376-
/* exec command is interpreted externally and will not take newlines */
3377-
while(replace(&ds_cmd, "\n", 1, " ", 1) == 0)
3378-
;
3379-
33803376
DBUG_PRINT("info", ("Executing '%s' as '%s'",
33813377
command->first_argument, ds_cmd.str));
33823378

cmake/cpack_rpm.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ SETA(CPACK_RPM_test_PACKAGE_PROVIDES
221221
"perl(mtr_io.pl)"
222222
"perl(mtr_match)"
223223
"perl(mtr_misc.pl)"
224+
"perl(mtr_gcov.pl)"
225+
"perl(mtr_gprof.pl)"
226+
"perl(mtr_process.pl)"
224227
"perl(mtr_report)"
225228
"perl(mtr_results)"
226229
"perl(mtr_unique)")

cmake/package_name.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ IF(NOT VERSION)
3030
SET(64BIT 1)
3131
ENDIF()
3232

33+
IF(NOT 64BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64")
34+
SET(DEFAULT_MACHINE "mips")
35+
ENDIF()
36+
3337
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
3438
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0)
3539
SET(DEFAULT_PLATFORM "win")

0 commit comments

Comments
 (0)