Skip to content

Commit bf9b224

Browse files
author
Andrzej Religa
committed
Merge branch 'mysql-8.0' into mysql-trunk
2 parents d03adb8 + 2c5ab46 commit bf9b224

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

router/src/routing/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
# along with this program; if not, write to the Free Software
2121
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2222

23+
IF (NOT PROTOBUF_LITE_LIBRARY)
24+
MESSAGE(FATAL_ERROR "Routing plugin requires protobuf-lite library")
25+
ENDIF()
26+
2327
SET(ROUTING_SOURCE_FILES_X_PROTOCOL
2428
${CMAKE_CURRENT_SOURCE_DIR}/src/protocol/x_protocol.cc
2529
)
@@ -55,7 +59,7 @@ SET(include_dirs
5559

5660
SET(system_include_dirs
5761
${PROTOBUF_INCLUDE_DIR}
58-
${MYSQLX_GENERATE_DIR}/protobuf
62+
${MYSQLX_GENERATE_DIR}/protobuf_lite
5963
)
6064

6165
# link_directories(${PROJECT_BINARY_DIR}/ext/protobuf/protobuf-3.0.0/cmake/)
@@ -68,7 +72,7 @@ add_harness_plugin(routing
6872
TARGET_INCLUDE_DIRECTORIES(routing PRIVATE ${include_dirs})
6973
TARGET_INCLUDE_DIRECTORIES(routing SYSTEM PRIVATE ${system_include_dirs})
7074

71-
TARGET_LINK_LIBRARIES(routing PRIVATE mysqlxmessages ${PROTOBUF_LIBRARY})
75+
TARGET_LINK_LIBRARIES(routing PRIVATE mysqlxmessages_lite ${PROTOBUF_LITE_LIBRARY})
7276

7377
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
7478
TARGET_LINK_LIBRARIES(routing PRIVATE -lnsl PRIVATE -lsocket)

router/src/routing/src/protocol/x_protocol.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3636
#include <algorithm>
3737
#include <cassert>
3838

39-
using ProtobufMessage = google::protobuf::Message;
39+
using ProtobufMessage = google::protobuf::MessageLite;
4040
IMPORT_LOG_FUNCTIONS()
4141

4242
constexpr size_t kMessageHeaderSize = 5;
@@ -75,7 +75,7 @@ static bool send_message(const std::string &log_prefix, int destination,
7575

7676
static bool message_valid(const void *message_buffer, const int8_t message_type,
7777
const uint32_t message_size) {
78-
std::unique_ptr<google::protobuf::Message> msg;
78+
std::unique_ptr<google::protobuf::MessageLite> msg;
7979

8080
assert(message_type == Mysqlx::ClientMessages::SESS_AUTHENTICATE_START ||
8181
message_type == Mysqlx::ClientMessages::CON_CAPABILITIES_GET ||

router/src/routing/tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ INCLUDE_DIRECTORIES(
3030

3131
INCLUDE_DIRECTORIES(SYSTEM
3232
${PROTOBUF_INCLUDE_DIR}
33-
${MYSQLX_GENERATE_DIR}/protobuf
33+
${MYSQLX_GENERATE_DIR}/protobuf_lite
3434
)
3535

3636
# link_directories(${PROJECT_BINARY_DIR}/ext/protobuf/protobuf-3.0.0/cmake/)
3737
ADD_LIBRARY(routing_tests STATIC ${ROUTING_SOURCE_FILES})
3838
TARGET_LINK_LIBRARIES(routing_tests routertest_helpers router_lib
3939
metadata_cache_static mysql_protocol_static
40-
mysqlxmessages ${PROTOBUF_LIBRARY})
40+
mysqlxmessages_lite ${PROTOBUF_LITE_LIBRARY})
4141
TARGET_COMPILE_DEFINITIONS(routing_tests PRIVATE -Dmetadata_cache_DEFINE_STATIC=1)
4242
TARGET_COMPILE_DEFINITIONS(routing_tests PRIVATE -Dmysql_protocol_DEFINE_STATIC=1)
4343
TARGET_INCLUDE_DIRECTORIES(routing PRIVATE ${include_dirs})

router/src/routing/tests/test_x_protocol.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class XProtocolTest : public ::testing::Test {
6161

6262
void serialize_protobuf_msg_to_buffer(RoutingProtocolBuffer &buffer,
6363
size_t &buffer_offset,
64-
google::protobuf::Message &msg,
64+
google::protobuf::MessageLite &msg,
6565
unsigned char type) {
6666
size_t msg_size = msg.ByteSize();
6767
google::protobuf::io::CodedOutputStream::WriteLittleEndian32ToArray(

0 commit comments

Comments
 (0)