~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--disable_abort_on_error
 
2
# Run this test only when mysqld don't has partitioning (not compiled with)
 
3
# the statements are not expected to work, just check that we
 
4
# can't crash the server
 
5
-- require r/not_partition.require
 
6
disable_query_log;
 
7
show variables like "have_partitioning";
 
8
enable_query_log;
 
9
--disable_warnings
 
10
DROP TABLE IF EXISTS t1;
 
11
--enable_warnings
 
12
let $MYSQLD_DATADIR= `SELECT @@datadir`;
 
13
 
 
14
#
 
15
# Bug#39893: Crash if select on a partitioned table,
 
16
#            when partitioning is disabled
 
17
FLUSH TABLES;
 
18
--copy_file $MYSQLTEST_VARDIR/std_data/parts/t1.frm $MYSQLD_DATADIR/test/t1.frm
 
19
SELECT * FROM t1;
 
20
TRUNCATE TABLE t1;
 
21
ANALYZE TABLE t1;
 
22
CHECK TABLE t1;
 
23
OPTIMIZE TABLE t1;
 
24
REPAIR TABLE t1;
 
25
ALTER TABLE t1 REPAIR PARTITION ALL;
 
26
ALTER TABLE t1 CHECK PARTITION ALL;
 
27
ALTER TABLE t1 OPTIMIZE PARTITION ALL;
 
28
ALTER TABLE t1 ANALYZE PARTITION ALL;
 
29
ALTER TABLE t1 REBUILD PARTITION ALL;
 
30
ALTER TABLE t1 ENGINE Memory;
 
31
ALTER TABLE t1 ADD (new INT);
 
32
DROP TABLE t1;
 
33
 
 
34
--error ER_FEATURE_DISABLED
 
35
CREATE TABLE t1 (
 
36
    firstname VARCHAR(25) NOT NULL,
 
37
    lastname VARCHAR(25) NOT NULL,
 
38
    username VARCHAR(16) NOT NULL,
 
39
    email VARCHAR(35),
 
40
    joined DATE NOT NULL
 
41
)
 
42
PARTITION BY KEY(joined)
 
43
PARTITIONS 6;
 
44
 
 
45
--error ER_FEATURE_DISABLED
 
46
ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2;
 
47
 
 
48
--error ER_BAD_TABLE_ERROR
 
49
drop table t1;
 
50
 
 
51
--error ER_FEATURE_DISABLED
 
52
CREATE TABLE t1 (
 
53
    firstname VARCHAR(25) NOT NULL,
 
54
    lastname VARCHAR(25) NOT NULL,
 
55
    username VARCHAR(16) NOT NULL,
 
56
    email VARCHAR(35),
 
57
    joined DATE NOT NULL
 
58
)
 
59
PARTITION BY RANGE( YEAR(joined) ) (
 
60
    PARTITION p0 VALUES LESS THAN (1960),
 
61
    PARTITION p1 VALUES LESS THAN (1970),
 
62
    PARTITION p2 VALUES LESS THAN (1980),
 
63
    PARTITION p3 VALUES LESS THAN (1990),
 
64
    PARTITION p4 VALUES LESS THAN MAXVALUE
 
65
);
 
66
--error ER_BAD_TABLE_ERROR
 
67
drop table t1;
 
68
 
 
69
--error ER_FEATURE_DISABLED
 
70
CREATE TABLE t1 (id INT, purchased DATE)
 
71
    PARTITION BY RANGE( YEAR(purchased) )
 
72
    SUBPARTITION BY HASH( TO_DAYS(purchased) )
 
73
    SUBPARTITIONS 2 (
 
74
        PARTITION p0 VALUES LESS THAN (1990),
 
75
        PARTITION p1 VALUES LESS THAN (2000),
 
76
        PARTITION p2 VALUES LESS THAN MAXVALUE
 
77
    );
 
78
--error ER_BAD_TABLE_ERROR
 
79
drop table t1;
 
80
 
 
81
# Create a table without partitions to test "EXPLAIN PARTITIONS"
 
82
create table t1 (a varchar(10) charset latin1 collate latin1_bin);
 
83
insert into t1 values (''),(' '),('a'),('a '),('a  ');
 
84
explain partitions select * from t1 where a='a ' OR a='a';
 
85
drop table t1;