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

!includedir reads files in random order

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.0
    • Fix Version/s: 10.0.17
    • Component/s: OTHER
    • Labels:
      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

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            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);
            
            Show
            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);
            Hide
            serg Sergei Golubchik added a comment -

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

            Show
            serg Sergei Golubchik added a comment - Affect Version is "10.0", this task isn't for 5.5
            Hide
            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 ~]# 
            
            Show
            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

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 minute
                  1m