push
github
Fix issue 1567 (#1570) ### Description closes https://github.com/go-sql-driver/mysql/issues/1567 When TLS is enabled, `mc.netConn` is rewritten after the TLS handshak as detailed here: https://github.com/go-sql-driver/mysql/blob/d86c4527b/packets.go#L355 Therefore, `mc.netConn` should not be accessed within the watcher goroutine. Instead, `mc.rawConn` should be initialized prior to invoking `mc.startWatcher`, and `mc.rawConn` should be used in lieu of `mc.netConn`. ### Checklist - [x] Code compiles correctly - [x] Created tests which fail without the change (if possible) - [x] All tests passing - [x] Extended the README / documentation, if necessary - [x] Added myself / the copyright holder to the AUTHORS file <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved variable naming for better code readability and maintenance. - Enhanced network connection handling logic. - **New Features** - Updated TCP connection handling to better support TCP Keepalives. - **Tests** - Added a new test to address and verify the fix for a specific issue related to TLS, connection pooling, and round trip time estimation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
4 of 4 new or added lines in 2 files covered. (100.0%)
443 existing lines in 11 files now uncovered.3122 of 3786 relevant lines covered (82.46%)
1130466.62 hits per line