[MDEV-17639] ignore_db_dirs as a configurable option only works with single directories per declaration; to specify multiple directories, the variable must be declared once per ignored directory. Created: 2018-11-07  Updated: 2020-08-25  Resolved: 2018-11-08

Status: Closed
Project: MariaDB Server
Component/s: Configuration, Documentation
Affects Version/s: 10.3.10
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Juan Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS



 Description   

Currently the configuration directive

[server]
ignore-db-dirs=lost+found,tmp

is accepted in .cnf files and processed by the server, but results in the server not ignoring any of the listed directories when multiple comma-separated directories are specified.

[server]
ignore-db-dirs=lost+found
ignore-db-dirs=tmp

works correctly and produces

MariaDB [(none)]> show global variables like 'ignore_db_dirs';
+----------------+---------------+
| Variable_name  |     Value     |
+----------------+---------------+
| ignore_db_dirs | lost+found.tmp  |
+----------------+---------------+
1 row in set (0.001 sec)



 Comments   
Comment by Elena Stepanova [ 2018-11-07 ]

The first example in the description is irrelevant – it works, but it will ignore the directory named lost+found,tmp, as requested.

However, things definitely don't work as documented, so at the very least we have a documentation bug.

The KB says:

ignore_db_dirs
Description: Comma-delimited list of directories in the data directory that are not considered as database directories. Set from --ignore-db-dir at startup.
Scope: Global
Dynamic: No
Data Type: string
Introduced: MariaDB 5.5

and

--ignore-db-dir
Commandline: --ignore-db-dir=name
Description: Tells the server that this directory can never be a database. That means two things - firstly it is ignored by the SHOW DATABASES command and INFORMATION_SCHEMA tables. And secondly, USE, CREATE DATABASE and SELECT statements will return an error if the database from the ignored list specified. Use this option several times if you need to ignore more than one directory. To make the list empty set the void value to the option as --ignore-db-dir=. Corresponding read-only variable ignore_db_dirs shows the current list.
Introduced: MariaDB 5.3.9

So, ignore_db_dirs is supposed to be a read-only variable, while ignore-db-dir is supposed to be an option. In fact, ignore-db-dirs serves as both. It can be used on server startup as an option multiple times, and at runtime it shows the combined list of provided values.
On the other hand, ignore-db_dir apparently doesn't exist at all, it only works as a prefix for ignore-db-dirs, because getopt-prefix-matching is enabled by default.

Comment by Elena Stepanova [ 2018-11-07 ]

Assigning to serg to confirm that it works as designed and is a documentation issue only. I can't quite figure it out from MDEV-495.

Comment by Juan [ 2018-11-07 ]

Thanks for the correction about ignore_db_dir vs ignore_db_dirs, Elena. Edited the description to correct that misunderstanding.

Comment by Sergei Golubchik [ 2018-11-08 ]

Let's fix the manual to describe the current behavior.

Generated at Thu Feb 08 08:37:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.