Skip to content

Commit be252ef

Browse files
committed
WL#15672: Upgrade Python Protobuf version to 4.21.12
Change-Id: Ida256ebbdea682dd15fb276326aa8876e9824547
1 parent 6ba6cd7 commit be252ef

20 files changed

+355
-4972
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Full release notes:
1111
v8.1.0
1212
======
1313

14+
- WL#15672: Upgrade Python Protobuf version to 4.21.12
1415
- WL#15630: Remove Python 3.7 support
1516
- WL#15591: Improve the network module
1617
- BUG#35349093: Compression doesn't work with C extension API

cpydist/data/deb/rules

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,5 @@ override_dh_installdocs:
131131
# anyway.
132132
SUBSTVARS = -Vpython3-distutils:Depends="python3-distutils"
133133

134-
# Python PROTOBUF is required to communicate with the server using a pure
135-
# Note that at this time, using PROTOBUF 4 is not supported
136-
SUBSTVARS += -Vpython3-protobuf:Depends='python3-protobuf (>= 3.11.0)'
137-
SUBSTVARS += -Vpython3-protobuf:Depends='python3-protobuf (<< 4)'
138-
139134
override_dh_gencontrol:
140135
dh_gencontrol -- $(SUBSTVARS)

cpydist/data/rpm/mysql-connector-python.spec

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2015, 2022, Oracle and/or its affiliates.
1+
# Copyright (c) 2015, 2023, Oracle and/or its affiliates.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0, as
@@ -26,7 +26,6 @@
2626
# along with this program; if not, write to the Free Software Foundation, Inc.,
2727
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2828

29-
%global requires_py_protobuf_version 3.11.0
3029
%global wants_py_dnspython_version 1.16.0
3130

3231
%undefine _package_note_file
@@ -179,11 +178,6 @@ Requires: python38
179178
Requires: python3-dns >= %{wants_py_dnspython_version}
180179
%endif
181180

182-
# We have no python3-protobuf on EL7, too old versions on EL8 and openSUSE 15
183-
%if 0%{?fedora} || 0%{?rhel} >= 9
184-
Requires: python3-protobuf >= %{requires_py_protobuf_version}, python3-protobuf < 4
185-
%endif
186-
187181

188182
%description -n mysql-connector-python3%{?product_suffix}
189183
MySQL Connector/Python enables Python programs to access MySQL

docs/mysqlx/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ As of Connector/Python 2.2.3, source distributions include a C++ Extension, that
6868
To build Connector/Python C++ Extension for Protobuf, you must satisfy the following prerequisites:
6969

7070
* A C/C++ compiler, such as ``gcc``
71-
* Protobuf C++ (version >= 3.6.1)
71+
* Protobuf C++ (version >= 4.21.1, <= 4.21.12)
7272
* Python development files
7373
* MySQL Connector/C or MySQL Server installed, including development files to compile the optional C Extension that interfaces with the MySQL C client library
7474

docs/mysqlx/requirements.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Requirements
33

44
* MySQL 8.0.0 or higher, with the X Plugin enabled
55
* Python >= 3.8
6-
* Protobuf C++ (version >= 3.11.0, <= 3.19.6)
7-
* Python Protobuf (version >= 3.11.0, <= 3.20.3)
6+
* Protobuf C++ (version >= 4.21.1, <= 4.21.12)
7+
* Python Protobuf (version >= 4.21.1, <= 4.21.12)
88
* dnspython (version >= 1.16.0, <= 2.3.0) for DNS SRV support
99
* lz4 (version >= 2.1.6, <= 4.3.2) for connection compression support
1010
* zstandard (version >= 0.12.0, <= 0.19.0) for connection compression support
Lines changed: 25 additions & 274 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Copyright (c) 2017, 2020, Oracle and/or its affiliates.
1+
# -*- coding: utf-8 -*-
2+
# Copyright (c) 2017, 2023, Oracle and/or its affiliates.
23
#
34
# This program is free software; you can redistribute it and/or modify
45
# it under the terms of the GNU General Public License, version 2.0, as
@@ -31,13 +32,11 @@
3132

