Skip to content

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

Open

Description

@cweiske

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 |
+-----+--------+

Activity

  1. cweiske commented on Jan 13, 2015

    @cweiske
    Author

    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

  2. cweiske commented on Jan 13, 2015

    @cweiske
    Author

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

  3. cweiske commented on Jan 13, 2015

    @cweiske
    Author

    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.

  4. added 2 commits that reference this issue on Jan 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions