SHOW EXPLAIN: Server crashes in JOIN::print_explain on a query with inner join and ORDER BY the same column twice

Description

Query:
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2

bzr version-info (5.5-show-explain-test1)

Reproducible with the default optimizer_switch (below) as well as with all OFF values.
Default optimizer_switch:

EXPLAIN with the default optimizer_switch:

Test case:

Environment

None

Assignee

Sergei Petrunia

Reporter

Elena Stepanova

Labels

None

Fix versions

Priority

Major
Configure