3233
# type: ignore
3334

34-
import sys
35-
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
35+
"""Generated protocol buffer code."""
36+
from google.protobuf.internal import builder as _builder
3637
from google.protobuf import descriptor as _descriptor
37-
from google.protobuf import message as _message
38-
from google.protobuf import reflection as _reflection
38+
from google.protobuf import descriptor_pool as _descriptor_pool
3939
from google.protobuf import symbol_database as _symbol_database
40-
from google.protobuf import descriptor_pb2
4140
# @@protoc_insertion_point(imports)
4241

4342
_sym_db = _symbol_database.Default()
@@ -47,272 +46,24 @@
4746
from mysqlx.protobuf import mysqlx_pb2 as mysqlx__pb2
4847

4948

50-
DESCRIPTOR = _descriptor.FileDescriptor(
51-
name='mysqlx_connection.proto',
52-
package='Mysqlx.Connection',
53-
syntax='proto2',
54-
serialized_pb=_b('\n\x17mysqlx_connection.proto\x12\x11Mysqlx.Connection\x1a\x16mysqlx_datatypes.proto\x1a\x0cmysqlx.proto\"@\n\nCapability\x12\x0c\n\x04name\x18\x01 \x02(\t\x12$\n\x05value\x18\x02 \x02(\x0b\x32\x15.Mysqlx.Datatypes.Any\"C\n\x0c\x43\x61pabilities\x12\x33\n\x0c\x63\x61pabilities\x18\x01 \x03(\x0b\x32\x1d.Mysqlx.Connection.Capability\"\x11\n\x0f\x43\x61pabilitiesGet\"H\n\x0f\x43\x61pabilitiesSet\x12\x35\n\x0c\x63\x61pabilities\x18\x01 \x02(\x0b\x32\x1f.Mysqlx.Connection.Capabilities\"\x07\n\x05\x43lose\"\xa5\x01\n\x0b\x43ompression\x12\x19\n\x11uncompressed_size\x18\x01 \x01(\x04\x12\x34\n\x0fserver_messages\x18\x02 \x01(\x0e\x32\x1b.Mysqlx.ServerMessages.Type\x12\x34\n\x0f\x63lient_messages\x18\x03 \x01(\x0e\x32\x1b.Mysqlx.ClientMessages.Type\x12\x0f\n\x07payload\x18\x04 \x02(\x0c\x42\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03')
55-
,
56-
dependencies=[mysqlx__datatypes__pb2.DESCRIPTOR,mysqlx__pb2.DESCRIPTOR,])
57-
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
58-
59-
60-
61-
62-
_CAPABILITY = _descriptor.Descriptor(
63-
name='Capability',
64-
full_name='Mysqlx.Connection.Capability',
65-
filename=None,
66-
file=DESCRIPTOR,
67-
containing_type=None,
68-
fields=[
69-
_descriptor.FieldDescriptor(
70-
name='name', full_name='Mysqlx.Connection.Capability.name', index=0,
71-
number=1, type=9, cpp_type=9, label=2,
72-
has_default_value=False, default_value=_b("").decode('utf-8'),
73-
message_type=None, enum_type=None, containing_type=None,
74-
is_extension=False, extension_scope=None,
75-
options=None),
76-
_descriptor.FieldDescriptor(
77-
name='value', full_name='Mysqlx.Connection.Capability.value', index=1,
78-
number=2, type=11, cpp_type=10, label=2,
79-
has_default_value=False, default_value=None,
80-
message_type=None, enum_type=None, containing_type=None,
81-
is_extension=False, extension_scope=None,
82-
options=None),
83-
],
84-
extensions=[
85-
],
86-
nested_types=[],
87-
enum_types=[
88-
],
89-
options=None,
90-
is_extendable=False,
91-
syntax='proto2',
92-
extension_ranges=[],
93-
oneofs=[
94-
],
95-
serialized_start=84,
96-
serialized_end=148,
97-
)
98-
99-
100-
_CAPABILITIES = _descriptor.Descriptor(
101-
name='Capabilities',
102-
full_name='Mysqlx.Connection.Capabilities',
103-
filename=None,
104-
file=DESCRIPTOR,
105-
containing_type=None,
106-
fields=[
107-
_descriptor.FieldDescriptor(
108-
name='capabilities', full_name='Mysqlx.Connection.Capabilities.capabilities', index=0,
109-
number=1, type=11, cpp_type=10, label=3,
110-
has_default_value=False, default_value=[],
111-
message_type=None, enum_type=None, containing_type=None,
112-
is_extension=False, extension_scope=None,
113-
options=None),
114-
],
115-
extensions=[
116-
],
117-
nested_types=[],
118-
enum_types=[
119-
],
120-
options=None,
121-
is_extendable=False,
122-
syntax='proto2',
123-
extension_ranges=[],
124-
oneofs=[
125-
],
126-
serialized_start=150,
127-
serialized_end=217,
128-
)
129-
130-
131-
_CAPABILITIESGET = _descriptor.Descriptor(
132-
name='CapabilitiesGet',
133-
full_name='Mysqlx.Connection.CapabilitiesGet',
134-
filename=None,
135-
file=DESCRIPTOR,
136-
containing_type=None,
137-
fields=[
138-
],
139-
extensions=[
140-
],
141-
nested_types=[],
142-
enum_types=[
143-
],
144-
options=None,
145-
is_extendable=False,
146-
syntax='proto2',
147-
extension_ranges=[],
148-
oneofs=[
149-
],
150-
serialized_start=219,
151-
serialized_end=236,
152-
)
153-
154-
155-
_CAPABILITIESSET = _descriptor.Descriptor(
156-
name='CapabilitiesSet',
157-
full_name='Mysqlx.Connection.CapabilitiesSet',
158-
filename=None,
159-
file=DESCRIPTOR,
160-
containing_type=None,
161-
fields=[
162-
_descriptor.FieldDescriptor(
163-
name='capabilities', full_name='Mysqlx.Connection.CapabilitiesSet.capabilities', index=0,
164-
number=1, type=11, cpp_type=10, label=2,
165-
has_default_value=False, default_value=None,
166-
message_type=None, enum_type=None, containing_type=None,
167-
is_extension=False, extension_scope=None,
168-
options=None),
169-
],
170-
extensions=[
171-
],
172-
nested_types=[],
173-
enum_types=[
174-
],
175-
options=None,
176-
is_extendable=False,
177-
syntax='proto2',
178-
extension_ranges=[],
179-
oneofs=[
180-
],
181-
serialized_start=238,
182-
serialized_end=310,
183-
)
184-
185-
186-
_CLOSE = _descriptor.Descriptor(
187-
name='Close',
188-
full_name='Mysqlx.Connection.Close',
189-
filename=None,
190-
file=DESCRIPTOR,
191-
containing_type=None,
192-
fields=[
193-
],
194-
extensions=[
195-
],
196-
nested_types=[],
197-
enum_types=[
198-
],
199-
options=None,
200-
is_extendable=False,
201-
syntax='proto2',
202-
extension_ranges=[],
203-
oneofs=[
204-
],
205-
serialized_start=312,
206-
serialized_end=319,
207-
)
208-
209-
210-
_COMPRESSION = _descriptor.Descriptor(
211-
name='Compression',
212-
full_name='Mysqlx.Connection.Compression',
213-
filename=None,
214-
file=DESCRIPTOR,
215-
containing_type=None,
216-
fields=[
217-
_descriptor.FieldDescriptor(
218-
name='uncompressed_size', full_name='Mysqlx.Connection.Compression.uncompressed_size', index=0,
219-
number=1, type=4, cpp_type=4, label=1,
220-
has_default_value=False, default_value=0,
221-
message_type=None, enum_type=None, containing_type=None,
222-
is_extension=False, extension_scope=None,
223-
options=None),
224-
_descriptor.FieldDescriptor(
225-
name='server_messages', full_name='Mysqlx.Connection.Compression.server_messages', index=1,
226-
number=2, type=14, cpp_type=8, label=1,
227-
has_default_value=False, default_value=0,
228-
message_type=None, enum_type=None, containing_type=None,
229-
is_extension=False, extension_scope=None,
230-
options=None),
231-
_descriptor.FieldDescriptor(
232-
name='client_messages', full_name='Mysqlx.Connection.Compression.client_messages', index=2,
233-
number=3, type=14, cpp_type=8, label=1,
234-
has_default_value=False, default_value=1,
235-
message_type=None, enum_type=None, containing_type=None,
236-
is_extension=False, extension_scope=None,
237-
options=None),
238-
_descriptor.FieldDescriptor(
239-
name='payload', full_name='Mysqlx.Connection.Compression.payload', index=3,
240-
number=4, type=12, cpp_type=9, label=2,
241-
has_default_value=False, default_value=_b(""),
242-
message_type=None, enum_type=None, containing_type=None,
243-
is_extension=False, extension_scope=None,
244-
options=None),
245-
],
246-
extensions=[
247-
],
248-
nested_types=[],
249-
enum_types=[
250-
],
251-
options=None,
252-
is_extendable=False,
253-
syntax='proto2',
254-
extension_ranges=[],
255-
oneofs=[
256-
],
257-
serialized_start=322,
258-
serialized_end=487,
259-
)
260-
261-
_CAPABILITY.fields_by_name['value'].message_type = mysqlx__datatypes__pb2._ANY
262-
_CAPABILITIES.fields_by_name['capabilities'].message_type = _CAPABILITY
263-
_CAPABILITIESSET.fields_by_name['capabilities'].message_type = _CAPABILITIES
264-
_COMPRESSION.fields_by_name['server_messages'].enum_type = mysqlx__pb2._SERVERMESSAGES_TYPE
265-
_COMPRESSION.fields_by_name['client_messages'].enum_type = mysqlx__pb2._CLIENTMESSAGES_TYPE
266-
DESCRIPTOR.message_types_by_name['Capability'] = _CAPABILITY
267-
DESCRIPTOR.message_types_by_name['Capabilities'] = _CAPABILITIES
268-
DESCRIPTOR.message_types_by_name['CapabilitiesGet'] = _CAPABILITIESGET
269-
DESCRIPTOR.message_types_by_name['CapabilitiesSet'] = _CAPABILITIESSET
270-
DESCRIPTOR.message_types_by_name['Close'] = _CLOSE
271-
DESCRIPTOR.message_types_by_name['Compression'] = _COMPRESSION
272-
273-
Capability = _reflection.GeneratedProtocolMessageType('Capability', (_message.Message,), dict(
274-
DESCRIPTOR = _CAPABILITY,
275-
__module__ = 'mysqlx_connection_pb2'
276-
# @@protoc_insertion_point(class_scope:Mysqlx.Connection.Capability)
277-
))
278-
_sym_db.RegisterMessage(Capability)
279-
280-
Capabilities = _reflection.GeneratedProtocolMessageType('Capabilities', (_message.Message,), dict(
281-
DESCRIPTOR = _CAPABILITIES,
282-
__module__ = 'mysqlx_connection_pb2'
283-
# @@protoc_insertion_point(class_scope:Mysqlx.Connection.Capabilities)
284-
))
285-
_sym_db.RegisterMessage(Capabilities)
286-
287-
CapabilitiesGet = _reflection.GeneratedProtocolMessageType('CapabilitiesGet', (_message.Message,), dict(
288-
DESCRIPTOR = _CAPABILITIESGET,
289-
__module__ = 'mysqlx_connection_pb2'
290-
# @@protoc_insertion_point(class_scope:Mysqlx.Connection.CapabilitiesGet)
291-
))
292-
_sym_db.RegisterMessage(CapabilitiesGet)
293-
294-
CapabilitiesSet = _reflection.GeneratedProtocolMessageType('CapabilitiesSet', (_message.Message,), dict(
295-
DESCRIPTOR = _CAPABILITIESSET,
296-
__module__ = 'mysqlx_connection_pb2'
297-
# @@protoc_insertion_point(class_scope:Mysqlx.Connection.CapabilitiesSet)
298-
))
299-
_sym_db.RegisterMessage(CapabilitiesSet)
300-
301-
Close = _reflection.GeneratedProtocolMessageType('Close', (_message.Message,), dict(
302-
DESCRIPTOR = _CLOSE,
303-
__module__ = 'mysqlx_connection_pb2'
304-
# @@protoc_insertion_point(class_scope:Mysqlx.Connection.Close)
305-
))
306-
_sym_db.RegisterMessage(Close)
307-
308-
Compression = _reflection.GeneratedProtocolMessageType('Compression', (_message.Message,), dict(
309-
DESCRIPTOR = _COMPRESSION,
310-
__module__ = 'mysqlx_connection_pb2'
311-
# @@protoc_insertion_point(class_scope:Mysqlx.Connection.Compression)
312-
))
313-
_sym_db.RegisterMessage(Compression)
314-
315-
316-
DESCRIPTOR.has_options = True
317-
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003'))
49+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17mysqlx_connection.proto\x12\x11Mysqlx.Connection\x1a\x16mysqlx_datatypes.proto\x1a\x0cmysqlx.proto\"@\n\nCapability\x12\x0c\n\x04name\x18\x01 \x02(\t\x12$\n\x05value\x18\x02 \x02(\x0b\x32\x15.Mysqlx.Datatypes.Any\"C\n\x0c\x43\x61pabilities\x12\x33\n\x0c\x63\x61pabilities\x18\x01 \x03(\x0b\x32\x1d.Mysqlx.Connection.Capability\"\x11\n\x0f\x43\x61pabilitiesGet\"H\n\x0f\x43\x61pabilitiesSet\x12\x35\n\x0c\x63\x61pabilities\x18\x01 \x02(\x0b\x32\x1f.Mysqlx.Connection.Capabilities\"\x07\n\x05\x43lose\"\xa5\x01\n\x0b\x43ompression\x12\x19\n\x11uncompressed_size\x18\x01 \x01(\x04\x12\x34\n\x0fserver_messages\x18\x02 \x01(\x0e\x32\x1b.Mysqlx.ServerMessages.Type\x12\x34\n\x0f\x63lient_messages\x18\x03 \x01(\x0e\x32\x1b.Mysqlx.ClientMessages.Type\x12\x0f\n\x07payload\x18\x04 \x02(\x0c\x42\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03')
50+
51+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
52+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mysqlx_connection_pb2', globals())
53+
if _descriptor._USE_C_DESCRIPTORS == False:
54+
55+
DESCRIPTOR._options = None
56+
DESCRIPTOR._serialized_options = b'\n\027com.mysql.cj.x.protobufH\003'
57+
_CAPABILITY._serialized_start=84
58+
_CAPABILITY._serialized_end=148
59+
_CAPABILITIES._serialized_start=150
60+
_CAPABILITIES._serialized_end=217
61+
_CAPABILITIESGET._serialized_start=219
62+
_CAPABILITIESGET._serialized_end=236
63+
_CAPABILITIESSET._serialized_start=238
64+
_CAPABILITIESSET._serialized_end=310
65+
_CLOSE._serialized_start=312
66+
_CLOSE._serialized_end=319
67+
_COMPRESSION._serialized_start=322
68+
_COMPRESSION._serialized_end=487
31869
# @@protoc_insertion_point(module_scope)

0 commit comments

Comments
 (0)