Bug #116454 | For mysql8.0.32 DEBUG version,it crash when do sql about ANALYZE TABLE USING DAT | ||
---|---|---|---|
Submitted: | 23 Oct 2024 2:29 | Modified: | 23 Oct 2024 5:40 |
Reporter: | wu sunny | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S6 (Debug Builds) |
Version: | 8.0.32 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | ANALYZE TABLE USING DATA, crash, debug |
[23 Oct 2024 2:29]
wu sunny
[23 Oct 2024 3:21]
wu sunny
It can also be resolved by next patch: diff --git a/sql/histograms/histogram.cc b/sql/histograms/histogram.cc index 4da9f514e96..691dad17284 100644 --- a/sql/histograms/histogram.cc +++ b/sql/histograms/histogram.cc @@ -221,6 +221,7 @@ Error_context::Error_context(THD *thd, Field *field, TABLE *table, m_field = make_field(create_field, table->s, m_buffer + 1, m_buffer, 0 /* null bit*/); m_field->table = table; + bitmap_set_bit(table->write_set, m_field->field_index()); } void Error_context::report_global(Message err_code) {
[23 Oct 2024 5:40]
MySQL Verification Team
Hello wu sunny, Thank you for the report and test case. I can confirm that 8.0.32-8.0.35 debug builds are affected but this issue is no longer seen since 8.0.36+. Looking at the change log, this is most likely fixed after Bug #35710383. Please see https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-36.html UPDATE HISTOGRAM did not behave as expected in all cases. UPDATE HISTOGRAM did not behave as expected in all cases. (Bug #35710404) -- 8.0.32(lowest checked)-8.0.35 bin/mysql -uroot -S/tmp/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.0.35-debug MySQL Community Server - GPL - Debug Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database test; Query OK, 1 row affected (0.01 sec) mysql> use test Database changed mysql> CREATE TABLE t2 (cc1 INT PRIMARY KEY, cc2 INT); Query OK, 0 rows affected (0.05 sec) mysql> INSERT INTO t2 VALUES (1,3),(2,1),(3,2),(4,3),(5,15); Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 mysql> ANALYZE TABLE t2 UPDATE HISTOGRAM ON cc2 USING DATA '{"buckets": [[1, 0.25], [2, 0.5], [3, 0.625], [15, 0.75]], "data-type": "int", "null-values": 0.25, "collation-id": 8, "sampling-rate": 1.0, "histogram-type": "singleton", "number-of-buckets-specified": 4}'; ERROR 2013 (HY000): Lost connection to MySQL server during query -- 8.0.36+ no issue seen bin/mysql -uroot -S/tmp/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.0.36-debug MySQL Community Server - GPL - Debug Copyright (c) 2000, 2024, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database test; Query OK, 1 row affected (0.01 sec) mysql> use test Database changed mysql> CREATE TABLE t2 (cc1 INT PRIMARY KEY, cc2 INT); Query OK, 0 rows affected (0.05 sec) mysql> INSERT INTO t2 VALUES (1,3),(2,1),(3,2),(4,3),(5,15); Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 mysql> ANALYZE TABLE t2 UPDATE HISTOGRAM ON cc2 USING DATA '{"buckets": [[1, 0.25], [2, 0.5], [3, 0.625], [15, 0.75]], "data-type": "int", "null-values": 0.25, "collation-id": 8, "sampling-rate": 1.0, "histogram-type": "singleton", "number-of-buckets-specified": 4}'; +---------+-----------+----------+------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +---------+-----------+----------+------------------------------------------------+ | test.t2 | histogram | status | Histogram statistics created for column 'cc2'. | +---------+-----------+----------+------------------------------------------------+ 1 row in set (0.00 sec) regards, Umesh