PT-1536 Updated samples for mysql-summary tests

This commit is contained in:
Carlos Salguero
2018-05-11 11:58:47 -03:00
parent 94e122adc0
commit b6526f6739
9 changed files with 75 additions and 4 deletions

View File

@@ -115,6 +115,12 @@ collect_encrypted_tables() {
$CMD_MYSQL $EXT_ARGV --table -ss -e "SELECT TABLE_SCHEMA, TABLE_NAME, CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE CREATE_OPTIONS LIKE '%ENCRYPTION=\"Y\"%';"
}
collect_encrypted_tablespaces() {
# I_S.INNODB_SYS_TABLESPACES has a "flag" field. Encrypted tablespace has bit 14 set. You can check it with "flag & 8192".
# And seems like MySQL is capable of bitwise operations. https://dev.mysql.com/doc/refman/5.7/en/bit-functions.html
$CMD_MYSQL $EXT_ARGV --table -ss -e "SELECT SPACE, NAME, SPACE_TYPE from INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES where FLAG&8192 = 8192;"
}
# ##############################################################################
# Functions for parsing specific files and getting desired info from them.
@@ -597,6 +603,14 @@ format_encrypted_tables() {
fi
}
format_encrypted_tablespaces() {
local encrypted_tablespaces="$1"
if [ ! -z "$encrypted_tablespaces" ]; then
echo "Encrypted tablespaces:"
echo "$encrypted_tablespaces"
fi
}
format_mysql_roles() {
local file=$1
[ -e "$file" ] || return
@@ -1568,12 +1582,15 @@ report_mysql_summary () {
section "Encryption"
local keyring_plugins="$(collect_keyring_plugins)"
local encrypted_tables=""
local encrypted_tablespaces=""
if [ ${OPT_LIST_ENCRYPTED_TABLES} == 'yes' ]; then
encrypted_tables="$(collect_encrypted_tables)"
encrypted_tablespaces="$(collect_encrypted_tablespaces)"
fi
format_keyring_plugins "$keyring_plugins" "$encrypted_tables"
format_encrypted_tables "$encrypted_tables"
format_encrypted_tablespaces "$encrypted_tablespaces"
# ########################################################################
# Binary Logging