mysqlbinlog_row_big.result 2.42 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#
# Preparatory cleanup.
#
DROP TABLE IF EXISTS t1;
#
# We need a fixed timestamp to avoid varying results.
#
SET timestamp=1000000000;
#
# We need big packets.
#
12 13
# Capture initial value to reset at the end of the test
# Now adjust max_allowed_packet
Alfranio Correia's avatar
Alfranio Correia committed
14
SET @@global.max_allowed_packet= 1024*1024*1024;
15 16 17 18 19 20 21 22
max_allowed_packet is a global variable.
In order for the preceding change in max_allowed_packets' value
to be seen and used, we must start a new connection.
The change does not take effect with the current one.
For simplicity, we just disconnect / reconnect connection default here.
Disconnecting default connection...
Reconnecting default connection...
default connection established, continuing with the test
23 24 25 26 27 28 29 30 31 32 33
#
# Delete all existing binary logs.
#
RESET MASTER;
#
# Create a test table.
#
CREATE TABLE t1 (
c1 LONGTEXT
) ENGINE=MyISAM DEFAULT CHARSET latin1;
#
34
# Show how many rows are affected by each statement.
35 36
#
#
37
# Insert some big rows.
38
#
39 40 41 42
256MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
affected rows: 1
32MB
43 44
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
affected rows: 1
45 46 47 48 49 50
4MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 262144));
affected rows: 1
512KB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 32768));
affected rows: 1
51 52 53 54 55
#
# Show what we have in the table.
# Do not display the column value itself, just its length.
#
SELECT LENGTH(c1) FROM t1;
56
LENGTH(c1)	268435456
57
LENGTH(c1)	33554432
58 59 60
LENGTH(c1)	4194304
LENGTH(c1)	524288
affected rows: 4
61
#
62
# Grow the rows by updating.
63 64
#
UPDATE t1 SET c1 = CONCAT(c1, c1);
65 66
affected rows: 4
info: Rows matched: 4  Changed: 4  Warnings: 0
67 68 69 70 71
#
# Show what we have in the table.
# Do not display the column value itself, just its length.
#
SELECT LENGTH(c1) FROM t1;
72 73
LENGTH(c1)	536870912
LENGTH(c1)	1048576
74
LENGTH(c1)	67108864
75 76
LENGTH(c1)	8388608
affected rows: 4
77
#
78
# Delete the rows.
79 80
#
DELETE FROM t1 WHERE c1 >= 'ManyMegaByteBlck';
81
affected rows: 4
82
#
83
# Hide how many rows are affected by each statement.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
#
#
# Flush all log buffers to the log file.
#
FLUSH LOGS;
#
# Call mysqlbinlog to display the log file contents.
# NOTE: The output of mysqlbinlog is redirected to
#       $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out
#       If you want to examine it, disable remove_file
#       at the bottom of the test script.
#
#
# Cleanup.
#
99 100
# reset variable value to pass testcase checks
SET @@global.max_allowed_packet = 1048576;
101 102
DROP TABLE t1;
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out