Skip to content

Commit 8bff148

Browse files
akojimabjornmu
authored andcommitted
Various xplugin fixes
- Fix for crash in connection accept code Was missing a mutex in timer for X connection timeout - Updated tests that print version numbers so that they don't get printed and break diffs - Fixed some warnings in Windows - Removed outdated/obsolete documentation for plugin - Fix for protobuf memleak (cherry picked from commit c82f0aa9454ff7799371567c9a6ee5f223383e8c) Conflicts: rapid/plugin/x/protocol/conf.py
1 parent 3b274d0 commit 8bff148

File tree

25 files changed

+131
-1155
lines changed

25 files changed

+131
-1155
lines changed

extra/protobuf/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
# protobuf-2.6.0/m4/
2727
# protobuf-2.6.0/vsprojects/
2828

29+
SET(PROTOBUF_MSVC_DISABLED_WARNINGS "/wd4018 /wd4005 /wd4244 /wd4267 /wd4065")
30+
2931
# Turn off some warning flags when compiling protobuf
3032
MY_CHECK_CXX_COMPILER_FLAG("-Wno-sign-compare" HAVE_NO_SIGN_COMPARE)
3133
IF(HAVE_NO_SIGN_COMPARE)
@@ -95,6 +97,11 @@ SET(LIBPROTOBUF_LITE_SOURCES
9597
${PROTO_SRC_DIR}/google/protobuf/io/zero_copy_stream.cc
9698
${PROTO_SRC_DIR}/google/protobuf/io/zero_copy_stream_impl_lite.cc
9799
)
100+
101+
IF(MSVC)
102+
ADD_COMPILE_FLAGS(${LIBPROTOBUF_LITE_SOURCES} COMPILE_FLAGS ${PROTOBUF_MSVC_DISABLED_WARNINGS})
103+
ENDIF(MSVC)
104+
98105
ADD_CONVENIENCE_LIBRARY(protobuf-lite ${LIBPROTOBUF_LITE_SOURCES})
99106
SET_PROPERTY(TARGET protobuf-lite PROPERTY EXCLUDE_FROM_ALL TRUE)
100107

