~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/order_by.result

  • Committer: Monty Taylor
  • Date: 2010-09-26 21:24:15 UTC
  • mto: (1796.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1797.
  • Revision ID: mordred@inaugust.com-20100926212415-5fn3p3q75pgiei7r
Moved protocol doc into the docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
297
297
1       NULL    b
298
298
explain select * from t1 where a >= 1 and a < 3 order by a desc;
299
299
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
300
 
1       SIMPLE  t1      range   a       a       4       NULL    10      Using where; Using index
 
300
1       SIMPLE  t1      range   a       a       4       NULL    5       Using where; Using index
301
301
select * from t1 where a >= 1 and a < 3 order by a desc;
302
302
a       b       c
303
303
2       3       c
313
313
1       NULL    NULL
314
314
explain select * from t1 where a = 1 order by a desc, b desc;
315
315
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
316
 
1       SIMPLE  t1      ref     a       a       4       const   6       Using where; Using index
 
316
1       SIMPLE  t1      ref     a       a       4       const   5       Using where; Using index
317
317
select * from t1 where a = 1 order by a desc, b desc;
318
318
a       b       c
319
319
1       3       b
331
331
1       NULL    b
332
332
explain select * from t1 where a >= 1 and a < 3 and b >0 order by a desc,b desc;
333
333
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
334
 
1       SIMPLE  t1      range   a       a       9       NULL    8       Using where; Using index
 
334
1       SIMPLE  t1      range   a       a       9       NULL    5       Using where; Using index
335
335
explain select * from t1 where a = 2 and b >0 order by a desc,b desc;
336
336
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
337
337
1       SIMPLE  t1      range   a       a       9       NULL    5       Using where; Using index
350
350
1       SIMPLE  t1      range   a       a       9       NULL    1       Using where; Using index
351
351
explain select * from t1 where a = 1 order by b desc;
352
352
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
353
 
1       SIMPLE  t1      ref     a       a       4       const   6       Using where; Using index
 
353
1       SIMPLE  t1      ref     a       a       4       const   5       Using where; Using index
354
354
select * from t1 where a = 1 order by b desc;
355
355
a       b       c
356
356
1       3       b
416
416
1       1       b
417
417
explain select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc;
418
418
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
419
 
1       SIMPLE  t1      index   a       a       414     NULL    8       Using where; Using index
 
419
1       SIMPLE  t1      range   a       a       12      NULL    4       Using where; Using index
420
420
select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc;
421
421
a       b       c
422
422
2       1       b
439
439
KEY component_id (cid)
440
440
) ENGINE=MyISAM;
441
441
INSERT INTO t1 VALUES (103853,108),(103867,108),(103962,108),(104505,108),(104619,108),(104620,108);
442
 
ALTER TABLE t1 add skr int default 42 not null;
 
442
ALTER TABLE t1 add skr int not null;
443
443
CREATE TEMPORARY TABLE t2 (
444
444
gid int NOT NULL default '0',
445
445
uid int NOT NULL default '1',
454
454
PRIMARY KEY  (uid)
455
455
) ENGINE=MyISAM;
456
456
INSERT INTO t3 VALUES (1),(15),(27),(75),(117),(250);
457
 
ALTER TABLE t3 add skr int default 42 not null;
 
457
ALTER TABLE t3 add skr int not null;
458
458
select t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
459
459
gid     sid     uid
460
460
104620  5       15