Details
-
Bug
-
Status: Stalled (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
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
- is part of
-
MDEV-15253 Default optimizer setting changes for MariaDB 10.4
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
{code:sql} --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); analyze table t1; alter table t1 change a b int; analyze table t1; show create table t1; select * from mysql.column_stats; drop table t1; {code} |
{code:sql}
--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; {code} |
Description |
{code:sql}
--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; {code} |
{code:sql}
--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; {code} 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. |
Link |
This issue is part of |
Status | Open [ 1 ] | In Progress [ 3 ] |
Description |
{code:sql}
--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; {code} 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. |
{code:sql}
--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; {code} 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 [ |
Priority | Major [ 3 ] | Minor [ 4 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Fix Version/s | 10.0 [ 16000 ] |
Fix Version/s | 10.1 [ 16100 ] |
Assignee | Varun Gupta [ varun ] | Sergei Petrunia [ psergey ] |
Workflow | MariaDB v3 [ 90792 ] | MariaDB v4 [ 143565 ] |
Fix Version/s | 10.2 [ 14601 ] |
Fix Version/s | 10.3 [ 22126 ] |
As discussed with psergey, reducing the priority of this issue