mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / t / mysqlbinlog_row_big.test
blobffd1b79af3406366656357b32f1aee32910ef9c5
1 # mysqlbinlog_big.test
3 # Show that mysqlbinlog can handle big rows.
7 # The *huge* output of mysqlbinlog will be redirected to
8 # $MYSQLTEST_VARDIR/$mysqlbinlog_output
10 --let $mysqlbinlog_output= tmp/mysqlbinlog_big_1.out
12 #--source include/have_myisam.inc
13 --let $engine_type= MyISAM
16 # This test case is insensitive to the binlog format
17 # because we don't display the output of mysqlbinlog.
19 #--source include/have_binlog_format_row.inc
21 --source include/have_log_bin.inc
23 # This is a big test.
24 --source include/big_test.inc
26 --echo #
27 --echo # Preparatory cleanup.
28 --echo #
29 --disable_warnings
30 DROP TABLE IF EXISTS t1;
31 --enable_warnings
33 --echo #
34 --echo # We need a fixed timestamp to avoid varying results.
35 --echo #
36 SET timestamp=1000000000;
38 --echo #
39 --echo # We need big packets.
40 --echo #
41 --echo # Capture initial value to reset at the end of the test
42 # use let $<var> = query_get_value as FLUSH statements
43 # in the test will set @<var> values to NULL
44 let $orig_max_allowed_packet = 
45 query_get_value(SELECT @@global.max_allowed_packet, @@global.max_allowed_packet, 1);
47 --echo # Now adjust max_allowed_packet
48 SET @@global.max_allowed_packet= 1024*1024*1024;
50 --echo max_allowed_packet is a global variable.
51 --echo In order for the preceding change in max_allowed_packets' value
52 --echo to be seen and used, we must start a new connection.
53 --echo The change does not take effect with the current one.
54 --echo For simplicity, we just disconnect / reconnect connection default here.
55 --echo Disconnecting default connection...
56 disconnect default;
57 --echo Reconnecting default connection...
58 connect (default, localhost,root,,);
59 --echo default connection established, continuing with the test
61 --echo #
62 --echo # Delete all existing binary logs.
63 --echo #
64 RESET MASTER;
66 --echo #
67 --echo # Create a test table.
68 --echo #
69 eval CREATE TABLE t1 (
70   c1 LONGTEXT
71   ) ENGINE=$engine_type DEFAULT CHARSET latin1;
73 --echo #
74 --echo # Show how many rows are affected by each statement.
75 --echo #
76 --enable_info
78 --echo #
79 --echo # Insert some big rows.
80 --echo #
82 --echo 64MB
83 INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 4194304));
85 --echo 32MB
86 INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
88 --echo 4MB
89 INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 262144));
91 --echo 512KB
92 INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 32768));
94 --echo #
95 --echo # Show what we have in the table.
96 --echo # Do not display the column value itself, just its length.
97 --echo #
98 --sorted_result
99 query_vertical SELECT LENGTH(c1) FROM t1;
101 --echo #
102 --echo # Grow the rows by updating.
103 --echo #
104 UPDATE t1 SET c1 = CONCAT(c1, c1);
106 --echo #
107 --echo # Show what we have in the table.
108 --echo # Do not display the column value itself, just its length.
109 --echo #
110 --sorted_result
111 query_vertical SELECT LENGTH(c1) FROM t1;
113 --echo #
114 --echo # Delete the rows.
115 --echo #
116 DELETE FROM t1 WHERE c1 >= 'ManyMegaByteBlck';
118 --echo #
119 --echo # Hide how many rows are affected by each statement.
120 --echo #
121 --disable_info
123 --echo #
124 --echo # Flush all log buffers to the log file.
125 --echo #
126 FLUSH LOGS;
128 --echo #
129 --echo # Call mysqlbinlog to display the log file contents.
130 --echo # NOTE: The output of mysqlbinlog is redirected to
131 --echo #       \$MYSQLTEST_VARDIR/$mysqlbinlog_output
132 --echo #       If you want to examine it, disable remove_file
133 --echo #       at the bottom of the test script.
134 --echo #
135 let $MYSQLD_DATADIR= `select @@datadir`;
136 --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
137 --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/
138 --exec $MYSQL_BINLOG -v -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output
140 --echo #
141 --echo # Cleanup.
142 --echo #
143 --echo # reset variable value to pass testcase checks
144 eval SET @@global.max_allowed_packet = $orig_max_allowed_packet;
145 DROP TABLE t1;
147 --echo remove_file \$MYSQLTEST_VARDIR/$mysqlbinlog_output
149 # NOTE: If you want to see the *huge* mysqlbinlog output, disable next line:
151 --remove_file $MYSQLTEST_VARDIR/$mysqlbinlog_output