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

Upon reading sequence TABLE_STATISTICS counts the row both as inserted and updated

    XMLWordPrintable

Details

    Description

      When a new batch of values is read from a sequence, TABLE_STATISTICS counts the sequence row as changed twice. It wasn't so initially, but started happening after this commit in 10.5.2:

      commit 91ab42a823b244a3d4b051ab79701b7a552f274a
      Author: Monty
      Date:   Tue Jan 28 23:23:51 2020 +0200
       
          Clean up and speed up interfaces for binary row logging
      

      set @userstat.save= @@userstat;
      set global userstat= 1;
       
      create sequence s;
      flush table_statistics;
      select nextval(s);
      query_vertical show table_statistics;
       
      # Cleanup
      drop table s;
      set global userstat= @userstat.save;
      

      10.5 8bc32410160265dcd27d595ed610843d08d32034

      flush table_statistics;
      select nextval(s);
      nextval(s)
      1
      show table_statistics;
      Table_schema	test
      Table_name	s
      Rows_read	0
      Rows_changed	2
      Rows_changed_x_#indexes	2
      

      In MDEV-33151 where the changed rows are detalized as inserts/updates/deletes, it can be seen that the row is counted as inserted once and updated once.

      Attachments

        Activity

          People

            monty Michael Widenius
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.