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

DML on table_type=INI gives no error even MySQLd has not the privilege to change the file

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.3
    • 10.0.5
    • None
    • Ubuntu/Precise/LXContainer

    Description

      Weve got two tables accessing a my.cnf file.
      The table mycnf accesses /etc/mysql/my.cnf this file belongs to root, so MySQLd is not able to change anything. The second mycnf2 is a file in the test schema belonging to mysql:mysql.

       CREATE TABLE `mycnf` (
        `section` char(20) DEFAULT NULL `flag`=1,
        `keyname` char(20) DEFAULT NULL `flag`=2,
        `value` char(200) DEFAULT NULL
      ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=ini `file_name`='/etc/mysql/my.cnf' `option_list`='layout=Row' ;
       
      CREATE TABLE `mycnf2` (
        `section` char(20) DEFAULT NULL `flag`=1,
        `keyname` char(20) DEFAULT NULL `flag`=2,
        `value` char(200) DEFAULT NULL
      ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=ini `file_name`='my.cnf' `option_list`='layout=Row';

      Lets work with mycnf2:

      MariaDB [test]> select * from mycnf2  where section='mysql';
      +---------+----------------------+-------+
      | section | keyname              | value |
      +---------+----------------------+-------+
      | mysql   | #no-auto-rehash     # fa |       |
      +---------+----------------------+-------+
      MariaDB [test]> insert into mycnf2 values('mysql','user','erkan');
      Query OK, 1 row affected (0.00 sec)
      MariaDB [test]> select * from mycnf2  where section='mysql';
      +---------+----------------------+-------+
      | section | keyname              | value |
      +---------+----------------------+-------+
      | mysql   | #no-auto-rehash     # fa |       |
      | mysql   | user                 | erkan |

      Ok everything worked. Now lets work with mycnf (/etc/mysql/my.cnf)

      MariaDB [test]> select * from mycnf  where section='mysql';
      +---------+----------------------+-------+
      | section | keyname              | value |
      +---------+----------------------+-------+
      | mysql   | #no-auto-rehash     # fa |       |
      +---------+----------------------+-------+
      MariaDB [test]> insert into mycnf values('mysql','user','erkan');
      Query OK, 1 row affected (0.00 sec)

      The same output as for mycnf2

      MariaDB [test]> select * from mycnf  where section='mysql';
      +---------+----------------------+-------+
      | section | keyname              | value |
      +---------+----------------------+-------+
      | mysql   | #no-auto-rehash     # fa |       |
      +---------+----------------------+-------+
      1 row in set (0.00 sec)

      I would expect an error if MySQL/ConnectSE is not able to perform the task because of insufficient permissions on filesystemlevel.

      Regards
      Erkan

      Attachments

        Activity

          erkules erkan yanar created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Fix Version/s 10.0.5 [ 13201 ]
          Assignee Olivier Bertrand [ bertrandop ]

          Fixed as revno 3785.
          Also fixing 2 other bugs: one causing the entire section to be deleted when deleting one key of a section with layout=row.
          (this is normal when layout=column because each section is one table row)
          The other one was no error message being returned when an insert was done without specifying the section name.

          bertrandop Olivier Bertrand added a comment - Fixed as revno 3785. Also fixing 2 other bugs: one causing the entire section to be deleted when deleting one key of a section with layout=row. (this is normal when layout=column because each section is one table row) The other one was no error message being returned when an insert was done without specifying the section name.
          bertrandop Olivier Bertrand made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow defaullt [ 28340 ] MariaDB v2 [ 44043 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 44043 ] MariaDB v3 [ 64226 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 64226 ] MariaDB v4 [ 146910 ]

          People

            bertrandop Olivier Bertrand
            erkules erkan yanar
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.