Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing data into files does not update SQL database records #3

Open
cweiske opened this issue Jan 13, 2015 · 3 comments
Open

Writing data into files does not update SQL database records #3

cweiske opened this issue Jan 13, 2015 · 3 comments

Comments

@cweiske
Copy link

cweiske commented Jan 13, 2015

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 |
+-----+--------+
@cweiske
Copy link
Author

cweiske commented Jan 13, 2015

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:

2015-01-13 mysqlfuse update

@cweiske
Copy link
Author

cweiske commented Jan 13, 2015

The first SQL query after the login is set autocommit=0, but that is not in the mysqlfuse codebase:
2015-01-13 mysqlfuse autocommit

@cweiske
Copy link
Author

cweiske commented Jan 13, 2015

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.

cweiske added a commit to cweiske/mysqlfuse that referenced this issue Jan 13, 2015
cweiske added a commit to cweiske/mysqlfuse that referenced this issue Jan 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant