diff options
| author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-20 15:49:48 +0200 |
|---|---|---|
| committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-20 15:49:48 +0200 |
| commit | 87a61355e8e499baf7908862711c26aa0225bf32 (patch) | |
| tree | 7122052c801b5f1ee4a93af2348fad916aa2f86b /mysql-test/main/join_cache.result | |
| parent | 7ea413ac2d80c7f03d1dbad90ac30ecddd8b2835 (diff) | |
| parent | bc43bf3e430c20bc2178e584215bd443054709d6 (diff) | |
| download | mariadb-git-87a61355e8e499baf7908862711c26aa0225bf32.tar.gz | |
Merge 10.3 into 10.4
The MDEV-17062 fix in commit c4195305b2a8431f39a4c75cc1c66ba43685f7a0
was omitted.
Diffstat (limited to 'mysql-test/main/join_cache.result')
| -rw-r--r-- | mysql-test/main/join_cache.result | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index ce0855602cc..cb9cdfa0214 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -6067,6 +6067,79 @@ select f2 from t2,t1 where f2 = 0; f2 drop table t1, t2; set join_buffer_size=@save_join_buffer_size; +# +# MDEV-21243: Join buffer: condition is checked in wrong place for range access +# +create table t1(a int primary key); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int); +insert into t2 select A.a + 10*B.a from t1 A, t1 B; +create table t3 ( +kp1 int, +kp2 int, +col1 int, +col2 int, +key (kp1, kp2) +); +insert into t3 +select +A.a, +B.a, +A.a + 100*B.a, +A.a + 100*B.a +from +t2 A, t2 B; +analyze table t3; +Table Op Msg_type Msg_text +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status Table is already up to date +# The following must have "B.col1 + 1 < 33333" attached to table B +# and not to the block-nl-join node: +explain format=json +select * +from t1 a, t3 b +where +b.kp1=a.a and +b.kp1 <= 10 and +b.kp2 <= 10 and +b.col1 +1 < 33333; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "a", + "access_type": "index", + "possible_keys": ["PRIMARY"], + "key": "PRIMARY", + "key_length": "4", + "used_key_parts": ["a"], + "rows": 10, + "filtered": 100, + "attached_condition": "a.a <= 10", + "using_index": true + }, + "block-nl-join": { + "table": { + "table_name": "b", + "access_type": "range", + "possible_keys": ["kp1"], + "key": "kp1", + "key_length": "10", + "used_key_parts": ["kp1", "kp2"], + "rows": 836, + "filtered": 76.434, + "index_condition": "b.kp2 <= 10", + "attached_condition": "b.kp2 <= 10 and b.col1 + 1 < 33333" + }, + "buffer_type": "flat", + "buffer_size": "54", + "join_type": "BNL", + "attached_condition": "b.kp1 = a.a" + } + } +} +drop table t1,t2,t3; set @@optimizer_switch=@save_optimizer_switch; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= |
