summaryrefslogtreecommitdiff
path: root/mysql-test/main/connect-abstract.test
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-20162: fix connect-abstract test caseDaniel Black2021-06-111-1/+4
| | | | | | | | | | | | | | The check-testcase record uses a mysqltest connection to the database to do the recording. With the server configured as an abstract socket, the mysqltest client cannot connect and fails. We work around this by starting the server as normal and then restart with an abstract socket and test this. This didn't affect Windows as it just did a tcp connection. So this did affect all unix socket based systems except Linux as this was the only one that supported abstract sockets.
* MDEV-15655: Add Linux abstract socket supportDaniel Black2018-05-101-0/+6
The functionality of the socket system variable is extended here such that a preciding '@' indicates that the socket will be an abstract socket. Thie socket name wil be the remainder of the name after the '@'. This is consistent with the approached used by systemd in socket activation. Thanks to Sergey Vojtovich: On OS X sockaddr_un is defined as: struct sockaddr_un { u_char sun_len; u_char sun_family; char sun_path[104]; }; There is a comment in man 7 unix (on linux): " On Linux, the above offsetof() expression equates to the same value as sizeof(sa_family_t), but some other implementations include other fields before sun_path, so the offsetof() expression more portably describes the size of the address structure. " As such, use the offsetof for Linux and use the previous sizeof(UNIXaddr) for non-unix platforms as that's what worked before and they don't support abstract sockets so there's no compatibility problem.. strace -fe trace=networking mysqld --skip-networking --socket @abc ... ... [pid 10578] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 22 [pid 10578] setsockopt(22, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 [pid 10578] bind(22, {sa_family=AF_UNIX, sun_path=@"abc"}, 6) = 0 [pid 10578] listen(22, 80) = 0 ... Version: '10.3.6-MariaDB-log' socket: '@abc' port: 0 Source distribution $ lsof -p 10578 mysqld 10578 dan 22u unix 0x00000000087e688c 0t0 4787815 @abc type=STREAM