| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Read the contents of the persisted variables into an mtr variable. |
| 4 |
# The file contains a JSON document. This script loads the file that |
| 5 |
# belongs to the server of the current connection. |
| 6 |
# |
| 7 |
# ==== Usage ==== |
| 8 |
# |
| 9 |
# [--let $escape_persisted_json = 1] |
| 10 |
# --source include/load_persisted_json.inc |
| 11 |
# # Now, the mtr variable $persisted_json contains the contents of the file. |
| 12 |
# |
| 13 |
# Parameters: |
| 14 |
# |
| 15 |
# $escape_persisted_json |
| 16 |
# If set, escape single quotes and backslashes in $persisted_json |
| 17 |
# so that it can be used in string context in subsequent queries. |
| 18 |
|
| 19 |
--let $persisted_json = `SELECT LOAD_FILE(CONCAT(@@global.datadir, 'mysqld-auto.cnf'))` |
| 20 |
if ($escape_persisted_json) { |
| 21 |
--let $persisted_json = escape(\',$persisted_json) |
| 22 |
} |