~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/subselect3.test

  • Committer: Daniel Nichter
  • Date: 2011-10-23 16:01:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2448.
  • Revision ID: daniel@percona.com-20111023160137-7ac3blgz8z4tf8za
Add Administration Getting Started and Logging.  Capitalize SQL clause keywords.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
insert into t3 values (NULL), (NULL);
57
57
flush status;
58
58
select a in (select max(ie) from t1 where oref=4 group by grp) from t3;
 
59
--replace_column 2 #
59
60
show status like 'Handler_read_rnd_next';
60
61
select ' ^ This must show 11' Z;
61
62
 
88
89
flush status;
89
90
select oref, a from t2 where a in (select a from t1 where oref=t2.oref);
90
91
# This will only show access to t2:
 
92
--replace_column 2 #
91
93
show status like '%Handler_read_rnd_next';
92
94
 
93
95
# Check that repeated NULL-scans are not cached (subq. is not correlated):
96
98
 
97
99
flush status;
98
100
select oref, a, a in (select a from t1 where oref=t2.oref) Z from t2;
 
101
--replace_column 2 #
99
102
show status like '%Handler_read%';
100
103
select 'No key lookups, seq reads: 29= 5 reads from t2 + 4 * 6 reads from t1.' Z;
101
104
 
222
225
 
223
226
# Then check that we do turn off 'ref' scans in the subquery
224
227
create table t4 (x int);
225
 
insert into t4 select A.a + 10*B.a from t1 A, t1 B;
 
228
insert into t4 select A.a + 10*B.a from t1 A CROSS JOIN t1 B;
226
229
explain extended 
227
230
  select a,b, oref, 
228
231
         (a,b) in (select a,b from t1,t4 where c=t2.oref) Z 
615
618
 
616
619
create table t1 (a int, b decimal(13, 3)); 
617
620
insert into t1 values (1, 0.123);
618
 
select a, (select max(b) from t1) into outfile "subselect.out.file.1" from t1;
 
621
system rm -f $DRIZZLETEST_VARDIR/subselect.out.file.1;
 
622
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
623
eval select a, (select max(b) from t1) into outfile "$DRIZZLETEST_VARDIR/subselect.out.file.1" from t1;
619
624
delete from t1;
620
 
load data infile "subselect.out.file.1" into table t1;
 
625
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
626
eval load data infile "$DRIZZLETEST_VARDIR/subselect.out.file.1" into table t1;
621
627
select * from t1;
622
628
drop table t1;
623
629