Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1, 12.3.2
-
Can result in hang or crash
Description
How to repeat
Execute the complete block below on an isolated MariaDB 12.3.2 instance with the optimizer settings listed above. It drops and recreates only `dayofyear_repro`. This is the exact independently replayed final SQL; no attachment or repository checkout is required.
DROP DATABASE IF EXISTS dayofyear_repro;
|
|
|
CREATE DATABASE dayofyear_repro;
|
|
|
USE dayofyear_repro;
|
|
|
CREATE TABLE t1 (c1 INT);
|
|
|
SELECT 1 |
FROM (SELECT '2000-1-1' AS d FROM t1) AS s JOIN t1 AS t ON TRUE |
GROUP BY t.c1, s.d
|
HAVING DAYOFYEAR(s.d) = t.c1;
|
Expected result
Return an empty result set and keep the server running. `t1` has no rows, so neither the derived table nor the inner join can produce a group.
Actual result
The exact SQL above reproduced SIGSEGV in *3/3 consecutive trials* (`trial-009` through `trial-011`). Each trial recorded a new signal-11 fatal block, server exit code *139*, `OOMKilled=false`, and the shared temporal-function and optimizer frames. The client received:
OperationalError: (2013, 'Lost connection to MySQL server during query') |
Relevant frames from the final reduced query, ordered from the fault toward the caller:
Temporal_with_date::make_from_item + 0x70 |
Item_func_dayofyear::val_int + 0x46 |
Type_handler_int_result::Item_eq_value + 0x23 |
Item_equal::add_const + 0x4e |
Item_equal::merge_with_check + 0xe1 |
propagate_new_equalities + 0xd8 |
and_new_conditions_to_optimized_cond + 0x71f |
JOIN::optimize_inner + 0x195f |
JOIN::optimize + 0xf3 |
mysql_select
|
Attachments
Issue Links
- relates to
-
MDEV-17846 Name Resolution: Wrong result with grouping select from merged derived table
-
- Closed
-
-
MDEV-23983 Crash caused by query containing constant having clause
-
- Closed
-
-
MDEV-33648 range optimizer works incorrectly for date_col=(expr yielding invalid date)
-
- Stalled
-