1 /*
2    Copyright (c) 2010, 2021, Oracle and/or its affiliates.
3    All rights reserved. Use is subject to license terms.
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License, version 2.0,
7    as published by the Free Software Foundation.
8 
9    This program is also distributed with certain software (including
10    but not limited to OpenSSL) that is licensed under separate terms,
11    as designated in a particular file or component or in included license
12    documentation.  The authors of MySQL hereby grant you an additional
13    permission to link the program and your derivative works with the
14    separately licensed software that they have included with MySQL.
15 
16    This program is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19    GNU General Public License, version 2.0, for more details.
20 
21    You should have received a copy of the GNU General Public License
22    along with this program; if not, write to the Free Software
23    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
24 */
25 
26 package testsuite.clusterj;
27 
28 import testsuite.clusterj.model.AllPrimitives;
29 import testsuite.clusterj.model.IdBase;
30 
31 public class QueryAllPrimitivesTest extends AbstractQueryTest {
32 
33     @Override
getInstanceType()34     public Class getInstanceType() {
35         return AllPrimitives.class;
36     }
37 
38     @Override
createInstances(int number)39     void createInstances(int number) {
40         createAllPrimitivesInstances(10);
41     }
42 
43     /** Test all single-predicate queries using AllPrimitives.
44 drop table if exists allprimitives;
45 create table allprimitives (
46  id int not null primary key,
47 
48  int_not_null_hash int not null,
49  int_not_null_btree int not null,
50  int_not_null_both int not null,
51  int_not_null_none int not null,
52  int_null_hash int,
53  int_null_btree int,
54  int_null_both int,
55  int_null_none int,
56 
57  byte_not_null_hash tinyint not null,
58  byte_not_null_btree tinyint not null,
59  byte_not_null_both tinyint not null,
60  byte_not_null_none tinyint not null,
61  byte_null_hash tinyint,
62  byte_null_btree tinyint,
63  byte_null_both tinyint,
64  byte_null_none tinyint,
65 
66  short_not_null_hash smallint not null,
67  short_not_null_btree smallint not null,
68  short_not_null_both smallint not null,
69  short_not_null_none smallint not null,
70  short_null_hash smallint,
71  short_null_btree smallint,
72  short_null_both smallint,
73  short_null_none smallint,
74 
75  long_not_null_hash bigint not null,
76  long_not_null_btree bigint not null,
77  long_not_null_both bigint not null,
78  long_not_null_none bigint not null,
79  long_null_hash bigint,
80  long_null_btree bigint,
81  long_null_both bigint,
82  long_null_none bigint
83      */
84 
test()85     public void test() {
86         btreeIndexScanInt();
87         hashIndexScanInt();
88         bothIndexScanInt();
89         noneIndexScanInt();
90 
91         btreeIndexScanByte();
92         hashIndexScanByte();
93         bothIndexScanByte();
94         noneIndexScanByte();
95 
96         btreeIndexScanShort();
97         hashIndexScanShort();
98         bothIndexScanShort();
99         noneIndexScanShort();
100 
101         btreeIndexScanLong();
102         hashIndexScanLong();
103         bothIndexScanLong();
104         noneIndexScanLong();
105         failOnError();
106     }
107 
btreeIndexScanInt()108     public void btreeIndexScanInt() {
109         equalQuery("int_not_null_btree", "idx_int_not_null_btree", 8, 8);
110         greaterEqualQuery("int_not_null_btree", "idx_int_not_null_btree", 7, 7, 8, 9);
111         greaterThanQuery("int_not_null_btree", "idx_int_not_null_btree", 6, 7, 8, 9);
112         lessEqualQuery("int_not_null_btree", "idx_int_not_null_btree", 4, 4, 3, 2, 1, 0);
113         lessThanQuery("int_not_null_btree", "idx_int_not_null_btree", 4, 3, 2, 1, 0);
114         betweenQuery("int_not_null_btree", "idx_int_not_null_btree", 4, 6, 4, 5, 6);
115         greaterEqualAndLessEqualQuery("int_not_null_btree", "idx_int_not_null_btree", 4, 6, 4, 5, 6);
116         greaterThanAndLessEqualQuery("int_not_null_btree", "idx_int_not_null_btree", 4, 6, 5, 6);
117         greaterEqualAndLessThanQuery("int_not_null_btree", "idx_int_not_null_btree", 4, 6, 4, 5);
118         greaterThanAndLessThanQuery("int_not_null_btree", "idx_int_not_null_btree", 4, 6, 5);
119 
120         equalQuery("int_null_btree", "idx_int_null_btree", 8, 8);
121         greaterEqualQuery("int_null_btree", "idx_int_null_btree", 7, 7, 8, 9);
122         greaterThanQuery("int_null_btree", "idx_int_null_btree", 6, 7, 8, 9);
123         lessEqualQuery("int_null_btree", "idx_int_null_btree", 4, 4, 3, 2, 1, 0);
124         lessThanQuery("int_null_btree", "idx_int_null_btree", 4, 3, 2, 1, 0);
125         betweenQuery("int_null_btree", "idx_int_null_btree", 4, 6, 4, 5, 6);
126         greaterEqualAndLessEqualQuery("int_null_btree", "idx_int_null_btree", 4, 6, 4, 5, 6);
127         greaterThanAndLessEqualQuery("int_null_btree", "idx_int_null_btree", 4, 6, 5, 6);
128         greaterEqualAndLessThanQuery("int_null_btree", "idx_int_null_btree", 4, 6, 4, 5);
129         greaterThanAndLessThanQuery("int_null_btree", "idx_int_null_btree", 4, 6, 5);
130     }
131 
hashIndexScanInt()132     public void hashIndexScanInt() {
133         equalQuery("int_not_null_hash", "idx_int_not_null_hash", 8, 8);
134         greaterEqualQuery("int_not_null_hash", "none", 7, 7, 8, 9);
135         greaterThanQuery("int_not_null_hash", "none", 6, 7, 8, 9);
136         lessEqualQuery("int_not_null_hash", "none", 4, 4, 3, 2, 1, 0);
137         lessThanQuery("int_not_null_hash", "none", 4, 3, 2, 1, 0);
138         betweenQuery("int_not_null_hash", "none", 4, 6, 4, 5, 6);
139         greaterEqualAndLessEqualQuery("int_not_null_hash", "none", 4, 6, 4, 5, 6);
140         greaterThanAndLessEqualQuery("int_not_null_hash", "none", 4, 6, 5, 6);
141         greaterEqualAndLessThanQuery("int_not_null_hash", "none", 4, 6, 4, 5);
142         greaterThanAndLessThanQuery("int_not_null_hash", "none", 4, 6, 5);
143 
144         equalQuery("int_null_hash", "idx_int_null_hash", 8, 8);
145         greaterEqualQuery("int_null_hash", "none", 7, 7, 8, 9);
146         greaterThanQuery("int_null_hash", "none", 6, 7, 8, 9);
147         lessEqualQuery("int_null_hash", "none", 4, 4, 3, 2, 1, 0);
148         lessThanQuery("int_null_hash", "none", 4, 3, 2, 1, 0);
149         betweenQuery("int_null_hash", "none", 4, 6, 4, 5, 6);
150         greaterEqualAndLessEqualQuery("int_null_hash", "none", 4, 6, 4, 5, 6);
151         greaterThanAndLessEqualQuery("int_null_hash", "none", 4, 6, 5, 6);
152         greaterEqualAndLessThanQuery("int_null_hash", "none", 4, 6, 4, 5);
153         greaterThanAndLessThanQuery("int_null_hash", "none", 4, 6, 5);
154     }
155 
bothIndexScanInt()156     public void bothIndexScanInt() {
157         equalQuery("int_not_null_both", "idx_int_not_null_both", 8, 8);
158         greaterEqualQuery("int_not_null_both", "idx_int_not_null_both", 7, 7, 8, 9);
159         greaterThanQuery("int_not_null_both", "idx_int_not_null_both", 6, 7, 8, 9);
160         lessEqualQuery("int_not_null_both", "idx_int_not_null_both", 4, 4, 3, 2, 1, 0);
161         lessThanQuery("int_not_null_both", "idx_int_not_null_both", 4, 3, 2, 1, 0);
162         betweenQuery("int_not_null_both", "idx_int_not_null_both", 4, 6, 4, 5, 6);
163         greaterEqualAndLessEqualQuery("int_not_null_both", "idx_int_not_null_both", 4, 6, 4, 5, 6);
164         greaterThanAndLessEqualQuery("int_not_null_both", "idx_int_not_null_both", 4, 6, 5, 6);
165         greaterEqualAndLessThanQuery("int_not_null_both", "idx_int_not_null_both", 4, 6, 4, 5);
166         greaterThanAndLessThanQuery("int_not_null_both", "idx_int_not_null_both", 4, 6, 5);
167 
168         equalQuery("int_null_both", "idx_int_null_both", 8, 8);
169         greaterEqualQuery("int_null_both", "idx_int_null_both", 7, 7, 8, 9);
170         greaterThanQuery("int_null_both", "idx_int_null_both", 6, 7, 8, 9);
171         lessEqualQuery("int_null_both", "idx_int_null_both", 4, 4, 3, 2, 1, 0);
172         lessThanQuery("int_null_both", "idx_int_null_both", 4, 3, 2, 1, 0);
173         betweenQuery("int_null_both", "idx_int_null_both", 4, 6, 4, 5, 6);
174         greaterEqualAndLessEqualQuery("int_null_both", "idx_int_null_both", 4, 6, 4, 5, 6);
175         greaterThanAndLessEqualQuery("int_null_both", "idx_int_null_both", 4, 6, 5, 6);
176         greaterEqualAndLessThanQuery("int_null_both", "idx_int_null_both", 4, 6, 4, 5);
177         greaterThanAndLessThanQuery("int_null_both", "idx_int_null_both", 4, 6, 5);
178     }
179 
noneIndexScanInt()180     public void noneIndexScanInt() {
181         equalQuery("int_not_null_none", "none", 8, 8);
182         greaterEqualQuery("int_not_null_none", "none", 7, 7, 8, 9);
183         greaterThanQuery("int_not_null_none", "none", 6, 7, 8, 9);
184         lessEqualQuery("int_not_null_none", "none", 4, 4, 3, 2, 1, 0);
185         lessThanQuery("int_not_null_none", "none", 4, 3, 2, 1, 0);
186         betweenQuery("int_not_null_none", "none", 4, 6, 4, 5, 6);
187         greaterEqualAndLessEqualQuery("int_not_null_none", "none", 4, 6, 4, 5, 6);
188         greaterThanAndLessEqualQuery("int_not_null_none", "none", 4, 6, 5, 6);
189         greaterEqualAndLessThanQuery("int_not_null_none", "none", 4, 6, 4, 5);
190         greaterThanAndLessThanQuery("int_not_null_none", "none", 4, 6, 5);
191 
192         equalQuery("int_not_null_none", "none", 8, 8);
193         greaterEqualQuery("int_not_null_none", "none", 7, 7, 8, 9);
194         greaterThanQuery("int_not_null_none", "none", 6, 7, 8, 9);
195         lessEqualQuery("int_not_null_none", "none", 4, 4, 3, 2, 1, 0);
196         lessThanQuery("int_not_null_none", "none", 4, 3, 2, 1, 0);
197         betweenQuery("int_not_null_none", "none", 4, 6, 4, 5, 6);
198 
199         greaterEqualAndLessEqualQuery("int_not_null_none", "none", 4, 6, 4, 5, 6);
200         greaterThanAndLessEqualQuery("int_not_null_none", "none", 4, 6, 5, 6);
201         greaterEqualAndLessThanQuery("int_not_null_none", "none", 4, 6, 4, 5);
202         greaterThanAndLessThanQuery("int_not_null_none", "none", 4, 6, 5);
203     }
204 
btreeIndexScanByte()205     public void btreeIndexScanByte() {
206         equalQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)8, 8);
207         greaterEqualQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)7, 7, 8, 9);
208         greaterThanQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)6, 7, 8, 9);
209         lessEqualQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)4, 4, 3, 2, 1, 0);
210         lessThanQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)4, 3, 2, 1, 0);
211         betweenQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)4, (byte)6, 4, 5, 6);
212         greaterEqualAndLessEqualQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)4, (byte)6, 4, 5, 6);
213         greaterThanAndLessEqualQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)4, (byte)6, 5, 6);
214         greaterEqualAndLessThanQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)4, (byte)6, 4, 5);
215         greaterThanAndLessThanQuery("byte_not_null_btree", "idx_byte_not_null_btree", (byte)4, (byte)6, 5);
216 
217         equalQuery("byte_null_btree", "idx_byte_null_btree", (byte)8, 8);
218         greaterEqualQuery("byte_null_btree", "idx_byte_null_btree", (byte)7, 7, 8, 9);
219         greaterThanQuery("byte_null_btree", "idx_byte_null_btree", (byte)6, 7, 8, 9);
220         lessEqualQuery("byte_null_btree", "idx_byte_null_btree", (byte)4, 4, 3, 2, 1, 0);
221         lessThanQuery("byte_null_btree", "idx_byte_null_btree", (byte)4, 3, 2, 1, 0);
222         betweenQuery("byte_null_btree", "idx_byte_null_btree", (byte)4, (byte)6, 4, 5, 6);
223         greaterEqualAndLessEqualQuery("byte_null_btree", "idx_byte_null_btree", (byte)4, (byte)6, 4, 5, 6);
224         greaterThanAndLessEqualQuery("byte_null_btree", "idx_byte_null_btree", (byte)4, (byte)6, 5, 6);
225         greaterEqualAndLessThanQuery("byte_null_btree", "idx_byte_null_btree", (byte)4, (byte)6, 4, 5);
226         greaterThanAndLessThanQuery("byte_null_btree", "idx_byte_null_btree", (byte)4, (byte)6, 5);
227     }
228 
hashIndexScanByte()229     public void hashIndexScanByte() {
230         equalQuery("byte_not_null_hash", "idx_byte_not_null_hash", (byte)8, 8);
231         greaterEqualQuery("byte_not_null_hash", "none", (byte)7, 7, 8, 9);
232         greaterThanQuery("byte_not_null_hash", "none", (byte)6, 7, 8, 9);
233         lessEqualQuery("byte_not_null_hash", "none", (byte)4, 4, 3, 2, 1, 0);
234         lessThanQuery("byte_not_null_hash", "none", (byte)4, 3, 2, 1, 0);
235         betweenQuery("byte_not_null_hash", "none", (byte)4, (byte)6, 4, 5, 6);
236         greaterEqualAndLessEqualQuery("byte_not_null_hash", "none", (byte)4, (byte)6, 4, 5, 6);
237         greaterThanAndLessEqualQuery("byte_not_null_hash", "none", (byte)4, (byte)6, 5, 6);
238         greaterEqualAndLessThanQuery("byte_not_null_hash", "none", (byte)4, (byte)6, 4, 5);
239         greaterThanAndLessThanQuery("byte_not_null_hash", "none", (byte)4, (byte)6, 5);
240 
241         equalQuery("byte_null_hash", "idx_byte_null_hash", (byte)8, 8);
242         greaterEqualQuery("byte_null_hash", "none", (byte)7, 7, 8, 9);
243         greaterThanQuery("byte_null_hash", "none", (byte)6, 7, 8, 9);
244         lessEqualQuery("byte_null_hash", "none", (byte)4, 4, 3, 2, 1, 0);
245         lessThanQuery("byte_null_hash", "none", (byte)4, 3, 2, 1, 0);
246         betweenQuery("byte_null_hash", "none", (byte)4, (byte)6, 4, 5, 6);
247         greaterEqualAndLessEqualQuery("byte_null_hash", "none", (byte)4, (byte)6, 4, 5, 6);
248         greaterThanAndLessEqualQuery("byte_null_hash", "none", (byte)4, (byte)6, 5, 6);
249         greaterEqualAndLessThanQuery("byte_null_hash", "none", (byte)4, (byte)6, 4, 5);
250         greaterThanAndLessThanQuery("byte_null_hash", "none", (byte)4, (byte)6, 5);
251     }
252 
bothIndexScanByte()253     public void bothIndexScanByte() {
254         equalQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)8, 8);
255         greaterEqualQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)7, 7, 8, 9);
256         greaterThanQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)6, 7, 8, 9);
257         lessEqualQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)4, 4, 3, 2, 1, 0);
258         lessThanQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)4, 3, 2, 1, 0);
259         betweenQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)4, (byte)6, 4, 5, 6);
260         greaterEqualAndLessEqualQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)4, (byte)6, 4, 5, 6);
261         greaterThanAndLessEqualQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)4, (byte)6, 5, 6);
262         greaterEqualAndLessThanQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)4, (byte)6, 4, 5);
263         greaterThanAndLessThanQuery("byte_not_null_both", "idx_byte_not_null_both", (byte)4, (byte)6, 5);
264 
265         equalQuery("byte_null_both", "idx_byte_null_both", (byte)8, 8);
266         greaterEqualQuery("byte_null_both", "idx_byte_null_both", (byte)7, 7, 8, 9);
267         greaterThanQuery("byte_null_both", "idx_byte_null_both", (byte)6, 7, 8, 9);
268         lessEqualQuery("byte_null_both", "idx_byte_null_both", (byte)4, 4, 3, 2, 1, 0);
269         lessThanQuery("byte_null_both", "idx_byte_null_both", (byte)4, 3, 2, 1, 0);
270         betweenQuery("byte_null_both", "idx_byte_null_both", (byte)4, (byte)6, 4, 5, 6);
271         greaterEqualAndLessEqualQuery("byte_null_both", "idx_byte_null_both", (byte)4, (byte)6, 4, 5, 6);
272         greaterThanAndLessEqualQuery("byte_null_both", "idx_byte_null_both", (byte)4, (byte)6, 5, 6);
273         greaterEqualAndLessThanQuery("byte_null_both", "idx_byte_null_both", (byte)4, (byte)6, 4, 5);
274         greaterThanAndLessThanQuery("byte_null_both", "idx_byte_null_both", (byte)4, (byte)6, 5);
275     }
276 
noneIndexScanByte()277     public void noneIndexScanByte() {
278         equalQuery("byte_not_null_none", "none", (byte)8, 8);
279         greaterEqualQuery("byte_not_null_none", "none", (byte)7, 7, 8, 9);
280         greaterThanQuery("byte_not_null_none", "none", (byte)6, 7, 8, 9);
281         lessEqualQuery("byte_not_null_none", "none", (byte)4, 4, 3, 2, 1, 0);
282         lessThanQuery("byte_not_null_none", "none", (byte)4, 3, 2, 1, 0);
283         betweenQuery("byte_not_null_none", "none", (byte)4, (byte)6, 4, 5, 6);
284         greaterEqualAndLessEqualQuery("byte_not_null_none", "none", (byte)4, (byte)6, 4, 5, 6);
285         greaterThanAndLessEqualQuery("byte_not_null_none", "none", (byte)4, (byte)6, 5, 6);
286         greaterEqualAndLessThanQuery("byte_not_null_none", "none", (byte)4, (byte)6, 4, 5);
287         greaterThanAndLessThanQuery("byte_not_null_none", "none", (byte)4, (byte)6, 5);
288 
289         equalQuery("byte_null_none", "none", (byte)8, 8);
290         greaterEqualQuery("byte_null_none", "none", (byte)7, 7, 8, 9);
291         greaterThanQuery("byte_null_none", "none", (byte)6, 7, 8, 9);
292         lessEqualQuery("byte_null_none", "none", (byte)4, 4, 3, 2, 1, 0);
293         lessThanQuery("byte_null_none", "none", (byte)4, 3, 2, 1, 0);
294         betweenQuery("byte_null_none", "none", (byte)4, (byte)6, 4, 5, 6);
295         greaterEqualAndLessEqualQuery("byte_null_none", "none", (byte)4, (byte)6, 4, 5, 6);
296         greaterThanAndLessEqualQuery("byte_null_none", "none", (byte)4, (byte)6, 5, 6);
297         greaterEqualAndLessThanQuery("byte_null_none", "none", (byte)4, (byte)6, 4, 5);
298         greaterThanAndLessThanQuery("byte_null_none", "none", (byte)4, (byte)6, 5);
299     }
300 
btreeIndexScanShort()301     public void btreeIndexScanShort() {
302         equalQuery("short_not_null_btree", "idx_short_not_null_btree", (short)8, 8);
303         greaterEqualQuery("short_not_null_btree", "idx_short_not_null_btree", (short)7, 7, 8, 9);
304         greaterThanQuery("short_not_null_btree", "idx_short_not_null_btree", (short)6, 7, 8, 9);
305         lessEqualQuery("short_not_null_btree", "idx_short_not_null_btree", (short)4, 4, 3, 2, 1, 0);
306         lessThanQuery("short_not_null_btree", "idx_short_not_null_btree", (short)4, 3, 2, 1, 0);
307         betweenQuery("short_not_null_btree", "idx_short_not_null_btree", (short)4, (short)6, 4, 5, 6);
308         greaterEqualAndLessEqualQuery("short_not_null_btree", "idx_short_not_null_btree", (short)4, (short)6, 4, 5, 6);
309         greaterThanAndLessEqualQuery("short_not_null_btree", "idx_short_not_null_btree", (short)4, (short)6, 5, 6);
310         greaterEqualAndLessThanQuery("short_not_null_btree", "idx_short_not_null_btree", (short)4, (short)6, 4, 5);
311         greaterThanAndLessThanQuery("short_not_null_btree", "idx_short_not_null_btree", (short)4, (short)6, 5);
312 
313         equalQuery("short_null_btree", "idx_short_null_btree", (short)8, 8);
314         greaterEqualQuery("short_null_btree", "idx_short_null_btree", (short)7, 7, 8, 9);
315         greaterThanQuery("short_null_btree", "idx_short_null_btree", (short)6, 7, 8, 9);
316         lessEqualQuery("short_null_btree", "idx_short_null_btree", (short)4, 4, 3, 2, 1, 0);
317         lessThanQuery("short_null_btree", "idx_short_null_btree", (short)4, 3, 2, 1, 0);
318         betweenQuery("short_null_btree", "idx_short_null_btree", (short)4, (short)6, 4, 5, 6);
319         greaterEqualAndLessEqualQuery("short_null_btree", "idx_short_null_btree", (short)4, (short)6, 4, 5, 6);
320         greaterThanAndLessEqualQuery("short_null_btree", "idx_short_null_btree", (short)4, (short)6, 5, 6);
321         greaterEqualAndLessThanQuery("short_null_btree", "idx_short_null_btree", (short)4, (short)6, 4, 5);
322         greaterThanAndLessThanQuery("short_null_btree", "idx_short_null_btree", (short)4, (short)6, 5);
323     }
324 
hashIndexScanShort()325     public void hashIndexScanShort() {
326         equalQuery("short_not_null_hash", "idx_short_not_null_hash", (short)8, 8);
327         greaterEqualQuery("short_not_null_hash", "none", (short)7, 7, 8, 9);
328         greaterThanQuery("short_not_null_hash", "none", (short)6, 7, 8, 9);
329         lessEqualQuery("short_not_null_hash", "none", (short)4, 4, 3, 2, 1, 0);
330         lessThanQuery("short_not_null_hash", "none", (short)4, 3, 2, 1, 0);
331         betweenQuery("short_not_null_hash", "none", (short)4, (short)6, 4, 5, 6);
332         greaterEqualAndLessEqualQuery("short_not_null_hash", "none", (short)4, (short)6, 4, 5, 6);
333         greaterThanAndLessEqualQuery("short_not_null_hash", "none", (short)4, (short)6, 5, 6);
334         greaterEqualAndLessThanQuery("short_not_null_hash", "none", (short)4, (short)6, 4, 5);
335         greaterThanAndLessThanQuery("short_not_null_hash", "none", (short)4, (short)6, 5);
336 
337         equalQuery("short_null_hash", "idx_short_null_hash", (short)8, 8);
338         greaterEqualQuery("short_null_hash", "none", (short)7, 7, 8, 9);
339         greaterThanQuery("short_null_hash", "none", (short)6, 7, 8, 9);
340         lessEqualQuery("short_null_hash", "none", (short)4, 4, 3, 2, 1, 0);
341         lessThanQuery("short_null_hash", "none", (short)4, 3, 2, 1, 0);
342         betweenQuery("short_null_hash", "none", (short)4, (short)6, 4, 5, 6);
343         greaterEqualAndLessEqualQuery("short_null_hash", "none", (short)4, (short)6, 4, 5, 6);
344         greaterThanAndLessEqualQuery("short_null_hash", "none", (short)4, (short)6, 5, 6);
345         greaterEqualAndLessThanQuery("short_null_hash", "none", (short)4, (short)6, 4, 5);
346         greaterThanAndLessThanQuery("short_null_hash", "none", (short)4, (short)6, 5);
347     }
348 
bothIndexScanShort()349     public void bothIndexScanShort() {
350         equalQuery("short_not_null_both", "idx_short_not_null_both", (short)8, 8);
351         greaterEqualQuery("short_not_null_both", "idx_short_not_null_both", (short)7, 7, 8, 9);
352         greaterThanQuery("short_not_null_both", "idx_short_not_null_both", (short)6, 7, 8, 9);
353         lessEqualQuery("short_not_null_both", "idx_short_not_null_both", (short)4, 4, 3, 2, 1, 0);
354         lessThanQuery("short_not_null_both", "idx_short_not_null_both", (short)4, 3, 2, 1, 0);
355         betweenQuery("short_not_null_both", "idx_short_not_null_both", (short)4, (short)6, 4, 5, 6);
356         greaterEqualAndLessEqualQuery("short_not_null_both", "idx_short_not_null_both", (short)4, (short)6, 4, 5, 6);
357         greaterThanAndLessEqualQuery("short_not_null_both", "idx_short_not_null_both", (short)4, (short)6, 5, 6);
358         greaterEqualAndLessThanQuery("short_not_null_both", "idx_short_not_null_both", (short)4, (short)6, 4, 5);
359         greaterThanAndLessThanQuery("short_not_null_both", "idx_short_not_null_both", (short)4, (short)6, 5);
360 
361         equalQuery("short_null_both", "idx_short_null_both", (short)8, 8);
362         greaterEqualQuery("short_null_both", "idx_short_null_both", (short)7, 7, 8, 9);
363         greaterThanQuery("short_null_both", "idx_short_null_both", (short)6, 7, 8, 9);
364         lessEqualQuery("short_null_both", "idx_short_null_both", (short)4, 4, 3, 2, 1, 0);
365         lessThanQuery("short_null_both", "idx_short_null_both", (short)4, 3, 2, 1, 0);
366         betweenQuery("short_null_both", "idx_short_null_both", (short)4, (short)6, 4, 5, 6);
367         greaterEqualAndLessEqualQuery("short_null_both", "idx_short_null_both", (short)4, (short)6, 4, 5, 6);
368         greaterThanAndLessEqualQuery("short_null_both", "idx_short_null_both", (short)4, (short)6, 5, 6);
369         greaterEqualAndLessThanQuery("short_null_both", "idx_short_null_both", (short)4, (short)6, 4, 5);
370         greaterThanAndLessThanQuery("short_null_both", "idx_short_null_both", (short)4, (short)6, 5);
371     }
372 
noneIndexScanShort()373     public void noneIndexScanShort() {
374         equalQuery("short_not_null_none", "none", (short)8, 8);
375         greaterEqualQuery("short_not_null_none", "none", (short)7, 7, 8, 9);
376         greaterThanQuery("short_not_null_none", "none", (short)6, 7, 8, 9);
377         lessEqualQuery("short_not_null_none", "none", (short)4, 4, 3, 2, 1, 0);
378         lessThanQuery("short_not_null_none", "none", (short)4, 3, 2, 1, 0);
379         betweenQuery("short_not_null_none", "none", (short)4, (short)6, 4, 5, 6);
380         greaterEqualAndLessEqualQuery("short_not_null_none", "none", (short)4, (short)6, 4, 5, 6);
381         greaterThanAndLessEqualQuery("short_not_null_none", "none", (short)4, (short)6, 5, 6);
382         greaterEqualAndLessThanQuery("short_not_null_none", "none", (short)4, (short)6, 4, 5);
383         greaterThanAndLessThanQuery("short_not_null_none", "none", (short)4, (short)6, 5);
384 
385         equalQuery("short_null_none", "none", (short)8, 8);
386         greaterEqualQuery("short_null_none", "none", (short)7, 7, 8, 9);
387         greaterThanQuery("short_null_none", "none", (short)6, 7, 8, 9);
388         lessEqualQuery("short_null_none", "none", (short)4, 4, 3, 2, 1, 0);
389         lessThanQuery("short_null_none", "none", (short)4, 3, 2, 1, 0);
390         betweenQuery("short_null_none", "none", (short)4, (short)6, 4, 5, 6);
391         greaterEqualAndLessEqualQuery("short_null_none", "none", (short)4, (short)6, 4, 5, 6);
392         greaterThanAndLessEqualQuery("short_null_none", "none", (short)4, (short)6, 5, 6);
393         greaterEqualAndLessThanQuery("short_null_none", "none", (short)4, (short)6, 4, 5);
394         greaterThanAndLessThanQuery("short_null_none", "none", (short)4, (short)6, 5);
395     }
396 
btreeIndexScanLong()397     public void btreeIndexScanLong() {
398         equalQuery("long_not_null_btree", "idx_long_not_null_btree", (long)8, 8);
399         greaterEqualQuery("long_not_null_btree", "idx_long_not_null_btree", (long)7, 7, 8, 9);
400         greaterThanQuery("long_not_null_btree", "idx_long_not_null_btree", (long)6, 7, 8, 9);
401         lessEqualQuery("long_not_null_btree", "idx_long_not_null_btree", (long)4, 4, 3, 2, 1, 0);
402         lessThanQuery("long_not_null_btree", "idx_long_not_null_btree", (long)4, 3, 2, 1, 0);
403         betweenQuery("long_not_null_btree", "idx_long_not_null_btree", (long)4, (long)6, 4, 5, 6);
404         greaterEqualAndLessEqualQuery("long_not_null_btree", "idx_long_not_null_btree", (long)4, (long)6, 4, 5, 6);
405         greaterThanAndLessEqualQuery("long_not_null_btree", "idx_long_not_null_btree", (long)4, (long)6, 5, 6);
406         greaterEqualAndLessThanQuery("long_not_null_btree", "idx_long_not_null_btree", (long)4, (long)6, 4, 5);
407         greaterThanAndLessThanQuery("long_not_null_btree", "idx_long_not_null_btree", (long)4, (long)6, 5);
408 
409         equalQuery("long_null_btree", "idx_long_null_btree", (long)8, 8);
410         greaterEqualQuery("long_null_btree", "idx_long_null_btree", (long)7, 7, 8, 9);
411         greaterThanQuery("long_null_btree", "idx_long_null_btree", (long)6, 7, 8, 9);
412         lessEqualQuery("long_null_btree", "idx_long_null_btree", (long)4, 4, 3, 2, 1, 0);
413         lessThanQuery("long_null_btree", "idx_long_null_btree", (long)4, 3, 2, 1, 0);
414         betweenQuery("long_null_btree", "idx_long_null_btree", (long)4, (long)6, 4, 5, 6);
415         greaterEqualAndLessEqualQuery("long_null_btree", "idx_long_null_btree", (long)4, (long)6, 4, 5, 6);
416         greaterThanAndLessEqualQuery("long_null_btree", "idx_long_null_btree", (long)4, (long)6, 5, 6);
417         greaterEqualAndLessThanQuery("long_null_btree", "idx_long_null_btree", (long)4, (long)6, 4, 5);
418         greaterThanAndLessThanQuery("long_null_btree", "idx_long_null_btree", (long)4, (long)6, 5);
419     }
420 
hashIndexScanLong()421     public void hashIndexScanLong() {
422         equalQuery("long_not_null_hash", "idx_long_not_null_hash", (long)8, 8);
423         greaterEqualQuery("long_not_null_hash", "none", (long)7, 7, 8, 9);
424         greaterThanQuery("long_not_null_hash", "none", (long)6, 7, 8, 9);
425         lessEqualQuery("long_not_null_hash", "none", (long)4, 4, 3, 2, 1, 0);
426         lessThanQuery("long_not_null_hash", "none", (long)4, 3, 2, 1, 0);
427         betweenQuery("long_not_null_hash", "none", (long)4, (long)6, 4, 5, 6);
428         greaterEqualAndLessEqualQuery("long_not_null_hash", "none", (long)4, (long)6, 4, 5, 6);
429         greaterThanAndLessEqualQuery("long_not_null_hash", "none", (long)4, (long)6, 5, 6);
430         greaterEqualAndLessThanQuery("long_not_null_hash", "none", (long)4, (long)6, 4, 5);
431         greaterThanAndLessThanQuery("long_not_null_hash", "none", (long)4, (long)6, 5);
432 
433         equalQuery("long_null_hash", "idx_long_null_hash", (long)8, 8);
434         greaterEqualQuery("long_null_hash", "none", (long)7, 7, 8, 9);
435         greaterThanQuery("long_null_hash", "none", (long)6, 7, 8, 9);
436         lessEqualQuery("long_null_hash", "none", (long)4, 4, 3, 2, 1, 0);
437         lessThanQuery("long_null_hash", "none", (long)4, 3, 2, 1, 0);
438         betweenQuery("long_null_hash", "none", (long)4, (long)6, 4, 5, 6);
439         greaterEqualAndLessEqualQuery("long_null_hash", "none", (long)4, (long)6, 4, 5, 6);
440         greaterThanAndLessEqualQuery("long_null_hash", "none", (long)4, (long)6, 5, 6);
441         greaterEqualAndLessThanQuery("long_null_hash", "none", (long)4, (long)6, 4, 5);
442         greaterThanAndLessThanQuery("long_null_hash", "none", (long)4, (long)6, 5);
443     }
444 
bothIndexScanLong()445     public void bothIndexScanLong() {
446         equalQuery("long_not_null_both", "idx_long_not_null_both", (long)8, 8);
447         greaterEqualQuery("long_not_null_both", "idx_long_not_null_both", (long)7, 7, 8, 9);
448         greaterThanQuery("long_not_null_both", "idx_long_not_null_both", (long)6, 7, 8, 9);
449         lessEqualQuery("long_not_null_both", "idx_long_not_null_both", (long)4, 4, 3, 2, 1, 0);
450         lessThanQuery("long_not_null_both", "idx_long_not_null_both", (long)4, 3, 2, 1, 0);
451         betweenQuery("long_not_null_both", "idx_long_not_null_both", (long)4, (long)6, 4, 5, 6);
452         greaterEqualAndLessEqualQuery("long_not_null_both", "idx_long_not_null_both", (long)4, (long)6, 4, 5, 6);
453         greaterThanAndLessEqualQuery("long_not_null_both", "idx_long_not_null_both", (long)4, (long)6, 5, 6);
454         greaterEqualAndLessThanQuery("long_not_null_both", "idx_long_not_null_both", (long)4, (long)6, 4, 5);
455         greaterThanAndLessThanQuery("long_not_null_both", "idx_long_not_null_both", (long)4, (long)6, 5);
456 
457         equalQuery("long_null_both", "idx_long_null_both", (long)8, 8);
458         greaterEqualQuery("long_null_both", "idx_long_null_both", (long)7, 7, 8, 9);
459         greaterThanQuery("long_null_both", "idx_long_null_both", (long)6, 7, 8, 9);
460         lessEqualQuery("long_null_both", "idx_long_null_both", (long)4, 4, 3, 2, 1, 0);
461         lessThanQuery("long_null_both", "idx_long_null_both", (long)4, 3, 2, 1, 0);
462         betweenQuery("long_null_both", "idx_long_null_both", (long)4, (long)6, 4, 5, 6);
463         greaterEqualAndLessEqualQuery("long_null_both", "idx_long_null_both", (long)4, (long)6, 4, 5, 6);
464         greaterThanAndLessEqualQuery("long_null_both", "idx_long_null_both", (long)4, (long)6, 5, 6);
465         greaterEqualAndLessThanQuery("long_null_both", "idx_long_null_both", (long)4, (long)6, 4, 5);
466         greaterThanAndLessThanQuery("long_null_both", "idx_long_null_both", (long)4, (long)6, 5);
467     }
468 
noneIndexScanLong()469     public void noneIndexScanLong() {
470         equalQuery("long_not_null_none", "none", (long)8, 8);
471         greaterEqualQuery("long_not_null_none", "none", (long)7, 7, 8, 9);
472         greaterThanQuery("long_not_null_none", "none", (long)6, 7, 8, 9);
473         lessEqualQuery("long_not_null_none", "none", (long)4, 4, 3, 2, 1, 0);
474         lessThanQuery("long_not_null_none", "none", (long)4, 3, 2, 1, 0);
475         betweenQuery("long_not_null_none", "none", (long)4, (long)6, 4, 5, 6);
476         greaterEqualAndLessEqualQuery("long_not_null_none", "none", (long)4, (long)6, 4, 5, 6);
477         greaterThanAndLessEqualQuery("long_not_null_none", "none", (long)4, (long)6, 5, 6);
478         greaterEqualAndLessThanQuery("long_not_null_none", "none", (long)4, (long)6, 4, 5);
479         greaterThanAndLessThanQuery("long_not_null_none", "none", (long)4, (long)6, 5);
480 
481         equalQuery("long_null_none", "none", (long)8, 8);
482         greaterEqualQuery("long_null_none", "none", (long)7, 7, 8, 9);
483         greaterThanQuery("long_null_none", "none", (long)6, 7, 8, 9);
484         lessEqualQuery("long_null_none", "none", (long)4, 4, 3, 2, 1, 0);
485         lessThanQuery("long_null_none", "none", (long)4, 3, 2, 1, 0);
486         betweenQuery("long_null_none", "none", (long)4, (long)6, 4, 5, 6);
487         greaterEqualAndLessEqualQuery("long_null_none", "none", (long)4, (long)6, 4, 5, 6);
488         greaterThanAndLessEqualQuery("long_null_none", "none", (long)4, (long)6, 5, 6);
489         greaterEqualAndLessThanQuery("long_null_none", "none", (long)4, (long)6, 4, 5);
490         greaterThanAndLessThanQuery("long_null_none", "none", (long)4, (long)6, 5);
491     }
492 
493 }
494