mirror of
https://github.com/MariaDB/server.git
synced 2025-01-26 16:54:15 +01:00
MDEV-33750: Rework MyISAM recovery script
Make small adjustment to MyISAM recovery function SQL statement and how to handle it.
This commit is contained in:
parent
af124c4f1c
commit
7ae9505106
1 changed files with 4 additions and 5 deletions
9
debian/additions/debian-start.inc.sh
vendored
9
debian/additions/debian-start.inc.sh
vendored
|
@ -3,7 +3,7 @@
|
||||||
# This file is included by /etc/mysql/debian-start
|
# This file is included by /etc/mysql/debian-start
|
||||||
#
|
#
|
||||||
|
|
||||||
## Check MyISAM and Aria unclosed tables.
|
## Is there MyISAM or Aria unclosed tables.
|
||||||
# - Requires the server to be up.
|
# - Requires the server to be up.
|
||||||
# - Is supposed to run silently in background.
|
# - Is supposed to run silently in background.
|
||||||
function check_for_crashed_tables() {
|
function check_for_crashed_tables() {
|
||||||
|
@ -31,14 +31,13 @@ function check_for_crashed_tables() {
|
||||||
# Note that inside single quotes must be quoted with '\'' (to be outside of single quotes).
|
# Note that inside single quotes must be quoted with '\'' (to be outside of single quotes).
|
||||||
set +e
|
set +e
|
||||||
# The $MARIADB is intentionally used to expand into a command and arguments
|
# The $MARIADB is intentionally used to expand into a command and arguments
|
||||||
# shellcheck disable=SC2086
|
echo '
|
||||||
LC_ALL=C echo '
|
|
||||||
SELECT CONCAT("select count(*) into @discard from '\''", TABLE_SCHEMA, "'\''.'\''", TABLE_NAME, "'\''")
|
SELECT CONCAT("select count(*) into @discard from '\''", TABLE_SCHEMA, "'\''.'\''", TABLE_NAME, "'\''")
|
||||||
FROM information_schema.TABLES WHERE TABLE_SCHEMA<>"INFORMATION_SCHEMA" AND TABLE_SCHEMA<>"PERFORMANCE_SCHEMA"
|
FROM information_schema.TABLES WHERE TABLE_SCHEMA<>"INFORMATION_SCHEMA" AND TABLE_SCHEMA<>"PERFORMANCE_SCHEMA"
|
||||||
AND (ENGINE="MyISAM" OR ENGINE="Aria")
|
AND (ENGINE="MyISAM" OR ENGINE="Aria")
|
||||||
' | \
|
' | \
|
||||||
$MARIADB --skip-column-names --batch | \
|
LC_ALL=C "$MARIADB" --skip-column-names --batch | \
|
||||||
xargs -i $MARIADB --skip-column-names --silent --batch --force -e "{}" &> "${tempfile}"
|
xargs --no-run-if-empty -i "$MARIADB" --skip-column-names --silent --batch --force -e "{}" &> "${tempfile}"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -s "$tempfile" ]
|
if [ -s "$tempfile" ]
|
||||||
|
|
Loading…
Add table
Reference in a new issue