diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-07-16 09:22:17 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-07-16 09:22:17 +0400 |
commit | 9651a6f5745c330111b5281e69a7d52fc8261d0d (patch) | |
tree | 57fdb29f4035a0a1c4edc155f97577f645e29796 /mysql-test/r/subselect_sj.result | |
parent | 716a49a19e9a6fdd86f384917c8fdd6fdd0dd53f (diff) | |
download | mariadb-git-9651a6f5745c330111b5281e69a7d52fc8261d0d.tar.gz |
mdev-4173: Wrong result (extra row) with semijoin=on, joins in outer query, LEFT JOIN in the subquery
Apply the patch from Patryk Pomykalski:
- create_internal_tmp_table_from_heap() will now return information whether
the last row that we tried to write was a duplicate row.
(mysql-5.6 also has this change)
Diffstat (limited to 'mysql-test/r/subselect_sj.result')
-rw-r--r-- | mysql-test/r/subselect_sj.result | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 56c3044c4e4..3fc91b452a5 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -2884,4 +2884,40 @@ HAVING c <> ( SELECT MAX( c ) FROM t1 ) ORDER BY sm; c sm DROP TABLE t1,t2; +# +# mdev-4173 ignored duplicate value when converting heap to temp table +# could lead to extra rows in semijoin queries or missing row in union queries +# +CREATE TABLE t1 (i1 INT) engine=myisam; +INSERT INTO t1 VALUES +(4),(8),(0),(0),(0),(7),(7),(5),(3),(4),(9),(6),(1),(5),(6),(2),(4),(4); +CREATE TABLE t2 (i2 INT, j2 INT) engine=myisam; +INSERT INTO t2 VALUES +(7,1),(0,7),(9,4),(3,7),(4,0),(2,2),(5,9),(3,4), +(1,0),(3,9),(5,8),(1,8),(204,18),(224,84),(9,6); +CREATE TABLE t3 (i3 INT, KEY(i3)) engine=myisam; +INSERT INTO t3 VALUES +(0),(8),(1),(8),(9),(24),(6),(1),(6),(2),(4),(2),(1); +select @@max_heap_table_size into @tmp_max_heap_table_size; +select @@join_buffer_size into @tmp_join_buffer_size; +set max_heap_table_size=16*1024; +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +DROP TABLE t1, t2, t3; +set join_buffer_size = @tmp_join_buffer_size; +set max_heap_table_size = @tmp_max_heap_table_size; set optimizer_switch=@subselect_sj_tmp; |