/[packages]/updates/8/mysql-connector-c++/current/SOURCES/mysql-connector-cpp-mariadb.patch
ViewVC logotype

Contents of /updates/8/mysql-connector-c++/current/SOURCES/mysql-connector-cpp-mariadb.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1935261 - (show annotations) (download)
Mon Jan 23 18:41:04 2023 UTC (14 months, 3 weeks ago) by daviddavid
File size: 14130 byte(s)
- new version: 8.0.32, fixes CVE-2022-24407 (mga#31430)
- use system zstd, zlib and lz4
- rediff mariadb patch
- drop unneeded system protobuf patch

1 diff -Nrup a/jdbc/cppconn/version_info.h.cmake b/jdbc/cppconn/version_info.h.cmake
2 --- a/jdbc/cppconn/version_info.h.cmake 2022-12-09 08:00:36.000000000 +0100
3 +++ b/jdbc/cppconn/version_info.h.cmake 2023-01-22 18:53:00.456883178 +0100
4 @@ -48,5 +48,6 @@
5
6 #define MYCPPCONN_STATIC_MYSQL_VERSION "@MYSQL_VERSION@"
7 #define MYCPPCONN_STATIC_MYSQL_VERSION_ID @MYSQL_NUM_VERSION@
8 +#define MYCPPCONN_MARIADB_BUILD
9
10 #define MYCPPCONN_BOOST_VERSION @Boost_VERSION@
11 diff -Nrup a/jdbc/driver/mysql_connection.cpp b/jdbc/driver/mysql_connection.cpp
12 --- a/jdbc/driver/mysql_connection.cpp 2022-12-09 08:00:36.000000000 +0100
13 +++ b/jdbc/driver/mysql_connection.cpp 2023-01-22 20:21:02.714025656 +0100
14 @@ -268,7 +268,7 @@ static const String2IntMap booleanOption
15 {OPT_CAN_HANDLE_EXPIRED_PASSWORDS, MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, true},
16 {OPT_CONNECT_ATTR_RESET, MYSQL_OPT_CONNECT_ATTR_RESET, true},
17 {OPT_RECONNECT, MYSQL_OPT_RECONNECT, true},
18 -#if MYCPPCONN_STATIC_MYSQL_VERSION_ID < 80000
19 +#if MYCPPCONN_STATIC_MYSQL_VERSION_ID < 80000 || defined(MYCPPCONN_MARIADB_BUILD)
20 {"sslVerify", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, false}, // Deprecated
21 {"sslEnforce", MYSQL_OPT_SSL_ENFORCE, false} // Deprecated
22 #else
23 @@ -290,9 +290,9 @@ static const String2IntMap intOptions[]=
24 {OPT_MAX_ALLOWED_PACKET, MYSQL_OPT_MAX_ALLOWED_PACKET, false},
25 {OPT_NET_BUFFER_LENGTH, MYSQL_OPT_NET_BUFFER_LENGTH, false},
26 #endif
27 - {OPT_SSL_MODE, MYSQL_OPT_SSL_MODE , false},
28 - {"OPT_SSL_MODE", MYSQL_OPT_SSL_MODE , false},
29 -#if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000
30 + //{OPT_SSL_MODE, MYSQL_OPT_SSL_MODE , false},
31 + //{"OPT_SSL_MODE", MYSQL_OPT_SSL_MODE , false},
32 +#if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000 && !defined(MYCPPCONN_MARIADB_BUILD)
33 {OPT_RETRY_COUNT, MYSQL_OPT_RETRY_COUNT, false},
34 #endif
35 };
36 @@ -321,7 +321,7 @@ static const String2IntMap stringOptions
37 {OPT_TLS_VERSION, MYSQL_OPT_TLS_VERSION, true},
38 {"OPT_TLS_VERSION", MYSQL_OPT_TLS_VERSION, true},
39 #endif
40 - {OPT_LOAD_DATA_LOCAL_DIR, MYSQL_OPT_LOAD_DATA_LOCAL_DIR, false}
41 + //{OPT_LOAD_DATA_LOCAL_DIR, MYSQL_OPT_LOAD_DATA_LOCAL_DIR, false}
42 };
43
44
45 @@ -330,7 +330,7 @@ static const String2IntMap stringOptions
46 inline
47 ::sql::mysql::MySQL_Connection_Options option_conversion(unsigned long client_version, int option)
48 {
49 - #if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000
50 + #if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000 && !defined(MYCPPCONN_MARIADB_BUILD)
51 if(client_version <80011)
52 {
53 switch (option) {
54 @@ -520,7 +520,7 @@ void MySQL_Connection::init(ConnectOptio
55 int client_exp_pwd = false;
56 bool opt_dns_srv = false;
57 bool opt_multi_host = false;
58 -#if MYCPPCONN_STATIC_MYSQL_VERSION_ID < 80000
59 +#if MYCPPCONN_STATIC_MYSQL_VERSION_ID < 80000 || defined(MYCPPCONN_MARIADB_BUILD)
60 bool secure_auth= true;
61 #endif
62
63 @@ -636,7 +636,7 @@ void MySQL_Connection::init(ConnectOptio
64 } else {
65 throw sql::InvalidArgumentException("No string value passed for password");
66 }
67 - } else if (!it->first.compare(OPT_PASSWORD1)) {
68 + /*} else if (!it->first.compare(OPT_PASSWORD1)) {
69 try {
70 p_s = (it->second).get< sql::SQLString >();
71 } catch (sql::InvalidArgumentException&) {
72 @@ -672,7 +672,7 @@ void MySQL_Connection::init(ConnectOptio
73 } else {
74 throw sql::InvalidArgumentException("No string value passed for password3");
75 }
76 - } else if (!it->first.compare(OPT_PORT)) {
77 + */} else if (!it->first.compare(OPT_PORT)) {
78 try {
79 p_i = (it->second).get< int >();
80 } catch (sql::InvalidArgumentException&) {
81 @@ -936,7 +936,7 @@ void MySQL_Connection::init(ConnectOptio
82 } catch (sql::InvalidArgumentException&) {
83 throw sql::InvalidArgumentException("Wrong type passed for useLegacyAuth expected sql::SQLString");
84 }
85 - #if MYCPPCONN_STATIC_MYSQL_VERSION_ID < 80000
86 + #if MYCPPCONN_STATIC_MYSQL_VERSION_ID < 80000 || defined(MYCPPCONN_MARIADB_BUILD)
87 if (p_b) {
88 secure_auth= !*p_b;
89 } else {
90 @@ -978,7 +978,7 @@ void MySQL_Connection::init(ConnectOptio
91 } else if (!it->first.compare(OPT_CONNECT_ATTR_RESET)) {
92 proxy->options(MYSQL_OPT_CONNECT_ATTR_RESET, 0);
93
94 - #if MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80000
95 + #if MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80000 && !defined(MYCPPCONN_MARIADB_BUILD)
96
97 //Deprecated
98 } else if (!it->first.compare("sslVerify")) {
99 @@ -1001,6 +1001,7 @@ void MySQL_Connection::init(ConnectOptio
100 throw sql::InvalidArgumentException("Wrong type passed for OPT_OCI_CONFIG_FILE. Expected sql::SQLString.");
101 }
102
103 + /*
104 try {
105 proxy->plugin_option(MYSQL_CLIENT_AUTHENTICATION_PLUGIN,
106 "authentication_oci_client",
107 @@ -1012,6 +1013,7 @@ void MySQL_Connection::init(ConnectOptio
108 OPT_OCI_CONFIG_FILE
109 );
110 }
111 + */
112
113 } else if (!it->first.compare(OPT_AUTHENTICATION_KERBEROS_CLIENT_MODE)) {
114 #if defined(_WIN32)
115 @@ -1080,7 +1082,7 @@ void MySQL_Connection::init(ConnectOptio
116
117 }
118
119 -#if MYCPPCONN_STATIC_MYSQL_VERSION_ID < 80000
120 +#if MYCPPCONN_STATIC_MYSQL_VERSION_ID < 80000 || defined(MYCPPCONN_MARIADB_BUILD)
121 try {
122 proxy->options(MYSQL_SECURE_AUTH, &secure_auth);
123 } catch (sql::InvalidArgumentException& e) {
124 @@ -1232,6 +1234,7 @@ void MySQL_Connection::init(ConnectOptio
125 if (proxy && callback && *callback)
126 {
127 callback_mutex.lock();
128 + /*
129 try
130 {
131 fido_callback_instance = callback;
132 @@ -1248,6 +1251,7 @@ void MySQL_Connection::init(ConnectOptio
133 OPT_OCI_CONFIG_FILE
134 );
135 }
136 + */
137 }
138 }
139
140 @@ -1255,6 +1259,7 @@ void MySQL_Connection::init(ConnectOptio
141 {
142 if(fido_callback_instance && proxy)
143 {
144 + /*
145 try
146 {
147 proxy->plugin_option(MYSQL_CLIENT_AUTHENTICATION_PLUGIN,
148 @@ -1262,7 +1267,7 @@ void MySQL_Connection::init(ConnectOptio
149 "fido_messages_callback",
150 nullptr);
151 }
152 - catch(...) {}
153 + catch(...) {} */
154 fido_callback_instance = nullptr;
155 callback_mutex.unlock();
156 }
157 @@ -1846,7 +1851,7 @@ MySQL_Connection::setClientOption(const
158 #endif
159 } else if (!optionName.compare(OPT_LOAD_DATA_LOCAL_DIR))
160 {
161 - proxy->options(MYSQL_OPT_LOAD_DATA_LOCAL_DIR, optionValue);
162 + //proxy->options(MYSQL_OPT_LOAD_DATA_LOCAL_DIR, optionValue);
163 }
164 return this;
165 }
166 diff -Nrup a/jdbc/driver/mysql_connection_options.h b/jdbc/driver/mysql_connection_options.h
167 --- a/jdbc/driver/mysql_connection_options.h 2022-12-09 08:00:36.000000000 +0100
168 +++ b/jdbc/driver/mysql_connection_options.h 2023-01-22 19:05:18.089996917 +0100
169 @@ -41,7 +41,7 @@ namespace mysql
170
171 enum MySQL_Connection_Options
172 {
173 -#if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000
174 +#if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000 && !defined(MYCPPCONN_MARIADB_BUILD)
175 MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
176 MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
177 MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
178 @@ -92,8 +92,8 @@ enum MySQL_Connection_Options
179 MYSQL_OPT_SSL_ENFORCE,
180 #if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 50700
181 MYSQL_OPT_MAX_ALLOWED_PACKET, MYSQL_OPT_NET_BUFFER_LENGTH,
182 - MYSQL_OPT_TLS_VERSION,
183 - MYSQL_OPT_SSL_MODE
184 + MYSQL_OPT_TLS_VERSION
185 +// MYSQL_OPT_SSL_MODE
186 #endif //MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 50700
187 #endif //MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000
188
189 diff -Nrup a/jdbc/driver/mysql_resultset_metadata.h b/jdbc/driver/mysql_resultset_metadata.h
190 --- a/jdbc/driver/mysql_resultset_metadata.h 2022-12-09 08:00:36.000000000 +0100
191 +++ b/jdbc/driver/mysql_resultset_metadata.h 2023-01-22 19:07:09.748939037 +0100
192 @@ -38,7 +38,7 @@
193 #include <cppconn/resultset_metadata.h>
194 #include <cppconn/version_info.h>
195
196 -#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004)
197 +#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004 && !defined(MYCPPCONN_MARIADB_BUILD))
198 struct MYSQL_FIELD;
199 #else
200 struct st_mysql_field;
201 diff -Nrup a/jdbc/driver/nativeapi/libmysql_static_proxy.cpp b/jdbc/driver/nativeapi/libmysql_static_proxy.cpp
202 --- a/jdbc/driver/nativeapi/libmysql_static_proxy.cpp 2022-12-09 08:00:36.000000000 +0100
203 +++ b/jdbc/driver/nativeapi/libmysql_static_proxy.cpp 2023-01-22 19:08:10.098446558 +0100
204 @@ -326,7 +326,7 @@ int
205 LibmysqlStaticProxy::get_option(MYSQL * mysql, enum mysql_option option, const void *arg)
206 {
207 #if MYSQL_VERSION_ID >= 50703
208 - if (::mysql_get_option(mysql, option, arg)) {
209 + if (::mysql_get_option(mysql, option, const_cast<void*>(arg))) {
210 throw sql::InvalidArgumentException("Unsupported option provided to mysql_get_option()");
211 } else {
212 return 0;
213 diff -Nrup a/jdbc/driver/nativeapi/mysql_native_connection_wrapper.cpp b/jdbc/driver/nativeapi/mysql_native_connection_wrapper.cpp
214 --- a/jdbc/driver/nativeapi/mysql_native_connection_wrapper.cpp 2022-12-09 08:00:36.000000000 +0100
215 +++ b/jdbc/driver/nativeapi/mysql_native_connection_wrapper.cpp 2023-01-22 19:09:06.389919062 +0100
216 @@ -97,11 +97,11 @@ get_mysql_option(sql::mysql::MySQL_Conne
217 case sql::mysql::MYSQL_OPT_MAX_ALLOWED_PACKET: return ::MYSQL_OPT_MAX_ALLOWED_PACKET;
218 case sql::mysql::MYSQL_OPT_NET_BUFFER_LENGTH: return ::MYSQL_OPT_NET_BUFFER_LENGTH;
219 case sql::mysql::MYSQL_OPT_TLS_VERSION: return ::MYSQL_OPT_TLS_VERSION;
220 - case sql::mysql::MYSQL_OPT_SSL_MODE: return ::MYSQL_OPT_SSL_MODE;
221 + //case sql::mysql::MYSQL_OPT_SSL_MODE: return ::MYSQL_OPT_SSL_MODE;
222 #endif
223
224
225 -#if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000
226 +#if MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80000 && !defined(MYCPPCONN_MARIADB_BUILD)
227 case sql::mysql::MYSQL_OPT_RETRY_COUNT: return ::MYSQL_OPT_RETRY_COUNT;
228 case sql::mysql::MYSQL_OPT_GET_SERVER_PUBLIC_KEY: return ::MYSQL_OPT_GET_SERVER_PUBLIC_KEY;
229 case sql::mysql::MYSQL_OPT_OPTIONAL_RESULTSET_METADATA: return ::MYSQL_OPT_OPTIONAL_RESULTSET_METADATA;
230 diff -Nrup a/jdbc/driver/nativeapi/mysql_native_connection_wrapper.h b/jdbc/driver/nativeapi/mysql_native_connection_wrapper.h
231 --- a/jdbc/driver/nativeapi/mysql_native_connection_wrapper.h 2022-12-09 08:00:36.000000000 +0100
232 +++ b/jdbc/driver/nativeapi/mysql_native_connection_wrapper.h 2023-01-22 19:09:34.197152171 +0100
233 @@ -60,7 +60,7 @@ class MySQL_NativeConnectionWrapper : pu
234 boost::shared_ptr< IMySQLCAPI > api;
235
236
237 -#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004)
238 +#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004 && !defined(MYCPPCONN_MARIADB_BUILD))
239 struct MYSQL* mysql;
240 #else
241 struct st_mysql* mysql;
242 diff -Nrup a/jdbc/driver/nativeapi/mysql_native_resultset_wrapper.h b/jdbc/driver/nativeapi/mysql_native_resultset_wrapper.h
243 --- a/jdbc/driver/nativeapi/mysql_native_resultset_wrapper.h 2022-12-09 08:00:36.000000000 +0100
244 +++ b/jdbc/driver/nativeapi/mysql_native_resultset_wrapper.h 2023-01-22 19:10:19.469531313 +0100
245 @@ -38,7 +38,7 @@
246 #include "native_resultset_wrapper.h"
247 #include "../cppconn/version_info.h"
248
249 -#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004)
250 +#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004 && !defined(MYCPPCONN_MARIADB_BUILD))
251 struct MYSQL_RES;
252 struct MYSQL;
253 #else
254 diff -Nrup a/jdbc/driver/nativeapi/mysql_native_statement_wrapper.h b/jdbc/driver/nativeapi/mysql_native_statement_wrapper.h
255 --- a/jdbc/driver/nativeapi/mysql_native_statement_wrapper.h 2022-12-09 08:00:36.000000000 +0100
256 +++ b/jdbc/driver/nativeapi/mysql_native_statement_wrapper.h 2023-01-22 19:12:05.383416675 +0100
257 @@ -38,7 +38,7 @@
258
259 #include "native_statement_wrapper.h"
260
261 -#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004)
262 +#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004 && !defined(MYCPPCONN_MARIADB_BUILD))
263 struct MYSQL_STMT;
264 #else
265 struct st_mysql_stmt;
266 diff -Nrup a/jdbc/driver/nativeapi/native_connection_wrapper.h b/jdbc/driver/nativeapi/native_connection_wrapper.h
267 --- a/jdbc/driver/nativeapi/native_connection_wrapper.h 2022-12-09 08:00:36.000000000 +0100
268 +++ b/jdbc/driver/nativeapi/native_connection_wrapper.h 2023-01-22 19:12:37.642685929 +0100
269 @@ -41,7 +41,7 @@
270
271 #include "../mysql_connection_options.h"
272
273 -#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80004)
274 +#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID >= 80004 && !defined(MYCPPCONN_MARIADB_BUILD))
275 struct MYSQL_BIND;
276 #else
277 struct st_mysql_bind;
278 diff -Nrup a/jdbc/driver/nativeapi/native_resultset_wrapper.h b/jdbc/driver/nativeapi/native_resultset_wrapper.h
279 --- a/jdbc/driver/nativeapi/native_resultset_wrapper.h 2022-12-09 08:00:36.000000000 +0100
280 +++ b/jdbc/driver/nativeapi/native_resultset_wrapper.h 2023-01-22 19:13:08.348942065 +0100
281 @@ -41,7 +41,7 @@
282
283 #include "../cppconn/version_info.h"
284
285 -#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004)
286 +#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004 && !defined(MYCPPCONN_MARIADB_BUILD))
287 struct MYSQL_FIELD;
288 #else
289 struct st_mysql_field;
290 diff -Nrup a/jdbc/driver/nativeapi/native_statement_wrapper.h b/jdbc/driver/nativeapi/native_statement_wrapper.h
291 --- a/jdbc/driver/nativeapi/native_statement_wrapper.h 2022-12-09 08:00:36.000000000 +0100
292 +++ b/jdbc/driver/nativeapi/native_statement_wrapper.h 2023-01-22 19:13:37.903188462 +0100
293 @@ -42,7 +42,7 @@
294 #include "../mysql_statement_options.h"
295 #include <cppconn/version_info.h>
296
297 -#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004)
298 +#if (MYCPPCONN_STATIC_MYSQL_VERSION_ID > 80004 && !defined(MYCPPCONN_MARIADB_BUILD))
299 struct MYSQL_BIND;
300 struct MYSQL_RES;
301 #else
302 diff -Nrup a/jdbc/FindMySQL.cmake b/jdbc/FindMySQL.cmake
303 --- a/jdbc/FindMySQL.cmake 2022-12-09 08:00:36.000000000 +0100
304 +++ b/jdbc/FindMySQL.cmake 2023-01-22 19:14:46.707761598 +0100
305 @@ -505,6 +505,8 @@ elseif(MYSQL_CONFIG_EXECUTABLE)
306 "\"${MYSQL_CONFIG_EXECUTABLE}\"")
307 endif()
308
309 + list(GET MYSQL_INCLUDE_DIR 0 MYSQL_INCLUDE_DIR)
310 +
311 if(NOT EXISTS "${MYSQL_INCLUDE_DIR}/mysql.h")
312 message(FATAL_ERROR "Could not find \"mysql.h\" in \"${MYSQL_INCLUDE_DIR}\" "
313 "found from running \"${MYSQL_CONFIG_EXECUTABLE}\"")

  ViewVC Help
Powered by ViewVC 1.1.30