Skip to content

Commit fdd2ba5

Browse files
authored
CSHARP-4965: Bump maxWireVersion for MongoDB 7.2 (#1266)
1 parent 88455ac commit fdd2ba5

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

src/MongoDB.Driver.Core/Core/Misc/WireVersion.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ internal static class WireVersion
104104
/// Wire version 21.
105105
/// </summary>
106106
public const int Server70 = 21;
107+
/// <summary>
108+
/// Wire version 22.
109+
/// </summary>
110+
public const int Server71 = 22;
111+
/// <summary>
112+
/// Wire version 23.
113+
/// </summary>
114+
public const int Server72 = 23;
107115

108116
#region static
109117
private static List<WireVersionInfo> __knownWireVersions = new()
@@ -134,10 +142,12 @@ internal static class WireVersion
134142
new WireVersionInfo(wireVersion: 18, major: 6, minor: 1),
135143
new WireVersionInfo(wireVersion: 19, major: 6, minor: 2),
136144
new WireVersionInfo(wireVersion: 20, major: 6, minor: 3),
137-
new WireVersionInfo(wireVersion: 21, major: 7, minor: 0)
145+
new WireVersionInfo(wireVersion: 21, major: 7, minor: 0),
146+
new WireVersionInfo(wireVersion: 22, major: 7, minor: 1),
147+
new WireVersionInfo(wireVersion: 23, major: 7, minor: 2)
138148
};
139149

140-
private static Range<int> __supportedWireVersionRange = CreateSupportedWireVersionRange(minWireVersion: 6, maxWireVersion: 21);
150+
private static Range<int> __supportedWireVersionRange = CreateSupportedWireVersionRange(minWireVersion: 6, maxWireVersion: 23);
141151

142152
private static Range<int> CreateSupportedWireVersionRange(int minWireVersion, int maxWireVersion)
143153
{

tests/MongoDB.Driver.Core.Tests/Core/Clusters/ClusterTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void SupportedWireVersionRange_should_return_expected_result()
6464
{
6565
var result = Cluster.SupportedWireVersionRange;
6666

67-
result.Should().Be(new Range<int>(6, 21));
67+
result.Should().Be(new Range<int>(6, 23));
6868
}
6969

7070
[Fact]
@@ -331,8 +331,8 @@ public void SelectServer_should_throw_if_the_matched_server_cannot_be_found_and_
331331
[Theory]
332332
[InlineData(0, 0, false)]
333333
[InlineData(0, 0, true)]
334-
[InlineData(22, 23, false)]
335-
[InlineData(22, 23, true)]
334+
[InlineData(24, 25, false)]
335+
[InlineData(24, 25, true)]
336336
public void SelectServer_should_throw_if_any_servers_are_incompatible(int min, int max, bool async)
337337
{
338338
var subject = CreateSubject();

tests/MongoDB.Driver.Core.Tests/Core/Misc/WireVersionTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void GetServerVersionForErrorMessage_should_return_expected_serverVersion
4646
[Fact]
4747
public void SupportedWireRange_should_be_correct()
4848
{
49-
WireVersion.SupportedWireVersionRange.Should().Be(new Range<int>(6, 21));
49+
WireVersion.SupportedWireVersionRange.Should().Be(new Range<int>(6, 23));
5050
}
5151

5252
[Fact]
@@ -59,7 +59,9 @@ public void ToServerVersion_should_throw_if_wireVersion_less_than_0()
5959

6060
[Theory]
6161
[InlineData(99, null, null)]
62-
[InlineData(22, null, null)]
62+
[InlineData(24, null, null)]
63+
[InlineData(23, 7, 2)]
64+
[InlineData(22, 7, 1)]
6365
[InlineData(21, 7, 0)]
6466
[InlineData(20, 6, 3)]
6567
[InlineData(19, 6, 2)]

tests/MongoDB.Driver.Core.Tests/Core/Servers/ServerDescriptionTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,11 @@ public void Equals_should_return_true_when_all_fields_are_equal()
280280
[InlineData(new[] { 16, 17 }, true)]
281281
[InlineData(new[] { 18, 19 }, true)]
282282
[InlineData(new[] { 19, 20 }, true)]
283-
[InlineData(new[] { 19, 20 }, true)]
284283
[InlineData(new[] { 20, 21 }, true)]
285284
[InlineData(new[] { 21, 22 }, true)]
286-
[InlineData(new[] { 22, 23 }, false)]
285+
[InlineData(new[] { 22, 23 }, true)]
286+
[InlineData(new[] { 23, 24 }, true)]
287+
[InlineData(new[] { 24, 25 }, false)]
287288
public void IsCompatibleWithDriver_should_return_expected_result(int[] minMaxWireVersions, bool expectedResult)
288289
{
289290
var clusterId = new ClusterId(1);

0 commit comments

Comments
 (0)