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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.3
    • Fix Version/s: 10.0.5
    • Component/s: None
    • Labels:
    • Environment:
      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

            People

            Assignee:
            bertrandop Olivier Bertrand
            Reporter:
            erkules erkan yanar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration