~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/r/partition_range.result

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120222223355-or06x1euyk8n0ldi
Tags: 5.1.61-0ubuntu0.10.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496
* Dropped patches unnecessary with 5.1.61:
  - debian/patches/90_mysql_safer_strmov.dpatch
  - debian/patches/51_ssl_test_certs.dpatch
  - debian/patches/52_CVE-2009-4030.dpatch
  - debian/patches/53_CVE-2009-4484.dpatch
  - debian/patches/54_CVE-2008-7247.dpatch
  - debian/patches/55_CVE-2010-1621.dpatch
  - debian/patches/56_CVE-2010-1850.dpatch
  - debian/patches/57_CVE-2010-1849.dpatch
  - debian/patches/58_CVE-2010-1848.dpatch
  - debian/patches/59_CVE-2010-1626.dpatch
  - debian/patches/60_CVE-2010-2008.dpatch
  - debian/patches/60_CVE-2010-3677.dpatch
  - debian/patches/60_CVE-2010-3678.dpatch
  - debian/patches/60_CVE-2010-3679.dpatch
  - debian/patches/60_CVE-2010-3680.dpatch
  - debian/patches/60_CVE-2010-3681.dpatch
  - debian/patches/60_CVE-2010-3682.dpatch
  - debian/patches/60_CVE-2010-3683.dpatch
  - debian/patches/60_CVE-2010-3833.dpatch
  - debian/patches/60_CVE-2010-3834.dpatch
  - debian/patches/60_CVE-2010-3835.dpatch
  - debian/patches/60_CVE-2010-3836.dpatch
  - debian/patches/60_CVE-2010-3837.dpatch
  - debian/patches/60_CVE-2010-3838.dpatch
  - debian/patches/60_CVE-2010-3839.dpatch
  - debian/patches/60_CVE-2010-3840.dpatch
  - debian/patches/61_disable_longfilename_test.dpatch
  - debian/patches/62_alter_table_fix.dpatch
  - debian/patches/63_cherrypick-upstream-49479.dpatch
  - debian/patches/10_readline_build_fix.dpatch
* debian/mysql-client-5.1.docs: removed EXCEPTIONS-CLIENT file
* debian/mysql-server-5.1.docs,debian/libmysqlclient16.docs,
  debian/libmysqlclient-dev.docs: removed, no longer necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
drop table if exists t1, t2;
 
2
#
 
3
# Bug#48229: group by performance issue of partitioned table
 
4
#
 
5
CREATE TABLE t1 (
 
6
a INT,
 
7
b INT,
 
8
KEY a (a,b)
 
9
)
 
10
PARTITION BY HASH (a) PARTITIONS 1;
 
11
INSERT INTO t1 VALUES (0, 580092), (3, 894076), (4, 805483), (4, 913540), (6, 611137), (8, 171602), (9, 599495), (9, 746305), (10, 272829), (10, 847519), (12, 258869), (12, 929028), (13, 288970), (15, 20971), (15, 105839), (16, 788272), (17, 76914), (18, 827274), (19, 802258), (20, 123677), (20, 587729), (22, 701449), (25, 31565), (25, 230782), (25, 442887), (25, 733139), (25, 851020);
 
12
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100, 3) GROUP BY a;
 
13
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
14
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
 
15
DROP TABLE t1;
2
16
create table t1 (a int)
3
17
partition by range (a)
4
18
( partition p0 values less than (maxvalue));
59
73
1       SIMPLE  t1      pnull   system  NULL    NULL    NULL    NULL    1       
60
74
explain partitions select * from t1 where a >= 0;
61
75
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
62
 
1       SIMPLE  t1      p0,p1   ALL     NULL    NULL    NULL    NULL    3       Using where
 
76
1       SIMPLE  t1      p0,p1   ALL     NULL    NULL    NULL    NULL    2       Using where
63
77
explain partitions select * from t1 where a < 0;
64
78
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
65
79
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE noticed after reading const tables
66
80
explain partitions select * from t1 where a <= 0;
67
81
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
68
 
