@@ -47,8 +47,15 @@ pub struct ConnectionInfo {
47
47
48
48
/// A server-generated identifier that uniquely identifies the connection. Available on server
49
49
/// versions 4.2+. This may be used to correlate driver connections with server logs.
50
+ /// If the connection ID sent by the server is too large for an i32, this will be a truncated
51
+ /// value.
50
52
pub server_id : Option < i32 > ,
51
53
54
+ /// A server-generated identifier that uniquely identifies the connection. Available on server
55
+ /// versions 4.2+. This may be used to correlate driver connections with server logs. This
56
+ /// value will not be truncated and should be used rather than `server_id`.
57
+ pub server_id_i64 : Option < i64 > ,
58
+
52
59
/// The address that the connection is connected to.
53
60
pub address : ServerAddress ,
54
61
}
@@ -60,7 +67,7 @@ pub(crate) struct Connection {
60
67
/// Driver-generated ID for the connection.
61
68
pub ( super ) id : u32 ,
62
69
/// Server-generated ID for the connection.
63
- pub ( crate ) server_id : Option < i32 > ,
70
+ pub ( crate ) server_id : Option < i64 > ,
64
71
65
72
pub ( crate ) address : ServerAddress ,
66
73
pub ( crate ) generation : ConnectionGeneration ,
@@ -165,7 +172,8 @@ impl Connection {
165
172
pub ( crate ) fn info ( & self ) -> ConnectionInfo {
166
173
ConnectionInfo {
167
174
id : self . id ,
168
- server_id : self . server_id ,
175
+ server_id : self . server_id . map ( |value| value as i32 ) ,
176
+ server_id_i64 : self . server_id ,
169
177
address : self . address . clone ( ) ,
170
178
}
171
179
}
0 commit comments