Skip to content

Commit 2895dab

Browse files
committed
Merge branch 'release-8.0.28'
# Conflicts: # jdbc
2 parents 6e88e5e + 3cfe012 commit 2895dab

File tree

14 files changed

+248
-75
lines changed

14 files changed

+248
-75
lines changed

LICENSE.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Introduction
1010
third-party software which may be included in this distribution of
1111
MySQL Connector/C++ 8.0.
1212

13-
Last updated: July 2021
13+
Last updated: September 2021
1414

1515
Licensing Information
1616

@@ -428,6 +428,7 @@ The Universal FOSS Exception, Version 1.0
428428
Software with Other FOSS, and the constants, function signatures, data
429429
structures and other invocation methods used to run or interact with
430430
each of them (as to each, such software's "Interfaces"):
431+
431432
i. The Software's Interfaces may, to the extent permitted by the
432433
license of the Other FOSS, be copied into, used and distributed in
433434
the Other FOSS in order to enable interoperability, without
@@ -437,13 +438,15 @@ The Universal FOSS Exception, Version 1.0
437438
including without limitation as used in the Other FOSS (which upon
438439
any such use also then contains a portion of the Software under the
439440
Software License).
441+
440442
ii. The Other FOSS's Interfaces may, to the extent permitted by the
441443
license of the Other FOSS, be copied into, used and distributed in
442444
the Software in order to enable interoperability, without requiring
443445
that such Interfaces be licensed under the terms of the Software
444446
License or otherwise altering their original terms, if this does
445447
not require any portion of the Software other than such Interfaces
446448
to be licensed under the terms other than the Software License.
449+
447450
iii. If only Interfaces and no other code is copied between the
448451
Software and the Other FOSS in either direction, the use and/or
449452
distribution of the Software with the Other FOSS shall not be
@@ -477,6 +480,7 @@ Licenses for Third-Party Components
477480
Cyrus SASL
478481

479482
Cyrus SASL
483+
480484
* Copyright (c) 1994-2012 Carnegie Mellon University. All rights reserved.
481485
*
482486
* Redistribution and use in source and binary forms, with or without
@@ -1918,6 +1922,7 @@ OpenSSL License
19181922
the original SSLeay license, separate from the Oracle product. If you
19191923
do not wish to install this library, you may remove it, but the Oracle
19201924
program might not operate properly or at all without it.
1925+
19211926
LICENSE ISSUES
19221927
==============
19231928

@@ -2158,6 +2163,7 @@ SOFTWARE.
21582163
ZSTD
21592164

21602165
Zstandard
2166+
21612167
Zstandard is dual-licensed under [BSD](LICENSE) and [GPLv2](COPYING).
21622168

21632169
/*
@@ -2563,27 +2569,38 @@ Written Offer for Source Code
25632569
request to the address listed below or by sending an email to Oracle
25642570
using the following link:
25652571
http://www.oracle.com/goto/opensourcecode/request.
2572+
25662573
Oracle America, Inc.
25672574
Attn: Senior Vice President
25682575
Development and Engineering Legal
25692576
500 Oracle Parkway, 10th Floor
25702577
Redwood Shores, CA 94065
25712578

25722579
Your request should include:
2580+
25732581
* The name of the binary for which you are requesting the source code
2582+
25742583
* The name and version number of the Oracle product containing the
25752584
binary
2585+
25762586
* The date you received the Oracle product
2587+
25772588
* Your name
2589+
25782590
* Your company name (if applicable)
2591+
25792592
* Your return mailing address and email, and
2593+
25802594
* A telephone number in the event we need to reach you.
25812595

2596+
25822597
We may charge you a fee to cover the cost of physical media and
25832598
processing.
25842599

25852600
Your request must be sent
2601+
25862602
a. within three (3) years of the date you received the Oracle product
25872603
that included the binary that is the subject of your request, or
2604+
25882605
b. in the case of code licensed under the GPL v3 for as long as Oracle
25892606
offers spare parts or customer support for that product model.

cdk/foundation/connection_openssl.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ POP_SYS_WARNINGS_CDK
7979
// Note: this list must be in increasing order.
8080

8181
#define TLS_VERSIONS(X) \
82-
X("TLSv1", TLS1_VERSION, 1,0) \
83-
X("TLSv1.1", TLS1_1_VERSION, 1,1) \
8482
X("TLSv1.2", TLS1_2_VERSION, 1,2) \
8583
X("TLSv1.3", TLS1_3_VERSION, 1,3) \
8684

cdk/include/mysql/cdk/codec.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Format<TYPE_INTEGER> : public Format_base
6767
{
6868
public:
6969

70-
enum Fmt { UINT, SINT };
70+
enum Fmt { UINT, SINT, BIT };
7171

7272
Format(const Format_info &fi)
7373
: Format_base(TYPE_INTEGER, fi)
@@ -76,7 +76,8 @@ class Format<TYPE_INTEGER> : public Format_base
7676
fi.get_info(*this);
7777
}
7878

79-
bool is_unsigned() const { return UINT == m_fmt; }
79+
bool is_bit() const { return BIT == m_fmt;}
80+
bool is_unsigned() const { return UINT == m_fmt || BIT == m_fmt; }
8081
size_t length() const { return m_length; }
8182

8283
protected:

cdk/include/mysql/cdk/mysqlx/result.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class Col_metadata
155155
{
156156
switch (m_type)
157157
{
158+
case protocol::mysqlx::col_type::BIT:
158159
case protocol::mysqlx::col_type::SINT:
159160
case protocol::mysqlx::col_type::UINT:
160161
return TYPE_INTEGER == type;
@@ -199,6 +200,9 @@ class Col_metadata
199200
case protocol::mysqlx::col_type::UINT:
200201
Format<TYPE_INTEGER>::Access::set_fmt(fmt, Format<TYPE_INTEGER>::UINT);
201202
break;
203+
case protocol::mysqlx::col_type::BIT:
204+
Format<TYPE_INTEGER>::Access::set_fmt(fmt, Format<TYPE_INTEGER>::BIT);
205+
break;
202206
}
203207
Format<TYPE_INTEGER>::Access::set_length(fmt, m_length);
204208
}

cdk/mysqlx/result.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ Type_info Cursor::type(col_count_t pos) const
653653

654654
switch (md.m_type)
655655
{
656+
case col_type::BIT:
656657
case col_type::SINT:
657658
case col_type::UINT:
658659
return TYPE_INTEGER;
@@ -680,7 +681,7 @@ Type_info Cursor::type(col_count_t pos) const
680681
return TYPE_STRING;
681682

682683
default:
683-
// TODO: correctly handle all X types (BIT)
684+
// TODO: correctly handle all X types
684685
return TYPE_BYTES;
685686
}
686687
}

common/session.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,12 @@ void prepare_options(
364364
switch (opt_val.first)
365365
{
366366
case Option::TLS_VERSIONS:
367+
try {
367368
tls_opt.add_version(opt_val.second.get_string());
369+
} catch (const cdk::Error&) {
370+
//unexpected TLS versions are not errors. Only if no valid tls version
371+
//is available, an error will be thrown below.
372+
}
368373
break;
369374
case Option::TLS_CIPHERSUITES:
370375
tls_opt.add_ciphersuite(opt_val.second.get_string());

devapi/result.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ Type get_api_type(cdk::Type_info type, const Format_info &fmt)
115115
const Format_descr<cdk::TYPE_INTEGER> &fd
116116
= fmt.get<cdk::TYPE_INTEGER>();
117117

118+
if(fd.m_format.is_bit())
119+
return Type::BIT;
120+
118121
size_t f_len = fd.m_format.length();
119122

120123
if (f_len < 5)

devapi/session.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Session_detail::Session_detail(common::Settings_impl &settings)
257257
catch(const cdk::Error &e)
258258
{
259259
if (e.code() == cdk::cdkerrc::tls_versions)
260-
throw_error("No supported TLS protocol version found in the 'tls-versions' list");
260+
throw_error("No valid TLS version was given, valid versions are: TLSv1.2, TLSv1.3");
261261

262262
else if (e.code() == cdk::cdkerrc::tls_ciphers)
263263
throw_error("No valid cipher suite found in the 'tls-ciphersuites' list");

devapi/tests/session-t.cc

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4123,3 +4123,59 @@ TEST_F(Sess, compression_algorithms)
41234123

41244124
}
41254125
}
4126+
4127+
TEST_F(Sess, tls_ver_deprecate)
4128+
{
4129+
SKIP_IF_NO_XPLUGIN;
4130+
4131+
struct TEST_CASES
4132+
{
4133+
const std::string& tls_versions;
4134+
bool succeed;
4135+
};
4136+
4137+
bool has_tlsv1_3 = check_tls_ver("TLSv1.3");
4138+
4139+
TEST_CASES test_cases[] =
4140+
{
4141+
{"TLSv1.1,TLSv1.2" ,true },
4142+
{"foo,TLSv1.3" ,has_tlsv1_3 },
4143+
{"TLSv1.0,TLSv1.1" ,false },
4144+
{"foo,TLSv1.1" ,false },
4145+
{"foo,bar" ,false },
4146+
{"" ,false }
4147+
};
4148+
4149+
for(auto test : test_cases)
4150+
{
4151+
4152+
std::cout << "Testing:" << test.tls_versions << std::endl;
4153+
4154+
{
4155+
SessionSettings opt(SessionOption::HOST, get_host(),
4156+
SessionOption::PORT, get_port(),
4157+
SessionOption::USER, get_user(),
4158+
SessionOption::PWD, get_password(),
4159+
SessionOption::SSL_MODE, SSLMode::REQUIRED);
4160+
EXPECT_EQ(test.succeed, check_tls_ver(test.tls_versions.c_str()));
4161+
}
4162+
//URI
4163+
std::stringstream uri;
4164+
uri << get_uri() << "/?tls-versions=[" << test.tls_versions << "]";
4165+
4166+
if(test.succeed)
4167+
{
4168+
EXPECT_NO_THROW(mysqlx::Session(uri.str()));
4169+
}
4170+
else
4171+
{
4172+
try {
4173+
mysqlx::Session(uri.str());
4174+
4175+
} catch (const std::exception& e) {
4176+
EXPECT_EQ(std::string(e.what()), "No valid TLS version was given, valid versions are: TLSv1.2, TLSv1.3");
4177+
}
4178+
}
4179+
}
4180+
4181+
}

0 commit comments

Comments
 (0)