Skip to content

Commit 308c666

Browse files
author
Nirbhay Choubey
committed
Merge remote-tracking branch 'origin/5.5' into 5.5-galera
2 parents 04f92dd + eac8d95 commit 308c666

Some content is hidden

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

49 files changed

+871
-352
lines changed

VERSION

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

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);
@@ -2223,7 +2224,7 @@ static COMMANDS *find_command(char *name)
22232224
if (!my_strnncoll(&my_charset_latin1, (uchar*) name, len,
22242225
(uchar*) commands[i].name, len) &&
22252226
(commands[i].name[len] == '\0') &&
2226-
(!end || commands[i].takes_params))
2227+
(!end || (commands[i].takes_params && get_arg(name, CHECK))))
22272228
{
22282229
index= i;
22292230
break;
@@ -3143,7 +3144,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
31433144
char buff[256], *param;
31443145
CHARSET_INFO * new_cs;
31453146
strmake_buf(buff, line);
3146-
param= get_arg(buff, 0);
3147+
param= get_arg(buff, GET);
31473148
if (!param || !*param)
31483149
{
31493150
return put_info("Usage: \\C charset_name | charset charset_name",
@@ -4228,12 +4229,12 @@ com_connect(String *buffer, char *line)
42284229
#ifdef EXTRA_DEBUG
42294230
tmp[1]= 0;
42304231
#endif
4231-
tmp= get_arg(buff, 0);
4232+
tmp= get_arg(buff, GET);
42324233
if (tmp && *tmp)
42334234
{
42344235
my_free(current_db);
42354236
current_db= my_strdup(tmp, MYF(MY_WME));
4236-
tmp= get_arg(buff, 1);
4237+
tmp= get_arg(buff, GET_NEXT);
42374238
if (tmp)
42384239
{
42394240
my_free(current_host);
@@ -4336,7 +4337,7 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
43364337
char buff[256], *tmp;
43374338

43384339
strmake_buf(buff, line);
4339-
tmp= get_arg(buff, 0);
4340+
tmp= get_arg(buff, GET);
43404341

43414342
if (!tmp || !*tmp)
43424343
{
@@ -4367,7 +4368,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
43674368

43684369
bzero(buff, sizeof(buff));
43694370
strmake_buf(buff, line);
4370-
tmp= get_arg(buff, 0);
4371+
tmp= get_arg(buff, GET);
43714372
if (!tmp || !*tmp)
43724373
{
43734374
put_info("USE must be followed by a database name", INFO_ERROR);
@@ -4452,23 +4453,22 @@ com_nowarnings(String *buffer __attribute__((unused)),
44524453
}
44534454

44544455
/*
4455-
Gets argument from a command on the command line. If get_next_arg is
4456-
not defined, skips the command and returns the first argument. The
4457-
line is modified by adding zero to the end of the argument. If
4458-
get_next_arg is defined, then the function searches for end of string
4459-
first, after found, returns the next argument and adds zero to the
4460-
end. If you ever wish to use this feature, remember to initialize all
4461-
items in the array to zero first.
4456+
Gets argument from a command on the command line. If mode is not GET_NEXT,
4457+
skips the command and returns the first argument. The line is modified by
4458+
adding zero to the end of the argument. If mode is GET_NEXT, then the
4459+
function searches for end of string first, after found, returns the next
4460+
argument and adds zero to the end. If you ever wish to use this feature,
4461+
remember to initialize all items in the array to zero first.
44624462
*/
44634463

4464-
char *get_arg(char *line, my_bool get_next_arg)
4464+
static char *get_arg(char *line, get_arg_mode mode)
44654465
{
44664466
char *ptr, *start;
4467-
my_bool quoted= 0, valid_arg= 0;
4467+
bool short_cmd= false;
44684468
char qtype= 0;
44694469

44704470
ptr= line;
4471-
if (get_next_arg)
4471+
if (mode == GET_NEXT)
44724472
{
44734473
for (; *ptr; ptr++) ;
44744474
if (*(ptr + 1))
@@ -4479,7 +4479,7 @@ char *get_arg(char *line, my_bool get_next_arg)
44794479
/* skip leading white spaces */
44804480
while (my_isspace(charset_info, *ptr))
44814481
ptr++;
4482-
if (*ptr == '\\') // short command was used
4482+
if ((short_cmd= *ptr == '\\')) // short command was used
44834483
ptr+= 2;
44844484
else
44854485
while (*ptr &&!my_isspace(charset_info, *ptr)) // skip command
@@ -4492,24 +4492,28 @@ char *get_arg(char *line, my_bool get_next_arg)
44924492
if (*ptr == '\'' || *ptr == '\"' || *ptr == '`')
44934493
{
44944494
qtype= *ptr;
4495-
quoted= 1;
44964495
ptr++;
44974496
}
44984497
for (start=ptr ; *ptr; ptr++)
44994498
{
4500-
if (*ptr == '\\' && ptr[1]) // escaped character
4499+
if ((*ptr == '\\' && ptr[1]) || // escaped character
4500+
(!short_cmd && qtype && *ptr == qtype && ptr[1] == qtype)) // quote
45014501
{
4502-
// Remove the backslash
4503-
strmov_overlapp(ptr, ptr+1);
4502+
// Remove (or skip) the backslash (or a second quote)
4503+
if (mode != CHECK)
4504+
strmov_overlapp(ptr, ptr+1);
4505+
else
4506+
ptr++;
45044507
}
4505-
else if ((!quoted && *ptr == ' ') || (quoted && *ptr == qtype))
4508+
else if (*ptr == (qtype ? qtype : ' '))
45064509
{
4507-
*ptr= 0;
4510+
qtype= 0;
4511+
if (mode != CHECK)
4512+
*ptr= 0;
45084513
break;
45094514
}
45104515
}
4511-
valid_arg= ptr != start;
4512-
return valid_arg ? start : NullS;
4516+
return ptr != start && !qtype ? start : NullS;
45134517
}
45144518

45154519

client/mysqldump.c

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,7 @@ static int dump_all_tablespaces();
547547
static int dump_tablespaces_for_tables(char *db, char **table_names, int tables);
548548
static int dump_tablespaces_for_databases(char** databases);
549549
static int dump_tablespaces(char* ts_where);
550-
static void print_comment(FILE *sql_file, my_bool is_error, const char *format,
551-
...);
552-
550+
static void print_comment(FILE *, my_bool, const char *, ...);
553551

554552
/*
555553
Print the supplied message if in verbose mode
@@ -627,6 +625,30 @@ static void short_usage(FILE *f)
627625
}
628626

629627

628+
/** returns a string fixed to be safely printed inside a -- comment
629+
630+
that is, any new line in it gets prefixed with --
631+
*/
632+
static const char *fix_for_comment(const char *ident)
633+
{
634+
static char buf[1024];
635+
char c, *s= buf;
636+
637+
while ((c= *s++= *ident++))
638+
{
639+
if (s >= buf + sizeof(buf) - 10)
640+
{
641+
strmov(s, "...");
642+
break;
643+
}
644+
if (c == '\n')
645+
s= strmov(s, "-- ");
646+
}
647+
648+
return buf;
649+
}
650+
651+
630652
static void write_header(FILE *sql_file, char *db_name)
631653
{
632654
if (opt_xml)
@@ -649,8 +671,8 @@ static void write_header(FILE *sql_file, char *db_name)
649671
DUMP_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE,
650672
MACHINE_TYPE);
651673
print_comment(sql_file, 0, "-- Host: %s Database: %s\n",
652-
current_host ? current_host : "localhost",
653-
db_name ? db_name : "");
674+
fix_for_comment(current_host ? current_host : "localhost"),
675+
fix_for_comment(db_name ? db_name : ""));
654676
print_comment(sql_file, 0,
655677
"-- ------------------------------------------------------\n"
656678
);
@@ -2094,7 +2116,8 @@ static uint dump_events_for_db(char *db)
20942116

20952117
/* nice comments */
20962118
print_comment(sql_file, 0,
2097-
"\n--\n-- Dumping events for database '%s'\n--\n", db);
2119+
"\n--\n-- Dumping events for database '%s'\n--\n",
2120+
fix_for_comment(db));
20982121

20992122
/*
21002123
not using "mysql_query_with_error_report" because we may have not
@@ -2307,7 +2330,8 @@ static uint dump_routines_for_db(char *db)
23072330

23082331
/* nice comments */
23092332
print_comment(sql_file, 0,
2310-
"\n--\n-- Dumping routines for database '%s'\n--\n", db);
2333+
"\n--\n-- Dumping routines for database '%s'\n--\n",
2334+
fix_for_comment(db));
23112335

23122336
/*
23132337
not using "mysql_query_with_error_report" because we may have not
@@ -2580,11 +2604,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
25802604
if (strcmp (table_type, "VIEW") == 0) /* view */
25812605
print_comment(sql_file, 0,
25822606
"\n--\n-- Temporary table structure for view %s\n--\n\n",
2583-
result_table);
2607+
fix_for_comment(result_table));
25842608
else
25852609
print_comment(sql_file, 0,
25862610
"\n--\n-- Table structure for table %s\n--\n\n",
2587-
result_table);
2611+
fix_for_comment(result_table));
25882612

25892613
if (opt_drop)
25902614
{
@@ -2826,7 +2850,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
28262850

28272851
print_comment(sql_file, 0,
28282852
"\n--\n-- Table structure for table %s\n--\n\n",
2829-
result_table);
2853+
fix_for_comment(result_table));
28302854
if (opt_drop)
28312855
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table);
28322856
if (!opt_xml)
@@ -3530,21 +3554,21 @@ static void dump_table(char *table, char *db)
35303554
{
35313555
print_comment(md_result_file, 0,
35323556
"\n--\n-- Dumping data for table %s\n--\n",
3533-
result_table);
3557+
fix_for_comment(result_table));
35343558

35353559
dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * FROM ");
35363560
dynstr_append_checked(&query_string, result_table);
35373561

35383562
if (where)
35393563
{
3540-
print_comment(md_result_file, 0, "-- WHERE: %s\n", where);
3564+
print_comment(md_result_file, 0, "-- WHERE: %s\n", fix_for_comment(where));
35413565

35423566
dynstr_append_checked(&query_string, " WHERE ");
35433567
dynstr_append_checked(&query_string, where);
35443568
}
35453569
if (order_by)
35463570
{
3547-
print_comment(md_result_file, 0, "-- ORDER BY: %s\n", order_by);
3571+
print_comment(md_result_file, 0, "-- ORDER BY: %s\n", fix_for_comment(order_by));
35483572

35493573
dynstr_append_checked(&query_string, " ORDER BY ");
35503574
dynstr_append_checked(&query_string, order_by);
@@ -4053,7 +4077,7 @@ static int dump_tablespaces(char* ts_where)
40534077
if (first)
40544078
{
40554079
print_comment(md_result_file, 0, "\n--\n-- Logfile group: %s\n--\n",
4056-
row[0]);
4080+
fix_for_comment(row[0]));
40574081

40584082
fprintf(md_result_file, "\nCREATE");
40594083
}
@@ -4122,7 +4146,8 @@ static int dump_tablespaces(char* ts_where)
41224146
first= 1;
41234147
if (first)
41244148
{
4125-
print_comment(md_result_file, 0, "\n--\n-- Tablespace: %s\n--\n", row[0]);
4149+
print_comment(md_result_file, 0, "\n--\n-- Tablespace: %s\n--\n",
4150+
fix_for_comment(row[0]));
41264151
fprintf(md_result_file, "\nCREATE");
41274152
}
41284153
else
@@ -4326,7 +4351,8 @@ static int init_dumping(char *database, int init_func(char*))
43264351
char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
43274352

43284353
print_comment(md_result_file, 0,
4329-
"\n--\n-- Current Database: %s\n--\n", qdatabase);
4354+
"\n--\n-- Current Database: %s\n--\n",
4355+
fix_for_comment(qdatabase));
43304356

43314357
/* Call the view or table specific function */
43324358
init_func(qdatabase);
@@ -5356,7 +5382,7 @@ static my_bool get_view_structure(char *table, char* db)
53565382

53575383
print_comment(sql_file, 0,
53585384
"\n--\n-- Final view structure for view %s\n--\n\n",
5359-
result_table);
5385+
fix_for_comment(result_table));
53605386

