pass Port and UserId to cancel connection#1305
Conversation
Signed-off-by: Nickolay Batov <stilettk@gmail.com>
|
@bgrainger unfortunately, I couldn’t figure it out how to write an integration test for it. I didn't find a way to setup a database with server redirection. Can you help me with that? |
|
The only server I know that supports it is Azure Database for MySQL Single Server. I don't have an instance of that available for integration tests, and am unlikely to set that up because it will be retired by September 2024: https://learn.microsoft.com/en-us/azure/mysql/single-server/whats-happening-to-mysql-single-server. (Based on #1302 I assume you're using Azure Single Server so please be aware that you've got less than eighteen months to migrate off it.) If there was an OSS MySQL DB that supported redirection, we could try integration testing in a Docker container. However, I'm not aware of one. (MariaDB was considering it as a potential feature, but it was never implemented AFAIK.) |
|
What are the options then? Merge this PR without an integration test for the bug?
Yes, thank you, migration is planned, but it's still a plenty of time to live with it so this fix is useful for us. |
I can use the AZ CLI to create a new Single Server instance and do ad-hoc testing, as well as code review. |
…irect Pass Port and UserId to cancel connection. Fixes #1302
|
I performed some small code cleanup, and tested with a private Azure Database for MySQL Single Server instance. Your PR fixed the failure to connect when cancelling a query. Thanks for the fix! |
Fixes #1302.
When canceling a connection, current
PortandUserIDare passed to new connection, because host, port and user might be different when the server supports redirection (and usingServerRedirectionMode).