fix --column-statistics handling in mysql tests (#1680)
This commit is contained in:
parent
e1954adc32
commit
e13867f7c9
|
@ -51,19 +51,14 @@ setup() {
|
||||||
|
|
||||||
dump() {
|
dump() {
|
||||||
backup_file="${1?Missing file to backup database to}"
|
backup_file="${1?Missing file to backup database to}"
|
||||||
COLUMN_STATISTICS=
|
|
||||||
if mysqldump --column-statistics 2>&1 | grep -q -v 'unknown option'; then
|
|
||||||
COLUMN_STATISTICS='--column-statistics=0'
|
|
||||||
fi
|
|
||||||
|
|
||||||
silence_password_warning \
|
args=(mysqldump)
|
||||||
mysqldump \
|
if mysqldump --column-statistics 2>&1 | grep -q -v 'unknown option'; then
|
||||||
"${COLUMN_STATISTICS}" \
|
args+=("--column-statistics=0")
|
||||||
"--host=${MYSQL_HOST}" \
|
fi
|
||||||
"--port=${MYSQL_PORT}" \
|
args+=("--host=${MYSQL_HOST}" "--port=${MYSQL_PORT}" "--user=${MYSQL_USER}" "--password=${MYSQL_PASSWORD}" --databases crowdsec_test)
|
||||||
"--user=${MYSQL_USER}" \
|
|
||||||
"--password=${MYSQL_PASSWORD}" \
|
silence_password_warning "${args[@]}" > "${backup_file}"
|
||||||
--databases crowdsec_test > "${backup_file}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
restore() {
|
restore() {
|
||||||
|
|
Loading…
Reference in a new issue