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

« back to all changes in this revision

Viewing changes to mysql-test/t/partition_csv.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
# Tests for the partition storage engine in connection with the
 
2
# storage engine CSV.
 
3
#
 
4
# Creation:
 
5
# 2007-10-18 mleich  - Move CSV related sub tests of partition.test to
 
6
#                      this test. Reason: CSV is not everytime available.
 
7
#                    - Minor cleanup
 
8
#
 
9
 
 
10
--source include/have_partition.inc
 
11
--source include/have_csv.inc
 
12
 
 
13
call mtr.add_suppression("Failed to write to mysql.general_log");
 
14
 
 
15
#
 
16
# Bug#19307: Partitions: csv delete failure
 
17
#            = CSV engine crashes
 
18
#
 
19
--disable_warnings
 
20
drop table if exists t1;
 
21
--enable_warnings
 
22
--error ER_PARTITION_MERGE_ERROR
 
23
create table t1 (a int)
 
24
engine = csv
 
25
partition by list (a)
 
26
(partition p0 values in (null));
 
27
 
 
28
#
 
29
# Bug #27816: Log tables ran with partitions crashes the server when logging
 
30
#             is enabled.
 
31
#
 
32
 
 
33
USE mysql;
 
34
TRUNCATE TABLE general_log;
 
35
SET @old_general_log_state = @@global.general_log;
 
36
SET GLOBAL general_log = 0;
 
37
ALTER TABLE general_log ENGINE = MyISAM;
 
38
--error ER_WRONG_USAGE
 
39
ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
 
40
  (PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
 
41
ALTER TABLE general_log ENGINE = CSV;
 
42
SET GLOBAL general_log = @old_general_log_state;
 
43
use test;
 
44
 
 
45
--echo #
 
46
--echo # Bug#40281: partitioning the general log table crashes the server
 
47
--echo #
 
48
 
 
49
--echo # set up partitioned log, and switch to it
 
50
 
 
51
USE mysql;
 
52
SET @old_general_log_state = @@global.general_log;
 
53
SET GLOBAL general_log = 0;
 
54
CREATE TABLE gl_partitioned LIKE general_log;
 
55
ALTER TABLE gl_partitioned ENGINE=myisam;
 
56
ALTER TABLE gl_partitioned PARTITION BY HASH (thread_id) PARTITIONS 10;
 
57
ALTER TABLE general_log RENAME TO gl_nonpartitioned;
 
58
ALTER TABLE gl_partitioned RENAME TO general_log;
 
59
 
 
60
SELECT @@global.log_output INTO @old_glo;
 
61
SET GLOBAL log_output='table';
 
62
SET GLOBAL general_log =1;
 
63
 
 
64
--echo # do some things to be logged to partitioned log, should fail
 
65
USE /* 1 */ test;
 
66
 
 
67
CREATE TABLE t1 (i INT);
 
68
 
 
69
connect (con1,localhost,root,,);
 
70
INSERT INTO t1 VALUES (1);
 
71
SELECT * FROM t1;
 
72
disconnect con1;
 
73
 
 
74
connection default;
 
75
USE mysql;
 
76
SET GLOBAL general_log =0;
 
77
ALTER TABLE general_log RENAME TO gl_partitioned;
 
78
ALTER TABLE gl_nonpartitioned RENAME TO general_log;
 
79
 
 
80
--echo # show whether we actually logged anything (no) to general_log
 
81
SELECT COUNT(argument) FROM gl_partitioned;
 
82
 
 
83
DROP TABLE gl_partitioned;
 
84
 
 
85
SET GLOBAL log_output = @old_glo;
 
86
SET GLOBAL general_log = 1;
 
87
 
 
88
USE /* 2 */ test;
 
89
DROP TABLE t1;
 
90
 
 
91
SET GLOBAL general_log = @old_general_log_state;
 
92
 
 
93
--echo End of 5.1 tests