Debian Codegraph @

mysql-test/suite/gcol/inc/gcol_handler.inc

raw
1 ################################################################################
2 # inc/gcol_handler.inc #
3 # #
4 # Purpose: #
5 # Testing HANDLER. #
6 # #
7 # #
8 # #
9 #------------------------------------------------------------------------------#
10 # Original Author: Andrey Zhakov #
11 # Original Date: 2008-09-04 #
12 # Change Author: #
13 # Change Date: #
14 # Change: #
15 ################################################################################
16
17 create table t1 (a int,
18 b int generated always as (-a) virtual,
19 c int generated always as (-a) stored,
20 d char(1),
21 index (a),
22 index (c));
23 insert into t1 (a,d) values (4,'a'), (2,'b'), (1,'c'), (3,'d');
24 select * from t1;
25
26 --echo # HANDLER tbl_name OPEN
27 handler t1 open;
28
29 --echo # HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...)
30 handler t1 read a > (2);
31
32 --echo # HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) WHERE non-gcol_field=expr
33 handler t1 read a > (2) where d='c';
34
35 --echo # HANDLER tbl_name READ gcol_index_name = (value1,value2,...)
36 handler t1 read c = (-2);
37
38 --echo # HANDLER tbl_name READ gcol_index_name = (value1,value2,...) WHERE non-gcol_field=expr
39 handler t1 read c = (-2) where d='c';
40
41 --echo # HANDLER tbl_name READ non-gcol_index_name > (value1,value2,...) WHERE gcol_field=expr
42 handler t1 read a > (2) where b=-3 && c=-3;
43
44 --echo # HANDLER tbl_name READ gcol_index_name <= (value1,value2,...)
45 handler t1 read c <= (-2);
46
47 --echo # HANDLER tbl_name READ gcol_index_name > (value1,value2,...) WHERE gcol_field=expr
48 handler t1 read c <= (-2) where b=-3;
49
50 --echo # HANDLER tbl_name READ gcol_index_name FIRST
51 handler t1 read c first;
52
53 --echo # HANDLER tbl_name READ gcol_index_name NEXT
54 --skip_if_hypergraph
55 handler t1 read c next;
56
57 --echo # HANDLER tbl_name READ gcol_index_name PREV
58 --skip_if_hypergraph
59 handler t1 read c prev;
60
61 --echo # HANDLER tbl_name READ gcol_index_name LAST
62 --skip_if_hypergraph
63 handler t1 read c last;
64
65 --echo # HANDLER tbl_name READ FIRST where non-gcol=expr
66 handler t1 read FIRST where a >= 2;
67
68 --echo # HANDLER tbl_name READ FIRST where gcol=expr
69 handler t1 read FIRST where b >= -2;
70
71 --echo # HANDLER tbl_name READ NEXT where non-gcol=expr
72 handler t1 read NEXT where d='c';
73
74 --echo # HANDLER tbl_name READ NEXT where gcol=expr
75 handler t1 read NEXT where b<=-4;
76
77 --echo # HANDLER tbl_name CLOSE
78 handler t1 close;
79
80 drop table t1;