| 1 |
# |
| 2 |
# Preparatory cleanup. |
| 3 |
# |
| 4 |
drop database if exists mysqltest; |
| 5 |
create database mysqltest; |
| 6 |
use mysqltest; |
| 7 |
DROP TABLE IF EXISTS t1; |
| 8 |
# |
| 9 |
# We need a fixed timestamp to avoid varying results. |
| 10 |
# |
| 11 |
SET timestamp=1000000000; |
| 12 |
# |
| 13 |
# We need big packets. |
| 14 |
# |
| 15 |
# Capture initial value to reset at the end of the test |
| 16 |
# Now adjust max_allowed_packet |
| 17 |
SET @@global.max_allowed_packet= 10*1024*1024*1024; |
| 18 |
Warnings: |
| 19 |
Warning 1292 Truncated incorrect max_allowed_packet value: '10737418240' |
| 20 |
max_allowed_packet is a global variable. |
| 21 |
In order for the preceding change in max_allowed_packets' value |
| 22 |
to be seen and used, we must start a new connection. |
| 23 |
The change does not take effect with the current one. |
| 24 |
For simplicity, we just disconnect / reconnect connection default here. |
| 25 |
disconnect default; |
| 26 |
connect default, localhost,root,,; |
| 27 |
# |
| 28 |
# Delete all existing binary logs. |
| 29 |
# |
| 30 |
RESET MASTER; |
| 31 |
# |
| 32 |
# Create a test table. |
| 33 |
# |
| 34 |
use mysqltest; |
| 35 |
CREATE TABLE t1 ( |
| 36 |
c1 LONGTEXT |
| 37 |
) DEFAULT CHARSET latin1; |
| 38 |
# |
| 39 |
# Show how many rows are affected by each statement. |
| 40 |
# |
| 41 |
# |
| 42 |
# Insert some big rows. |
| 43 |
# |
| 44 |
insert 1024MB data twice |
| 45 |
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 67108864)); |
| 46 |
affected rows: 1 |
| 47 |
INSERT INTO t1 VALUES (REPEAT('MegaByteBlckMany', 67108864)); |
| 48 |
affected rows: 1 |
| 49 |
# |
| 50 |
# Flush all log buffers to the log file. |
| 51 |
# |
| 52 |
FLUSH LOGS; |
| 53 |
affected rows: 0 |
| 54 |
# |
| 55 |
# Call mysqlbinlog to display the log file contents. |
| 56 |
# NOTE: The output of mysqlbinlog is redirected to |
| 57 |
# $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out |
| 58 |
# If you want to examine it, disable remove_file |
| 59 |
# at the bottom of the test script. |
| 60 |
# |
| 61 |
# |
| 62 |
# Cleanup. |
| 63 |
# |
| 64 |
# reset variable value to pass testcase checks |
| 65 |
affected rows: 0 |
| 66 |
DROP TABLE t1; |
| 67 |
affected rows: 0 |
| 68 |
drop database if exists mysqltest; |
| 69 |
affected rows: 0 |
| 70 |
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out |