Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/mysql_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ char * MySQL_Connection::connect_start_DNS_lookup() {
host_ip = connected_host_details.ip;
}
else {
// NOTE: DNS cache miss — hostname is passed directly to
// mysql_real_connect which resolves via the MariaDB client library
// using AF_UNSPEC. The mysql-resolution_family setting does NOT
// apply here; it only governs the DNS cache resolver thread.
Comment on lines +962 to +965

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment states that mysql-resolution_family governs the DNS cache resolver thread. However, the implementation of monitor_dns_resolver_thread in lib/MySQL_Monitor.cpp appears to use a hardcoded AF_UNSPEC for the address family:

// lib/MySQL_Monitor.cpp:4675
hints.ai_family = AF_UNSPEC;

This makes the comment potentially misleading as it suggests mysql-resolution_family is being used by the resolver thread when it is not. To avoid confusion, the comment should be updated to accurately reflect the current implementation.

Comment on lines +962 to +965

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new comment refers to a mysql-resolution_family setting and says it “only governs the DNS cache resolver thread”, but in this branch the DNS resolver thread still hardcodes hints.ai_family = AF_UNSPEC (see lib/MySQL_Monitor.cpp:4676) and there are no other references to mysql-resolution_family in the repo. Either stack this PR on top of the change that introduces that setting, or reword this note to avoid documenting a config option that doesn’t exist here. Also consider naming the actual async API used here (mysql_real_connect_start) to match the code path.

Copilot uses AI. Check for mistakes.
host_ip = parent->address;
}
return host_ip;
Expand Down
Loading