(Translated by https://www.hiragana.jp/)
MDEV-34902: Fix Debian reporting error on Aria/MyISAM even tables are… by illuusio · Pull Request #3564 · MariaDB/server · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-34902: Fix Debian reporting error on Aria/MyISAM even tables are… #3564

Open
wants to merge 1 commit into
base: 10.11
Choose a base branch
from

Conversation

illuusio
Copy link
Contributor

@illuusio illuusio commented Oct 2, 2024

  • The Jira issue number for this PR is: MDEV-34902

Description

Commit changes ''' to single back-tick char in Debian start-up script function 'check_for_crashed_tables' which is used to check are Aria/MyISAM tables crashed and do they need manual repairing.

Without this initial script can report for crashed tables even if they are all good.

Release Notes

Should not add anything

How can this PR be tested?

This is bit tricky to test (automatic test is on it's was but still in works). This bit WIP currently
If you have podman with systemd:

podman run -it --systemd=true registry.salsa.debian.org/salsa-ci-team/pipeline/autopkgtest systemd

and then

podman exec -it correctsha bash

one can install system MariaDB with these: https://mariadb.org/download/?t=repo-config&d=Debian+%22Sid%22&v=10.11&r_m=xtom_tal
After that should install nano

apt install nano

and then run add this script:

#!/bin/bash

function check_journalctl
{
  JOURNALCTL_ERROR=$(journalctl | grep "\[ERROR\] mariadbd: Table './mydatabase/mytable name' is marked as crashed and should be repaired")

  if [ -z "${JOURNALCTL_ERROR}" ]
  then
     echo "There should be error that MyISAM crashed and it's repaired"
     exit 1
  fi

  JOURNALCTL_ERROR=$(journalctl | grep "\[Warning\] Checking table:   './mydatabase/mytable name'")

  if [ -z "${JOURNALCTL_ERROR}" ]
  then
      echo "There should be warning for MyISAM check"
      exit 1
  fi
}

set -ex

systemctl restart mariadb

echo '
  DROP DATABASE IF EXISTS mydatabase;
  CREATE DATABASE IF NOT EXISTS mydatabase;
  USE mydatabase;
  CREATE TABLE `mytable-dev` (id INT(11), name VARCHAR(100)) ENGINE=Aria;
  INSERT INTO `mytable-dev` (id, name) VALUES (1, "John Doe");
  CREATE TABLE `mytable name` (id INT(11), name VARCHAR(100)) ENGINE=Aria;
  INSERT INTO `mytable name` (id, name) VALUES (1, "John Doe");
  CREATE TABLE `mytable-dev` (id INT(11), name VARCHAR(100)) ENGINE=MyISAM;
  INSERT INTO `mytable-dev` (id, name) VALUES (1, "John Doe");
  CREATE TABLE `mytable name` (id INT(11), name VARCHAR(100)) ENGINE=MyISAM;
  INSERT INTO `mytable name` (id, name) VALUES (1, "John Doe");
' | mariadb

killall -9 mariadbd

sleep 3s

check_journalctl

#
# Remove journal
journalctl --flush --rotate --vacuum-time=1s

sleep 3s

systemctl restart mariadb

check_journalctl

exit 0

It should fail even without killall -9 mariadb every time. After that tester should download deb packages from https://salsa.debian.org/illuusio/mariadb-server/-/pipelines/740935 and install them with

apt install debian/output/*.deb

and run script again and it should not complain all the times in journalctl. I'll update this testing..

Basing the PR against the correct MariaDB version

  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

@illuusio illuusio force-pushed the 10.11-MDEV-34902-table-names-not-being-escaped branch from f818154 to 1211387 Compare October 7, 2024 06:31
… good

Commit changes '\'' to single back-tick char in  Debian start-up
script function 'check_for_crashed_tables' which is used to check are
Aria/MyISAM tables crashed and do they need manual repairing.

Without this initial script can report for crashed tables even
if they are all good.
@illuusio illuusio force-pushed the 10.11-MDEV-34902-table-names-not-being-escaped branch from 1211387 to c4f9df0 Compare October 7, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant