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

Userstat does not count rows updated via FK cascade

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.4, 11.5(EOL)
    • 10.5, 10.6, 10.11, 11.4
    • Plugin - userstat
    • None

    Description

      --source include/have_innodb.inc
       
      set @userstat.save= @@userstat;
      set global userstat= 1;
       
      create table t1 (a int key) engine=InnoDB;
      insert into t1 values (1),(2);
       
      create table t2 (b int, foreign key(b) references t1(a) on update cascade) engine=InnoDB;
      insert into t2 values (1),(2);
       
      select table_name, rows_changed from information_schema.table_statistics where table_name in ('t1','t2');
      update t1 set a = 20 where a = 2;
      select table_name, rows_changed from information_schema.table_statistics where table_name in ('t1','t2');
      select * from t2;
       
      # Cleanup
      drop table t2, t1;
      set global userstat= @userstat.save;
      

      10.4 ee59ca7ff1620dd74b9bc1449878c5d1acee0f53

      select table_name, rows_changed from information_schema.table_statistics where table_name in ('t1','t2');
      table_name	rows_changed
      t2	2
      t1	2
      update t1 set a = 20 where a = 2;
      select table_name, rows_changed from information_schema.table_statistics where table_name in ('t1','t2');
      table_name	rows_changed
      t2	2
      t1	3
      select * from t2;
      b
      1
      20
      

      Update on t2 is not taken into account.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.