Commit 3dc16466 authored by Alexey Kopytov's avatar Alexey Kopytov

Automerge.

parents 6f3770ca 735de9ea
......@@ -1145,3 +1145,14 @@ NULL
NULL
1
DROP TABLE t1, t2, mm1;
#
# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
#
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES (0,0), (1,1);
SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
a b a b
0 0 0 0
1 1 1 1
DROP TABLE t1;
End of 5.1 tests
......@@ -816,3 +816,16 @@ CREATE TABLE mm1(a CHAR(9),b INT,KEY(b),KEY(a))
ENGINE=MERGE UNION=(t1,t2);
SELECT t1.a FROM mm1,t1;
DROP TABLE t1, t2, mm1;
--echo #
--echo # Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
--echo #
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES (0,0), (1,1);
SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
DROP TABLE t1;
--echo End of 5.1 tests
......@@ -7027,10 +7027,12 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab)
break;
}
if (order)
{
if (!(order->used & map))
{
found++;
DBUG_ASSERT(!(order->used & map));
order->used|=map;
order->used|= map;
}
continue; // Used in ORDER BY
}
if (!only_eq_ref_tables(join,start_order, (*ref_item)->used_tables()))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment