Skip to content

Commit

Permalink
Merge tag 'mariadb-5.5.58' into 5.5-galera
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Lindström committed Oct 19, 2017
2 parents 2b811f0 + b000e16 commit 8da6b4e
Show file tree
Hide file tree
Showing 134 changed files with 1,532 additions and 357 deletions.
5 changes: 2 additions & 3 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,7 @@ static void fix_history(String *final_command);

static COMMANDS *find_command(char *name);
static COMMANDS *find_command(char cmd_name);
static bool add_line(String &buffer, char *line, ulong line_length,
char *in_string, bool *ml_comment, bool truncated);
static bool add_line(String &, char *, ulong, char *, bool *, bool);
static void remove_cntrl(String &buffer);
static void print_table_data(MYSQL_RES *result);
static void print_table_data_html(MYSQL_RES *result);
Expand All @@ -1080,7 +1079,7 @@ static ulong start_timer(void);
static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
extern "C" sig_handler mysql_end(int sig);
extern "C" sig_handler mysql_end(int sig) __attribute__ ((noreturn));
extern "C" sig_handler handle_sigint(int sig);
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
static sig_handler window_resize(int sig);
Expand Down
1 change: 1 addition & 0 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
Expand Up @@ -2012,6 +2012,7 @@ static void print_xml_comment(FILE *xml_file, size_t len,
case '-':
if (*(comment_string + 1) == '-') /* Only one hyphen allowed. */
break;
/* fall through */
default:
fputc(*comment_string, xml_file);
break;
Expand Down
21 changes: 13 additions & 8 deletions extra/my_print_defaults.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,16 @@ void cleanup_and_exit(int exit_code)
exit(exit_code);
}

static void usage(my_bool version)
static void version()
{
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE);
if (version)
return;
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
}


static void usage() __attribute__ ((noreturn));
static void usage()
{
version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Prints all arguments that is give to some program using the default files");
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
Expand All @@ -131,12 +135,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
cleanup_and_exit(0);
case 'I':
case '?':
usage(0);
usage();
case 'v':
verbose++;
break;
case 'V':
usage(1);
version();
/* fall through */
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
Expand Down Expand Up @@ -184,7 +189,7 @@ int main(int argc, char **argv)
nargs+= array_elements(mysqld_groups);

if (nargs < 2)
usage(0);
usage();

load_default_groups=(char**) my_malloc(nargs*sizeof(char*), MYF(MY_WME));
if (!load_default_groups)
Expand Down
1 change: 1 addition & 0 deletions extra/replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ register char **argv[];
break;
case 'V':
version=1;
/* fall through */
case 'I':
case '?':
help=1; /* Help text written */
Expand Down
8 changes: 8 additions & 0 deletions extra/yassl/README
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ before calling SSL_new();

*** end Note ***

yaSSL Release notes, version 2.4.4 (8/8/2017)
This release of yaSSL fixes an interop issue. A fix for detecting cipher
suites with non leading zeros is included as yaSSL only supports cipher
suites with leading zeros. Thanks for the report from Security Innovation
and Oracle.

Users interoping with other SSL stacks should update.

yaSSL Release notes, version 2.4.2 (9/22/2016)
This release of yaSSL fixes a medium security vulnerability. A fix for
potential AES side channel leaks is included that a local user monitoring
Expand Down
4 changes: 2 additions & 2 deletions extra/yassl/include/openssl/ssl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -35,7 +35,7 @@
#include "rsa.h"


#define YASSL_VERSION "2.4.2"
#define YASSL_VERSION "2.4.4"


#if defined(__cplusplus)
Expand Down
6 changes: 5 additions & 1 deletion extra/yassl/src/yassl_imp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005, 2014, Oracle and/or its affiliates
Copyright (c) 2005, 2017, Oracle and/or its affiliates.
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 @@ -1578,6 +1578,10 @@ void ServerHello::Process(input_buffer& input, SSL& ssl)
ssl.SetError(badVersion_error);
return;
}
if (cipher_suite_[0] != 0x00) {
ssl.SetError(unknown_cipher);
return;
}
ssl.set_pending(cipher_suite_[1]);
ssl.set_random(random_, server_end);
if (id_len_)
Expand Down
14 changes: 9 additions & 5 deletions extra/yassl/src/yassl_int.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005, 2014, Oracle and/or its affiliates
Copyright (c) 2005, 2017, Oracle and/or its affiliates.
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 @@ -1399,12 +1399,17 @@ void SSL::matchSuite(const opaque* peer, uint length)
// start with best, if a match we are good, Ciphers are at odd index
// since all SSL and TLS ciphers have 0x00 first byte
for (uint i = 1; i < secure_.get_parms().suites_size_; i += 2)
for (uint j = 1; j < length; j+= 2)
if (secure_.use_parms().suites_[i] == peer[j]) {
for (uint j = 0; (j + 1) < length; j+= 2) {
if (peer[j] != 0x00) {
continue; // only 0x00 first byte supported
}

if (secure_.use_parms().suites_[i] == peer[j + 1]) {
secure_.use_parms().suite_[0] = 0x00;
secure_.use_parms().suite_[1] = peer[j];
secure_.use_parms().suite_[1] = peer[j + 1];
return;
}
}

SetError(match_error);
}
Expand Down Expand Up @@ -2706,4 +2711,3 @@ template mySTL::list<yaSSL::SSL_SESSION*>::iterator find_if<mySTL::list<yaSSL::S
template mySTL::list<yaSSL::ThreadError>::iterator find_if<mySTL::list<yaSSL::ThreadError>::iterator, yaSSL::yassl_int_cpp_local2::thr_match>(mySTL::list<yaSSL::ThreadError>::iterator, mySTL::list<yaSSL::ThreadError>::iterator, yaSSL::yassl_int_cpp_local2::thr_match);
}
#endif

