mysqlfuse
mysqlfuse copied to clipboard
Writing data into files does not update SQL database records
Changing the contents of a file (column) does not change the actual record in the database:
$ mysql -utest -ptest test -e 'SELECT * FROM data'
+-----+--------+
| uid | title |
+-----+--------+
| 1 | title1 |
+-----+--------+
$ ls mountpoint/data/ test/
$ cat mountpoint/data/uid/1/title; echo
title1
$ echo title2 > mountpoint/data/uid/1/title
$ cat mountpoint/data/uid/1/title
title2
$ mysql -utest -ptest test -e 'SELECT * FROM data'
+-----+--------+
| uid | title |
+-----+--------+
| 1 | title1 |
+-----+--------+
I guess this has to to with the fact that mysqlfuse
seems to use transactions. The network protocol dump shows that we're in a transaction, and autocommit
is not enabled:
The first SQL query after the login is set autocommit=0
, but that is not in the mysqlfuse codebase:
This was a change in the MySQLdb package:
Starting with 1.2.0, MySQLdb disables autocommit by default, as required by the DB-API standard (PEP-249). If you are using InnoDB tables or some other type of transactional table type, you'll need to do connection.commit() before closing the connection, or else none of your changes will be written to the database.