53615387
/* Table might not exist if this view was dumped with --tab. */
53625388
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
@@ -3349,10 +3349,6 @@ void do_exec(struct st_command *command)
33493349
#endif
33503350
#endif
33513351

3352-
/* exec command is interpreted externally and will not take newlines */
3353-
while(replace(&ds_cmd, "\n", 1, " ", 1) == 0)
3354-
;
3355-
33563352
DBUG_PRINT("info", ("Executing '%s' as '%s'",
33573353
command->first_argument, ds_cmd.str));
33583354

extra/yassl/README

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@ before calling SSL_new();
1212

1313
*** end Note ***
1414

15+
yaSSL Release notes, version 2.4.2 (9/22/2016)
16+
This release of yaSSL fixes a medium security vulnerability. A fix for
17+
potential AES side channel leaks is included that a local user monitoring
18+
the same CPU core cache could exploit. VM users, hyper-threading users,
19+
and users where potential attackers have access to the CPU cache will need
20+
to update if they utilize AES.
21+
22+
DSA padding fixes for unusual sizes is included as well. Users with DSA
23+
certficiates should update.
24+
25+
yaSSL Release notes, version 2.4.0 (5/20/2016)
26+
This release of yaSSL fixes the OpenSSL compatibility function
27+
SSL_CTX_load_verify_locations() when using the path directory to allow
28+
unlimited path sizes. Minor Windows build fixes are included.
29+
No high level security fixes in this version but we always recommend
30+
updating.
31+
32+
1533
yaSSL Release notes, version 2.3.9b (2/03/2016)
1634
This release of yaSSL fixes the OpenSSL compatibility function
1735
X509_NAME_get_index_by_NID() to use the actual index of the common name

extra/yassl/certs/dsa-cert.pem

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
-----BEGIN CERTIFICATE-----
2-
MIIDqzCCA2ugAwIBAgIJAMGqrgDU6DyhMAkGByqGSM44BAMwgY4xCzAJBgNVBAYT
2+
MIIDrzCCA2+gAwIBAgIJAK1zRM7YFcNjMAkGByqGSM44BAMwgZAxCzAJBgNVBAYT
33
AlVTMQ8wDQYDVQQIDAZPcmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQK
4-
DAd3b2xmU1NMMRAwDgYDVQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wu
5-
Y29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMB4XDTEzMDQyMjIw
6-
MDk0NFoXDTE2MDExNzIwMDk0NFowgY4xCzAJBgNVBAYTAlVTMQ8wDQYDVQQIDAZP
7-
cmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQKDAd3b2xmU1NMMRAwDgYD
8-
VQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR8wHQ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ition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "rsa.h"
3636

3737

38-
#define YASSL_VERSION "2.3.9b"
38+
#define YASSL_VERSION "2.4.2"
3939

4040

4141
#if defined(__cplusplus)

0 commit comments

Comments
 (0)