Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7530

!includedir reads files in random order

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.0(EOL)
    • 10.0.17
    • OTHER
    • None

    Description

      Currently !includedir directive in my.cnf seems to include files in some unspecified order. This makes it impossible to override settings in one specific include file by adding another file that is included later.

      The server should include files in alphabetical order, so that one could use config files with conventional two-digit prefixes.

      the fix is to add MY_WANT_SORT to my_dir() in my_default.c

      Attachments

        Activity

          holyfoot Alexey Botchkov added a comment - - edited

          I cannot reproduce this one. Mean that '*cfg' files in an !includedir-ed directory are sorted for me.

          And the sorting code is there in the my_dir() like:

            if (!(MyFlags & MY_DONT_SORT))
              my_qsort((void *) result->dir_entry, result->number_off_files,
                    sizeof(FILEINFO), (qsort_cmp) comp_names);

          holyfoot Alexey Botchkov added a comment - - edited I cannot reproduce this one. Mean that '*cfg' files in an !includedir-ed directory are sorted for me. And the sorting code is there in the my_dir() like: if (!(MyFlags & MY_DONT_SORT)) my_qsort((void *) result->dir_entry, result->number_off_files, sizeof(FILEINFO), (qsort_cmp) comp_names);

          Affect Version is "10.0", this task isn't for 5.5

          serg Sergei Golubchik added a comment - Affect Version is "10.0", this task isn't for 5.5
          wfong Will Fong added a comment -

          I'm sorry, I don't understand C, but here was my test:

          [root@7530 ~]# mysql -e "SHOW VARIABLES LIKE 'server_id'"
          +---------------+-------+
          | Variable_name | Value |
          +---------------+-------+
          | server_id     | 0     |
          +---------------+-------+
          [root@7530 ~]# echo -e "[server]\nserver_id=200\n" > /etc/my.cnf.d/z.cnf
          [root@7530 ~]# service mysql restart
          Shutting down MySQL... SUCCESS! 
          Starting MySQL. SUCCESS! 
          [root@7530 ~]# mysql -e "SHOW VARIABLES LIKE 'server_id'"
          +---------------+-------+
          | Variable_name | Value |
          +---------------+-------+
          | server_id     | 200   |
          +---------------+-------+
          [root@7530 ~]# echo -e "[server]\nserver_id=100\n" > /etc/my.cnf.d/a.cnf
          [root@7530 ~]# service mysql restart
          Shutting down MySQL... SUCCESS! 
          Starting MySQL. SUCCESS! 
          [root@7530 ~]# mysql -e "SHOW VARIABLES LIKE 'server_id'"
          +---------------+-------+
          | Variable_name | Value |
          +---------------+-------+
          | server_id     | 100   |
          +---------------+-------+
          [root@7530 ~]# echo -e "[server]\nserver_id=500\n" > /etc/my.cnf.d/Z.cnf
          [root@7530 ~]# service mysql restart
          Shutting down MySQL... SUCCESS! 
          Starting MySQL. SUCCESS! 
          [root@7530 ~]# mysql -e "SHOW VARIABLES LIKE 'server_id'"
          +---------------+-------+
          | Variable_name | Value |
          +---------------+-------+
          | server_id     | 500   |
          +---------------+-------+
          [root@7530 ~]# mysql -e "SELECT VERSION()"
          +-----------------+
          | VERSION()       |
          +-----------------+
          | 10.0.16-MariaDB |
          +-----------------+
          [root@7530 ~]# 

          wfong Will Fong added a comment - I'm sorry, I don't understand C, but here was my test: [root@7530 ~]# mysql -e "SHOW VARIABLES LIKE 'server_id'" +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 0 | +---------------+-------+ [root@7530 ~]# echo -e "[server]\nserver_id=200\n" > /etc/my.cnf.d/z.cnf [root@7530 ~]# service mysql restart Shutting down MySQL... SUCCESS! Starting MySQL. SUCCESS! [root@7530 ~]# mysql -e "SHOW VARIABLES LIKE 'server_id'" +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 200 | +---------------+-------+ [root@7530 ~]# echo -e "[server]\nserver_id=100\n" > /etc/my.cnf.d/a.cnf [root@7530 ~]# service mysql restart Shutting down MySQL... SUCCESS! Starting MySQL. SUCCESS! [root@7530 ~]# mysql -e "SHOW VARIABLES LIKE 'server_id'" +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 100 | +---------------+-------+ [root@7530 ~]# echo -e "[server]\nserver_id=500\n" > /etc/my.cnf.d/Z.cnf [root@7530 ~]# service mysql restart Shutting down MySQL... SUCCESS! Starting MySQL. SUCCESS! [root@7530 ~]# mysql -e "SHOW VARIABLES LIKE 'server_id'" +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 500 | +---------------+-------+ [root@7530 ~]# mysql -e "SELECT VERSION()" +-----------------+ | VERSION() | +-----------------+ | 10.0.16-MariaDB | +-----------------+ [root@7530 ~]#

          People

            serg Sergei Golubchik
            serg Sergei Golubchik
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.