Files
oceanbase/tools/deploy/mysql_test/t/index_14_hint.test
2023-11-20 08:32:44 +00:00

43 lines
1.2 KiB
Plaintext

--disable_query_log
set @@session.explicit_defaults_for_timestamp=off;
--enable_query_log
#owner: yibo.tyf
#owner group: sql1
#test:
#create index objecting to columns
###TODO regenerate result file after physicalplan output is ready
--disable_query_log
--source mysql_test/include/index_quick_major.inc
--real_sleep 1
--disable_warnings
drop table if exists t1;
--enable_warnings
--enable_query_log
#init data table and index table
create table t1 (c1 int, c2 int, c3 int, c4 int, primary key(c1));
create index i1 on t1 (c2);
create index i2 on t1 (c3, c4);
create index i3 on t1 (c3) storing(c4);
replace into t1 values (1,1,2,1),(2,2,1,null),(3,3,null,null),(4,null,null,null);
select * from t1;
select /*+ index(t1 i2) */ * from t1 where c3=1;
let $index_name = __idx_3003_i3;
--source mysql_test/include/check_all_idx_ok.inc
select * from t1 where c3=1;
select /*+ index(a1 i2) */ * from t1 as a1 where c3 in(1,2);
select * from t1 as a1 where a1.c3 in (1,2);
select /*+ index(t1 primary) */ * from t1 where c3 in(1,2);
select * from t1 where c3 is null;
select /*+ index(t1 i2) */ * from t1 where c3 is null;
select /*+ index(t1 primary) */ * from t1 where c3 is null;
select /*+ index(t1 i4) */ * from t1 where c3 is null;
drop table t1;