mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
Bug#43716: Test mysqlbinlog_row_big is failing, needs to be updated
Altered the test to accommodate the new behavior of max_allowed_packet. Had to disconnect / reconnect the default connection for the new value to register. Re-enabled certain parts of the test that were commented out and added some setup / cleanup code to ensure proper reset of max_allowed_packet at the end of the test. Re-recorded the .result file to account for changes to the test.
This commit is contained in:
parent
ff9803acea
commit
05c9b0c396
2 changed files with 77 additions and 27 deletions
|
@ -9,7 +9,17 @@ SET timestamp=1000000000;
|
||||||
#
|
#
|
||||||
# We need big packets.
|
# We need big packets.
|
||||||
#
|
#
|
||||||
|
# Capture initial value to reset at the end of the test
|
||||||
|
# Now adjust max_allowed_packet
|
||||||
SET @@global.max_allowed_packet= 1024*1024*1024;
|
SET @@global.max_allowed_packet= 1024*1024*1024;
|
||||||
|
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
|
||||||
#
|
#
|
||||||
# Delete all existing binary logs.
|
# Delete all existing binary logs.
|
||||||
#
|
#
|
||||||
|
@ -21,40 +31,56 @@ CREATE TABLE t1 (
|
||||||
c1 LONGTEXT
|
c1 LONGTEXT
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET latin1;
|
) ENGINE=MyISAM DEFAULT CHARSET latin1;
|
||||||
#
|
#
|
||||||
# Show how much rows are affected by each statement.
|
# Show how many rows are affected by each statement.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Insert a big row.
|
# Insert some big rows.
|
||||||
#
|
#
|
||||||
|
256MB
|
||||||
|
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
|
||||||
|
affected rows: 1
|
||||||
|
32MB
|
||||||
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
|
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
|
||||||
affected rows: 1
|
affected rows: 1
|
||||||
|
4MB
|
||||||
|
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 262144));
|
||||||
|
affected rows: 1
|
||||||
|
512KB
|
||||||
|
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 32768));
|
||||||
|
affected rows: 1
|
||||||
#
|
#
|
||||||
# Show what we have in the table.
|
# Show what we have in the table.
|
||||||
# Do not display the column value itself, just its length.
|
# Do not display the column value itself, just its length.
|
||||||
#
|
#
|
||||||
SELECT LENGTH(c1) FROM t1;
|
SELECT LENGTH(c1) FROM t1;
|
||||||
|
LENGTH(c1) 268435456
|
||||||
LENGTH(c1) 33554432
|
LENGTH(c1) 33554432
|
||||||
affected rows: 1
|
LENGTH(c1) 4194304
|
||||||
|
LENGTH(c1) 524288
|
||||||
|
affected rows: 4
|
||||||
#
|
#
|
||||||
# Grow the row by updating.
|
# Grow the rows by updating.
|
||||||
#
|
#
|
||||||
UPDATE t1 SET c1 = CONCAT(c1, c1);
|
UPDATE t1 SET c1 = CONCAT(c1, c1);
|
||||||
affected rows: 1
|
affected rows: 4
|
||||||
info: Rows matched: 1 Changed: 1 Warnings: 0
|
info: Rows matched: 4 Changed: 4 Warnings: 0
|
||||||
#
|
#
|
||||||
# Show what we have in the table.
|
# Show what we have in the table.
|
||||||
# Do not display the column value itself, just its length.
|
# Do not display the column value itself, just its length.
|
||||||
#
|
#
|
||||||
SELECT LENGTH(c1) FROM t1;
|
SELECT LENGTH(c1) FROM t1;
|
||||||
|
LENGTH(c1) 536870912
|
||||||
|
LENGTH(c1) 1048576
|
||||||
LENGTH(c1) 67108864
|
LENGTH(c1) 67108864
|
||||||
affected rows: 1
|
LENGTH(c1) 8388608
|
||||||
|
affected rows: 4
|
||||||
#
|
#
|
||||||
# Delete the row.
|
# Delete the rows.
|
||||||
#
|
#
|
||||||
DELETE FROM t1 WHERE c1 >= 'ManyMegaByteBlck';
|
DELETE FROM t1 WHERE c1 >= 'ManyMegaByteBlck';
|
||||||
affected rows: 1
|
affected rows: 4
|
||||||
#
|
#
|
||||||
# Hide how much rows are affected by each statement.
|
# Hide how many rows are affected by each statement.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Flush all log buffers to the log file.
|
# Flush all log buffers to the log file.
|
||||||
|
@ -70,5 +96,7 @@ FLUSH LOGS;
|
||||||
#
|
#
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
#
|
#
|
||||||
|
# reset variable value to pass testcase checks
|
||||||
|
SET @@global.max_allowed_packet = 1048576;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out
|
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out
|
||||||
|
|
|
@ -38,8 +38,26 @@ SET timestamp=1000000000;
|
||||||
--echo #
|
--echo #
|
||||||
--echo # We need big packets.
|
--echo # We need big packets.
|
||||||
--echo #
|
--echo #
|
||||||
|
--echo # Capture initial value to reset at the end of the test
|
||||||
|
# use let $<var> = query_get_value as FLUSH statements
|
||||||
|
# in the test will set @<var> values to NULL
|
||||||
|
let $orig_max_allowed_packet =
|
||||||
|
query_get_value(SELECT @@global.max_allowed_packet, @@global.max_allowed_packet, 1);
|
||||||
|
|
||||||
|
--echo # Now adjust max_allowed_packet
|
||||||
SET @@global.max_allowed_packet= 1024*1024*1024;
|
SET @@global.max_allowed_packet= 1024*1024*1024;
|
||||||
|
|
||||||
|
--echo max_allowed_packet is a global variable.
|
||||||
|
--echo In order for the preceding change in max_allowed_packets' value
|
||||||
|
--echo to be seen and used, we must start a new connection.
|
||||||
|
--echo The change does not take effect with the current one.
|
||||||
|
--echo For simplicity, we just disconnect / reconnect connection default here.
|
||||||
|
--echo Disconnecting default connection...
|
||||||
|
disconnect default;
|
||||||
|
--echo Reconnecting default connection...
|
||||||
|
connect (default, localhost,root,,);
|
||||||
|
--echo default connection established, continuing with the test
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Delete all existing binary logs.
|
--echo # Delete all existing binary logs.
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -53,34 +71,35 @@ eval CREATE TABLE t1 (
|
||||||
) ENGINE=$engine_type DEFAULT CHARSET latin1;
|
) ENGINE=$engine_type DEFAULT CHARSET latin1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Show how much rows are affected by each statement.
|
--echo # Show how many rows are affected by each statement.
|
||||||
--echo #
|
--echo #
|
||||||
--enable_info
|
--enable_info
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Insert a big row.
|
--echo # Insert some big rows.
|
||||||
--echo #
|
--echo #
|
||||||
#
|
|
||||||
# 256MB
|
--echo 256MB
|
||||||
#INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
|
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
|
||||||
#
|
|
||||||
# 32MB
|
--echo 32MB
|
||||||
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
|
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
|
||||||
#
|
|
||||||
# 4MB
|
--echo 4MB
|
||||||
#INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 262144));
|
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 262144));
|
||||||
#
|
|
||||||
# 512KB
|
--echo 512KB
|
||||||
#INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 32768));
|
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 32768));
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Show what we have in the table.
|
--echo # Show what we have in the table.
|
||||||
--echo # Do not display the column value itself, just its length.
|
--echo # Do not display the column value itself, just its length.
|
||||||
--echo #
|
--echo #
|
||||||
|
--sorted_result
|
||||||
query_vertical SELECT LENGTH(c1) FROM t1;
|
query_vertical SELECT LENGTH(c1) FROM t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Grow the row by updating.
|
--echo # Grow the rows by updating.
|
||||||
--echo #
|
--echo #
|
||||||
UPDATE t1 SET c1 = CONCAT(c1, c1);
|
UPDATE t1 SET c1 = CONCAT(c1, c1);
|
||||||
|
|
||||||
|
@ -88,15 +107,16 @@ UPDATE t1 SET c1 = CONCAT(c1, c1);
|
||||||
--echo # Show what we have in the table.
|
--echo # Show what we have in the table.
|
||||||
--echo # Do not display the column value itself, just its length.
|
--echo # Do not display the column value itself, just its length.
|
||||||
--echo #
|
--echo #
|
||||||
|
--sorted_result
|
||||||
query_vertical SELECT LENGTH(c1) FROM t1;
|
query_vertical SELECT LENGTH(c1) FROM t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Delete the row.
|
--echo # Delete the rows.
|
||||||
--echo #
|
--echo #
|
||||||
DELETE FROM t1 WHERE c1 >= 'ManyMegaByteBlck';
|
DELETE FROM t1 WHERE c1 >= 'ManyMegaByteBlck';
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Hide how much rows are affected by each statement.
|
--echo # Hide how many rows are affected by each statement.
|
||||||
--echo #
|
--echo #
|
||||||
--disable_info
|
--disable_info
|
||||||
|
|
||||||
|
@ -113,13 +133,15 @@ FLUSH LOGS;
|
||||||
--echo # at the bottom of the test script.
|
--echo # at the bottom of the test script.
|
||||||
--echo #
|
--echo #
|
||||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
|
||||||
--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 = #/
|
--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 = #/
|
||||||
--exec $MYSQL_BINLOG -v -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output
|
--exec $MYSQL_BINLOG -v -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Cleanup.
|
--echo # Cleanup.
|
||||||
--echo #
|
--echo #
|
||||||
|
--echo # reset variable value to pass testcase checks
|
||||||
|
eval SET @@global.max_allowed_packet = $orig_max_allowed_packet;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo remove_file \$MYSQLTEST_VARDIR/$mysqlbinlog_output
|
--echo remove_file \$MYSQLTEST_VARDIR/$mysqlbinlog_output
|
||||||
|
|
Loading…
Reference in a new issue