Merge lp:~laurynas-biveinis/percona-server/bug1323014 into lp:percona-server/5.6

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 597
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1323014
Merge into: lp:percona-server/5.6
Diff against target: 138 lines (+18/-14)
7 files modified
plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/database.cpp (+4/-2)
plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/handlersocket.cpp (+2/-1)
plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr.cpp (+1/-1)
plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp (+3/-7)
plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/mysql_incl.hpp (+3/-0)
plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/auto_addrinfo.hpp (+3/-1)
plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/socket.cpp (+2/-2)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1323014
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Registry Administrators Pending
Review via email: mp+220927@code.launchpad.net

Description of the change

Fix bug 1323014 (Handlersocket failed to compile in debug config) by fixing numerous
compilation warnings: missing struct field initializers and macro re-definitions.

http://jenkins.percona.com/job/percona-server-5.6-param/611/

Will self-approve and merge later today if no objections, then will address any comments in follow-ups as necessary.

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/database.cpp'
2--- plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/database.cpp 2014-04-25 15:30:49 +0000
3+++ plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/database.cpp 2014-05-26 09:07:28 +0000
4@@ -240,7 +240,8 @@
5 DBG_SHUT(fprintf(stderr, "HNDSOCK wsts\n"));
6 pthread_mutex_lock(&LOCK_server_started);
7 while (!mysqld_server_started) {
8- timespec abstime = { };
9+ timespec abstime;
10+ memset(&abstime, 0, sizeof(abstime));
11 set_timespec(abstime, 1);
12 pthread_cond_timedwait(&COND_server_started, &LOCK_server_started,
13 &abstime);
14@@ -291,7 +292,8 @@
15 DENA_THR_OFFSETOF(locked_tables_list)));
16 thd->store_globals();
17 thd->system_thread = static_cast<enum_thread_type>(1<<30UL);
18- const NET v = { 0 };
19+ NET v;
20+ memset(&v, 0, sizeof(v));
21 thd->net = v;
22 if (for_write_flag) {
23 #if MYSQL_VERSION_ID >= 50505
24
25=== modified file 'plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/handlersocket.cpp'
26--- plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/handlersocket.cpp 2014-04-25 15:30:49 +0000
27+++ plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/handlersocket.cpp 2014-05-26 09:07:28 +0000
28@@ -216,7 +216,8 @@
29 0x0100 /* 1.0 */,
30 daemon_handlersocket_status_variables,
31 daemon_handlersocket_system_variables,
32- 0
33+ NULL,
34+ 0,
35 }
36 mysql_declare_plugin_end;
37
38
39=== modified file 'plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr.cpp'
40--- plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr.cpp 2014-04-25 15:30:49 +0000
41+++ plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr.cpp 2014-05-26 09:07:28 +0000
42@@ -54,7 +54,7 @@
43 void
44 check_nfile(size_t nfile)
45 {
46- struct rlimit rl = { };
47+ struct rlimit rl;
48 const int r = getrlimit(RLIMIT_NOFILE, &rl);
49 if (r != 0) {
50 fatal_abort("check_nfile: getrlimit failed");
51
52=== modified file 'plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp'
53--- plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp 2014-04-25 15:30:49 +0000
54+++ plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp 2014-05-26 09:07:28 +0000
55@@ -293,9 +293,7 @@
56 if (epoll_fd.get() < 0) {
57 fatal_abort("epoll_create");
58 }
59- epoll_event ev = { };
60- ev.events = EPOLLIN;
61- ev.data.ptr = 0;
62+ epoll_event ev = { EPOLLIN, { 0 } };
63 if (epoll_ctl(epoll_fd.get(), EPOLL_CTL_ADD, cshared.listen_fd.get(), &ev)
64 != 0) {
65 fatal_abort("epoll_ctl EPOLL_CTL_ADD");
66@@ -505,7 +503,7 @@
67 if (fcntl(c->fd.get(), F_SETFL, O_NONBLOCK) != 0) {
68 fatal_abort("F_SETFL O_NONBLOCK");
69 }
70- epoll_event cev = { };
71+ epoll_event cev;
72 cev.events = EPOLLIN | EPOLLOUT | EPOLLET;
73 cev.data.ptr = c.get();
74 c->nb_last_io = now;
75@@ -630,9 +628,7 @@
76 total_num_conns * 2 > num_conns * cshared.num_threads) {
77 e_acc = true;
78 }
79- epoll_event ev = { };
80- ev.events = EPOLLIN;
81- ev.data.ptr = 0;
82+ epoll_event ev = { EPOLLIN, { 0 } };
83 if (e_acc == accept_enabled) {
84 } else if (e_acc) {
85 if (epoll_ctl(epoll_fd.get(), EPOLL_CTL_ADD, cshared.listen_fd.get(), &ev)
86
87=== modified file 'plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/mysql_incl.hpp'
88--- plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/mysql_incl.hpp 2014-04-25 15:30:49 +0000
89+++ plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/mysql_incl.hpp 2014-05-26 09:07:28 +0000
90@@ -13,7 +13,10 @@
91 #define HAVE_CONFIG_H
92 #endif
93
94+#ifndef MYSQL_DYNAMIC_PLUGIN
95 #define MYSQL_DYNAMIC_PLUGIN
96+#endif
97+
98 #define MYSQL_SERVER 1
99
100 #include <my_config.h>
101
102=== modified file 'plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/auto_addrinfo.hpp'
103--- plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/auto_addrinfo.hpp 2014-04-25 15:30:49 +0000
104+++ plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/auto_addrinfo.hpp 2014-05-26 09:07:28 +0000
105@@ -9,6 +9,7 @@
106 #ifndef DENA_AUTO_ADDRINFO_HPP
107 #define DENA_AUTO_ADDRINFO_HPP
108
109+#include <cstring>
110 #include <sys/types.h>
111 #include <sys/socket.h>
112 #include <netdb.h>
113@@ -32,7 +33,8 @@
114 int resolve(const char *node, const char *service, int flags = 0,
115 int family = AF_UNSPEC, int socktype = SOCK_STREAM, int protocol = 0) {
116 reset();
117- addrinfo hints = { };
118+ addrinfo hints;
119+ memset(&hints, 0, sizeof(hints));
120 hints.ai_flags = flags;
121 hints.ai_family = family;
122 hints.ai_socktype = socktype;
123
124=== modified file 'plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/socket.cpp'
125--- plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/socket.cpp 2014-04-25 15:30:49 +0000
126+++ plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/socket.cpp 2014-05-26 09:07:28 +0000
127@@ -80,9 +80,9 @@
128 socket_set_options(auto_file& fd, const socket_args& args, std::string& err_r)
129 {
130 if (args.timeout != 0 && !args.nonblocking) {
131- struct timeval tv = { };
132+ struct timeval tv;
133+ memset(&tv, 0, sizeof(tv));
134 tv.tv_sec = args.timeout;
135- tv.tv_usec = 0;
136 if (setsockopt(fd.get(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) != 0) {
137 return errno_string("setsockopt SO_RCVTIMEO", errno, err_r);
138 }

Subscribers

People subscribed via source and target branches