1# galera_connect.inc
2# ==================
3#
4# Description
5# -----------
6# Open a connection to the specified server number ($galera_server_number).
7# The connection itself would be identified by $galera_connection_name.
8#
9# Parameters
10# ----------
11# $galera_connection_name
12#   Name of the resulting connection.
13#
14# $galera_server_number
15#   Sequence number of the node in the galera cluster.
16#
17# $galera_debug
18#   Print debug information.
19#
20
21if (!$galera_connection_name)
22{
23  --die ERROR IN TEST: $galera_connection_name must be set before sourcing include/galera_connect.inc
24}
25
26if (!$galera_server_number)
27{
28  --die ERROR IN TEST: $galera_server_number must be set before sourcing include/galera_connect.inc
29}
30
31--let $_galera_port= \$NODE_MYPORT_$galera_server_number
32if (!$_galera_port)
33{
34  --echo Bug in test case: '\$NODE_MYPORT_$galera_server_number' not initialized. Check the test's .cfg file.
35  --die Not all NODE_MYPORT_* environment variables are setup correctly.
36}
37
38if ($galera_debug)
39{
40--disable_query_log
41  --echo connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
42--enable_query_log
43}
44
45# Temporal solution to avoid concurrent IST MDEV-7178
46--sleep 1
47
48# Open a connection
49--disable_query_log
50--connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
51--enable_query_log
52