Debian Codegraph @

mysql-test/suite/encryption/t/tempfiles.test

raw
1 #
2 # Various test cases for IO_CACHE tempfiles (file==-1) encryption
3 #
4 source include/have_file_key_management_plugin.inc;
5 source include/have_sequence.inc;
6
7 # Row binlog format to fill binlog cache faster
8 source include/have_binlog_format_row.inc;
9
10 source include/have_innodb.inc;
11
12 select @@encrypt_tmp_files;
13
14 #
15 # MyISAM messing around with IO_CACHE::file
16 #
17 CREATE TABLE t1(a INT);
18 INSERT INTO t1 VALUES(1),(2);
19 DELETE FROM t1 WHERE a=1;
20 OPTIMIZE TABLE t1;
21 CHECK TABLE t1;
22 DROP TABLE t1;
23
24 #
25 # filesort, my_b_pread, seeks in READ_CACHE
26 #
27 create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
28 insert into t1 (v) select concat(char(ascii('a')+s2.seq),repeat(' ',s1.seq))
29 from seq_0_to_9 as s1, seq_0_to_26 as s2;
30 update t1 set c=v, t=v;
31 select sql_big_result t,count(t) from t1 group by t limit 10;
32 drop table t1;
33
34 reset master;
35 set @save_binlog_cache_size=@@global.binlog_cache_size;
36 set global binlog_cache_size=8192;
37
38 connect con1, localhost, root;
39
40 #
41 # Test the last half-filled block:
42 # first write 3 blocks, then reinit the file and write one full and one
43 # partial block. reading the second time must stop in the middle of the
44 # second block, and NOT read till EOF.
45 #
46 create table t1 (a text) engine=innodb;
47 start transaction;
48 insert t1 select repeat(seq, 1000) from seq_1_to_15;
49 commit;
50 start transaction;
51 insert t1 select repeat(seq, 1000) from seq_1_to_8;
52 commit;
53
54 disconnect con1;
55 connect con2, localhost, root;
56
57 #
58 # Test reinit_io_cache(WRITE_CACHE) with non-zero seek_offset:
59 # Start a transaction, write until the cache goes to disk,
60 # create a savepoint, write more blocks to disk, rollback to savepoint.
61 #
62 create table t2 (a text) engine=innodb;
63 start transaction;
64 insert t2 select repeat(seq, 1000) from seq_1_to_15;
65 savepoint foo;
66 insert t2 select repeat(seq, 1000) from seq_16_to_30;
67 rollback to savepoint foo;
68 insert t2 select repeat(seq, 1000) from seq_31_to_40;
69 commit;
70
71 disconnect con2;
72 connection default;
73
74 flush binary logs;
75
76 drop table t1, t2;
77
78 set @@global.binlog_cache_size=@save_binlog_cache_size;
79
80 let $MYSQLD_DATADIR= `select @@datadir`;
81 exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL;
82
83 select left(a, 10) from t1;
84 select left(a, 10) from t2;
85 drop table t1, t2;