Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
13.0
-
Can result in unexpected behaviour
-
Q2/2026 Server Maintenance
Description
Run this testcase by mtr:
CREATE TABLE t1 (a INT, b INT, KEY(a)) engine=myisam;
|
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
|
analyze table t1;
|
set optimizer_record_context=1;
|
EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a = 1;
|
select context into dumpfile
|
"../../tmp/dump1.sql" from information_schema.optimizer_context;
|
drop table t1;
|
-- source "$MYSQLTEST_VARDIR/tmp/dump1.sql"
|
drop table t1;
|
The output will be:
EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a = 1;
|
EXPLAIN
|
{
|
"query_block": {
|
"select_id": 1,
|
"cost": 0.002024411,
|
"nested_loop": [
|
{
|
"table": {
|
"table_name": "t1",
|
"access_type": "ref",
|
"possible_keys": ["a"],
|
"key": "a",
|
"key_length": "5",
|
"used_key_parts": ["a"],
|
"ref": ["const"],
|
"loops": 1,
|
"rows": 1,
|
"cost": 0.002024411,
|
"filtered": 100
|
}
|
}
|
]
|
}
|
}
|
select context into dumpfile
|
"../../tmp/dump1.sql" from information_schema.optimizer_context;
|
...
EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a = 1;
|
EXPLAIN
|
{
|
"query_block": {
|
"select_id": 1,
|
"table": {
|
"message": "Impossible WHERE noticed after reading const tables"
|
}
|
}
|
}
|
EXPLAIN outputs do not match.
Attachments
Issue Links
- relates to
-
MDEV-39368 Add mtr option to test Optimizer Context Replay
-
- Open
-
-
MDEV-39435 FIXED: Server crash : Assertion `table_records || !head->file->stats.records' failed.
-
- In Progress
-