1       SIMPLE  t1      pnull,p0        ALL     NULL    NULL    NULL    NULL    3       Using where
 
82
1       SIMPLE  t1      pnull,p0        ALL     NULL    NULL    NULL    NULL    2       Using where
69
83
explain partitions select * from t1 where a > 1;
70
84
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
71
85
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE noticed after reading const tables
98
112
a       b
99
113
explain partitions select * from t1 where a is null;
100
114
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
101
 
1       SIMPLE  t1      pnull_pnullsp0,pnull_pnullsp1   ALL     NULL    NULL    NULL    NULL    6       Using where
 
115
1       SIMPLE  t1      pnull_pnullsp0,pnull_pnullsp1   ALL     NULL    NULL    NULL    NULL    2       Using where
102
116
explain partitions select * from t1 where a >= 0;
103
117
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
104
 
1       SIMPLE  t1      p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1     ALL     NULL    NULL    NULL    NULL    6       Using where
 
118
1       SIMPLE  t1      p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1     ALL     NULL    NULL    NULL    NULL    4       Using where
105
119
explain partitions select * from t1 where a < 0;
106
120
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
107
 
1       SIMPLE  t1      pnull_pnullsp0,pnull_pnullsp1   ALL     NULL    NULL    NULL    NULL    6       Using where
 
121
1       SIMPLE  t1      pnull_pnullsp0,pnull_pnullsp1   ALL     NULL    NULL    NULL    NULL    2       Using where
108
122
explain partitions select * from t1 where a <= 0;
109
123
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
110
 
1       SIMPLE  t1      pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL     NULL    NULL    NULL    NULL    6       Using where
 
124
1       SIMPLE  t1      pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL     NULL    NULL    NULL    NULL    4       Using where
111
125
explain partitions select * from t1 where a > 1;
112
126
id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
113
127
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE noticed after reading const tables
794
808
sum(count)
795
809
579
796
810
drop table t1, t2;
 
811
#
 
812
# Bug#50939: Loose Index Scan unduly relies on engine to remember range 
 
813
# endpoints
 
814
#
 
815
CREATE TABLE t1 (
 
816
a INT,
 
817
b INT,
 
818
KEY ( a, b )
 
819
) PARTITION BY HASH (a) PARTITIONS 1;
 
820
CREATE TABLE t2 (
 
821
a INT,
 
822
b INT,
 
823
KEY ( a, b )
 
824
);
 
825
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
 
826
INSERT INTO t1 SELECT a +  5, b +  5 FROM t1;
 
827
INSERT INTO t1 SELECT a + 10, b + 10 FROM t1;
 
828
INSERT INTO t1 SELECT a + 20, b + 20 FROM t1;
 
829
INSERT INTO t1 SELECT a + 40, b + 40 FROM t1;
 
830
INSERT INTO t2 SELECT * FROM t1;
 
831
# plans should be identical
 
832
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a;
 
833
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
834
1       SIMPLE  t1      range   a       a       5       NULL    1       Using where; Using index for group-by
 
835
EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
 
836
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
837
1       SIMPLE  t2      range   a       a       5       NULL    2       Using where; Using index for group-by
 
838
FLUSH status;
 
839
SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a;
 
840
a       MAX(b)
 
841
10      10
 
842
# Should be no more than 4 reads.
 
843
SHOW status LIKE 'handler_read_key';
 
844
Variable_name   Value
 
845
Handler_read_key        4
 
846
FLUSH status;
 
847
SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a;
 
848
a       MAX(b)
 
849
10      10
 
850
# Should be no more than 4 reads.
 
851
SHOW status LIKE 'handler_read_key';
 
852
Variable_name   Value
 
853
Handler_read_key        4
 
854
DROP TABLE t1, t2;