Skip to content

Commit e006ad4

Browse files
committed
Merge branch 'refs/heads/master' into wl12755-tls-ciphers
2 parents c6f2e1e + dbc4b23 commit e006ad4

File tree

10 files changed

+144
-99
lines changed

10 files changed

+144
-99
lines changed

cdk/cmake/DepFindProtobuf.cmake

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,27 @@ if(SUNPRO)
226226
)
227227
endif()
228228

229+
#
230+
# Try using parallel builds for protobuf.
231+
#
232+
233+
include(ProcessorCount)
234+
ProcessorCount(N)
235+
236+
MESSAGE("Processor Count: ${N}")
237+
238+
set(opt_build)
239+
set(opt_tool)
240+
if(NOT N EQUAL 0)
241+
if(NOT CMAKE_VERSION VERSION_LESS 3.12)
242+
set(opt_build --parallel ${N})
243+
elseif(CMAKE_MAKE_PROGRAM MATCHES "make")
244+
set(opt_tool -j${N})
245+
endif()
246+
endif()
229247

230248
add_custom_command(OUTPUT "${build_stamp}"
231-
COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG_EXPR}
249+
COMMAND ${CMAKE_COMMAND} --build . ${opt_build} --config ${CONFIG_EXPR} -- ${opt_tool}
232250
COMMAND ${CMAKE_COMMAND} -E touch "${build_stamp}"
233251
WORKING_DIRECTORY "${PB_BINARY_DIR}"
234252
COMMENT "Building protobuf"
@@ -308,4 +326,3 @@ function(mysqlx_protobuf_generate_cpp SRCS HDRS)
308326
SET(${HDRS} ${hdrs} PARENT_SCOPE)
309327

310328
endfunction(mysqlx_protobuf_generate_cpp)
311-

cdk/cmake/compiler/CLANG.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929

3030
function(enable_cxx11)
3131

32+
add_flags(CXX -std=c++11)
33+
3234
#
33-
# If Clang is used and deployment target is not specified
35+
# If Clang is used on macOS and deployment target is not specified
3436
# with MACOSX_DEPLOYMENT_TARGET environment variable, make
3537
# sure that clang's native implementation of C++ std
3638
# libarary (libc++) is used. Otherwise clang defaults to
@@ -41,7 +43,9 @@ function(enable_cxx11)
4143
# so.
4244
#
4345

44-
add_flags(CXX -std=c++11 -stdlib=libc++)
46+
if (MACOS)
47+
add_flags(CXX -stdlib=libc++)
48+
endif()
4549

4650
endfunction()
4751

cdk/cmake/gtest.cmake

Lines changed: 63 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -39,84 +39,87 @@ ENDMACRO(SETUP_GTEST)
3939

4040
SET(WITH_GTEST $ENV{WITH_GTEST} CACHE PATH "Location of gtest")
4141

42-
#
43-
# TODO: Try to find gtest in system-wide locations if WITH_GTEST is
44-
# not set
45-
#
4642

47-
if(DEFINED WITH_GTEST)
48-
set(GTEST_ROOT ${WITH_GTEST})
49-
endif()
43+
if(NOT WITH_GTEST)
5044

51-
find_package(GTest)
45+
#
46+
# Try to find gtest in system-wide locations
47+
#
5248

53-
if(NOT GTEST_FOUND)
49+
find_package(GTest)
5450

55-
IF(NOT DEFINED WITH_GTEST)
56-
MESSAGE(FATAL_ERROR "This project requires gtest libraries"
57-
" but WITH_GTEST option was not specified."
58-
" Please set it to the location where gtest"
59-
" was built from sources using cmake.")
60-
ENDIF()
51+
if(NOT GTEST_FOUND)
52+
message(FATAL_ERROR "This project requires gtest libraries"
53+
" but WITH_GTEST option was not specified."
54+
" Please set it to the location where gtest"
55+
" was built from sources using cmake.")
56+
endif()
6157

62-
message("Looking for gtest build in: ${WITH_GTEST}")
58+
list(GET GTEST_LIBRARIES 0 gtest_location)
59+
list(GET GTEST_MAIN_LIBRARIES 0 gtest_main_location)
6360

64-
#
65-
# TODO: Configure gtest build if sources location is given
66-
#
61+
else(NOT WITH_GTEST)
6762

68-
IF(NOT EXISTS "${WITH_GTEST}/CMakeCache.txt")
69-
MESSAGE(FATAL_ERROR
70-
"Could not find gtest build in this location: ${WITH_GTEST}"
71-
)
72-
ENDIF()
63+
message("Looking for gtest build in: ${WITH_GTEST}")
7364

74-
#
75-
# Read source location from build configuration cache and set
76-
# GTEST_INCLUDE_DIR.
77-
#
65+
#
66+
# TODO: Configure gtest build if source location is given
67+
#
7868

79-
LOAD_CACHE(${WITH_GTEST} READ_WITH_PREFIX GTEST_
80-
CMAKE_PROJECT_NAME)
81-
#MESSAGE(STATUS "Gtest project name: ${GTEST_CMAKE_PROJECT_NAME}")
69+
if(NOT EXISTS "${WITH_GTEST}/CMakeCache.txt")
70+
message(FATAL_ERROR
71+
"Could not find gtest build in this location: ${WITH_GTEST}"
72+
)
73+
endif()
8274