@@ -125,6 +132,11 @@ SET(LIBPROTOBUF_SOURCES
125132
${PROTO_SRC_DIR}/google/protobuf/compiler/importer.cc
126133
${PROTO_SRC_DIR}/google/protobuf/compiler/parser.cc
127134
)
135+
136+
IF(MSVC)
137+
ADD_COMPILE_FLAGS(${LIBPROTOBUF_SOURCES} COMPILE_FLAGS ${PROTOBUF_MSVC_DISABLED_WARNINGS})
138+
ENDIF(MSVC)
139+
128140
ADD_CONVENIENCE_LIBRARY(protobuf
129141
${LIBPROTOBUF_SOURCES} ${LIBPROTOBUF_LITE_SOURCES})
130142
TARGET_LINK_LIBRARIES(protobuf
@@ -201,6 +213,10 @@ SET(LIBPROTOC_SOURCES
201213
${PROTO_SRC_DIR}/google/protobuf/compiler/python/python_generator.cc
202214
)
203215

216+
IF(MSVC)
217+
ADD_COMPILE_FLAGS(${LIBPROTOC_SOURCES} COMPILE_FLAGS ${PROTOBUF_MSVC_DISABLED_WARNINGS})
218+
ENDIF(MSVC)
219+
204220
ADD_CONVENIENCE_LIBRARY(protoclib ${LIBPROTOC_SOURCES})
205221
ADD_EXECUTABLE(protoc ${PROTO_SRC_DIR}/google/protobuf/compiler/main.cc)
206222
TARGET_LINK_LIBRARIES(protoc protobuf protoclib protobuf)

extra/protobuf/protobuf-2.6.0/src/google/protobuf/generated_message_util.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ double NaN() {
5151
const ::std::string* empty_string_;
5252
GOOGLE_PROTOBUF_DECLARE_ONCE(empty_string_once_init_);
5353

54+
void DeleteEmptyString() {
55+
delete empty_string_;
56+
}
57+
5458
void InitEmptyString() {
5559
empty_string_ = new string;
60+
OnShutdown(&DeleteEmptyString);
5661
}
5762

5863

mysql-test/suite/xplugin/r/installxplugin.result

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ RUN show variables like 'mysqlx_min_worker_threads%'
5353
Variable_name Value
5454
mysqlx_min_worker_threads 2
5555
0 rows affected
56-
RUN SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_TYPE_VERSION,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%'
57-
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPEPLUGIN_TYPE_VERSIONPLUGIN_LIBRARY_VERSION LOAD_OPTION
58-
mysqlx 1.0 ACTIVE DAEMON50712.01.6 ON
56+
RUN SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%'
57+
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_LIBRARY_VERSION LOAD_OPTION
58+
mysqlx 1.0 ACTIVE DAEMON 1.6 ON
5959
0 rows affected
6060
Mysqlx.Ok {
6161
msg: "bye!"
@@ -151,9 +151,9 @@ mysqlx_max_connections 500
151151
show variables like 'mysqlx_min_worker_threads%';
152152
Variable_name Value
153153
mysqlx_min_worker_threads 50
154-
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_TYPE_VERSION,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
155-
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPEPLUGIN_TYPE_VERSIONPLUGIN_LIBRARY_VERSION LOAD_OPTION
156-
mysqlx 1.0 ACTIVE DAEMON50712.01.6 ON
154+
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
155+
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_LIBRARY_VERSION LOAD_OPTION
156+
mysqlx 1.0 ACTIVE DAEMON 1.6 ON
157157
uninstall plugin mysqlx;
158158
# restart: --plugin-load=mysqlx.so --mysqlx_idle_worker_thread_timeout=70 --mysqlx_max_allowed_packet=4048576 --mysqlx_max_connections=500 --mysqlx_min_worker_threads=50
159159
show variables like 'mysqlx_idle_worker_thread_timeout%';
@@ -177,8 +177,8 @@ show variables like 'mysqlx_max_connections%';
177177
Variable_name Value
178178
show variables like 'mysqlx_min_worker_threads%';
179179
Variable_name Value
180-
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_TYPE_VERSION,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
181-
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPEPLUGIN_TYPE_VERSIONPLUGIN_LIBRARY_VERSION LOAD_OPTION
180+
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
181+
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_LIBRARY_VERSION LOAD_OPTION
182182
INSTALL PLUGIN mysqlx soname "mysqlx.so";
183183
uninstall plugin mysqlx;
184184
# restart: --max_connections=151
@@ -259,9 +259,9 @@ RUN show variables like 'mysqlx_min_worker_threads%'
259259
Variable_name Value
260260
mysqlx_min_worker_threads 50
261261
0 rows affected
262-
RUN SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_TYPE_VERSION,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%'
263-
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPEPLUGIN_TYPE_VERSIONPLUGIN_LIBRARY_VERSION LOAD_OPTION
264-
mysqlx 1.0 ACTIVE DAEMON50712.01.6 ON
262+
RUN SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%'
263+
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_LIBRARY_VERSION LOAD_OPTION
264+
mysqlx 1.0 ACTIVE DAEMON 1.6 ON
265265
0 rows affected
266266
Mysqlx.Ok {
267267
msg: "bye!"
@@ -356,9 +356,9 @@ RUN show variables like 'mysqlx_min_worker_threads%'
356356
Variable_name Value
357357
mysqlx_min_worker_threads 50
358358
0 rows affected
359-
RUN SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_TYPE_VERSION,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%'
360-
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPEPLUGIN_TYPE_VERSIONPLUGIN_LIBRARY_VERSION LOAD_OPTION
361-
mysqlx 1.0 ACTIVE DAEMON50712.01.6 ON
359+
RUN SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%'
360+
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_LIBRARY_VERSION LOAD_OPTION
361+
mysqlx 1.0 ACTIVE DAEMON 1.6 ON
362362
0 rows affected
363363
Mysqlx.Ok {
364364
msg: "bye!"

mysql-test/suite/xplugin/t/client_close.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ SELECT `user`,`host`,`db`,`command`,`state`,`info` FROM INFORMATION_SCHEMA.PROCE
3535
Mysqlx.Connection.Close {
3636
}
3737
-->recvtype Mysqlx.Ok
38-
-->peerdisc 1000 1000
38+
-->peerdisc 1000 2000
3939
-->endmacro
4040

4141

mysql-test/suite/xplugin/t/installxplugin.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ show variables like 'mysqlx_idle_worker_thread_timeout%';
3232
show variables like 'mysqlx_max_allowed_packet%';
3333
show variables like 'mysqlx_max_connections%';
3434
show variables like 'mysqlx_min_worker_threads%';
35-
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_TYPE_VERSION,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
35+
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
3636
-->endsql
3737
EOF
3838

@@ -134,7 +134,7 @@ show variables like 'mysqlx_max_allowed_packet%';
134134
show variables like 'mysqlx_max_connections%';
135135
show variables like 'mysqlx_min_worker_threads%';
136136
--replace_regex /\.dll/.so/
137-
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_TYPE_VERSION,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
137+
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
138138

139139
##uninstall mysqlx plugin with old protocol session when server started with mysqlx plugin variables with other than default values
140140
uninstall plugin mysqlx;
@@ -150,7 +150,7 @@ show variables like 'mysqlx_idle_worker_thread_timeout%';
150150
show variables like 'mysqlx_max_allowed_packet%';
151151
show variables like 'mysqlx_max_connections%';
152152
show variables like 'mysqlx_min_worker_threads%';
153-
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_TYPE_VERSION,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
153+
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY_VERSION,LOAD_OPTION from information_schema.plugins where PLUGIN_NAME LIKE 'mysqlx%';
154154
--replace_regex /\.dll/.so/
155155
--eval INSTALL PLUGIN mysqlx soname "$MYSQLXPLUGIN"
156156

rapid/plugin/x/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ ELSE()
111111
SET(xplugin_PROTOBUF_LIB ${PROTOBUF_LITE_LIBRARY})
112112
ENDIF()
113113

114+
IF(MSVC)
115+
ADD_COMPILE_FLAGS(${PROTO_SRCS} ${PROTO_LITE_SRCS} COMPILE_FLAGS "/wd4018")
116+
ENDIF(MSVC)
114117

115118
# Built *without* -DMYSQL_DYNAMIC_PLUGIN
116119
ADD_CONVENIENCE_LIBRARY(xplugin ${xplugin_SRC} ${xplugin_HDRS} ${xplugin_PROTOBUF_SRC})

0 commit comments

Comments
 (0)