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

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb_plugin/t/innodb_bug51378.test

  • 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
# This is the test for bug 51378. Unique index created
 
2
# through "create index" and "alter table add unique index"
 
3
# interfaces should not be treated as primary index if indexed
 
4
# columns contain one or more column prefix(es) (only prefix/part of
 
5
# the column is indexed)
 
6
# On the other hand, if there is a unique index covers all
 
7
# columns of a table, and they are non-null columns, and
 
8
# full length of the column are indexed, then this index
 
9
# will be created as primary index
 
10
# Following queries test various scenario, no mismatch
 
11
# error message should be printed.
 
12
-- source include/have_innodb_plugin.inc
 
13
 
 
14
# Create a table contains a BLOB column
 
15
create table bug51378 (
 
16
        col1 int not null,
 
17
        col2 blob not null,
 
18
        col3 time not null) engine = innodb;
 
19
 
 
20
# Create following unique indexes on 'col1' and 'col2(31)'
 
21
# of the table, the index should not be treated as primary
 
22
# key because it indexes only first 31 bytes of col2.
 
23
# Thus it contains "column prefix", and will not be
 
24
# upgraded to primary index.
 
25
# There should not be mismatch message printed in the
 
26
# errorlog
 
27
create unique index idx on bug51378(col1, col2(31));
 
28
 
 
29
alter table bug51378 add unique index idx2(col1, col2(31));
 
30
 
 
31
# Unique index on 'col1' and 'col3' will be created as primary index,
 
32
# since the index does not contain column prefix
 
33
create unique index idx3 on bug51378(col1, col3);
 
34
 
 
35
# Show create table would show idx3 created as unique index, internally,
 
36
# idx3 is treated as primary index both by MySQL and Innodb
 
37
SHOW CREATE TABLE bug51378;
 
38
 
 
39
# "GEN_CLUST_INDEX" will be re-created as default primary index
 
40
# after idx3 is dropped
 
41
drop index idx3 on bug51378;
 
42
 
 
43
SHOW CREATE TABLE bug51378;
 
44
 
 
45
# Or we can add the primary key through alter table interfaces
 
46
alter table bug51378 add primary key idx3(col1, col2(31));
 
47
 
 
48
SHOW CREATE TABLE bug51378;
 
49
 
 
50
drop table bug51378;
 
51
 
 
52
# Or we can create such primary key through create table interfaces
 
53
create table bug51378 (
 
54
        col1 int not null,
 
55
        col2 blob not null,
 
56
        col3 time not null, primary key(col1, col2(31))) engine = innodb;
 
57
 
 
58
# Unique index on one or more column prefix(es) will be created
 
59
# as non-cluster index
 
60
create unique index idx on bug51378(col1, col2(31));
 
61
 
 
62
SHOW CREATE TABLE bug51378;
 
63
 
 
64
drop table bug51378;
 
65
 
 
66
# If a table has a NULLABLE column, unique index on it will not
 
67
# be treated as primary index.
 
68
create table bug51378 (
 
69
        col1 int not null,
 
70
        col2 int ) engine = innodb;
 
71
 
 
72
# This will be created as non-cluster index since col2 is nullable
 
73
create unique index idx on bug51378(col1, col2);
 
74
 
 
75
SHOW CREATE TABLE bug51378;
 
76
 
 
77
drop table bug51378;