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

Analyze table returns warnings due to rounding error or overflow while collection of EITS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Stalled (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0, 10.1, 10.2, 10.3, 10.4
    • Fix Version/s: 10.0, 10.1, 10.2, 10.3, 10.4
    • Component/s: Optimizer
    • Labels:
      None

      Description

      --source include/have_innodb.inc
       
      set @@optimizer_use_condition_selectivity=4;
      set @@use_stat_tables=PREFERABLY;
       
      create table t1 (a int)engine=InnoDB;
      insert into t1 values (1),(1),(2),(3);
       
      MariaDB [test]> analyze table t1;
      +---------+---------+----------+-----------------------------------------+
      | Table   | Op      | Msg_type | Msg_text                                |
      +---------+---------+----------+-----------------------------------------+
      | test.t1 | analyze | status   | Engine-independent statistics collected |
      | test.t1 | analyze | status   | OK                                      |
      +---------+---------+----------+-----------------------------------------+
       
      alter table t1 change a b int;
       
      MariaDB [test]> analyze table t1;
      +---------+---------+----------+----------------------------------------------------+
      | Table   | Op      | Msg_type | Msg_text                                           |
      +---------+---------+----------+----------------------------------------------------+
      | test.t1 | analyze | status   | Engine-independent statistics collected            |
      | test.t1 | analyze | Note     | Data truncated for column 'avg_frequency' at row 1 |
      | test.t1 | analyze | status   | OK                                                 |
      +---------+---------+----------+----------------------------------------------------+
       
      select * from mysql.column_stats;
      drop table t1;
      

      So here we see a truncation that happens due
      rounding off (we should suppress this because the user doesn't expects this)
      But we should be throwing a warning if we have an overflow.

      The current situations is like for ANALYZE command we don't make a choice if we want to throw a warning on truncation or not. The above case happens due to the bug MDEV-17778. So this MDEV is about making the choice as to if we want to throw warning or errors for truncation or overflow while calculating the statistics

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              varun Varun Gupta
              Reporter:
              varun Varun Gupta
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: