@@ -47,8 +47,15 @@ pub struct ConnectionInfo {
4747
4848 /// A server-generated identifier that uniquely identifies the connection. Available on server
4949 /// 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.
5052 pub server_id : Option < i32 > ,
5153
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+
5259 /// The address that the connection is connected to.
5360 pub address : ServerAddress ,
5461}
@@ -60,7 +67,7 @@ pub(crate) struct Connection {
6067 /// Driver-generated ID for the connection.
6168 pub ( super ) id : u32 ,
6269 /// Server-generated ID for the connection.
63- pub ( crate ) server_id : Option < i32 > ,
70+ pub ( crate ) server_id : Option < i64 > ,
6471
6572 pub ( crate ) address : ServerAddress ,
6673 pub ( crate ) generation : ConnectionGeneration ,
@@ -165,7 +172,8 @@ impl Connection {
165172 pub ( crate ) fn info ( & self ) -> ConnectionInfo {
166173 ConnectionInfo {
167174 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 ,
169177 address : self . address . clone ( ) ,
170178 }
171179 }
0 commit comments