83-
LOAD_CACHE(${WITH_GTEST} READ_WITH_PREFIX GTEST_
84-
${GTEST_CMAKE_PROJECT_NAME}_SOURCE_DIR)
75+
#
76+
# Read source location from build configuration cache and set
77+
# GTEST_INCLUDE_DIR.
78+
#
8579

86-
FIND_PATH(GTEST_INCLUDE_DIRS
87-
NAMES gtest/gtest.h
88-
PATHS ${GTEST_${GTEST_CMAKE_PROJECT_NAME}_SOURCE_DIR}/include ${GTEST_${GTEST_CMAKE_PROJECT_NAME}_SOURCE_DIR}/gtest/include
89-
NO_DEFAULT_PATH
90-
)
80+
load_cache(${WITH_GTEST} READ_WITH_PREFIX GTEST_
81+
CMAKE_PROJECT_NAME
82+
)
83+
#MESSAGE(STATUS "Gtest project name: ${GTEST_CMAKE_PROJECT_NAME}")
9184

92-
IF(NOT EXISTS "${GTEST_INCLUDE_DIRS}/gtest/gtest.h")
93-
MESSAGE(FATAL_ERROR "Could not find gtest headers at: ${GTEST_INCLUDE_DIRS}")
94-
ENDIF()
85+
load_cache(${WITH_GTEST} READ_WITH_PREFIX GTEST_
86+
${GTEST_CMAKE_PROJECT_NAME}_SOURCE_DIR
87+
)
9588

96-
#
97-
# TODO: Run build if libraries can not be found in expected locations
98-
#
89+
message("Gtest sources at: ${GTEST_${GTEST_CMAKE_PROJECT_NAME}_SOURCE_DIR}")
9990

100-
FIND_LIBRARY(gtest_location
101-
NAMES libgtest gtest
102-
PATHS ${WITH_GTEST} ${WITH_GTEST}/gtest
103-
PATH_SUFFIXES . Release RelWithDebInfo Debug
104-
NO_DEFAULT_PATH
105-
)
91+
find_path(GTEST_INCLUDE_DIRS
92+
NAMES gtest/gtest.h
93+
PATHS
94+
${GTEST_${GTEST_CMAKE_PROJECT_NAME}_SOURCE_DIR}/include
95+
${GTEST_${GTEST_CMAKE_PROJECT_NAME}_SOURCE_DIR}/gtest/include
96+
NO_DEFAULT_PATH
97+
)
10698

107-
FIND_LIBRARY(gtest_main_location
108-
NAMES libgtest_main gtest_main
109-
PATHS ${WITH_GTEST} ${WITH_GTEST}/gtest
110-
PATH_SUFFIXES . Release RelWithDebInfo Debug
111-
NO_DEFAULT_PATH
112-
)
99+
if(NOT EXISTS "${GTEST_INCLUDE_DIRS}/gtest/gtest.h")
100+
message(FATAL_ERROR "Could not find gtest headers at: ${GTEST_INCLUDE_DIRS}")
101+
endif()
102+
103+
#
104+
# TODO: Run build if libraries can not be found in expected locations
105+
#
106+
107+
find_library(gtest_location
108+
NAMES libgtest gtest
109+
PATHS ${WITH_GTEST} ${WITH_GTEST}/gtest
110+
PATH_SUFFIXES . Release RelWithDebInfo Debug
111+
NO_DEFAULT_PATH
112+
)
113113

114-
else()
114+
find_library(gtest_main_location
115+
NAMES libgtest_main gtest_main
116+
PATHS ${WITH_GTEST} ${WITH_GTEST}/gtest
117+
PATH_SUFFIXES . Release RelWithDebInfo Debug
118+
NO_DEFAULT_PATH
119+
)
115120

116-
list(GET GTEST_LIBRARIES 0 gtest_location)
117-
list(GET GTEST_MAIN_LIBRARIES 0 gtest_main_location)
121+
endif(NOT WITH_GTEST)
118122

119-
endif(NOT GTEST_FOUND)
120123

121124
MESSAGE(STATUS "GTEST_INCLUDE_DIRS: ${GTEST_INCLUDE_DIRS}")
122125

cdk/include/mysql/cdk/foundation/std_error_conditions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@
9898
X (operation_not_permitted, EPERM) \
9999
X (operation_not_supported, EOPNOTSUPP) \
100100
X (operation_would_block, EWOULDBLOCK) \
101-
X (owner_dead, EOWNERDEAD) \
101+
/* X (owner_dead, EOWNERDEAD) */\
102102
X (permission_denied, EACCES) \
103103
X (protocol_error, EPROTO) \
104104
X (protocol_not_supported, EPROTONOSUPPORT) \
105105
X (read_only_file_system, EROFS) \
106106
X (resource_deadlock_would_occur, EDEADLK) \
107107
X (resource_unavailable_try_again, EAGAIN) \
108108
X (result_out_of_range, ERANGE) \
109-
X (state_not_recoverable, ENOTRECOVERABLE) \
109+
/* X (state_not_recoverable, ENOTRECOVERABLE)*/\
110110
/* X (stream_timeout, ETIME) */\
111111
X (text_file_busy, ETXTBSY) \
112112
X (timed_out, ETIMEDOUT) \

