mariadb/mysql-test/main/range_aria_dbt3.test
Monty 7d1df207c4 MDEV-30373 Wrong result with range access
This issue was caused by the bug fix for
MDEV-30325 Wrong result upon range query using index condition

The bug could happen in the case of several overlapping key ranges
with OR
2023-01-11 18:12:40 +02:00

33 lines
1.1 KiB
Text

#
# This is generic tests using dbt3_s001 tables
# This file uses the Aria storage engine
#
set default_storage_engine=Aria;
CREATE DATABASE dbt3_s001;
use dbt3_s001;
--disable_query_log
--source include/dbt3_s001.inc
--enable_query_log
--echo #
--echo # MDEV-30325 Wrong result upon range query using index condition
--echo #
SELECT COUNT(*) FROM lineitem force index (i_l_orderkey_quantity,i_l_shipdate) WHERE l_shipdate < '1994-01-01' AND l_orderkey < 800 OR l_quantity > 3 AND l_orderkey NOT IN ( 157, 1444 );
SELECT COUNT(*) FROM lineitem ignore index (i_l_orderkey_quantity,i_l_shipdate) WHERE l_shipdate < '1994-01-01' AND l_orderkey < 800 OR l_quantity > 3 AND l_orderkey NOT IN ( 157, 1444 );
--echo #
--echo # MDEV-30373 Wrong result with range access
--echo #
explain SELECT COUNT(*) FROM lineitem WHERE l_orderkey BETWEEN 111 AND 262 OR ( l_orderkey BETWEEN 152 AND 672 AND l_linenumber BETWEEN 4 AND 9 );
SELECT COUNT(*) FROM lineitem WHERE l_orderkey BETWEEN 111 AND 262 OR ( l_orderkey BETWEEN 152 AND 672 AND l_linenumber BETWEEN 4 AND 9 );
DROP DATABASE dbt3_s001;
--echo #
--echo # End of 10.5 tests
--echo #