Skip to content

Commit 540294b

Browse files
committed
Support for fb_info_protocol_version (#933).
1 parent 9fa4dd0 commit 540294b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbDatabaseInfoTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public void CompleteDatabaseInfoTest()
5252
nameof(FbDatabaseInfo.GetDbFileIdAsync),
5353
nameof(FbDatabaseInfo.GetDbGuidAsync),
5454
nameof(FbDatabaseInfo.GetCreationTimestampAsync),
55+
nameof(FbDatabaseInfo.GetProtocolVersionAsync),
5556
}.Contains(m.Name))
5657
continue;
5758

Provider/src/FirebirdSql.Data.FirebirdClient/Common/IscHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public static List<object> ParseDatabaseInfo(byte[] buffer)
7373
case IscCodes.isc_info_active_tran_count:
7474
case IscCodes.fb_info_next_attachment:
7575
case IscCodes.fb_info_next_statement:
76+
case IscCodes.fb_info_protocol_version:
7677
info.Add(VaxInteger(buffer, pos, length));
7778
break;
7879

Provider/src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbDatabaseInfo.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,15 @@ public Task<FbZonedDateTime> GetCreationTimestampAsync(CancellationToken cancell
450450
return GetValueAsync<FbZonedDateTime>(IscCodes.fb_info_creation_timestamp_tz, cancellationToken);
451451
}
452452

453+
public int GetProtocolVersion()
454+
{
455+
return GetValue<int>(IscCodes.fb_info_protocol_version);
456+
}
457+
public Task<int> GetProtocolVersionAsync(CancellationToken cancellationToken = default)
458+
{
459+
return GetValueAsync<int>(IscCodes.fb_info_protocol_version, cancellationToken);
460+
}
461+
453462
#endregion
454463

455464
#region Constructors
@@ -473,7 +482,7 @@ private T GetValue<T>(byte item)
473482
IscCodes.isc_info_end
474483
};
475484
var info = Connection.InnerConnection.Database.GetDatabaseInfo(items);
476-
return info.Any() ? ConvertValue<T>(info[0]): default;
485+
return info.Any() ? ConvertValue<T>(info[0]) : default;
477486
}
478487
private async Task<T> GetValueAsync<T>(byte item, CancellationToken cancellationToken = default)
479488
{

0 commit comments

Comments
 (0)