cdk/include/mysql/cdk/mysqlx/session.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,6 @@ class Session
440440

441441
private:
442442

443-
friend Stmt_op;
444-
445443
// Send Connection Attributes
446444
void send_connection_attr(const Options &options);
447445
// Authentication (cdk::protocol::mysqlx::Auth_processor)

cdk/parser/tokenizer.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,6 @@ bool Tokenizer::iterator::parse_quotted_string(char qchar)
421421
*/
422422

423423

424-
namespace {
425-
426-
// Note: be independent from the system locale settings.
427-
428-
std::locale c_loc("C");
429-
const std::ctype<char> &ctf = std::use_facet<std::ctype<char>>(c_loc);
430-
431-
}
432-
433424
std::locale char_iterator::m_cloc("C");
434425

435426

common/result.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,26 @@ class Result_impl
10231023
if(!m_result_mdata.empty())
10241024
m_result_mdata.pop();
10251025
if (!m_result_cache.empty())
1026+
{
1027+
/*
1028+
At this point m_cache_it can point inside the last entry of
1029+
m_result_cache that is just to be removed. Such dangling iterator
1030+
can cause issues when later it is assigned to a new value (as
1031+
compiler thinks it is still pointing inside old container and might
1032+
want to do some cleanups). To avoid dangling iterator, we reset it
1033+
to something neutral here.
1034+
1035+
Note: This "fix" works under assumption that "one past the end"
1036+
iterator is compatible between different containers, which seems to
1037+
be the case for all compilers we use.
1038+
1039+
TODO: A better solution would be to use std::option<> type for
1040+
m_cache_it.
1041+
*/
1042+
1043+
m_cache_it = m_result_cache.back().end();
10261044
m_result_cache.pop();
1045+
}
10271046
if (!m_result_cache_size.empty())
10281047
m_result_cache_size.pop();
10291048
}

devapi/tests/crud-t.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ TEST_F(Crud, basic)
159159
cout << "Query sent, reading rows..." << endl;
160160
cout << "There are " << res.getColumnCount() << " columns in the result" << endl;
161161

162-
EXPECT_EQ(3, res.getColumnCount());
162+
//From server 8.0.19, 3 columns are expected
163+
//have 2 columns
164+
EXPECT_GE(res.getColumnCount(), 2);
163165

164166
Row row;
165167
unsigned row_count = 0;

devapi/tests/session-t.cc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,24 +2225,25 @@ TEST_F(Sess, pool_ttl)
22252225

22262226
#endif
22272227

2228-
{
2228+
// Temporary disabled, bug#30532629
22292229

2230+
#if 0
2231+
{
22302232
std::cout << "Not threaded" << std::endl;
22312233

22322234
settings.set(ClientOption::POOL_QUEUE_TIMEOUT, std::chrono::seconds(100),
2233-
ClientOption::POOL_MAX_IDLE_TIME, std::chrono::seconds(10));
2235+
ClientOption::POOL_MAX_IDLE_TIME, std::chrono::seconds(10));
22342236

22352237
mysqlx::Client client(settings);
22362238

22372239

2238-
auto get_sessions = [&client, &max_connections] ()
2240+
auto get_sessions = [&client, &max_connections]()
22392241
{
22402242
std::list<mysqlx::Session> sessions;
2241-
for(int i = 0; i < max_connections; ++i)
2243+
for (int i = 0; i < max_connections; ++i)
22422244
{
22432245
sessions.emplace_back(client);
22442246
EXPECT_EQ(1, sessions.back().sql("select 1").execute()
2245-
.fetchOne()[0].get<int>());
22462247
}
22472248
};
22482249

@@ -2254,15 +2255,13 @@ TEST_F(Sess, pool_ttl)
22542255

22552256
int this_thread_id = sql("SELECT CONNECTION_ID()").fetchOne()[0].get<int>();
22562257

2257-
std::list<Row> rows =sql("show processlist").fetchAll();
2258+
std::list<Row> rows = sql("show processlist").fetchAll();
22582259

22592260
for (auto row : rows)
22602261
{
22612262
auto val = row.get(7);
22622263
int thread_id = row.get(0).get<int>();
22632264
if (val.isNull() ||
2264-
val.get<string>() != string("PLUGIN") ||
2265-
thread_id == this_thread_id)
22662265
continue;
22672266

22682267
proccess_ids.push_back(thread_id);
@@ -2291,6 +2290,9 @@ TEST_F(Sess, pool_ttl)
22912290
client.getSession().sql("set global mysqlx_wait_timeout=28800").execute();
22922291
}
22932292

2293+
#endif // 0
2294+
2295+
22942296
{
22952297
settings.set(ClientOption::POOL_MAX_SIZE, 1);
22962298

0 commit comments

Comments
 (0)