Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11154

Write_on_release_cache(log_event.cc) function will not write "COMMIT", if use "mysqlbinlog ... | mysql ..."

    XMLWordPrintable

Details

    Description

      Executing command, "mysqlbinlog --read-from-remote-server --host='xx.xx.xx.xx' --port=3306 --user=xxx --password=xxx --database=mysql --to-last-log mysql-bin.000001 --start-position=1098699 --stop-never |mysql -uxxx -pxxx", we found that last data read from remote couldn't commit. Write_on_release_cache(log_event.cc) function may have some problems.

      In Write_on_release_cache(log_event.cc) function have following code:

      public:
        enum flag
        {
          FLUSH_F
        };
      ...
        Write_on_release_cache(IO_CACHE *cache, FILE *file, flag_set flags = 0)
          : m_cache(cache), m_file(file), m_flags(flags)
        {
          reinit_io_cache(m_cache, WRITE_CACHE, 0L, FALSE, TRUE);
        }
       
        ~Write_on_release_cache()
        {
          copy_event_cache_to_file_and_reinit(m_cache, m_file);
          if (m_flags & FLUSH_F)
            fflush(m_file);
        }
      ...
      

      The right code maybe:

      public:
        enum flag
        {
          FLUSH_F = 1
        };
      ...
      

      Attachments

        1. mysqlbinlog1.PNG
          mysqlbinlog1.PNG
          8 kB
        2. mysqlbinlog2.PNG
          mysqlbinlog2.PNG
          12 kB
        3. mysqlbinlog3.PNG
          mysqlbinlog3.PNG
          4 kB
        4. mysqlbinlog4.PNG
          mysqlbinlog4.PNG
          8 kB
        5. mysqlbinlog5.PNG
          mysqlbinlog5.PNG
          4 kB
        6. mysqlbinlog6.PNG
          mysqlbinlog6.PNG
          30 kB

        Activity

          People

            knielsen Kristian Nielsen
            vincen vincen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.