~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/select.test

  • Committer: Lee
  • Date: 2008-10-03 23:31:06 UTC
  • mfrom: (413.2.3 drizzle)
  • mto: This revision was merged to the branch mainline in revision 459.
  • Revision ID: lbieber@lbieber-desktop-20081003233106-tgvzu0fh25gb3xeg
breaking out enum field classes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1332
1332
# If the like starts with a certain letter key will be used.
1333
1333
#
1334
1334
 
1335
 
--sorted_result
1336
1335
select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
1337
1336
select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
1338
1337
select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
1349
1348
select distinct companynr from t2;
1350
1349
select distinct companynr from t2 order by companynr;
1351
1350
select distinct companynr from t2 order by companynr desc;
1352
 
--sorted_result
1353
1351
select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
1354
1352
 
1355
1353
select distinct fld3 from t2 where companynr = 34 order by fld3;
1356
 
# PBXT: because there is no ORDER BY with a LIMIT, these
1357
 
# statements return different results to those from innodb
1358
 
--sorted_result
1359
1354
select distinct fld3 from t2 limit 10;
1360
1355
select distinct fld3 from t2 having fld3 like "A%" limit 10;
1361
1356
select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
1362
1357
select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
1363
1358
select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
1364
 
--sorted_result
1365
1359
select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
1366
1360
 
1367
1361
# make a big table.
1480
1474
# Search with a constant table and several rows from another table
1481
1475
#
1482
1476
 
1483
 
--sorted_result
1484
1477
select fld3,period from t2,t1 where companynr*10 = 37*10;
1485
1478
 
1486
1479
#
1838
1831
select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1;
1839
1832
select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a));
1840
1833
# inner join on
1841
 
--sorted_result
1842
1834
select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1;
1843
1835
select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
1844
1836
# inner join using
2983
2975
SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL;
2984
2976
SELECT COUNT(*) FROM t1 WHERE ID_better=1;
2985
2977
 
2986
 
# PBXT: does not return a consistent row count
2987
 
--replace_column 9 #
2988
2978
EXPLAIN SELECT * FROM t1
2989
2979
  WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
2990
 
--replace_column 9 #
2991
2980
EXPLAIN SELECT * FROM t1
2992
2981
  WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ;
2993
 
--replace_column 9 #
2994
2982
EXPLAIN SELECT * FROM t1
2995
2983
  WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL;
2996
2984