[MDEV-17784] Analyze table returns warnings due to rounding error or overflow while collection of EITS Created: 2018-11-20  Updated: 2023-04-27

Status: Stalled
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.0, 10.1, 10.2, 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Minor
Reporter: Varun Gupta (Inactive) Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-15253 Default optimizer setting changes for... Closed

 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



 Comments   
Comment by Varun Gupta (Inactive) [ 2018-12-09 ]

As discussed with psergey, reducing the priority of this issue

Generated at Thu Feb 08 08:39:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.