1

I'm getting a number of these errors printed in the systemd journal when i restart mariadb:

Nov 07 17:56:05 p2 /etc/mysql/debian-start[8427]: --------------
Nov 07 17:56:05 p2 /etc/mysql/debian-start[8427]: select count(*) into @discard from _cdfd7a1251c20c3e.tabError Log
Nov 07 17:56:05 p2 /etc/mysql/debian-start[8427]: --------------
Nov 07 17:56:05 p2 /etc/mysql/debian-start[8427]: 
Nov 07 17:56:05 p2 /etc/mysql/debian-start[8427]: ERROR 1146 (42S02) at line 1: Table '_cdfd7a1251c20c3e.tabError' doesn't exist

It appears to be cause by the check_for_crashed_tables shell call in debian-start I have found that function in /usr/share/mariadb/debian-start.inc.sh:

  echo '
    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"
    AND (ENGINE="MyISAM" OR ENGINE="Aria")
    ' | \
    LC_ALL=C $MARIADB --skip-column-names --batch | \
    xargs --no-run-if-empty -i $MARIADB --skip-column-names --silent --batch --force -e "{}" &> "${tempfile}"

It looks to me like the table.table_name is not properly surrounded by quotes, so when a table name with spaces occurs, the command is failing.

However looking at the shell script they have gone to quite a bit of trouble to add the correct quotes in the SELECT CONCAT( statement.

Can anyone provide some insight? I have reported to the debian bug tracker (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1120329).

2
  • Anyway, if this isn't a script you're responsible for, this isn't a programming question. Commented Nov 7 at 19:51
  • Ah, it's xargs that's removing the quotes. Another good reason to use backticks. Commented Nov 7 at 19:55

2 Answers 2

1

The problem is that xargs removes single and double quotes from the input by default. It does this even when using -i, which makes newline the input delimiter.

This can be disabled by specifying a delimiter explicitly. So pipe to

xargs --no-run-if-empty -d '\n' -i $MARIADB --skip-column-names --silent --batch --force -e "{}" &> "${tempfile}"
Sign up to request clarification or add additional context in comments.

Comments

1

I wondered about using backticks instead, which worked. Change the SELECT statement to:

SELECT CONCAT("select count(*) into @discard from `", TABLE_SCHEMA, "`.`", TABLE_NAME, "`")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.