Commit bff40f3e authored by Sergey Petrunya's avatar Sergey Petrunya

Fix test failure for join_outer_innodb.test:

reuse the approach from vasil.dimov@oracle.com-20120521133620-glj6l0ntcsrz0wbl
run ANALYZE TABLE.
parent 5f0d489d
...@@ -4,6 +4,12 @@ CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11), ...@@ -4,6 +4,12 @@ CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB; FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B'); INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3); INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
EXPLAIN EXPLAIN
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%'; WHERE t1.name LIKE 'A%';
......
...@@ -15,6 +15,9 @@ CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11), ...@@ -15,6 +15,9 @@ CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B'); INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3); INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
ANALYZE TABLE t1;
ANALYZE TABLE t2;
EXPLAIN EXPLAIN
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%'; WHERE t1.name LIKE 'A%';
......
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