summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqlbinlog_row_big.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2008-08-20 19:06:31 +0500
committerAlexander Barkov <bar@mysql.com>2008-08-20 19:06:31 +0500
commit0c5bc2eafc95cb20f332becd295c29be95149700 (patch)
tree9b01eca71e89e78891e200183ef0f206f42306ab /mysql-test/t/mysqlbinlog_row_big.test
parente4e99f1439cd46a5f96e39289e6bc4f74c86ce88 (diff)
downloadmariadb-git-0c5bc2eafc95cb20f332becd295c29be95149700.tar.gz
Bug#31455 mysqlbinlog don't print user readable info about RBR events
Implementing -v command line parameter to mysqlbinlog to decode and print row events. mysql-test/include/mysqlbinlog_row_engine.inc mysql-test/r/mysqlbinlog_row.result mysql-test/r/mysqlbinlog_row_big.result mysql-test/r/mysqlbinlog_row_innodb.result mysql-test/r/mysqlbinlog_row_myisam.result mysql-test/r/mysqlbinlog_row_trans.result mysql-test/t/mysqlbinlog_row.test mysql-test/t/mysqlbinlog_row_big.test mysql-test/t/mysqlbinlog_row_innodb.test mysql-test/t/mysqlbinlog_row_myisam.test mysql-test/t/mysqlbinlog_row_trans.test Adding tests client/Makefile.am Adding new files to symlink client/mysqlbinlog.cc Adding -v option sql/log_event.cc Impelentations of the new methods sql/log_event.h Declaration of the new methods and member sql/mysql_priv.h Adding new function prototype sql/rpl_tblmap.cc Adding pre-processor conditions sql/rpl_tblmap.h Adding pre-processor conditions sql/rpl_utility.h Adding pre-processor conditions sql/sql_base.cc Adding reset_table_id_sequence() function. sql/sql_repl.cc Resetting table_id on "RESET MASTER" .bzrignore Ignoring new symlinked files
Diffstat (limited to 'mysql-test/t/mysqlbinlog_row_big.test')
-rw-r--r--mysql-test/t/mysqlbinlog_row_big.test130
1 files changed, 130 insertions, 0 deletions
diff --git a/mysql-test/t/mysqlbinlog_row_big.test b/mysql-test/t/mysqlbinlog_row_big.test
new file mode 100644
index 00000000000..99db199f910
--- /dev/null
+++ b/mysql-test/t/mysqlbinlog_row_big.test
@@ -0,0 +1,130 @@
+# mysqlbinlog_big.test
+#
+# Show that mysqlbinlog can handle big rows.
+#
+
+#
+# The *huge* output of mysqlbinlog will be redirected to
+# $MYSQLTEST_VARDIR/$mysqlbinlog_output
+#
+--let $mysqlbinlog_output= tmp/mysqlbinlog_big_1.out
+
+#--source include/have_myisam.inc
+--let $engine_type= MyISAM
+
+#
+# This test case is insensitive to the binlog format
+# because we don't display the output of mysqlbinlog.
+#
+#--source include/have_binlog_format_row.inc
+
+--source include/have_log_bin.inc
+
+# This is a big test.
+--source include/big_test.inc
+
+--echo #
+--echo # Preparatory cleanup.
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #
+--echo # We need a fixed timestamp to avoid varying results.
+--echo #
+SET timestamp=1000000000;
+
+--echo #
+--echo # We need big packets.
+--echo #
+SET @@session.max_allowed_packet= 1024*1024*1024;
+
+--echo #
+--echo # Delete all existing binary logs.
+--echo #
+RESET MASTER;
+
+--echo #
+--echo # Create a test table.
+--echo #
+eval CREATE TABLE t1 (
+ c1 LONGTEXT
+ ) ENGINE=$engine_type DEFAULT CHARSET latin1;
+
+--echo #
+--echo # Show how much rows are affected by each statement.
+--echo #
+--enable_info
+
+--echo #
+--echo # Insert a big row.
+--echo #
+#
+# 256MB
+#INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
+#
+# 32MB
+INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
+#
+# 4MB
+#INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 262144));
+#
+# 512KB
+#INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 32768));
+
+--echo #
+--echo # Show what we have in the table.
+--echo # Do not display the column value itself, just its length.
+--echo #
+query_vertical SELECT LENGTH(c1) FROM t1;
+
+--echo #
+--echo # Grow the row by updating.
+--echo #
+UPDATE t1 SET c1 = CONCAT(c1, c1);
+
+--echo #
+--echo # Show what we have in the table.
+--echo # Do not display the column value itself, just its length.
+--echo #
+query_vertical SELECT LENGTH(c1) FROM t1;
+
+--echo #
+--echo # Delete the row.
+--echo #
+DELETE FROM t1 WHERE c1 >= 'ManyMegaByteBlck';
+
+--echo #
+--echo # Hide how much rows are affected by each statement.
+--echo #
+--disable_info
+
+--echo #
+--echo # Flush all log buffers to the log file.
+--echo #
+FLUSH LOGS;
+
+--echo #
+--echo # Call mysqlbinlog to display the log file contents.
+--echo # NOTE: The output of mysqlbinlog is redirected to
+--echo # \$MYSQLTEST_VARDIR/$mysqlbinlog_output
+--echo # If you want to examine it, disable remove_file
+--echo # at the bottom of the test script.
+--echo #
+let $MYSQLD_DATADIR= `select @@datadir`;
+--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 = #/
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output
+
+--echo #
+--echo # Cleanup.
+--echo #
+DROP TABLE t1;
+
+--echo remove_file \$MYSQLTEST_VARDIR/$mysqlbinlog_output
+#
+# NOTE: If you want to see the *huge* mysqlbinlog output, disable next line:
+#
+--remove_file $MYSQLTEST_VARDIR/$mysqlbinlog_output
+