~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/select.test

  • Committer: Paul McCullagh
  • Date: 2008-10-09 20:02:10 UTC
  • mto: (499.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 505.
  • Revision ID: paul.mccullagh@primebase.org-20081009200210-bibbmfemeaekqow0
Changes to .test files to run both PBXT and InnoDB

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