@@ -249,6 +249,58 @@ select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
249
249
250
250
drop table t1;
251
251
252
+ # decimal (not the new 5.0 thing)
253
+
254
+ create table t1 (
255
+ a int primary key,
256
+ s decimal(12),
257
+ t decimal(12, 5),
258
+ u decimal(12) unsigned,
259
+ v decimal(12, 5) unsigned,
260
+ key (s),
261
+ key (t),
262
+ key (u),
263
+ key (v)
264
+ ) engine=ndb;
265
+ #
266
+ insert into t1 values
267
+ ( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042),
268
+ ( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003),
269
+ ( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488),
270
+ ( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013),
271
+ ( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002),
272
+ ( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018),
273
+ ( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001),
274
+ ( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374),
275
+ ( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000),
276
+ ( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008);
277
+ #
278
+ select count(*)- 5 from t1 use index (s) where s < -000000000007;
279
+ select count(*)- 7 from t1 use index (s) where s <= -000000000007;
280
+ select count(*)- 2 from t1 use index (s) where s = -000000000007;
281
+ select count(*)- 5 from t1 use index (s) where s >= -000000000007;
282
+ select count(*)- 3 from t1 use index (s) where s > -000000000007;
283
+ #
284
+ select count(*)- 4 from t1 use index (t) where t < -0000061.00003;
285
+ select count(*)- 5 from t1 use index (t) where t <= -0000061.00003;
286
+ select count(*)- 1 from t1 use index (t) where t = -0000061.00003;
287
+ select count(*)- 6 from t1 use index (t) where t >= -0000061.00003;
288
+ select count(*)- 5 from t1 use index (t) where t > -0000061.00003;
289
+ #
290
+ select count(*)- 2 from t1 use index (u) where u < 000000000061;
291
+ select count(*)- 4 from t1 use index (u) where u <= 000000000061;
292
+ select count(*)- 2 from t1 use index (u) where u = 000000000061;
293
+ select count(*)- 8 from t1 use index (u) where u >= 000000000061;
294
+ select count(*)- 6 from t1 use index (u) where u > 000000000061;
295
+ #
296
+ select count(*)- 5 from t1 use index (v) where v < 0000965.00042;
297
+ select count(*)- 6 from t1 use index (v) where v <= 0000965.00042;
298
+ select count(*)- 1 from t1 use index (v) where v = 0000965.00042;
299
+ select count(*)- 5 from t1 use index (v) where v >= 0000965.00042;
300
+ select count(*)- 4 from t1 use index (v) where v > 0000965.00042;
301
+
302
+ drop table t1;
303
+
252
304
# bug#7798
253
305
create table t1(a int primary key, b int not null, index(b));
254
306
insert into t1 values (1,1), (2,2);
0 commit comments