7 changes: 7 additions & 0 deletions mysql-test/include/wait_for_slave_sql_error_and_skip.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ if (!$slave_skip_counter) {
}
source include/start_slave.inc;

# start_slave.inc returns when Slave_SQL_Running=Yes. But the slave
# thread sets it before clearing Last_SQL_Errno. So we have to wait
# for Last_SQL_Errno=0 separately.

let $slave_param= Last_SQL_Errno;
let $slave_param_value= 0;
source include/wait_for_slave_param.inc;

--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
--source include/end_include_file.inc
3 changes: 1 addition & 2 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,7 @@ ($$$)

# Repeat test $opt_repeat number of times
my $repeat= $result->{repeat} || 1;
# Don't repeat if test was skipped
if ($repeat < $opt_repeat && $result->{'result'} ne 'MTR_RES_SKIPPED')
if ($repeat < $opt_repeat)
{
$result->{retries}= 0;
$result->{rep_failures}++ if $result->{failures};
Expand Down
52 changes: 52 additions & 0 deletions mysql-test/r/alter_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -1340,3 +1340,55 @@ rename table t2 to t1;
execute stmt1;
deallocate prepare stmt1;
drop table t2;
#
# MDEV-8960 Can't refer the same column twice in one ALTER TABLE
#
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
ALTER COLUMN `consultant_id` DROP DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL,
ALTER COLUMN `consultant_id` SET DEFAULT 2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL DEFAULT '2'
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
ALTER COLUMN `consultant_id` DROP DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
ALTER TABLE t1 ADD COLUMN `consultant_id` integer NOT NULL DEFAULT 2,
ALTER COLUMN `consultant_id` DROP DEFAULT,
MODIFY COLUMN `consultant_id` BIGINT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
16 changes: 16 additions & 0 deletions mysql-test/r/case.result
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,22 @@ a d
3 11120436154190595086
drop table t1, t2;
End of 5.0 tests
#
# Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
# (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
#
set @@sql_mode='';
CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2);
Warnings:
Note 1291 Column 'c1' has duplicated value '' in SET
INSERT INTO t1 VALUES(990101.102);
Warnings:
Warning 1265 Data truncated for column 'c1' at row 1
SELECT COALESCE(c1)FROM t1 ORDER BY 1;
COALESCE(c1)

