1
# Tests for the partition storage engine in connection with the
5
# 2007-10-18 mleich - Move CSV related sub tests of partition.test to
6
# this test. Reason: CSV is not everytime available.
10
--source include/have_partition.inc
11
--source include/have_csv.inc
13
call mtr.add_suppression("Failed to write to mysql.general_log");
16
# Bug#19307: Partitions: csv delete failure
17
# = CSV engine crashes
20
drop table if exists t1;
22
--error ER_PARTITION_MERGE_ERROR
23
create table t1 (a int)
26
(partition p0 values in (null));
29
# Bug #27816: Log tables ran with partitions crashes the server when logging
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;
46
--echo # Bug#40281: partitioning the general log table crashes the server
49
--echo # set up partitioned log, and switch to it
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;
60
SELECT @@global.log_output INTO @old_glo;
61
SET GLOBAL log_output='table';
62
SET GLOBAL general_log =1;
64
--echo # do some things to be logged to partitioned log, should fail
67
CREATE TABLE t1 (i INT);
69
connect (con1,localhost,root,,);
70
INSERT INTO t1 VALUES (1);
76
SET GLOBAL general_log =0;
77
ALTER TABLE general_log RENAME TO gl_partitioned;
78
ALTER TABLE gl_nonpartitioned RENAME TO general_log;
80
--echo # show whether we actually logged anything (no) to general_log
81
SELECT COUNT(argument) FROM gl_partitioned;
83
DROP TABLE gl_partitioned;
85
SET GLOBAL log_output = @old_glo;
86
SET GLOBAL general_log = 1;
91
SET GLOBAL general_log = @old_general_log_state;
93
--echo End of 5.1 tests