diff options
author | Daniel Black <daniel@mariadb.org> | 2021-05-19 14:56:09 +1000 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2021-12-16 10:53:32 +1100 |
commit | 2776635cb98d35867447d375fdc04a44ef11a697 (patch) | |
tree | 23d76c965568951cb62f4de59a1dbf45df968e91 | |
parent | 03678bcf55bf8a813a1d81c021d2ae085750aee2 (diff) | |
download | mariadb-git-2776635cb98d35867447d375fdc04a44ef11a697.tar.gz |
MDEV-24788: mariadbd --help Can't lock aria control file
... '/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.result | 4 | ||||
-rw-r--r-- | mysql-test/main/mysqld--help-aria.test | 7 | ||||
-rw-r--r-- | storage/maria/ma_control_file.c | 4 |
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; |