Merge lp:~sergei.glushchenko/percona-server/5.5-ps-bug1203567 into lp:percona-server/5.6

Proposed by Sergei Glushchenko
Status: Superseded
Proposed branch: lp:~sergei.glushchenko/percona-server/5.5-ps-bug1203567
Merge into: lp:percona-server/5.6
Diff against target: 165 lines (+121/-1) (has conflicts)
2 files modified
Percona-Server/sql/mysqld.cc (+114/-1)
Percona-Server/sql/sql_connect.cc (+7/-0)
Text conflict in Percona-Server/sql/mysqld.cc
Text conflict in Percona-Server/sql/sql_connect.cc
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-server/5.5-ps-bug1203567
Reviewer Review Type Date Requested Status
Percona core Pending
Review via email: mp+176921@code.launchpad.net

This proposal has been superseded by a proposal from 2013-07-25.

Description of the change

Bug 1203567: close_socket() is not declared
The reason is missed close_socket from MariaDB in threadpool port.
Fixed by porting close_socket from MariaDB.
This branch also fixes few issues which prevent embedded server from
being able to be built. However this branch is still impossible to
compile with

CFLAGS="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -O0 -g3 -gdwarf-2" CXXFLAGS="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -O0 -g3 -gdwarf-2" cmake .. -DCMAKE_VERBOSE_MAKEFILE=true -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DENABLE_DTRACE=OFF -DENABLE_DOWNLOADS=1 -DWITH_DEBUG=1

because embedded server is broken due to many undefined symbols such as
acl_is_utility_user, init_intvar_from_file, init_global_user_stats, etc.

http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param-valgrind/1/

I did not check test results because the bug was about impossibility of build.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/sql/mysqld.cc'
2--- Percona-Server/sql/mysqld.cc 2013-06-25 13:13:06 +0000
3+++ Percona-Server/sql/mysqld.cc 2013-07-25 11:21:48 +0000
4@@ -1488,6 +1488,27 @@
5 DBUG_VOID_RETURN;
6 }
7
8+#ifdef HAVE_CLOSE_SERVER_SOCK
9+static void close_socket(my_socket sock, const char *info)
10+{
11+ DBUG_ENTER("close_socket");
12+
13+ if (sock != INVALID_SOCKET)
14+ {
15+ DBUG_PRINT("info", ("calling shutdown on %s socket", info));
16+ (void) mysql_socket_shutdown(sock, SHUT_RDWR);
17+#if defined(__NETWARE__)
18+ /*
19+ The following code is disabled for normal systems as it causes MySQL
20+ to hang on AIX 4.3 during shutdown
21+ */
22+ DBUG_PRINT("info", ("calling closesocket on %s socket", info));
23+ (void) closesocket(tmp_sock);
24+#endif
25+ }
26+ DBUG_VOID_RETURN;
27+}
28+#endif
29
30 static void close_server_sock()
31 {
32@@ -5145,8 +5166,100 @@
33 #define decrement_handler_count()
34 #endif /* defined(_WIN32) || defined(HAVE_SMEM) */
35
36-
37+<<<<<<< TREE
38+=======
39 #ifndef EMBEDDED_LIBRARY
40+#if defined(__linux__)
41+/*
42+ * Auto detect if we support flash cache on the host system.
43+ * This needs to be called before we setuid away from root
44+ * to avoid permission problems on opening the device node.
45+ */
46+static void init_cachedev(void)
47+{
48+ struct statfs stfs_data_home_dir;
49+ struct statfs stfs;
50+ struct mntent *ent;
51+ pid_t pid = getpid();
52+ FILE *mounts;
53+ const char *error_message= NULL;
54+
55+ // disabled by default
56+ cachedev_fd = -1;
57+
58+ if (!mysql_data_home)
59+ {
60+ error_message= "Flashcache setup error (mysql_data_home not set)";
61+ goto epilogue;
62+ }
63+
64+ if (statfs(mysql_data_home, &stfs_data_home_dir) < 0)
65+ {
66+ error_message= "Flashcache setup error (statfs)";
67+ goto epilogue;
68+ }
69+
70+ mounts = setmntent("/etc/mtab", "r");
71+ if (mounts == NULL)
72+ {
73+ error_message= "Flashcache setup error (setmntent)";
74+ goto epilogue;
75+ }
76+
77+ while ((ent = getmntent(mounts)) != NULL)
78+ {
79+ if (statfs(ent->mnt_dir, &stfs) < 0)
80+ continue;
81+ if (memcmp(&stfs.f_fsid, &stfs_data_home_dir.f_fsid, sizeof(fsid_t)) == 0)
82+ break;
83+ }
84+ endmntent(mounts);
85+
86+ if (ent == NULL)
87+ {
88+ error_message= "Flashcache setup error (getmntent loop)";
89+ goto epilogue;
90+ }
91+
92+ cachedev_fd = open(ent->mnt_fsname, O_RDONLY);
93+ if (cachedev_fd < 0)
94+ {
95+ error_message= "Flashcache setup error (open flash device)";
96+ goto epilogue;
97+ }
98+
99+ /* cleanup previous whitelistings */
100+ if (ioctl(cachedev_fd, FLASHCACHEDELALLWHITELIST, &pid) < 0)
101+ {
102+ close(cachedev_fd);
103+ cachedev_fd = -1;
104+ error_message= "Flashcache setup error (ioctl)";
105+ } else {
106+ ioctl(cachedev_fd, FLASHCACHEADDWHITELIST, &pid);
107+ }
108+
109+epilogue:
110+ if (error_message) {
111+ sql_perror(error_message);
112+ unireg_abort(1);
113+ }
114+ sql_print_information("Flashcache bypass support initialized successfully");
115+
116+}
117+
118+static void cleanup_cachedev(void)
119+{
120+ pid_t pid = getpid();
121+
122+ if (cachedev_enabled) {
123+ ioctl(cachedev_fd, FLASHCACHEDELWHITELIST, &pid);
124+ close(cachedev_fd);
125+ cachedev_fd = -1;
126+ }
127+}
128+#endif//__linux__
129+>>>>>>> MERGE-SOURCE
130+
131 #ifndef DBUG_OFF
132 /*
133 Debugging helper function to keep the locale database
134
135=== modified file 'Percona-Server/sql/sql_connect.cc'
136--- Percona-Server/sql/sql_connect.cc 2013-06-25 13:13:06 +0000
137+++ Percona-Server/sql/sql_connect.cc 2013-07-25 11:21:48 +0000
138@@ -58,11 +58,14 @@
139 #define MIN_HANDSHAKE_SIZE 6
140 #endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
141
142+<<<<<<< TREE
143 #ifndef EMBEDDED_LIBRARY
144 // Increments connection count for user.
145 static int increment_connection_count(THD* thd, bool use_lock);
146 #endif
147
148+=======
149+>>>>>>> MERGE-SOURCE
150 // Uses the THD to update the global stats by user name and client IP
151 void update_global_user_stats(THD* thd, bool create_user, time_t now);
152
153@@ -83,6 +86,10 @@
154 */
155
156 #ifndef NO_EMBEDDED_ACCESS_CHECKS
157+
158+// Increments connection count for user.
159+static int increment_connection_count(THD* thd, bool use_lock);
160+
161 static HASH hash_user_connections;
162
163 int get_or_create_user_conn(THD *thd, const char *user,
164
165=== modified file 'Percona-Server/sql/sys_vars.cc'

Subscribers

People subscribed via source and target branches