DROP TABLE t1;
set @@sql_mode=default;
CREATE TABLE t1(a YEAR);
SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
1
Expand Down
25 changes: 25 additions & 0 deletions mysql-test/r/count_distinct.result
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,28 @@ count(distinct user_id)
17
drop table t1;
set @@tmp_table_size = default;
create table t1 (
a VARCHAR(1020),
b int
);
insert into t1 values
( 0 , 1 ),
( 1 , 2 ),
( 2 , 3 ),
( 3 , 4 ),
( 4 , 5 ),
( 5 , 6 ),
( 6 , 7 ),
( 7 , 8 ),
( 8 , 9 ),
( 9 , 10 ),
( 0 , 11 ),
( 1 , 12 ),
( 2 , 13 ),
( 3 , 14 );
set @@tmp_table_size=1024;
select count(distinct a) from t1;
count(distinct a)
10
drop table t1;
set @@tmp_table_size = default;
30 changes: 30 additions & 0 deletions mysql-test/r/ctype_ucs.result
Original file line number Diff line number Diff line change
Expand Up @@ -4367,5 +4367,35 @@ NO_ENGINE_SUBSTITUTION
SET sql_mode=DEFAULT;
SET NAMES utf8;
#
# MDEV-13972 crash in Item_func_sec_to_time::get_date
#
SELECT SEC_TO_TIME(CONVERT(900*24*60*60 USING ucs2));
SEC_TO_TIME(CONVERT(900*24*60*60 USING ucs2))
838:59:59.999999
Warnings:
Warning 1292 Truncated incorrect time value: '77760000'
#
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
#
CREATE TABLE t1 (c1 VARCHAR(32766) CHARACTER SET ucs2);
DESCRIBE t1;
Field Type Null Key Default Extra
c1 varchar(32766) YES NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 VARCHAR(32767) CHARACTER SET ucs2);
Warnings:
Note 1246 Converting column 'c1' from VARCHAR to TEXT
DESCRIBE t1;
Field Type Null Key Default Extra
c1 text YES NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 VARCHAR(32768) CHARACTER SET ucs2);
Warnings:
Note 1246 Converting column 'c1' from VARCHAR to TEXT
DESCRIBE t1;
Field Type Null Key Default Extra
c1 mediumtext YES NULL
DROP TABLE t1;
#
# End of 5.5 tests
#
15 changes: 15 additions & 0 deletions mysql-test/r/ctype_utf32.result
Original file line number Diff line number Diff line change
Expand Up @@ -1283,5 +1283,20 @@ NO_ENGINE_SUBSTITUTION
SET sql_mode=DEFAULT;
SET NAMES utf8;
#
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
#
CREATE TABLE t1 (c1 VARCHAR(16383) CHARACTER SET utf32);
DESCRIBE t1;
Field Type Null Key Default Extra
c1 varchar(16383) YES NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 VARCHAR(16384) CHARACTER SET utf32);
Warnings:
Note 1246 Converting column 'c1' from VARCHAR to TEXT
DESCRIBE t1;
Field Type Null Key Default Extra
c1 mediumtext YES NULL
DROP TABLE t1;
#
# End of 5.5 tests
#
22 changes: 22 additions & 0 deletions mysql-test/r/ctype_utf8.result
Original file line number Diff line number Diff line change
Expand Up @@ -5933,5 +5933,27 @@ Warnings:
SET sql_mode=DEFAULT;
DROP TABLE t1;
#
# MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
#
CREATE TABLE t1 (c1 VARCHAR(21844) CHARACTER SET utf8);
DESCRIBE t1;
Field Type Null Key Default Extra
c1 varchar(21844) YES NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 VARCHAR(21845) CHARACTER SET utf8);
Warnings:
Note 1246 Converting column 'c1' from VARCHAR to TEXT
DESCRIBE t1;
Field Type Null Key Default Extra
c1 text YES NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 VARCHAR(21846) CHARACTER SET utf8);
Warnings:
Note 1246 Converting column 'c1' from VARCHAR to TEXT
DESCRIBE t1;
Field Type Null Key Default Extra
c1 mediumtext YES NULL
DROP TABLE t1;
#
# End of 5.5 tests
#
2 changes: 1 addition & 1 deletion mysql-test/r/errors.result
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ create table t1 (a int(256));
ERROR 42000: Display width out of range for 'a' (max = 255)
set sql_mode='traditional';
create table t1 (a varchar(66000));
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
ERROR 42000: Column length too big for column 'a' (max = 65532); use BLOB or TEXT instead
set sql_mode=default;
CREATE TABLE t1 (a INT);
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/r/func_in.result
Original file line number Diff line number Diff line change
Expand Up @@ -812,3 +812,9 @@ EXECUTE s;
1
DROP TABLE t1;
# End of 5.3 tests
create table t1 (a int);
insert t1 values (1),(2),(3);
select * from t1 where 1 in (a, name_const('a', null));
a
1
drop table t1;
Loading

0 comments on commit 8da6b4e

Please sign in to comment.