1
call mtr.add_suppression("Failed to write to mysql.general_log");
2
drop table if exists t1;
3
create table t1 (a int)
6
(partition p0 values in (null));
7
ERROR HY000: Engine cannot be used in partitioned tables
9
TRUNCATE TABLE general_log;
10
SET @old_general_log_state = @@global.general_log;
11
SET GLOBAL general_log = 0;
12
ALTER TABLE general_log ENGINE = MyISAM;
13
ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
14
(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
15
ERROR HY000: Incorrect usage of PARTITION and log table
16
ALTER TABLE general_log ENGINE = CSV;
17
SET GLOBAL general_log = @old_general_log_state;
20
# Bug#40281: partitioning the general log table crashes the server
22
# set up partitioned log, and switch to it
24
SET @old_general_log_state = @@global.general_log;
25
SET GLOBAL general_log = 0;
26
CREATE TABLE gl_partitioned LIKE general_log;
27
ALTER TABLE gl_partitioned ENGINE=myisam;
28
ALTER TABLE gl_partitioned PARTITION BY HASH (thread_id) PARTITIONS 10;
29
ALTER TABLE general_log RENAME TO gl_nonpartitioned;
30
ALTER TABLE gl_partitioned RENAME TO general_log;
31
SELECT @@global.log_output INTO @old_glo;
32
SET GLOBAL log_output='table';
33
SET GLOBAL general_log =1;
34
# do some things to be logged to partitioned log, should fail
36
CREATE TABLE t1 (i INT);
37
INSERT INTO t1 VALUES (1);
42
SET GLOBAL general_log =0;
43
ALTER TABLE general_log RENAME TO gl_partitioned;
44
ALTER TABLE gl_nonpartitioned RENAME TO general_log;
45
# show whether we actually logged anything (no) to general_log
46
SELECT COUNT(argument) FROM gl_partitioned;
49
DROP TABLE gl_partitioned;
50
SET GLOBAL log_output = @old_glo;
51
SET GLOBAL general_log = 1;
54
SET GLOBAL general_log = @old_general_log_state;