summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2021-05-19 14:56:09 +1000
committerDaniel Black <daniel@mariadb.org>2021-11-26 16:29:37 +1100
commit76f3e6101e2952c9b91411791007ba6e66dac2fa (patch)
treecf9765cd3c2764cb1564ea9ee4169f69eb714aa0
parentca2695392411adc7f1d19f85d464213128e4f285 (diff)
downloadmariadb-git-bb-10.5-danielblack-MDEV-24788-mysqld--help-cannot-lock-aria-control.tar.gz
MDEV-24788: mariadbd --help Can't lock aria control filebb-10.5-danielblack-MDEV-24788-mysqld--help-cannot-lock-aria-control
... '/var/lib/mysql/aria_log_control' for exclusive use, error: 11 As such don't lock under aria_readonly (which is set by opt_help in the handler initialization. Fixes: 8eba777c2bbad7721c818936a3a0ced3b2fcd59c
-rw-r--r--mysql-test/main/mysqld--help-aria.result4
-rw-r--r--mysql-test/main/mysqld--help-aria.test7
-rw-r--r--storage/maria/ma_control_file.c4
3 files changed, 3 insertions, 12 deletions
diff --git a/mysql-test/main/mysqld--help-aria.result b/mysql-test/main/mysqld--help-aria.result
index 70e7d8930c4..fb44c3ea3ee 100644
--- a/mysql-test/main/mysqld--help-aria.result
+++ b/mysql-test/main/mysqld--help-aria.result
@@ -1,7 +1,3 @@
-[ERROR] mariadbd: Can't lock aria aria_log_control for exclusive use, error: #. Will retry for 0 seconds
-[ERROR] Plugin 'Aria' init function returned error.
-[ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
-[Warning] Could not open mysql.plugin table: "Unknown storage engine 'Aria'". Some options may be missing from the help text
#
# Check that we don't write any data to wrong or not existing datadir
#
diff --git a/mysql-test/main/mysqld--help-aria.test b/mysql-test/main/mysqld--help-aria.test
index 253a46492f0..55131e9e4eb 100644
--- a/mysql-test/main/mysqld--help-aria.test
+++ b/mysql-test/main/mysqld--help-aria.test
@@ -2,15 +2,10 @@
# Check errors from mysqld--help when providing different datadir
#
-# We can't run this test on windows as windows doesn't provide file locking
-# which the first exec requires.
-
---source include/not_windows.inc
-
--let $args=--table-cache=5 --max-connections=10 --log-warnings=1 --silent-startup --lower-case-table-names=1 --help --verbose
--exec $MYSQLD_CMD $args > $MYSQL_TMP_DIR/mysqld--help2.txt 2> $MYSQL_TMP_DIR/mysqld--help2.err
---replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // /control file '.*aria_log_control'/aria_log_control/ /error: \d+/error: #/
+--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* //
--cat_file $MYSQL_TMP_DIR/mysqld--help2.err
--echo #
diff --git a/storage/maria/ma_control_file.c b/storage/maria/ma_control_file.c
index 65b8b0922aa..af1708c72b2 100644
--- a/storage/maria/ma_control_file.c
+++ b/storage/maria/ma_control_file.c
@@ -314,7 +314,7 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing,
errmsg= "Can't create file";
goto err;
}
- if (lock_control_file(name, wait_for_lock))
+ if (!aria_readonly && lock_control_file(name, wait_for_lock))
{
error= CONTROL_FILE_LOCKED;
errmsg= lock_failed_errmsg;
@@ -332,7 +332,7 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing,
}
/* lock it before reading content */
- if (lock_control_file(name, wait_for_lock))
+ if (!aria_readonly && lock_control_file(name, wait_for_lock))
{
error= CONTROL_FILE_LOCKED;
errmsg= lock_failed_errmsg;