Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'bb-10.1-merge' into 10.1
  • Loading branch information
vuvova committed May 5, 2016
2 parents fba385e + 1532598 commit 46973bb
Show file tree
Hide file tree
Showing 249 changed files with 8,705 additions and 1,917 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=1
MYSQL_VERSION_PATCH=13
MYSQL_VERSION_PATCH=14
1 change: 1 addition & 0 deletions client/client_priv.h
@@ -1,5 +1,6 @@
/*
Copyright (c) 2001, 2012, Oracle and/or its affiliates.
Copyright (c) 2009, 2016, MariaDB
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
35 changes: 21 additions & 14 deletions client/mysql.cc
@@ -1,7 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
Copyright (c) 2013, 2014, SkySQL Ab
Copyright (c) 2009, 2016, MariaDB
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 @@ -96,9 +95,16 @@ extern "C" {
#endif
}

#if !defined(HAVE_VIDATTR)
#undef vidattr
#define vidattr(A) {} // Can't get this to work
#ifdef HAVE_VIDATTR
static int have_curses= 0;
static void my_vidattr(chtype attrs)
{
if (have_curses)
vidattr(attrs);
}
#else
#undef HAVE_SETUPTERM
#define my_vidattr(A) {} // Can't get this to work
#endif

#ifdef FN_NO_CASE_SENSE
Expand Down Expand Up @@ -4735,9 +4741,9 @@ com_status(String *buffer __attribute__((unused)),

if (skip_updates)
{
vidattr(A_BOLD);
my_vidattr(A_BOLD);
tee_fprintf(stdout, "\nAll updates ignored to this database\n");
vidattr(A_NORMAL);
my_vidattr(A_NORMAL);
}
#ifdef USE_POPEN
tee_fprintf(stdout, "Current pager:\t\t%s\n", pager);
Expand Down Expand Up @@ -4805,9 +4811,9 @@ com_status(String *buffer __attribute__((unused)),
}
if (safe_updates)
{
vidattr(A_BOLD);
my_vidattr(A_BOLD);
tee_fprintf(stdout, "\nNote that you are running in safe_update_mode:\n");
vidattr(A_NORMAL);
my_vidattr(A_NORMAL);
tee_fprintf(stdout, "\
UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.\n\
(One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)\n\
Expand Down Expand Up @@ -4900,10 +4906,11 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
{
if (!inited)
{
inited=1;
#ifdef HAVE_SETUPTERM
(void) setupterm((char *)0, 1, (int *) 0);
int errret;
have_curses= setupterm((char *)0, 1, &errret) != ERR;
#endif
inited=1;
}
if (info_type == INFO_ERROR)
{
Expand All @@ -4915,7 +4922,7 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
putchar('\a'); /* This should make a bell */
#endif
}
vidattr(A_STANDOUT);
my_vidattr(A_STANDOUT);
if (error)
{
if (sqlstate)
Expand All @@ -4934,9 +4941,9 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
tee_fputs(": ", file);
}
else
vidattr(A_BOLD);
my_vidattr(A_BOLD);
(void) tee_puts(str, file);
vidattr(A_NORMAL);
my_vidattr(A_NORMAL);
}
if (unbuffered)
fflush(file);
Expand Down
2 changes: 1 addition & 1 deletion client/mysql_upgrade.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2006, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
Copyright (c) 2010, 2016, MariaDB
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
2 changes: 1 addition & 1 deletion client/mysqladmin.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
Copyright (c) 2010, 2016, MariaDB
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
15 changes: 15 additions & 0 deletions client/mysqlbinlog.cc
Expand Up @@ -34,6 +34,7 @@
#define TABLE TABLE_CLIENT
#include "client_priv.h"
#include <my_time.h>
#include <sslopt-vars.h>
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
#include "sql_priv.h"
#include "log_event.h"
Expand Down Expand Up @@ -1403,6 +1404,7 @@ static struct my_option my_options[] =
{"socket", 'S', "The socket file to use for connection.",
&sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
#include <sslopt-longopts.h>
{"start-datetime", OPT_START_DATETIME,
"Start reading the binlog at first event having a datetime equal or "
"posterior to the argument; the argument must be a date and time "
Expand Down Expand Up @@ -1621,6 +1623,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
#endif
#include <sslopt-case.h>
case 'd':
one_database = 1;
break;
Expand Down Expand Up @@ -1773,6 +1776,18 @@ static Exit_status safe_connect()
return ERROR_STOP;
}

#ifdef HAVE_OPENSSL
if (opt_use_ssl)
{
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif /*HAVE_OPENSSL*/

if (opt_plugindir && *opt_plugindir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugindir);

Expand Down
2 changes: 1 addition & 1 deletion client/mysqlcheck.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
Copyright (c) 2010, 2016, MariaDB
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
2 changes: 1 addition & 1 deletion client/mysqldump.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, Monty Program Ab.
Copyright (c) 2010, 2016, MariaDB
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
2 changes: 1 addition & 1 deletion client/mysqlimport.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2011, 2015, MariaDB
Copyright (c) 2011, 2016, MariaDB
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
2 changes: 1 addition & 1 deletion client/mysqlshow.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
Copyright (c) 2010, 2016, MariaDB
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
2 changes: 1 addition & 1 deletion client/mysqlslap.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
Copyright (c) 2010, 2016, MariaDB
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
2 changes: 1 addition & 1 deletion client/mysqltest.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
Copyright (c) 2009, 2016, Monty Program Ab.
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
8 changes: 5 additions & 3 deletions cmake/plugin.cmake
Expand Up @@ -209,11 +209,13 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(ARG_COMPONENT)
IF(CPACK_COMPONENTS_ALL AND
NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT})
IF (ARG_STORAGE_ENGINE)
SET(ver " = %{version}-%{release}")
ENDIF()
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT} PARENT_SCOPE)

SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT})
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
IF (NOT ARG_CLIENT)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB${ver}" PARENT_SCOPE)
ENDIF()
# workarounds for cmake issues #13248 and #12864:
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE)
Expand Down
2 changes: 0 additions & 2 deletions debian/mariadb-test-10.1.dirs
Expand Up @@ -44,8 +44,6 @@ usr/share/mysql/mysql-test/suite/jp/r
usr/share/mysql/mysql-test/suite/jp/include
usr/share/mysql/mysql-test/suite/jp/std_data
usr/share/mysql/mysql-test/suite/maria
usr/share/mysql/mysql-test/suite/maria/t
usr/share/mysql/mysql-test/suite/maria/r
usr/share/mysql/mysql-test/suite/funcs_2
usr/share/mysql/mysql-test/suite/funcs_2/lib
usr/share/mysql/mysql-test/suite/funcs_2/t
Expand Down
6 changes: 6 additions & 0 deletions extra/yassl/README
Expand Up @@ -12,6 +12,12 @@ before calling SSL_new();

*** end Note ***

yaSSL Release notes, version 2.3.9b (2/03/2016)
This release of yaSSL fixes the OpenSSL compatibility function
X509_NAME_get_index_by_NID() to use the actual index of the common name
instead of searching on the format prefix. Thanks for the report from
yashwant.sahu@oracle.com . Anyone using this function should update.

yaSSL Release notes, version 2.3.9 (12/01/2015)
This release of yaSSL fixes two client side Diffie-Hellman problems.
yaSSL was only handling the cases of zero or one leading zeros for the key
Expand Down
2 changes: 1 addition & 1 deletion extra/yassl/include/openssl/ssl.h
Expand Up @@ -34,7 +34,7 @@
#include "rsa.h"


#define YASSL_VERSION "2.3.9"
#define YASSL_VERSION "2.3.9b"


