summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera/include/galera_base_port.inc
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/galera/include/galera_base_port.inc')
-rw-r--r--mysql-test/suite/galera/include/galera_base_port.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/include/galera_base_port.inc b/mysql-test/suite/galera/include/galera_base_port.inc
new file mode 100644
index 00000000000..caf986ee950
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_base_port.inc
@@ -0,0 +1,8 @@
+#
+# Extract base_port from galera node.
+#
+
+# Convert "... base_port = N; ..." to "N; ..."
+--let $s1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('base_port =', @@wsrep_provider_options) + LENGTH('base_port = '))`
+# Convert "N; ..." to "N"
+--let $_NODE_GALERAPORT = `SELECT SUBSTR('$s1', 1, LOCATE(';', '$s1') - 1)`