~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysql-test/t/partition_range.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
846
846
select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid;
847
847
drop table t1, t2;
848
848
 
 
849
 
 
850
--echo #
 
851
--echo # Bug#50939: Loose Index Scan unduly relies on engine to remember range 
 
852
--echo # endpoints
 
853
--echo #
 
854
CREATE TABLE t1 (
 
855
 a INT,
 
856
 b INT,
 
857
 KEY ( a, b )
 
858
) PARTITION BY HASH (a) PARTITIONS 1;
 
859
 
 
860
CREATE TABLE t2 (
 
861
 a INT,
 
862
 b INT,
 
863
 KEY ( a, b )
 
864
);
 
865
 
 
866
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
 
867
 
 
868
INSERT INTO t1 SELECT a +  5, b +  5 FROM t1;
 
869
INSERT INTO t1 SELECT a + 10, b + 10 FROM t1;
 
870
INSERT INTO t1 SELECT a + 20, b + 20 FROM t1;
 
871
INSERT INTO t1 SELECT a + 40, b + 40 FROM t1;
 
872
 
 
873
INSERT INTO t2 SELECT * FROM t1;
 
874
 
 
875
--echo # plans should be identical
 
876
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a;
 
877
EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
 
878
 
 
879
FLUSH status;
 
880
SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a;
 
881
--echo # Should be no more than 4 reads.
 
882
SHOW status LIKE 'handler_read_key';
 
883
 
 
884
FLUSH status;
 
885
SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a;
 
886
--echo # Should be no more than 4 reads.
 
887
SHOW status LIKE 'handler_read_key';
 
888
 
 
889
DROP TABLE t1, t2;