#if defined(__cplusplus)
Expand Down
8 changes: 6 additions & 2 deletions extra/yassl/include/yassl_int.hpp
Expand Up @@ -191,14 +191,18 @@ class sslFactory {
class X509_NAME {
char* name_;
size_t sz_;
int cnPosition_; // start of common name, -1 is none
int cnLen_; // length of above
ASN1_STRING entry_;
public:
X509_NAME(const char*, size_t sz);
X509_NAME(const char*, size_t sz, int pos, int len);
~X509_NAME();

const char* GetName() const;
ASN1_STRING* GetEntry(int i);
size_t GetLength() const;
int GetCnPosition() const { return cnPosition_; }
int GetCnLength() const { return cnLen_; }
private:
X509_NAME(const X509_NAME&); // hide copy
X509_NAME& operator=(const X509_NAME&); // and assign
Expand Down Expand Up @@ -226,7 +230,7 @@ class X509 {
StringHolder afterDate_; // not valid after
public:
X509(const char* i, size_t, const char* s, size_t,
ASN1_STRING *b, ASN1_STRING *a);
ASN1_STRING *b, ASN1_STRING *a, int, int, int, int);
~X509() {}

X509_NAME* GetIssuer();
Expand Down
13 changes: 10 additions & 3 deletions extra/yassl/src/cert_wrapper.cpp
Expand Up @@ -304,7 +304,10 @@ int CertManager::Validate()
afterDate.type= cert.GetAfterDateType();
afterDate.length= strlen((char *) afterDate.data) + 1;
peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(),
sSz, &beforeDate, &afterDate);
sSz, &beforeDate, &afterDate,
cert.GetIssuerCnStart(), cert.GetIssuerCnLength(),
cert.GetSubjectCnStart(), cert.GetSubjectCnLength()
);

if (err == TaoCrypt::SIG_OTHER_E && verifyCallback_) {
X509_STORE_CTX store;
Expand Down Expand Up @@ -350,7 +353,9 @@ int CertManager::SetPrivateKey(const x509& key)
afterDate.type= cd.GetAfterDateType();
afterDate.length= strlen((char *) afterDate.data) + 1;
selfX509_ = NEW_YS X509(cd.GetIssuer(), iSz, cd.GetCommonName(),
sSz, &beforeDate, &afterDate);
sSz, &beforeDate, &afterDate,
cd.GetIssuerCnStart(), cd.GetIssuerCnLength(),
cd.GetSubjectCnStart(), cd.GetSubjectCnLength());
}
return 0;
}
Expand All @@ -367,7 +372,9 @@ void CertManager::setPeerX509(X509* x)
ASN1_STRING* after = x->GetAfter();

peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(),
subject->GetName(), subject->GetLength(), before, after);
subject->GetName(), subject->GetLength(), before, after,
issuer->GetCnPosition(), issuer->GetCnLength(),
subject->GetCnPosition(), subject->GetCnLength());
}


Expand Down
14 changes: 4 additions & 10 deletions extra/yassl/src/ssl.cpp
Expand Up @@ -1351,15 +1351,13 @@ int ASN1_STRING_type(ASN1_STRING *x)
int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos)
{
int idx = -1; // not found
const char* start = &name->GetName()[lastpos + 1];
int cnPos = -1;

switch (nid) {
case NID_commonName:
const char* found = strstr(start, "/CN=");
if (found) {
found += 4; // advance to str
idx = found - start + lastpos + 1;
}
cnPos = name->GetCnPosition();
if (lastpos < cnPos)
idx = cnPos;
break;
}

Expand Down Expand Up @@ -1471,10 +1469,6 @@ int SSL_peek(SSL* ssl, void* buffer, int sz)

int SSL_pending(SSL* ssl)
{
// Just in case there's pending data that hasn't been processed yet...
char c;
SSL_peek(ssl, &c, 1);

return ssl->bufferedData();
}

Expand Down

0 comments on commit 46973bb

Please sign in to comment.