diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
commit | 06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/order_by_optimizer.test | |
parent | Initial commit. (diff) | |
download | mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/order_by_optimizer.test')
-rw-r--r-- | mysql-test/main/order_by_optimizer.test | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/main/order_by_optimizer.test b/mysql-test/main/order_by_optimizer.test new file mode 100644 index 00000000..a4c134af --- /dev/null +++ b/mysql-test/main/order_by_optimizer.test @@ -0,0 +1,34 @@ +--disable_warnings +drop table if exists t0,t1,t2,t3; + +--enable_warnings +--echo # +--echo # MDEV-7885: EXPLAIN shows wrong info for ORDER BY query +--echo # +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; + +create table t2 (key1 int, col1 int, key(key1)); +insert into t2 select a,a from t0; +insert into t2 select 15,15 from t1; +alter table t2 add key2 int, add key(key2); +--echo # This must show "Using filesort": +explain +select * from t2 ignore index for order by (key1) where col1<0 order by key1 limit 10; + +drop table t0, t1, t2; + +--echo # +--echo # MDEV-8857: [Upstream too] EXPLAIN incorrectly shows Distinct for tables using join buffer +--echo # +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1 (a int, filler char(200), key(a)); +insert into t1 select A.a + B.a* 10, 'AAAAAAAAAAAAAAAAAAAA' from t0 A, t0 B where B.a in (0,1); +explain select distinct A.a from t0 A, t1 B where A.a+B.a> 0; + +drop table t0, t1; + |