1# ==== Purpose ====
2#
3# Issues START GROUP_REPLICATION on the current connection.
4# Validates that server was able to bind Group Replication
5# local port, if it was not:
6#   on Windows systems: the test will skip itself;
7#   on other systems:   the test will fail.
8#
9#
10# ==== Usage ====
11#
12# --source include/start_group_replication_command.inc
13#
14
15--let $_is_windows= `SELECT convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 1`
16
17if ($_is_windows)
18{
19  --error 0, ER_GROUP_REPLICATION_CONFIGURATION
20}
21START GROUP_REPLICATION;
22
23if ($_is_windows)
24{
25  --let $_member_id= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
26  --let $_is_member_offline= `SELECT COUNT(*)=1 FROM performance_schema.replication_group_members group_members WHERE group_members.channel_name="group_replication_applier" AND group_members.member_id="$_member_id" AND group_members.member_state="OFFLINE"`
27
28  if ($_is_member_offline)
29  {
30    --source include/force_restart_if_skipped.inc
31    --skip Group Replication local port was busy, test cannot continue
32  }
33}
34