[MDEV-4853] DML on table_type=INI gives no error even MySQLd has not the privilege to change the file Created: 2013-08-08  Updated: 2013-08-14  Resolved: 2013-08-14

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.3
Fix Version/s: 10.0.5

Type: Bug Priority: Major
Reporter: erkan yanar Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: connect-engine
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



 Comments   
Comment by Olivier Bertrand [ 2013-08-14 ]

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.

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