Skip to content

Commit 12c3e16

Browse files
committed
Merge branch '5.5' into 10.0
2 parents 39dceaa + 6e25727 commit 12c3e16

25 files changed

+551
-193
lines changed

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

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-
VQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR8wHQYJKoZIhvcN
9-
AQkBFhBpbmZvQHdvbGZzc2wuY29tMIIBuDCCASwGByqGSM44BAEwggEfAoGBAL1R
10-
7koy4IrH6sbh6nDEUUPPKgfhxxLCWCVexF2+qzANEr+hC9M002haJXFOfeS9DyoO
11-
WFbL0qMZOuqv+22CaHnoUWl7q3PjJOAI3JH0P54ZyUPuU1909RzgTdIDp5+ikbr7
12-
KYjnltL73FQVMbjTZQKthI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x+rG4epwxFFDzyoH4ccSwlglXsRdvqswDRK/oQvTNNNoWiVxTn3k
11+
vQ8qDlhWy9KjGTrqr/ttgmh56FFpe6tz4yTgCNyR9D+eGclD7lNfdPUc4E3SA6ef
12+
opG6+ymI55bS+9xUFTG402UCrYSKT59zI2HBfuI6dltsxQIVAJHJ7WDQ+jBn/nmM
13+
yCQzdi+0qJx1AoGBAJJacRK36s5yGY1b6qhxWqvpoAC+SfEKylZnYWGYf2PM+Iwo
14+
6AgPKEw6BSsX+7Nmc4Gjyr4JWhComKi6onPamO/A2CbMM0DCxb47BeLBWfqWAgXV
15+
j0CODT4MQos5yugnviR/YpEgbzLxvrXr469lKWsAyB19/gFmGmQWcCgAwGm6A4GF
16+
AAKBgQCdy2PPch8r0P07EOs5WG6L425P6IJ3bDKj3TVLy+Ebj04CT/3Gmgw2tFye
17+
2pOgO0yfkIXizcDl6GT2CQuBBhUgwF6WJ4hoW1iK1UwhnupZmQ358eNFl0tJJN5v
18+
wx2gtNxJSwIsm8VRscqqFH2092b9ScH7VjLoqhx+bgA4XV7l1aNQME4wHQYDVR0O
19+
BBYEFCCY5ONeqOL/KqR/SwbV5Ufb/IHHMB8GA1UdIwQYMBaAFCCY5ONeqOL/KqR/
20+
SwbV5Ufb/IHHMAwGA1UdEwQFMAMBAf8wCQYHKoZIzjgEAwMvADAsAhQRYSCVN/Ge
21+
agV3mffU3qNZ92fI0QIUPH7Jp+iASI7U1ocaYDc10qXGaGY=
2222
-----END CERTIFICATE-----

extra/yassl/include/openssl/ssl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "rsa.h"
3535

3636

37-
#define YASSL_VERSION "2.3.9b"
37+
#define YASSL_VERSION "2.4.2"
3838

3939

4040
#if defined(__cplusplus)

0 commit comments

Comments
 (0)