From d72a15fcaaf55a5c5e6356524186ebd2a8705b70 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 11 Dec 2009 18:41:31 +0100 Subject: [PATCH 001/121] Bug#49477: Assertion `0' failed in ha_partition.cc:5530 with temporary table and partitions It was possible to create temporary partitioned tables via create table ... like ... (which is not allowed with create temporary table). This lead to a new HA_EXTRA flag (HA_EXTRA_MMAP) was sent to the partitioning handler, which was caught on an assert in debug builds. Solution was to check for partitioned tables when doing create table ... like ... and disallow it. mysql-test/r/partition_error.result: Bug#49477: Assertion `0' failed in ha_partition.cc:5530 with temporary table and partitions Added result mysql-test/t/partition_error.test: Bug#49477: Assertion `0' failed in ha_partition.cc:5530 with temporary table and partitions Added test sql/sql_table.cc: Bug#49477: Assertion `0' failed in ha_partition.cc:5530 with temporary table and partitions Added check to prevent creation of partitioned temporary tables. Only copy .par file for partitioned tables. --- mysql-test/r/partition_error.result | 8 ++++++++ mysql-test/t/partition_error.test | 9 +++++++++ sql/sql_table.cc | 20 +++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 511806d64bd..5b7030d33fe 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1,4 +1,12 @@ drop table if exists t1; +# +# Bug#49477: Assertion `0' failed in ha_partition.cc:5530 +# with temporary table and partitions +# +CREATE TABLE t1 (a INT) PARTITION BY HASH(a); +CREATE TEMPORARY TABLE tmp_t1 LIKE t1; +ERROR HY000: Cannot create temporary table with partitions +DROP TABLE t1; CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a)); INSERT INTO t1 VALUES (1),(1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 49632f95dfb..5f824fefc93 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -8,6 +8,15 @@ drop table if exists t1; --enable_warnings +--echo # +--echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530 +--echo # with temporary table and partitions +--echo # +CREATE TABLE t1 (a INT) PARTITION BY HASH(a); +--error ER_PARTITION_NO_TEMPORARY +CREATE TEMPORARY TABLE tmp_t1 LIKE t1; +DROP TABLE t1; + # # Bug#38719: Partitioning returns a different error code for a # duplicate key error diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 869ae42c98c..6e0daefb7c1 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5257,6 +5257,11 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, */ if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { + if (src_table->table->file->ht == partition_hton) + { + my_error(ER_PARTITION_NO_TEMPORARY, MYF(0)); + goto err; + } if (find_temporary_table(thd, db, table_name)) goto table_exists; dst_path_length= build_tmptable_filename(thd, dst_path, sizeof(dst_path)); @@ -5321,14 +5326,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, /* For partitioned tables we need to copy the .par file as well since it is used in open_table_def to even be able to create a new handler. - There is no way to find out here if the original table is a - partitioned table so we copy the file and ignore any errors. */ - fn_format(tmp_path, dst_path, reg_ext, ".par", MYF(MY_REPLACE_EXT)); - strmov(dst_path, tmp_path); - fn_format(tmp_path, src_path, reg_ext, ".par", MYF(MY_REPLACE_EXT)); - strmov(src_path, tmp_path); - my_copy(src_path, dst_path, MYF(MY_DONT_OVERWRITE_FILE)); + if (src_table->table->file->ht == partition_hton) + { + fn_format(tmp_path, dst_path, reg_ext, ".par", MYF(MY_REPLACE_EXT)); + strmov(dst_path, tmp_path); + fn_format(tmp_path, src_path, reg_ext, ".par", MYF(MY_REPLACE_EXT)); + strmov(src_path, tmp_path); + my_copy(src_path, dst_path, MYF(MY_DONT_OVERWRITE_FILE)); + } #endif DBUG_EXECUTE_IF("sleep_create_like_before_ha_create", my_sleep(6000000);); From 287fa3caf532509d01d92e8d32f2149603914137 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 7 Apr 2010 18:17:56 +0300 Subject: [PATCH 002/121] Bug #52512: Assertion `! is_set()' in Diagnostics_area::set_ok_status on LOAD DATA Two problems : 1. LOAD DATA was not checking for SQL errors and was sending an OK packet even when there were errors reported already. Fixed to check for SQL errors in addition to the error conditions already detected. 2. There was an over-ambitious assert() on the server to check if the protocol is always followed by the client. This can cause crashes on debug servers by clients not completing the protocol exchange for some reason (e.g. --send command in mysqltest). Fixed by keeping the assert only on client side, since the server always completes the protocol exchange. --- mysql-test/r/loaddata.result | 7 +++++++ mysql-test/t/loaddata.test | 20 ++++++++++++++++++++ sql/net_serv.cc | 8 +++++++- sql/sql_load.cc | 4 ++++ 4 files changed, 38 insertions(+), 1 deletion(-) mode change 100755 => 100644 mysql-test/r/loaddata.result diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result old mode 100755 new mode 100644 index ef206565db5..2f645187530 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -502,4 +502,11 @@ SELECT * FROM t1; col0 test DROP TABLE t1; +# +# Bug #52512 : Assertion `! is_set()' in +# Diagnostics_area::set_ok_status on LOAD DATA +# +CREATE TABLE t1 (id INT NOT NULL); +LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index e5f0a1d7eba..1047cd0101a 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -554,4 +554,24 @@ let $MYSQLD_DATADIR= `select @@datadir`; remove_file $MYSQLD_DATADIR/test/t1.txt; +--echo # +--echo # Bug #52512 : Assertion `! is_set()' in +--echo # Diagnostics_area::set_ok_status on LOAD DATA +--echo # + +connect (con1,localhost,root,,test); + +CREATE TABLE t1 (id INT NOT NULL); +--send LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1 +# please keep this is a spearate test file : it's important to have no +# commands after this one + +connection default; +dirty_close con1; + +connect (con1,localhost,root,,test); +DROP TABLE t1; +connection default; +disconnect con1; + --echo End of 5.1 tests diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 73892f31ccf..1badee68be4 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -903,7 +903,13 @@ my_real_read(NET *net, size_t *complen) ("Packets out of order (Found: %d, expected %u)", (int) net->buff[net->where_b + 3], net->pkt_nr)); -#ifdef EXTRA_DEBUG + /* + We don't make noise server side, since the client is expected + to break the protocol for e.g. --send LOAD DATA .. LOCAL where + the server expects the client to send a file, but the client + may reply with a new command instead. + */ +#if defined (EXTRA_DEBUG) && !defined (MYSQL_SERVER) fflush(stdout); fprintf(stderr,"Error: Packets out of order (Found: %d, expected %d)\n", (int) net->buff[net->where_b + 3], diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 3fb1b07cf6c..114651b9efb 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -940,6 +940,10 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, DBUG_RETURN(1); } } + + if (thd->is_error()) + read_info.error= 1; + if (read_info.error) break; if (skip_lines) From 037950e676fd1b8bf207c31cc4f808a468421ed7 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Sat, 1 May 2010 16:46:04 +0300 Subject: [PATCH 003/121] tree name change --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index 557df1b1ffe..f79c1cd6319 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.0-bugteam" +tree_name = "mysql-5.0" From 1f3305f6950151220286ddd66f72a8a8dfad0ca8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 May 2010 12:06:18 +0200 Subject: [PATCH 004/121] Raise version number after cloning 5.0.91 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index d7e5e32eaed..53598d2b4c7 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.91) +AM_INIT_AUTOMAKE(mysql, 5.0.92) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=91 +NDB_VERSION_BUILD=92 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 7c4e538d765d2a488167d550eb0b029130bdf888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 3 May 2010 15:28:59 +0300 Subject: [PATCH 005/121] buf_zip_decompress(): Allow BUF_NO_CHECKSUM_MAGIC as the stamped checksum. buf_page_get_gen(): Assert that buf_zip_decompress() succeeds. Callers are not prepared for a NULL return value. (Bug #53248) --- storage/innodb_plugin/ChangeLog | 6 ++++++ storage/innodb_plugin/buf/buf0buf.c | 18 ++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index fb34b7bf493..bc69aaca96a 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2010-05-03 The InnoDB Team + + * buf0buf.c: + Fix Bug#53248 compressed tables page checksum mismatch after + re-enabling innodb_checksums + 2010-04-28 The InnoDB Team * log/log0recv.h, log/log0recv.c: diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c index d4a88565570..f299c2df969 100644 --- a/storage/innodb_plugin/buf/buf0buf.c +++ b/storage/innodb_plugin/buf/buf0buf.c @@ -1820,14 +1820,14 @@ buf_zip_decompress( buf_block_t* block, /*!< in/out: block */ ibool check) /*!< in: TRUE=verify the page checksum */ { - const byte* frame = block->page.zip.data; + const byte* frame = block->page.zip.data; + ulint stamp_checksum = mach_read_from_4( + frame + FIL_PAGE_SPACE_OR_CHKSUM); ut_ad(buf_block_get_zip_size(block)); ut_a(buf_block_get_space(block) != 0); - if (UNIV_LIKELY(check)) { - ulint stamp_checksum = mach_read_from_4( - frame + FIL_PAGE_SPACE_OR_CHKSUM); + if (UNIV_LIKELY(check && stamp_checksum != BUF_NO_CHECKSUM_MAGIC)) { ulint calc_checksum = page_zip_calc_checksum( frame, page_zip_get_size(&block->page.zip)); @@ -2251,8 +2251,9 @@ wait_until_unfixed: /* Decompress the page and apply buffered operations while not holding buf_pool_mutex or block->mutex. */ success = buf_zip_decompress(block, srv_use_checksums); + ut_a(success); - if (UNIV_LIKELY(success && !recv_no_ibuf_operations)) { + if (UNIV_LIKELY(!recv_no_ibuf_operations)) { ibuf_merge_or_delete_for_page(block, space, offset, zip_size, TRUE); } @@ -2265,13 +2266,6 @@ wait_until_unfixed: mutex_exit(&block->mutex); buf_pool->n_pend_unzip--; rw_lock_x_unlock(&block->lock); - - if (UNIV_UNLIKELY(!success)) { - - buf_pool_mutex_exit(); - return(NULL); - } - break; case BUF_BLOCK_ZIP_FREE: From 4e76242675a56810a02b5559f83f8c736f96031d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 4 May 2010 12:31:28 +0300 Subject: [PATCH 006/121] btr_page_split_and_insert(): Correct the fix of Bug #52964. When split_rec==NULL, choose the correct node pointer key (first_rec). --- storage/innodb_plugin/btr/btr0btr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/storage/innodb_plugin/btr/btr0btr.c b/storage/innodb_plugin/btr/btr0btr.c index ab20a945d00..96fcc2ed821 100644 --- a/storage/innodb_plugin/btr/btr0btr.c +++ b/storage/innodb_plugin/btr/btr0btr.c @@ -1999,9 +1999,13 @@ func_start: split_rec = NULL; goto insert_empty; } + } else if (UNIV_UNLIKELY(insert_left)) { + first_rec = page_rec_get_next(page_get_infimum_rec(page)); + move_limit = page_rec_get_next(btr_cur_get_rec(cursor)); } else { insert_empty: ut_ad(!split_rec); + ut_ad(!insert_left); buf = mem_alloc(rec_get_converted_size(cursor->index, tuple, n_ext)); @@ -2025,7 +2029,11 @@ insert_empty: && btr_page_insert_fits(cursor, split_rec, offsets, tuple, n_ext, heap); } else { - mem_free(buf); + if (!insert_left) { + mem_free(buf); + buf = NULL; + } + insert_will_fit = !new_page_zip && btr_page_insert_fits(cursor, NULL, NULL, tuple, n_ext, heap); From 39be66c7cea79b54e3aab138c3f5af0c339012e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 4 May 2010 13:55:46 +0300 Subject: [PATCH 007/121] Remove UNIV_BTR_AVOID_COPY. It was broken because btr_attach_half_pages() would get the block, new_block in the wrong order. Fixing that would have complicated the function even further for this marginal case. --- storage/innodb_plugin/ChangeLog | 6 ------ storage/innodb_plugin/btr/btr0btr.c | 20 +------------------- storage/innodb_plugin/include/univ.i | 4 ---- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index bc69aaca96a..b4d8afab50c 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -48,12 +48,6 @@ Only check the record size at index creation time when innodb_strict_mode is set or when ROW_FORMAT is DYNAMIC or COMPRESSED. -2010-04-20 The InnoDB Team - - * btr/btr0btr.c, include/univ.i: - Implement UNIV_BTR_AVOID_COPY, for avoiding writes when a B-tree - node is split at the first or last record. - 2010-04-15 The InnoDB Team * trx/trx0rec.c: diff --git a/storage/innodb_plugin/btr/btr0btr.c b/storage/innodb_plugin/btr/btr0btr.c index 96fcc2ed821..3c24eaac81e 100644 --- a/storage/innodb_plugin/btr/btr0btr.c +++ b/storage/innodb_plugin/btr/btr0btr.c @@ -2046,17 +2046,7 @@ insert_empty: } /* 5. Move then the records to the new page */ - if (direction == FSP_DOWN -#ifdef UNIV_BTR_AVOID_COPY - && page_rec_is_supremum(move_limit)) { - /* Instead of moving all records, make the new page - the empty page. */ - - left_block = block; - right_block = new_block; - } else if (direction == FSP_DOWN -#endif /* UNIV_BTR_AVOID_COPY */ - ) { + if (direction == FSP_DOWN) { /* fputs("Split left\n", stderr); */ if (0 @@ -2099,14 +2089,6 @@ insert_empty: right_block = block; lock_update_split_left(right_block, left_block); -#ifdef UNIV_BTR_AVOID_COPY - } else if (!split_rec) { - /* Instead of moving all records, make the new page - the empty page. */ - - left_block = new_block; - right_block = block; -#endif /* UNIV_BTR_AVOID_COPY */ } else { /* fputs("Split right\n", stderr); */ diff --git a/storage/innodb_plugin/include/univ.i b/storage/innodb_plugin/include/univ.i index 49717760456..2aa27245d5f 100644 --- a/storage/innodb_plugin/include/univ.i +++ b/storage/innodb_plugin/include/univ.i @@ -205,10 +205,6 @@ operations (very slow); also UNIV_DEBUG must be defined */ adaptive hash index */ #define UNIV_SRV_PRINT_LATCH_WAITS /* enable diagnostic output in sync0sync.c */ -#define UNIV_BTR_AVOID_COPY /* when splitting B-tree nodes, - do not move any records when - all the records would - be moved */ #define UNIV_BTR_PRINT /* enable functions for printing B-trees */ #define UNIV_ZIP_DEBUG /* extensive consistency checks From 19263724e481b44785d0d6938b964e1ddbf31215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 4 May 2010 15:47:44 +0300 Subject: [PATCH 008/121] Add Valgrind checks to catch uninitialized writes to data files. buf_flush_insert_into_flush_list(), buf_flush_insert_sorted_into_flush_list(), buf_flush_post_to_doublewrite_buf(): Check that the page is initialized. --- storage/innodb_plugin/buf/buf0flu.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/storage/innodb_plugin/buf/buf0flu.c b/storage/innodb_plugin/buf/buf0flu.c index f2b07492470..d8c0497fa1e 100644 --- a/storage/innodb_plugin/buf/buf0flu.c +++ b/storage/innodb_plugin/buf/buf0flu.c @@ -249,6 +249,17 @@ buf_flush_insert_into_flush_list( ut_d(block->page.in_flush_list = TRUE); UT_LIST_ADD_FIRST(list, buf_pool->flush_list, &block->page); +#ifdef UNIV_DEBUG_VALGRIND + { + ulint zip_size = buf_block_get_zip_size(block); + + if (UNIV_UNLIKELY(zip_size)) { + UNIV_MEM_ASSERT_RW(block->page.zip.data, zip_size); + } else { + UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE); + } + } +#endif /* UNIV_DEBUG_VALGRIND */ #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG ut_a(buf_flush_validate_low()); #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ @@ -276,6 +287,18 @@ buf_flush_insert_sorted_into_flush_list( ut_ad(!block->page.in_flush_list); ut_d(block->page.in_flush_list = TRUE); +#ifdef UNIV_DEBUG_VALGRIND + { + ulint zip_size = buf_block_get_zip_size(block); + + if (UNIV_UNLIKELY(zip_size)) { + UNIV_MEM_ASSERT_RW(block->page.zip.data, zip_size); + } else { + UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE); + } + } +#endif /* UNIV_DEBUG_VALGRIND */ + prev_b = NULL; /* For the most part when this function is called the flush_rbt @@ -809,6 +832,7 @@ try_again: zip_size = buf_page_get_zip_size(bpage); if (UNIV_UNLIKELY(zip_size)) { + UNIV_MEM_ASSERT_RW(bpage->zip.data, zip_size); /* Copy the compressed page and clear the rest. */ memcpy(trx_doublewrite->write_buf + UNIV_PAGE_SIZE * trx_doublewrite->first_free, @@ -818,6 +842,8 @@ try_again: + zip_size, 0, UNIV_PAGE_SIZE - zip_size); } else { ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE); + UNIV_MEM_ASSERT_RW(((buf_block_t*) bpage)->frame, + UNIV_PAGE_SIZE); memcpy(trx_doublewrite->write_buf + UNIV_PAGE_SIZE * trx_doublewrite->first_free, From 6e5619be2c8a5e9ead3f3849cac1ebabed9d57cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 4 May 2010 15:55:10 +0300 Subject: [PATCH 009/121] Add Valgrind checks to catch uninitialized writes to data files. buf_flush_insert_into_flush_list(), buf_flush_insert_sorted_into_flush_list(), buf_flush_post_to_doublewrite_buf(): Check that the page is initialized. --- storage/innobase/buf/buf0flu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c index 423c08c0569..7533205d695 100644 --- a/storage/innobase/buf/buf0flu.c +++ b/storage/innobase/buf/buf0flu.c @@ -55,6 +55,7 @@ buf_flush_insert_into_flush_list( || (ut_dulint_cmp((UT_LIST_GET_FIRST(buf_pool->flush_list)) ->oldest_modification, block->oldest_modification) <= 0)); + UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE); UT_LIST_ADD_FIRST(flush_list, buf_pool->flush_list, block); @@ -75,6 +76,7 @@ buf_flush_insert_sorted_into_flush_list( buf_block_t* b; ut_ad(mutex_own(&(buf_pool->mutex))); + UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE); prev_b = NULL; b = UT_LIST_GET_FIRST(buf_pool->flush_list); @@ -423,6 +425,7 @@ try_again: goto try_again; } + UNIV_MEM_ASSERT_RW(block->frame, UNIV_PAGE_SIZE); ut_memcpy(trx_doublewrite->write_buf + UNIV_PAGE_SIZE * trx_doublewrite->first_free, block->frame, UNIV_PAGE_SIZE); From 54b01fbff1906543e7794d6a335e6665511f48c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 4 May 2010 16:09:17 +0300 Subject: [PATCH 010/121] fsp_init_file_page_low(): Zero out the page. (Bug #53306) --- storage/innodb_plugin/fsp/fsp0fsp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/storage/innodb_plugin/fsp/fsp0fsp.c b/storage/innodb_plugin/fsp/fsp0fsp.c index c7f1a299d8a..2bae8481d20 100644 --- a/storage/innodb_plugin/fsp/fsp0fsp.c +++ b/storage/innodb_plugin/fsp/fsp0fsp.c @@ -869,12 +869,10 @@ fsp_init_file_page_low( return; } - UNIV_MEM_INVALID(page, UNIV_PAGE_SIZE); + memset(page, 0, UNIV_PAGE_SIZE); mach_write_to_4(page + FIL_PAGE_OFFSET, buf_block_get_page_no(block)); - memset(page + FIL_PAGE_LSN, 0, 8); mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, buf_block_get_space(block)); - memset(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM, 0, 8); } #ifndef UNIV_HOTBACKUP From 304daa74319017eb5e8653cc97c9b8829de8c7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 4 May 2010 16:13:58 +0300 Subject: [PATCH 011/121] fsp_init_file_page_low(): Zero out the page. (Bug #53306) --- mysql-test/suite/innodb/t/disabled.def | 1 - storage/innobase/fsp/fsp0fsp.c | 7 +------ storage/innobase/include/univ.i | 5 ----- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def index dff86f24787..888298bbb09 100644 --- a/mysql-test/suite/innodb/t/disabled.def +++ b/mysql-test/suite/innodb/t/disabled.def @@ -9,4 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -innodb : Bug#53306 2010-04-30 VasilDimov valgrind warnings diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c index e1074933fe8..1ec1c262a52 100644 --- a/storage/innobase/fsp/fsp0fsp.c +++ b/storage/innobase/fsp/fsp0fsp.c @@ -802,12 +802,7 @@ fsp_init_file_page_low( buf_block_align(page)->check_index_page_at_flush = FALSE; -#ifdef UNIV_BASIC_LOG_DEBUG - memset(page, 0xff, UNIV_PAGE_SIZE); -#endif - mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM, - ut_dulint_zero); - mach_write_to_8(page + FIL_PAGE_LSN, ut_dulint_zero); + memset(page, 0, UNIV_PAGE_SIZE); } /*************************************************************** diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index ee3a0b27b20..ecf754762ad 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -126,11 +126,6 @@ by one. */ /* the above option prevents forcing of log to disk at a buffer page write: it should be tested with this option off; also some ibuf tests are suppressed */ -/* -#define UNIV_BASIC_LOG_DEBUG -*/ - /* the above option enables basic recovery debugging: - new allocated file pages are reset */ #if (!defined(UNIV_DEBUG) && !defined(INSIDE_HA_INNOBASE_CC) && !defined(UNIV_MUST_NOT_INLINE)) /* Definition for inline version */ From 322dda239775212b6f572297792e49c0c0bca9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 4 May 2010 16:15:17 +0300 Subject: [PATCH 012/121] Document Bug #53306 in the InnoDB Plugin ChangeLog. --- storage/innodb_plugin/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index b4d8afab50c..06577b4c1e7 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,8 @@ +2010-05-04 The InnoDB Team + + * fsp/fsp0fsp.c: + Fix Bug#53306 valgrind: warnings in innodb.innodb + 2010-05-03 The InnoDB Team * buf0buf.c: From 6bc1a96b31cd9d931bb5a8515c82e75520db8388 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Tue, 4 May 2010 21:52:24 -0700 Subject: [PATCH 013/121] Port fix for 53165 to InnoDB 5.1 plugin. The change buffering options are different in 5.1 comparing to that of 5.5, so a hand port is necessary to avoid wrong default option to be set by a simple branch merge. --- storage/innodb_plugin/handler/ha_innodb.cc | 79 ++++++++++++++++------ 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc index 0fc6e786f4c..0a2340d0f67 100644 --- a/storage/innodb_plugin/handler/ha_innodb.cc +++ b/storage/innodb_plugin/handler/ha_innodb.cc @@ -10346,7 +10346,35 @@ innodb_old_blocks_pct_update( } /*************************************************************//** -Check if it is a valid value of innodb_change_buffering. This function is +Find the corresponding ibuf_use_t value that indexes into +innobase_change_buffering_values[] array for the input +change buffering option name. +@return corresponding IBUF_USE_* value for the input variable +name, or IBUF_USE_COUNT if not able to find a match */ +static +ibuf_use_t +innodb_find_change_buffering_value( +/*===============================*/ + const char* input_name) /*!< in: input change buffering + option name */ +{ + ulint use; + + for (use = 0; use < UT_ARR_SIZE(innobase_change_buffering_values); + use++) { + /* found a match */ + if (!innobase_strcasecmp( + input_name, innobase_change_buffering_values[use])) { + return((ibuf_use_t)use); + } + } + + /* Did not find any match */ + return(IBUF_USE_COUNT); +} + +/*************************************************************//** +Check if it is a valid value of innodb_change_buffering. This function is registered as a callback with MySQL. @return 0 for valid innodb_change_buffering */ static @@ -10370,19 +10398,22 @@ innodb_change_buffering_validate( change_buffering_input = value->val_str(value, buff, &len); if (change_buffering_input != NULL) { - ulint use; + ibuf_use_t use; - for (use = 0; use < UT_ARR_SIZE(innobase_change_buffering_values); - use++) { - if (!innobase_strcasecmp( - change_buffering_input, - innobase_change_buffering_values[use])) { - *(ibuf_use_t*) save = (ibuf_use_t) use; - return(0); - } + use = innodb_find_change_buffering_value( + change_buffering_input); + + if (use != IBUF_USE_COUNT) { + /* Find a matching change_buffering option value. */ + *static_cast(save) = + innobase_change_buffering_values[use]; + + return(0); } } + /* No corresponding change buffering option for user supplied + "change_buffering_input" */ return(1); } @@ -10393,21 +10424,27 @@ static void innodb_change_buffering_update( /*===========================*/ - THD* thd, /*!< in: thread handle */ - struct st_mysql_sys_var* var, /*!< in: pointer to - system variable */ - void* var_ptr, /*!< out: where the - formal string goes */ - const void* save) /*!< in: immediate result - from check function */ + THD* thd, /*!< in: thread handle */ + struct st_mysql_sys_var* var, /*!< in: pointer to + system variable */ + void* var_ptr,/*!< out: where the + formal string goes */ + const void* save) /*!< in: immediate result + from check function */ { + ibuf_use_t use; + ut_a(var_ptr != NULL); ut_a(save != NULL); - ut_a((*(ibuf_use_t*) save) < IBUF_USE_COUNT); - ibuf_use = *(const ibuf_use_t*) save; + use = innodb_find_change_buffering_value( + *static_cast(save)); - *(const char**) var_ptr = innobase_change_buffering_values[ibuf_use]; + ut_a(use < IBUF_USE_COUNT); + + ibuf_use = use; + *static_cast(var_ptr) = + *static_cast(save); } static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff) @@ -10735,7 +10772,7 @@ static MYSQL_SYSVAR_STR(change_buffering, innobase_change_buffering, "Buffer changes to reduce random access: " "OFF, ON, none, inserts.", innodb_change_buffering_validate, - innodb_change_buffering_update, NULL); + innodb_change_buffering_update, "inserts"); static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold, PLUGIN_VAR_RQCMDARG, From c5b14cda4423193923b32398275d3856013f5b60 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 5 May 2010 12:38:59 +0300 Subject: [PATCH 014/121] tree name change --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index 557df1b1ffe..f79c1cd6319 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.0-bugteam" +tree_name = "mysql-5.0" From 264942661b5181c670a62fc7be1e7f4e54df7a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 12:53:28 +0300 Subject: [PATCH 015/121] Add Valgrind diagnostics to track down Bug #38999. --- storage/innobase/row/row0sel.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index 1d30249c53e..6912a489f75 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -2452,6 +2452,7 @@ row_sel_field_store_in_mysql_format( byte* pad_ptr; ut_ad(len != UNIV_SQL_NULL); + UNIV_MEM_ASSERT_RW(data, len); if (templ->type == DATA_INT) { /* Convert integer data from Innobase to a little-endian @@ -2687,6 +2688,9 @@ row_sel_store_mysql_rec( /* MySQL assumes that the field for an SQL NULL value is set to the default value. */ + UNIV_MEM_ASSERT_RW(prebuilt->default_rec + + templ->mysql_col_offset, + templ->mysql_col_len); mysql_rec[templ->mysql_null_byte_offset] |= (byte) templ->mysql_null_bit_mask; memcpy(mysql_rec + templ->mysql_col_offset, @@ -3007,6 +3011,11 @@ row_sel_pop_cached_row_for_mysql( for (i = 0; i < prebuilt->n_template; i++) { templ = prebuilt->mysql_template + i; +#if 0 /* Some of the cached_rec may legitimately be uninitialized. */ + UNIV_MEM_ASSERT_RW(cached_rec + + templ->mysql_col_offset, + templ->mysql_col_len); +#endif ut_memcpy(buf + templ->mysql_col_offset, cached_rec + templ->mysql_col_offset, templ->mysql_col_len); @@ -3021,6 +3030,11 @@ row_sel_pop_cached_row_for_mysql( } } else { +#if 0 /* Some of the cached_rec may legitimately be uninitialized. */ + UNIV_MEM_ASSERT_RW(prebuilt->fetch_cache + [prebuilt->fetch_cache_first], + prebuilt->mysql_prefix_len); +#endif ut_memcpy(buf, prebuilt->fetch_cache[prebuilt->fetch_cache_first], prebuilt->mysql_prefix_len); @@ -3070,6 +3084,8 @@ row_sel_push_cache_row_for_mysql( } ut_ad(prebuilt->fetch_cache_first == 0); + UNIV_MEM_INVALID(prebuilt->fetch_cache[prebuilt->n_fetch_cached], + prebuilt->mysql_row_len); if (UNIV_UNLIKELY(!row_sel_store_mysql_rec( prebuilt->fetch_cache[ From 9141b67822d589d5a6df6cb0f8459ea48ea4c4a5 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Wed, 5 May 2010 03:02:19 -0700 Subject: [PATCH 016/121] Update ChangeLog for bug fix of #53165 --- storage/innodb_plugin/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 06577b4c1e7..fd76d8d40ee 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2010-05-05 The InnoDB Team + + * handler/ha_innodb.cc: + Fix Bug#53165 Setting innodb_change_buffering=DEFAULT produces + incorrect result + 2010-05-04 The InnoDB Team * fsp/fsp0fsp.c: From d4b1117768084e76c3c0ab06e7da83d22f02cbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 13:05:07 +0300 Subject: [PATCH 017/121] Add Valgrind diagnostics to track down Bug #38999. --- storage/innodb_plugin/row/row0sel.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/storage/innodb_plugin/row/row0sel.c b/storage/innodb_plugin/row/row0sel.c index d0702a0cd2f..0735215a9a9 100644 --- a/storage/innodb_plugin/row/row0sel.c +++ b/storage/innodb_plugin/row/row0sel.c @@ -2498,6 +2498,7 @@ row_sel_field_store_in_mysql_format( byte* pad_ptr; ut_ad(len != UNIV_SQL_NULL); + UNIV_MEM_ASSERT_RW(data, len); switch (templ->type) { case DATA_INT: @@ -2746,6 +2747,9 @@ row_sel_store_mysql_rec( /* MySQL assumes that the field for an SQL NULL value is set to the default value. */ + UNIV_MEM_ASSERT_RW(prebuilt->default_rec + + templ->mysql_col_offset, + templ->mysql_col_len); mysql_rec[templ->mysql_null_byte_offset] |= (byte) templ->mysql_null_bit_mask; memcpy(mysql_rec + templ->mysql_col_offset, @@ -3070,6 +3074,11 @@ row_sel_pop_cached_row_for_mysql( for (i = 0; i < prebuilt->n_template; i++) { templ = prebuilt->mysql_template + i; +#if 0 /* Some of the cached_rec may legitimately be uninitialized. */ + UNIV_MEM_ASSERT_RW(cached_rec + + templ->mysql_col_offset, + templ->mysql_col_len); +#endif ut_memcpy(buf + templ->mysql_col_offset, cached_rec + templ->mysql_col_offset, templ->mysql_col_len); @@ -3084,6 +3093,11 @@ row_sel_pop_cached_row_for_mysql( } } else { +#if 0 /* Some of the cached_rec may legitimately be uninitialized. */ + UNIV_MEM_ASSERT_RW(prebuilt->fetch_cache + [prebuilt->fetch_cache_first], + prebuilt->mysql_prefix_len); +#endif ut_memcpy(buf, prebuilt->fetch_cache[prebuilt->fetch_cache_first], prebuilt->mysql_prefix_len); @@ -3134,6 +3148,8 @@ row_sel_push_cache_row_for_mysql( } ut_ad(prebuilt->fetch_cache_first == 0); + UNIV_MEM_INVALID(prebuilt->fetch_cache[prebuilt->n_fetch_cached], + prebuilt->mysql_row_len); if (UNIV_UNLIKELY(!row_sel_store_mysql_rec( prebuilt->fetch_cache[ From e73feed2d80588bc1ea8e5187405ec68353bbcc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 13:40:01 +0300 Subject: [PATCH 018/121] Factor out innodb_multi_update.test from innodb.test --- mysql-test/suite/innodb/r/innodb.result | 80 +------------------ .../suite/innodb/r/innodb_multi_update.result | 76 ++++++++++++++++++ mysql-test/suite/innodb/t/disabled.def | 1 + mysql-test/suite/innodb/t/innodb.test | 27 ------- .../suite/innodb/t/innodb_multi_update.test | 29 +++++++ 5 files changed, 108 insertions(+), 105 deletions(-) create mode 100644 mysql-test/suite/innodb/r/innodb_multi_update.result create mode 100644 mysql-test/suite/innodb/t/innodb_multi_update.test diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 5b84a64e8e8..c6f6f352743 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -1179,82 +1179,6 @@ a b 8 8 9 9 drop table t1; -CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; -CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; -INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); -INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); -update t1,t2 set t1.a=t1.a+100; -select * from t1; -a b -101 1 -102 2 -103 3 -104 4 -105 5 -106 6 -107 7 -108 8 -109 9 -110 10 -111 11 -112 12 -update t1,t2 set t1.a=t1.a+100 where t1.a=101; -select * from t1; -a b -201 1 -102 2 -103 3 -104 4 -105 5 -106 6 -107 7 -108 8 -109 9 -110 10 -111 11 -112 12 -update t1,t2 set t1.b=t1.b+10 where t1.b=2; -select * from t1; -a b -201 1 -103 3 -104 4 -105 5 -106 6 -107 7 -108 8 -109 9 -110 10 -111 11 -102 12 -112 12 -update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100; -select * from t1; -a b -201 1 -103 5 -104 6 -106 6 -105 7 -107 7 -108 8 -109 9 -110 10 -111 11 -102 12 -112 12 -select * from t2; -a b -1 1 -2 2 -6 6 -7 7 -8 8 -9 9 -3 13 -4 14 -5 15 -drop table t1,t2; CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=0; @@ -1747,10 +1671,10 @@ variable_value - @innodb_rows_deleted_orig 71 SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted'; variable_value - @innodb_rows_inserted_orig -1084 +1063 SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated'; variable_value - @innodb_rows_updated_orig -885 +865 SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits'; variable_value - @innodb_row_lock_waits_orig 0 diff --git a/mysql-test/suite/innodb/r/innodb_multi_update.result b/mysql-test/suite/innodb/r/innodb_multi_update.result new file mode 100644 index 00000000000..7af9b030d1f --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_multi_update.result @@ -0,0 +1,76 @@ +CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb; +INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); +INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100; +select * from bug38999_1; +a b +101 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101; +select * from bug38999_1; +a b +201 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2; +select * from bug38999_1; +a b +201 1 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100; +select * from bug38999_1; +a b +201 1 +103 5 +104 6 +106 6 +105 7 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +select * from bug38999_2; +a b +1 1 +2 2 +6 6 +7 7 +8 8 +9 9 +3 13 +4 14 +5 15 +drop table bug38999_1,bug38999_2; diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def index 888298bbb09..da04138fd0a 100644 --- a/mysql-test/suite/innodb/t/disabled.def +++ b/mysql-test/suite/innodb/t/disabled.def @@ -9,3 +9,4 @@ # Do not use any TAB characters for whitespace. # ############################################################################## +innodb_multi_update: Bug #38999 2010-05-05 mmakela Valgrind warnings diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index 8641163e4f7..480183b9e2d 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -905,33 +905,6 @@ UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; SELECT * from t1; drop table t1; -# -# Test multi update with different join methods -# - -CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; -CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; -INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); -INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); - -# Full join, without key -update t1,t2 set t1.a=t1.a+100; -select * from t1; - -# unique key -update t1,t2 set t1.a=t1.a+100 where t1.a=101; -select * from t1; - -# ref key -update t1,t2 set t1.b=t1.b+10 where t1.b=2; -select * from t1; - -# Range key (in t1) -update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100; -select * from t1; -select * from t2; - -drop table t1,t2; CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=0; diff --git a/mysql-test/suite/innodb/t/innodb_multi_update.test b/mysql-test/suite/innodb/t/innodb_multi_update.test new file mode 100644 index 00000000000..7ab17ccf70a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_multi_update.test @@ -0,0 +1,29 @@ +-- source include/have_innodb.inc + +# +# Test multi update with different join methods +# + +CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb; +INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); +INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); + +# Full join, without key +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100; +select * from bug38999_1; + +# unique key +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101; +select * from bug38999_1; + +# ref key +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2; +select * from bug38999_1; + +# Range key (in bug38999_1) +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100; +select * from bug38999_1; +select * from bug38999_2; + +drop table bug38999_1,bug38999_2; From 415e5b282b07b4d9b34120f336306c8d8cfd41c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 13:44:25 +0300 Subject: [PATCH 019/121] Factor out innodb_multi_update.test from innodb.test --- .../suite/innodb_plugin/r/innodb.result | 80 +------------------ .../r/innodb_multi_update.result | 76 ++++++++++++++++++ mysql-test/suite/innodb_plugin/t/disabled.def | 12 +++ mysql-test/suite/innodb_plugin/t/innodb.test | 27 ------- .../innodb_plugin/t/innodb_multi_update.test | 29 +++++++ 5 files changed, 119 insertions(+), 105 deletions(-) create mode 100644 mysql-test/suite/innodb_plugin/r/innodb_multi_update.result create mode 100644 mysql-test/suite/innodb_plugin/t/disabled.def create mode 100644 mysql-test/suite/innodb_plugin/t/innodb_multi_update.test diff --git a/mysql-test/suite/innodb_plugin/r/innodb.result b/mysql-test/suite/innodb_plugin/r/innodb.result index e435c0f68ca..75a7023f9d0 100644 --- a/mysql-test/suite/innodb_plugin/r/innodb.result +++ b/mysql-test/suite/innodb_plugin/r/innodb.result @@ -1184,82 +1184,6 @@ a b 8 8 9 9 drop table t1; -CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; -CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; -INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); -INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); -update t1,t2 set t1.a=t1.a+100; -select * from t1; -a b -101 1 -102 2 -103 3 -104 4 -105 5 -106 6 -107 7 -108 8 -109 9 -110 10 -111 11 -112 12 -update t1,t2 set t1.a=t1.a+100 where t1.a=101; -select * from t1; -a b -201 1 -102 2 -103 3 -104 4 -105 5 -106 6 -107 7 -108 8 -109 9 -110 10 -111 11 -112 12 -update t1,t2 set t1.b=t1.b+10 where t1.b=2; -select * from t1; -a b -201 1 -103 3 -104 4 -105 5 -106 6 -107 7 -108 8 -109 9 -110 10 -111 11 -102 12 -112 12 -update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100; -select * from t1; -a b -201 1 -103 5 -104 6 -106 6 -105 7 -107 7 -108 8 -109 9 -110 10 -111 11 -102 12 -112 12 -select * from t2; -a b -1 1 -2 2 -6 6 -7 7 -8 8 -9 9 -3 13 -4 14 -5 15 -drop table t1,t2; CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=0; @@ -1752,10 +1676,10 @@ variable_value - @innodb_rows_deleted_orig 71 SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted'; variable_value - @innodb_rows_inserted_orig -1087 +1066 SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated'; variable_value - @innodb_rows_updated_orig -885 +865 SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits'; variable_value - @innodb_row_lock_waits_orig 0 diff --git a/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result b/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result new file mode 100644 index 00000000000..7af9b030d1f --- /dev/null +++ b/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result @@ -0,0 +1,76 @@ +CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb; +INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); +INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100; +select * from bug38999_1; +a b +101 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101; +select * from bug38999_1; +a b +201 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2; +select * from bug38999_1; +a b +201 1 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100; +select * from bug38999_1; +a b +201 1 +103 5 +104 6 +106 6 +105 7 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +select * from bug38999_2; +a b +1 1 +2 2 +6 6 +7 7 +8 8 +9 9 +3 13 +4 14 +5 15 +drop table bug38999_1,bug38999_2; diff --git a/mysql-test/suite/innodb_plugin/t/disabled.def b/mysql-test/suite/innodb_plugin/t/disabled.def new file mode 100644 index 00000000000..da04138fd0a --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/disabled.def @@ -0,0 +1,12 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## +innodb_multi_update: Bug #38999 2010-05-05 mmakela Valgrind warnings diff --git a/mysql-test/suite/innodb_plugin/t/innodb.test b/mysql-test/suite/innodb_plugin/t/innodb.test index 6cfc0f0cb9a..60ba7d1e3bf 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb.test +++ b/mysql-test/suite/innodb_plugin/t/innodb.test @@ -915,33 +915,6 @@ UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; SELECT * from t1; drop table t1; -# -# Test multi update with different join methods -# - -CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; -CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; -INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); -INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); - -# Full join, without key -update t1,t2 set t1.a=t1.a+100; -select * from t1; - -# unique key -update t1,t2 set t1.a=t1.a+100 where t1.a=101; -select * from t1; - -# ref key -update t1,t2 set t1.b=t1.b+10 where t1.b=2; -select * from t1; - -# Range key (in t1) -update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100; -select * from t1; -select * from t2; - -drop table t1,t2; CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=0; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_multi_update.test b/mysql-test/suite/innodb_plugin/t/innodb_multi_update.test new file mode 100644 index 00000000000..7ab17ccf70a --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_multi_update.test @@ -0,0 +1,29 @@ +-- source include/have_innodb.inc + +# +# Test multi update with different join methods +# + +CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb; +INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); +INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); + +# Full join, without key +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100; +select * from bug38999_1; + +# unique key +update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101; +select * from bug38999_1; + +# ref key +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2; +select * from bug38999_1; + +# Range key (in bug38999_1) +update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100; +select * from bug38999_1; +select * from bug38999_2; + +drop table bug38999_1,bug38999_2; From 3f8a812d7a8df215654e3abbd528e5e4d16c4bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 14:24:11 +0300 Subject: [PATCH 020/121] row_merge_drop_temp_indexes(): Load the table via the dictionary cache. Allow multiple indexes to be dropped. (Bug #53256) --- storage/innodb_plugin/row/row0merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c index d61d626f92e..bedad2d1c71 100644 --- a/storage/innodb_plugin/row/row0merge.c +++ b/storage/innodb_plugin/row/row0merge.c @@ -2087,7 +2087,7 @@ row_merge_drop_temp_indexes(void) btr_pcur_store_position(&pcur, &mtr); btr_pcur_commit_specify_mtr(&pcur, &mtr); - table = dict_load_table_on_id(table_id); + table = dict_table_get_on_id_low(table_id); if (table) { dict_index_t* index; From 3ea54dbfa968fac58c4ca06d1c980c7e36bd856d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 14:45:13 +0300 Subject: [PATCH 021/121] Note the 1.0.7 release --- storage/innodb_plugin/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index fd76d8d40ee..9269703f974 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -77,6 +77,10 @@ * mysql-test/innodb_bug38231.test: Remove non-determinism in the test case. +2010-03-29 The InnoDB Team + + InnoDB Plugin 1.0.7 released + 2010-03-18 The InnoDB Team * CMakeLists.txt: From dc4abe9481fcd5afc57dde78ed166abc90e6c9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 14:50:11 +0300 Subject: [PATCH 022/121] Document Bug #53256 --- storage/innodb_plugin/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 9269703f974..9b8709c4e8e 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2010-05-05 The InnoDB Team + + * row/row0merge.c: + Fix Bug#53256 in a stress test, assert dict/dict0dict.c:815 + table2 == NULL + 2010-05-05 The InnoDB Team * handler/ha_innodb.cc: From fa2c00d316371620d98073737989b68c2c034ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 15:05:55 +0300 Subject: [PATCH 023/121] Re-enable ps_3innodb. --- mysql-test/t/disabled.def | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 68584c6f3e3..03fb781b34f 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -12,4 +12,3 @@ kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild. query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings -ps_3innodb : Bug#53309 2010-04-30 VasilDimov valgrind warnings From 326d75bd414290c1548b5ca337c19887c7165d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 May 2010 15:39:01 +0300 Subject: [PATCH 024/121] Merge a contribution from Ryan Mack at Facebook: Bugfix for 53290, fast unique index creation fails on duplicate null values Summary: Bug in the fast index creation code incorrectly considers null values to be duplicates during block merging. Innodb policy is that multiple null values are allowed in a unique index. Null duplicates were correctly ignored while sorting individual blocks and with slow index creation. Test Plan: mtr, including new test, load dbs using deferred index creation DiffCamp Revision: 110840 Reviewed By: mcallaghan CC: mcallaghan, mysql-devel@lists Revert Plan: OK --- .../innodb_plugin/r/innodb_bug53290.result | 17 ++++++++++++++ .../innodb_plugin/t/innodb_bug53290.test | 22 +++++++++++++++++++ storage/innodb_plugin/include/rem0cmp.h | 4 +++- storage/innodb_plugin/rem/rem0cmp.c | 7 +++++- storage/innodb_plugin/row/row0merge.c | 13 +++++++---- 5 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 mysql-test/suite/innodb_plugin/r/innodb_bug53290.result create mode 100644 mysql-test/suite/innodb_plugin/t/innodb_bug53290.test diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug53290.result b/mysql-test/suite/innodb_plugin/r/innodb_bug53290.result new file mode 100644 index 00000000000..46cd7248c4e --- /dev/null +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug53290.result @@ -0,0 +1,17 @@ +create table bug53290 (x bigint) engine=innodb; +insert into bug53290 () values (),(),(),(),(),(),(),(),(),(),(),(); +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +alter table bug53290 add unique index `idx` (x); +drop table bug53290; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug53290.test b/mysql-test/suite/innodb_plugin/t/innodb_bug53290.test new file mode 100644 index 00000000000..3f6b9b513f7 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug53290.test @@ -0,0 +1,22 @@ +-- source include/have_innodb_plugin.inc + +create table bug53290 (x bigint) engine=innodb; + +insert into bug53290 () values (),(),(),(),(),(),(),(),(),(),(),(); +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; +insert into bug53290 select * from bug53290; + +alter table bug53290 add unique index `idx` (x); + +drop table bug53290; diff --git a/storage/innodb_plugin/include/rem0cmp.h b/storage/innodb_plugin/include/rem0cmp.h index 072f74267ea..2f751a38864 100644 --- a/storage/innodb_plugin/include/rem0cmp.h +++ b/storage/innodb_plugin/include/rem0cmp.h @@ -148,7 +148,9 @@ cmp_rec_rec_simple( const rec_t* rec2, /*!< in: physical record */ const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ - const dict_index_t* index); /*!< in: data dictionary index */ + const dict_index_t* index, /*!< in: data dictionary index */ + ibool* null_eq);/*!< out: set to TRUE if + found matching null values */ /*************************************************************//** This function is used to compare two physical records. Only the common first fields are compared, and if an externally stored field is diff --git a/storage/innodb_plugin/rem/rem0cmp.c b/storage/innodb_plugin/rem/rem0cmp.c index e6dab0bc66b..35b67992558 100644 --- a/storage/innodb_plugin/rem/rem0cmp.c +++ b/storage/innodb_plugin/rem/rem0cmp.c @@ -706,7 +706,9 @@ cmp_rec_rec_simple( const rec_t* rec2, /*!< in: physical record */ const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */ const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */ - const dict_index_t* index) /*!< in: data dictionary index */ + const dict_index_t* index, /*!< in: data dictionary index */ + ibool* null_eq)/*!< out: set to TRUE if + found matching null values */ { ulint rec1_f_len; /*!< length of current field in rec1 */ const byte* rec1_b_ptr; /*!< pointer to the current byte @@ -753,6 +755,9 @@ cmp_rec_rec_simple( || rec2_f_len == UNIV_SQL_NULL) { if (rec1_f_len == rec2_f_len) { + if (null_eq) { + *null_eq = TRUE; + } goto next_field; diff --git a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c index bedad2d1c71..832d29df710 100644 --- a/storage/innodb_plugin/row/row0merge.c +++ b/storage/innodb_plugin/row/row0merge.c @@ -1075,11 +1075,14 @@ row_merge_cmp( record to be compared */ const ulint* offsets1, /*!< in: first record offsets */ const ulint* offsets2, /*!< in: second record offsets */ - const dict_index_t* index) /*!< in: index */ + const dict_index_t* index, /*!< in: index */ + ibool* null_eq) /*!< out: set to TRUE if + found matching null values */ { int cmp; - cmp = cmp_rec_rec_simple(mrec1, mrec2, offsets1, offsets2, index); + cmp = cmp_rec_rec_simple(mrec1, mrec2, offsets1, offsets2, index, + null_eq); #ifdef UNIV_DEBUG if (row_merge_print_cmp) { @@ -1445,11 +1448,13 @@ corrupt: } while (mrec0 && mrec1) { + ibool null_eq = FALSE; switch (row_merge_cmp(mrec0, mrec1, - offsets0, offsets1, index)) { + offsets0, offsets1, index, + &null_eq)) { case 0: if (UNIV_UNLIKELY - (dict_index_is_unique(index))) { + (dict_index_is_unique(index) && !null_eq)) { innobase_rec_to_mysql(table, mrec0, index, offsets0); mem_heap_free(heap); From c5bf05cd9555c9629c91f8874f3d866b73937dc0 Mon Sep 17 00:00:00 2001 From: Sunanda Menon Date: Wed, 5 May 2010 15:33:46 +0200 Subject: [PATCH 025/121] ------------------------------------------------------------ revno: 2861 committer: Georgi Kodinov branch nick: B53371-5.0-bugteam timestamp: Mon 2010-05-03 18:16:51 +0300 message: Bug #53371: COM_FIELD_LIST can be abused to bypass table level grants. The server was not checking the supplied to COM_FIELD_LIST table name for validity and compliance to acceptable table names standards. Fixed by checking the table name for compliance similar to how it's normally checked by the parser and returning an error message if it's not compliant. --- sql/sql_parse.cc | 7 +++++++ tests/mysql_client_test.c | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2b43d95dd7c..807d6c09a46 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2042,6 +2042,13 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } thd->convert_string(&conv_name, system_charset_info, packet, arg_length, thd->charset()); + if (check_table_name (conv_name.str, conv_name.length)) + { + /* this is OK due to convert_string() null-terminating the string */ + my_error(ER_WRONG_TABLE_NAME, MYF(0), conv_name.str); + break; + } + table_list.alias= table_list.table_name= conv_name.str; packet= pend+1; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 63137bdba93..5b26b96707b 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16679,6 +16679,47 @@ static void test_bug45010() } +static void test_bug53371() +{ + int rc; + MYSQL_RES *result; + + myheader("test_bug53371"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + myquery(rc); + rc= mysql_query(mysql, "DROP DATABASE IF EXISTS bug53371"); + myquery(rc); + rc= mysql_query(mysql, "DROP USER 'testbug'@localhost"); + + rc= mysql_query(mysql, "CREATE TABLE t1 (a INT)"); + myquery(rc); + rc= mysql_query(mysql, "CREATE DATABASE bug53371"); + myquery(rc); + rc= mysql_query(mysql, "GRANT SELECT ON bug53371.* to 'testbug'@localhost"); + myquery(rc); + + rc= mysql_change_user(mysql, "testbug", NULL, "bug53371"); + myquery(rc); + + rc= mysql_query(mysql, "SHOW COLUMNS FROM client_test_db.t1"); + DIE_UNLESS(rc); + DIE_UNLESS(mysql_errno(mysql) == 1142); + + result= mysql_list_fields(mysql, "../client_test_db/t1", NULL); + DIE_IF(result); + + rc= mysql_change_user(mysql, opt_user, opt_password, current_db); + myquery(rc); + rc= mysql_query(mysql, "DROP TABLE t1"); + myquery(rc); + rc= mysql_query(mysql, "DROP DATABASE bug53371"); + myquery(rc); + rc= mysql_query(mysql, "DROP USER 'testbug'@localhost"); + myquery(rc); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -16982,6 +17023,7 @@ static struct my_tests_st my_tests[]= { { "test_bug41078", test_bug41078 }, { "test_bug20023", test_bug20023 }, { "test_bug45010", test_bug45010 }, + { "test_bug53371", test_bug53371 }, { 0, 0 } }; From f908dc88bc7257fcf35337e4fd9ff5ee53aa84d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 May 2010 19:58:16 +0200 Subject: [PATCH 026/121] Raise version number after cloning 5.1.47 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 7148c26187a..53852f46981 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.47], [], [mysql]) +AC_INIT([MySQL Server], [5.1.48], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM From 6b062319d40e724c5d74b2d3dc1120ca761d4eeb Mon Sep 17 00:00:00 2001 From: Marko Makela Date: Mon, 10 May 2010 13:37:52 +0200 Subject: [PATCH 027/121] Add an innodb test case for Bug #49164. --- .../suite/innodb/r/innodb_bug49164.result | 42 +++++++++++++++++ .../suite/innodb/t/innodb_bug49164.test | 47 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb_bug49164.result create mode 100644 mysql-test/suite/innodb/t/innodb_bug49164.test diff --git a/mysql-test/suite/innodb/r/innodb_bug49164.result b/mysql-test/suite/innodb/r/innodb_bug49164.result new file mode 100644 index 00000000000..9456702e1d0 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug49164.result @@ -0,0 +1,42 @@ +SET tx_isolation = 'READ-COMMITTED'; +CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b)) +ENGINE=InnoDB; +insert into bug49164 values (1,1,1), (2,2,2), (3,3,3); +begin; +update bug49164 set c=7; +select * from bug49164; +a b c +1 1 7 +2 2 7 +3 3 7 +rollback; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +begin; +update bug49164 set c=7; +SET tx_isolation = 'READ-COMMITTED'; +begin; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +commit; +begin; +update bug49164 set c=6 where a=1 and b=1; +rollback; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +commit; +select * from bug49164; +a b c +1 1 6 +2 2 2 +3 3 3 +drop table bug49164; diff --git a/mysql-test/suite/innodb/t/innodb_bug49164.test b/mysql-test/suite/innodb/t/innodb_bug49164.test new file mode 100644 index 00000000000..7f1c9f4ca9c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug49164.test @@ -0,0 +1,47 @@ +-- source include/have_innodb.inc + +# Bug #49164 READ-COMMITTED reports "matched: 0" on compound PK +# a duplicate of +# Bug #52663 Lost update incrementing column value under READ COMMITTED + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +connection con1; +SET tx_isolation = 'READ-COMMITTED'; + +CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b)) +ENGINE=InnoDB; + +insert into bug49164 values (1,1,1), (2,2,2), (3,3,3); + +begin; +update bug49164 set c=7; +select * from bug49164; +rollback; +select * from bug49164; +begin; +update bug49164 set c=7; + +connection con2; + +SET tx_isolation = 'READ-COMMITTED'; +begin; +select * from bug49164; +commit; +begin; +--send +update bug49164 set c=6 where a=1 and b=1; + +connection con1; +rollback; +select * from bug49164; +connection con2; +reap; +commit; +connection con1; +select * from bug49164; +connection default; +disconnect con1; +disconnect con2; +drop table bug49164; From dcdb8f82b3ba4fe2fbdd5ede4995a8d4e8d0bdaa Mon Sep 17 00:00:00 2001 From: Marko Makela Date: Mon, 10 May 2010 13:38:25 +0200 Subject: [PATCH 028/121] Add an innodb_plugin test case for Bug #49164. --- .../innodb_plugin/r/innodb_bug49164.result | 42 +++++++++++++++++ .../innodb_plugin/t/innodb_bug49164.test | 47 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 mysql-test/suite/innodb_plugin/r/innodb_bug49164.result create mode 100644 mysql-test/suite/innodb_plugin/t/innodb_bug49164.test diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug49164.result b/mysql-test/suite/innodb_plugin/r/innodb_bug49164.result new file mode 100644 index 00000000000..9456702e1d0 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug49164.result @@ -0,0 +1,42 @@ +SET tx_isolation = 'READ-COMMITTED'; +CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b)) +ENGINE=InnoDB; +insert into bug49164 values (1,1,1), (2,2,2), (3,3,3); +begin; +update bug49164 set c=7; +select * from bug49164; +a b c +1 1 7 +2 2 7 +3 3 7 +rollback; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +begin; +update bug49164 set c=7; +SET tx_isolation = 'READ-COMMITTED'; +begin; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +commit; +begin; +update bug49164 set c=6 where a=1 and b=1; +rollback; +select * from bug49164; +a b c +1 1 1 +2 2 2 +3 3 3 +commit; +select * from bug49164; +a b c +1 1 6 +2 2 2 +3 3 3 +drop table bug49164; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug49164.test b/mysql-test/suite/innodb_plugin/t/innodb_bug49164.test new file mode 100644 index 00000000000..a945bc681b6 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug49164.test @@ -0,0 +1,47 @@ +-- source include/have_innodb_plugin.inc + +# Bug #49164 READ-COMMITTED reports "matched: 0" on compound PK +# a duplicate of +# Bug #52663 Lost update incrementing column value under READ COMMITTED + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +connection con1; +SET tx_isolation = 'READ-COMMITTED'; + +CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b)) +ENGINE=InnoDB; + +insert into bug49164 values (1,1,1), (2,2,2), (3,3,3); + +begin; +update bug49164 set c=7; +select * from bug49164; +rollback; +select * from bug49164; +begin; +update bug49164 set c=7; + +connection con2; + +SET tx_isolation = 'READ-COMMITTED'; +begin; +select * from bug49164; +commit; +begin; +--send +update bug49164 set c=6 where a=1 and b=1; + +connection con1; +rollback; +select * from bug49164; +connection con2; +reap; +commit; +connection con1; +select * from bug49164; +connection default; +disconnect con1; +disconnect con2; +drop table bug49164; From 85f8f09c3e6c715e9dab78c4f541e39cb8815e65 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 10 May 2010 16:24:33 +0300 Subject: [PATCH 029/121] Make dict_index_stat_mutex[] static because it is only used in dict0dict.c --- storage/innodb_plugin/dict/dict0dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innodb_plugin/dict/dict0dict.c b/storage/innodb_plugin/dict/dict0dict.c index 83438231689..8e901a3b70b 100644 --- a/storage/innodb_plugin/dict/dict0dict.c +++ b/storage/innodb_plugin/dict/dict0dict.c @@ -82,7 +82,7 @@ static char dict_ibfk[] = "_ibfk_"; /** array of mutexes protecting dict_index_t::stat_n_diff_key_vals[] */ #define DICT_INDEX_STAT_MUTEX_SIZE 32 -mutex_t dict_index_stat_mutex[DICT_INDEX_STAT_MUTEX_SIZE]; +static mutex_t dict_index_stat_mutex[DICT_INDEX_STAT_MUTEX_SIZE]; /*******************************************************************//** Tries to find column names for the index and sets the col field of the From 5acbc67f6e58496eeb8dcfc34232fdc94a856e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 11 May 2010 13:45:00 +0300 Subject: [PATCH 030/121] Remove a stray expression. Spotted by Sunny Bains. --- storage/innodb_plugin/page/page0zip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innodb_plugin/page/page0zip.c b/storage/innodb_plugin/page/page0zip.c index aa5e39ff04a..a64a41ea518 100644 --- a/storage/innodb_plugin/page/page0zip.c +++ b/storage/innodb_plugin/page/page0zip.c @@ -571,7 +571,7 @@ page_zip_dir_encode( /* Traverse the list of stored records in the collation order, starting from the first user record. */ - rec = page + PAGE_NEW_INFIMUM, TRUE; + rec = page + PAGE_NEW_INFIMUM; i = 0; From b7cf210256fbebc458c266d46c767e66cac61369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 11 May 2010 13:49:10 +0300 Subject: [PATCH 031/121] btr_page_split_and_insert(): Add an assertion suggested by Sunny Bains when reviewing Bug #52964. --- storage/innodb_plugin/btr/btr0btr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/innodb_plugin/btr/btr0btr.c b/storage/innodb_plugin/btr/btr0btr.c index 3c24eaac81e..02677e0a71c 100644 --- a/storage/innodb_plugin/btr/btr0btr.c +++ b/storage/innodb_plugin/btr/btr0btr.c @@ -2000,6 +2000,7 @@ func_start: goto insert_empty; } } else if (UNIV_UNLIKELY(insert_left)) { + ut_a(n_iterations > 0); first_rec = page_rec_get_next(page_get_infimum_rec(page)); move_limit = page_rec_get_next(btr_cur_get_rec(cursor)); } else { From 80142dd779c7d45b025417b71fd8bdbffab6840f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 11 May 2010 13:50:12 +0300 Subject: [PATCH 032/121] Do not demand that buf_page_t be fully initialized on 64-bit systems. There may be padding before buf_page_t::zip. (Bug #53307) --- storage/innodb_plugin/buf/buf0lru.c | 10 ++++++++++ storage/innodb_plugin/include/buf0buf.ic | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c index 9cfa02ba3ac..1fa7c088297 100644 --- a/storage/innodb_plugin/buf/buf0lru.c +++ b/storage/innodb_plugin/buf/buf0lru.c @@ -1393,7 +1393,12 @@ buf_LRU_free_block( ut_ad(buf_page_in_file(bpage)); ut_ad(bpage->in_LRU_list); ut_ad(!bpage->in_flush_list == !bpage->oldest_modification); +#if UNIV_WORD_SIZE == 4 + /* On 32-bit systems, there is no padding in buf_page_t. On + other systems, Valgrind could complain about uninitialized pad + bytes. */ UNIV_MEM_ASSERT_RW(bpage, sizeof *bpage); +#endif if (!buf_page_can_relocate(bpage)) { @@ -1688,7 +1693,12 @@ buf_LRU_block_remove_hashed_page( ut_a(buf_page_get_io_fix(bpage) == BUF_IO_NONE); ut_a(bpage->buf_fix_count == 0); +#if UNIV_WORD_SIZE == 4 + /* On 32-bit systems, there is no padding in + buf_page_t. On other systems, Valgrind could complain + about uninitialized pad bytes. */ UNIV_MEM_ASSERT_RW(bpage, sizeof *bpage); +#endif buf_LRU_remove_block(bpage); diff --git a/storage/innodb_plugin/include/buf0buf.ic b/storage/innodb_plugin/include/buf0buf.ic index 378c3590181..23db684806c 100644 --- a/storage/innodb_plugin/include/buf0buf.ic +++ b/storage/innodb_plugin/include/buf0buf.ic @@ -931,7 +931,12 @@ buf_page_hash_get( ut_a(buf_page_in_file(bpage)); ut_ad(bpage->in_page_hash); ut_ad(!bpage->in_zip_hash); +#if UNIV_WORD_SIZE == 4 + /* On 32-bit systems, there is no padding in + buf_page_t. On other systems, Valgrind could complain + about uninitialized pad bytes. */ UNIV_MEM_ASSERT_RW(bpage, sizeof *bpage); +#endif } return(bpage); From 703309a3a8dcc5ca8a2830d421d694e5241cd656 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Tue, 11 May 2010 13:58:28 +0300 Subject: [PATCH 033/121] Raise InnoDB Plugin version from 1.0.8 to 1.0.9. 1.0.8 will be released in MySQL 5.1.47, so 1.0.9 will be released in MySQL 5.1.48 --- storage/innodb_plugin/include/univ.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innodb_plugin/include/univ.i b/storage/innodb_plugin/include/univ.i index 2aa27245d5f..8fb2505a791 100644 --- a/storage/innodb_plugin/include/univ.i +++ b/storage/innodb_plugin/include/univ.i @@ -46,7 +46,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 1 #define INNODB_VERSION_MINOR 0 -#define INNODB_VERSION_BUGFIX 8 +#define INNODB_VERSION_BUGFIX 9 /* The following is the InnoDB version as shown in SELECT plugin_version FROM information_schema.plugins; From 80323e52009ed9db7d014d994c15ce5902f2662d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 11 May 2010 19:58:45 +0300 Subject: [PATCH 034/121] Fix sys_vars.tx_isolation_func.test, which was broken in revno 3432 when making READ UNCOMMITTED lock as little as READ COMMITTED. --- .../suite/sys_vars/r/tx_isolation_func.result | 25 ++++++++++++++++--- .../suite/sys_vars/t/tx_isolation_func.test | 3 --- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/tx_isolation_func.result b/mysql-test/suite/sys_vars/r/tx_isolation_func.result index 2242525f14b..6b4c990c71c 100644 --- a/mysql-test/suite/sys_vars/r/tx_isolation_func.result +++ b/mysql-test/suite/sys_vars/r/tx_isolation_func.result @@ -95,10 +95,7 @@ a b 22 10 24 10 INSERT INTO t1 VALUES(23, 23); -ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t1 VALUES(25, 25); -ERROR HY000: Lock wait timeout exceeded; try restarting transaction -Bug: Only even rows are being locked, error 1205 should'nt have occured SELECT * FROM t1; a b 2 10 @@ -109,7 +106,9 @@ a b 18 10 20 10 22 10 +23 23 24 10 +25 25 COMMIT; ** Connection con0 ** COMMIT; @@ -144,7 +143,9 @@ a b 18 10 20 10 22 10 +23 23 24 10 +25 25 INSERT INTO t1 VALUES(5, 5); INSERT INTO t1 VALUES(7, 7); SELECT * FROM t1; @@ -159,7 +160,9 @@ a b 18 10 20 10 22 10 +23 23 24 10 +25 25 COMMIT; ** Connection con0 ** COMMIT; @@ -196,7 +199,9 @@ a b 18 11 20 11 22 11 +23 23 24 11 +25 25 INSERT INTO t1 VALUES(9, 9); ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t1 VALUES(13, 13); @@ -214,7 +219,9 @@ a b 18 11 20 11 22 11 +23 23 24 11 +25 25 COMMIT; ** Connection con0 ** COMMIT; @@ -225,6 +232,8 @@ SELECT * FROM t1 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0 FOR UPDATE; a b 5 5 7 7 +23 23 +25 25 UPDATE t1 SET b = 13 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0; ** Connection con1 ** START TRANSACTION; @@ -240,7 +249,9 @@ a b 18 12 20 12 22 12 +23 23 24 12 +25 25 INSERT INTO t1 VALUES(9, 9); ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t1 VALUES(13, 13); @@ -258,7 +269,9 @@ a b 18 12 20 12 22 12 +23 23 24 12 +25 25 COMMIT; ** Connection con0 ** COMMIT; @@ -273,7 +286,9 @@ a b 18 12 20 12 22 12 +23 13 24 12 +25 13 UPDATE t1 SET b = 14 WHERE a IN (2,4,6,8) = 0; ** Connection con1 ** START TRANSACTION; @@ -289,7 +304,9 @@ a b 18 12 20 12 22 12 +23 13 24 12 +25 13 INSERT INTO t1 VALUES(9, 9); ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t1 VALUES(13, 13); @@ -307,7 +324,9 @@ a b 18 12 20 12 22 12 +23 13 24 12 +25 13 COMMIT; ** Connection con0 ** COMMIT; diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_func.test b/mysql-test/suite/sys_vars/t/tx_isolation_func.test index 1fd2e323db8..7072de6b086 100644 --- a/mysql-test/suite/sys_vars/t/tx_isolation_func.test +++ b/mysql-test/suite/sys_vars/t/tx_isolation_func.test @@ -134,12 +134,9 @@ START TRANSACTION; SELECT * FROM t1; ---error ER_LOCK_WAIT_TIMEOUT INSERT INTO t1 VALUES(23, 23); ---error ER_LOCK_WAIT_TIMEOUT INSERT INTO t1 VALUES(25, 25); ---echo Bug: Only even rows are being locked, error 1205 should'nt have occured SELECT * FROM t1; From 2c889b9dbce849af72933af437c707f5e463c037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 12 May 2010 08:39:25 +0300 Subject: [PATCH 035/121] row_merge_drop_temp_indexes(): Do not reference freed memory. (Bug #53471) --- storage/innodb_plugin/row/row0merge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c index 832d29df710..f3a695071d3 100644 --- a/storage/innodb_plugin/row/row0merge.c +++ b/storage/innodb_plugin/row/row0merge.c @@ -2096,9 +2096,12 @@ row_merge_drop_temp_indexes(void) if (table) { dict_index_t* index; + dict_index_t* next_index; for (index = dict_table_get_first_index(table); - index; index = dict_table_get_next_index(index)) { + index; index = next_index) { + + next_index = dict_table_get_next_index(index); if (*index->name == TEMP_INDEX_PREFIX) { row_merge_drop_index(index, table, trx); From 96853eed5444f6b0f7f1997ed9162a23be6d3fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 12 May 2010 09:09:22 +0300 Subject: [PATCH 036/121] Document recent fixes in ChangeLog. --- storage/innodb_plugin/ChangeLog | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 9b8709c4e8e..36514baa06a 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,19 @@ +2010-05-12 The InnoDB Team + + * row/row0merge.c: + Fix Bug#53471 row_merge_drop_temp_indexes() refers freed memory, SEGVs + +2010-05-11 The InnoDB Team + + * mysql-test/innodb_bug53290.test, mysql-test/innodb_bug53290.result, + include/rem0cmp.h, rem/rem0cmp.c, row/row0merge.c: + Fix Bug#53290 wrong duplicate key error when adding a unique index + via fast alter table + +2010-05-11 The InnoDB Team + * buf/buf0lru.c, include/buf0buf.ic: + Fix Bug#53307 valgrind: warnings in main.partition_innodb_plugin + 2010-05-05 The InnoDB Team * row/row0merge.c: From bfdae6402c293e863a517b537c23702186fde73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 12 May 2010 13:42:12 +0300 Subject: [PATCH 037/121] ha_innobase::add_index(): Reset trx->error_state in error handling. (Bug #53591) --- .../innodb_plugin/r/innodb_bug53591.result | 16 ++++++++++++++ .../innodb_plugin/t/innodb_bug53591.test | 22 +++++++++++++++++++ .../innodb_plugin/handler/handler0alter.cc | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 mysql-test/suite/innodb_plugin/r/innodb_bug53591.result create mode 100644 mysql-test/suite/innodb_plugin/t/innodb_bug53591.test diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result b/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result new file mode 100644 index 00000000000..1f05b6d2a57 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result @@ -0,0 +1,16 @@ +SET GLOBAL innodb_file_format='Barracuda'; +SET GLOBAL innodb_file_per_table=on; +set old_alter_table=0; +CREATE TABLE bug53591(a text charset utf8 not null) +ENGINE=InnoDB KEY_BLOCK_SIZE=1; +ALTER TABLE bug53591 ADD PRIMARY KEY(a(220)); +ERROR HY000: Too big row +SHOW WARNINGS; +Level Code Message +Error 139 Too big row +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs +Error 1030 Got error 139 from storage engine +DROP TABLE bug53591; +SET GLOBAL innodb_file_format=Antelope; +SET GLOBAL innodb_file_format_check=Antelope; +SET GLOBAL innodb_file_per_table=0; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug53591.test b/mysql-test/suite/innodb_plugin/t/innodb_bug53591.test new file mode 100644 index 00000000000..760b4630383 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug53591.test @@ -0,0 +1,22 @@ +-- source include/have_innodb_plugin.inc + +let $file_format=`select @@innodb_file_format`; +let $file_format_check=`select @@innodb_file_format_check`; +let $file_per_table=`select @@innodb_file_per_table`; + +SET GLOBAL innodb_file_format='Barracuda'; +SET GLOBAL innodb_file_per_table=on; + +set old_alter_table=0; + +CREATE TABLE bug53591(a text charset utf8 not null) +ENGINE=InnoDB KEY_BLOCK_SIZE=1; +-- error 139 +ALTER TABLE bug53591 ADD PRIMARY KEY(a(220)); +SHOW WARNINGS; + +DROP TABLE bug53591; + +EVAL SET GLOBAL innodb_file_format=$file_format; +EVAL SET GLOBAL innodb_file_format_check=$file_format_check; +EVAL SET GLOBAL innodb_file_per_table=$file_per_table; diff --git a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc index e474c318c58..e936bfafa0e 100644 --- a/storage/innodb_plugin/handler/handler0alter.cc +++ b/storage/innodb_plugin/handler/handler0alter.cc @@ -894,6 +894,8 @@ error: prebuilt->trx->error_info = NULL; /* fall through */ default: + trx->error_state = DB_SUCCESS; + if (new_primary) { if (indexed_table != innodb_table) { row_merge_drop_table(trx, indexed_table); From 42a07d5040d21f59d91f427edb2ec304089306df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 12 May 2010 13:46:03 +0300 Subject: [PATCH 038/121] Document the Bug #53591 fix in the ChangeLog. --- storage/innodb_plugin/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 36514baa06a..169f859b8fd 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2010-05-12 The InnoDB Team + + * handler/handler0alter.cc: + Fix Bug#53591 crash with fast alter table and text/blob prefix + primary key + 2010-05-12 The InnoDB Team * row/row0merge.c: From 162ab29157201ca075fccd405bb23f2626a11a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 14 May 2010 13:51:26 +0300 Subject: [PATCH 039/121] Remove unused code. --- storage/innobase/srv/srv0start.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c index a7950473a17..9d057110d11 100644 --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -102,20 +102,6 @@ static char* srv_monitor_file_name; #define SRV_MAX_N_PENDING_SYNC_IOS 100 -/* Avoid warnings when using purify */ - -#ifdef HAVE_purify -static int inno_bcmp(register const char *s1, register const char *s2, - register uint len) -{ - while ((len-- != 0) && (*s1++ == *s2++)) - ; - - return(len + 1); -} -#define memcmp(A,B,C) inno_bcmp((A),(B),(C)) -#endif - static char* srv_parse_megabytes( From c3c2279cbd8427f29c3e884336b154ddf0a803c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 14 May 2010 16:02:28 +0300 Subject: [PATCH 040/121] Make the InnoDB FOREIGN KEY parser understand multi-statements. (Bug #48024) Also make InnoDB thinks that /*/ only starts a comment. (Bug #53644). struct trx_struct: Add mysql_query_len. ha_innodb.cc: Use trx_query_string() instead of trx_query() and initialize trx->mysql_query_len. INNOBASE_COPY_STMT(thd, trx): New macro, to initialize trx->mysql_query_str and trx->mysql_query_len. dict_strip_comments(): Add and observe the parameter sql_length. Treat /*/ as the start of a comment. dict_create_foreign_constraints(), row_table_add_foreign_constraints(): Add the parameter sql_length. --- .../suite/innodb/r/innodb_bug48024.result | 10 ++++ .../suite/innodb/t/innodb_bug48024.test | 20 ++++++++ storage/innobase/dict/dict0dict.c | 48 +++++++++++-------- storage/innobase/handler/ha_innodb.cc | 25 +++++++--- storage/innobase/handler/ha_innodb.h | 2 +- storage/innobase/include/dict0dict.h | 1 + storage/innobase/include/row0mysql.h | 1 + storage/innobase/include/trx0trx.h | 2 + storage/innobase/row/row0mysql.c | 5 +- storage/innobase/trx/trx0trx.c | 3 ++ 10 files changed, 88 insertions(+), 29 deletions(-) create mode 100644 mysql-test/suite/innodb/r/innodb_bug48024.result create mode 100644 mysql-test/suite/innodb/t/innodb_bug48024.test diff --git a/mysql-test/suite/innodb/r/innodb_bug48024.result b/mysql-test/suite/innodb/r/innodb_bug48024.result new file mode 100644 index 00000000000..611923d2796 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug48024.result @@ -0,0 +1,10 @@ +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b); +DROP TABLE bug48024,bug48024_b; +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)| +DROP TABLE bug48024,bug48024_b; diff --git a/mysql-test/suite/innodb/t/innodb_bug48024.test b/mysql-test/suite/innodb/t/innodb_bug48024.test new file mode 100644 index 00000000000..00d76beb89d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug48024.test @@ -0,0 +1,20 @@ +# Bug #48024 Innodb doesn't work with multi-statements + +--source include/have_innodb.inc + +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +# Bug #53644 InnoDB thinks that /*/ starts and ends a comment +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b); + +DROP TABLE bug48024,bug48024_b; + +delimiter |; +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)| +delimiter ;| + +DROP TABLE bug48024,bug48024_b; diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index b8251a99105..d3b277d2d7a 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -2586,25 +2586,28 @@ dict_strip_comments( /* out, own: SQL string stripped from comments; the caller must free this with mem_free()! */ - const char* sql_string) /* in: SQL string */ + const char* sql_string, /* in: SQL string */ + size_t sql_length) /* in: length of sql_string */ { char* str; const char* sptr; + const char* eptr = sql_string + sql_length; char* ptr; /* unclosed quote character (0 if none) */ char quote = 0; - str = mem_alloc(strlen(sql_string) + 1); + str = mem_alloc(sql_length + 1); sptr = sql_string; ptr = str; for (;;) { scan_more: - if (*sptr == '\0') { + if (sptr >= eptr || *sptr == '\0') { +end_of_string: *ptr = '\0'; - ut_a(ptr <= str + strlen(sql_string)); + ut_a(ptr <= str + sql_length); return(str); } @@ -2623,30 +2626,35 @@ scan_more: || (sptr[0] == '-' && sptr[1] == '-' && sptr[2] == ' ')) { for (;;) { + if (++sptr >= eptr) { + goto end_of_string; + } + /* In Unix a newline is 0x0A while in Windows it is 0x0D followed by 0x0A */ - if (*sptr == (char)0x0A - || *sptr == (char)0x0D - || *sptr == '\0') { - + switch (*sptr) { + case (char) 0X0A: + case (char) 0x0D: + case '\0': goto scan_more; } - - sptr++; } } else if (!quote && *sptr == '/' && *(sptr + 1) == '*') { + sptr += 2; for (;;) { - if (*sptr == '*' && *(sptr + 1) == '/') { - - sptr += 2; - - goto scan_more; + if (sptr >= eptr) { + goto end_of_string; } - if (*sptr == '\0') { - + switch (*sptr) { + case '\0': goto scan_more; + case '*': + if (sptr[1] == '/') { + sptr += 2; + goto scan_more; + } } sptr++; @@ -3348,6 +3356,7 @@ dict_create_foreign_constraints( name before it: test.table2; the default database id the database of parameter name */ + size_t sql_length, /* in: length of sql_string */ const char* name, /* in: table full name in the normalized form database_name/table_name */ @@ -3362,7 +3371,7 @@ dict_create_foreign_constraints( ut_a(trx); ut_a(trx->mysql_thd); - str = dict_strip_comments(sql_string); + str = dict_strip_comments(sql_string, sql_length); heap = mem_heap_create(10000); err = dict_create_foreign_constraints_low( @@ -3411,7 +3420,8 @@ dict_foreign_parse_drop_constraints( *constraints_to_drop = mem_heap_alloc(heap, 1000 * sizeof(char*)); - str = dict_strip_comments(*(trx->mysql_query_str)); + str = dict_strip_comments(*trx->mysql_query_str, + *trx->mysql_query_len); ptr = str; ut_ad(mutex_own(&(dict_sys->mutex))); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ebf01fbc296..f2a6c52ce7b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1140,6 +1140,15 @@ innobase_next_autoinc( return(next_value); } +/** Copy the current SQL statement. +* @param[in] thd MySQL client connection +* @param[in/out] trx InnoDB transaction */ +#define INNOBASE_COPY_STMT(thd, trx) do { \ + LEX_STRING* stmt = thd_query_string(thd); \ + (trx)->mysql_query_str = &stmt->str; \ + (trx)->mysql_query_len = &stmt->length; \ +} while (0) + /************************************************************************* Gets the InnoDB transaction handle for a MySQL handler object, creates an InnoDB transaction struct if the corresponding MySQL thread struct still @@ -1160,7 +1169,7 @@ check_trx_exists( trx = trx_allocate_for_mysql(); trx->mysql_thd = thd; - trx->mysql_query_str = thd_query(thd); + INNOBASE_COPY_STMT(thd, trx); /* Update the info whether we should skip XA steps that eat CPU time */ @@ -5578,7 +5587,7 @@ ha_innobase::create( trx = trx_allocate_for_mysql(); trx->mysql_thd = thd; - trx->mysql_query_str = thd_query(thd); + INNOBASE_COPY_STMT(thd, trx); if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { trx->check_foreigns = FALSE; @@ -5674,8 +5683,10 @@ ha_innobase::create( } if (*trx->mysql_query_str) { - error = row_table_add_foreign_constraints(trx, - *trx->mysql_query_str, norm_name, + error = row_table_add_foreign_constraints( + trx, + *trx->mysql_query_str, *trx->mysql_query_len, + norm_name, create_info->options & HA_LEX_CREATE_TMP_TABLE); error = convert_error_code_to_mysql(error, NULL); @@ -5866,7 +5877,7 @@ ha_innobase::delete_table( trx = trx_allocate_for_mysql(); trx->mysql_thd = thd; - trx->mysql_query_str = thd_query(thd); + INNOBASE_COPY_STMT(thd, trx); if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { trx->check_foreigns = FALSE; @@ -5955,7 +5966,7 @@ innobase_drop_database( #endif trx = trx_allocate_for_mysql(); trx->mysql_thd = thd; - trx->mysql_query_str = thd_query(thd); + INNOBASE_COPY_STMT(thd, trx); if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { trx->check_foreigns = FALSE; @@ -6025,7 +6036,7 @@ ha_innobase::rename_table( trx = trx_allocate_for_mysql(); trx->mysql_thd = thd; - trx->mysql_query_str = thd_query(thd); + INNOBASE_COPY_STMT(thd, trx); if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { trx->check_foreigns = FALSE; diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 5b3df16875a..eb9199b8955 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -210,7 +210,7 @@ the definitions are bracketed with #ifdef INNODB_COMPATIBILITY_HOOKS */ extern "C" { struct charset_info_st *thd_charset(MYSQL_THD thd); -char **thd_query(MYSQL_THD thd); +LEX_STRING *thd_query_string(MYSQL_THD thd); /** Get the file name of the MySQL binlog. * @return the name of the binlog file diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 7d5ff09c7a6..e76f23d0767 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -309,6 +309,7 @@ dict_create_foreign_constraints( name before it: test.table2; the default database id the database of parameter name */ + size_t sql_length, /* in: length of sql_string */ const char* name, /* in: table full name in the normalized form database_name/table_name */ diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 5430190fa51..40fcdbb9548 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -366,6 +366,7 @@ row_table_add_foreign_constraints( FOREIGN KEY (a, b) REFERENCES table2(c, d), table2 can be written also with the database name before it: test.table2 */ + size_t sql_length, /* in: length of sql_string */ const char* name, /* in: table full name in the normalized form database_name/table_name */ diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index cdbf1970715..97a47d9f46e 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -444,6 +444,8 @@ struct trx_struct{ char** mysql_query_str;/* pointer to the field in mysqld_thd which contains the pointer to the current SQL query string */ + size_t* mysql_query_len;/* pointer to the length of the + current SQL query string */ const char* mysql_log_file_name; /* if MySQL binlog is used, this field contains a pointer to the latest file diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index a0e0ee99775..20fb69499a1 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -2103,6 +2103,7 @@ row_table_add_foreign_constraints( FOREIGN KEY (a, b) REFERENCES table2(c, d), table2 can be written also with the database name before it: test.table2 */ + size_t sql_length, /* in: length of sql_string */ const char* name, /* in: table full name in the normalized form database_name/table_name */ @@ -2124,8 +2125,8 @@ row_table_add_foreign_constraints( trx->dict_operation = TRUE; - err = dict_create_foreign_constraints(trx, sql_string, name, - reject_fks); + err = dict_create_foreign_constraints(trx, sql_string, sql_length, + name, reject_fks); if (err == DB_SUCCESS) { /* Check that also referencing constraints are ok */ diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index fae479feddc..545226a5994 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -131,6 +131,8 @@ trx_create( trx->mysql_thd = NULL; trx->mysql_query_str = NULL; + trx->mysql_query_len = NULL; + trx->active_trans = 0; trx->duplicates = 0; @@ -936,6 +938,7 @@ trx_commit_off_kernel( trx->undo_no = ut_dulint_zero; trx->last_sql_stat_start.least_undo_no = ut_dulint_zero; trx->mysql_query_str = NULL; + trx->mysql_query_len = NULL; ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0); ut_ad(UT_LIST_GET_LEN(trx->trx_locks) == 0); From 54f59fb55ee1c88d2a47222c3dfc3511e575a6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 14 May 2010 16:08:15 +0300 Subject: [PATCH 041/121] Make the InnoDB FOREIGN KEY parser understand multi-statements. (Bug #48024) Also make InnoDB thinks that /*/ only starts a comment. (Bug #53644). This fixes the bugs in the InnoDB Plugin. ha_innodb.h: Use trx_query_string() instead of trx_query() when available (MySQL 5.1.42 or later). innobase_get_stmt(): New function, to retrieve the currently running SQL statement. struct trx_struct: Remove mysql_query_str. Use innobase_get_stmt() instead. dict_strip_comments(): Add and observe the parameter sql_length. Treat /*/ as the start of a comment. dict_create_foreign_constraints(), row_table_add_foreign_constraints(): Add the parameter sql_length. --- .../innodb_plugin/r/innodb_bug48024.result | 10 ++++ .../innodb_plugin/t/innodb_bug48024.test | 20 ++++++++ storage/innodb_plugin/dict/dict0dict.c | 51 ++++++++++++------- storage/innodb_plugin/handler/ha_innodb.cc | 35 +++++++++++-- storage/innodb_plugin/handler/ha_innodb.h | 4 ++ storage/innodb_plugin/include/dict0dict.h | 1 + storage/innodb_plugin/include/ha_prototypes.h | 12 ++++- storage/innodb_plugin/include/row0mysql.h | 1 + storage/innodb_plugin/include/trx0trx.h | 3 -- storage/innodb_plugin/row/row0mysql.c | 5 +- storage/innodb_plugin/trx/trx0i_s.c | 40 +++++++-------- storage/innodb_plugin/trx/trx0trx.c | 2 - 12 files changed, 131 insertions(+), 53 deletions(-) create mode 100644 mysql-test/suite/innodb_plugin/r/innodb_bug48024.result create mode 100644 mysql-test/suite/innodb_plugin/t/innodb_bug48024.test diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug48024.result b/mysql-test/suite/innodb_plugin/r/innodb_bug48024.result new file mode 100644 index 00000000000..611923d2796 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug48024.result @@ -0,0 +1,10 @@ +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b); +DROP TABLE bug48024,bug48024_b; +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)| +DROP TABLE bug48024,bug48024_b; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug48024.test b/mysql-test/suite/innodb_plugin/t/innodb_bug48024.test new file mode 100644 index 00000000000..3bcfe74eda0 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug48024.test @@ -0,0 +1,20 @@ +# Bug #48024 Innodb doesn't work with multi-statements + +--source include/have_innodb_plugin.inc + +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +# Bug #53644 InnoDB thinks that /*/ starts and ends a comment +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b); + +DROP TABLE bug48024,bug48024_b; + +delimiter |; +CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; +CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/ +ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)| +delimiter ;| + +DROP TABLE bug48024,bug48024_b; diff --git a/storage/innodb_plugin/dict/dict0dict.c b/storage/innodb_plugin/dict/dict0dict.c index 8e901a3b70b..61f70c72720 100644 --- a/storage/innodb_plugin/dict/dict0dict.c +++ b/storage/innodb_plugin/dict/dict0dict.c @@ -3008,25 +3008,28 @@ static char* dict_strip_comments( /*================*/ - const char* sql_string) /*!< in: SQL string */ + const char* sql_string, /*!< in: SQL string */ + size_t sql_length) /*!< in: length of sql_string */ { char* str; const char* sptr; + const char* eptr = sql_string + sql_length; char* ptr; /* unclosed quote character (0 if none) */ char quote = 0; - str = mem_alloc(strlen(sql_string) + 1); + str = mem_alloc(sql_length + 1); sptr = sql_string; ptr = str; for (;;) { scan_more: - if (*sptr == '\0') { + if (sptr >= eptr || *sptr == '\0') { +end_of_string: *ptr = '\0'; - ut_a(ptr <= str + strlen(sql_string)); + ut_a(ptr <= str + sql_length); return(str); } @@ -3045,30 +3048,35 @@ scan_more: || (sptr[0] == '-' && sptr[1] == '-' && sptr[2] == ' ')) { for (;;) { + if (++sptr >= eptr) { + goto end_of_string; + } + /* In Unix a newline is 0x0A while in Windows it is 0x0D followed by 0x0A */ - if (*sptr == (char)0x0A - || *sptr == (char)0x0D - || *sptr == '\0') { - + switch (*sptr) { + case (char) 0X0A: + case (char) 0x0D: + case '\0': goto scan_more; } - - sptr++; } } else if (!quote && *sptr == '/' && *(sptr + 1) == '*') { + sptr += 2; for (;;) { - if (*sptr == '*' && *(sptr + 1) == '/') { - - sptr += 2; - - goto scan_more; + if (sptr >= eptr) { + goto end_of_string; } - if (*sptr == '\0') { - + switch (*sptr) { + case '\0': goto scan_more; + case '*': + if (sptr[1] == '/') { + sptr += 2; + goto scan_more; + } } sptr++; @@ -3749,6 +3757,7 @@ dict_create_foreign_constraints( name before it: test.table2; the default database id the database of parameter name */ + size_t sql_length, /*!< in: length of sql_string */ const char* name, /*!< in: table full name in the normalized form database_name/table_name */ @@ -3763,7 +3772,7 @@ dict_create_foreign_constraints( ut_a(trx); ut_a(trx->mysql_thd); - str = dict_strip_comments(sql_string); + str = dict_strip_comments(sql_string, sql_length); heap = mem_heap_create(10000); err = dict_create_foreign_constraints_low( @@ -3796,6 +3805,7 @@ dict_foreign_parse_drop_constraints( dict_foreign_t* foreign; ibool success; char* str; + size_t len; const char* ptr; const char* id; FILE* ef = dict_foreign_err_file; @@ -3810,7 +3820,10 @@ dict_foreign_parse_drop_constraints( *constraints_to_drop = mem_heap_alloc(heap, 1000 * sizeof(char*)); - str = dict_strip_comments(*(trx->mysql_query_str)); + ptr = innobase_get_stmt(trx->mysql_thd, &len); + + str = dict_strip_comments(ptr, len); + ptr = str; ut_ad(mutex_own(&(dict_sys->mutex))); diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc index 0a2340d0f67..bd0618b7424 100644 --- a/storage/innodb_plugin/handler/ha_innodb.cc +++ b/storage/innodb_plugin/handler/ha_innodb.cc @@ -1004,6 +1004,29 @@ innobase_get_charset( return(thd_charset((THD*) mysql_thd)); } +/**********************************************************************//** +Determines the current SQL statement. +@return SQL statement string */ +extern "C" UNIV_INTERN +const char* +innobase_get_stmt( +/*==============*/ + void* mysql_thd, /*!< in: MySQL thread handle */ + size_t* length) /*!< out: length of the SQL statement */ +{ +#if MYSQL_VERSION_ID >= 50142 + LEX_STRING* stmt; + + stmt = thd_query_string((THD*) mysql_thd); + *length = stmt->length; + return(stmt->str); +#else + const char* stmt_str = thd_query((THD*) mysql_thd); + *length = strlen(stmt_str); + return(stmt_str); +#endif +} + #if defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN) extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list; /*******************************************************************//** @@ -1314,7 +1337,6 @@ innobase_trx_allocate( trx = trx_allocate_for_mysql(); trx->mysql_thd = thd; - trx->mysql_query_str = thd_query(thd); innobase_trx_init(thd, trx); @@ -6433,6 +6455,8 @@ ha_innobase::create( /* Cache the value of innodb_file_format, in case it is modified by another thread while the table is being created. */ const ulint file_format = srv_file_format; + const char* stmt; + size_t stmt_len; DBUG_ENTER("ha_innobase::create"); @@ -6709,9 +6733,11 @@ ha_innobase::create( } } - if (*trx->mysql_query_str) { - error = row_table_add_foreign_constraints(trx, - *trx->mysql_query_str, norm_name, + stmt = innobase_get_stmt(thd, &stmt_len); + + if (stmt) { + error = row_table_add_foreign_constraints( + trx, stmt, stmt_len, norm_name, create_info->options & HA_LEX_CREATE_TMP_TABLE); error = convert_error_code_to_mysql(error, flags, NULL); @@ -6996,7 +7022,6 @@ innobase_drop_database( /* In the Windows plugin, thd = current_thd is always NULL */ trx = trx_allocate_for_mysql(); trx->mysql_thd = NULL; - trx->mysql_query_str = NULL; #else trx = innobase_trx_allocate(thd); #endif diff --git a/storage/innodb_plugin/handler/ha_innodb.h b/storage/innodb_plugin/handler/ha_innodb.h index 8a3e1ccff82..9789e4ba639 100644 --- a/storage/innodb_plugin/handler/ha_innodb.h +++ b/storage/innodb_plugin/handler/ha_innodb.h @@ -231,7 +231,11 @@ the definitions are bracketed with #ifdef INNODB_COMPATIBILITY_HOOKS */ extern "C" { struct charset_info_st *thd_charset(MYSQL_THD thd); +#if MYSQL_VERSION_ID >= 50142 +LEX_STRING *thd_query_string(MYSQL_THD thd); +#else char **thd_query(MYSQL_THD thd); +#endif /** Get the file name of the MySQL binlog. * @return the name of the binlog file diff --git a/storage/innodb_plugin/include/dict0dict.h b/storage/innodb_plugin/include/dict0dict.h index 79dcbb30de2..3a1bee4cd89 100644 --- a/storage/innodb_plugin/include/dict0dict.h +++ b/storage/innodb_plugin/include/dict0dict.h @@ -352,6 +352,7 @@ dict_create_foreign_constraints( name before it: test.table2; the default database id the database of parameter name */ + size_t sql_length, /*!< in: length of sql_string */ const char* name, /*!< in: table full name in the normalized form database_name/table_name */ diff --git a/storage/innodb_plugin/include/ha_prototypes.h b/storage/innodb_plugin/include/ha_prototypes.h index b737a00b3dc..e897a233a6a 100644 --- a/storage/innodb_plugin/include/ha_prototypes.h +++ b/storage/innodb_plugin/include/ha_prototypes.h @@ -215,11 +215,21 @@ innobase_casedn_str( /**********************************************************************//** Determines the connection character set. @return connection character set */ +UNIV_INTERN struct charset_info_st* innobase_get_charset( /*=================*/ void* mysql_thd); /*!< in: MySQL thread handle */ - +/**********************************************************************//** +Determines the current SQL statement. +@return SQL statement string */ +UNIV_INTERN +const char* +innobase_get_stmt( +/*==============*/ + void* mysql_thd, /*!< in: MySQL thread handle */ + size_t* length) /*!< out: length of the SQL statement */ + __attribute__((nonnull)); /******************************************************************//** This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set. The function diff --git a/storage/innodb_plugin/include/row0mysql.h b/storage/innodb_plugin/include/row0mysql.h index d2a8734c61f..bf9cda1ba80 100644 --- a/storage/innodb_plugin/include/row0mysql.h +++ b/storage/innodb_plugin/include/row0mysql.h @@ -403,6 +403,7 @@ row_table_add_foreign_constraints( FOREIGN KEY (a, b) REFERENCES table2(c, d), table2 can be written also with the database name before it: test.table2 */ + size_t sql_length, /*!< in: length of sql_string */ const char* name, /*!< in: table full name in the normalized form database_name/table_name */ diff --git a/storage/innodb_plugin/include/trx0trx.h b/storage/innodb_plugin/include/trx0trx.h index 6872fb463c0..abd175d365b 100644 --- a/storage/innodb_plugin/include/trx0trx.h +++ b/storage/innodb_plugin/include/trx0trx.h @@ -560,9 +560,6 @@ struct trx_struct{ /*------------------------------*/ void* mysql_thd; /*!< MySQL thread handle corresponding to this trx, or NULL */ - char** mysql_query_str;/* pointer to the field in mysqld_thd - which contains the pointer to the - current SQL query string */ const char* mysql_log_file_name; /* if MySQL binlog is used, this field contains a pointer to the latest file diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c index 24abf8067f2..ff3491a4f31 100644 --- a/storage/innodb_plugin/row/row0mysql.c +++ b/storage/innodb_plugin/row/row0mysql.c @@ -2059,6 +2059,7 @@ row_table_add_foreign_constraints( FOREIGN KEY (a, b) REFERENCES table2(c, d), table2 can be written also with the database name before it: test.table2 */ + size_t sql_length, /*!< in: length of sql_string */ const char* name, /*!< in: table full name in the normalized form database_name/table_name */ @@ -2080,8 +2081,8 @@ row_table_add_foreign_constraints( trx_set_dict_operation(trx, TRX_DICT_OP_TABLE); - err = dict_create_foreign_constraints(trx, sql_string, name, - reject_fks); + err = dict_create_foreign_constraints(trx, sql_string, sql_length, + name, reject_fks); if (err == DB_SUCCESS) { /* Check that also referencing constraints are ok */ err = dict_load_foreigns(name, TRUE); diff --git a/storage/innodb_plugin/trx/trx0i_s.c b/storage/innodb_plugin/trx/trx0i_s.c index c160eb2942a..5bc8302d0c0 100644 --- a/storage/innodb_plugin/trx/trx0i_s.c +++ b/storage/innodb_plugin/trx/trx0i_s.c @@ -429,6 +429,9 @@ fill_trx_row( which to copy volatile strings */ { + const char* stmt; + size_t stmt_len; + row->trx_id = trx_get_id(trx); row->trx_started = (ib_time_t) trx->start_time; row->trx_state = trx_get_que_state_str(trx); @@ -449,38 +452,33 @@ fill_trx_row( row->trx_weight = (ullint) ut_conv_dulint_to_longlong(TRX_WEIGHT(trx)); - if (trx->mysql_thd != NULL) { - row->trx_mysql_thread_id - = thd_get_thread_id(trx->mysql_thd); - } else { + if (trx->mysql_thd == NULL) { /* For internal transactions e.g., purge and transactions being recovered at startup there is no associated MySQL thread data structure. */ row->trx_mysql_thread_id = 0; + row->trx_query = NULL; + return(TRUE); } - if (trx->mysql_query_str != NULL && *trx->mysql_query_str != NULL) { + row->trx_mysql_thread_id = thd_get_thread_id(trx->mysql_thd); + stmt = innobase_get_stmt(trx->mysql_thd, &stmt_len); - if (strlen(*trx->mysql_query_str) - > TRX_I_S_TRX_QUERY_MAX_LEN) { + if (stmt != NULL) { - char query[TRX_I_S_TRX_QUERY_MAX_LEN + 1]; + char query[TRX_I_S_TRX_QUERY_MAX_LEN + 1]; - memcpy(query, *trx->mysql_query_str, - TRX_I_S_TRX_QUERY_MAX_LEN); - query[TRX_I_S_TRX_QUERY_MAX_LEN] = '\0'; - - row->trx_query = ha_storage_put_memlim( - cache->storage, query, - TRX_I_S_TRX_QUERY_MAX_LEN + 1, - MAX_ALLOWED_FOR_STORAGE(cache)); - } else { - - row->trx_query = ha_storage_put_str_memlim( - cache->storage, *trx->mysql_query_str, - MAX_ALLOWED_FOR_STORAGE(cache)); + if (stmt_len > TRX_I_S_TRX_QUERY_MAX_LEN) { + stmt_len = TRX_I_S_TRX_QUERY_MAX_LEN; } + memcpy(query, stmt, stmt_len); + query[stmt_len] = '\0'; + + row->trx_query = ha_storage_put_memlim( + cache->storage, stmt, stmt_len + 1, + MAX_ALLOWED_FOR_STORAGE(cache)); + if (row->trx_query == NULL) { return(FALSE); diff --git a/storage/innodb_plugin/trx/trx0trx.c b/storage/innodb_plugin/trx/trx0trx.c index 6ef7e62e6ae..9722bb59a5e 100644 --- a/storage/innodb_plugin/trx/trx0trx.c +++ b/storage/innodb_plugin/trx/trx0trx.c @@ -119,7 +119,6 @@ trx_create( trx->table_id = ut_dulint_zero; trx->mysql_thd = NULL; - trx->mysql_query_str = NULL; trx->active_trans = 0; trx->duplicates = 0; @@ -940,7 +939,6 @@ trx_commit_off_kernel( trx->rseg = NULL; trx->undo_no = ut_dulint_zero; trx->last_sql_stat_start.least_undo_no = ut_dulint_zero; - trx->mysql_query_str = NULL; ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0); ut_ad(UT_LIST_GET_LEN(trx->trx_locks) == 0); From d32bf00e21b72f1abf1f5dcb58ae8ee64b4a1d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 14 May 2010 16:10:50 +0300 Subject: [PATCH 042/121] Document Bug #48024 and Bug #53644 in the ChangeLog --- storage/innodb_plugin/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 169f859b8fd..a05e1ebc716 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,11 @@ +2010-05-14 The InnoDB Team + * mysql-test/innodb_bug48024.test, mysql-test/innodb_bug48024.result, + dict/dict0dict.c, handler/ha_innodb.cc, handler/ha_innodb.h, + include/dict0dict.h, include/ha_prototypes.h, include/row0mysql.h, + include/trx0trx.h, row/row0mysql.c, trx/trx0i_s.c, trx/trx0trx.c: + Fix Bug#48024 Innodb doesn't work with multi-statements + Fix Bug#53644 InnoDB thinks that /*/ starts and ends a comment + 2010-05-12 The InnoDB Team * handler/handler0alter.cc: From 4ff217a4584428943eddadb23719dfaa82db1c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 18 May 2010 16:06:58 +0300 Subject: [PATCH 043/121] Work around Bug #53750 in innodb_bug48024.test --- mysql-test/suite/innodb_plugin/t/innodb_bug48024.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug48024.test b/mysql-test/suite/innodb_plugin/t/innodb_bug48024.test index 3bcfe74eda0..fea3adf9216 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug48024.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug48024.test @@ -10,6 +10,8 @@ ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b); DROP TABLE bug48024,bug48024_b; +# Work around Bug #53750 (failure in mysql-test-run --ps-protocol) +-- disable_ps_protocol delimiter |; CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; From a1250799afb6e162388392a36a69af66f6e0af54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 May 2010 10:56:13 +0300 Subject: [PATCH 044/121] Work around Bug #53750 in innodb.innodb_bug48024 --- mysql-test/suite/innodb/t/innodb_bug48024.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/innodb/t/innodb_bug48024.test b/mysql-test/suite/innodb/t/innodb_bug48024.test index 00d76beb89d..db828aa1cda 100644 --- a/mysql-test/suite/innodb/t/innodb_bug48024.test +++ b/mysql-test/suite/innodb/t/innodb_bug48024.test @@ -10,6 +10,8 @@ ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b); DROP TABLE bug48024,bug48024_b; +# Work around Bug #53750 (failure in mysql-test-run --ps-protocol) +-- disable_ps_protocol delimiter |; CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB; CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB; From 72541c6b0d9d8258fc0ca936d454bc042ad28e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 May 2010 10:58:43 +0300 Subject: [PATCH 045/121] Add Valgrind checks to compressed BLOB access. --- storage/innodb_plugin/btr/btr0cur.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c index 0e603fdca8f..6270aa6a727 100644 --- a/storage/innodb_plugin/btr/btr0cur.c +++ b/storage/innodb_plugin/btr/btr0cur.c @@ -3871,6 +3871,8 @@ btr_store_big_rec_extern_fields( field_ref += local_len; } extern_len = big_rec_vec->fields[i].len; + UNIV_MEM_ASSERT_RW(big_rec_vec->fields[i].data, + extern_len); ut_a(extern_len > 0); @@ -4507,6 +4509,7 @@ btr_copy_blob_prefix( mtr_commit(&mtr); if (page_no == FIL_NULL || copy_len != part_len) { + UNIV_MEM_ASSERT_RW(buf, copied_len); return(copied_len); } @@ -4690,6 +4693,7 @@ btr_copy_externally_stored_field_prefix_low( space_id, page_no, offset); inflateEnd(&d_stream); mem_heap_free(heap); + UNIV_MEM_ASSERT_RW(buf, d_stream.total_out); return(d_stream.total_out); } else { return(btr_copy_blob_prefix(buf, len, space_id, From b8df3227dac23612c622bbc552911a863dcda8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 May 2010 11:01:52 +0300 Subject: [PATCH 046/121] Silence some more bogus Valgrind warnings on non-32-bit systems. (Bug #53307) --- storage/innodb_plugin/buf/buf0buddy.c | 5 +++++ storage/innodb_plugin/buf/buf0buf.c | 5 +++++ storage/innodb_plugin/buf/buf0lru.c | 7 ++++++- storage/innodb_plugin/page/page0zip.c | 5 +++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/storage/innodb_plugin/buf/buf0buddy.c b/storage/innodb_plugin/buf/buf0buddy.c index 66d802f8a36..07753cb8a60 100644 --- a/storage/innodb_plugin/buf/buf0buddy.c +++ b/storage/innodb_plugin/buf/buf0buddy.c @@ -495,7 +495,12 @@ success: mutex_exit(mutex); } else if (i == buf_buddy_get_slot(sizeof(buf_page_t))) { /* This must be a buf_page_t object. */ +#if UNIV_WORD_SIZE == 4 + /* On 32-bit systems, there is no padding in + buf_page_t. On other systems, Valgrind could complain + about uninitialized pad bytes. */ UNIV_MEM_ASSERT_RW(src, size); +#endif if (buf_buddy_relocate_block(src, dst)) { goto success; diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c index f299c2df969..bc5e9814099 100644 --- a/storage/innodb_plugin/buf/buf0buf.c +++ b/storage/innodb_plugin/buf/buf0buf.c @@ -2280,7 +2280,12 @@ wait_until_unfixed: ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); mutex_enter(&block->mutex); +#if UNIV_WORD_SIZE == 4 + /* On 32-bit systems, there is no padding in buf_page_t. On + other systems, Valgrind could complain about uninitialized pad + bytes. */ UNIV_MEM_ASSERT_RW(&block->page, sizeof block->page); +#endif buf_block_buf_fix_inc(block, file, line); diff --git a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c index 1fa7c088297..ac5eea649cb 100644 --- a/storage/innodb_plugin/buf/buf0lru.c +++ b/storage/innodb_plugin/buf/buf0lru.c @@ -1494,8 +1494,13 @@ alloc: ut_ad(prev_b->in_LRU_list); ut_ad(buf_page_in_file(prev_b)); +#if UNIV_WORD_SIZE == 4 + /* On 32-bit systems, there is no + padding in buf_page_t. On other + systems, Valgrind could complain about + uninitialized pad bytes. */ UNIV_MEM_ASSERT_RW(prev_b, sizeof *prev_b); - +#endif UT_LIST_INSERT_AFTER(LRU, buf_pool->LRU, prev_b, b); diff --git a/storage/innodb_plugin/page/page0zip.c b/storage/innodb_plugin/page/page0zip.c index a64a41ea518..8d9632a3548 100644 --- a/storage/innodb_plugin/page/page0zip.c +++ b/storage/innodb_plugin/page/page0zip.c @@ -3117,8 +3117,13 @@ page_zip_validate_low( temp_page_zip in a debugger when running valgrind --db-attach. */ VALGRIND_GET_VBITS(page, temp_page, UNIV_PAGE_SIZE); UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE); +# if UNIV_WORD_SIZE == 4 VALGRIND_GET_VBITS(page_zip, &temp_page_zip, sizeof temp_page_zip); + /* On 32-bit systems, there is no padding in page_zip_des_t. + On other systems, Valgrind could complain about uninitialized + pad bytes. */ UNIV_MEM_ASSERT_RW(page_zip, sizeof *page_zip); +# endif VALGRIND_GET_VBITS(page_zip->data, temp_page, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip)); From 627074a6a4514fc1bd7937190f4b5ea0440e596f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 May 2010 11:07:43 +0300 Subject: [PATCH 047/121] Make UNIV_DEBUG Valgrind friendly. Use | instead of +, and mask out the dont-care bits in debug assertions. --- storage/innodb_plugin/include/mach0data.ic | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/storage/innodb_plugin/include/mach0data.ic b/storage/innodb_plugin/include/mach0data.ic index ef20356bd31..96d2417ac81 100644 --- a/storage/innodb_plugin/include/mach0data.ic +++ b/storage/innodb_plugin/include/mach0data.ic @@ -36,7 +36,7 @@ mach_write_to_1( ulint n) /*!< in: ulint integer to be stored, >= 0, < 256 */ { ut_ad(b); - ut_ad(n <= 0xFFUL); + ut_ad((n | 0xFFUL) <= 0xFFUL); b[0] = (byte)n; } @@ -65,7 +65,7 @@ mach_write_to_2( ulint n) /*!< in: ulint integer to be stored */ { ut_ad(b); - ut_ad(n <= 0xFFFFUL); + ut_ad((n | 0xFFFFUL) <= 0xFFFFUL); b[0] = (byte)(n >> 8); b[1] = (byte)(n); @@ -81,10 +81,7 @@ mach_read_from_2( /*=============*/ const byte* b) /*!< in: pointer to 2 bytes */ { - ut_ad(b); - return( ((ulint)(b[0]) << 8) - + (ulint)(b[1]) - ); + return(((ulint)(b[0]) << 8) | (ulint)(b[1])); } /********************************************************//** @@ -129,7 +126,7 @@ mach_write_to_3( ulint n) /*!< in: ulint integer to be stored */ { ut_ad(b); - ut_ad(n <= 0xFFFFFFUL); + ut_ad((n | 0xFFFFFFUL) <= 0xFFFFFFUL); b[0] = (byte)(n >> 16); b[1] = (byte)(n >> 8); @@ -148,8 +145,8 @@ mach_read_from_3( { ut_ad(b); return( ((ulint)(b[0]) << 16) - + ((ulint)(b[1]) << 8) - + (ulint)(b[2]) + | ((ulint)(b[1]) << 8) + | (ulint)(b[2]) ); } @@ -183,9 +180,9 @@ mach_read_from_4( { ut_ad(b); return( ((ulint)(b[0]) << 24) - + ((ulint)(b[1]) << 16) - + ((ulint)(b[2]) << 8) - + (ulint)(b[3]) + | ((ulint)(b[1]) << 16) + | ((ulint)(b[2]) << 8) + | (ulint)(b[3]) ); } @@ -721,7 +718,7 @@ mach_read_from_2_little_endian( /*===========================*/ const byte* buf) /*!< in: from where to read */ { - return((ulint)(*buf) + ((ulint)(*(buf + 1))) * 256); + return((ulint)(buf[0]) | ((ulint)(buf[1]) << 8)); } /*********************************************************//** From 3564a2643f49e3b4a75f2c6af9cf697971d2aa4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 May 2010 11:16:18 +0300 Subject: [PATCH 048/121] Make UNIV_DEBUG Valgrind friendly in the built-in InnoDB. Use | instead of +, and mask out the dont-care bits in debug assertions. --- storage/innobase/include/mach0data.ic | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/storage/innobase/include/mach0data.ic b/storage/innobase/include/mach0data.ic index dc7918c287b..fceb8017121 100644 --- a/storage/innobase/include/mach0data.ic +++ b/storage/innobase/include/mach0data.ic @@ -19,7 +19,7 @@ mach_write_to_1( ulint n) /* in: ulint integer to be stored, >= 0, < 256 */ { ut_ad(b); - ut_ad(n <= 0xFFUL); + ut_ad((n | 0xFFUL) <= 0xFFUL); b[0] = (byte)n; } @@ -48,7 +48,7 @@ mach_write_to_2( ulint n) /* in: ulint integer to be stored */ { ut_ad(b); - ut_ad(n <= 0xFFFFUL); + ut_ad((n | 0xFFFFUL) <= 0xFFFFUL); b[0] = (byte)(n >> 8); b[1] = (byte)(n); @@ -64,10 +64,7 @@ mach_read_from_2( /* out: ulint integer */ byte* b) /* in: pointer to 2 bytes */ { - ut_ad(b); - return( ((ulint)(b[0]) << 8) - + (ulint)(b[1]) - ); + return(((ulint)(b[0]) << 8) | (ulint)(b[1])); } /************************************************************ @@ -112,7 +109,7 @@ mach_write_to_3( ulint n) /* in: ulint integer to be stored */ { ut_ad(b); - ut_ad(n <= 0xFFFFFFUL); + ut_ad((n | 0xFFFFFFUL) <= 0xFFFFFFUL); b[0] = (byte)(n >> 16); b[1] = (byte)(n >> 8); @@ -131,8 +128,8 @@ mach_read_from_3( { ut_ad(b); return( ((ulint)(b[0]) << 16) - + ((ulint)(b[1]) << 8) - + (ulint)(b[2]) + | ((ulint)(b[1]) << 8) + | (ulint)(b[2]) ); } @@ -166,9 +163,9 @@ mach_read_from_4( { ut_ad(b); return( ((ulint)(b[0]) << 24) - + ((ulint)(b[1]) << 16) - + ((ulint)(b[2]) << 8) - + (ulint)(b[3]) + | ((ulint)(b[1]) << 16) + | ((ulint)(b[2]) << 8) + | (ulint)(b[3]) ); } @@ -670,7 +667,7 @@ mach_read_from_2_little_endian( /* out: unsigned long int */ byte* buf) /* in: from where to read */ { - return((ulint)(*buf) + ((ulint)(*(buf + 1))) * 256); + return((ulint)(buf[0]) | ((ulint)(buf[1]) << 8)); } /************************************************************* From 094a1f1e58c09a1df922aeff942712c2c8be9914 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 20 May 2010 10:39:02 +0300 Subject: [PATCH 049/121] Merge from mysql-trunk-innodb into mysql-5.1-innodb/storage/innobase: ------------------------------------------------------------ revno: 3094 revision-id: vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh parent: vasil.dimov@oracle.com-20100512173700-byf8xntxjur1hqov committer: Vasil Dimov branch nick: mysql-trunk-innodb timestamp: Thu 2010-05-13 10:46:52 +0300 message: Followup to Bug#51920, fix binlog.binlog_killed This is a followup to the fix of Bug#51920 Innodb connections in row lock wait ignore KILL until lock wait timeout in that fix (rb://279) the behavior was changed to honor when a trx is interrupted during lock wait, but the returned error code was still "lock wait timeout" when it should be "interrupted". This change fixes the non-deterministically failing test binlog.binlog_killed, that failed like this: binlog.binlog_killed 'stmt' [ fail ] Test ended at 2010-05-12 11:39:08 CURRENT_TEST: binlog.binlog_killed mysqltest: At line 208: query 'reap' failed with wrong errno 1205: 'Lock wait timeout exceeded; try restarting transaction', instead of 0... Approved by: Sunny Bains (rb://344) ------------------------------------------------------------ This merge is non-trivial since it has to introduce the DB_INTERRUPTED error code. Also revert vasil.dimov@oracle.com-20100408165555-9rpjh24o0sa9ad5y which adjusted the binlog.binlog_killed test to the new (wrong) behavior --- mysql-test/suite/binlog/t/binlog_killed.test | 2 +- storage/innobase/handler/ha_innodb.cc | 4 ++++ storage/innobase/include/db0err.h | 3 +++ storage/innobase/row/row0mysql.c | 1 + storage/innobase/srv/srv0srv.c | 10 +++++++--- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test index ce6d344af32..e2db326129d 100644 --- a/mysql-test/suite/binlog/t/binlog_killed.test +++ b/mysql-test/suite/binlog/t/binlog_killed.test @@ -202,7 +202,7 @@ eval kill query $ID; rollback; connection con2; ---error 0,ER_QUERY_INTERRUPTED,ER_LOCK_WAIT_TIMEOUT +--error 0,ER_QUERY_INTERRUPTED reap; # todo 1,2 above rollback; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index f2a6c52ce7b..cf7ec4d6e6f 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -759,6 +759,10 @@ convert_error_code_to_mysql( } else if (error == DB_UNSUPPORTED) { return(HA_ERR_UNSUPPORTED); + } else if (error == DB_INTERRUPTED) { + + my_error(ER_QUERY_INTERRUPTED, MYF(0)); + return(-1); } else { return(-1); // Unknown error } diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h index ed7ce151718..b1461689d38 100644 --- a/storage/innobase/include/db0err.h +++ b/storage/innobase/include/db0err.h @@ -69,6 +69,9 @@ Created 5/24/1996 Heikki Tuuri a feature that it can't recoginize or work with e.g., FT indexes created by a later version of the engine. */ +#define DB_INTERRUPTED 49 /* the query has been interrupted with + "KILL QUERY N;" */ + /* The following are partial failure codes */ #define DB_FAIL 1000 #define DB_OVERFLOW 1001 diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 20fb69499a1..b4ce31575c7 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -483,6 +483,7 @@ handle_new_error: } else if (err == DB_ROW_IS_REFERENCED || err == DB_NO_REFERENCED_ROW || err == DB_CANNOT_ADD_CONSTRAINT + || err == DB_INTERRUPTED || err == DB_TOO_MANY_CONCURRENT_TRXS) { if (savept) { /* Roll back the latest, possibly incomplete diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index a2eed3f171c..5b1184fb416 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -1554,12 +1554,16 @@ srv_suspend_mysql_thread( mutex_exit(&kernel_mutex); - if (trx_is_interrupted(trx) - || (srv_lock_wait_timeout < 100000000 - && wait_time > (double)srv_lock_wait_timeout)) { + if (srv_lock_wait_timeout < 100000000 + && wait_time > (double)srv_lock_wait_timeout) { trx->error_state = DB_LOCK_WAIT_TIMEOUT; } + + if (trx_is_interrupted(trx)) { + + trx->error_state = DB_INTERRUPTED; + } #else /* UNIV_HOTBACKUP */ /* This function depends on MySQL code that is not included in InnoDB Hot Backup builds. Besides, this function should never From 56586334f123a86237d0921667493acfaaf9996f Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 20 May 2010 10:50:07 +0300 Subject: [PATCH 050/121] Merge from mysql-trunk-innodb into mysql-5.1-innodb/storage/innodb_plugin: ------------------------------------------------------------ revno: 3094 revision-id: vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh parent: vasil.dimov@oracle.com-20100512173700-byf8xntxjur1hqov committer: Vasil Dimov branch nick: mysql-trunk-innodb timestamp: Thu 2010-05-13 10:46:52 +0300 message: Followup to Bug#51920, fix binlog.binlog_killed This is a followup to the fix of Bug#51920 Innodb connections in row lock wait ignore KILL until lock wait timeout in that fix (rb://279) the behavior was changed to honor when a trx is interrupted during lock wait, but the returned error code was still "lock wait timeout" when it should be "interrupted". This change fixes the non-deterministically failing test binlog.binlog_killed, that failed like this: binlog.binlog_killed 'stmt' [ fail ] Test ended at 2010-05-12 11:39:08 CURRENT_TEST: binlog.binlog_killed mysqltest: At line 208: query 'reap' failed with wrong errno 1205: 'Lock wait timeout exceeded; try restarting transaction', instead of 0... Approved by: Sunny Bains (rb://344) ------------------------------------------------------------ --- storage/innodb_plugin/row/row0mysql.c | 1 + storage/innodb_plugin/srv/srv0srv.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c index ff3491a4f31..9592de88346 100644 --- a/storage/innodb_plugin/row/row0mysql.c +++ b/storage/innodb_plugin/row/row0mysql.c @@ -522,6 +522,7 @@ handle_new_error: case DB_CANNOT_ADD_CONSTRAINT: case DB_TOO_MANY_CONCURRENT_TRXS: case DB_OUT_OF_FILE_SPACE: + case DB_INTERRUPTED: if (savept) { /* Roll back the latest, possibly incomplete insertion or update */ diff --git a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c index 63c355cea32..f7e7e351bdc 100644 --- a/storage/innodb_plugin/srv/srv0srv.c +++ b/storage/innodb_plugin/srv/srv0srv.c @@ -1609,12 +1609,16 @@ srv_suspend_mysql_thread( innodb_lock_wait_timeout, because trx->mysql_thd == NULL. */ lock_wait_timeout = thd_lock_wait_timeout(trx->mysql_thd); - if (trx_is_interrupted(trx) - || (lock_wait_timeout < 100000000 - && wait_time > (double) lock_wait_timeout)) { + if (lock_wait_timeout < 100000000 + && wait_time > (double) lock_wait_timeout) { trx->error_state = DB_LOCK_WAIT_TIMEOUT; } + + if (trx_is_interrupted(trx)) { + + trx->error_state = DB_INTERRUPTED; + } } /********************************************************************//** From 98406ba452be5fc8b0ee53cf69812342af1c9ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 20 May 2010 13:40:42 +0300 Subject: [PATCH 051/121] Bug#53593: Add some instrumentation to improve Valgrind sensitivity BUILD/*: Add valgrind_configs=--with-valgrind. BUILD/*: Remove -USAFEMALLOC from valgrind_flags. configure.in: Add AC_ARG_WITH(valgrind) and HAVE_VALGRIND. include/my_sys.h: Define a number of MEM_ wrappers for VALGRIND_ functions. include/my_sys.h: Make TRASH do MEM_UNDEFINED(). include/m_string.h: Remove unused macro bzero_if_purify(A,B). _mymalloc(): Declare MEM_UNDEFINED() on the allocated memory. _myfree(): Declare MEM_NOACCESS() on the freed memory. storage/innobase/include/univ.i: Enable UNIV_DEBUG_VALGRIND based on HAVE_VALGRIND rather than HAVE_purify. Possible things to do: * In my_global.h, remove the defined(HAVE_purify) condition from the _WIN32 uint3korr(). * In my_global.h *int*korr(), use | instead of + in order to keep the Valgrind V bits accurate * Consider replacing HAVE_purify with HAVE_VALGRIND * Use VALGRIND_CREATE_BLOCK, VALGRIND_DISCARD in mem_root and similar places --- BUILD/SETUP.sh | 6 +++++- BUILD/build_mccge.sh | 3 ++- BUILD/compile-amd64-valgrind-max | 2 +- BUILD/compile-pentium-icc-valgrind-max | 2 +- BUILD/compile-pentium-valgrind-max | 2 +- BUILD/compile-pentium-valgrind-max-no-ndb | 2 +- BUILD/compile-pentium64-valgrind-max | 2 +- configure.in | 11 +++++++++++ include/m_string.h | 3 --- include/my_sys.h | 17 +++++++++++++++-- mysys/safemalloc.c | 5 +++++ storage/innobase/include/univ.i | 4 ++-- storage/innodb_plugin/include/univ.i | 4 ++-- 13 files changed, 47 insertions(+), 16 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 3655d3eae67..0bc16f120e5 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -119,8 +119,12 @@ fi # Set flags for various build configurations. # Used in -valgrind builds -valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " +# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro +# LINT_INIT(), which is only useful for silencing spurious warnings +# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind. +valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify " valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" +valgrind_configs="--with-valgrind" # # Used in -debug builds debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS " diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh index fc0f8181692..43ca117fb78 100755 --- a/BUILD/build_mccge.sh +++ b/BUILD/build_mccge.sh @@ -938,9 +938,10 @@ set_up_ccache() set_valgrind_flags() { if test "x$valgrind_flag" = "xyes" ; then - loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " + loc_valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify " loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" compiler_flags="$compiler_flags $loc_valgrind_flags" + with_flags="$with_flags --with-valgrind" fi } diff --git a/BUILD/compile-amd64-valgrind-max b/BUILD/compile-amd64-valgrind-max index 962d0f17b04..fb8dce38df3 100755 --- a/BUILD/compile-amd64-valgrind-max +++ b/BUILD/compile-amd64-valgrind-max @@ -4,7 +4,7 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$amd64_cflags $debug_cflags $valgrind_flags" -extra_configs="$amd64_configs $debug_configs $max_configs" +extra_configs="$amd64_configs $debug_configs $valgrind_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-icc-valgrind-max b/BUILD/compile-pentium-icc-valgrind-max index 58acf892f5a..0babf9ee881 100755 --- a/BUILD/compile-pentium-icc-valgrind-max +++ b/BUILD/compile-pentium-icc-valgrind-max @@ -29,6 +29,6 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572" cxx_warnings="$c_warnings -wd869,874" base_cxxflags="-fno-exceptions -fno-rtti" -extra_configs="$pentium_configs $debug_configs" +extra_configs="$pentium_configs $debug_configs $valgrind_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index 09cc162d2be..8ef47bfbc17 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -4,7 +4,7 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" -extra_configs="$pentium_configs $debug_configs $max_configs" +extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-valgrind-max-no-ndb b/BUILD/compile-pentium-valgrind-max-no-ndb index 66f6ae08a7f..f480f83ebf7 100755 --- a/BUILD/compile-pentium-valgrind-max-no-ndb +++ b/BUILD/compile-pentium-valgrind-max-no-ndb @@ -4,7 +4,7 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" -extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs" +extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_no_ndb_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max index fa476cbb50a..eb3d20c874d 100755 --- a/BUILD/compile-pentium64-valgrind-max +++ b/BUILD/compile-pentium64-valgrind-max @@ -4,7 +4,7 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags" -extra_configs="$pentium_configs $debug_configs $max_configs" +extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs" . "$path/FINISH.sh" diff --git a/configure.in b/configure.in index 53852f46981..a2a3a6196fc 100644 --- a/configure.in +++ b/configure.in @@ -1729,6 +1729,17 @@ else CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" fi +AC_ARG_WITH([valgrind], + [AS_HELP_STRING([--with-valgrind], + [Valgrind instrumentation @<:@default=no@:>@])], + [], [with_valgrind=no]) + +if test "$with_valgrind" != "no" +then + AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h], + [AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])]) +fi + # Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it. AC_MSG_CHECKING(if Debug Sync Facility should be enabled.) AC_ARG_ENABLE(debug_sync, diff --git a/include/m_string.h b/include/m_string.h index a25675f2638..b2a1d9ff2f4 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -127,9 +127,6 @@ extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len); extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len); #undef bcmp #define bcmp(A,B,C) my_bcmp((A),(B),(C)) -#define bzero_if_purify(A,B) bzero(A,B) -#else -#define bzero_if_purify(A,B) #endif /* HAVE_purify */ #ifndef bmove512 diff --git a/include/my_sys.h b/include/my_sys.h index 59b44307b6f..4b26cbee8cd 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -25,6 +25,19 @@ typedef struct my_aio_result { } my_aio_result; #endif +#ifdef HAVE_VALGRIND +# include +# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len) +# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) +# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len) +# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len) +#else /* HAVE_VALGRIND */ +# define MEM_UNDEFINED(a,len) ((void) 0) +# define MEM_NOACCESS(a,len) ((void) 0) +# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) +# define MEM_CHECK_DEFINED(a,len) ((void) 0) +#endif /* HAVE_VALGRIND */ + #ifndef THREAD extern int NEAR my_errno; /* Last error in mysys */ #else @@ -141,7 +154,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C) #define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C) #define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C) -#define TRASH(A,B) bfill(A, B, 0x8F) +#define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0) #define QUICK_SAFEMALLOC sf_malloc_quick=1 #define NORMAL_SAFEMALLOC sf_malloc_quick=0 extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; @@ -169,7 +182,7 @@ extern char *my_strndup(const char *from, size_t length, #define CALLER_INFO_PROTO /* nothing */ #define CALLER_INFO /* nothing */ #define ORIG_CALLER_INFO /* nothing */ -#define TRASH(A,B) /* nothing */ +#define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) #endif #if defined(ENABLED_DEBUG_SYNC) diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index c484f1d4c54..1235cb5ddd8 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -190,9 +190,12 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) sf_malloc_count++; pthread_mutex_unlock(&THR_LOCK_malloc); + MEM_CHECK_ADDRESSABLE(data, size); /* Set the memory to the aribtrary wierd value */ if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick) bfill(data, size, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL)); + if (!(MyFlags & MY_ZEROFILL)) + MEM_UNDEFINED(data, size); /* Return a pointer to the real data */ DBUG_PRINT("exit",("ptr: %p", data)); if (sf_min_adress > data) @@ -309,7 +312,9 @@ void _myfree(void *ptr, const char *filename, uint lineno, myf myflags) if (!sf_malloc_quick) bfill(ptr, irem->datasize, (pchar) FREE_VAL); #endif + MEM_NOACCESS(ptr, irem->datasize); *((uint32*) ((char*) ptr- sizeof(uint32)))= ~MAGICKEY; + MEM_NOACCESS((char*) ptr - sizeof(uint32), sizeof(uint32)); /* Actually free the memory */ free((char*) irem); DBUG_VOID_RETURN; diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index ecf754762ad..97d022d284e 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -82,9 +82,9 @@ memory is read outside the allocated blocks. */ /* Make a non-inline debug version */ -#ifdef HAVE_purify +#if defined HAVE_VALGRIND # define UNIV_DEBUG_VALGRIND -#endif /* HAVE_purify */ +#endif /* HAVE_VALGRIND */ #if 0 #define UNIV_DEBUG_VALGRIND /* Enable extra Valgrind instrumentation */ diff --git a/storage/innodb_plugin/include/univ.i b/storage/innodb_plugin/include/univ.i index 8fb2505a791..018fd157a25 100644 --- a/storage/innodb_plugin/include/univ.i +++ b/storage/innodb_plugin/include/univ.i @@ -165,9 +165,9 @@ command. Not tested on Windows. */ #define UNIV_COMPILE_TEST_FUNCS */ -#ifdef HAVE_purify +#if defined HAVE_VALGRIND # define UNIV_DEBUG_VALGRIND -#endif /* HAVE_purify */ +#endif /* HAVE_VALGRIND */ #if 0 #define UNIV_DEBUG_VALGRIND /* Enable extra Valgrind instrumentation */ From a426d6f9a857ae939675b37cbc6856ae30a2e162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 20 May 2010 16:07:34 +0300 Subject: [PATCH 052/121] buf_LRU_free_block(): Correct an error in the comment. --- storage/innodb_plugin/buf/buf0lru.c | 2 +- storage/innodb_plugin/include/buf0lru.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c index ac5eea649cb..78d8d348e2a 100644 --- a/storage/innodb_plugin/buf/buf0lru.c +++ b/storage/innodb_plugin/buf/buf0lru.c @@ -1364,7 +1364,7 @@ buf_LRU_make_block_old( Try to free a block. If bpage is a descriptor of a compressed-only page, the descriptor object will be freed as well. -NOTE: If this function returns BUF_LRU_FREED, it will not temporarily +NOTE: If this function returns BUF_LRU_FREED, it will temporarily release buf_pool_mutex. Furthermore, the page frame will no longer be accessible via bpage. diff --git a/storage/innodb_plugin/include/buf0lru.h b/storage/innodb_plugin/include/buf0lru.h index 009430af35b..5a9cfd059f3 100644 --- a/storage/innodb_plugin/include/buf0lru.h +++ b/storage/innodb_plugin/include/buf0lru.h @@ -96,7 +96,7 @@ buf_LRU_insert_zip_clean( Try to free a block. If bpage is a descriptor of a compressed-only page, the descriptor object will be freed as well. -NOTE: If this function returns BUF_LRU_FREED, it will not temporarily +NOTE: If this function returns BUF_LRU_FREED, it will temporarily release buf_pool_mutex. Furthermore, the page frame will no longer be accessible via bpage. From 09438406cb773c4f8e1d3e6b243c39ea5ab7f6bc Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 20 May 2010 16:27:35 +0300 Subject: [PATCH 053/121] Disable main.ps_3innodb for valgrind tests since it results in known failures, that are described in Bug#38999 valgrind warnings for update statement in function compare_record() At the time I am adding this the failures are: main.ps_3innodb [ fail ] Found warnings/errors in server log file! Test ended at 2010-05-20 01:17:34 line ==31559== Thread 11: ==31559== Conditional jump or move depends on uninitialised value(s) ==31559== at 0x75C5BD: compare_record(st_table*) (sql_update.cc:35) ==31559== by 0x744732: write_record(THD*, st_table*, st_copy_info*) (sql_insert.cc:1486) ==31559== by 0x74A0D7: mysql_insert(THD*, TABLE_LIST*, List&, List >&, List&, List&, enum_duplicates, bool) (sql_insert.cc:835) ==31559== by 0x6A79B4: mysql_execute_command(THD*) (sql_parse.cc:3198) ==31559== by 0x754998: Prepared_statement::execute(String*, bool) (sql_prepare.cc:3583) ==31559== by 0x754C4F: Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*) (sql_prepare.cc:3258) ==31559== by 0x754F33: mysql_sql_stmt_execute(THD*) (sql_prepare.cc:2529) ==31559== by 0x6A5028: mysql_execute_command(THD*) (sql_parse.cc:2272) ==31559== by 0x6ADAE8: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5986) ==31559== by 0x6AF3A4: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1233) ==31559== by 0x6B0800: do_command(THD*) (sql_parse.cc:874) ==31559== by 0x69CB46: handle_one_connection (sql_connect.cc:1134) ==31559== by 0x33EDA062F6: start_thread (in /lib64/libpthread-2.5.so) ==31559== by 0x33ECED1B6C: clone (in /lib64/libc-2.5.so) ==31559== Conditional jump or move depends on uninitialised value(s) ==31559== at 0x75C5D0: compare_record(st_table*) (sql_update.cc:35) ==31559== by 0x744732: write_record(THD*, st_table*, st_copy_info*) (sql_insert.cc:1486) ==31559== by 0x74A0D7: mysql_insert(THD*, TABLE_LIST*, List&, List >&, List&, List&, enum_duplicates, bool) (sql_insert.cc:835) ==31559== by 0x6A79B4: mysql_execute_command(THD*) (sql_parse.cc:3198) ==31559== by 0x754998: Prepared_statement::execute(String*, bool) (sql_prepare.cc:3583) ==31559== by 0x754C4F: Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*) (sql_prepare.cc:3258) ==31559== by 0x754F33: mysql_sql_stmt_execute(THD*) (sql_prepare.cc:2529) ==31559== by 0x6A5028: mysql_execute_command(THD*) (sql_parse.cc:2272) ==31559== by 0x6ADAE8: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5986) ==31559== by 0x6AF3A4: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1233) ==31559== by 0x6B0800: do_command(THD*) (sql_parse.cc:874) ==31559== by 0x69CB46: handle_one_connection (sql_connect.cc:1134) ==31559== by 0x33EDA062F6: start_thread (in /lib64/libpthread-2.5.so) ==31559== by 0x33ECED1B6C: clone (in /lib64/libc-2.5.so) ^ Found warnings in /export/home4/pb2/test/sb_3-1827397-1274300957.87/mysql-5.1.48-linux-x86_64-test/mysql-test/var-n_mix/log/mysqld.1.err --- mysql-test/t/ps_3innodb.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysql-test/t/ps_3innodb.test b/mysql-test/t/ps_3innodb.test index e25a8b1f469..10d2e7a9ae5 100644 --- a/mysql-test/t/ps_3innodb.test +++ b/mysql-test/t/ps_3innodb.test @@ -8,6 +8,10 @@ # NOTE: PLEASE SEE ps_1general.test (bottom) # BEFORE ADDING NEW TEST CASES HERE !!! +# See Bug#38999 valgrind warnings for update statement in function +# compare_record() +-- source include/not_valgrind.inc + use test; -- source include/have_innodb.inc From c2ebb0ac882feadedd0bbca71277fd2de66aa957 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Fri, 21 May 2010 15:23:48 +0400 Subject: [PATCH 054/121] Bug #42064: low memory crash when importing hex strings, in Item_hex_string::Item_hex_string The status of memory allocation in the Lex_input_stream (called from the Parser_state constructor) was not checked which led to a parser crash in case of the out-of-memory error. The solution is to introduce new init() member function in Parser_state and Lex_input_stream so that status of memory allocation can be returned to the caller. mysql-test/r/error_simulation.result: Added a test case for bug #42064. mysql-test/t/error_simulation.test: Added a test case for bug #42064. mysys/my_alloc.c: Added error injection code for the regression test. mysys/my_malloc.c: Added error injection code for the regression test. mysys/safemalloc.c: Added error injection code for the regression test. sql/event_data_objects.cc: Use the new init() member function of Parser_state and check its return value to handle memory allocation failures. sql/mysqld.cc: Added error injection code for the regression test. sql/sp.cc: Use the new init() member function of Parser_state and check its return value to handle memory allocation failures. sql/sql_lex.cc: Moved memory allocation from constructor to the separate init() member function. Added error injection code for the regression test. sql/sql_lex.h: Moved memory allocation from constructor to the separate init() member function. sql/sql_parse.cc: Use the new init() member function of Parser_state and check its return value to handle memory allocation failures. sql/sql_partition.cc: Use the new init() member function of Parser_state and check its return value to handle memory allocation failures. sql/sql_prepare.cc: Use the new init() member function of Parser_state and check its return value to handle memory allocation failures. sql/sql_trigger.cc: Use the new init() member function of Parser_state and check its return value to handle memory allocation failures. sql/sql_view.cc: Use the new init() member function of Parser_state and check its return value to handle memory allocation failures.. sql/thr_malloc.cc: Added error injection code for the regression test. --- mysql-test/r/error_simulation.result | 9 +++++ mysql-test/t/error_simulation.test | 14 +++++++ mysys/my_alloc.c | 16 ++++++++ mysys/my_malloc.c | 12 +++++- mysys/safemalloc.c | 7 ++++ sql/event_data_objects.cc | 5 ++- sql/mysqld.cc | 7 ++++ sql/sp.cc | 7 +++- sql/sql_lex.cc | 56 ++++++++++++---------------- sql/sql_lex.h | 48 ++++++++++++++++++++++-- sql/sql_parse.cc | 30 +++++++++------ sql/sql_partition.cc | 4 +- sql/sql_prepare.cc | 15 +++++--- sql/sql_trigger.cc | 6 +-- sql/sql_view.cc | 7 ++-- sql/thr_malloc.cc | 8 +++- 16 files changed, 186 insertions(+), 65 deletions(-) diff --git a/mysql-test/r/error_simulation.result b/mysql-test/r/error_simulation.result index 27e51a33112..fc58687cc86 100644 --- a/mysql-test/r/error_simulation.result +++ b/mysql-test/r/error_simulation.result @@ -39,5 +39,14 @@ a 2 DROP TABLE t1; # +# Bug#42064: low memory crash when importing hex strings, in Item_hex_string::Item_hex_string +# +CREATE TABLE t1(a BLOB); +SET SESSION debug="+d,bug42064_simulate_oom"; +INSERT INTO t1 VALUES(""); +Got one of the listed errors +SET SESSION debug=DEFAULT; +DROP TABLE t1; +# # End of 5.1 tests # diff --git a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test index 7cd16a6bc5a..7a48a2e3231 100644 --- a/mysql-test/t/error_simulation.test +++ b/mysql-test/t/error_simulation.test @@ -46,6 +46,20 @@ SELECT * FROM t1; DROP TABLE t1; +--echo # +--echo # Bug#42064: low memory crash when importing hex strings, in Item_hex_string::Item_hex_string +--echo # + +CREATE TABLE t1(a BLOB); + +SET SESSION debug="+d,bug42064_simulate_oom"; +# May fail with either ER_OUT_OF_RESOURCES or EE_OUTOFMEMORY +--error ER_OUT_OF_RESOURCES, 5 +INSERT INTO t1 VALUES(""); +SET SESSION debug=DEFAULT; + +DROP TABLE t1; + --echo # --echo # End of 5.1 tests --echo # diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 2607ea57d08..dd27dcda41e 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -154,6 +154,14 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length) DBUG_ASSERT(alloc_root_inited(mem_root)); + DBUG_EXECUTE_IF("simulate_out_of_memory", + { + if (mem_root->error_handler) + (*mem_root->error_handler)(); + DBUG_SET("-d,simulate_out_of_memory"); + DBUG_RETURN((void*) 0); /* purecov: inspected */ + }); + length+=ALIGN_SIZE(sizeof(USED_MEM)); if (!(next = (USED_MEM*) my_malloc(length,MYF(MY_WME)))) { @@ -176,6 +184,14 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length) DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root)); DBUG_ASSERT(alloc_root_inited(mem_root)); + DBUG_EXECUTE_IF("simulate_out_of_memory", + { + /* Avoid reusing an already allocated block */ + if (mem_root->error_handler) + (*mem_root->error_handler)(); + DBUG_SET("-d,simulate_out_of_memory"); + DBUG_RETURN((void*) 0); /* purecov: inspected */ + }); length= ALIGN_SIZE(length); if ((*(prev= &mem_root->free)) != NULL) { diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index 12793ad451b..13d2375eb99 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -31,13 +31,23 @@ void *my_malloc(size_t size, myf my_flags) if (!size) size=1; /* Safety */ - if ((point = (char*)malloc(size)) == NULL) + + point= (char *) malloc(size); + DBUG_EXECUTE_IF("simulate_out_of_memory", + { + free(point); + point= NULL; + }); + + if (point == NULL) { my_errno=errno; if (my_flags & MY_FAE) error_handler_hook=fatal_error_handler_hook; if (my_flags & (MY_FAE+MY_WME)) my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH),size); + DBUG_EXECUTE_IF("simulate_out_of_memory", + DBUG_SET("-d,simulate_out_of_memory");); if (my_flags & MY_FAE) exit(1); } diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index c484f1d4c54..938ecd9dde8 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -139,6 +139,11 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) size + /* size requested */ 4 + /* overrun mark */ sf_malloc_endhunc); + DBUG_EXECUTE_IF("simulate_out_of_memory", + { + free(irem); + irem= NULL; + }); } /* Check if there isn't anymore memory avaiable */ if (!irem) @@ -159,6 +164,8 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) } DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", sf_malloc_max_memory,lineno, filename)); + DBUG_EXECUTE_IF("simulate_out_of_memory", + DBUG_SET("-d,simulate_out_of_memory");); if (MyFlags & MY_FAE) exit(1); DBUG_RETURN ((void*) 0); diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 92e237a17b7..c010ca2309a 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1433,7 +1433,10 @@ Event_job_data::execute(THD *thd, bool drop) thd->set_query(sp_sql.c_ptr_safe(), sp_sql.length()); { - Parser_state parser_state(thd, thd->query(), thd->query_length()); + Parser_state parser_state; + if (parser_state.init(thd, thd->query(), thd->query_length())) + goto end; + lex_start(thd); if (parse_sql(thd, & parser_state, creation_ctx)) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3664f46995f..d6ee840455e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2933,6 +2933,9 @@ int my_message_sql(uint error, const char *str, myf MyFlags) DBUG_RETURN(0); } + /* When simulating OOM, skip writing to error log to avoid mtr errors */ + DBUG_EXECUTE_IF("simulate_out_of_memory", DBUG_RETURN(0);); + if (!thd->no_warnings_for_error && !(MyFlags & ME_NO_WARNING_FOR_ERROR)) { @@ -2945,6 +2948,10 @@ int my_message_sql(uint error, const char *str, myf MyFlags) thd->no_warnings_for_error= FALSE; } } + + /* When simulating OOM, skip writing to error log to avoid mtr errors */ + DBUG_EXECUTE_IF("simulate_out_of_memory", DBUG_RETURN(0);); + if (!thd || MyFlags & ME_NOREFRESH) sql_print_error("%s: %s",my_progname,str); /* purecov: inspected */ DBUG_RETURN(0); diff --git a/sql/sp.cc b/sql/sp.cc index ef69edb96c6..0eb652d5b16 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -782,7 +782,12 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp, thd->spcont= NULL; { - Parser_state parser_state(thd, defstr.c_ptr(), defstr.length()); + Parser_state parser_state; + if (parser_state.init(thd, defstr.c_ptr(), defstr.length())) + { + ret= SP_INTERNAL_ERROR; + goto end; + } lex_start(thd); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a3776f59241..35a5e2aeefc 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -110,39 +110,31 @@ st_parsing_options::reset() allows_derived= TRUE; } -Lex_input_stream::Lex_input_stream(THD *thd, - const char* buffer, - unsigned int length) -: m_thd(thd), - yylineno(1), - yytoklen(0), - yylval(NULL), - m_ptr(buffer), - m_tok_start(NULL), - m_tok_end(NULL), - m_end_of_query(buffer + length), - m_tok_start_prev(NULL), - m_buf(buffer), - m_buf_length(length), - m_echo(TRUE), - m_cpp_tok_start(NULL), - m_cpp_tok_start_prev(NULL), - m_cpp_tok_end(NULL), - m_body_utf8(NULL), - m_cpp_utf8_processed_ptr(NULL), - next_state(MY_LEX_START), - found_semicolon(NULL), - ignore_space(test(thd->variables.sql_mode & MODE_IGNORE_SPACE)), - stmt_prepare_mode(FALSE), - in_comment(NO_COMMENT), - m_underscore_cs(NULL) -{ - m_cpp_buf= (char*) thd->alloc(length + 1); - m_cpp_ptr= m_cpp_buf; -} -Lex_input_stream::~Lex_input_stream() -{} +bool Lex_input_stream::init(THD *thd, const char *buff, unsigned int length) +{ + DBUG_EXECUTE_IF("bug42064_simulate_oom", + DBUG_SET("+d,simulate_out_of_memory");); + + m_cpp_buf= (char*) thd->alloc(length + 1); + + DBUG_EXECUTE_IF("bug42064_simulate_oom", + DBUG_SET("-d,bug42064_simulate_oom");); + + if (m_cpp_buf == NULL) + return FALSE; + + m_cpp_ptr= m_cpp_buf; + m_thd= thd; + m_ptr= buff; + m_end_of_query= buff + length; + m_buf= buff; + m_buf_length= length; + ignore_space= test(thd->variables.sql_mode & MODE_IGNORE_SPACE); + + return FALSE; + } + /** The operation is called from the parser in order to diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 54eefa22a59..184d24ee5b6 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1147,9 +1147,38 @@ enum enum_comment_state class Lex_input_stream { public: - Lex_input_stream(THD *thd, const char* buff, unsigned int length); - ~Lex_input_stream(); + Lex_input_stream() : + yylineno(1), + yytoklen(0), + yylval(NULL), + m_tok_start(NULL), + m_tok_end(NULL), + m_tok_start_prev(NULL), + m_echo(TRUE), + m_cpp_tok_start(NULL), + m_cpp_tok_start_prev(NULL), + m_cpp_tok_end(NULL), + m_body_utf8(NULL), + m_cpp_utf8_processed_ptr(NULL), + next_state(MY_LEX_START), + found_semicolon(NULL), + stmt_prepare_mode(FALSE), + in_comment(NO_COMMENT), + m_underscore_cs(NULL) + { + } + ~Lex_input_stream() + { + } + + /** + Object initializer. Must be called before usage. + + @retval FALSE OK + @retval TRUE Error + */ + bool init(THD *thd, const char *buff, unsigned int length); /** Set the echo mode. @@ -1930,10 +1959,21 @@ public: class Parser_state { public: - Parser_state(THD *thd, const char* buff, unsigned int length) - : m_lip(thd, buff, length), m_yacc() + Parser_state() + : m_yacc() {} + /** + Object initializer. Must be called before usage. + + @retval FALSE OK + @retval TRUE Error + */ + bool init(THD *thd, const char *buff, unsigned int length) + { + return m_lip.init(thd, buff, length); + } + ~Parser_state() {} diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 93d80164ffb..89ab16294c4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5944,10 +5944,15 @@ void mysql_parse(THD *thd, const char *inBuf, uint length, sp_cache_flush_obsolete(&thd->sp_proc_cache); sp_cache_flush_obsolete(&thd->sp_func_cache); - Parser_state parser_state(thd, inBuf, length); - - bool err= parse_sql(thd, & parser_state, NULL); - *found_semicolon= parser_state.m_lip.found_semicolon; + Parser_state parser_state; + bool err; + if (!(err= parser_state.init(thd, inBuf, length))) + { + err= parse_sql(thd, & parser_state, NULL); + *found_semicolon= parser_state.m_lip.found_semicolon; + } + else + *found_semicolon= NULL; if (!err) { @@ -6033,14 +6038,17 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) bool error= 0; DBUG_ENTER("mysql_test_parse_for_slave"); - Parser_state parser_state(thd, inBuf, length); - lex_start(thd); - mysql_reset_thd_for_next_command(thd); + Parser_state parser_state; + if (!(error= parser_state.init(thd, inBuf, length))) + { + lex_start(thd); + mysql_reset_thd_for_next_command(thd); - if (!parse_sql(thd, & parser_state, NULL) && - all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first)) - error= 1; /* Ignore question */ - thd->end_statement(); + if (!parse_sql(thd, & parser_state, NULL) && + all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first)) + error= 1; /* Ignore question */ + thd->end_statement(); + } thd->cleanup_after_query(); DBUG_RETURN(error); } diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 679d23b49ad..122ae661046 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3892,7 +3892,9 @@ bool mysql_unpack_partition(THD *thd, thd->lex= &lex; thd->variables.character_set_client= system_charset_info; - Parser_state parser_state(thd, part_buf, part_info_len); + Parser_state parser_state; + if (parser_state.init(thd, part_buf, part_info_len)) + goto end; lex_start(thd); *work_part_info_used= false; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 5979f2ca17e..a928942bd88 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -3034,13 +3034,16 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) old_stmt_arena= thd->stmt_arena; thd->stmt_arena= this; - Parser_state parser_state(thd, thd->query(), thd->query_length()); - parser_state.m_lip.stmt_prepare_mode= TRUE; - lex_start(thd); + Parser_state parser_state; + if (!parser_state.init(thd, thd->query(), thd->query_length())) + { + parser_state.m_lip.stmt_prepare_mode= TRUE; + lex_start(thd); - error= parse_sql(thd, & parser_state, NULL) || - thd->is_error() || - init_param_array(this); + error= parse_sql(thd, & parser_state, NULL) || + thd->is_error() || + init_param_array(this); + } lex->set_trg_event_type_for_tables(); diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index aafb25013f6..84cb45fe104 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1297,9 +1297,9 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, thd->variables.sql_mode= (ulong)*trg_sql_mode; - Parser_state parser_state(thd, - trg_create_str->str, - trg_create_str->length); + Parser_state parser_state; + if (parser_state.init(thd, trg_create_str->str, trg_create_str->length)) + goto err_with_lex_cleanup; Trigger_creation_ctx *creation_ctx= Trigger_creation_ctx::create(thd, diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 5ec80dfb621..340409aa42f 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1190,9 +1190,10 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, char old_db_buf[NAME_LEN+1]; LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) }; bool dbchanged; - Parser_state parser_state(thd, - table->select_stmt.str, - table->select_stmt.length); + Parser_state parser_state; + if (parser_state.init(thd, table->select_stmt.str, + table->select_stmt.length)) + goto err; /* Use view db name as thread default database, in order to ensure diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index 0764fe8be33..1fbab74554f 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -21,8 +21,6 @@ extern "C" { void sql_alloc_error_handler(void) { - sql_print_error("%s", ER(ER_OUT_OF_RESOURCES)); - THD *thd= current_thd; if (thd) { @@ -49,6 +47,12 @@ extern "C" { ER(ER_OUT_OF_RESOURCES)); } } + + /* Skip writing to the error log to avoid mtr complaints */ + DBUG_EXECUTE_IF("simulate_out_of_memory", return;); + + sql_print_error("%s", ER(ER_OUT_OF_RESOURCES)); + } } From d4fd7bb95eb04e53ad2505b6733928da591190c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 24 May 2010 14:04:39 +0300 Subject: [PATCH 055/121] Bug#53578: assert on invalid page access, in fil_io() Store the max_space_id in the data dictionary header in order to avoid space_id reuse. DICT_HDR_MIX_ID: Renamed to DICT_HDR_MAX_SPACE_ID, DICT_HDR_MIX_ID_LOW. dict_hdr_get_new_id(): Return table_id, index_id, space_id or a subset of them. fil_system_t: Add ibool space_id_reuse_warned. fil_create_new_single_table_tablespace(): Get the space_id from the caller. fil_space_create(): Issue a warning if the fil_system->max_assigned_id is exceeded. fil_assign_new_space_id(): Return TRUE/FALSE and take a pointer to the space_id as a parameter. Make the function public. fil_init(): Initialize all fil_system fields by mem_zalloc(). Remove explicit initializations of certain fields to 0 or NULL. --- storage/innodb_plugin/dict/dict0boot.c | 46 ++++++--- storage/innodb_plugin/dict/dict0crea.c | 14 ++- storage/innodb_plugin/fil/fil0fil.c | 117 +++++++++++----------- storage/innodb_plugin/include/dict0boot.h | 12 ++- storage/innodb_plugin/include/fil0fil.h | 14 ++- storage/innodb_plugin/row/row0mysql.c | 11 +- 6 files changed, 124 insertions(+), 90 deletions(-) diff --git a/storage/innodb_plugin/dict/dict0boot.c b/storage/innodb_plugin/dict/dict0boot.c index 45d57b8c619..e63c1dc94b9 100644 --- a/storage/innodb_plugin/dict/dict0boot.c +++ b/storage/innodb_plugin/dict/dict0boot.c @@ -62,32 +62,47 @@ dict_hdr_get( } /**********************************************************************//** -Returns a new table, index, or tree id. -@return the new id */ +Returns a new table, index, or space id. */ UNIV_INTERN -dulint +void dict_hdr_get_new_id( /*================*/ - ulint type) /*!< in: DICT_HDR_ROW_ID, ... */ + dulint* table_id, /*!< out: table id (not assigned if NULL) */ + dulint* index_id, /*!< out: index id (not assigned if NULL) */ + ulint* space_id) /*!< out: space id (not assigned if NULL) */ { dict_hdr_t* dict_hdr; dulint id; mtr_t mtr; - ut_ad((type == DICT_HDR_TABLE_ID) || (type == DICT_HDR_INDEX_ID)); - mtr_start(&mtr); dict_hdr = dict_hdr_get(&mtr); - id = mtr_read_dulint(dict_hdr + type, &mtr); - id = ut_dulint_add(id, 1); + if (table_id) { + id = mtr_read_dulint(dict_hdr + DICT_HDR_TABLE_ID, &mtr); + id = ut_dulint_add(id, 1); + mlog_write_dulint(dict_hdr + DICT_HDR_TABLE_ID, id, &mtr); + *table_id = id; + } - mlog_write_dulint(dict_hdr + type, id, &mtr); + if (index_id) { + id = mtr_read_dulint(dict_hdr + DICT_HDR_INDEX_ID, &mtr); + id = ut_dulint_add(id, 1); + mlog_write_dulint(dict_hdr + DICT_HDR_INDEX_ID, id, &mtr); + *index_id = id; + } + + if (space_id) { + *space_id = mtr_read_ulint(dict_hdr + DICT_HDR_MAX_SPACE_ID, + MLOG_4BYTES, &mtr); + if (fil_assign_new_space_id(space_id)) { + mlog_write_ulint(dict_hdr + DICT_HDR_MAX_SPACE_ID, + *space_id, MLOG_4BYTES, &mtr); + } + } mtr_commit(&mtr); - - return(id); } /**********************************************************************//** @@ -151,9 +166,12 @@ dict_hdr_create( mlog_write_dulint(dict_header + DICT_HDR_INDEX_ID, ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr); - /* Obsolete, but we must initialize it to 0 anyway. */ - mlog_write_dulint(dict_header + DICT_HDR_MIX_ID, - ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr); + mlog_write_ulint(dict_header + DICT_HDR_MAX_SPACE_ID, + 0, MLOG_4BYTES, mtr); + + /* Obsolete, but we must initialize it anyway. */ + mlog_write_ulint(dict_header + DICT_HDR_MIX_ID_LOW, + DICT_HDR_FIRST_ID, MLOG_4BYTES, mtr); /* Create the B-tree roots for the clustered indexes of the basic system tables */ diff --git a/storage/innodb_plugin/dict/dict0crea.c b/storage/innodb_plugin/dict/dict0crea.c index 653bff4bef6..f185371bfca 100644 --- a/storage/innodb_plugin/dict/dict0crea.c +++ b/storage/innodb_plugin/dict/dict0crea.c @@ -239,16 +239,22 @@ dict_build_table_def_step( const char* path_or_name; ibool is_path; mtr_t mtr; + ulint space = 0; ut_ad(mutex_own(&(dict_sys->mutex))); table = node->table; - table->id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID); + dict_hdr_get_new_id(&table->id, NULL, + srv_file_per_table ? &space : NULL); thr_get_trx(thr)->table_id = table->id; if (srv_file_per_table) { + if (UNIV_UNLIKELY(space == ULINT_UNDEFINED)) { + return(DB_ERROR); + } + /* We create a new single-table tablespace for the table. We initially let it be 4 pages: - page 0 is the fsp header and an extent descriptor page, @@ -257,8 +263,6 @@ dict_build_table_def_step( - page 3 will contain the root of the clustered index of the table we create here. */ - ulint space = 0; /* reset to zero for the call below */ - if (table->dir_path_of_temp_table) { /* We place tables created with CREATE TEMPORARY TABLE in the tmp dir of mysqld server */ @@ -276,7 +280,7 @@ dict_build_table_def_step( flags = table->flags & ~(~0 << DICT_TF_BITS); error = fil_create_new_single_table_tablespace( - &space, path_or_name, is_path, + space, path_or_name, is_path, flags == DICT_TF_COMPACT ? 0 : flags, FIL_IBD_FILE_INITIAL_SIZE); table->space = (unsigned int) space; @@ -561,7 +565,7 @@ dict_build_index_def_step( ut_ad((UT_LIST_GET_LEN(table->indexes) > 0) || dict_index_is_clust(index)); - index->id = dict_hdr_get_new_id(DICT_HDR_INDEX_ID); + dict_hdr_get_new_id(NULL, &index->id, NULL); /* Inherit the space id from the table; we store all indexes of a table in the same tablespace */ diff --git a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c index 963e306c00c..af85e14f226 100644 --- a/storage/innodb_plugin/fil/fil0fil.c +++ b/storage/innodb_plugin/fil/fil0fil.c @@ -279,6 +279,10 @@ struct fil_system_struct { request */ UT_LIST_BASE_NODE_T(fil_space_t) space_list; /*!< list of all file spaces */ + ibool space_id_reuse_warned; + /* !< TRUE if fil_space_create() + has issued a warning about + potential space_id reuse */ }; /** The tablespace memory cache. This variable is NULL before the module is @@ -1193,7 +1197,19 @@ try_again: space->tablespace_version = fil_system->tablespace_version; space->mark = FALSE; - if (purpose == FIL_TABLESPACE && id > fil_system->max_assigned_id) { + if (UNIV_LIKELY(purpose == FIL_TABLESPACE) + && UNIV_UNLIKELY(id > fil_system->max_assigned_id)) { + if (!fil_system->space_id_reuse_warned) { + fil_system->space_id_reuse_warned = TRUE; + + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: Warning: allocated tablespace %lu," + " old maximum was %lu\n", + (ulong) id, + (ulong) fil_system->max_assigned_id); + } + fil_system->max_assigned_id = id; } @@ -1231,19 +1247,25 @@ try_again: Assigns a new space id for a new single-table tablespace. This works simply by incrementing the global counter. If 4 billion id's is not enough, we may need to recycle id's. -@return new tablespace id; ULINT_UNDEFINED if could not assign an id */ -static -ulint -fil_assign_new_space_id(void) -/*=========================*/ +@return TRUE if assigned, FALSE if not */ +UNIV_INTERN +ibool +fil_assign_new_space_id( +/*====================*/ + ulint* space_id) /*!< in/out: space id */ { - ulint id; + ulint id; + ibool success; mutex_enter(&fil_system->mutex); - fil_system->max_assigned_id++; + id = *space_id; - id = fil_system->max_assigned_id; + if (id < fil_system->max_assigned_id) { + id = fil_system->max_assigned_id; + } + + id++; if (id > (SRV_LOG_SPACE_FIRST_ID / 2) && (id % 1000000UL == 0)) { ut_print_timestamp(stderr); @@ -1259,7 +1281,11 @@ fil_assign_new_space_id(void) (ulong) SRV_LOG_SPACE_FIRST_ID); } - if (id >= SRV_LOG_SPACE_FIRST_ID) { + success = (id < SRV_LOG_SPACE_FIRST_ID); + + if (success) { + *space_id = fil_system->max_assigned_id = id; + } else { ut_print_timestamp(stderr); fprintf(stderr, "InnoDB: You have run out of single-table" @@ -1269,14 +1295,12 @@ fil_assign_new_space_id(void) " have to dump all your tables and\n" "InnoDB: recreate the whole InnoDB installation.\n", (ulong) id); - fil_system->max_assigned_id--; - - id = ULINT_UNDEFINED; + *space_id = ULINT_UNDEFINED; } mutex_exit(&fil_system->mutex); - return(id); + return(success); } /*******************************************************************//** @@ -1512,7 +1536,7 @@ fil_init( ut_a(hash_size > 0); ut_a(max_n_open > 0); - fil_system = mem_alloc(sizeof(fil_system_t)); + fil_system = mem_zalloc(sizeof(fil_system_t)); mutex_create(&fil_system->mutex, SYNC_ANY_LATCH); @@ -1521,16 +1545,7 @@ fil_init( UT_LIST_INIT(fil_system->LRU); - fil_system->n_open = 0; fil_system->max_n_open = max_n_open; - - fil_system->modification_counter = 0; - fil_system->max_assigned_id = 0; - - fil_system->tablespace_version = 0; - - UT_LIST_INIT(fil_system->unflushed_spaces); - UT_LIST_INIT(fil_system->space_list); } /*******************************************************************//** @@ -2115,7 +2130,7 @@ fil_op_log_parse_or_replay( fil_create_directory_for_tablename(name); if (fil_create_new_single_table_tablespace( - &space_id, name, FALSE, flags, + space_id, name, FALSE, flags, FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { ut_error; } @@ -2562,9 +2577,7 @@ UNIV_INTERN ulint fil_create_new_single_table_tablespace( /*===================================*/ - ulint* space_id, /*!< in/out: space id; if this is != 0, - then this is an input parameter, - otherwise output */ + ulint space_id, /*!< in: space id */ const char* tablename, /*!< in: the table name in the usual databasename/tablename format of InnoDB, or a dir path to a temp @@ -2584,6 +2597,8 @@ fil_create_new_single_table_tablespace( ibool success; char* path; + ut_a(space_id > 0); + ut_a(space_id < SRV_LOG_SPACE_FIRST_ID); ut_a(size >= FIL_IBD_FILE_INITIAL_SIZE); /* The tablespace flags (FSP_SPACE_FLAGS) should be 0 for ROW_FORMAT=COMPACT @@ -2640,38 +2655,21 @@ fil_create_new_single_table_tablespace( return(DB_ERROR); } - buf2 = ut_malloc(3 * UNIV_PAGE_SIZE); - /* Align the memory for file i/o if we might have O_DIRECT set */ - page = ut_align(buf2, UNIV_PAGE_SIZE); - ret = os_file_set_size(path, file, size * UNIV_PAGE_SIZE, 0); if (!ret) { - ut_free(buf2); - os_file_close(file); - os_file_delete(path); - - mem_free(path); - return(DB_OUT_OF_FILE_SPACE); - } - - if (*space_id == 0) { - *space_id = fil_assign_new_space_id(); - } - - /* printf("Creating tablespace %s id %lu\n", path, *space_id); */ - - if (*space_id == ULINT_UNDEFINED) { - ut_free(buf2); + err = DB_OUT_OF_FILE_SPACE; error_exit: os_file_close(file); error_exit2: os_file_delete(path); mem_free(path); - return(DB_ERROR); + return(err); } + /* printf("Creating tablespace %s id %lu\n", path, space_id); */ + /* We have to write the space id to the file immediately and flush the file to disk. This is because in crash recovery we must be aware what tablespaces exist and what are their space id's, so that we can apply @@ -2681,10 +2679,14 @@ error_exit2: with zeros from the call of os_file_set_size(), until a buffer pool flush would write to it. */ + buf2 = ut_malloc(3 * UNIV_PAGE_SIZE); + /* Align the memory for file i/o if we might have O_DIRECT set */ + page = ut_align(buf2, UNIV_PAGE_SIZE); + memset(page, '\0', UNIV_PAGE_SIZE); - fsp_header_init_fields(page, *space_id, flags); - mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, *space_id); + fsp_header_init_fields(page, space_id, flags); + mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, space_id); if (!(flags & DICT_TF_ZSSIZE_MASK)) { buf_flush_init_for_writing(page, NULL, 0); @@ -2715,6 +2717,7 @@ error_exit2: " to tablespace ", stderr); ut_print_filename(stderr, path); putc('\n', stderr); + err = DB_ERROR; goto error_exit; } @@ -2724,22 +2727,20 @@ error_exit2: fputs("InnoDB: Error: file flush of tablespace ", stderr); ut_print_filename(stderr, path); fputs(" failed\n", stderr); + err = DB_ERROR; goto error_exit; } os_file_close(file); - if (*space_id == ULINT_UNDEFINED) { - goto error_exit2; - } - - success = fil_space_create(path, *space_id, flags, FIL_TABLESPACE); + success = fil_space_create(path, space_id, flags, FIL_TABLESPACE); if (!success) { + err = DB_ERROR; goto error_exit2; } - fil_node_create(path, size, *space_id, FALSE); + fil_node_create(path, size, space_id, FALSE); #ifndef UNIV_HOTBACKUP { @@ -2750,7 +2751,7 @@ error_exit2: fil_op_write_log(flags ? MLOG_FILE_CREATE2 : MLOG_FILE_CREATE, - *space_id, + space_id, is_temp ? MLOG_FILE_FLAG_TEMP : 0, flags, tablename, NULL, &mtr); diff --git a/storage/innodb_plugin/include/dict0boot.h b/storage/innodb_plugin/include/dict0boot.h index 1a13bd1503a..148b5cbe250 100644 --- a/storage/innodb_plugin/include/dict0boot.h +++ b/storage/innodb_plugin/include/dict0boot.h @@ -46,13 +46,14 @@ dict_hdr_get( /*=========*/ mtr_t* mtr); /*!< in: mtr */ /**********************************************************************//** -Returns a new row, table, index, or tree id. -@return the new id */ +Returns a new table, index, or space id. */ UNIV_INTERN -dulint +void dict_hdr_get_new_id( /*================*/ - ulint type); /*!< in: DICT_HDR_ROW_ID, ... */ + dulint* table_id, /*!< out: table id (not assigned if NULL) */ + dulint* index_id, /*!< out: index id (not assigned if NULL) */ + ulint* space_id); /*!< out: space id (not assigned if NULL) */ /**********************************************************************//** Returns a new row id. @return the new id */ @@ -119,7 +120,8 @@ dict_create(void); #define DICT_HDR_ROW_ID 0 /* The latest assigned row id */ #define DICT_HDR_TABLE_ID 8 /* The latest assigned table id */ #define DICT_HDR_INDEX_ID 16 /* The latest assigned index id */ -#define DICT_HDR_MIX_ID 24 /* Obsolete, always 0. */ +#define DICT_HDR_MAX_SPACE_ID 24 /* The latest assigned space id, or 0*/ +#define DICT_HDR_MIX_ID_LOW 28 /* Obsolete,always DICT_HDR_FIRST_ID */ #define DICT_HDR_TABLES 32 /* Root of the table index tree */ #define DICT_HDR_TABLE_IDS 36 /* Root of the table index tree */ #define DICT_HDR_COLUMNS 40 /* Root of the column index tree */ diff --git a/storage/innodb_plugin/include/fil0fil.h b/storage/innodb_plugin/include/fil0fil.h index de8ef9e9687..10c3ff025ac 100644 --- a/storage/innodb_plugin/include/fil0fil.h +++ b/storage/innodb_plugin/include/fil0fil.h @@ -225,6 +225,16 @@ fil_space_create( 0 for uncompressed tablespaces */ ulint purpose);/*!< in: FIL_TABLESPACE, or FIL_LOG if log */ /*******************************************************************//** +Assigns a new space id for a new single-table tablespace. This works simply by +incrementing the global counter. If 4 billion id's is not enough, we may need +to recycle id's. +@return TRUE if assigned, FALSE if not */ +UNIV_INTERN +ibool +fil_assign_new_space_id( +/*====================*/ + ulint* space_id); /*!< in/out: space id */ +/*******************************************************************//** Returns the size of the space in pages. The tablespace must be cached in the memory cache. @return space size, 0 if space not found */ @@ -427,9 +437,7 @@ UNIV_INTERN ulint fil_create_new_single_table_tablespace( /*===================================*/ - ulint* space_id, /*!< in/out: space id; if this is != 0, - then this is an input parameter, - otherwise output */ + ulint space_id, /*!< in: space id */ const char* tablename, /*!< in: the table name in the usual databasename/tablename format of InnoDB, or a dir path to a temp diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c index 9592de88346..a98dd8d2900 100644 --- a/storage/innodb_plugin/row/row0mysql.c +++ b/storage/innodb_plugin/row/row0mysql.c @@ -2427,7 +2427,7 @@ row_discard_tablespace_for_mysql( goto funct_exit; } - new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID); + dict_hdr_get_new_id(&new_id, NULL, NULL); /* Remove all locks except the table-level S and X locks. */ lock_remove_all_on_table(table, FALSE); @@ -2789,10 +2789,11 @@ row_truncate_table_for_mysql( dict_index_t* index; - space = 0; + dict_hdr_get_new_id(NULL, NULL, &space); - if (fil_create_new_single_table_tablespace( - &space, table->name, FALSE, flags, + if (space == ULINT_UNDEFINED + || fil_create_new_single_table_tablespace( + space, table->name, FALSE, flags, FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { ut_print_timestamp(stderr); fprintf(stderr, @@ -2897,7 +2898,7 @@ next_rec: mem_heap_free(heap); - new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID); + dict_hdr_get_new_id(&new_id, NULL, NULL); info = pars_info_create(); From 2dcd1ac65ada96c9f7e51334a3b6ba8c856c92c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 24 May 2010 14:43:49 +0300 Subject: [PATCH 056/121] Document the Bug #53578 fix. --- storage/innodb_plugin/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index a05e1ebc716..8b5a9bf2d7e 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2010-05-24 The InnoDB Team + + * dict/dict0boot.c, dict/dict0crea.c, fil/fil0fil.c, + include/dict0boot.h, include/fil0fil.h, row/row0mysql.c: + Fix Bug#53578: assert on invalid page access, in fil_io() + 2010-05-14 The InnoDB Team * mysql-test/innodb_bug48024.test, mysql-test/innodb_bug48024.result, dict/dict0dict.c, handler/ha_innodb.cc, handler/ha_innodb.h, From 7e80f1c5dc5e834117d85d6d71aab598d193a6e9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 May 2010 21:54:08 +0800 Subject: [PATCH 057/121] Bug #49741 test files contain explicit references to bin/relay-log positions Some of the test cases reference to binlog position and these position numbers are written into result explicitly. It is difficult to maintain if log event format changes. There are a couple of cases explicit position number appears, we handle them in different ways A. 'CHANGE MASTER ...' with MASTER_LOG_POS or/and RELAY_LOG_POS options Use --replace_result to mask them. B. 'SHOW BINLOG EVENT ...' Replaced by show_binlog_events.inc or wait_for_binlog_event.inc. show_binlog_events.inc file's function is enhanced by given $binlog_file and $binlog_limit. C. 'SHOW SLAVE STATUS', 'show_slave_status.inc' and 'show_slave_status2.inc' For the test cases just care a few items in the result of 'SHOW SLAVE STATUS', only the items related to each test case are showed. 'show_slave_status.inc' is rebuild, only the given items in $status_items will be showed. 'check_slave_is_running.inc' and 'check_slave_no_error.inc' and 'check_slave_param.inc' are auxiliary files helping to show running status and error information easily. mysql-test/extra/binlog_tests/binlog.test: It only cares whether current binlog file index is changed, so it is ok with 'show_master_status.inc' instead of 'show mater status'. mysql-test/extra/binlog_tests/blackhole.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/extra/rpl_tests/rpl_deadlock.test: Use 'check_slave_is_running.inc' instead of 'show_slave_status2.inc'. mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: Use 'wait_for_slave_sql_error.inc' and 'ait_for_slave_sql_error_and_skip.inc' instead of 'show slave status'. mysql-test/extra/rpl_tests/rpl_flsh_tbls.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test: It is need now to give a error number, so use 'wait_for_slave_io_to_stop.inc' instead of 'wait_for_slave_io_error.inc'. mysql-test/extra/rpl_tests/rpl_insert_delayed.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/extra/rpl_tests/rpl_log.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. se 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/extra/rpl_tests/rpl_max_relay_size.test: se 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/extra/rpl_tests/rpl_reset_slave.test: Use 'show_slave_status.inc' instead of 'show_slave_status2.inc' statement. Use 'check_slave_no_error.inc' to simplify the check that there is no error. mysql-test/extra/rpl_tests/rpl_row_basic.test: Use 'check_slave_is_running.inc' to verify that Slave threads are running well. Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. mysql-test/extra/rpl_tests/rpl_row_tabledefs.test: Use 'show_slave_error_status_and_skip.inc' instead of 'show slave status'. mysql-test/include/check_slave_is_running.inc: To make sure both sql and io thread are running well. If not, the test will be aborted. mysql-test/include/check_slave_no_error.inc: To make sure both sql and io thread have no error. If not, the test will be aborted. mysql-test/include/get_relay_log_pos.inc: According to the position of a log event in master binlog file, find the peer position of a log event in relay log file. mysql-test/include/rpl_stmt_seq.inc: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/include/show_binlog_events.inc: Add two options $binlog_file and $binlog_limit for showing binlog events from different binlog files or/and given different limits on position or row number. mysql-test/include/show_rpl_debug_info.inc: Add 'SELECT NOW()' in the debug information. mysql-test/include/show_slave_status.inc: It's more clean and tidy Only the given columns of slave status are printed. mysql-test/include/test_fieldsize.inc: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave stutus'. mysql-test/include/wait_for_binlog_event.inc: Use show_rpl_debug_info.inc instead of 'SHOW BINLOG EVENTS'. mysql-test/include/wait_for_slave_io_error.inc: Add $slave_io_errno and $show_slave_io_error, it waits only a given error. mysql-test/include/wait_for_slave_param.inc: Use die instead of exit. mysql-test/include/wait_for_slave_sql_error.inc: Add $slave_sql_errno and $show_slave_sql_error, it waits only a given error. mysql-test/include/wait_for_status_var.inc: Use die instead of exit. mysql-test/r/flush_block_commit_notembedded.result: It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'. mysql-test/r/multi_update.result: It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'. mysql-test/suite/binlog/r/binlog_innodb.result: It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'. mysql-test/suite/binlog/r/binlog_row_binlog.result: Position in the result of 'show master status' is replaced by '#'. mysql-test/suite/binlog/r/binlog_stm_binlog.result: Position in the result of 'show master status' is replaced by '#'. mysql-test/suite/binlog/t/binlog_innodb.test: It checks whether somethings are binlogged, so we use 'show_binlog_event.inc' instead of 'show master status'. mysql-test/suite/binlog/t/binlog_stm_binlog.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/bugs/r/rpl_bug36391.result: Position in the result of 'show master status' is replaced by '#'. mysql-test/suite/bugs/t/rpl_bug12691.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/bugs/t/rpl_bug36391.test: 'show master status' is replaced by 'show_master_status.inc'. Position in the result of 'show master status' is replaced by '#'. mysql-test/suite/engines/funcs/r/rpl_000015.result: It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'. mysql-test/suite/engines/funcs/t/rpl_000015.test: Use 'check_slave_is_running.inc' to verify that Slave threads are running well. mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test: Use 'query_vertical SHOW SLAVE STATUS' instead of 'show slave status'. There is no status columns in the result file, for no slave exists on master's server. mysql-test/suite/engines/funcs/t/rpl_change_master.test: This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos. mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test: We doesn't really need the statement. mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test: Just show Relay_Log_File, running status and error informations. Use 'check_slave_is_running.inc' to verify that Slave threads are running well. mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/engines/funcs/t/rpl_log_pos.test: Mask the explicit positions in the result file. Use 'check_slave_no_error.inc' to simplify the check that there is no error. Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave stutus'. mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/engines/funcs/t/rpl_row_drop.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave stutus'. mysql-test/suite/engines/funcs/t/rpl_row_until.test: Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements. Mask the explicit binary log positions in the result file. mysql-test/suite/engines/funcs/t/rpl_server_id1.test: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave stutus'. Use 'check_slave_no_error.inc' to simplify the check that there is no error. mysql-test/suite/engines/funcs/t/rpl_server_id2.test: It doesn't really need in this test. mysql-test/suite/engines/funcs/t/rpl_slave_status.test: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave stutus'. mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/manual/t/rpl_replication_delay.test: Use 'show_slave_status.inc' instead of 'show slave status'. mysql-test/suite/parts/t/rpl_partition.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/suite/rpl/include/rpl_mixed_ddl.inc: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/rpl/include/rpl_mixed_dml.inc: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/rpl/t/rpl_000015.test: Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'. mysql-test/suite/rpl/t/rpl_binlog_grant.test: Use 'wait_for_binlog_event.inc' instead of 'show binlog events' statement. mysql-test/suite/rpl/t/rpl_bug33931.test: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave stutus'. mysql-test/suite/rpl/t/rpl_change_master.test: This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos. mysql-test/suite/rpl/t/rpl_critical_errors.test: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave stutus'. mysql-test/suite/rpl/t/rpl_dual_pos_advance.test: Mask the explicit position numbers in result file. It is restricted running on SBR, for it want to binlog 'set @a=1' statement. mysql-test/suite/rpl/t/rpl_empty_master_crash.test: It doesn't need in this test. mysql-test/suite/rpl/t/rpl_flushlog_loop.test: UUse 'check_slave_is_running.inc' and 'show_slave_status.inc' instead of 'show slave status' statement. mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test: Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening. mysql-test/suite/rpl/t/rpl_grant.test: It doesn't need in this test. mysql-test/suite/rpl/t/rpl_incident.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/suite/rpl/t/rpl_known_bugs_detection.test: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave stutus'. mysql-test/suite/rpl/t/rpl_loaddata_fatal.test: Use 'wait_for_slave_sql_error_and_skip.inc' to wait the given sql thread error happening and then skip the event. There is no need to print the result of 'show slave stutus'. mysql-test/suite/rpl/t/rpl_log_pos.test: Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening. There is no need to print the result of 'show slave status'. mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/rpl/t/rpl_replicate_do.test: Use 'show_slave_status.inc' instead of 'show slave status'. mysql-test/suite/rpl/t/rpl_rotate_logs.test: Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'. mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/rpl/t/rpl_row_create_table.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/rpl/t/rpl_row_drop.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/rpl/t/rpl_row_until.test: Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements. mysql-test/suite/rpl/t/rpl_skip_error.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave status'. mysql-test/suite/rpl/t/rpl_slave_skip.test: Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and mask the explicit position number in the 'CHANGE MASTER' statements. mysql-test/suite/rpl/t/rpl_sp.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/suite/rpl/t/rpl_ssl.test: Use 'show_slave_status.inc' instead of 'show slave status'. mysql-test/suite/rpl/t/rpl_ssl1.test: Use 'show_slave_status.inc' instead of 'show slave status'. mysql-test/suite/rpl/t/rpl_stm_until.test: Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements. mysql-test/suite/rpl/t/rpl_temporary_errors.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test: Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening. There is no need to print the result of 'show slave status'. mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test: Mask master_log_pos and master_log_file mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test: Use 'check_slave_is_running.inc' instead of 'show slave status' statement. mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/t/alter_table-big.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/t/create-big.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/t/ctype_cp932_binlog_stm.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. mysql-test/t/flush_block_commit_notembedded.test: It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'. mysql-test/t/multi_update.test: It checks whether somethings are binlogged, so we using 'wait_binlog_event.inc' instead of 'show master status'. mysql-test/t/sp_trans_log.test: Use 'show_binlog_events.inc' instead of 'show binlog events' statement. --- mysql-test/extra/binlog_tests/binlog.test | 25 +- mysql-test/extra/binlog_tests/blackhole.test | 26 +- mysql-test/extra/rpl_tests/rpl_deadlock.test | 7 +- .../extra/rpl_tests/rpl_extraMaster_Col.test | 67 +- .../extra/rpl_tests/rpl_extraSlave_Col.test | 104 +- mysql-test/extra/rpl_tests/rpl_flsh_tbls.test | 12 +- .../rpl_get_master_version_and_clock.test | 2 +- .../extra/rpl_tests/rpl_insert_delayed.test | 17 +- mysql-test/extra/rpl_tests/rpl_log.test | 57 +- .../extra/rpl_tests/rpl_max_relay_size.test | 19 +- .../extra/rpl_tests/rpl_ndb_apply_status.test | 38 +- .../extra/rpl_tests/rpl_reset_slave.test | 59 +- mysql-test/extra/rpl_tests/rpl_row_basic.test | 32 +- .../extra/rpl_tests/rpl_row_tabledefs.test | 38 +- mysql-test/include/check_slave_is_running.inc | 18 + mysql-test/include/check_slave_no_error.inc | 17 + mysql-test/include/check_slave_param.inc | 16 + mysql-test/include/get_relay_log_pos.inc | 70 + mysql-test/include/rpl_stmt_seq.inc | 30 +- mysql-test/include/show_binlog_events.inc | 41 +- mysql-test/include/show_rpl_debug_info.inc | 2 + mysql-test/include/show_slave_status.inc | 25 +- mysql-test/include/show_slave_status2.inc | 8 - mysql-test/include/test_fieldsize.inc | 7 +- mysql-test/include/wait_for_binlog_event.inc | 2 +- .../include/wait_for_slave_io_error.inc | 47 +- mysql-test/include/wait_for_slave_param.inc | 2 +- .../include/wait_for_slave_sql_error.inc | 17 +- .../wait_for_slave_sql_error_and_skip.inc | 27 +- mysql-test/include/wait_for_status_var.inc | 4 +- .../include/wait_until_count_sessions.inc | 1 + mysql-test/r/alter_table-big.result | 32 +- mysql-test/r/create-big.result | 54 +- mysql-test/r/ctype_cp932_binlog_stm.result | 12 +- .../r/flush_block_commit_notembedded.result | 10 +- mysql-test/r/multi_update.result | 6 - mysql-test/r/sp_trans_log.result | 12 +- .../suite/binlog/r/binlog_innodb.result | 12 +- .../suite/binlog/r/binlog_row_binlog.result | 2069 ++++++++--------- .../suite/binlog/r/binlog_stm_binlog.result | 1068 +++++---- .../binlog/r/binlog_stm_blackhole.result | 12 +- mysql-test/suite/binlog/t/binlog_innodb.test | 6 +- .../suite/binlog/t/binlog_stm_binlog.test | 3 +- mysql-test/suite/bugs/r/rpl_bug12691.result | 9 +- mysql-test/suite/bugs/r/rpl_bug36391.result | 3 +- mysql-test/suite/bugs/t/rpl_bug12691.test | 4 +- mysql-test/suite/bugs/t/rpl_bug36391.test | 4 +- .../suite/engines/funcs/r/rpl_000015.result | 143 +- .../suite/engines/funcs/r/rpl_REDIRECT.result | 3 +- .../engines/funcs/r/rpl_change_master.result | 6 - .../funcs/r/rpl_empty_master_crash.result | 2 - .../engines/funcs/r/rpl_flushlog_loop.result | 41 +- .../engines/funcs/r/rpl_loaddata_s.result | 2 +- .../suite/engines/funcs/r/rpl_log_pos.result | 28 +- .../engines/funcs/r/rpl_rbr_to_sbr.result | 51 +- .../suite/engines/funcs/r/rpl_row_drop.result | 9 +- .../funcs/r/rpl_row_inexist_tbl.result | 40 +- .../funcs/r/rpl_row_max_relay_size.result | 239 +- .../funcs/r/rpl_row_reset_slave.result | 185 +- .../engines/funcs/r/rpl_row_until.result | 188 +- .../engines/funcs/r/rpl_server_id1.result | 4 +- .../engines/funcs/r/rpl_server_id2.result | 3 - .../engines/funcs/r/rpl_slave_status.result | 39 - .../funcs/r/rpl_stm_max_relay_size.result | 239 +- .../funcs/r/rpl_stm_reset_slave.result | 185 +- .../funcs/r/rpl_switch_stm_row_mixed.result | 4 +- .../suite/engines/funcs/t/rpl_000015.test | 26 +- .../suite/engines/funcs/t/rpl_REDIRECT.test | 12 +- .../engines/funcs/t/rpl_change_master.test | 25 +- .../funcs/t/rpl_empty_master_crash.test | 3 - .../engines/funcs/t/rpl_flushlog_loop.test | 7 +- .../suite/engines/funcs/t/rpl_loaddata_s.test | 4 +- .../suite/engines/funcs/t/rpl_log_pos.test | 45 +- .../suite/engines/funcs/t/rpl_rbr_to_sbr.test | 16 +- .../suite/engines/funcs/t/rpl_row_drop.test | 5 +- .../engines/funcs/t/rpl_row_inexist_tbl.test | 10 +- .../suite/engines/funcs/t/rpl_row_until.test | 49 +- .../suite/engines/funcs/t/rpl_server_id1.test | 9 +- .../suite/engines/funcs/t/rpl_server_id2.test | 3 - .../engines/funcs/t/rpl_slave_status.test | 12 +- .../funcs/t/rpl_switch_stm_row_mixed.test | 8 +- .../manual/r/rpl_replication_delay.result | 117 +- .../suite/manual/t/rpl_replication_delay.test | 16 +- .../ndb_team/r/rpl_ndb_extraColMaster.result | 612 +---- .../ndb_team/r/rpl_ndb_mix_innodb.result | 22 +- mysql-test/suite/parts/r/rpl_partition.result | 40 +- mysql-test/suite/parts/t/rpl_partition.test | 4 +- .../suite/rpl/include/rpl_mixed_ddl.inc | 4 +- .../suite/rpl/include/rpl_mixed_dml.inc | 5 +- mysql-test/suite/rpl/r/rpl_000015.result | 141 -- .../suite/rpl/r/rpl_binlog_grant.result | 24 - mysql-test/suite/rpl/r/rpl_bug33931.result | 40 +- .../suite/rpl/r/rpl_change_master.result | 80 +- .../suite/rpl/r/rpl_deadlock_innodb.result | 122 +- .../suite/rpl/r/rpl_dual_pos_advance.result | 14 +- .../suite/rpl/r/rpl_empty_master_crash.result | 1 - .../suite/rpl/r/rpl_extraCol_innodb.result | 395 +--- .../suite/rpl/r/rpl_extraCol_myisam.result | 395 +--- .../rpl/r/rpl_extraColmaster_innodb.result | 906 +------- .../rpl/r/rpl_extraColmaster_myisam.result | 906 +------- .../rpl/r/rpl_filter_tables_not_exist.result | 32 +- .../suite/rpl/r/rpl_flushlog_loop.result | 44 +- .../r/rpl_get_master_version_and_clock.result | 3 +- mysql-test/suite/rpl/r/rpl_grant.result | 39 - mysql-test/suite/rpl/r/rpl_incident.result | 80 +- .../suite/rpl/r/rpl_innodb_mixed_ddl.result | 39 +- .../suite/rpl/r/rpl_innodb_mixed_dml.result | 527 +++-- .../rpl/r/rpl_known_bugs_detection.result | 84 +- .../suite/rpl/r/rpl_loaddata_fatal.result | 82 +- mysql-test/suite/rpl/r/rpl_log_pos.result | 86 +- mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result | 69 +- .../suite/rpl/r/rpl_replicate_do.result | 38 - mysql-test/suite/rpl/r/rpl_rotate_logs.result | 114 +- .../suite/rpl/r/rpl_row_basic_11bugs.result | 13 +- .../suite/rpl/r/rpl_row_basic_2myisam.result | 12 +- .../suite/rpl/r/rpl_row_basic_3innodb.result | 12 +- mysql-test/suite/rpl/r/rpl_row_colSize.result | 520 +---- .../suite/rpl/r/rpl_row_create_table.result | 151 +- mysql-test/suite/rpl/r/rpl_row_drop.result | 9 +- .../suite/rpl/r/rpl_row_flsh_tbls.result | 8 +- mysql-test/suite/rpl/r/rpl_row_log.result | 138 +- .../suite/rpl/r/rpl_row_log_innodb.result | 138 +- .../suite/rpl/r/rpl_row_max_relay_size.result | 239 +- .../suite/rpl/r/rpl_row_reset_slave.result | 185 +- .../rpl/r/rpl_row_tabledefs_2myisam.result | 215 +- .../rpl/r/rpl_row_tabledefs_3innodb.result | 215 +- mysql-test/suite/rpl/r/rpl_row_until.result | 166 +- mysql-test/suite/rpl/r/rpl_skip_error.result | 80 +- .../r/rpl_slave_load_remove_tmpfile.result | 39 - mysql-test/suite/rpl/r/rpl_slave_skip.result | 82 +- mysql-test/suite/rpl/r/rpl_sp.result | 178 +- mysql-test/suite/rpl/r/rpl_ssl.result | 74 +- mysql-test/suite/rpl/r/rpl_ssl1.result | 111 +- .../suite/rpl/r/rpl_stm_flsh_tbls.result | 8 +- .../suite/rpl/r/rpl_stm_insert_delayed.result | 22 +- mysql-test/suite/rpl/r/rpl_stm_log.result | 110 +- .../suite/rpl/r/rpl_stm_max_relay_size.result | 239 +- .../suite/rpl/r/rpl_stm_reset_slave.result | 185 +- mysql-test/suite/rpl/r/rpl_stm_until.result | 174 +- .../suite/rpl/r/rpl_temporary_errors.result | 40 +- mysql-test/suite/rpl/t/rpl_000015-slave.opt | 1 - mysql-test/suite/rpl/t/rpl_000015.cnf | 2 - mysql-test/suite/rpl/t/rpl_000015.test | 40 - mysql-test/suite/rpl/t/rpl_binlog_grant.test | 10 +- mysql-test/suite/rpl/t/rpl_bug33931.test | 7 +- mysql-test/suite/rpl/t/rpl_change_master.test | 22 +- .../suite/rpl/t/rpl_critical_errors.test | 12 +- .../suite/rpl/t/rpl_dual_pos_advance.test | 54 +- .../suite/rpl/t/rpl_empty_master_crash.test | 2 - .../rpl/t/rpl_filter_tables_not_exist.test | 2 +- mysql-test/suite/rpl/t/rpl_flushlog_loop.test | 26 +- .../t/rpl_get_master_version_and_clock.test | 10 +- mysql-test/suite/rpl/t/rpl_grant.test | 2 - mysql-test/suite/rpl/t/rpl_incident.test | 9 +- .../suite/rpl/t/rpl_known_bugs_detection.test | 14 +- .../suite/rpl/t/rpl_loaddata_fatal.test | 10 +- mysql-test/suite/rpl/t/rpl_log_pos.test | 11 +- mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test | 14 +- mysql-test/suite/rpl/t/rpl_replicate_do.test | 6 +- mysql-test/suite/rpl/t/rpl_rotate_logs.test | 10 +- .../suite/rpl/t/rpl_row_basic_11bugs.test | 4 +- .../suite/rpl/t/rpl_row_create_table.test | 32 +- mysql-test/suite/rpl/t/rpl_row_drop.test | 5 +- mysql-test/suite/rpl/t/rpl_row_until.test | 41 +- mysql-test/suite/rpl/t/rpl_skip_error.test | 4 +- .../rpl/t/rpl_slave_load_remove_tmpfile.test | 9 +- mysql-test/suite/rpl/t/rpl_slave_skip.test | 19 +- mysql-test/suite/rpl/t/rpl_sp.test | 4 +- mysql-test/suite/rpl/t/rpl_ssl.test | 11 +- mysql-test/suite/rpl/t/rpl_ssl1.test | 17 +- mysql-test/suite/rpl/t/rpl_stm_until.test | 42 +- .../suite/rpl/t/rpl_temporary_errors.test | 2 +- .../suite/rpl_ndb/r/rpl_ndb_basic.result | 40 +- .../suite/rpl_ndb/r/rpl_ndb_circular.result | 80 +- .../rpl_ndb/r/rpl_ndb_circular_simplex.result | 80 +- .../suite/rpl_ndb/r/rpl_ndb_extraCol.result | 395 +--- .../suite/rpl_ndb/r/rpl_ndb_idempotent.result | 11 +- mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result | 162 +- .../suite/rpl_ndb/r/rpl_ndb_multi.result | 4 +- .../suite/rpl_ndb/r/rpl_ndb_stm_innodb.result | 22 +- .../suite/rpl_ndb/r/rpl_ndb_sync.result | 40 +- .../suite/rpl_ndb/r/rpl_row_basic_7ndb.result | 12 +- .../suite/rpl_ndb/r/rpl_truncate_7ndb.result | 70 +- mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test | 9 +- .../suite/rpl_ndb/t/rpl_ndb_circular.test | 16 +- .../rpl_ndb/t/rpl_ndb_circular_simplex.test | 12 +- .../suite/rpl_ndb/t/rpl_ndb_idempotent.test | 14 +- mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test | 2 +- mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test | 6 +- .../suite/rpl_ndb/t/rpl_truncate_7ndb.test | 9 +- mysql-test/t/alter_table-big.test | 8 +- mysql-test/t/create-big.test | 12 +- mysql-test/t/ctype_cp932_binlog_stm.test | 3 +- .../t/flush_block_commit_notembedded.test | 4 +- mysql-test/t/multi_update.test | 6 +- mysql-test/t/sp_trans_log.test | 4 +- 196 files changed, 3690 insertions(+), 12027 deletions(-) create mode 100644 mysql-test/include/check_slave_is_running.inc create mode 100644 mysql-test/include/check_slave_no_error.inc create mode 100644 mysql-test/include/check_slave_param.inc create mode 100644 mysql-test/include/get_relay_log_pos.inc delete mode 100644 mysql-test/include/show_slave_status2.inc delete mode 100644 mysql-test/suite/rpl/r/rpl_000015.result delete mode 100644 mysql-test/suite/rpl/t/rpl_000015-slave.opt delete mode 100644 mysql-test/suite/rpl/t/rpl_000015.cnf delete mode 100644 mysql-test/suite/rpl/t/rpl_000015.test diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index b819996acb0..7f48341077e 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -41,13 +41,10 @@ while ($1) --enable_query_log commit; drop table t1; ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events in 'master-bin.000001' from 106; ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events in 'master-bin.000002' from 106; - +--source include/show_binlog_events.inc +--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) +--source include/show_binlog_events.inc +--let $binlog_file= # # Bug#22540 - Incorrect value in column End_log_pos of @@ -77,8 +74,7 @@ insert into t1 values (2); insert into t1 values (3); commit; drop table t1; ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ -show binlog events from 0; +--source include/show_binlog_events.inc # now show that nothing breaks if we need to read from the cache more # than once, resulting in split event-headers @@ -100,8 +96,7 @@ while ($1) commit; enable_query_log; ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ -show binlog events from 0; +--source include/show_binlog_events.inc drop table t1; @@ -122,8 +117,7 @@ set @b= 14632475938453979136; execute stmt using @a, @b; deallocate prepare stmt; drop table t1; ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ -show binlog events from 0; +--source include/show_binlog_events.inc # @@ -249,14 +243,15 @@ reset master; drop table if exists t3; --enable_warnings create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb; -show master status; +source include/show_master_status.inc; let $it=4; while ($it) { insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); dec $it; } -show master status /* must show new binlog index after rotating */; +# must show new binlog index after rotating; +source include/show_master_status.inc; drop table t3; --echo # diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test index 14c15a58e18..da63a7a8619 100644 --- a/mysql-test/extra/binlog_tests/blackhole.test +++ b/mysql-test/extra/binlog_tests/blackhole.test @@ -125,12 +125,7 @@ select * from t1; select * from t2; select * from t3; -let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_column 2 # 4 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ ---replace_regex /file_id=[0-9]+/file_id=#/ -show binlog events; +--source include/show_binlog_events.inc drop table t1,t2,t3; @@ -168,18 +163,21 @@ set autocommit=0; start transaction; insert into t1 values(1); commit; + +let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1); + start transaction; insert into t1 values(2); rollback; + +let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1); +if (`SELECT $master_log_pos_2 <> $master_log_pos_1`) +{ + echo $master_log_pos_1 $master_log_pos_2; + die Rollbacked transaction has been binlogged; +} + set autocommit=1; - -let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_column 2 # 4 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ ---replace_regex /file_id=[0-9]+/file_id=#/ -show binlog events; - drop table if exists t1; # diff --git a/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test index 1b331cc948b..607348ae97b 100644 --- a/mysql-test/extra/rpl_tests/rpl_deadlock.test +++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test @@ -61,7 +61,7 @@ sync_with_master; SELECT * FROM t1; SELECT * FROM t3; # Check that no error is reported ---source include/show_slave_status2.inc +source include/check_slave_is_running.inc; --echo # 2) Test lock wait timeout @@ -89,7 +89,7 @@ sync_with_master; SELECT * FROM t1; SELECT * FROM t3; # Check that no error is reported ---source include/show_slave_status2.inc +source include/check_slave_is_running.inc; --echo # 3) Test lock wait timeout and purged relay log @@ -103,6 +103,7 @@ SET global max_relay_log_size=0; --source include/stop_slave.inc DELETE FROM t2; # Set slave position to the BEGIN log event +--replace_result $master_pos_begin MASTER_POS_BEGIN eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin; BEGIN; # Hold lock @@ -119,7 +120,7 @@ sync_with_master; SELECT * FROM t1; SELECT * FROM t3; # Check that no error is reported ---source include/show_slave_status2.inc +source include/check_slave_is_running.inc; --echo # Clean up diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test index c426ac1fae8..16c4bc8e2da 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test @@ -146,12 +146,7 @@ SELECT COUNT(*) FROM t1; --echo SELECT * FROM t1 ORDER BY f3 LIMIT 20; ---echo ---echo * Show Slave Status * ---echo ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical show slave status; ---echo +--source include/check_slave_is_running.inc ### Altering table def scenario --echo @@ -431,16 +426,14 @@ connection master; delete from t4; delete from t31; ---echo ---echo ** Check slave status ** ---echo #connection slave; sync_slave_with_master; select * from t31; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical show slave status; +--echo +--echo ** Check slave status ** +--echo +--source include/check_slave_is_running.inc #### Clean Up #### @@ -493,16 +486,15 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), --echo --echo ******************************************** ---echo *** Expect slave to fail with Error 1523 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** --echo connection slave; -source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF +--let $slave_sql_errno= 1535 +--let $slave_skip_counter= 2 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo --echo *** Drop t10 *** @@ -550,16 +542,15 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), --echo --echo ******************************************** ---echo *** Expect slave to fail with Error 1523 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** --echo connection slave; -source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF +--let $slave_sql_errno= 1535 +--let $slave_skip_counter= 2 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo --echo *** Drop t11 *** @@ -697,10 +688,10 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; # Remove below once fixed #*************************** connection slave; -source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +# 1091 = ER_CANT_DROP_FIELD_OR_KEY +--let $slave_sql_errno= 1091 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc #*************************** STOP SLAVE; @@ -763,10 +754,10 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; --echo ******************************************** --echo connection slave; -source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +# 1054 = ER_BAD_FIELD_ERROR +--let $slave_sql_errno= 1054 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc STOP SLAVE; RESET SLAVE; @@ -840,10 +831,10 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; --echo ***************** --echo connection slave; -source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +# 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS +--let $slave_sql_errno= 1072 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test index 46168d6b97a..0317aa79891 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test @@ -96,10 +96,9 @@ SELECT * FROM t2 ORDER BY a; --echo *** Start Slave *** connection slave; START SLAVE; -source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -149,12 +148,10 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_sql_errno= 1535 +--let $slave_skip_counter= 2 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo *** Drop t3 *** connection master; @@ -194,12 +191,10 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_sql_errno= 1535 +--let $slave_skip_counter= 2 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo *** Drop t4 *** connection master; @@ -239,12 +234,10 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_sql_errno= 1535 +--let $slave_skip_counter= 2 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo *** Drop t5 *** connection master; @@ -285,10 +278,9 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; #START SLAVE; @@ -387,12 +379,10 @@ INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ### Uncomment once bug is fixed #connection slave; -#wait_for_slave_to_stop; -#--replace_result $MASTER_MYPORT MASTER_PORT -#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # -#--query_vertical SHOW SLAVE STATUS -#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -#START SLAVE; +#--let $slave_sql_errno= SOMETHING +#--let $slave_skip_counter= 2 +#--let $show_slave_sql_error= 1 +#--source include/wait_for_slave_sql_error_and_skip.inc --echo *** Drop t8 *** connection master; @@ -451,12 +441,10 @@ if (`SELECT $engine_type != 'NDB'`) # todo: fix Bug #43992 slave sql thread can't tune own sql_mode ... # and add/restore waiting for stop test - #--source include/wait_for_slave_sql_to_stop.inc - #--replace_result $MASTER_MYPORT MASTER_PORT - #--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # - #--query_vertical SHOW SLAVE STATUS - #SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; - #START SLAVE; + #--let $slave_sql_errno= SOMETHING + #--let $slave_skip_counter= 2 + #--let $show_slave_sql_error= 1 + #--source include/wait_for_slave_sql_error_and_skip.inc } #--echo *** Drop t9 *** @@ -494,12 +482,10 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_sql_errno= 1535 +--let $slave_skip_counter= 2 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo *** Drop t10 *** connection master; @@ -538,12 +524,10 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_sql_errno= 1535 +--let $slave_skip_counter= 2 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo *** Drop t11 *** connection master; @@ -810,12 +794,10 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; --echo *** Expect slave to fail with Error 1060 *** --echo ******************************************** connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; +--let $slave_sql_errno= 1060 +--let $slave_skip_counter= 1 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo *** Try to insert in master **** connection master; @@ -921,12 +903,10 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_sql_errno= 1535 +--let $slave_skip_counter= 2 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc --echo ** DROP table t17 *** connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test index 0baf49c9fac..0a1a4503975 100644 --- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test +++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test @@ -20,19 +20,15 @@ rename table t1 to t5, t2 to t1; # first don't write it to the binlog, to test the NO_WRITE_TO_BINLOG keyword. flush no_write_to_binlog tables; # Check that it's not in the binlog. ---replace_result $SERVER_VERSION SERVER_VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -eval SHOW BINLOG EVENTS FROM $rename_event_pos ; +let $binlog_start= $rename_event_pos; +source include/show_binlog_events.inc; # Check that the master is not confused. select * from t3; # This FLUSH should go into the binlog to not confuse the slave. flush tables; # Check that it's in the binlog. ---replace_result $SERVER_VERSION SERVER_VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -eval SHOW BINLOG EVENTS FROM $rename_event_pos ; +let $wait_binlog_event= flush tables; +source include/wait_for_binlog_event.inc; sync_slave_with_master; # Check that the slave is not confused. diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test index c392686454d..6e750d57c56 100644 --- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test +++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test @@ -68,7 +68,7 @@ eval SET DEBUG_SYNC=$debug_sync_action; # Show slave last IO errno connection slave; -source include/wait_for_slave_io_error.inc; +source include/wait_for_slave_io_to_stop.inc; let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1); --echo Check network error happened here if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index e492903afad..e2762eab8df 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -90,7 +90,7 @@ connection master; # Bug #29571: INSERT DELAYED IGNORE written to binary log on the master but # on the slave # -if (`SELECT @@global.binlog_format != 'ROW'`) +if ($binlog_format_statement) { #flush the logs before the test connection slave; @@ -103,22 +103,23 @@ CREATE TABLE t1(a int, UNIQUE(a)); INSERT DELAYED IGNORE INTO t1 VALUES(1); INSERT DELAYED IGNORE INTO t1 VALUES(1); flush table t1; # to wait for INSERT DELAYED to be done - -if (`SELECT @@global.binlog_format != 'ROW'`) +if ($binlog_format_statement) { #must show two INSERT DELAYED - --replace_column 1 x 2 x 3 x 4 x 5 x - show binlog events in 'master-bin.000002' LIMIT 2,2; + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_limit= 1,2 + --source include/show_binlog_events.inc } select * from t1; sync_slave_with_master; echo On slave; -if (`SELECT @@global.binlog_format != 'ROW'`) +if ($binlog_format_statement) { #must show two INSERT DELAYED - --replace_column 1 x 2 x 3 x 4 x 5 x - show binlog events in 'slave-bin.000002' LIMIT 2,2; + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_limit= 1,2 + --source include/show_binlog_events.inc } select * from t1; diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test index e4ebfd68761..e714d84a51b 100644 --- a/mysql-test/extra/rpl_tests/rpl_log.test +++ b/mysql-test/extra/rpl_tests/rpl_log.test @@ -11,11 +11,9 @@ # (otherwise RESET MASTER may come too early). sync_slave_with_master; source include/stop_slave.inc; ---source include/wait_for_slave_to_stop.inc reset master; reset slave; -start slave; ---source include/wait_for_slave_to_start.inc +source include/start_slave.inc; let $VERSION=`select version()`; @@ -31,19 +29,17 @@ eval create table t1 (word char(20) not null)ENGINE=$engine_type; --replace_result $LOAD_FILE LOAD_FILE eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines; select count(*) from t1; ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events; ---replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 106 limit 1; ---replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 106 limit 2; ---replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 106 limit 2,1; +source include/show_binlog_events.inc; + +let $binlog_limit= 1; +source include/show_binlog_events.inc; + +let $binlog_limit= 2; +source include/show_binlog_events.inc; + +let $binlog_limit= 2,1; +source include/show_binlog_events.inc; +let $binlog_limit=; flush logs; # We need an extra update before doing save_master_pos. @@ -84,27 +80,24 @@ connection master; eval create table t2 (n int)ENGINE=$engine_type; insert into t2 values (1); source include/show_binlog_events.inc; ---replace_result $VERSION VERSION ---replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/ ---replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events in 'master-bin.000002'; + +let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); +source include/show_binlog_events.inc; + --replace_column 2 # show binary logs; sync_slave_with_master; ---source include/wait_for_slave_to_start.inc --replace_column 2 # show binary logs; ---replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /INFILE '.+'/INFILE 'words.dat'/ ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events in 'slave-bin.000001' from 4; ---replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events in 'slave-bin.000002' from 4; -source include/show_slave_status.inc; + +let $binlog_file=; +source include/show_binlog_events.inc; + +let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); +source include/show_binlog_events.inc; +let $binlog_file=; + +source include/check_slave_is_running.inc; # Need to recode the following diff --git a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test index 5b546bbd891..8415522ec92 100644 --- a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test +++ b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test @@ -43,7 +43,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096 select @@global.max_relay_log_size; start slave; sync_with_master; -source include/show_slave_status2.inc; +--source include/check_slave_is_running.inc --echo # --echo # Test 2 @@ -55,7 +55,7 @@ set global max_relay_log_size=(5*4096); query_vertical select @@global.max_relay_log_size; start slave; sync_with_master; -source include/show_slave_status2.inc; +--source include/check_slave_is_running.inc --echo # --echo # Test 3: max_relay_log_size = 0 @@ -67,7 +67,7 @@ set global max_relay_log_size=0; query_vertical select @@global.max_relay_log_size; start slave; sync_with_master; -source include/show_slave_status2.inc; +--source include/check_slave_is_running.inc --echo # --echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions @@ -78,7 +78,6 @@ reset slave; # test of relay log rotation when the slave is stopped # (to make sure it does not crash). flush logs; -source include/show_slave_status2.inc; --echo # --echo # Test 5 @@ -93,10 +92,8 @@ flush logs; # log we just closed. But a trick to achieve this is do an update on the master. connection master; create table t1 (a int); -save_master_pos; -connection slave; -sync_with_master; -source include/show_slave_status2.inc; +sync_slave_with_master; +--source include/check_slave_is_running.inc --echo # --echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated @@ -105,10 +102,8 @@ source include/show_slave_status2.inc; flush logs; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; -source include/show_slave_status2.inc; +sync_slave_with_master; +--source include/check_slave_is_running.inc connection master; # test that the absence of relay logs does not make a master crash diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test index 4677f6da25d..3de1d42c34f 100644 --- a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test +++ b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test @@ -56,24 +56,23 @@ connection master; --echo # since insert is done with transactional engine, expect a BEGIN --echo # at --echo ---replace_result $start_pos ---replace_column 5 # ---eval show binlog events from $start_pos limit 1 +--let $binlog_start= $start_pos +--let $binlog_limit= 1 +--source include/show_binlog_events.inc --echo --echo # Now the insert, one step after --echo ---replace_result $start_pos ---replace_column 2 # 5 # ---eval show binlog events from $start_pos limit 1,1 +--let $binlog_start= $start_pos +--let $binlog_limit= 1,1 +--source include/show_binlog_events.inc --echo --echo # and the COMMIT should be at --echo ---replace_result $start_pos $end_pos ---replace_column 2 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ ---eval show binlog events from $start_pos limit 2,1 +--let $binlog_start= $start_pos +--let $binlog_limit= 2,1 +--source include/show_binlog_events.inc --echo @@ -89,18 +88,17 @@ commit; --source include/select_ndb_apply_status.inc connection master; ---replace_result $start_pos ---replace_column 5 # ---eval show binlog events from $start_pos limit 1 +--let $binlog_start= $start_pos +--let $binlog_limit= 1 +--source include/show_binlog_events.inc --echo ---replace_result $start_pos ---replace_column 2 # 4 # 5 # ---eval show binlog events from $start_pos limit 1,2 +--let $binlog_start= $start_pos +--let $binlog_limit= 1,2 +--source include/show_binlog_events.inc --echo ---replace_result $start_pos $end_pos ---replace_column 2 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ ---eval show binlog events from $start_pos limit 3,1 +--let $binlog_start= $start_pos +--let $binlog_limit= 3,1 +--source include/show_binlog_events.inc --echo diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test index 1f88c792fce..5c7d33d519e 100644 --- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test @@ -9,36 +9,32 @@ # RESET SLAVE. -- source include/master-slave.inc -connection master; -save_master_pos; -connection slave; -sync_with_master; -source include/show_slave_status2.inc; +sync_slave_with_master; +let $status_items= Master_User, Master_Host; +source include/show_slave_status.inc; -stop slave; +source include/stop_slave.inc; change master to master_user='test'; -source include/show_slave_status2.inc; +source include/show_slave_status.inc; reset slave; -source include/show_slave_status2.inc; +source include/show_slave_status.inc; -start slave; +source include/start_slave.inc; sync_with_master; -source include/show_slave_status2.inc; +source include/show_slave_status.inc; # test of crash with temp tables & RESET SLAVE # (test to see if RESET SLAVE clears temp tables in memory and disk) -stop slave; +source include/stop_slave.inc; reset slave; -start slave; +source include/start_slave.inc; connection master; create temporary table t1 (a int); -save_master_pos; -connection slave; -sync_with_master; -stop slave; +sync_slave_with_master; +source include/stop_slave.inc; reset slave; -start slave; +source include/start_slave.inc; sync_with_master; show status like 'slave_open_temp_tables'; @@ -47,10 +43,9 @@ show status like 'slave_open_temp_tables'; # # clearing the status -stop slave; +source include/stop_slave.inc; reset slave; -let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); -echo *** errno must be zero: $last_io_errno ***; +source include/check_slave_no_error.inc; # # verifying start slave resets Last_IO_Error and Last_IO_Errno. @@ -58,19 +53,13 @@ echo *** errno must be zero: $last_io_errno ***; change master to master_user='impossible_user_name'; start slave; +let $slave_io_errno= 1045; source include/wait_for_slave_io_error.inc; -let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); ---disable_query_log -eval SELECT $last_io_errno > 0 as ONE; ---enable_query_log source include/stop_slave.inc; change master to master_user='root'; source include/start_slave.inc; -let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); -let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1); ---echo *** last errno must be zero: $last_io_errno *** ---echo *** last error must be blank: $last_io_error *** +source include/check_slave_no_error.inc; # # verifying reset slave resets Last_{IO,SQL}_Err{or,no} @@ -79,19 +68,9 @@ let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1); source include/stop_slave.inc; change master to master_user='impossible_user_name'; start slave; +let $slave_io_errno= 1045; source include/wait_for_slave_io_error.inc; -let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); ---disable_query_log -eval SELECT $last_io_errno > 0 as ONE; ---enable_query_log source include/stop_slave.inc; reset slave; -let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); -let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1); -let $last_sql_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); -let $last_sql_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); ---echo *** io last errno must be zero: $last_io_errno *** ---echo *** io last error must be blank: $last_io_error *** ---echo *** sql last errno must be zero: $last_sql_errno *** ---echo *** sql last error must be blank: $last_sql_error *** +source include/check_slave_no_error.inc; diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 0ba27c69a55..84f7b79e733 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -259,10 +259,7 @@ DELETE FROM t1; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; sync_slave_with_master; set @@global.slave_exec_mode= default; -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; +source include/check_slave_is_running.inc; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; # BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly @@ -376,11 +373,10 @@ INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); connection slave; -source include/wait_for_slave_sql_to_stop.inc; -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; +# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc connection master; RESET MASTER; connection slave; @@ -405,11 +401,10 @@ INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); connection slave; -source include/wait_for_slave_sql_to_stop.inc; -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; +# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc connection master; RESET MASTER; connection slave; @@ -424,11 +419,10 @@ INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); connection slave; -source include/wait_for_slave_sql_to_stop.inc; -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; +# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc connection master; RESET MASTER; connection slave; diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test index 083088f12ff..ee6205c79d8 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test +++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test @@ -138,9 +138,7 @@ SELECT * FROM t2; sync_slave_with_master; --echo **** On Slave **** SELECT * FROM t2; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 20 22 # 23 # 33 # 35 36 38 ---query_vertical SHOW SLAVE STATUS +--source include/check_slave_is_running.inc connection master; INSERT INTO t9 VALUES (4); @@ -149,12 +147,10 @@ sync_slave_with_master; connection master; INSERT INTO t4 VALUES (4); connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 20 22 # 23 # 33 # 35 36 38 ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_skip_counter= 2 +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc connection master; INSERT INTO t9 VALUES (5); @@ -163,12 +159,10 @@ sync_slave_with_master; connection master; INSERT INTO t5 VALUES (5,10,25); connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 20 22 # 23 # 33 # 35 36 38 ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_skip_counter= 2 +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc connection master; INSERT INTO t9 VALUES (6); @@ -177,19 +171,15 @@ sync_slave_with_master; connection master; INSERT INTO t6 VALUES (6,12,36); connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 20 22 # 23 # 33 # 35 36 38 ---query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--let $slave_skip_counter= 2 +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc connection master; INSERT INTO t9 VALUES (6); sync_slave_with_master; ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 20 22 # 23 # 33 # 35 36 38 ---query_vertical SHOW SLAVE STATUS +--source include/check_slave_is_running.inc # Testing some tables extra field that can be null and cannot be null # (but have default values) diff --git a/mysql-test/include/check_slave_is_running.inc b/mysql-test/include/check_slave_is_running.inc new file mode 100644 index 00000000000..5fbbe0d684c --- /dev/null +++ b/mysql-test/include/check_slave_is_running.inc @@ -0,0 +1,18 @@ +# ==== Purpose ==== +# +# Assert that the slave threads are running and don't have any errors. +# +# ==== Usage ==== +# +# --source include/check_slave_running.inc + +--echo Checking that both slave threads are running. + +--let $slave_sql_running = query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1) +--let $slave_io_running = query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1) + +if (`SELECT '$slave_sql_running' != 'Yes' OR '$slave_io_running' != 'Yes'`) { + --echo Slave not running: Slave_SQL_Running = $slave_sql_running Slave_IO_Running = $slave_io_running + --source include/show_rpl_debug_info.inc + --die Expected slave to be running, but it was not running. +} diff --git a/mysql-test/include/check_slave_no_error.inc b/mysql-test/include/check_slave_no_error.inc new file mode 100644 index 00000000000..371db5ed6a0 --- /dev/null +++ b/mysql-test/include/check_slave_no_error.inc @@ -0,0 +1,17 @@ +# ==== Purpose ==== +# +# Assert that Slave_SQL_Error and Slave_IO_Error are empty. +# +# ==== Usage ==== +# +# --let $slave_param= Exec_Master_Log_Pos +# --let $slave_param_value= 4711 +# --source include/check_slave_running.inc + +--let $slave_param= Last_SQL_Errno +--let $slave_param_value= 0 +--source include/check_slave_param.inc + +--let $slave_param= Last_IO_Errno +--let $slave_param_value= 0 +--source include/check_slave_param.inc diff --git a/mysql-test/include/check_slave_param.inc b/mysql-test/include/check_slave_param.inc new file mode 100644 index 00000000000..d82c26851ea --- /dev/null +++ b/mysql-test/include/check_slave_param.inc @@ -0,0 +1,16 @@ +# ==== Purpose ==== +# +# Assert that a given column in SHOW SLAVE STATUS has a given value. +# +# ==== Usage ==== +# +# --let $slave_param= Exec_Master_Log_Pos +# --let $slave_param_value= 4711 +# --source include/check_slave_param.inc + +--let $_param_value= query_get_value(SHOW SLAVE STATUS, $slave_param, 1) +if (`SELECT '$_param_value' != '$slave_param_value'`) { + --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value' + --source include/show_rpl_debug_info.inc + --die Wrong value for slave parameter +} diff --git a/mysql-test/include/get_relay_log_pos.inc b/mysql-test/include/get_relay_log_pos.inc new file mode 100644 index 00000000000..7ce36fd3c50 --- /dev/null +++ b/mysql-test/include/get_relay_log_pos.inc @@ -0,0 +1,70 @@ +# For a given event which is at position $master_log_pos in the the master's +# binary log, returns its position in the slave's relay log file +# $relay_log_file. +# The position is stored in the variable $relay_log_pos. + +# Usage: +# let $relay_log_file= 'relay-log-bin.000001'; +# let $master_log_pos= 106; +# source include/get_relay_log_pos.inc; +# # at this point, get_relay_log_pos.inc sets $relay_log_pos. echo position +# # in $relay_log_file: $relay_log_pos. + +if (`SELECT '$relay_log_file' = ''`) +{ + --die 'variable $relay_log_file is null' +} + +if (`SELECT '$master_log_pos' = ''`) +{ + --die 'variable $master_log_pos is null' +} + +let $MYSQLD_DATADIR= `select @@datadir`; +let $_suffix= `SELECT UUID()`; +let $_tmp_file= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.$_suffix; +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$relay_log_file > $_tmp_file + +# All queries in this file should not be logged. +--disable_query_log + +--disable_warnings +DROP TEMPORARY TABLE IF EXISTS mysqlbinlog_events; +DROP TEMPORARY TABLE IF EXISTS events_at; +DROP TEMPORARY TABLE IF EXISTS events_pos; +CREATE TEMPORARY TABLE mysqlbinlog_events(c1 INT AUTO_INCREMENT KEY, c2 varchar(256)); + +# Event position is in the comments output by mysqlbinlog, we load this +# comments into the table +# '# at 106' +# '# .... end_log_pos 46' +eval LOAD DATA LOCAL INFILE '$_tmp_file' INTO TABLE mysqlbinlog_events + LINES STARTING BY '#' (c2) SET c1 = NULL; +--enable_warnings + +# Event pos in relay log file is inserted into table events_at +CREATE TEMPORARY TABLE events_at(c1 INT AUTO_INCREMENT KEY, c2 varchar(256)) + SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE ' at%' ORDER BY c1; + +# Event pos in master log file is inserted into table events_pos +CREATE TEMPORARY TABLE events_pos(c1 INT AUTO_INCREMENT KEY, c2 varchar(256)) + SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE '% end_log_pos %' ORDER BY c1; + +# events_at events_pos +# c1------c2-------------------------- c1------c2------------------------ +# 1 ev1's begin pos in relay log 1 ev1's end pos in master log +# 2 ev2's begin pos in relay log 2 ev2's end pos in master log +# 3 ev3's begin pos in relay log 3 ev3's end pos in master log +# events always keep the same sequence. +# Because event[N]'s end pos is equal to event[N+1]'s begin pos we want to +# find event's end pos in relay log, we can find the right relay_log_pos +# using the relationship that 'events_pos.c1 = events_at.c1 + 1' +# +# There is a fault that we can't get the relay log position of the last event, +# as it is not output by mysqlbinlog +let $relay_log_pos= `SELECT SUBSTRING(a.c2, 5) + FROM events_at a, events_pos b + WHERE a.c1=b.c1+1 and b.c2 LIKE '% $master_log_pos%'`; +DROP TEMPORARY TABLE mysqlbinlog_events, events_at, events_pos; +--remove_file $_tmp_file +--enable_query_log diff --git a/mysql-test/include/rpl_stmt_seq.inc b/mysql-test/include/rpl_stmt_seq.inc index 6c944dc4729..08f6e44aba0 100644 --- a/mysql-test/include/rpl_stmt_seq.inc +++ b/mysql-test/include/rpl_stmt_seq.inc @@ -80,9 +80,8 @@ eval INSERT INTO t1 SET f1= $MAX + 1; SELECT MAX(f1) FROM t1; if ($show_binlog) { ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; + --let $binlog_file= master-bin.$_log_num_s + --source include/show_binlog_events.inc } sync_slave_with_master; @@ -93,9 +92,8 @@ connection slave; SELECT MAX(f1) FROM t1; if ($show_binlog) { ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; + --let $binlog_file= slave-bin.$_log_num_s + --source include/show_binlog_events.inc } ############################################################### @@ -111,9 +109,8 @@ let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT; SELECT MAX(f1) FROM t1; if ($show_binlog) { ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; + --let $binlog_file= master-bin.$_log_num_s + --source include/show_binlog_events.inc } sync_slave_with_master; @@ -124,9 +121,8 @@ connection slave; SELECT MAX(f1) FROM t1; if ($show_binlog) { ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; + --let $binlog_file= slave-bin.$_log_num_s + --source include/show_binlog_events.inc } ############################################################### @@ -150,9 +146,8 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ', --enable_query_log if ($show_binlog) { ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; + --let $binlog_file= master-bin.$_log_num_s + --source include/show_binlog_events.inc } sync_slave_with_master; @@ -171,9 +166,8 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE: The INSERT is ', --enable_query_log if ($show_binlog) { ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; + --let $binlog_file= slave-bin.$_log_num_s + --source include/show_binlog_events.inc } ############################################################### diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc index 68f913a16a3..8649f31ad9f 100644 --- a/mysql-test/include/show_binlog_events.inc +++ b/mysql-test/include/show_binlog_events.inc @@ -1,10 +1,45 @@ -# $binlog_start can be set by caller or take a default value +############################################################################## +# Show binary log events +# +# Useage: +# let $binlog_file= master-bin.000002; +# let $binlog_start= 106; +# let $binlog_limit= 1, 3; +# source include/show_binlog_events.inc; +# +# It shows the first binary log file if $binlog_file is not given. +# +# It shows events from the end position of the description event if +# $binlog_start is not given. +# +# It shows all of the events if $binlog_limit is not given. +# $binlog_format has the same semantic with 'LIMIT' option. +# +############################################################################## if (!$binlog_start) { - let $binlog_start=106; + # If $binlog_start is not set, we will set it as the second event's position. + # The first event(Description Event) is always ignored. For description + # event's length might be changed because of adding new events, 'SHOW BINLOG + # EVENTS LIMIT 1' is used to get the right value. + --let $binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1) } + +--let $_statement=show binlog events +if (`SELECT '$binlog_file' <> ''`) +{ + --let $_statement= $_statement in '$binlog_file' +} + +--let $_statement= $_statement from $binlog_start + +if (`SELECT '$binlog_limit' <> ''`) +{ + --let $_statement= $_statement limit $binlog_limit +} + --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start --replace_column 2 # 4 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ ---eval show binlog events from $binlog_start +--eval $_statement diff --git a/mysql-test/include/show_rpl_debug_info.inc b/mysql-test/include/show_rpl_debug_info.inc index 252d63f1bf4..148d11f3b02 100644 --- a/mysql-test/include/show_rpl_debug_info.inc +++ b/mysql-test/include/show_rpl_debug_info.inc @@ -36,6 +36,7 @@ let $_con= $CURRENT_CONNECTION; --echo --echo [on $_con] --echo +SELECT NOW(); --echo **** SHOW SLAVE STATUS on $_con **** query_vertical SHOW SLAVE STATUS; --echo @@ -70,6 +71,7 @@ if (`SELECT '$_master_con' != ''`) --echo [on $_master_con] connection $_master_con; --echo + SELECT NOW(); --echo **** SHOW MASTER STATUS on $_master_con **** query_vertical SHOW MASTER STATUS; --echo diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index b315b9e45ca..d66c068e19b 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -1,6 +1,25 @@ # Include file to show the slave status, masking out some information # that varies depending on where the test is executed. ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; +--let $_items=$status_items +if (`SELECT "XX$status_items" = "XX"`) +{ + --die 'Variable status_items is NULL' +} + +--disable_query_log +--vertical_results + +while (`SELECT "XX$_items" <> "XX"`) +{ + --let $_name= `SELECT SUBSTRING_INDEX('$_items', ',', 1)` + --let $_items= `SELECT LTRIM(SUBSTRING('$_items', LENGTH('$_name') + 2))` + + --let $_value= query_get_value(SHOW SLAVE STATUS, $_name, 1) + + --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR + --eval SELECT "$_value" AS $_name +} + +--horizontal_results +--enable_query_log diff --git a/mysql-test/include/show_slave_status2.inc b/mysql-test/include/show_slave_status2.inc deleted file mode 100644 index 9c4e14c62c2..00000000000 --- a/mysql-test/include/show_slave_status2.inc +++ /dev/null @@ -1,8 +0,0 @@ -# Include file to show the slave status, masking out some information -# that varies depending on where the test is executed. - -# masked out log positions - ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; diff --git a/mysql-test/include/test_fieldsize.inc b/mysql-test/include/test_fieldsize.inc index 606bc63779d..57dba4d1cc0 100644 --- a/mysql-test/include/test_fieldsize.inc +++ b/mysql-test/include/test_fieldsize.inc @@ -22,10 +22,9 @@ eval $test_insert; connection slave; START SLAVE; ---source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $slave_sql_errno= 1535 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc # The following should be 0 SELECT COUNT(*) FROM t1; diff --git a/mysql-test/include/wait_for_binlog_event.inc b/mysql-test/include/wait_for_binlog_event.inc index 2a57c191413..7a55c8c2182 100644 --- a/mysql-test/include/wait_for_binlog_event.inc +++ b/mysql-test/include/wait_for_binlog_event.inc @@ -18,7 +18,7 @@ while (`SELECT INSTR("$_last_event","$wait_binlog_event") = 0`) dec $_loop_count; if (!$_loop_count) { - SHOW BINLOG EVENTS; + --source include/show_rpl_debug_info.inc --die ERROR: failed while waiting for $wait_binlog_event in binlog } real_sleep 0.1; diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc index 094406e02b2..101df69730c 100644 --- a/mysql-test/include/wait_for_slave_io_error.inc +++ b/mysql-test/include/wait_for_slave_io_error.inc @@ -1,23 +1,48 @@ # ==== Purpose ==== # # Waits until the IO thread of the current connection has got an -# error, or until a timeout is reached. +# error, or until a timeout is reached. Also waits until the IO +# thread has completely stopped. # # ==== Usage ==== # # source include/wait_for_slave_io_error.inc; # -# Parameters to this macro are $slave_timeout and -# $slave_keep_connection. See wait_for_slave_param.inc for -# descriptions. +# Parameters: +# +# $slave_io_errno +# The expected IO error number. This is required. +# (After BUG#41956 has been fixed, this will be required to be a +# symbolic name instead of a number.) +# +# $show_slave_io_error +# If set, will print the error to the query log. +# +# $slave_timeout +# See wait_for_slave_param.inc for description. +# +# $master_connection +# See wait_for_slave_param.inc for description. -let $old_slave_param_comparison= $slave_param_comparison; +if (`SELECT '$slave_io_errno' = ''`) { + --die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc +} -let $slave_param= Last_IO_Errno; -let $slave_param_comparison= !=; -let $slave_param_value= 0; -let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread; +let $slave_param= Slave_IO_Running; +let $slave_param_value= No; +let $slave_error_message= Failed while waiting for slave to stop the IO thread (expecting error in the IO thread); source include/wait_for_slave_param.inc; -let $slave_error_message= ; -let $slave_param_comparison= $old_slave_param_comparison; +let $_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); +if (`SELECT '$_error' != '$slave_io_errno'`) { + --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) **** + source include/show_rpl_debug_info.inc; + --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) **** + --die Slave stopped with wrong error code +} + +if ($show_slave_io_error) +{ + let $error= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1); + echo Last_IO_Error = $error; +} diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc index 82e57922913..ef864f9245e 100644 --- a/mysql-test/include/wait_for_slave_param.inc +++ b/mysql-test/include/wait_for_slave_param.inc @@ -78,5 +78,5 @@ if (!$_slave_timeout_counter) --echo Current connection is '$CURRENT_CONNECTION' echo Note: the following output may have changed since the failure was detected; source include/show_rpl_debug_info.inc; - exit; + die; } diff --git a/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-test/include/wait_for_slave_sql_error.inc index ad1d7a9e639..aab04036eea 100644 --- a/mysql-test/include/wait_for_slave_sql_error.inc +++ b/mysql-test/include/wait_for_slave_sql_error.inc @@ -14,6 +14,9 @@ # The expected SQL error number. This is required. # (After BUG#41956 has been fixed, this will be required to be a # symbolic name instead of a number.) +# +# $show_slave_sql_error +# If set, will print the error to the query log. # # $slave_timeout # See wait_for_slave_param.inc for description. @@ -22,8 +25,7 @@ # See wait_for_slave_param.inc for description. if (`SELECT '$slave_sql_errno' = ''`) { - --echo !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_fro_slave_sql_error.inc - exit; + --die !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_for_slave_sql_error.inc } let $slave_param= Slave_SQL_Running; @@ -33,7 +35,14 @@ source include/wait_for_slave_param.inc; let $_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); if (`SELECT '$_error' != '$slave_sql_errno'`) { - --echo Slave stopped with wrong error code: $_error (expected $slave_sql_errno) + --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) **** source include/show_rpl_debug_info.inc; - exit; + --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) **** + --die Slave stopped with wrong error code +} + +if ($show_slave_sql_error) +{ + let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); + echo Last_SQL_Error = $error; } diff --git a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc index 247de3a41a1..11c02c0b490 100644 --- a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc +++ b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc @@ -22,17 +22,30 @@ # # $master_connection # See wait_for_slave_param.inc for description. +# +# $slave_skip_counter +# If set, skip this number of events. If not set, skip one event. +# +# $not_switch_connection If set, don't switch to slave and don't switch back +# master. +# echo --source include/wait_for_slave_sql_error_and_skip.inc; -connection slave; -source include/wait_for_slave_sql_error.inc; -if ($show_sql_error) +if (!$not_switch_connection) { - let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); - echo Last_SQL_Error = $error; + connection slave; } +source include/wait_for_slave_sql_error.inc; # skip the erroneous statement -set global sql_slave_skip_counter=1; +if ($slave_skip_counter) { + eval SET GLOBAL SQL_SLAVE_SKIP_COUNTER= $slave_skip_counter; +} +if (!$slave_skip_counter) { + SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +} source include/start_slave.inc; -connection master; +if (!$not_switch_connection) +{ + connection master; +} diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc index 4c168da7f1a..8b644c2c3c5 100644 --- a/mysql-test/include/wait_for_status_var.inc +++ b/mysql-test/include/wait_for_status_var.inc @@ -35,7 +35,7 @@ if (`SELECT STRCMP('$status_type', '') * STRCMP(UPPER('$status_type'), 'SESSION') * STRCMP(UPPER('$status_type'), 'GLOBAL')`) { --echo **** ERROR: Unknown type of variable status_type: allowed values are: SESSION or GLOBAL **** - exit; + die; } let $_status_timeout_counter= $status_timeout; @@ -60,7 +60,7 @@ while (`SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_va --echo **** Showing STATUS, PROCESSLIST **** eval SHOW $status_type STATUS LIKE '$status_var'; SHOW PROCESSLIST; - exit; + die; } dec $_status_timeout_counter; sleep 0.1; diff --git a/mysql-test/include/wait_until_count_sessions.inc b/mysql-test/include/wait_until_count_sessions.inc index de4f0eeb652..26b0d8f2633 100644 --- a/mysql-test/include/wait_until_count_sessions.inc +++ b/mysql-test/include/wait_until_count_sessions.inc @@ -122,5 +122,6 @@ if (!$success) --echo # Timeout in wait_until_count_sessions.inc --echo # Number of sessions expected: <= $count_sessions found: $current_sessions SHOW PROCESSLIST; + --die Timeout in wait_until_count_sessions.inc } diff --git a/mysql-test/r/alter_table-big.result b/mysql-test/r/alter_table-big.result index 9761754a02f..d6b936bd5d7 100644 --- a/mysql-test/r/alter_table-big.result +++ b/mysql-test/r/alter_table-big.result @@ -12,11 +12,11 @@ alter table t1 enable keys;; insert into t2 values (1); insert into t1 values (1, 1, 1); set session debug="-d,sleep_alter_enable_indexes"; -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t2 values (1) -master-bin.000001 # Query 1 # use `test`; alter table t1 enable keys -master-bin.000001 # Query 1 # use `test`; insert into t1 values (1, 1, 1) +master-bin.000001 # Query # # use `test`; insert into t2 values (1) +master-bin.000001 # Query # # use `test`; alter table t1 enable keys +master-bin.000001 # Query # # use `test`; insert into t1 values (1, 1, 1) drop tables t1, t2; End of 5.0 tests drop table if exists t1, t2, t3; @@ -41,17 +41,17 @@ alter table t2 change c vc varchar(100) default 'Test2', rename to t1;; rename table t1 to t3; drop table t3; set session debug="-d,sleep_alter_before_main_binlog"; -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; alter table t1 change i c char(10) default 'Test1' -master-bin.000001 # Query 1 # use `test`; insert into t1 values () -master-bin.000001 # Query 1 # use `test`; alter table t1 change c vc varchar(100) default 'Test2' -master-bin.000001 # Query 1 # use `test`; rename table t1 to t2 -master-bin.000001 # Query 1 # use `test`; drop table t2 -master-bin.000001 # Query 1 # use `test`; create table t1 (i int) -master-bin.000001 # Query 1 # use `test`; alter table t1 change i c char(10) default 'Test3', rename to t2 -master-bin.000001 # Query 1 # use `test`; insert into t2 values () -master-bin.000001 # Query 1 # use `test`; alter table t2 change c vc varchar(100) default 'Test2', rename to t1 -master-bin.000001 # Query 1 # use `test`; rename table t1 to t3 -master-bin.000001 # Query 1 # use `test`; drop table t3 +master-bin.000001 # Query # # use `test`; alter table t1 change i c char(10) default 'Test1' +master-bin.000001 # Query # # use `test`; insert into t1 values () +master-bin.000001 # Query # # use `test`; alter table t1 change c vc varchar(100) default 'Test2' +master-bin.000001 # Query # # use `test`; rename table t1 to t2 +master-bin.000001 # Query # # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; create table t1 (i int) +master-bin.000001 # Query # # use `test`; alter table t1 change i c char(10) default 'Test3', rename to t2 +master-bin.000001 # Query # # use `test`; insert into t2 values () +master-bin.000001 # Query # # use `test`; alter table t2 change c vc varchar(100) default 'Test2', rename to t1 +master-bin.000001 # Query # # use `test`; rename table t1 to t3 +master-bin.000001 # Query # # use `test`; drop table t3 End of 5.1 tests diff --git a/mysql-test/r/create-big.result b/mysql-test/r/create-big.result index eb57bf59084..d062b59a008 100644 --- a/mysql-test/r/create-big.result +++ b/mysql-test/r/create-big.result @@ -175,12 +175,12 @@ t2 CREATE TABLE `t2` ( `i` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2; -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t1 values (1) -master-bin.000001 # Query 1 # use `test`; create table t2 like t1 -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Query # # use `test`; create table t2 like t1 +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; drop table t2 create table t1 (i int); set session debug="-d,sleep_create_like_before_check_if_exists:+d,sleep_create_like_before_copy"; create table t2 like t1;; @@ -197,11 +197,11 @@ reset master; create table t2 like t1;; drop table t1; drop table t2; -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t2 like t1 -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; create table t2 like t1 +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; drop table t2 create table t1 (i int); set session debug="-d,sleep_create_like_before_copy:+d,sleep_create_like_before_ha_create"; reset master; @@ -213,16 +213,16 @@ drop table t2; create table t2 like t1;; drop table t1; drop table t2; -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t2 like t1 -master-bin.000001 # Query 1 # use `test`; insert into t2 values (1) -master-bin.000001 # Query 1 # use `test`; drop table t2 -master-bin.000001 # Query 1 # use `test`; create table t2 like t1 -master-bin.000001 # Query 1 # use `test`; drop table t2 -master-bin.000001 # Query 1 # use `test`; create table t2 like t1 -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; create table t2 like t1 +master-bin.000001 # Query # # use `test`; insert into t2 values (1) +master-bin.000001 # Query # # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; create table t2 like t1 +master-bin.000001 # Query # # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; create table t2 like t1 +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; drop table t2 create table t1 (i int); set session debug="-d,sleep_create_like_before_ha_create:+d,sleep_create_like_before_binlogging"; reset master; @@ -234,14 +234,14 @@ drop table t2; create table t2 like t1;; drop table t1; drop table t2; -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t2 like t1 -master-bin.000001 # Query 1 # use `test`; insert into t2 values (1) -master-bin.000001 # Query 1 # use `test`; drop table t2 -master-bin.000001 # Query 1 # use `test`; create table t2 like t1 -master-bin.000001 # Query 1 # use `test`; drop table t2 -master-bin.000001 # Query 1 # use `test`; create table t2 like t1 -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; create table t2 like t1 +master-bin.000001 # Query # # use `test`; insert into t2 values (1) +master-bin.000001 # Query # # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; create table t2 like t1 +master-bin.000001 # Query # # use `test`; drop table t2 +master-bin.000001 # Query # # use `test`; create table t2 like t1 +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; drop table t2 set session debug="-d,sleep_create_like_before_binlogging"; diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index 044885d1ea7..8854a835e25 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -29,20 +29,20 @@ HEX(s1) HEX(s2) d 466F6F2773206120426172 ED40ED41ED42 47.93 DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 370| +show binlog events from | Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 370 Query 1 536 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, +master-bin.000001 # Query # # use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, s2 CHAR(50) CHARACTER SET cp932, d DECIMAL(10,2)) -master-bin.000001 536 Query 1 785 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50), +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50), IN ins2 CHAR(50) CHARACTER SET cp932, IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 785 Query 1 1049 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93)) -master-bin.000001 1049 Query 1 1138 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1138 Query 1 1217 use `test`; DROP TABLE t4 +master-bin.000001 # Query # # use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93)) +master-bin.000001 # Query # # use `test`; DROP PROCEDURE bug18293 +master-bin.000001 # Query # # use `test`; DROP TABLE t4 End of 5.0 tests SHOW BINLOG EVENTS FROM 365; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result index c7fd7a11877..a81b1ce1e3a 100644 --- a/mysql-test/r/flush_block_commit_notembedded.result +++ b/mysql-test/r/flush_block_commit_notembedded.result @@ -7,15 +7,13 @@ SET AUTOCOMMIT=0; INSERT t1 VALUES (1); # Switch to connection con2 FLUSH TABLES WITH READ LOCK; -SHOW MASTER STATUS; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info # Switch to connection con1 COMMIT; # Switch to connection con2 -SHOW MASTER STATUS; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info UNLOCK TABLES; # Switch to connection con1 DROP TABLE t1; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 04bf7720c43..ae72f416c79 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -602,9 +602,6 @@ select * from t2 /* must be (3,1), (4,4) */; a b 3 1 4 4 -show master status /* there must be the UPDATE query event */; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 206 delete from t1; delete from t2; insert into t1 values (1,2),(3,4),(4,4); @@ -612,9 +609,6 @@ insert into t2 values (1,2),(3,4),(4,4); reset master; UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; ERROR 23000: Duplicate entry '4' for key 'PRIMARY' -show master status /* there must be the UPDATE query event */; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 221 drop table t1, t2; set @@session.binlog_format= @sav_binlog_format; drop table if exists t1, t2, t3; diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result index 7a6173b89e2..7b7d05617ab 100644 --- a/mysql-test/r/sp_trans_log.result +++ b/mysql-test/r/sp_trans_log.result @@ -14,13 +14,13 @@ end| reset master| insert into t2 values (bug23333(),1)| ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -show binlog events from 106 /* with fixes for #23333 will show there is the query */| +show binlog events from | Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # # -master-bin.000001 # Table_map 1 # # -master-bin.000001 # Table_map 1 # # -master-bin.000001 # Write_rows 1 # # -master-bin.000001 # Query 1 # # +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # ROLLBACK select count(*),@a from t1 /* must be 1,1 */| count(*) @a 1 1 diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result index 1922897f631..881d8d2719e 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_innodb.result @@ -156,9 +156,9 @@ select * from t2 /* must be (3,1), (4,4) */; a b 1 1 4 4 -show master status /* there must no UPDATE in binlog */; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 +# There must no UPDATE in binlog; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info delete from t1; delete from t2; insert into t1 values (1,2),(3,4),(4,4); @@ -166,8 +166,8 @@ insert into t2 values (1,2),(3,4),(4,4); reset master; UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; ERROR 23000: Duplicate entry '4' for key 'PRIMARY' -show master status /* there must be no UPDATE query event */; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 +# There must be no UPDATE query event; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info drop table t1, t2; End of tests diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 4d32a4f4739..d612e7adde1 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -26,215 +26,215 @@ create table t1 (n int) engine=innodb; begin; commit; drop table t1; -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002' from 106; +master-bin.000001 # Query # # use `test`; create table t1 (n int) engine=innodb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=4 +show binlog events in 'master-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query 1 # use `test`; drop table t1 +master-bin.000002 # Query # # use `test`; drop table t1 set @ac = @@autocommit; set autocommit= 0; reset master; @@ -245,830 +245,828 @@ insert into t1 values (2); insert into t1 values (3); commit; drop table t1; -show binlog events from 0; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb -master-bin.000001 205 Query 1 273 BEGIN -master-bin.000001 273 Table_map 1 314 table_id: # (test.t1) -master-bin.000001 314 Write_rows 1 348 table_id: # flags: STMT_END_F -master-bin.000001 348 Table_map 1 389 table_id: # (test.t1) -master-bin.000001 389 Write_rows 1 423 table_id: # flags: STMT_END_F -master-bin.000001 423 Table_map 1 464 table_id: # (test.t1) -master-bin.000001 464 Write_rows 1 498 table_id: # flags: STMT_END_F -master-bin.000001 498 Xid 1 525 COMMIT /* XID */ -master-bin.000001 525 Query 1 601 use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1(n int) engine=innodb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; drop table t1 set @bcs = @@binlog_cache_size; set global binlog_cache_size=4096; reset master; create table t1 (a int) engine=innodb; -show binlog events from 0; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb -master-bin.000001 206 Query 1 274 BEGIN -master-bin.000001 274 Table_map 1 315 table_id: # (test.t1) -master-bin.000001 315 Write_rows 1 349 table_id: # flags: STMT_END_F -master-bin.000001 349 Table_map 1 390 table_id: # (test.t1) -master-bin.000001 390 Write_rows 1 424 table_id: # flags: STMT_END_F -master-bin.000001 424 Table_map 1 465 table_id: # (test.t1) -master-bin.000001 465 Write_rows 1 499 table_id: # flags: STMT_END_F -master-bin.000001 499 Table_map 1 540 table_id: # (test.t1) -master-bin.000001 540 Write_rows 1 574 table_id: # flags: STMT_END_F -master-bin.000001 574 Table_map 1 615 table_id: # (test.t1) -master-bin.000001 615 Write_rows 1 649 table_id: # flags: STMT_END_F -master-bin.000001 649 Table_map 1 690 table_id: # (test.t1) -master-bin.000001 690 Write_rows 1 724 table_id: # flags: STMT_END_F -master-bin.000001 724 Table_map 1 765 table_id: # (test.t1) -master-bin.000001 765 Write_rows 1 799 table_id: # flags: STMT_END_F -master-bin.000001 799 Table_map 1 840 table_id: # (test.t1) -master-bin.000001 840 Write_rows 1 874 table_id: # flags: STMT_END_F -master-bin.000001 874 Table_map 1 915 table_id: # (test.t1) -master-bin.000001 915 Write_rows 1 949 table_id: # flags: STMT_END_F -master-bin.000001 949 Table_map 1 990 table_id: # (test.t1) -master-bin.000001 990 Write_rows 1 1024 table_id: # flags: STMT_END_F -master-bin.000001 1024 Table_map 1 1065 table_id: # (test.t1) -master-bin.000001 1065 Write_rows 1 1099 table_id: # flags: STMT_END_F -master-bin.000001 1099 Table_map 1 1140 table_id: # (test.t1) -master-bin.000001 1140 Write_rows 1 1174 table_id: # flags: STMT_END_F -master-bin.000001 1174 Table_map 1 1215 table_id: # (test.t1) -master-bin.000001 1215 Write_rows 1 1249 table_id: # flags: STMT_END_F -master-bin.000001 1249 Table_map 1 1290 table_id: # (test.t1) -master-bin.000001 1290 Write_rows 1 1324 table_id: # flags: STMT_END_F -master-bin.000001 1324 Table_map 1 1365 table_id: # (test.t1) -master-bin.000001 1365 Write_rows 1 1399 table_id: # flags: STMT_END_F -master-bin.000001 1399 Table_map 1 1440 table_id: # (test.t1) -master-bin.000001 1440 Write_rows 1 1474 table_id: # flags: STMT_END_F -master-bin.000001 1474 Table_map 1 1515 table_id: # (test.t1) -master-bin.000001 1515 Write_rows 1 1549 table_id: # flags: STMT_END_F -master-bin.000001 1549 Table_map 1 1590 table_id: # (test.t1) -master-bin.000001 1590 Write_rows 1 1624 table_id: # flags: STMT_END_F -master-bin.000001 1624 Table_map 1 1665 table_id: # (test.t1) -master-bin.000001 1665 Write_rows 1 1699 table_id: # flags: STMT_END_F -master-bin.000001 1699 Table_map 1 1740 table_id: # (test.t1) -master-bin.000001 1740 Write_rows 1 1774 table_id: # flags: STMT_END_F -master-bin.000001 1774 Table_map 1 1815 table_id: # (test.t1) -master-bin.000001 1815 Write_rows 1 1849 table_id: # flags: STMT_END_F -master-bin.000001 1849 Table_map 1 1890 table_id: # (test.t1) -master-bin.000001 1890 Write_rows 1 1924 table_id: # flags: STMT_END_F -master-bin.000001 1924 Table_map 1 1965 table_id: # (test.t1) -master-bin.000001 1965 Write_rows 1 1999 table_id: # flags: STMT_END_F -master-bin.000001 1999 Table_map 1 2040 table_id: # (test.t1) -master-bin.000001 2040 Write_rows 1 2074 table_id: # flags: STMT_END_F -master-bin.000001 2074 Table_map 1 2115 table_id: # (test.t1) -master-bin.000001 2115 Write_rows 1 2149 table_id: # flags: STMT_END_F -master-bin.000001 2149 Table_map 1 2190 table_id: # (test.t1) -master-bin.000001 2190 Write_rows 1 2224 table_id: # flags: STMT_END_F -master-bin.000001 2224 Table_map 1 2265 table_id: # (test.t1) -master-bin.000001 2265 Write_rows 1 2299 table_id: # flags: STMT_END_F -master-bin.000001 2299 Table_map 1 2340 table_id: # (test.t1) -master-bin.000001 2340 Write_rows 1 2374 table_id: # flags: STMT_END_F -master-bin.000001 2374 Table_map 1 2415 table_id: # (test.t1) -master-bin.000001 2415 Write_rows 1 2449 table_id: # flags: STMT_END_F -master-bin.000001 2449 Table_map 1 2490 table_id: # (test.t1) -master-bin.000001 2490 Write_rows 1 2524 table_id: # flags: STMT_END_F -master-bin.000001 2524 Table_map 1 2565 table_id: # (test.t1) -master-bin.000001 2565 Write_rows 1 2599 table_id: # flags: STMT_END_F -master-bin.000001 2599 Table_map 1 2640 table_id: # (test.t1) -master-bin.000001 2640 Write_rows 1 2674 table_id: # flags: STMT_END_F -master-bin.000001 2674 Table_map 1 2715 table_id: # (test.t1) -master-bin.000001 2715 Write_rows 1 2749 table_id: # flags: STMT_END_F -master-bin.000001 2749 Table_map 1 2790 table_id: # (test.t1) -master-bin.000001 2790 Write_rows 1 2824 table_id: # flags: STMT_END_F -master-bin.000001 2824 Table_map 1 2865 table_id: # (test.t1) -master-bin.000001 2865 Write_rows 1 2899 table_id: # flags: STMT_END_F -master-bin.000001 2899 Table_map 1 2940 table_id: # (test.t1) -master-bin.000001 2940 Write_rows 1 2974 table_id: # flags: STMT_END_F -master-bin.000001 2974 Table_map 1 3015 table_id: # (test.t1) -master-bin.000001 3015 Write_rows 1 3049 table_id: # flags: STMT_END_F -master-bin.000001 3049 Table_map 1 3090 table_id: # (test.t1) -master-bin.000001 3090 Write_rows 1 3124 table_id: # flags: STMT_END_F -master-bin.000001 3124 Table_map 1 3165 table_id: # (test.t1) -master-bin.000001 3165 Write_rows 1 3199 table_id: # flags: STMT_END_F -master-bin.000001 3199 Table_map 1 3240 table_id: # (test.t1) -master-bin.000001 3240 Write_rows 1 3274 table_id: # flags: STMT_END_F -master-bin.000001 3274 Table_map 1 3315 table_id: # (test.t1) -master-bin.000001 3315 Write_rows 1 3349 table_id: # flags: STMT_END_F -master-bin.000001 3349 Table_map 1 3390 table_id: # (test.t1) -master-bin.000001 3390 Write_rows 1 3424 table_id: # flags: STMT_END_F -master-bin.000001 3424 Table_map 1 3465 table_id: # (test.t1) -master-bin.000001 3465 Write_rows 1 3499 table_id: # flags: STMT_END_F -master-bin.000001 3499 Table_map 1 3540 table_id: # (test.t1) -master-bin.000001 3540 Write_rows 1 3574 table_id: # flags: STMT_END_F -master-bin.000001 3574 Table_map 1 3615 table_id: # (test.t1) -master-bin.000001 3615 Write_rows 1 3649 table_id: # flags: STMT_END_F -master-bin.000001 3649 Table_map 1 3690 table_id: # (test.t1) -master-bin.000001 3690 Write_rows 1 3724 table_id: # flags: STMT_END_F -master-bin.000001 3724 Table_map 1 3765 table_id: # (test.t1) -master-bin.000001 3765 Write_rows 1 3799 table_id: # flags: STMT_END_F -master-bin.000001 3799 Table_map 1 3840 table_id: # (test.t1) -master-bin.000001 3840 Write_rows 1 3874 table_id: # flags: STMT_END_F -master-bin.000001 3874 Table_map 1 3915 table_id: # (test.t1) -master-bin.000001 3915 Write_rows 1 3949 table_id: # flags: STMT_END_F -master-bin.000001 3949 Table_map 1 3990 table_id: # (test.t1) -master-bin.000001 3990 Write_rows 1 4024 table_id: # flags: STMT_END_F -master-bin.000001 4024 Table_map 1 4065 table_id: # (test.t1) -master-bin.000001 4065 Write_rows 1 4099 table_id: # flags: STMT_END_F -master-bin.000001 4099 Table_map 1 4140 table_id: # (test.t1) -master-bin.000001 4140 Write_rows 1 4174 table_id: # flags: STMT_END_F -master-bin.000001 4174 Table_map 1 4215 table_id: # (test.t1) -master-bin.000001 4215 Write_rows 1 4249 table_id: # flags: STMT_END_F -master-bin.000001 4249 Table_map 1 4290 table_id: # (test.t1) -master-bin.000001 4290 Write_rows 1 4324 table_id: # flags: STMT_END_F -master-bin.000001 4324 Table_map 1 4365 table_id: # (test.t1) -master-bin.000001 4365 Write_rows 1 4399 table_id: # flags: STMT_END_F -master-bin.000001 4399 Table_map 1 4440 table_id: # (test.t1) -master-bin.000001 4440 Write_rows 1 4474 table_id: # flags: STMT_END_F -master-bin.000001 4474 Table_map 1 4515 table_id: # (test.t1) -master-bin.000001 4515 Write_rows 1 4549 table_id: # flags: STMT_END_F -master-bin.000001 4549 Table_map 1 4590 table_id: # (test.t1) -master-bin.000001 4590 Write_rows 1 4624 table_id: # flags: STMT_END_F -master-bin.000001 4624 Table_map 1 4665 table_id: # (test.t1) -master-bin.000001 4665 Write_rows 1 4699 table_id: # flags: STMT_END_F -master-bin.000001 4699 Table_map 1 4740 table_id: # (test.t1) -master-bin.000001 4740 Write_rows 1 4774 table_id: # flags: STMT_END_F -master-bin.000001 4774 Table_map 1 4815 table_id: # (test.t1) -master-bin.000001 4815 Write_rows 1 4849 table_id: # flags: STMT_END_F -master-bin.000001 4849 Table_map 1 4890 table_id: # (test.t1) -master-bin.000001 4890 Write_rows 1 4924 table_id: # flags: STMT_END_F -master-bin.000001 4924 Table_map 1 4965 table_id: # (test.t1) -master-bin.000001 4965 Write_rows 1 4999 table_id: # flags: STMT_END_F -master-bin.000001 4999 Table_map 1 5040 table_id: # (test.t1) -master-bin.000001 5040 Write_rows 1 5074 table_id: # flags: STMT_END_F -master-bin.000001 5074 Table_map 1 5115 table_id: # (test.t1) -master-bin.000001 5115 Write_rows 1 5149 table_id: # flags: STMT_END_F -master-bin.000001 5149 Table_map 1 5190 table_id: # (test.t1) -master-bin.000001 5190 Write_rows 1 5224 table_id: # flags: STMT_END_F -master-bin.000001 5224 Table_map 1 5265 table_id: # (test.t1) -master-bin.000001 5265 Write_rows 1 5299 table_id: # flags: STMT_END_F -master-bin.000001 5299 Table_map 1 5340 table_id: # (test.t1) -master-bin.000001 5340 Write_rows 1 5374 table_id: # flags: STMT_END_F -master-bin.000001 5374 Table_map 1 5415 table_id: # (test.t1) -master-bin.000001 5415 Write_rows 1 5449 table_id: # flags: STMT_END_F -master-bin.000001 5449 Table_map 1 5490 table_id: # (test.t1) -master-bin.000001 5490 Write_rows 1 5524 table_id: # flags: STMT_END_F -master-bin.000001 5524 Table_map 1 5565 table_id: # (test.t1) -master-bin.000001 5565 Write_rows 1 5599 table_id: # flags: STMT_END_F -master-bin.000001 5599 Table_map 1 5640 table_id: # (test.t1) -master-bin.000001 5640 Write_rows 1 5674 table_id: # flags: STMT_END_F -master-bin.000001 5674 Table_map 1 5715 table_id: # (test.t1) -master-bin.000001 5715 Write_rows 1 5749 table_id: # flags: STMT_END_F -master-bin.000001 5749 Table_map 1 5790 table_id: # (test.t1) -master-bin.000001 5790 Write_rows 1 5824 table_id: # flags: STMT_END_F -master-bin.000001 5824 Table_map 1 5865 table_id: # (test.t1) -master-bin.000001 5865 Write_rows 1 5899 table_id: # flags: STMT_END_F -master-bin.000001 5899 Table_map 1 5940 table_id: # (test.t1) -master-bin.000001 5940 Write_rows 1 5974 table_id: # flags: STMT_END_F -master-bin.000001 5974 Table_map 1 6015 table_id: # (test.t1) -master-bin.000001 6015 Write_rows 1 6049 table_id: # flags: STMT_END_F -master-bin.000001 6049 Table_map 1 6090 table_id: # (test.t1) -master-bin.000001 6090 Write_rows 1 6124 table_id: # flags: STMT_END_F -master-bin.000001 6124 Table_map 1 6165 table_id: # (test.t1) -master-bin.000001 6165 Write_rows 1 6199 table_id: # flags: STMT_END_F -master-bin.000001 6199 Table_map 1 6240 table_id: # (test.t1) -master-bin.000001 6240 Write_rows 1 6274 table_id: # flags: STMT_END_F -master-bin.000001 6274 Table_map 1 6315 table_id: # (test.t1) -master-bin.000001 6315 Write_rows 1 6349 table_id: # flags: STMT_END_F -master-bin.000001 6349 Table_map 1 6390 table_id: # (test.t1) -master-bin.000001 6390 Write_rows 1 6424 table_id: # flags: STMT_END_F -master-bin.000001 6424 Table_map 1 6465 table_id: # (test.t1) -master-bin.000001 6465 Write_rows 1 6499 table_id: # flags: STMT_END_F -master-bin.000001 6499 Table_map 1 6540 table_id: # (test.t1) -master-bin.000001 6540 Write_rows 1 6574 table_id: # flags: STMT_END_F -master-bin.000001 6574 Table_map 1 6615 table_id: # (test.t1) -master-bin.000001 6615 Write_rows 1 6649 table_id: # flags: STMT_END_F -master-bin.000001 6649 Table_map 1 6690 table_id: # (test.t1) -master-bin.000001 6690 Write_rows 1 6724 table_id: # flags: STMT_END_F -master-bin.000001 6724 Table_map 1 6765 table_id: # (test.t1) -master-bin.000001 6765 Write_rows 1 6799 table_id: # flags: STMT_END_F -master-bin.000001 6799 Table_map 1 6840 table_id: # (test.t1) -master-bin.000001 6840 Write_rows 1 6874 table_id: # flags: STMT_END_F -master-bin.000001 6874 Table_map 1 6915 table_id: # (test.t1) -master-bin.000001 6915 Write_rows 1 6949 table_id: # flags: STMT_END_F -master-bin.000001 6949 Table_map 1 6990 table_id: # (test.t1) -master-bin.000001 6990 Write_rows 1 7024 table_id: # flags: STMT_END_F -master-bin.000001 7024 Table_map 1 7065 table_id: # (test.t1) -master-bin.000001 7065 Write_rows 1 7099 table_id: # flags: STMT_END_F -master-bin.000001 7099 Table_map 1 7140 table_id: # (test.t1) -master-bin.000001 7140 Write_rows 1 7174 table_id: # flags: STMT_END_F -master-bin.000001 7174 Table_map 1 7215 table_id: # (test.t1) -master-bin.000001 7215 Write_rows 1 7249 table_id: # flags: STMT_END_F -master-bin.000001 7249 Table_map 1 7290 table_id: # (test.t1) -master-bin.000001 7290 Write_rows 1 7324 table_id: # flags: STMT_END_F -master-bin.000001 7324 Table_map 1 7365 table_id: # (test.t1) -master-bin.000001 7365 Write_rows 1 7399 table_id: # flags: STMT_END_F -master-bin.000001 7399 Table_map 1 7440 table_id: # (test.t1) -master-bin.000001 7440 Write_rows 1 7474 table_id: # flags: STMT_END_F -master-bin.000001 7474 Table_map 1 7515 table_id: # (test.t1) -master-bin.000001 7515 Write_rows 1 7549 table_id: # flags: STMT_END_F -master-bin.000001 7549 Table_map 1 7590 table_id: # (test.t1) -master-bin.000001 7590 Write_rows 1 7624 table_id: # flags: STMT_END_F -master-bin.000001 7624 Table_map 1 7665 table_id: # (test.t1) -master-bin.000001 7665 Write_rows 1 7699 table_id: # flags: STMT_END_F -master-bin.000001 7699 Table_map 1 7740 table_id: # (test.t1) -master-bin.000001 7740 Write_rows 1 7774 table_id: # flags: STMT_END_F -master-bin.000001 7774 Table_map 1 7815 table_id: # (test.t1) -master-bin.000001 7815 Write_rows 1 7849 table_id: # flags: STMT_END_F -master-bin.000001 7849 Table_map 1 7890 table_id: # (test.t1) -master-bin.000001 7890 Write_rows 1 7924 table_id: # flags: STMT_END_F -master-bin.000001 7924 Table_map 1 7965 table_id: # (test.t1) -master-bin.000001 7965 Write_rows 1 7999 table_id: # flags: STMT_END_F -master-bin.000001 7999 Table_map 1 8040 table_id: # (test.t1) -master-bin.000001 8040 Write_rows 1 8074 table_id: # flags: STMT_END_F -master-bin.000001 8074 Table_map 1 8115 table_id: # (test.t1) -master-bin.000001 8115 Write_rows 1 8149 table_id: # flags: STMT_END_F -master-bin.000001 8149 Table_map 1 8190 table_id: # (test.t1) -master-bin.000001 8190 Write_rows 1 8224 table_id: # flags: STMT_END_F -master-bin.000001 8224 Table_map 1 8265 table_id: # (test.t1) -master-bin.000001 8265 Write_rows 1 8299 table_id: # flags: STMT_END_F -master-bin.000001 8299 Table_map 1 8340 table_id: # (test.t1) -master-bin.000001 8340 Write_rows 1 8374 table_id: # flags: STMT_END_F -master-bin.000001 8374 Table_map 1 8415 table_id: # (test.t1) -master-bin.000001 8415 Write_rows 1 8449 table_id: # flags: STMT_END_F -master-bin.000001 8449 Table_map 1 8490 table_id: # (test.t1) -master-bin.000001 8490 Write_rows 1 8524 table_id: # flags: STMT_END_F -master-bin.000001 8524 Table_map 1 8565 table_id: # (test.t1) -master-bin.000001 8565 Write_rows 1 8599 table_id: # flags: STMT_END_F -master-bin.000001 8599 Table_map 1 8640 table_id: # (test.t1) -master-bin.000001 8640 Write_rows 1 8674 table_id: # flags: STMT_END_F -master-bin.000001 8674 Table_map 1 8715 table_id: # (test.t1) -master-bin.000001 8715 Write_rows 1 8749 table_id: # flags: STMT_END_F -master-bin.000001 8749 Table_map 1 8790 table_id: # (test.t1) -master-bin.000001 8790 Write_rows 1 8824 table_id: # flags: STMT_END_F -master-bin.000001 8824 Table_map 1 8865 table_id: # (test.t1) -master-bin.000001 8865 Write_rows 1 8899 table_id: # flags: STMT_END_F -master-bin.000001 8899 Table_map 1 8940 table_id: # (test.t1) -master-bin.000001 8940 Write_rows 1 8974 table_id: # flags: STMT_END_F -master-bin.000001 8974 Table_map 1 9015 table_id: # (test.t1) -master-bin.000001 9015 Write_rows 1 9049 table_id: # flags: STMT_END_F -master-bin.000001 9049 Table_map 1 9090 table_id: # (test.t1) -master-bin.000001 9090 Write_rows 1 9124 table_id: # flags: STMT_END_F -master-bin.000001 9124 Table_map 1 9165 table_id: # (test.t1) -master-bin.000001 9165 Write_rows 1 9199 table_id: # flags: STMT_END_F -master-bin.000001 9199 Table_map 1 9240 table_id: # (test.t1) -master-bin.000001 9240 Write_rows 1 9274 table_id: # flags: STMT_END_F -master-bin.000001 9274 Table_map 1 9315 table_id: # (test.t1) -master-bin.000001 9315 Write_rows 1 9349 table_id: # flags: STMT_END_F -master-bin.000001 9349 Table_map 1 9390 table_id: # (test.t1) -master-bin.000001 9390 Write_rows 1 9424 table_id: # flags: STMT_END_F -master-bin.000001 9424 Table_map 1 9465 table_id: # (test.t1) -master-bin.000001 9465 Write_rows 1 9499 table_id: # flags: STMT_END_F -master-bin.000001 9499 Table_map 1 9540 table_id: # (test.t1) -master-bin.000001 9540 Write_rows 1 9574 table_id: # flags: STMT_END_F -master-bin.000001 9574 Table_map 1 9615 table_id: # (test.t1) -master-bin.000001 9615 Write_rows 1 9649 table_id: # flags: STMT_END_F -master-bin.000001 9649 Table_map 1 9690 table_id: # (test.t1) -master-bin.000001 9690 Write_rows 1 9724 table_id: # flags: STMT_END_F -master-bin.000001 9724 Table_map 1 9765 table_id: # (test.t1) -master-bin.000001 9765 Write_rows 1 9799 table_id: # flags: STMT_END_F -master-bin.000001 9799 Table_map 1 9840 table_id: # (test.t1) -master-bin.000001 9840 Write_rows 1 9874 table_id: # flags: STMT_END_F -master-bin.000001 9874 Table_map 1 9915 table_id: # (test.t1) -master-bin.000001 9915 Write_rows 1 9949 table_id: # flags: STMT_END_F -master-bin.000001 9949 Table_map 1 9990 table_id: # (test.t1) -master-bin.000001 9990 Write_rows 1 10024 table_id: # flags: STMT_END_F -master-bin.000001 10024 Table_map 1 10065 table_id: # (test.t1) -master-bin.000001 10065 Write_rows 1 10099 table_id: # flags: STMT_END_F -master-bin.000001 10099 Table_map 1 10140 table_id: # (test.t1) -master-bin.000001 10140 Write_rows 1 10174 table_id: # flags: STMT_END_F -master-bin.000001 10174 Table_map 1 10215 table_id: # (test.t1) -master-bin.000001 10215 Write_rows 1 10249 table_id: # flags: STMT_END_F -master-bin.000001 10249 Table_map 1 10290 table_id: # (test.t1) -master-bin.000001 10290 Write_rows 1 10324 table_id: # flags: STMT_END_F -master-bin.000001 10324 Table_map 1 10365 table_id: # (test.t1) -master-bin.000001 10365 Write_rows 1 10399 table_id: # flags: STMT_END_F -master-bin.000001 10399 Table_map 1 10440 table_id: # (test.t1) -master-bin.000001 10440 Write_rows 1 10474 table_id: # flags: STMT_END_F -master-bin.000001 10474 Table_map 1 10515 table_id: # (test.t1) -master-bin.000001 10515 Write_rows 1 10549 table_id: # flags: STMT_END_F -master-bin.000001 10549 Table_map 1 10590 table_id: # (test.t1) -master-bin.000001 10590 Write_rows 1 10624 table_id: # flags: STMT_END_F -master-bin.000001 10624 Table_map 1 10665 table_id: # (test.t1) -master-bin.000001 10665 Write_rows 1 10699 table_id: # flags: STMT_END_F -master-bin.000001 10699 Table_map 1 10740 table_id: # (test.t1) -master-bin.000001 10740 Write_rows 1 10774 table_id: # flags: STMT_END_F -master-bin.000001 10774 Table_map 1 10815 table_id: # (test.t1) -master-bin.000001 10815 Write_rows 1 10849 table_id: # flags: STMT_END_F -master-bin.000001 10849 Table_map 1 10890 table_id: # (test.t1) -master-bin.000001 10890 Write_rows 1 10924 table_id: # flags: STMT_END_F -master-bin.000001 10924 Table_map 1 10965 table_id: # (test.t1) -master-bin.000001 10965 Write_rows 1 10999 table_id: # flags: STMT_END_F -master-bin.000001 10999 Table_map 1 11040 table_id: # (test.t1) -master-bin.000001 11040 Write_rows 1 11074 table_id: # flags: STMT_END_F -master-bin.000001 11074 Table_map 1 11115 table_id: # (test.t1) -master-bin.000001 11115 Write_rows 1 11149 table_id: # flags: STMT_END_F -master-bin.000001 11149 Table_map 1 11190 table_id: # (test.t1) -master-bin.000001 11190 Write_rows 1 11224 table_id: # flags: STMT_END_F -master-bin.000001 11224 Table_map 1 11265 table_id: # (test.t1) -master-bin.000001 11265 Write_rows 1 11299 table_id: # flags: STMT_END_F -master-bin.000001 11299 Table_map 1 11340 table_id: # (test.t1) -master-bin.000001 11340 Write_rows 1 11374 table_id: # flags: STMT_END_F -master-bin.000001 11374 Table_map 1 11415 table_id: # (test.t1) -master-bin.000001 11415 Write_rows 1 11449 table_id: # flags: STMT_END_F -master-bin.000001 11449 Table_map 1 11490 table_id: # (test.t1) -master-bin.000001 11490 Write_rows 1 11524 table_id: # flags: STMT_END_F -master-bin.000001 11524 Table_map 1 11565 table_id: # (test.t1) -master-bin.000001 11565 Write_rows 1 11599 table_id: # flags: STMT_END_F -master-bin.000001 11599 Table_map 1 11640 table_id: # (test.t1) -master-bin.000001 11640 Write_rows 1 11674 table_id: # flags: STMT_END_F -master-bin.000001 11674 Table_map 1 11715 table_id: # (test.t1) -master-bin.000001 11715 Write_rows 1 11749 table_id: # flags: STMT_END_F -master-bin.000001 11749 Table_map 1 11790 table_id: # (test.t1) -master-bin.000001 11790 Write_rows 1 11824 table_id: # flags: STMT_END_F -master-bin.000001 11824 Table_map 1 11865 table_id: # (test.t1) -master-bin.000001 11865 Write_rows 1 11899 table_id: # flags: STMT_END_F -master-bin.000001 11899 Table_map 1 11940 table_id: # (test.t1) -master-bin.000001 11940 Write_rows 1 11974 table_id: # flags: STMT_END_F -master-bin.000001 11974 Table_map 1 12015 table_id: # (test.t1) -master-bin.000001 12015 Write_rows 1 12049 table_id: # flags: STMT_END_F -master-bin.000001 12049 Table_map 1 12090 table_id: # (test.t1) -master-bin.000001 12090 Write_rows 1 12124 table_id: # flags: STMT_END_F -master-bin.000001 12124 Table_map 1 12165 table_id: # (test.t1) -master-bin.000001 12165 Write_rows 1 12199 table_id: # flags: STMT_END_F -master-bin.000001 12199 Table_map 1 12240 table_id: # (test.t1) -master-bin.000001 12240 Write_rows 1 12274 table_id: # flags: STMT_END_F -master-bin.000001 12274 Table_map 1 12315 table_id: # (test.t1) -master-bin.000001 12315 Write_rows 1 12349 table_id: # flags: STMT_END_F -master-bin.000001 12349 Table_map 1 12390 table_id: # (test.t1) -master-bin.000001 12390 Write_rows 1 12424 table_id: # flags: STMT_END_F -master-bin.000001 12424 Table_map 1 12465 table_id: # (test.t1) -master-bin.000001 12465 Write_rows 1 12499 table_id: # flags: STMT_END_F -master-bin.000001 12499 Table_map 1 12540 table_id: # (test.t1) -master-bin.000001 12540 Write_rows 1 12574 table_id: # flags: STMT_END_F -master-bin.000001 12574 Table_map 1 12615 table_id: # (test.t1) -master-bin.000001 12615 Write_rows 1 12649 table_id: # flags: STMT_END_F -master-bin.000001 12649 Table_map 1 12690 table_id: # (test.t1) -master-bin.000001 12690 Write_rows 1 12724 table_id: # flags: STMT_END_F -master-bin.000001 12724 Table_map 1 12765 table_id: # (test.t1) -master-bin.000001 12765 Write_rows 1 12799 table_id: # flags: STMT_END_F -master-bin.000001 12799 Table_map 1 12840 table_id: # (test.t1) -master-bin.000001 12840 Write_rows 1 12874 table_id: # flags: STMT_END_F -master-bin.000001 12874 Table_map 1 12915 table_id: # (test.t1) -master-bin.000001 12915 Write_rows 1 12949 table_id: # flags: STMT_END_F -master-bin.000001 12949 Table_map 1 12990 table_id: # (test.t1) -master-bin.000001 12990 Write_rows 1 13024 table_id: # flags: STMT_END_F -master-bin.000001 13024 Table_map 1 13065 table_id: # (test.t1) -master-bin.000001 13065 Write_rows 1 13099 table_id: # flags: STMT_END_F -master-bin.000001 13099 Table_map 1 13140 table_id: # (test.t1) -master-bin.000001 13140 Write_rows 1 13174 table_id: # flags: STMT_END_F -master-bin.000001 13174 Table_map 1 13215 table_id: # (test.t1) -master-bin.000001 13215 Write_rows 1 13249 table_id: # flags: STMT_END_F -master-bin.000001 13249 Table_map 1 13290 table_id: # (test.t1) -master-bin.000001 13290 Write_rows 1 13324 table_id: # flags: STMT_END_F -master-bin.000001 13324 Table_map 1 13365 table_id: # (test.t1) -master-bin.000001 13365 Write_rows 1 13399 table_id: # flags: STMT_END_F -master-bin.000001 13399 Table_map 1 13440 table_id: # (test.t1) -master-bin.000001 13440 Write_rows 1 13474 table_id: # flags: STMT_END_F -master-bin.000001 13474 Table_map 1 13515 table_id: # (test.t1) -master-bin.000001 13515 Write_rows 1 13549 table_id: # flags: STMT_END_F -master-bin.000001 13549 Table_map 1 13590 table_id: # (test.t1) -master-bin.000001 13590 Write_rows 1 13624 table_id: # flags: STMT_END_F -master-bin.000001 13624 Table_map 1 13665 table_id: # (test.t1) -master-bin.000001 13665 Write_rows 1 13699 table_id: # flags: STMT_END_F -master-bin.000001 13699 Table_map 1 13740 table_id: # (test.t1) -master-bin.000001 13740 Write_rows 1 13774 table_id: # flags: STMT_END_F -master-bin.000001 13774 Table_map 1 13815 table_id: # (test.t1) -master-bin.000001 13815 Write_rows 1 13849 table_id: # flags: STMT_END_F -master-bin.000001 13849 Table_map 1 13890 table_id: # (test.t1) -master-bin.000001 13890 Write_rows 1 13924 table_id: # flags: STMT_END_F -master-bin.000001 13924 Table_map 1 13965 table_id: # (test.t1) -master-bin.000001 13965 Write_rows 1 13999 table_id: # flags: STMT_END_F -master-bin.000001 13999 Table_map 1 14040 table_id: # (test.t1) -master-bin.000001 14040 Write_rows 1 14074 table_id: # flags: STMT_END_F -master-bin.000001 14074 Table_map 1 14115 table_id: # (test.t1) -master-bin.000001 14115 Write_rows 1 14149 table_id: # flags: STMT_END_F -master-bin.000001 14149 Table_map 1 14190 table_id: # (test.t1) -master-bin.000001 14190 Write_rows 1 14224 table_id: # flags: STMT_END_F -master-bin.000001 14224 Table_map 1 14265 table_id: # (test.t1) -master-bin.000001 14265 Write_rows 1 14299 table_id: # flags: STMT_END_F -master-bin.000001 14299 Table_map 1 14340 table_id: # (test.t1) -master-bin.000001 14340 Write_rows 1 14374 table_id: # flags: STMT_END_F -master-bin.000001 14374 Table_map 1 14415 table_id: # (test.t1) -master-bin.000001 14415 Write_rows 1 14449 table_id: # flags: STMT_END_F -master-bin.000001 14449 Table_map 1 14490 table_id: # (test.t1) -master-bin.000001 14490 Write_rows 1 14524 table_id: # flags: STMT_END_F -master-bin.000001 14524 Table_map 1 14565 table_id: # (test.t1) -master-bin.000001 14565 Write_rows 1 14599 table_id: # flags: STMT_END_F -master-bin.000001 14599 Table_map 1 14640 table_id: # (test.t1) -master-bin.000001 14640 Write_rows 1 14674 table_id: # flags: STMT_END_F -master-bin.000001 14674 Table_map 1 14715 table_id: # (test.t1) -master-bin.000001 14715 Write_rows 1 14749 table_id: # flags: STMT_END_F -master-bin.000001 14749 Table_map 1 14790 table_id: # (test.t1) -master-bin.000001 14790 Write_rows 1 14824 table_id: # flags: STMT_END_F -master-bin.000001 14824 Table_map 1 14865 table_id: # (test.t1) -master-bin.000001 14865 Write_rows 1 14899 table_id: # flags: STMT_END_F -master-bin.000001 14899 Table_map 1 14940 table_id: # (test.t1) -master-bin.000001 14940 Write_rows 1 14974 table_id: # flags: STMT_END_F -master-bin.000001 14974 Table_map 1 15015 table_id: # (test.t1) -master-bin.000001 15015 Write_rows 1 15049 table_id: # flags: STMT_END_F -master-bin.000001 15049 Table_map 1 15090 table_id: # (test.t1) -master-bin.000001 15090 Write_rows 1 15124 table_id: # flags: STMT_END_F -master-bin.000001 15124 Table_map 1 15165 table_id: # (test.t1) -master-bin.000001 15165 Write_rows 1 15199 table_id: # flags: STMT_END_F -master-bin.000001 15199 Table_map 1 15240 table_id: # (test.t1) -master-bin.000001 15240 Write_rows 1 15274 table_id: # flags: STMT_END_F -master-bin.000001 15274 Table_map 1 15315 table_id: # (test.t1) -master-bin.000001 15315 Write_rows 1 15349 table_id: # flags: STMT_END_F -master-bin.000001 15349 Table_map 1 15390 table_id: # (test.t1) -master-bin.000001 15390 Write_rows 1 15424 table_id: # flags: STMT_END_F -master-bin.000001 15424 Table_map 1 15465 table_id: # (test.t1) -master-bin.000001 15465 Write_rows 1 15499 table_id: # flags: STMT_END_F -master-bin.000001 15499 Table_map 1 15540 table_id: # (test.t1) -master-bin.000001 15540 Write_rows 1 15574 table_id: # flags: STMT_END_F -master-bin.000001 15574 Table_map 1 15615 table_id: # (test.t1) -master-bin.000001 15615 Write_rows 1 15649 table_id: # flags: STMT_END_F -master-bin.000001 15649 Table_map 1 15690 table_id: # (test.t1) -master-bin.000001 15690 Write_rows 1 15724 table_id: # flags: STMT_END_F -master-bin.000001 15724 Table_map 1 15765 table_id: # (test.t1) -master-bin.000001 15765 Write_rows 1 15799 table_id: # flags: STMT_END_F -master-bin.000001 15799 Table_map 1 15840 table_id: # (test.t1) -master-bin.000001 15840 Write_rows 1 15874 table_id: # flags: STMT_END_F -master-bin.000001 15874 Table_map 1 15915 table_id: # (test.t1) -master-bin.000001 15915 Write_rows 1 15949 table_id: # flags: STMT_END_F -master-bin.000001 15949 Table_map 1 15990 table_id: # (test.t1) -master-bin.000001 15990 Write_rows 1 16024 table_id: # flags: STMT_END_F -master-bin.000001 16024 Table_map 1 16065 table_id: # (test.t1) -master-bin.000001 16065 Write_rows 1 16099 table_id: # flags: STMT_END_F -master-bin.000001 16099 Table_map 1 16140 table_id: # (test.t1) -master-bin.000001 16140 Write_rows 1 16174 table_id: # flags: STMT_END_F -master-bin.000001 16174 Table_map 1 16215 table_id: # (test.t1) -master-bin.000001 16215 Write_rows 1 16249 table_id: # flags: STMT_END_F -master-bin.000001 16249 Table_map 1 16290 table_id: # (test.t1) -master-bin.000001 16290 Write_rows 1 16324 table_id: # flags: STMT_END_F -master-bin.000001 16324 Table_map 1 16365 table_id: # (test.t1) -master-bin.000001 16365 Write_rows 1 16399 table_id: # flags: STMT_END_F -master-bin.000001 16399 Table_map 1 16440 table_id: # (test.t1) -master-bin.000001 16440 Write_rows 1 16474 table_id: # flags: STMT_END_F -master-bin.000001 16474 Table_map 1 16515 table_id: # (test.t1) -master-bin.000001 16515 Write_rows 1 16549 table_id: # flags: STMT_END_F -master-bin.000001 16549 Table_map 1 16590 table_id: # (test.t1) -master-bin.000001 16590 Write_rows 1 16624 table_id: # flags: STMT_END_F -master-bin.000001 16624 Table_map 1 16665 table_id: # (test.t1) -master-bin.000001 16665 Write_rows 1 16699 table_id: # flags: STMT_END_F -master-bin.000001 16699 Table_map 1 16740 table_id: # (test.t1) -master-bin.000001 16740 Write_rows 1 16774 table_id: # flags: STMT_END_F -master-bin.000001 16774 Table_map 1 16815 table_id: # (test.t1) -master-bin.000001 16815 Write_rows 1 16849 table_id: # flags: STMT_END_F -master-bin.000001 16849 Table_map 1 16890 table_id: # (test.t1) -master-bin.000001 16890 Write_rows 1 16924 table_id: # flags: STMT_END_F -master-bin.000001 16924 Table_map 1 16965 table_id: # (test.t1) -master-bin.000001 16965 Write_rows 1 16999 table_id: # flags: STMT_END_F -master-bin.000001 16999 Table_map 1 17040 table_id: # (test.t1) -master-bin.000001 17040 Write_rows 1 17074 table_id: # flags: STMT_END_F -master-bin.000001 17074 Table_map 1 17115 table_id: # (test.t1) -master-bin.000001 17115 Write_rows 1 17149 table_id: # flags: STMT_END_F -master-bin.000001 17149 Table_map 1 17190 table_id: # (test.t1) -master-bin.000001 17190 Write_rows 1 17224 table_id: # flags: STMT_END_F -master-bin.000001 17224 Table_map 1 17265 table_id: # (test.t1) -master-bin.000001 17265 Write_rows 1 17299 table_id: # flags: STMT_END_F -master-bin.000001 17299 Table_map 1 17340 table_id: # (test.t1) -master-bin.000001 17340 Write_rows 1 17374 table_id: # flags: STMT_END_F -master-bin.000001 17374 Table_map 1 17415 table_id: # (test.t1) -master-bin.000001 17415 Write_rows 1 17449 table_id: # flags: STMT_END_F -master-bin.000001 17449 Table_map 1 17490 table_id: # (test.t1) -master-bin.000001 17490 Write_rows 1 17524 table_id: # flags: STMT_END_F -master-bin.000001 17524 Table_map 1 17565 table_id: # (test.t1) -master-bin.000001 17565 Write_rows 1 17599 table_id: # flags: STMT_END_F -master-bin.000001 17599 Table_map 1 17640 table_id: # (test.t1) -master-bin.000001 17640 Write_rows 1 17674 table_id: # flags: STMT_END_F -master-bin.000001 17674 Table_map 1 17715 table_id: # (test.t1) -master-bin.000001 17715 Write_rows 1 17749 table_id: # flags: STMT_END_F -master-bin.000001 17749 Table_map 1 17790 table_id: # (test.t1) -master-bin.000001 17790 Write_rows 1 17824 table_id: # flags: STMT_END_F -master-bin.000001 17824 Table_map 1 17865 table_id: # (test.t1) -master-bin.000001 17865 Write_rows 1 17899 table_id: # flags: STMT_END_F -master-bin.000001 17899 Table_map 1 17940 table_id: # (test.t1) -master-bin.000001 17940 Write_rows 1 17974 table_id: # flags: STMT_END_F -master-bin.000001 17974 Table_map 1 18015 table_id: # (test.t1) -master-bin.000001 18015 Write_rows 1 18049 table_id: # flags: STMT_END_F -master-bin.000001 18049 Table_map 1 18090 table_id: # (test.t1) -master-bin.000001 18090 Write_rows 1 18124 table_id: # flags: STMT_END_F -master-bin.000001 18124 Table_map 1 18165 table_id: # (test.t1) -master-bin.000001 18165 Write_rows 1 18199 table_id: # flags: STMT_END_F -master-bin.000001 18199 Table_map 1 18240 table_id: # (test.t1) -master-bin.000001 18240 Write_rows 1 18274 table_id: # flags: STMT_END_F -master-bin.000001 18274 Table_map 1 18315 table_id: # (test.t1) -master-bin.000001 18315 Write_rows 1 18349 table_id: # flags: STMT_END_F -master-bin.000001 18349 Table_map 1 18390 table_id: # (test.t1) -master-bin.000001 18390 Write_rows 1 18424 table_id: # flags: STMT_END_F -master-bin.000001 18424 Table_map 1 18465 table_id: # (test.t1) -master-bin.000001 18465 Write_rows 1 18499 table_id: # flags: STMT_END_F -master-bin.000001 18499 Table_map 1 18540 table_id: # (test.t1) -master-bin.000001 18540 Write_rows 1 18574 table_id: # flags: STMT_END_F -master-bin.000001 18574 Table_map 1 18615 table_id: # (test.t1) -master-bin.000001 18615 Write_rows 1 18649 table_id: # flags: STMT_END_F -master-bin.000001 18649 Table_map 1 18690 table_id: # (test.t1) -master-bin.000001 18690 Write_rows 1 18724 table_id: # flags: STMT_END_F -master-bin.000001 18724 Table_map 1 18765 table_id: # (test.t1) -master-bin.000001 18765 Write_rows 1 18799 table_id: # flags: STMT_END_F -master-bin.000001 18799 Table_map 1 18840 table_id: # (test.t1) -master-bin.000001 18840 Write_rows 1 18874 table_id: # flags: STMT_END_F -master-bin.000001 18874 Table_map 1 18915 table_id: # (test.t1) -master-bin.000001 18915 Write_rows 1 18949 table_id: # flags: STMT_END_F -master-bin.000001 18949 Table_map 1 18990 table_id: # (test.t1) -master-bin.000001 18990 Write_rows 1 19024 table_id: # flags: STMT_END_F -master-bin.000001 19024 Table_map 1 19065 table_id: # (test.t1) -master-bin.000001 19065 Write_rows 1 19099 table_id: # flags: STMT_END_F -master-bin.000001 19099 Table_map 1 19140 table_id: # (test.t1) -master-bin.000001 19140 Write_rows 1 19174 table_id: # flags: STMT_END_F -master-bin.000001 19174 Table_map 1 19215 table_id: # (test.t1) -master-bin.000001 19215 Write_rows 1 19249 table_id: # flags: STMT_END_F -master-bin.000001 19249 Table_map 1 19290 table_id: # (test.t1) -master-bin.000001 19290 Write_rows 1 19324 table_id: # flags: STMT_END_F -master-bin.000001 19324 Table_map 1 19365 table_id: # (test.t1) -master-bin.000001 19365 Write_rows 1 19399 table_id: # flags: STMT_END_F -master-bin.000001 19399 Table_map 1 19440 table_id: # (test.t1) -master-bin.000001 19440 Write_rows 1 19474 table_id: # flags: STMT_END_F -master-bin.000001 19474 Table_map 1 19515 table_id: # (test.t1) -master-bin.000001 19515 Write_rows 1 19549 table_id: # flags: STMT_END_F -master-bin.000001 19549 Table_map 1 19590 table_id: # (test.t1) -master-bin.000001 19590 Write_rows 1 19624 table_id: # flags: STMT_END_F -master-bin.000001 19624 Table_map 1 19665 table_id: # (test.t1) -master-bin.000001 19665 Write_rows 1 19699 table_id: # flags: STMT_END_F -master-bin.000001 19699 Table_map 1 19740 table_id: # (test.t1) -master-bin.000001 19740 Write_rows 1 19774 table_id: # flags: STMT_END_F -master-bin.000001 19774 Table_map 1 19815 table_id: # (test.t1) -master-bin.000001 19815 Write_rows 1 19849 table_id: # flags: STMT_END_F -master-bin.000001 19849 Table_map 1 19890 table_id: # (test.t1) -master-bin.000001 19890 Write_rows 1 19924 table_id: # flags: STMT_END_F -master-bin.000001 19924 Table_map 1 19965 table_id: # (test.t1) -master-bin.000001 19965 Write_rows 1 19999 table_id: # flags: STMT_END_F -master-bin.000001 19999 Table_map 1 20040 table_id: # (test.t1) -master-bin.000001 20040 Write_rows 1 20074 table_id: # flags: STMT_END_F -master-bin.000001 20074 Table_map 1 20115 table_id: # (test.t1) -master-bin.000001 20115 Write_rows 1 20149 table_id: # flags: STMT_END_F -master-bin.000001 20149 Table_map 1 20190 table_id: # (test.t1) -master-bin.000001 20190 Write_rows 1 20224 table_id: # flags: STMT_END_F -master-bin.000001 20224 Table_map 1 20265 table_id: # (test.t1) -master-bin.000001 20265 Write_rows 1 20299 table_id: # flags: STMT_END_F -master-bin.000001 20299 Table_map 1 20340 table_id: # (test.t1) -master-bin.000001 20340 Write_rows 1 20374 table_id: # flags: STMT_END_F -master-bin.000001 20374 Table_map 1 20415 table_id: # (test.t1) -master-bin.000001 20415 Write_rows 1 20449 table_id: # flags: STMT_END_F -master-bin.000001 20449 Table_map 1 20490 table_id: # (test.t1) -master-bin.000001 20490 Write_rows 1 20524 table_id: # flags: STMT_END_F -master-bin.000001 20524 Table_map 1 20565 table_id: # (test.t1) -master-bin.000001 20565 Write_rows 1 20599 table_id: # flags: STMT_END_F -master-bin.000001 20599 Table_map 1 20640 table_id: # (test.t1) -master-bin.000001 20640 Write_rows 1 20674 table_id: # flags: STMT_END_F -master-bin.000001 20674 Table_map 1 20715 table_id: # (test.t1) -master-bin.000001 20715 Write_rows 1 20749 table_id: # flags: STMT_END_F -master-bin.000001 20749 Table_map 1 20790 table_id: # (test.t1) -master-bin.000001 20790 Write_rows 1 20824 table_id: # flags: STMT_END_F -master-bin.000001 20824 Table_map 1 20865 table_id: # (test.t1) -master-bin.000001 20865 Write_rows 1 20899 table_id: # flags: STMT_END_F -master-bin.000001 20899 Table_map 1 20940 table_id: # (test.t1) -master-bin.000001 20940 Write_rows 1 20974 table_id: # flags: STMT_END_F -master-bin.000001 20974 Table_map 1 21015 table_id: # (test.t1) -master-bin.000001 21015 Write_rows 1 21049 table_id: # flags: STMT_END_F -master-bin.000001 21049 Table_map 1 21090 table_id: # (test.t1) -master-bin.000001 21090 Write_rows 1 21124 table_id: # flags: STMT_END_F -master-bin.000001 21124 Table_map 1 21165 table_id: # (test.t1) -master-bin.000001 21165 Write_rows 1 21199 table_id: # flags: STMT_END_F -master-bin.000001 21199 Table_map 1 21240 table_id: # (test.t1) -master-bin.000001 21240 Write_rows 1 21274 table_id: # flags: STMT_END_F -master-bin.000001 21274 Table_map 1 21315 table_id: # (test.t1) -master-bin.000001 21315 Write_rows 1 21349 table_id: # flags: STMT_END_F -master-bin.000001 21349 Table_map 1 21390 table_id: # (test.t1) -master-bin.000001 21390 Write_rows 1 21424 table_id: # flags: STMT_END_F -master-bin.000001 21424 Table_map 1 21465 table_id: # (test.t1) -master-bin.000001 21465 Write_rows 1 21499 table_id: # flags: STMT_END_F -master-bin.000001 21499 Table_map 1 21540 table_id: # (test.t1) -master-bin.000001 21540 Write_rows 1 21574 table_id: # flags: STMT_END_F -master-bin.000001 21574 Table_map 1 21615 table_id: # (test.t1) -master-bin.000001 21615 Write_rows 1 21649 table_id: # flags: STMT_END_F -master-bin.000001 21649 Table_map 1 21690 table_id: # (test.t1) -master-bin.000001 21690 Write_rows 1 21724 table_id: # flags: STMT_END_F -master-bin.000001 21724 Table_map 1 21765 table_id: # (test.t1) -master-bin.000001 21765 Write_rows 1 21799 table_id: # flags: STMT_END_F -master-bin.000001 21799 Table_map 1 21840 table_id: # (test.t1) -master-bin.000001 21840 Write_rows 1 21874 table_id: # flags: STMT_END_F -master-bin.000001 21874 Table_map 1 21915 table_id: # (test.t1) -master-bin.000001 21915 Write_rows 1 21949 table_id: # flags: STMT_END_F -master-bin.000001 21949 Table_map 1 21990 table_id: # (test.t1) -master-bin.000001 21990 Write_rows 1 22024 table_id: # flags: STMT_END_F -master-bin.000001 22024 Table_map 1 22065 table_id: # (test.t1) -master-bin.000001 22065 Write_rows 1 22099 table_id: # flags: STMT_END_F -master-bin.000001 22099 Table_map 1 22140 table_id: # (test.t1) -master-bin.000001 22140 Write_rows 1 22174 table_id: # flags: STMT_END_F -master-bin.000001 22174 Table_map 1 22215 table_id: # (test.t1) -master-bin.000001 22215 Write_rows 1 22249 table_id: # flags: STMT_END_F -master-bin.000001 22249 Table_map 1 22290 table_id: # (test.t1) -master-bin.000001 22290 Write_rows 1 22324 table_id: # flags: STMT_END_F -master-bin.000001 22324 Table_map 1 22365 table_id: # (test.t1) -master-bin.000001 22365 Write_rows 1 22399 table_id: # flags: STMT_END_F -master-bin.000001 22399 Table_map 1 22440 table_id: # (test.t1) -master-bin.000001 22440 Write_rows 1 22474 table_id: # flags: STMT_END_F -master-bin.000001 22474 Table_map 1 22515 table_id: # (test.t1) -master-bin.000001 22515 Write_rows 1 22549 table_id: # flags: STMT_END_F -master-bin.000001 22549 Table_map 1 22590 table_id: # (test.t1) -master-bin.000001 22590 Write_rows 1 22624 table_id: # flags: STMT_END_F -master-bin.000001 22624 Table_map 1 22665 table_id: # (test.t1) -master-bin.000001 22665 Write_rows 1 22699 table_id: # flags: STMT_END_F -master-bin.000001 22699 Table_map 1 22740 table_id: # (test.t1) -master-bin.000001 22740 Write_rows 1 22774 table_id: # flags: STMT_END_F -master-bin.000001 22774 Table_map 1 22815 table_id: # (test.t1) -master-bin.000001 22815 Write_rows 1 22849 table_id: # flags: STMT_END_F -master-bin.000001 22849 Table_map 1 22890 table_id: # (test.t1) -master-bin.000001 22890 Write_rows 1 22924 table_id: # flags: STMT_END_F -master-bin.000001 22924 Table_map 1 22965 table_id: # (test.t1) -master-bin.000001 22965 Write_rows 1 22999 table_id: # flags: STMT_END_F -master-bin.000001 22999 Table_map 1 23040 table_id: # (test.t1) -master-bin.000001 23040 Write_rows 1 23074 table_id: # flags: STMT_END_F -master-bin.000001 23074 Table_map 1 23115 table_id: # (test.t1) -master-bin.000001 23115 Write_rows 1 23149 table_id: # flags: STMT_END_F -master-bin.000001 23149 Table_map 1 23190 table_id: # (test.t1) -master-bin.000001 23190 Write_rows 1 23224 table_id: # flags: STMT_END_F -master-bin.000001 23224 Table_map 1 23265 table_id: # (test.t1) -master-bin.000001 23265 Write_rows 1 23299 table_id: # flags: STMT_END_F -master-bin.000001 23299 Table_map 1 23340 table_id: # (test.t1) -master-bin.000001 23340 Write_rows 1 23374 table_id: # flags: STMT_END_F -master-bin.000001 23374 Table_map 1 23415 table_id: # (test.t1) -master-bin.000001 23415 Write_rows 1 23449 table_id: # flags: STMT_END_F -master-bin.000001 23449 Table_map 1 23490 table_id: # (test.t1) -master-bin.000001 23490 Write_rows 1 23524 table_id: # flags: STMT_END_F -master-bin.000001 23524 Table_map 1 23565 table_id: # (test.t1) -master-bin.000001 23565 Write_rows 1 23599 table_id: # flags: STMT_END_F -master-bin.000001 23599 Table_map 1 23640 table_id: # (test.t1) -master-bin.000001 23640 Write_rows 1 23674 table_id: # flags: STMT_END_F -master-bin.000001 23674 Table_map 1 23715 table_id: # (test.t1) -master-bin.000001 23715 Write_rows 1 23749 table_id: # flags: STMT_END_F -master-bin.000001 23749 Table_map 1 23790 table_id: # (test.t1) -master-bin.000001 23790 Write_rows 1 23824 table_id: # flags: STMT_END_F -master-bin.000001 23824 Table_map 1 23865 table_id: # (test.t1) -master-bin.000001 23865 Write_rows 1 23899 table_id: # flags: STMT_END_F -master-bin.000001 23899 Table_map 1 23940 table_id: # (test.t1) -master-bin.000001 23940 Write_rows 1 23974 table_id: # flags: STMT_END_F -master-bin.000001 23974 Table_map 1 24015 table_id: # (test.t1) -master-bin.000001 24015 Write_rows 1 24049 table_id: # flags: STMT_END_F -master-bin.000001 24049 Table_map 1 24090 table_id: # (test.t1) -master-bin.000001 24090 Write_rows 1 24124 table_id: # flags: STMT_END_F -master-bin.000001 24124 Table_map 1 24165 table_id: # (test.t1) -master-bin.000001 24165 Write_rows 1 24199 table_id: # flags: STMT_END_F -master-bin.000001 24199 Table_map 1 24240 table_id: # (test.t1) -master-bin.000001 24240 Write_rows 1 24274 table_id: # flags: STMT_END_F -master-bin.000001 24274 Table_map 1 24315 table_id: # (test.t1) -master-bin.000001 24315 Write_rows 1 24349 table_id: # flags: STMT_END_F -master-bin.000001 24349 Table_map 1 24390 table_id: # (test.t1) -master-bin.000001 24390 Write_rows 1 24424 table_id: # flags: STMT_END_F -master-bin.000001 24424 Table_map 1 24465 table_id: # (test.t1) -master-bin.000001 24465 Write_rows 1 24499 table_id: # flags: STMT_END_F -master-bin.000001 24499 Table_map 1 24540 table_id: # (test.t1) -master-bin.000001 24540 Write_rows 1 24574 table_id: # flags: STMT_END_F -master-bin.000001 24574 Table_map 1 24615 table_id: # (test.t1) -master-bin.000001 24615 Write_rows 1 24649 table_id: # flags: STMT_END_F -master-bin.000001 24649 Table_map 1 24690 table_id: # (test.t1) -master-bin.000001 24690 Write_rows 1 24724 table_id: # flags: STMT_END_F -master-bin.000001 24724 Table_map 1 24765 table_id: # (test.t1) -master-bin.000001 24765 Write_rows 1 24799 table_id: # flags: STMT_END_F -master-bin.000001 24799 Table_map 1 24840 table_id: # (test.t1) -master-bin.000001 24840 Write_rows 1 24874 table_id: # flags: STMT_END_F -master-bin.000001 24874 Table_map 1 24915 table_id: # (test.t1) -master-bin.000001 24915 Write_rows 1 24949 table_id: # flags: STMT_END_F -master-bin.000001 24949 Table_map 1 24990 table_id: # (test.t1) -master-bin.000001 24990 Write_rows 1 25024 table_id: # flags: STMT_END_F -master-bin.000001 25024 Table_map 1 25065 table_id: # (test.t1) -master-bin.000001 25065 Write_rows 1 25099 table_id: # flags: STMT_END_F -master-bin.000001 25099 Table_map 1 25140 table_id: # (test.t1) -master-bin.000001 25140 Write_rows 1 25174 table_id: # flags: STMT_END_F -master-bin.000001 25174 Table_map 1 25215 table_id: # (test.t1) -master-bin.000001 25215 Write_rows 1 25249 table_id: # flags: STMT_END_F -master-bin.000001 25249 Table_map 1 25290 table_id: # (test.t1) -master-bin.000001 25290 Write_rows 1 25324 table_id: # flags: STMT_END_F -master-bin.000001 25324 Table_map 1 25365 table_id: # (test.t1) -master-bin.000001 25365 Write_rows 1 25399 table_id: # flags: STMT_END_F -master-bin.000001 25399 Table_map 1 25440 table_id: # (test.t1) -master-bin.000001 25440 Write_rows 1 25474 table_id: # flags: STMT_END_F -master-bin.000001 25474 Table_map 1 25515 table_id: # (test.t1) -master-bin.000001 25515 Write_rows 1 25549 table_id: # flags: STMT_END_F -master-bin.000001 25549 Table_map 1 25590 table_id: # (test.t1) -master-bin.000001 25590 Write_rows 1 25624 table_id: # flags: STMT_END_F -master-bin.000001 25624 Table_map 1 25665 table_id: # (test.t1) -master-bin.000001 25665 Write_rows 1 25699 table_id: # flags: STMT_END_F -master-bin.000001 25699 Table_map 1 25740 table_id: # (test.t1) -master-bin.000001 25740 Write_rows 1 25774 table_id: # flags: STMT_END_F -master-bin.000001 25774 Table_map 1 25815 table_id: # (test.t1) -master-bin.000001 25815 Write_rows 1 25849 table_id: # flags: STMT_END_F -master-bin.000001 25849 Table_map 1 25890 table_id: # (test.t1) -master-bin.000001 25890 Write_rows 1 25924 table_id: # flags: STMT_END_F -master-bin.000001 25924 Table_map 1 25965 table_id: # (test.t1) -master-bin.000001 25965 Write_rows 1 25999 table_id: # flags: STMT_END_F -master-bin.000001 25999 Table_map 1 26040 table_id: # (test.t1) -master-bin.000001 26040 Write_rows 1 26074 table_id: # flags: STMT_END_F -master-bin.000001 26074 Table_map 1 26115 table_id: # (test.t1) -master-bin.000001 26115 Write_rows 1 26149 table_id: # flags: STMT_END_F -master-bin.000001 26149 Table_map 1 26190 table_id: # (test.t1) -master-bin.000001 26190 Write_rows 1 26224 table_id: # flags: STMT_END_F -master-bin.000001 26224 Table_map 1 26265 table_id: # (test.t1) -master-bin.000001 26265 Write_rows 1 26299 table_id: # flags: STMT_END_F -master-bin.000001 26299 Table_map 1 26340 table_id: # (test.t1) -master-bin.000001 26340 Write_rows 1 26374 table_id: # flags: STMT_END_F -master-bin.000001 26374 Table_map 1 26415 table_id: # (test.t1) -master-bin.000001 26415 Write_rows 1 26449 table_id: # flags: STMT_END_F -master-bin.000001 26449 Table_map 1 26490 table_id: # (test.t1) -master-bin.000001 26490 Write_rows 1 26524 table_id: # flags: STMT_END_F -master-bin.000001 26524 Table_map 1 26565 table_id: # (test.t1) -master-bin.000001 26565 Write_rows 1 26599 table_id: # flags: STMT_END_F -master-bin.000001 26599 Table_map 1 26640 table_id: # (test.t1) -master-bin.000001 26640 Write_rows 1 26674 table_id: # flags: STMT_END_F -master-bin.000001 26674 Table_map 1 26715 table_id: # (test.t1) -master-bin.000001 26715 Write_rows 1 26749 table_id: # flags: STMT_END_F -master-bin.000001 26749 Table_map 1 26790 table_id: # (test.t1) -master-bin.000001 26790 Write_rows 1 26824 table_id: # flags: STMT_END_F -master-bin.000001 26824 Table_map 1 26865 table_id: # (test.t1) -master-bin.000001 26865 Write_rows 1 26899 table_id: # flags: STMT_END_F -master-bin.000001 26899 Table_map 1 26940 table_id: # (test.t1) -master-bin.000001 26940 Write_rows 1 26974 table_id: # flags: STMT_END_F -master-bin.000001 26974 Table_map 1 27015 table_id: # (test.t1) -master-bin.000001 27015 Write_rows 1 27049 table_id: # flags: STMT_END_F -master-bin.000001 27049 Table_map 1 27090 table_id: # (test.t1) -master-bin.000001 27090 Write_rows 1 27124 table_id: # flags: STMT_END_F -master-bin.000001 27124 Table_map 1 27165 table_id: # (test.t1) -master-bin.000001 27165 Write_rows 1 27199 table_id: # flags: STMT_END_F -master-bin.000001 27199 Table_map 1 27240 table_id: # (test.t1) -master-bin.000001 27240 Write_rows 1 27274 table_id: # flags: STMT_END_F -master-bin.000001 27274 Table_map 1 27315 table_id: # (test.t1) -master-bin.000001 27315 Write_rows 1 27349 table_id: # flags: STMT_END_F -master-bin.000001 27349 Table_map 1 27390 table_id: # (test.t1) -master-bin.000001 27390 Write_rows 1 27424 table_id: # flags: STMT_END_F -master-bin.000001 27424 Table_map 1 27465 table_id: # (test.t1) -master-bin.000001 27465 Write_rows 1 27499 table_id: # flags: STMT_END_F -master-bin.000001 27499 Table_map 1 27540 table_id: # (test.t1) -master-bin.000001 27540 Write_rows 1 27574 table_id: # flags: STMT_END_F -master-bin.000001 27574 Table_map 1 27615 table_id: # (test.t1) -master-bin.000001 27615 Write_rows 1 27649 table_id: # flags: STMT_END_F -master-bin.000001 27649 Table_map 1 27690 table_id: # (test.t1) -master-bin.000001 27690 Write_rows 1 27724 table_id: # flags: STMT_END_F -master-bin.000001 27724 Table_map 1 27765 table_id: # (test.t1) -master-bin.000001 27765 Write_rows 1 27799 table_id: # flags: STMT_END_F -master-bin.000001 27799 Table_map 1 27840 table_id: # (test.t1) -master-bin.000001 27840 Write_rows 1 27874 table_id: # flags: STMT_END_F -master-bin.000001 27874 Table_map 1 27915 table_id: # (test.t1) -master-bin.000001 27915 Write_rows 1 27949 table_id: # flags: STMT_END_F -master-bin.000001 27949 Table_map 1 27990 table_id: # (test.t1) -master-bin.000001 27990 Write_rows 1 28024 table_id: # flags: STMT_END_F -master-bin.000001 28024 Table_map 1 28065 table_id: # (test.t1) -master-bin.000001 28065 Write_rows 1 28099 table_id: # flags: STMT_END_F -master-bin.000001 28099 Table_map 1 28140 table_id: # (test.t1) -master-bin.000001 28140 Write_rows 1 28174 table_id: # flags: STMT_END_F -master-bin.000001 28174 Table_map 1 28215 table_id: # (test.t1) -master-bin.000001 28215 Write_rows 1 28249 table_id: # flags: STMT_END_F -master-bin.000001 28249 Table_map 1 28290 table_id: # (test.t1) -master-bin.000001 28290 Write_rows 1 28324 table_id: # flags: STMT_END_F -master-bin.000001 28324 Table_map 1 28365 table_id: # (test.t1) -master-bin.000001 28365 Write_rows 1 28399 table_id: # flags: STMT_END_F -master-bin.000001 28399 Table_map 1 28440 table_id: # (test.t1) -master-bin.000001 28440 Write_rows 1 28474 table_id: # flags: STMT_END_F -master-bin.000001 28474 Table_map 1 28515 table_id: # (test.t1) -master-bin.000001 28515 Write_rows 1 28549 table_id: # flags: STMT_END_F -master-bin.000001 28549 Table_map 1 28590 table_id: # (test.t1) -master-bin.000001 28590 Write_rows 1 28624 table_id: # flags: STMT_END_F -master-bin.000001 28624 Table_map 1 28665 table_id: # (test.t1) -master-bin.000001 28665 Write_rows 1 28699 table_id: # flags: STMT_END_F -master-bin.000001 28699 Table_map 1 28740 table_id: # (test.t1) -master-bin.000001 28740 Write_rows 1 28774 table_id: # flags: STMT_END_F -master-bin.000001 28774 Table_map 1 28815 table_id: # (test.t1) -master-bin.000001 28815 Write_rows 1 28849 table_id: # flags: STMT_END_F -master-bin.000001 28849 Table_map 1 28890 table_id: # (test.t1) -master-bin.000001 28890 Write_rows 1 28924 table_id: # flags: STMT_END_F -master-bin.000001 28924 Table_map 1 28965 table_id: # (test.t1) -master-bin.000001 28965 Write_rows 1 28999 table_id: # flags: STMT_END_F -master-bin.000001 28999 Table_map 1 29040 table_id: # (test.t1) -master-bin.000001 29040 Write_rows 1 29074 table_id: # flags: STMT_END_F -master-bin.000001 29074 Table_map 1 29115 table_id: # (test.t1) -master-bin.000001 29115 Write_rows 1 29149 table_id: # flags: STMT_END_F -master-bin.000001 29149 Table_map 1 29190 table_id: # (test.t1) -master-bin.000001 29190 Write_rows 1 29224 table_id: # flags: STMT_END_F -master-bin.000001 29224 Table_map 1 29265 table_id: # (test.t1) -master-bin.000001 29265 Write_rows 1 29299 table_id: # flags: STMT_END_F -master-bin.000001 29299 Table_map 1 29340 table_id: # (test.t1) -master-bin.000001 29340 Write_rows 1 29374 table_id: # flags: STMT_END_F -master-bin.000001 29374 Table_map 1 29415 table_id: # (test.t1) -master-bin.000001 29415 Write_rows 1 29449 table_id: # flags: STMT_END_F -master-bin.000001 29449 Table_map 1 29490 table_id: # (test.t1) -master-bin.000001 29490 Write_rows 1 29524 table_id: # flags: STMT_END_F -master-bin.000001 29524 Table_map 1 29565 table_id: # (test.t1) -master-bin.000001 29565 Write_rows 1 29599 table_id: # flags: STMT_END_F -master-bin.000001 29599 Table_map 1 29640 table_id: # (test.t1) -master-bin.000001 29640 Write_rows 1 29674 table_id: # flags: STMT_END_F -master-bin.000001 29674 Table_map 1 29715 table_id: # (test.t1) -master-bin.000001 29715 Write_rows 1 29749 table_id: # flags: STMT_END_F -master-bin.000001 29749 Table_map 1 29790 table_id: # (test.t1) -master-bin.000001 29790 Write_rows 1 29824 table_id: # flags: STMT_END_F -master-bin.000001 29824 Table_map 1 29865 table_id: # (test.t1) -master-bin.000001 29865 Write_rows 1 29899 table_id: # flags: STMT_END_F -master-bin.000001 29899 Table_map 1 29940 table_id: # (test.t1) -master-bin.000001 29940 Write_rows 1 29974 table_id: # flags: STMT_END_F -master-bin.000001 29974 Table_map 1 30015 table_id: # (test.t1) -master-bin.000001 30015 Write_rows 1 30049 table_id: # flags: STMT_END_F -master-bin.000001 30049 Table_map 1 30090 table_id: # (test.t1) -master-bin.000001 30090 Write_rows 1 30124 table_id: # flags: STMT_END_F -master-bin.000001 30124 Table_map 1 30165 table_id: # (test.t1) -master-bin.000001 30165 Write_rows 1 30199 table_id: # flags: STMT_END_F -master-bin.000001 30199 Table_map 1 30240 table_id: # (test.t1) -master-bin.000001 30240 Write_rows 1 30274 table_id: # flags: STMT_END_F -master-bin.000001 30274 Xid 1 30301 COMMIT /* XID */ -master-bin.000001 30301 Rotate 1 30345 master-bin.000002;pos=4 +master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=4 drop table t1; set global binlog_cache_size=@bcs; set session autocommit = @ac; @@ -1081,15 +1079,14 @@ set @b= 14632475938453979136; execute stmt using @a, @b; deallocate prepare stmt; drop table t1; -show binlog events from 0; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned) -master-bin.000001 227 Query 1 295 BEGIN -master-bin.000001 295 Table_map 1 337 table_id: # (test.t1) -master-bin.000001 337 Write_rows 1 383 table_id: # flags: STMT_END_F -master-bin.000001 383 Query 1 452 COMMIT -master-bin.000001 452 Query 1 528 use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; drop table t1 reset master; CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE bug39182; @@ -1289,14 +1286,14 @@ drop table if exists t3; create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 346 +master-bin.000001 # insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); -show master status /* must show new binlog index after rotating */; +show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000002 106 +master-bin.000002 # drop table t3; # # Bug #45998: database crashes when running "create as select" diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index eebcfceaa25..f5ba4524c61 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -2,13 +2,12 @@ create table t1 (a int, b int) engine=innodb; begin; insert into t1 values (1,2); commit; -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: #, Binlog ver: # -master-bin.000001 106 Query 1 213 use `test`; create table t1 (a int, b int) engine=innodb -master-bin.000001 213 Query 1 281 BEGIN -master-bin.000001 281 Query 1 371 use `test`; insert into t1 values (1,2) -master-bin.000001 371 Xid 1 398 COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; create table t1 (a int, b int) engine=innodb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values (1,2) +master-bin.000001 # Xid # # COMMIT /* XID */ drop table t1; drop table if exists t1, t2; reset master; @@ -36,115 +35,115 @@ create table t1 (n int) engine=innodb; begin; commit; drop table t1; -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(100 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(99 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(98 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(97 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(96 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(95 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(94 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(93 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(92 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(91 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(90 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(89 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(88 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(87 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(86 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(85 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(84 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(83 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(82 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(81 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(80 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(79 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(78 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(77 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(76 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(75 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(74 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(73 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(72 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(71 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(70 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(69 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(68 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(67 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(66 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(65 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(64 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(63 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(62 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(61 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(60 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(59 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(58 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(57 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(56 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(55 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(54 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(53 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(52 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(51 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(50 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(49 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(48 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(47 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(46 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(45 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(44 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(43 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(42 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(41 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(40 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(39 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(38 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(37 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(36 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(35 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(34 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(33 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(32 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(31 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(30 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(29 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(28 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(27 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(26 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(25 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(24 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(23 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(22 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(21 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(20 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(19 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(18 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(17 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(16 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(15 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(14 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(13 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(12 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(11 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(10 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(9 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(8 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(7 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(6 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(5 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(4 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002' from 106; +master-bin.000001 # Query # # use `test`; create table t1 (n int) engine=innodb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(100 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(99 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(98 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(97 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(96 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(95 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(94 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(93 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(92 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(91 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(90 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(89 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(88 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(87 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(86 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(85 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(84 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(83 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(82 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(81 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(80 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(79 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(78 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(77 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(76 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(75 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(74 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(73 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(72 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(71 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(70 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(69 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(68 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(67 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(66 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(65 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(64 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(63 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(62 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(61 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(60 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(59 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(58 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(57 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(56 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(55 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(54 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(53 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(52 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(51 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(50 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(49 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(48 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(47 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(46 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(45 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(44 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(43 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(42 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(41 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(40 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(39 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(38 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(37 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(36 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(35 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(34 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(33 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(32 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(31 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(30 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(29 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(28 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(27 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(26 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(25 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(24 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(23 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(22 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(21 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(20 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(19 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(18 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(17 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(16 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(15 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(14 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(13 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(12 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(11 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(10 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(9 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(8 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(7 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(6 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(5 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(4 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(3 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(2 + 4) +master-bin.000001 # Query # # use `test`; insert into t1 values(1 + 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=4 +show binlog events in 'master-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query 1 # use `test`; drop table t1 +master-bin.000002 # Query # # use `test`; drop table t1 set @ac = @@autocommit; set autocommit= 0; reset master; @@ -155,427 +154,425 @@ insert into t1 values (2); insert into t1 values (3); commit; drop table t1; -show binlog events from 0; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb -master-bin.000001 205 Query 1 273 BEGIN -master-bin.000001 273 Query 1 361 use `test`; insert into t1 values (1) -master-bin.000001 361 Query 1 449 use `test`; insert into t1 values (2) -master-bin.000001 449 Query 1 537 use `test`; insert into t1 values (3) -master-bin.000001 537 Xid 1 564 COMMIT /* XID */ -master-bin.000001 564 Query 1 640 use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1(n int) engine=innodb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Query # # use `test`; insert into t1 values (2) +master-bin.000001 # Query # # use `test`; insert into t1 values (3) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; drop table t1 set @bcs = @@binlog_cache_size; set global binlog_cache_size=4096; reset master; create table t1 (a int) engine=innodb; -show binlog events from 0; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb -master-bin.000001 206 Query 1 274 BEGIN -master-bin.000001 274 Query 1 365 use `test`; insert into t1 values( 400 ) -master-bin.000001 365 Query 1 456 use `test`; insert into t1 values( 399 ) -master-bin.000001 456 Query 1 547 use `test`; insert into t1 values( 398 ) -master-bin.000001 547 Query 1 638 use `test`; insert into t1 values( 397 ) -master-bin.000001 638 Query 1 729 use `test`; insert into t1 values( 396 ) -master-bin.000001 729 Query 1 820 use `test`; insert into t1 values( 395 ) -master-bin.000001 820 Query 1 911 use `test`; insert into t1 values( 394 ) -master-bin.000001 911 Query 1 1002 use `test`; insert into t1 values( 393 ) -master-bin.000001 1002 Query 1 1093 use `test`; insert into t1 values( 392 ) -master-bin.000001 1093 Query 1 1184 use `test`; insert into t1 values( 391 ) -master-bin.000001 1184 Query 1 1275 use `test`; insert into t1 values( 390 ) -master-bin.000001 1275 Query 1 1366 use `test`; insert into t1 values( 389 ) -master-bin.000001 1366 Query 1 1457 use `test`; insert into t1 values( 388 ) -master-bin.000001 1457 Query 1 1548 use `test`; insert into t1 values( 387 ) -master-bin.000001 1548 Query 1 1639 use `test`; insert into t1 values( 386 ) -master-bin.000001 1639 Query 1 1730 use `test`; insert into t1 values( 385 ) -master-bin.000001 1730 Query 1 1821 use `test`; insert into t1 values( 384 ) -master-bin.000001 1821 Query 1 1912 use `test`; insert into t1 values( 383 ) -master-bin.000001 1912 Query 1 2003 use `test`; insert into t1 values( 382 ) -master-bin.000001 2003 Query 1 2094 use `test`; insert into t1 values( 381 ) -master-bin.000001 2094 Query 1 2185 use `test`; insert into t1 values( 380 ) -master-bin.000001 2185 Query 1 2276 use `test`; insert into t1 values( 379 ) -master-bin.000001 2276 Query 1 2367 use `test`; insert into t1 values( 378 ) -master-bin.000001 2367 Query 1 2458 use `test`; insert into t1 values( 377 ) -master-bin.000001 2458 Query 1 2549 use `test`; insert into t1 values( 376 ) -master-bin.000001 2549 Query 1 2640 use `test`; insert into t1 values( 375 ) -master-bin.000001 2640 Query 1 2731 use `test`; insert into t1 values( 374 ) -master-bin.000001 2731 Query 1 2822 use `test`; insert into t1 values( 373 ) -master-bin.000001 2822 Query 1 2913 use `test`; insert into t1 values( 372 ) -master-bin.000001 2913 Query 1 3004 use `test`; insert into t1 values( 371 ) -master-bin.000001 3004 Query 1 3095 use `test`; insert into t1 values( 370 ) -master-bin.000001 3095 Query 1 3186 use `test`; insert into t1 values( 369 ) -master-bin.000001 3186 Query 1 3277 use `test`; insert into t1 values( 368 ) -master-bin.000001 3277 Query 1 3368 use `test`; insert into t1 values( 367 ) -master-bin.000001 3368 Query 1 3459 use `test`; insert into t1 values( 366 ) -master-bin.000001 3459 Query 1 3550 use `test`; insert into t1 values( 365 ) -master-bin.000001 3550 Query 1 3641 use `test`; insert into t1 values( 364 ) -master-bin.000001 3641 Query 1 3732 use `test`; insert into t1 values( 363 ) -master-bin.000001 3732 Query 1 3823 use `test`; insert into t1 values( 362 ) -master-bin.000001 3823 Query 1 3914 use `test`; insert into t1 values( 361 ) -master-bin.000001 3914 Query 1 4005 use `test`; insert into t1 values( 360 ) -master-bin.000001 4005 Query 1 4096 use `test`; insert into t1 values( 359 ) -master-bin.000001 4096 Query 1 4187 use `test`; insert into t1 values( 358 ) -master-bin.000001 4187 Query 1 4278 use `test`; insert into t1 values( 357 ) -master-bin.000001 4278 Query 1 4369 use `test`; insert into t1 values( 356 ) -master-bin.000001 4369 Query 1 4460 use `test`; insert into t1 values( 355 ) -master-bin.000001 4460 Query 1 4551 use `test`; insert into t1 values( 354 ) -master-bin.000001 4551 Query 1 4642 use `test`; insert into t1 values( 353 ) -master-bin.000001 4642 Query 1 4733 use `test`; insert into t1 values( 352 ) -master-bin.000001 4733 Query 1 4824 use `test`; insert into t1 values( 351 ) -master-bin.000001 4824 Query 1 4915 use `test`; insert into t1 values( 350 ) -master-bin.000001 4915 Query 1 5006 use `test`; insert into t1 values( 349 ) -master-bin.000001 5006 Query 1 5097 use `test`; insert into t1 values( 348 ) -master-bin.000001 5097 Query 1 5188 use `test`; insert into t1 values( 347 ) -master-bin.000001 5188 Query 1 5279 use `test`; insert into t1 values( 346 ) -master-bin.000001 5279 Query 1 5370 use `test`; insert into t1 values( 345 ) -master-bin.000001 5370 Query 1 5461 use `test`; insert into t1 values( 344 ) -master-bin.000001 5461 Query 1 5552 use `test`; insert into t1 values( 343 ) -master-bin.000001 5552 Query 1 5643 use `test`; insert into t1 values( 342 ) -master-bin.000001 5643 Query 1 5734 use `test`; insert into t1 values( 341 ) -master-bin.000001 5734 Query 1 5825 use `test`; insert into t1 values( 340 ) -master-bin.000001 5825 Query 1 5916 use `test`; insert into t1 values( 339 ) -master-bin.000001 5916 Query 1 6007 use `test`; insert into t1 values( 338 ) -master-bin.000001 6007 Query 1 6098 use `test`; insert into t1 values( 337 ) -master-bin.000001 6098 Query 1 6189 use `test`; insert into t1 values( 336 ) -master-bin.000001 6189 Query 1 6280 use `test`; insert into t1 values( 335 ) -master-bin.000001 6280 Query 1 6371 use `test`; insert into t1 values( 334 ) -master-bin.000001 6371 Query 1 6462 use `test`; insert into t1 values( 333 ) -master-bin.000001 6462 Query 1 6553 use `test`; insert into t1 values( 332 ) -master-bin.000001 6553 Query 1 6644 use `test`; insert into t1 values( 331 ) -master-bin.000001 6644 Query 1 6735 use `test`; insert into t1 values( 330 ) -master-bin.000001 6735 Query 1 6826 use `test`; insert into t1 values( 329 ) -master-bin.000001 6826 Query 1 6917 use `test`; insert into t1 values( 328 ) -master-bin.000001 6917 Query 1 7008 use `test`; insert into t1 values( 327 ) -master-bin.000001 7008 Query 1 7099 use `test`; insert into t1 values( 326 ) -master-bin.000001 7099 Query 1 7190 use `test`; insert into t1 values( 325 ) -master-bin.000001 7190 Query 1 7281 use `test`; insert into t1 values( 324 ) -master-bin.000001 7281 Query 1 7372 use `test`; insert into t1 values( 323 ) -master-bin.000001 7372 Query 1 7463 use `test`; insert into t1 values( 322 ) -master-bin.000001 7463 Query 1 7554 use `test`; insert into t1 values( 321 ) -master-bin.000001 7554 Query 1 7645 use `test`; insert into t1 values( 320 ) -master-bin.000001 7645 Query 1 7736 use `test`; insert into t1 values( 319 ) -master-bin.000001 7736 Query 1 7827 use `test`; insert into t1 values( 318 ) -master-bin.000001 7827 Query 1 7918 use `test`; insert into t1 values( 317 ) -master-bin.000001 7918 Query 1 8009 use `test`; insert into t1 values( 316 ) -master-bin.000001 8009 Query 1 8100 use `test`; insert into t1 values( 315 ) -master-bin.000001 8100 Query 1 8191 use `test`; insert into t1 values( 314 ) -master-bin.000001 8191 Query 1 8282 use `test`; insert into t1 values( 313 ) -master-bin.000001 8282 Query 1 8373 use `test`; insert into t1 values( 312 ) -master-bin.000001 8373 Query 1 8464 use `test`; insert into t1 values( 311 ) -master-bin.000001 8464 Query 1 8555 use `test`; insert into t1 values( 310 ) -master-bin.000001 8555 Query 1 8646 use `test`; insert into t1 values( 309 ) -master-bin.000001 8646 Query 1 8737 use `test`; insert into t1 values( 308 ) -master-bin.000001 8737 Query 1 8828 use `test`; insert into t1 values( 307 ) -master-bin.000001 8828 Query 1 8919 use `test`; insert into t1 values( 306 ) -master-bin.000001 8919 Query 1 9010 use `test`; insert into t1 values( 305 ) -master-bin.000001 9010 Query 1 9101 use `test`; insert into t1 values( 304 ) -master-bin.000001 9101 Query 1 9192 use `test`; insert into t1 values( 303 ) -master-bin.000001 9192 Query 1 9283 use `test`; insert into t1 values( 302 ) -master-bin.000001 9283 Query 1 9374 use `test`; insert into t1 values( 301 ) -master-bin.000001 9374 Query 1 9465 use `test`; insert into t1 values( 300 ) -master-bin.000001 9465 Query 1 9556 use `test`; insert into t1 values( 299 ) -master-bin.000001 9556 Query 1 9647 use `test`; insert into t1 values( 298 ) -master-bin.000001 9647 Query 1 9738 use `test`; insert into t1 values( 297 ) -master-bin.000001 9738 Query 1 9829 use `test`; insert into t1 values( 296 ) -master-bin.000001 9829 Query 1 9920 use `test`; insert into t1 values( 295 ) -master-bin.000001 9920 Query 1 10011 use `test`; insert into t1 values( 294 ) -master-bin.000001 10011 Query 1 10102 use `test`; insert into t1 values( 293 ) -master-bin.000001 10102 Query 1 10193 use `test`; insert into t1 values( 292 ) -master-bin.000001 10193 Query 1 10284 use `test`; insert into t1 values( 291 ) -master-bin.000001 10284 Query 1 10375 use `test`; insert into t1 values( 290 ) -master-bin.000001 10375 Query 1 10466 use `test`; insert into t1 values( 289 ) -master-bin.000001 10466 Query 1 10557 use `test`; insert into t1 values( 288 ) -master-bin.000001 10557 Query 1 10648 use `test`; insert into t1 values( 287 ) -master-bin.000001 10648 Query 1 10739 use `test`; insert into t1 values( 286 ) -master-bin.000001 10739 Query 1 10830 use `test`; insert into t1 values( 285 ) -master-bin.000001 10830 Query 1 10921 use `test`; insert into t1 values( 284 ) -master-bin.000001 10921 Query 1 11012 use `test`; insert into t1 values( 283 ) -master-bin.000001 11012 Query 1 11103 use `test`; insert into t1 values( 282 ) -master-bin.000001 11103 Query 1 11194 use `test`; insert into t1 values( 281 ) -master-bin.000001 11194 Query 1 11285 use `test`; insert into t1 values( 280 ) -master-bin.000001 11285 Query 1 11376 use `test`; insert into t1 values( 279 ) -master-bin.000001 11376 Query 1 11467 use `test`; insert into t1 values( 278 ) -master-bin.000001 11467 Query 1 11558 use `test`; insert into t1 values( 277 ) -master-bin.000001 11558 Query 1 11649 use `test`; insert into t1 values( 276 ) -master-bin.000001 11649 Query 1 11740 use `test`; insert into t1 values( 275 ) -master-bin.000001 11740 Query 1 11831 use `test`; insert into t1 values( 274 ) -master-bin.000001 11831 Query 1 11922 use `test`; insert into t1 values( 273 ) -master-bin.000001 11922 Query 1 12013 use `test`; insert into t1 values( 272 ) -master-bin.000001 12013 Query 1 12104 use `test`; insert into t1 values( 271 ) -master-bin.000001 12104 Query 1 12195 use `test`; insert into t1 values( 270 ) -master-bin.000001 12195 Query 1 12286 use `test`; insert into t1 values( 269 ) -master-bin.000001 12286 Query 1 12377 use `test`; insert into t1 values( 268 ) -master-bin.000001 12377 Query 1 12468 use `test`; insert into t1 values( 267 ) -master-bin.000001 12468 Query 1 12559 use `test`; insert into t1 values( 266 ) -master-bin.000001 12559 Query 1 12650 use `test`; insert into t1 values( 265 ) -master-bin.000001 12650 Query 1 12741 use `test`; insert into t1 values( 264 ) -master-bin.000001 12741 Query 1 12832 use `test`; insert into t1 values( 263 ) -master-bin.000001 12832 Query 1 12923 use `test`; insert into t1 values( 262 ) -master-bin.000001 12923 Query 1 13014 use `test`; insert into t1 values( 261 ) -master-bin.000001 13014 Query 1 13105 use `test`; insert into t1 values( 260 ) -master-bin.000001 13105 Query 1 13196 use `test`; insert into t1 values( 259 ) -master-bin.000001 13196 Query 1 13287 use `test`; insert into t1 values( 258 ) -master-bin.000001 13287 Query 1 13378 use `test`; insert into t1 values( 257 ) -master-bin.000001 13378 Query 1 13469 use `test`; insert into t1 values( 256 ) -master-bin.000001 13469 Query 1 13560 use `test`; insert into t1 values( 255 ) -master-bin.000001 13560 Query 1 13651 use `test`; insert into t1 values( 254 ) -master-bin.000001 13651 Query 1 13742 use `test`; insert into t1 values( 253 ) -master-bin.000001 13742 Query 1 13833 use `test`; insert into t1 values( 252 ) -master-bin.000001 13833 Query 1 13924 use `test`; insert into t1 values( 251 ) -master-bin.000001 13924 Query 1 14015 use `test`; insert into t1 values( 250 ) -master-bin.000001 14015 Query 1 14106 use `test`; insert into t1 values( 249 ) -master-bin.000001 14106 Query 1 14197 use `test`; insert into t1 values( 248 ) -master-bin.000001 14197 Query 1 14288 use `test`; insert into t1 values( 247 ) -master-bin.000001 14288 Query 1 14379 use `test`; insert into t1 values( 246 ) -master-bin.000001 14379 Query 1 14470 use `test`; insert into t1 values( 245 ) -master-bin.000001 14470 Query 1 14561 use `test`; insert into t1 values( 244 ) -master-bin.000001 14561 Query 1 14652 use `test`; insert into t1 values( 243 ) -master-bin.000001 14652 Query 1 14743 use `test`; insert into t1 values( 242 ) -master-bin.000001 14743 Query 1 14834 use `test`; insert into t1 values( 241 ) -master-bin.000001 14834 Query 1 14925 use `test`; insert into t1 values( 240 ) -master-bin.000001 14925 Query 1 15016 use `test`; insert into t1 values( 239 ) -master-bin.000001 15016 Query 1 15107 use `test`; insert into t1 values( 238 ) -master-bin.000001 15107 Query 1 15198 use `test`; insert into t1 values( 237 ) -master-bin.000001 15198 Query 1 15289 use `test`; insert into t1 values( 236 ) -master-bin.000001 15289 Query 1 15380 use `test`; insert into t1 values( 235 ) -master-bin.000001 15380 Query 1 15471 use `test`; insert into t1 values( 234 ) -master-bin.000001 15471 Query 1 15562 use `test`; insert into t1 values( 233 ) -master-bin.000001 15562 Query 1 15653 use `test`; insert into t1 values( 232 ) -master-bin.000001 15653 Query 1 15744 use `test`; insert into t1 values( 231 ) -master-bin.000001 15744 Query 1 15835 use `test`; insert into t1 values( 230 ) -master-bin.000001 15835 Query 1 15926 use `test`; insert into t1 values( 229 ) -master-bin.000001 15926 Query 1 16017 use `test`; insert into t1 values( 228 ) -master-bin.000001 16017 Query 1 16108 use `test`; insert into t1 values( 227 ) -master-bin.000001 16108 Query 1 16199 use `test`; insert into t1 values( 226 ) -master-bin.000001 16199 Query 1 16290 use `test`; insert into t1 values( 225 ) -master-bin.000001 16290 Query 1 16381 use `test`; insert into t1 values( 224 ) -master-bin.000001 16381 Query 1 16472 use `test`; insert into t1 values( 223 ) -master-bin.000001 16472 Query 1 16563 use `test`; insert into t1 values( 222 ) -master-bin.000001 16563 Query 1 16654 use `test`; insert into t1 values( 221 ) -master-bin.000001 16654 Query 1 16745 use `test`; insert into t1 values( 220 ) -master-bin.000001 16745 Query 1 16836 use `test`; insert into t1 values( 219 ) -master-bin.000001 16836 Query 1 16927 use `test`; insert into t1 values( 218 ) -master-bin.000001 16927 Query 1 17018 use `test`; insert into t1 values( 217 ) -master-bin.000001 17018 Query 1 17109 use `test`; insert into t1 values( 216 ) -master-bin.000001 17109 Query 1 17200 use `test`; insert into t1 values( 215 ) -master-bin.000001 17200 Query 1 17291 use `test`; insert into t1 values( 214 ) -master-bin.000001 17291 Query 1 17382 use `test`; insert into t1 values( 213 ) -master-bin.000001 17382 Query 1 17473 use `test`; insert into t1 values( 212 ) -master-bin.000001 17473 Query 1 17564 use `test`; insert into t1 values( 211 ) -master-bin.000001 17564 Query 1 17655 use `test`; insert into t1 values( 210 ) -master-bin.000001 17655 Query 1 17746 use `test`; insert into t1 values( 209 ) -master-bin.000001 17746 Query 1 17837 use `test`; insert into t1 values( 208 ) -master-bin.000001 17837 Query 1 17928 use `test`; insert into t1 values( 207 ) -master-bin.000001 17928 Query 1 18019 use `test`; insert into t1 values( 206 ) -master-bin.000001 18019 Query 1 18110 use `test`; insert into t1 values( 205 ) -master-bin.000001 18110 Query 1 18201 use `test`; insert into t1 values( 204 ) -master-bin.000001 18201 Query 1 18292 use `test`; insert into t1 values( 203 ) -master-bin.000001 18292 Query 1 18383 use `test`; insert into t1 values( 202 ) -master-bin.000001 18383 Query 1 18474 use `test`; insert into t1 values( 201 ) -master-bin.000001 18474 Query 1 18565 use `test`; insert into t1 values( 200 ) -master-bin.000001 18565 Query 1 18656 use `test`; insert into t1 values( 199 ) -master-bin.000001 18656 Query 1 18747 use `test`; insert into t1 values( 198 ) -master-bin.000001 18747 Query 1 18838 use `test`; insert into t1 values( 197 ) -master-bin.000001 18838 Query 1 18929 use `test`; insert into t1 values( 196 ) -master-bin.000001 18929 Query 1 19020 use `test`; insert into t1 values( 195 ) -master-bin.000001 19020 Query 1 19111 use `test`; insert into t1 values( 194 ) -master-bin.000001 19111 Query 1 19202 use `test`; insert into t1 values( 193 ) -master-bin.000001 19202 Query 1 19293 use `test`; insert into t1 values( 192 ) -master-bin.000001 19293 Query 1 19384 use `test`; insert into t1 values( 191 ) -master-bin.000001 19384 Query 1 19475 use `test`; insert into t1 values( 190 ) -master-bin.000001 19475 Query 1 19566 use `test`; insert into t1 values( 189 ) -master-bin.000001 19566 Query 1 19657 use `test`; insert into t1 values( 188 ) -master-bin.000001 19657 Query 1 19748 use `test`; insert into t1 values( 187 ) -master-bin.000001 19748 Query 1 19839 use `test`; insert into t1 values( 186 ) -master-bin.000001 19839 Query 1 19930 use `test`; insert into t1 values( 185 ) -master-bin.000001 19930 Query 1 20021 use `test`; insert into t1 values( 184 ) -master-bin.000001 20021 Query 1 20112 use `test`; insert into t1 values( 183 ) -master-bin.000001 20112 Query 1 20203 use `test`; insert into t1 values( 182 ) -master-bin.000001 20203 Query 1 20294 use `test`; insert into t1 values( 181 ) -master-bin.000001 20294 Query 1 20385 use `test`; insert into t1 values( 180 ) -master-bin.000001 20385 Query 1 20476 use `test`; insert into t1 values( 179 ) -master-bin.000001 20476 Query 1 20567 use `test`; insert into t1 values( 178 ) -master-bin.000001 20567 Query 1 20658 use `test`; insert into t1 values( 177 ) -master-bin.000001 20658 Query 1 20749 use `test`; insert into t1 values( 176 ) -master-bin.000001 20749 Query 1 20840 use `test`; insert into t1 values( 175 ) -master-bin.000001 20840 Query 1 20931 use `test`; insert into t1 values( 174 ) -master-bin.000001 20931 Query 1 21022 use `test`; insert into t1 values( 173 ) -master-bin.000001 21022 Query 1 21113 use `test`; insert into t1 values( 172 ) -master-bin.000001 21113 Query 1 21204 use `test`; insert into t1 values( 171 ) -master-bin.000001 21204 Query 1 21295 use `test`; insert into t1 values( 170 ) -master-bin.000001 21295 Query 1 21386 use `test`; insert into t1 values( 169 ) -master-bin.000001 21386 Query 1 21477 use `test`; insert into t1 values( 168 ) -master-bin.000001 21477 Query 1 21568 use `test`; insert into t1 values( 167 ) -master-bin.000001 21568 Query 1 21659 use `test`; insert into t1 values( 166 ) -master-bin.000001 21659 Query 1 21750 use `test`; insert into t1 values( 165 ) -master-bin.000001 21750 Query 1 21841 use `test`; insert into t1 values( 164 ) -master-bin.000001 21841 Query 1 21932 use `test`; insert into t1 values( 163 ) -master-bin.000001 21932 Query 1 22023 use `test`; insert into t1 values( 162 ) -master-bin.000001 22023 Query 1 22114 use `test`; insert into t1 values( 161 ) -master-bin.000001 22114 Query 1 22205 use `test`; insert into t1 values( 160 ) -master-bin.000001 22205 Query 1 22296 use `test`; insert into t1 values( 159 ) -master-bin.000001 22296 Query 1 22387 use `test`; insert into t1 values( 158 ) -master-bin.000001 22387 Query 1 22478 use `test`; insert into t1 values( 157 ) -master-bin.000001 22478 Query 1 22569 use `test`; insert into t1 values( 156 ) -master-bin.000001 22569 Query 1 22660 use `test`; insert into t1 values( 155 ) -master-bin.000001 22660 Query 1 22751 use `test`; insert into t1 values( 154 ) -master-bin.000001 22751 Query 1 22842 use `test`; insert into t1 values( 153 ) -master-bin.000001 22842 Query 1 22933 use `test`; insert into t1 values( 152 ) -master-bin.000001 22933 Query 1 23024 use `test`; insert into t1 values( 151 ) -master-bin.000001 23024 Query 1 23115 use `test`; insert into t1 values( 150 ) -master-bin.000001 23115 Query 1 23206 use `test`; insert into t1 values( 149 ) -master-bin.000001 23206 Query 1 23297 use `test`; insert into t1 values( 148 ) -master-bin.000001 23297 Query 1 23388 use `test`; insert into t1 values( 147 ) -master-bin.000001 23388 Query 1 23479 use `test`; insert into t1 values( 146 ) -master-bin.000001 23479 Query 1 23570 use `test`; insert into t1 values( 145 ) -master-bin.000001 23570 Query 1 23661 use `test`; insert into t1 values( 144 ) -master-bin.000001 23661 Query 1 23752 use `test`; insert into t1 values( 143 ) -master-bin.000001 23752 Query 1 23843 use `test`; insert into t1 values( 142 ) -master-bin.000001 23843 Query 1 23934 use `test`; insert into t1 values( 141 ) -master-bin.000001 23934 Query 1 24025 use `test`; insert into t1 values( 140 ) -master-bin.000001 24025 Query 1 24116 use `test`; insert into t1 values( 139 ) -master-bin.000001 24116 Query 1 24207 use `test`; insert into t1 values( 138 ) -master-bin.000001 24207 Query 1 24298 use `test`; insert into t1 values( 137 ) -master-bin.000001 24298 Query 1 24389 use `test`; insert into t1 values( 136 ) -master-bin.000001 24389 Query 1 24480 use `test`; insert into t1 values( 135 ) -master-bin.000001 24480 Query 1 24571 use `test`; insert into t1 values( 134 ) -master-bin.000001 24571 Query 1 24662 use `test`; insert into t1 values( 133 ) -master-bin.000001 24662 Query 1 24753 use `test`; insert into t1 values( 132 ) -master-bin.000001 24753 Query 1 24844 use `test`; insert into t1 values( 131 ) -master-bin.000001 24844 Query 1 24935 use `test`; insert into t1 values( 130 ) -master-bin.000001 24935 Query 1 25026 use `test`; insert into t1 values( 129 ) -master-bin.000001 25026 Query 1 25117 use `test`; insert into t1 values( 128 ) -master-bin.000001 25117 Query 1 25208 use `test`; insert into t1 values( 127 ) -master-bin.000001 25208 Query 1 25299 use `test`; insert into t1 values( 126 ) -master-bin.000001 25299 Query 1 25390 use `test`; insert into t1 values( 125 ) -master-bin.000001 25390 Query 1 25481 use `test`; insert into t1 values( 124 ) -master-bin.000001 25481 Query 1 25572 use `test`; insert into t1 values( 123 ) -master-bin.000001 25572 Query 1 25663 use `test`; insert into t1 values( 122 ) -master-bin.000001 25663 Query 1 25754 use `test`; insert into t1 values( 121 ) -master-bin.000001 25754 Query 1 25845 use `test`; insert into t1 values( 120 ) -master-bin.000001 25845 Query 1 25936 use `test`; insert into t1 values( 119 ) -master-bin.000001 25936 Query 1 26027 use `test`; insert into t1 values( 118 ) -master-bin.000001 26027 Query 1 26118 use `test`; insert into t1 values( 117 ) -master-bin.000001 26118 Query 1 26209 use `test`; insert into t1 values( 116 ) -master-bin.000001 26209 Query 1 26300 use `test`; insert into t1 values( 115 ) -master-bin.000001 26300 Query 1 26391 use `test`; insert into t1 values( 114 ) -master-bin.000001 26391 Query 1 26482 use `test`; insert into t1 values( 113 ) -master-bin.000001 26482 Query 1 26573 use `test`; insert into t1 values( 112 ) -master-bin.000001 26573 Query 1 26664 use `test`; insert into t1 values( 111 ) -master-bin.000001 26664 Query 1 26755 use `test`; insert into t1 values( 110 ) -master-bin.000001 26755 Query 1 26846 use `test`; insert into t1 values( 109 ) -master-bin.000001 26846 Query 1 26937 use `test`; insert into t1 values( 108 ) -master-bin.000001 26937 Query 1 27028 use `test`; insert into t1 values( 107 ) -master-bin.000001 27028 Query 1 27119 use `test`; insert into t1 values( 106 ) -master-bin.000001 27119 Query 1 27210 use `test`; insert into t1 values( 105 ) -master-bin.000001 27210 Query 1 27301 use `test`; insert into t1 values( 104 ) -master-bin.000001 27301 Query 1 27392 use `test`; insert into t1 values( 103 ) -master-bin.000001 27392 Query 1 27483 use `test`; insert into t1 values( 102 ) -master-bin.000001 27483 Query 1 27574 use `test`; insert into t1 values( 101 ) -master-bin.000001 27574 Query 1 27665 use `test`; insert into t1 values( 100 ) -master-bin.000001 27665 Query 1 27755 use `test`; insert into t1 values( 99 ) -master-bin.000001 27755 Query 1 27845 use `test`; insert into t1 values( 98 ) -master-bin.000001 27845 Query 1 27935 use `test`; insert into t1 values( 97 ) -master-bin.000001 27935 Query 1 28025 use `test`; insert into t1 values( 96 ) -master-bin.000001 28025 Query 1 28115 use `test`; insert into t1 values( 95 ) -master-bin.000001 28115 Query 1 28205 use `test`; insert into t1 values( 94 ) -master-bin.000001 28205 Query 1 28295 use `test`; insert into t1 values( 93 ) -master-bin.000001 28295 Query 1 28385 use `test`; insert into t1 values( 92 ) -master-bin.000001 28385 Query 1 28475 use `test`; insert into t1 values( 91 ) -master-bin.000001 28475 Query 1 28565 use `test`; insert into t1 values( 90 ) -master-bin.000001 28565 Query 1 28655 use `test`; insert into t1 values( 89 ) -master-bin.000001 28655 Query 1 28745 use `test`; insert into t1 values( 88 ) -master-bin.000001 28745 Query 1 28835 use `test`; insert into t1 values( 87 ) -master-bin.000001 28835 Query 1 28925 use `test`; insert into t1 values( 86 ) -master-bin.000001 28925 Query 1 29015 use `test`; insert into t1 values( 85 ) -master-bin.000001 29015 Query 1 29105 use `test`; insert into t1 values( 84 ) -master-bin.000001 29105 Query 1 29195 use `test`; insert into t1 values( 83 ) -master-bin.000001 29195 Query 1 29285 use `test`; insert into t1 values( 82 ) -master-bin.000001 29285 Query 1 29375 use `test`; insert into t1 values( 81 ) -master-bin.000001 29375 Query 1 29465 use `test`; insert into t1 values( 80 ) -master-bin.000001 29465 Query 1 29555 use `test`; insert into t1 values( 79 ) -master-bin.000001 29555 Query 1 29645 use `test`; insert into t1 values( 78 ) -master-bin.000001 29645 Query 1 29735 use `test`; insert into t1 values( 77 ) -master-bin.000001 29735 Query 1 29825 use `test`; insert into t1 values( 76 ) -master-bin.000001 29825 Query 1 29915 use `test`; insert into t1 values( 75 ) -master-bin.000001 29915 Query 1 30005 use `test`; insert into t1 values( 74 ) -master-bin.000001 30005 Query 1 30095 use `test`; insert into t1 values( 73 ) -master-bin.000001 30095 Query 1 30185 use `test`; insert into t1 values( 72 ) -master-bin.000001 30185 Query 1 30275 use `test`; insert into t1 values( 71 ) -master-bin.000001 30275 Query 1 30365 use `test`; insert into t1 values( 70 ) -master-bin.000001 30365 Query 1 30455 use `test`; insert into t1 values( 69 ) -master-bin.000001 30455 Query 1 30545 use `test`; insert into t1 values( 68 ) -master-bin.000001 30545 Query 1 30635 use `test`; insert into t1 values( 67 ) -master-bin.000001 30635 Query 1 30725 use `test`; insert into t1 values( 66 ) -master-bin.000001 30725 Query 1 30815 use `test`; insert into t1 values( 65 ) -master-bin.000001 30815 Query 1 30905 use `test`; insert into t1 values( 64 ) -master-bin.000001 30905 Query 1 30995 use `test`; insert into t1 values( 63 ) -master-bin.000001 30995 Query 1 31085 use `test`; insert into t1 values( 62 ) -master-bin.000001 31085 Query 1 31175 use `test`; insert into t1 values( 61 ) -master-bin.000001 31175 Query 1 31265 use `test`; insert into t1 values( 60 ) -master-bin.000001 31265 Query 1 31355 use `test`; insert into t1 values( 59 ) -master-bin.000001 31355 Query 1 31445 use `test`; insert into t1 values( 58 ) -master-bin.000001 31445 Query 1 31535 use `test`; insert into t1 values( 57 ) -master-bin.000001 31535 Query 1 31625 use `test`; insert into t1 values( 56 ) -master-bin.000001 31625 Query 1 31715 use `test`; insert into t1 values( 55 ) -master-bin.000001 31715 Query 1 31805 use `test`; insert into t1 values( 54 ) -master-bin.000001 31805 Query 1 31895 use `test`; insert into t1 values( 53 ) -master-bin.000001 31895 Query 1 31985 use `test`; insert into t1 values( 52 ) -master-bin.000001 31985 Query 1 32075 use `test`; insert into t1 values( 51 ) -master-bin.000001 32075 Query 1 32165 use `test`; insert into t1 values( 50 ) -master-bin.000001 32165 Query 1 32255 use `test`; insert into t1 values( 49 ) -master-bin.000001 32255 Query 1 32345 use `test`; insert into t1 values( 48 ) -master-bin.000001 32345 Query 1 32435 use `test`; insert into t1 values( 47 ) -master-bin.000001 32435 Query 1 32525 use `test`; insert into t1 values( 46 ) -master-bin.000001 32525 Query 1 32615 use `test`; insert into t1 values( 45 ) -master-bin.000001 32615 Query 1 32705 use `test`; insert into t1 values( 44 ) -master-bin.000001 32705 Query 1 32795 use `test`; insert into t1 values( 43 ) -master-bin.000001 32795 Query 1 32885 use `test`; insert into t1 values( 42 ) -master-bin.000001 32885 Query 1 32975 use `test`; insert into t1 values( 41 ) -master-bin.000001 32975 Query 1 33065 use `test`; insert into t1 values( 40 ) -master-bin.000001 33065 Query 1 33155 use `test`; insert into t1 values( 39 ) -master-bin.000001 33155 Query 1 33245 use `test`; insert into t1 values( 38 ) -master-bin.000001 33245 Query 1 33335 use `test`; insert into t1 values( 37 ) -master-bin.000001 33335 Query 1 33425 use `test`; insert into t1 values( 36 ) -master-bin.000001 33425 Query 1 33515 use `test`; insert into t1 values( 35 ) -master-bin.000001 33515 Query 1 33605 use `test`; insert into t1 values( 34 ) -master-bin.000001 33605 Query 1 33695 use `test`; insert into t1 values( 33 ) -master-bin.000001 33695 Query 1 33785 use `test`; insert into t1 values( 32 ) -master-bin.000001 33785 Query 1 33875 use `test`; insert into t1 values( 31 ) -master-bin.000001 33875 Query 1 33965 use `test`; insert into t1 values( 30 ) -master-bin.000001 33965 Query 1 34055 use `test`; insert into t1 values( 29 ) -master-bin.000001 34055 Query 1 34145 use `test`; insert into t1 values( 28 ) -master-bin.000001 34145 Query 1 34235 use `test`; insert into t1 values( 27 ) -master-bin.000001 34235 Query 1 34325 use `test`; insert into t1 values( 26 ) -master-bin.000001 34325 Query 1 34415 use `test`; insert into t1 values( 25 ) -master-bin.000001 34415 Query 1 34505 use `test`; insert into t1 values( 24 ) -master-bin.000001 34505 Query 1 34595 use `test`; insert into t1 values( 23 ) -master-bin.000001 34595 Query 1 34685 use `test`; insert into t1 values( 22 ) -master-bin.000001 34685 Query 1 34775 use `test`; insert into t1 values( 21 ) -master-bin.000001 34775 Query 1 34865 use `test`; insert into t1 values( 20 ) -master-bin.000001 34865 Query 1 34955 use `test`; insert into t1 values( 19 ) -master-bin.000001 34955 Query 1 35045 use `test`; insert into t1 values( 18 ) -master-bin.000001 35045 Query 1 35135 use `test`; insert into t1 values( 17 ) -master-bin.000001 35135 Query 1 35225 use `test`; insert into t1 values( 16 ) -master-bin.000001 35225 Query 1 35315 use `test`; insert into t1 values( 15 ) -master-bin.000001 35315 Query 1 35405 use `test`; insert into t1 values( 14 ) -master-bin.000001 35405 Query 1 35495 use `test`; insert into t1 values( 13 ) -master-bin.000001 35495 Query 1 35585 use `test`; insert into t1 values( 12 ) -master-bin.000001 35585 Query 1 35675 use `test`; insert into t1 values( 11 ) -master-bin.000001 35675 Query 1 35765 use `test`; insert into t1 values( 10 ) -master-bin.000001 35765 Query 1 35854 use `test`; insert into t1 values( 9 ) -master-bin.000001 35854 Query 1 35943 use `test`; insert into t1 values( 8 ) -master-bin.000001 35943 Query 1 36032 use `test`; insert into t1 values( 7 ) -master-bin.000001 36032 Query 1 36121 use `test`; insert into t1 values( 6 ) -master-bin.000001 36121 Query 1 36210 use `test`; insert into t1 values( 5 ) -master-bin.000001 36210 Query 1 36299 use `test`; insert into t1 values( 4 ) -master-bin.000001 36299 Query 1 36388 use `test`; insert into t1 values( 3 ) -master-bin.000001 36388 Query 1 36477 use `test`; insert into t1 values( 2 ) -master-bin.000001 36477 Query 1 36566 use `test`; insert into t1 values( 1 ) -master-bin.000001 36566 Xid 1 36593 COMMIT /* XID */ -master-bin.000001 36593 Rotate 1 36637 master-bin.000002;pos=4 +master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values( 400 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 399 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 398 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 397 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 396 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 395 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 394 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 393 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 392 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 391 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 390 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 389 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 388 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 387 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 386 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 385 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 384 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 383 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 382 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 381 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 380 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 379 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 378 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 377 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 376 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 375 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 374 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 373 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 372 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 371 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 370 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 369 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 368 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 367 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 366 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 365 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 364 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 363 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 362 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 361 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 360 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 359 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 358 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 357 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 356 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 355 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 354 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 353 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 352 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 351 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 350 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 349 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 348 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 347 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 346 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 345 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 344 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 343 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 342 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 341 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 340 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 339 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 338 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 337 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 336 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 335 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 334 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 333 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 332 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 331 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 330 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 329 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 328 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 327 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 326 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 325 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 324 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 323 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 322 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 321 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 320 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 319 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 318 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 317 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 316 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 315 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 314 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 313 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 312 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 311 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 310 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 309 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 308 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 307 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 306 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 305 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 304 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 303 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 302 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 301 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 300 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 299 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 298 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 297 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 296 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 295 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 294 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 293 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 292 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 291 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 290 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 289 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 288 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 287 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 286 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 285 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 284 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 283 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 282 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 281 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 280 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 279 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 278 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 277 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 276 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 275 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 274 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 273 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 272 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 271 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 270 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 269 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 268 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 267 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 266 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 265 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 264 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 263 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 262 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 261 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 260 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 259 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 258 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 257 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 256 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 255 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 254 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 253 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 252 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 251 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 250 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 249 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 248 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 247 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 246 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 245 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 244 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 243 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 242 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 241 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 240 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 239 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 238 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 237 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 236 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 235 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 234 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 233 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 232 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 231 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 230 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 229 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 228 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 227 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 226 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 225 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 224 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 223 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 222 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 221 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 220 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 219 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 218 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 217 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 216 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 215 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 214 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 213 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 212 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 211 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 210 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 209 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 208 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 207 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 206 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 205 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 204 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 203 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 202 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 201 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 200 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 199 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 198 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 197 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 196 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 195 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 194 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 193 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 192 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 191 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 190 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 189 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 188 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 187 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 186 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 185 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 184 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 183 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 182 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 181 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 180 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 179 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 178 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 177 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 176 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 175 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 174 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 173 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 172 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 171 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 170 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 169 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 168 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 167 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 166 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 165 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 164 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 163 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 162 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 161 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 160 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 159 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 158 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 157 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 156 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 155 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 154 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 153 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 152 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 151 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 150 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 149 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 148 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 147 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 146 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 145 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 144 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 143 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 142 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 141 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 140 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 139 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 138 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 137 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 136 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 135 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 134 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 133 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 132 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 131 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 130 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 129 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 128 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 127 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 126 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 125 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 124 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 123 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 122 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 121 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 120 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 119 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 118 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 117 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 116 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 115 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 114 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 113 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 112 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 111 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 110 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 109 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 108 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 107 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 105 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 104 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 103 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 102 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 101 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 100 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 99 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 98 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 97 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 96 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 95 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 94 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 93 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 92 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 91 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 90 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 89 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 88 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 87 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 86 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 85 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 84 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 83 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 82 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 81 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 80 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 79 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 78 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 77 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 76 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 75 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 74 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 73 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 72 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 71 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 70 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 69 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 68 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 67 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 66 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 65 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 64 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 63 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 62 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 61 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 60 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 59 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 58 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 57 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 56 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 55 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 54 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 53 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 52 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 51 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 50 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 49 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 48 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 47 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 46 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 45 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 44 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 43 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 42 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 41 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 40 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 39 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 38 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 37 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 36 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 35 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 34 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 33 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 32 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 31 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 30 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 29 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 28 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 27 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 26 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 25 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 24 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 23 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 22 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 21 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 20 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 19 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 18 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 17 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 16 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 15 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 14 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 13 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 12 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 11 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 10 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 9 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 8 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 7 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 6 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 5 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 4 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 3 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 2 ) +master-bin.000001 # Query # # use `test`; insert into t1 values( 1 ) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=4 drop table t1; set global binlog_cache_size=@bcs; set session autocommit = @ac; @@ -588,12 +585,11 @@ set @b= 14632475938453979136; execute stmt using @a, @b; deallocate prepare stmt; drop table t1; -show binlog events from 0; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned) -master-bin.000001 227 Query 1 351 use `test`; insert into t1 values (9999999999999999,14632475938453979136) -master-bin.000001 351 Query 1 427 use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned) +master-bin.000001 # Query # # use `test`; insert into t1 values (9999999999999999,14632475938453979136) +master-bin.000001 # Query # # use `test`; drop table t1 reset master; CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE bug39182; @@ -764,14 +760,14 @@ drop table if exists t3; create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 346 +master-bin.000001 # insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); -show master status /* must show new binlog index after rotating */; +show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000002 106 +master-bin.000002 # drop table t3; # # Bug #45998: database crashes when running "create as select" diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result index b2e6ac854cf..a47ab2ce932 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result +++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result @@ -104,9 +104,8 @@ select * from t2; a select * from t3; a -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc # # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query # # use `test`; drop table t1,t2 master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Query # # BEGIN @@ -126,7 +125,7 @@ master-bin.000001 # Query # # use `test`; replace into t1 values(100) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole master-bin.000001 # Query # # BEGIN -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`) ;file_id=# master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; alter table t1 add b int @@ -163,13 +162,6 @@ start transaction; insert into t1 values(2); rollback; set autocommit=1; -show binlog events; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc # # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; insert into t1 values(1) -master-bin.000001 # Query # # COMMIT drop table if exists t1; reset master; create table t1 (a int auto_increment, primary key (a)) engine=blackhole; diff --git a/mysql-test/suite/binlog/t/binlog_innodb.test b/mysql-test/suite/binlog/t/binlog_innodb.test index f84fd65226a..2914cd1dcc5 100644 --- a/mysql-test/suite/binlog/t/binlog_innodb.test +++ b/mysql-test/suite/binlog/t/binlog_innodb.test @@ -155,7 +155,8 @@ reset master; UPDATE t2,t1 SET t2.a=t1.a+2; # check select * from t2 /* must be (3,1), (4,4) */; -show master status /* there must no UPDATE in binlog */; +--echo # There must no UPDATE in binlog; +source include/show_binlog_events.inc; # B. testing multi_update::send_error() execution branch delete from t1; @@ -165,7 +166,8 @@ insert into t2 values (1,2),(3,4),(4,4); reset master; --error ER_DUP_ENTRY UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; -show master status /* there must be no UPDATE query event */; +--echo # There must be no UPDATE query event; +source include/show_binlog_events.inc; # cleanup bug#27716 drop table t1, t2; diff --git a/mysql-test/suite/binlog/t/binlog_stm_binlog.test b/mysql-test/suite/binlog/t/binlog_stm_binlog.test index 280b7a3aef9..d18c2b4cd77 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_binlog.test +++ b/mysql-test/suite/binlog/t/binlog_stm_binlog.test @@ -5,8 +5,7 @@ create table t1 (a int, b int) engine=innodb; begin; insert into t1 values (1,2); commit; ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; drop table t1; # This is a wrapper for binlog.test so that the same test case can be used diff --git a/mysql-test/suite/bugs/r/rpl_bug12691.result b/mysql-test/suite/bugs/r/rpl_bug12691.result index 69d5e8009b0..8feeb0effc3 100644 --- a/mysql-test/suite/bugs/r/rpl_bug12691.result +++ b/mysql-test/suite/bugs/r/rpl_bug12691.result @@ -16,12 +16,11 @@ LOAD DATA INFILE FILENAME SELECT COUNT(*) FROM t1; COUNT(*) 3 -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: # -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (b CHAR(10)) -master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=# -master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE FILENAME ;file_id=# +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (b CHAR(10)) +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`b`) ;file_id=# **** On Slave **** SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; diff --git a/mysql-test/suite/bugs/r/rpl_bug36391.result b/mysql-test/suite/bugs/r/rpl_bug36391.result index 2d62837a87a..33175d89d30 100644 --- a/mysql-test/suite/bugs/r/rpl_bug36391.result +++ b/mysql-test/suite/bugs/r/rpl_bug36391.result @@ -13,5 +13,6 @@ Tables_in_test t1 show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 278 +master-bin.000001 # flush logs; +drop table t1; diff --git a/mysql-test/suite/bugs/t/rpl_bug12691.test b/mysql-test/suite/bugs/t/rpl_bug12691.test index b29c85584a5..28d7f16935e 100644 --- a/mysql-test/suite/bugs/t/rpl_bug12691.test +++ b/mysql-test/suite/bugs/t/rpl_bug12691.test @@ -28,9 +28,7 @@ STOP SLAVE; SELECT COUNT(*) FROM t1; ---replace_column 2 # 5 # ---replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /'.+'/FILENAME/ -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; --save_master_pos diff --git a/mysql-test/suite/bugs/t/rpl_bug36391.test b/mysql-test/suite/bugs/t/rpl_bug36391.test index 9f384304837..8bca9a46c5a 100644 --- a/mysql-test/suite/bugs/t/rpl_bug36391.test +++ b/mysql-test/suite/bugs/t/rpl_bug36391.test @@ -21,8 +21,10 @@ create table t1(id int); show tables; -show master status; +--source include/show_master_status.inc flush logs; --exec $MYSQL_BINLOG $MYSQL_TEST_DIR/var/log/master-bin.000001 | $MYSQL test + +drop table t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl_000015.result b/mysql-test/suite/engines/funcs/r/rpl_000015.result index eee3b505ad6..8cd48141127 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_000015.result +++ b/mysql-test/suite/engines/funcs/r/rpl_000015.result @@ -10,166 +10,25 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 106 stop slave; reset slave; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry # Master_Log_File Read_Master_Log_Pos 4 -Relay_Log_File # -Relay_Log_Pos # Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 Exec_Master_Log_Pos 0 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error change master to master_host='127.0.0.1'; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry # Master_Log_File Read_Master_Log_Pos 4 -Relay_Log_File # -Relay_Log_Pos # Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 Exec_Master_Log_Pos 0 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=MASTER_PORT; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry # Master_Log_File Read_Master_Log_Pos 4 -Relay_Log_File # -Relay_Log_Pos # Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 Exec_Master_Log_Pos 0 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error start slave; -show slave status; -Slave_IO_State Waiting for master to send event -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 106 -Relay_Log_File slave-relay-bin.000002 -Relay_Log_Pos 252 Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 106 -Relay_Log_Space 407 -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. drop table if exists t1; create table t1 (n int, PRIMARY KEY(n)); insert into t1 values (10),(45),(90); diff --git a/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result b/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result index 7a901b65810..b6cb2c0e7de 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result +++ b/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result @@ -4,8 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error +SHOW SLAVE STATUS;; SHOW SLAVE HOSTS; Server_id Host Port Rpl_recovery_rank Master_id 2 127.0.0.1 SLAVE_PORT 0 1 diff --git a/mysql-test/suite/engines/funcs/r/rpl_change_master.result b/mysql-test/suite/engines/funcs/r/rpl_change_master.result index 62c5ffdd4f8..2258a35a869 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_change_master.result +++ b/mysql-test/suite/engines/funcs/r/rpl_change_master.result @@ -11,13 +11,7 @@ stop slave sql_thread; insert into t1 values(1); insert into t1 values(2); stop slave; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # No 0 0 change master to master_user='root'; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # No 0 0 start slave; select * from t1; n diff --git a/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result b/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result index b5e14d3adac..f71411c68dd 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result +++ b/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result @@ -4,8 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error load table t1 from master; ERROR 08S01: Error connecting to master: Master is not configured load table t1 from master; diff --git a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result index c894ad0135b..ef4d7797dbf 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result +++ b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result @@ -17,43 +17,6 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes% --source include/wait_slave_status.inc flush logs; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port SLAVE_PORT -Connect_Retry 60 -Master_Log_File slave-bin.000001 -Read_Master_Log_Pos 106 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File slave-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 106 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +Relay_Log_File mysqld-relay-bin.000003 +Checking that both slave threads are running. STOP SLAVE; diff --git a/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result b/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result index d858ced1352..779a3af9631 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result +++ b/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result @@ -10,6 +10,6 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; select count(*) from test.t1; count(*) 2 -show binlog events from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info drop table test.t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result index f26f4350cf1..1b2ded26f66 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result +++ b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result @@ -4,39 +4,23 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # No 0 0 stop slave; -change master to master_log_pos=106; +change master to master_log_pos=MASTER_LOG_POS; start slave; stop slave; -change master to master_log_pos=106; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No 0 0 106 # None 0 No # No 0 0 +change master to master_log_pos=MASTER_LOG_POS; start slave; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # No 0 0 stop slave; -change master to master_log_pos=177; +# impossible position leads to an error +change master to master_log_pos=MASTER_LOG_POS; start slave; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 177 # # master-bin.000001 No Yes 0 0 177 # None 0 No # No 1236 Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' 0 -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 +Last_IO_Error = Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' create table if not exists t1 (n int); drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); stop slave; -change master to master_log_pos=206; +change master to master_log_pos=MASTER_LOG_POS; start slave; select * from t1 ORDER BY n; n diff --git a/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result b/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result index b4b04d35208..ced1693bdc8 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result +++ b/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result @@ -14,47 +14,16 @@ MIXED MIXED CREATE TABLE t1 (a INT, b LONG); INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); -SHOW BINLOG EVENTS; +show binlog events from ; **** On Slave **** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -SHOW BINLOG EVENTS; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +show binlog events from ; DROP TABLE IF EXISTS t1; SET GLOBAL BINLOG_FORMAT=@saved_binlog_format; diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result index 89654ebf165..048e07271b3 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result @@ -41,12 +41,11 @@ t1 t2 **** On Master **** DROP TABLE t1,t2; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 192 use `test`; CREATE TABLE t1 (a int) -master-bin.000001 192 Query 1 278 use `test`; CREATE TABLE t2 (a int) -master-bin.000001 278 Query 1 382 use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int) +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ SHOW TABLES; Tables_in_test t2 diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result b/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result index ad192b530a7..cd7528280d0 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result @@ -17,43 +17,5 @@ a 0 drop table t1; insert into t1 values (1); -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table test.t2 -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1146 -Last_Error Error 'Table 'test.t1' doesn't exist' on opening tables -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 1146 -Last_SQL_Error Error 'Table 'test.t1' doesn't exist' on opening tables +Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables drop table t1, t2; diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result b/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result index 6ef88c23726..c0f7ddabec7 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result @@ -24,45 +24,7 @@ select @@global.max_relay_log_size; @@global.max_relay_log_size 4096 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 2 # @@ -72,45 +34,7 @@ set global max_relay_log_size=(5*4096); select @@global.max_relay_log_size; @@global.max_relay_log_size 20480 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 3: max_relay_log_size = 0 # @@ -120,90 +44,13 @@ set global max_relay_log_size=0; select @@global.max_relay_log_size; @@global.max_relay_log_size 0 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # stop slave; reset slave; flush logs; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error # # Test 5 # @@ -211,89 +58,13 @@ reset slave; start slave; flush logs; create table t1 (a int); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # flush logs; drop table t1; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result index fa40d8760a8..7bf09df31ca 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result @@ -4,196 +4,37 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -stop slave; +Master_Host 127.0.0.1 +include/stop_slave.inc change master to master_user='test'; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 Master_User test -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -reset slave; -SHOW SLAVE STATUS; -Slave_IO_State # Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -stop slave; reset slave; -start slave; +Master_User root +Master_Host 127.0.0.1 +include/start_slave.inc +Master_User root +Master_Host 127.0.0.1 +include/stop_slave.inc +reset slave; +include/start_slave.inc create temporary table t1 (a int); -stop slave; +include/stop_slave.inc reset slave; -start slave; +include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 -stop slave; +include/stop_slave.inc reset slave; -*** errno must be zero: 0 *** change master to master_user='impossible_user_name'; start slave; -ONE -1 include/stop_slave.inc change master to master_user='root'; include/start_slave.inc -*** last errno must be zero: 0 *** -*** last error must be blank: *** include/stop_slave.inc change master to master_user='impossible_user_name'; start slave; -ONE -1 include/stop_slave.inc reset slave; -*** io last errno must be zero: 0 *** -*** io last error must be blank: *** -*** sql last errno must be zero: 0 *** -*** sql last error must be blank: *** diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_until.result b/mysql-test/suite/engines/funcs/r/rpl_row_until.result index 5091a9f6468..72dd1a6a7c3 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_until.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_until.result @@ -12,193 +12,39 @@ create table t2(n int not null auto_increment primary key); insert into t2 values (1),(2); insert into t2 values (3),(4); drop table t2; -start slave until master_log_file='master-bin.000001', master_log_pos=311; +start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; select * from t1; n 1 2 3 4 -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File slave-relay-bin.000004 -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running # -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos 311 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; +start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS; select * from t1; -n 1 -n 2 -n 3 -n 4 -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File slave-relay-bin.000004 -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running # -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-no-such-bin.000001 -Until_Log_Pos 291 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; +n +1 +2 +3 +4 +start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS; select * from t2; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File slave-relay-bin.000004 -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running # -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Relay -Until_Log_File slave-relay-bin.000004 -Until_Log_Pos 728 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +n +1 +2 start slave; stop slave; -start slave until master_log_file='master-bin.000001', master_log_pos=740; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File slave-relay-bin.000004 -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos 740 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -start slave until master_log_file='master-bin', master_log_pos=561; +start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; +start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; +start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until relay_log_file='slave-relay-bin.000002'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; +start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave sql_thread; -start slave until master_log_file='master-bin.000001', master_log_pos=740; +start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; Warnings: -Level Note -Code 1254 -Message Slave is already running +Note 1254 Slave is already running diff --git a/mysql-test/suite/engines/funcs/r/rpl_server_id1.result b/mysql-test/suite/engines/funcs/r/rpl_server_id1.result index 47c2a522094..1e7108d7961 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_server_id1.result +++ b/mysql-test/suite/engines/funcs/r/rpl_server_id1.result @@ -8,10 +8,8 @@ create table t1 (n int); reset master; stop slave; change master to master_port=SLAVE_PORT; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 106 None 0 No NULL No 0 0 start slave; +Last_IO_Error = Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it). insert into t1 values (1); show status like "slave_running"; Variable_name Value diff --git a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result index d50814022d8..066b563c4e8 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result +++ b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result @@ -8,9 +8,6 @@ create table t1 (n int); reset master; stop slave; change master to master_port=SLAVE_PORT; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 106 None 0 No NULL No 0 0 start slave; insert into t1 values (1); select * from t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl_slave_status.result b/mysql-test/suite/engines/funcs/r/rpl_slave_status.result index dfc82f61e68..c4dc7686045 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_slave_status.result +++ b/mysql-test/suite/engines/funcs/r/rpl_slave_status.result @@ -18,44 +18,5 @@ drop user rpl@127.0.0.1; flush privileges; stop slave; start slave; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User rpl -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master NULL -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error drop table t1; drop table t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result b/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result index 2215b34814e..db06cb6d3de 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result +++ b/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result @@ -21,45 +21,7 @@ select @@global.max_relay_log_size; @@global.max_relay_log_size 4096 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 2 # @@ -69,45 +31,7 @@ set global max_relay_log_size=(5*4096); select @@global.max_relay_log_size; @@global.max_relay_log_size 20480 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 3: max_relay_log_size = 0 # @@ -117,90 +41,13 @@ set global max_relay_log_size=0; select @@global.max_relay_log_size; @@global.max_relay_log_size 0 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # stop slave; reset slave; flush logs; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error # # Test 5 # @@ -208,89 +55,13 @@ reset slave; start slave; flush logs; create table t1 (a int); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # flush logs; drop table t1; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result b/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result index 78d9d7c41eb..1fc189975ef 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result @@ -4,196 +4,37 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -stop slave; +Master_Host 127.0.0.1 +include/stop_slave.inc change master to master_user='test'; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 Master_User test -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -reset slave; -SHOW SLAVE STATUS; -Slave_IO_State # Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -stop slave; reset slave; -start slave; +Master_User root +Master_Host 127.0.0.1 +include/start_slave.inc +Master_User root +Master_Host 127.0.0.1 +include/stop_slave.inc +reset slave; +include/start_slave.inc create temporary table t1 (a int); -stop slave; +include/stop_slave.inc reset slave; -start slave; +include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 -stop slave; +include/stop_slave.inc reset slave; -*** errno must be zero: 0 *** change master to master_user='impossible_user_name'; start slave; -ONE -1 include/stop_slave.inc change master to master_user='root'; include/start_slave.inc -*** last errno must be zero: 0 *** -*** last error must be blank: *** include/stop_slave.inc change master to master_user='impossible_user_name'; start slave; -ONE -1 include/stop_slave.inc reset slave; -*** io last errno must be zero: 0 *** -*** io last error must be blank: *** -*** sql last errno must be zero: 0 *** -*** sql last error must be blank: *** diff --git a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result index 466302000af..61d77c0dc2a 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result @@ -376,7 +376,7 @@ CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; -show binlog events; -show binlog events; +show binlog events from ; +show binlog events from ; drop database mysqltest1; set global binlog_format= @saved_binlog_format; diff --git a/mysql-test/suite/engines/funcs/t/rpl_000015.test b/mysql-test/suite/engines/funcs/t/rpl_000015.test index 817ed6f407c..6c18e66a3a6 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_000015.test +++ b/mysql-test/suite/engines/funcs/t/rpl_000015.test @@ -11,31 +11,25 @@ save_master_pos; connection slave; stop slave; reset slave; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 5 # 8 # 9 # 23 # 33 # -show slave status; +let $status_items= Master_Log_File, Read_Master_Log_Pos, Relay_Master_Log_File, Exec_Master_Log_Pos; +source include/show_slave_status.inc; change master to master_host='127.0.0.1'; # The following needs to be cleaned up when change master is fixed ---vertical_results ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 5 # 8 # 9 # 23 # 33 # -show slave status; +source include/show_slave_status.inc; + --replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=$MASTER_MYPORT; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 5 # 8 # 9 # 23 # 33 # -show slave status; +source include/show_slave_status.inc; + start slave; sync_with_master; +let $status_items= Master_Log_File, Relay_Master_Log_File; +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; + --vertical_results ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 5 # 8 # 9 # 23 # 33 # ---replace_column 33 # -show slave status; connection master; --disable_warnings drop table if exists t1; diff --git a/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test b/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test index 078d1048794..7644b18ee7e 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test +++ b/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test @@ -7,15 +7,11 @@ source include/master-slave.inc; --disable_ps_protocol #first, make sure the slave has had enough time to register -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; #discover slaves connection master; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # -SHOW SLAVE STATUS; +--query_vertical SHOW SLAVE STATUS; --replace_result $SLAVE_MYPORT SLAVE_PORT SHOW SLAVE HOSTS; rpl_probe; @@ -25,9 +21,7 @@ enable_rpl_parse; create table t1 ( n int); insert into t1 values (1),(2),(3),(4); disable_rpl_parse; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; insert into t1 values(5); connection master; enable_rpl_parse; diff --git a/mysql-test/suite/engines/funcs/t/rpl_change_master.test b/mysql-test/suite/engines/funcs/t/rpl_change_master.test index c031464c95e..ce8c921c2ad 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_change_master.test +++ b/mysql-test/suite/engines/funcs/t/rpl_change_master.test @@ -18,13 +18,26 @@ save_master_pos; connection slave; --real_sleep 3 # wait for I/O thread to have read updates stop slave; ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 23 # 33 # -show slave status; +source include/wait_for_slave_to_stop.inc; + +let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); +let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); +if (`SELECT $read_pos = $exec_pos`) +{ + source include/show_rpl_debug_info.inc; + echo 'Read_Master_Log_Pos: $read_pos' == 'Exec_Master_Log_Pos: $exec_pos'; + die Failed because Read_Master_Log_Pos is equal to Exec_Master_Log_Pos; +} change master to master_user='root'; ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 23 # 33 # -show slave status; +let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); +let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); +if (`SELECT $read_pos <> $exec_pos`) +{ + source include/show_rpl_debug_info.inc; + echo 'Read_Master_Log_Pos: $read_pos' <> 'Exec_Master_Log_Pos: $exec_pos'; + die Failed because Read_Master_Log_Pos is not equal to Exec_Master_Log_Pos; +} + start slave; sync_with_master; select * from t1; diff --git a/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test b/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test index 707d1eca8c2..863b450a6d9 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test +++ b/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test @@ -1,8 +1,5 @@ source include/master-slave.inc; ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # -show slave status; - # # Load table should not succeed on the master as this is not a slave # diff --git a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test index 2e481f5e5e7..0b71817226a 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test +++ b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test @@ -41,8 +41,7 @@ sleep 5; # # Show status of slave # ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # ---vertical_results -SHOW SLAVE STATUS; +--let status_items= Relay_Log_File +--source include/show_slave_status.inc +--source include/check_slave_is_running.inc STOP SLAVE; diff --git a/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test b/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test index 791fe84420f..2dd2218eb5c 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test +++ b/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test @@ -20,9 +20,7 @@ save_master_pos; connection slave; sync_with_master; select count(*) from test.t1; # check that LOAD was replicated ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 106; # should be nothing +source include/show_binlog_events.inc; # Cleanup connection master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test index 13083e47bcf..e07f0d5f2a7 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test +++ b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test @@ -11,36 +11,41 @@ # Passes with rbr no problem, removed statement include [jbm] source include/master-slave.inc; ---replace_column 3 -show master status; +let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1); sync_slave_with_master; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; stop slave; -change master to master_log_pos=106; + +--replace_result $master_log_pos MASTER_LOG_POS +eval change master to master_log_pos=$master_log_pos; start slave; sleep 5; stop slave; -change master to master_log_pos=106; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; + +--replace_result $master_log_pos MASTER_LOG_POS +eval change master to master_log_pos=$master_log_pos; +--let $slave_param= Read_Master_Log_Pos +--let $slave_param_value= $master_log_pos +--source include/wait_for_slave_param.inc + start slave; sleep 5; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; +--let $slave_param= Read_Master_Log_Pos +--let $slave_param_value= $master_log_pos +--source include/wait_for_slave_param.inc +--source include/check_slave_no_error.inc + stop slave; +--echo # impossible position leads to an error +--replace_result 177 MASTER_LOG_POS change master to master_log_pos=177; start slave; sleep 2; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; +let $slave_io_errno= 1236; +let $show_slave_io_error= 1; +source include/wait_for_slave_io_error.inc; connection master; ---replace_column 3 -show master status; + +let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1); create table if not exists t1 (n int); drop table if exists t1; create table t1 (n int); @@ -48,7 +53,9 @@ insert into t1 values (1),(2),(3); save_master_pos; connection slave; stop slave; -change master to master_log_pos=206; + +--replace_result $master_log_pos MASTER_LOG_POS +eval change master to master_log_pos=$master_log_pos; start slave; sync_with_master; select * from t1 ORDER BY n; diff --git a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test b/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test index d466382dc92..c9d27d1ea6a 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test +++ b/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test @@ -15,25 +15,17 @@ SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; CREATE TABLE t1 (a INT, b LONG); INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); -let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ # Different number of binlog events are generated by different engines --disable_result_log -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; --enable_result_log sync_slave_with_master; --echo **** On Slave **** ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical SHOW SLAVE STATUS ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ +source include/show_binlog_events.inc; + # Different number of binlog events are generated by different engines --disable_result_log -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; --enable_result_log --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_drop.test b/mysql-test/suite/engines/funcs/t/rpl_row_drop.test index 20c217a7c3a..d18ebc2846b 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_drop.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_drop.test @@ -30,10 +30,7 @@ connection master; --echo **** On Master **** # Should drop the non-temporary table t1 and the temporary table t2 DROP TABLE t1,t2; -let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; SHOW TABLES; sync_slave_with_master; --echo **** On Slave **** diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test b/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test index 736071a8ece..dca2894c9da 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test @@ -22,13 +22,11 @@ connection master; insert into t1 values (1); connection slave; -# slave should have stopped because can't find table t1 -wait_for_slave_to_stop; +# slave should have stopped because can't find table t1 # see if we have a good error message: ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # ---vertical_results -show slave status; +--let $slave_sql_errno= 1146 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc # cleanup connection master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_until.test b/mysql-test/suite/engines/funcs/t/rpl_row_until.test index ccd9ce11637..b60734317c6 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_until.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_until.test @@ -18,44 +18,50 @@ connection master; # create some events on master create table t1(n int not null auto_increment primary key); insert into t1 values (1),(2),(3),(4); +let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1); drop table t1; + create table t2(n int not null auto_increment primary key); insert into t2 values (1),(2); +let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1); insert into t2 values (3),(4); drop table t2; # try to replicate all queries until drop of t1 connection slave; -start slave until master_log_file='master-bin.000001', master_log_pos=311; +--replace_result $master_log_pos_1 MASTER_LOG_POS +eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_log_pos_1; sleep 2; wait_for_slave_to_stop; # here table should be still not deleted select * from t1; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 # -show slave status; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_log_pos_1 +--source include/check_slave_param.inc # this should fail right after start +--replace_result 291 MASTER_LOG_POS start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; # again this table should be still not deleted select * from t1; sleep 2; wait_for_slave_to_stop; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 # -show slave status; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_log_pos_1 +--source include/check_slave_param.inc # try replicate all up to and not including the second insert to t2; -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; +let $master_log_pos= $master_log_pos_2; +let $relay_log_file= slave-relay-bin.000004; +--source include/get_relay_log_pos.inc +--replace_result $relay_log_pos RELAY_LOG_POS +eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos; sleep 2; wait_for_slave_to_stop; select * from t2; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 # -show slave status; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_log_pos +--source include/check_slave_param.inc # clean up start slave; @@ -65,27 +71,32 @@ connection slave; sync_with_master; stop slave; +--let $exec_log_pos_1= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) # this should stop immediately as we are already there -start slave until master_log_file='master-bin.000001', master_log_pos=740; +--replace_result $master_log_pos_2 MASTER_LOG_POS +eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_log_pos_2; sleep 2; wait_for_slave_to_stop; # here the sql slave thread should be stopped ---vertical_results ---replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 ---replace_column 1 # 7 # 9 # 22 # 23 # 33 # -show slave status; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $exec_log_pos_1 +--source include/check_slave_param.inc #testing various error conditions +--replace_result 561 MASTER_LOG_POS --error 1277 start slave until master_log_file='master-bin', master_log_pos=561; +--replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS --error 1277 start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; --error 1277 start slave until master_log_file='master-bin.000001'; --error 1277 start slave until relay_log_file='slave-relay-bin.000002'; +--replace_result 561 MASTER_LOG_POS --error 1277 start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; # Warning should be given for second command start slave sql_thread; +--replace_result 740 MASTER_LOG_POS start slave until master_log_file='master-bin.000001', master_log_pos=740; diff --git a/mysql-test/suite/engines/funcs/t/rpl_server_id1.test b/mysql-test/suite/engines/funcs/t/rpl_server_id1.test index 71310750b60..014f38d3544 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_server_id1.test +++ b/mysql-test/suite/engines/funcs/t/rpl_server_id1.test @@ -12,10 +12,13 @@ reset master; stop slave; --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_port=$SLAVE_MYPORT; ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 16 # 18 # -show slave status; +source include/check_slave_no_error.inc; + start slave; +let $slave_io_errno= 1593; +let $show_slave_io_error= 1; +source include/wait_for_slave_io_error.inc; + insert into t1 values (1); # can't MASTER_POS_WAIT(), it does not work in this weird setup # (when slave is its own master without --replicate-same-server-id) diff --git a/mysql-test/suite/engines/funcs/t/rpl_server_id2.test b/mysql-test/suite/engines/funcs/t/rpl_server_id2.test index 0f2eb560d18..5b8683ecfb1 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_server_id2.test +++ b/mysql-test/suite/engines/funcs/t/rpl_server_id2.test @@ -9,9 +9,6 @@ reset master; stop slave; --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_port=$SLAVE_MYPORT; ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 18 # -show slave status; start slave; insert into t1 values (1); save_master_pos; diff --git a/mysql-test/suite/engines/funcs/t/rpl_slave_status.test b/mysql-test/suite/engines/funcs/t/rpl_slave_status.test index b3d6e49e215..cc3fbf6abee 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_slave_status.test +++ b/mysql-test/suite/engines/funcs/t/rpl_slave_status.test @@ -22,9 +22,7 @@ drop table if exists t1; --enable_warnings create table t1 (n int); insert into t1 values (1); -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select * from t1; # 3. Delete new replication user @@ -40,12 +38,8 @@ stop slave; start slave; # 5. Make sure Slave_IO_Running = No ---replace_result $MASTER_MYPORT MASTER_MYPORT -# Column 1 is replaced, since the output can be either -# "Connecting to master" or "Waiting for master update" ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 # ---vertical_results -show slave status; +let $slave_io_errno= 1045; +source include/wait_for_slave_io_error.inc; # Cleanup (Note that slave IO thread is not running) connection slave; diff --git a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test index d89765fb28d..eb2e2a828f3 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test @@ -501,9 +501,7 @@ INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; --disable_result_log ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; --enable_result_log sync_slave_with_master; @@ -520,9 +518,7 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_ connection master; --disable_result_log ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; --enable_result_log # Now test that mysqlbinlog works fine on a binlog generated by the diff --git a/mysql-test/suite/manual/r/rpl_replication_delay.result b/mysql-test/suite/manual/r/rpl_replication_delay.result index a8fa6ce8265..73dd77cc647 100644 --- a/mysql-test/suite/manual/r/rpl_replication_delay.result +++ b/mysql-test/suite/manual/r/rpl_replication_delay.result @@ -4,45 +4,8 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -show slave status /* Second_behind reports 0 */;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port 9306 -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 106 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 106 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key +# Second_behind reports 0 Seconds_Behind_Master 0 -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error drop table if exists t1; Warnings: Note 1051 Unknown table 't1' @@ -50,87 +13,13 @@ create table t1 (f1 int); flush logs /* contaminate rli->last_master_timestamp */; lock table t1 write; insert into t1 values (1); -show slave status /* bug emulated: reports slave threads starting time about 3*3 not 3 secs */;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port 9306 -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 367 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 279 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key +# bug emulated: reports slave threads starting time about 3*3 not 3 secs Seconds_Behind_Master 9 -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error unlock tables; flush logs /* this time rli->last_master_timestamp is not affected */; lock table t1 write; insert into t1 values (2); -show slave status /* reports the correct diff with master query time about 3+3 secs */;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port 9306 -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 455 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 367 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key +# reports the correct diff with master query time about 3+3 secs Seconds_Behind_Master 7 -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error unlock tables; drop table t1; diff --git a/mysql-test/suite/manual/t/rpl_replication_delay.test b/mysql-test/suite/manual/t/rpl_replication_delay.test index 8230698c8f9..fc1db9bfe18 100644 --- a/mysql-test/suite/manual/t/rpl_replication_delay.test +++ b/mysql-test/suite/manual/t/rpl_replication_delay.test @@ -10,9 +10,9 @@ source include/master-slave.inc; connection master; #connection slave; sync_slave_with_master; ---replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # ---query_vertical show slave status /* Second_behind reports 0 */; +--echo # Second_behind reports 0 +let $status_items= Seconds_Behind_Master; +source include/show_slave_status.inc; sleep 3; ### bug emulation @@ -35,9 +35,8 @@ insert into t1 values (1); sleep 3; connection slave; ---replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # ---query_vertical show slave status /* bug emulated: reports slave threads starting time about 3*3 not 3 secs */; +--echo # bug emulated: reports slave threads starting time about 3*3 not 3 secs +source include/show_slave_status.inc; unlock tables; connection master; @@ -55,9 +54,8 @@ insert into t1 values (2); sleep 3; connection slave; ---replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # ---query_vertical show slave status /* reports the correct diff with master query time about 3+3 secs */; +--echo # reports the correct diff with master query time about 3+3 secs +source include/show_slave_status.inc; unlock tables; connection master; diff --git a/mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result b/mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result index 97300e7131b..fb0324bc89e 100644 --- a/mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result +++ b/mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result @@ -91,49 +91,7 @@ f1 f2 f3 f4 27 27 27 next 29 29 29 second 30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - +Checking that both slave threads are running. ***** Testing Altering table def scenario ***** @@ -454,7 +412,9 @@ f1 f2 f3 f4 update t31 set f5=555555555555555 where f3=6; update t31 set f2=2 where f3=2; update t31 set f1=NULL where f3=1; -update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3; +update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; +Warnings: +Warning 1048 Column 'f3' cannot be null ** Delete from Master ** @@ -463,50 +423,12 @@ delete from t2; delete from t3; delete from t4; delete from t31; +select * from t31; +f1 f2 f3 f4 ** Check slave status ** -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. **************************************** * columns in master at middle of table * @@ -539,50 +461,13 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; @@ -614,50 +499,13 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; @@ -768,45 +616,7 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' STOP SLAVE; RESET SLAVE; @@ -854,45 +664,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' STOP SLAVE; RESET SLAVE; @@ -940,45 +712,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' STOP SLAVE; RESET SLAVE; @@ -1230,49 +964,7 @@ f1 f2 f3 f4 27 27 27 next 29 29 29 second 30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - +Checking that both slave threads are running. ***** Testing Altering table def scenario ***** @@ -1593,7 +1285,9 @@ f1 f2 f3 f4 update t31 set f5=555555555555555 where f3=6; update t31 set f2=2 where f3=2; update t31 set f1=NULL where f3=1; -update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3; +update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; +Warnings: +Warning 1048 Column 'f3' cannot be null ** Delete from Master ** @@ -1602,50 +1296,12 @@ delete from t2; delete from t3; delete from t4; delete from t31; +select * from t31; +f1 f2 f3 f4 ** Check slave status ** -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. **************************************** * columns in master at middle of table * @@ -1678,50 +1334,13 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; @@ -1753,50 +1372,13 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; @@ -1907,45 +1489,7 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' STOP SLAVE; RESET SLAVE; @@ -1993,45 +1537,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' STOP SLAVE; RESET SLAVE; @@ -2079,45 +1585,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result b/mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result index f9c077f38da..203a59b4613 100644 --- a/mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result +++ b/mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result @@ -26,21 +26,21 @@ from mysql.ndb_apply_status; # since insert is done with transactional engine, expect a BEGIN # at -show binlog events from limit 1; +show binlog events from limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 Query 1 # BEGIN +master-bin.000001 # Query # # BEGIN # Now the insert, one step after -show binlog events from limit 1,1; +show binlog events from limit 1,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t1 values (1,2) +master-bin.000001 # Query # # use `test`; insert into t1 values (1,2) # and the COMMIT should be at -show binlog events from limit 2,1; +show binlog events from limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Xid 1 COMMIT /* XID */ +master-bin.000001 # Xid # # COMMIT /* XID */ begin; insert into t1 values (2,3); @@ -51,18 +51,18 @@ select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status; @log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos -show binlog events from limit 1; +show binlog events from limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 Query 1 # BEGIN +master-bin.000001 # Query # # BEGIN -show binlog events from limit 1,2; +show binlog events from limit 1,2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; insert into t1 values (2,3) master-bin.000001 # Query # # use `test`; insert into t2 values (3,4) -show binlog events from limit 3,1; +show binlog events from limit 3,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Xid 1 COMMIT /* XID */ +master-bin.000001 # Xid # # COMMIT /* XID */ DROP TABLE test.t1, test.t2; SHOW TABLES; diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result index c2537815631..9c5ac34b1b0 100644 --- a/mysql-test/suite/parts/r/rpl_partition.result +++ b/mysql-test/suite/parts/r/rpl_partition.result @@ -138,45 +138,7 @@ SUBPARTITIONS 2 PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. SELECT count(*) "Slave norm" FROM t1; Slave norm 500 SELECT count(*) "Slave bykey" FROM t2; diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test index c5ee20971b3..15cd85463b1 100644 --- a/mysql-test/suite/parts/t/rpl_partition.test +++ b/mysql-test/suite/parts/t/rpl_partition.test @@ -144,9 +144,7 @@ SELECT count(*) as "Master byrange" FROM t3; --sync_slave_with_master connection slave; show create table t3; ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # -show slave status; +--source include/check_slave_is_running.inc SELECT count(*) "Slave norm" FROM t1; SELECT count(*) "Slave bykey" FROM t2; SELECT count(*) "Slave byrange" FROM t3; diff --git a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc index 70e17cef9fe..79825016448 100644 --- a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc +++ b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc @@ -66,9 +66,7 @@ ALTER TABLE t2 DROP COLUMN d; --echo --echo --echo ******************** SHOW BINLOG EVENTS ******************** ---replace_column 2 # 5 # ---replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ -show binlog events from 1; +source include/show_binlog_events.inc; sync_slave_with_master; # as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc index e9adb805c99..d953397c0cb 100644 --- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc +++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc @@ -326,10 +326,7 @@ DROP VIEW v2; --echo --echo --echo ******************** SHOW BINLOG EVENTS ******************** ---replace_column 2 # 5 # ---replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -show binlog events from 1; +--source include/show_binlog_events.inc sync_slave_with_master; # as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql diff --git a/mysql-test/suite/rpl/r/rpl_000015.result b/mysql-test/suite/rpl/r/rpl_000015.result deleted file mode 100644 index 03b96d5870b..00000000000 --- a/mysql-test/suite/rpl/r/rpl_000015.result +++ /dev/null @@ -1,141 +0,0 @@ -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -reset slave; -SHOW SLAVE STATUS; -change master to master_host='127.0.0.1'; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User test -Master_Port 3306 -Connect_Retry 7 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -change master to master_host='127.0.0.1',master_user='root', -master_password='',master_port=MASTER_PORT; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 7 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 7 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -drop table if exists t1; -create table t1 (n int, PRIMARY KEY(n)); -insert into t1 values (10),(45),(90); -SELECT * FROM t1 ORDER BY n; -n -10 -45 -90 -SELECT * FROM t1 ORDER BY n; -n -10 -45 -90 -drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result index 4a789f361c6..7a2e3183d5b 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result @@ -17,16 +17,6 @@ show grants for x@y; Grants for x@y GRANT USAGE ON *.* TO 'x'@'y' GRANT SELECT ON `d1`.`t` TO 'x'@'y' -show binlog events; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 193 drop database if exists d1 -master-bin.000001 193 Query 1 272 create database d1 -master-bin.000001 272 Query 1 370 use `d1`; create table t (s1 int) engine=innodb -master-bin.000001 370 Query 1 436 BEGIN -master-bin.000001 436 Query 1 521 use `d1`; insert into t values (1) -master-bin.000001 521 Xid 1 548 COMMIT /* XID */ -master-bin.000001 548 Query 1 633 use `d1`; grant select on t to x@y start transaction; insert into t values (2); revoke select on t from x@y; @@ -38,19 +28,5 @@ s1 show grants for x@y; Grants for x@y GRANT USAGE ON *.* TO 'x'@'y' -show binlog events; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 193 drop database if exists d1 -master-bin.000001 193 Query 1 272 create database d1 -master-bin.000001 272 Query 1 370 use `d1`; create table t (s1 int) engine=innodb -master-bin.000001 370 Query 1 436 BEGIN -master-bin.000001 436 Query 1 521 use `d1`; insert into t values (1) -master-bin.000001 521 Xid 1 548 COMMIT /* XID */ -master-bin.000001 548 Query 1 633 use `d1`; grant select on t to x@y -master-bin.000001 633 Query 1 699 BEGIN -master-bin.000001 699 Query 1 784 use `d1`; insert into t values (2) -master-bin.000001 784 Xid 1 811 COMMIT /* XID */ -master-bin.000001 811 Query 1 899 use `d1`; revoke select on t from x@y drop user x@y; drop database d1; diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result index a17941f6ba9..292922a1afd 100644 --- a/mysql-test/suite/rpl/r/rpl_bug33931.result +++ b/mysql-test/suite/rpl/r/rpl_bug33931.result @@ -4,43 +4,5 @@ stop slave; reset slave; SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init"; start slave; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos 4 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno # -Last_Error Failed during slave thread initialization -Skip_Counter 0 -Exec_Master_Log_Pos 0 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno # -Last_SQL_Error Failed during slave thread initialization +Last_SQL_Error = Failed during slave thread initialization SET GLOBAL debug=""; diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result index c06c1201e3d..883feb42b3f 100644 --- a/mysql-test/suite/rpl/r/rpl_change_master.result +++ b/mysql-test/suite/rpl/r/rpl_change_master.result @@ -10,86 +10,8 @@ n stop slave sql_thread; insert into t1 values(1); insert into t1 values(2); -stop slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +include/stop_slave.inc change master to master_user='root'; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error start slave; select * from t1; n diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result index 6c8d35619e5..1485389204b 100644 --- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result @@ -50,45 +50,7 @@ a SELECT * FROM t3; a 3 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. *** Test lock wait timeout *** include/stop_slave.inc @@ -112,52 +74,14 @@ SELECT * FROM t3; a 3 3 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. *** Test lock wait timeout and purged relay logs *** SET @my_max_relay_log_size= @@global.max_relay_log_size; SET global max_relay_log_size=0; include/stop_slave.inc DELETE FROM t2; -CHANGE MASTER TO MASTER_LOG_POS=440; +CHANGE MASTER TO MASTER_LOG_POS=MASTER_POS_BEGIN; BEGIN; SELECT * FROM t1 FOR UPDATE; a @@ -179,45 +103,7 @@ a 3 3 3 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. *** Clean up *** DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result index 4c6323a61db..aa1a573d052 100644 --- a/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result +++ b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result @@ -6,9 +6,9 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; reset master; change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root"; -start slave; +include/start_slave.inc create table t1 (n int); -stop slave; +include/stop_slave.inc create table t2 (n int); show tables; Tables_in_test @@ -22,20 +22,20 @@ insert into t3 values(2); insert into t3 values(3); commit; insert into t3 values(4); -start slave until master_log_file="slave-bin.000001",master_log_pos=195; +start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS; Warnings: Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart show tables; Tables_in_test t1 t2 -start slave until master_log_file="slave-bin.000001",master_log_pos=438; +start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS; Warnings: Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart select * from t3; n 1 -start slave until master_log_file="slave-bin.000001",master_log_pos=663; +start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS; Warnings: Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart select * from t3; @@ -43,7 +43,7 @@ n 1 2 3 -start slave; +include/start_slave.inc create table t4 (n int); create table t5 (n int); create table t6 (n int); @@ -55,6 +55,6 @@ t3 t4 t5 t6 -stop slave; +include/stop_slave.inc reset slave; drop table t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/rpl/r/rpl_empty_master_crash.result b/mysql-test/suite/rpl/r/rpl_empty_master_crash.result index f0d84f85069..f71411c68dd 100644 --- a/mysql-test/suite/rpl/r/rpl_empty_master_crash.result +++ b/mysql-test/suite/rpl/r/rpl_empty_master_crash.result @@ -4,7 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -SHOW SLAVE STATUS; load table t1 from master; ERROR 08S01: Error connecting to master: Master is not configured load table t1 from master; diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result index 63154383e8c..025da75581c 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result @@ -54,45 +54,7 @@ a b c 3 4 QA TESTING *** Start Slave *** START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -121,47 +83,10 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t3 *** DROP TABLE t3; *** Create t4 on slave *** @@ -183,47 +108,10 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t4 *** DROP TABLE t4; *** Create t5 on slave *** @@ -245,47 +133,10 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t5 *** DROP TABLE t5; *** Create t6 on slave *** @@ -306,45 +157,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_SQL_Error = Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -442,47 +255,10 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; *** Create t11 on slave *** @@ -503,47 +279,10 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; *** Create t12 on slave *** @@ -753,47 +492,10 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** *** Expect slave to fail with Error 1060 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1060 -Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1060 -Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 1; +include/start_slave.inc *** Try to insert in master **** INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); SELECT * FROM t15 ORDER BY c1; @@ -893,46 +595,9 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc ** DROP table t17 *** DROP TABLE t17; diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result index d80ac5eea2c..8dc726db84c 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result @@ -54,45 +54,7 @@ a b c 3 4 QA TESTING *** Start Slave *** START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -121,47 +83,10 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t3 *** DROP TABLE t3; *** Create t4 on slave *** @@ -183,47 +108,10 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t4 *** DROP TABLE t4; *** Create t5 on slave *** @@ -245,47 +133,10 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t5 *** DROP TABLE t5; *** Create t6 on slave *** @@ -306,45 +157,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_SQL_Error = Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -442,47 +255,10 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; *** Create t11 on slave *** @@ -503,47 +279,10 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; *** Create t12 on slave *** @@ -753,47 +492,10 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** *** Expect slave to fail with Error 1060 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1060 -Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1060 -Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 1; +include/start_slave.inc *** Try to insert in master **** INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); SELECT * FROM t15 ORDER BY c1; @@ -893,46 +595,9 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc ** DROP table t17 *** DROP TABLE t17; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index ad67f96db71..e8535a0bc5e 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result @@ -91,49 +91,7 @@ f1 f2 f3 f4 27 27 27 next 29 29 29 second 30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - +Checking that both slave threads are running. ***** Testing Altering table def scenario ***** @@ -465,50 +423,12 @@ delete from t2; delete from t3; delete from t4; delete from t31; +select * from t31; +f1 f2 f3 f4 ** Check slave status ** -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. **************************************** * columns in master at middle of table * @@ -541,50 +461,13 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; @@ -616,50 +499,13 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; @@ -770,45 +616,7 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' STOP SLAVE; RESET SLAVE; @@ -856,45 +664,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' STOP SLAVE; RESET SLAVE; @@ -942,45 +712,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' STOP SLAVE; RESET SLAVE; @@ -1232,49 +964,7 @@ f1 f2 f3 f4 27 27 27 next 29 29 29 second 30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - +Checking that both slave threads are running. ***** Testing Altering table def scenario ***** @@ -1606,50 +1296,12 @@ delete from t2; delete from t3; delete from t4; delete from t31; +select * from t31; +f1 f2 f3 f4 ** Check slave status ** -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. **************************************** * columns in master at middle of table * @@ -1682,50 +1334,13 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; @@ -1757,50 +1372,13 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; @@ -1911,45 +1489,7 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' STOP SLAVE; RESET SLAVE; @@ -1997,45 +1537,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' STOP SLAVE; RESET SLAVE; @@ -2083,45 +1585,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' STOP SLAVE; RESET SLAVE; @@ -2373,49 +1837,7 @@ f1 f2 f3 f4 27 27 27 next 29 29 29 second 30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - +Checking that both slave threads are running. ***** Testing Altering table def scenario ***** @@ -2747,50 +2169,12 @@ delete from t2; delete from t3; delete from t4; delete from t31; +select * from t31; +f1 f2 f3 f4 ** Check slave status ** -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. **************************************** * columns in master at middle of table * @@ -2823,50 +2207,13 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; @@ -2898,50 +2245,13 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; @@ -3052,45 +2362,7 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' STOP SLAVE; RESET SLAVE; @@ -3138,45 +2410,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' STOP SLAVE; RESET SLAVE; @@ -3224,45 +2458,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index 8859a8e24e3..f360a8847eb 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result @@ -91,49 +91,7 @@ f1 f2 f3 f4 27 27 27 next 29 29 29 second 30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - +Checking that both slave threads are running. ***** Testing Altering table def scenario ***** @@ -465,50 +423,12 @@ delete from t2; delete from t3; delete from t4; delete from t31; +select * from t31; +f1 f2 f3 f4 ** Check slave status ** -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. **************************************** * columns in master at middle of table * @@ -541,50 +461,13 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; @@ -616,50 +499,13 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; @@ -770,45 +616,7 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' STOP SLAVE; RESET SLAVE; @@ -856,45 +664,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' STOP SLAVE; RESET SLAVE; @@ -942,45 +712,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' STOP SLAVE; RESET SLAVE; @@ -1232,49 +964,7 @@ f1 f2 f3 f4 27 27 27 next 29 29 29 second 30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - +Checking that both slave threads are running. ***** Testing Altering table def scenario ***** @@ -1606,50 +1296,12 @@ delete from t2; delete from t3; delete from t4; delete from t31; +select * from t31; +f1 f2 f3 f4 ** Check slave status ** -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. **************************************** * columns in master at middle of table * @@ -1682,50 +1334,13 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; @@ -1757,50 +1372,13 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; @@ -1911,45 +1489,7 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' STOP SLAVE; RESET SLAVE; @@ -1997,45 +1537,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' STOP SLAVE; RESET SLAVE; @@ -2083,45 +1585,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' STOP SLAVE; RESET SLAVE; @@ -2373,49 +1837,7 @@ f1 f2 f3 f4 27 27 27 next 29 29 29 second 30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - +Checking that both slave threads are running. ***** Testing Altering table def scenario ***** @@ -2747,50 +2169,12 @@ delete from t2; delete from t3; delete from t4; delete from t31; +select * from t31; +f1 f2 f3 f4 ** Check slave status ** -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. **************************************** * columns in master at middle of table * @@ -2823,50 +2207,13 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; @@ -2898,50 +2245,13 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), (3,@b1,DEFAULT,'QA',DEFAULT); ******************************************** -*** Expect slave to fail with Error 1523 *** +*** Expect slave to fail with Error 1535 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; @@ -3052,45 +2362,7 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' STOP SLAVE; RESET SLAVE; @@ -3138,45 +2410,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' STOP SLAVE; RESET SLAVE; @@ -3224,45 +2458,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result index 7eddaabc636..5f1f72a9a3a 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result @@ -49,82 +49,82 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1; --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1' -set global sql_slave_skip_counter=1; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave.inc [on slave] show tables like 't%'; diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result index 600ac44fc86..3bb96b669d7 100644 --- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result +++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result @@ -19,43 +19,9 @@ stop slave; change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=SLAVE_PORT; include/start_slave.inc +CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM; +INSERT INTO t1 VALUE(1); FLUSH LOGS; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port SLAVE_PORT -Connect_Retry 60 -Master_Log_File slave-bin.000001 -Read_Master_Log_Pos POSITION -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File slave-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos POSITION -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert # -Last_IO_Errno # -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +INSERT INTO t1 VALUE(2); +Checking that both slave threads are running. +Relay_Log_File relay-log.000003 diff --git a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result index a34c536feb8..6d3e73f787d 100644 --- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result +++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result @@ -31,6 +31,5 @@ include/stop_slave.inc change master to master_port=SLAVE_PORT; start slave; *** must be having the replicate-same-server-id IO thread error *** -Slave_IO_Errno= 1593 -Slave_IO_Error= Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it). +Last_IO_Error = Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it). SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/rpl/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result index 1bed6101e3c..285d52b7678 100644 --- a/mysql-test/suite/rpl/r/rpl_grant.result +++ b/mysql-test/suite/rpl/r/rpl_grant.result @@ -41,42 +41,3 @@ user host SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%'; COUNT(*) 0 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result index c3baabbdbc3..6c226aaf2f7 100644 --- a/mysql-test/suite/rpl/r/rpl_incident.result +++ b/mysql-test/suite/rpl/r/rpl_incident.result @@ -19,51 +19,13 @@ a 2 3 4 +Last_SQL_Error = The incident LOST_EVENTS occured on the master. Message: **** On Slave **** SELECT * FROM t1; a 1 2 3 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File # -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1590 -Last_Error The incident LOST_EVENTS occured on the master. Message: -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 1590 -Last_SQL_Error The incident LOST_EVENTS occured on the master. Message: SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; SELECT * FROM t1; @@ -72,43 +34,5 @@ a 2 3 4 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File # -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000002 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result index fbb1e2355c3..549842198e8 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result @@ -136,25 +136,24 @@ ALTER TABLE t2 DROP COLUMN d; ******************** SHOW BINLOG EVENTS ******************** -show binlog events from 1; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: # -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test_rpl -master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test_rpl_1 -master-bin.000001 # Query 1 # CREATE DATABASE test_rpl_1 CHARACTER SET utf8 COLLATE utf8_general_ci -master-bin.000001 # Query 1 # ALTER DATABASE test_rpl_1 CHARACTER SET latin1 COLLATE latin1_general_ci -master-bin.000001 # Query 1 # DROP DATABASE test_rpl_1 -master-bin.000001 # Query 1 # CREATE DATABASE test_rpl CHARACTER SET utf8 COLLATE utf8_general_ci -master-bin.000001 # Query 1 # ALTER DATABASE test_rpl CHARACTER SET latin1 COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `test_rpl`; CREATE TABLE t0 (a int auto_increment not null, c int not null, PRIMARY KEY(a), KEY index2 (c)) ENGINE=innodb -master-bin.000001 # Query 1 # use `test_rpl`; ALTER TABLE t0 DROP INDEX index2 -master-bin.000001 # Query 1 # use `test_rpl`; ALTER TABLE t0 ADD COLUMN b char(254) -master-bin.000001 # Query 1 # use `test_rpl`; ALTER TABLE t0 ADD INDEX index1 (b) -master-bin.000001 # Query 1 # use `test_rpl`; ALTER TABLE t0 DROP COLUMN c -master-bin.000001 # Query 1 # use `test_rpl`; RENAME TABLE t0 TO t1 -master-bin.000001 # Query 1 # use `test_rpl`; CREATE TABLE t2 LIKE t1 -master-bin.000001 # Query 1 # use `test_rpl`; ALTER TABLE t2 ADD COLUMN d datetime -master-bin.000001 # Query 1 # use `test_rpl`; CREATE INDEX index2 on t2 (d) -master-bin.000001 # Query 1 # use `test_rpl`; CREATE INDEX index3 on t2 (a, d) -master-bin.000001 # Query 1 # use `test_rpl`; ALTER TABLE t2 DROP COLUMN d +master-bin.000001 # Query # # DROP DATABASE IF EXISTS test_rpl +master-bin.000001 # Query # # DROP DATABASE IF EXISTS test_rpl_1 +master-bin.000001 # Query # # CREATE DATABASE test_rpl_1 CHARACTER SET utf8 COLLATE utf8_general_ci +master-bin.000001 # Query # # ALTER DATABASE test_rpl_1 CHARACTER SET latin1 COLLATE latin1_general_ci +master-bin.000001 # Query # # DROP DATABASE test_rpl_1 +master-bin.000001 # Query # # CREATE DATABASE test_rpl CHARACTER SET utf8 COLLATE utf8_general_ci +master-bin.000001 # Query # # ALTER DATABASE test_rpl CHARACTER SET latin1 COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `test_rpl`; CREATE TABLE t0 (a int auto_increment not null, c int not null, PRIMARY KEY(a), KEY index2 (c)) ENGINE=innodb +master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t0 DROP INDEX index2 +master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t0 ADD COLUMN b char(254) +master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t0 ADD INDEX index1 (b) +master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t0 DROP COLUMN c +master-bin.000001 # Query # # use `test_rpl`; RENAME TABLE t0 TO t1 +master-bin.000001 # Query # # use `test_rpl`; CREATE TABLE t2 LIKE t1 +master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 ADD COLUMN d datetime +master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index2 on t2 (d) +master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index3 on t2 (a, d) +master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 DROP COLUMN d drop database test_rpl; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 58b9d445037..26f2545dd72 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -830,278 +830,277 @@ DELETE FROM t2; ******************** SHOW BINLOG EVENTS ******************** -show binlog events from 1; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: # -master-bin.000001 # Query 1 # CREATE DATABASE test_rpl -master-bin.000001 # Query 1 # use `test_rpl`; CREATE TABLE t1 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=innodb -master-bin.000001 # Query 1 # use `test_rpl`; CREATE TABLE t2 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=innodb -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(2, 't1, text 2') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t2) -master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 SELECT * FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1' -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 WHERE a = 2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=# -master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, `b`) ;file_id=# -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(2, 't1, text 2') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(3, 't1, text 3') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; REPLACE INTO t1 VALUES(1, 't1, text 11') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1) -master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; REPLACE INTO t1 SET a=3, b='t1, text 33' -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 'CCC') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(2, 'DDD') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(1, 'DDD') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(2, 'CCC') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; TRUNCATE t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test' -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (1, 'start') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (3, 'before savepoint s1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2') -master-bin.000001 # Query 1 # SAVEPOINT s2 -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2') -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 7 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # use `test_rpl`; CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111' -master-bin.000001 # Query 1 # use `test_rpl`; GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost' -master-bin.000001 # Query 1 # use `test_rpl`; REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost' -master-bin.000001 # Query 1 # use `test_rpl`; SET PASSWORD FOR 'user_test_rpl'@'localhost'='*0000000000000000000000000000000000000000' -master-bin.000001 # Query 1 # use `test_rpl`; RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost' -master-bin.000001 # Query 1 # use `test_rpl`; DROP USER 'user_test_rpl_2'@'localhost' -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(100, 'test') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # use `test_rpl`; ANALYZE TABLE t1 -master-bin.000001 # Query 1 # use `test_rpl`; OPTIMIZE TABLE t1 -master-bin.000001 # Query 1 # use `test_rpl`; REPAIR TABLE t1 -master-bin.000001 # Query 1 # use `test_rpl`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +master-bin.000001 # Query # # CREATE DATABASE test_rpl +master-bin.000001 # Query # # use `test_rpl`; CREATE TABLE t1 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=innodb +master-bin.000001 # Query # # use `test_rpl`; CREATE TABLE t2 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=innodb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(2, 't1, text 2') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test_rpl.t2) +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 SELECT * FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1' +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 WHERE a = 2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test_rpl`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, `b`) ;file_id=# +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(2, 't1, text 2') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(3, 't1, text 3') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; REPLACE INTO t1 VALUES(1, 't1, text 11') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; REPLACE INTO t1 SET a=3, b='t1, text 33' +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 'CCC') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(2, 'DDD') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(1, 'DDD') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(2, 'CCC') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; TRUNCATE t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test' +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (1, 'start') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (3, 'before savepoint s1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2') +master-bin.000001 # Query # # SAVEPOINT s2 +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2') +master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 7 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test_rpl`; CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111' +master-bin.000001 # Query # # use `test_rpl`; GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost' +master-bin.000001 # Query # # use `test_rpl`; REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost' +master-bin.000001 # Query # # use `test_rpl`; SET PASSWORD FOR 'user_test_rpl'@'localhost'='*0000000000000000000000000000000000000000' +master-bin.000001 # Query # # use `test_rpl`; RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost' +master-bin.000001 # Query # # use `test_rpl`; DROP USER 'user_test_rpl_2'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(100, 'test') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test_rpl`; ANALYZE TABLE t1 +master-bin.000001 # Query # # use `test_rpl`; OPTIMIZE TABLE t1 +master-bin.000001 # Query # # use `test_rpl`; REPAIR TABLE t1 +master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() BEGIN UPDATE t1 SET b = 'test' WHERE a = 201; END -master-bin.000001 # Query 1 # use `test_rpl`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`() +master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`() BEGIN UPDATE t1 SET b = UUID() WHERE a = 202; END -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(201, 'test 201') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; UPDATE t1 SET b = 'test' WHERE a = 201 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(202, 'test 202') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1) -master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 202 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # use `test_rpl`; ALTER PROCEDURE p1 COMMENT 'p1' -master-bin.000001 # Query 1 # use `test_rpl`; DROP PROCEDURE p1 -master-bin.000001 # Query 1 # use `test_rpl`; DROP PROCEDURE p2 -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # use `test_rpl`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(201, 'test 201') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; UPDATE t1 SET b = 'test' WHERE a = 201 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(202, 'test 202') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 202 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test_rpl`; ALTER PROCEDURE p1 COMMENT 'p1' +master-bin.000001 # Query # # use `test_rpl`; DROP PROCEDURE p1 +master-bin.000001 # Query # # use `test_rpl`; DROP PROCEDURE p2 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN INSERT INTO t2 SET a = NEW.a, b = NEW.b; END -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1) -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # use `test_rpl`; DROP TRIGGER tr1 -master-bin.000001 # Query 1 # use `test_rpl`; GRANT EVENT ON *.* TO 'root'@'localhost' -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # use `test_rpl`; CREATE DEFINER=`root`@`localhost` EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1 -master-bin.000001 # Query 1 # use `test_rpl`; ALTER EVENT e1 RENAME TO e2 -master-bin.000001 # Query 1 # use `test_rpl`; DROP EVENT e2 -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(2, 'test2') -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 1 -master-bin.000001 # Query 1 # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS SELECT * FROM t1 WHERE b <> UUID() -master-bin.000001 # Query 1 # use `test_rpl`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 2 -master-bin.000001 # Query 1 # use `test_rpl`; DROP VIEW v1 -master-bin.000001 # Query 1 # use `test_rpl`; DROP VIEW v2 -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 -master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 -master-bin.000001 # Xid 1 # # +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) +master-bin.000001 # Table_map # # table_id: # (test_rpl.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test_rpl`; DROP TRIGGER tr1 +master-bin.000001 # Query # # use `test_rpl`; GRANT EVENT ON *.* TO 'root'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1 +master-bin.000001 # Query # # use `test_rpl`; ALTER EVENT e1 RENAME TO e2 +master-bin.000001 # Query # # use `test_rpl`; DROP EVENT e2 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(2, 'test2') +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 1 +master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS SELECT * FROM t1 WHERE b <> UUID() +master-bin.000001 # Query # # use `test_rpl`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 2 +master-bin.000001 # Query # # use `test_rpl`; DROP VIEW v1 +master-bin.000001 # Query # # use `test_rpl`; DROP VIEW v2 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 +master-bin.000001 # Xid # # COMMIT /* XID */ drop database test_rpl; diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 75180334c28..daefee9c669 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -11,45 +11,7 @@ SELECT * FROM t1; a b 1 10 2 2 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1105 -Last_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10' -Skip_Counter 0 -Exec_Master_Log_Pos 246 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 1105 -Last_SQL_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10' +Last_SQL_Error = Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10' SELECT * FROM t1; a b stop slave; @@ -94,49 +56,7 @@ id field_1 field_2 field_3 4 4 d 4d 5 5 e 5e 6 6 f 6f -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1105 -Last_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1 (field_1, field_2, field_3) -SELECT t2.field_a, t2.field_b, t2.field_c -FROM t2 -ON DUPLICATE KEY UPDATE -t1.field_3 = t2.field_c' -Skip_Counter 0 -Exec_Master_Log_Pos 1278 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 1105 -Last_SQL_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1 (field_1, field_2, field_3) +Last_SQL_Error = Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1 (field_1, field_2, field_3) SELECT t2.field_a, t2.field_b, t2.field_c FROM t2 ON DUPLICATE KEY UPDATE diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result index ba0aa847cf7..9acc1ad93ac 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result @@ -6,85 +6,9 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 290 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 290 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 560 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1593 -Last_Error Fatal error: Not enough memory -Skip_Counter 0 -Exec_Master_Log_Pos 325 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1593 -Last_SQL_Error Fatal error: Not enough memory +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Fatal error: Not enough memory SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; +include/start_slave.inc DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 85fa4c10eac..d9f02f6e82f 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -9,87 +9,11 @@ show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # include/stop_slave.inc -change master to master_log_pos=75; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -start slave; -include/stop_slave.inc -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 +change master to master_log_pos=MASTER_LOG_POS; Read_Master_Log_Pos 75 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 75 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +start slave; +Last_IO_Error = Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master' +include/stop_slave.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # @@ -97,7 +21,7 @@ create table if not exists t1 (n int); drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); -change master to master_log_pos=4; +change master to master_log_pos=MASTER_LOG_POS; start slave; select * from t1 ORDER BY n; n diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result index 2e707fb62c1..6bb9b139057 100644 --- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result +++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result @@ -14,63 +14,22 @@ MIXED MIXED CREATE TABLE t1 (a INT, b LONG); INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG) -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT **** On Slave **** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 594 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 594 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert # -Last_IO_Errno # -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG) -slave-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -slave-bin.000001 # Query 1 # BEGIN -slave-bin.000001 # Table_map 1 # table_id: # (test.t1) -slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000001 # Query 1 # COMMIT +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT DROP TABLE IF EXISTS t1; SET @@global.binlog_format= @old_binlog_format; diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result index 33088ee2ec8..637047a883b 100644 --- a/mysql-test/suite/rpl/r/rpl_replicate_do.result +++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result @@ -26,45 +26,7 @@ n select * from t11; ERROR 42S02: Table 'test.t11' doesn't exist drop table if exists t1,t2,t11; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB Replicate_Do_Table test.t1 -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error create table t1 (ts timestamp); set one_shot time_zone='met'; insert into t1 values('2005-08-12 00:00:00'); diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index 013ba87ec0b..b50c7cebcab 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -14,45 +14,9 @@ create temporary table temp_table (a char(80) not null); insert into temp_table values ("testing temporary tables"); create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 60 Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. select * from t1; s Could not break slave @@ -93,45 +57,9 @@ show binary logs; Log_name File_size master-bin.000003 # insert into t2 values (65); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 60 Master_Log_File master-bin.000003 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # Relay_Master_Log_File master-bin.000003 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. select * from t2; m 34 @@ -157,45 +85,9 @@ master-bin.000005 # select * from t4; a testing temporary tables part 2 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 60 Master_Log_File master-bin.000005 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # Relay_Master_Log_File master-bin.000005 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index 7920b9a981d..458ae53e79c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -56,14 +56,13 @@ DELETE FROM t1; INSERT INTO t1 VALUES (1),(2); DELETE FROM t1 WHERE a = 0; UPDATE t1 SET a=99 WHERE a = 0; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 192 use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 192 Query 1 260 BEGIN -master-bin.000001 260 Table_map 1 301 table_id: # (test.t1) -master-bin.000001 301 Write_rows 1 340 table_id: # flags: STMT_END_F -master-bin.000001 340 Query 1 409 COMMIT +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT DROP TABLE t1; ================ Test for BUG#17620 ================ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index a980092ac37..a247c3a6039 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -436,8 +436,7 @@ DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; -Last_SQL_Error - +Checking that both slave threads are running. SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 **** Test for BUG#37076 **** @@ -487,8 +486,7 @@ Comparing tables master:test.t2 and slave:test.t2 [expecting slave to stop] INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -500,8 +498,7 @@ Comparing tables master:test.t4 and slave:test.t4 [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -509,8 +506,7 @@ START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index ea0c322fe6d..fefe8e969dc 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -436,8 +436,7 @@ DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; -Last_SQL_Error - +Checking that both slave threads are running. SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 **** Test for BUG#37076 **** @@ -487,8 +486,7 @@ Comparing tables master:test.t2 and slave:test.t2 [expecting slave to stop] INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -500,8 +498,7 @@ Comparing tables master:test.t4 and slave:test.t4 [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -509,8 +506,7 @@ START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index 6d002a722f1..417bc65641a 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -18,45 +18,7 @@ CREATE TABLE t1 (a DECIMAL(20, 10)); RESET MASTER; INSERT INTO t1 VALUES (901251.90125); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -72,45 +34,7 @@ CREATE TABLE t1 (a DECIMAL(27, 18)); RESET MASTER; INSERT INTO t1 VALUES (901251.90125); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 12, test.t1 on slave has size 12. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 12, test.t1 on slave has size 12. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 12, test.t1 on slave has size 12. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -126,45 +50,7 @@ CREATE TABLE t1 (a NUMERIC(20, 10)); RESET MASTER; INSERT INTO t1 VALUES (901251.90125); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -181,45 +67,7 @@ CREATE TABLE t1 (a FLOAT(47)); RESET MASTER; INSERT INTO t1 VALUES (901251.90125); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4 +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4 SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -236,45 +84,7 @@ CREATE TABLE t1 (a BIT(64)); RESET MASTER; INSERT INTO t1 VALUES (B'10101'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 8, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 8, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 8, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -290,45 +100,7 @@ CREATE TABLE t1 (a BIT(12)); RESET MASTER; INSERT INTO t1 VALUES (B'10101'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 2. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 2. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 2. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -345,45 +117,7 @@ CREATE TABLE t1 (a SET('1','2','3','4','5','6','7','8','9')); RESET MASTER; INSERT INTO t1 VALUES ('4'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -400,45 +134,7 @@ CREATE TABLE t1 (a CHAR(20)); RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 20, test.t1 on slave has size 11. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 20, test.t1 on slave has size 11. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 20, test.t1 on slave has size 11. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -486,45 +182,7 @@ CREATE TABLE t1 (a ENUM( RESET MASTER; INSERT INTO t1 VALUES ('44'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -541,45 +199,7 @@ CREATE TABLE t1 (a VARCHAR(2000)); RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 100. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 100. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 100. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -595,45 +215,7 @@ CREATE TABLE t1 (a VARCHAR(200)); RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 200, test.t1 on slave has size 10. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 200, test.t1 on slave has size 10. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 200, test.t1 on slave has size 10. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -649,45 +231,7 @@ CREATE TABLE t1 (a VARCHAR(2000)); RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 1000. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 1000. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 1000. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -704,45 +248,7 @@ CREATE TABLE t1 (a LONGBLOB); RESET MASTER; INSERT INTO t1 VALUES ('This is a test.'); START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 4, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 4, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 0 size mismatch - master has size 4, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. SELECT COUNT(*) FROM t1; COUNT(*) 0 diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index 8a1b7a805aa..e480ff3dfe9 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -13,31 +13,12 @@ CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT) ENGINE=Merge; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; -SHOW BINLOG EVENTS FROM 106; -Log_name # -Pos 106 -Event_type Query -Server_id # -End_log_pos 199 -Info use `test`; CREATE TABLE t1 (a INT, b INT) -Log_name # -Pos 199 -Event_type Query -Server_id # -End_log_pos 305 -Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge -Log_name # -Pos 305 -Event_type Query -Server_id # -End_log_pos 411 -Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8 -Log_name # -Pos 411 -Event_type Query -Server_id # -End_log_pos 530 -Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b INT) +master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge +master-bin.000001 # Query # # use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8 +master-bin.000001 # Query # # use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8 **** On Master **** SHOW CREATE TABLE t1; Table t1 @@ -137,7 +118,7 @@ RESET MASTER; include/start_slave.inc CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; ERROR 23000: Duplicate entry '2' for key 'b' -SHOW BINLOG EVENTS FROM 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info CREATE TABLE t7 (a INT, b INT UNIQUE); INSERT INTO t7 SELECT a,b FROM tt3; @@ -147,13 +128,13 @@ a b 1 2 2 4 3 6 -SHOW BINLOG EVENTS FROM 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -# 106 Query # 206 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) -# 206 Query # 274 BEGIN -# 274 Table_map # 316 table_id: # (test.t7) -# 316 Write_rows # 372 table_id: # flags: STMT_END_F -# 372 Query # 443 ROLLBACK +master-bin.000001 # Query # # use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t7) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # ROLLBACK SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -171,12 +152,12 @@ INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -SHOW BINLOG EVENTS FROM 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -# 106 Query # 174 BEGIN -# 174 Table_map # 216 table_id: # (test.t7) -# 216 Write_rows # 272 table_id: # flags: STMT_END_F -# 272 Query # 341 COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t7) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -216,10 +197,10 @@ Create Table CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW BINLOG EVENTS FROM 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -# 106 Query # 192 use `test`; CREATE TABLE t8 LIKE t4 -# 192 Query # 331 use `test`; CREATE TABLE `t9` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE t8 LIKE t4 +master-bin.000001 # Query # # use `test`; CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) @@ -289,38 +270,38 @@ a 1 2 3 -SHOW BINLOG EVENTS FROM 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT) -# 192 Query # 260 BEGIN -# 260 Table_map # 301 table_id: # (test.t1) -# 301 Write_rows # 345 table_id: # flags: STMT_END_F -# 345 Query # 414 COMMIT -# 414 Query # 482 BEGIN -# 482 Query # 607 use `test`; CREATE TABLE `t2` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 607 Table_map # 648 table_id: # (test.t2) -# 648 Write_rows # 692 table_id: # flags: STMT_END_F -# 692 Xid # 719 COMMIT /* XID */ -# 719 Query # 787 BEGIN -# 787 Query # 912 use `test`; CREATE TABLE `t3` ( +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `t3` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 912 Table_map # 953 table_id: # (test.t3) -# 953 Write_rows # 997 table_id: # flags: STMT_END_F -# 997 Xid # 1024 COMMIT /* XID */ -# 1024 Query # 1092 BEGIN -# 1092 Query # 1217 use `test`; CREATE TABLE `t4` ( +master-bin.000001 # Table_map # # table_id: # (test.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 1217 Table_map # 1258 table_id: # (test.t4) -# 1258 Write_rows # 1302 table_id: # flags: STMT_END_F -# 1302 Xid # 1329 COMMIT /* XID */ -# 1329 Query # 1397 BEGIN -# 1397 Table_map # 1438 table_id: # (test.t1) -# 1438 Write_rows # 1482 table_id: # flags: STMT_END_F -# 1482 Query # 1551 COMMIT +master-bin.000001 # Table_map # # table_id: # (test.t4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT SHOW TABLES; Tables_in_test t1 @@ -374,20 +355,20 @@ a 4 6 9 -SHOW BINLOG EVENTS FROM 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT) -# 192 Query # 260 BEGIN -# 260 Table_map # 301 table_id: # (test.t1) -# 301 Write_rows # 345 table_id: # flags: STMT_END_F -# 345 Query # 414 COMMIT -# 414 Query # 514 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB -# 514 Query # 582 BEGIN -# 582 Table_map # 623 table_id: # (test.t2) -# 623 Write_rows # 667 table_id: # flags: STMT_END_F -# 667 Table_map # 708 table_id: # (test.t2) -# 708 Write_rows # 747 table_id: # flags: STMT_END_F -# 747 Xid # 774 COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a 1 @@ -413,14 +394,14 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back SELECT * FROM t2 ORDER BY a; a -SHOW BINLOG EVENTS FROM 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -# 106 Query # 174 BEGIN -# 174 Table_map # 215 table_id: # (test.t2) -# 215 Write_rows # 259 table_id: # flags: STMT_END_F -# 259 Table_map # 300 table_id: # (test.t2) -# 300 Write_rows # 339 table_id: # flags: STMT_END_F -# 339 Query # 410 ROLLBACK +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # ROLLBACK SELECT * FROM t2 ORDER BY a; a DROP TABLE t1,t2; diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result index 89654ebf165..048e07271b3 100644 --- a/mysql-test/suite/rpl/r/rpl_row_drop.result +++ b/mysql-test/suite/rpl/r/rpl_row_drop.result @@ -41,12 +41,11 @@ t1 t2 **** On Master **** DROP TABLE t1,t2; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 192 use `test`; CREATE TABLE t1 (a int) -master-bin.000001 192 Query 1 278 use `test`; CREATE TABLE t2 (a int) -master-bin.000001 278 Query 1 382 use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int) +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ SHOW TABLES; Tables_in_test t2 diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result index 129bad0fbcc..61fee130d49 100644 --- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result +++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result @@ -12,16 +12,12 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 897 ; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 +master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 897 ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 -master-bin.000001 # Query 1 # use `test`; flush tables select * from t3; a stop slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result index 9593b009d1f..0f648539c47 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log.result +++ b/mysql-test/suite/rpl/r/rpl_row_log.result @@ -7,7 +7,7 @@ start slave; include/stop_slave.inc reset master; reset slave; -start slave; +include/start_slave.inc create table t1(n int not null auto_increment primary key)ENGINE=MyISAM; insert into t1 values (NULL); drop table t1; @@ -16,30 +16,29 @@ load data infile 'LOAD_FILE' into table t1 ignore 1 lines; select count(*) from t1; count(*) 69 -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # COMMIT -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # COMMIT -show binlog events from 106 limit 1; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +show binlog events from limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -show binlog events from 106 limit 2; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +show binlog events from limit 2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -master-bin.000001 # Query 1 # BEGIN -show binlog events from 106 limit 2,1; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +master-bin.000001 # Query # # BEGIN +show binlog events from limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t1) flush logs; create table t3 (a int)ENGINE=MyISAM; select * from t1 order by 1 asc; @@ -203,15 +202,14 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002'; +show binlog events in 'master-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM -master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM -master-bin.000002 # Query 1 # BEGIN -master-bin.000002 # Table_map 1 # table_id: # (test.t2) -master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000002 # Query 1 # COMMIT +master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM +master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Table_map # # table_id: # (test.t2) +master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000002 # Query # # COMMIT show binary logs; Log_name File_size master-bin.000001 # @@ -220,69 +218,29 @@ show binary logs; Log_name File_size slave-bin.000001 # slave-bin.000002 # -show binlog events in 'slave-bin.000001' from 4; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -slave-bin.000001 # Query 1 # BEGIN -slave-bin.000001 # Table_map 1 # table_id: # (test.t1) -slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000001 # Query 1 # COMMIT -slave-bin.000001 # Query 1 # use `test`; drop table t1 -slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM -slave-bin.000001 # Query 1 # BEGIN -slave-bin.000001 # Table_map 1 # table_id: # (test.t1) -slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000001 # Query 1 # COMMIT -slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM -slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 -show binlog events in 'slave-bin.000002' from 4; +slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # use `test`; drop table t1 +slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM +slave-bin.000001 # Rotate # # slave-bin.000002;pos=4 +show binlog events in 'slave-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test.t2) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000002 -Read_Master_Log_Pos 516 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000002 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 516 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM +slave-bin.000002 # Query # # BEGIN +slave-bin.000002 # Table_map # # table_id: # (test.t2) +slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000002 # Query # # COMMIT +Checking that both slave threads are running. show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result index 8526bad558b..ff189e676cc 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result @@ -7,7 +7,7 @@ start slave; include/stop_slave.inc reset master; reset slave; -start slave; +include/start_slave.inc create table t1(n int not null auto_increment primary key)ENGINE=InnoDB; insert into t1 values (NULL); drop table t1; @@ -16,30 +16,29 @@ load data infile 'LOAD_FILE' into table t1 ignore 1 lines; select count(*) from t1; count(*) 69 -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* XID */ -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* XID */ -show binlog events from 106 limit 1; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +show binlog events from limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB -show binlog events from 106 limit 2; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +show binlog events from limit 2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB -master-bin.000001 # Query 1 # BEGIN -show binlog events from 106 limit 2,1; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +master-bin.000001 # Query # # BEGIN +show binlog events from limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t1) flush logs; create table t3 (a int)ENGINE=InnoDB; select * from t1 order by 1 asc; @@ -203,15 +202,14 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Rotate # # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002'; +show binlog events in 'master-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB -master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB -master-bin.000002 # Query 1 # BEGIN -master-bin.000002 # Table_map 1 # table_id: # (test.t2) -master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000002 # Xid 1 # COMMIT /* XID */ +master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=InnoDB +master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=InnoDB +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Table_map # # table_id: # (test.t2) +master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000002 # Xid # # COMMIT /* XID */ show binary logs; Log_name File_size master-bin.000001 # @@ -220,69 +218,29 @@ show binary logs; Log_name File_size slave-bin.000001 # slave-bin.000002 # -show binlog events in 'slave-bin.000001' from 4; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB -slave-bin.000001 # Query 1 # BEGIN -slave-bin.000001 # Table_map 1 # table_id: # (test.t1) -slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000001 # Xid 1 # COMMIT /* XID */ -slave-bin.000001 # Query 1 # use `test`; drop table t1 -slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB -slave-bin.000001 # Query 1 # BEGIN -slave-bin.000001 # Table_map 1 # table_id: # (test.t1) -slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000001 # Xid 1 # COMMIT /* XID */ -slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB -slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 -show binlog events in 'slave-bin.000002' from 4; +slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # use `test`; drop table t1 +slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=InnoDB +slave-bin.000001 # Rotate # # slave-bin.000002;pos=4 +show binlog events in 'slave-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test.t2) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Xid 1 # COMMIT /* XID */ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000002 -Read_Master_Log_Pos 474 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000002 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 474 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=InnoDB +slave-bin.000002 # Query # # BEGIN +slave-bin.000002 # Table_map # # table_id: # (test.t2) +slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000002 # Xid # # COMMIT /* XID */ +Checking that both slave threads are running. show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result index 2215b34814e..db06cb6d3de 100644 --- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result +++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result @@ -21,45 +21,7 @@ select @@global.max_relay_log_size; @@global.max_relay_log_size 4096 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 2 # @@ -69,45 +31,7 @@ set global max_relay_log_size=(5*4096); select @@global.max_relay_log_size; @@global.max_relay_log_size 20480 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 3: max_relay_log_size = 0 # @@ -117,90 +41,13 @@ set global max_relay_log_size=0; select @@global.max_relay_log_size; @@global.max_relay_log_size 0 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # stop slave; reset slave; flush logs; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error # # Test 5 # @@ -208,89 +55,13 @@ reset slave; start slave; flush logs; create table t1 (a int); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # flush logs; drop table t1; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result index fa40d8760a8..7bf09df31ca 100644 --- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result @@ -4,196 +4,37 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -stop slave; +Master_Host 127.0.0.1 +include/stop_slave.inc change master to master_user='test'; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 Master_User test -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -reset slave; -SHOW SLAVE STATUS; -Slave_IO_State # Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -stop slave; reset slave; -start slave; +Master_User root +Master_Host 127.0.0.1 +include/start_slave.inc +Master_User root +Master_Host 127.0.0.1 +include/stop_slave.inc +reset slave; +include/start_slave.inc create temporary table t1 (a int); -stop slave; +include/stop_slave.inc reset slave; -start slave; +include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 -stop slave; +include/stop_slave.inc reset slave; -*** errno must be zero: 0 *** change master to master_user='impossible_user_name'; start slave; -ONE -1 include/stop_slave.inc change master to master_user='root'; include/start_slave.inc -*** last errno must be zero: 0 *** -*** last error must be blank: *** include/stop_slave.inc change master to master_user='impossible_user_name'; start slave; -ONE -1 include/stop_slave.inc reset slave; -*** io last errno must be zero: 0 *** -*** io last error must be blank: *** -*** sql last errno must be zero: 0 *** -*** sql last error must be blank: *** diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result index bb9865ab2d1..2b83bffd85f 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result @@ -118,214 +118,27 @@ a b SELECT * FROM t2; a 2 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 1535 -Last_SQL_Error -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc INSERT INTO t9 VALUES (5); INSERT INTO t5 VALUES (5,10,25); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 1535 -Last_SQL_Error -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc INSERT INTO t9 VALUES (6); INSERT INTO t6 VALUES (6,12,36); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 1535 -Last_SQL_Error -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc INSERT INTO t9 VALUES (6); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); SELECT * FROM t7 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result index f606a28c2d9..a42530c354d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result @@ -118,214 +118,27 @@ a b SELECT * FROM t2; a 2 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 1535 -Last_SQL_Error -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc INSERT INTO t9 VALUES (5); INSERT INTO t5 VALUES (5,10,25); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 1535 -Last_SQL_Error -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc INSERT INTO t9 VALUES (6); INSERT INTO t6 VALUES (6,12,36); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 1535 -Last_SQL_Error -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc INSERT INTO t9 VALUES (6); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); SELECT * FROM t7 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result index ad54450af74..81aeb0d645b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_until.result +++ b/mysql-test/suite/rpl/r/rpl_row_until.result @@ -20,188 +20,32 @@ n 2 3 4 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos MASTER_POS_DROP_T1 -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos MASTER_POS_DROP_T1 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291; +START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; SELECT * FROM t1; n 1 2 3 4 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos MASTER_POS_DROP_T1 -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-no-such-bin.000001 -Until_Log_Pos 291 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2 SELECT * FROM t2; n 1 2 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos MASTER_POS_INSERT1_T2 -Relay_Log_Space # -Until_Condition Relay -Until_Log_File slave-relay-bin.000002 -Until_Log_Pos RELAY_POS_INSERT1_T2 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error START SLAVE; include/stop_slave.inc START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos MASTER_POS_DROP_T2 -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos MASTER_POS_CREATE_T2 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS, RELAY_LOG_POS=RELAY_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561; +START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL START SLAVE; -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; Warnings: Note 1254 Slave is already running diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result index d955859f030..0aa8069a38c 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -31,45 +31,7 @@ n 3 7 8 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. ==== Clean Up ==== drop table t1; create table t1(a int primary key); @@ -84,45 +46,7 @@ select * from t1; a 1 2 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. ==== Clean Up ==== drop table t1; ==== Using Innodb ==== diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result index e2efcf08d7a..c3c4f7c015a 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result @@ -10,45 +10,6 @@ insert into t1(b) values (1); insert into t1(b) values (2); load data infile '../../std_data/rpl_loaddata.dat' into table t1; commit; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 9 -Last_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 9 -Last_SQL_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed drop table t1; drop table t1; call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3"); diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result index 6148de5d954..a4067fb7983 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_skip.result +++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result @@ -42,46 +42,7 @@ c d 2 8 3 18 **** On Slave **** -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=762; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 1115 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 762 -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos 762 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; SELECT * FROM t1; @@ -104,48 +65,9 @@ show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # User var # # @`foo`=12 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@foo, 2*@foo) -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 248 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 248 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error **** On Master **** DROP TABLE t1, t2; SET SESSION BINLOG_FORMAT=ROW; diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index 631369b2b74..8f06653f8ab 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -409,110 +409,110 @@ return 0; end| use mysqltest; set @a:= mysqltest2.f1(); -show binlog events in 'master-bin.000001' from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest1 -master-bin.000001 # Query 1 # create database mysqltest1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +master-bin.000001 # Query # # drop database if exists mysqltest1 +master-bin.000001 # Query # # create database mysqltest1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() begin declare b int; set b = 8; insert into t1 values (b); insert into t1 values (unix_timestamp()); end -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8)) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (unix_timestamp()) -master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`() +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8)) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (unix_timestamp()) +master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`() select * from mysqltest1.t1 -master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo2 contains sql -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 like t1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo3`() +master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo2 contains sql +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int) +master-bin.000001 # Query # # use `mysqltest1`; create table t2 like t1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo3`() DETERMINISTIC insert into t1 values (15) -master-bin.000001 # Query 1 # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1 -master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1 -master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`() +master-bin.000001 # Query # # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query # # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query # # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`() DETERMINISTIC begin insert into t2 values(3); insert into t1 values (5); end -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (15) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3) -master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo4 sql security invoker -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (5) -master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a) -master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo4 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`() +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (15) +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo4 sql security invoker +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (5) +master-bin.000001 # Query # # use `mysqltest1`; delete from t2 +master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a) +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`() DETERMINISTIC begin insert into t2 values(20),(20); end -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(20),(20) -master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo4 -master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo -master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo2 -master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo3 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(20),(20) +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4 +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo2 +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo3 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) DETERMINISTIC begin insert into t1 values (x); return x+2; end -master-bin.000001 # Query 1 # use `mysqltest1`; delete t1,t2 from t1,t2 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(fn1(21)) -master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11) +master-bin.000001 # Query # # use `mysqltest1`; delete t1,t2 from t1,t2 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(fn1(21)) +master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11) NO SQL begin return unix_timestamp(); end -master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(fn1()) -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) +master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(fn1()) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) NO SQL begin return unix_timestamp(); end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11) READS SQL DATA begin return 0; end -master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a) -master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) +master-bin.000001 # Query # # use `mysqltest1`; delete from t2 +master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a) +master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) begin insert into t2 values(x),(x); return 10; end -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100) -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) -master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1) -master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop trigger trg -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1) -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100) +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) +master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1) +master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop trigger trg +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() READS SQL DATA select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo -master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1 -master-bin.000001 # Query 1 # drop database mysqltest1 -master-bin.000001 # Query 1 # drop user "zedjzlcsjhd"@127.0.0.1 -master-bin.000001 # Query 1 # use `test`; drop function if exists f1 -master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo +master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 +master-bin.000001 # Query # # drop database mysqltest1 +master-bin.000001 # Query # # drop user "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query # # use `test`; drop function if exists f1 +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) READS SQL DATA begin declare var integer; @@ -522,41 +522,41 @@ fetch c into var; close c; return var; end -master-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) -master-bin.000001 # Query 1 # use `test`; insert into t1 (a) values (f1()) -master-bin.000001 # Query 1 # use `test`; drop view v1 -master-bin.000001 # Query 1 # use `test`; drop function f1 -master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE IF EXISTS p1 -master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t1 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(col VARCHAR(10)) -master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10)) +master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # use `test`; insert into t1 (a) values (f1()) +master-bin.000001 # Query # # use `test`; drop view v1 +master-bin.000001 # Query # # use `test`; drop function f1 +master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(col VARCHAR(10)) +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10)) INSERT INTO t1 VALUES(arg) -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci')) -master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1 -master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE IF EXISTS p1 -master-bin.000001 # Query 1 # use `test`; DROP FUNCTION IF EXISTS f1 -master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci')) +master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1 +master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1 +master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS f1 +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() SET @a = 1 -master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) RETURN 0 -master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1 -master-bin.000001 # Query 1 # use `test`; DROP FUNCTION f1 -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # drop database if exists mysqltest -master-bin.000001 # Query 1 # drop database if exists mysqltest2 -master-bin.000001 # Query 1 # create database mysqltest -master-bin.000001 # Query 1 # create database mysqltest2 -master-bin.000001 # Query 1 # use `mysqltest2`; create table t ( t integer ) -master-bin.000001 # Query 1 # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`() +master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1 +master-bin.000001 # Query # # use `test`; DROP FUNCTION f1 +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # drop database if exists mysqltest +master-bin.000001 # Query # # drop database if exists mysqltest2 +master-bin.000001 # Query # # create database mysqltest +master-bin.000001 # Query # # create database mysqltest2 +master-bin.000001 # Query # # use `mysqltest2`; create table t ( t integer ) +master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`() begin end -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t values ( 1 ) -master-bin.000001 # Query 1 # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +master-bin.000001 # Query # # use `mysqltest2`; insert into t values ( 1 ) +master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) begin insert into t values (1); return 0; end -master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`() +master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`() set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators; Warnings: Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result index d188dd353ce..1af4c5e227c 100644 --- a/mysql-test/suite/rpl/r/rpl_ssl.result +++ b/mysql-test/suite/rpl/r/rpl_ssl.result @@ -19,89 +19,23 @@ insert into t1 values(1); select * from t1; t 1 -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User replssl -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 Master_SSL_Allowed Yes -Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_CA_Path +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem -Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. STOP SLAVE; select * from t1; t 1 insert into t1 values (NULL); -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User replssl -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 Master_SSL_Allowed Yes -Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_CA_Path +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem -Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. drop user replssl@localhost; drop table t1; End of 5.0 tests diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result index 74d2550cdaf..5b4aa126c77 100644 --- a/mysql-test/suite/rpl/r/rpl_ssl1.result +++ b/mysql-test/suite/rpl/r/rpl_ssl1.result @@ -18,89 +18,23 @@ start slave; select * from t1; t 1 -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User replssl -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File # -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File # -Slave_IO_Running # -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 Master_SSL_Allowed Yes -Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_CA_Path +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem -Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. stop slave; change master to master_user='root',master_password='', master_ssl=0; start slave; drop user replssl@localhost; drop table t1; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File # -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File # -Slave_IO_Running # -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 Master_SSL_Allowed No -Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_CA_Path +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem -Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. stop slave; change master to master_host="localhost", @@ -116,43 +50,10 @@ on slave select * from t1; t 1 -show slave status; -Slave_IO_State # -Master_Host localhost -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File # -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File # -Slave_IO_Running # -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 Master_SSL_Allowed Yes -Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_CA_Path +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem -Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert Yes -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result index 74031af1dde..61fee130d49 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result +++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result @@ -12,16 +12,12 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 656 ; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 +master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 656 ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 -master-bin.000001 # Query 1 # use `test`; flush tables select * from t3; a stop slave; diff --git a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result index 5ca0ea2b780..1bed2058687 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result +++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result @@ -52,18 +52,18 @@ CREATE TABLE t1(a int, UNIQUE(a)); INSERT DELAYED IGNORE INTO t1 VALUES(1); INSERT DELAYED IGNORE INTO t1 VALUES(1); flush table t1; -show binlog events in 'master-bin.000002' LIMIT 2,2; +show binlog events in 'master-bin.000002' from limit 1,2; Log_name Pos Event_type Server_id End_log_pos Info -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +master-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +master-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) select * from t1; a 1 On slave -show binlog events in 'slave-bin.000002' LIMIT 2,2; +show binlog events in 'slave-bin.000002' from limit 1,2; Log_name Pos Event_type Server_id End_log_pos Info -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +slave-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +slave-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) select * from t1; a 1 @@ -112,24 +112,14 @@ id name USE test; DROP SCHEMA mysqlslap; use test; -FLUSH LOGS; -FLUSH LOGS; CREATE TABLE t1(a int, UNIQUE(a)); INSERT DELAYED IGNORE INTO t1 VALUES(1); INSERT DELAYED IGNORE INTO t1 VALUES(1); flush table t1; -show binlog events in 'master-bin.000002' LIMIT 2,2; -Log_name Pos Event_type Server_id End_log_pos Info -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) select * from t1; a 1 On slave -show binlog events in 'slave-bin.000002' LIMIT 2,2; -Log_name Pos Event_type Server_id End_log_pos Info -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) select * from t1; a 1 diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result index 47556a33e97..d73a689969f 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_log.result +++ b/mysql-test/suite/rpl/r/rpl_stm_log.result @@ -7,7 +7,7 @@ start slave; include/stop_slave.inc reset master; reset slave; -start slave; +include/start_slave.inc create table t1(n int not null auto_increment primary key)ENGINE=MyISAM; insert into t1 values (NULL); drop table t1; @@ -16,26 +16,25 @@ load data infile 'LOAD_FILE' into table t1 ignore 1 lines; select count(*) from t1; count(*) 69 -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -master-bin.000001 # Intvar 1 # INSERT_ID=1 -master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM -master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 -master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=1 -show binlog events from 106 limit 1; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=# +show binlog events from limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -show binlog events from 106 limit 2; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +show binlog events from limit 2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -master-bin.000001 # Intvar 1 # INSERT_ID=1 -show binlog events from 106 limit 2,1; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +master-bin.000001 # Intvar # # INSERT_ID=1 +show binlog events from limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) flush logs; create table t3 (a int)ENGINE=MyISAM; select * from t1 order by 1 asc; @@ -195,12 +194,11 @@ master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not nul master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=# master-bin.000001 # Rotate # # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002'; +show binlog events in 'master-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM -master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM -master-bin.000002 # Query 1 # use `test`; insert into t2 values (1) +master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM +master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM +master-bin.000002 # Query # # use `test`; insert into t2 values (1) show binary logs; Log_name File_size master-bin.000001 # @@ -209,62 +207,22 @@ show binary logs; Log_name File_size slave-bin.000001 # slave-bin.000002 # -show binlog events in 'slave-bin.000001' from 4; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -slave-bin.000001 # Intvar 1 # INSERT_ID=1 -slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) -slave-bin.000001 # Query 1 # use `test`; drop table t1 -slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM -slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 -slave-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=1 -slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM -slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 -show binlog events in 'slave-bin.000002' from 4; +slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +slave-bin.000001 # Intvar # # INSERT_ID=1 +slave-bin.000001 # Query # # use `test`; insert into t1 values (NULL) +slave-bin.000001 # Query # # use `test`; drop table t1 +slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +slave-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +slave-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES (`word`) ;file_id=# +slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM +slave-bin.000001 # Rotate # # slave-bin.000002;pos=4 +show binlog events in 'slave-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM -slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1) -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000002 -Read_Master_Log_Pos 392 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000002 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 392 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM +slave-bin.000002 # Query # # use `test`; insert into t2 values (1) +Checking that both slave threads are running. show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result index 2215b34814e..db06cb6d3de 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result @@ -21,45 +21,7 @@ select @@global.max_relay_log_size; @@global.max_relay_log_size 4096 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 2 # @@ -69,45 +31,7 @@ set global max_relay_log_size=(5*4096); select @@global.max_relay_log_size; @@global.max_relay_log_size 20480 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 3: max_relay_log_size = 0 # @@ -117,90 +41,13 @@ set global max_relay_log_size=0; select @@global.max_relay_log_size; @@global.max_relay_log_size 0 start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # stop slave; reset slave; flush logs; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error # # Test 5 # @@ -208,89 +55,13 @@ reset slave; start slave; flush logs; create table t1 (a int); -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # flush logs; drop table t1; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result index 78d9d7c41eb..1fc189975ef 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result @@ -4,196 +4,37 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -stop slave; +Master_Host 127.0.0.1 +include/stop_slave.inc change master to master_user='test'; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 Master_User test -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -reset slave; -SHOW SLAVE STATUS; -Slave_IO_State # Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -start slave; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -stop slave; reset slave; -start slave; +Master_User root +Master_Host 127.0.0.1 +include/start_slave.inc +Master_User root +Master_Host 127.0.0.1 +include/stop_slave.inc +reset slave; +include/start_slave.inc create temporary table t1 (a int); -stop slave; +include/stop_slave.inc reset slave; -start slave; +include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 -stop slave; +include/stop_slave.inc reset slave; -*** errno must be zero: 0 *** change master to master_user='impossible_user_name'; start slave; -ONE -1 include/stop_slave.inc change master to master_user='root'; include/start_slave.inc -*** last errno must be zero: 0 *** -*** last error must be blank: *** include/stop_slave.inc change master to master_user='impossible_user_name'; start slave; -ONE -1 include/stop_slave.inc reset slave; -*** io last errno must be zero: 0 *** -*** io last error must be blank: *** -*** sql last errno must be zero: 0 *** -*** sql last error must be blank: *** diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result index 644baba0335..118d31d78c8 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_until.result +++ b/mysql-test/suite/rpl/r/rpl_stm_until.result @@ -17,199 +17,43 @@ insert into t2 values (3),(4); drop table t2; ==== Replicate one event at a time on slave ==== [on slave] -start slave until master_log_file='master-bin.000001', master_log_pos=323; +start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS; select * from t1; n 1 2 3 4 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos 323 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; +start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS; select * from t1; n 1 2 3 4 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-no-such-bin.000001 -Until_Log_Pos 291 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; +start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS; select * from t2; n 1 2 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Relay -Until_Log_File slave-relay-bin.000004 -Until_Log_Pos 746 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error start slave; [on master] [on slave] include/stop_slave.inc -start slave until master_log_file='master-bin.000001', master_log_pos=776; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos 776 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS; ==== Test various error conditions ==== -start slave until master_log_file='master-bin', master_log_pos=561; +start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; +start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until relay_log_file='slave-relay-bin.000002'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; +start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave sql_thread; -start slave until master_log_file='master-bin.000001', master_log_pos=776; +start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; Warnings: Note 1254 Slave is already running include/stop_slave.inc @@ -230,7 +74,7 @@ insert into t1 set a=null; select count(*) as two from t1; two 2 -start slave until master_log_file='master-bin.000001', master_log_pos= UNTIL_POS;; +start slave until master_log_file='MASTER_LOG_FILE', master_log_pos= UNTIL_POS;; slave stopped at the prescribed position select 0 as zero; zero diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result index d14380a6369..d261becc409 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result +++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result @@ -40,45 +40,7 @@ a b 2 2 3 3 4 4 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. DROP TABLE t1; **** On Master **** DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_000015-slave.opt b/mysql-test/suite/rpl/t/rpl_000015-slave.opt deleted file mode 100644 index 28bc753dd56..00000000000 --- a/mysql-test/suite/rpl/t/rpl_000015-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---server-id=22 --master-connect-retry=7 diff --git a/mysql-test/suite/rpl/t/rpl_000015.cnf b/mysql-test/suite/rpl/t/rpl_000015.cnf deleted file mode 100644 index 46f8af242c2..00000000000 --- a/mysql-test/suite/rpl/t/rpl_000015.cnf +++ /dev/null @@ -1,2 +0,0 @@ -!include ../rpl_1slave_base.cnf - diff --git a/mysql-test/suite/rpl/t/rpl_000015.test b/mysql-test/suite/rpl/t/rpl_000015.test deleted file mode 100644 index 45a43cd38d0..00000000000 --- a/mysql-test/suite/rpl/t/rpl_000015.test +++ /dev/null @@ -1,40 +0,0 @@ --- source include/have_log_bin.inc -##################### -# Change Author: JBM -# Change Date: 2006-01-17 -# Change: added order by in select -##################### - -connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); -connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); -connection master; -reset master; -source include/show_master_status.inc; -save_master_pos; -connection slave; -reset slave; -source include/show_slave_status2.inc; - -change master to master_host='127.0.0.1'; -# The following needs to be cleaned up when change master is fixed -source include/show_slave_status2.inc; ---replace_result $MASTER_MYPORT MASTER_PORT -eval change master to master_host='127.0.0.1',master_user='root', - master_password='',master_port=$MASTER_MYPORT; -source include/show_slave_status2.inc; -start slave; -sync_with_master; -source include/show_slave_status2.inc; -connection master; ---disable_warnings -drop table if exists t1; ---enable_warnings -create table t1 (n int, PRIMARY KEY(n)); -insert into t1 values (10),(45),(90); -sync_slave_with_master; -connection slave; -SELECT * FROM t1 ORDER BY n; -connection master; -SELECT * FROM t1 ORDER BY n; -drop table t1; -sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test index 31163927ce2..4c6402359fe 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test @@ -20,26 +20,24 @@ set @@autocommit=0; start transaction; insert into t values (1); grant select on t to x@y; +let $wait_binlog_event= grant select; +source include/wait_for_binlog_event.inc; # # There is no active transaction here # rollback; show grants for x@y; ---replace_result $VERSION VERSION ---replace_regex /\/\* xid=.* \*\//\/* XID *\// -show binlog events; start transaction; insert into t values (2); revoke select on t from x@y; +let $wait_binlog_event= revoke select; +source include/wait_for_binlog_event.inc; # # There is no active transaction here # commit; select * from t; show grants for x@y; ---replace_result $VERSION VERSION ---replace_regex /\/\* xid=.* \*\//\/* XID *\// -show binlog events; drop user x@y; drop database d1; --sync_slave_with_master diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test index 1316ddb7401..3327a36622c 100644 --- a/mysql-test/suite/rpl/t/rpl_bug33931.test +++ b/mysql-test/suite/rpl/t/rpl_bug33931.test @@ -37,9 +37,10 @@ connection slave; # source include/wait_for_slave_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 19 # 23 # 33 # 37 # -query_vertical show slave status; +# 1593 = ER_SLAVE_FATAL_ERROR +--let $slave_sql_errno= 1593 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc # # Cleanup diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test index d0cd40e2e11..33bd9d51b11 100644 --- a/mysql-test/suite/rpl/t/rpl_change_master.test +++ b/mysql-test/suite/rpl/t/rpl_change_master.test @@ -19,10 +19,26 @@ let $slave_param= Read_Master_Log_Pos; let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1); connection slave; source include/wait_for_slave_param.inc; -stop slave; -source include/show_slave_status2.inc; +source include/stop_slave.inc; + +let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); +let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); +if (`SELECT $read_pos = $exec_pos`) +{ + source include/show_rpl_debug_info.inc; + echo 'Read_Master_Log_Pos: $read_pos' == 'Exec_Master_Log_Pos: $exec_pos'; + die Failed because Read_Master_Log_Pos is equal to Exec_Master_Log_Pos; +} change master to master_user='root'; -source include/show_slave_status2.inc; +let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); +let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); +if (`SELECT $read_pos <> $exec_pos`) +{ + source include/show_rpl_debug_info.inc; + echo 'Read_Master_Log_Pos: $read_pos' <> 'Exec_Master_Log_Pos: $exec_pos'; + die Failed because Read_Master_Log_Pos is not equal to Exec_Master_Log_Pos; +} + start slave; sync_with_master; select * from t1; diff --git a/mysql-test/suite/rpl/t/rpl_critical_errors.test b/mysql-test/suite/rpl/t/rpl_critical_errors.test index b35cd305f92..aa1f251b738 100644 --- a/mysql-test/suite/rpl/t/rpl_critical_errors.test +++ b/mysql-test/suite/rpl/t/rpl_critical_errors.test @@ -53,15 +53,13 @@ KILL QUERY 2; connection slave; # Here the slave will only stop if the query above actually started -# inserting some rows into t2. Otherwise, it will hang forever. ---source include/wait_for_slave_to_stop.inc +# inserting some rows into t2. Otherwise, it will hang forever. ... and there +# the error code should be 1317 (ER_QUERY_INTERRUPTED) +--let $slave_sql_errno= 1317 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc # The following should be 0 SELECT COUNT(*) FROM t2; -# ... and there the error code should be 1317 (ER_QUERY_INTERRUPTED) ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 20 # 22 # 23 # 33 # -query_vertical SHOW SLAVE STATUS; - enable_parsing; diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test index 9efb3d16d2b..ab1de6a2e9f 100644 --- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test +++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test @@ -21,52 +21,51 @@ connection master; --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"; -start slave; +source include/start_slave.inc; # now we test it connection slave; create table t1 (n int); +let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1); +let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1); +let $master_log_pos_1= `SELECT $master_log_pos_1 + 3`; -save_master_pos; -connection master; -sync_with_master; +sync_slave_with_master master; # # BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if # log-slave-updates and circul repl # -stop slave; +source include/stop_slave.inc; create table t2 (n int); # create one ignored event -save_master_pos; -connection slave; -sync_with_master; - -connection slave; +sync_slave_with_master; show tables; -save_master_pos; - create table t3 (n int) engine=innodb; +let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1); +let $master_log_pos_2= `SELECT $master_log_pos_2 + 5`; set @a=1; insert into t3 values(@a); +let $master_log_pos_3= query_get_value(SHOW MASTER STATUS, Position, 1); +let $master_log_pos_3= `SELECT $master_log_pos_3 + 5`; begin; insert into t3 values(2); insert into t3 values(3); commit; insert into t3 values(4); - connection master; # bug is that START SLAVE UNTIL may stop too late, we test that by # asking it to stop before creation of t3. -start slave until master_log_file="slave-bin.000001",master_log_pos=195; +--replace_result $master_log_file MASTER_LOG_FILE $master_log_pos_1 MASTER_LOG_POS +eval start slave until master_log_file="$master_log_file",master_log_pos=$master_log_pos_1; --source include/wait_for_slave_sql_to_stop.inc # then BUG#13861 causes t3 to show up below (because stopped too @@ -75,16 +74,18 @@ start slave until master_log_file="slave-bin.000001",master_log_pos=195; show tables; # ensure that we do not break set @a=1; insert into t3 values(@a); -start slave until master_log_file="slave-bin.000001",master_log_pos=438; +--replace_result $master_log_file MASTER_LOG_FILE $master_log_pos_2 MASTER_LOG_POS +eval start slave until master_log_file="$master_log_file",master_log_pos=$master_log_pos_2; --source include/wait_for_slave_sql_to_stop.inc select * from t3; # ensure that we do not break transaction -start slave until master_log_file="slave-bin.000001",master_log_pos=663; +--replace_result $master_log_file MASTER_LOG_FILE $master_log_pos_3 MASTER_LOG_POS +eval start slave until master_log_file="$master_log_file",master_log_pos=$master_log_pos_3; --source include/wait_for_slave_sql_to_stop.inc select * from t3; -start slave; +source include/start_slave.inc; # BUG#13023 is that Exec_master_log_pos may stay too low "forever": @@ -94,31 +95,20 @@ create table t4 (n int); # create 3 ignored events create table t5 (n int); create table t6 (n int); -save_master_pos; -connection slave; -sync_with_master; - -connection slave; - -save_master_pos; - -connection master; +sync_slave_with_master; +sync_slave_with_master master; # then BUG#13023 caused hang below ("master" looks behind, while it's # not in terms of updates done). -sync_with_master; - show tables; # cleanup -stop slave; +source include/stop_slave.inc; reset slave; drop table t1,t2,t3,t4,t5,t6; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_empty_master_crash.test b/mysql-test/suite/rpl/t/rpl_empty_master_crash.test index f8e7870ae3c..863b450a6d9 100644 --- a/mysql-test/suite/rpl/t/rpl_empty_master_crash.test +++ b/mysql-test/suite/rpl/t/rpl_empty_master_crash.test @@ -1,7 +1,5 @@ source include/master-slave.inc; -source include/show_slave_status.inc; - # # Load table should not succeed on the master as this is not a slave # diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test index bf71ffbfd1e..aa2dee0fe57 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test @@ -126,7 +126,7 @@ connection master; # Parameters for include/wait_for_slave_sql_error_and_skip.inc: # Ask it to show SQL error message. -let $show_sql_error= 1; +let $show_slave_sql_error= 1; # The expected error will always be 1146 (ER_NO_SUCH_TABLE). let $slave_sql_errno= 1146; diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test index a8befe612c2..487f910ba2b 100644 --- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test +++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test @@ -36,7 +36,6 @@ source include/start_slave.inc; # 2. Insert into t1 on slave (2nd) when the event (1st) for t1 replicated. # 3. Master waits until the event (2nd) for t1 will be replicated. ---disable_query_log CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM; let $wait_binlog_event= CREATE TABLE t1; --source include/wait_for_binlog_event.inc @@ -44,31 +43,20 @@ sync_slave_with_master; connection master; INSERT INTO t1 VALUE(1); ---enable_query_log FLUSH LOGS; -let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1); +sync_slave_with_master; -connection slave; -let $slave_param= Exec_Master_Log_Pos; -source include/wait_for_slave_param.inc; - ---disable_query_log INSERT INTO t1 VALUE(2); let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1); ---enable_query_log - -connection master; -let $slave_param= Exec_Master_Log_Pos; -source include/wait_for_slave_param.inc; - ---enable_query_log +sync_slave_with_master master; # -# Show status of slave +# Check that the master server's slave threads are still running and show +# Relay_Log_File # ---replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 # ---query_vertical SHOW SLAVE STATUS +--source include/check_slave_is_running.inc +--let status_items= Relay_Log_File +--source include/show_slave_status.inc --disable_query_log connection master; diff --git a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test index 4a9276d9880..28f13c17042 100644 --- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test +++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test @@ -57,14 +57,10 @@ source include/stop_slave.inc; eval change master to master_port=$SLAVE_MYPORT; start slave; -let $slave_param= Last_IO_Errno; -let $slave_param_value= 1593; -source include/wait_for_slave_param.inc; --echo *** must be having the replicate-same-server-id IO thread error *** -let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1); -let $last_io_error= query_get_value("show slave status", Last_IO_Error, 1); -echo Slave_IO_Errno= $last_io_errno; -echo Slave_IO_Error= $last_io_error; +let $slave_io_errno= 1593; +let $show_slave_io_error= 1; +source include/wait_for_slave_io_error.inc; # cleanup diff --git a/mysql-test/suite/rpl/t/rpl_grant.test b/mysql-test/suite/rpl/t/rpl_grant.test index 50b243eab92..6fbdafc0f9c 100644 --- a/mysql-test/suite/rpl/t/rpl_grant.test +++ b/mysql-test/suite/rpl/t/rpl_grant.test @@ -36,5 +36,3 @@ sync_slave_with_master; --echo **** On Slave **** SELECT user,host FROM mysql.user WHERE user like 'dummy%'; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%'; - -source include/show_slave_status2.inc; diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test index 66893ebb93f..08096d03c11 100644 --- a/mysql-test/suite/rpl/t/rpl_incident.test +++ b/mysql-test/suite/rpl/t/rpl_incident.test @@ -16,6 +16,7 @@ SELECT * FROM t1; connection slave; # Wait until SQL thread stops with error LOST_EVENT on master let $slave_sql_errno= 1590; +let $show_slave_sql_error= 1; source include/wait_for_slave_sql_error.inc; # The 4 should not be inserted into the table, since the incident log @@ -23,10 +24,6 @@ source include/wait_for_slave_sql_error.inc; --echo **** On Slave **** SELECT * FROM t1; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical SHOW SLAVE STATUS - SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; --sync_with_master @@ -35,9 +32,7 @@ START SLAVE; # should be running. We should also have rotated to a new binary log. SELECT * FROM t1; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical SHOW SLAVE STATUS +source include/check_slave_is_running.inc; connection master; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index b300603f454..5b31b094b62 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -26,9 +26,11 @@ INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; SELECT * FROM t1; connection slave; --source include/wait_for_slave_sql_to_stop.inc -# show the error message ---replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # ---query_vertical show slave status; +# show the error message +#1105 = ER_UNKNOWN_ERROR +--let $slave_sql_errno= 1105 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc # show that it was not replicated SELECT * FROM t1; @@ -81,8 +83,10 @@ SELECT * FROM t1; connection slave; --source include/wait_for_slave_sql_to_stop.inc # show the error message ---replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # ---query_vertical show slave status; +#1105 = ER_UNKNOWN_ERROR +--let $slave_sql_errno= 1105 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc # show that it was not replicated SELECT * FROM t1; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test index b7d9995c834..e80fc160d8f 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test @@ -8,7 +8,6 @@ connection master; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10); sync_slave_with_master; -source include/show_slave_status.inc; # Now we feed it a load data infile, which should make it stop with a # fatal error. @@ -16,12 +15,9 @@ connection master; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; connection slave; -wait_for_slave_to_stop; -source include/show_slave_status.inc; - -connection slave; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; +let $slave_sql_errno= 1593; +let $show_slave_sql_error= 1; +source include/wait_for_slave_sql_error_and_skip.inc; connection master; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 48effa00b64..239ddc5c8d4 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -16,14 +16,16 @@ source include/show_master_status.inc; sync_slave_with_master; source include/stop_slave.inc; +--replace_result 75 MASTER_LOG_POS change master to master_log_pos=75; -source include/show_slave_status2.inc; +let $status_items= Read_Master_Log_Pos; +source include/show_slave_status.inc; start slave; -source include/wait_for_slave_sql_to_start.inc; -source include/wait_for_slave_io_to_stop.inc; +let $slave_io_errno= 1236; +let $show_slave_io_error= 1; +source include/wait_for_slave_io_error.inc; source include/stop_slave.inc; -source include/show_slave_status.inc; connection master; source include/show_master_status.inc; create table if not exists t1 (n int); @@ -32,6 +34,7 @@ create table t1 (n int); insert into t1 values (1),(2),(3); save_master_pos; connection slave; +--replace_result 4 MASTER_LOG_POS change master to master_log_pos=4; start slave; sync_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test index 8863c9d4ac7..ec50311fc7c 100644 --- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test +++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test @@ -15,20 +15,10 @@ SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; CREATE TABLE t1 (a INT, b LONG); INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); -let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; sync_slave_with_master; --echo **** On Slave **** ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # 34 # 35 # ---query_vertical SHOW SLAVE STATUS ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test index fea168ee9f1..382e198aaf9 100644 --- a/mysql-test/suite/rpl/t/rpl_replicate_do.test +++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test @@ -31,10 +31,8 @@ save_master_pos; connection slave; sync_with_master; # show slave status, just to see of it prints replicate-do-table ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; - +let $status_items= Replicate_Do_Table; +source include/show_slave_status.inc; # # BUG#12542 # TEST: "SET ONE_SHOT should always be executed on slave" diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index e06099fd707..a2f7b522f1f 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -66,7 +66,9 @@ insert into temp_table values ("testing temporary tables"); create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); sync_slave_with_master; -source include/show_slave_status2.inc; +let $status_items= Master_Log_File, Relay_Master_Log_File; +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; select * from t1; connection master; flush logs; @@ -136,7 +138,8 @@ purge master logs before (@time_for_purge); source include/show_binary_logs.inc; insert into t2 values (65); sync_slave_with_master; -source include/show_slave_status2.inc; +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; select * from t2; # @@ -166,7 +169,8 @@ connection slave; sync_with_master; select * from t4; -source include/show_slave_status2.inc; +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; # because of concurrent insert, the table may not be up to date # if we do not lock lock tables t3 read; diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index 5904585a050..b1f37e0bfe4 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -48,9 +48,7 @@ DELETE FROM t1; INSERT INTO t1 VALUES (1),(2); DELETE FROM t1 WHERE a = 0; UPDATE t1 SET a=99 WHERE a = 0; ---replace_result $SERVER_VERSION SERVER_VERSION ---replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test index e30982da605..a72ca75e975 100644 --- a/mysql-test/suite/rpl/t/rpl_row_create_table.test +++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test @@ -36,9 +36,7 @@ CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT) ENGINE=Merge; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; ---replace_column 1 # 4 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ ---query_vertical SHOW BINLOG EVENTS FROM 106 +--source include/show_binlog_events.inc --echo **** On Master **** --query_vertical SHOW CREATE TABLE t1 --query_vertical SHOW CREATE TABLE t2 @@ -74,9 +72,7 @@ connection master; --error ER_DUP_ENTRY CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; # Shouldn't be written to the binary log ---replace_column 1 # 4 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 106; +--source include/show_binlog_events.inc # Test that INSERT-SELECT works the same way as for SBR. CREATE TABLE t7 (a INT, b INT UNIQUE); @@ -84,9 +80,7 @@ CREATE TABLE t7 (a INT, b INT UNIQUE); INSERT INTO t7 SELECT a,b FROM tt3; SELECT * FROM t7 ORDER BY a,b; # Should be written to the binary log ---replace_column 1 # 4 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 106; +--source include/show_binlog_events.inc sync_slave_with_master; SELECT * FROM t7 ORDER BY a,b; @@ -98,9 +92,7 @@ INSERT INTO tt4 VALUES (4,8), (5,10), (6,12); BEGIN; INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; ---replace_column 1 # 4 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 106; +--source include/show_binlog_events.inc SELECT * FROM t7 ORDER BY a,b; sync_slave_with_master; SELECT * FROM t7 ORDER BY a,b; @@ -116,9 +108,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1; --echo **** On Master **** --query_vertical SHOW CREATE TABLE t8 --query_vertical SHOW CREATE TABLE t9 ---replace_column 1 # 4 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 106; +--source include/show_binlog_events.inc sync_slave_with_master; --echo **** On Slave **** --query_vertical SHOW CREATE TABLE t8 @@ -160,9 +150,7 @@ SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; SELECT * FROM t3 ORDER BY a; SELECT * FROM t4 ORDER BY a; ---replace_column 1 # 4 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 106; +--source include/show_binlog_events.inc sync_slave_with_master; SHOW TABLES; SELECT * FROM t1 ORDER BY a; @@ -202,9 +190,7 @@ INSERT INTO t2 SELECT a+2 FROM tt1; COMMIT; SELECT * FROM t2 ORDER BY a; ---replace_column 1 # 4 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 106; +--source include/show_binlog_events.inc sync_slave_with_master; SELECT * FROM t2 ORDER BY a; @@ -225,9 +211,7 @@ INSERT INTO t2 SELECT a+2 FROM tt2; ROLLBACK; SELECT * FROM t2 ORDER BY a; ---replace_column 1 # 4 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 106; +source include/show_binlog_events.inc; sync_slave_with_master; SELECT * FROM t2 ORDER BY a; diff --git a/mysql-test/suite/rpl/t/rpl_row_drop.test b/mysql-test/suite/rpl/t/rpl_row_drop.test index 20c217a7c3a..d18ebc2846b 100644 --- a/mysql-test/suite/rpl/t/rpl_row_drop.test +++ b/mysql-test/suite/rpl/t/rpl_row_drop.test @@ -30,10 +30,7 @@ connection master; --echo **** On Master **** # Should drop the non-temporary table t1 and the temporary table t2 DROP TABLE t1,t2; -let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; SHOW TABLES; sync_slave_with_master; --echo **** On Slave **** diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test index fe859218ed3..9e3cbbd325a 100644 --- a/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-test/suite/rpl/t/rpl_row_until.test @@ -15,6 +15,7 @@ DROP TABLE t1; # Save master log postion for query DROP TABLE t1 save_master_pos; let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7); +let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 7); CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); # Save master log postion for query CREATE TABLE t2 @@ -46,26 +47,28 @@ eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='1 # Try to replicate all queries until drop of t1 connection slave; -echo START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1; +echo START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_drop_t1; --disable_query_log -eval START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$master_pos_drop_t1; +eval START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_drop_t1; --enable_query_log --source include/wait_for_slave_sql_to_stop.inc # Here table should be still not deleted SELECT * FROM t1; ---replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1 ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos_drop_t1 +--source include/check_slave_param.inc # This should fail right after start +--replace_result 291 MASTER_LOG_POS START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291; --source include/wait_for_slave_sql_to_stop.inc # again this table should be still not deleted SELECT * FROM t1; ---replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1 ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; + +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos_drop_t1 +--source include/check_slave_param.inc # Try replicate all up to and not including the second insert to t2; echo START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2; @@ -74,9 +77,10 @@ eval START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=$r --enable_query_log --source include/wait_for_slave_sql_to_stop.inc SELECT * FROM t2; ---replace_result $relay_pos_insert1_t2 RELAY_POS_INSERT1_T2 $master_pos_insert1_t2 MASTER_POS_INSERT1_T2 ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; + +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos_insert1_t2 +--source include/check_slave_param.inc # clean up START SLAVE; @@ -86,31 +90,34 @@ sync_slave_with_master; --source include/stop_slave.inc # This should stop immediately as we are already there -echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2; +echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_create_t2; --disable_query_log -eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$master_pos_create_t2; +eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_create_t2; --enable_query_log let $slave_param= Until_Log_Pos; let $slave_param_value= $master_pos_create_t2; --source include/wait_for_slave_param.inc --source include/wait_for_slave_sql_to_stop.inc # here the sql slave thread should be stopped ---replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 ---replace_result $master_pos_create_t2 MASTER_POS_CREATE_T2 $master_pos_drop_t2 MASTER_POS_DROP_T2 ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos_drop_t2 +--source include/check_slave_param.inc #testing various error conditions +--replace_result 561 MASTER_LOG_POS --error 1277 START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561; +--replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS --error 1277 START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12; --error 1277 START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001'; --error 1277 START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009'; +--replace_result 561 MASTER_LOG_POS --error 1277 START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561; # Warning should be given for second command START SLAVE; +--replace_result 740 MASTER_LOG_POS START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740; diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test index 9c6aa3dcb57..8d176ac0c3b 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_error.test +++ b/mysql-test/suite/rpl/t/rpl_skip_error.test @@ -55,7 +55,7 @@ insert into t1 values (7), (8), (9); --echo [on slave] sync_slave_with_master; select * from t1 order by n; -source include/show_slave_status2.inc; +source include/check_slave_is_running.inc; --echo ==== Clean Up ==== connection master; @@ -78,7 +78,7 @@ insert into t1 values (1), (2), (3); --echo [on slave] sync_slave_with_master; select * from t1; -source include/show_slave_status2.inc; +source include/check_slave_is_running.inc; --echo ==== Clean Up ==== diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test index 437e1ebb92d..22309c33724 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test @@ -31,12 +31,9 @@ commit; # Catch Error ########################################################################## connection slave; -source include/wait_for_slave_sql_to_stop.inc; - ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---replace_regex /SQL_LOAD-[0-9]-[0-9]-[0-9]*/SQL_LOAD/ -query_vertical show slave status; +# Errno 9 is what we get although it's wrong (see BUG#52768). +--let $slave_sql_errno= 9 +--source include/wait_for_slave_sql_error.inc ########################################################################## # Clean up diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test index c5ee6793277..4c5930d74fe 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_skip.test +++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test @@ -14,6 +14,7 @@ CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (c INT, d INT); INSERT INTO t1 VALUES (1,1),(2,4),(3,9); INSERT INTO t2 VALUES (1,1),(2,8),(3,27); +let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1); UPDATE t1,t2 SET b = d, d = b * 2 WHERE a = c; source include/show_binlog_events.inc; @@ -21,16 +22,17 @@ source include/show_binlog_events.inc; SELECT * FROM t1; SELECT * FROM t2; save_master_pos; - --echo **** On Slave **** connection slave; # Stop when reaching the the first table map event. -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=762; +--replace_result $master_log_pos MASTER_LOG_POS +eval START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$master_log_pos; source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; +let $slave_param= Exec_Master_Log_Pos; +let $slave_param_value= $master_log_pos; +source include/check_slave_param.inc; +source include/check_slave_no_error.inc; # Now we skip *one* table map event. If the execution starts right # after that table map event, *one* of the involved tables will be @@ -53,19 +55,18 @@ RESET MASTER; SET SESSION BINLOG_FORMAT=STATEMENT; SET @foo = 12; +let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1); INSERT INTO t1 VALUES(@foo, 2*@foo); save_master_pos; source include/show_binlog_events.inc; connection slave; -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106; +--replace_result $master_log_pos MASTER_LOG_POS +eval START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$master_log_pos; source include/wait_for_slave_sql_to_stop.inc; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; sync_with_master; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; --echo **** On Master **** connection master; diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test index 9be630e9ae8..243136a0d38 100644 --- a/mysql-test/suite/rpl/t/rpl_sp.test +++ b/mysql-test/suite/rpl/t/rpl_sp.test @@ -568,9 +568,7 @@ connection master; # Final inspection which verifies how all statements of this test file # were written to the binary log. ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events in 'master-bin.000001' from 106; +--source include/show_binlog_events.inc # Restore log_bin_trust_function_creators to its original value. diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index 7e256390e25..803b08eeec5 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -30,9 +30,9 @@ select * from t1; # The slave is synced and waiting/reading from master # SHOW SLAVE STATUS will show "Waiting for master to send event" ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # -query_vertical show slave status; +let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Cert, Master_SSL_Key; +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; # Stop the slave, as reported in bug#21871 it would hang STOP SLAVE; @@ -70,9 +70,8 @@ let $master_count= `select count(*) from t1`; sync_slave_with_master; --source include/wait_for_slave_to_start.inc ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # -query_vertical show slave status; +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; let $slave_count= `select count(*) from t1`; diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test index b5355d737d5..eca6a8cf46e 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl1.test +++ b/mysql-test/suite/rpl/t/rpl_ssl1.test @@ -45,9 +45,9 @@ sync_with_master; select * from t1; #checking show slave status ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # -query_vertical show slave status; +let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Cert, Master_SSL_Key; +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; #checking if replication works without ssl also performing clean up stop slave; @@ -59,10 +59,8 @@ drop table t1; save_master_pos; connection slave; sync_with_master; ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # -query_vertical show slave status; - +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; # End of 4.1 tests # Start replication with ssl_verify_server_cert turned on @@ -89,9 +87,8 @@ echo on slave; select * from t1; #checking show slave status ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # -query_vertical show slave status; +source include/show_slave_status.inc; +--source include/check_slave_is_running.inc connection master; drop table t1; diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test index ae03ebe8b76..ee9501681a1 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -34,9 +34,12 @@ sync_slave_with_master; connection master; create table t1(n int not null auto_increment primary key); insert into t1 values (1),(2),(3),(4); +let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1); +let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1); drop table t1; create table t2(n int not null auto_increment primary key); insert into t2 values (1),(2); +let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1); insert into t2 values (3),(4); drop table t2; @@ -45,27 +48,39 @@ drop table t2; # try to replicate all queries until drop of t1 --echo [on slave] connection slave; -start slave until master_log_file='master-bin.000001', master_log_pos=323; +--replace_result $master_log_file MASTER_LOG_FILE $master_log_pos_1 MASTER_LOG_POS +eval start slave until master_log_file='$master_log_file', master_log_pos=$master_log_pos_1; --source include/wait_for_slave_io_to_start.inc --source include/wait_for_slave_sql_to_stop.inc # here table should be still not deleted select * from t1; -source include/show_slave_status2.inc; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_log_pos_1 +--source include/check_slave_param.inc # this should fail right after start +--replace_result 291 MASTER_LOG_POS start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; --source include/wait_for_slave_io_to_start.inc --source include/wait_for_slave_sql_to_stop.inc # again this table should be still not deleted select * from t1; -source include/show_slave_status2.inc; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_log_pos_1 +--source include/check_slave_param.inc +let $relay_log_file= slave-relay-bin.000004; +let $master_log_pos= $master_log_pos_2; +source include/get_relay_log_pos.inc; # try replicate all up to and not including the second insert to t2; -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; +--replace_result $relay_log_pos RELAY_LOG_POS +eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos; --source include/wait_for_slave_io_to_start.inc --source include/wait_for_slave_sql_to_stop.inc select * from t2; -source include/show_slave_status2.inc; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_log_pos +--source include/check_slave_param.inc # clean up start slave; @@ -75,27 +90,34 @@ connection master; sync_slave_with_master; --source include/stop_slave.inc +--let $exec_log_pos_1= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) # this should stop immediately as we are already there -start slave until master_log_file='master-bin.000001', master_log_pos=776; +--replace_result $master_log_file MASTER_LOG_FILE $master_log_pos_2 MASTER_LOG_POS +eval start slave until master_log_file='$master_log_file', master_log_pos=$master_log_pos_2; --source include/wait_for_slave_io_to_start.inc --source include/wait_for_slave_sql_to_stop.inc ---replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 -source include/show_slave_status2.inc; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $exec_log_pos_1 +--source include/check_slave_param.inc --echo ==== Test various error conditions ==== +--replace_result 561 MASTER_LOG_POS --error 1277 start slave until master_log_file='master-bin', master_log_pos=561; +--replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS --error 1277 start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; --error 1277 start slave until master_log_file='master-bin.000001'; --error 1277 start slave until relay_log_file='slave-relay-bin.000002'; +--replace_result 561 MASTER_LOG_POS --error 1277 start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; # Warning should be given for second command start slave sql_thread; +--replace_result 776 MASTER_LOG_POS start slave until master_log_file='master-bin.000001', master_log_pos=776; # @@ -144,8 +166,8 @@ insert into t1 set a=null; select count(*) as two from t1; connection slave; ---replace_result $until_pos UNTIL_POS; -eval start slave until master_log_file='master-bin.000001', master_log_pos= $until_pos; +--replace_result $master_log_file MASTER_LOG_FILE $until_pos UNTIL_POS; +eval start slave until master_log_file='$master_log_file', master_log_pos= $until_pos; source include/wait_for_slave_sql_to_stop.inc; let $slave_exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); --echo slave stopped at the prescribed position diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test index 3b373e00a62..b3f62943689 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test +++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test @@ -25,7 +25,7 @@ sync_slave_with_master; set @@global.slave_exec_mode= default; SHOW STATUS LIKE 'Slave_retried_transactions'; SELECT * FROM t1; -source include/show_slave_status2.inc; +source include/check_slave_is_running.inc; DROP TABLE t1; --echo **** On Master **** diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result index b16a63ec5ad..d43165e2b5e 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result @@ -140,45 +140,7 @@ set GLOBAL slave_transaction_retries=1; **** On Master **** UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1; **** On Slave **** -SHOW SLAVE STATUS;; -Slave_IO_State -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos -Relay_Log_File -Relay_Log_Pos -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos -Relay_Log_Space -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno -Last_SQL_Error +Last_SQL_Error = Could not execute Write_rows event on table test.t1; Got temporary error 266 'Time-out in NDB, probably caused by deadlock' from NDB, Error_code: 1297; Lock wait timeout exceeded; try restarting transaction, Error_code: 1205; handler error HA_ERR_LOCK_WAIT_TIMEOUT; the event's master log master-bin.000001, end_log_pos 6834 set GLOBAL slave_transaction_retries=10; include/start_slave.inc select * from t1 order by nid; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result index 2daacb351a9..dfbd7a37d8e 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result @@ -17,87 +17,11 @@ SELECT * FROM t1 ORDER BY a; a b 1 2 2 3 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. SELECT * FROM t1 ORDER BY a; a b 1 2 2 3 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 60 -Master_Log_File slave-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File slave-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. STOP SLAVE; DROP TABLE t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result index b6f32668c42..99438d663bb 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result @@ -14,45 +14,7 @@ INSERT INTO t1 VALUES (2,3); STOP SLAVE; CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=SLAVE_PORT,MASTER_USER="root"; START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port SLAVE_PORT -Connect_Retry 60 -Master_Log_File slave-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File slave-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. SELECT * FROM t1 ORDER BY a; a b 1 2 @@ -63,43 +25,5 @@ SELECT * FROM t1 ORDER BY a; a b 1 2 2 3 -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. DROP TABLE t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result index f514bf7a75b..642fc078918 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result @@ -54,45 +54,7 @@ a b c 3 4 QA TESTING *** Start Slave *** START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -121,47 +83,10 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t3 *** DROP TABLE t3; *** Create t4 on slave *** @@ -183,47 +108,10 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t4 *** DROP TABLE t4; *** Create t5 on slave *** @@ -245,47 +133,10 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t5 *** DROP TABLE t5; *** Create t6 on slave *** @@ -306,45 +157,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_SQL_Error = Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -418,47 +231,10 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t10 *** DROP TABLE t10; *** Create t11 on slave *** @@ -479,47 +255,10 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc *** Drop t11 *** DROP TABLE t11; *** Create t12 on slave *** @@ -729,47 +468,10 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** *** Expect slave to fail with Error 1060 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1060 -Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1060 -Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 1; +include/start_slave.inc *** Try to insert in master **** INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); SELECT * FROM t15 ORDER BY c1; @@ -869,46 +571,9 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; +include/start_slave.inc ** DROP table t17 *** DROP TABLE t17; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result index e2fee391bab..e2755c04f28 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result @@ -32,16 +32,11 @@ SELECT * FROM t1 ORDER BY c3; c1 c2 c3 row3 C 3 row4 D 4 -SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error - 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 Yes Yes 0 0 None 0 No No 0 +Checking that both slave threads are running. STOP SLAVE; CHANGE MASTER TO master_log_file = 'master-bin.000001', master_log_pos = ; -SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error - 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 No No 0 0 None 0 No No 0 START SLAVE; SELECT * FROM t1 ORDER BY c3; c1 c2 c3 @@ -67,7 +62,5 @@ COMMIT; SELECT * FROM t1; c1 c2 c3 row2 new on slave 2 -SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error - 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 Yes Yes 0 0 None 0 No 0 +Checking that both slave threads are running. DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result index 540c430e757..85ecb13bd66 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result @@ -7,7 +7,7 @@ start slave; include/stop_slave.inc reset master; reset slave; -start slave; +include/start_slave.inc create table t1(n int not null auto_increment primary key)ENGINE=NDB; insert into t1 values (NULL); drop table t1; @@ -16,34 +16,33 @@ load data infile 'LOAD_FILE' into table t1 ignore 1 lines; select count(*) from t1; count(*) 69 -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # COMMIT -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # COMMIT -show binlog events from 106 limit 1; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=NDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +show binlog events from limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -show binlog events from 106 limit 2; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +show binlog events from limit 2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -master-bin.000001 # Query 1 # BEGIN -show binlog events from 106 limit 2,1; +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +master-bin.000001 # Query # # BEGIN +show binlog events from limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t1) flush logs; create table t3 (a int)ENGINE=NDB; select * from t1 order by 1 asc; @@ -211,17 +210,16 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002'; +show binlog events in 'master-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB -master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB -master-bin.000002 # Query 1 # BEGIN -master-bin.000002 # Table_map 1 # table_id: # (test.t2) -master-bin.000002 # Table_map 1 # table_id: # (mysql.ndb_apply_status) -master-bin.000002 # Write_rows 1 # table_id: # -master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000002 # Query 1 # COMMIT +master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=NDB +master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=NDB +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Table_map # # table_id: # (test.t2) +master-bin.000002 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000002 # Write_rows # # table_id: # +master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000002 # Query # # COMMIT show binary logs; Log_name File_size master-bin.000001 # @@ -230,75 +228,35 @@ show binary logs; Log_name File_size slave-bin.000001 # slave-bin.000002 # -show binlog events in 'slave-bin.000001' from 4; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -slave-bin.000001 # Query 2 # BEGIN -slave-bin.000001 # Table_map 2 # table_id: # (test.t1) -slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status) -slave-bin.000001 # Write_rows 2 # table_id: # -slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000001 # Query 2 # COMMIT -slave-bin.000001 # Query 1 # use `test`; drop table t1 -slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB -slave-bin.000001 # Query 2 # BEGIN -slave-bin.000001 # Table_map 2 # table_id: # (test.t1) -slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status) -slave-bin.000001 # Write_rows 2 # table_id: # -slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000001 # Query 2 # COMMIT -slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB -slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 -show binlog events in 'slave-bin.000002' from 4; +slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +slave-bin.000001 # Write_rows # # table_id: # +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # use `test`; drop table t1 +slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=NDB +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +slave-bin.000001 # Write_rows # # table_id: # +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=NDB +slave-bin.000001 # Rotate # # slave-bin.000002;pos=4 +show binlog events in 'slave-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB -slave-bin.000002 # Query 2 # BEGIN -slave-bin.000002 # Table_map 2 # table_id: # (test.t2) -slave-bin.000002 # Table_map 2 # table_id: # (mysql.ndb_apply_status) -slave-bin.000002 # Write_rows 2 # table_id: # -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 2 # COMMIT -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000002 -Read_Master_Log_Pos 623 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000002 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 623 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error +slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=NDB +slave-bin.000002 # Query # # BEGIN +slave-bin.000002 # Table_map # # table_id: # (test.t2) +slave-bin.000002 # Table_map # # table_id: # (mysql.ndb_apply_status) +slave-bin.000002 # Write_rows # # table_id: # +slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000002 # Query # # COMMIT +Checking that both slave threads are running. show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result index f8eb5ebdd89..05524ae1ae3 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result @@ -29,8 +29,8 @@ FROM mysql.ndb_binlog_index WHERE epoch = ; 106 master-bin.000001 CHANGE MASTER TO master_port=, -master_log_file = 'master-bin.000001', -master_log_pos = 106 ; +master_log_file = 'MASTER_LOG_FILE', +master_log_pos = MASTER_LOG_POS ; start slave; INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4); DELETE FROM t1 WHERE c3 = 1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result index 5327bfde7e0..367738b21e5 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result @@ -27,21 +27,21 @@ from mysql.ndb_apply_status; # since insert is done with transactional engine, expect a BEGIN # at -show binlog events from limit 1; +show binlog events from limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 Query 1 # BEGIN +master-bin.000001 # Query # # BEGIN # Now the insert, one step after -show binlog events from limit 1,1; +show binlog events from limit 1,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t1 values (1,2) +master-bin.000001 # Query # # use `test`; insert into t1 values (1,2) # and the COMMIT should be at -show binlog events from limit 2,1; +show binlog events from limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Xid 1 COMMIT /* XID */ +master-bin.000001 # Xid # # COMMIT /* XID */ begin; insert into t1 values (2,3); @@ -52,18 +52,18 @@ select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status; @log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos -show binlog events from limit 1; +show binlog events from limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 Query 1 # BEGIN +master-bin.000001 # Query # # BEGIN -show binlog events from limit 1,2; +show binlog events from limit 1,2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; insert into t1 values (2,3) master-bin.000001 # Query # # use `test`; insert into t2 values (3,4) -show binlog events from limit 3,1; +show binlog events from limit 3,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Xid 1 COMMIT /* XID */ +master-bin.000001 # Xid # # COMMIT /* XID */ DROP TABLE test.t1, test.t2; SHOW TABLES; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result index 3ef5e2b7e53..49d068d5fe4 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result @@ -68,45 +68,7 @@ CHANGE MASTER TO master_log_file = 'master-bin.000001', master_log_pos = ; START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos -Relay_Log_File -Relay_Log_Pos -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos -Relay_Log_Space -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master -Master_SSL_Verify_Server_Cert No -Last_IO_Errno -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error +Checking that both slave threads are running. SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; hex(c1) hex(c2) c3 1 1 row1 diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result index 409397cb3d1..04a75bf3479 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result @@ -436,8 +436,7 @@ DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; -Last_SQL_Error - +Checking that both slave threads are running. SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 **** Test for BUG#37076 **** @@ -487,8 +486,7 @@ Comparing tables master:test.t2 and slave:test.t2 [expecting slave to stop] INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -500,8 +498,7 @@ Comparing tables master:test.t4 and slave:test.t4 [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -509,8 +506,7 @@ START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +Last_SQL_Error = Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. RESET MASTER; STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result index d6c57aed41b..14d3baee1b0 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result @@ -27,18 +27,17 @@ SELECT * FROM t1 ORDER BY a,b; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 223 Query 1 287 BEGIN -master-bin.000001 287 Table_map 1 330 table_id: # (test.t1) -master-bin.000001 330 Table_map 1 392 table_id: # (mysql.ndb_apply_status) -master-bin.000001 392 Write_rows 1 451 table_id: # -master-bin.000001 451 Write_rows 1 498 table_id: # flags: STMT_END_F -master-bin.000001 498 Query 1 563 COMMIT -master-bin.000001 563 Query 1 643 use `test`; TRUNCATE TABLE t1 -master-bin.000001 643 Query 1 719 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB; INSERT INTO t1 VALUES (1,1), (2,2); @@ -63,29 +62,28 @@ a b 3 3 **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 223 Query 1 287 BEGIN -master-bin.000001 287 Table_map 1 330 table_id: # (test.t1) -master-bin.000001 330 Table_map 1 392 table_id: # (mysql.ndb_apply_status) -master-bin.000001 392 Write_rows 1 451 table_id: # -master-bin.000001 451 Write_rows 1 498 table_id: # flags: STMT_END_F -master-bin.000001 498 Query 1 563 COMMIT -master-bin.000001 563 Query 1 643 use `test`; TRUNCATE TABLE t1 -master-bin.000001 643 Query 1 719 use `test`; DROP TABLE t1 -master-bin.000001 719 Query 1 836 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 836 Query 1 900 BEGIN -master-bin.000001 900 Table_map 1 943 table_id: # (test.t1) -master-bin.000001 943 Table_map 1 1005 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1005 Write_rows 1 1064 table_id: # -master-bin.000001 1064 Write_rows 1 1111 table_id: # flags: STMT_END_F -master-bin.000001 1111 Query 1 1176 COMMIT -master-bin.000001 1176 Query 1 1240 BEGIN -master-bin.000001 1240 Table_map 1 1283 table_id: # (test.t1) -master-bin.000001 1283 Table_map 1 1345 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1345 Write_rows 1 1404 table_id: # -master-bin.000001 1404 Delete_rows 1 1443 table_id: # flags: STMT_END_F -master-bin.000001 1443 Query 1 1508 COMMIT -master-bin.000001 1508 Query 1 1584 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP TABLE t1 diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test index 5903cd223ad..c03738bc48b 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test @@ -191,10 +191,11 @@ connection slave; source include/wait_for_slave_sql_to_stop.inc; # Replication should have stopped, since max retries were not enough. -# verify with show slave status ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 7 8 9 16 19 20 22 23 33 35 36 37 38 ---query_vertical SHOW SLAVE STATUS; +# verify with show slave status +# 1205 = ER_LOCK_WAIT_TIMEOUT +--let $slave_sql_errno= 1205 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc # now set max retries high enough to succeed, and start slave again set GLOBAL slave_transaction_retries=10; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test index 7b8497d8dab..e63b7c5e8ff 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test @@ -16,9 +16,7 @@ START SLAVE; --connection slave CREATE TABLE t1 (a int key, b int) ENGINE=ndb; #CREATE TABLE t2 (a int key, b int) ENGINE=ndb; ---save_master_pos ---connection master ---sync_with_master +sync_slave_with_master master; # now we should have a table on the master as well SHOW TABLES; @@ -30,25 +28,19 @@ INSERT INTO t1 VALUES (2,3); # ensure data has propagated both ways --connection slave ---save_master_pos ---connection master ---sync_with_master +sync_slave_with_master master; --sync_slave_with_master # connect to slave and ensure data it there. --connection slave SELECT * FROM t1 ORDER BY a; #SELECT * FROM t2 ORDER BY a; -# BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36 ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical show slave status; +source include/check_slave_is_running.inc; # connect to master and ensure data it there. --connection master SELECT * FROM t1 ORDER BY a; #SELECT * FROM t2 ORDER BY a; -# BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36 ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---query_vertical show slave status; +source include/check_slave_is_running.inc; # stop replication on "master" as not to replicate # shutdown circularly, eg drop table diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test index eb04dc2e260..8b0f869c1a3 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test @@ -38,9 +38,7 @@ eval CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=$SLAVE_MYPORT,MASTER_U START SLAVE; connection slave; -save_master_pos; -connection master; -sync_with_master; +sync_slave_with_master master; # The statement is disabled since it cannot reliably show the same # info all the time. Use it for debug purposes. @@ -48,9 +46,7 @@ sync_with_master; #SHOW BINLOG EVENTS; # Check that there is no error in replication ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; +source include/check_slave_is_running.inc; # Check that we have the data on the master SELECT * FROM t1 ORDER BY a; @@ -75,9 +71,7 @@ sync_with_master; SELECT * FROM t1 ORDER BY a; # Check that there is no error in replication ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # -query_vertical SHOW SLAVE STATUS; +source include/check_slave_is_running.inc; -- connection master DROP TABLE t1; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test index 3133ad34f0c..99c9df40094 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test @@ -39,12 +39,9 @@ SELECT * FROM t1 ORDER BY c3; # check that we have it on the slave --sync_slave_with_master ---connection slave SELECT * FROM t1 ORDER BY c3; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 7 8 9 16 22 23 33 35 36 -SHOW SLAVE STATUS; +source include/check_slave_is_running.inc; # stop slave and reset position to before the last changes STOP SLAVE; @@ -53,9 +50,7 @@ eval CHANGE MASTER TO master_log_file = '$the_file', master_log_pos = $the_pos ; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 7 8 9 16 22 23 33 35 36 -SHOW SLAVE STATUS; +source include/check_slave_no_error.inc; # start the slave again # -> same events should have been applied again @@ -67,7 +62,6 @@ START SLAVE; --connection master SELECT * FROM t1 ORDER BY c3; --sync_slave_with_master ---connection slave SELECT * FROM t1 ORDER BY c3; STOP SLAVE; @@ -106,9 +100,7 @@ COMMIT; --sync_slave_with_master --connection slave SELECT * FROM t1; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 7 8 9 16 22 23 33 34 35 -SHOW SLAVE STATUS; +source include/check_slave_is_running.inc; connection master; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test index eb128cfa2ce..e9107fd90bd 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test @@ -39,7 +39,7 @@ let $the_file= `SELECT @the_file` ; # now connect the slave to the _other_ "master" connection slave; ---replace_result $MASTER_MYPORT1 +--replace_result $MASTER_MYPORT1 $the_pos MASTER_LOG_POS $the_file MASTER_LOG_FILE eval CHANGE MASTER TO master_port=$MASTER_MYPORT1, master_log_file = '$the_file', diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test index 88572c3e9a2..b91ff198c51 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test @@ -70,10 +70,7 @@ START SLAVE; # --connection master --sync_slave_with_master ---connection slave ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 7 8 9 16 22 23 33 35 36 -query_vertical SHOW SLAVE STATUS; +--source include/check_slave_is_running.inc SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; @@ -85,7 +82,6 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; --connection master DROP DATABASE ndbsynctest; --sync_slave_with_master ---connection slave STOP SLAVE; # diff --git a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test index f8933b3744d..898bf310dc5 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test @@ -39,10 +39,7 @@ SELECT * FROM t1 ORDER BY a,b; --echo **** On Master **** connection master; DROP TABLE t1; -let SERVER_VERSION=`select version()`; ---replace_regex /\/\* xid=[0-9]+ \*\//\/* xid= *\// /table_id: [0-9]+/table_id: #/ ---replace_result $SERVER_VERSION SERVER_VERSION -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; --echo **** On Master **** connection master; @@ -64,8 +61,6 @@ SELECT * FROM t1 ORDER BY a,b; --echo **** On Master **** connection master; DROP TABLE t1; ---replace_regex /table_id: [0-9]+/table_id: #/ ---replace_result $SERVER_VERSION SERVER_VERSION -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; -- source include/master-slave-end.inc diff --git a/mysql-test/t/alter_table-big.test b/mysql-test/t/alter_table-big.test index 1dcc1f1c9bd..e007a3a55e0 100644 --- a/mysql-test/t/alter_table-big.test +++ b/mysql-test/t/alter_table-big.test @@ -31,7 +31,9 @@ create table t2 (i int); # statement execution, so we don't need many rows in 't1' to make # this test repeatable. alter table t1 disable keys; +--disable_warnings insert into t1 values (RAND()*1000, RAND()*1000, RAND()*1000); +--enable_warnings # Later we use binlog to check the order in which statements are # executed so let us reset it first. @@ -50,8 +52,7 @@ connection default; --reap set session debug="-d,sleep_alter_enable_indexes"; # Check that statements were executed/binlogged in correct order. ---replace_column 2 # 5 # -show binlog events in 'master-bin.000001' from 106; +source include/show_binlog_events.inc; # Clean up drop tables t1, t2; @@ -111,8 +112,7 @@ drop table t3; set session debug="-d,sleep_alter_before_main_binlog"; # Check that all statements were logged in correct order ---replace_column 2 # 5 # -show binlog events in 'master-bin.000001' from 106; +source include/show_binlog_events.inc; --echo End of 5.1 tests diff --git a/mysql-test/t/create-big.test b/mysql-test/t/create-big.test index 6cd6326cdb8..e1dfbbd4ac4 100644 --- a/mysql-test/t/create-big.test +++ b/mysql-test/t/create-big.test @@ -305,8 +305,7 @@ connection default; show create table t2; drop table t2; # Let us check that statements were executed/binlogged in correct order ---replace_column 2 # 5 # -show binlog events in 'master-bin.000001' from 106; +source include/show_binlog_events.inc; # Now let us check the gap between check for target table # existance and copying of .frm file. @@ -330,8 +329,7 @@ drop table t1; connection default; --reap drop table t2; ---replace_column 2 # 5 # -show binlog events in 'master-bin.000001' from 106; +source include/show_binlog_events.inc; # And now he gap between copying of .frm file and ha_create_table() call. create table t1 (i int); @@ -359,8 +357,7 @@ drop table t1; connection default; --reap drop table t2; ---replace_column 2 # 5 # -show binlog events in 'master-bin.000001' from 106; +source include/show_binlog_events.inc; # Finally we check the gap between ha_create_table() and binlogging create table t1 (i int); @@ -386,7 +383,6 @@ drop table t1; connection default; --reap drop table t2; ---replace_column 2 # 5 # -show binlog events in 'master-bin.000001' from 106; +source include/show_binlog_events.inc; set session debug="-d,sleep_create_like_before_binlogging"; diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test index 89df33a6df5..f3038ccfa61 100644 --- a/mysql-test/t/ctype_cp932_binlog_stm.test +++ b/mysql-test/t/ctype_cp932_binlog_stm.test @@ -7,6 +7,7 @@ # # Bug#18293: Values in stored procedure written to binlog unescaped # +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); delimiter |; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, @@ -22,7 +23,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)| SELECT HEX(s1),HEX(s2),d FROM t4| DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 370| +source include/show_binlog_events.inc| delimiter ;| --echo End of 5.0 tests diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test index aea38250218..b774d7ec069 100644 --- a/mysql-test/t/flush_block_commit_notembedded.test +++ b/mysql-test/t/flush_block_commit_notembedded.test @@ -28,14 +28,14 @@ INSERT t1 VALUES (1); --echo # Switch to connection con2 connection con2; FLUSH TABLES WITH READ LOCK; -SHOW MASTER STATUS; +--source include/show_binlog_events.inc --echo # Switch to connection con1 connection con1; send COMMIT; --echo # Switch to connection con2 connection con2; sleep 1; -SHOW MASTER STATUS; +--source include/show_binlog_events.inc UNLOCK TABLES; --echo # Switch to connection con1 connection con1; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 3c33a3dde35..559408eb90e 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -585,7 +585,8 @@ reset master; UPDATE t2,t1 SET t2.a=t1.a+2; # check select * from t2 /* must be (3,1), (4,4) */; -show master status /* there must be the UPDATE query event */; +let wait_binlog_event= UPDATE; +source include/wait_for_binlog_event.inc; # B. testing multi_update::send_error() ineffective update # (as there is a policy described at mysql_update() still go to binlog) @@ -596,7 +597,8 @@ insert into t2 values (1,2),(3,4),(4,4); reset master; --error ER_DUP_ENTRY UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; -show master status /* there must be the UPDATE query event */; +let wait_binlog_event= UPDATE; +source include/wait_for_binlog_event.inc; # cleanup drop table t1, t2; diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test index 2f2b84a9bef..5eccbf81fef 100644 --- a/mysql-test/t/sp_trans_log.test +++ b/mysql-test/t/sp_trans_log.test @@ -34,8 +34,8 @@ end| reset master| --error ER_DUP_ENTRY insert into t2 values (bug23333(),1)| ---replace_column 2 # 5 # 6 # -show binlog events from 106 /* with fixes for #23333 will show there is the query */| +# with fixes for 23333 will show there is the query */| +--source include/show_binlog_events.inc select count(*),@a from t1 /* must be 1,1 */| delimiter ;| From 8f8e1d6fb85d4be1e8e44beb22b26a72f76ac84e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 May 2010 11:39:45 +0800 Subject: [PATCH 058/121] Postfix BUG#49741 --- mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test | 14 +++++++------- mysql-test/suite/rpl/r/rpl_extraCol_innodb.result | 14 +++++++------- mysql-test/suite/rpl/r/rpl_extraCol_myisam.result | 14 +++++++------- mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result | 14 +++++++------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test index 0317aa79891..3b8e7663ec7 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test @@ -145,7 +145,7 @@ set @b1 = concat(@b1,@b1); INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING'); --echo ******************************************** ---echo *** Expect slave to fail with Error 1522 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** connection slave; --let $slave_sql_errno= 1535 @@ -188,7 +188,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), (30000.22,4,'QA TESTING'); --echo ******************************************** ---echo *** Expect slave to fail with Error 1522 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** connection slave; --let $slave_sql_errno= 1535 @@ -231,7 +231,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), (2,'JOE',300.01,0,'b2b2',1.0000009); --echo ******************************************** ---echo *** Expect slave to fail with Error 1522 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** connection slave; --let $slave_sql_errno= 1535 @@ -275,7 +275,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), (2,'JOE',300.01,0); --echo ******************************************** ---echo *** Expect slave to fail with Error 1522 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** connection slave; --let $slave_sql_errno= 1535 @@ -479,7 +479,7 @@ set @b1 = concat(@b1,@b1); INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); --echo ******************************************** ---echo *** Expect slave to fail with Error 1522 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** connection slave; --let $slave_sql_errno= 1535 @@ -521,7 +521,7 @@ set @b1 = concat(@b1,@b1); INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); --echo ******************************************** ---echo *** Expect slave to fail with Error 1522 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** connection slave; --let $slave_sql_errno= 1535 @@ -900,7 +900,7 @@ connection master; INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); --echo ******************************************** ---echo *** Expect slave to fail with Error 1522 *** +--echo *** Expect slave to fail with Error 1535 *** --echo ******************************************** connection slave; --let $slave_sql_errno= 1535 diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result index 025da75581c..48fd0366c26 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result @@ -81,7 +81,7 @@ set @b1 = 'b1'; set @b1 = concat(@b1,@b1); INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 @@ -106,7 +106,7 @@ START SLAVE; INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), (30000.22,4,'QA TESTING'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 @@ -131,7 +131,7 @@ START SLAVE; INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), (2,'JOE',300.01,0,'b2b2',1.0000009); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 @@ -155,7 +155,7 @@ START SLAVE; INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), (2,'JOE',300.01,0); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** Last_SQL_Error = Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; @@ -253,7 +253,7 @@ set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 @@ -277,7 +277,7 @@ set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 @@ -593,7 +593,7 @@ START SLAVE; *** Master Data Insert *** INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result index 8dc726db84c..80b18ee4bd7 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result @@ -81,7 +81,7 @@ set @b1 = 'b1'; set @b1 = concat(@b1,@b1); INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 @@ -106,7 +106,7 @@ START SLAVE; INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), (30000.22,4,'QA TESTING'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 @@ -131,7 +131,7 @@ START SLAVE; INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), (2,'JOE',300.01,0,'b2b2',1.0000009); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 @@ -155,7 +155,7 @@ START SLAVE; INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), (2,'JOE',300.01,0); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** Last_SQL_Error = Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; @@ -253,7 +253,7 @@ set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 @@ -277,7 +277,7 @@ set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 @@ -593,7 +593,7 @@ START SLAVE; *** Master Data Insert *** INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result index 642fc078918..1a79affabe6 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result @@ -81,7 +81,7 @@ set @b1 = 'b1'; set @b1 = concat(@b1,@b1); INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 @@ -106,7 +106,7 @@ START SLAVE; INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), (30000.22,4,'QA TESTING'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 @@ -131,7 +131,7 @@ START SLAVE; INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), (2,'JOE',300.01,0,'b2b2',1.0000009); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 @@ -155,7 +155,7 @@ START SLAVE; INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), (2,'JOE',300.01,0); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** Last_SQL_Error = Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; @@ -229,7 +229,7 @@ set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 @@ -253,7 +253,7 @@ set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 @@ -569,7 +569,7 @@ START SLAVE; *** Master Data Insert *** INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** -*** Expect slave to fail with Error 1522 *** +*** Expect slave to fail with Error 1535 *** ******************************************** --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 From 10f9434f1216e744d98cd071f92a27fb33cb361d Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Tue, 25 May 2010 11:01:03 +0300 Subject: [PATCH 059/121] Fix comments on row_merge_write() This is a port of vasil.dimov@oracle.com-20100521175337-c1b1lqxgizqegb0w and vasil.dimov@oracle.com-20100521180951-mef23h24k023xuwq from mysql-trunk-innodb --- storage/innodb_plugin/row/row0merge.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c index f3a695071d3..1f6851bf63c 100644 --- a/storage/innodb_plugin/row/row0merge.c +++ b/storage/innodb_plugin/row/row0merge.c @@ -717,14 +717,16 @@ row_merge_read( } /********************************************************************//** -Read a merge block from the file system. +Write a merge block to the file system. @return TRUE if request was successful, FALSE if fail */ static ibool row_merge_write( /*============*/ int fd, /*!< in: file descriptor */ - ulint offset, /*!< in: offset where to write */ + ulint offset, /*!< in: offset where to read + in number of row_merge_block_t + elements */ const void* buf) /*!< in: data */ { ib_uint64_t ofs = ((ib_uint64_t) offset) From 4ecd80297e769f96b0150e4830740119f696b0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 25 May 2010 15:37:48 +0300 Subject: [PATCH 060/121] Suppress bogus Valgrind warnings about buf_buddy_relocate() accessing uninitialized memory in Valgrind-instrumented builds. --- mysql-test/valgrind.supp | 5 +++++ storage/innodb_plugin/buf/buf0buddy.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 6b10e4cb544..d082b750de9 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -722,3 +722,8 @@ fun:pthread_create* } +{ + buf_buddy_relocate peeking (space,page) in potentially free blocks + Memcheck:Addr1 + fun:buf_buddy_relocate +} diff --git a/storage/innodb_plugin/buf/buf0buddy.c b/storage/innodb_plugin/buf/buf0buddy.c index 07753cb8a60..ee5a569c3ff 100644 --- a/storage/innodb_plugin/buf/buf0buddy.c +++ b/storage/innodb_plugin/buf/buf0buddy.c @@ -442,11 +442,15 @@ buf_buddy_relocate( pool), so there is nothing wrong about this. The mach_read_from_4() calls here will only trigger bogus Valgrind memcheck warnings in UNIV_DEBUG_VALGRIND builds. */ - bpage = buf_page_hash_get( - mach_read_from_4((const byte*) src - + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID), - mach_read_from_4((const byte*) src - + FIL_PAGE_OFFSET)); + ulint space = mach_read_from_4( + (const byte*) src + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); + ulint page_no = mach_read_from_4( + (const byte*) src + FIL_PAGE_OFFSET); + /* Suppress Valgrind warnings about conditional jump + on uninitialized value. */ + UNIV_MEM_VALID(&space, sizeof space); + UNIV_MEM_VALID(&page_no, sizeof page_no); + bpage = buf_page_hash_get(space, page_no); if (!bpage || bpage->zip.data != src) { /* The block has probably been freshly From 268e38753b55dee8822324cf105b7f16ed79bffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 25 May 2010 15:53:52 +0300 Subject: [PATCH 061/121] row_search_for_mysql(): Add assertions to track down Bug #53627. --- storage/innodb_plugin/row/row0sel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/storage/innodb_plugin/row/row0sel.c b/storage/innodb_plugin/row/row0sel.c index 0735215a9a9..4d19ed93a49 100644 --- a/storage/innodb_plugin/row/row0sel.c +++ b/storage/innodb_plugin/row/row0sel.c @@ -3611,6 +3611,13 @@ shortcut_fails_too_big_rec: trx->has_search_latch = FALSE; } + ut_ad(prebuilt->sql_stat_start || trx->conc_state == TRX_ACTIVE); + ut_ad(trx->conc_state == TRX_NOT_STARTED + || trx->conc_state == TRX_ACTIVE); + ut_ad(prebuilt->sql_stat_start + || prebuilt->select_lock_type != LOCK_NONE + || trx->read_view); + trx_start_if_not_started(trx); if (trx->isolation_level <= TRX_ISO_READ_COMMITTED From c42772c7f2d7ec7fb838ec3076afc6620ab24322 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 25 May 2010 14:27:52 +0100 Subject: [PATCH 062/121] bug#49968: Properly define HAVE_ERRNO_AS_DEFINE for the appropriate OpenBSD releases. Apply patch from Brad Smith, thanks! --- include/my_global.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/my_global.h b/include/my_global.h index e4e53aca20a..e284acce186 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -55,6 +55,10 @@ #define USE_PRAGMA_INTERFACE #endif +#if defined(__OpenBSD__) && (OpenBSD >= 200411) +#define HAVE_ERRNO_AS_DEFINE +#endif + #if defined(i386) && !defined(__i386__) #define __i386__ #endif From 342819f1680c6821a2b495e2fa888e5291767bb7 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 25 May 2010 10:36:48 -0300 Subject: [PATCH 063/121] Bug#53908: compile failure with embedded enabled This fixes a recently introduced regression, where a variable is not defined for the embedded server. Although the embedded server is not supported in 5.0, make it at least compile. --- sql/sql_parse.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d0a4fff442f..b9a8537b61a 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -493,6 +493,7 @@ int check_user(THD *thd, enum enum_server_command command, } send_ok(thd); thd->password= test(passwd_len); // remember for error messages +#ifndef EMBEDDED_LIBRARY /* Allow the network layer to skip big packets. Although a malicious authenticated session might use this to trick the server to read @@ -500,6 +501,7 @@ int check_user(THD *thd, enum enum_server_command command, that needs to be preserved as to not break backwards compatibility. */ thd->net.skip_big_packet= TRUE; +#endif /* Ready to handle queries */ DBUG_RETURN(0); } From 0fdd97af48190fab72ea752a7d8120d891bb49af Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Tue, 25 May 2010 15:41:00 +0200 Subject: [PATCH 064/121] Bug#49161: Out of memory; restart server and try again (needed 2 bytes) Problem was reporting wrong error Fixed by adding a new error which better explain the problem. mysql-test/r/partition_error.result: Bug#49161: Out of memory; restart server and try again (needed 2 bytes) Updated test result mysql-test/t/partition_error.test: Bug#49161: Out of memory; restart server and try again (needed 2 bytes) Added test case sql/ha_partition.cc: Bug#49161: Out of memory; restart server and try again (needed 2 bytes) Better error message. (used ER_UNKNOWN_ERROR to avoid merge problems in mysql-trunk+) --- mysql-test/r/partition_error.result | 16 ++++++++++++++++ mysql-test/t/partition_error.test | 22 ++++++++++++++++++++-- sql/ha_partition.cc | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index e1e284556dd..16428fba4d9 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1,5 +1,21 @@ drop table if exists t1; # +# Bug#49161: Out of memory; restart server and try again (needed 2 bytes) +# +CREATE TABLE t1 (a INT) PARTITION BY HASH (a); +FLUSH TABLES; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check Error Failed to read from the .par file +test.t1 check Error Incorrect information in file: './test/t1.frm' +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Failed to read from the .par file +# Note that it is currently impossible to drop a partitioned table +# without the .par file +DROP TABLE t1; +ERROR 42S02: Unknown table 't1' +# # Bug#49477: Assertion `0' failed in ha_partition.cc:5530 # with temporary table and partitions # diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index dbc67032a42..7f733df701b 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -7,7 +7,26 @@ --disable_warnings drop table if exists t1; --enable_warnings - + +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +--echo # +--echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes) +--echo # +CREATE TABLE t1 (a INT) PARTITION BY HASH (a); +FLUSH TABLES; +--remove_file $MYSQLD_DATADIR/test/t1.par +CHECK TABLE t1; +--error ER_UNKNOWN_ERROR +SELECT * FROM t1; +--echo # Note that it is currently impossible to drop a partitioned table +--echo # without the .par file +--error ER_BAD_TABLE_ERROR +DROP TABLE t1; +--remove_file $MYSQLD_DATADIR/test/t1.frm +--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI +--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD + --echo # --echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530 --echo # with temporary table and partitions @@ -167,7 +186,6 @@ partitions 3 partition x2 tablespace ts2, partition x3 tablespace ts3); -let $MYSQLD_DATADIR= `select @@datadir`; select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by hash, invalid field in function diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 4fc3b2c9908..60722f0100e 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -359,7 +359,7 @@ bool ha_partition::initialize_partition(MEM_ROOT *mem_root) } else if (get_from_handler_file(table_share->normalized_path.str, mem_root)) { - mem_alloc_error(2); + my_message(ER_UNKNOWN_ERROR, "Failed to read from the .par file", MYF(0)); DBUG_RETURN(1); } /* From eef9ce8c1ab519a150cdc67552e3eb36cfeca7ff Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Tue, 25 May 2010 17:56:23 +0400 Subject: [PATCH 065/121] Fix for bug #53907: Table dump command can be abused to dump arbitrary tables. Problem: one with SELECT privilege on some table may dump other table performing COM_TABLE_DUMP command due to missed check of the table name. Fix: check the table name. sql/sql_parse.cc: Fix for bug #53907: Table dump command can be abused to dump arbitrary tables. - check given table name performing COM_TABLE_DUMP command. tests/mysql_client_test.c: Fix for bug #53907: Table dump command can be abused to dump arbitrary tables. - test case. --- sql/sql_parse.cc | 12 +++++++++--- tests/mysql_client_test.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d0a4fff442f..70385b8b501 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1432,6 +1432,7 @@ void cleanup_items(Item *item) db database name or an empty string. If empty, the current database of the connection is used tbl_name name of the table to dump + tbl_len its length NOTES This function is written to handle one specific command only. @@ -1442,7 +1443,7 @@ void cleanup_items(Item *item) */ static -int mysql_table_dump(THD* thd, char* db, char* tbl_name) +int mysql_table_dump(THD* thd, char* db, char* tbl_name, uint tbl_len) { TABLE* table; TABLE_LIST* table_list; @@ -1461,6 +1462,11 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name) my_error(ER_WRONG_DB_NAME ,MYF(0), db ? db : "NULL"); goto err; } + if (!tbl_name || check_table_name(tbl_name, tbl_len)) + { + my_error(ER_WRONG_TABLE_NAME , MYF(0), tbl_name ? tbl_name : "NULL"); + goto err; + } if (lower_case_table_names) my_casedn_str(files_charset_info, tbl_name); remove_escape(table_list->table_name); @@ -1471,7 +1477,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name) if (check_one_table_access(thd, SELECT_ACL, table_list)) goto err; thd->free_list = 0; - thd->set_query(tbl_name, (uint) strlen(tbl_name)); + thd->set_query(tbl_name, tbl_len); if ((error = mysqld_dump_create_info(thd, table_list, -1))) { my_error(ER_GET_ERRNO, MYF(0), my_errno); @@ -1838,7 +1844,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } tbl_name= strmake(db, packet + 1, db_len)+1; strmake(tbl_name, packet + db_len + 2, tbl_len); - mysql_table_dump(thd, db, tbl_name); + mysql_table_dump(thd, db, tbl_name, tbl_len); break; } case COM_CHANGE_USER: diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 5b26b96707b..b50c1efe92b 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16720,6 +16720,43 @@ static void test_bug53371() } +static void test_bug53907() +{ + int rc; + char buf[] = "\x4test\x14../client_test_db/t1"; + + myheader("test_bug53907"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + myquery(rc); + rc= mysql_query(mysql, "DROP DATABASE IF EXISTS bug53907"); + myquery(rc); + rc= mysql_query(mysql, "DROP USER 'testbug'@localhost"); + + rc= mysql_query(mysql, "CREATE TABLE t1 (a INT)"); + myquery(rc); + rc= mysql_query(mysql, "CREATE DATABASE bug53907"); + myquery(rc); + rc= mysql_query(mysql, "GRANT SELECT ON bug53907.* to 'testbug'@localhost"); + myquery(rc); + + rc= mysql_change_user(mysql, "testbug", NULL, "bug53907"); + myquery(rc); + + rc= simple_command(mysql, COM_TABLE_DUMP, buf, sizeof(buf), 0); + DIE_UNLESS(mysql_errno(mysql) == 1103); /* ER_WRONG_TABLE_NAME */ + + rc= mysql_change_user(mysql, opt_user, opt_password, current_db); + myquery(rc); + rc= mysql_query(mysql, "DROP TABLE t1"); + myquery(rc); + rc= mysql_query(mysql, "DROP DATABASE bug53907"); + myquery(rc); + rc= mysql_query(mysql, "DROP USER 'testbug'@localhost"); + myquery(rc); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -17024,6 +17061,7 @@ static struct my_tests_st my_tests[]= { { "test_bug20023", test_bug20023 }, { "test_bug45010", test_bug45010 }, { "test_bug53371", test_bug53371 }, + { "test_bug53907", test_bug53907 }, { 0, 0 } }; From 1d0acc7754a44613d2ad56dc2231f20a1bedf718 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 25 May 2010 18:43:45 +0400 Subject: [PATCH 066/121] Bug #53830: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index)) UPDATE on an InnoDB table modifying the same index that is used to satisfy the WHERE condition could trigger a debug assertion under some circumstances. Since for engines with the HA_PRIMARY_KEY_IN_READ_INDEX flag set results of an index scan on a secondary index are appended by the primary key value, if a query involves only columns from the primary key and a secondary index, the latter is considered to be covering. That tricks mysql_update() to mark for reading only columns from the secondary index when it does an index scan to retrieve rows to update in case a part of that key is also being updated. However, there may be other columns in WHERE that are part of the primary key, but not the secondary one. What we actually want to do in this case is to add index columns to the existing WHERE columns bitmap rather than replace it. mysql-test/r/innodb_mysql.result: Test case for bug #53830. mysql-test/t/innodb_mysql.test: Test case for bug #53830. sql/sql_update.cc: Add index columns to the read_set bitmap, don't replace it. sql/table.cc: Added a new add_read_columns_used_by_index() function to st_table. sql/table.h: Added a new add_read_columns_used_by_index() function to st_table. --- mysql-test/r/innodb_mysql.result | 9 +++++++++ mysql-test/t/innodb_mysql.test | 14 ++++++++++++++ sql/sql_update.cc | 2 +- sql/table.cc | 21 +++++++++++++++++++++ sql/table.h | 1 + 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 8257b291cf1..6590bac9c47 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -2408,4 +2408,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where DROP TABLE t1,t2; +# +# Bug #53830: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index)) +# +CREATE TABLE t1 (a INT, b INT, c INT, d INT, +PRIMARY KEY(a,b,c), KEY(b,d)) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0, 77, 1, 3); +UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index f179f3960a9..52a30d2fbb4 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -649,4 +649,18 @@ EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0 DROP TABLE t1,t2; + +--echo # +--echo # Bug #53830: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index)) +--echo # + +CREATE TABLE t1 (a INT, b INT, c INT, d INT, + PRIMARY KEY(a,b,c), KEY(b,d)) + ENGINE=InnoDB; +INSERT INTO t1 VALUES (0, 77, 1, 3); + +UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25; + +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 69f3a29e923..7df0898e841 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -397,7 +397,7 @@ int mysql_update(THD *thd, matching rows before updating the table! */ if (used_index < MAX_KEY && old_covering_keys.is_set(used_index)) - table->mark_columns_used_by_index(used_index); + table->add_read_columns_used_by_index(used_index); else { table->use_all_columns(); diff --git a/sql/table.cc b/sql/table.cc index 8b97dd36170..0fef7fa639a 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4377,6 +4377,27 @@ void st_table::mark_columns_used_by_index(uint index) } +/* + Add fields used by a specified index to the table's read_set. + + NOTE: + The original state can be restored with + restore_column_maps_after_mark_index(). +*/ + +void st_table::add_read_columns_used_by_index(uint index) +{ + MY_BITMAP *bitmap= &tmp_set; + DBUG_ENTER("st_table::add_read_columns_used_by_index"); + + set_keyread(TRUE); + bitmap_copy(bitmap, read_set); + mark_columns_used_by_index_no_reset(index, bitmap); + column_bitmaps_set(bitmap, write_set); + DBUG_VOID_RETURN; +} + + /* Restore to use normal column maps after key read diff --git a/sql/table.h b/sql/table.h index bddb0731625..4125c252427 100644 --- a/sql/table.h +++ b/sql/table.h @@ -865,6 +865,7 @@ struct st_table { void prepare_for_position(void); void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map); void mark_columns_used_by_index(uint index); + void add_read_columns_used_by_index(uint index); void restore_column_maps_after_mark_index(); void mark_auto_increment_column(void); void mark_columns_needed_for_update(void); From 602bb5c0fe0fa9f2df6425efe566d3e11452da69 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Tue, 25 May 2010 22:31:27 -0700 Subject: [PATCH 067/121] Fix Bug #53592 in plugin code, "crash replacing duplicates into table after fast alter table added unique key". Look up MySQL index number should go through index translation table. rb://347, approved by Marko --- .../innodb_plugin/r/innodb_bug53592.result | 26 +++++++ .../innodb_plugin/t/innodb_bug53592.test | 59 ++++++++++++++++ storage/innodb_plugin/handler/ha_innodb.cc | 67 ++++++++++++++++++- storage/innodb_plugin/include/row0mysql.h | 9 --- storage/innodb_plugin/row/row0mysql.c | 31 --------- storage/innodb_plugin/setup.sh | 2 +- 6 files changed, 150 insertions(+), 44 deletions(-) create mode 100644 mysql-test/suite/innodb_plugin/r/innodb_bug53592.result create mode 100644 mysql-test/suite/innodb_plugin/t/innodb_bug53592.test diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug53592.result b/mysql-test/suite/innodb_plugin/r/innodb_bug53592.result new file mode 100644 index 00000000000..18906568613 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug53592.result @@ -0,0 +1,26 @@ +set old_alter_table=0; +create table bug53592(a int) engine=innodb row_format=compact; +alter table bug53592 add column b text charset utf8; +alter table bug53592 add column c blob not null; +create index bug53592_b on bug53592(b(81)); +create unique index bug53592_c on bug53592(c(1)); +replace into bug53592 values (),(); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +check table bug53592; +Table Op Msg_type Msg_text +test.bug53592 check status OK +drop table bug53592; +set old_alter_table=1; +create table bug53592(a int) engine=innodb row_format=compact; +alter table bug53592 add column b text charset utf8; +alter table bug53592 add column c blob not null; +create index bug53592_b on bug53592(b(81)); +create unique index bug53592_c on bug53592(c(1)); +replace into bug53592 values (),(); +Warnings: +Warning 1364 Field 'c' doesn't have a default value +check table bug53592; +Table Op Msg_type Msg_text +test.bug53592 check status OK +drop table bug53592; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug53592.test b/mysql-test/suite/innodb_plugin/t/innodb_bug53592.test new file mode 100644 index 00000000000..ca2bd41b137 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug53592.test @@ -0,0 +1,59 @@ +# Testcase for Bug #53592 - "crash replacing duplicates into +# table after fast alter table added unique key". The fix is to make +# sure index number lookup should go through "index translation table". + +--source include/have_innodb.inc + +# Use FIC for index creation +set old_alter_table=0; + +create table bug53592(a int) engine=innodb row_format=compact; + +alter table bug53592 add column b text charset utf8; + +alter table bug53592 add column c blob not null; + +# Create a non-unique nonclustered index +create index bug53592_b on bug53592(b(81)); + +# Create a unique index, this unique index should have smaller +# index number than bug53592_b, since unique index ranks higher +# than regular index does +create unique index bug53592_c on bug53592(c(1)); + +# This will trigger a dup key error and will require fetching +# the index number through a index structure for the error reporting. +# To get the correct index number, the code should go through index +# translation table. Otherwise, it will get the wrong index +# number and later trigger a server crash. +replace into bug53592 values (),(); + +check table bug53592; + +drop table bug53592; + +# Running the same set of test when "old_alter_table" is turned on +set old_alter_table=1; + +create table bug53592(a int) engine=innodb row_format=compact; + +alter table bug53592 add column b text charset utf8; + +alter table bug53592 add column c blob not null; + +# Create a non-unique nonclustered index +create index bug53592_b on bug53592(b(81)); + +# Create a unique index +create unique index bug53592_c on bug53592(c(1)); + +# This will trigger a dup key error and will require fetching +# the index number through a index structure for the error reporting. +# To get the correct index number, the code should go through index +# translation table. Otherwise, it will get the wrong index +# number and later trigger a server crash. +replace into bug53592 values (),(); + +check table bug53592; + +drop table bug53592; diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc index bd0618b7424..f753e2d1cbd 100644 --- a/storage/innodb_plugin/handler/ha_innodb.cc +++ b/storage/innodb_plugin/handler/ha_innodb.cc @@ -6673,7 +6673,7 @@ ha_innobase::create( (int) form->s->primary_key : -1); - /* Our function row_get_mysql_key_number_for_index assumes + /* Our function innobase_get_mysql_key_number_for_index assumes the primary key is always number 0, if it exists */ ut_a(primary_key_no == -1 || primary_key_no == 0); @@ -7389,6 +7389,67 @@ ha_innobase::read_time( return(ranges + (double) rows / (double) total_rows * time_for_scan); } +/*********************************************************************//** +Calculates the key number used inside MySQL for an Innobase index. We will +first check the "index translation table" for a match of the index to get +the index number. If there does not exist an "index translation table", +or not able to find the index in the translation table, then we will fall back +to the traditional way of looping through dict_index_t list to find a +match. In this case, we have to take into account if we generated a +default clustered index for the table +@return the key number used inside MySQL */ +static +unsigned int +innobase_get_mysql_key_number_for_index( +/*====================================*/ + INNOBASE_SHARE* share, /*!< in: share structure for index + translation table. */ + const TABLE* table, /*!< in: table in MySQL data + dictionary */ + dict_table_t* ib_table,/*!< in: table in Innodb data + dictionary */ + const dict_index_t* index) /*!< in: index */ +{ + const dict_index_t* ind; + unsigned int i; + + ut_ad(index); + ut_ad(ib_table); + ut_ad(table); + ut_ad(share); + + /* If index translation table exists, we will first check + the index through index translation table for a match. */ + if (share->idx_trans_tbl.index_mapping) { + for (i = 0; i < share->idx_trans_tbl.index_count; i++) { + if (share->idx_trans_tbl.index_mapping[i] == index) { + return(i); + } + } + + /* Print an error message if we cannot find the index + ** in the "index translation table". */ + sql_print_error("Cannot find index %s in InnoDB index " + "translation table.", index->name); + } + + /* If we do not have an "index translation table", or not able + to find the index in the translation table, we'll directly find + matching index in the dict_index_t list */ + for (i = 0; i < table->s->keys; i++) { + ind = dict_table_get_index_on_name( + ib_table, table->key_info[i].name); + + if (index == ind) { + return(i); + } + } + + sql_print_error("Cannot find matching index number for index %s " + "in InnoDB index list.", index->name); + + return(0); +} /*********************************************************************//** Returns statistics information of the table to the MySQL interpreter, in various fields of the handle object. */ @@ -7658,8 +7719,8 @@ ha_innobase::info( err_index = trx_get_error_info(prebuilt->trx); if (err_index) { - errkey = (unsigned int) - row_get_mysql_key_number_for_index(err_index); + errkey = innobase_get_mysql_key_number_for_index( + share, table, ib_table, err_index); } else { errkey = (unsigned int) prebuilt->trx->error_key_num; } diff --git a/storage/innodb_plugin/include/row0mysql.h b/storage/innodb_plugin/include/row0mysql.h index bf9cda1ba80..e90742abe7c 100644 --- a/storage/innodb_plugin/include/row0mysql.h +++ b/storage/innodb_plugin/include/row0mysql.h @@ -253,15 +253,6 @@ row_table_got_default_clust_index( /*==============================*/ const dict_table_t* table); /*!< in: table */ /*********************************************************************//** -Calculates the key number used inside MySQL for an Innobase index. We have -to take into account if we generated a default clustered index for the table -@return the key number used inside MySQL */ -UNIV_INTERN -ulint -row_get_mysql_key_number_for_index( -/*===============================*/ - const dict_index_t* index); /*!< in: index */ -/*********************************************************************//** Does an update or delete of a row for MySQL. @return error code or DB_SUCCESS */ UNIV_INTERN diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c index a98dd8d2900..8d47d0f25fc 100644 --- a/storage/innodb_plugin/row/row0mysql.c +++ b/storage/innodb_plugin/row/row0mysql.c @@ -1645,37 +1645,6 @@ row_table_got_default_clust_index( return(dict_index_get_nth_col(clust_index, 0)->mtype == DATA_SYS); } -/*********************************************************************//** -Calculates the key number used inside MySQL for an Innobase index. We have -to take into account if we generated a default clustered index for the table -@return the key number used inside MySQL */ -UNIV_INTERN -ulint -row_get_mysql_key_number_for_index( -/*===============================*/ - const dict_index_t* index) /*!< in: index */ -{ - const dict_index_t* ind; - ulint i; - - ut_a(index); - - i = 0; - ind = dict_table_get_first_index(index->table); - - while (index != ind) { - ind = dict_table_get_next_index(ind); - i++; - } - - if (row_table_got_default_clust_index(index->table)) { - ut_a(i > 0); - i--; - } - - return(i); -} - /*********************************************************************//** Locks the data dictionary in shared mode from modifications, for performing foreign key check, rollback, or other operation invisible to MySQL. */ diff --git a/storage/innodb_plugin/setup.sh b/storage/innodb_plugin/setup.sh index 23fe729a406..b5d8299d411 100755 --- a/storage/innodb_plugin/setup.sh +++ b/storage/innodb_plugin/setup.sh @@ -21,7 +21,7 @@ set -eu -TARGETDIR=../storage/innobase +TARGETDIR=../storage/innodb_plugin # link the build scripts BUILDSCRIPTS="compile-innodb compile-innodb-debug" From e20e3a2426d4fbe2b7f188b0c2a8dc87459cc9c9 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Tue, 25 May 2010 22:38:14 -0700 Subject: [PATCH 068/121] Update ChangeLog for bug fix regarding 53582. --- storage/innodb_plugin/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 8b5a9bf2d7e..89823642957 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2010-05-25 The InnoDB Team + + * handler/ha_innodb.cc, include/row0mysql.h, row/row0mysql.c: + Fix Bug#53592: crash replacing duplicates into table after fast + alter table added unique key + 2010-05-24 The InnoDB Team * dict/dict0boot.c, dict/dict0crea.c, fil/fil0fil.c, From b01407461b684560784416abdf3537225ba8e7dc Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Wed, 26 May 2010 17:13:02 +0200 Subject: [PATCH 069/121] Bug#52107 Comment in sql/net_serv.cc still makes "GPL protocol" claim Removed misleading comments. --- sql/net_serv.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 15c0c581108..c55c4246750 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -16,11 +16,7 @@ /** @file - This file is the net layer API for the MySQL client/server protocol, - which is a tightly coupled, proprietary protocol owned by MySQL AB. - @note - Any re-implementations of this protocol must also be under GPL - unless one has got an license from MySQL AB stating otherwise. + This file is the net layer API for the MySQL client/server protocol. Write and read of logical packets to/from socket. From d82ce916606ba247638418dd34a9200e50d0670d Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Thu, 27 May 2010 14:48:50 +0400 Subject: [PATCH 070/121] Fixed an incorrect merge from 5.1-bugteam. --- sql/table.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/table.cc b/sql/table.cc index 2b6d55d0cb5..12ac8b11f97 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4445,10 +4445,10 @@ void TABLE::mark_columns_used_by_index(uint index) restore_column_maps_after_mark_index(). */ -void st_table::add_read_columns_used_by_index(uint index) +void TABLE::add_read_columns_used_by_index(uint index) { MY_BITMAP *bitmap= &tmp_set; - DBUG_ENTER("st_table::add_read_columns_used_by_index"); + DBUG_ENTER("TABLE::add_read_columns_used_by_index"); set_keyread(TRUE); bitmap_copy(bitmap, read_set); From 8ede529b361b0c86121879700de580d797fddd4c Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Thu, 27 May 2010 19:13:53 +0400 Subject: [PATCH 071/121] Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins There are two problems: 1. In simplify_joins function we calculate table dependencies. If STRAIGHT_JOIN hint is used for whole SELECT we do not count it and as result some dependendecies might be lost. It leads to incorrect table order which is returned by join_tab_cmp_straight() function. 2. make_join_statistics() calculate the transitive closure for relations a particular JOIN_TAB is 'dependent on'. We aggregate the dependent table_map of a JOIN_TAB by adding dependencies from other tables which we depend on. However, this may also cause new dependencies to be available after we have completed processing a certain JOIN_TAB. Both these problems affect condition pushdown and as result condition might be pushed into wrong table which leads to crash or even omitted which leads to wrong result. The fix: 1. Use modified 'transitive closure' algorithm provided by Ole John Aske 2. Update table dependences in simplify_joins according to global STRAIGHT_JOIN hint. Note: the patch also fixes bugs 46091 & 51492 mysql-test/r/join_outer.result: test case mysql-test/t/join_outer.test: test case sql/sql_select.cc: 1. Use modified 'transitive closure' algorithm provided by Ole John Aske 2. Update table dependences in simplify_joins according to global STRAIGHT_JOIN hint. --- mysql-test/r/join_outer.result | 59 ++++++++++++++++++++++++++++++++++ mysql-test/t/join_outer.test | 45 ++++++++++++++++++++++++++ sql/sql_select.cc | 43 +++++++++++++++++++------ 3 files changed, 137 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 6fe0faacb00..e81389f2735 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1338,4 +1338,63 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE tt9 ALL NULL NULL NULL NULL 2 Using join buffer SET optimizer_search_depth = DEFAULT; DROP TABLE t1; +# +# Bug#46091 STRAIGHT_JOIN + RIGHT JOIN returns different result +# +CREATE TABLE t1 (f1 INT NOT NULL); +INSERT INTO t1 VALUES (9),(0); +CREATE TABLE t2 (f1 INT NOT NULL); +INSERT INTO t2 VALUES +(5),(3),(0),(3),(1),(0),(1),(7),(1),(0),(0),(8),(4),(9),(0),(2),(0),(8),(5),(1); +SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1 +RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1; +COUNT(*) +476 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1 +RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE TA2 ALL NULL NULL NULL NULL 20 Using where +1 SIMPLE TA3 ALL NULL NULL NULL NULL 20 Using join buffer +1 SIMPLE TA1 ALL NULL NULL NULL NULL 2 +DROP TABLE t1, t2; +# +# Bug#48971 Segfault in add_found_match_trig_cond () at sql_select.cc:5990 +# +CREATE TABLE t1(f1 INT, PRIMARY KEY (f1)); +INSERT INTO t1 VALUES (1),(2); +EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1 +LEFT JOIN t1 AS T2 +RIGHT JOIN t1 AS T3 +JOIN t1 AS T4 ON 1 +LEFT JOIN t1 AS T5 ON 1 +ON 1 +RIGHT JOIN t1 AS T6 ON T6.f1 +ON 1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE T1 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T6 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T3 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T4 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T5 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T2 index NULL PRIMARY 4 NULL 2 100.00 Using index +Warnings: +Note 1003 select straight_join `test`.`T1`.`f1` AS `f1` from `test`.`t1` `T1` left join (`test`.`t1` `T6` left join (`test`.`t1` `T3` join `test`.`t1` `T4` left join `test`.`t1` `T5` on(1) left join `test`.`t1` `T2` on(1)) on((`test`.`T6`.`f1` and 1))) on(1) where 1 +EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1 +RIGHT JOIN t1 AS T2 +RIGHT JOIN t1 AS T3 +JOIN t1 AS T4 ON 1 +LEFT JOIN t1 AS T5 ON 1 +ON 1 +RIGHT JOIN t1 AS T6 ON T6.f1 +ON 1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE T6 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T3 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T4 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T5 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T2 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE T1 index NULL PRIMARY 4 NULL 2 100.00 Using index +Warnings: +Note 1003 select straight_join `test`.`T1`.`f1` AS `f1` from `test`.`t1` `T6` left join (`test`.`t1` `T3` join `test`.`t1` `T4` left join `test`.`t1` `T5` on(1) left join `test`.`t1` `T2` on(1)) on((`test`.`T6`.`f1` and 1)) left join `test`.`t1` `T1` on(1) where 1 +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index aaea8b3120b..e7bc5cf6317 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -936,4 +936,49 @@ FROM t1 tt3 LEFT OUTER JOIN t1 tt4 ON 1 SET optimizer_search_depth = DEFAULT; DROP TABLE t1; + +--echo # +--echo # Bug#46091 STRAIGHT_JOIN + RIGHT JOIN returns different result +--echo # +CREATE TABLE t1 (f1 INT NOT NULL); +INSERT INTO t1 VALUES (9),(0); + +CREATE TABLE t2 (f1 INT NOT NULL); +INSERT INTO t2 VALUES +(5),(3),(0),(3),(1),(0),(1),(7),(1),(0),(0),(8),(4),(9),(0),(2),(0),(8),(5),(1); + +SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1 +RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1; + +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1 +RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1; + +DROP TABLE t1, t2; + +--echo # +--echo # Bug#48971 Segfault in add_found_match_trig_cond () at sql_select.cc:5990 +--echo # +CREATE TABLE t1(f1 INT, PRIMARY KEY (f1)); +INSERT INTO t1 VALUES (1),(2); + +EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1 + LEFT JOIN t1 AS T2 + RIGHT JOIN t1 AS T3 + JOIN t1 AS T4 ON 1 + LEFT JOIN t1 AS T5 ON 1 + ON 1 + RIGHT JOIN t1 AS T6 ON T6.f1 + ON 1; + +EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1 + RIGHT JOIN t1 AS T2 + RIGHT JOIN t1 AS T3 + JOIN t1 AS T4 ON 1 + LEFT JOIN t1 AS T5 ON 1 + ON 1 + RIGHT JOIN t1 AS T6 ON T6.f1 + ON 1; + +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6f128cb8181..ccb63dc0ed0 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2709,31 +2709,53 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds, /* Build transitive closure for relation 'to be dependent on'. This will speed up the plan search for many cases with outer joins, - as well as allow us to catch illegal cross references/ + as well as allow us to catch illegal cross references. Warshall's algorithm is used to build the transitive closure. - As we use bitmaps to represent the relation the complexity - of the algorithm is O((number of tables)^2). + As we may restart the outer loop upto 'table_count' times, the + complexity of the algorithm is O((number of tables)^3). + However, most of the iterations will be shortcircuited when + there are no pedendencies to propogate. */ - for (i= 0, s= stat ; i < table_count ; i++, s++) + for (i= 0 ; i < table_count ; i++) { - for (uint j= 0 ; j < table_count ; j++) + uint j; + table= stat[i].table; + + if (!table->reginfo.join_tab->dependent) + continue; + + /* Add my dependencies to other tables depending on me */ + for (j= 0, s= stat ; j < table_count ; j++, s++) { - table= stat[j].table; if (s->dependent & table->map) + { + table_map was_dependent= s->dependent; s->dependent |= table->reginfo.join_tab->dependent; + /* + If we change dependencies for a table we already have + processed: Redo dependency propagation from this table. + */ + if (i > j && s->dependent != was_dependent) + { + i = j-1; + break; + } + } } - if (outer_join & s->table->map) - s->table->maybe_null= 1; } - /* Catch illegal cross references for outer joins */ + for (i= 0, s= stat ; i < table_count ; i++, s++) { + /* Catch illegal cross references for outer joins */ if (s->dependent & s->table->map) { join->tables=0; // Don't use join->table my_message(ER_WRONG_OUTER_JOIN, ER(ER_WRONG_OUTER_JOIN), MYF(0)); goto error; } + + if (outer_join & s->table->map) + s->table->maybe_null= 1; s->key_dependent= s->dependent; } } @@ -8704,6 +8726,7 @@ simplify_joins(JOIN *join, List *join_list, COND *conds, bool top) NESTED_JOIN *nested_join; TABLE_LIST *prev_table= 0; List_iterator li(*join_list); + bool straight_join= test(join->select_options & SELECT_STRAIGHT_JOIN); DBUG_ENTER("simplify_joins"); /* @@ -8814,7 +8837,7 @@ simplify_joins(JOIN *join, List *join_list, COND *conds, bool top) if (prev_table) { /* The order of tables is reverse: prev_table follows table */ - if (prev_table->straight) + if (prev_table->straight || straight_join) prev_table->dep_tables|= used_tables; if (prev_table->on_expr) { From 6734ce935e0c7aad8122ecfb45cfc4ffde392648 Mon Sep 17 00:00:00 2001 From: Inaam Rana Date: Thu, 27 May 2010 12:31:00 -0400 Subject: [PATCH 072/121] Fix the printout in for long semaphore waits to not list a thread doing a wait_ex as an s-lock waiter. --- storage/innodb_plugin/sync/sync0arr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/innodb_plugin/sync/sync0arr.c b/storage/innodb_plugin/sync/sync0arr.c index ed9e25bf2f2..3c825e2202b 100644 --- a/storage/innodb_plugin/sync/sync0arr.c +++ b/storage/innodb_plugin/sync/sync0arr.c @@ -498,7 +498,9 @@ sync_array_cell_print( || type == RW_LOCK_WAIT_EX || type == RW_LOCK_SHARED) { - fputs(type == RW_LOCK_EX ? "X-lock on" : "S-lock on", file); + fputs(type == RW_LOCK_EX ? "X-lock on" + : type == RW_LOCK_WAIT_EX ? "X-lock (wait_ex) on" + : "S-lock on", file); rwlock = cell->old_wait_rw_lock; From 0a35e5bd18951a59aec6977a7a1f34d87c10ca88 Mon Sep 17 00:00:00 2001 From: Dmitry Lenev Date: Fri, 28 May 2010 00:07:40 +0400 Subject: [PATCH 073/121] A 5.1-only version of fix for bug #46947 "Embedded SELECT without FOR UPDATE is causing a lock". SELECT statements with subqueries referencing InnoDB tables were acquiring shared locks on rows in these tables when they were executed in REPEATABLE-READ mode and with statement or mixed mode binary logging turned on. This was a regression which were introduced when fixing bug 39843. The problem was that for tables belonging to subqueries parser set TL_READ_DEFAULT as a lock type. In cases when statement/mixed binary logging at open_tables() time this type of lock was converted to TL_READ_NO_INSERT lock at open_tables() time and caused InnoDB engine to acquire shared locks on reads from these tables. Although in some cases such behavior was correct (e.g. for subqueries in DELETE) in case of SELECT it has caused unnecessary locking. This patch implements minimal version of the fix for the specific problem described in the bug-report which supposed to be not too risky for pushing into 5.1 tree. The 5.5 tree already contains a more appropriate solution which also addresses other related issues like bug 53921 "Wrong locks for SELECTs used stored functions may lead to broken SBR". This patch tries to solve the problem by ensuring that TL_READ_DEFAULT lock which is set in the parser for tables participating in subqueries at open_tables() time is interpreted as TL_READ_NO_INSERT or TL_READ. TL_READ is used only if we know that this is a SELECT and that this particular table is not used by a stored function. Test coverage is added for both InnoDB and MyISAM. This patch introduces an "incompatible" change in locking scheme for subqueries used in SELECT ... FOR UPDATE and SELECT .. IN SHARE MODE. In 4.1 (as well as in 5.0 and 5.1 before fix for bug 39843) the server would use a snapshot InnoDB read for subqueries in SELECT FOR UPDATE and SELECT .. IN SHARE MODE statements, regardless of whether the binary log is on or off. If the user required a different type of read (i.e. locking read), he/she could request so explicitly by providing FOR UPDATE/IN SHARE MODE clause for each individual subquery. The patch for bug 39843 broke this behaviour (which was not documented or tested), and started to use locking reads for all subqueries in SELECT ... FOR UPDATE/IN SHARE MODE. This patch restores 4.1 behaviour. This patch should be mostly null-merged into 5.5 tree. mysql-test/include/check_concurrent_insert.inc: Added auxiliary script which allows to check if statement reading table allows concurrent inserts in it. mysql-test/include/check_no_concurrent_insert.inc: Added auxiliary script which allows to check that statement reading table doesn't allow concurrent inserts in it. mysql-test/include/check_no_row_lock.inc: Added auxiliary script which allows to check if statement reading table doesn't take locks on its rows. mysql-test/include/check_shared_row_lock.inc: Added auxiliary script which allows to check if statement reading table takes shared locks on some of its rows. mysql-test/r/bug39022.result: After bug #46947 'Embedded SELECT without FOR UPDATE is causing a lock' was fixed test case for bug 39022 has to be adjusted in order to trigger execution path on which original problem was encountered. mysql-test/r/innodb_mysql_lock2.result: Added coverage for handling of locking in various cases when we read data from InnoDB tables (includes test case for bug #46947 'Embedded SELECT without FOR UPDATE is causing a lock'). mysql-test/r/lock_sync.result: Added coverage for handling of locking in various cases when we read data from MyISAM tables. mysql-test/t/bug39022.test: After bug #46947 'Embedded SELECT without FOR UPDATE is causing a lock' was fixed test case for bug 39022 has to be adjusted in order to trigger execution path on which original problem was encountered. mysql-test/t/innodb_mysql_lock2.test: Added coverage for handling of locking in various cases when we read data from InnoDB tables (includes test case for bug #46947 'Embedded SELECT without FOR UPDATE is causing a lock'). mysql-test/t/lock_sync.test: Added coverage for handling of locking in various cases when we read data from MyISAM tables. sql/mysql_priv.h: Function read_lock_type_for_table() now takes pointers to LEX and TABLE_LIST elements as its arguments since to correctly determine lock type it needs to know what statement is being performed and whether table element for which lock type to be determined belongs to prelocking list. sql/sql_base.cc: Changed read_lock_type_for_table() to return a weak TL_READ type of lock in cases when we are executing SELECT (and so won't update tables directly) and table doesn't belong to statement's prelocking list and thus can't be used by a stored function. It is OK to do so since in this case table won't be used by statement or function call which will be written to the binary log, so serializability requirements for it can be relaxed. One of results from this change is that SELECTs on InnoDB tables no longer takes shared row locks for tables which are used in subqueries (i.e. bug #46947 is fixed). Another result is that for similar SELECTs on MyISAM tables concurrent inserts are allowed. In order to implement this change signature of read_lock_type_for_table() function was changed to take pointers to LEX and TABLE_LIST objects. sql/sql_update.cc: Function read_lock_type_for_table() now takes pointers to LEX and TABLE_LIST elements as its arguments since to correctly determine lock type it needs to know what statement is being performed and whether table element for which lock type to be determined belongs to prelocking list. --- .../include/check_concurrent_insert.inc | 96 ++ .../include/check_no_concurrent_insert.inc | 81 ++ mysql-test/include/check_no_row_lock.inc | 71 ++ mysql-test/include/check_shared_row_lock.inc | 61 ++ mysql-test/r/bug39022.result | 6 +- mysql-test/r/innodb_mysql_lock2.result | 601 ++++++++++++ mysql-test/r/lock_sync.result | 631 +++++++++++++ mysql-test/t/bug39022.test | 6 +- mysql-test/t/innodb_mysql_lock2.test | 803 ++++++++++++++++ mysql-test/t/lock_sync.test | 867 ++++++++++++++++++ sql/mysql_priv.h | 3 +- sql/sql_base.cc | 34 +- sql/sql_update.cc | 2 +- 13 files changed, 3245 insertions(+), 17 deletions(-) create mode 100644 mysql-test/include/check_concurrent_insert.inc create mode 100644 mysql-test/include/check_no_concurrent_insert.inc create mode 100644 mysql-test/include/check_no_row_lock.inc create mode 100644 mysql-test/include/check_shared_row_lock.inc create mode 100644 mysql-test/r/innodb_mysql_lock2.result create mode 100644 mysql-test/r/lock_sync.result create mode 100644 mysql-test/t/innodb_mysql_lock2.test create mode 100644 mysql-test/t/lock_sync.test diff --git a/mysql-test/include/check_concurrent_insert.inc b/mysql-test/include/check_concurrent_insert.inc new file mode 100644 index 00000000000..f4bec3c9cdb --- /dev/null +++ b/mysql-test/include/check_concurrent_insert.inc @@ -0,0 +1,96 @@ +# +# SUMMARY +# Check if statement reading table '$table' allows concurrent +# inserts in it. +# +# PARAMETERS +# $table Table in which concurrent inserts should be allowed. +# $con_aux1 Name of the first auxiliary connection to be used by this +# script. +# $con_aux2 Name of the second auxiliary connection to be used by this +# script. +# $statement Statement to be checked. +# $restore_table Table which might be modified by statement to be checked +# and thus needs backing up before its execution and +# restoring after it (can be empty). +# +# EXAMPLE +# lock_sync.test +# +--disable_result_log +--disable_query_log + +# Reset DEBUG_SYNC facility for safety. +set debug_sync= "RESET"; + +if (`SELECT '$restore_table' <> ''`) +{ +--eval create temporary table t_backup select * from $restore_table; +} + +connection $con_aux1; +set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go'; +--send_eval $statement; + +connection $con_aux2; +set debug_sync='now WAIT_FOR parked'; +--send_eval insert into $table (i) values (0); + +--enable_result_log +--enable_query_log +connection default; +# Wait until concurrent insert is successfully executed while +# statement being checked has its tables locked. +# We use wait_condition.inc instead of simply reaping +# concurrent insert here in order to avoid deadlocks if test +# fails and to time out gracefully instead. +let $wait_condition= + select count(*) = 0 from information_schema.processlist + where info = "insert into $table (i) values (0)"; +--source include/wait_condition.inc + +--disable_result_log +--disable_query_log + +if ($success) +{ +# Apparently concurrent insert was successfully executed. +# To be safe against wait_condition.inc succeeding due to +# races let us first reap concurrent insert to ensure that +# it has really been successfully executed. +connection $con_aux2; +--reap +connection default; +set debug_sync= 'now SIGNAL go'; +connection $con_aux1; +--reap +connection default; +--echo Success: '$statement' allows concurrent inserts into '$table'. +} +if (!$success) +{ +# Waiting has timed out. Apparently concurrent insert was blocked. +# So to be able to continue we need to end our statement first. +set debug_sync= 'now SIGNAL go'; +connection $con_aux1; +--reap +connection $con_aux2; +--reap +connection default; +--echo Error: '$statement' doesn't allow concurrent inserts into '$table'! +} + +--eval delete from $table where i = 0; + +if (`SELECT '$restore_table' <> ''`) +{ +--eval truncate table $restore_table; +--eval insert into $restore_table select * from t_backup; +drop temporary table t_backup; +} + +# Clean-up. Reset DEBUG_SYNC facility after use. +set debug_sync= "RESET"; + +--enable_result_log +--enable_query_log diff --git a/mysql-test/include/check_no_concurrent_insert.inc b/mysql-test/include/check_no_concurrent_insert.inc new file mode 100644 index 00000000000..f60401bcad1 --- /dev/null +++ b/mysql-test/include/check_no_concurrent_insert.inc @@ -0,0 +1,81 @@ +# +# SUMMARY +# Check that statement reading table '$table' doesn't allow concurrent +# inserts in it. +# +# PARAMETERS +# $table Table in which concurrent inserts should be disallowed. +# $con_aux1 Name of the first auxiliary connection to be used by this +# script. +# $con_aux2 Name of the second auxiliary connection to be used by this +# script. +# $statement Statement to be checked. +# $restore_table Table which might be modified by statement to be checked +# and thus needs backing up before its execution and +# restoring after it (can be empty). +# +# EXAMPLE +# lock_sync.test +# +--disable_result_log +--disable_query_log + +# Reset DEBUG_SYNC facility for safety. +set debug_sync= "RESET"; + +if (`SELECT '$restore_table' <> ''`) +{ +--eval create temporary table t_backup select * from $restore_table; +} + +connection $con_aux1; +set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go'; +--send_eval $statement; + +connection $con_aux2; +set debug_sync='now WAIT_FOR parked'; +--send_eval insert into $table (i) values (0); + +--enable_result_log +--enable_query_log +connection default; +# Wait until concurrent insert is successfully blocked because +# of our statement. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Locked" and info = "insert into $table (i) values (0)"; +--source include/wait_condition.inc + +--disable_result_log +--disable_query_log + +set debug_sync= 'now SIGNAL go'; +connection $con_aux1; +--reap +connection $con_aux2; +--reap +connection default; + +if ($success) +{ +--echo Success: '$statement' doesn't allow concurrent inserts into '$table'. +} +if (!$success) +{ +--echo Error: '$statement' allows concurrent inserts into '$table'! +} + +--eval delete from $table where i = 0; + +if (`SELECT '$restore_table' <> ''`) +{ +--eval truncate table $restore_table; +--eval insert into $restore_table select * from t_backup; +drop temporary table t_backup; +} + +# Clean-up. Reset DEBUG_SYNC facility after use. +set debug_sync= "RESET"; + +--enable_result_log +--enable_query_log diff --git a/mysql-test/include/check_no_row_lock.inc b/mysql-test/include/check_no_row_lock.inc new file mode 100644 index 00000000000..c08e7f35b10 --- /dev/null +++ b/mysql-test/include/check_no_row_lock.inc @@ -0,0 +1,71 @@ +# +# SUMMARY +# Check if statement affecting or reading table '$table' doesn't +# take any kind of locks on its rows. +# +# PARAMETERS +# $table Table for which presence of row locks should be checked. +# $con_aux Name of auxiliary connection to be used by this script. +# $statement Statement to be checked. +# +# EXAMPLE +# innodb_mysql_lock2.test +# +--disable_result_log +--disable_query_log + +connection default; +begin; +--eval select * from $table for update; + +connection $con_aux; +begin; +--send_eval $statement; + +--enable_result_log +--enable_query_log + +connection default; +# Wait until statement is successfully executed while +# all rows in table are X-locked. This means that it +# does not acquire any row locks. +# We use wait_condition.inc instead of simply reaping +# statement here in order to avoid deadlocks if test +# fails and to time out gracefully instead. +let $wait_condition= + select count(*) = 0 from information_schema.processlist + where info = "$statement"; +--source include/wait_condition.inc + +--disable_result_log +--disable_query_log + +if ($success) +{ +# Apparently statement was successfully executed and thus it +# has not required any row locks. +# To be safe against wait_condition.inc succeeding due to +# races let us first reap the statement being checked to +# ensure that it has been successfully executed. +connection $con_aux; +--reap +rollback; +connection default; +rollback; +--echo Success: '$statement' doesn't take row locks on '$table'. +} +if (!$success) +{ +# Waiting has timed out. Apparently statement was blocked on +# some row lock. So to be able to continue we need to unlock +# rows first. +rollback; +connection $con_aux; +--reap +rollback; +connection default; +--echo Error: '$statement' takes some row locks on '$table'! +} + +--enable_result_log +--enable_query_log diff --git a/mysql-test/include/check_shared_row_lock.inc b/mysql-test/include/check_shared_row_lock.inc new file mode 100644 index 00000000000..efc7e13b3aa --- /dev/null +++ b/mysql-test/include/check_shared_row_lock.inc @@ -0,0 +1,61 @@ +# +# SUMMARY +# Check if statement reading table '$table' takes shared locks +# on some of its rows. +# +# PARAMETERS +# $table Table for which presence of row locks should be checked. +# $con_aux Name of auxiliary connection to be used by this script. +# $statement Statement to be checked. +# $wait_statement Sub-statement which is supposed to acquire locks (should +# be the same as $statement for ordinary statements). +# +# EXAMPLE +# innodb_mysql_lock2.test +# +--disable_result_log +--disable_query_log + +connection default; +begin; +--eval select * from $table for update; + +connection $con_aux; +begin; +--send_eval $statement; + +--enable_result_log +--enable_query_log + +connection default; +# Wait until statement is successfully blocked because +# all rows in table are X-locked. This means that at +# least it acquires S-locks on some of rows. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state in ("Sending data","statistics", "preparing") and + info = "$wait_statement"; +--source include/wait_condition.inc + +--disable_result_log +--disable_query_log + +rollback; + +connection $con_aux; +--reap +rollback; + +connection default; +--enable_result_log +--enable_query_log + +if ($success) +{ +--echo Success: '$statement' takes shared row locks on '$table'. +} + +if (!$success) +{ +--echo Error: '$statement' hasn't taken shared row locks on '$table'! +} diff --git a/mysql-test/r/bug39022.result b/mysql-test/r/bug39022.result index 5963709aa2a..75899ed686b 100644 --- a/mysql-test/r/bug39022.result +++ b/mysql-test/r/bug39022.result @@ -12,7 +12,7 @@ INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10), START TRANSACTION; # in thread2 REPLACE INTO t2 VALUES (-17); -SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); +SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; d # in thread1 REPLACE INTO t1(a,b) VALUES (67,20); @@ -21,10 +21,10 @@ COMMIT; START TRANSACTION; REPLACE INTO t1(a,b) VALUES (65,-50); REPLACE INTO t2 VALUES (-91); -SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); +SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; # in thread1 # should not crash -SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); +SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction # in thread2 d diff --git a/mysql-test/r/innodb_mysql_lock2.result b/mysql-test/r/innodb_mysql_lock2.result new file mode 100644 index 00000000000..79606ea8bdc --- /dev/null +++ b/mysql-test/r/innodb_mysql_lock2.result @@ -0,0 +1,601 @@ +# +# Test how do we handle locking in various cases when +# we read data from InnoDB tables. +# +# In fact by performing this test we check two things: +# 1) That SQL-layer correctly determine type of thr_lock.c +# lock to be acquired/passed to InnoDB engine. +# 2) That InnoDB engine correctly interprets this lock +# type and takes necessary row locks or does not +# take them if they are not necessary. +# +# This test makes sense only in REPEATABLE-READ mode as +# in SERIALIZABLE mode all statements that read data take +# shared lock on them to enforce its semantics. +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +# Prepare playground by creating tables, views, +# routines and triggers used in tests. +drop table if exists t0, t1, t2, t3, t4, t5, te; +drop view if exists v1, v2; +drop procedure if exists p1; +drop procedure if exists p2; +drop function if exists f1; +drop function if exists f2; +drop function if exists f3; +drop function if exists f4; +drop function if exists f5; +drop function if exists f6; +drop function if exists f7; +drop function if exists f8; +drop function if exists f9; +drop function if exists f10; +drop function if exists f11; +drop function if exists f12; +drop function if exists f13; +drop function if exists f14; +drop function if exists f15; +create table t1 (i int primary key) engine=innodb; +insert into t1 values (1), (2), (3), (4), (5); +create table t2 (j int primary key) engine=innodb; +insert into t2 values (1), (2), (3), (4), (5); +create table t3 (k int primary key) engine=innodb; +insert into t3 values (1), (2), (3); +create table t4 (l int primary key) engine=innodb; +insert into t4 values (1); +create table t5 (l int primary key) engine=innodb; +insert into t5 values (1); +create table te(e int primary key); +insert into te values (1); +create view v1 as select i from t1; +create view v2 as select j from t2 where j in (select i from t1); +create procedure p1(k int) insert into t2 values (k); +create function f1() returns int +begin +declare j int; +select i from t1 where i = 1 into j; +return j; +end| +create function f2() returns int +begin +declare k int; +select i from t1 where i = 1 into k; +insert into t2 values (k + 5); +return 0; +end| +create function f3() returns int +begin +return (select i from t1 where i = 3); +end| +create function f4() returns int +begin +if (select i from t1 where i = 3) then +return 1; +else +return 0; +end if; +end| +create function f5() returns int +begin +insert into t2 values ((select i from t1 where i = 1) + 5); +return 0; +end| +create function f6() returns int +begin +declare k int; +select i from v1 where i = 1 into k; +return k; +end| +create function f7() returns int +begin +declare k int; +select j from v2 where j = 1 into k; +return k; +end| +create function f8() returns int +begin +declare k int; +select i from v1 where i = 1 into k; +insert into t2 values (k+5); +return k; +end| +create function f9() returns int +begin +update v2 set j=j+10 where j=1; +return 1; +end| +create function f10() returns int +begin +return f1(); +end| +create function f11() returns int +begin +declare k int; +set k= f1(); +insert into t2 values (k+5); +return k; +end| +create function f12(p int) returns int +begin +insert into t2 values (p); +return p; +end| +create function f13(p int) returns int +begin +return p; +end| +create procedure p2(inout p int) +begin +select i from t1 where i = 1 into p; +end| +create function f14() returns int +begin +declare k int; +call p2(k); +insert into t2 values (k+5); +return k; +end| +create function f15() returns int +begin +declare k int; +call p2(k); +return k; +end| +create trigger t4_bi before insert on t4 for each row +begin +declare k int; +select i from t1 where i=1 into k; +set new.l= k+1; +end| +create trigger t4_bu before update on t4 for each row +begin +if (select i from t1 where i=1) then +set new.l= 2; +end if; +end| +# Trigger below uses insertion of duplicate key in 'te' +# table as a way to abort delete operation. +create trigger t4_bd before delete on t4 for each row +begin +if !(select i from v1 where i=1) then +insert into te values (1); +end if; +end| +create trigger t5_bi before insert on t5 for each row +begin +set new.l= f1()+1; +end| +create trigger t5_bu before update on t5 for each row +begin +declare j int; +call p2(j); +set new.l= j + 1; +end| +# +# Set common variables to be used by scripts called below. +# +# +# 1. Statements that read tables and do not use subqueries. +# +# +# 1.1 Simple SELECT statement. +# +# No locks are necessary as this statement won't be written +# to the binary log and InnoDB supports snapshots. +Success: 'select * from t1' doesn't take row locks on 't1'. +# +# 1.2 Multi-UPDATE statement. +# +# Has to take shared locks on rows in the table being read as this +# statement will be written to the binary log and therefore should +# be serialized with concurrent statements. +Success: 'update t2, t1 set j= j - 1 where i = j' takes shared row locks on 't1'. +# +# 1.3 Multi-DELETE statement. +# +# The above is true for this statement as well. +Success: 'delete t2 from t1, t2 where i = j' takes shared row locks on 't1'. +# +# 1.4 DESCRIBE statement. +# +# This statement does not really read data from the +# target table and thus does not take any lock on it. +# We check this for completeness of coverage. +Success: 'describe t1' doesn't take row locks on 't1'. +# +# 1.5 SHOW statements. +# +# The above is true for SHOW statements as well. +Success: 'show create table t1' doesn't take row locks on 't1'. +Success: 'show keys from t1' doesn't take row locks on 't1'. +# +# 2. Statements which read tables through subqueries. +# +# +# 2.1 CALL with a subquery. +# +# A strong lock is not necessary as this statement is not +# written to the binary log as a whole (it is written +# statement-by-statement) and thanks to MVCC we can always get +# versions of rows prior to the update that has locked them. +# But in practice InnoDB does locking reads for all statements +# other than SELECT (unless it is a READ-COMITTED mode or +# innodb_locks_unsafe_for_binlog is ON). +Success: 'call p1((select i + 5 from t1 where i = 1))' takes shared row locks on 't1'. +# +# 2.2 CREATE TABLE with a subquery. +# +# Has to take shared locks on rows in the table being read as +# this statement is written to the binary log and therefore +# should be serialized with concurrent statements. +Success: 'create table t0 engine=innodb select * from t1' takes shared row locks on 't1'. +drop table t0; +Success: 'create table t0 engine=innodb select j from t2 where j in (select i from t1)' takes shared row locks on 't1'. +drop table t0; +# +# 2.3 DELETE with a subquery. +# +# The above is true for this statement as well. +Success: 'delete from t2 where j in (select i from t1)' takes shared row locks on 't1'. +# +# 2.4 MULTI-DELETE with a subquery. +# +# Same is true for this statement as well. +Success: 'delete t2 from t3, t2 where k = j and j in (select i from t1)' takes shared row locks on 't1'. +# +# 2.5 DO with a subquery. +# +# In theory should not take row locks as it is not logged. +# In practice InnoDB takes shared row locks. +Success: 'do (select i from t1 where i = 1)' takes shared row locks on 't1'. +# +# 2.6 INSERT with a subquery. +# +# Has to take shared locks on rows in the table being read as +# this statement is written to the binary log and therefore +# should be serialized with concurrent statements. +Success: 'insert into t2 select i+5 from t1' takes shared row locks on 't1'. +Success: 'insert into t2 values ((select i+5 from t1 where i = 4))' takes shared row locks on 't1'. +# +# 2.7 LOAD DATA with a subquery. +# +# The above is true for this statement as well. +Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1)' takes shared row locks on 't1'. +# +# 2.8 REPLACE with a subquery. +# +# Same is true for this statement as well. +Success: 'replace into t2 select i+5 from t1' takes shared row locks on 't1'. +Success: 'replace into t2 values ((select i+5 from t1 where i = 4))' takes shared row locks on 't1'. +# +# 2.9 SELECT with a subquery. +# +# Locks are not necessary as this statement is not written +# to the binary log and thanks to MVCC we can always get +# versions of rows prior to the update that has locked them. +# +# Also serves as a test case for bug #46947 "Embedded SELECT +# without FOR UPDATE is causing a lock". +Success: 'select * from t2 where j in (select i from t1)' doesn't take row locks on 't1'. +# +# 2.10 SET with a subquery. +# +# In theory should not require locking as it is not written +# to the binary log. In practice InnoDB acquires shared row +# locks. +Success: 'set @a:= (select i from t1 where i = 1)' takes shared row locks on 't1'. +# +# 2.11 SHOW with a subquery. +# +# Similarly to the previous case, in theory should not require locking +# as it is not written to the binary log. In practice InnoDB +# acquires shared row locks. +Success: 'show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1)' takes shared row locks on 't1'. +Success: 'show columns from t2 where (select i from t1 where i = 1)' takes shared row locks on 't1'. +# +# 2.12 UPDATE with a subquery. +# +# Has to take shared locks on rows in the table being read as +# this statement is written to the binary log and therefore +# should be serialized with concurrent statements. +Success: 'update t2 set j= j-10 where j in (select i from t1)' takes shared row locks on 't1'. +# +# 2.13 MULTI-UPDATE with a subquery. +# +# Same is true for this statement as well. +Success: 'update t2, t3 set j= j -10 where j=k and j in (select i from t1)' takes shared row locks on 't1'. +# +# 3. Statements which read tables through a view. +# +# +# 3.1 SELECT statement which uses some table through a view. +# +# Since this statement is not written to the binary log +# and old version of rows are accessible thanks to MVCC, +# no locking is necessary. +Success: 'select * from v1' doesn't take row locks on 't1'. +Success: 'select * from v2' doesn't take row locks on 't1'. +Success: 'select * from t2 where j in (select i from v1)' doesn't take row locks on 't1'. +Success: 'select * from t3 where k in (select j from v2)' doesn't take row locks on 't1'. +# +# 3.2 Statements which modify a table and use views. +# +# Since such statements are going to be written to the binary +# log they need to be serialized against concurrent statements +# and therefore should take shared row locks on data read. +Success: 'update t2 set j= j-10 where j in (select i from v1)' takes shared row locks on 't1'. +Success: 'update t3 set k= k-10 where k in (select j from v2)' takes shared row locks on 't1'. +Success: 'update t2, v1 set j= j-10 where j = i' takes shared row locks on 't1'. +Success: 'update v2 set j= j-10 where j = 3' takes shared row locks on 't1'. +# +# 4. Statements which read tables through stored functions. +# +# +# 4.1 SELECT/SET with a stored function which does not +# modify data and uses SELECT in its turn. +# +# Calls to such functions won't get into the binary log and +# thus don't need to acquire strong locks. +# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +# used stored functions may lead to broken SBR" strong locks +# are taken (we accepted it as a trade-off for this fix). +Success: 'select f1()' doesn't take row locks on 't1'. +Success: 'set @a:= f1()' doesn't take row locks on 't1'. +# +# 4.2 INSERT (or other statement which modifies data) with +# a stored function which does not modify data and uses +# SELECT. +# +# Since such statement is written to the binary log it should +# be serialized with concurrent statements affecting the data +# it uses. Therefore it should take row locks on the data +# it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'insert into t2 values (f1() + 5)' doesn't take row locks on 't1'. +# +# 4.3 SELECT/SET with a stored function which +# reads and modifies data. +# +# Since a call to such function is written to the binary log, +# it should be serialized with concurrent statements affecting +# the data it uses. Hence, row locks on the data read +# should be taken. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'select f2()' doesn't take row locks on 't1'. +Success: 'set @a:= f2()' doesn't take row locks on 't1'. +# +# 4.4. SELECT/SET with a stored function which does not +# modify data and reads a table through subselect +# in a control construct. +# +# Again, in theory a call to this function won't get to the +# binary log and thus no locking is needed. But in practice +# we don't detect this fact early enough (get_lock_type_for_table()) +# to avoid taking row locks. +Success: 'select f3()' takes shared row locks on 't1'. +Success: 'set @a:= f3()' takes shared row locks on 't1'. +Success: 'select f4()' takes shared row locks on 't1'. +Success: 'set @a:= f4()' takes shared row locks on 't1'. +# +# 4.5. INSERT (or other statement which modifies data) with +# a stored function which does not modify data and reads +# the table through a subselect in one of its control +# constructs. +# +# Since such statement is written to the binary log it should +# be serialized with concurrent statements affecting data it +# uses. Therefore it should take row locks on the data +# it reads. +Success: 'insert into t2 values (f3() + 5)' takes shared row locks on 't1'. +Success: 'insert into t2 values (f4() + 6)' takes shared row locks on 't1'. +# +# 4.6 SELECT/SET which uses a stored function with +# DML which reads a table via a subquery. +# +# Since call to such function is written to the binary log +# it should be serialized with concurrent statements. +# Hence reads should take row locks. +Success: 'select f5()' takes shared row locks on 't1'. +Success: 'set @a:= f5()' takes shared row locks on 't1'. +# +# 4.7 SELECT/SET which uses a stored function which +# doesn't modify data and reads tables through +# a view. +# +# Once again, in theory, calls to such functions won't +# get into the binary log and thus don't need row +# locks. In practice this fact is discovered +# too late to have any effect. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken +# in case of simple SELECT. +Success: 'select f6()' doesn't take row locks on 't1'. +Success: 'set @a:= f6()' doesn't take row locks on 't1'. +Success: 'select f7()' takes shared row locks on 't1'. +Success: 'set @a:= f7()' takes shared row locks on 't1'. +# +# 4.8 INSERT which uses stored function which +# doesn't modify data and reads a table +# through a view. +# +# Since such statement is written to the binary log and +# should be serialized with concurrent statements affecting +# the data it uses. Therefore it should take row locks on +# the rows it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken +# in case of simple SELECT. +Success: 'insert into t3 values (f6() + 5)' doesn't take row locks on 't1'. +Success: 'insert into t3 values (f7() + 5)' takes shared row locks on 't1'. +# +# 4.9 SELECT which uses a stored function which +# modifies data and reads tables through a view. +# +# Since a call to such function is written to the binary log +# it should be serialized with concurrent statements. +# Hence, reads should take row locks. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken +# in case of simple SELECT. +Success: 'select f8()' doesn't take row locks on 't1'. +Success: 'select f9()' takes shared row locks on 't1'. +# +# 4.10 SELECT which uses stored function which doesn't modify +# data and reads a table indirectly, by calling another +# function. +# +# Calls to such functions won't get into the binary log and +# thus don't need to acquire strong locks. +# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +# used stored functions may lead to broken SBR" strong locks +# are taken (we accepted it as a trade-off for this fix). +Success: 'select f10()' doesn't take row locks on 't1'. +# +# 4.11 INSERT which uses a stored function which doesn't modify +# data and reads a table indirectly, by calling another +# function. +# +# Since such statement is written to the binary log, it should +# be serialized with concurrent statements affecting the data it +# uses. Therefore it should take row locks on data it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'insert into t2 values (f10() + 5)' doesn't take row locks on 't1'. +# +# 4.12 SELECT which uses a stored function which modifies +# data and reads a table indirectly, by calling another +# function. +# +# Since a call to such function is written to the binary log +# it should be serialized from concurrent statements. +# Hence, reads should take row locks. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'select f11()' doesn't take row locks on 't1'. +# +# 4.13 SELECT that reads a table through a subquery passed +# as a parameter to a stored function which modifies +# data. +# +# Even though a call to this function is written to the +# binary log, values of its parameters are written as literals. +# So there is no need to acquire row locks on rows used in +# the subquery. +# But due to the fact that in 5.1 for prelocked statements +# THD::in_lock_tables is set to TRUE we acquire strong locks +# (see also bug#44613 "SELECT statement inside FUNCTION takes +# a shared lock" [sic!!!]). +Success: 'select f12((select i+10 from t1 where i=1))' takes shared row locks on 't1'. +# +# 4.14 INSERT that reads a table via a subquery passed +# as a parameter to a stored function which doesn't +# modify data. +# +# Since this statement is written to the binary log it should +# be serialized with concurrent statements affecting the data it +# uses. Therefore it should take row locks on the data it reads. +Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' takes shared row locks on 't1'. +# +# 5. Statements that read tables through stored procedures. +# +# +# 5.1 CALL statement which reads a table via SELECT. +# +# Since neither this statement nor its components are +# written to the binary log, there is no need to take +# row locks on the data it reads. +Success: 'call p2(@a)' doesn't take row locks on 't1'. +# +# 5.2 Function that modifies data and uses CALL, +# which reads a table through SELECT. +# +# Since a call to such function is written to the binary +# log, it should be serialized with concurrent statements. +# Hence, in this case reads should take row locks on data. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'select f14()' doesn't take row locks on 't1'. +# +# 5.3 SELECT that calls a function that doesn't modify data and +# uses a CALL statement that reads a table via SELECT. +# +# Calls to such functions won't get into the binary log and +# thus don't need to acquire strong locks. +# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +# used stored functions may lead to broken SBR" strong locks +# are taken (we accepted it as a trade-off for this fix). +Success: 'select f15()' doesn't take row locks on 't1'. +# +# 5.4 INSERT which calls function which doesn't modify data and +# uses CALL statement which reads table through SELECT. +# +# Since such statement is written to the binary log it should +# be serialized with concurrent statements affecting data it +# uses. Therefore it should take row locks on data it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'insert into t2 values (f15()+5)' doesn't take row locks on 't1'. +# +# 6. Statements that use triggers. +# +# +# 6.1 Statement invoking a trigger that reads table via SELECT. +# +# Since this statement is written to the binary log it should +# be serialized with concurrent statements affecting the data +# it uses. Therefore, it should take row locks on the data +# it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'insert into t4 values (2)' doesn't take row locks on 't1'. +# +# 6.2 Statement invoking a trigger that reads table through +# a subquery in a control construct. +# +# The above is true for this statement as well. +Success: 'update t4 set l= 2 where l = 1' takes shared row locks on 't1'. +# +# 6.3 Statement invoking a trigger that reads a table through +# a view. +# +# And for this statement. +Success: 'delete from t4 where l = 1' takes shared row locks on 't1'. +# +# 6.4 Statement invoking a trigger that reads a table through +# a stored function. +# +# And for this statement. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'insert into t5 values (2)' doesn't take row locks on 't1'. +# +# 6.5 Statement invoking a trigger that reads a table through +# stored procedure. +# +# And for this statement. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" no lock is taken. +Success: 'update t5 set l= 2 where l = 1' doesn't take row locks on 't1'. +# Clean-up. +drop function f1; +drop function f2; +drop function f3; +drop function f4; +drop function f5; +drop function f6; +drop function f7; +drop function f8; +drop function f9; +drop function f10; +drop function f11; +drop function f12; +drop function f13; +drop function f14; +drop function f15; +drop view v1, v2; +drop procedure p1; +drop procedure p2; +drop table t1, t2, t3, t4, t5, te; diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result new file mode 100644 index 00000000000..752f278a2b4 --- /dev/null +++ b/mysql-test/r/lock_sync.result @@ -0,0 +1,631 @@ +# +# Test how we handle locking in various cases when +# we read data from MyISAM tables. +# +# In this test we mostly check that the SQL-layer correctly +# determines the type of thr_lock.c lock for a table being +# read. +# I.e. that it disallows concurrent inserts when the statement +# is going to be written to the binary log and therefore +# should be serialized, and allows concurrent inserts when +# such serialization is not necessary (e.g. when +# the statement is not written to binary log). +# +# Force concurrent inserts to be performed even if the table +# has gaps. This allows to simplify clean up in scripts +# used below (instead of backing up table being inserted +# into and then restoring it from backup at the end of the +# script we can simply delete rows which were inserted). +set @old_concurrent_insert= @@global.concurrent_insert; +set @@global.concurrent_insert= 2; +select @@global.concurrent_insert; +@@global.concurrent_insert +2 +# Prepare playground by creating tables, views, +# routines and triggers used in tests. +drop table if exists t0, t1, t2, t3, t4, t5, te; +drop view if exists v1, v2; +drop procedure if exists p1; +drop procedure if exists p2; +drop function if exists f1; +drop function if exists f2; +drop function if exists f3; +drop function if exists f4; +drop function if exists f5; +drop function if exists f6; +drop function if exists f7; +drop function if exists f8; +drop function if exists f9; +drop function if exists f10; +drop function if exists f11; +drop function if exists f12; +drop function if exists f13; +drop function if exists f14; +drop function if exists f15; +create table t1 (i int primary key); +insert into t1 values (1), (2), (3), (4), (5); +create table t2 (j int primary key); +insert into t2 values (1), (2), (3), (4), (5); +create table t3 (k int primary key); +insert into t3 values (1), (2), (3); +create table t4 (l int primary key); +insert into t4 values (1); +create table t5 (l int primary key); +insert into t5 values (1); +create table te(e int primary key); +insert into te values (1); +create view v1 as select i from t1; +create view v2 as select j from t2 where j in (select i from t1); +create procedure p1(k int) insert into t2 values (k); +create function f1() returns int +begin +declare j int; +select i from t1 where i = 1 into j; +return j; +end| +create function f2() returns int +begin +declare k int; +select i from t1 where i = 1 into k; +insert into t2 values (k + 5); +return 0; +end| +create function f3() returns int +begin +return (select i from t1 where i = 3); +end| +create function f4() returns int +begin +if (select i from t1 where i = 3) then +return 1; +else +return 0; +end if; +end| +create function f5() returns int +begin +insert into t2 values ((select i from t1 where i = 1) + 5); +return 0; +end| +create function f6() returns int +begin +declare k int; +select i from v1 where i = 1 into k; +return k; +end| +create function f7() returns int +begin +declare k int; +select j from v2 where j = 1 into k; +return k; +end| +create function f8() returns int +begin +declare k int; +select i from v1 where i = 1 into k; +insert into t2 values (k+5); +return k; +end| +create function f9() returns int +begin +update v2 set j=j+10 where j=1; +return 1; +end| +create function f10() returns int +begin +return f1(); +end| +create function f11() returns int +begin +declare k int; +set k= f1(); +insert into t2 values (k+5); +return k; +end| +create function f12(p int) returns int +begin +insert into t2 values (p); +return p; +end| +create function f13(p int) returns int +begin +return p; +end| +create procedure p2(inout p int) +begin +select i from t1 where i = 1 into p; +end| +create function f14() returns int +begin +declare k int; +call p2(k); +insert into t2 values (k+5); +return k; +end| +create function f15() returns int +begin +declare k int; +call p2(k); +return k; +end| +create trigger t4_bi before insert on t4 for each row +begin +declare k int; +select i from t1 where i=1 into k; +set new.l= k+1; +end| +create trigger t4_bu before update on t4 for each row +begin +if (select i from t1 where i=1) then +set new.l= 2; +end if; +end| +# Trigger below uses insertion of duplicate key in 'te' +# table as a way to abort delete operation. +create trigger t4_bd before delete on t4 for each row +begin +if !(select i from v1 where i=1) then +insert into te values (1); +end if; +end| +create trigger t5_bi before insert on t5 for each row +begin +set new.l= f1()+1; +end| +create trigger t5_bu before update on t5 for each row +begin +declare j int; +call p2(j); +set new.l= j + 1; +end| +# +# Set common variables to be used by the scripts +# called below. +# +# Switch to connection 'con1'. +# Cache all functions used in the tests below so statements +# calling them won't need to open and lock mysql.proc table +# and we can assume that each statement locks its tables +# once during its execution. +show create procedure p1; +show create procedure p2; +show create function f1; +show create function f2; +show create function f3; +show create function f4; +show create function f5; +show create function f6; +show create function f7; +show create function f8; +show create function f9; +show create function f10; +show create function f11; +show create function f12; +show create function f13; +show create function f14; +show create function f15; +# Switch back to connection 'default'. +# +# 1. Statements that read tables and do not use subqueries. +# +# +# 1.1 Simple SELECT statement. +# +# No locks are necessary as this statement won't be written +# to the binary log and thanks to how MyISAM works SELECT +# will see version of the table prior to concurrent insert. +Success: 'select * from t1' allows concurrent inserts into 't1'. +# +# 1.2 Multi-UPDATE statement. +# +# Has to take shared locks on rows in the table being read as this +# statement will be written to the binary log and therefore should +# be serialized with concurrent statements. +Success: 'update t2, t1 set j= j - 1 where i = j' doesn't allow concurrent inserts into 't1'. +# +# 1.3 Multi-DELETE statement. +# +# The above is true for this statement as well. +Success: 'delete t2 from t1, t2 where i = j' doesn't allow concurrent inserts into 't1'. +# +# 1.4 DESCRIBE statement. +# +# This statement does not really read data from the +# target table and thus does not take any lock on it. +# We check this for completeness of coverage. +lock table t1 write; +# Switching to connection 'con1'. +# This statement should not be blocked. +describe t1; +# Switching to connection 'default'. +unlock tables; +# +# 1.5 SHOW statements. +# +# The above is true for SHOW statements as well. +lock table t1 write; +# Switching to connection 'con1'. +# These statements should not be blocked. +show keys from t1; +# Switching to connection 'default'. +unlock tables; +# +# 2. Statements which read tables through subqueries. +# +# +# 2.1 CALL with a subquery. +# +# In theory strong lock is not necessary as this statement +# is not written to the binary log as a whole (it is written +# statement-by-statement). But in practice in 5.1 for +# almost everything except SELECT we take strong lock. +Success: 'call p1((select i + 5 from t1 where i = 1))' doesn't allow concurrent inserts into 't1'. +# +# 2.2 CREATE TABLE with a subquery. +# +# Has to take a strong lock on the table being read as +# this statement is written to the binary log and therefore +# should be serialized with concurrent statements. +Success: 'create table t0 select * from t1' doesn't allow concurrent inserts into 't1'. +drop table t0; +Success: 'create table t0 select j from t2 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'. +drop table t0; +# +# 2.3 DELETE with a subquery. +# +# The above is true for this statement as well. +Success: 'delete from t2 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'. +# +# 2.4 MULTI-DELETE with a subquery. +# +# Same is true for this statement as well. +Success: 'delete t2 from t3, t2 where k = j and j in (select i from t1)' doesn't allow concurrent inserts into 't1'. +# +# 2.5 DO with a subquery. +# +# In theory strong lock is not necessary as it is not logged. +# But in practice in 5.1 for almost everything except SELECT +# we take strong lock. +Success: 'do (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'. +# +# 2.6 INSERT with a subquery. +# +# Has to take a strong lock on the table being read as +# this statement is written to the binary log and therefore +# should be serialized with concurrent inserts. +Success: 'insert into t2 select i+5 from t1' doesn't allow concurrent inserts into 't1'. +Success: 'insert into t2 values ((select i+5 from t1 where i = 4))' doesn't allow concurrent inserts into 't1'. +# +# 2.7 LOAD DATA with a subquery. +# +# The above is true for this statement as well. +Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'. +# +# 2.8 REPLACE with a subquery. +# +# Same is true for this statement as well. +Success: 'replace into t2 select i+5 from t1' doesn't allow concurrent inserts into 't1'. +Success: 'replace into t2 values ((select i+5 from t1 where i = 4))' doesn't allow concurrent inserts into 't1'. +# +# 2.9 SELECT with a subquery. +# +# Strong locks are not necessary as this statement is not written +# to the binary log and thanks to how MyISAM works this statement +# sees a version of the table prior to the concurrent insert. +Success: 'select * from t2 where j in (select i from t1)' allows concurrent inserts into 't1'. +# +# 2.10 SET with a subquery. +# +# In theory the same is true for this statement as well. +# But in practice in 5.1 we acquire strong lock in this +# case as well. +Success: 'set @a:= (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'. +# +# 2.11 SHOW with a subquery. +# +# The same is true for this statement too. +Success: 'show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'. +Success: 'show columns from t2 where (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'. +# +# 2.12 UPDATE with a subquery. +# +# Has to take a strong lock on the table being read as +# this statement is written to the binary log and therefore +# should be serialized with concurrent inserts. +Success: 'update t2 set j= j-10 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'. +# +# 2.13 MULTI-UPDATE with a subquery. +# +# Same is true for this statement as well. +Success: 'update t2, t3 set j= j -10 where j=k and j in (select i from t1)' doesn't allow concurrent inserts into 't1'. +# +# 3. Statements which read tables through a view. +# +# +# 3.1 SELECT statement which uses some table through a view. +# +# Since this statement is not written to the binary log and +# an old version of the table is accessible thanks to how MyISAM +# handles concurrent insert, no locking is necessary. +Success: 'select * from v1' allows concurrent inserts into 't1'. +Success: 'select * from v2' allows concurrent inserts into 't1'. +Success: 'select * from t2 where j in (select i from v1)' allows concurrent inserts into 't1'. +Success: 'select * from t3 where k in (select j from v2)' allows concurrent inserts into 't1'. +# +# 3.2 Statements which modify a table and use views. +# +# Since such statements are going to be written to the binary +# log they need to be serialized against concurrent statements +# and therefore should take strong locks on the data read. +Success: 'update t2 set j= j-10 where j in (select i from v1)' doesn't allow concurrent inserts into 't1'. +Success: 'update t3 set k= k-10 where k in (select j from v2)' doesn't allow concurrent inserts into 't1'. +Success: 'update t2, v1 set j= j-10 where j = i' doesn't allow concurrent inserts into 't1'. +Success: 'update v2 set j= j-10 where j = 3' doesn't allow concurrent inserts into 't1'. +# +# 4. Statements which read tables through stored functions. +# +# +# 4.1 SELECT/SET with a stored function which does not +# modify data and uses SELECT in its turn. +# +# Calls to such functions won't get into the binary log and +# thus don't need to acquire strong locks. +# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +# used stored functions may lead to broken SBR" strong locks +# are taken (we accepted it as a trade-off for this fix). +Success: 'select f1()' allows concurrent inserts into 't1'. +Success: 'set @a:= f1()' allows concurrent inserts into 't1'. +# +# 4.2 INSERT (or other statement which modifies data) with +# a stored function which does not modify data and uses +# SELECT. +# +# Since such statement is written to the binary log it should +# be serialized with concurrent statements affecting the data +# it uses. Therefore it should take strong lock on the data +# it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'insert into t2 values (f1() + 5)' allows concurrent inserts into 't1'. +# +# 4.3 SELECT/SET with a stored function which +# reads and modifies data. +# +# Since a call to such function is written to the binary log, +# it should be serialized with concurrent statements affecting +# the data it uses. Hence, a strong lock on the data read +# should be taken. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'select f2()' allows concurrent inserts into 't1'. +Success: 'set @a:= f2()' allows concurrent inserts into 't1'. +# +# 4.4. SELECT/SET with a stored function which does not +# modify data and reads a table through subselect +# in a control construct. +# +# Again, in theory a call to this function won't get to the +# binary log and thus no strong lock is needed. But in practice +# we don't detect this fact early enough (get_lock_type_for_table()) +# to avoid taking a strong lock. +Success: 'select f3()' doesn't allow concurrent inserts into 't1'. +Success: 'set @a:= f3()' doesn't allow concurrent inserts into 't1'. +Success: 'select f4()' doesn't allow concurrent inserts into 't1'. +Success: 'set @a:= f4()' doesn't allow concurrent inserts into 't1'. +# +# 4.5. INSERT (or other statement which modifies data) with +# a stored function which does not modify data and reads +# the table through a subselect in one of its control +# constructs. +# +# Since such statement is written to the binary log it should +# be serialized with concurrent statements affecting data it +# uses. Therefore it should take a strong lock on the data +# it reads. +Success: 'insert into t2 values (f3() + 5)' doesn't allow concurrent inserts into 't1'. +Success: 'insert into t2 values (f4() + 6)' doesn't allow concurrent inserts into 't1'. +# +# 4.6 SELECT/SET which uses a stored function with +# DML which reads a table via a subquery. +# +# Since call to such function is written to the binary log +# it should be serialized with concurrent statements. +# Hence reads should take a strong lock. +Success: 'select f5()' doesn't allow concurrent inserts into 't1'. +Success: 'set @a:= f5()' doesn't allow concurrent inserts into 't1'. +# +# 4.7 SELECT/SET which uses a stored function which +# doesn't modify data and reads tables through +# a view. +# +# Once again, in theory, calls to such functions won't +# get into the binary log and thus don't need strong +# locks. In practice this fact is discovered +# too late to have any effect. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken +# in case when simple SELECT is used. +Success: 'select f6()' allows concurrent inserts into 't1'. +Success: 'set @a:= f6()' allows concurrent inserts into 't1'. +Success: 'select f7()' doesn't allow concurrent inserts into 't1'. +Success: 'set @a:= f7()' doesn't allow concurrent inserts into 't1'. +# +# 4.8 INSERT which uses stored function which +# doesn't modify data and reads a table +# through a view. +# +# Since such statement is written to the binary log and +# should be serialized with concurrent statements affecting +# the data it uses. Therefore it should take a strong lock on +# the table it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken +# in case when simple SELECT is used. +Success: 'insert into t3 values (f6() + 5)' allows concurrent inserts into 't1'. +Success: 'insert into t3 values (f7() + 5)' doesn't allow concurrent inserts into 't1'. +# +# 4.9 SELECT which uses a stored function which +# modifies data and reads tables through a view. +# +# Since a call to such function is written to the binary log +# it should be serialized with concurrent statements. +# Hence, reads should take strong locks. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken +# in case when simple SELECT is used. +Success: 'select f8()' allows concurrent inserts into 't1'. +Success: 'select f9()' doesn't allow concurrent inserts into 't1'. +# +# 4.10 SELECT which uses a stored function which doesn't modify +# data and reads a table indirectly, by calling another +# function. +# +# Calls to such functions won't get into the binary log and +# thus don't need to acquire strong locks. +# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +# used stored functions may lead to broken SBR" strong locks +# are taken (we accepted it as a trade-off for this fix). +Success: 'select f10()' allows concurrent inserts into 't1'. +# +# 4.11 INSERT which uses a stored function which doesn't modify +# data and reads a table indirectly, by calling another +# function. +# +# Since such statement is written to the binary log, it should +# be serialized with concurrent statements affecting the data it +# uses. Therefore it should take strong locks on data it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'insert into t2 values (f10() + 5)' allows concurrent inserts into 't1'. +# +# 4.12 SELECT which uses a stored function which modifies +# data and reads a table indirectly, by calling another +# function. +# +# Since a call to such function is written to the binary log +# it should be serialized from concurrent statements. +# Hence, read should take a strong lock. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'select f11()' allows concurrent inserts into 't1'. +# +# 4.13 SELECT that reads a table through a subquery passed +# as a parameter to a stored function which modifies +# data. +# +# Even though a call to this function is written to the +# binary log, values of its parameters are written as literals. +# So there is no need to acquire strong locks for tables used in +# the subquery. +Success: 'select f12((select i+10 from t1 where i=1))' allows concurrent inserts into 't1'. +# +# 4.14 INSERT that reads a table via a subquery passed +# as a parameter to a stored function which doesn't +# modify data. +# +# Since this statement is written to the binary log it should +# be serialized with concurrent statements affecting the data it +# uses. Therefore it should take strong locks on the data it reads. +Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' doesn't allow concurrent inserts into 't1'. +# +# 5. Statements that read tables through stored procedures. +# +# +# 5.1 CALL statement which reads a table via SELECT. +# +# Since neither this statement nor its components are +# written to the binary log, there is no need to take +# strong locks on the data it reads. +Success: 'call p2(@a)' allows concurrent inserts into 't1'. +# +# 5.2 Function that modifies data and uses CALL, +# which reads a table through SELECT. +# +# Since a call to such function is written to the binary +# log, it should be serialized with concurrent statements. +# Hence, in this case reads should take strong locks on data. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'select f14()' allows concurrent inserts into 't1'. +# +# 5.3 SELECT that calls a function that doesn't modify data and +# uses a CALL statement that reads a table via SELECT. +# +# Calls to such functions won't get into the binary log and +# thus don't need to acquire strong locks. +# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +# used stored functions may lead to broken SBR" strong locks +# are taken (we accepted it as a trade-off for this fix). +Success: 'select f15()' allows concurrent inserts into 't1'. +# +# 5.4 INSERT which calls function which doesn't modify data and +# uses CALL statement which reads table through SELECT. +# +# Since such statement is written to the binary log it should +# be serialized with concurrent statements affecting data it +# uses. Therefore it should take strong locks on data it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'insert into t2 values (f15()+5)' allows concurrent inserts into 't1'. +# +# 6. Statements that use triggers. +# +# +# 6.1 Statement invoking a trigger that reads table via SELECT. +# +# Since this statement is written to the binary log it should +# be serialized with concurrent statements affecting the data +# it uses. Therefore, it should take strong locks on the data +# it reads. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'insert into t4 values (2)' allows concurrent inserts into 't1'. +# +# 6.2 Statement invoking a trigger that reads table through +# a subquery in a control construct. +# +# The above is true for this statement as well. +Success: 'update t4 set l= 2 where l = 1' doesn't allow concurrent inserts into 't1'. +# +# 6.3 Statement invoking a trigger that reads a table through +# a view. +# +# And for this statement. +Success: 'delete from t4 where l = 1' doesn't allow concurrent inserts into 't1'. +# +# 6.4 Statement invoking a trigger that reads a table through +# a stored function. +# +# And for this statement. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'insert into t5 values (2)' allows concurrent inserts into 't1'. +# +# 6.5 Statement invoking a trigger that reads a table through +# stored procedure. +# +# And for this statement. +# But due to bug #53921 "Wrong locks for SELECTs used stored +# functions may lead to broken SBR" weak locks are taken. +Success: 'update t5 set l= 2 where l = 1' allows concurrent inserts into 't1'. +# Clean-up. +drop function f1; +drop function f2; +drop function f3; +drop function f4; +drop function f5; +drop function f6; +drop function f7; +drop function f8; +drop function f9; +drop function f10; +drop function f11; +drop function f12; +drop function f13; +drop function f14; +drop function f15; +drop view v1, v2; +drop procedure p1; +drop procedure p2; +drop table t1, t2, t3, t4, t5, te; +set @@global.concurrent_insert= @old_concurrent_insert; diff --git a/mysql-test/t/bug39022.test b/mysql-test/t/bug39022.test index 268b207e0e5..6056dbf0e7b 100644 --- a/mysql-test/t/bug39022.test +++ b/mysql-test/t/bug39022.test @@ -24,7 +24,7 @@ START TRANSACTION; connection thread2; --echo # in thread2 REPLACE INTO t2 VALUES (-17); -SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); +SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; connection thread1; --echo # in thread1 @@ -37,14 +37,14 @@ START TRANSACTION; REPLACE INTO t1(a,b) VALUES (65,-50); REPLACE INTO t2 VALUES (-91); send; -SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); #waits +SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; #waits connection thread1; --echo # in thread1 --echo # should not crash --error ER_LOCK_DEADLOCK -SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); #crashes +SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; #crashes connection thread2; --echo # in thread2 diff --git a/mysql-test/t/innodb_mysql_lock2.test b/mysql-test/t/innodb_mysql_lock2.test new file mode 100644 index 00000000000..79698bcd898 --- /dev/null +++ b/mysql-test/t/innodb_mysql_lock2.test @@ -0,0 +1,803 @@ +# This test covers behavior for InnoDB tables. +--source include/have_innodb.inc +# This test requires statement/mixed mode binary logging. +# Row-based mode puts weaker serializability requirements +# so weaker locks are acquired for it. +--source include/have_binlog_format_mixed_or_statement.inc +# Save the initial number of concurrent sessions. +--source include/count_sessions.inc + +--echo # +--echo # Test how do we handle locking in various cases when +--echo # we read data from InnoDB tables. +--echo # +--echo # In fact by performing this test we check two things: +--echo # 1) That SQL-layer correctly determine type of thr_lock.c +--echo # lock to be acquired/passed to InnoDB engine. +--echo # 2) That InnoDB engine correctly interprets this lock +--echo # type and takes necessary row locks or does not +--echo # take them if they are not necessary. +--echo # + +--echo # This test makes sense only in REPEATABLE-READ mode as +--echo # in SERIALIZABLE mode all statements that read data take +--echo # shared lock on them to enforce its semantics. +select @@session.tx_isolation; + +--echo # Prepare playground by creating tables, views, +--echo # routines and triggers used in tests. +connect (con1, localhost, root,,); +connection default; +--disable_warnings +drop table if exists t0, t1, t2, t3, t4, t5, te; +drop view if exists v1, v2; +drop procedure if exists p1; +drop procedure if exists p2; +drop function if exists f1; +drop function if exists f2; +drop function if exists f3; +drop function if exists f4; +drop function if exists f5; +drop function if exists f6; +drop function if exists f7; +drop function if exists f8; +drop function if exists f9; +drop function if exists f10; +drop function if exists f11; +drop function if exists f12; +drop function if exists f13; +drop function if exists f14; +drop function if exists f15; +--enable_warnings +create table t1 (i int primary key) engine=innodb; +insert into t1 values (1), (2), (3), (4), (5); +create table t2 (j int primary key) engine=innodb; +insert into t2 values (1), (2), (3), (4), (5); +create table t3 (k int primary key) engine=innodb; +insert into t3 values (1), (2), (3); +create table t4 (l int primary key) engine=innodb; +insert into t4 values (1); +create table t5 (l int primary key) engine=innodb; +insert into t5 values (1); +create table te(e int primary key); +insert into te values (1); +create view v1 as select i from t1; +create view v2 as select j from t2 where j in (select i from t1); +create procedure p1(k int) insert into t2 values (k); +delimiter |; +create function f1() returns int +begin + declare j int; + select i from t1 where i = 1 into j; + return j; +end| +create function f2() returns int +begin + declare k int; + select i from t1 where i = 1 into k; + insert into t2 values (k + 5); + return 0; +end| +create function f3() returns int +begin + return (select i from t1 where i = 3); +end| +create function f4() returns int +begin + if (select i from t1 where i = 3) then + return 1; + else + return 0; + end if; +end| +create function f5() returns int +begin + insert into t2 values ((select i from t1 where i = 1) + 5); + return 0; +end| +create function f6() returns int +begin + declare k int; + select i from v1 where i = 1 into k; + return k; +end| +create function f7() returns int +begin + declare k int; + select j from v2 where j = 1 into k; + return k; +end| +create function f8() returns int +begin + declare k int; + select i from v1 where i = 1 into k; + insert into t2 values (k+5); + return k; +end| +create function f9() returns int +begin + update v2 set j=j+10 where j=1; + return 1; +end| +create function f10() returns int +begin + return f1(); +end| +create function f11() returns int +begin + declare k int; + set k= f1(); + insert into t2 values (k+5); + return k; +end| +create function f12(p int) returns int +begin + insert into t2 values (p); + return p; +end| +create function f13(p int) returns int +begin + return p; +end| +create procedure p2(inout p int) +begin + select i from t1 where i = 1 into p; +end| +create function f14() returns int +begin + declare k int; + call p2(k); + insert into t2 values (k+5); + return k; +end| +create function f15() returns int +begin + declare k int; + call p2(k); + return k; +end| +create trigger t4_bi before insert on t4 for each row +begin + declare k int; + select i from t1 where i=1 into k; + set new.l= k+1; +end| +create trigger t4_bu before update on t4 for each row +begin + if (select i from t1 where i=1) then + set new.l= 2; + end if; +end| +--echo # Trigger below uses insertion of duplicate key in 'te' +--echo # table as a way to abort delete operation. +create trigger t4_bd before delete on t4 for each row +begin + if !(select i from v1 where i=1) then + insert into te values (1); + end if; +end| +create trigger t5_bi before insert on t5 for each row +begin + set new.l= f1()+1; +end| +create trigger t5_bu before update on t5 for each row +begin + declare j int; + call p2(j); + set new.l= j + 1; +end| +delimiter ;| + +--echo # +--echo # Set common variables to be used by scripts called below. +--echo # +let $con_aux= con1; +let $table= t1; + + +--echo # +--echo # 1. Statements that read tables and do not use subqueries. +--echo # + +--echo # +--echo # 1.1 Simple SELECT statement. +--echo # +--echo # No locks are necessary as this statement won't be written +--echo # to the binary log and InnoDB supports snapshots. +let $statement= select * from t1; +--source include/check_no_row_lock.inc + +--echo # +--echo # 1.2 Multi-UPDATE statement. +--echo # +--echo # Has to take shared locks on rows in the table being read as this +--echo # statement will be written to the binary log and therefore should +--echo # be serialized with concurrent statements. +let $statement= update t2, t1 set j= j - 1 where i = j; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 1.3 Multi-DELETE statement. +--echo # +--echo # The above is true for this statement as well. +let $statement= delete t2 from t1, t2 where i = j; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 1.4 DESCRIBE statement. +--echo # +--echo # This statement does not really read data from the +--echo # target table and thus does not take any lock on it. +--echo # We check this for completeness of coverage. +let $statement= describe t1; +--source include/check_no_row_lock.inc + +--echo # +--echo # 1.5 SHOW statements. +--echo # +--echo # The above is true for SHOW statements as well. +let $statement= show create table t1; +--source include/check_no_row_lock.inc +let $statement= show keys from t1; +--source include/check_no_row_lock.inc + + +--echo # +--echo # 2. Statements which read tables through subqueries. +--echo # + +--echo # +--echo # 2.1 CALL with a subquery. +--echo # +--echo # A strong lock is not necessary as this statement is not +--echo # written to the binary log as a whole (it is written +--echo # statement-by-statement) and thanks to MVCC we can always get +--echo # versions of rows prior to the update that has locked them. +--echo # But in practice InnoDB does locking reads for all statements +--echo # other than SELECT (unless it is a READ-COMITTED mode or +--echo # innodb_locks_unsafe_for_binlog is ON). +let $statement= call p1((select i + 5 from t1 where i = 1)); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.2 CREATE TABLE with a subquery. +--echo # +--echo # Has to take shared locks on rows in the table being read as +--echo # this statement is written to the binary log and therefore +--echo # should be serialized with concurrent statements. +let $statement= create table t0 engine=innodb select * from t1; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +drop table t0; +let $statement= create table t0 engine=innodb select j from t2 where j in (select i from t1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +drop table t0; + +--echo # +--echo # 2.3 DELETE with a subquery. +--echo # +--echo # The above is true for this statement as well. +let $statement= delete from t2 where j in (select i from t1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.4 MULTI-DELETE with a subquery. +--echo # +--echo # Same is true for this statement as well. +let $statement= delete t2 from t3, t2 where k = j and j in (select i from t1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.5 DO with a subquery. +--echo # +--echo # In theory should not take row locks as it is not logged. +--echo # In practice InnoDB takes shared row locks. +let $statement= do (select i from t1 where i = 1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.6 INSERT with a subquery. +--echo # +--echo # Has to take shared locks on rows in the table being read as +--echo # this statement is written to the binary log and therefore +--echo # should be serialized with concurrent statements. +let $statement= insert into t2 select i+5 from t1; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= insert into t2 values ((select i+5 from t1 where i = 4)); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.7 LOAD DATA with a subquery. +--echo # +--echo # The above is true for this statement as well. +let $statement= load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.8 REPLACE with a subquery. +--echo # +--echo # Same is true for this statement as well. +let $statement= replace into t2 select i+5 from t1; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= replace into t2 values ((select i+5 from t1 where i = 4)); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.9 SELECT with a subquery. +--echo # +--echo # Locks are not necessary as this statement is not written +--echo # to the binary log and thanks to MVCC we can always get +--echo # versions of rows prior to the update that has locked them. +--echo # +--echo # Also serves as a test case for bug #46947 "Embedded SELECT +--echo # without FOR UPDATE is causing a lock". +let $statement= select * from t2 where j in (select i from t1); +--source include/check_no_row_lock.inc + +--echo # +--echo # 2.10 SET with a subquery. +--echo # +--echo # In theory should not require locking as it is not written +--echo # to the binary log. In practice InnoDB acquires shared row +--echo # locks. +let $statement= set @a:= (select i from t1 where i = 1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.11 SHOW with a subquery. +--echo # +--echo # Similarly to the previous case, in theory should not require locking +--echo # as it is not written to the binary log. In practice InnoDB +--echo # acquires shared row locks. +let $statement= show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= show columns from t2 where (select i from t1 where i = 1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.12 UPDATE with a subquery. +--echo # +--echo # Has to take shared locks on rows in the table being read as +--echo # this statement is written to the binary log and therefore +--echo # should be serialized with concurrent statements. +let $statement= update t2 set j= j-10 where j in (select i from t1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 2.13 MULTI-UPDATE with a subquery. +--echo # +--echo # Same is true for this statement as well. +let $statement= update t2, t3 set j= j -10 where j=k and j in (select i from t1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + + +--echo # +--echo # 3. Statements which read tables through a view. +--echo # + +--echo # +--echo # 3.1 SELECT statement which uses some table through a view. +--echo # +--echo # Since this statement is not written to the binary log +--echo # and old version of rows are accessible thanks to MVCC, +--echo # no locking is necessary. +let $statement= select * from v1; +--source include/check_no_row_lock.inc +let $statement= select * from v2; +--source include/check_no_row_lock.inc +let $statement= select * from t2 where j in (select i from v1); +--source include/check_no_row_lock.inc +let $statement= select * from t3 where k in (select j from v2); +--source include/check_no_row_lock.inc + +--echo # +--echo # 3.2 Statements which modify a table and use views. +--echo # +--echo # Since such statements are going to be written to the binary +--echo # log they need to be serialized against concurrent statements +--echo # and therefore should take shared row locks on data read. +let $statement= update t2 set j= j-10 where j in (select i from v1); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= update t3 set k= k-10 where k in (select j from v2); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= update t2, v1 set j= j-10 where j = i; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= update v2 set j= j-10 where j = 3; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + + +--echo # +--echo # 4. Statements which read tables through stored functions. +--echo # + +--echo # +--echo # 4.1 SELECT/SET with a stored function which does not +--echo # modify data and uses SELECT in its turn. +--echo # +--echo # Calls to such functions won't get into the binary log and +--echo # thus don't need to acquire strong locks. +--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +--echo # used stored functions may lead to broken SBR" strong locks +--echo # are taken (we accepted it as a trade-off for this fix). +let $statement= select f1(); +let $wait_statement= select i from t1 where i = 1 into j; +--source include/check_no_row_lock.inc +let $statement= set @a:= f1(); +let $wait_statement= select i from t1 where i = 1 into j; +--source include/check_no_row_lock.inc + +--echo # +--echo # 4.2 INSERT (or other statement which modifies data) with +--echo # a stored function which does not modify data and uses +--echo # SELECT. +--echo # +--echo # Since such statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting the data +--echo # it uses. Therefore it should take row locks on the data +--echo # it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= insert into t2 values (f1() + 5); +let $wait_statement= select i from t1 where i = 1 into j; +--source include/check_no_row_lock.inc + +--echo # +--echo # 4.3 SELECT/SET with a stored function which +--echo # reads and modifies data. +--echo # +--echo # Since a call to such function is written to the binary log, +--echo # it should be serialized with concurrent statements affecting +--echo # the data it uses. Hence, row locks on the data read +--echo # should be taken. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= select f2(); +let $wait_statement= select i from t1 where i = 1 into k; +--source include/check_no_row_lock.inc +let $statement= set @a:= f2(); +let $wait_statement= select i from t1 where i = 1 into k; +--source include/check_no_row_lock.inc + +--echo # +--echo # 4.4. SELECT/SET with a stored function which does not +--echo # modify data and reads a table through subselect +--echo # in a control construct. +--echo # +--echo # Again, in theory a call to this function won't get to the +--echo # binary log and thus no locking is needed. But in practice +--echo # we don't detect this fact early enough (get_lock_type_for_table()) +--echo # to avoid taking row locks. +let $statement= select f3(); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= set @a:= f3(); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= select f4(); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= set @a:= f4(); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 4.5. INSERT (or other statement which modifies data) with +--echo # a stored function which does not modify data and reads +--echo # the table through a subselect in one of its control +--echo # constructs. +--echo # +--echo # Since such statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting data it +--echo # uses. Therefore it should take row locks on the data +--echo # it reads. +let $statement= insert into t2 values (f3() + 5); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc +let $statement= insert into t2 values (f4() + 6); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 4.6 SELECT/SET which uses a stored function with +--echo # DML which reads a table via a subquery. +--echo # +--echo # Since call to such function is written to the binary log +--echo # it should be serialized with concurrent statements. +--echo # Hence reads should take row locks. +let $statement= select f5(); +let $wait_statement= insert into t2 values ((select i from t1 where i = 1) + 5); +--source include/check_shared_row_lock.inc +let $statement= set @a:= f5(); +let $wait_statement= insert into t2 values ((select i from t1 where i = 1) + 5); +--source include/check_shared_row_lock.inc + +--echo # +--echo # 4.7 SELECT/SET which uses a stored function which +--echo # doesn't modify data and reads tables through +--echo # a view. +--echo # +--echo # Once again, in theory, calls to such functions won't +--echo # get into the binary log and thus don't need row +--echo # locks. In practice this fact is discovered +--echo # too late to have any effect. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken +--echo # in case of simple SELECT. +let $statement= select f6(); +let $wait_statement= select i from v1 where i = 1 into k; +--source include/check_no_row_lock.inc +let $statement= set @a:= f6(); +let $wait_statement= select i from v1 where i = 1 into k; +--source include/check_no_row_lock.inc +let $statement= select f7(); +let $wait_statement= select j from v2 where j = 1 into k; +--source include/check_shared_row_lock.inc +let $statement= set @a:= f7(); +let $wait_statement= select j from v2 where j = 1 into k; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 4.8 INSERT which uses stored function which +--echo # doesn't modify data and reads a table +--echo # through a view. +--echo # +--echo # Since such statement is written to the binary log and +--echo # should be serialized with concurrent statements affecting +--echo # the data it uses. Therefore it should take row locks on +--echo # the rows it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken +--echo # in case of simple SELECT. +let $statement= insert into t3 values (f6() + 5); +let $wait_statement= select i from v1 where i = 1 into k; +--source include/check_no_row_lock.inc +let $statement= insert into t3 values (f7() + 5); +let $wait_statement= select j from v2 where j = 1 into k; +--source include/check_shared_row_lock.inc + + +--echo # +--echo # 4.9 SELECT which uses a stored function which +--echo # modifies data and reads tables through a view. +--echo # +--echo # Since a call to such function is written to the binary log +--echo # it should be serialized with concurrent statements. +--echo # Hence, reads should take row locks. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken +--echo # in case of simple SELECT. +let $statement= select f8(); +let $wait_statement= select i from v1 where i = 1 into k; +--source include/check_no_row_lock.inc +let $statement= select f9(); +let $wait_statement= update v2 set j=j+10 where j=1; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 4.10 SELECT which uses stored function which doesn't modify +--echo # data and reads a table indirectly, by calling another +--echo # function. +--echo # +--echo # Calls to such functions won't get into the binary log and +--echo # thus don't need to acquire strong locks. +--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +--echo # used stored functions may lead to broken SBR" strong locks +--echo # are taken (we accepted it as a trade-off for this fix). +let $statement= select f10(); +let $wait_statement= select i from t1 where i = 1 into j; +--source include/check_no_row_lock.inc + +--echo # +--echo # 4.11 INSERT which uses a stored function which doesn't modify +--echo # data and reads a table indirectly, by calling another +--echo # function. +--echo # +--echo # Since such statement is written to the binary log, it should +--echo # be serialized with concurrent statements affecting the data it +--echo # uses. Therefore it should take row locks on data it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= insert into t2 values (f10() + 5); +let $wait_statement= select i from t1 where i = 1 into j; +--source include/check_no_row_lock.inc + +--echo # +--echo # 4.12 SELECT which uses a stored function which modifies +--echo # data and reads a table indirectly, by calling another +--echo # function. +--echo # +--echo # Since a call to such function is written to the binary log +--echo # it should be serialized from concurrent statements. +--echo # Hence, reads should take row locks. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= select f11(); +let $wait_statement= select i from t1 where i = 1 into j; +--source include/check_no_row_lock.inc + +--echo # +--echo # 4.13 SELECT that reads a table through a subquery passed +--echo # as a parameter to a stored function which modifies +--echo # data. +--echo # +--echo # Even though a call to this function is written to the +--echo # binary log, values of its parameters are written as literals. +--echo # So there is no need to acquire row locks on rows used in +--echo # the subquery. +--echo # But due to the fact that in 5.1 for prelocked statements +--echo # THD::in_lock_tables is set to TRUE we acquire strong locks +--echo # (see also bug#44613 "SELECT statement inside FUNCTION takes +--echo # a shared lock" [sic!!!]). +let $statement= select f12((select i+10 from t1 where i=1)); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 4.14 INSERT that reads a table via a subquery passed +--echo # as a parameter to a stored function which doesn't +--echo # modify data. +--echo # +--echo # Since this statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting the data it +--echo # uses. Therefore it should take row locks on the data it reads. +let $statement= insert into t2 values (f13((select i+10 from t1 where i=1))); +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + + +--echo # +--echo # 5. Statements that read tables through stored procedures. +--echo # + +--echo # +--echo # 5.1 CALL statement which reads a table via SELECT. +--echo # +--echo # Since neither this statement nor its components are +--echo # written to the binary log, there is no need to take +--echo # row locks on the data it reads. +let $statement= call p2(@a); +--source include/check_no_row_lock.inc + +--echo # +--echo # 5.2 Function that modifies data and uses CALL, +--echo # which reads a table through SELECT. +--echo # +--echo # Since a call to such function is written to the binary +--echo # log, it should be serialized with concurrent statements. +--echo # Hence, in this case reads should take row locks on data. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= select f14(); +let $wait_statement= select i from t1 where i = 1 into p; +--source include/check_no_row_lock.inc + +--echo # +--echo # 5.3 SELECT that calls a function that doesn't modify data and +--echo # uses a CALL statement that reads a table via SELECT. +--echo # +--echo # Calls to such functions won't get into the binary log and +--echo # thus don't need to acquire strong locks. +--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +--echo # used stored functions may lead to broken SBR" strong locks +--echo # are taken (we accepted it as a trade-off for this fix). +let $statement= select f15(); +let $wait_statement= select i from t1 where i = 1 into p; +--source include/check_no_row_lock.inc + +--echo # +--echo # 5.4 INSERT which calls function which doesn't modify data and +--echo # uses CALL statement which reads table through SELECT. +--echo # +--echo # Since such statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting data it +--echo # uses. Therefore it should take row locks on data it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= insert into t2 values (f15()+5); +let $wait_statement= select i from t1 where i = 1 into p; +--source include/check_no_row_lock.inc + + +--echo # +--echo # 6. Statements that use triggers. +--echo # + +--echo # +--echo # 6.1 Statement invoking a trigger that reads table via SELECT. +--echo # +--echo # Since this statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting the data +--echo # it uses. Therefore, it should take row locks on the data +--echo # it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= insert into t4 values (2); +let $wait_statement= select i from t1 where i=1 into k; +--source include/check_no_row_lock.inc + +--echo # +--echo # 6.2 Statement invoking a trigger that reads table through +--echo # a subquery in a control construct. +--echo # +--echo # The above is true for this statement as well. +let $statement= update t4 set l= 2 where l = 1; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 6.3 Statement invoking a trigger that reads a table through +--echo # a view. +--echo # +--echo # And for this statement. +let $statement= delete from t4 where l = 1; +let $wait_statement= $statement; +--source include/check_shared_row_lock.inc + +--echo # +--echo # 6.4 Statement invoking a trigger that reads a table through +--echo # a stored function. +--echo # +--echo # And for this statement. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= insert into t5 values (2); +let $wait_statement= select i from t1 where i = 1 into j; +--source include/check_no_row_lock.inc + +--echo # +--echo # 6.5 Statement invoking a trigger that reads a table through +--echo # stored procedure. +--echo # +--echo # And for this statement. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" no lock is taken. +let $statement= update t5 set l= 2 where l = 1; +let $wait_statement= select i from t1 where i = 1 into p; +--source include/check_no_row_lock.inc + +--echo # Clean-up. +drop function f1; +drop function f2; +drop function f3; +drop function f4; +drop function f5; +drop function f6; +drop function f7; +drop function f8; +drop function f9; +drop function f10; +drop function f11; +drop function f12; +drop function f13; +drop function f14; +drop function f15; +drop view v1, v2; +drop procedure p1; +drop procedure p2; +drop table t1, t2, t3, t4, t5, te; +disconnect con1; + +# Check that all connections opened by test cases in this file are really +# gone so execution of other tests won't be affected by their presence. +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test new file mode 100644 index 00000000000..17f8abb75f3 --- /dev/null +++ b/mysql-test/t/lock_sync.test @@ -0,0 +1,867 @@ +# +# Locking related tests which use DEBUG_SYNC facility. +# +--source include/have_debug_sync.inc +# This test requires statement/mixed mode binary logging. +# Row-based mode puts weaker serializability requirements +# so weaker locks are acquired for it. +--source include/have_binlog_format_mixed_or_statement.inc + +# Save the initial number of concurrent sessions. +--source include/count_sessions.inc + + +--echo # +--echo # Test how we handle locking in various cases when +--echo # we read data from MyISAM tables. +--echo # +--echo # In this test we mostly check that the SQL-layer correctly +--echo # determines the type of thr_lock.c lock for a table being +--echo # read. +--echo # I.e. that it disallows concurrent inserts when the statement +--echo # is going to be written to the binary log and therefore +--echo # should be serialized, and allows concurrent inserts when +--echo # such serialization is not necessary (e.g. when +--echo # the statement is not written to binary log). +--echo # + +--echo # Force concurrent inserts to be performed even if the table +--echo # has gaps. This allows to simplify clean up in scripts +--echo # used below (instead of backing up table being inserted +--echo # into and then restoring it from backup at the end of the +--echo # script we can simply delete rows which were inserted). +set @old_concurrent_insert= @@global.concurrent_insert; +set @@global.concurrent_insert= 2; +select @@global.concurrent_insert; + +--echo # Prepare playground by creating tables, views, +--echo # routines and triggers used in tests. +connect (con1, localhost, root,,); +connect (con2, localhost, root,,); +connection default; +--disable_warnings +drop table if exists t0, t1, t2, t3, t4, t5, te; +drop view if exists v1, v2; +drop procedure if exists p1; +drop procedure if exists p2; +drop function if exists f1; +drop function if exists f2; +drop function if exists f3; +drop function if exists f4; +drop function if exists f5; +drop function if exists f6; +drop function if exists f7; +drop function if exists f8; +drop function if exists f9; +drop function if exists f10; +drop function if exists f11; +drop function if exists f12; +drop function if exists f13; +drop function if exists f14; +drop function if exists f15; +--enable_warnings +create table t1 (i int primary key); +insert into t1 values (1), (2), (3), (4), (5); +create table t2 (j int primary key); +insert into t2 values (1), (2), (3), (4), (5); +create table t3 (k int primary key); +insert into t3 values (1), (2), (3); +create table t4 (l int primary key); +insert into t4 values (1); +create table t5 (l int primary key); +insert into t5 values (1); +create table te(e int primary key); +insert into te values (1); +create view v1 as select i from t1; +create view v2 as select j from t2 where j in (select i from t1); +create procedure p1(k int) insert into t2 values (k); +delimiter |; +create function f1() returns int +begin + declare j int; + select i from t1 where i = 1 into j; + return j; +end| +create function f2() returns int +begin + declare k int; + select i from t1 where i = 1 into k; + insert into t2 values (k + 5); + return 0; +end| +create function f3() returns int +begin + return (select i from t1 where i = 3); +end| +create function f4() returns int +begin + if (select i from t1 where i = 3) then + return 1; + else + return 0; + end if; +end| +create function f5() returns int +begin + insert into t2 values ((select i from t1 where i = 1) + 5); + return 0; +end| +create function f6() returns int +begin + declare k int; + select i from v1 where i = 1 into k; + return k; +end| +create function f7() returns int +begin + declare k int; + select j from v2 where j = 1 into k; + return k; +end| +create function f8() returns int +begin + declare k int; + select i from v1 where i = 1 into k; + insert into t2 values (k+5); + return k; +end| +create function f9() returns int +begin + update v2 set j=j+10 where j=1; + return 1; +end| +create function f10() returns int +begin + return f1(); +end| +create function f11() returns int +begin + declare k int; + set k= f1(); + insert into t2 values (k+5); + return k; +end| +create function f12(p int) returns int +begin + insert into t2 values (p); + return p; +end| +create function f13(p int) returns int +begin + return p; +end| +create procedure p2(inout p int) +begin + select i from t1 where i = 1 into p; +end| +create function f14() returns int +begin + declare k int; + call p2(k); + insert into t2 values (k+5); + return k; +end| +create function f15() returns int +begin + declare k int; + call p2(k); + return k; +end| +create trigger t4_bi before insert on t4 for each row +begin + declare k int; + select i from t1 where i=1 into k; + set new.l= k+1; +end| +create trigger t4_bu before update on t4 for each row +begin + if (select i from t1 where i=1) then + set new.l= 2; + end if; +end| +--echo # Trigger below uses insertion of duplicate key in 'te' +--echo # table as a way to abort delete operation. +create trigger t4_bd before delete on t4 for each row +begin + if !(select i from v1 where i=1) then + insert into te values (1); + end if; +end| +create trigger t5_bi before insert on t5 for each row +begin + set new.l= f1()+1; +end| +create trigger t5_bu before update on t5 for each row +begin + declare j int; + call p2(j); + set new.l= j + 1; +end| +delimiter ;| + +--echo # +--echo # Set common variables to be used by the scripts +--echo # called below. +--echo # +let $con_aux1= con1; +let $con_aux2= con2; +let $table= t1; + +--echo # Switch to connection 'con1'. +connection con1; +--echo # Cache all functions used in the tests below so statements +--echo # calling them won't need to open and lock mysql.proc table +--echo # and we can assume that each statement locks its tables +--echo # once during its execution. +--disable_result_log +show create procedure p1; +show create procedure p2; +show create function f1; +show create function f2; +show create function f3; +show create function f4; +show create function f5; +show create function f6; +show create function f7; +show create function f8; +show create function f9; +show create function f10; +show create function f11; +show create function f12; +show create function f13; +show create function f14; +show create function f15; +--enable_result_log +--echo # Switch back to connection 'default'. +connection default; + +--echo # +--echo # 1. Statements that read tables and do not use subqueries. +--echo # + +--echo # +--echo # 1.1 Simple SELECT statement. +--echo # +--echo # No locks are necessary as this statement won't be written +--echo # to the binary log and thanks to how MyISAM works SELECT +--echo # will see version of the table prior to concurrent insert. +let $statement= select * from t1; +let $restore_table= ; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 1.2 Multi-UPDATE statement. +--echo # +--echo # Has to take shared locks on rows in the table being read as this +--echo # statement will be written to the binary log and therefore should +--echo # be serialized with concurrent statements. +let $statement= update t2, t1 set j= j - 1 where i = j; +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 1.3 Multi-DELETE statement. +--echo # +--echo # The above is true for this statement as well. +let $statement= delete t2 from t1, t2 where i = j; +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 1.4 DESCRIBE statement. +--echo # +--echo # This statement does not really read data from the +--echo # target table and thus does not take any lock on it. +--echo # We check this for completeness of coverage. +lock table t1 write; +--echo # Switching to connection 'con1'. +connection con1; +--echo # This statement should not be blocked. +--disable_result_log +describe t1; +--enable_result_log +--echo # Switching to connection 'default'. +connection default; +unlock tables; + +--echo # +--echo # 1.5 SHOW statements. +--echo # +--echo # The above is true for SHOW statements as well. +lock table t1 write; +--echo # Switching to connection 'con1'. +connection con1; +--echo # These statements should not be blocked. +# The below test for SHOW CREATE TABLE is disabled until bug 52593 +# "SHOW CREATE TABLE is blocked if table is locked for write by another +# connection" is fixed. +--disable_parsing +show create table t1; +--enable_parsing +--disable_result_log +show keys from t1; +--enable_result_log +--echo # Switching to connection 'default'. +connection default; +unlock tables; + + +--echo # +--echo # 2. Statements which read tables through subqueries. +--echo # + +--echo # +--echo # 2.1 CALL with a subquery. +--echo # +--echo # In theory strong lock is not necessary as this statement +--echo # is not written to the binary log as a whole (it is written +--echo # statement-by-statement). But in practice in 5.1 for +--echo # almost everything except SELECT we take strong lock. +let $statement= call p1((select i + 5 from t1 where i = 1)); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.2 CREATE TABLE with a subquery. +--echo # +--echo # Has to take a strong lock on the table being read as +--echo # this statement is written to the binary log and therefore +--echo # should be serialized with concurrent statements. +let $statement= create table t0 select * from t1; +let $restore_table= ; +--source include/check_no_concurrent_insert.inc +drop table t0; +let $statement= create table t0 select j from t2 where j in (select i from t1); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc +drop table t0; + +--echo # +--echo # 2.3 DELETE with a subquery. +--echo # +--echo # The above is true for this statement as well. +let $statement= delete from t2 where j in (select i from t1); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.4 MULTI-DELETE with a subquery. +--echo # +--echo # Same is true for this statement as well. +let $statement= delete t2 from t3, t2 where k = j and j in (select i from t1); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + + +--echo # +--echo # 2.5 DO with a subquery. +--echo # +--echo # In theory strong lock is not necessary as it is not logged. +--echo # But in practice in 5.1 for almost everything except SELECT +--echo # we take strong lock. +let $statement= do (select i from t1 where i = 1); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.6 INSERT with a subquery. +--echo # +--echo # Has to take a strong lock on the table being read as +--echo # this statement is written to the binary log and therefore +--echo # should be serialized with concurrent inserts. +let $statement= insert into t2 select i+5 from t1; +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc +let $statement= insert into t2 values ((select i+5 from t1 where i = 4)); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.7 LOAD DATA with a subquery. +--echo # +--echo # The above is true for this statement as well. +let $statement= load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.8 REPLACE with a subquery. +--echo # +--echo # Same is true for this statement as well. +let $statement= replace into t2 select i+5 from t1; +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc +let $statement= replace into t2 values ((select i+5 from t1 where i = 4)); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.9 SELECT with a subquery. +--echo # +--echo # Strong locks are not necessary as this statement is not written +--echo # to the binary log and thanks to how MyISAM works this statement +--echo # sees a version of the table prior to the concurrent insert. +let $statement= select * from t2 where j in (select i from t1); +let $restore_table= ; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 2.10 SET with a subquery. +--echo # +--echo # In theory the same is true for this statement as well. +--echo # But in practice in 5.1 we acquire strong lock in this +--echo # case as well. +let $statement= set @a:= (select i from t1 where i = 1); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.11 SHOW with a subquery. +--echo # +--echo # The same is true for this statement too. +let $statement= show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc +let $statement= show columns from t2 where (select i from t1 where i = 1); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.12 UPDATE with a subquery. +--echo # +--echo # Has to take a strong lock on the table being read as +--echo # this statement is written to the binary log and therefore +--echo # should be serialized with concurrent inserts. +let $statement= update t2 set j= j-10 where j in (select i from t1); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 2.13 MULTI-UPDATE with a subquery. +--echo # +--echo # Same is true for this statement as well. +let $statement= update t2, t3 set j= j -10 where j=k and j in (select i from t1); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + + +--echo # +--echo # 3. Statements which read tables through a view. +--echo # + +--echo # +--echo # 3.1 SELECT statement which uses some table through a view. +--echo # +--echo # Since this statement is not written to the binary log and +--echo # an old version of the table is accessible thanks to how MyISAM +--echo # handles concurrent insert, no locking is necessary. +let $statement= select * from v1; +let $restore_table= ; +--source include/check_concurrent_insert.inc +let $statement= select * from v2; +let $restore_table= ; +--source include/check_concurrent_insert.inc +let $statement= select * from t2 where j in (select i from v1); +let $restore_table= ; +--source include/check_concurrent_insert.inc +let $statement= select * from t3 where k in (select j from v2); +let $restore_table= ; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 3.2 Statements which modify a table and use views. +--echo # +--echo # Since such statements are going to be written to the binary +--echo # log they need to be serialized against concurrent statements +--echo # and therefore should take strong locks on the data read. +let $statement= update t2 set j= j-10 where j in (select i from v1); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc +let $statement= update t3 set k= k-10 where k in (select j from v2); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc +let $statement= update t2, v1 set j= j-10 where j = i; +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc +let $statement= update v2 set j= j-10 where j = 3; +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + + +--echo # +--echo # 4. Statements which read tables through stored functions. +--echo # + +--echo # +--echo # 4.1 SELECT/SET with a stored function which does not +--echo # modify data and uses SELECT in its turn. +--echo # +--echo # Calls to such functions won't get into the binary log and +--echo # thus don't need to acquire strong locks. +--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +--echo # used stored functions may lead to broken SBR" strong locks +--echo # are taken (we accepted it as a trade-off for this fix). +let $statement= select f1(); +let $restore_table= ; +--source include/check_concurrent_insert.inc +let $statement= set @a:= f1(); +let $restore_table= ; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 4.2 INSERT (or other statement which modifies data) with +--echo # a stored function which does not modify data and uses +--echo # SELECT. +--echo # +--echo # Since such statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting the data +--echo # it uses. Therefore it should take strong lock on the data +--echo # it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= insert into t2 values (f1() + 5); +let $restore_table= t2; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 4.3 SELECT/SET with a stored function which +--echo # reads and modifies data. +--echo # +--echo # Since a call to such function is written to the binary log, +--echo # it should be serialized with concurrent statements affecting +--echo # the data it uses. Hence, a strong lock on the data read +--echo # should be taken. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= select f2(); +let $restore_table= t2; +--source include/check_concurrent_insert.inc +let $statement= set @a:= f2(); +let $restore_table= t2; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 4.4. SELECT/SET with a stored function which does not +--echo # modify data and reads a table through subselect +--echo # in a control construct. +--echo # +--echo # Again, in theory a call to this function won't get to the +--echo # binary log and thus no strong lock is needed. But in practice +--echo # we don't detect this fact early enough (get_lock_type_for_table()) +--echo # to avoid taking a strong lock. +let $statement= select f3(); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc +let $statement= set @a:= f3(); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc +let $statement= select f4(); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc +let $statement= set @a:= f4(); +let $restore_table= ; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 4.5. INSERT (or other statement which modifies data) with +--echo # a stored function which does not modify data and reads +--echo # the table through a subselect in one of its control +--echo # constructs. +--echo # +--echo # Since such statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting data it +--echo # uses. Therefore it should take a strong lock on the data +--echo # it reads. +let $statement= insert into t2 values (f3() + 5); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc +let $statement= insert into t2 values (f4() + 6); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 4.6 SELECT/SET which uses a stored function with +--echo # DML which reads a table via a subquery. +--echo # +--echo # Since call to such function is written to the binary log +--echo # it should be serialized with concurrent statements. +--echo # Hence reads should take a strong lock. +let $statement= select f5(); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc +let $statement= set @a:= f5(); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 4.7 SELECT/SET which uses a stored function which +--echo # doesn't modify data and reads tables through +--echo # a view. +--echo # +--echo # Once again, in theory, calls to such functions won't +--echo # get into the binary log and thus don't need strong +--echo # locks. In practice this fact is discovered +--echo # too late to have any effect. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken +--echo # in case when simple SELECT is used. +let $statement= select f6(); +let $restore_table= t2; +--source include/check_concurrent_insert.inc +let $statement= set @a:= f6(); +let $restore_table= t2; +--source include/check_concurrent_insert.inc +let $statement= select f7(); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc +let $statement= set @a:= f7(); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 4.8 INSERT which uses stored function which +--echo # doesn't modify data and reads a table +--echo # through a view. +--echo # +--echo # Since such statement is written to the binary log and +--echo # should be serialized with concurrent statements affecting +--echo # the data it uses. Therefore it should take a strong lock on +--echo # the table it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken +--echo # in case when simple SELECT is used. +let $statement= insert into t3 values (f6() + 5); +let $restore_table= t3; +--source include/check_concurrent_insert.inc +let $statement= insert into t3 values (f7() + 5); +let $restore_table= t3; +--source include/check_no_concurrent_insert.inc + + +--echo # +--echo # 4.9 SELECT which uses a stored function which +--echo # modifies data and reads tables through a view. +--echo # +--echo # Since a call to such function is written to the binary log +--echo # it should be serialized with concurrent statements. +--echo # Hence, reads should take strong locks. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken +--echo # in case when simple SELECT is used. +let $statement= select f8(); +let $restore_table= t2; +--source include/check_concurrent_insert.inc +let $statement= select f9(); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 4.10 SELECT which uses a stored function which doesn't modify +--echo # data and reads a table indirectly, by calling another +--echo # function. +--echo # +--echo # Calls to such functions won't get into the binary log and +--echo # thus don't need to acquire strong locks. +--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +--echo # used stored functions may lead to broken SBR" strong locks +--echo # are taken (we accepted it as a trade-off for this fix). +let $statement= select f10(); +let $restore_table= ; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 4.11 INSERT which uses a stored function which doesn't modify +--echo # data and reads a table indirectly, by calling another +--echo # function. +--echo # +--echo # Since such statement is written to the binary log, it should +--echo # be serialized with concurrent statements affecting the data it +--echo # uses. Therefore it should take strong locks on data it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= insert into t2 values (f10() + 5); +let $restore_table= t2; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 4.12 SELECT which uses a stored function which modifies +--echo # data and reads a table indirectly, by calling another +--echo # function. +--echo # +--echo # Since a call to such function is written to the binary log +--echo # it should be serialized from concurrent statements. +--echo # Hence, read should take a strong lock. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= select f11(); +let $restore_table= t2; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 4.13 SELECT that reads a table through a subquery passed +--echo # as a parameter to a stored function which modifies +--echo # data. +--echo # +--echo # Even though a call to this function is written to the +--echo # binary log, values of its parameters are written as literals. +--echo # So there is no need to acquire strong locks for tables used in +--echo # the subquery. +let $statement= select f12((select i+10 from t1 where i=1)); +let $restore_table= t2; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 4.14 INSERT that reads a table via a subquery passed +--echo # as a parameter to a stored function which doesn't +--echo # modify data. +--echo # +--echo # Since this statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting the data it +--echo # uses. Therefore it should take strong locks on the data it reads. +let $statement= insert into t2 values (f13((select i+10 from t1 where i=1))); +let $restore_table= t2; +--source include/check_no_concurrent_insert.inc + + +--echo # +--echo # 5. Statements that read tables through stored procedures. +--echo # + +--echo # +--echo # 5.1 CALL statement which reads a table via SELECT. +--echo # +--echo # Since neither this statement nor its components are +--echo # written to the binary log, there is no need to take +--echo # strong locks on the data it reads. +let $statement= call p2(@a); +let $restore_table= ; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 5.2 Function that modifies data and uses CALL, +--echo # which reads a table through SELECT. +--echo # +--echo # Since a call to such function is written to the binary +--echo # log, it should be serialized with concurrent statements. +--echo # Hence, in this case reads should take strong locks on data. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= select f14(); +let $restore_table= t2; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 5.3 SELECT that calls a function that doesn't modify data and +--echo # uses a CALL statement that reads a table via SELECT. +--echo # +--echo # Calls to such functions won't get into the binary log and +--echo # thus don't need to acquire strong locks. +--echo # In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs +--echo # used stored functions may lead to broken SBR" strong locks +--echo # are taken (we accepted it as a trade-off for this fix). +let $statement= select f15(); +let $restore_table= ; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 5.4 INSERT which calls function which doesn't modify data and +--echo # uses CALL statement which reads table through SELECT. +--echo # +--echo # Since such statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting data it +--echo # uses. Therefore it should take strong locks on data it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= insert into t2 values (f15()+5); +let $restore_table= t2; +--source include/check_concurrent_insert.inc + + +--echo # +--echo # 6. Statements that use triggers. +--echo # + +--echo # +--echo # 6.1 Statement invoking a trigger that reads table via SELECT. +--echo # +--echo # Since this statement is written to the binary log it should +--echo # be serialized with concurrent statements affecting the data +--echo # it uses. Therefore, it should take strong locks on the data +--echo # it reads. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= insert into t4 values (2); +let $restore_table= t4; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 6.2 Statement invoking a trigger that reads table through +--echo # a subquery in a control construct. +--echo # +--echo # The above is true for this statement as well. +let $statement= update t4 set l= 2 where l = 1; +let $restore_table= t4; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 6.3 Statement invoking a trigger that reads a table through +--echo # a view. +--echo # +--echo # And for this statement. +let $statement= delete from t4 where l = 1; +let $restore_table= t4; +--source include/check_no_concurrent_insert.inc + +--echo # +--echo # 6.4 Statement invoking a trigger that reads a table through +--echo # a stored function. +--echo # +--echo # And for this statement. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= insert into t5 values (2); +let $restore_table= t5; +--source include/check_concurrent_insert.inc + +--echo # +--echo # 6.5 Statement invoking a trigger that reads a table through +--echo # stored procedure. +--echo # +--echo # And for this statement. +--echo # But due to bug #53921 "Wrong locks for SELECTs used stored +--echo # functions may lead to broken SBR" weak locks are taken. +let $statement= update t5 set l= 2 where l = 1; +let $restore_table= t5; +--source include/check_concurrent_insert.inc + + +--echo # Clean-up. +drop function f1; +drop function f2; +drop function f3; +drop function f4; +drop function f5; +drop function f6; +drop function f7; +drop function f8; +drop function f9; +drop function f10; +drop function f11; +drop function f12; +drop function f13; +drop function f14; +drop function f15; +drop view v1, v2; +drop procedure p1; +drop procedure p2; +drop table t1, t2, t3, t4, t5, te; + +disconnect con1; +disconnect con2; + +set @@global.concurrent_insert= @old_concurrent_insert; + + +# Check that all connections opened by test cases in this file are really +# gone so execution of other tests won't be affected by their presence. +--source include/wait_until_count_sessions.inc diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f61565fe6e7..44694c59447 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1288,7 +1288,8 @@ bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last, TABLE_LIST *new_child_list, TABLE_LIST **new_last); bool reopen_table(TABLE *table); bool reopen_tables(THD *thd,bool get_locks,bool in_refresh); -thr_lock_type read_lock_type_for_table(THD *thd, TABLE *table); +thr_lock_type read_lock_type_for_table(THD *thd, LEX *lex, + TABLE_LIST *table_list); void close_data_files_and_morph_locks(THD *thd, const char *db, const char *table_name); void close_handle_and_leave_table_as_lock(TABLE *table); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 55d4ab0c20f..3a51b5c5610 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4418,7 +4418,8 @@ bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last, Return a appropriate read lock type given a table object. @param thd Thread context - @param table TABLE object for table to be locked + @param lex LEX for the current statement. + @param table_list Table list element for table to be locked. @remark Due to a statement-based replication limitation, statements such as INSERT INTO .. SELECT FROM .. and CREATE TABLE .. SELECT FROM need @@ -4427,19 +4428,32 @@ bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last, source table. If such a statement gets applied on the slave before the INSERT .. SELECT statement finishes, data on the master could differ from data on the slave and end-up with a discrepancy between - the binary log and table state. Furthermore, this does not apply to - I_S and log tables as it's always unsafe to replicate such tables - under statement-based replication as the table on the slave might - contain other data (ie: general_log is enabled on the slave). The - statement will be marked as unsafe for SBR in decide_logging_format(). + the binary log and table state. + This also applies to SELECT/SET/DO statements which use stored + functions. Calls to such functions are going to be logged as a + whole and thus should be serialized against concurrent changes + to tables used by those functions. This can be avoided if functions + only read data but doing so requires more complex analysis than it + is done now (unfortunately, due to bug #53921 "Wrong locks for + SELECTs used stored functions may lead to broken SBR" this rule + is not followed in cases when stored function or trigger use + simple SELECT and not a subselect in their body). + Furthermore, this does not apply to I_S and log tables as it's + always unsafe to replicate such tables under statement-based + replication as the table on the slave might contain other data + (ie: general_log is enabled on the slave). The statement will + be marked as unsafe for SBR in decide_logging_format(). */ -thr_lock_type read_lock_type_for_table(THD *thd, TABLE *table) +thr_lock_type read_lock_type_for_table(THD *thd, LEX *lex, + TABLE_LIST *table_list) { bool log_on= mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG); ulong binlog_format= thd->variables.binlog_format; if ((log_on == FALSE) || (binlog_format == BINLOG_FORMAT_ROW) || - (table->s->table_category == TABLE_CATEGORY_PERFORMANCE)) + (table_list->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) || + (lex->sql_command == SQLCOM_SELECT && + ! table_list->prelocking_placeholder)) return TL_READ; else return TL_READ_NO_INSERT; @@ -4735,7 +4749,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) tables->table->reginfo.lock_type= thd->update_lock_default; else if (tables->lock_type == TL_READ_DEFAULT) tables->table->reginfo.lock_type= - read_lock_type_for_table(thd, tables->table); + read_lock_type_for_table(thd, thd->lex, tables); else tables->table->reginfo.lock_type= tables->lock_type; } @@ -5389,6 +5403,8 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) DBUG_RETURN(-1); } + DEBUG_SYNC(thd, "after_lock_tables_takes_lock"); + if (thd->lex->requires_prelocking() && thd->lex->sql_command != SQLCOM_LOCK_TABLES) { diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 7df0898e841..b2f2897c74e 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1053,7 +1053,7 @@ reopen_tables: correct order of statements. Otherwise, we use a TL_READ lock to improve performance. */ - tl->lock_type= read_lock_type_for_table(thd, table); + tl->lock_type= read_lock_type_for_table(thd, lex, tl); tl->updating= 0; /* Update TABLE::lock_type accordingly. */ if (!tl->placeholder() && !using_lock_tables) From 3df7f6749a7448a0a55c4b122d2b921f652360dd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 May 2010 10:57:45 +0800 Subject: [PATCH 074/121] Postfix for BUG#49741 Add code to waiting for a set of errors. Add code to waiting for an error instead of waiting for io thread to stop, as after 'START SLAVE', the status of io thread is still not running. But it doesn't mean slave io thread encounters an error. --- .../rpl_get_master_version_and_clock.test | 20 +++++++--------- .../include/wait_for_slave_io_error.inc | 23 ++++++++++++++----- .../r/rpl_get_master_version_and_clock.result | 2 -- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test index 6e750d57c56..66bd61a8ea9 100644 --- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test +++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test @@ -68,19 +68,15 @@ eval SET DEBUG_SYNC=$debug_sync_action; # Show slave last IO errno connection slave; -source include/wait_for_slave_io_to_stop.inc; -let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1); --echo Check network error happened here -if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST - '$last_io_errno' = '2003' || # CR_CONN_HOST_ERROR - '$last_io_errno' = '2002' || # CR_CONNECTION_ERROR - '$last_io_errno' = '2006' || # CR_SERVER_GONE_ERROR - '$last_io_errno' = '1040' || # ER_CON_COUNT_ERROR - '$last_io_errno' = '1053' # ER_SERVER_SHUTDOWN - `) -{ - --echo NETWORK ERROR -} +# '2013' CR_SERVER_LOST +# '2003' CR_CONN_HOST_ERROR +# '2002' CR_CONNECTION_ERROR +# '2006' CR_SERVER_GONE_ERROR +# '1040' ER_CON_COUNT_ERROR +# '1053' ER_SERVER_SHUTDOWN +let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013; +source include/wait_for_slave_io_error.inc; # deactivate the sync point of get_master_version_and_clock() # now to avoid restarting IO-thread to re-enter it. diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc index 101df69730c..34cbf20a73b 100644 --- a/mysql-test/include/wait_for_slave_io_error.inc +++ b/mysql-test/include/wait_for_slave_io_error.inc @@ -6,14 +6,21 @@ # # ==== Usage ==== # +# # Wait several errors. +# let $slave_io_errno= 1, 2, 3; +# source include/wait_for_slave_io_error.inc; +# +# # Print error message +# let $slave_io_errno= 1; +# let $show_slave_io_error= 1; # source include/wait_for_slave_io_error.inc; # # Parameters: # # $slave_io_errno -# The expected IO error number. This is required. +# The expected IO error numbers. This is required. # (After BUG#41956 has been fixed, this will be required to be a -# symbolic name instead of a number.) +# symbolic name instead of a numbers.) # # $show_slave_io_error # If set, will print the error to the query log. @@ -28,13 +35,17 @@ if (`SELECT '$slave_io_errno' = ''`) { --die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc } -let $slave_param= Slave_IO_Running; -let $slave_param_value= No; -let $slave_error_message= Failed while waiting for slave to stop the IO thread (expecting error in the IO thread); +let $old_slave_param_comparison= $slave_param_comparison; +let $slave_param= Last_IO_Errno; +let $slave_param_comparison= !=; +let $slave_param_value= 0; +let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread; source include/wait_for_slave_param.inc; +let $slave_error_message= ; +let $slave_param_comparison= $old_slave_param_comparison; let $_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); -if (`SELECT '$_error' != '$slave_io_errno'`) { +if (`SELECT $_error NOT IN ($slave_io_errno)`) { --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) **** source include/show_rpl_debug_info.inc; --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) **** diff --git a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result index 6d3e73f787d..432bcfcc94d 100644 --- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result +++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result @@ -14,7 +14,6 @@ slave is going to hang in get_master_version_and_clock slave is unblocked SET DEBUG_SYNC='now SIGNAL signal.get_unix_timestamp'; Check network error happened here -NETWORK ERROR set @@global.debug = "-d,'debug_lock.before_get_UNIX_TIMESTAMP'"; stop slave; SET @@global.debug= "+d,'debug_lock.before_get_SERVER_ID'"; @@ -23,7 +22,6 @@ slave is going to hang in get_master_version_and_clock slave is unblocked SET DEBUG_SYNC='now SIGNAL signal.get_server_id'; Check network error happened here -NETWORK ERROR set @@global.debug = "-d,'debug_lock.before_get_SERVER_ID'"; set global debug= ''; reset master; From d02ec3463ee7adf16b807102b8300c735221285d Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Fri, 28 May 2010 06:17:37 -0700 Subject: [PATCH 075/121] This is to fix a special case for the fix on bug #53592, where the err_index could be not a member of the share structure or prebuilt structure passed from MySQL. For now, we resort to the traditional way of scanning index->table for the index number. --- storage/innodb_plugin/handler/ha_innodb.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc index f753e2d1cbd..c65ba3163fc 100644 --- a/storage/innodb_plugin/handler/ha_innodb.cc +++ b/storage/innodb_plugin/handler/ha_innodb.cc @@ -7418,6 +7418,26 @@ innobase_get_mysql_key_number_for_index( ut_ad(table); ut_ad(share); + /* If index does not belong to the table of share structure. Search + index->table instead */ + if (index->table != ib_table + && strcmp(index->table->name, share->table_name)) { + i = 0; + ind = dict_table_get_first_index(index->table); + + while (index != ind) { + ind = dict_table_get_next_index(ind); + i++; + } + + if (row_table_got_default_clust_index(index->table)) { + ut_a(i > 0); + i--; + } + + return(i); + } + /* If index translation table exists, we will first check the index through index translation table for a match. */ if (share->idx_trans_tbl.index_mapping) { From f3a83073972b510ffee922aac37434946ae0e0bc Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sat, 29 May 2010 22:16:45 +0400 Subject: [PATCH 076/121] Bug #48537: difference of index selection between rpm binary and .tar.gz, windows vs linux.. On Intel x86 machines index selection by the MySQL query optimizer could sometimes depend on the compiler version and optimization flags used to build the server binary. The problem was a result of a known issue with floating point calculations on x86: since internal FPU precision (80 bit) differs from precision used by programs (32-bit float or 64-bit double), the result of calculating a complex expression may depend on how FPU registers are allocated by the compiler and whether intermediate values are spilled from FPU to memory. In this particular case compiler versions and optimization flags had an effect on cost calculation when choosing the best index in best_access_path(). A possible solution to this problem which has already been implemented in mysql-trunk is to limit FPU internal precision to 64 bits. So the fix is a backport of the relevant code to 5.1 from mysql-trunk. configure.in: Configure check for fpu_control.h mysql-test/r/explain.result: Test case for bug #48537. mysql-test/t/explain.test: Test case for bug #48537. sql/mysqld.cc: Backport of the code to switch FPU on x86 to 64-bit precision. --- configure.in | 4 ++-- mysql-test/r/explain.result | 13 +++++++++++++ mysql-test/t/explain.test | 15 +++++++++++++++ sql/mysqld.cc | 36 +++++++++++++++++++++++++++++++++++- 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 7148c26187a..cb48710f5c6 100644 --- a/configure.in +++ b/configure.in @@ -838,8 +838,8 @@ AC_TYPE_SIZE_T AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \ - memory.h pwd.h select.h \ +AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h fpu_control.h \ + ieeefp.h limits.h memory.h pwd.h select.h \ stdlib.h stddef.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 8f2d704b312..f46fe8daaad 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -238,4 +238,17 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables DROP TABLE t1, t2; +# +# Bug #48573: difference of index selection between rpm binary and +# .tar.gz, windows vs linux.. +# +CREATE TABLE t1(c1 INT, c2 INT, c4 INT, c5 INT, KEY(c2, c5), KEY(c2, c4, c5)); +INSERT INTO t1 VALUES(4, 1, 1, 1); +INSERT INTO t1 VALUES(3, 1, 1, 1); +INSERT INTO t1 VALUES(2, 1, 1, 1); +INSERT INTO t1 VALUES(1, 1, 1, 1); +EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref c2,c2_2 c2 10 const,const 3 Using where +DROP TABLE t1; End of 5.1 tests. diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index ba6be72dbdc..b635a1b2968 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -213,4 +213,19 @@ EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT 1 FROM t1 t JOIN t2 WHERE b <= 1 AND DROP TABLE t1, t2; +--echo # +--echo # Bug #48573: difference of index selection between rpm binary and +--echo # .tar.gz, windows vs linux.. +--echo # + +CREATE TABLE t1(c1 INT, c2 INT, c4 INT, c5 INT, KEY(c2, c5), KEY(c2, c4, c5)); +INSERT INTO t1 VALUES(4, 1, 1, 1); +INSERT INTO t1 VALUES(3, 1, 1, 1); +INSERT INTO t1 VALUES(2, 1, 1, 1); +INSERT INTO t1 VALUES(1, 1, 1, 1); + +EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1; + +DROP TABLE t1; + --echo End of 5.1 tests. diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3664f46995f..3ffc1a21e9c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -183,6 +183,21 @@ typedef fp_except fp_except_t; /* for IRIX to use set_fpc_csr() */ #include #endif +#ifdef HAVE_FPU_CONTROL_H +#include +#endif +#if defined(__i386__) && !defined(HAVE_FPU_CONTROL_H) +# define fpu_control_t unsigned int +# define _FPU_EXTENDED 0x300 +# define _FPU_DOUBLE 0x200 +# ifdef __GNUC__ +# define _FPU_GETCW(cw) __asm__ __volatile__("fnstcw %0" : "=m" (*&cw)) +# define _FPU_SETCW(cw) __asm__ __volatile__("fldcw %0" : : "m" (*&cw)) +# else +# define _FPU_GETCW(cw) (cw= 0) +# define _FPU_SETCW(cw) +# endif +#endif inline void setup_fpu() { @@ -204,7 +219,26 @@ inline void setup_fpu() /* Set FPU rounding mode to "round-to-nearest" */ fesetround(FE_TONEAREST); #endif /* HAVE_FESETROUND */ - + + /* + x86 (32-bit) requires FPU precision to be explicitly set to 64 bit + (double precision) for portable results of floating point operations. + However, there is no need to do so if compiler is using SSE2 for floating + point, double values will be stored and processed in 64 bits anyway. + */ +#if defined(__i386__) && !defined(__SSE2_MATH__) +#if defined(_WIN32) +#if !defined(_WIN64) + _control87(_PC_53, MCW_PC); +#endif /* !_WIN64 */ +#else /* !_WIN32 */ + fpu_control_t cw; + _FPU_GETCW(cw); + cw= (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE; + _FPU_SETCW(cw); +#endif /* _WIN32 && */ +#endif /* __i386__ */ + #if defined(__sgi) && defined(HAVE_SYS_FPU_H) /* Enable denormalized DOUBLE values support for IRIX */ union fpc_csr n; From 89b83c05e0946e0fdd7cf9392a5e5b7e7a78957e Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Mon, 31 May 2010 13:25:11 +0400 Subject: [PATCH 077/121] Bug#53942 valgrind warnings with timestamp() function and incomplete datetime values Field_time::get_date method does not initialize MYSQL_TIME::time_type field. The fix is to init this field. mysql-test/r/type_time.result: test case mysql-test/t/type_time.test: test case sql/field.cc: --use Field_time::get_time in Field_time::get_date --removed duplicated code in Field_time::get_date method --- mysql-test/r/type_time.result | 10 ++++++++++ mysql-test/t/type_time.test | 12 +++++++++++- sql/field.cc | 15 +-------------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index e4b90196c2d..86712bebfa1 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -138,3 +138,13 @@ CAST(c AS TIME) 00:00:00 DROP TABLE t1; End of 5.0 tests +# +# Bug#53942 valgrind warnings with timestamp() function and incomplete datetime values +# +CREATE TABLE t1(f1 TIME); +INSERT INTO t1 VALUES ('23:38:57'); +SELECT TIMESTAMP(f1,'1') FROM t1; +TIMESTAMP(f1,'1') +NULL +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index 5bb521601e5..34331b72688 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -88,5 +88,15 @@ INSERT INTO t1 VALUES ('0:00:00'); SELECT CAST(c AS TIME) FROM t1; DROP TABLE t1; - --echo End of 5.0 tests + +--echo # +--echo # Bug#53942 valgrind warnings with timestamp() function and incomplete datetime values +--echo # + +CREATE TABLE t1(f1 TIME); +INSERT INTO t1 VALUES ('23:38:57'); +SELECT TIMESTAMP(f1,'1') FROM t1; +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/sql/field.cc b/sql/field.cc index b203a42a918..7360a013ffb 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5312,7 +5312,6 @@ String *Field_time::val_str(String *val_buffer, bool Field_time::get_date(MYSQL_TIME *ltime, uint fuzzydate) { - long tmp; THD *thd= table ? table->in_use : current_thd; if (!(fuzzydate & TIME_FUZZY_DATE)) { @@ -5322,19 +5321,7 @@ bool Field_time::get_date(MYSQL_TIME *ltime, uint fuzzydate) thd->row_count); return 1; } - tmp=(long) sint3korr(ptr); - ltime->neg=0; - if (tmp < 0) - { - ltime->neg= 1; - tmp=-tmp; - } - ltime->hour=tmp/10000; - tmp-=ltime->hour*10000; - ltime->minute= tmp/100; - ltime->second= tmp % 100; - ltime->year= ltime->month= ltime->day= ltime->second_part= 0; - return 0; + return Field_time::get_time(ltime); } From 8cef6205048a0522f966e7dccf14ce2ffdd37fe8 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Tue, 1 Jun 2010 09:02:28 +0200 Subject: [PATCH 078/121] post push fix for bug#49161 result file differs on embedded --- mysql-test/t/partition_error.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 7f733df701b..434392c2e28 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -16,6 +16,7 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`; CREATE TABLE t1 (a INT) PARTITION BY HASH (a); FLUSH TABLES; --remove_file $MYSQLD_DATADIR/test/t1.par +--replace_result $MYSQLD_DATADIR ./ CHECK TABLE t1; --error ER_UNKNOWN_ERROR SELECT * FROM t1; From 4d0177180779130c8f9dc950c682723fa2e22a9e Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 1 Jun 2010 11:54:06 +0400 Subject: [PATCH 079/121] test case fix --- mysql-test/r/join_outer.result | 52 +++++++++++++++++----------------- mysql-test/t/join_outer.test | 24 ++++++++-------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index e81389f2735..8e438934b23 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1362,39 +1362,39 @@ DROP TABLE t1, t2; # CREATE TABLE t1(f1 INT, PRIMARY KEY (f1)); INSERT INTO t1 VALUES (1),(2); -EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1 -LEFT JOIN t1 AS T2 -RIGHT JOIN t1 AS T3 -JOIN t1 AS T4 ON 1 -LEFT JOIN t1 AS T5 ON 1 +EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1 +LEFT JOIN t1 AS jt2 +RIGHT JOIN t1 AS jt3 +JOIN t1 AS jt4 ON 1 +LEFT JOIN t1 AS jt5 ON 1 ON 1 -RIGHT JOIN t1 AS T6 ON T6.f1 +RIGHT JOIN t1 AS jt6 ON jt6.f1 ON 1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE T1 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T6 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T3 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T4 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T5 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T2 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt1 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt6 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt3 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt4 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt5 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt2 index NULL PRIMARY 4 NULL 2 100.00 Using index Warnings: -Note 1003 select straight_join `test`.`T1`.`f1` AS `f1` from `test`.`t1` `T1` left join (`test`.`t1` `T6` left join (`test`.`t1` `T3` join `test`.`t1` `T4` left join `test`.`t1` `T5` on(1) left join `test`.`t1` `T2` on(1)) on((`test`.`T6`.`f1` and 1))) on(1) where 1 -EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1 -RIGHT JOIN t1 AS T2 -RIGHT JOIN t1 AS T3 -JOIN t1 AS T4 ON 1 -LEFT JOIN t1 AS T5 ON 1 +Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt1` left join (`test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1))) on(1) where 1 +EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1 +RIGHT JOIN t1 AS jt2 +RIGHT JOIN t1 AS jt3 +JOIN t1 AS jt4 ON 1 +LEFT JOIN t1 AS jt5 ON 1 ON 1 -RIGHT JOIN t1 AS T6 ON T6.f1 +RIGHT JOIN t1 AS jt6 ON jt6.f1 ON 1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE T6 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T3 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T4 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T5 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T2 index NULL PRIMARY 4 NULL 2 100.00 Using index -1 SIMPLE T1 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt6 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt3 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt4 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt5 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt2 index NULL PRIMARY 4 NULL 2 100.00 Using index +1 SIMPLE jt1 index NULL PRIMARY 4 NULL 2 100.00 Using index Warnings: -Note 1003 select straight_join `test`.`T1`.`f1` AS `f1` from `test`.`t1` `T6` left join (`test`.`t1` `T3` join `test`.`t1` `T4` left join `test`.`t1` `T5` on(1) left join `test`.`t1` `T2` on(1)) on((`test`.`T6`.`f1` and 1)) left join `test`.`t1` `T1` on(1) where 1 +Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1)) left join `test`.`t1` `jt1` on(1) where 1 DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index e7bc5cf6317..cf881e6aaa2 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -961,22 +961,22 @@ DROP TABLE t1, t2; CREATE TABLE t1(f1 INT, PRIMARY KEY (f1)); INSERT INTO t1 VALUES (1),(2); -EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1 - LEFT JOIN t1 AS T2 - RIGHT JOIN t1 AS T3 - JOIN t1 AS T4 ON 1 - LEFT JOIN t1 AS T5 ON 1 +EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1 + LEFT JOIN t1 AS jt2 + RIGHT JOIN t1 AS jt3 + JOIN t1 AS jt4 ON 1 + LEFT JOIN t1 AS jt5 ON 1 ON 1 - RIGHT JOIN t1 AS T6 ON T6.f1 + RIGHT JOIN t1 AS jt6 ON jt6.f1 ON 1; -EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1 - RIGHT JOIN t1 AS T2 - RIGHT JOIN t1 AS T3 - JOIN t1 AS T4 ON 1 - LEFT JOIN t1 AS T5 ON 1 +EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1 + RIGHT JOIN t1 AS jt2 + RIGHT JOIN t1 AS jt3 + JOIN t1 AS jt4 ON 1 + LEFT JOIN t1 AS jt5 ON 1 ON 1 - RIGHT JOIN t1 AS T6 ON T6.f1 + RIGHT JOIN t1 AS jt6 ON jt6.f1 ON 1; DROP TABLE t1; From 5b685c000e6c86be8e76950e91423756c2fc6413 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 1 Jun 2010 15:14:38 +0300 Subject: [PATCH 080/121] Bug #54138 : making main.sp and rpl.rpl_row_sp011 experimental on solaris --- mysql-test/collections/default.experimental | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index d791686cd62..c123e400f17 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -14,11 +14,13 @@ funcs_2.ndb_charset # joro : NDB tests marked as experiment main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists main.plugin_load @solaris # Bug#42144 +main.sp @solaris # joro : Bug#54138 main.outfile_loaddata @solaris # joro : Bug #46895 ndb.* # joro : NDB tests marked as experimental as agreed with bochklin rpl.rpl_innodb_bug28430* @solaris # Bug#46029 +rpl.rpl_row_sp011 @solaris # Joro : Bug #54138 rpl_ndb.* # joro : NDB tests marked as experimental as agreed with bochklin rpl_ndb.rpl_ndb_log # Bug#38998 From 6bd49855192c08306b8a6be3f6d19004de9da63c Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 1 Jun 2010 15:16:35 +0300 Subject: [PATCH 081/121] Bug#40928 : make main.func_str experimental on Solaris --- mysql-test/collections/default.experimental | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index c123e400f17..11c6613a9f7 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -13,6 +13,7 @@ funcs_1.ndb* # joro : NDB tests marked as experiment funcs_2.ndb_charset # joro : NDB tests marked as experimental as agreed with bochklin main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists +main.func_str @solaris # joro: Bug#40928 main.plugin_load @solaris # Bug#42144 main.sp @solaris # joro : Bug#54138 main.outfile_loaddata @solaris # joro : Bug #46895 From 1d9ab18a1a77d9323ac09512627e4b10f64e74ae Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 2 Jun 2010 12:20:43 +0100 Subject: [PATCH 082/121] BUG#54161: MTR: disabled.def lists don't work with FQ test names MTR will ignore fully qualified test name entries in disabled.def lists. Therefore, it would still run the test case, even if it is listed. This patch fix this by extending the check when marking the test case as disabled to take into consideration not only the cases that contain the simple test name but also those that contain fully qualified test names. --- mysql-test/lib/mtr_cases.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index cf84c0ad31f..ea3a1efce55 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -768,11 +768,13 @@ sub collect_one_test_case { # Check for disabled tests # ---------------------------------------------------------------------- my $marked_as_disabled= 0; - if ( $disabled->{$tname} ) + if ( $disabled->{$tname} or $disabled->{"$suitename.$tname"} ) { # Test was marked as disabled in suites disabled.def file $marked_as_disabled= 1; - $tinfo->{'comment'}= $disabled->{$tname}; + # Test name may have been disabled with or without suite name part + $tinfo->{'comment'}= $disabled->{$tname} || + $disabled->{"$suitename.$tname"}; } my $disabled_file= "$testdir/$tname.disabled"; From b591cce1d2c0c65c5aa80c42fd1f1f2da6c1f139 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Wed, 2 Jun 2010 15:49:05 +0300 Subject: [PATCH 083/121] Adjust .bzr-mysql/default.conf that was reverted by a recent bzr pull --- .bzr-mysql/default.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index 4eab3d239d0..df9a60f35ad 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] -post_commit_to = "commits@lists.mysql.com" -post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-trunk-bugfixing" +post_commit_to = commits@lists.mysql.com, innodb_dev_ww@oracle.com +post_push_to = commits@lists.mysql.com, innodb_dev_ww@oracle.com +tree_name = "mysql-trunk-innodb" From 1b27674429a5c6f639eeff07ce952de3703d2f10 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 2 Jun 2010 23:26:12 +0100 Subject: [PATCH 084/121] BUG#53893: RBR: nullable unique key can lead to out-of-sync slave When using Unique Keys with nullable parts in RBR, the slave can choose the wrong row to update. This happens because a table with an unique key containing nullable parts cannot strictly guarantee uniqueness. As stated in the manual, for all engines, a UNIQUE index allows multiple NULL values for columns that can contain NULL. We fix this at the slave by extending the checks before assuming that the row found through an unique index is is the correct one. This means that when a record (R) is fetched from the storage engine and a key that is not primary (K) is used, the server does the following: - If K is unique and has no nullable parts, it returns R; - Otherwise, if any field in the before image that is part of K is null do an index scan; - If there is no NULL field in the BI part of K, then return R. A side change: renamed the existing test case file and added a test case covering the changes in this patch. --- ...ave_key.result => rpl_row_find_row.result} | 12 +++++++ ...d_slave_key.test => rpl_row_find_row.test} | 31 +++++++++++++++++ sql/log_event.cc | 34 +++++++++++++++++-- sql/log_event_old.cc | 34 +++++++++++++++++-- 4 files changed, 107 insertions(+), 4 deletions(-) rename mysql-test/suite/rpl/r/{rpl_row_disabled_slave_key.result => rpl_row_find_row.result} (62%) rename mysql-test/suite/rpl/t/{rpl_row_disabled_slave_key.test => rpl_row_find_row.test} (64%) diff --git a/mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result b/mysql-test/suite/rpl/r/rpl_row_find_row.result similarity index 62% rename from mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result rename to mysql-test/suite/rpl/r/rpl_row_find_row.result index 01e3dfd6508..69516b47b7d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result +++ b/mysql-test/suite/rpl/r/rpl_row_find_row.result @@ -24,3 +24,15 @@ INSERT INTO t VALUES (1,2,4); INSERT INTO t VALUES (4,3,4); DELETE FROM t; DROP TABLE t; +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2)); +INSERT INTO t1(c1,c2) VALUES(1,1); +INSERT INTO t1(c1,c2) VALUES(1,2); +UPDATE t1 SET c1=1000 WHERE c2=2; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test b/mysql-test/suite/rpl/t/rpl_row_find_row.test similarity index 64% rename from mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test rename to mysql-test/suite/rpl/t/rpl_row_find_row.test index 1d7e134f4f4..9163ab54406 100644 --- a/mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test +++ b/mysql-test/suite/rpl/t/rpl_row_find_row.test @@ -71,3 +71,34 @@ DELETE FROM t; DROP TABLE t; -- sync_slave_with_master + +# +# BUG#53893: RBR: nullable unique key can lead to out-of-sync slave +# + +# +# We insert two rows. Both with part of UNIQUE KEY set to null. +# Then we update the last row inserted. On master the correct +# row is updated. On the slave the wrong row would be updated +# because the engine would look it up by the NULL Unique KEY. +# As a consquence, the wrong row would be updated. +# + +-- connection master +-- source include/master-slave-reset.inc +-- connection master + +CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2)); +INSERT INTO t1(c1,c2) VALUES(1,1); +INSERT INTO t1(c1,c2) VALUES(1,2); +UPDATE t1 SET c1=1000 WHERE c2=2; +-- sync_slave_with_master + +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE t1; +-- sync_slave_with_master + diff --git a/sql/log_event.cc b/sql/log_event.cc index 2cc594d85b4..c07bb573188 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -9015,8 +9015,38 @@ int Rows_log_event::find_row(const Relay_log_info *rli) */ if (table->key_info->flags & HA_NOSAME) { - table->file->ha_index_end(); - goto ok; + /* Unique does not have non nullable part */ + if (!(table->key_info->flags & (HA_NULL_PART_KEY))) + { + table->file->ha_index_end(); + goto ok; + } + else + { + KEY *keyinfo= table->key_info; + /* + Unique has nullable part. We need to check if there is any field in the + BI image that is null and part of UNNI. + */ + bool null_found= FALSE; + + for (uint i=0, fieldnr= keyinfo->key_part[i].fieldnr - 1 ; + (i < keyinfo->key_parts) && !null_found ; + i++, fieldnr= keyinfo->key_part[i].fieldnr - 1) + { + Field **f= table->field+fieldnr; + if ((*f)->is_null()) + null_found= TRUE; + } + + if (!null_found) + { + table->file->ha_index_end(); + goto ok; + } + + /* else fall through to index scan */ + } } /* diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 60b0df5253a..5f2d55d6477 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -2428,8 +2428,38 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) */ if (table->key_info->flags & HA_NOSAME) { - table->file->ha_index_end(); - DBUG_RETURN(0); + /* Unique does not have non nullable part */ + if (!(table->key_info->flags & (HA_NULL_PART_KEY))) + { + table->file->ha_index_end(); + DBUG_RETURN(0); + } + else + { + KEY *keyinfo= table->key_info; + /* + Unique has nullable part. We need to check if there is any field in the + BI image that is null and part of UNNI. + */ + bool null_found= FALSE; + + for (uint i=0, fieldnr= keyinfo->key_part[i].fieldnr - 1 ; + (i < keyinfo->key_parts) && !null_found ; + i++, fieldnr= keyinfo->key_part[i].fieldnr - 1) + { + Field **f= table->field+fieldnr; + if ((*f)->is_null()) + null_found= TRUE; + } + + if (!null_found) + { + table->file->ha_index_end(); + DBUG_RETURN(0); + } + + /* else fall through to index scan */ + } } /* From 5c6a9a5f6fb1c57ad99ac3a14a56ade38684d631 Mon Sep 17 00:00:00 2001 From: "Horst.Hunger" Date: Thu, 3 Jun 2010 10:31:26 +0200 Subject: [PATCH 085/121] Patch for bug#52913 including all review results and changes of date format. --- mysql-test/collections/default.experimental | 2 + mysql-test/include/mysqlhotcopy.inc | 116 ++++++++++++++ mysql-test/lib/mtr_misc.pl | 22 +++ mysql-test/mysql-test-run.pl | 9 ++ mysql-test/r/mysqlhotcopy_archive.result | 118 ++++++++++++++ mysql-test/r/mysqlhotcopy_myisam.result | 164 ++++++++++++++++++++ mysql-test/t/mysqlhotcopy_archive.test | 8 + mysql-test/t/mysqlhotcopy_myisam.test | 7 + 8 files changed, 446 insertions(+) create mode 100644 mysql-test/include/mysqlhotcopy.inc create mode 100644 mysql-test/r/mysqlhotcopy_archive.result create mode 100644 mysql-test/r/mysqlhotcopy_myisam.result create mode 100644 mysql-test/t/mysqlhotcopy_archive.test create mode 100644 mysql-test/t/mysqlhotcopy_myisam.test diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 11c6613a9f7..f84337660ea 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -42,3 +42,5 @@ parts.partition_mgm_lc1_ndb # joro : NDB tests marked as experiment parts.partition_mgm_lc2_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_syntax_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_value_ndb # joro : NDB tests marked as experimental as agreed with bochklin +main.mysqlhotcopy_myisam # horst: due to bug#54129 +main.mysqlhotcopy_archive # horst: due to bug#54129 diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc new file mode 100644 index 00000000000..585f8c13e74 --- /dev/null +++ b/mysql-test/include/mysqlhotcopy.inc @@ -0,0 +1,116 @@ +# Test of mysqlhotcopy (perl script) +# Author: Horst Hunger +# Created: 2010-05-10 + +--source include/not_windows.inc +--source include/not_embedded.inc + +let $MYSQLD_DATADIR= `SELECT @@datadir`; +--disable_warnings +DROP DATABASE IF EXISTS hotcopy_test; +--enable_warnings +CREATE DATABASE hotcopy_test; +USE hotcopy_test; +eval CREATE TABLE t1 (c1 int, c2 varchar(20)) ENGINE=$engine; +eval CREATE TABLE t2 (c1 int, c2 varchar(20)) ENGINE=$engine; +eval CREATE TABLE t3 (c1 int, c2 varchar(20)) ENGINE=$engine; + +INSERT INTO t1 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); +INSERT INTO t2 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); +INSERT INTO t3 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_test + +# backup into another database in the same directory +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_save + +USE hotcopy_save; +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; + +# restore data into the original database with mysqlhotcopy +if(`SELECT engine= 'MyISAM' FROM information_schema.tables WHERE table_name='t1'`) +{ +USE hotcopy_test; +DELETE FROM t1; +SELECT * FROM t1; + +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQLHOTCOPY --quiet --addtodest -S $MASTER_MYSOCK -u root hotcopy_save hotcopy_test + +USE hotcopy_save; +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +} + +USE hotcopy_test; +DROP TABLE t2; +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_test + +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQLHOTCOPY --quiet --addtodest -S $MASTER_MYSOCK -u root hotcopy_save hotcopy_test + +FLUSH TABLES; +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; + +# backup of db into a directory +USE hotcopy_test; +--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test $MYSQLTEST_VARDIR/tmp +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--list_files $MYSQLTEST_VARDIR/tmp/hotcopy_test +#--exec rm -rf $MYSQLTEST_VARDIR/tmp/hotcopy_test +--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/hotcopy_test * +--rmdir $MYSQLTEST_VARDIR/tmp/hotcopy_test + +# backup without full index files +# reproduction of bug#53556, "--list_files" shows MYI files, which is wrong. +DROP DATABASE hotcopy_save; +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQLHOTCOPY --quiet --noindices -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_save + +# test of option "allowold" +DROP DATABASE hotcopy_save; +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_save +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--error 9,2304 +--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_save + +# test of option "keepold" +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQLHOTCOPY --quiet --keepold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_save_old +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_save + +# test of option "suffix" +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQLHOTCOPY --quiet --suffix=_cpy -S $MASTER_MYSOCK -u root hotcopy_test +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--list_files $MYSQLD_DATADIR/hotcopy_test_cpy +DROP DATABASE hotcopy_test_cpy; + +DROP DATABASE hotcopy_test; +DROP DATABASE hotcopy_save; +DROP DATABASE hotcopy_save_old; + diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 97eb693b52e..32960d866ce 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -147,6 +147,28 @@ sub mtr_exe_maybe_exists (@) { } +# +# NOTE! More specific paths should be given before less specific. +# +sub mtr_pl_maybe_exists (@) { + my @path= @_; + + map {$_.= ".pl"} @path if IS_WINDOWS; + foreach my $path ( @path ) + { + if(IS_WINDOWS) + { + return $path if -f $path; + } + else + { + return $path if -x $path; + } + } + return ""; +} + + # # NOTE! More specific paths should be given before less specific. # For example /client/debug should be listed before /client diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a35741bebda..820650b120e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2039,6 +2039,15 @@ sub environment_setup { "$basedir/storage/myisam/myisampack", "$basedir/myisam/myisampack")); + # ---------------------------------------------------- + # mysqlhotcopy + # ---------------------------------------------------- + my $mysqlhotcopy= + mtr_pl_maybe_exists("$basedir/scripts/mysqlhotcopy"); + # Since mysqltest interprets the real path as "false" in an if, + # use 1 ("true") to indicate "not exists" so it can be tested for + $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy || 1; + # ---------------------------------------------------- # perror # ---------------------------------------------------- diff --git a/mysql-test/r/mysqlhotcopy_archive.result b/mysql-test/r/mysqlhotcopy_archive.result new file mode 100644 index 00000000000..bea78597336 --- /dev/null +++ b/mysql-test/r/mysqlhotcopy_archive.result @@ -0,0 +1,118 @@ +DROP DATABASE IF EXISTS hotcopy_test; +CREATE DATABASE hotcopy_test; +USE hotcopy_test; +CREATE TABLE t1 (c1 int, c2 varchar(20)) ENGINE=archive; +CREATE TABLE t2 (c1 int, c2 varchar(20)) ENGINE=archive; +CREATE TABLE t3 (c1 int, c2 varchar(20)) ENGINE=archive; +INSERT INTO t1 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); +Warnings: +Warning 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t2 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); +Warnings: +Warning 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t3 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); +Warnings: +Warning 1265 Data truncated for column 'c2' at row 2 +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +USE hotcopy_save; +SELECT * FROM t1; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t2; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t3; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +USE hotcopy_test; +DROP TABLE t2; +db.opt +t1.ARZ +t1.frm +t3.ARZ +t3.frm +FLUSH TABLES; +SELECT * FROM t1; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t2; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t3; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +USE hotcopy_test; +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +DROP DATABASE hotcopy_save; +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +DROP DATABASE hotcopy_save; +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +db.opt +t1.ARZ +t1.frm +t2.ARZ +t2.frm +t3.ARZ +t3.frm +DROP DATABASE hotcopy_test_cpy; +DROP DATABASE hotcopy_test; +DROP DATABASE hotcopy_save; +DROP DATABASE hotcopy_save_old; diff --git a/mysql-test/r/mysqlhotcopy_myisam.result b/mysql-test/r/mysqlhotcopy_myisam.result new file mode 100644 index 00000000000..52aeffce5cf --- /dev/null +++ b/mysql-test/r/mysqlhotcopy_myisam.result @@ -0,0 +1,164 @@ +DROP DATABASE IF EXISTS hotcopy_test; +CREATE DATABASE hotcopy_test; +USE hotcopy_test; +CREATE TABLE t1 (c1 int, c2 varchar(20)) ENGINE=MyISAM; +CREATE TABLE t2 (c1 int, c2 varchar(20)) ENGINE=MyISAM; +CREATE TABLE t3 (c1 int, c2 varchar(20)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); +Warnings: +Warning 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t2 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); +Warnings: +Warning 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t3 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb'); +Warnings: +Warning 1265 Data truncated for column 'c2' at row 2 +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +USE hotcopy_save; +SELECT * FROM t1; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t2; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t3; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +USE hotcopy_test; +DELETE FROM t1; +SELECT * FROM t1; +c1 c2 +USE hotcopy_save; +SELECT * FROM t1; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t2; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t3; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +USE hotcopy_test; +DROP TABLE t2; +db.opt +t1.MYD +t1.MYI +t1.frm +t3.MYD +t3.MYI +t3.frm +FLUSH TABLES; +SELECT * FROM t1; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t2; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +SELECT * FROM t3; +c1 c2 +1 aaaaaaaaaaaaaaaaaaaa +2 bbbbbbbbbbbbbbbbbbbb +USE hotcopy_test; +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +DROP DATABASE hotcopy_save; +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +DROP DATABASE hotcopy_save; +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +db.opt +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +t3.MYD +t3.MYI +t3.frm +DROP DATABASE hotcopy_test_cpy; +DROP DATABASE hotcopy_test; +DROP DATABASE hotcopy_save; +DROP DATABASE hotcopy_save_old; diff --git a/mysql-test/t/mysqlhotcopy_archive.test b/mysql-test/t/mysqlhotcopy_archive.test new file mode 100644 index 00000000000..4bfad3ce138 --- /dev/null +++ b/mysql-test/t/mysqlhotcopy_archive.test @@ -0,0 +1,8 @@ +# Test of mysqlhotcopy (perl script) +# Author: Horst Hunger +# Created: 2010-05-10 + +--source include/have_archive.inc +let $engine= archive; +--source include/mysqlhotcopy.inc +--exit diff --git a/mysql-test/t/mysqlhotcopy_myisam.test b/mysql-test/t/mysqlhotcopy_myisam.test new file mode 100644 index 00000000000..adf26e42245 --- /dev/null +++ b/mysql-test/t/mysqlhotcopy_myisam.test @@ -0,0 +1,7 @@ +# Test of mysqlhotcopy (perl script) +# Author: Horst Hunger +# Created: 2010-05-10 + +let $engine= MyISAM; +--source include/mysqlhotcopy.inc +--exit From c440ee86762ff33a4aff48fc9295fb07c7b72a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 3 Jun 2010 13:28:40 +0300 Subject: [PATCH 086/121] Merge a change from mysql-5.1-innodb: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------------------------------------------------------ revno: 3500 revision-id: marko.makela@oracle.com-20100603095032-v5ptkkzt1bhz0m1d parent: marko.makela@oracle.com-20100603094859-8cibt7xns239jjvc committer: Marko Mäkelä branch nick: 5.1-innodb timestamp: Thu 2010-06-03 12:50:32 +0300 message: Move some InnoDB tests to mysql-test/suite/innodb. --- mysql-test/{ => suite/innodb}/r/innodb-autoinc-optimize.result | 0 mysql-test/{ => suite/innodb}/r/innodb-ucs2.result | 0 .../{ => suite/innodb}/r/innodb_autoinc_lock_mode_zero.result | 0 mysql-test/{ => suite/innodb}/r/innodb_bug30919.result | 0 mysql-test/{ => suite/innodb}/r/innodb_bug42419.result | 0 mysql-test/{ => suite/innodb}/r/innodb_gis.result | 0 mysql-test/{ => suite/innodb}/r/innodb_lock_wait_timeout_1.result | 0 mysql-test/{ => suite/innodb}/r/innodb_mysql.result | 0 mysql-test/{ => suite/innodb}/r/innodb_mysql_rbk.result | 0 mysql-test/{ => suite/innodb}/r/innodb_notembedded.result | 0 mysql-test/{ => suite/innodb}/r/innodb_timeout_rollback.result | 0 mysql-test/{ => suite/innodb}/t/innodb-autoinc-optimize.test | 0 mysql-test/{ => suite/innodb}/t/innodb-ucs2.test | 0 .../{ => suite/innodb}/t/innodb_autoinc_lock_mode_zero-master.opt | 0 .../{ => suite/innodb}/t/innodb_autoinc_lock_mode_zero.test | 0 mysql-test/{ => suite/innodb}/t/innodb_bug30919-master.opt | 0 mysql-test/{ => suite/innodb}/t/innodb_bug30919.test | 0 mysql-test/{ => suite/innodb}/t/innodb_bug42419.test | 0 mysql-test/{ => suite/innodb}/t/innodb_gis.test | 0 .../{ => suite/innodb}/t/innodb_lock_wait_timeout_1-master.opt | 0 mysql-test/{ => suite/innodb}/t/innodb_lock_wait_timeout_1.test | 0 mysql-test/{ => suite/innodb}/t/innodb_mysql-master.opt | 0 mysql-test/{ => suite/innodb}/t/innodb_mysql.test | 0 mysql-test/{ => suite/innodb}/t/innodb_mysql_rbk-master.opt | 0 mysql-test/{ => suite/innodb}/t/innodb_mysql_rbk.test | 0 mysql-test/{ => suite/innodb}/t/innodb_notembedded.test | 0 .../{ => suite/innodb}/t/innodb_timeout_rollback-master.opt | 0 mysql-test/{ => suite/innodb}/t/innodb_timeout_rollback.test | 0 28 files changed, 0 insertions(+), 0 deletions(-) rename mysql-test/{ => suite/innodb}/r/innodb-autoinc-optimize.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb-ucs2.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_autoinc_lock_mode_zero.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_bug30919.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_bug42419.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_gis.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_lock_wait_timeout_1.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_mysql.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_mysql_rbk.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_notembedded.result (100%) rename mysql-test/{ => suite/innodb}/r/innodb_timeout_rollback.result (100%) rename mysql-test/{ => suite/innodb}/t/innodb-autoinc-optimize.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb-ucs2.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_autoinc_lock_mode_zero-master.opt (100%) rename mysql-test/{ => suite/innodb}/t/innodb_autoinc_lock_mode_zero.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_bug30919-master.opt (100%) rename mysql-test/{ => suite/innodb}/t/innodb_bug30919.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_bug42419.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_gis.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_lock_wait_timeout_1-master.opt (100%) rename mysql-test/{ => suite/innodb}/t/innodb_lock_wait_timeout_1.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_mysql-master.opt (100%) rename mysql-test/{ => suite/innodb}/t/innodb_mysql.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_mysql_rbk-master.opt (100%) rename mysql-test/{ => suite/innodb}/t/innodb_mysql_rbk.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_notembedded.test (100%) rename mysql-test/{ => suite/innodb}/t/innodb_timeout_rollback-master.opt (100%) rename mysql-test/{ => suite/innodb}/t/innodb_timeout_rollback.test (100%) diff --git a/mysql-test/r/innodb-autoinc-optimize.result b/mysql-test/suite/innodb/r/innodb-autoinc-optimize.result similarity index 100% rename from mysql-test/r/innodb-autoinc-optimize.result rename to mysql-test/suite/innodb/r/innodb-autoinc-optimize.result diff --git a/mysql-test/r/innodb-ucs2.result b/mysql-test/suite/innodb/r/innodb-ucs2.result similarity index 100% rename from mysql-test/r/innodb-ucs2.result rename to mysql-test/suite/innodb/r/innodb-ucs2.result diff --git a/mysql-test/r/innodb_autoinc_lock_mode_zero.result b/mysql-test/suite/innodb/r/innodb_autoinc_lock_mode_zero.result similarity index 100% rename from mysql-test/r/innodb_autoinc_lock_mode_zero.result rename to mysql-test/suite/innodb/r/innodb_autoinc_lock_mode_zero.result diff --git a/mysql-test/r/innodb_bug30919.result b/mysql-test/suite/innodb/r/innodb_bug30919.result similarity index 100% rename from mysql-test/r/innodb_bug30919.result rename to mysql-test/suite/innodb/r/innodb_bug30919.result diff --git a/mysql-test/r/innodb_bug42419.result b/mysql-test/suite/innodb/r/innodb_bug42419.result similarity index 100% rename from mysql-test/r/innodb_bug42419.result rename to mysql-test/suite/innodb/r/innodb_bug42419.result diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result similarity index 100% rename from mysql-test/r/innodb_gis.result rename to mysql-test/suite/innodb/r/innodb_gis.result diff --git a/mysql-test/r/innodb_lock_wait_timeout_1.result b/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result similarity index 100% rename from mysql-test/r/innodb_lock_wait_timeout_1.result rename to mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result similarity index 100% rename from mysql-test/r/innodb_mysql.result rename to mysql-test/suite/innodb/r/innodb_mysql.result diff --git a/mysql-test/r/innodb_mysql_rbk.result b/mysql-test/suite/innodb/r/innodb_mysql_rbk.result similarity index 100% rename from mysql-test/r/innodb_mysql_rbk.result rename to mysql-test/suite/innodb/r/innodb_mysql_rbk.result diff --git a/mysql-test/r/innodb_notembedded.result b/mysql-test/suite/innodb/r/innodb_notembedded.result similarity index 100% rename from mysql-test/r/innodb_notembedded.result rename to mysql-test/suite/innodb/r/innodb_notembedded.result diff --git a/mysql-test/r/innodb_timeout_rollback.result b/mysql-test/suite/innodb/r/innodb_timeout_rollback.result similarity index 100% rename from mysql-test/r/innodb_timeout_rollback.result rename to mysql-test/suite/innodb/r/innodb_timeout_rollback.result diff --git a/mysql-test/t/innodb-autoinc-optimize.test b/mysql-test/suite/innodb/t/innodb-autoinc-optimize.test similarity index 100% rename from mysql-test/t/innodb-autoinc-optimize.test rename to mysql-test/suite/innodb/t/innodb-autoinc-optimize.test diff --git a/mysql-test/t/innodb-ucs2.test b/mysql-test/suite/innodb/t/innodb-ucs2.test similarity index 100% rename from mysql-test/t/innodb-ucs2.test rename to mysql-test/suite/innodb/t/innodb-ucs2.test diff --git a/mysql-test/t/innodb_autoinc_lock_mode_zero-master.opt b/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero-master.opt similarity index 100% rename from mysql-test/t/innodb_autoinc_lock_mode_zero-master.opt rename to mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero-master.opt diff --git a/mysql-test/t/innodb_autoinc_lock_mode_zero.test b/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test similarity index 100% rename from mysql-test/t/innodb_autoinc_lock_mode_zero.test rename to mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test diff --git a/mysql-test/t/innodb_bug30919-master.opt b/mysql-test/suite/innodb/t/innodb_bug30919-master.opt similarity index 100% rename from mysql-test/t/innodb_bug30919-master.opt rename to mysql-test/suite/innodb/t/innodb_bug30919-master.opt diff --git a/mysql-test/t/innodb_bug30919.test b/mysql-test/suite/innodb/t/innodb_bug30919.test similarity index 100% rename from mysql-test/t/innodb_bug30919.test rename to mysql-test/suite/innodb/t/innodb_bug30919.test diff --git a/mysql-test/t/innodb_bug42419.test b/mysql-test/suite/innodb/t/innodb_bug42419.test similarity index 100% rename from mysql-test/t/innodb_bug42419.test rename to mysql-test/suite/innodb/t/innodb_bug42419.test diff --git a/mysql-test/t/innodb_gis.test b/mysql-test/suite/innodb/t/innodb_gis.test similarity index 100% rename from mysql-test/t/innodb_gis.test rename to mysql-test/suite/innodb/t/innodb_gis.test diff --git a/mysql-test/t/innodb_lock_wait_timeout_1-master.opt b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1-master.opt similarity index 100% rename from mysql-test/t/innodb_lock_wait_timeout_1-master.opt rename to mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1-master.opt diff --git a/mysql-test/t/innodb_lock_wait_timeout_1.test b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test similarity index 100% rename from mysql-test/t/innodb_lock_wait_timeout_1.test rename to mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test diff --git a/mysql-test/t/innodb_mysql-master.opt b/mysql-test/suite/innodb/t/innodb_mysql-master.opt similarity index 100% rename from mysql-test/t/innodb_mysql-master.opt rename to mysql-test/suite/innodb/t/innodb_mysql-master.opt diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test similarity index 100% rename from mysql-test/t/innodb_mysql.test rename to mysql-test/suite/innodb/t/innodb_mysql.test diff --git a/mysql-test/t/innodb_mysql_rbk-master.opt b/mysql-test/suite/innodb/t/innodb_mysql_rbk-master.opt similarity index 100% rename from mysql-test/t/innodb_mysql_rbk-master.opt rename to mysql-test/suite/innodb/t/innodb_mysql_rbk-master.opt diff --git a/mysql-test/t/innodb_mysql_rbk.test b/mysql-test/suite/innodb/t/innodb_mysql_rbk.test similarity index 100% rename from mysql-test/t/innodb_mysql_rbk.test rename to mysql-test/suite/innodb/t/innodb_mysql_rbk.test diff --git a/mysql-test/t/innodb_notembedded.test b/mysql-test/suite/innodb/t/innodb_notembedded.test similarity index 100% rename from mysql-test/t/innodb_notembedded.test rename to mysql-test/suite/innodb/t/innodb_notembedded.test diff --git a/mysql-test/t/innodb_timeout_rollback-master.opt b/mysql-test/suite/innodb/t/innodb_timeout_rollback-master.opt similarity index 100% rename from mysql-test/t/innodb_timeout_rollback-master.opt rename to mysql-test/suite/innodb/t/innodb_timeout_rollback-master.opt diff --git a/mysql-test/t/innodb_timeout_rollback.test b/mysql-test/suite/innodb/t/innodb_timeout_rollback.test similarity index 100% rename from mysql-test/t/innodb_timeout_rollback.test rename to mysql-test/suite/innodb/t/innodb_timeout_rollback.test From 745d2141baddb82896b9138f5c93abefff3df86c Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 3 Jun 2010 09:54:37 -0300 Subject: [PATCH 087/121] Don't enable safemalloc for valgrind builds, it's too slow. --- BUILD/SETUP.sh | 2 +- BUILD/build_mccge.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 0bc16f120e5..626f932e045 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -122,7 +122,7 @@ fi # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro # LINT_INIT(), which is only useful for silencing spurious warnings # of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind. -valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify " +valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_configs="--with-valgrind" # diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh index 43ca117fb78..eb37323c570 100755 --- a/BUILD/build_mccge.sh +++ b/BUILD/build_mccge.sh @@ -938,7 +938,7 @@ set_up_ccache() set_valgrind_flags() { if test "x$valgrind_flag" = "xyes" ; then - loc_valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify " + loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" compiler_flags="$compiler_flags $loc_valgrind_flags" with_flags="$with_flags --with-valgrind" From 5f336d9956e558baca964e15aac9135b6d4ad2a4 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Thu, 3 Jun 2010 06:37:01 -0700 Subject: [PATCH 088/121] Remove the unneccesary innobase_strcasecmp() in innobase_get_mysql_key_number_for_index() created as a bug fix for #53592 since dict_table_t could already unique identify the table. --- storage/innobase/handler/ha_innodb.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 86246e62eee..21d30dc4904 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -7610,8 +7610,7 @@ innobase_get_mysql_key_number_for_index( /* If index does not belong to the table of share structure. Search index->table instead */ - if (index->table != ib_table - && innobase_strcasecmp(index->table->name, share->table_name)) { + if (index->table != ib_table) { i = 0; ind = dict_table_get_first_index(index->table); From 1b61dcf434a042abaa5f1455351ea3e149177fd1 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Fri, 4 Jun 2010 00:45:07 +0100 Subject: [PATCH 089/121] BUG#53893: RBR: nullable unique key can lead to out-of-sync slave Post-push fix. There was a valgrind issue on the loop that checks whether there are NULL fields in the UNIQUE KEY or not. In detail, for the last iteration the server may read out of the key_part array boundaries, making valgrind to output warnings. We fix this by correcting the loop, ie, moving the part that reads from the key_part to be inside the loop statement block. This way the assignment is protected by the loop condition. --- sql/log_event.cc | 9 +++------ sql/log_event_old.cc | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index c07bb573188..9c6de5bb42e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -9029,14 +9029,11 @@ int Rows_log_event::find_row(const Relay_log_info *rli) BI image that is null and part of UNNI. */ bool null_found= FALSE; - - for (uint i=0, fieldnr= keyinfo->key_part[i].fieldnr - 1 ; - (i < keyinfo->key_parts) && !null_found ; - i++, fieldnr= keyinfo->key_part[i].fieldnr - 1) + for (uint i=0; i < keyinfo->key_parts && !null_found; i++) { + uint fieldnr= keyinfo->key_part[i].fieldnr - 1; Field **f= table->field+fieldnr; - if ((*f)->is_null()) - null_found= TRUE; + null_found= (*f)->is_null(); } if (!null_found) diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 5f2d55d6477..8376eb6c584 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -2442,14 +2442,11 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) BI image that is null and part of UNNI. */ bool null_found= FALSE; - - for (uint i=0, fieldnr= keyinfo->key_part[i].fieldnr - 1 ; - (i < keyinfo->key_parts) && !null_found ; - i++, fieldnr= keyinfo->key_part[i].fieldnr - 1) + for (uint i=0; i < keyinfo->key_parts && !null_found; i++) { + uint fieldnr= keyinfo->key_part[i].fieldnr - 1; Field **f= table->field+fieldnr; - if ((*f)->is_null()) - null_found= TRUE; + null_found= (*f)->is_null(); } if (!null_found) From 517f586762a5c775f46668fedfa10c3c802e7f18 Mon Sep 17 00:00:00 2001 From: "Horst.Hunger" Date: Fri, 4 Jun 2010 10:53:18 +0200 Subject: [PATCH 090/121] Patch for bug#52913: Inserted check if mysqlhotcopy script is existing as requested by review. DIsabled the test until bug#54129 will befixed. --- mysql-test/include/mysqlhotcopy.inc | 5 +++++ mysql-test/t/disabled.def | 2 ++ 2 files changed, 7 insertions(+) diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc index 585f8c13e74..b3fd5e47179 100644 --- a/mysql-test/include/mysqlhotcopy.inc +++ b/mysql-test/include/mysqlhotcopy.inc @@ -5,6 +5,11 @@ --source include/not_windows.inc --source include/not_embedded.inc +if ($MYSQLHOTCOPY) +{ + die due to missing mysqlhotcopy tool; +} + let $MYSQLD_DATADIR= `SELECT @@datadir`; --disable_warnings DROP DATABASE IF EXISTS hotcopy_test; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 03fb781b34f..cede26f555a 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -12,3 +12,5 @@ kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild. query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings +main.mysqlhotcopy_myisam : bug#54129 2010-06-04 Horst +main.mysqlhotcopy_archive: bug#54129 2010-06-04 Horst From 121e04732ea3b5edf36335f827cc5bcb08fb7665 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 4 Jun 2010 16:21:19 +0300 Subject: [PATCH 091/121] Bug #52315: utc_date() crashes when system time > year 2037 Some of the server implementations don't support dates later than 2038 due to the internal time type being 32 bit. Added checks so that the server will refuse dates that cannot be handled by either throwing an error when setting date at runtime or by refusing to start or shutting down the server if the system date cannot be stored in my_time_t. --- mysql-test/r/variables.result | 8 ++++++++ mysql-test/t/variables.test | 14 ++++++++++++++ sql/mysqld.cc | 8 ++++++++ sql/set_var.cc | 18 +++++++++++++++++- sql/set_var.h | 1 + sql/sql_class.h | 5 +++++ sql/sql_parse.cc | 13 +++++++++++++ 7 files changed, 66 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index e24117187d2..297445a70cb 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -910,3 +910,11 @@ set global thread_cache_size =@my_thread_cache_size; # Test 'myisam_mmap_size' option is not dynamic SET @@myisam_mmap_size= 500M; ERROR HY000: Variable 'myisam_mmap_size' is a read only variable +# +# Bug #52315: utc_date() crashes when system time > year 2037 +# +SET TIMESTAMP=2*1024*1024*1024; +#Should not crash +SELECT UTC_DATE(); +SET TIMESTAMP=DEFAULT; +End of 5.0 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index cff6a5a0767..73e5bbd9d87 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -771,3 +771,17 @@ set global thread_cache_size =@my_thread_cache_size; --echo # Test 'myisam_mmap_size' option is not dynamic --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@myisam_mmap_size= 500M; + +--echo # +--echo # Bug #52315: utc_date() crashes when system time > year 2037 +--echo # + +--error 0, ER_UNKNOWN_ERROR +SET TIMESTAMP=2*1024*1024*1024; +--echo #Should not crash +--disable_result_log +SELECT UTC_DATE(); +--enable_result_log +SET TIMESTAMP=DEFAULT; + +--echo End of 5.0 tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 4b0739cc2d2..bda4e796ce2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2835,6 +2835,14 @@ static int init_common_variables(const char *conf_file_name, int argc, max_system_variables.pseudo_thread_id= (ulong)~0; server_start_time= flush_status_time= time((time_t*) 0); + + /* TODO: remove this when my_time_t is 64 bit compatible */ + if (server_start_time >= (time_t) MY_TIME_T_MAX) + { + sql_print_error("This MySQL server doesn't support dates later then 2038"); + return 1; + } + if (init_thread_environment()) return 1; mysql_init_variables(); diff --git a/sql/set_var.cc b/sql/set_var.cc index 8e032d44a62..16a22f129e6 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2712,10 +2712,26 @@ int set_var_collation_client::update(THD *thd) /****************************************************************************/ +bool sys_var_timestamp::check(THD *thd, set_var *var) +{ + time_t val; + var->save_result.ulonglong_value= var->value->val_int(); + val= (time_t) var->save_result.ulonglong_value; + if (val < (time_t) MY_TIME_T_MIN || val > (time_t) MY_TIME_T_MAX) + { + my_message(ER_UNKNOWN_ERROR, + "This version of MySQL doesn't support dates later than 2038", + MYF(0)); + return TRUE; + } + return FALSE; +} + + bool sys_var_timestamp::update(THD *thd, set_var *var) { thd->set_time((time_t) var->save_result.ulonglong_value); - return 0; + return FALSE; } diff --git a/sql/set_var.h b/sql/set_var.h index 5fb883e8b86..9945c69cac0 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -536,6 +536,7 @@ class sys_var_timestamp :public sys_var { public: sys_var_timestamp(const char *name_arg) :sys_var(name_arg) {} + bool check(THD *thd, set_var *var); bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } diff --git a/sql/sql_class.h b/sql/sql_class.h index ac058bca4f9..c195c8be864 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1707,6 +1707,11 @@ public: inline void end_time() { safe_time(&start_time); } inline void set_time(time_t t) { time_after_lock=start_time=user_time=t; } inline void lock_time() { safe_time(&time_after_lock); } + /*TODO: this will be obsolete when we have support for 64 bit my_time_t */ + inline bool is_valid_time() + { + return (start_time < (time_t) MY_TIME_T_MAX); + } inline void insert_id(ulonglong id_arg) { last_insert_id= id_arg; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 381aa0cf054..d9e1ea9e4e7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1771,6 +1771,19 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->enable_slow_log= TRUE; thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */ thd->set_time(); + if (!thd->is_valid_time()) + { + /* + If the time has got past 2038 we need to shut this server down + We do this by making sure every command is a shutdown and we + have enough privileges to shut the server down + + TODO: remove this when we have full 64 bit my_time_t support + */ + thd->security_ctx->master_access|= SHUTDOWN_ACL; + command= COM_SHUTDOWN; + } + VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query_id= global_query_id; From 9a381264978344ed4f053b9d780761b3607ff5bf Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Fri, 4 Jun 2010 21:58:41 +0400 Subject: [PATCH 092/121] Fix for bug #53912: Fails to build from source NET::skip_big_packet isn't defined for the embedded server, hide it in such a case. sql/sql_connect.cc: Fix for bug #53912: Fails to build from source - hide net.skip_big_packet for the embedded server, as it isn't defined there. --- sql/sql_connect.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 2039c7f7449..28c1acc4716 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -471,6 +471,7 @@ check_user(THD *thd, enum enum_server_command command, } my_ok(thd); thd->password= test(passwd_len); // remember for error messages +#ifndef EMBEDDED_LIBRARY /* Allow the network layer to skip big packets. Although a malicious authenticated session might use this to trick the server to read @@ -478,6 +479,7 @@ check_user(THD *thd, enum enum_server_command command, that needs to be preserved as to not break backwards compatibility. */ thd->net.skip_big_packet= TRUE; +#endif /* Ready to handle queries */ DBUG_RETURN(0); } From df088b8de24b4cac58fa2b9eed2cafeb9d5abfd6 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 7 Jun 2010 12:49:52 +0300 Subject: [PATCH 093/121] Addendum to the fix for bug #52315: need to set a proper shutdown type when an out-of-supported-range date is detected. --- sql/sql_parse.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d9e1ea9e4e7..b730e2585ae 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2243,8 +2243,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd, SHUTDOWN_DEFAULT is 0. If client is >= 4.1.3, the shutdown level is in packet[0]. */ - enum mysql_enum_shutdown_level level= - (enum mysql_enum_shutdown_level) (uchar) packet[0]; + enum mysql_enum_shutdown_level level; + if (!thd->is_valid_time()) + level= SHUTDOWN_DEFAULT; + else + level= (enum mysql_enum_shutdown_level) (uchar) packet[0]; + DBUG_PRINT("quit",("Got shutdown command for level %u", level)); if (level == SHUTDOWN_DEFAULT) level= SHUTDOWN_WAIT_ALL_BUFFERS; // soon default will be configurable From a961688d2e443d2c1a72c62edfaa9d6e111e3f51 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Jun 2010 10:27:34 +0800 Subject: [PATCH 094/121] Postfix for bug49741 --- .../extra/rpl_tests/rpl_insert_delayed.test | 20 +++++++++++++++++-- .../suite/rpl/r/rpl_stm_insert_delayed.result | 8 ++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index f64e359b672..7fd3451184a 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -101,6 +101,8 @@ if (`SELECT @@global.binlog_format = 'STATEMENT'`) } CREATE TABLE t1(a int, UNIQUE(a)); +--let $_start= query_get_value(SHOW MASTER STATUS, Position, 1) + INSERT DELAYED IGNORE INTO t1 VALUES(1); INSERT DELAYED IGNORE INTO t1 VALUES(1); flush table t1; # to wait for INSERT DELAYED to be done @@ -108,8 +110,22 @@ if (`SELECT @@global.binlog_format = 'STATEMENT'`) { #must show two INSERT DELAYED --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) - --let $binlog_limit= 1,4 - --source include/show_binlog_events.inc + + # The first INSERT DELAYED + --let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 2) + --echo $stmt + +# The second INSERT DELAYED statement is the 3 item if two INSERT DELAYED are +# handled together + --let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 3) + +# The second INSERT DELAYED statement is the 5 item if two INSERT DELAYED are +# handled separately + if (`SELECT '$stmt' = 'COMMIT'`) + { + --let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 5) + } + --echo $stmt } select * from t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result index 7906d395f42..6b0c1c38c16 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result +++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result @@ -51,12 +51,8 @@ CREATE TABLE t1(a int, UNIQUE(a)); INSERT DELAYED IGNORE INTO t1 VALUES(1); INSERT DELAYED IGNORE INTO t1 VALUES(1); flush table t1; -show binlog events in 'master-bin.000002' from limit 1,4; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query # # BEGIN -master-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -master-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -master-bin.000002 # Query # # COMMIT +use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) select * from t1; a 1 From 66c621ba3ba8c7c179a8328b06565bdd40296aa5 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 8 Jun 2010 10:22:40 +0400 Subject: [PATCH 095/121] Bug#53933 crash when using uncacheable subquery in the having clause of outer query The problem is in the Item_func_isnull::update_used_tables() function, bracket is at the wrong place. Because of that isnull item erroneously is treated as const item. The fix is to set brackets in the right place. mysql-test/r/func_isnull.result: test case mysql-test/t/func_isnull.test: test case sql/item_cmpfunc.h: set brackets in the right place. --- mysql-test/r/func_isnull.result | 14 ++++++++++++++ mysql-test/t/func_isnull.test | 15 +++++++++++++++ sql/item_cmpfunc.h | 4 ++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_isnull.result b/mysql-test/r/func_isnull.result index 20ddc87ee78..c1f5849c091 100644 --- a/mysql-test/r/func_isnull.result +++ b/mysql-test/r/func_isnull.result @@ -5,3 +5,17 @@ flush tables; select * from t1 where isnull(to_days(mydate)); id mydate drop table t1; +# +# Bug#53933 crash when using uncacheable subquery in the having clause of outer query +# +CREATE TABLE t1 (f1 INT); +INSERT INTO t1 VALUES (0),(0); +SELECT ISNULL((SELECT GET_LOCK('Bug#53933', 0) FROM t1 GROUP BY f1)) AS f2 +FROM t1 GROUP BY f1 HAVING f2 = f2; +f2 +0 +SELECT RELEASE_LOCK('Bug#53933'); +RELEASE_LOCK('Bug#53933') +1 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/t/func_isnull.test b/mysql-test/t/func_isnull.test index 6218efb882f..d3ad4614998 100644 --- a/mysql-test/t/func_isnull.test +++ b/mysql-test/t/func_isnull.test @@ -13,3 +13,18 @@ select * from t1 where isnull(to_days(mydate)); drop table t1; # End of 4.1 tests + +--echo # +--echo # Bug#53933 crash when using uncacheable subquery in the having clause of outer query +--echo # + +CREATE TABLE t1 (f1 INT); +INSERT INTO t1 VALUES (0),(0); + +SELECT ISNULL((SELECT GET_LOCK('Bug#53933', 0) FROM t1 GROUP BY f1)) AS f2 +FROM t1 GROUP BY f1 HAVING f2 = f2; +SELECT RELEASE_LOCK('Bug#53933'); + +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 89bc6f9570b..233922fe2f8 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1209,8 +1209,8 @@ public: else { args[0]->update_used_tables(); - if ((const_item_cache= !(used_tables_cache= args[0]->used_tables())) && - !with_subselect) + if ((const_item_cache= !(used_tables_cache= args[0]->used_tables()) && + !with_subselect)) { /* Remember if the value is always NULL or never NULL */ cached_value= (longlong) args[0]->is_null(); From cf2e7c770cbf5405b65fb4e73b76bd3592c3234f Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Tue, 8 Jun 2010 10:58:19 +0200 Subject: [PATCH 096/121] Bug#53191 Lock_time in slow log is negative when logging stored routines Logging slow stored procedures caused the slow log to write very large lock times. The lock times was a result of a negative number being cast to an unsigned integer. The reason the lock time appeard negative was because one of the measurements points was reset after execution causing it to change order with the start time of the statement. This bug is related to bug 47905 which in turn was introduced because of a joint fix for 12480,12481,12482 and 11587. The fix is to only reset the start_time before any statement execution in a SP while not resetting start_utime or utime_after_lock which are used for measuring the performance of the SP. Start_time is used to set the timestamp on the replication event which controlls how the slave interprets time functions like NOW(). --- .../sys_vars/r/slow_query_log_func.result | 73 ++++++++++++++++ .../suite/sys_vars/t/slow_query_log_func.test | 87 ++++++++++++++++++- sql/sp_head.cc | 45 ++++++++-- 3 files changed, 196 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_func.result b/mysql-test/suite/sys_vars/r/slow_query_log_func.result index eb7efe4a004..fb650399597 100644 --- a/mysql-test/suite/sys_vars/r/slow_query_log_func.result +++ b/mysql-test/suite/sys_vars/r/slow_query_log_func.result @@ -36,5 +36,78 @@ SELECT count(*) > 0 FROM mysql.slow_log; count(*) > 0 1 DROP PROCEDURE p_test; +Bug53191 Lock_time in slow log is negative when logging stored routines +TRUNCATE mysql.slow_log; +CREATE TABLE t1 (c0 INT PRIMARY KEY AUTO_INCREMENT, c1 TIMESTAMP, c2 TIMESTAMP); +CREATE FUNCTION f_slow_now() RETURNS TIMESTAMP +BEGIN +DO SLEEP(2); +RETURN NOW(); +END// +CREATE FUNCTION f_slow_current_time() RETURNS TIME +BEGIN +DO SLEEP(2); +RETURN CURRENT_TIME(); +END +// +INSERT INTO t1 (c1,c2) VALUES (now(), f_slow_now())// +CREATE TRIGGER tf_before BEFORE INSERT ON t1 +FOR EACH ROW BEGIN +SET new.c2 = f_slow_now(); +END// +CREATE PROCEDURE p1() +BEGIN +INSERT INTO t1 (c1,c2) values (now(),now()); +DO SLEEP(2); +INSERT INTO t1 (c1,c2) values (now(),now()); +end// +INSERT INTO t1 (c1,c2) VALUES (now(), now()); +CALL p1(); +SELECT c1-c2 FROM t1; +c1-c2 +0 +0 +0 +0 +*** There shouldn't less than 1 s difference between each row +SELECT t1.c1-self.c1 > 1 FROM t1, t1 as self WHERE t1.c0=self.c0+1 ORDER BY t1.c0; +t1.c1-self.c1 > 1 +1 +1 +1 +DROP TRIGGER tf_before; +DROP FUNCTION f_slow_now; +DROP FUNCTION f_slow_current_time; +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1(c1 INT) ENGINE=MyISAM; +DROP PROCEDURE IF EXISTS p1; +CREATE PROCEDURE p1() +BEGIN +INSERT INTO t1 VALUES (1); +SELECT COUNT(*) FROM t1 WHERE c1= 1; +UPDATE t1 SET c1=c1*2; +END| +Connection 2 +LOCK TABLE t1 WRITE; +Back to default connection +CALL p1(); +Wait three seconds and unlock the table +UNLOCK TABLES; +COUNT(*) +1 +Slow log: +**** 1 == we have slow log entries +SELECT count(*) > 0 FROM mysql.slow_log; +count(*) > 0 +1 +**** 0 == None of the entries have a lock time greater than 10 s +SELECT count(*) FROM mysql.slow_log WHERE lock_time > 10; +count(*) +0 +DROP TABLE t1; +DROP PROCEDURE p1; SET @@global.log_output = @global_log_output; SET @global.slow_query_log = @global_slow_query_log; diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_func.test b/mysql-test/suite/sys_vars/t/slow_query_log_func.test index 250d5210c46..dd202ec20ff 100644 --- a/mysql-test/suite/sys_vars/t/slow_query_log_func.test +++ b/mysql-test/suite/sys_vars/t/slow_query_log_func.test @@ -51,8 +51,93 @@ CALL p_test(); SELECT count(*) > 0 FROM mysql.slow_log; DROP PROCEDURE p_test; +#============================================================================== +--echo Bug53191 Lock_time in slow log is negative when logging stored routines +#============================================================================== +TRUNCATE mysql.slow_log; +connect (con2,localhost,root,,); +connection default; -#restore +CREATE TABLE t1 (c0 INT PRIMARY KEY AUTO_INCREMENT, c1 TIMESTAMP, c2 TIMESTAMP); +delimiter //; +CREATE FUNCTION f_slow_now() RETURNS TIMESTAMP +BEGIN + DO SLEEP(2); + RETURN NOW(); +END// + +CREATE FUNCTION f_slow_current_time() RETURNS TIME +BEGIN + DO SLEEP(2); + RETURN CURRENT_TIME(); +END +// + +INSERT INTO t1 (c1,c2) VALUES (now(), f_slow_now())// + +CREATE TRIGGER tf_before BEFORE INSERT ON t1 +FOR EACH ROW BEGIN + SET new.c2 = f_slow_now(); +END// + +CREATE PROCEDURE p1() +BEGIN + INSERT INTO t1 (c1,c2) values (now(),now()); + DO SLEEP(2); + INSERT INTO t1 (c1,c2) values (now(),now()); +end// + +delimiter ;// + +INSERT INTO t1 (c1,c2) VALUES (now(), now()); +CALL p1(); + +SELECT c1-c2 FROM t1; +--echo *** There shouldn't less than 1 s difference between each row +SELECT t1.c1-self.c1 > 1 FROM t1, t1 as self WHERE t1.c0=self.c0+1 ORDER BY t1.c0; + +DROP TRIGGER tf_before; +DROP FUNCTION f_slow_now; +DROP FUNCTION f_slow_current_time; +DROP TABLE t1; + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(c1 INT) ENGINE=MyISAM; +DROP PROCEDURE IF EXISTS p1; +delimiter |; +CREATE PROCEDURE p1() +BEGIN + INSERT INTO t1 VALUES (1); + SELECT COUNT(*) FROM t1 WHERE c1= 1; + UPDATE t1 SET c1=c1*2; +END| +delimiter ;| + +--echo Connection 2 +connection con2; +LOCK TABLE t1 WRITE; + +--echo Back to default connection +connection default; +send CALL p1(); + +--echo Wait three seconds and unlock the table +connection con2; +sleep 3; +UNLOCK TABLES; +connection default; +reap; +--echo Slow log: +--echo **** 1 == we have slow log entries +SELECT count(*) > 0 FROM mysql.slow_log; +--echo **** 0 == None of the entries have a lock time greater than 10 s +SELECT count(*) FROM mysql.slow_log WHERE lock_time > 10; +disconnect con2; +DROP TABLE t1; +DROP PROCEDURE p1; + + +#================================================================== Restore SET @@global.log_output = @global_log_output; SET @global.slow_query_log = @global_slow_query_log; diff --git a/sql/sp_head.cc b/sql/sp_head.cc index cadda38053c..66d5eff5112 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -34,6 +34,36 @@ extern "C" uchar *sp_table_key(const uchar *ptr, size_t *plen, my_bool first); +/** + Helper function which operates on a THD object to set the query start_time to + the current time. + + @param[in, out] thd The session object + +*/ + +static void reset_start_time_for_sp(THD *thd) +{ + /* + Do nothing if the context is a trigger or function because time should be + constant during the execution of those. + */ + if (!thd->in_sub_stmt) + { + /* + First investigate if there is a cached time stamp + */ + if (thd->user_time) + { + thd->start_time= thd->user_time; + } + else + { + my_micro_time_and_time(&thd->start_time); + } + } +} + Item_result sp_map_result_type(enum enum_field_types type) { @@ -1225,10 +1255,13 @@ sp_head::execute(THD *thd) DBUG_PRINT("execute", ("Instruction %u", ip)); - /* Don't change NOW() in FUNCTION or TRIGGER */ - if (!thd->in_sub_stmt) - thd->set_time(); // Make current_time() et al work - + /* + We need to reset start_time to allow for time to flow inside a stored + procedure. This is only done for SP since time is suppose to be constant + during execution of triggers and functions. + */ + reset_start_time_for_sp(thd); + /* We have to set thd->stmt_arena before executing the instruction to store in the instruction free_list all new items, created @@ -1840,8 +1873,6 @@ sp_head::execute_procedure(THD *thd, List *args) { bool err_status= FALSE; uint params = m_pcont->context_var_count(); - /* Query start time may be reset in a multi-stmt SP; keep this for later. */ - ulonglong utime_before_sp_exec= thd->utime_after_lock; sp_rcontext *save_spcont, *octx; sp_rcontext *nctx = NULL; bool save_enable_slow_log= false; @@ -2034,8 +2065,6 @@ sp_head::execute_procedure(THD *thd, List *args) delete nctx; thd->spcont= save_spcont; - thd->utime_after_lock= utime_before_sp_exec; - DBUG_RETURN(err_status); } From 419e3853abe38c6f85220e7676fd9fcde29bbc72 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 8 Jun 2010 13:17:46 +0300 Subject: [PATCH 097/121] Addendum to merge of Bug#52315 to mysql-trunk-merge : Fixed the failing sys_vars.timestamp_basic.test by not re-calculating the value of the system variable at check time. --- sql/sys_vars.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 0a692089798..856f4c6f771 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2388,7 +2388,6 @@ static bool check_timestamp(sys_var *self, THD *thd, set_var *var) if (!var->value) return FALSE; - var->save_result.ulonglong_value= var->value->val_int(); val= (time_t) var->save_result.ulonglong_value; if (val < (time_t) MY_TIME_T_MIN || val > (time_t) MY_TIME_T_MAX) { From d264c3afbccaf1a4ffd0e08ab30df29f96784f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 8 Jun 2010 14:47:34 +0300 Subject: [PATCH 098/121] =?UTF-8?q?Merge=20a=20change=20from=20mysql-5.1-i?= =?UTF-8?q?nnodb:=20------------------------------------------------------?= =?UTF-8?q?------=20revno:=203502=20revision-id:=20marko.makela@oracle.com?= =?UTF-8?q?-20100608114055-7b04ytuqz0lde6v1=20parent:=20jimmy.yang@oracle.?= =?UTF-8?q?com-20100603134448-itzduhwgbw0b8nlh=20committer:=20Marko=20M?= =?UTF-8?q?=C3=A4kel=C3=A4=20=20branch=20nick:=20?= =?UTF-8?q?5.1-innodb=20timestamp:=20Tue=202010-06-08=2014:40:55=20+0300?= =?UTF-8?q?=20message:=20=20=20buf=5Fpage=5Fget=5Fgen():=20Pass=20file,lin?= =?UTF-8?q?e=20to=20rw=5Flock=5Fx=5Flock().?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- storage/innobase/buf/buf0buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index ae228732270..4b6b0a82486 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -2957,7 +2957,7 @@ wait_until_unfixed: block->page.buf_fix_count = 1; buf_block_set_io_fix(block, BUF_IO_READ); - rw_lock_x_lock(&block->lock); + rw_lock_x_lock_func(&block->lock, 0, file, line); UNIV_MEM_INVALID(bpage, sizeof *bpage); From a9c223cf05356e057fcc7c394d4938ab680f5543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 8 Jun 2010 15:26:45 +0300 Subject: [PATCH 099/121] =?UTF-8?q?Merge=20a=20change=20from=20mysql-5.1-i?= =?UTF-8?q?nnodb:=20------------------------------------------------------?= =?UTF-8?q?------=20revno:=203503=20revision-id:=20marko.makela@oracle.com?= =?UTF-8?q?-20100608121041-l7t9r6lrpx6lh361=20parent:=20marko.makela@oracl?= =?UTF-8?q?e.com-20100608114055-7b04ytuqz0lde6v1=20committer:=20Marko=20M?= =?UTF-8?q?=C3=A4kel=C3=A4=20=20branch=20nick:=20?= =?UTF-8?q?5.1-innodb=20timestamp:=20Tue=202010-06-08=2015:10:41=20+0300?= =?UTF-8?q?=20message:=20=20=20Bug#54009:=20Server=20crashes=20when=20data?= =?UTF-8?q?=20is=20selected=20from=20non=20backed=20up=20table=20=20=20for?= =?UTF-8?q?=20InnoDB=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dict_load_table(): Pass the correct tablespace flags to fil_open_single_table_tablespace(). For ROW_FORMAT=COMPACT and REDUNDANT, the tablespace flags are 0. The table flags would be 0 or DICT_TF_COMPACT. --- storage/innobase/dict/dict0load.c | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c index b061fe696c1..6bf2c1d9d81 100644 --- a/storage/innobase/dict/dict0load.c +++ b/storage/innobase/dict/dict0load.c @@ -1694,6 +1694,7 @@ err_exit: /* Try to open the tablespace */ if (!fil_open_single_table_tablespace( TRUE, table->space, + table->flags == DICT_TF_COMPACT ? 0 : table->flags & ~(~0 << DICT_TF_BITS), name)) { /* We failed to find a sensible tablespace file */ From e3d9ac526209ef00277e527e8476527d0e27e367 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 8 Jun 2010 10:36:47 -0300 Subject: [PATCH 100/121] Bug#34236: Various possibly related SSL crashes The problem was that the bundled yaSSL library was being built without thread safety support regardless of the thread safeness of the compoments linked with it. The solution is to enable yaSSL thread safety support if any component (server or client) is to be built with thread support. Also, generate new certificates for yaSSL's test suite. config/ac-macros/yassl.m4: Enable yaSSL thread safety if linking with the server or a thread safe client library. Avoids building a thread safe yaSSL when only building a non-thread safe client library. extra/yassl/CMakeLists.txt: Always enable for Windows builds. extra/yassl/certs/ca-cert.pem: New certificate, previous one expired. extra/yassl/certs/client-cert.der: New certificate, previous one expired. extra/yassl/certs/client-cert.pem: New certificate, previous one expired. extra/yassl/certs/dsa-cert.pem: New certificate, previous one expired. extra/yassl/certs/server-cert.pem: New certificate, previous one expired. extra/yassl/include/lock.hpp: Rename MULTI_THREAD to YASSL_THREAD_SAFE. extra/yassl/src/Makefile.am: Use CXXFLAGS to set thread related definitions as the lock header (lock.hpp) has no local dependencies. extra/yassl/src/lock.cpp: Rename MULTI_THREAD to YASSL_THREAD_SAFE. extra/yassl/taocrypt/CMakeLists.txt: Always enable for Windows builds. extra/yassl/taocrypt/benchmark/Makefile.am: Pass thread related CXXFLAGS. extra/yassl/taocrypt/src/Makefile.am: Pass thread related CXXFLAGS. extra/yassl/taocrypt/test/Makefile.am: Pass thread related CXXFLAGS. extra/yassl/taocrypt/test/memory.cpp: Rename MULTI_THREAD to YASSL_THREAD_SAFE. extra/yassl/testsuite/Makefile.am: Pass thread related CXXFLAGS. --- config/ac-macros/yassl.m4 | 6 +++ extra/yassl/CMakeLists.txt | 2 +- extra/yassl/certs/ca-cert.pem | 42 ++++++++++----------- extra/yassl/certs/client-cert.der | Bin 699 -> 699 bytes extra/yassl/certs/client-cert.pem | 18 ++++----- extra/yassl/certs/dsa-cert.pem | 18 ++++----- extra/yassl/certs/server-cert.pem | 20 +++++----- extra/yassl/include/lock.hpp | 6 +-- extra/yassl/src/Makefile.am | 2 +- extra/yassl/src/lock.cpp | 4 +- extra/yassl/taocrypt/CMakeLists.txt | 2 + extra/yassl/taocrypt/benchmark/Makefile.am | 2 +- extra/yassl/taocrypt/src/Makefile.am | 3 +- extra/yassl/taocrypt/test/Makefile.am | 2 +- extra/yassl/taocrypt/test/memory.cpp | 2 +- extra/yassl/testsuite/Makefile.am | 2 +- 16 files changed, 70 insertions(+), 61 deletions(-) diff --git a/config/ac-macros/yassl.m4 b/config/ac-macros/yassl.m4 index 967dcbf764a..f9bd2b06098 100644 --- a/config/ac-macros/yassl.m4 +++ b/config/ac-macros/yassl.m4 @@ -32,6 +32,12 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [ ;; esac AC_SUBST([yassl_taocrypt_extra_cxxflags]) + # Thread safe check + yassl_thread_cxxflags="" + if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"; then + yassl_thread_cxxflags="-DYASSL_THREAD_SAFE" + fi + AC_SUBST([yassl_thread_cxxflags]) # Link extra/yassl/include/openssl subdir to include/ yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl" AC_SUBST(yassl_h_ln_cmd) diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt index 26e682cbb0c..981f679f785 100755 --- a/extra/yassl/CMakeLists.txt +++ b/extra/yassl/CMakeLists.txt @@ -17,7 +17,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/include ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL) -ADD_DEFINITIONS("-D_LIB -DYASSL_PREFIX") +ADD_DEFINITIONS("-D_LIB -DYASSL_PREFIX -DYASSL_THREAD_SAFE") SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp diff --git a/extra/yassl/certs/ca-cert.pem b/extra/yassl/certs/ca-cert.pem index 981dd004fc6..e353d118712 100644 --- a/extra/yassl/certs/ca-cert.pem +++ b/extra/yassl/certs/ca-cert.pem @@ -5,49 +5,49 @@ Certificate: Signature Algorithm: md5WithRSAEncryption Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com Validity - Not Before: Jan 18 20:12:32 2005 GMT - Not After : Oct 15 20:12:32 2007 GMT + Not Before: Mar 7 03:10:11 2005 GMT + Not After : Apr 1 03:10:11 2046 GMT Subject: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (512 bit) Modulus (512 bit): - 00:cf:2b:14:00:b0:3c:df:6f:9e:91:40:ec:c8:f6: - 90:b2:5b:b4:70:80:a5:a4:0a:73:c7:44:f3:2a:26: - c4:2f:f1:3a:f1:c3:c4:ac:fc:c3:d2:c3:bf:f5:d7: - 6a:38:42:ad:22:ab:c8:c4:4b:4c:1d:16:af:05:34: - 7d:79:97:5e:e1 + 00:ef:c1:e3:9a:3c:6e:6e:cb:26:6f:05:be:e0:cb: + 57:a0:4b:68:e6:1b:f9:95:db:01:92:aa:6e:a6:b5: + 2d:b1:2b:50:fd:db:13:f2:c5:d8:b8:4f:75:28:53: + 72:e8:e5:11:9d:bb:c3:4f:4f:09:fd:4c:e7:46:d5: + 1d:bb:35:02:af Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - CB:0F:1F:E9:A2:76:71:C9:E6:E8:23:A6:C1:18:B7:CC:44:CF:B9:84 + 1D:EF:A1:B8:81:78:12:47:E8:57:06:08:74:18:F7:D3:AA:D8:F7:BD X509v3 Authority Key Identifier: - keyid:CB:0F:1F:E9:A2:76:71:C9:E6:E8:23:A6:C1:18:B7:CC:44:CF:B9:84 + keyid:1D:EF:A1:B8:81:78:12:47:E8:57:06:08:74:18:F7:D3:AA:D8:F7:BD DirName:/C=US/ST=Oregon/L=Portland/O=sawtooth/CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com serial:00 X509v3 Basic Constraints: CA:TRUE Signature Algorithm: md5WithRSAEncryption - 27:f7:3d:fb:39:6f:73:a4:86:f3:a0:48:22:60:84:e9:5c:3d: - 28:36:05:16:44:98:07:87:e1:5d:b5:f3:a7:bc:33:5f:f4:29: - a9:5f:87:33:df:e6:8e:bd:e2:f3:0a:c8:00:69:ae:3d:41:47: - 03:ea:0b:4c:67:45:4b:ab:f3:39 + d9:77:e3:07:d9:2e:ec:2f:9b:8e:9e:ca:b4:00:0b:ef:c7:74: + cb:f4:f6:44:2f:02:75:17:a5:74:3e:26:b2:26:fd:1f:ab:3a: + df:d5:e3:05:14:08:d0:8c:1d:c9:3e:e1:59:6f:b3:38:5d:af: + 78:60:e3:c5:6a:69:96:80:7d:00 -----BEGIN CERTIFICATE----- MIIC7zCCApmgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBiTELMAkGA1UEBhMCVVMx DzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxETAPBgNVBAoTCHNh d3Rvb3RoMSQwIgYDVQQDExt3d3cuc2F3dG9vdGgtY29uc3VsdGluZy5jb20xHTAb -BgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTA1MDExODIwMTIzMloXDTA3 -MTAxNTIwMTIzMlowgYkxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAP +BgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTA1MDMwNzAzMTAxMVoXDTQ2 +MDQwMTAzMTAxMVowgYkxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAP BgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290aDEkMCIGA1UEAxMbd3d3 LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlh -c3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDPKxQAsDzfb56RQOzI9pCy -W7RwgKWkCnPHRPMqJsQv8Trxw8Ss/MPSw7/112o4Qq0iq8jES0wdFq8FNH15l17h -AgMBAAGjgekwgeYwHQYDVR0OBBYEFMsPH+midnHJ5ugjpsEYt8xEz7mEMIG2BgNV -HSMEga4wgauAFMsPH+midnHJ5ugjpsEYt8xEz7mEoYGPpIGMMIGJMQswCQYDVQQG +c3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDvweOaPG5uyyZvBb7gy1eg +S2jmG/mV2wGSqm6mtS2xK1D92xPyxdi4T3UoU3Lo5RGdu8NPTwn9TOdG1R27NQKv +AgMBAAGjgekwgeYwHQYDVR0OBBYEFB3vobiBeBJH6FcGCHQY99Oq2Pe9MIG2BgNV +HSMEga4wgauAFB3vobiBeBJH6FcGCHQY99Oq2Pe9oYGPpIGMMIGJMQswCQYDVQQG EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDERMA8GA1UE ChMIc2F3dG9vdGgxJDAiBgNVBAMTG3d3dy5zYXd0b290aC1jb25zdWx0aW5nLmNv bTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb22CAQAwDAYDVR0TBAUwAwEB -/zANBgkqhkiG9w0BAQQFAANBACf3Pfs5b3OkhvOgSCJghOlcPSg2BRZEmAeH4V21 -86e8M1/0KalfhzPf5o694vMKyABprj1BRwPqC0xnRUur8zk= +/zANBgkqhkiG9w0BAQQFAANBANl34wfZLuwvm46eyrQAC+/HdMv09kQvAnUXpXQ+ +JrIm/R+rOt/V4wUUCNCMHck+4Vlvszhdr3hg48VqaZaAfQA= -----END CERTIFICATE----- diff --git a/extra/yassl/certs/client-cert.der b/extra/yassl/certs/client-cert.der index b28e2753376659d0034cdf6313c0c61d8c2033d3..c2a75119e54275743b5dc77e1812756668f4a72d 100644 GIT binary patch delta 105 zcmdnZx|?;v0!d>7a|2@o17pJ|ab6QM0}}&7D0iZK^=1=BcSeUu$#v3xsq;>K++q9w zc${dP!1NwFC8O1TrOOMNKmFEU|4&WhrT>+ao;CS_bz1)yM60^$rQPJ6H09}zgk$Ma GpP2z^N-1*y delta 105 zcmdnZx|?;v0!c$d3qwm|V?)y@ab5#+LjyxoD0iZK^=1=BcSeV!O=>*yiHsr}&PmKn znaKC?#{|2@eETeFrte}ssdeXWlCDr9KMzzP~Us`QE>g!&bO(nT_bgRw2{8 Gigo}P`6jsl diff --git a/extra/yassl/certs/client-cert.pem b/extra/yassl/certs/client-cert.pem index 81110f17252..4d2bbff7ca5 100644 --- a/extra/yassl/certs/client-cert.pem +++ b/extra/yassl/certs/client-cert.pem @@ -5,8 +5,8 @@ Certificate: Signature Algorithm: md5WithRSAEncryption Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info@yassl.com Validity - Not Before: Jan 18 19:33:15 2005 GMT - Not After : Oct 15 19:33:15 2007 GMT + Not Before: Mar 7 03:00:31 2005 GMT + Not After : Apr 1 03:00:31 2046 GMT Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info@yassl.com Subject Public Key Info: Public Key Algorithm: rsaEncryption @@ -29,15 +29,15 @@ Certificate: X509v3 Basic Constraints: CA:TRUE Signature Algorithm: md5WithRSAEncryption - c5:82:26:0c:1f:61:01:14:b0:ce:18:99:64:91:0e:f1:f8:90: - 3e:a3:0e:be:38:7c:97:ba:05:c9:2a:dc:dd:62:2d:12:61:79: - 7a:86:b1:97:5d:1e:e8:f7:e8:32:34:f7:8f:b1:08:3d:13:71: - a6:3c:15:91:85:12:35:6e:78:87 + 59:19:ae:1b:4e:65:9e:ca:f1:b8:3d:ff:c7:5e:15:86:10:97: + 8c:3e:22:32:ab:4e:75:a7:70:83:f2:fb:2f:af:fe:26:28:e9: + 4f:d4:c9:49:7c:6f:51:7e:2a:ff:a0:5b:25:45:2e:66:d9:0d: + 92:94:e5:b8:60:c6:67:1a:f3:03 -----BEGIN CERTIFICATE----- MIICtzCCAmGgAwIBAgIBADANBgkqhkiG9w0BAQQFADB4MQswCQYDVQQGEwJVUzEP MA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwGA1UEChMFeWFT U0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9A -eWFzc2wuY29tMB4XDTA1MDExODE5MzMxNVoXDTA3MTAxNTE5MzMxNVoweDELMAkG +eWFzc2wuY29tMB4XDTA1MDMwNzAzMDAzMVoXDTQ2MDQwMTAzMDAzMVoweDELMAkG A1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAM BgNVBAoTBXlhU1NMMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN AQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDNH3hH @@ -47,6 +47,6 @@ wP/OtbStMIGiBgNVHSMEgZowgZeAFK4lXvpNo1srh97xKvVCwP/OtbStoXykejB4 MQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFu ZDEOMAwGA1UEChMFeWFTU0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkq hkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZI -hvcNAQEEBQADQQDFgiYMH2EBFLDOGJlkkQ7x+JA+ow6+OHyXugXJKtzdYi0SYXl6 -hrGXXR7o9+gyNPePsQg9E3GmPBWRhRI1bniH +hvcNAQEEBQADQQBZGa4bTmWeyvG4Pf/HXhWGEJeMPiIyq051p3CD8vsvr/4mKOlP +1MlJfG9Rfir/oFslRS5m2Q2SlOW4YMZnGvMD -----END CERTIFICATE----- diff --git a/extra/yassl/certs/dsa-cert.pem b/extra/yassl/certs/dsa-cert.pem index ecca18dae82..788d263bb9f 100644 --- a/extra/yassl/certs/dsa-cert.pem +++ b/extra/yassl/certs/dsa-cert.pem @@ -5,8 +5,8 @@ Certificate: Signature Algorithm: dsaWithSHA1 Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info@yassl.com Validity - Not Before: Jan 23 22:54:51 2005 GMT - Not After : Oct 20 22:54:51 2007 GMT + Not Before: Mar 7 03:22:00 2005 GMT + Not After : Apr 1 03:22:00 2046 GMT Subject: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info@yassl.com Subject Public Key Info: Public Key Algorithm: dsaEncryption @@ -43,14 +43,14 @@ Certificate: X509v3 Basic Constraints: CA:TRUE Signature Algorithm: dsaWithSHA1 - 30:2b:02:14:74:46:9f:91:7b:24:17:3b:ee:0f:10:e3:76:62: - f4:dc:81:e6:fd:fe:02:13:08:f4:87:0a:ab:ba:9c:de:3a:69: - 72:59:b8:ec:e9:57:f4:bf:37 + 30:2c:02:14:7e:5e:94:fc:7f:ca:81:ab:b3:32:f7:21:83:48: + 48:5f:0a:f1:13:ca:02:14:73:54:32:14:51:22:bf:0b:ec:d7: + 6a:6a:fa:a7:1d:46:b4:c2:a3:b5 -----BEGIN CERTIFICATE----- -MIIDMTCCAvKgAwIBAgIBADAJBgcqhkjOOAQDMHgxCzAJBgNVBAYTAlVTMQ8wDQYD +MIIDMjCCAvKgAwIBAgIBADAJBgcqhkjOOAQDMHgxCzAJBgNVBAYTAlVTMQ8wDQYD VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMRIwEAYDVQQKEwl5YVNTTCBE U0ExEjAQBgNVBAMTCXlhU1NMIERTQTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNz -bC5jb20wHhcNMDUwMTIzMjI1NDUxWhcNMDcxMDIwMjI1NDUxWjB4MQswCQYDVQQG +bC5jb20wHhcNMDUwMzA3MDMyMjAwWhcNNDYwNDAxMDMyMjAwWjB4MQswCQYDVQQG EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDESMBAGA1UE ChMJeWFTU0wgRFNBMRIwEAYDVQQDEwl5YVNTTCBEU0ExHTAbBgkqhkiG9w0BCQEW DmluZm9AeWFzc2wuY29tMIHwMIGoBgcqhkjOOAQBMIGcAkEAmSlpgMk8mGhFqYL+ @@ -63,6 +63,6 @@ IeRhRHPp4jCBogYDVR0jBIGaMIGXgBS++Yxd1hy07oHdNlYKIeRhRHPp4qF8pHow eDELMAkGA1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxh bmQxEjAQBgNVBAoTCXlhU1NMIERTQTESMBAGA1UEAxMJeWFTU0wgRFNBMR0wGwYJ KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbYIBADAMBgNVHRMEBTADAQH/MAkGByqG -SM44BAMDLgAwKwIUdEafkXskFzvuDxDjdmL03IHm/f4CEwj0hwqrupzeOmlyWbjs -6Vf0vzc= +SM44BAMDLwAwLAIUfl6U/H/KgauzMvchg0hIXwrxE8oCFHNUMhRRIr8L7Ndqavqn +HUa0wqO1 -----END CERTIFICATE----- diff --git a/extra/yassl/certs/server-cert.pem b/extra/yassl/certs/server-cert.pem index 403dabdf5fa..30608f5f65b 100644 --- a/extra/yassl/certs/server-cert.pem +++ b/extra/yassl/certs/server-cert.pem @@ -5,8 +5,8 @@ Certificate: Signature Algorithm: md5WithRSAEncryption Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com Validity - Not Before: Jan 18 20:50:59 2005 GMT - Not After : Oct 15 20:50:59 2007 GMT + Not Before: Mar 8 03:00:47 2005 GMT + Not After : Apr 2 03:00:47 2046 GMT Subject: C=US, ST=Oregon, L=Portland, O=taoSoftDev, CN=www.taosoftdev.com/emailAddress=info@yassl.com Subject Public Key Info: Public Key Algorithm: rsaEncryption @@ -19,20 +19,20 @@ Certificate: f2:25:93:22:e7 Exponent: 65537 (0x10001) Signature Algorithm: md5WithRSAEncryption - 08:36:07:8c:3a:7f:f9:91:0a:82:d1:6a:c1:34:be:bc:2d:b2: - 20:98:dc:45:50:53:9c:66:e6:26:71:bd:fa:d2:b4:91:d3:53: - c0:20:05:c0:b6:84:9a:5f:3f:61:75:f5:fd:c6:ec:e2:f6:9f: - a2:13:17:a9:b7:83:60:cc:cb:eb + 36:72:12:3b:ac:e4:58:83:09:86:4f:71:2a:3a:0d:8a:05:27: + 75:f3:3e:62:4f:ab:b8:70:20:cd:ad:70:ab:91:11:68:f8:82: + 33:e2:78:85:a8:16:f5:66:bd:68:2c:5a:26:15:12:1e:6e:83: + c7:6d:62:b9:c3:ff:e1:86:e4:e6 -----BEGIN CERTIFICATE----- MIIB9zCCAaECAQEwDQYJKoZIhvcNAQEEBQAwgYkxCzAJBgNVBAYTAlVTMQ8wDQYD VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290 aDEkMCIGA1UEAxMbd3d3LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZI -hvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0wNTAxMTgyMDUwNTlaFw0wNzEwMTUy -MDUwNTlaMIGCMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH +hvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0wNTAzMDgwMzAwNDdaFw00NjA0MDIw +MzAwNDdaMIGCMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH EwhQb3J0bGFuZDETMBEGA1UEChMKdGFvU29mdERldjEbMBkGA1UEAxMSd3d3LnRh b3NvZnRkZXYuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0G CSqGSIb3DQEBAQUAA0sAMEgCQQCkaLu8tydfPPV4xhqvuZX8fmEfqIEKykOImgPg 0KZ5cBY0uXx1VMpwGWY4vm4ofqX/azyDLzlCwxXzvfIlkyLnAgMBAAEwDQYJKoZI -hvcNAQEEBQADQQAINgeMOn/5kQqC0WrBNL68LbIgmNxFUFOcZuYmcb360rSR01PA -IAXAtoSaXz9hdfX9xuzi9p+iExept4NgzMvr +hvcNAQEEBQADQQA2chI7rORYgwmGT3EqOg2KBSd18z5iT6u4cCDNrXCrkRFo+IIz +4niFqBb1Zr1oLFomFRIeboPHbWK5w//hhuTm -----END CERTIFICATE----- diff --git a/extra/yassl/include/lock.hpp b/extra/yassl/include/lock.hpp index 0525943e45d..7ce656522df 100644 --- a/extra/yassl/include/lock.hpp +++ b/extra/yassl/include/lock.hpp @@ -27,7 +27,7 @@ namespace yaSSL { -#ifdef MULTI_THREADED +#ifdef YASSL_THREAD_SAFE #ifdef _WIN32 #include @@ -69,7 +69,7 @@ namespace yaSSL { }; #endif // _WIN32 -#else // MULTI_THREADED (WE'RE SINGLE) +#else // YASSL_THREAD_SAFE (WE'RE SINGLE) class Mutex { public: @@ -79,7 +79,7 @@ namespace yaSSL { }; }; -#endif // MULTI_THREADED +#endif // YASSL_THREAD_SAFE diff --git a/extra/yassl/src/Makefile.am b/extra/yassl/src/Makefile.am index bc57e7d05ba..d192eb03b49 100644 --- a/extra/yassl/src/Makefile.am +++ b/extra/yassl/src/Makefile.am @@ -5,7 +5,7 @@ libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \ handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \ template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h) -AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX +AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX @yassl_thread_cxxflags@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/extra/yassl/src/lock.cpp b/extra/yassl/src/lock.cpp index 6d8e9c17477..6e85fefa14d 100644 --- a/extra/yassl/src/lock.cpp +++ b/extra/yassl/src/lock.cpp @@ -26,7 +26,7 @@ namespace yaSSL { -#ifdef MULTI_THREADED +#ifdef YASSL_THREAD_SAFE #ifdef _WIN32 Mutex::Mutex() @@ -79,7 +79,7 @@ namespace yaSSL { #endif // _WIN32 -#endif // MULTI_THREADED +#endif // YASSL_THREAD_SAFE diff --git a/extra/yassl/taocrypt/CMakeLists.txt b/extra/yassl/taocrypt/CMakeLists.txt index e91fa021de5..c8faeac3b77 100755 --- a/extra/yassl/taocrypt/CMakeLists.txt +++ b/extra/yassl/taocrypt/CMakeLists.txt @@ -16,6 +16,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include) +ADD_DEFINITIONS("-DYASSL_THREAD_SAFE") + SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp src/md4.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp diff --git a/extra/yassl/taocrypt/benchmark/Makefile.am b/extra/yassl/taocrypt/benchmark/Makefile.am index 2fe1c90c90d..1f082f22f40 100644 --- a/extra/yassl/taocrypt/benchmark/Makefile.am +++ b/extra/yassl/taocrypt/benchmark/Makefile.am @@ -2,7 +2,7 @@ INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL noinst_PROGRAMS = benchmark benchmark_SOURCES = benchmark.cpp benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la -benchmark_CXXFLAGS = -DYASSL_PURE_C +benchmark_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@ EXTRA_DIST = benchmark.dsp rsa1024.der dh1024.der dsa1024.der make.bat # Don't update the files from bitkeeper diff --git a/extra/yassl/taocrypt/src/Makefile.am b/extra/yassl/taocrypt/src/Makefile.am index 61032d4c381..6ca969ad686 100644 --- a/extra/yassl/taocrypt/src/Makefile.am +++ b/extra/yassl/taocrypt/src/Makefile.am @@ -8,7 +8,8 @@ libtaocrypt_la_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp \ random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \ tftables.cpp twofish.cpp -libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C +libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \ + @yassl_thread_cxxflags@ EXTRA_DIST = $(wildcard ../include/*.hpp) diff --git a/extra/yassl/taocrypt/test/Makefile.am b/extra/yassl/taocrypt/test/Makefile.am index 73e7f729bdb..aa325ff9b75 100644 --- a/extra/yassl/taocrypt/test/Makefile.am +++ b/extra/yassl/taocrypt/test/Makefile.am @@ -2,7 +2,7 @@ INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL noinst_PROGRAMS = test test_SOURCES = test.cpp test_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la -test_CXXFLAGS = -DYASSL_PURE_C +test_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@ EXTRA_DIST = make.bat # Don't update the files from bitkeeper diff --git a/extra/yassl/taocrypt/test/memory.cpp b/extra/yassl/taocrypt/test/memory.cpp index 726c9c0ef54..a879a497800 100644 --- a/extra/yassl/taocrypt/test/memory.cpp +++ b/extra/yassl/taocrypt/test/memory.cpp @@ -13,7 +13,7 @@ To use MemoryTracker merely add this file to your project No need to instantiate anything -If your app is multi threaded define MULTI_THREADED +If your app is multi threaded define YASSL_THREAD_SAFE *********************************************************************/ diff --git a/extra/yassl/testsuite/Makefile.am b/extra/yassl/testsuite/Makefile.am index cae34e7bbc0..e626b1822ec 100644 --- a/extra/yassl/testsuite/Makefile.am +++ b/extra/yassl/testsuite/Makefile.am @@ -4,7 +4,7 @@ testsuite_SOURCES = testsuite.cpp ../taocrypt/test/test.cpp \ ../examples/client/client.cpp ../examples/server/server.cpp \ ../examples/echoclient/echoclient.cpp \ ../examples/echoserver/echoserver.cpp -testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER +testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER @yassl_thread_cxxflags@ testsuite_LDADD = $(top_builddir)/extra/yassl/src/libyassl.la \ $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat From 51e90dc79e5b3847a8b1fdf69b8207864ff2f7c8 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 8 Jun 2010 16:20:54 -0300 Subject: [PATCH 101/121] Bug#53906: Stray semicolon in my_sys.h corrupts macro function definition of MY_INIT include/my_sys.h: Remove stray semicolon. --- include/my_sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/my_sys.h b/include/my_sys.h index 4ec4846f528..40ae6924f9f 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -37,7 +37,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; } #define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;} -#define MY_INIT(name); { my_progname= name; my_init(); } +#define MY_INIT(name) { my_progname= name; my_init(); } #define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */ #define NRERRBUFFS (2) /* Buffers for parameters */ From f4b7c50d6e1860b8f28ff387118f27eeea812f48 Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Wed, 9 Jun 2010 14:45:04 +0400 Subject: [PATCH 102/121] Fix for bug #54007: assert in ha_myisam::index_next, HANDLER Problem: the server missed the fact that one can read from 2 indexes alternately using HANDLER interface. Fix: check if the same (initialized) index is involved reading next/prev values from the index. mysql-test/r/handler_myisam.result: Fix for bug #54007: assert in ha_myisam::index_next, HANDLER - test result. mysql-test/t/handler_myisam.test: Fix for bug #54007: assert in ha_myisam::index_next, HANDLER - test case. sql/sql_handler.cc: Fix for bug #54007: assert in ha_myisam::index_next, HANDLER - check if we use the same (initialized) index to read next/prev values from the index. --- mysql-test/r/handler_myisam.result | 93 ++++++++++++++++++++++++++++++ mysql-test/t/handler_myisam.test | 49 ++++++++++++++++ sql/sql_handler.cc | 23 +++++++- 3 files changed, 162 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result index a970e20a2c0..b20b8dbb138 100644 --- a/mysql-test/r/handler_myisam.result +++ b/mysql-test/r/handler_myisam.result @@ -769,4 +769,97 @@ a 1 HANDLER t1 CLOSE; DROP TABLE t1; +# +# Bug #54007: assert in ha_myisam::index_next , HANDLER +# +CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b)); +HANDLER t1 OPEN; +HANDLER t1 READ FIRST; +a b +HANDLER t1 READ `PRIMARY` NEXT; +a b +HANDLER t1 READ ab NEXT; +a b +HANDLER t1 READ b NEXT; +a b +HANDLER t1 READ NEXT; +a b +HANDLER t1 CLOSE; +INSERT INTO t1 VALUES (2, 20), (1, 10), (4, 40), (3, 30); +HANDLER t1 OPEN; +HANDLER t1 READ FIRST; +a b +2 20 +HANDLER t1 READ NEXT; +a b +1 10 +HANDLER t1 READ `PRIMARY` NEXT; +a b +1 10 +HANDLER t1 READ `PRIMARY` NEXT; +a b +2 20 +HANDLER t1 READ ab NEXT; +a b +1 10 +HANDLER t1 READ ab NEXT; +a b +2 20 +HANDLER t1 READ b NEXT; +a b +1 10 +HANDLER t1 READ b NEXT; +a b +2 20 +HANDLER t1 READ b NEXT; +a b +3 30 +HANDLER t1 READ b NEXT; +a b +4 40 +HANDLER t1 READ b NEXT; +a b +HANDLER t1 READ NEXT; +a b +4 40 +HANDLER t1 READ NEXT; +a b +3 30 +HANDLER t1 READ NEXT; +a b +HANDLER t1 CLOSE; +HANDLER t1 OPEN; +HANDLER t1 READ FIRST; +a b +2 20 +HANDLER t1 READ `PRIMARY` PREV; +a b +4 40 +HANDLER t1 READ `PRIMARY` PREV; +a b +3 30 +HANDLER t1 READ b PREV; +a b +4 40 +HANDLER t1 READ b PREV; +a b +3 30 +HANDLER t1 CLOSE; +HANDLER t1 OPEN; +HANDLER t1 READ FIRST; +a b +2 20 +HANDLER t1 READ `PRIMARY` PREV LIMIT 3; +a b +4 40 +3 30 +2 20 +HANDLER t1 READ b NEXT LIMIT 5; +a b +1 10 +2 20 +3 30 +4 40 +HANDLER t1 CLOSE; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/handler_myisam.test b/mysql-test/t/handler_myisam.test index 868ba14480a..e78072ef8a0 100644 --- a/mysql-test/t/handler_myisam.test +++ b/mysql-test/t/handler_myisam.test @@ -48,4 +48,53 @@ HANDLER t1 READ a NEXT; HANDLER t1 CLOSE; DROP TABLE t1; + +--echo # +--echo # Bug #54007: assert in ha_myisam::index_next , HANDLER +--echo # +CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b)); + +HANDLER t1 OPEN; +HANDLER t1 READ FIRST; +HANDLER t1 READ `PRIMARY` NEXT; +HANDLER t1 READ ab NEXT; +HANDLER t1 READ b NEXT; +HANDLER t1 READ NEXT; +HANDLER t1 CLOSE; + +INSERT INTO t1 VALUES (2, 20), (1, 10), (4, 40), (3, 30); +HANDLER t1 OPEN; +HANDLER t1 READ FIRST; +HANDLER t1 READ NEXT; +HANDLER t1 READ `PRIMARY` NEXT; +HANDLER t1 READ `PRIMARY` NEXT; +HANDLER t1 READ ab NEXT; +HANDLER t1 READ ab NEXT; +HANDLER t1 READ b NEXT; +HANDLER t1 READ b NEXT; +HANDLER t1 READ b NEXT; +HANDLER t1 READ b NEXT; +HANDLER t1 READ b NEXT; +HANDLER t1 READ NEXT; +HANDLER t1 READ NEXT; +HANDLER t1 READ NEXT; +HANDLER t1 CLOSE; + +HANDLER t1 OPEN; +HANDLER t1 READ FIRST; +HANDLER t1 READ `PRIMARY` PREV; +HANDLER t1 READ `PRIMARY` PREV; +HANDLER t1 READ b PREV; +HANDLER t1 READ b PREV; +HANDLER t1 CLOSE; + +HANDLER t1 OPEN; +HANDLER t1 READ FIRST; +HANDLER t1 READ `PRIMARY` PREV LIMIT 3; +HANDLER t1 READ b NEXT LIMIT 5; +HANDLER t1 CLOSE; + +DROP TABLE t1; + + --echo End of 5.1 tests diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 3bbf4b78d07..bbc3d0b27a4 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -539,6 +539,14 @@ retry: my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), keyname, tables->alias); goto err; } + /* Check if the same index involved. */ + if ((uint) keyno != table->file->get_index()) + { + if (mode == RNEXT) + mode= RFIRST; + else if (mode == RPREV) + mode= RLAST; + } } if (insert_fields(thd, &thd->lex->select_lex.context, @@ -561,9 +569,16 @@ retry: case RNEXT: if (table->file->inited != handler::NONE) { - error=keyname ? - table->file->index_next(table->record[0]) : - table->file->rnd_next(table->record[0]); + if (keyname) + { + /* Check if we read from the same index. */ + DBUG_ASSERT((uint) keyno == table->file->get_index()); + error= table->file->index_next(table->record[0]); + } + else + { + error= table->file->rnd_next(table->record[0]); + } break; } /* else fall through */ @@ -584,6 +599,8 @@ retry: break; case RPREV: DBUG_ASSERT(keyname != 0); + /* Check if we read from the same index. */ + DBUG_ASSERT((uint) keyno == table->file->get_index()); if (table->file->inited != handler::NONE) { error=table->file->index_prev(table->record[0]); From 41297909aded820350afaecf64a4aee888bd369c Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 9 Jun 2010 21:30:41 -0300 Subject: [PATCH 103/121] Bug#34236: Various possibly related SSL crashes Addendum: Work around a compilation failure on Windows due to windows.h not being added to the global namespace. extra/yassl/include/lock.hpp: Move windows.h inclusion into the global namespace. --- extra/yassl/include/lock.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/extra/yassl/include/lock.hpp b/extra/yassl/include/lock.hpp index 7ce656522df..99829b0b6de 100644 --- a/extra/yassl/include/lock.hpp +++ b/extra/yassl/include/lock.hpp @@ -23,13 +23,21 @@ #ifndef yaSSL_LOCK_HPP #define yaSSL_LOCK_HPP +/* + Visual Studio Source Annotations header (sourceannotations.h) fails + to compile if outside of the global namespace. +*/ +#ifdef YASSL_THREAD_SAFE +#ifdef _WIN32 +#include +#endif +#endif namespace yaSSL { #ifdef YASSL_THREAD_SAFE #ifdef _WIN32 - #include class Mutex { CRITICAL_SECTION cs_; From a24df71e95fb6379a3ba86322c9941a82b8d6527 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 10 Jun 2010 13:15:35 +0200 Subject: [PATCH 104/121] Backport of Bug#53303 mytap tests should always have a plan() The bug was caused by buffered output. Flushing resolved it. We still recommend to allways call plan(). Also fix some compile warnings (formal parameter different from declaration) unittest/examples/Makefile.am: Omit core-t, since it will always fail. unittest/examples/no_plan-t.c: Comment that we recommend calling plan(NO_PLAN) unittest/mytap/tap.c: Use the named constant NO_PLAN Flush all output. unittest/mytap/tap.h: Change documentation for the plan() function. --- unittest/examples/Makefile.am | 3 ++- unittest/examples/no_plan-t.c | 11 ++++++++--- unittest/mytap/tap.c | 13 ++++++++++--- unittest/mytap/tap.h | 13 ++++++------- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/unittest/examples/Makefile.am b/unittest/examples/Makefile.am index 94032c00928..a1627a58b4e 100644 --- a/unittest/examples/Makefile.am +++ b/unittest/examples/Makefile.am @@ -20,7 +20,8 @@ AM_LDFLAGS = -L$(top_builddir)/unittest/mytap LDADD = -lmytap -noinst_PROGRAMS = simple-t skip-t todo-t skip_all-t no_plan-t core-t +# We omit core-t here, since it will always fail. +noinst_PROGRAMS = simple-t skip-t todo-t skip_all-t no_plan-t # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/unittest/examples/no_plan-t.c b/unittest/examples/no_plan-t.c index 56aabd6d752..f22340ae0d1 100644 --- a/unittest/examples/no_plan-t.c +++ b/unittest/examples/no_plan-t.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 MySQL AB +/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,14 +20,19 @@ /* Sometimes, the number of tests is not known beforehand. In those - cases, the plan can be omitted and will instead be written at the - end of the test (inside exit_status()). + cases, you should invoke plan(NO_PLAN). + The plan will be printed at the end of the test (inside exit_status()). Use this sparingly, it is a last resort: planning how many tests you are going to run will help you catch that offending case when some tests are skipped for an unknown reason. */ int main() { + /* + We recommend calling plan(NO_PLAN), but want to verify that + omitting the call works as well. + plan(NO_PLAN); + */ ok(1, " "); ok(1, " "); ok(1, " "); diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c index 4e053e3e745..a5831f2b71d 100644 --- a/unittest/mytap/tap.c +++ b/unittest/mytap/tap.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 MySQL AB +/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ @ingroup MyTAP_Internal */ -static TEST_DATA g_test = { 0, 0, 0, "" }; +static TEST_DATA g_test = { NO_PLAN, 0, 0, "" }; /** Output stream for test report message. @@ -74,6 +74,7 @@ vemit_tap(int pass, char const *fmt, va_list ap) (fmt && *fmt) ? " - " : ""); if (fmt && *fmt) vfprintf(tapout, fmt, ap); + fflush(tapout); } @@ -96,6 +97,7 @@ static void emit_dir(const char *dir, const char *why) { fprintf(tapout, " # %s %s", dir, why); + fflush(tapout); } @@ -108,6 +110,7 @@ static void emit_endl() { fprintf(tapout, "\n"); + fflush(tapout); } static void @@ -183,7 +186,10 @@ plan(int const count) break; default: if (count > 0) + { fprintf(tapout, "1..%d\n", count); + fflush(tapout); + } break; } } @@ -196,6 +202,7 @@ skip_all(char const *reason, ...) va_start(ap, reason); fprintf(tapout, "1..0 # skip "); vfprintf(tapout, reason, ap); + fflush(tapout); va_end(ap); exit(0); } @@ -218,7 +225,7 @@ ok(int const pass, char const *fmt, ...) void -skip(int how_many, char const *const fmt, ...) +skip(int how_many, char const *fmt, ...) { char reason[80]; if (fmt && *fmt) diff --git a/unittest/mytap/tap.h b/unittest/mytap/tap.h index 31ec47d1ef2..4118207ca7a 100644 --- a/unittest/mytap/tap.h +++ b/unittest/mytap/tap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 MySQL AB +/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,10 +72,9 @@ extern "C" { /** Set number of tests that is planned to execute. - The function also accepts the predefined constant - NO_PLAN. If the function is not called, it is as if - it was called with NO_PLAN, i.e., the test plan will - be printed after all the test lines. + The function also accepts the predefined constant NO_PLAN. + If invoked with this constant -- or not invoked at all -- + the test plan will be printed after all the test lines. The plan() function will install signal handlers for all signals that generate a core, so if you want to override these signals, do @@ -84,7 +83,7 @@ extern "C" { @param count The planned number of tests to run. */ -void plan(int count); +void plan(int const count); /** @@ -103,7 +102,7 @@ void plan(int count); which case nothing is printed. */ -void ok(int pass, char const *fmt, ...) +void ok(int const pass, char const *fmt, ...) __attribute__((format(printf,2,3))); From 6f3a540c37bd1d84139c32a4b74844ff648c3b0c Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 10 Jun 2010 17:16:43 -0300 Subject: [PATCH 105/121] Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Essentially, the problem is that large parts of the server were developed in simpler times (last decades, pre C99 standard) when strict aliasing and compilers supporting such optimizations were rare to non-existent. Thus, when compiling the server with a modern compiler that uses strict aliasing rules to perform optimizations, there are several places in the code that might trigger undefined behavior. As evinced by some recent bugs, GCC does a somewhat good of job misoptimizing such code, but on the other hand also gives warnings about suspicious code. One problem is that the warnings aren't always accurate, yet we can't afford to just shut them off as we might miss real cases. False-positive cases are aggravated mostly by casts that are likely to trigger undefined behavior. The solution is to start a cleanup process focused on fixing and reducing the amount of strict-aliasing related warnings produced by GCC and others compilers. A good deal of noise reduction can be achieved by just removing useless casts that are product of historical cruft and are likely to trigger undefined behavior if dereferenced. client/mysql.cc: Remove now-unnecessary casts. Break up large strings. client/mysql_upgrade.c: Remove now-unnecessary casts. client/mysqladmin.cc: Remove now-unnecessary casts. Break up large strings. client/mysqlbinlog.cc: Remove now-unnecessary casts. client/mysqlcheck.c: Remove now-unnecessary casts. client/mysqldump.c: Remove now-unnecessary casts. client/mysqlimport.c: Remove now-unnecessary casts. client/mysqlshow.c: Remove now-unnecessary casts. client/mysqlslap.c: Remove now-unnecessary casts. client/mysqltest.cc: Remove now-unnecessary casts. extra/comp_err.c: Remove now-unnecessary casts. extra/my_print_defaults.c: Remove now-unnecessary casts. Break up large strings. extra/mysql_waitpid.c: Remove now-unnecessary casts. extra/perror.c: Remove now-unnecessary casts. extra/resolve_stack_dump.c: Remove now-unnecessary casts. extra/resolveip.c: Remove now-unnecessary casts. include/my_getopt.h: Use a void pointer type as the opaque type to avoid problems with type incompatibility -- GCC issues warnings when the type name is not type compatible with a operand. As a side bonus, a explicit cast won't be necessary anymore. include/sslopt-longopts.h: Remove now-unnecessary casts. Break up large strings. mysys/my_getopt.c: Update opaque type and introduce a type definition for the argument to my_getopt_register_get_addr. server-tools/instance-manager/options.cc: Remove now-unnecessary casts. sql/mysqld.cc: Remove now-unnecessary casts. Break up large strings. Update mysql_getopt_value prototype (the old prototype was different from the definition anyway). sql/sql_plugin.cc: The type of a pointer to a function must be compatible with the pointed-to function type, otherwise the behavior is undefined. sql/table.cc: The variable buf pointer to pointer to pointer to constant char could improperly alias a incompatible type in call to fix_type_ pointers. Since this was actually dead code, it is simply removed. sql/unireg.cc: Remove call to get_form_pos. The code creates a new FRM file which is always truncated and writes the form position as 0. Hence, no need to retrieve it, we now for sure it is 0. storage/archive/archive_reader.c: Remove now-unnecessary casts. storage/myisam/ft_nlq_search.c: Read weight directly from the buffer. storage/myisam/fulltext.h: Add explanation about the type duality of a key buffer. Add accessor macro to retrieve a FT float value. storage/myisam/mi_test1.c: Remove now-unnecessary casts. storage/myisam/myisam_ftdump.c: Read weight directly from the buffer. storage/myisam/myisamchk.c: Remove now-unnecessary casts. storage/myisam/myisamlog.c: A pointer to char was used to alias a pointer to pointer to unsigned char, thus violating strict aliasing rules. storage/myisam/myisampack.c: Remove now-unnecessary casts. strings/decimal.c: Remove aliasing violation, printing the value is enough for debugging purposes. tests/mysql_client_test.c: Remove now-unnecessary casts. --- client/mysql.cc | 175 ++-- client/mysql_upgrade.c | 24 +- client/mysqladmin.cc | 60 +- client/mysqlbinlog.cc | 67 +- client/mysqlcheck.c | 58 +- client/mysqldump.c | 146 ++-- client/mysqlimport.c | 72 +- client/mysqlshow.c | 39 +- client/mysqlslap.c | 106 ++- client/mysqltest.cc | 65 +- extra/comp_err.c | 32 +- extra/my_print_defaults.c | 27 +- extra/mysql_waitpid.c | 2 +- extra/perror.c | 10 +- extra/resolve_stack_dump.c | 6 +- extra/resolveip.c | 2 +- include/my_getopt.h | 21 +- include/sslopt-longopts.h | 21 +- mysys/mf_wfile.c | 2 +- mysys/my_getopt.c | 36 +- server-tools/instance-manager/options.cc | 74 +- sql/mysqld.cc | 988 ++++++++++++----------- sql/sql_plugin.cc | 60 +- sql/table.cc | 73 +- sql/unireg.cc | 14 +- storage/archive/archive_reader.c | 5 +- storage/myisam/ft_nlq_search.c | 2 +- storage/myisam/fulltext.h | 15 + storage/myisam/mi_test1.c | 34 +- storage/myisam/myisam_ftdump.c | 2 +- storage/myisam/myisamchk.c | 66 +- storage/myisam/myisamlog.c | 8 +- storage/myisam/myisampack.c | 12 +- strings/decimal.c | 2 +- tests/mysql_client_test.c | 33 +- 35 files changed, 1248 insertions(+), 1111 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index d013dc4c4ae..14a6ceed51d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1347,58 +1347,66 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"auto-rehash", OPT_AUTO_REHASH, - "Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.", - (uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, + "Enable automatic rehashing. One doesn't need to use 'rehash' to get table " + "and field completion, but startup and reconnecting may take a longer time. " + "Disable with --disable-auto-rehash.", + &opt_rehash, &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"no-auto-rehash", 'A', - "No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.", + "No automatic rehashing. One has to use 'rehash' to get table and field " + "completion. This gives a quicker start of mysql and disables rehashing " + "on reconnect.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"batch", 'B', - "Don't use history file. Disable interactive behavior. (Enables --silent.)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Don't use history file. Disable interactive behavior. (Enables --silent.)", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", &charsets_dir, + &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"column-type-info", OPT_COLUMN_TYPES, "Display column type information.", - (uchar**) &column_types_flag, (uchar**) &column_types_flag, + &column_types_flag, &column_types_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"comments", 'c', "Preserve comments. Send comments to the server." " The default is --skip-comments (discard comments), enable with --comments.", - (uchar**) &preserve_comments, (uchar**) &preserve_comments, + &preserve_comments, &preserve_comments, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use compression in server/client protocol.", - (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - #ifdef DBUG_OFF {"debug", '#', "This is a non-debug version. Catch this and exit.", 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option, - (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log.", &default_dbug_option, + &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag, - (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"database", 'D', "Database to use.", (uchar**) ¤t_db, - (uchar**) ¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag, + &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"database", 'D', "Database to use.", ¤t_db, + ¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, - "Set the default character set.", (uchar**) &default_charset, - (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"delimiter", OPT_DELIMITER, "Delimiter to be used.", (uchar**) &delimiter_str, - (uchar**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Set the default character set.", &default_charset, + &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"delimiter", OPT_DELIMITER, "Delimiter to be used.", &delimiter_str, + &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"vertical", 'E', "Print the output of a query (rows) vertically.", - (uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, + &vertical, &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Continue even if we get an SQL error.", - (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, + &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"named-commands", 'G', - "Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.", - (uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + "Enable named commands. Named commands mean this program's internal " + "commands; see mysql> help . When enabled, the named commands can be " + "used from any line of the query, otherwise only from the first line, " + "before an enter. Disable with --disable-named-commands. This option " + "is disabled by default.", + &named_cmds, &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-named-commands", 'g', "Named commands are disabled. Use \\* form only, or use named commands " @@ -1408,47 +1416,54 @@ static struct my_option my_long_options[] = "WARNING: option deprecated; use --disable-named-commands instead.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"ignore-spaces", 'i', "Ignore space after function names.", - (uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0, + &ignore_spaces, &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.", - (uchar**) &opt_local_infile, - (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep, - (uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host.", (uchar**) ¤t_host, - (uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"html", 'H', "Produce HTML output.", (uchar**) &opt_html, (uchar**) &opt_html, + &opt_local_infile, + &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"no-beep", 'b', "Turn off beep on error.", &opt_nobeep, + &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"host", 'h', "Connect to host.", ¤t_host, + ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"html", 'H', "Produce HTML output.", &opt_html, &opt_html, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"xml", 'X', "Produce XML output.", (uchar**) &opt_xml, (uchar**) &opt_xml, 0, + {"xml", 'X', "Produce XML output.", &opt_xml, &opt_xml, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.", - (uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL, + &line_numbers, &line_numbers, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered, - (uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"unbuffered", 'n', "Flush buffer after each query.", &unbuffered, + &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"column-names", OPT_COLUMN_NAMES, "Write column names in results.", - (uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL, + &column_names, &column_names, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"skip-column-names", 'N', "Don't write column names in results.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"set-variable", 'O', - "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", + "Change the value of a variable. Please note that this option is " + "deprecated; you can set variables directly with --variable-name=value.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C).", - (uchar**) &opt_sigint_ignore, (uchar**) &opt_sigint_ignore, 0, GET_BOOL, + &opt_sigint_ignore, &opt_sigint_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"one-database", 'o', - "Only update the default database. This is useful for skipping updates to other database in the update log.", + "Only update the default database. This is useful for skipping updates " + "to other database in the update log.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef USE_POPEN {"pager", OPT_PAGER, - "Pager to use to display results. If you don't supply an option, the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.", + "Pager to use to display results. If you don't supply an option, the " + "default pager is taken from your ENV variable PAGER. Valid pagers are " + "less, more, cat [> filename], etc. See interactive help (\\h) also. " + "This option does not work in batch mode. Disable with --disable-pager. " + "This option is disabled by default.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"no-pager", OPT_NOPAGER, - "Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead.", + "Disable pager and print to stdout. See interactive help (\\h) also. " + "WARNING: option deprecated; use --disable-pager instead.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"password", 'p', @@ -1464,48 +1479,53 @@ static struct my_option my_long_options[] = "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &opt_mysql_port, - (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &opt_mysql_port, + &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"prompt", OPT_PROMPT, "Set the mysql prompt to this value.", - (uchar**) ¤t_prompt, (uchar**) ¤t_prompt, 0, GET_STR_ALLOC, + ¤t_prompt, ¤t_prompt, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"quick", 'q', - "Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.", - (uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Don't cache result, print it row by row. This may slow down the server " + "if the output is suspended. Doesn't use history file.", + &quick, &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"raw", 'r', "Write fields without conversion. Used with --batch.", - (uchar**) &opt_raw_data, (uchar**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_raw_data, &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.", - (uchar**) &opt_reconnect, (uchar**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, - 0, 0}, + {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable " + "with --disable-reconnect. This option is enabled by default.", + &opt_reconnect, &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"silent", 's', "Be more silent. Print results with a tab as separator, " + "each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, - 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Base name of shared memory.", &shared_memory_base_name, + &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"socket", 'S', "The socket file to use for connection.", - (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR_ALLOC, + &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include "sslopt-longopts.h" - {"table", 't', "Output in table format.", (uchar**) &output_tables, - (uchar**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"table", 't', "Output in table format.", &output_tables, + &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"tee", OPT_TEE, - "Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.", + "Append everything into outfile. See interactive help (\\h) also. " + "Does not work in batch mode. Disable with --disable-tee. " + "This option is disabled by default.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: Option deprecated; use --disable-tee instead.", 0, 0, 0, GET_NO_ARG, - NO_ARG, 0, 0, 0, 0, 0, 0}, + {"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. " + "WARNING: Option deprecated; use --disable-tee instead.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE - {"user", 'u', "User for login if not current user.", (uchar**) ¤t_user, - (uchar**) ¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user.", ¤t_user, + ¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.", - (uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0, + &safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.", - (uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0, + &safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -1515,35 +1535,32 @@ static struct my_option my_long_options[] = NO_ARG, 0, 0, 0, 0, 0, 0}, {"connect_timeout", OPT_CONNECT_TIMEOUT, "Number of seconds before connection timeout.", - (uchar**) &opt_connect_timeout, - (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0, - 0, 0}, + &opt_connect_timeout, &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, + 0, 0, 3600*12, 0, 0, 0}, {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "The maximum packet length to send to or receive from server.", - (uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0, + &opt_max_allowed_packet, &opt_max_allowed_packet, 0, GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096, (longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "The buffer size for TCP/IP and socket communication.", - (uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG, + &opt_net_buffer_length, &opt_net_buffer_length, 0, GET_ULONG, REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0}, {"select_limit", OPT_SELECT_LIMIT, "Automatic limit for SELECT when using --safe-updates.", - (uchar**) &select_limit, - (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX, - 0, 1, 0}, + &select_limit, &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, + 1, ULONG_MAX, 0, 1, 0}, {"max_join_size", OPT_MAX_JOIN_SIZE, "Automatic limit for rows in a join when using --safe-updates.", - (uchar**) &max_join_size, - (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX, - 0, 1, 0}, + &max_join_size, &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, + 1, ULONG_MAX, 0, 1, 0}, {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" - " uses old (pre-4.1.1) protocol.", (uchar**) &opt_secure_auth, - (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + " uses old (pre-4.1.1) protocol.", &opt_secure_auth, + &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.", - (uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG, + &show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index ade8e30648a..0b8b43775ed 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -68,7 +68,7 @@ static struct my_option my_long_options[]= "Directory for character set files.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compress", OPT_COMPRESS, "Use compression in server/client protocol.", - (uchar**)¬_used, (uchar**)¬_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + ¬_used, ¬_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"datadir", 'd', "Not used by mysql_upgrade. Only for backward compatibility.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -76,26 +76,26 @@ static struct my_option my_long_options[]= {"debug", '#', "This is a non-debug version. Catch this and exit.", 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log.", (uchar* *) & default_dbug_option, - (uchar* *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log.", &default_dbug_option, + &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag, - (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag, + &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade " "has already been executed for the current version of MySQL.", - (uchar**)&opt_force, (uchar**)&opt_force, 0, + &opt_force, &opt_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host",'h', "Connect to host.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given," - " it's solicited on the tty.", (uchar**) &opt_password,(uchar**) &opt_password, + " it's solicited on the tty.", &opt_password,&opt_password, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #ifdef __WIN__ {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, @@ -121,15 +121,15 @@ static struct my_option my_long_options[]= #include {"tmpdir", 't', "Directory for temporary files.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"user", 'u', "User for login if not current user.", (uchar**) &opt_user, - (uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user.", &opt_user, + &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Display more output about the process.", - (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0, + &opt_verbose, &opt_verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"write-binlog", OPT_WRITE_BINLOG, "All commands including mysqlcheck are binlogged. Enabled by default;" "use --skip-write-binlog when commands should not be sent to replication slaves.", - (uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG, + &opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 8a8e8ec2db5..fe3e51a4d61 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -122,37 +122,37 @@ static struct my_option my_long_options[] = #endif {"count", 'c', "Number of iterations to make. This works with -i (--sleep) only.", - (uchar**) &nr_iterations, (uchar**) &nr_iterations, 0, GET_UINT, + &nr_iterations, &nr_iterations, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DBUG_OFF {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", - (uchar**) &debug_info_flag, (uchar**) &debug_info_flag, + &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.", - (uchar**) &option_force, (uchar**) &option_force, 0, GET_BOOL, NO_ARG, 0, 0, + &option_force, &option_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use compression in server/client protocol.", - (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", &charsets_dir, + &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, - "Set the default character set.", (uchar**) &default_charset, - (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Set the default character set.", &default_charset, + &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR, + {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep, - (uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"no-beep", 'b', "Turn off beep on error.", &opt_nobeep, + &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -166,50 +166,52 @@ static struct my_option my_long_options[] = "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &tcp_port, - (uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &tcp_port, + &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"relative", 'r', - "Show difference between current and previous values when used with -i. Currently only works with extended-status.", - (uchar**) &opt_relative, (uchar**) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0, + "Show difference between current and previous values when used with -i. " + "Currently only works with extended-status.", + &opt_relative, &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"set-variable", 'O', - "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", + "Change the value of a variable. Please note that this option is " + "deprecated; you can set variables directly with --variable-name=value.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, + "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"silent", 's', "Silently exit if one can't connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", - (uchar**) &unix_port, (uchar**) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, + &unix_port, &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"sleep", 'i', "Execute commands repeatedly with a sleep between.", - (uchar**) &interval, (uchar**) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, + &interval, &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include #ifndef DONT_ALLOW_USER_CHANGE - {"user", 'u', "User for login if not current user.", (uchar**) &user, - (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user.", &user, + &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"verbose", 'v', "Write more information.", (uchar**) &opt_verbose, - (uchar**) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Write more information.", &opt_verbose, + &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"vertical", 'E', "Print output vertically. Is similar to --relative, but prints output vertically.", - (uchar**) &opt_vertical, (uchar**) &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_vertical, &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (uchar**) &opt_connect_timeout, - (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0, + {"connect_timeout", OPT_CONNECT_TIMEOUT, "", &opt_connect_timeout, + &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0, 3600*12, 0, 1, 0}, - {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout, - (uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG, + {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", &opt_shutdown_timeout, + &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG, SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index c8b9a7d34c5..30bdb58153f 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1004,9 +1004,8 @@ static struct my_option my_long_options[] = "events); 'always' prints base64 whenever possible. 'always' is for " "debugging only and should not be used in a production system. If this " "argument is not given, the default is 'auto'; if it is given with no " - "argument, 'always' is used." - ,(uchar**) &opt_base64_output_mode_str, - (uchar**) &opt_base64_output_mode_str, + "argument, 'always' is used.", + &opt_base64_output_mode_str, &opt_base64_output_mode_str, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, /* mysqlbinlog needs charsets knowledge, to be able to convert a charset @@ -1015,43 +1014,43 @@ static struct my_option my_long_options[] = SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`; */ {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", &charsets_dir, + &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"database", 'd', "List entries for just this database (local log only).", - (uchar**) &database, (uchar**) &database, 0, GET_STR_ALLOC, REQUIRED_ARG, + &database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DBUG_OFF - {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option, - (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log.", &default_dbug_option, + &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", - (uchar**) &debug_info_flag, (uchar**) &debug_info_flag, + &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"disable-log-bin", 'D', "Disable binary log. This is useful, if you " "enabled --to-last-log and are sending the output to the same MySQL server. " "This way you could avoid an endless loop. You would also like to use it " "when restoring after a crash to avoid duplication of the statements you " "already have. NOTE: you will need a SUPER privilege to use this option.", - (uchar**) &disable_log_bin, (uchar**) &disable_log_bin, 0, GET_BOOL, + &disable_log_bin, &disable_log_bin, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"force-if-open", 'F', "Force if binlog was not closed properly.", - (uchar**) &force_if_open_opt, (uchar**) &force_if_open_opt, 0, GET_BOOL, NO_ARG, + &force_if_open_opt, &force_if_open_opt, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"force-read", 'f', "Force reading unknown binlog events.", - (uchar**) &force_opt, (uchar**) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &force_opt, &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.", - (uchar**) &opt_hexdump, (uchar**) &opt_hexdump, 0, GET_BOOL, NO_ARG, + &opt_hexdump, &opt_hexdump, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Get the binlog from server.", (uchar**) &host, (uchar**) &host, + {"host", 'h', "Get the binlog from server.", &host, &host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.", - (uchar**) &dirname_for_local_load, (uchar**) &dirname_for_local_load, 0, + &dirname_for_local_load, &dirname_for_local_load, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"offset", 'o', "Skip the first N entries.", (uchar**) &offset, (uchar**) &offset, + {"offset", 'o', "Skip the first N entries.", &offset, &offset, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to connect to remote server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -1061,10 +1060,10 @@ static struct my_option my_long_options[] = "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG, + &port, &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"position", OPT_POSITION, "Deprecated. Use --start-position instead.", - (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL, + &start_position, &start_position, 0, GET_ULL, REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE, /* COM_BINLOG_DUMP accepts only 4 bytes for the position */ (ulonglong)(~(uint32)0), 0, 0, 0}, @@ -1072,31 +1071,31 @@ static struct my_option my_long_options[] = "The protocol to use for connection (tcp, socket, pipe, memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"read-from-remote-server", 'R', "Read binary logs from a MySQL server.", - (uchar**) &remote_opt, (uchar**) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &remote_opt, &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"server-id", OPT_SERVER_ID, "Extract only binlog entries created by the server having the given id.", - (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG, + &server_id, &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"set-charset", OPT_SET_CHARSET, - "Add 'SET NAMES character_set' to the output.", (uchar**) &charset, - (uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Add 'SET NAMES character_set' to the output.", &charset, + &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, - (uchar**) &shared_memory_base_name, + "Base name of shared memory.", &shared_memory_base_name, + &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"short-form", 's', "Just show regular queries: no extra info and no " "row-based events. This is for testing only, and should not be used in " "production systems. If you want to suppress base64-output, consider " "using --base64-output=never instead.", - (uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &short_form, &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", - (uchar**) &sock, (uchar**) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, + &sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"start-datetime", OPT_START_DATETIME, "Start reading the binlog at first event having a datetime equal or " @@ -1104,12 +1103,12 @@ static struct my_option my_long_options[] = "in the local time zone, in any format accepted by the MySQL server " "for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 " "(you should probably use quotes for your shell to set it properly).", - (uchar**) &start_datetime_str, (uchar**) &start_datetime_str, + &start_datetime_str, &start_datetime_str, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"start-position", 'j', "Start reading the binlog at position N. Applies to the first binlog " "passed on the command line.", - (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL, + &start_position, &start_position, 0, GET_ULL, REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE, /* COM_BINLOG_DUMP accepts only 4 bytes for the position */ (ulonglong)(~(uint32)0), 0, 0, 0}, @@ -1119,22 +1118,22 @@ static struct my_option my_long_options[] = "in the local time zone, in any format accepted by the MySQL server " "for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 " "(you should probably use quotes for your shell to set it properly).", - (uchar**) &stop_datetime_str, (uchar**) &stop_datetime_str, + &stop_datetime_str, &stop_datetime_str, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"stop-position", OPT_STOP_POSITION, "Stop reading the binlog at position N. Applies to the last binlog " "passed on the command line.", - (uchar**) &stop_position, (uchar**) &stop_position, 0, GET_ULL, + &stop_position, &stop_position, 0, GET_ULL, REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE, (ulonglong)(~(my_off_t)0), 0, 0, 0}, {"to-last-log", 't', "Requires -R. Will not stop at the end of the \ requested binlog but rather continue printing until the end of the last \ binlog of the MySQL server. If you send the output to the same MySQL server, \ that may lead to an endless loop.", - (uchar**) &to_last_remote_log, (uchar**) &to_last_remote_log, 0, GET_BOOL, + &to_last_remote_log, &to_last_remote_log, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"user", 'u', "Connect to the remote server as username.", - (uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, + &user, &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Reconstruct SQL statements out of row events. " "-v -v adds comments on column data types.", @@ -1143,7 +1142,7 @@ that may lead to an endless loop.", 0, 0, 0, 0, 0}, {"open_files_limit", OPT_OPEN_FILES_LIMIT, "Used to reserve file descriptors for use by this program.", - (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG, + &open_files_limit, &open_files_limit, 0, GET_ULONG, REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index d88fa6e46c2..4183ab1dd5e 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -54,13 +54,13 @@ static struct my_option my_long_options[] = { {"all-databases", 'A', "Check all the databases. This is the same as --databases with all databases selected.", - (uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"all-in-1", '1', "Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.", - (uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_all_in_1, &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef __NETWARE__ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.", @@ -68,11 +68,11 @@ static struct my_option my_long_options[] = #endif {"auto-repair", OPT_AUTO_REPAIR, "If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.", - (uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0, + &opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", &charsets_dir, + &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"check-only-changed", 'C', @@ -82,11 +82,11 @@ static struct my_option my_long_options[] = "Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"compress", OPT_COMPRESS, "Use compression in server/client protocol.", - (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"databases", 'B', "Check several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names.", - (uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, + &opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef DBUG_OFF {"debug", '#', "This is a non-debug version. Catch this and exit.", @@ -96,40 +96,40 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", - (uchar**) &debug_info_flag, (uchar**) &debug_info_flag, + &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, - "Set the default character set.", (uchar**) &default_charset, - (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Set the default character set.", &default_charset, + &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"fast",'F', "Check only tables that haven't been closed properly.", - (uchar**) &opt_fast, (uchar**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, + &opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.", - (uchar**) &opt_fix_db_names, (uchar**) &opt_fix_db_names, + &opt_fix_db_names, &opt_fix_db_names, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.", - (uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names, + &opt_fix_table_names, &opt_fix_table_names, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Continue even if we get an SQL error.", - (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, + &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"extended", 'e', "If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.", - (uchar**) &opt_extended, (uchar**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_extended, &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host",'h', "Connect to host.", (uchar**) ¤t_host, - (uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"host",'h', "Connect to host.", ¤t_host, + ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"medium-check", 'm', "Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"write-binlog", OPT_WRITE_BINLOG, "Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.", - (uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG, + &opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -146,38 +146,38 @@ static struct my_option my_long_options[] = "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &opt_mysql_port, - (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, + &opt_mysql_port, + &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"quick", 'q', "If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.", - (uchar**) &opt_quick, (uchar**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, + &opt_quick, &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"repair", 'r', "Can fix almost anything except unique keys that aren't unique.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, + "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"silent", 's', "Print only error messages.", (uchar**) &opt_silent, - (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"silent", 's', "Print only error messages.", &opt_silent, + &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", - (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR, + &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"use-frm", OPT_FRM, "When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.", - (uchar**) &opt_frm, (uchar**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, + &opt_frm, &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE - {"user", 'u', "User for login if not current user.", (uchar**) ¤t_user, - (uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user.", ¤t_user, + ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/client/mysqldump.c b/client/mysqldump.c index dca8ecb7dfb..e35672c2a2c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -180,115 +180,115 @@ HASH ignore_table; static struct my_option my_long_options[] = { {"all", OPT_ALL, "Deprecated. Use --create-options instead.", - (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1, + &create_options, &create_options, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"all-databases", 'A', "Dump all the databases. This will be same as --databases with all databases selected.", - (uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"all-tablespaces", 'Y', "Dump all the tablespaces.", - (uchar**) &opt_alltspcs, (uchar**) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_alltspcs, &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-tablespaces", 'y', "Do not dump any tablespace information.", - (uchar**) &opt_notspcs, (uchar**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_notspcs, &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"add-drop-database", OPT_DROP_DATABASE, "Add a DROP DATABASE before each create.", - (uchar**) &opt_drop_database, (uchar**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, + &opt_drop_database, &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"add-drop-table", OPT_DROP, "Add a DROP TABLE before each create.", - (uchar**) &opt_drop, (uchar**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, + &opt_drop, &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"add-locks", OPT_LOCKS, "Add locks around INSERT statements.", - (uchar**) &opt_lock, (uchar**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, + &opt_lock, &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"allow-keywords", OPT_KEYWORDS, - "Allow creation of column names that are keywords.", (uchar**) &opt_keywords, - (uchar**) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Allow creation of column names that are keywords.", &opt_keywords, + &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef __NETWARE__ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", &charsets_dir, + &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"comments", 'i', "Write additional information.", - (uchar**) &opt_comments, (uchar**) &opt_comments, 0, GET_BOOL, NO_ARG, + &opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"compatible", OPT_COMPATIBLE, "Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.", - (uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0, + &opt_compatible_mode_str, &opt_compatible_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compact", OPT_COMPACT, "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset.", - (uchar**) &opt_compact, (uchar**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_compact, &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"complete-insert", 'c', "Use complete insert statements.", - (uchar**) &opt_complete_insert, (uchar**) &opt_complete_insert, 0, GET_BOOL, + &opt_complete_insert, &opt_complete_insert, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use compression in server/client protocol.", - (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"create-options", 'a', "Include all MySQL specific create options.", - (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1, + &create_options, &create_options, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"databases", 'B', "Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output.", - (uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0, + &opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef DBUG_OFF {"debug", '#', "This is a non-debug version. Catch this and exit.", 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option, - (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log.", &default_dbug_option, + &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", - (uchar**) &debug_info_flag, (uchar**) &debug_info_flag, + &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, - "Set the default character set.", (uchar**) &default_charset, - (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Set the default character set.", &default_charset, + &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.", - (uchar**) &opt_delayed, (uchar**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_delayed, &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"delete-master-logs", OPT_DELETE_MASTER_LOGS, "Delete logs on master after backup. This automatically enables --master-data.", - (uchar**) &opt_delete_master_logs, (uchar**) &opt_delete_master_logs, 0, + &opt_delete_master_logs, &opt_delete_master_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"disable-keys", 'K', - "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (uchar**) &opt_disable_keys, - (uchar**) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", &opt_disable_keys, + &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"events", 'E', "Dump events.", - (uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL, + &opt_events, &opt_events, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"extended-insert", 'e', "Use multiple-row INSERT syntax that include several VALUES lists.", - (uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG, + &extended_insert, &extended_insert, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"fields-terminated-by", OPT_FTB, "Fields in the output file are terminated by the given string.", - (uchar**) &fields_terminated, (uchar**) &fields_terminated, 0, + &fields_terminated, &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"fields-enclosed-by", OPT_ENC, "Fields in the output file are enclosed by the given character.", - (uchar**) &enclosed, (uchar**) &enclosed, 0, + &enclosed, &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0}, {"fields-optionally-enclosed-by", OPT_O_ENC, "Fields in the output file are optionally enclosed by the given character.", - (uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0, + &opt_enclosed, &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0}, {"fields-escaped-by", OPT_ESC, "Fields in the output file are escaped by the given character.", - (uchar**) &escaped, (uchar**) &escaped, 0, + &escaped, &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"first-slave", OPT_FIRST_SLAVE, "Deprecated, renamed to --lock-all-tables.", - (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, + &opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"flush-logs", 'F', "Flush logs file in server before starting dump. " "Note that if you dump many databases at once (using the option " @@ -299,24 +299,24 @@ static struct my_option my_long_options[] = "to the moment all tables are locked. So if you want your dump and " "the log flush to happen at the same exact moment you should use " "--lock-all-tables or --master-data with --flush-logs.", - (uchar**) &flush_logs, (uchar**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &flush_logs, &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement " "after dumping the mysql database. This option should be used any " "time the dump contains the mysql database and any other database " "that depends on the data in the mysql database for proper restore. ", - (uchar**) &flush_privileges, (uchar**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &flush_privileges, &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Continue even if we get an SQL error.", - (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, + &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, " "VARBINARY, BLOB) in hexadecimal format.", - (uchar**) &opt_hex_blob, (uchar**) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host.", (uchar**) ¤t_host, - (uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &opt_hex_blob, &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"host", 'h', "Connect to host.", ¤t_host, + ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ignore-table", OPT_IGNORE_TABLE, "Do not dump the specified table. To specify more than one table to ignore, " "use the directive multiple times, once for each table. Each table must " @@ -324,21 +324,21 @@ static struct my_option my_long_options[] = "--ignore-table=database.table.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.", - (uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_ignore, &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the output file are terminated by the given string.", - (uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR, + &lines_terminated, &lines_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lock-all-tables", 'x', "Locks all tables across all databases. This " "is achieved by taking a global read lock for the duration of the whole " "dump. Automatically turns --single-transaction and --lock-tables off.", - (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, + &opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"lock-tables", 'l', "Lock all tables for read.", (uchar**) &lock_tables, - (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"lock-tables", 'l', "Lock all tables for read.", &lock_tables, + &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.", - (uchar**) &log_error_file, (uchar**) &log_error_file, 0, GET_STR, + &log_error_file, &log_error_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"master-data", OPT_MASTER_DATA, "This causes the binary log position and filename to be appended to the " @@ -350,33 +350,33 @@ static struct my_option my_long_options[] = "don't forget to read about --single-transaction below). In all cases, " "any action on logs will happen at the exact moment of the dump. " "Option automatically turns --lock-tables off.", - (uchar**) &opt_master_data, (uchar**) &opt_master_data, 0, + &opt_master_data, &opt_master_data, 0, GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "The maximum packet length to send to or receive from server.", - (uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0, + &opt_max_allowed_packet, &opt_max_allowed_packet, 0, GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "The buffer size for TCP/IP and socket communication.", - (uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, + &opt_net_buffer_length, &opt_net_buffer_length, 0, GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, MALLOC_OVERHEAD-1024, 1024, 0}, {"no-autocommit", OPT_AUTOCOMMIT, "Wrap tables with autocommit/commit statements.", - (uchar**) &opt_autocommit, (uchar**) &opt_autocommit, 0, GET_BOOL, NO_ARG, + &opt_autocommit, &opt_autocommit, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-create-db", 'n', "Suppress the CREATE DATABASE ... IF EXISTS statement that normally is " "output for each dumped database if --all-databases or --databases is " "given.", - (uchar**) &opt_create_db, (uchar**) &opt_create_db, 0, + &opt_create_db, &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-create-info", 't', "Don't write table creation info.", - (uchar**) &opt_no_create_info, (uchar**) &opt_no_create_info, 0, GET_BOOL, + &opt_no_create_info, &opt_no_create_info, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"no-data", 'd', "No row information.", (uchar**) &opt_no_data, - (uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"no-data", 'd', "No row information.", &opt_no_data, + &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-set-names", 'N',"Suppress the SET NAMES statement", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"opt", OPT_OPTIMIZE, @@ -384,7 +384,7 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"order-by-primary", OPT_ORDER_BY_PRIMARY, "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.", - (uchar**) &opt_order_by_primary, (uchar**) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + &opt_order_by_primary, &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's solicited on the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -392,36 +392,36 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port, - (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, + {"port", 'P', "Port number to use for connection.", &opt_mysql_port, + &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"quick", 'q', "Don't buffer query, dump directly to stdout.", - (uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + &quick, &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"quote-names",'Q', "Quote table and column names with backticks (`).", - (uchar**) &opt_quoted, (uchar**) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, + &opt_quoted, &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"replace", OPT_MYSQL_REPLACE_INTO, "Use REPLACE INTO instead of INSERT INTO.", - (uchar**) &opt_replace_into, (uchar**) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_replace_into, &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"result-file", 'r', "Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"routines", 'R', "Dump stored routines (functions and procedures).", - (uchar**) &opt_routines, (uchar**) &opt_routines, 0, GET_BOOL, + &opt_routines, &opt_routines, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"set-charset", OPT_SET_CHARSET, "Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.", - (uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1, + &opt_set_charset, &opt_set_charset, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"set-variable", 'O', "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, + "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* @@ -439,42 +439,42 @@ static struct my_option my_long_options[] = "connection should use the following statements: ALTER TABLE, DROP " "TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not " "isolated from them. Option automatically turns off --lock-tables.", - (uchar**) &opt_single_transaction, (uchar**) &opt_single_transaction, 0, + &opt_single_transaction, &opt_single_transaction, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.", - (uchar**) &opt_dump_date, (uchar**) &opt_dump_date, 0, + &opt_dump_date, &opt_dump_date, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"skip-opt", OPT_SKIP_OPTIMIZATION, "Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", - (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, + &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include {"tab",'T', "Create tab-separated textfile for each table to given path. (Create .sql " "and .txt files.) NOTE: This only works if mysqldump is run on the same " "machine as the mysqld server.", - (uchar**) &path, (uchar**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &path, &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table.", - (uchar**) &opt_dump_triggers, (uchar**) &opt_dump_triggers, 0, GET_BOOL, + &opt_dump_triggers, &opt_dump_triggers, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"tz-utc", OPT_TZ_UTC, "SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.", - (uchar**) &opt_tz_utc, (uchar**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + &opt_tz_utc, &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE {"user", 'u', "User for login if not current user.", - (uchar**) ¤t_user, (uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG, + ¤t_user, ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"verbose", 'v', "Print info about the various stages.", - (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version",'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"where", 'w', "Dump only selected records. Quotes are mandatory.", - (uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &where, &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} diff --git a/client/mysqlimport.c b/client/mysqlimport.c index d346cd567e7..404106560c1 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -73,68 +73,68 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", &charsets_dir, + &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, - "Set the default character set.", (uchar**) &default_charset, - (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Set the default character set.", &default_charset, + &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"columns", 'c', "Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.", - (uchar**) &opt_columns, (uchar**) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, + &opt_columns, &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use compression in server/client protocol.", - (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", - (uchar**) &debug_info_flag, (uchar**) &debug_info_flag, + &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"delete", 'd', "First delete all rows from table.", (uchar**) &opt_delete, - (uchar**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"delete", 'd', "First delete all rows from table.", &opt_delete, + &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"fields-terminated-by", OPT_FTB, "Fields in the input file are terminated by the given string.", - (uchar**) &fields_terminated, (uchar**) &fields_terminated, 0, + &fields_terminated, &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"fields-enclosed-by", OPT_ENC, "Fields in the import file are enclosed by the given character.", - (uchar**) &enclosed, (uchar**) &enclosed, 0, + &enclosed, &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"fields-optionally-enclosed-by", OPT_O_ENC, "Fields in the input file are optionally enclosed by the given character.", - (uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0, + &opt_enclosed, &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"fields-escaped-by", OPT_ESC, "Fields in the input file are escaped by the given character.", - (uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, + &escaped, &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Continue even if we get an SQL error.", - (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, + &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host.", (uchar**) ¤t_host, - (uchar**) ¤t_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"host", 'h', "Connect to host.", ¤t_host, + ¤t_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ignore", 'i', "If duplicate unique key was found, keep old row.", - (uchar**) &ignore, (uchar**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + &ignore, &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.", - (uchar**) &opt_ignore_lines, (uchar**) &opt_ignore_lines, 0, GET_LL, + &opt_ignore_lines, &opt_ignore_lines, 0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the input file are terminated by the given string.", - (uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR, + &lines_terminated, &lines_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"local", 'L', "Read all files through the client.", (uchar**) &opt_local_file, - (uchar**) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"local", 'L', "Read all files through the client.", &opt_local_file, + &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"lock-tables", 'l', "Lock all tables for write (this disables threads).", - (uchar**) &lock_tables, (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, + &lock_tables, &lock_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"low-priority", OPT_LOW_PRIORITY, - "Use LOW_PRIORITY when updating the table.", (uchar**) &opt_low_priority, - (uchar**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Use LOW_PRIORITY when updating the table.", &opt_low_priority, + &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -148,35 +148,35 @@ static struct my_option my_long_options[] = "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &opt_mysql_port, - (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, + &opt_mysql_port, + &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replace", 'r', "If duplicate unique key was found, replace old row.", - (uchar**) &replace, (uchar**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + &replace, &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, + "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, 0, + {"silent", 's', "Be more silent.", &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", - (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR, + &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include {"use-threads", OPT_USE_THREADS, "Load files in parallel. The argument is the number " "of threads to use for loading data.", - (uchar**) &opt_use_threads, (uchar**) &opt_use_threads, 0, + &opt_use_threads, &opt_use_threads, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE - {"user", 'u', "User for login if not current user.", (uchar**) ¤t_user, - (uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user.", ¤t_user, + ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"verbose", 'v', "Print info about the various stages.", (uchar**) &verbose, - (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Print info about the various stages.", &verbose, + &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 370efe83f10..2f5582cb668 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -164,35 +164,35 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"character-sets-dir", 'c', "Directory for character set files.", - (uchar**) &charsets_dir, (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, + &charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-character-set", OPT_DEFAULT_CHARSET, - "Set the default character set.", (uchar**) &default_charset, - (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Set the default character set.", &default_charset, + &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"count", OPT_COUNT, "Show number of rows per table (may be slow for non-MyISAM tables).", - (uchar**) &opt_count, (uchar**) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_count, &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use compression in server/client protocol.", - (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", - (uchar**) &debug_info_flag, (uchar**) &debug_info_flag, + &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR, + {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"status", 'i', "Shows a lot of extra information about each table.", - (uchar**) &opt_status, (uchar**) &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_status, &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"keys", 'k', "Show keys for table.", (uchar**) &opt_show_keys, - (uchar**) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"keys", 'k', "Show keys for table.", &opt_show_keys, + &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given, it's " "solicited on the tty.", @@ -203,8 +203,8 @@ static struct my_option my_long_options[] = "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &opt_mysql_port, - (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, + &opt_mysql_port, + &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef __WIN__ {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, @@ -215,19 +215,20 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, - 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Base name of shared memory.", &shared_memory_base_name, + &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, #endif {"show-table-type", 't', "Show table type column.", - (uchar**) &opt_table_type, (uchar**) &opt_table_type, 0, GET_BOOL, + &opt_table_type, &opt_table_type, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", - (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR, + &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include #ifndef DONT_ALLOW_USER_CHANGE - {"user", 'u', "User for login if not current user.", (uchar**) &user, - (uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user.", &user, + &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"verbose", 'v', "More verbose output; you can use this multiple times to get even more " diff --git a/client/mysqlslap.c b/client/mysqlslap.c index a9681528943..b1eafe0082c 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -511,62 +511,62 @@ static struct my_option my_long_options[] = 0, 0, 0, 0, 0, 0}, {"auto-generate-sql", 'a', "Generate SQL where not supplied by file or command line.", - (uchar**) &auto_generate_sql, (uchar**) &auto_generate_sql, + &auto_generate_sql, &auto_generate_sql, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO, "Add an AUTO_INCREMENT column to auto-generated tables.", - (uchar**) &auto_generate_sql_autoincrement, - (uchar**) &auto_generate_sql_autoincrement, + &auto_generate_sql_autoincrement, + &auto_generate_sql_autoincrement, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES, "Set this number to generate a set number of queries to run.", - (uchar**) &auto_actual_queries, (uchar**) &auto_actual_queries, + &auto_actual_queries, &auto_actual_queries, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY, "Add GUID based primary keys to auto-generated tables.", - (uchar**) &auto_generate_sql_guid_primary, - (uchar**) &auto_generate_sql_guid_primary, + &auto_generate_sql_guid_primary, + &auto_generate_sql_guid_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, "Specify test load type: mixed, update, write, key, or read; default is mixed.", - (uchar**) &auto_generate_sql_type, (uchar**) &auto_generate_sql_type, + &auto_generate_sql_type, &auto_generate_sql_type, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-secondary-indexes", OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES, "Number of secondary indexes to add to auto-generated tables.", - (uchar**) &auto_generate_sql_secondary_indexes, - (uchar**) &auto_generate_sql_secondary_indexes, 0, + &auto_generate_sql_secondary_indexes, + &auto_generate_sql_secondary_indexes, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-unique-query-number", OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM, "Number of unique queries to generate for automatic tests.", - (uchar**) &auto_generate_sql_unique_query_number, - (uchar**) &auto_generate_sql_unique_query_number, + &auto_generate_sql_unique_query_number, + &auto_generate_sql_unique_query_number, 0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0}, {"auto-generate-sql-unique-write-number", OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM, "Number of unique queries to generate for auto-generate-sql-write-number.", - (uchar**) &auto_generate_sql_unique_write_number, - (uchar**) &auto_generate_sql_unique_write_number, + &auto_generate_sql_unique_write_number, + &auto_generate_sql_unique_write_number, 0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0}, {"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM, "Number of row inserts to perform for each thread (default is 100).", - (uchar**) &auto_generate_sql_number, (uchar**) &auto_generate_sql_number, + &auto_generate_sql_number, &auto_generate_sql_number, 0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0}, {"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.", - (uchar**) &commit_rate, (uchar**) &commit_rate, 0, GET_UINT, REQUIRED_ARG, + &commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use compression in server/client protocol.", - (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"concurrency", 'c', "Number of clients to simulate for query to run.", - (uchar**) &concurrency_str, (uchar**) &concurrency_str, 0, GET_STR, + &concurrency_str, &concurrency_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.", - (uchar**) &create_string, (uchar**) &create_string, 0, GET_STR, REQUIRED_ARG, + &create_string, &create_string, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.", - (uchar**) &create_schema_string, (uchar**) &create_schema_string, 0, GET_STR, + &create_schema_string, &create_schema_string, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"csv", OPT_SLAP_CSV, "Generate CSV output to named file or to stdout if no file is named.", @@ -576,45 +576,45 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", - (uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR, + &default_dbug_option, &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag, - (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag, + &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"delimiter", 'F', "Delimiter to use in SQL statements supplied in file or command line.", - (uchar**) &delimiter, (uchar**) &delimiter, 0, GET_STR, REQUIRED_ARG, + &delimiter, &delimiter, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"detach", OPT_SLAP_DETACH, "Detach (close and reopen) connections after X number of requests.", - (uchar**) &detach_rate, (uchar**) &detach_rate, 0, GET_UINT, REQUIRED_ARG, + &detach_rate, &detach_rate, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"engine", 'e', "Storage engine to use for creating the table.", - (uchar**) &default_engine, (uchar**) &default_engine, 0, + &default_engine, &default_engine, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR, + {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"iterations", 'i', "Number of times to run the tests.", (uchar**) &iterations, - (uchar**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, + {"iterations", 'i', "Number of times to run the tests.", &iterations, + &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, {"number-char-cols", 'x', "Number of VARCHAR columns to create in table if specifying --auto-generate-sql.", - (uchar**) &num_char_cols_opt, (uchar**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG, + &num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"number-int-cols", 'y', "Number of INT columns to create in table if specifying --auto-generate-sql.", - (uchar**) &num_int_cols_opt, (uchar**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG, + &num_int_cols_opt, &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY, "Limit each client to this number of queries (this is not exact).", - (uchar**) &num_of_query, (uchar**) &num_of_query, 0, + &num_of_query, &num_of_query, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"only-print", OPT_MYSQL_ONLY_PRINT, "Do not connect to the databases, but instead print out what would have " "been done.", - (uchar**) &opt_only_print, (uchar**) &opt_only_print, 0, GET_BOOL, NO_ARG, + &opt_only_print, &opt_only_print, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's " @@ -623,58 +623,54 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port, - (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, + {"port", 'P', "Port number to use for connection.", &opt_mysql_port, + &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, {"post-query", OPT_SLAP_POST_QUERY, "Query to run or file containing query to execute after tests have completed.", - (uchar**) &user_supplied_post_statements, - (uchar**) &user_supplied_post_statements, + &user_supplied_post_statements, &user_supplied_post_statements, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"post-system", OPT_SLAP_POST_SYSTEM, "system() string to execute after tests have completed.", - (uchar**) &post_system, - (uchar**) &post_system, + &post_system, &post_system, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"pre-query", OPT_SLAP_PRE_QUERY, "Query to run or file containing query to execute before running tests.", - (uchar**) &user_supplied_pre_statements, - (uchar**) &user_supplied_pre_statements, + &user_supplied_pre_statements, &user_supplied_pre_statements, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"pre-system", OPT_SLAP_PRE_SYSTEM, "system() string to execute before running tests.", - (uchar**) &pre_system, - (uchar**) &pre_system, + &pre_system, &pre_system, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"query", 'q', "Query to run or file containing query to run.", - (uchar**) &user_supplied_query, (uchar**) &user_supplied_query, + &user_supplied_query, &user_supplied_query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, - (uchar**) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, + "Base name of shared memory.", &shared_memory_base_name, + &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"silent", 's', "Run program in silent mode - no output.", - (uchar**) &opt_silent, (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, + &opt_silent, &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", - (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR, + &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include #ifndef DONT_ALLOW_USER_CHANGE - {"user", 'u', "User for login if not current user.", (uchar**) &user, - (uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user.", &user, + &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"verbose", 'v', - "More verbose output; you can use this multiple times to get even more " - "verbose output.", (uchar**) &verbose, (uchar**) &verbose, 0, - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, - NO_ARG, 0, 0, 0, 0, 0, 0}, + "More verbose output; you can use this multiple times to get even more " + "verbose output.", &verbose, &verbose, 0, GET_NO_ARG, NO_ARG, + 0, 0, 0, 0, 0, 0}, + {"version", 'V', "Output version information and exit.", 0, 0, 0, + GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 141440a91d8..359de9880e7 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5836,18 +5836,18 @@ static struct my_option my_long_options[] = { {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir, - (uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"basedir", 'b', "Basedir for tests.", &opt_basedir, + &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory for character set files.", (uchar**) &opt_charsets_dir, - (uchar**) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory for character set files.", &opt_charsets_dir, + &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use the compressed server/client protocol.", - (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.", - (uchar**) &cursor_protocol, (uchar**) &cursor_protocol, 0, + &cursor_protocol, &cursor_protocol, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"database", 'D', "Database to use.", (uchar**) &opt_db, (uchar**) &opt_db, 0, + {"database", 'D', "Database to use.", &opt_db, &opt_db, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef DBUG_OFF {"debug", '#', "This is a non-debug version. Catch this and exit", @@ -5857,28 +5857,28 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", - (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, + &debug_check_flag, &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", - (uchar**) &debug_info_flag, (uchar**) &debug_info_flag, + &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host.", (uchar**) &opt_host, (uchar**) &opt_host, 0, + {"host", 'h', "Connect to host.", &opt_host, &opt_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"include", 'i', "Include SQL before each test case.", (uchar**) &opt_include, - (uchar**) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"logdir", OPT_LOG_DIR, "Directory for log files", (uchar**) &opt_logdir, - (uchar**) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"include", 'i', "Include SQL before each test case.", &opt_include, + &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"logdir", OPT_LOG_DIR, "Directory for log files", &opt_logdir, + &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"mark-progress", OPT_MARK_PROGRESS, "Write line number and elapsed time to .progress.", - (uchar**) &opt_mark_progress, (uchar**) &opt_mark_progress, 0, + &opt_mark_progress, &opt_mark_progress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"max-connect-retries", OPT_MAX_CONNECT_RETRIES, "Maximum number of attempts to connect to server.", - (uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0, + &opt_max_connect_retries, &opt_max_connect_retries, 0, GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0}, {"max-connections", OPT_MAX_CONNECTIONS, "Max number of open connections to server", - (uchar**) &opt_max_connections, (uchar**) &opt_max_connections, 0, + &opt_max_connections, &opt_max_connections, 0, GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -5888,18 +5888,17 @@ static struct my_option my_long_options[] = "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &opt_port, - (uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &opt_port, &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ps-protocol", OPT_PS_PROTOCOL, "Use prepared-statement protocol for communication.", - (uchar**) &ps_protocol, (uchar**) &ps_protocol, 0, + &ps_protocol, &ps_protocol, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"quiet", 's', "Suppress all normal output.", (uchar**) &silent, - (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"quiet", 's', "Suppress all normal output.", &silent, + &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"record", 'r', "Record output of test_file into result file.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"result-file", 'R', "Read/store result from/in this file.", - (uchar**) &result_file_name, (uchar**) &result_file_name, 0, + &result_file_name, &result_file_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"server-arg", 'A', "Send option value to embedded server as a parameter.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -5907,28 +5906,28 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, - (uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, + "Base name of shared memory.", &shared_memory_base_name, + &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"silent", 's', "Suppress all normal output. Synonym for --quiet.", - (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-safemalloc", OPT_SKIP_SAFEMALLOC, "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"sleep", 'T', "Always sleep this many seconds on sleep commands.", - (uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0, + &opt_sleep, &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", - (uchar**) &unix_sock, (uchar**) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, + &unix_sock, &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select.", - (uchar**) &sp_protocol, (uchar**) &sp_protocol, 0, + &sp_protocol, &sp_protocol, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #include "sslopt-longopts.h" {"tail-lines", OPT_TAIL_LINES, "Number of lines of the result to include in a failure report.", - (uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0, + &opt_tail_lines, &opt_tail_lines, 0, GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0}, {"test-file", 'x', "Read test from/in this file (default stdin).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -5936,14 +5935,14 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tmpdir", 't', "Temporary directory where sockets are put.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"user", 'u', "User for login.", (uchar**) &opt_user, (uchar**) &opt_user, 0, + {"user", 'u', "User for login.", &opt_user, &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"verbose", 'v', "Write more.", (uchar**) &verbose, (uchar**) &verbose, 0, + {"verbose", 'v', "Write more.", &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select.", - (uchar**) &view_protocol, (uchar**) &view_protocol, 0, + &view_protocol, &view_protocol, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/extra/comp_err.c b/extra/comp_err.c index 9326444ade9..bd03f20a755 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -99,31 +99,29 @@ static struct my_option my_long_options[]= {"debug", '#', "This is a non-debug version. Catch this and exit", 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log", (uchar**) & default_dbug_option, - (uchar**) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log", &default_dbug_option, + &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"debug-info", 'T', "Print some debug info at exit.", (uchar**) & info_flag, - (uchar**) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"debug-info", 'T', "Print some debug info at exit.", &info_flag, + &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"charset", 'C', "Charset dir", (uchar**) & charsets_dir, - (uchar**) & charsets_dir, + {"charset", 'C', "Charset dir", &charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"in_file", 'F', "Input file", (uchar**) & TXTFILE, (uchar**) & TXTFILE, + {"in_file", 'F', "Input file", &TXTFILE, &TXTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"out_dir", 'D', "Output base directory", (uchar**) & DATADIRECTORY, - (uchar**) & DATADIRECTORY, + {"out_dir", 'D', "Output base directory", &DATADIRECTORY, &DATADIRECTORY, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"out_file", 'O', "Output filename (errmsg.sys)", (uchar**) & OUTFILE, - (uchar**) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"header_file", 'H', "mysqld_error.h file ", (uchar**) & HEADERFILE, - (uchar**) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"name_file", 'N', "mysqld_ername.h file ", (uchar**) & NAMEFILE, - (uchar**) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"state_file", 'S', "sql_state.h file", (uchar**) & STATEFILE, - (uchar**) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"out_file", 'O', "Output filename (errmsg.sys)", &OUTFILE, + &OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"header_file", 'H', "mysqld_error.h file ", &HEADERFILE, + &HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"name_file", 'N', "mysqld_ername.h file ", &NAMEFILE, + &NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"state_file", 'S', "sql_state.h file", &STATEFILE, + &STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 06f7e51c380..cc74208b783 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -46,31 +46,36 @@ static struct my_option my_long_options[] = searched for a file of this name (and standard filename extensions are added if the file has no extension) */ - {"config-file", 'c', "Deprecated, please use --defaults-file instead. Name of config file to read; if no extension is given, default extension (e.g., .ini or .cnf) will be added", - (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG, + {"config-file", 'c', "Deprecated, please use --defaults-file instead. " + "Name of config file to read; if no extension is given, default " + "extension (e.g., .ini or .cnf) will be added", + &config_file, &config_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef DBUG_OFF {"debug", '#', "This is a non-debug version. Catch this and exit", 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log", (uchar**) &default_dbug_option, - (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log", &default_dbug_option, + &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"defaults-file", 'c', "Like --config-file, except: if first option, then read this file only, do not read global or per-user config files; should be the first option", - (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG, + {"defaults-file", 'c', "Like --config-file, except: if first option, " + "then read this file only, do not read global or per-user config " + "files; should be the first option", + &config_file, &config_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"defaults-extra-file", 'e', - "Read this file after the global config file and before the config file in the users home directory; should be the first option", - (uchar**) &my_defaults_extra_file, (uchar**) &my_defaults_extra_file, 0, + "Read this file after the global config file and before the config " + "file in the users home directory; should be the first option", + &my_defaults_extra_file, &my_defaults_extra_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"defaults-group-suffix", 'g', "In addition to the given groups, read also groups with this suffix", - (uchar**) &my_defaults_group_suffix, (uchar**) &my_defaults_group_suffix, + &my_defaults_group_suffix, &my_defaults_group_suffix, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"extra-file", 'e', "Deprecated. Synonym for --defaults-extra-file.", - (uchar**) &my_defaults_extra_file, - (uchar**) &my_defaults_extra_file, 0, GET_STR, + &my_defaults_extra_file, + &my_defaults_extra_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"no-defaults", 'n', "Return an empty string (useful for scripts).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c index 42465998862..e5c06ac9857 100644 --- a/extra/mysql_waitpid.c +++ b/extra/mysql_waitpid.c @@ -38,7 +38,7 @@ static struct my_option my_long_options[] = 0, 0, 0, 0, 0}, {"verbose", 'v', "Be more verbose. Give a warning, if kill can't handle signal 0.", - (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Print version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} diff --git a/extra/perror.c b/extra/perror.c index a98a4fc3d1b..c32ad2bc791 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -60,18 +60,18 @@ static struct my_option my_long_options[] = {"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE - {"ndb", 257, "Ndbcluster storage engine specific error codes.", (uchar**) &ndb_code, - (uchar**) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"ndb", 257, "Ndbcluster storage engine specific error codes.", &ndb_code, + &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif #ifdef HAVE_SYS_ERRLIST {"all", 'a', "Print all the error messages and the number.", - (uchar**) &print_all_codes, (uchar**) &print_all_codes, 0, GET_BOOL, NO_ARG, + &print_all_codes, &print_all_codes, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"verbose", 'v', "Print error code and message (default).", (uchar**) &verbose, - (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Print error code and message (default).", &verbose, + &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"version", 'V', "Displays version information and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c index 447d63890bd..4faca1653b2 100644 --- a/extra/resolve_stack_dump.c +++ b/extra/resolve_stack_dump.c @@ -53,10 +53,10 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"symbols-file", 's', "Use specified symbols file.", (uchar**) &sym_fname, - (uchar**) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"symbols-file", 's', "Use specified symbols file.", &sym_fname, + &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"numeric-dump-file", 'n', "Read the dump from specified file.", - (uchar**) &dump_fname, (uchar**) &dump_fname, 0, GET_STR, REQUIRED_ARG, + &dump_fname, &dump_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/extra/resolveip.c b/extra/resolveip.c index 5f2a9269f62..90fda977848 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -45,7 +45,7 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, + {"silent", 's', "Be more silent.", &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Displays version information and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/include/my_getopt.h b/include/my_getopt.h index 7cbad607aac..d7c996302fd 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -45,10 +45,10 @@ struct my_option const char *name; /* Name of the option */ int id; /* unique id or short option */ const char *comment; /* option comment, for autom. --help */ - uchar **value; /* The variable value */ - uchar **u_max_value; /* The user def. max variable value */ + void *value; /* The variable value */ + void *u_max_value; /* The user def. max variable value */ struct st_typelib *typelib; /* Pointer to possible values */ - ulong var_type; + ulong var_type; /* Must match the variable type */ enum get_opt_arg_type arg_type; longlong def_value; /* Default value */ longlong min_value; /* Min allowed value */ @@ -58,8 +58,16 @@ struct my_option void *app_type; /* To be used by an application */ }; -typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * ); -typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... ); +typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *); +typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...); +/** + Used to retrieve a reference to the object (variable) that holds the value + for the given option. For example, if var_type is GET_UINT, the function + must return a pointer to a variable of type uint. A argument is stored in + the location pointed to by the returned pointer. +*/ +typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *, + int *); extern char *disabled_my_option; extern my_bool my_getopt_print_errors; @@ -71,8 +79,7 @@ extern int handle_options (int *argc, char ***argv, extern void my_cleanup_options(const struct my_option *options); extern void my_print_help(const struct my_option *options); extern void my_print_variables(const struct my_option *options); -extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint, - const struct my_option *, int *)); +extern void my_getopt_register_get_addr(my_getopt_value); ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, my_bool *fix); diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h index c76b5dcd252..c038ece1644 100644 --- a/include/sslopt-longopts.h +++ b/include/sslopt-longopts.h @@ -16,30 +16,31 @@ #ifdef HAVE_OPENSSL {"ssl", OPT_SSL_SSL, - "Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.", - (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, - 0, 0, 0}, + "Enable SSL for connection (automatically enabled with other flags)." + "Disable with --skip-ssl.", &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, + NO_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-ca", OPT_SSL_CA, "CA file in PEM format (check OpenSSL docs, implies --ssl).", - (uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-capath", OPT_SSL_CAPATH, "CA directory (check OpenSSL docs, implies --ssl).", - (uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).", - (uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).", - (uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).", - (uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, + &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef MYSQL_CLIENT {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, - "Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.", - (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert, + "Verify server's \"Common Name\" in its cert against hostname used " + "when connecting. This option is disabled by default.", + &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif #endif /* HAVE_OPENSSL */ diff --git a/mysys/mf_wfile.c b/mysys/mf_wfile.c index f98d348994e..4a4fb466600 100644 --- a/mysys/mf_wfile.c +++ b/mysys/mf_wfile.c @@ -119,6 +119,6 @@ void wf_end(WF_PACK *buffer) { DBUG_ENTER("wf_end"); if (buffer) - my_free((uchar*) buffer,MYF(0)); + my_free(buffer, MYF(0)); DBUG_VOID_RETURN; } /* wf_end */ diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index fc5662812b0..26b1cc75af0 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -22,7 +22,7 @@ #include #include -typedef void (*init_func_p)(const struct my_option *option, uchar* *variable, +typedef void (*init_func_p)(const struct my_option *option, void *variable, longlong value); static void default_reporter(enum loglevel level, const char *format, ...); @@ -40,11 +40,11 @@ static ulonglong getopt_ull(char *arg, const struct my_option *optp, static double getopt_double(char *arg, const struct my_option *optp, int *err); static void init_variables(const struct my_option *options, init_func_p init_one_value); -static void init_one_value(const struct my_option *option, uchar* *variable, +static void init_one_value(const struct my_option *option, void *variable, longlong value); -static void fini_one_value(const struct my_option *option, uchar* *variable, +static void fini_one_value(const struct my_option *option, void *variable, longlong value); -static int setval(const struct my_option *opts, uchar* *value, char *argument, +static int setval(const struct my_option *opts, void *value, char *argument, my_bool set_maximum_value); static char *check_struct_option(char *cur_arg, char *key_name); @@ -101,10 +101,9 @@ static void default_reporter(enum loglevel level, one. Call function 'get_one_option()' once for each option. */ -static uchar** (*getopt_get_addr)(const char *, uint, const struct my_option *, int *); +static my_getopt_value getopt_get_addr; -void my_getopt_register_get_addr(uchar** (*func_addr)(const char *, uint, - const struct my_option *, int *)) +void my_getopt_register_get_addr(my_getopt_value func_addr) { getopt_get_addr= func_addr; } @@ -119,7 +118,7 @@ int handle_options(int *argc, char ***argv, char **pos, **pos_end, *optend, *UNINIT_VAR(prev_found), *opt_str, key_name[FN_REFLEN]; const struct my_option *optp; - uchar* *value; + void *value; int error, i; LINT_INIT(opt_found); @@ -173,7 +172,7 @@ int handle_options(int *argc, char ***argv, "%s: Option '--set-variable' is deprecated. " "Use --variable-name=value instead.", my_progname); - + must_be_var= 1; if (cur_arg[13] == '=') { @@ -378,7 +377,7 @@ int handle_options(int *argc, char ***argv, optp->value; if (error) return error; - + if (optp->arg_type == NO_ARG) { if (optend && (optp->var_type & GET_TYPE_MASK) != GET_BOOL) @@ -406,8 +405,8 @@ int handle_options(int *argc, char ***argv, else { my_getopt_error_reporter(WARNING_LEVEL, - "%s: ignoring option '--%s' due to \ -invalid value '%s'", + "%s: ignoring option '--%s' due to " + "invalid value '%s'", my_progname, optp->name, optend); continue; } @@ -611,15 +610,14 @@ static char *check_struct_option(char *cur_arg, char *key_name) Will set the option value to given value */ -static int setval(const struct my_option *opts, uchar* *value, char *argument, +static int setval(const struct my_option *opts, void *value, char *argument, my_bool set_maximum_value) { int err= 0; if (value && argument) { - uchar* *result_pos= ((set_maximum_value) ? - opts->u_max_value : value); + void *result_pos= ((set_maximum_value) ? opts->u_max_value : value); if (!result_pos) return EXIT_NO_PTR_TO_VARIABLE; @@ -994,7 +992,7 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err) value Pointer to variable */ -static void init_one_value(const struct my_option *option, uchar* *variable, +static void init_one_value(const struct my_option *option, void *variable, longlong value) { DBUG_ENTER("init_one_value"); @@ -1068,7 +1066,7 @@ static void init_one_value(const struct my_option *option, uchar* *variable, value Pointer to variable */ -static void fini_one_value(const struct my_option *option, uchar* *variable, +static void fini_one_value(const struct my_option *option, void *variable, longlong value __attribute__ ((unused))) { DBUG_ENTER("fini_one_value"); @@ -1109,7 +1107,7 @@ static void init_variables(const struct my_option *options, DBUG_ENTER("init_variables"); for (; options->name; options++) { - uchar* *variable; + void *variable; DBUG_PRINT("options", ("name: '%s'", options->name)); /* We must set u_max_value first as for some variables @@ -1224,7 +1222,7 @@ void my_print_variables(const struct my_option *options) printf("--------------------------------- -----------------------------\n"); for (optp= options; optp->id; optp++) { - uchar* *value= (optp->var_type & GET_ASK_ADDR ? + void *value= (optp->var_type & GET_ASK_ADDR ? (*getopt_get_addr)("", 0, optp, 0) : optp->value); if (value) { diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc index 75a18c5b43a..b9f8b103315 100644 --- a/server-tools/instance-manager/options.cc +++ b/server-tools/instance-manager/options.cc @@ -153,14 +153,14 @@ static struct my_option my_long_options[] = #ifndef __WIN__ { "angel-pid-file", OPT_ANGEL_PID_FILE, "Pid file for angel process.", - (uchar* *) &Options::Daemon::angel_pid_file_name, - (uchar* *) &Options::Daemon::angel_pid_file_name, + &Options::Daemon::angel_pid_file_name, + &Options::Daemon::angel_pid_file_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, #endif { "bind-address", OPT_BIND_ADDRESS, "Bind address to use for connection.", - (uchar* *) &Options::Main::bind_address, - (uchar* *) &Options::Main::bind_address, + &Options::Main::bind_address, + &Options::Main::bind_address, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "check-password-file", OPT_CHECK_PASSWORD_FILE, @@ -173,15 +173,15 @@ static struct my_option my_long_options[] = #ifndef DBUG_OFF {"debug", '#', "Debug log.", - (uchar* *) &Options::Debug::config_str, - (uchar* *) &Options::Debug::config_str, + &Options::Debug::config_str, + &Options::Debug::config_str, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif { "default-mysqld-path", OPT_MYSQLD_PATH, "Where to look for MySQL" " Server binary.", - (uchar* *) &Options::Main::default_mysqld_path, - (uchar* *) &Options::Main::default_mysqld_path, + &Options::Main::default_mysqld_path, + &Options::Main::default_mysqld_path, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, { "drop-user", OPT_DROP_USER, @@ -194,8 +194,8 @@ static struct my_option my_long_options[] = #ifdef __WIN__ { "install", OPT_INSTALL_SERVICE, "Install as system service.", - (uchar* *) &Options::Service::install_as_service, - (uchar* *) &Options::Service::install_as_service, + &Options::Service::install_as_service, + &Options::Service::install_as_service, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, #endif @@ -205,22 +205,22 @@ static struct my_option my_long_options[] = #ifndef __WIN__ { "log", OPT_LOG, "Path to log file. Used only with --run-as-service.", - (uchar* *) &Options::Daemon::log_file_name, - (uchar* *) &Options::Daemon::log_file_name, + &Options::Daemon::log_file_name, + &Options::Daemon::log_file_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, #endif { "monitoring-interval", OPT_MONITORING_INTERVAL, "Interval to monitor" " instances in seconds.", - (uchar* *) &Options::Main::monitoring_interval, - (uchar* *) &Options::Main::monitoring_interval, + &Options::Main::monitoring_interval, + &Options::Main::monitoring_interval, 0, GET_UINT, REQUIRED_ARG, DEFAULT_MONITORING_INTERVAL, 0, 0, 0, 0, 0 }, { "mysqld-safe-compatible", OPT_MYSQLD_SAFE_COMPATIBLE, "Start Instance Manager in mysqld_safe-compatible manner.", - (uchar* *) &Options::Main::mysqld_safe_compatible, - (uchar* *) &Options::Main::mysqld_safe_compatible, + &Options::Main::mysqld_safe_compatible, + &Options::Main::mysqld_safe_compatible, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, { "print-password-line", OPT_PRINT_PASSWORD_LINE, @@ -228,61 +228,61 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "password", OPT_PASSWORD, "Password to update the password file.", - (uchar* *) &Options::User_management::password, - (uchar* *) &Options::User_management::password, + &Options::User_management::password, + &Options::User_management::password, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "password-file", OPT_PASSWORD_FILE, "Look for Instance Manager users and passwords here.", - (uchar* *) &Options::Main::password_file_name, - (uchar* *) &Options::Main::password_file_name, + &Options::Main::password_file_name, + &Options::Main::password_file_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "pid-file", OPT_PID_FILE, "Pid file to use.", - (uchar* *) &Options::Main::pid_file_name, - (uchar* *) &Options::Main::pid_file_name, + &Options::Main::pid_file_name, + &Options::Main::pid_file_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "port", OPT_PORT, "Port number to use for connections.", - (uchar* *) &Options::Main::port_number, - (uchar* *) &Options::Main::port_number, + &Options::Main::port_number, + &Options::Main::port_number, 0, GET_UINT, REQUIRED_ARG, DEFAULT_PORT, 0, 0, 0, 0, 0 }, #ifdef __WIN__ { "remove", OPT_REMOVE_SERVICE, "Remove system service.", - (uchar* *) &Options::Service::remove_service, - (uchar* *) &Options::Service::remove_service, + &Options::Service::remove_service, + &Options::Service::remove_service, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0}, #else { "run-as-service", OPT_RUN_AS_SERVICE, "Daemonize and start angel process.", - (uchar* *) &Options::Daemon::run_as_service, + &Options::Daemon::run_as_service, 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, #endif #ifndef __WIN__ { "socket", OPT_SOCKET, "Socket file to use for connection.", - (uchar* *) &Options::Main::socket_file_name, - (uchar* *) &Options::Main::socket_file_name, + &Options::Main::socket_file_name, + &Options::Main::socket_file_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, #endif #ifdef __WIN__ { "standalone", OPT_STAND_ALONE, "Run the application in stand alone mode.", - (uchar* *) &Options::Service::stand_alone, - (uchar* *) &Options::Service::stand_alone, + &Options::Service::stand_alone, + &Options::Service::stand_alone, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0}, #else { "user", OPT_USER, "Username to start mysqlmanager.", - (uchar* *) &Options::Daemon::user, - (uchar* *) &Options::Daemon::user, + &Options::Daemon::user, + &Options::Daemon::user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, #endif { "username", OPT_USERNAME, "Username to update the password file.", - (uchar* *) &Options::User_management::user_name, - (uchar* *) &Options::User_management::user_name, + &Options::User_management::user_name, + &Options::User_management::user_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "version", 'V', "Output version information and exit.", 0, 0, 0, @@ -290,8 +290,8 @@ static struct my_option my_long_options[] = { "wait-timeout", OPT_WAIT_TIMEOUT, "The number of seconds IM waits " "for activity on a connection before closing it.", - (uchar* *) &net_read_timeout, - (uchar* *) &net_read_timeout, + &net_read_timeout, + &net_read_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7598c2a5276..9afdfab7e89 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5787,12 +5787,12 @@ enum options_mysqld struct my_option my_long_options[] = { {"help", '?', "Display this help and exit.", - (uchar**) &opt_help, (uchar**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &opt_help, &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION {"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT, "Option used by mysql-test for debugging and testing of replication.", - (uchar**) &abort_slave_event_count, (uchar**) &abort_slave_event_count, + &abort_slave_event_count, &abort_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_REPLICATION */ {"allow-suspicious-udfs", OPT_ALLOW_SUSPICIOUS_UDFS, @@ -5800,33 +5800,34 @@ struct my_option my_long_options[] = "without corresponding xxx_init() or xxx_deinit(). That also means " "that one can load any function from any library, for example exit() " "from libc.so", - (uchar**) &opt_allow_suspicious_udfs, (uchar**) &opt_allow_suspicious_udfs, + &opt_allow_suspicious_udfs, &opt_allow_suspicious_udfs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode will also set transaction isolation level 'serializable'.", 0, 0, 0, + {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode " + "will also set transaction isolation level 'serializable'.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"auto-increment-increment", OPT_AUTO_INCREMENT, "Auto-increment columns are incremented by this.", - (uchar**) &global_system_variables.auto_increment_increment, - (uchar**) &max_system_variables.auto_increment_increment, 0, GET_ULONG, + &global_system_variables.auto_increment_increment, + &max_system_variables.auto_increment_increment, 0, GET_ULONG, OPT_ARG, 1, 1, 65535, 0, 1, 0 }, {"auto-increment-offset", OPT_AUTO_INCREMENT_OFFSET, "Offset added to Auto-increment columns. Used when auto-increment-increment != 1.", - (uchar**) &global_system_variables.auto_increment_offset, - (uchar**) &max_system_variables.auto_increment_offset, 0, GET_ULONG, OPT_ARG, + &global_system_variables.auto_increment_offset, + &max_system_variables.auto_increment_offset, 0, GET_ULONG, OPT_ARG, 1, 1, 65535, 0, 1, 0 }, {"automatic-sp-privileges", OPT_SP_AUTOMATIC_PRIVILEGES, "Creating and dropping stored procedures alters ACLs. Disable with --skip-automatic-sp-privileges.", - (uchar**) &sp_automatic_privileges, (uchar**) &sp_automatic_privileges, + &sp_automatic_privileges, &sp_automatic_privileges, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"basedir", 'b', "Path to installation directory. All paths are usually resolved relative to this.", - (uchar**) &mysql_home_ptr, (uchar**) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG, + &mysql_home_ptr, &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"big-tables", OPT_BIG_TABLES, "Allow big result sets by saving all temporary sets on file (solves most 'table full' errors).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.", - (uchar**) &my_bind_addr_str, (uchar**) &my_bind_addr_str, 0, GET_STR, + &my_bind_addr_str, &my_bind_addr_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"binlog_format", OPT_BINLOG_FORMAT, "Does not have any effect without '--log-bin'. " @@ -5839,10 +5840,11 @@ struct my_option my_long_options[] = "If ndbcluster is enabled and binlog_format is `mixed', the format switches" " to 'row' and back implicitly per each query accessing a NDB table." #endif - ,(uchar**) &opt_binlog_format, (uchar**) &opt_binlog_format, + , &opt_binlog_format, &opt_binlog_format, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"binlog-do-db", OPT_BINLOG_DO_DB, - "Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.", + "Tells the master it should log updates for the specified database, " + "and exclude all others not explicitly mentioned.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"binlog-ignore-db", OPT_BINLOG_IGNORE_DB, "Tells the master that updates to the given database should not be logged to the binary log.", @@ -5851,9 +5853,8 @@ struct my_option my_long_options[] = "The maximum size of a row-based binary log event in bytes. Rows will be " "grouped into events smaller than this size if possible. " "The value has to be a multiple of 256.", - (uchar**) &opt_binlog_rows_event_max_size, - (uchar**) &opt_binlog_rows_event_max_size, 0, - GET_ULONG, REQUIRED_ARG, + &opt_binlog_rows_event_max_size, &opt_binlog_rows_event_max_size, + 0, GET_ULONG, REQUIRED_ARG, /* def_value */ 1024, /* min_value */ 256, /* max_value */ ULONG_MAX, /* sub_size */ 0, /* block_size */ 256, /* app_type */ 0 @@ -5864,108 +5865,112 @@ struct my_option my_long_options[] = #endif {"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE, "Don't ignore client side character set value sent during handshake.", - (uchar**) &opt_character_set_client_handshake, - (uchar**) &opt_character_set_client_handshake, + &opt_character_set_client_handshake, + &opt_character_set_client_handshake, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"character-set-filesystem", OPT_CHARACTER_SET_FILESYSTEM, "Set the filesystem character set.", - (uchar**) &character_set_filesystem_name, - (uchar**) &character_set_filesystem_name, + &character_set_filesystem_name, + &character_set_filesystem_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"character-set-server", 'C', "Set the default character set.", - (uchar**) &default_character_set_name, (uchar**) &default_character_set_name, + &default_character_set_name, &default_character_set_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"character-sets-dir", OPT_CHARSETS_DIR, - "Directory where character sets are.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory where character sets are.", &charsets_dir, + &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"chroot", 'r', "Chroot mysqld daemon during startup.", - (uchar**) &mysqld_chroot, (uchar**) &mysqld_chroot, 0, GET_STR, REQUIRED_ARG, + &mysqld_chroot, &mysqld_chroot, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"collation-server", OPT_DEFAULT_COLLATION, "Set the default collation.", - (uchar**) &default_collation_name, (uchar**) &default_collation_name, + &default_collation_name, &default_collation_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"completion-type", OPT_COMPLETION_TYPE, "Default completion type.", - (uchar**) &global_system_variables.completion_type, - (uchar**) &max_system_variables.completion_type, 0, GET_ULONG, + &global_system_variables.completion_type, + &max_system_variables.completion_type, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 2, 0, 1, 0}, {"concurrent-insert", OPT_CONCURRENT_INSERT, "Use concurrent insert with MyISAM. Disable with --concurrent-insert=0.", - (uchar**) &myisam_concurrent_insert, (uchar**) &myisam_concurrent_insert, + &myisam_concurrent_insert, &myisam_concurrent_insert, 0, GET_ULONG, OPT_ARG, 1, 0, 2, 0, 0, 0}, {"console", OPT_CONSOLE, "Write error output on screen; don't remove the console window on windows.", - (uchar**) &opt_console, (uchar**) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0, + &opt_console, &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"datadir", 'h', "Path to the database root.", (uchar**) &mysql_data_home, - (uchar**) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"datadir", 'h', "Path to the database root.", &mysql_data_home, + &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DBUG_OFF - {"debug", '#', "Debug log.", (uchar**) &default_dbug_option, - (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Debug log.", &default_dbug_option, + &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"default-character-set", OPT_DEFAULT_CHARACTER_SET_OLD, "Set the default character set (deprecated option, use --character-set-server instead).", - (uchar**) &default_character_set_name, (uchar**) &default_character_set_name, + &default_character_set_name, &default_character_set_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"default-collation", OPT_DEFAULT_COLLATION_OLD, "Set the default collation (deprecated option, use --collation-server instead).", - (uchar**) &default_collation_name, (uchar**) &default_collation_name, + {"default-collation", OPT_DEFAULT_COLLATION_OLD, "Set the default collation " + "(deprecated option, use --collation-server instead).", + &default_collation_name, &default_collation_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"default-storage-engine", OPT_STORAGE_ENGINE, "Set the default storage engine (table type) for tables.", - (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str, + &default_storage_engine_str, &default_storage_engine_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-table-type", OPT_STORAGE_ENGINE, "(deprecated) Use --default-storage-engine.", - (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str, + &default_storage_engine_str, &default_storage_engine_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-time-zone", OPT_DEFAULT_TIME_ZONE, "Set the default time zone.", - (uchar**) &default_tz_name, (uchar**) &default_tz_name, + &default_tz_name, &default_tz_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE.", 0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL, - "Don't flush key buffers between writes for any MyISAM table. (Deprecated option, use --delay-key-write=all instead.)", + "Don't flush key buffers between writes for any MyISAM table. " + "(Deprecated option, use --delay-key-write=all instead.)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_OPENSSL {"des-key-file", OPT_DES_KEY_FILE, "Load keys for des_encrypt() and des_encrypt from given file.", - (uchar**) &des_key_file, (uchar**) &des_key_file, 0, GET_STR, REQUIRED_ARG, + &des_key_file, &des_key_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_OPENSSL */ #ifdef HAVE_REPLICATION {"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT, "Option used by mysql-test for debugging and testing of replication.", - (uchar**) &disconnect_slave_event_count, - (uchar**) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, - 0, 0, 0}, + &disconnect_slave_event_count, &disconnect_slave_event_count, + 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_REPLICATION */ {"enable-locking", OPT_ENABLE_LOCK, "Deprecated option, use --external-locking instead.", - (uchar**) &opt_external_locking, (uchar**) &opt_external_locking, + &opt_external_locking, &opt_external_locking, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef __NT__ {"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).", - (uchar**) &opt_enable_named_pipe, (uchar**) &opt_enable_named_pipe, 0, GET_BOOL, + &opt_enable_named_pipe, &opt_enable_named_pipe, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif #ifdef HAVE_STACK_TRACE_ON_SEGV {"enable-pstack", OPT_DO_PSTACK, "Print a symbolic stack trace on failure.", - (uchar**) &opt_do_pstack, (uchar**) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0, + &opt_do_pstack, &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_STACK_TRACE_ON_SEGV */ {"engine-condition-pushdown", OPT_ENGINE_CONDITION_PUSHDOWN, "Push supported query conditions to the storage engine.", - (uchar**) &global_system_variables.engine_condition_pushdown, - (uchar**) &global_system_variables.engine_condition_pushdown, + &global_system_variables.engine_condition_pushdown, + &global_system_variables.engine_condition_pushdown, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, /* See how it's handled in get_one_option() */ {"event-scheduler", OPT_EVENT_SCHEDULER, "Enable/disable the event scheduler.", NULL, NULL, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"exit-info", 'T', "Used for debugging. Use at your own risk.", 0, 0, 0, GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"external-locking", OPT_USE_LOCKING, "Use system (external) locking (disabled by default). With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running. Disable with --skip-external-locking.", - (uchar**) &opt_external_locking, (uchar**) &opt_external_locking, + {"external-locking", OPT_USE_LOCKING, "Use system (external) locking " + "(disabled by default). With this option enabled you can run myisamchk " + "to test (not repair) tables while the MySQL server is running. " + "Disable with --skip-external-locking.", + &opt_external_locking, &opt_external_locking, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"flush", OPT_FLUSH, "Flush tables to disk between SQL commands.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -5973,64 +5978,61 @@ struct my_option my_long_options[] = easier to do */ {"gdb", OPT_DEBUGGING, "Set up signals usable for debugging.", - (uchar**) &opt_debugging, (uchar**) &opt_debugging, + &opt_debugging, &opt_debugging, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"general_log", OPT_GENERAL_LOG, - "Enable/disable general log.", (uchar**) &opt_log, - (uchar**) &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, + "Enable/disable general log.", &opt_log, + &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_LARGE_PAGES - {"large-pages", OPT_ENABLE_LARGE_PAGES, "Enable support for large pages. \ -Disable with --skip-large-pages.", - (uchar**) &opt_large_pages, (uchar**) &opt_large_pages, 0, GET_BOOL, NO_ARG, 0, 0, 0, - 0, 0, 0}, + {"large-pages", OPT_ENABLE_LARGE_PAGES, "Enable support for large pages. " + "Disable with --skip-large-pages.", &opt_large_pages, &opt_large_pages, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"ignore-builtin-innodb", OPT_IGNORE_BUILTIN_INNODB , "Disable initialization of builtin InnoDB plugin.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection.", - (uchar**) &opt_init_connect, (uchar**) &opt_init_connect, 0, GET_STR_ALLOC, + &opt_init_connect, &opt_init_connect, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DISABLE_GRANT_OPTIONS {"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup.", - (uchar**) &opt_init_file, (uchar**) &opt_init_file, 0, GET_STR, REQUIRED_ARG, + &opt_init_file, &opt_init_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed by a slave server \ each time the SQL thread starts.", - (uchar**) &opt_init_slave, (uchar**) &opt_init_slave, 0, GET_STR_ALLOC, + &opt_init_slave, &opt_init_slave, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"language", 'L', "Client error messages in given language. May be given as a full path.", - (uchar**) &language_ptr, (uchar**) &language_ptr, 0, GET_STR, REQUIRED_ARG, + &language_ptr, &language_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lc-time-names", OPT_LC_TIME_NAMES, "Set the language used for the month names and the days of the week.", - (uchar**) &lc_time_names_name, - (uchar**) &lc_time_names_name, + &lc_time_names_name, &lc_time_names_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE (takes values 1 or 0).", - (uchar**) &opt_local_infile, - (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, + &opt_local_infile, &opt_local_infile, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"log", 'l', "Log connections and queries to file (deprecated option, use " - "--general_log/--general_log_file instead).", (uchar**) &opt_logname, - (uchar**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + "--general_log/--general_log_file instead).", &opt_logname, + &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"general_log_file", OPT_GENERAL_LOG_FILE, - "Log connections and queries to given file.", (uchar**) &opt_logname, - (uchar**) &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Log connections and queries to given file.", &opt_logname, + &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"log-bin", OPT_BIN_LOG, "Log update queries in binary format. Optional (but strongly recommended " "to avoid replication problems if server's hostname changes) argument " "should be the chosen location for the binary log files.", - (uchar**) &opt_bin_logname, (uchar**) &opt_bin_logname, 0, GET_STR_ALLOC, + &opt_bin_logname, &opt_bin_logname, 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-bin-index", OPT_BIN_LOG_INDEX, "File that holds the names for last binary log files.", - (uchar**) &opt_binlog_index_name, (uchar**) &opt_binlog_index_name, 0, GET_STR, + &opt_binlog_index_name, &opt_binlog_index_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifndef TO_BE_REMOVED_IN_5_1_OR_6_0 /* @@ -6041,7 +6043,7 @@ each time the SQL thread starts.", */ {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS_OLD, "(deprecated) Use log-bin-trust-function-creators.", - (uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0, + &trust_function_creators, &trust_function_creators, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif /* @@ -6056,188 +6058,195 @@ each time the SQL thread starts.", "Note that if ALL connections to this server ALWAYS use row-based binary " "logging, the security issues do not exist and the binary logging cannot " "break, so you can safely set this to 1." - ,(uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0, + ,&trust_function_creators, &trust_function_creators, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-error", OPT_ERROR_LOG_FILE, "Error log file.", - (uchar**) &log_error_file_ptr, (uchar**) &log_error_file_ptr, 0, GET_STR, + &log_error_file_ptr, &log_error_file_ptr, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.", - (uchar**) &myisam_log_filename, (uchar**) &myisam_log_filename, 0, GET_STR, + &myisam_log_filename, &myisam_log_filename, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-long-format", '0', - "Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.", + "Log some extra information to update log. Please note that this option " + "is deprecated; see --log-short-format option.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef WITH_CSV_STORAGE_ENGINE {"log-output", OPT_LOG_OUTPUT, "Syntax: log-output[=value[,value...]], where \"value\" could be TABLE, " "FILE or NONE.", - (uchar**) &log_output_str, (uchar**) &log_output_str, 0, + &log_output_str, &log_output_str, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"log-queries-not-using-indexes", OPT_LOG_QUERIES_NOT_USING_INDEXES, "Log queries that are executed without benefit of any index to the slow log if it is open.", - (uchar**) &opt_log_queries_not_using_indexes, (uchar**) &opt_log_queries_not_using_indexes, + &opt_log_queries_not_using_indexes, &opt_log_queries_not_using_indexes, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-short-format", OPT_SHORT_LOG_FORMAT, "Don't log extra information to update and slow-query logs.", - (uchar**) &opt_short_log_format, (uchar**) &opt_short_log_format, + &opt_short_log_format, &opt_short_log_format, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-slave-updates", OPT_LOG_SLAVE_UPDATES, - "Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.", - (uchar**) &opt_log_slave_updates, (uchar**) &opt_log_slave_updates, 0, GET_BOOL, + "Tells the slave to log the updates from the slave thread to the binary log. " + "You will need to turn it on if you plan to daisy-chain the slaves.", + &opt_log_slave_updates, &opt_log_slave_updates, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-slow-admin-statements", OPT_LOG_SLOW_ADMIN_STATEMENTS, - "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.", - (uchar**) &opt_log_slow_admin_statements, - (uchar**) &opt_log_slow_admin_statements, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements " + "to the slow log if it is open.", &opt_log_slow_admin_statements, + &opt_log_slow_admin_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-slow-slave-statements", OPT_LOG_SLOW_SLAVE_STATEMENTS, "Log slow statements executed by slave thread to the slow log if it is open.", - (uchar**) &opt_log_slow_slave_statements, - (uchar**) &opt_log_slow_slave_statements, + &opt_log_slow_slave_statements, + &opt_log_slow_slave_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log_slow_queries", OPT_SLOW_QUERY_LOG, "Log slow queries to a table or log file. Defaults logging to table " "mysql.slow_log or hostname-slow.log if --log-output=file is used. " "Must be enabled to activate other slow log options. " "(deprecated option, use --slow_query_log/--slow_query_log_file instead)", - (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG, + &opt_slow_logname, &opt_slow_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"slow_query_log_file", OPT_SLOW_QUERY_LOG_FILE, - "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.", - (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, + "Log slow queries to given log file. Defaults logging to hostname-slow.log. " + "Must be enabled to activate other slow log options.", + &opt_slow_logname, &opt_slow_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"log-tc", OPT_LOG_TC, "Path to transaction coordinator log (used for transactions that affect " "more than one storage engine, when binary log is disabled).", - (uchar**) &opt_tc_log_file, (uchar**) &opt_tc_log_file, 0, GET_STR, + &opt_tc_log_file, &opt_tc_log_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_MMAP {"log-tc-size", OPT_LOG_TC_SIZE, "Size of transaction coordinator log.", - (uchar**) &opt_tc_log_size, (uchar**) &opt_tc_log_size, 0, GET_ULONG, + &opt_tc_log_size, &opt_tc_log_size, 0, GET_ULONG, REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, ULONG_MAX, 0, TC_LOG_PAGE_SIZE, 0}, #endif {"log-update", OPT_UPDATE_LOG, "The update log is deprecated since version 5.0, is replaced by the binary " "log and this option just turns on --log-bin instead.", - (uchar**) &opt_update_logname, (uchar**) &opt_update_logname, 0, GET_STR, + &opt_update_logname, &opt_update_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"log-warnings", 'W', "Log some not critical warnings to the log file.", - (uchar**) &global_system_variables.log_warnings, - (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0, + &global_system_variables.log_warnings, + &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"low-priority-updates", OPT_LOW_PRIORITY_UPDATES, "INSERT/DELETE/UPDATE has lower priority than selects.", - (uchar**) &global_system_variables.low_priority_updates, - (uchar**) &max_system_variables.low_priority_updates, + &global_system_variables.low_priority_updates, + &max_system_variables.low_priority_updates, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"master-connect-retry", OPT_MASTER_CONNECT_RETRY, "The number of seconds the slave thread will sleep before retrying to " "connect to the master, in case the master goes down or the connection " "is lost.", - (uchar**) &master_connect_retry, (uchar**) &master_connect_retry, 0, GET_UINT, + &master_connect_retry, &master_connect_retry, 0, GET_UINT, REQUIRED_ARG, 60, 0, 0, 0, 0, 0}, {"master-host", OPT_MASTER_HOST, - "Master hostname or IP address for replication. If not set, the slave thread will not be started. Note that the setting of master-host will be ignored if there exists a valid master.info file.", - (uchar**) &master_host, (uchar**) &master_host, 0, GET_STR, REQUIRED_ARG, 0, 0, + "Master hostname or IP address for replication. If not set, the slave " + "thread will not be started. Note that the setting of master-host will " + "be ignored if there exists a valid master.info file.", + &master_host, &master_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"master-info-file", OPT_MASTER_INFO_FILE, - "The location and name of the file that remembers the master and where the I/O replication \ -thread is in the master's binlogs.", - (uchar**) &master_info_file, (uchar**) &master_info_file, 0, GET_STR, + "The location and name of the file that remembers the master and where " + "the I/O replication thread is in the master's binlogs.", + &master_info_file, &master_info_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"master-password", OPT_MASTER_PASSWORD, "The password the slave thread will authenticate with when connecting to " "the master. If not set, an empty password is assumed. The value in " "master.info will take precedence if it can be read.", - (uchar**)&master_password, (uchar**)&master_password, 0, + &master_password, &master_password, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"master-port", OPT_MASTER_PORT, - "The port the master is listening on. If not set, the compiled setting of MYSQL_PORT is assumed. If you have not tinkered with configure options, this should be 3306. The value in master.info will take precedence if it can be read.", - (uchar**) &master_port, (uchar**) &master_port, 0, GET_UINT, REQUIRED_ARG, + "The port the master is listening on. If not set, the compiled setting of " + "MYSQL_PORT is assumed. If you have not tinkered with configure options, " + "this should be 3306. The value in master.info will take precedence if it " + "can be read.", &master_port, &master_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, {"master-retry-count", OPT_MASTER_RETRY_COUNT, "The number of tries the slave will make to connect to the master before giving up.", - (uchar**) &master_retry_count, (uchar**) &master_retry_count, 0, GET_ULONG, + &master_retry_count, &master_retry_count, 0, GET_ULONG, REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0}, {"master-ssl", OPT_MASTER_SSL, "Enable the slave to connect to the master using SSL.", - (uchar**) &master_ssl, (uchar**) &master_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + &master_ssl, &master_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-ca", OPT_MASTER_SSL_CA, "Master SSL CA file. Only applies if you have enabled master-ssl.", - (uchar**) &master_ssl_ca, (uchar**) &master_ssl_ca, 0, GET_STR, OPT_ARG, + &master_ssl_ca, &master_ssl_ca, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-capath", OPT_MASTER_SSL_CAPATH, "Master SSL CA path. Only applies if you have enabled master-ssl.", - (uchar**) &master_ssl_capath, (uchar**) &master_ssl_capath, 0, GET_STR, OPT_ARG, + &master_ssl_capath, &master_ssl_capath, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-cert", OPT_MASTER_SSL_CERT, "Master SSL certificate file name. Only applies if you have enabled " "master-ssl.", - (uchar**) &master_ssl_cert, (uchar**) &master_ssl_cert, 0, GET_STR, OPT_ARG, + &master_ssl_cert, &master_ssl_cert, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-cipher", OPT_MASTER_SSL_CIPHER, "Master SSL cipher. Only applies if you have enabled master-ssl.", - (uchar**) &master_ssl_cipher, (uchar**) &master_ssl_capath, 0, GET_STR, OPT_ARG, + &master_ssl_cipher, &master_ssl_capath, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"master-ssl-key", OPT_MASTER_SSL_KEY, "Master SSL keyfile name. Only applies if you have enabled master-ssl.", - (uchar**) &master_ssl_key, (uchar**) &master_ssl_key, 0, GET_STR, OPT_ARG, + &master_ssl_key, &master_ssl_key, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"master-user", OPT_MASTER_USER, - "The username the slave thread will use for authentication when connecting to the master. The user must have FILE privilege. If the master user is not set, user test is assumed. The value in master.info will take precedence if it can be read.", - (uchar**) &master_user, (uchar**) &master_user, 0, GET_STR, REQUIRED_ARG, 0, 0, + "The username the slave thread will use for authentication when " + "connecting to the master. The user must have FILE privilege. " + "If the master user is not set, user test is assumed. The value " + "in master.info will take precedence if it can be read.", + &master_user, &master_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION {"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS, "Option used by mysql-test for debugging and testing of replication.", - (uchar**) &max_binlog_dump_events, (uchar**) &max_binlog_dump_events, 0, + &max_binlog_dump_events, &max_binlog_dump_events, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_REPLICATION */ - {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (uchar**) &locked_in_memory, - (uchar**) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", &locked_in_memory, + &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"myisam-recover", OPT_MYISAM_RECOVER, "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.", - (uchar**) &myisam_recover_options_str, (uchar**) &myisam_recover_options_str, 0, + &myisam_recover_options_str, &myisam_recover_options_str, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE {"ndb-connectstring", OPT_NDB_CONNECTSTRING, "Connect string for ndbcluster.", - (uchar**) &opt_ndb_connectstring, - (uchar**) &opt_ndb_connectstring, + &opt_ndb_connectstring, &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ndb-mgmd-host", OPT_NDB_MGMD, "Set host and port for ndb_mgmd. Syntax: hostname[:port]", - (uchar**) &opt_ndb_mgmd, - (uchar**) &opt_ndb_mgmd, + &opt_ndb_mgmd, &opt_ndb_mgmd, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ndb-nodeid", OPT_NDB_NODEID, "Nodeid for this mysqlserver in the cluster.", - (uchar**) &opt_ndb_nodeid, - (uchar**) &opt_ndb_nodeid, + &opt_ndb_nodeid, + &opt_ndb_nodeid, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, "Specify number of autoincrement values that are prefetched.", - (uchar**) &global_system_variables.ndb_autoincrement_prefetch_sz, - (uchar**) &max_system_variables.ndb_autoincrement_prefetch_sz, + &global_system_variables.ndb_autoincrement_prefetch_sz, + &max_system_variables.ndb_autoincrement_prefetch_sz, 0, GET_ULONG, REQUIRED_ARG, 1, 1, 256, 0, 0, 0}, {"ndb-force-send", OPT_NDB_FORCE_SEND, "Force send of buffers to ndb immediately without waiting for " "other threads.", - (uchar**) &global_system_variables.ndb_force_send, - (uchar**) &global_system_variables.ndb_force_send, + &global_system_variables.ndb_force_send, + &global_system_variables.ndb_force_send, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb_force_send", OPT_NDB_FORCE_SEND, "same as --ndb-force-send.", - (uchar**) &global_system_variables.ndb_force_send, - (uchar**) &global_system_variables.ndb_force_send, + &global_system_variables.ndb_force_send, + &global_system_variables.ndb_force_send, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb-extra-logging", OPT_NDB_EXTRA_LOGGING, "Turn on more logging in the error log.", - (uchar**) &ndb_extra_logging, - (uchar**) &ndb_extra_logging, + &ndb_extra_logging, + &ndb_extra_logging, 0, GET_INT, OPT_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_NDB_BINLOG {"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP, @@ -6245,86 +6254,87 @@ thread is in the master's binlogs.", "E.g., 3 means that if the difference between what epoch has been received " "from the storage nodes and what has been applied to the binlog is 3 or more, " "a status message will be sent to the cluster log.", - (uchar**) &ndb_report_thresh_binlog_epoch_slip, - (uchar**) &ndb_report_thresh_binlog_epoch_slip, + &ndb_report_thresh_binlog_epoch_slip, + &ndb_report_thresh_binlog_epoch_slip, 0, GET_ULONG, REQUIRED_ARG, 3, 0, 256, 0, 0, 0}, {"ndb-report-thresh-binlog-mem-usage", OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE, "Threshold on percentage of free memory before reporting binlog status. E.g., " "10 means that if amount of available memory for receiving binlog data from " "the storage nodes goes below 10%, " "a status message will be sent to the cluster log.", - (uchar**) &ndb_report_thresh_binlog_mem_usage, - (uchar**) &ndb_report_thresh_binlog_mem_usage, + &ndb_report_thresh_binlog_mem_usage, + &ndb_report_thresh_binlog_mem_usage, 0, GET_ULONG, REQUIRED_ARG, 10, 0, 100, 0, 0, 0}, #endif {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT, "Use exact records count during query planning and for fast " "select count(*), disable for faster queries.", - (uchar**) &global_system_variables.ndb_use_exact_count, - (uchar**) &global_system_variables.ndb_use_exact_count, + &global_system_variables.ndb_use_exact_count, + &global_system_variables.ndb_use_exact_count, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT, "Same as --ndb-use-exact-count.", - (uchar**) &global_system_variables.ndb_use_exact_count, - (uchar**) &global_system_variables.ndb_use_exact_count, + &global_system_variables.ndb_use_exact_count, + &global_system_variables.ndb_use_exact_count, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb-use-transactions", OPT_NDB_USE_TRANSACTIONS, "Use transactions for large inserts, if enabled then large " "inserts will be split into several smaller transactions", - (uchar**) &global_system_variables.ndb_use_transactions, - (uchar**) &global_system_variables.ndb_use_transactions, + &global_system_variables.ndb_use_transactions, + &global_system_variables.ndb_use_transactions, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS, "Same as --ndb-use-transactions.", - (uchar**) &global_system_variables.ndb_use_transactions, - (uchar**) &global_system_variables.ndb_use_transactions, + &global_system_variables.ndb_use_transactions, + &global_system_variables.ndb_use_transactions, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb-shm", OPT_NDB_SHM, "Use shared memory connections when available.", - (uchar**) &opt_ndb_shm, - (uchar**) &opt_ndb_shm, + &opt_ndb_shm, &opt_ndb_shm, 0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0}, {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION, "Select nodes for transactions in a more optimal way.", - (uchar**) &opt_ndb_optimized_node_selection, - (uchar**) &opt_ndb_optimized_node_selection, + &opt_ndb_optimized_node_selection, + &opt_ndb_optimized_node_selection, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, { "ndb-cache-check-time", OPT_NDB_CACHE_CHECK_TIME, "A dedicated thread is created to, at the given milliseconds interval, " "invalidate the query cache if another MySQL server in the cluster has " "changed the data in the database.", - (uchar**) &opt_ndb_cache_check_time, (uchar**) &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG, + &opt_ndb_cache_check_time, &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG, 0, 0, LONG_TIMEOUT, 0, 1, 0}, {"ndb-index-stat-enable", OPT_NDB_INDEX_STAT_ENABLE, "Use ndb index statistics in query optimization.", - (uchar**) &global_system_variables.ndb_index_stat_enable, - (uchar**) &max_system_variables.ndb_index_stat_enable, + &global_system_variables.ndb_index_stat_enable, + &max_system_variables.ndb_index_stat_enable, 0, GET_BOOL, OPT_ARG, 0, 0, 1, 0, 0, 0}, #endif {"ndb-use-copying-alter-table", OPT_NDB_USE_COPYING_ALTER_TABLE, - "Force ndbcluster to always copy tables at alter table (should only be used if on-line alter table fails).", - (uchar**) &global_system_variables.ndb_use_copying_alter_table, - (uchar**) &global_system_variables.ndb_use_copying_alter_table, + "Force ndbcluster to always copy tables at alter table " + "(should only be used if on-line alter table fails).", + &global_system_variables.ndb_use_copying_alter_table, + &global_system_variables.ndb_use_copying_alter_table, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"new", 'n', "Use very new, possibly 'unsafe', functions.", - (uchar**) &global_system_variables.new_mode, - (uchar**) &max_system_variables.new_mode, + &global_system_variables.new_mode, + &max_system_variables.new_mode, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef NOT_YET {"no-mix-table-types", OPT_NO_MIX_TYPE, "Don't allow commands that use two different table types.", - (uchar**) &opt_no_mix_types, (uchar**) &opt_no_mix_types, 0, GET_BOOL, NO_ARG, + &opt_no_mix_types, &opt_no_mix_types, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"old-alter-table", OPT_OLD_ALTER_TABLE, "Use old, non-optimized alter table.", - (uchar**) &global_system_variables.old_alter_table, - (uchar**) &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG, + &global_system_variables.old_alter_table, + &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"old-passwords", OPT_OLD_PASSWORDS, "Use old password encryption method (needed for 4.0 and older clients).", - (uchar**) &global_system_variables.old_passwords, - (uchar**) &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG, + {"old-passwords", OPT_OLD_PASSWORDS, "Use old password " + "encryption method (needed for 4.0 and older clients).", + &global_system_variables.old_passwords, + &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"one-thread", OPT_ONE_THREAD, "(Deprecated): Only use one thread (for debugging under Linux). Use " @@ -6333,10 +6343,10 @@ thread is in the master's binlogs.", {"old-style-user-limits", OPT_OLD_STYLE_USER_LIMITS, "Enable old-style user limits (before 5.0.3, user resources were counted " "per each user+host vs. per account).", - (uchar**) &opt_old_style_user_limits, (uchar**) &opt_old_style_user_limits, + &opt_old_style_user_limits, &opt_old_style_user_limits, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.", - (uchar**) &pidfile_name_ptr, (uchar**) &pidfile_name_ptr, 0, GET_STR, + &pidfile_name_ptr, &pidfile_name_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " @@ -6344,64 +6354,85 @@ thread is in the master's binlogs.", "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &mysqld_port, - (uchar**) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &mysqld_port, + &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port-open-timeout", OPT_PORT_OPEN_TIMEOUT, "Maximum time in seconds to wait for the port to become free. " - "(Default: No wait).", (uchar**) &mysqld_port_timeout, - (uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "(Default: No wait).", &mysqld_port_timeout, + &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) {"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory.", - (uchar**) &global_system_variables.profiling_history_size, - (uchar**) &max_system_variables.profiling_history_size, + &global_system_variables.profiling_history_size, + &max_system_variables.profiling_history_size, 0, GET_ULONG, REQUIRED_ARG, 15, 0, 100, 0, 0, 0}, #endif {"relay-log", OPT_RELAY_LOG, "The location and name to use for relay logs.", - (uchar**) &opt_relay_logname, (uchar**) &opt_relay_logname, 0, + &opt_relay_logname, &opt_relay_logname, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"relay-log-index", OPT_RELAY_LOG_INDEX, "The location and name to use for the file that keeps a list of the last \ relay logs.", - (uchar**) &opt_relaylog_index_name, (uchar**) &opt_relaylog_index_name, 0, + &opt_relaylog_index_name, &opt_relaylog_index_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE, "The location and name of the file that remembers where the SQL replication \ thread is in the relay logs.", - (uchar**) &relay_log_info_file, (uchar**) &relay_log_info_file, 0, GET_STR, + &relay_log_info_file, &relay_log_info_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replicate-do-db", OPT_REPLICATE_DO_DB, - "Tells the slave thread to restrict replication to the specified database. To specify more than one database, use the directive multiple times, once for each database. Note that this will only work if you do not use cross-database queries such as UPDATE some_db.some_table SET foo='bar' while having selected a different or no database. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-do-table=db_name.%.", + "Tells the slave thread to restrict replication to the specified database. " + "To specify more than one database, use the directive multiple times, " + "once for each database. Note that this will only work if you do not use " + "cross-database queries such as UPDATE some_db.some_table SET foo='bar' " + "while having selected a different or no database. If you need cross " + "database updates to work, make sure you have 3.23.28 or later, and use " + "replicate-wild-do-table=db_name.%.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replicate-do-table", OPT_REPLICATE_DO_TABLE, - "Tells the slave thread to restrict replication to the specified table. To specify more than one table, use the directive multiple times, once for each table. This will work for cross-database updates, in contrast to replicate-do-db.", - 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Tells the slave thread to restrict replication to the specified table. " + "To specify more than one table, use the directive multiple times, once " + "for each table. This will work for cross-database updates, in contrast " + "to replicate-do-db.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replicate-ignore-db", OPT_REPLICATE_IGNORE_DB, - "Tells the slave thread to not replicate to the specified database. To specify more than one database to ignore, use the directive multiple times, once for each database. This option will not work if you use cross database updates. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-ignore-table=db_name.%. ", - 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Tells the slave thread to not replicate to the specified database. To " + "specify more than one database to ignore, use the directive multiple " + "times, once for each database. This option will not work if you use " + "cross database updates. If you need cross database updates to work, " + "make sure you have 3.23.28 or later, and use replicate-wild-ignore-" + "table=db_name.%. ", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replicate-ignore-table", OPT_REPLICATE_IGNORE_TABLE, "Tells the slave thread to not replicate to the specified table. To specify " "more than one table to ignore, use the directive multiple times, once for " "each table. This will work for cross-database updates, in contrast to " - "replicate-ignore-db.", - 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "replicate-ignore-db.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replicate-rewrite-db", OPT_REPLICATE_REWRITE_DB, - "Updates to a database with a different name than the original. Example: replicate-rewrite-db=master_db_name->slave_db_name.", + "Updates to a database with a different name than the original. Example: " + "replicate-rewrite-db=master_db_name->slave_db_name.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION {"replicate-same-server-id", OPT_REPLICATE_SAME_SERVER_ID, - "In replication, if set to 1, do not skip events having our server id. \ -Default value is 0 (to break infinite loops in circular replication). \ -Can't be set to 1 if --log-slave-updates is used.", - (uchar**) &replicate_same_server_id, - (uchar**) &replicate_same_server_id, + "In replication, if set to 1, do not skip events having our server id. " + "Default value is 0 (to break infinite loops in circular replication). " + "Can't be set to 1 if --log-slave-updates is used.", + &replicate_same_server_id, &replicate_same_server_id, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"replicate-wild-do-table", OPT_REPLICATE_WILD_DO_TABLE, - "Tells the slave thread to restrict replication to the tables that match the specified wildcard pattern. To specify more than one table, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-do-table=foo%.bar% will replicate only updates to tables in all databases that start with foo and whose table names start with bar.", + "Tells the slave thread to restrict replication to the tables that match " + "the specified wildcard pattern. To specify more than one table, use the " + "directive multiple times, once for each table. This will work for cross-" + "database updates. Example: replicate-wild-do-table=foo%.bar% will " + "replicate only updates to tables in all databases that start with foo " + "and whose table names start with bar.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replicate-wild-ignore-table", OPT_REPLICATE_WILD_IGNORE_TABLE, - "Tells the slave thread to not replicate to the tables that match the given wildcard pattern. To specify more than one table to ignore, use the directive multiple times, once for each table. This will work for cross-database updates. Example: replicate-wild-ignore-table=foo%.bar% will not do updates to tables in databases that start with foo and whose table names start with bar.", + "Tells the slave thread to not replicate to the tables that match the " + "given wildcard pattern. To specify more than one table to ignore, use " + "the directive multiple times, once for each table. This will work for " + "cross-database updates. Example: replicate-wild-ignore-table=foo%.bar% " + "will not do updates to tables in databases that start with foo and whose " + "table names start with bar.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, // In replication, we may need to tell the other servers how to connect {"report-host", OPT_REPORT_HOST, @@ -6412,19 +6443,22 @@ Can't be set to 1 if --log-slave-updates is used.", "from the socket once the slave connects. Due to NAT and other routing " "issues, that IP may not be valid for connecting to the slave from the " "master or other hosts.", - (uchar**) &report_host, (uchar**) &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0, + &report_host, &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"report-password", OPT_REPORT_PASSWORD, "Undocumented.", - (uchar**) &report_password, (uchar**) &report_password, 0, GET_STR, + &report_password, &report_password, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"report-port", OPT_REPORT_PORT, - "Port for connecting to slave reported to the master during slave registration. Set it only if the slave is listening on a non-default port or if you have a special tunnel from the master or other clients to the slave. If not sure, leave this option unset.", - (uchar**) &report_port, (uchar**) &report_port, 0, GET_UINT, REQUIRED_ARG, + "Port for connecting to slave reported to the master during slave " + "registration. Set it only if the slave is listening on a non-default " + "port or if you have a special tunnel from the master or other clients " + "to the slave. If not sure, leave this option unset.", + &report_port, &report_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, - {"report-user", OPT_REPORT_USER, "Undocumented.", (uchar**) &report_user, - (uchar**) &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"report-user", OPT_REPORT_USER, "Undocumented.", &report_user, + &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented.", - (uchar**) &rpl_recovery_rank, (uchar**) &rpl_recovery_rank, 0, GET_ULONG, + &rpl_recovery_rank, &rpl_recovery_rank, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -6435,21 +6469,21 @@ Can't be set to 1 if --log-slave-updates is used.", #endif {"safe-user-create", OPT_SAFE_USER_CREATE, "Don't allow new user creation by the user who has no write privileges to the mysql.user table.", - (uchar**) &opt_safe_user_create, (uchar**) &opt_safe_user_create, 0, GET_BOOL, + &opt_safe_user_create, &opt_safe_user_create, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT, "Simulate memory shortage when compiled with the --with-debug=full option.", 0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"secure-auth", OPT_SECURE_AUTH, "Disallow authentication for accounts that have old (pre-4.1) passwords.", - (uchar**) &opt_secure_auth, (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, + &opt_secure_auth, &opt_secure_auth, 0, GET_BOOL, NO_ARG, my_bool(0), 0, 0, 0, 0, 0}, {"secure-file-priv", OPT_SECURE_FILE_PRIV, "Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory.", - (uchar**) &opt_secure_file_priv, (uchar**) &opt_secure_file_priv, 0, + &opt_secure_file_priv, &opt_secure_file_priv, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"server-id", OPT_SERVER_ID, "Uniquely identifies the server instance in the community of replication partners.", - (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, UINT_MAX32, + &server_id, &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, UINT_MAX32, 0, 0, 0}, {"set-variable", 'O', "Change the value of a variable. Please note that this option is deprecated; " @@ -6457,22 +6491,22 @@ Can't be set to 1 if --log-slave-updates is used.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory", OPT_ENABLE_SHARED_MEMORY, - "Enable the shared memory.",(uchar**) &opt_enable_shared_memory, (uchar**) &opt_enable_shared_memory, + "Enable the shared memory.",&opt_enable_shared_memory, &opt_enable_shared_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif #ifdef HAVE_SMEM {"shared-memory-base-name",OPT_SHARED_MEMORY_BASE_NAME, - "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, + "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO, "Show user and password in SHOW SLAVE HOSTS on this master.", - (uchar**) &opt_show_slave_auth_info, (uchar**) &opt_show_slave_auth_info, 0, + &opt_show_slave_auth_info, &opt_show_slave_auth_info, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DISABLE_GRANT_OPTIONS {"skip-grant-tables", OPT_SKIP_GRANT, "Start without grant tables. This gives all users FULL ACCESS to all tables.", - (uchar**) &opt_noacl, (uchar**) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, + &opt_noacl, &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0, @@ -6499,49 +6533,55 @@ Can't be set to 1 if --log-slave-updates is used.", "Don't allow 'SHOW DATABASE' commands.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-slave-start", OPT_SKIP_SLAVE_START, - "If set, slave is not autostarted.", (uchar**) &opt_skip_slave_start, - (uchar**) &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + "If set, slave is not autostarted.", &opt_skip_slave_start, + &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-stack-trace", OPT_SKIP_STACK_TRACE, "Don't print a stack trace on failure.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Deprecated option. Use --skip-symbolic-links instead.", + {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. " + "Deprecated option. Use --skip-symbolic-links instead.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-thread-priority", OPT_SKIP_PRIOR, "Don't give threads different priorities. Deprecated option.", 0, 0, 0, GET_NO_ARG, NO_ARG, DEFAULT_SKIP_THREAD_PRIORITY, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR, - "The location where the slave should put its temporary files when \ -replicating a LOAD DATA INFILE command.", - (uchar**) &slave_load_tmpdir, (uchar**) &slave_load_tmpdir, 0, GET_STR_ALLOC, + "The location where the slave should put its temporary files when " + "replicating a LOAD DATA INFILE command.", + &slave_load_tmpdir, &slave_load_tmpdir, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"slave-skip-errors", OPT_SLAVE_SKIP_ERRORS, "Tells the slave thread to continue replication when a query event returns an error from the provided list.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"slave-exec-mode", OPT_SLAVE_EXEC_MODE, - "Modes for how replication events should be executed. Legal values are STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, replication will not stop for operations that are idempotent. In STRICT mode, replication will stop on any unexpected difference between the master and the slave.", - (uchar**) &slave_exec_mode_str, (uchar**) &slave_exec_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Modes for how replication events should be executed. Legal values are " + "STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, replication will " + "not stop for operations that are idempotent. In STRICT mode, replication " + "will stop on any unexpected difference between the master and the slave.", + &slave_exec_mode_str, &slave_exec_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"slow-query-log", OPT_SLOW_LOG, - "Enable/disable slow query log.", (uchar**) &opt_slow_log, - (uchar**) &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, + "Enable/disable slow query log.", &opt_slow_log, + &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"socket", OPT_SOCKET, "Socket file to use for connection.", - (uchar**) &mysqld_unix_port, (uchar**) &mysqld_unix_port, 0, GET_STR, + &mysqld_unix_port, &mysqld_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_REPLICATION {"sporadic-binlog-dump-fail", OPT_SPORADIC_BINLOG_DUMP_FAIL, "Option used by mysql-test for debugging and testing of replication.", - (uchar**) &opt_sporadic_binlog_dump_fail, - (uchar**) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, + &opt_sporadic_binlog_dump_fail, + &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_REPLICATION */ {"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME, - "The update log is deprecated since version 5.0, is replaced by the binary \ -log and this option does nothing anymore.", + "The update log is deprecated since version 5.0, is replaced by the " + "binary log and this option does nothing anymore.", 0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0}, {"sql-mode", OPT_SQL_MODE, - "Syntax: sql-mode=option[,option[,option...]] where option can be one of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.", - (uchar**) &sql_mode_str, (uchar**) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0, + "Syntax: sql-mode=option[,option[,option...]] where option can be one " + "of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, " + "ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.", + &sql_mode_str, &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_OPENSSL #include "sslopt-longopts.h" @@ -6552,7 +6592,7 @@ log and this option does nothing anymore.", NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"symbolic-links", 's', "Enable symbolic link support.", - (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG, + &my_use_symdir, &my_use_symdir, 0, GET_BOOL, NO_ARG, /* The system call realpath() produces warnings under valgrind and purify. These are not suppressed: instead we disable symlinks @@ -6560,33 +6600,35 @@ log and this option does nothing anymore.", */ IF_PURIFY(0,1), 0, 0, 0, 0, 0}, {"sysdate-is-now", OPT_SYSDATE_IS_NOW, - "Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement.", - (uchar**) &global_system_variables.sysdate_is_now, + "Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. " + "Since 5.0, SYSDATE() returns a `dynamic' value different for different " + "invocations, even within the same statement.", + &global_system_variables.sysdate_is_now, 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, {"tc-heuristic-recover", OPT_TC_HEURISTIC_RECOVER, - "Decision to use in heuristic recover process. Possible values are COMMIT or ROLLBACK.", - (uchar**) &opt_tc_heuristic_recover, (uchar**) &opt_tc_heuristic_recover, + "Decision to use in heuristic recover process. Possible values are COMMIT " + "or ROLLBACK.", &opt_tc_heuristic_recover, &opt_tc_heuristic_recover, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #if defined(ENABLED_DEBUG_SYNC) {"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT, "Enable the debug sync facility " "and optionally specify a default wait timeout in seconds. " "A zero value keeps the facility disabled.", - (uchar**) &opt_debug_sync_timeout, 0, + &opt_debug_sync_timeout, 0, 0, GET_UINT, OPT_ARG, 0, 0, UINT_MAX, 0, 0, 0}, #endif /* defined(ENABLED_DEBUG_SYNC) */ {"temp-pool", OPT_TEMP_POOL, #if (ENABLE_TEMP_POOL) - "Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.", + "Using this option will cause most temporary files created to use a small " + "set of names, rather than a unique name for each new file.", #else "This option is ignored on this OS.", #endif - (uchar**) &use_temp_pool, (uchar**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1, + &use_temp_pool, &use_temp_pool, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"timed_mutexes", OPT_TIMED_MUTEXES, "Specify whether to time mutexes (only InnoDB mutexes are currently supported).", - (uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0, + &timed_mutexes, &timed_mutexes, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"tmpdir", 't', "Path for temporary files. Several paths may be specified, separated by a " @@ -6596,133 +6638,139 @@ log and this option does nothing anymore.", "colon (:)" #endif ", in this case they are used in a round-robin fashion.", - (uchar**) &opt_mysql_tmpdir, - (uchar**) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &opt_mysql_tmpdir, &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, {"transaction-isolation", OPT_TX_ISOLATION, "Default transaction isolation level.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"use-symbolic-links", OPT_SYMBOLIC_LINKS, "Enable symbolic link support. Deprecated option; use --symbolic-links instead.", - (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG, + {"use-symbolic-links", OPT_SYMBOLIC_LINKS, "Enable symbolic link support. " + "Deprecated option; use --symbolic-links instead.", + &my_use_symdir, &my_use_symdir, 0, GET_BOOL, NO_ARG, IF_PURIFY(0,1), 0, 0, 0, 0, 0}, {"user", 'u', "Run mysqld daemon as user.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Used with --help option for detailed help.", - (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, - 0, 0}, + &opt_verbose, &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"warnings", OPT_WARNINGS, "Deprecated; use --log-warnings instead.", - (uchar**) &global_system_variables.log_warnings, - (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, + &global_system_variables.log_warnings, + &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, ULONG_MAX, 0, 0, 0}, - { "back_log", OPT_BACK_LOG, - "The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.", - (uchar**) &back_log, (uchar**) &back_log, 0, GET_ULONG, - REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 }, + {"back_log", OPT_BACK_LOG, + "The number of outstanding connection requests MySQL can have. This " + "comes into play when the main MySQL thread gets very many connection " + "requests in a very short time.", &back_log, &back_log, 0, GET_ULONG, + REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 }, {"binlog_cache_size", OPT_BINLOG_CACHE_SIZE, - "The size of the cache to hold the SQL statements for the binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance.", - (uchar**) &binlog_cache_size, (uchar**) &binlog_cache_size, 0, GET_ULONG, + "The size of the cache to hold the SQL statements for the binary log " + "during a transaction. If you often use big, multi-statement " + "transactions you can increase this to get more performance.", + &binlog_cache_size, &binlog_cache_size, 0, GET_ULONG, REQUIRED_ARG, 32*1024L, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0}, {"bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE, - "Size of tree cache used in bulk insert optimization. Note that this is a limit per thread.", - (uchar**) &global_system_variables.bulk_insert_buff_size, - (uchar**) &max_system_variables.bulk_insert_buff_size, + "Size of tree cache used in bulk insert optimization. Note that this " + "is a limit per thread.", &global_system_variables.bulk_insert_buff_size, + &max_system_variables.bulk_insert_buff_size, 0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, ULONG_MAX, 0, 1, 0}, {"connect_timeout", OPT_CONNECT_TIMEOUT, - "The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.", - (uchar**) &connect_timeout, (uchar**) &connect_timeout, + "The number of seconds the mysqld server is waiting for a connect packet " + "before responding with 'Bad handshake'.", &connect_timeout, &connect_timeout, 0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 }, { "date_format", OPT_DATE_FORMAT, "The DATE format (for future).", - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE], - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE], + &opt_date_time_formats[MYSQL_TIMESTAMP_DATE], + &opt_date_time_formats[MYSQL_TIMESTAMP_DATE], 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { "datetime_format", OPT_DATETIME_FORMAT, "The DATETIME/TIMESTAMP format (for future).", - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME], - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME], + &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME], + &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME], 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { "default_week_format", OPT_DEFAULT_WEEK_FORMAT, "The default week format used by WEEK() functions.", - (uchar**) &global_system_variables.default_week_format, - (uchar**) &max_system_variables.default_week_format, + &global_system_variables.default_week_format, + &max_system_variables.default_week_format, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 7L, 0, 1, 0}, {"delayed_insert_limit", OPT_DELAYED_INSERT_LIMIT, - "After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.", - (uchar**) &delayed_insert_limit, (uchar**) &delayed_insert_limit, 0, GET_ULONG, + "After inserting delayed_insert_limit rows, the INSERT DELAYED handler " + "will check if there are any SELECT statements pending. If so, it allows " + "these to execute before continuing.", + &delayed_insert_limit, &delayed_insert_limit, 0, GET_ULONG, REQUIRED_ARG, DELAYED_LIMIT, 1, ULONG_MAX, 0, 1, 0}, {"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT, "How long a INSERT DELAYED thread should wait for INSERT statements before terminating.", - (uchar**) &delayed_insert_timeout, (uchar**) &delayed_insert_timeout, 0, + &delayed_insert_timeout, &delayed_insert_timeout, 0, GET_ULONG, REQUIRED_ARG, DELAYED_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, { "delayed_queue_size", OPT_DELAYED_QUEUE_SIZE, - "What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again.", - (uchar**) &delayed_queue_size, (uchar**) &delayed_queue_size, 0, GET_ULONG, + "What size queue (in rows) should be allocated for handling INSERT DELAYED. " + "If the queue becomes full, any client that does INSERT DELAYED will wait " + "until there is room in the queue again.", + &delayed_queue_size, &delayed_queue_size, 0, GET_ULONG, REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ULONG_MAX, 0, 1, 0}, {"div_precision_increment", OPT_DIV_PRECINCREMENT, "Precision of the result of '/' operator will be increased on that value.", - (uchar**) &global_system_variables.div_precincrement, - (uchar**) &max_system_variables.div_precincrement, 0, GET_ULONG, + &global_system_variables.div_precincrement, + &max_system_variables.div_precincrement, 0, GET_ULONG, REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0}, {"expire_logs_days", OPT_EXPIRE_LOGS_DAYS, "If non-zero, binary logs will be purged after expire_logs_days " "days; possible purges happen at startup and at binary log rotation.", - (uchar**) &expire_logs_days, - (uchar**) &expire_logs_days, 0, GET_ULONG, + &expire_logs_days, &expire_logs_days, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 99, 0, 1, 0}, { "flush_time", OPT_FLUSH_TIME, "A dedicated thread is created to flush all tables at the given interval.", - (uchar**) &flush_time, (uchar**) &flush_time, 0, GET_ULONG, REQUIRED_ARG, + &flush_time, &flush_time, 0, GET_ULONG, REQUIRED_ARG, FLUSH_TIME, 0, LONG_TIMEOUT, 0, 1, 0}, { "ft_boolean_syntax", OPT_FT_BOOLEAN_SYNTAX, "List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE).", - 0, 0, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, - "The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.", - (uchar**) &ft_max_word_len, (uchar**) &ft_max_word_len, 0, GET_ULONG, + "The maximum length of the word to be included in a FULLTEXT index. " + "Note: FULLTEXT indexes must be rebuilt after changing this variable.", + &ft_max_word_len, &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, HA_FT_MAXCHARLEN, 0, 1, 0}, { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, - "The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.", - (uchar**) &ft_min_word_len, (uchar**) &ft_min_word_len, 0, GET_ULONG, + "The minimum length of the word to be included in a FULLTEXT index. " + "Note: FULLTEXT indexes must be rebuilt after changing this variable.", + &ft_min_word_len, &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, 0, 1, 0}, { "ft_query_expansion_limit", OPT_FT_QUERY_EXPANSION_LIMIT, "Number of best matches to use for query expansion.", - (uchar**) &ft_query_expansion_limit, (uchar**) &ft_query_expansion_limit, 0, GET_ULONG, + &ft_query_expansion_limit, &ft_query_expansion_limit, 0, GET_ULONG, REQUIRED_ARG, 20, 0, 1000, 0, 1, 0}, { "ft_stopword_file", OPT_FT_STOPWORD_FILE, "Use stopwords from this file instead of built-in list.", - (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR, + &ft_stopword_file, &ft_stopword_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN, "The maximum length of the result of function group_concat.", - (uchar**) &global_system_variables.group_concat_max_len, - (uchar**) &max_system_variables.group_concat_max_len, 0, GET_ULONG, + &global_system_variables.group_concat_max_len, + &max_system_variables.group_concat_max_len, 0, GET_ULONG, REQUIRED_ARG, 1024, 4, ULONG_MAX, 0, 1, 0}, {"interactive_timeout", OPT_INTERACTIVE_TIMEOUT, - "The number of seconds the server waits for activity on an interactive connection before closing it.", - (uchar**) &global_system_variables.net_interactive_timeout, - (uchar**) &max_system_variables.net_interactive_timeout, 0, + "The number of seconds the server waits for activity on an interactive " + "connection before closing it.", + &global_system_variables.net_interactive_timeout, + &max_system_variables.net_interactive_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, {"join_buffer_size", OPT_JOIN_BUFF_SIZE, "The size of the buffer that is used for full joins.", - (uchar**) &global_system_variables.join_buff_size, - (uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG, + &global_system_variables.join_buff_size, + &max_system_variables.join_buff_size, 0, GET_ULONG, REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ULONG_MAX, MALLOC_OVERHEAD, IO_SIZE, 0}, {"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE, "Don't overwrite stale .MYD and .MYI even if no directory is specified.", - (uchar**) &global_system_variables.keep_files_on_create, - (uchar**) &max_system_variables.keep_files_on_create, + &global_system_variables.keep_files_on_create, + &max_system_variables.keep_files_on_create, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"key_buffer_size", OPT_KEY_BUFFER_SIZE, "The size of the buffer used for index blocks for MyISAM tables. Increase " "this to get better index handling (for all reads and multiple writes) to " "as much as you can afford; 1GB on a 4GB machine that mainly runs MySQL is " "quite common.", - (uchar**) &dflt_key_cache_var.param_buff_size, - (uchar**) 0, - 0, (GET_ULL | GET_ASK_ADDR), + &dflt_key_cache_var.param_buff_size, NULL, NULL, (GET_ULL | GET_ASK_ADDR), REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD, IO_SIZE, 0}, {"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD, @@ -6730,34 +6778,27 @@ log and this option does nothing anymore.", "until it is considered aged enough to be downgraded to a warm block. " "This specifies the percentage ratio of that number of hits to the total " "number of blocks in key cache.", - (uchar**) &dflt_key_cache_var.param_age_threshold, - (uchar**) 0, - 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, - 300, 100, ULONG_MAX, 0, 100, 0}, + &dflt_key_cache_var.param_age_threshold, NULL, NULL, + (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, 300, 100, ULONG_MAX, 0, 100, 0}, {"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE, "The default size of key cache blocks.", - (uchar**) &dflt_key_cache_var.param_block_size, - (uchar**) 0, - 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, - KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0}, + &dflt_key_cache_var.param_block_size, NULL, NULL, (GET_ULONG | GET_ASK_ADDR), + REQUIRED_ARG, KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0}, {"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT, "The minimum percentage of warm blocks in key cache.", - (uchar**) &dflt_key_cache_var.param_division_limit, - (uchar**) 0, - 0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100, - 1, 100, 0, 1, 0}, + &dflt_key_cache_var.param_division_limit, NULL, NULL, + (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100, 1, 100, 0, 1, 0}, {"long_query_time", OPT_LONG_QUERY_TIME, "Log all queries that have taken more than long_query_time seconds to " "execute. The argument will be treated as a decimal value with " "microsecond precision.", - (uchar**) &long_query_time, (uchar**) &long_query_time, 0, GET_DOUBLE, + &long_query_time, &long_query_time, 0, GET_DOUBLE, REQUIRED_ARG, 10, 0, LONG_TIMEOUT, 0, 0, 0}, {"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES, "If set to 1, table names are stored in lowercase on disk and table names " "will be case-insensitive. Should be set to 2 if you are using a case-" "insensitive file system.", - (uchar**) &lower_case_table_names, - (uchar**) &lower_case_table_names, 0, GET_UINT, OPT_ARG, + &lower_case_table_names, &lower_case_table_names, 0, GET_UINT, OPT_ARG, #ifdef FN_NO_CASE_SENCE 1 #else @@ -6766,399 +6807,422 @@ log and this option does nothing anymore.", , 0, 2, 0, 1, 0}, {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "The maximum packet length to send to or receive from server.", - (uchar**) &global_system_variables.max_allowed_packet, - (uchar**) &max_system_variables.max_allowed_packet, 0, GET_ULONG, + &global_system_variables.max_allowed_packet, + &max_system_variables.max_allowed_packet, 0, GET_ULONG, REQUIRED_ARG, 1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, {"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE, "Can be used to restrict the total size used to cache a multi-transaction query.", - (uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0, + &max_binlog_cache_size, &max_binlog_cache_size, 0, GET_ULL, REQUIRED_ARG, ULONG_MAX, IO_SIZE, ULONGLONG_MAX, 0, IO_SIZE, 0}, {"max_binlog_size", OPT_MAX_BINLOG_SIZE, - "Binary log will be rotated automatically when the size exceeds this \ -value. Will also apply to relay logs if max_relay_log_size is 0. \ -The minimum value for this variable is 4096.", - (uchar**) &max_binlog_size, (uchar**) &max_binlog_size, 0, GET_ULONG, + "Binary log will be rotated automatically when the size exceeds this " + "value. Will also apply to relay logs if max_relay_log_size is 0. " + "The minimum value for this variable is 4096.", + &max_binlog_size, &max_binlog_size, 0, GET_ULONG, REQUIRED_ARG, 1024*1024L*1024L, IO_SIZE, 1024*1024L*1024L, 0, IO_SIZE, 0}, {"max_connect_errors", OPT_MAX_CONNECT_ERRORS, - "If there is more than this number of interrupted connections from a host this host will be blocked from further connections.", - (uchar**) &max_connect_errors, (uchar**) &max_connect_errors, 0, GET_ULONG, - REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0}, + "If there is more than this number of interrupted connections from a host " + "this host will be blocked from further connections.", + &max_connect_errors, &max_connect_errors, 0, GET_ULONG, + REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0}, // Default max_connections of 151 is larger than Apache's default max // children, to avoid "too many connections" error in a common setup {"max_connections", OPT_MAX_CONNECTIONS, - "The number of simultaneous clients allowed.", (uchar**) &max_connections, - (uchar**) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 100000, 0, 1, - 0}, + "The number of simultaneous clients allowed.", &max_connections, + &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 100000, 0, 1, 0}, {"max_delayed_threads", OPT_MAX_DELAYED_THREADS, - "Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero, which means INSERT DELAYED is not used.", - (uchar**) &global_system_variables.max_insert_delayed_threads, - (uchar**) &max_system_variables.max_insert_delayed_threads, + "Don't start more than this number of threads to handle INSERT DELAYED " + "statements. If set to zero, which means INSERT DELAYED is not used.", + &global_system_variables.max_insert_delayed_threads, + &max_system_variables.max_insert_delayed_threads, 0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0}, {"max_error_count", OPT_MAX_ERROR_COUNT, "Max number of errors/warnings to store for a statement.", - (uchar**) &global_system_variables.max_error_count, - (uchar**) &max_system_variables.max_error_count, + &global_system_variables.max_error_count, + &max_system_variables.max_error_count, 0, GET_ULONG, REQUIRED_ARG, DEFAULT_ERROR_COUNT, 0, 65535, 0, 1, 0}, {"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE, "Don't allow creation of heap tables bigger than this.", - (uchar**) &global_system_variables.max_heap_table_size, - (uchar**) &max_system_variables.max_heap_table_size, 0, GET_ULL, + &global_system_variables.max_heap_table_size, + &max_system_variables.max_heap_table_size, 0, GET_ULL, REQUIRED_ARG, 16*1024*1024L, 16384, MAX_MEM_TABLE_SIZE, MALLOC_OVERHEAD, 1024, 0}, {"max_join_size", OPT_MAX_JOIN_SIZE, "Joins that are probably going to read more than max_join_size records return an error.", - (uchar**) &global_system_variables.max_join_size, - (uchar**) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG, + &global_system_variables.max_join_size, + &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG, HA_POS_ERROR, 1, HA_POS_ERROR, 0, 1, 0}, {"max_length_for_sort_data", OPT_MAX_LENGTH_FOR_SORT_DATA, "Max number of bytes in sorted records.", - (uchar**) &global_system_variables.max_length_for_sort_data, - (uchar**) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG, + &global_system_variables.max_length_for_sort_data, + &max_system_variables.max_length_for_sort_data, 0, GET_ULONG, REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, {"max_prepared_stmt_count", OPT_MAX_PREPARED_STMT_COUNT, "Maximum number of prepared statements in the server.", - (uchar**) &max_prepared_stmt_count, (uchar**) &max_prepared_stmt_count, + &max_prepared_stmt_count, &max_prepared_stmt_count, 0, GET_ULONG, REQUIRED_ARG, 16382, 0, 1*1024*1024, 0, 1, 0}, {"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE, - "If non-zero: relay log will be rotated automatically when the size exceeds this value; if zero (the default): when the size exceeds max_binlog_size. 0 excepted, the minimum value for this variable is 4096.", - (uchar**) &max_relay_log_size, (uchar**) &max_relay_log_size, 0, GET_ULONG, + "If non-zero: relay log will be rotated automatically when the size " + "exceeds this value; if zero (the default): when the size exceeds " + "max_binlog_size. 0 excepted, the minimum value for this variable is 4096.", + &max_relay_log_size, &max_relay_log_size, 0, GET_ULONG, REQUIRED_ARG, 0L, 0L, 1024*1024L*1024L, 0, IO_SIZE, 0}, { "max_seeks_for_key", OPT_MAX_SEEKS_FOR_KEY, "Limit assumed max number of seeks when looking up rows based on a key.", - (uchar**) &global_system_variables.max_seeks_for_key, - (uchar**) &max_system_variables.max_seeks_for_key, 0, GET_ULONG, + &global_system_variables.max_seeks_for_key, + &max_system_variables.max_seeks_for_key, 0, GET_ULONG, REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0 }, {"max_sort_length", OPT_MAX_SORT_LENGTH, - "The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).", - (uchar**) &global_system_variables.max_sort_length, - (uchar**) &max_system_variables.max_sort_length, 0, GET_ULONG, + "The number of bytes to use when sorting BLOB or TEXT values (only the " + "first max_sort_length bytes of each value are used; the rest are ignored).", + &global_system_variables.max_sort_length, + &max_system_variables.max_sort_length, 0, GET_ULONG, REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, {"max_sp_recursion_depth", OPT_MAX_SP_RECURSION_DEPTH, "Maximum stored procedure recursion depth. (discussed with docs).", - (uchar**) &global_system_variables.max_sp_recursion_depth, - (uchar**) &max_system_variables.max_sp_recursion_depth, 0, GET_ULONG, + &global_system_variables.max_sp_recursion_depth, + &max_system_variables.max_sp_recursion_depth, 0, GET_ULONG, OPT_ARG, 0, 0, 255, 0, 1, 0 }, {"max_tmp_tables", OPT_MAX_TMP_TABLES, "Maximum number of temporary tables a client can keep open at a time.", - (uchar**) &global_system_variables.max_tmp_tables, - (uchar**) &max_system_variables.max_tmp_tables, 0, GET_ULONG, + &global_system_variables.max_tmp_tables, + &max_system_variables.max_tmp_tables, 0, GET_ULONG, REQUIRED_ARG, 32, 1, ULONG_MAX, 0, 1, 0}, {"max_user_connections", OPT_MAX_USER_CONNECTIONS, "The maximum number of active connections for a single user (0 = no limit).", - (uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT, + &max_user_connections, &max_user_connections, 0, GET_UINT, REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0}, {"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT, "After this many write locks, allow some read locks to run in between.", - (uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG, + &max_write_lock_count, &max_write_lock_count, 0, GET_ULONG, REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0}, {"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT, "Don't log queries which examine less than min_examined_row_limit rows to file.", - (uchar**) &global_system_variables.min_examined_row_limit, - (uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG, + &global_system_variables.min_examined_row_limit, + &max_system_variables.min_examined_row_limit, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0}, {"multi_range_count", OPT_MULTI_RANGE_COUNT, "Number of key ranges to request at once.", - (uchar**) &global_system_variables.multi_range_count, - (uchar**) &max_system_variables.multi_range_count, 0, + &global_system_variables.multi_range_count, + &max_system_variables.multi_range_count, 0, GET_ULONG, REQUIRED_ARG, 256, 1, ULONG_MAX, 0, 1, 0}, {"myisam_block_size", OPT_MYISAM_BLOCK_SIZE, "Block size to be used for MyISAM index pages.", - (uchar**) &opt_myisam_block_size, - (uchar**) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG, + &opt_myisam_block_size, &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0}, {"myisam_data_pointer_size", OPT_MYISAM_DATA_POINTER_SIZE, "Default pointer size to be used for MyISAM tables.", - (uchar**) &myisam_data_pointer_size, - (uchar**) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG, + &myisam_data_pointer_size, + &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG, 6, 2, 7, 0, 1, 0}, {"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, - "This is a deprecated option that does nothing anymore. It will be removed in MySQL " - VER_CELOSIA, - (uchar**) &global_system_variables.myisam_max_extra_sort_file_size, - (uchar**) &max_system_variables.myisam_max_extra_sort_file_size, + "This is a deprecated option that does nothing anymore. " + "It will be removed in MySQL " VER_CELOSIA, + &global_system_variables.myisam_max_extra_sort_file_size, + &max_system_variables.myisam_max_extra_sort_file_size, 0, GET_ULL, REQUIRED_ARG, (ulonglong) MI_MAX_TEMP_LENGTH, 0, (ulonglong) MAX_FILE_SIZE, 0, 1, 0}, {"myisam_max_sort_file_size", OPT_MYISAM_MAX_SORT_FILE_SIZE, - "Don't use the fast sort index method to created index if the temporary file would get bigger than this.", - (uchar**) &global_system_variables.myisam_max_sort_file_size, - (uchar**) &max_system_variables.myisam_max_sort_file_size, 0, + "Don't use the fast sort index method to created index if the temporary " + "file would get bigger than this.", + &global_system_variables.myisam_max_sort_file_size, + &max_system_variables.myisam_max_sort_file_size, 0, GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE, 0, 1024*1024, 0}, {"myisam_mmap_size", OPT_MYISAM_MMAP_SIZE, "Can be used to restrict the total memory used for memory mmaping of myisam files", - (uchar**) &myisam_mmap_size, (uchar**) &myisam_mmap_size, 0, + &myisam_mmap_size, &myisam_mmap_size, 0, GET_ULL, REQUIRED_ARG, SIZE_T_MAX, MEMMAP_EXTRA_MARGIN, SIZE_T_MAX, 0, 1, 0}, {"myisam_repair_threads", OPT_MYISAM_REPAIR_THREADS, "Specifies whether several threads should be used when repairing MyISAM " "tables. For values > 1, one thread is used per index. The value of 1 " "disables parallel repair.", - (uchar**) &global_system_variables.myisam_repair_threads, - (uchar**) &max_system_variables.myisam_repair_threads, 0, + &global_system_variables.myisam_repair_threads, + &max_system_variables.myisam_repair_threads, 0, GET_ULONG, REQUIRED_ARG, 1, 1, ULONG_MAX, 0, 1, 0}, {"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE, - "The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.", - (uchar**) &global_system_variables.myisam_sort_buff_size, - (uchar**) &max_system_variables.myisam_sort_buff_size, 0, + "The buffer that is allocated when sorting the index when doing a REPAIR " + "or when creating indexes with CREATE INDEX or ALTER TABLE.", + &global_system_variables.myisam_sort_buff_size, + &max_system_variables.myisam_sort_buff_size, 0, GET_ULONG, REQUIRED_ARG, 8192 * 1024, 4096, ~0L, 0, 1, 0}, {"myisam_use_mmap", OPT_MYISAM_USE_MMAP, "Use memory mapping for reading and writing MyISAM tables.", - (uchar**) &opt_myisam_use_mmap, - (uchar**) &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, 0, - 0, 0, 0, 0, 0}, + &opt_myisam_use_mmap, &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, {"myisam_stats_method", OPT_MYISAM_STATS_METHOD, "Specifies how MyISAM index statistics collection code should threat NULLs. " "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), " "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".", - (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0, + &myisam_stats_method_str, &myisam_stats_method_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "Buffer length for TCP/IP and socket communication.", - (uchar**) &global_system_variables.net_buffer_length, - (uchar**) &max_system_variables.net_buffer_length, 0, GET_ULONG, + &global_system_variables.net_buffer_length, + &max_system_variables.net_buffer_length, 0, GET_ULONG, REQUIRED_ARG, 16384, 1024, 1024*1024L, 0, 1024, 0}, {"net_read_timeout", OPT_NET_READ_TIMEOUT, "Number of seconds to wait for more data from a connection before aborting the read.", - (uchar**) &global_system_variables.net_read_timeout, - (uchar**) &max_system_variables.net_read_timeout, 0, GET_ULONG, + &global_system_variables.net_read_timeout, + &max_system_variables.net_read_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_READ_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, {"net_retry_count", OPT_NET_RETRY_COUNT, "If a read on a communication port is interrupted, retry this many times before giving up.", - (uchar**) &global_system_variables.net_retry_count, - (uchar**) &max_system_variables.net_retry_count,0, + &global_system_variables.net_retry_count, + &max_system_variables.net_retry_count,0, GET_ULONG, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, ULONG_MAX, 0, 1, 0}, {"net_write_timeout", OPT_NET_WRITE_TIMEOUT, "Number of seconds to wait for a block to be written to a connection before " "aborting the write.", - (uchar**) &global_system_variables.net_write_timeout, - (uchar**) &max_system_variables.net_write_timeout, 0, GET_ULONG, + &global_system_variables.net_write_timeout, + &max_system_variables.net_write_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, { "old", OPT_OLD_MODE, "Use compatible behavior.", - (uchar**) &global_system_variables.old_mode, - (uchar**) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG, + &global_system_variables.old_mode, + &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"open_files_limit", OPT_OPEN_FILES_LIMIT, - "If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.", - (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG, + "If this is not 0, then mysqld will use this value to reserve file " + "descriptors to use with setrlimit(). If this value is 0 then mysqld " + "will reserve max_connections*5 or max_connections + table_cache*2 " + "(whichever is larger) number of files.", + &open_files_limit, &open_files_limit, 0, GET_ULONG, REQUIRED_ARG, 0, 0, OS_FILE_LIMIT, 0, 1, 0}, {"optimizer_prune_level", OPT_OPTIMIZER_PRUNE_LEVEL, - "Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows.", - (uchar**) &global_system_variables.optimizer_prune_level, - (uchar**) &max_system_variables.optimizer_prune_level, + "Controls the heuristic(s) applied during query optimization to prune " + "less-promising partial plans from the optimizer search space. Meaning: " + "0 - do not apply any heuristic, thus perform exhaustive search; 1 - " + "prune plans based on number of retrieved rows.", + &global_system_variables.optimizer_prune_level, + &max_system_variables.optimizer_prune_level, 0, GET_ULONG, OPT_ARG, 1, 0, 1, 0, 1, 0}, {"optimizer_search_depth", OPT_OPTIMIZER_SEARCH_DEPTH, - "Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Smaller values than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to MAX_TABLES+2, the optimizer will switch to the original find_best (used for testing/comparison).", - (uchar**) &global_system_variables.optimizer_search_depth, - (uchar**) &max_system_variables.optimizer_search_depth, + "Maximum depth of search performed by the query optimizer. Values larger " + "than the number of relations in a query result in better query plans, " + "but take longer to compile a query. Smaller values than the number of " + "tables in a relation result in faster optimization, but may produce " + "very bad query plans. If set to 0, the system will automatically pick " + "a reasonable value; if set to MAX_TABLES+2, the optimizer will switch " + "to the original find_best (used for testing/comparison).", + &global_system_variables.optimizer_search_depth, + &max_system_variables.optimizer_search_depth, 0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0}, {"optimizer_switch", OPT_OPTIMIZER_SWITCH, "optimizer_switch=option=val[,option=val...], where option={index_merge, " "index_merge_union, index_merge_sort_union, index_merge_intersection} and " "val={on, off, default}.", - (uchar**) &optimizer_switch_str, (uchar**) &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG, - /*OPTIMIZER_SWITCH_DEFAULT*/0, - 0, 0, 0, 0, 0}, + &optimizer_switch_str, &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG, + /*OPTIMIZER_SWITCH_DEFAULT*/0, 0, 0, 0, 0, 0}, {"plugin_dir", OPT_PLUGIN_DIR, "Directory for plugins.", - (uchar**) &opt_plugin_dir_ptr, (uchar**) &opt_plugin_dir_ptr, 0, + &opt_plugin_dir_ptr, &opt_plugin_dir_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"plugin-load", OPT_PLUGIN_LOAD, "Optional semicolon-separated list of plugins to load, where each plugin is " "identified as name=library, where name is the plugin name and library " "is the plugin library in plugin_dir.", - (uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0, + &opt_plugin_load, &opt_plugin_load, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE, "The size of the buffer that is allocated when preloading indexes.", - (uchar**) &global_system_variables.preload_buff_size, - (uchar**) &max_system_variables.preload_buff_size, 0, GET_ULONG, + &global_system_variables.preload_buff_size, + &max_system_variables.preload_buff_size, 0, GET_ULONG, REQUIRED_ARG, 32*1024L, 1024, 1024*1024*1024L, 0, 1, 0}, {"query_alloc_block_size", OPT_QUERY_ALLOC_BLOCK_SIZE, "Allocation block size for query parsing and execution.", - (uchar**) &global_system_variables.query_alloc_block_size, - (uchar**) &max_system_variables.query_alloc_block_size, 0, GET_ULONG, + &global_system_variables.query_alloc_block_size, + &max_system_variables.query_alloc_block_size, 0, GET_ULONG, REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, #ifdef HAVE_QUERY_CACHE {"query_cache_limit", OPT_QUERY_CACHE_LIMIT, "Don't cache results that are bigger than this.", - (uchar**) &query_cache_limit, (uchar**) &query_cache_limit, 0, GET_ULONG, + &query_cache_limit, &query_cache_limit, 0, GET_ULONG, REQUIRED_ARG, 1024*1024L, 0, ULONG_MAX, 0, 1, 0}, {"query_cache_min_res_unit", OPT_QUERY_CACHE_MIN_RES_UNIT, "Minimal size of unit in which space for results is allocated (last unit " "will be trimmed after writing all result data).", - (uchar**) &query_cache_min_res_unit, (uchar**) &query_cache_min_res_unit, + &query_cache_min_res_unit, &query_cache_min_res_unit, 0, GET_ULONG, REQUIRED_ARG, QUERY_CACHE_MIN_RESULT_DATA_SIZE, 0, ULONG_MAX, 0, 1, 0}, #endif /*HAVE_QUERY_CACHE*/ {"query_cache_size", OPT_QUERY_CACHE_SIZE, "The memory allocated to store results from old queries.", - (uchar**) &query_cache_size, (uchar**) &query_cache_size, 0, GET_ULONG, + &query_cache_size, &query_cache_size, 0, GET_ULONG, REQUIRED_ARG, 0, 0, (longlong) ULONG_MAX, 0, 1024, 0}, #ifdef HAVE_QUERY_CACHE {"query_cache_type", OPT_QUERY_CACHE_TYPE, - "0 = OFF = Don't cache or retrieve results. 1 = ON = Cache all results except SELECT SQL_NO_CACHE ... queries. 2 = DEMAND = Cache only SELECT SQL_CACHE ... queries.", - (uchar**) &global_system_variables.query_cache_type, - (uchar**) &max_system_variables.query_cache_type, + "0 = OFF = Don't cache or retrieve results. 1 = ON = Cache all results " + "except SELECT SQL_NO_CACHE ... queries. 2 = DEMAND = Cache only SELECT " + "SQL_CACHE ... queries.", &global_system_variables.query_cache_type, + &max_system_variables.query_cache_type, 0, GET_ULONG, REQUIRED_ARG, 1, 0, 2, 0, 1, 0}, {"query_cache_wlock_invalidate", OPT_QUERY_CACHE_WLOCK_INVALIDATE, "Invalidate queries in query cache on LOCK for write.", - (uchar**) &global_system_variables.query_cache_wlock_invalidate, - (uchar**) &max_system_variables.query_cache_wlock_invalidate, + &global_system_variables.query_cache_wlock_invalidate, + &max_system_variables.query_cache_wlock_invalidate, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, #endif /*HAVE_QUERY_CACHE*/ {"query_prealloc_size", OPT_QUERY_PREALLOC_SIZE, "Persistent buffer for query parsing and execution.", - (uchar**) &global_system_variables.query_prealloc_size, - (uchar**) &max_system_variables.query_prealloc_size, 0, GET_ULONG, + &global_system_variables.query_prealloc_size, + &max_system_variables.query_prealloc_size, 0, GET_ULONG, REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE, ULONG_MAX, 0, 1024, 0}, {"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE, "Allocation block size for storing ranges during optimization.", - (uchar**) &global_system_variables.range_alloc_block_size, - (uchar**) &max_system_variables.range_alloc_block_size, 0, GET_ULONG, + &global_system_variables.range_alloc_block_size, + &max_system_variables.range_alloc_block_size, 0, GET_ULONG, REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, RANGE_ALLOC_BLOCK_SIZE, ULONG_MAX, 0, 1024, 0}, {"read_buffer_size", OPT_RECORD_BUFFER, - "Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.", - (uchar**) &global_system_variables.read_buff_size, - (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, + "Each thread that does a sequential scan allocates a buffer of this size " + "for each table it scans. If you do many sequential scans, you may want " + "to increase this value.", &global_system_variables.read_buff_size, + &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, {"read_only", OPT_READONLY, "Make all non-temporary tables read-only, with the exception of replication " "(slave) threads and users with the SUPER privilege.", - (uchar**) &opt_readonly, - (uchar**) &opt_readonly, + &opt_readonly, + &opt_readonly, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, {"read_rnd_buffer_size", OPT_RECORD_RND_BUFFER, "When reading rows in sorted order after a sort, the rows are read through " "this buffer to avoid disk seeks. If not set, then it's set to the value of " "record_buffer.", - (uchar**) &global_system_variables.read_rnd_buff_size, - (uchar**) &max_system_variables.read_rnd_buff_size, 0, + &global_system_variables.read_rnd_buff_size, + &max_system_variables.read_rnd_buff_size, 0, GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, {"record_buffer", OPT_RECORD_BUFFER_OLD, "Alias for read_buffer_size. This variable is deprecated and will be removed in a future release.", - (uchar**) &global_system_variables.read_buff_size, - (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, + &global_system_variables.read_buff_size, + &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, #ifdef HAVE_REPLICATION {"relay_log_purge", OPT_RELAY_LOG_PURGE, "0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.", - (uchar**) &relay_log_purge, - (uchar**) &relay_log_purge, 0, GET_BOOL, NO_ARG, + &relay_log_purge, + &relay_log_purge, 0, GET_BOOL, NO_ARG, 1, 0, 1, 0, 1, 0}, {"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT, "Maximum space to use for all relay logs.", - (uchar**) &relay_log_space_limit, - (uchar**) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L, + &relay_log_space_limit, + &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L, (longlong) ULONG_MAX, 0, 1, 0}, {"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL, "Use compression on master/slave protocol.", - (uchar**) &opt_slave_compressed_protocol, - (uchar**) &opt_slave_compressed_protocol, + &opt_slave_compressed_protocol, + &opt_slave_compressed_protocol, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, {"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT, "Number of seconds to wait for more data from a master/slave connection before aborting the read.", - (uchar**) &slave_net_timeout, (uchar**) &slave_net_timeout, 0, + &slave_net_timeout, &slave_net_timeout, 0, GET_ULONG, REQUIRED_ARG, SLAVE_NET_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, {"slave_transaction_retries", OPT_SLAVE_TRANS_RETRIES, "Number of times the slave SQL thread will retry a transaction in case " "it failed with a deadlock or elapsed lock wait timeout, " "before giving up and stopping.", - (uchar**) &slave_trans_retries, (uchar**) &slave_trans_retries, 0, + &slave_trans_retries, &slave_trans_retries, 0, GET_ULONG, REQUIRED_ARG, 10L, 0L, (longlong) ULONG_MAX, 0, 1, 0}, #endif /* HAVE_REPLICATION */ {"slow_launch_time", OPT_SLOW_LAUNCH_TIME, - "If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented.", - (uchar**) &slow_launch_time, (uchar**) &slow_launch_time, 0, GET_ULONG, + "If creating the thread takes longer than this value (in seconds), " + "the Slow_launch_threads counter will be incremented.", + &slow_launch_time, &slow_launch_time, 0, GET_ULONG, REQUIRED_ARG, 2L, 0L, LONG_TIMEOUT, 0, 1, 0}, {"sort_buffer_size", OPT_SORT_BUFFER, "Each thread that needs to do a sort allocates a buffer of this size.", - (uchar**) &global_system_variables.sortbuff_size, - (uchar**) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG, + &global_system_variables.sortbuff_size, + &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG, MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD, 1, 0}, {"sync-binlog", OPT_SYNC_BINLOG, "Synchronously flush binary log to disk after every #th event. " "Use 0 (default) to disable synchronous flushing.", - (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_ULONG, + &sync_binlog_period, &sync_binlog_period, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1, 0}, {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.", - (uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, + &opt_sync_frm, &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"table_cache", OPT_TABLE_OPEN_CACHE, "Deprecated; use --table_open_cache instead.", - (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG, + &table_cache_size, &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0}, {"table_definition_cache", OPT_TABLE_DEF_CACHE, "The number of cached table definitions.", - (uchar**) &table_def_size, (uchar**) &table_def_size, + &table_def_size, &table_def_size, 0, GET_ULONG, REQUIRED_ARG, TABLE_DEF_CACHE_DEFAULT, TABLE_DEF_CACHE_MIN, 512*1024L, 0, 1, 0}, {"table_open_cache", OPT_TABLE_OPEN_CACHE, "The number of cached open tables.", - (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG, + &table_cache_size, &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0}, {"table_lock_wait_timeout", OPT_TABLE_LOCK_WAIT_TIMEOUT, "Timeout in seconds to wait for a table level lock before returning an " "error. Used only if the connection has active cursors.", - (uchar**) &table_lock_wait_timeout, (uchar**) &table_lock_wait_timeout, + &table_lock_wait_timeout, &table_lock_wait_timeout, 0, GET_ULONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0}, {"thread_cache_size", OPT_THREAD_CACHE_SIZE, "How many threads we should keep in a cache for reuse.", - (uchar**) &thread_cache_size, (uchar**) &thread_cache_size, 0, GET_ULONG, + &thread_cache_size, &thread_cache_size, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 16384, 0, 1, 0}, {"thread_concurrency", OPT_THREAD_CONCURRENCY, - "Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.", - (uchar**) &concurrency, (uchar**) &concurrency, 0, GET_ULONG, REQUIRED_ARG, + "Permits the application to give the threads system a hint for the " + "desired number of threads that should be run at the same time.", + &concurrency, &concurrency, 0, GET_ULONG, REQUIRED_ARG, DEFAULT_CONCURRENCY, 1, 512, 0, 1, 0}, #if HAVE_POOL_OF_THREADS == 1 {"thread_pool_size", OPT_THREAD_CACHE_SIZE, "How many threads we should create to handle query requests in case of " "'thread_handling=pool-of-threads'.", - (uchar**) &thread_pool_size, (uchar**) &thread_pool_size, 0, GET_ULONG, + &thread_pool_size, &thread_pool_size, 0, GET_ULONG, REQUIRED_ARG, 20, 1, 16384, 0, 1, 0}, #endif {"thread_stack", OPT_THREAD_STACK, - "The stack size for each thread.", (uchar**) &my_thread_stack_size, - (uchar**) &my_thread_stack_size, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK, + "The stack size for each thread.", &my_thread_stack_size, + &my_thread_stack_size, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK, 1024L*128L, ULONG_MAX, 0, 1024, 0}, { "time_format", OPT_TIME_FORMAT, "The TIME format (for future).", - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME], - (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME], + &opt_date_time_formats[MYSQL_TIMESTAMP_TIME], + &opt_date_time_formats[MYSQL_TIMESTAMP_TIME], 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tmp_table_size", OPT_TMP_TABLE_SIZE, "If an internal in-memory temporary table exceeds this size, MySQL will" " automatically convert it to an on-disk MyISAM table.", - (uchar**) &global_system_variables.tmp_table_size, - (uchar**) &max_system_variables.tmp_table_size, 0, GET_ULL, + &global_system_variables.tmp_table_size, + &max_system_variables.tmp_table_size, 0, GET_ULL, REQUIRED_ARG, 16*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0}, {"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE, "Allocation block size for transactions to be stored in binary log.", - (uchar**) &global_system_variables.trans_alloc_block_size, - (uchar**) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG, + &global_system_variables.trans_alloc_block_size, + &max_system_variables.trans_alloc_block_size, 0, GET_ULONG, REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, {"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE, "Persistent buffer for transactions to be stored in binary log.", - (uchar**) &global_system_variables.trans_prealloc_size, - (uchar**) &max_system_variables.trans_prealloc_size, 0, GET_ULONG, + &global_system_variables.trans_prealloc_size, + &max_system_variables.trans_prealloc_size, 0, GET_ULONG, REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, {"thread_handling", OPT_THREAD_HANDLING, "Define threads usage for handling queries: " "one-thread-per-connection or no-threads.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"updatable_views_with_limit", OPT_UPDATABLE_VIEWS_WITH_LIMIT, - "1 = YES = Don't issue an error message (warning only) if a VIEW without presence of a key of the underlying table is used in queries with a LIMIT clause for updating. 0 = NO = Prohibit update of a VIEW, which does not contain a key of the underlying table and the query uses a LIMIT clause (usually get from GUI tools).", - (uchar**) &global_system_variables.updatable_views_with_limit, - (uchar**) &max_system_variables.updatable_views_with_limit, + "1 = YES = Don't issue an error message (warning only) if a VIEW without " + "presence of a key of the underlying table is used in queries with a " + "LIMIT clause for updating. 0 = NO = Prohibit update of a VIEW, which " + "does not contain a key of the underlying table and the query uses a " + "LIMIT clause (usually get from GUI tools).", + &global_system_variables.updatable_views_with_limit, + &max_system_variables.updatable_views_with_limit, 0, GET_ULONG, REQUIRED_ARG, 1, 0, 1, 0, 1, 0}, {"wait_timeout", OPT_WAIT_TIMEOUT, "The number of seconds the server waits for activity on a connection before closing it.", - (uchar**) &global_system_variables.net_wait_timeout, - (uchar**) &max_system_variables.net_wait_timeout, 0, GET_ULONG, + &global_system_variables.net_wait_timeout, + &max_system_variables.net_wait_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT), 0, 1, 0}, {"binlog-direct-non-transactional-updates", OPT_BINLOG_DIRECT_NON_TRANS_UPDATE, @@ -7167,8 +7231,9 @@ The minimum value for this variable is 4096.", "there are no dependencies between transactional and non-transactional " "tables such as in the statement INSERT INTO t_myisam SELECT * FROM " "t_innodb; otherwise, slaves may diverge from the master.", - (uchar**) &global_system_variables.binlog_direct_non_trans_update, (uchar**) &max_system_variables.binlog_direct_non_trans_update, 0, GET_BOOL, NO_ARG, 0, - 0, 0, 0, 0, 0}, + &global_system_variables.binlog_direct_non_trans_update, + &max_system_variables.binlog_direct_non_trans_update, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -8597,13 +8662,12 @@ mysqld_get_one_option(int optid, /** Handle arguments for multiple key caches. */ +C_MODE_START +static void* mysql_getopt_value(const char *, uint, + const struct my_option *, int *); +C_MODE_END -extern "C" int mysql_getopt_value(uchar **value, - const char *keyname, uint key_length, - const struct my_option *option, - int *error); - -static uchar* * +static void* mysql_getopt_value(const char *keyname, uint key_length, const struct my_option *option, int *error) { @@ -8624,13 +8688,13 @@ mysql_getopt_value(const char *keyname, uint key_length, } switch (option->id) { case OPT_KEY_BUFFER_SIZE: - return (uchar**) &key_cache->param_buff_size; + return &key_cache->param_buff_size; case OPT_KEY_CACHE_BLOCK_SIZE: - return (uchar**) &key_cache->param_block_size; + return &key_cache->param_block_size; case OPT_KEY_CACHE_DIVISION_LIMIT: - return (uchar**) &key_cache->param_division_limit; + return &key_cache->param_division_limit; case OPT_KEY_CACHE_AGE_THRESHOLD: - return (uchar**) &key_cache->param_age_threshold; + return &key_cache->param_age_threshold; } } } diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 94a2b506207..7383d59a1d9 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1913,10 +1913,6 @@ typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_uint_t, uint); typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulong_t, ulong); typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulonglong_t, ulonglong); -#define SET_PLUGIN_VAR_RESOLVE(opt)\ - *(mysql_sys_var_ptr_p*)&((opt)->resolve)= mysql_sys_var_ptr -typedef uchar *(*mysql_sys_var_ptr_p)(void* a_thd, int offset); - /**************************************************************************** default variable data check and update functions @@ -2445,11 +2441,49 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) return (uchar*)thd->variables.dynamic_variables_ptr + offset; } -static uchar *mysql_sys_var_ptr(void* a_thd, int offset) + +/** + For correctness and simplicity's sake, a pointer to a function + must be compatible with pointed-to type, that is, the return and + parameters types must be the same. Thus, a callback function is + defined for each scalar type. The functions are assigned in + construct_options to their respective types. +*/ + +static char *mysql_sys_var_char(THD* thd, int offset) { - return intern_sys_var_ptr((THD *)a_thd, offset, true); + return (char *) intern_sys_var_ptr(thd, offset, true); } +static int *mysql_sys_var_int(THD* thd, int offset) +{ + return (int *) intern_sys_var_ptr(thd, offset, true); +} + +static long *mysql_sys_var_long(THD* thd, int offset) +{ + return (long *) intern_sys_var_ptr(thd, offset, true); +} + +static unsigned long *mysql_sys_var_ulong(THD* thd, int offset) +{ + return (unsigned long *) intern_sys_var_ptr(thd, offset, true); +} + +static long long *mysql_sys_var_longlong(THD* thd, int offset) +{ + return (long long *) intern_sys_var_ptr(thd, offset, true); +} + +static unsigned long long *mysql_sys_var_ulonglong(THD* thd, int offset) +{ + return (unsigned long long *) intern_sys_var_ptr(thd, offset, true); +} + +static char **mysql_sys_var_str(THD* thd, int offset) +{ + return (char **) intern_sys_var_ptr(thd, offset, true); +} void plugin_thdvar_init(THD *thd) { @@ -3020,25 +3054,25 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, continue; switch (opt->flags & PLUGIN_VAR_TYPEMASK) { case PLUGIN_VAR_BOOL: - SET_PLUGIN_VAR_RESOLVE((thdvar_bool_t *) opt); + ((thdvar_bool_t *) opt)->resolve= mysql_sys_var_char; break; case PLUGIN_VAR_INT: - SET_PLUGIN_VAR_RESOLVE((thdvar_int_t *) opt); + ((thdvar_int_t *) opt)->resolve= mysql_sys_var_int; break; case PLUGIN_VAR_LONG: - SET_PLUGIN_VAR_RESOLVE((thdvar_long_t *) opt); + ((thdvar_long_t *) opt)->resolve= mysql_sys_var_long; break; case PLUGIN_VAR_LONGLONG: - SET_PLUGIN_VAR_RESOLVE((thdvar_longlong_t *) opt); + ((thdvar_longlong_t *) opt)->resolve= mysql_sys_var_longlong; break; case PLUGIN_VAR_STR: - SET_PLUGIN_VAR_RESOLVE((thdvar_str_t *) opt); + ((thdvar_str_t *) opt)->resolve= mysql_sys_var_str; break; case PLUGIN_VAR_ENUM: - SET_PLUGIN_VAR_RESOLVE((thdvar_enum_t *) opt); + ((thdvar_enum_t *) opt)->resolve= mysql_sys_var_ulong; break; case PLUGIN_VAR_SET: - SET_PLUGIN_VAR_RESOLVE((thdvar_set_t *) opt); + ((thdvar_set_t *) opt)->resolve= mysql_sys_var_ulonglong; break; default: sql_print_error("Unknown variable type code 0x%x in plugin '%s'.", diff --git a/sql/table.cc b/sql/table.cc index 0fef7fa639a..dde3654dab1 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -45,6 +45,8 @@ static uint find_field(Field **fields, uchar *record, uint start, uint length); inline bool is_system_table_name(const char *name, uint length); +static ulong get_form_pos(File file, uchar *head); + /************************************************************************** Object_creation_ctx implementation. **************************************************************************/ @@ -693,7 +695,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, disk_buff= 0; error= 3; - if (!(pos=get_form_pos(file,head,(TYPELIB*) 0))) + /* Position of the form in the form file. */ + if (!(pos= get_form_pos(file, head))) goto err; /* purecov: inspected */ share->frm_version= head[2]; @@ -2047,52 +2050,46 @@ void free_field_buffers_larger_than(TABLE *table, uint32 size) } } - /* Find where a form starts */ - /* if formname is NullS then only formnames is read */ +/** + Find where a form starts. -ulong get_form_pos(File file, uchar *head, TYPELIB *save_names) + @param head The start of the form file. + + @remark If formname is NULL then only formnames is read. + + @retval The form position. +*/ + +static ulong get_form_pos(File file, uchar *head) { - uint a_length,names,length; - uchar *pos,*buf; + uchar *pos, *buf; + uint names, length; ulong ret_value=0; DBUG_ENTER("get_form_pos"); - names=uint2korr(head+8); - a_length=(names+2)*sizeof(char *); /* Room for two extra */ + names= uint2korr(head+8); - if (!save_names) - a_length=0; - else - save_names->type_names=0; /* Clear if error */ + if (!(names= uint2korr(head+8))) + DBUG_RETURN(0); - if (names) + length= uint2korr(head+4); + + my_seek(file, 64L, MY_SEEK_SET, MYF(0)); + + if (!(buf= (uchar*) my_malloc(length+names*4, MYF(MY_WME)))) + DBUG_RETURN(0); + + if (my_read(file, buf, length+names*4, MYF(MY_NABP))) { - length=uint2korr(head+4); - VOID(my_seek(file,64L,MY_SEEK_SET,MYF(0))); - if (!(buf= (uchar*) my_malloc((size_t) length+a_length+names*4, - MYF(MY_WME))) || - my_read(file, buf+a_length, (size_t) (length+names*4), - MYF(MY_NABP))) - { /* purecov: inspected */ - x_free((uchar*) buf); /* purecov: inspected */ - DBUG_RETURN(0L); /* purecov: inspected */ - } - pos= buf+a_length+length; - ret_value=uint4korr(pos); - } - if (! save_names) - { - if (names) - my_free((uchar*) buf,MYF(0)); - } - else if (!names) - bzero((char*) save_names,sizeof(save_names)); - else - { - char *str; - str=(char *) (buf+a_length); - fix_type_pointers((const char ***) &buf,save_names,1,&str); + x_free(buf); + DBUG_RETURN(0); } + + pos= buf+length; + ret_value= uint4korr(pos); + + my_free(buf, MYF(0)); + DBUG_RETURN(ret_value); } diff --git a/sql/unireg.cc b/sql/unireg.cc index 60674b8390b..84160da9d77 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -108,7 +108,6 @@ bool mysql_create_frm(THD *thd, const char *file_name, File file; ulong filepos, data_offset; uchar fileinfo[64],forminfo[288],*keybuff; - TYPELIB formnames; uchar *screen_buff; char buff[128]; #ifdef WITH_PARTITION_STORAGE_ENGINE @@ -119,7 +118,7 @@ bool mysql_create_frm(THD *thd, const char *file_name, DBUG_ENTER("mysql_create_frm"); DBUG_ASSERT(*fn_rext((char*)file_name)); // Check .frm extension - formnames.type_names=0; + if (!(screen_buff=pack_screens(create_fields,&info_length,&screens,0))) DBUG_RETURN(1); DBUG_ASSERT(db_file != NULL); @@ -194,8 +193,15 @@ bool mysql_create_frm(THD *thd, const char *file_name, key_buff_length= uint4korr(fileinfo+47); keybuff=(uchar*) my_malloc(key_buff_length, MYF(0)); key_info_length= pack_keys(keybuff, keys, key_info, data_offset); - VOID(get_form_pos(file,fileinfo,&formnames)); - if (!(filepos=make_new_entry(file,fileinfo,&formnames,""))) + + /* + Ensure that there are no forms in this newly created form file. + Even if the form file exists, create_frm must truncate it to + ensure one form per form file. + */ + DBUG_ASSERT(uint2korr(fileinfo+8) == 0); + + if (!(filepos= make_new_entry(file, fileinfo, NULL, ""))) goto err; maxlength=(uint) next_io_size((ulong) (uint2korr(forminfo)+1000)); int2store(forminfo+2,maxlength); diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c index 84d4e318b49..0cf795cefdf 100644 --- a/storage/archive/archive_reader.c +++ b/storage/archive/archive_reader.c @@ -355,15 +355,14 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"set-auto-increment", 'A', "Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.", - (uchar**) &new_auto_increment, - (uchar**) &new_auto_increment, + &new_auto_increment, &new_auto_increment, 0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"silent", 's', "Only print errors. One can use two -s to make archive_reader very silent.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"tmpdir", 't', "Path for temporary files.", - (uchar**) &opt_tmpdir, + &opt_tmpdir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Print version and exit.", diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c index eb563638d36..5317da78ee4 100644 --- a/storage/myisam/ft_nlq_search.c +++ b/storage/myisam/ft_nlq_search.c @@ -123,7 +123,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) goto do_skip; } #if HA_FT_WTYPE == HA_KEYTYPE_FLOAT - tmp_weight=*(float*)&subkeys; + ft_floatXget(tmp_weight, info->lastkey+info->lastkey_length-extra); #else #error #endif diff --git a/storage/myisam/fulltext.h b/storage/myisam/fulltext.h index 856e93e034d..853eb6362e6 100644 --- a/storage/myisam/fulltext.h +++ b/storage/myisam/fulltext.h @@ -24,8 +24,23 @@ #define HA_FT_WLEN 4 #define FT_SEGS 2 +/** + Accessor methods for the weight and the number of subkeys in a buffer. + + The weight is of float type and subkeys number is of integer type. Both + are stored in the same position of the buffer and the stored object is + identified by the sign (bit): the weight value is positive whilst the + number of subkeys is negative. + + In light of C's strict-aliasing rules, which roughly state that an object + must not be accessed through incompatible types, these methods are used to + avoid any problems arising from the type duality inside the buffer. The + values are retrieved using a character type which can access any object. +*/ #define ft_sintXkorr(A) mi_sint4korr(A) #define ft_intXstore(T,A) mi_int4store(T,A) +#define ft_floatXget(V,M) mi_float4get(V,M) + extern const HA_KEYSEG ft_keysegs[FT_SEGS]; diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c index f218bf4e77f..363b024737a 100644 --- a/storage/myisam/mi_test1.c +++ b/storage/myisam/mi_test1.c @@ -536,21 +536,21 @@ static struct my_option my_long_options[] = {"debug", '#', "Undocumented", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"delete_rows", 'd', "Undocumented", (uchar**) &remove_count, - (uchar**) &remove_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, + {"delete_rows", 'd', "Undocumented", &remove_count, + &remove_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, {"help", '?', "Display help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"insert_rows", 'i', "Undocumented", (uchar**) &insert_count, - (uchar**) &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, + {"insert_rows", 'i', "Undocumented", &insert_count, + &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, {"key_alpha", 'a', "Use a key of type HA_KEYTYPE_TEXT", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"key_binary_pack", 'B', "Undocumented", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"key_blob", 'b', "Undocumented", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"key_cache", 'K', "Undocumented", (uchar**) &key_cacheing, - (uchar**) &key_cacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"key_length", 'k', "Undocumented", (uchar**) &key_length, (uchar**) &key_length, + {"key_cache", 'K', "Undocumented", &key_cacheing, + &key_cacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"key_length", 'k', "Undocumented", &key_length, &key_length, 0, GET_UINT, REQUIRED_ARG, 6, 0, 0, 0, 0, 0}, {"key_multiple", 'm', "Undocumented", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -561,21 +561,21 @@ static struct my_option my_long_options[] = {"key_varchar", 'w', "Test VARCHAR keys", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"null_fields", 'N', "Define fields with NULL", - (uchar**) &null_fields, (uchar**) &null_fields, 0, GET_BOOL, NO_ARG, + &null_fields, &null_fields, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"row_fixed_size", 'S', "Undocumented", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"row_pointer_size", 'R', "Undocumented", (uchar**) &rec_pointer_size, - (uchar**) &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"row_pointer_size", 'R', "Undocumented", &rec_pointer_size, + &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"silent", 's', "Undocumented", - (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"skip_update", 'U', "Undocumented", (uchar**) &skip_update, - (uchar**) &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"unique", 'C', "Undocumented", (uchar**) &opt_unique, (uchar**) &opt_unique, 0, + &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"skip_update", 'U', "Undocumented", &skip_update, + &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"unique", 'C', "Undocumented", &opt_unique, &opt_unique, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"update_rows", 'u', "Undocumented", (uchar**) &update_count, - (uchar**) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, - {"verbose", 'v', "Be more verbose", (uchar**) &verbose, (uchar**) &verbose, 0, + {"update_rows", 'u', "Undocumented", &update_count, + &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Be more verbose", &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Print version number and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/storage/myisam/myisam_ftdump.c b/storage/myisam/myisam_ftdump.c index 63d954242a0..f1637a7e116 100644 --- a/storage/myisam/myisam_ftdump.c +++ b/storage/myisam/myisam_ftdump.c @@ -113,7 +113,7 @@ int main(int argc,char *argv[]) subkeys=ft_sintXkorr(info->lastkey+keylen+1); if (subkeys >= 0) - weight=*(float*)&subkeys; + ft_floatXget(weight, info->lastkey+keylen+1); #ifdef HAVE_SNPRINTF snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1); diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 611fb6325c8..96ceb35b3d5 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -168,7 +168,7 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", - (uchar**) &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -188,8 +188,8 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"data-file-length", 'D', "Max length of data file (when recreating data-file when it's full).", - (uchar**) &check_param.max_data_file_length, - (uchar**) &check_param.max_data_file_length, + &check_param.max_data_file_length, + &check_param.max_data_file_length, 0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"extend-check", 'e', "If used when checking a table, ensure that the table is 100 percent consistent, which will take a long time. If used when repairing a table, try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option with repair if you are not totally desperate.", @@ -211,13 +211,13 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"keys-used", 'k', "Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts.", - (uchar**) &check_param.keys_in_use, - (uchar**) &check_param.keys_in_use, + &check_param.keys_in_use, + &check_param.keys_in_use, 0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0}, {"max-record-length", OPT_MAX_RECORD_LENGTH, "Skip rows bigger than this if myisamchk can't allocate memory to hold it", - (uchar**) &check_param.max_record_length, - (uchar**) &check_param.max_record_length, + &check_param.max_record_length, + &check_param.max_record_length, 0, GET_ULL, REQUIRED_ARG, LONGLONG_MAX, 0, LONGLONG_MAX, 0, 0, 0}, {"medium-check", 'm', "Faster than extend-check, but only finds 99.99% of all errors. Should be good enough for most cases.", @@ -246,12 +246,12 @@ static struct my_option my_long_options[] = #endif {"set-auto-increment", 'A', "Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.", - (uchar**) &check_param.auto_increment_value, - (uchar**) &check_param.auto_increment_value, + &check_param.auto_increment_value, + &check_param.auto_increment_value, 0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"set-collation", OPT_SET_COLLATION, "Change the collation used by the index", - (uchar**) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"set-variable", 'O', "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -263,12 +263,12 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"sort-records", 'R', "Sort records according to an index. This makes your data much more localized and may speed up things. (It may be VERY slow to do a sort the first time!)", - (uchar**) &check_param.opt_sort_key, - (uchar**) &check_param.opt_sort_key, + &check_param.opt_sort_key, + &check_param.opt_sort_key, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tmpdir", 't', "Path for temporary files.", - (uchar**) &opt_tmpdir, + &opt_tmpdir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"update-state", 'U', "Mark tables as crashed if any errors were found.", @@ -286,54 +286,54 @@ static struct my_option my_long_options[] = "Wait if table is locked.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, { "key_buffer_size", OPT_KEY_BUFFER_SIZE, "", - (uchar**) &check_param.use_buffers, (uchar**) &check_param.use_buffers, 0, + &check_param.use_buffers, &check_param.use_buffers, 0, GET_ULL, REQUIRED_ARG, USE_BUFFER_INIT, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD, IO_SIZE, 0}, { "key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE, "", - (uchar**) &opt_key_cache_block_size, - (uchar**) &opt_key_cache_block_size, 0, + &opt_key_cache_block_size, + &opt_key_cache_block_size, 0, GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0}, { "myisam_block_size", OPT_MYISAM_BLOCK_SIZE, "", - (uchar**) &opt_myisam_block_size, (uchar**) &opt_myisam_block_size, 0, + &opt_myisam_block_size, &opt_myisam_block_size, 0, GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0}, { "read_buffer_size", OPT_READ_BUFFER_SIZE, "", - (uchar**) &check_param.read_buffer_length, - (uchar**) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG, + &check_param.read_buffer_length, + &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG, (long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD, INT_MAX32, (long) MALLOC_OVERHEAD, (long) 1L, 0}, { "write_buffer_size", OPT_WRITE_BUFFER_SIZE, "", - (uchar**) &check_param.write_buffer_length, - (uchar**) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG, + &check_param.write_buffer_length, + &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG, (long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD, INT_MAX32, (long) MALLOC_OVERHEAD, (long) 1L, 0}, { "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "", - (uchar**) &check_param.sort_buffer_length, - (uchar**) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG, + &check_param.sort_buffer_length, + &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG, (long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD), ULONG_MAX, (long) MALLOC_OVERHEAD, (long) 1L, 0}, { "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "", - (uchar**) &check_param.sort_key_blocks, - (uchar**) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG, + &check_param.sort_key_blocks, + &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG, BUFFERS_WHEN_SORTING, 4L, 100L, 0L, 1L, 0}, - { "decode_bits", OPT_DECODE_BITS, "", (uchar**) &decode_bits, - (uchar**) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0}, - { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (uchar**) &ft_min_word_len, - (uchar**) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, + { "decode_bits", OPT_DECODE_BITS, "", &decode_bits, + &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0}, + { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", &ft_min_word_len, + &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, 0, 1, 0}, - { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (uchar**) &ft_max_word_len, - (uchar**) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, + { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", &ft_max_word_len, + &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, HA_FT_MAXCHARLEN, 0, 1, 0}, { "ft_stopword_file", OPT_FT_STOPWORD_FILE, "Use stopwords from this file instead of built-in list.", - (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR, + &ft_stopword_file, &ft_stopword_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"stats_method", OPT_STATS_METHOD, "Specifies how index statistics collection code should treat NULLs. " "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), " "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".", - (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0, + &myisam_stats_method_str, &myisam_stats_method_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c index fafb5140a5e..7e0d0a442a5 100644 --- a/storage/myisam/myisamlog.c +++ b/storage/myisam/myisamlog.c @@ -382,18 +382,18 @@ static int examine_log(char * file_name, char **table_names) curr_file_info->show_name); if (my_b_read(&cache,(uchar*) head,2)) goto err; + buff= 0; file_info.name=0; file_info.show_name=0; file_info.record=0; - if (read_string(&cache,(uchar**) &file_info.name, - (uint) mi_uint2korr(head))) + if (read_string(&cache, &buff, (uint) mi_uint2korr(head))) goto err; { uint i; char *pos,*to; /* Fix if old DOS files to new format */ - for (pos=file_info.name; (pos=strchr(pos,'\\')) ; pos++) + for (pos=file_info.name=(char*)buff; (pos=strchr(pos,'\\')) ; pos++) *pos= '/'; pos=file_info.name; @@ -692,7 +692,7 @@ static int read_string(IO_CACHE *file, register uchar* *to, register uint length *to= 0; DBUG_RETURN(1); } - *((char*) *to+length)= '\0'; + *((uchar*) *to+length)= '\0'; DBUG_RETURN (0); } /* read_string */ diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index 908c32e48d3..5fcfbae8f8f 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -257,10 +257,10 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif {"backup", 'b', "Make a backup of the table as table_name.OLD.", - (uchar**) &backup, (uchar**) &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + &backup, &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR_MP, - "Directory where character sets are.", (uchar**) &charsets_dir, - (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + "Directory where character sets are.", &charsets_dir, + &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', @@ -268,7 +268,7 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"join", 'j', "Join all given tables into 'new_table_name'. All tables MUST have identical layouts.", - (uchar**) &join_table, (uchar**) &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, + &join_table, &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -282,8 +282,8 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"wait", 'w', "Wait and retry if table is in use.", (uchar**) &opt_wait, - (uchar**) &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"wait", 'w', "Wait and retry if table is in use.", &opt_wait, + &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; diff --git a/strings/decimal.c b/strings/decimal.c index 282e7cae8ab..d6c33baf713 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -971,7 +971,7 @@ int decimal2double(decimal_t *from, double *to) *to= from->sign ? -result : result; - DBUG_PRINT("info", ("result: %f (%lx)", *to, *(ulong *)to)); + DBUG_PRINT("info", ("result: %f", *to)); return E_DEC_OK; } diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 43ba2222650..a15b6164d0c 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -18220,17 +18220,17 @@ static char **defaults_argv; static struct my_option client_test_long_options[] = { - {"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir, - (uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"count", 't', "Number of times test to be executed", (uchar **) &opt_count, - (uchar **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, - {"database", 'D', "Database to use", (uchar **) &opt_db, (uchar **) &opt_db, + {"basedir", 'b', "Basedir for tests.", &opt_basedir, + &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"count", 't', "Number of times test to be executed", &opt_count, + &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, + {"database", 'D', "Database to use", &opt_db, &opt_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"debug", '#', "Output debug log", (uchar**) &default_dbug_option, - (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log", &default_dbug_option, + &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host", (uchar **) &opt_host, (uchar **) &opt_host, + {"host", 'h', "Connect to host", &opt_host, &opt_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", @@ -18241,8 +18241,7 @@ static struct my_option client_test_long_options[] = "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar **) &opt_port, - (uchar **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &opt_port, &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"server-arg", 'A', "Send embedded server this as a parameter.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"show-tests", 'T', "Show all tests' names", 0, 0, 0, GET_NO_ARG, NO_ARG, @@ -18251,23 +18250,23 @@ static struct my_option client_test_long_options[] = 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", 'm', "Base name of shared memory.", - (uchar**) &shared_memory_base_name, (uchar**)&shared_memory_base_name, 0, + &shared_memory_base_name, (uchar**)&shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"socket", 'S', "Socket file to use for connection", - (uchar **) &opt_unix_socket, (uchar **) &opt_unix_socket, 0, GET_STR, + &opt_unix_socket, &opt_unix_socket, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"testcase", 'c', "May disable some code when runs as mysql-test-run testcase.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE - {"user", 'u', "User for login if not current user", (uchar **) &opt_user, - (uchar **) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user", &opt_user, + &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"vardir", 'v', "Data dir for tests.", (uchar**) &opt_vardir, - (uchar**) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"vardir", 'v', "Data dir for tests.", &opt_vardir, + &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"getopt-ll-test", 'g', "Option for testing bug in getopt library", - (uchar **) &opt_getopt_ll_test, (uchar **) &opt_getopt_ll_test, 0, + &opt_getopt_ll_test, &opt_getopt_ll_test, 0, GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; From 0f9ddfa9d8bb8d071266bcc63e92813cf18ccd2b Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 10 Jun 2010 17:45:22 -0300 Subject: [PATCH 106/121] Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. One somewhat major source of strict-aliasing violations and related warnings is the SQL_LIST structure. For example, consider its member function `link_in_list` which takes a pointer to pointer of type T (any type) as a pointer to pointer to unsigned char. Dereferencing this pointer, which is done to reset the next field, violates strict-aliasing rules and might cause problems for surrounding code that uses the next field of the object being added to the list. The solution is to use templates to parametrize the SQL_LIST structure in order to deference the pointers with compatible types. As a side bonus, it becomes possible to remove quite a few casts related to acessing data members of SQL_LIST. sql/handler.h: Use the appropriate template type argument. sql/item.cc: Remove now-unnecessary cast. sql/item_subselect.cc: Remove now-unnecessary casts. sql/item_sum.cc: Use the appropriate template type argument. Remove now-unnecessary cast. sql/mysql_priv.h: Move SQL_LIST structure to sql_list.h Use the appropriate template type argument. sql/sp.cc: Remove now-unnecessary casts. sql/sql_delete.cc: Use the appropriate template type argument. Remove now-unnecessary casts. sql/sql_derived.cc: Remove now-unnecessary casts. sql/sql_lex.cc: Remove now-unnecessary casts. sql/sql_lex.h: SQL_LIST now takes a template type argument which must match the type of the elements of the list. Use forward declaration when the type is not available, it is used in pointers anyway. sql/sql_list.h: Rename SQL_LIST to SQL_I_List. The template parameter is the type of object that is stored in the list. sql/sql_olap.cc: Remove now-unnecessary casts. sql/sql_parse.cc: Remove now-unnecessary casts. sql/sql_prepare.cc: Remove now-unnecessary casts. sql/sql_select.cc: Remove now-unnecessary casts. sql/sql_show.cc: Remove now-unnecessary casts. sql/sql_table.cc: Remove now-unnecessary casts. sql/sql_trigger.cc: Remove now-unnecessary casts. sql/sql_union.cc: Remove now-unnecessary casts. sql/sql_update.cc: Remove now-unnecessary casts. sql/sql_view.cc: Remove now-unnecessary casts. sql/sql_yacc.yy: Remove now-unnecessary casts. storage/myisammrg/ha_myisammrg.cc: Remove now-unnecessary casts. --- sql/handler.h | 2 +- sql/item.cc | 2 +- sql/item_subselect.cc | 17 ++++---- sql/item_sum.cc | 4 +- sql/item_sum.h | 2 +- sql/mysql_priv.h | 47 +--------------------- sql/sp.cc | 24 +++++------ sql/sql_delete.cc | 10 ++--- sql/sql_derived.cc | 6 +-- sql/sql_lex.cc | 19 +++++---- sql/sql_lex.h | 23 ++++++----- sql/sql_list.h | 67 +++++++++++++++++++++++++++++++ sql/sql_olap.cc | 4 +- sql/sql_parse.cc | 60 +++++++++++++-------------- sql/sql_prepare.cc | 17 ++++---- sql/sql_select.cc | 20 ++++----- sql/sql_show.cc | 5 +-- sql/sql_table.cc | 2 +- sql/sql_trigger.cc | 7 ++-- sql/sql_union.cc | 38 +++++++++--------- sql/sql_update.cc | 8 ++-- sql/sql_view.cc | 7 ++-- sql/sql_yacc.yy | 27 +++++-------- sql/table.h | 2 +- storage/myisammrg/ha_myisammrg.cc | 6 +-- 25 files changed, 216 insertions(+), 210 deletions(-) diff --git a/sql/handler.h b/sql/handler.h index d9dfd4f0707..aa74ca19468 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -910,7 +910,7 @@ typedef struct st_ha_create_information ulong avg_row_length; ulong used_fields; ulong key_block_size; - SQL_LIST merge_list; + SQL_I_List merge_list; handlerton *db_type; /** Row type of the table definition. diff --git a/sql/item.cc b/sql/item.cc index 2175a579f4a..5f0ca4374df 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3841,7 +3841,7 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select) { Item **group_by_ref= NULL; Item **select_ref= NULL; - ORDER *group_list= (ORDER*) select->group_list.first; + ORDER *group_list= select->group_list.first; bool ambiguous_fields= FALSE; uint counter; enum_resolution_type resolution; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index f3fcbc4db68..b93ea6f241b 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -244,12 +244,12 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery, if (item->walk(processor, walk_subquery, argument)) return 1; } - for (order= (ORDER*) lex->order_list.first ; order; order= order->next) + for (order= lex->order_list.first ; order; order= order->next) { if ((*order->item)->walk(processor, walk_subquery, argument)) return 1; } - for (order= (ORDER*) lex->group_list.first ; order; order= order->next) + for (order= lex->group_list.first ; order; order= order->next) { if ((*order->item)->walk(processor, walk_subquery, argument)) return 1; @@ -1781,15 +1781,15 @@ int subselect_single_select_engine::prepare() SELECT_LEX *save_select= thd->lex->current_select; thd->lex->current_select= select_lex; if (join->prepare(&select_lex->ref_pointer_array, - (TABLE_LIST*) select_lex->table_list.first, + select_lex->table_list.first, select_lex->with_wild, select_lex->where, select_lex->order_list.elements + select_lex->group_list.elements, - (ORDER*) select_lex->order_list.first, - (ORDER*) select_lex->group_list.first, + select_lex->order_list.first, + select_lex->group_list.first, select_lex->having, - (ORDER*) 0, select_lex, + NULL, select_lex, select_lex->master_unit())) return 1; thd->lex->current_select= save_select; @@ -2450,14 +2450,13 @@ table_map subselect_engine::calc_const_tables(TABLE_LIST *table) table_map subselect_single_select_engine::upper_select_const_tables() { - return calc_const_tables((TABLE_LIST *) select_lex->outer_select()-> - leaf_tables); + return calc_const_tables(select_lex->outer_select()->leaf_tables); } table_map subselect_union_engine::upper_select_const_tables() { - return calc_const_tables((TABLE_LIST *) unit->outer_select()->leaf_tables); + return calc_const_tables(unit->outer_select()->leaf_tables); } diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 8c1e5501a1b..228e36fc9f9 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2969,7 +2969,7 @@ int dump_leaf_key(uchar* key, element_count count __attribute__((unused)), Item_func_group_concat:: Item_func_group_concat(Name_resolution_context *context_arg, bool distinct_arg, List *select_list, - SQL_LIST *order_list, String *separator_arg) + SQL_I_List *order_list, String *separator_arg) :tmp_table_param(0), warning(0), separator(separator_arg), tree(0), unique_filter(NULL), table(0), order(0), context(context_arg), @@ -3013,7 +3013,7 @@ Item_func_group_concat(Name_resolution_context *context_arg, if (arg_count_order) { ORDER **order_ptr= order; - for (ORDER *order_item= (ORDER*) order_list->first; + for (ORDER *order_item= order_list->first; order_item != NULL; order_item= order_item->next) { diff --git a/sql/item_sum.h b/sql/item_sum.h index 5e3972698e9..fe05858ab1d 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -1221,7 +1221,7 @@ class Item_func_group_concat : public Item_sum public: Item_func_group_concat(Name_resolution_context *context_arg, bool is_distinct, List *is_select, - SQL_LIST *is_order, String *is_separator); + SQL_I_List *is_order, String *is_separator); Item_func_group_concat(THD *thd, Item_func_group_concat *item); ~Item_func_group_concat(); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 44694c59447..88f3763ef50 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -641,49 +641,6 @@ enum enum_check_fields CHECK_FIELD_ERROR_FOR_NULL }; - -/** Struct to handle simple linked lists. */ -typedef struct st_sql_list { - uint elements; - uchar *first; - uchar **next; - - st_sql_list() {} /* Remove gcc warning */ - inline void empty() - { - elements=0; - first=0; - next= &first; - } - inline void link_in_list(uchar *element,uchar **next_ptr) - { - elements++; - (*next)=element; - next= next_ptr; - *next=0; - } - inline void save_and_clear(struct st_sql_list *save) - { - *save= *this; - empty(); - } - inline void push_front(struct st_sql_list *save) - { - *save->next= first; /* link current list last */ - first= save->first; - elements+= save->elements; - } - inline void push_back(struct st_sql_list *save) - { - if (save->first) - { - *next= save->first; - next= save->next; - elements+= save->elements; - } - } -} SQL_LIST; - #if defined(MYSQL_DYNAMIC_PLUGIN) && defined(_WIN32) extern "C" THD *_current_thd_noinline(); #define _current_thd() _current_thd_noinline() @@ -1262,7 +1219,7 @@ int check_that_all_fields_are_given_values(THD *thd, TABLE *entry, void prepare_triggers_for_insert_stmt(TABLE *table); int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds); bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, - SQL_LIST *order, ha_rows rows, ulonglong options, + SQL_I_List *order, ha_rows rows, ulonglong options, bool reset_auto_increment); bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok); bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create); @@ -1462,7 +1419,7 @@ Create_field * new_create_field(THD *thd, char *field_name, enum_field_types typ List *interval_list, CHARSET_INFO *cs, uint uint_geom_type); void store_position_for_column(const char *name); -bool add_to_list(THD *thd, SQL_LIST &list,Item *group,bool asc); +bool add_to_list(THD *thd, SQL_I_List &list, Item *group,bool asc); bool push_new_name_resolution_context(THD *thd, TABLE_LIST *left_op, TABLE_LIST *right_op); diff --git a/sql/sp.cc b/sql/sp.cc index ef69edb96c6..e0c1fcfa378 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1630,8 +1630,7 @@ extern "C" uchar* sp_sroutine_key(const uchar *ptr, size_t *plen, void sp_get_prelocking_info(THD *thd, bool *need_prelocking, bool *first_no_prelocking) { - Sroutine_hash_entry *routine; - routine= (Sroutine_hash_entry*)thd->lex->sroutines_list.first; + Sroutine_hash_entry *routine= thd->lex->sroutines_list.first; DBUG_ASSERT(routine); bool first_is_procedure= (routine->key.str[0] == TYPE_ENUM_PROCEDURE); @@ -1694,7 +1693,7 @@ static bool add_used_routine(LEX *lex, Query_arena *arena, memcpy(rn->key.str, key->str, key->length + 1); if (my_hash_insert(&lex->sroutines, (uchar *)rn)) return FALSE; - lex->sroutines_list.link_in_list((uchar *)rn, (uchar **)&rn->next); + lex->sroutines_list.link_in_list(rn, &rn->next); rn->belong_to_view= belong_to_view; return TRUE; } @@ -1740,7 +1739,7 @@ void sp_add_used_routine(LEX *lex, Query_arena *arena, void sp_remove_not_own_routines(LEX *lex) { Sroutine_hash_entry *not_own_rt, *next_rt; - for (not_own_rt= *(Sroutine_hash_entry **)lex->sroutines_list_own_last; + for (not_own_rt= *lex->sroutines_list_own_last; not_own_rt; not_own_rt= next_rt) { /* @@ -1751,7 +1750,7 @@ void sp_remove_not_own_routines(LEX *lex) hash_delete(&lex->sroutines, (uchar *)not_own_rt); } - *(Sroutine_hash_entry **)lex->sroutines_list_own_last= NULL; + *lex->sroutines_list_own_last= NULL; lex->sroutines_list.next= lex->sroutines_list_own_last; lex->sroutines_list.elements= lex->sroutines_list_own_elements; } @@ -1832,11 +1831,11 @@ sp_update_stmt_used_routines(THD *thd, LEX *lex, HASH *src, It will also add elements to end of 'LEX::sroutines_list' list. */ -static void sp_update_stmt_used_routines(THD *thd, LEX *lex, SQL_LIST *src, +static void sp_update_stmt_used_routines(THD *thd, LEX *lex, + SQL_I_List *src, TABLE_LIST *belong_to_view) { - for (Sroutine_hash_entry *rt= (Sroutine_hash_entry *)src->first; - rt; rt= rt->next) + for (Sroutine_hash_entry *rt= src->first; rt; rt= rt->next) (void)add_used_routine(lex, thd->stmt_arena, &rt->key, belong_to_view); } @@ -1971,8 +1970,7 @@ int sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock) { return sp_cache_routines_and_add_tables_aux(thd, lex, - (Sroutine_hash_entry *)lex->sroutines_list.first, - first_no_prelock); + lex->sroutines_list.first, first_no_prelock); } @@ -1996,8 +1994,7 @@ sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock) int sp_cache_routines_and_add_tables_for_view(THD *thd, LEX *lex, TABLE_LIST *view) { - Sroutine_hash_entry **last_cached_routine_ptr= - (Sroutine_hash_entry **)lex->sroutines_list.next; + Sroutine_hash_entry **last_cached_routine_ptr= lex->sroutines_list.next; sp_update_stmt_used_routines(thd, lex, &view->view->sroutines_list, view->top_table()); return sp_cache_routines_and_add_tables_aux(thd, lex, @@ -2026,8 +2023,7 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, { int ret= 0; - Sroutine_hash_entry **last_cached_routine_ptr= - (Sroutine_hash_entry **)lex->sroutines_list.next; + Sroutine_hash_entry **last_cached_routine_ptr= lex->sroutines_list.next; if (static_cast(table->lock_type) >= static_cast(TL_WRITE_ALLOW_WRITE)) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 07421ca55a6..eb0fd4b5332 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -33,7 +33,7 @@ */ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, - SQL_LIST *order, ha_rows limit, ulonglong options, + SQL_I_List *order, ha_rows limit, ulonglong options, bool reset_auto_increment) { bool will_batch; @@ -84,7 +84,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, if (select_lex->setup_ref_array(thd, order->elements) || setup_order(thd, select_lex->ref_pointer_array, &tables, - fields, all_fields, (ORDER*) order->first)) + fields, all_fields, order->first)) { delete select; free_underlaid_joins(thd, &thd->lex->select_lex); @@ -230,14 +230,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ha_rows examined_rows; if ((!select || table->quick_keys.is_clear_all()) && limit != HA_POS_ERROR) - usable_index= get_index_for_order(table, (ORDER*)(order->first), limit); + usable_index= get_index_for_order(table, order->first, limit); if (usable_index == MAX_KEY) { table->sort.io_cache= (IO_CACHE *) my_malloc(sizeof(IO_CACHE), MYF(MY_FAE | MY_ZEROFILL)); - if (!(sortorder= make_unireg_sortorder((ORDER*) order->first, + if (!(sortorder= make_unireg_sortorder(order->first, &length, NULL)) || (table->sort.found_records = filesort(thd, table, sortorder, length, select, HA_POS_ERROR, 1, @@ -547,7 +547,7 @@ extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b) int mysql_multi_delete_prepare(THD *thd) { LEX *lex= thd->lex; - TABLE_LIST *aux_tables= (TABLE_LIST *)lex->auxiliary_table_list.first; + TABLE_LIST *aux_tables= lex->auxiliary_table_list.first; TABLE_LIST *target_tbl; DBUG_ENTER("mysql_multi_delete_prepare"); diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 37adf5c403a..782589f7d0f 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -281,13 +281,13 @@ bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list) lex->current_select= first_select; res= mysql_select(thd, &first_select->ref_pointer_array, - (TABLE_LIST*) first_select->table_list.first, + first_select->table_list.first, first_select->with_wild, first_select->item_list, first_select->where, (first_select->order_list.elements+ first_select->group_list.elements), - (ORDER *) first_select->order_list.first, - (ORDER *) first_select->group_list.first, + first_select->order_list.first, + first_select->group_list.first, first_select->having, (ORDER*) NULL, (first_select->options | thd->options | SELECT_NO_UNLOCK), diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a3776f59241..7eb2607147c 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1641,7 +1641,7 @@ void st_select_lex::init_select() linkage= UNSPECIFIED_TYPE; order_list.elements= 0; order_list.first= 0; - order_list.next= (uchar**) &order_list.first; + order_list.next= &order_list.first; /* Set limit and offset to default values */ select_limit= 0; /* denotes the default limit = HA_POS_ERROR */ offset_limit= 0; /* denotes the default offset = 0 */ @@ -1963,7 +1963,7 @@ uint st_select_lex::get_in_sum_expr() TABLE_LIST* st_select_lex::get_table_list() { - return (TABLE_LIST*) table_list.first; + return table_list.first; } List* st_select_lex::get_item_list() @@ -2020,9 +2020,8 @@ void st_select_lex_unit::print(String *str, enum_query_type query_type) if (fake_select_lex->order_list.elements) { str->append(STRING_WITH_LEN(" order by ")); - fake_select_lex->print_order( - str, - (ORDER *) fake_select_lex->order_list.first, + fake_select_lex->print_order(str, + fake_select_lex->order_list.first, query_type); } fake_select_lex->print_limit(thd, str, query_type); @@ -2667,7 +2666,7 @@ TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local) { select_lex.context.table_list= select_lex.context.first_name_resolution_table= first->next_local; - select_lex.table_list.first= (uchar*) (first->next_local); + select_lex.table_list.first= first->next_local; select_lex.table_list.elements--; //safety first->next_local= 0; /* @@ -2699,7 +2698,7 @@ TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local) void st_lex::first_lists_tables_same() { - TABLE_LIST *first_table= (TABLE_LIST*) select_lex.table_list.first; + TABLE_LIST *first_table= select_lex.table_list.first; if (query_tables != first_table && first_table != 0) { TABLE_LIST *next; @@ -2746,9 +2745,9 @@ void st_lex::link_first_table_back(TABLE_LIST *first, if (link_to_local) { - first->next_local= (TABLE_LIST*) select_lex.table_list.first; + first->next_local= select_lex.table_list.first; select_lex.context.table_list= first; - select_lex.table_list.first= (uchar*) first; + select_lex.table_list.first= first; select_lex.table_list.elements++; //safety } } @@ -2914,7 +2913,7 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds, prep_having= *having_conds; *having_conds= having= prep_having->copy_andor_structure(thd); } - fix_prepare_info_in_table_list(thd, (TABLE_LIST *)table_list.first); + fix_prepare_info_in_table_list(thd, table_list.first); } } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 54eefa22a59..fb011f05f08 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -587,8 +587,8 @@ public: st_lex *parent_lex; enum olap_type olap; /* FROM clause - points to the beginning of the TABLE_LIST::next_local list. */ - SQL_LIST table_list; - SQL_LIST group_list; /* GROUP BY clause. */ + SQL_I_List table_list; + SQL_I_List group_list; /* GROUP BY clause. */ List item_list; /* list of fields & expressions */ List interval_list; bool is_item_list_lookup; @@ -610,8 +610,8 @@ public: TABLE_LIST *leaf_tables; const char *type; /* type of select for EXPLAIN */ - SQL_LIST order_list; /* ORDER clause */ - SQL_LIST *gorder_list; + SQL_I_List order_list; /* ORDER clause */ + SQL_I_List *gorder_list; Item *select_limit, *offset_limit; /* LIMIT clause parameters */ // Arrays of pointers to top elements of all_fields list Item **ref_pointer_array; @@ -774,7 +774,7 @@ public: { order_list.elements= 0; order_list.first= 0; - order_list.next= (uchar**) &order_list.first; + order_list.next= &order_list.first; } /* This method created for reiniting LEX in mysql_admin_table() and can be @@ -953,6 +953,8 @@ enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE, XA_SUSPEND, XA_FOR_MIGRATE}; +struct Sroutine_hash_entry; + /* Class representing list of all tables used by statement. It also contains information about stored functions used by statement @@ -993,9 +995,9 @@ public: We use these two members for restoring of 'sroutines_list' to the state in which it was right after query parsing. */ - SQL_LIST sroutines_list; - uchar **sroutines_list_own_last; - uint sroutines_list_own_elements; + SQL_I_List sroutines_list; + Sroutine_hash_entry **sroutines_list_own_last; + uint sroutines_list_own_elements; /* These constructor and destructor serve for creation/destruction @@ -1599,7 +1601,8 @@ typedef struct st_lex : public Query_tables_list */ List context_stack; - SQL_LIST proc_list, auxiliary_table_list, save_list; + SQL_I_List proc_list; + SQL_I_List auxiliary_table_list, save_list; Create_field *last_field; Item_sum *in_sum_func; udf_func udf; @@ -1721,7 +1724,7 @@ typedef struct st_lex : public Query_tables_list fields to TABLE object at table open (altough for latter pointer to table being opened is probably enough). */ - SQL_LIST trg_table_fields; + SQL_I_List trg_table_fields; /* stmt_definition_begin is intended to point to the next word after diff --git a/sql/sql_list.h b/sql/sql_list.h index 22df77afeb3..3e0ba2b2ede 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -55,6 +55,73 @@ public: }; +/** + Simple intrusive linked list. + + @remark Similar in nature to base_list, but intrusive. It keeps a + a pointer to the first element in the list and a indirect + reference to the last element. +*/ +template +class SQL_I_List :public Sql_alloc +{ +public: + uint elements; + /** The first element in the list. */ + T *first; + /** A reference to the next element in the list. */ + T **next; + + SQL_I_List() { empty(); } + + SQL_I_List(const SQL_I_List &tmp) + { + elements= tmp.elements; + first= tmp.first; + next= elements ? tmp.next : &first; + } + + inline void empty() + { + elements= 0; + first= NULL; + next= &first; + } + + inline void link_in_list(T *element, T **next_ptr) + { + elements++; + (*next)= element; + next= next_ptr; + *next= NULL; + } + + inline void save_and_clear(SQL_I_List *save) + { + *save= *this; + empty(); + } + + inline void push_front(SQL_I_List *save) + { + /* link current list last */ + *save->next= first; + first= save->first; + elements+= save->elements; + } + + inline void push_back(SQL_I_List *save) + { + if (save->first) + { + *next= save->first; + next= save->next; + elements+= save->elements; + } + } +}; + + /* Basic single linked list Used for item and item_buffs. diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index dccfcbaf8ac..21deef8c664 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -146,14 +146,14 @@ int handle_olaps(LEX *lex, SELECT_LEX *select_lex) lex->last_selects=select_lex; - for (ORDER *order=(ORDER *)select_lex->group_list.first ; order ; order=order->next) + for (ORDER *order= select_lex->group_list.first ; order ; order=order->next) item_list_copy.push_back(*(order->item)); List all_fields(select_lex->item_list); if (setup_tables(lex->thd, &select_lex->context, &select_lex->top_join_list, - (TABLE_LIST *)select_lex->table_list.first + select_lex->table_list.first &select_lex->leaf_tables, FALSE) || setup_fields(lex->thd, 0, select_lex->item_list, MARK_COLUMNS_READ, &all_fields,1) || diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 6603aa55d03..c4963914036 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1368,8 +1368,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, mysql_reset_thd_for_next_command(thd); thd->lex-> - select_lex.table_list.link_in_list((uchar*) &table_list, - (uchar**) &table_list.next_local); + select_lex.table_list.link_in_list(&table_list, + &table_list.next_local); thd->lex->add_to_query_tables(&table_list); /* switch on VIEW optimisation: do not fill temporary tables */ @@ -1845,7 +1845,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, { DBUG_RETURN(1); } - TABLE_LIST *table_list= (TABLE_LIST*) select_lex->table_list.first; + TABLE_LIST *table_list= select_lex->table_list.first; table_list->schema_select_lex= schema_select_lex; table_list->schema_table_reformed= 1; DBUG_RETURN(0); @@ -2041,7 +2041,7 @@ mysql_execute_command(THD *thd) /* first SELECT_LEX (have special meaning for many of non-SELECTcommands) */ SELECT_LEX *select_lex= &lex->select_lex; /* first table of first SELECT_LEX */ - TABLE_LIST *first_table= (TABLE_LIST*) select_lex->table_list.first; + TABLE_LIST *first_table= select_lex->table_list.first; /* list of all tables in query */ TABLE_LIST *all_tables; /* most outer SELECT_LEX_UNIT of query */ @@ -2076,7 +2076,7 @@ mysql_execute_command(THD *thd) all_tables= lex->query_tables; /* set context for commands which do not use setup_tables */ select_lex-> - context.resolve_in_table_list_only((TABLE_LIST*)select_lex-> + context.resolve_in_table_list_only(select_lex-> table_list.first); /* @@ -2417,7 +2417,7 @@ mysql_execute_command(THD *thd) goto error; /* purecov: inspected */ thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_backup_table(thd, first_table); - select_lex->table_list.first= (uchar*) first_table; + select_lex->table_list.first= first_table; lex->query_tables=all_tables; break; } @@ -2429,7 +2429,7 @@ mysql_execute_command(THD *thd) goto error; /* purecov: inspected */ thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_restore_table(thd, first_table); - select_lex->table_list.first= (uchar*) first_table; + select_lex->table_list.first= first_table; lex->query_tables=all_tables; break; } @@ -2723,7 +2723,7 @@ mysql_execute_command(THD *thd) if (create_info.used_fields & HA_CREATE_USED_UNION) { TABLE_LIST *tab; - for (tab= (TABLE_LIST*) create_info.merge_list.first; + for (tab= create_info.merge_list.first; tab; tab= tab->next_local) { @@ -2893,7 +2893,6 @@ end_with_restore_list: check_access(thd,INSERT_ACL | CREATE_ACL,select_lex->db,&priv,0,0, is_schema_db(select_lex->db))|| check_merge_table_access(thd, first_table->db, - (TABLE_LIST *) create_info.merge_list.first)) goto error; /* purecov: inspected */ if (check_grant(thd, priv_needed, all_tables, 0, UINT_MAX, 0)) @@ -3028,7 +3027,7 @@ end_with_restore_list: */ res= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } - select_lex->table_list.first= (uchar*) first_table; + select_lex->table_list.first= first_table; lex->query_tables=all_tables; break; } @@ -3040,7 +3039,7 @@ end_with_restore_list: goto error; /* purecov: inspected */ thd->enable_slow_log= opt_log_slow_admin_statements; res = mysql_check_table(thd, first_table, &lex->check_opt); - select_lex->table_list.first= (uchar*) first_table; + select_lex->table_list.first= first_table; lex->query_tables=all_tables; break; } @@ -3060,7 +3059,7 @@ end_with_restore_list: */ res= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } - select_lex->table_list.first= (uchar*) first_table; + select_lex->table_list.first= first_table; lex->query_tables=all_tables; break; } @@ -3083,7 +3082,7 @@ end_with_restore_list: */ res= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } - select_lex->table_list.first= (uchar*) first_table; + select_lex->table_list.first= first_table; lex->query_tables=all_tables; break; } @@ -3101,7 +3100,7 @@ end_with_restore_list: lex->value_list, select_lex->where, select_lex->order_list.elements, - (ORDER *) select_lex->order_list.first, + select_lex->order_list.first, unit->select_limit_cnt, lex->duplicates, lex->ignore)); /* mysql_update return 2 if we need to switch to multi-update */ @@ -3261,7 +3260,7 @@ end_with_restore_list: { /* Skip first table, which is the table we are inserting in */ TABLE_LIST *second_table= first_table->next_local; - select_lex->table_list.first= (uchar*) second_table; + select_lex->table_list.first= second_table; select_lex->context.table_list= select_lex->context.first_name_resolution_table= second_table; res= mysql_insert_select_prepare(thd); @@ -3292,7 +3291,7 @@ end_with_restore_list: delete sel_result; } /* revert changes for SP */ - select_lex->table_list.first= (uchar*) first_table; + select_lex->table_list.first= first_table; } /* @@ -3354,8 +3353,7 @@ end_with_restore_list: case SQLCOM_DELETE_MULTI: { DBUG_ASSERT(first_table == all_tables && first_table != 0); - TABLE_LIST *aux_tables= - (TABLE_LIST *)thd->lex->auxiliary_table_list.first; + TABLE_LIST *aux_tables= thd->lex->auxiliary_table_list.first; multi_delete *del_result; if (!thd->locked_tables && @@ -5363,7 +5361,7 @@ static bool check_show_access(THD *thd, TABLE_LIST *table) case SCH_STATISTICS: { TABLE_LIST *dst_table; - dst_table= (TABLE_LIST *) table->schema_select_lex->table_list.first; + dst_table= table->schema_select_lex->table_list.first; DBUG_ASSERT(dst_table); @@ -6062,7 +6060,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) mysql_reset_thd_for_next_command(thd); if (!parse_sql(thd, & parser_state, NULL) && - all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first)) + all_tables_not_ok(thd, lex->select_lex.table_list.first)) error= 1; /* Ignore question */ thd->end_statement(); thd->cleanup_after_query(); @@ -6200,7 +6198,7 @@ add_proc_to_list(THD* thd, Item *item) *item_ptr= item; order->item=item_ptr; order->free_me=0; - thd->lex->proc_list.link_in_list((uchar*) order,(uchar**) &order->next); + thd->lex->proc_list.link_in_list(order, &order->next); return 0; } @@ -6209,7 +6207,7 @@ add_proc_to_list(THD* thd, Item *item) save order by and tables in own lists. */ -bool add_to_list(THD *thd, SQL_LIST &list,Item *item,bool asc) +bool add_to_list(THD *thd, SQL_I_List &list, Item *item,bool asc) { ORDER *order; DBUG_ENTER("add_to_list"); @@ -6221,7 +6219,7 @@ bool add_to_list(THD *thd, SQL_LIST &list,Item *item,bool asc) order->free_me=0; order->used=0; order->counter_used= 0; - list.link_in_list((uchar*) order,(uchar**) &order->next); + list.link_in_list(order, &order->next); DBUG_RETURN(0); } @@ -6335,7 +6333,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, /* check that used name is unique */ if (lock_type != TL_IGNORE) { - TABLE_LIST *first_table= (TABLE_LIST*) table_list.first; + TABLE_LIST *first_table= table_list.first; if (lex->sql_command == SQLCOM_CREATE_VIEW) first_table= first_table ? first_table->next_local : NULL; for (TABLE_LIST *tables= first_table ; @@ -6377,7 +6375,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, previous table reference to 'ptr'. Here we also add one element to the list 'table_list'. */ - table_list.link_in_list((uchar*) ptr, (uchar**) &ptr->next_local); + table_list.link_in_list(ptr, &ptr->next_local); ptr->next_name_resolution_table= NULL; /* Link table in global list (all used tables) */ lex->add_to_query_tables(ptr); @@ -6610,7 +6608,7 @@ void st_select_lex::set_lock_for_tables(thr_lock_type lock_type) DBUG_ENTER("set_lock_for_tables"); DBUG_PRINT("enter", ("lock_type: %d for_update: %d", lock_type, for_update)); - for (TABLE_LIST *tables= (TABLE_LIST*) table_list.first; + for (TABLE_LIST *tables= table_list.first; tables; tables= tables->next_local) { @@ -7302,8 +7300,7 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables) bool multi_delete_precheck(THD *thd, TABLE_LIST *tables) { SELECT_LEX *select_lex= &thd->lex->select_lex; - TABLE_LIST *aux_tables= - (TABLE_LIST *)thd->lex->auxiliary_table_list.first; + TABLE_LIST *aux_tables= thd->lex->auxiliary_table_list.first; TABLE_LIST **save_query_tables_own_last= thd->lex->query_tables_own_last; DBUG_ENTER("multi_delete_precheck"); @@ -7349,13 +7346,13 @@ bool multi_delete_precheck(THD *thd, TABLE_LIST *tables) bool multi_delete_set_locks_and_link_aux_tables(LEX *lex) { - TABLE_LIST *tables= (TABLE_LIST*)lex->select_lex.table_list.first; + TABLE_LIST *tables= lex->select_lex.table_list.first; TABLE_LIST *target_tbl; DBUG_ENTER("multi_delete_set_locks_and_link_aux_tables"); lex->table_count= 0; - for (target_tbl= (TABLE_LIST *)lex->auxiliary_table_list.first; + for (target_tbl= lex->auxiliary_table_list.first; target_tbl; target_tbl= target_tbl->next_local) { lex->table_count++; @@ -7525,8 +7522,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables, &create_table->grant.privilege, 0, 0, test(create_table->schema_table)) || check_merge_table_access(thd, create_table->db, - (TABLE_LIST *) - lex->create_info.merge_list.first)) + lex->create_info.merge_list.first)) goto err; if (want_priv != CREATE_TMP_ACL && check_grant(thd, want_priv, create_table, 0, 1, 0)) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 5979f2ca17e..4fe64732c72 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1240,7 +1240,7 @@ static int mysql_test_update(Prepared_statement *stmt, if (mysql_prepare_update(thd, table_list, &select->where, select->order_list.elements, - (ORDER *) select->order_list.first)) + select->order_list.first)) goto error; #ifndef NO_EMBEDDED_ACCESS_CHECKS @@ -1746,11 +1746,10 @@ error: static int mysql_insert_select_prepare_tester(THD *thd) { SELECT_LEX *first_select= &thd->lex->select_lex; - TABLE_LIST *second_table= ((TABLE_LIST*)first_select->table_list.first)-> - next_local; + TABLE_LIST *second_table= first_select->table_list.first->next_local; /* Skip first table, which is the table we are inserting in */ - first_select->table_list.first= (uchar *) second_table; + first_select->table_list.first= second_table; thd->lex->select_lex.context.table_list= thd->lex->select_lex.context.first_name_resolution_table= second_table; @@ -1787,7 +1786,7 @@ static bool mysql_test_insert_select(Prepared_statement *stmt, return 1; /* store it, because mysql_insert_select_prepare_tester change it */ - first_local_table= (TABLE_LIST *)lex->select_lex.table_list.first; + first_local_table= lex->select_lex.table_list.first; DBUG_ASSERT(first_local_table != 0); res= @@ -1795,7 +1794,7 @@ static bool mysql_test_insert_select(Prepared_statement *stmt, &mysql_insert_select_prepare_tester, OPTION_SETUP_TABLES_DONE); /* revert changes made by mysql_insert_select_prepare_tester */ - lex->select_lex.table_list.first= (uchar*) first_local_table; + lex->select_lex.table_list.first= first_local_table; return res; } @@ -2339,10 +2338,10 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) DBUG_ASSERT(sl->join == 0); ORDER *order; /* Fix GROUP list */ - for (order= (ORDER *)sl->group_list.first; order; order= order->next) + for (order= sl->group_list.first; order; order= order->next) order->item= &order->item_ptr; /* Fix ORDER list */ - for (order= (ORDER *)sl->order_list.first; order; order= order->next) + for (order= sl->order_list.first; order; order= order->next) order->item= &order->item_ptr; /* clear the no_error flag for INSERT/UPDATE IGNORE */ @@ -2379,7 +2378,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) (multi-delete). We do a full clean up, although at the moment all we need to clean in the tables of MULTI-DELETE list is 'table' member. */ - for (TABLE_LIST *tables= (TABLE_LIST*) lex->auxiliary_table_list.first; + for (TABLE_LIST *tables= lex->auxiliary_table_list.first; tables; tables= tables->next_global) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ccb63dc0ed0..296b18631e5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -255,15 +255,15 @@ bool handle_select(THD *thd, LEX *lex, select_result *result, setup_tables_done_option changed for next rexecution */ res= mysql_select(thd, &select_lex->ref_pointer_array, - (TABLE_LIST*) select_lex->table_list.first, + select_lex->table_list.first, select_lex->with_wild, select_lex->item_list, select_lex->where, select_lex->order_list.elements + select_lex->group_list.elements, - (ORDER*) select_lex->order_list.first, - (ORDER*) select_lex->group_list.first, + select_lex->order_list.first, + select_lex->group_list.first, select_lex->having, - (ORDER*) lex->proc_list.first, + lex->proc_list.first, select_lex->options | thd->options | setup_tables_done_option, result, unit, select_lex); @@ -16803,15 +16803,15 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result) thd->lex->current_select= first; unit->set_limit(unit->global_parameters); res= mysql_select(thd, &first->ref_pointer_array, - (TABLE_LIST*) first->table_list.first, + first->table_list.first, first->with_wild, first->item_list, first->where, first->order_list.elements + first->group_list.elements, - (ORDER*) first->order_list.first, - (ORDER*) first->group_list.first, + first->order_list.first, + first->group_list.first, first->having, - (ORDER*) thd->lex->proc_list.first, + thd->lex->proc_list.first, first->options | thd->options | SELECT_DESCRIBE, result, unit, first); } @@ -17098,7 +17098,7 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) if (group_list.elements) { str->append(STRING_WITH_LEN(" group by ")); - print_order(str, (ORDER *) group_list.first, query_type); + print_order(str, group_list.first, query_type); switch (olap) { case CUBE_TYPE: @@ -17129,7 +17129,7 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) if (order_list.elements) { str->append(STRING_WITH_LEN(" order by ")); - print_order(str, (ORDER *) order_list.first, query_type); + print_order(str, order_list.first, query_type); } // limit diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 61a414dcb6f..f634c149fd9 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2998,8 +2998,7 @@ fill_schema_show_cols_or_idxs(THD *thd, TABLE_LIST *tables, bool res; LEX_STRING tmp_lex_string, tmp_lex_string1, *db_name, *table_name; enum_sql_command save_sql_command= lex->sql_command; - TABLE_LIST *show_table_list= (TABLE_LIST*) tables->schema_select_lex-> - table_list.first; + TABLE_LIST *show_table_list= tables->schema_select_lex->table_list.first; TABLE *table= tables->table; int error= 1; DBUG_ENTER("fill_schema_show"); @@ -3445,7 +3444,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) goto err; if (make_table_list(thd, &sel, db_name, table_name)) goto err; - TABLE_LIST *show_table_list= (TABLE_LIST*) sel.table_list.first; + TABLE_LIST *show_table_list= sel.table_list.first; lex->all_selects_list= &sel; lex->derived_tables= 0; lex->sql_command= SQLCOM_SHOW_FIELDS; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 05f9fa4e398..50045ec6d90 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4592,7 +4592,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, table->next_global= 0; save_next_local= table->next_local; table->next_local= 0; - select->table_list.first= (uchar*)table; + select->table_list.first= table; /* Time zone tables and SP tables can be add to lex->query_tables list, so it have to be prepared. diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index aafb25013f6..1bd3fc78400 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -653,7 +653,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables, */ old_field= new_field= table->field; - for (trg_field= (Item_trigger_field *)(lex->trg_table_fields.first); + for (trg_field= lex->trg_table_fields.first; trg_field; trg_field= trg_field->next_trg_field) { /* @@ -1413,7 +1413,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, */ triggers->trigger_fields[lex.trg_chistics.event] [lex.trg_chistics.action_time]= - (Item_trigger_field *)(lex.trg_table_fields.first); + lex.trg_table_fields.first; /* Also let us bind these objects to Field objects in table being opened. @@ -1423,8 +1423,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, SELECT)... Anyway some things can be checked only during trigger execution. */ - for (Item_trigger_field *trg_field= - (Item_trigger_field *)(lex.trg_table_fields.first); + for (Item_trigger_field *trg_field= lex.trg_table_fields.first; trg_field; trg_field= trg_field->next_trg_field) { diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 1760670f9c8..948ba1d9d9c 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -144,20 +144,19 @@ void st_select_lex_unit::init_prepare_fake_select_lex(THD *thd_arg) { thd_arg->lex->current_select= fake_select_lex; - fake_select_lex->table_list.link_in_list((uchar *)&result_table_list, - (uchar **) - &result_table_list.next_local); + fake_select_lex->table_list.link_in_list(&result_table_list, + &result_table_list.next_local); fake_select_lex->context.table_list= fake_select_lex->context.first_name_resolution_table= fake_select_lex->get_table_list(); if (!fake_select_lex->first_execution) { - for (ORDER *order= (ORDER *) global_parameters->order_list.first; + for (ORDER *order= global_parameters->order_list.first; order; order= order->next) order->item= &order->item_ptr; } - for (ORDER *order= (ORDER *)global_parameters->order_list.first; + for (ORDER *order= global_parameters->order_list.first; order; order=order->next) { @@ -249,18 +248,18 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, can_skip_order_by= is_union_select && !(sl->braces && sl->explicit_limit); saved_error= join->prepare(&sl->ref_pointer_array, - (TABLE_LIST*) sl->table_list.first, + sl->table_list.first, sl->with_wild, sl->where, (can_skip_order_by ? 0 : sl->order_list.elements) + sl->group_list.elements, can_skip_order_by ? - (ORDER*) 0 : (ORDER *)sl->order_list.first, - (ORDER*) sl->group_list.first, + NULL : sl->order_list.first, + sl->group_list.first, sl->having, - (is_union_select ? (ORDER*) 0 : - (ORDER*) thd_arg->lex->proc_list.first), + (is_union_select ? NULL : + thd_arg->lex->proc_list.first), sl, this); /* There are no * in the statement anymore (for PS) */ sl->with_wild= 0; @@ -354,7 +353,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, { ORDER *ord; Item_func::Functype ft= Item_func::FT_FUNC; - for (ord= (ORDER*)global_parameters->order_list.first; ord; ord= ord->next) + for (ord= global_parameters->order_list.first; ord; ord= ord->next) if ((*ord->item)->walk (&Item::find_function_processor, FALSE, (uchar *) &ft)) { @@ -416,12 +415,11 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, thd_arg->lex->current_select= fake_select_lex; saved_error= fake_select_lex->join-> prepare(&fake_select_lex->ref_pointer_array, - (TABLE_LIST*) fake_select_lex->table_list.first, + fake_select_lex->table_list.first, 0, 0, fake_select_lex->order_list.elements, - (ORDER*) fake_select_lex->order_list.first, - (ORDER*) NULL, NULL, - (ORDER*) NULL, + fake_select_lex->order_list.first, + NULL, NULL, NULL, fake_select_lex, this); fake_select_lex->table_list.empty(); } @@ -597,8 +595,8 @@ bool st_select_lex_unit::exec() &result_table_list, 0, item_list, NULL, global_parameters->order_list.elements, - (ORDER*)global_parameters->order_list.first, - (ORDER*) NULL, NULL, (ORDER*) NULL, + global_parameters->order_list.first, + NULL, NULL, NULL, fake_select_lex->options | SELECT_NO_UNLOCK, result, this, fake_select_lex); } @@ -620,8 +618,8 @@ bool st_select_lex_unit::exec() &result_table_list, 0, item_list, NULL, global_parameters->order_list.elements, - (ORDER*)global_parameters->order_list.first, - (ORDER*) NULL, NULL, (ORDER*) NULL, + global_parameters->order_list.first, + NULL, NULL, NULL, fake_select_lex->options | SELECT_NO_UNLOCK, result, this, fake_select_lex); } @@ -697,7 +695,7 @@ bool st_select_lex_unit::cleanup() if (global_parameters->order_list.elements) { ORDER *ord; - for (ord= (ORDER*)global_parameters->order_list.first; ord; ord= ord->next) + for (ord= global_parameters->order_list.first; ord; ord= ord->next) (*ord->item)->walk (&Item::cleanup_processor, 0, 0); } } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b2f2897c74e..3cdbb97b90b 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1331,7 +1331,7 @@ int multi_update::prepare(List ¬_used_values, SELECT_LEX_UNIT *lex_unit) { TABLE_LIST *table_ref; - SQL_LIST update; + SQL_I_List update; table_map tables_to_update; Item_field *item; List_iterator_fast field_it(*fields); @@ -1412,11 +1412,11 @@ int multi_update::prepare(List ¬_used_values, leaf_table_count++; if (tables_to_update & table->map) { - TABLE_LIST *tl= (TABLE_LIST*) thd->memdup((char*) table_ref, + TABLE_LIST *tl= (TABLE_LIST*) thd->memdup(table_ref, sizeof(*tl)); if (!tl) DBUG_RETURN(1); - update.link_in_list((uchar*) tl, (uchar**) &tl->next_local); + update.link_in_list(tl, &tl->next_local); tl->shared= table_count++; table->no_keyread=1; table->covering_keys.clear_all(); @@ -1437,7 +1437,7 @@ int multi_update::prepare(List ¬_used_values, table_count= update.elements; - update_tables= (TABLE_LIST*) update.first; + update_tables= update.first; tmp_tables = (TABLE**) thd->calloc(sizeof(TABLE *) * table_count); tmp_table_param = (TMP_TABLE_PARAM*) thd->calloc(sizeof(TMP_TABLE_PARAM) * diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 5ec80dfb621..3d0d80c8ad1 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -887,7 +887,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, view->algorithm != VIEW_ALGORITHM_TMPTABLE))) { /* TODO: change here when we will support UNIONs */ - for (TABLE_LIST *tbl= (TABLE_LIST *)lex->select_lex.table_list.first; + for (TABLE_LIST *tbl= lex->select_lex.table_list.first; tbl; tbl= tbl->next_local) { @@ -1006,7 +1006,7 @@ loop_out: */ if (view->updatable_view && !lex->select_lex.master_unit()->is_union() && - !((TABLE_LIST*)lex->select_lex.table_list.first)->next_local && + !(lex->select_lex.table_list.first)->next_local && find_table_in_global_list(lex->query_tables->next_global, lex->query_tables->db, lex->query_tables->table_name)) @@ -1349,8 +1349,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, This may change in future, for example if we enable merging of views with subqueries in select list. */ - view_main_select_tables= - (TABLE_LIST*)lex->select_lex.table_list.first; + view_main_select_tables= lex->select_lex.table_list.first; /* Let us set proper lock type for tables of the view's main diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index f815da006b1..5a3ad0b3eba 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -514,8 +514,7 @@ set_trigger_new_row(THD *thd, LEX_STRING *name, Item *val) Let us add this item to list of all Item_trigger_field objects in trigger. */ - lex->trg_table_fields.link_in_list((uchar *) trg_fld, - (uchar **) &trg_fld->next_trg_field); + lex->trg_table_fields.link_in_list(trg_fld, &trg_fld->next_trg_field); return lex->sphead->add_instr(sp_fld); } @@ -4678,11 +4677,9 @@ create_table_option: TABLE_LIST *table_list= lex->select_lex.get_table_list(); lex->create_info.merge_list= lex->select_lex.table_list; lex->create_info.merge_list.elements--; - lex->create_info.merge_list.first= - (uchar*) (table_list->next_local); + lex->create_info.merge_list.first= table_list->next_local; lex->select_lex.table_list.elements=1; - lex->select_lex.table_list.next= - (uchar**) &(table_list->next_local); + lex->select_lex.table_list.next= &(table_list->next_local); table_list->next_local= 0; lex->create_info.used_fields|= HA_CREATE_USED_UNION; } @@ -5638,8 +5635,7 @@ alter: lex->alter_info.reset(); lex->col_list.empty(); lex->select_lex.init_order(); - lex->select_lex.db= - ((TABLE_LIST*) lex->select_lex.table_list.first)->db; + lex->select_lex.db= (lex->select_lex.table_list.first)->db; bzero((char*) &lex->create_info,sizeof(lex->create_info)); lex->create_info.db_type= 0; lex->create_info.default_table_charset= NULL; @@ -8348,9 +8344,8 @@ opt_gorder_clause: | order_clause { SELECT_LEX *select= Select; - select->gorder_list= - (SQL_LIST*) sql_memdup((char*) &select->order_list, - sizeof(st_sql_list)); + select->gorder_list= new (YYTHD->mem_root) + SQL_I_List(select->order_list); if (select->gorder_list == NULL) MYSQL_YYABORT; select->order_list.empty(); @@ -9294,7 +9289,7 @@ procedure_clause: } lex->proc_list.elements=0; lex->proc_list.first=0; - lex->proc_list.next= (uchar**) &lex->proc_list.first; + lex->proc_list.next= &lex->proc_list.first; Item_field *item= new (YYTHD->mem_root) Item_field(&lex->current_select->context, NULL, NULL, $2.str); @@ -11252,8 +11247,8 @@ simple_ident_q: Let us add this item to list of all Item_trigger_field objects in trigger. */ - lex->trg_table_fields.link_in_list((uchar*) trg_fld, - (uchar**) &trg_fld->next_trg_field); + lex->trg_table_fields.link_in_list(trg_fld, + &trg_fld->next_trg_field); $$= trg_fld; } @@ -11339,7 +11334,7 @@ field_ident: ident { $$=$1;} | ident '.' ident '.' ident { - TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; + TABLE_LIST *table= Select->table_list.first; if (my_strcasecmp(table_alias_charset, $1.str, table->db)) { my_error(ER_WRONG_DB_NAME, MYF(0), $1.str); @@ -11355,7 +11350,7 @@ field_ident: } | ident '.' ident { - TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first; + TABLE_LIST *table= Select->table_list.first; if (my_strcasecmp(table_alias_charset, $1.str, table->alias)) { my_error(ER_WRONG_TABLE_NAME, MYF(0), $1.str); diff --git a/sql/table.h b/sql/table.h index 4125c252427..3ef3c5e0cb2 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1165,7 +1165,7 @@ struct TABLE_LIST } /* - List of tables local to a subquery (used by SQL_LIST). Considers + List of tables local to a subquery (used by SQL_I_List). Considers views as leaves (unlike 'next_leaf' below). Created at parse time in st_select_lex::add_table_to_list() -> table_list.link_in_list(). */ diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 9ccb08a8d33..7886cc2a5a2 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -1130,8 +1130,8 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info) goto err; create_info->merge_list.elements++; - (*create_info->merge_list.next) = (uchar*) ptr; - create_info->merge_list.next= (uchar**) &ptr->next_local; + (*create_info->merge_list.next) = ptr; + create_info->merge_list.next= &ptr->next_local; } *create_info->merge_list.next=0; } @@ -1153,7 +1153,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form, { char buff[FN_REFLEN]; const char **table_names, **pos; - TABLE_LIST *tables= (TABLE_LIST*) create_info->merge_list.first; + TABLE_LIST *tables= create_info->merge_list.first; THD *thd= current_thd; size_t dirlgt= dirname_length(name); DBUG_ENTER("ha_myisammrg::create"); From 0823afc8bf160e03ce722c5e3cef21024b63b99a Mon Sep 17 00:00:00 2001 From: Martin Hansson Date: Fri, 11 Jun 2010 09:38:29 +0200 Subject: [PATCH 107/121] Bug#53859: Valgrind: opt_sum_query(TABLE_LIST*, List&, Item*) at opt_sum.cc:305 Queries applying MIN/MAX functions to indexed columns are optimized to read directly from the index if all key parts of the index preceding the aggregated key part are bound to constants by the WHERE clause. A prefix length is also produced, equal to the total length of the bound key parts. If the aggregated column itself is bound to a constant, however, it is also included in the prefix. Such full search keys are read as closed intervals for reasons beyond the scope of this bug. However, the procedure missed one case where a key part meant for use as range endpoint was being overwritten with a NULL value destined for equality checking. In this case the key part was overwritten but the range flag remained, causing open interval reading to be performed. Bug was fixed by adding more stringent checking to the search key building procedure (matching_cond) and never allow overwrites of range predicates with non-range predicates. An assertion was added to make sure open intervals are never used with full search keys. --- mysql-test/r/group_min_max.result | 13 ++++++++++ mysql-test/t/group_min_max.test | 15 +++++++++++ sql/opt_sum.cc | 41 +++++++++++++++++++++---------- 3 files changed, 56 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index 01f27a498ef..6fef66b9d93 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -2767,4 +2767,17 @@ SELECT MIN( a ) FROM t1 WHERE a IS NULL; MIN( a ) NULL DROP TABLE t1; +# +# Bug#53859: Valgrind: opt_sum_query(TABLE_LIST*, List&, Item*) at +# opt_sum.cc:305 +# +CREATE TABLE t1 ( a INT, KEY (a) ); +INSERT INTO t1 VALUES (1), (2), (3); +SELECT MIN( a ) AS min_a +FROM t1 +WHERE a > 1 AND a IS NULL +ORDER BY min_a; +min_a +NULL +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index b06f0c09fc5..8ab7e1c9cb4 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -1085,4 +1085,19 @@ INSERT INTO t1 VALUES (1), (2), (3); --source include/min_null_cond.inc DROP TABLE t1; +--echo # +--echo # Bug#53859: Valgrind: opt_sum_query(TABLE_LIST*, List&, Item*) at +--echo # opt_sum.cc:305 +--echo # +CREATE TABLE t1 ( a INT, KEY (a) ); +INSERT INTO t1 VALUES (1), (2), (3); + +SELECT MIN( a ) AS min_a +FROM t1 +WHERE a > 1 AND a IS NULL +ORDER BY min_a; + +DROP TABLE t1; + + --echo End of 5.1 tests diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 666485fcfa2..b20a0c4fcbe 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -142,7 +142,10 @@ static int get_index_min_value(TABLE *table, TABLE_REF *ref, 1) We have only MIN() and the argument column is nullable, or 2) there is a > predicate on it, nullability is irrelevant. We need to scan the next bigger record first. + Open interval is not used if the search key involves the last keypart, + and it would not work. */ + DBUG_ASSERT(prefix_len < ref->key_length); error= table->file->index_read_map(table->record[0], ref->key_buff, make_prev_keypart_map(ref->key_parts), @@ -591,18 +594,19 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, key_part_map *key_part_used, uint *range_fl, uint *prefix_len) { + DBUG_ENTER("matching_cond"); if (!cond) - return 1; + DBUG_RETURN(TRUE); Field *field= field_part->field; if (!(cond->used_tables() & field->table->map)) { /* Condition doesn't restrict the used table */ - return 1; + DBUG_RETURN(TRUE); } if (cond->type() == Item::COND_ITEM) { if (((Item_cond*) cond)->functype() == Item_func::COND_OR_FUNC) - return 0; + DBUG_RETURN(FALSE); /* AND */ List_iterator_fast li(*((Item_cond*) cond)->argument_list()); @@ -611,13 +615,13 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, { if (!matching_cond(max_fl, ref, keyinfo, field_part, item, key_part_used, range_fl, prefix_len)) - return 0; + DBUG_RETURN(FALSE); } - return 1; + DBUG_RETURN(TRUE); } if (cond->type() != Item::FUNC_ITEM) - return 0; // Not operator, can't optimize + DBUG_RETURN(FALSE); // Not operator, can't optimize bool eq_type= 0; // =, <=> or IS NULL bool is_null_safe_eq= FALSE; // The operator is NULL safe, e.g. <=> @@ -651,7 +655,7 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, eq_type= 1; break; default: - return 0; // Can't optimize function + DBUG_RETURN(FALSE); // Can't optimize function } Item *args[3]; @@ -659,11 +663,11 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, /* Test if this is a comparison of a field and constant */ if (!simple_pred((Item_func*) cond, args, &inv)) - return 0; + DBUG_RETURN(FALSE); if (!is_null_safe_eq && !is_null && (args[1]->is_null() || (between && args[2]->is_null()))) - return FALSE; + DBUG_RETURN(FALSE); if (inv && !eq_type) less_fl= 1-less_fl; // Convert '<' -> '>' (etc) @@ -675,14 +679,14 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, { if (part > field_part) - return 0; // Field is beyond the tested parts + DBUG_RETURN(FALSE); // Field is beyond the tested parts if (part->field->eq(((Item_field*) args[0])->field)) break; // Found a part of the key for the field } bool is_field_part= part == field_part; if (!(is_field_part || eq_type)) - return 0; + DBUG_RETURN(FALSE); key_part_map org_key_part_used= *key_part_used; if (eq_type || between || max_fl == less_fl) @@ -702,6 +706,17 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, *key_part_used|= (key_part_map) 1 << (part - keyinfo->key_part); } + if (org_key_part_used == *key_part_used && + /* + The current search key is not being extended with a new key part. This + means that the a condition is added a key part for which there was a + previous condition. We can only overwrite such key parts in some special + cases, e.g. a > 2 AND a > 1 (here range_fl must be set to something). In + all other cases the WHERE condition is always false anyway. + */ + (eq_type || *range_fl == 0)) + DBUG_RETURN(FALSE); + if (org_key_part_used != *key_part_used || (is_field_part && (between || eq_type || max_fl == less_fl) && !cond->val_int())) @@ -747,11 +762,11 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, { if ((!is_null && !cond->val_int()) || (is_null && !test(part->field->is_null()))) - return 0; // Impossible test + DBUG_RETURN(FALSE); // Impossible test } else if (is_field_part) *range_fl&= ~(max_fl ? NO_MIN_RANGE : NO_MAX_RANGE); - return 1; + DBUG_RETURN(TRUE); } From 2845586723f383cd0bf7929eb80a263ef6e69da9 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sat, 12 Jun 2010 00:35:28 +0400 Subject: [PATCH 108/121] Fixed ha_ndbcluster_binlog.cc to use Parser_state::init(). --- sql/ha_ndbcluster_binlog.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index d38544f9b9f..a61f5b4feea 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -277,8 +277,9 @@ static void run_query(THD *thd, char *buf, char *end, DBUG_ASSERT(!thd->locked_tables_mode); { - Parser_state parser_state(thd, thd->query(), thd->query_length()); - mysql_parse(thd, thd->query(), thd->query_length(), &parser_state); + Parser_state parser_state; + if (!parser_state.init(thd, thd->query(), thd->query_length())) + mysql_parse(thd, thd->query(), thd->query_length(), &parser_state); } if (no_print_error && thd->is_slave_error) From 41c3732a75dad4872ccfcb61624e78a7bec8b944 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sat, 12 Jun 2010 09:52:31 +0400 Subject: [PATCH 109/121] Addendum for the fix for bug #42064: In Prepared_statement::prepare() bail out as soon as parser_state.init() fails, trying to continue leads to crashes. --- sql/sql_prepare.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 85ec5a72d77..a4241772311 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -3034,16 +3034,21 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) thd->stmt_arena= this; Parser_state parser_state; - if (!parser_state.init(thd, thd->query(), thd->query_length())) + if (parser_state.init(thd, thd->query(), thd->query_length())) { - parser_state.m_lip.stmt_prepare_mode= TRUE; - lex_start(thd); - - error= parse_sql(thd, & parser_state, NULL) || - thd->is_error() || - init_param_array(this); + thd->restore_backup_statement(this, &stmt_backup); + thd->restore_active_arena(this, &stmt_backup); + thd->stmt_arena= old_stmt_arena; + DBUG_RETURN(TRUE); } + parser_state.m_lip.stmt_prepare_mode= TRUE; + lex_start(thd); + + error= parse_sql(thd, & parser_state, NULL) || + thd->is_error() || + init_param_array(this); + lex->set_trg_event_type_for_tables(); /* From 28ec745704a231ce7064b14c2d94cf2b9bf7408c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 14 Jun 2010 09:35:01 +0300 Subject: [PATCH 110/121] Merge a change from mysql-5.1-innodb: ------------------------------------------------------------ revno: 3506 revision-id: sergey.glukhov@sun.com-20100609121718-04mpk5kjxvnrxdu8 parent: sergey.glukhov@sun.com-20100609120734-ndy2281wau9067zv committer: Sergey Glukhov branch nick: mysql-5.1-innodb timestamp: Wed 2010-06-09 16:17:18 +0400 message: Bug#38999 valgrind warnings for update statement in function compare_record() (InnoDB plugin branch) @ mysql-test/suite/innodb_plugin/r/innodb_mysql.result test case @ mysql-test/suite/innodb_plugin/t/innodb_mysql.test test case @ storage/innodb_plugin/row/row0sel.c init null bytes with default values as they might be left uninitialized in some cases and these uninited bytes might be copied into mysql record buffer that leads to valgrind warnings on next use of the buffer. --- mysql-test/suite/innodb/r/innodb_mysql.result | 12 ++++++++++++ mysql-test/suite/innodb/t/innodb_mysql.test | 14 ++++++++++++++ storage/innobase/row/row0sel.c | 6 ++++++ 3 files changed, 32 insertions(+) diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 1845b32564d..90ced3c8b16 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -2413,6 +2413,18 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where DROP TABLE t1,t2; +# +# Bug#38999 valgrind warnings for update statement in function compare_record() +# +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 values (1),(2),(3),(4),(5); +INSERT INTO t2 values (1); +SELECT * FROM t1 WHERE a = 2; +a +2 +UPDATE t1,t2 SET t1.a = t1.a + 100 WHERE t1.a = 1; +DROP TABLE t1,t2; End of 5.1 tests # # Test for bug #39932 "create table fails if column for FK is in different diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test index f2c770cce42..c49b215887b 100644 --- a/mysql-test/suite/innodb/t/innodb_mysql.test +++ b/mysql-test/suite/innodb/t/innodb_mysql.test @@ -649,6 +649,20 @@ EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0 DROP TABLE t1,t2; +--echo # +--echo # Bug#38999 valgrind warnings for update statement in function compare_record() +--echo # + +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 values (1),(2),(3),(4),(5); +INSERT INTO t2 values (1); + +SELECT * FROM t1 WHERE a = 2; +UPDATE t1,t2 SET t1.a = t1.a + 100 WHERE t1.a = 1; + +DROP TABLE t1,t2; + --echo End of 5.1 tests diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index a5bf361661b..2861235a995 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -2678,6 +2678,12 @@ row_sel_store_mysql_rec( prebuilt->blob_heap = NULL; } + /* init null bytes with default values as they might be + left uninitialized in some cases and these uninited bytes + might be copied into mysql record buffer that leads to + valgrind warnings */ + memcpy(mysql_rec, prebuilt->default_rec, prebuilt->null_bitmap_len); + for (i = 0; i < prebuilt->n_template; i++) { templ = prebuilt->mysql_template + i; From ac3c92e435e94b96f8ae942d28a9f80f9d9427c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 14 Jun 2010 09:50:30 +0300 Subject: [PATCH 111/121] =?UTF-8?q?Merge=20a=20change=20from=20mysql-5.1-i?= =?UTF-8?q?nnodb:=20------------------------------------------------------?= =?UTF-8?q?------=20revno:=203507=20revision-id:=20marko.makela@oracle.com?= =?UTF-8?q?-20100610125623-ar6qf4w2pv2kr7mb=20parent:=20sergey.glukhov@sun?= =?UTF-8?q?.com-20100609121718-04mpk5kjxvnrxdu8=20committer:=20Marko=20M?= =?UTF-8?q?=C3=A4kel=C3=A4=20=20branch=20nick:=20?= =?UTF-8?q?5.1-innodb=20timestamp:=20Thu=202010-06-10=2015:56:23=20+0300?= =?UTF-8?q?=20message:=20=20=20Bug=20#38999:=20Re-enable=20innodb=5Fmulti?= =?UTF-8?q?=5Fupdate.test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mysql-test/suite/innodb/t/disabled.def | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def index da04138fd0a..888298bbb09 100644 --- a/mysql-test/suite/innodb/t/disabled.def +++ b/mysql-test/suite/innodb/t/disabled.def @@ -9,4 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -innodb_multi_update: Bug #38999 2010-05-05 mmakela Valgrind warnings From b18902fd59596bfc0b0a0417953bbd312be8bcaa Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Mon, 14 Jun 2010 11:26:42 +0200 Subject: [PATCH 112/121] Bug #46882 Suite timeout doesn't kill stray processes Kill mysqltest and call mtr_kill_leftovers() before terminating --- mysql-test/lib/mtr_process.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index a60b2822a14..ee5277d39d7 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -264,8 +264,9 @@ sub spawn_parent_impl { if ( $timer_name eq "suite" ) { # We give up here - # FIXME we should only give up the suite, not all of the run? print STDERR "\n"; + kill(9, $pid); # Kill mysqltest + mtr_kill_leftovers(); # Kill servers the hard way mtr_error("Test suite timeout"); } elsif ( $timer_name eq "testcase" ) From 3434059ae06030252dde38b9ce2ecaa05c8bfd8b Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Tue, 15 Jun 2010 12:58:52 +0400 Subject: [PATCH 113/121] Make perfschema.pfs_upgrade and sys_vars.wait_timeout_func experimental. --- mysql-test/collections/default.experimental | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 84fb2ac5e76..29f0e6c34a6 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -25,6 +25,8 @@ main.sp @solaris # Bug#47791 2010-01-20 alik Several tes main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris +perfschema.pfs_upgrade # Bug#53102 2010-06-15 alik perfschema.pfs_upgrade fails on sol10 sparc64 max in parallel mode + rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_innodb_bug28430* # Bug#46029 @@ -34,7 +36,7 @@ rpl.rpl_plugin_load* @solaris # Bug#47146 rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun -sys_vars.wait_timeout_func @solaris # Bug#41255 2010-04-26 alik wait_timeout_func fails +sys_vars.wait_timeout_func # Bug#41255 2010-04-26 alik wait_timeout_func fails # Declare all NDB-tests in ndb and rpl_ndb test suites experimental. # Usually the test cases from ndb and rpl_ndb test suites are not run in PB, From 8d253fe2f8ee8cbb3bd9f0cba1116567a9721022 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 15 Jun 2010 11:00:02 +0200 Subject: [PATCH 114/121] Bug #53424 Certain combination of flags give internal error Reorder code breaks when finding tests skipped due to --skip-rpl etc. Add simple test that master_opt is non-empty --- mysql-test/lib/mtr_cases.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index b9943fb6cfa..b3b7adf1b9e 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -246,8 +246,10 @@ sub collect_test_cases ($) { push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0")); # Group test with equal options together. # Ending with "~" makes empty sort later than filled - push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~"); - + if ( $tinfo->{'master_opt'}[0] ) + { + push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~"); + } $sort_criteria{$test_name} = join(" ", @criteria); } } From d2e58e4e49f4c42c3c6b1220ccc0004ed6963192 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 15 Jun 2010 18:29:53 +0400 Subject: [PATCH 115/121] Backport of the patch for bug52208 to 5.1 since the root cause of 52208 resulted in another test failure in 5.1. --- sql/mysqld.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7356d4e917e..daa1bbe8ccc 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -190,9 +190,9 @@ typedef fp_except fp_except_t; # define fpu_control_t unsigned int # define _FPU_EXTENDED 0x300 # define _FPU_DOUBLE 0x200 -# ifdef __GNUC__ -# define _FPU_GETCW(cw) __asm__ __volatile__("fnstcw %0" : "=m" (*&cw)) -# define _FPU_SETCW(cw) __asm__ __volatile__("fldcw %0" : : "m" (*&cw)) +# if defined(__GNUC__) || defined(__SUNPRO_CC) +# define _FPU_GETCW(cw) asm volatile ("fnstcw %0" : "=m" (*&cw)) +# define _FPU_SETCW(cw) asm volatile ("fldcw %0" : : "m" (*&cw)) # else # define _FPU_GETCW(cw) (cw= 0) # define _FPU_SETCW(cw) From 5a0b9cd2968839759f783f7b869852fafa8ef8f7 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Tue, 15 Jun 2010 17:51:57 +0300 Subject: [PATCH 116/121] Increment InnoDB version number from 1.1.1 to 1.1.2, the 1.1.1 release will be included inside MySQL 5.5.5 and is up to (inclusive): vasil.dimov@oracle.com-20100602124314-21l3cb27w4rbfqrq --- storage/innobase/include/univ.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 11cec113fc8..15acb81f0d8 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -46,7 +46,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 1 #define INNODB_VERSION_MINOR 1 -#define INNODB_VERSION_BUGFIX 1 +#define INNODB_VERSION_BUGFIX 2 /* The following is the InnoDB version as shown in SELECT plugin_version FROM information_schema.plugins; From b3eac87c3cf7a3c747173483bcb02deb3421f4b3 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 15 Jun 2010 22:27:48 +0200 Subject: [PATCH 117/121] Fix bug#27072: RPM autostarts the server This is the fix for 5.1, where only the behaviour on upgrade is changed: If the server was stopped when the upgrade begins, we assume the administrator is taking manual action, so we do not start the (new) server at the end of the upgrade. We still install the start/stop script, so it will be started on reboot. support-files/mysql.spec.sh: In the "pre" section of the spec file, check the server status, and write the result to a file. In the "post" section, evaluate the status file, and start the server if it was running during status analysis. In 5.1, we start the server if there is no status file (which will happen on first installation, when there is no data directory yet). --- support-files/mysql.spec.sh | 120 +++++++++++++++++++++++++++++++++--- 1 file changed, 113 insertions(+), 7 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 91848ffc8bd..21a4d0c52a0 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -610,6 +610,7 @@ touch $RBR%{_sysconfdir}/mysqlmanager.passwd ############################################################################## %pre server +mysql_datadir=%{mysqldatadir} # Check if we can safely upgrade. An upgrade is only safe if it's from one # of our RPMs in the same version family. @@ -678,7 +679,74 @@ HERE fi fi +# We assume that if there is exactly one ".pid" file, +# it contains the valid PID of a running MySQL server. +NR_PID_FILES=`ls $mysql_datadir/*.pid 2>/dev/null | wc -l` +case $NR_PID_FILES in + 0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server + 1 ) SERVER_TO_START='true' ;; + * ) SERVER_TO_START='' # Situation not clear + SEVERAL_PID_FILES=true ;; +esac +# That logic may be debated: We might check whether it is non-empty, +# contains exactly one number (possibly a PID), and whether "ps" finds it. +# OTOH, if there is no such process, it means a crash without a cleanup - +# is that a reason not to start a new server after upgrade? + +STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER + +if [ -f $STATUS_FILE ]; then + echo "Some previous upgrade was not finished:" + ls -ld $STATUS_FILE + echo "Please check its status, then do" + echo " rm $STATUS_FILE" + echo "before repeating the MySQL upgrade." + exit 1 +elif [ -n "$SEVERAL_PID_FILES" ] ; then + echo "Your MySQL directory '$mysql_datadir' has more than one PID file:" + ls -ld $mysql_datadir/*.pid + echo "Please check which one (if any) corresponds to a running server" + echo "and delete all others before repeating the MySQL upgrade." + exit 1 +fi + +NEW_VERSION=%{mysql_version}-%{release} + +# The "pre" section code is also run on a first installation, +# when there is no data directory yet. Protect against error messages. +if [ -d $mysql_datadir ] ; then + echo "MySQL RPM upgrade to version $NEW_VERSION" > $STATUS_FILE + echo "'pre' step running at `date`" >> $STATUS_FILE + echo >> $STATUS_FILE + echo "ERR file(s):" >> $STATUS_FILE + ls -ltr $mysql_datadir/*.err >> $STATUS_FILE + echo >> $STATUS_FILE + echo "Latest 'Version' line in latest file:" >> $STATUS_FILE + grep '^Version' `ls -tr $mysql_datadir/*.err | tail -1` | \ + tail -1 >> $STATUS_FILE + echo >> $STATUS_FILE + + if [ -n "$SERVER_TO_START" ] ; then + # There is only one PID file, race possibility ignored + echo "PID file:" >> $STATUS_FILE + ls -l $mysql_datadir/*.pid >> $STATUS_FILE + cat $mysql_datadir/*.pid >> $STATUS_FILE + echo >> $STATUS_FILE + echo "Server process:" >> $STATUS_FILE + ps -fp `cat $mysql_datadir/*.pid` >> $STATUS_FILE + echo >> $STATUS_FILE + echo "SERVER_TO_START=$SERVER_TO_START" >> $STATUS_FILE + else + # Take a note we checked it ... + echo "PID file:" >> $STATUS_FILE + ls -l $mysql_datadir/*.pid >> $STATUS_FILE 2>&1 + fi +fi + # Shut down a previously installed server first +# Note we *could* make that depend on $SERVER_TO_START, but we rather don't, +# so a "stop" is attempted even if there is no PID file. +# (Maybe the "stop" doesn't work then, but we might fix that in itself.) if [ -x %{_sysconfdir}/init.d/mysql ] ; then %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1 echo "Giving mysqld 5 seconds to exit nicely" @@ -687,17 +755,33 @@ fi %post server mysql_datadir=%{mysqldatadir} +NEW_VERSION=%{mysql_version}-%{release} +STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER # ---------------------------------------------------------------------- -# Create data directory if needed +# Create data directory if needed, check whether upgrade or install # ---------------------------------------------------------------------- if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi -if [ ! -d $mysql_datadir/mysql ] ; then mkdir $mysql_datadir/mysql; fi +if [ -f $STATUS_FILE ] ; then + SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` +else + SERVER_TO_START='true' # This is for 5.1 only, to not change behavior +fi +# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START" +if [ ! -d $mysql_datadir/mysql ] ; then + mkdir $mysql_datadir/mysql; + echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE +else + # If the directory exists, we may assume it is an upgrade. + echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE +fi if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi # ---------------------------------------------------------------------- # Make MySQL start/shutdown automatically when the machine does it. # ---------------------------------------------------------------------- +# NOTE: This still needs to be debated. Should we check whether these links +# for the other run levels exist(ed) before the upgrade? # use insserv for older SuSE Linux versions if [ -x /sbin/insserv ] ; then /sbin/insserv %{_sysconfdir}/init.d/mysql @@ -741,11 +825,14 @@ chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir # ---------------------------------------------------------------------- chmod -R og-rw $mysql_datadir/mysql -# Restart in the same way that mysqld will be started normally. -%{_sysconfdir}/init.d/mysql start +# Was the server running before the upgrade? If so, restart the new one. +if [ "$SERVER_TO_START" = "true" ] ; then + # Restart in the same way that mysqld will be started normally. + %{_sysconfdir}/init.d/mysql start -# Allow mysqld_safe to start mysqld and print a message before we exit -sleep 2 + # Allow mysqld_safe to start mysqld and print a message before we exit + sleep 2 +fi #echo "Thank you for installing the MySQL Community Server! For Production #systems, we recommend MySQL Enterprise, which contains enterprise-ready @@ -753,6 +840,14 @@ sleep 2 #scheduled service packs and more. Visit www.mysql.com/enterprise for more #information." +# Collect an upgrade history ... +echo "Upgrade/install finished at `date`" >> $STATUS_FILE +echo >> $STATUS_FILE +echo "=====" >> $STATUS_FILE +STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY +cat $STATUS_FILE >> $STATUS_HISTORY +rm $STATUS_FILE + %if %{CLUSTER_BUILD} %post ndb-storage mysql_clusterdir=/var/lib/mysql-cluster @@ -1038,6 +1133,17 @@ fi # merging BK trees) ############################################################################## %changelog + +* Tue Jun 15 2010 Joerg Bruehe + +- Change the behaviour on upgrade: + *Iff* the server was stopped before the upgrade is started, this is taken as a + sign the administrator is handling that manually, and so the new server will + not be started automatically at the end of the upgrade. + The start/stop scripts will still be installed, so the server will be started + on the next machine boot. + This is the 5.1 version of fixing bug#27072 (RPM autostarting the server). + * Mon Mar 01 2010 Joerg Bruehe - Set "Oracle and/or its affiliates" as the vendor and copyright owner, From 8ccbb4211bcbcddb9a5e6bbd35c426b6e5cbaece Mon Sep 17 00:00:00 2001 From: Sunny Bains Date: Thu, 17 Jun 2010 11:06:13 +1000 Subject: [PATCH 118/121] Revert a change that should have been a part of 3008.2.76..3008.2.78. --- storage/innobase/srv/srv0srv.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index b1f3a543b07..5bdeca7b01d 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -2371,30 +2371,6 @@ loop: OS_THREAD_DUMMY_RETURN; } -/******************************************************************//** -Increment the server activity count. */ -UNIV_INLINE -void -srv_inc_activity_count_low(void) -/*============================*/ -{ - mutex_enter(&kernel_mutex); - - ++srv_activity_count; - - mutex_exit(&kernel_mutex); -} - -/******************************************************************//** -Increment the server activity count. */ -UNIV_INTERN -void -srv_inc_activity_count(void) -/*========================*/ -{ - srv_inc_activity_count_low(); -} - /**********************************************************************//** Check whether any background thread is active. @return FALSE if all are are suspended or have exited. */ @@ -2431,9 +2407,7 @@ void srv_active_wake_master_thread(void) /*===============================*/ { - ut_ad(!mutex_own(&kernel_mutex)); - - srv_inc_activity_count_low(); + srv_activity_count++; if (srv_n_threads_active[SRV_MASTER] == 0) { From 0cbc668fc2583c44600256e5800f4a158302e855 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Thu, 17 Jun 2010 02:13:53 -0700 Subject: [PATCH 119/121] This change splits innodb_file_format_check into innodb_file_format_check and innodb_file_format_max two system variables. And this also fixes bug #53654 after 2nd shutdown innodb_file_format_check attains strange values. rb://366 approved by Marko --- mysql-test/suite/innodb/r/innodb-index.result | 2 +- mysql-test/suite/innodb/r/innodb-zip.result | 20 +- .../suite/innodb/r/innodb_bug47167.result | 42 ++-- .../suite/innodb/r/innodb_bug52745.result | 2 +- .../suite/innodb/r/innodb_bug53591.result | 2 +- .../suite/innodb/r/innodb_file_format.result | 35 ++-- .../suite/innodb/t/innodb-autoinc-44030.test | 4 +- mysql-test/suite/innodb/t/innodb-autoinc.test | 4 +- mysql-test/suite/innodb/t/innodb-index.test | 6 +- mysql-test/suite/innodb/t/innodb-zip.test | 16 +- .../suite/innodb/t/innodb_bug36172.test | 4 +- .../suite/innodb/t/innodb_bug47167.test | 45 ++-- .../suite/innodb/t/innodb_bug52745.test | 4 +- .../suite/innodb/t/innodb_bug53591.test | 4 +- .../suite/innodb/t/innodb_file_format.test | 28 ++- mysql-test/suite/sys_vars/r/all_vars.result | 2 + .../r/innodb_file_format_check_basic.result | 84 ++++---- .../t/innodb_file_format_check_basic.test | 46 ++--- storage/innobase/handler/ha_innodb.cc | 195 ++++++++---------- storage/innobase/include/dict0mem.h | 4 + storage/innobase/include/srv0srv.h | 2 +- storage/innobase/srv/srv0srv.c | 2 +- storage/innobase/srv/srv0start.c | 2 +- storage/innobase/trx/trx0sys.c | 8 +- 24 files changed, 277 insertions(+), 286 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index 5d67a06b80f..e43f70a2365 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -920,7 +920,7 @@ create index t1u on t1 (u(1)); drop table t1; set global innodb_file_per_table=0; set global innodb_file_format=Antelope; -set global innodb_file_format_check=Antelope; +set global innodb_file_format_max=Antelope; SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; CREATE TABLE t1( diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb/r/innodb-zip.result index bcd3849238f..6c93f4bb6ca 100644 --- a/mysql-test/suite/innodb/r/innodb-zip.result +++ b/mysql-test/suite/innodb/r/innodb-zip.result @@ -397,25 +397,25 @@ set global innodb_file_per_table=0; set global innodb_file_format=Antelope; set global innodb_file_per_table=on; set global innodb_file_format=`Barracuda`; -set global innodb_file_format_check=`Antelope`; +set global innodb_file_format_max=`Antelope`; create table normal_table ( c1 int ) engine = innodb; -select @@innodb_file_format_check; -@@innodb_file_format_check +select @@innodb_file_format_max; +@@innodb_file_format_max Antelope create table zip_table ( c1 int ) engine = innodb key_block_size = 8; -select @@innodb_file_format_check; -@@innodb_file_format_check +select @@innodb_file_format_max; +@@innodb_file_format_max Barracuda -set global innodb_file_format_check=`Antelope`; -select @@innodb_file_format_check; -@@innodb_file_format_check +set global innodb_file_format_max=`Antelope`; +select @@innodb_file_format_max; +@@innodb_file_format_max Antelope show table status; -select @@innodb_file_format_check; -@@innodb_file_format_check +select @@innodb_file_format_max; +@@innodb_file_format_max Barracuda drop table normal_table, zip_table; diff --git a/mysql-test/suite/innodb/r/innodb_bug47167.result b/mysql-test/suite/innodb/r/innodb_bug47167.result index cf8cb0c0d7b..656a4846a52 100644 --- a/mysql-test/suite/innodb/r/innodb_bug47167.result +++ b/mysql-test/suite/innodb/r/innodb_bug47167.result @@ -1,24 +1,24 @@ -set @old_innodb_file_format_check=@@innodb_file_format_check; -select @old_innodb_file_format_check; -@old_innodb_file_format_check +set @old_innodb_file_format_max=@@innodb_file_format_max; +select @old_innodb_file_format_max; +@old_innodb_file_format_max Antelope -set global innodb_file_format_check = Barracuda; -select @@innodb_file_format_check; -@@innodb_file_format_check +set global innodb_file_format_max = Barracuda; +select @@innodb_file_format_max; +@@innodb_file_format_max Barracuda -set global innodb_file_format_check = DEFAULT; -select @@innodb_file_format_check; -@@innodb_file_format_check -Barracuda -set global innodb_file_format_check = @old_innodb_file_format_check; -select @@innodb_file_format_check; -@@innodb_file_format_check +set global innodb_file_format_max = DEFAULT; +select @@innodb_file_format_max; +@@innodb_file_format_max Antelope -set global innodb_file_format_check = cheetah; -ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'cheetah' -set global innodb_file_format_check = Bear; -ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'Bear' -set global innodb_file_format_check = on; -ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'ON' -set global innodb_file_format_check = off; -ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'off' +set global innodb_file_format_max = @old_innodb_file_format_max; +select @@innodb_file_format_max; +@@innodb_file_format_max +Antelope +set global innodb_file_format_max = cheetah; +ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'cheetah' +set global innodb_file_format_max = Bear; +ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Bear' +set global innodb_file_format_max = on; +ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'ON' +set global innodb_file_format_max = off; +ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'off' diff --git a/mysql-test/suite/innodb/r/innodb_bug52745.result b/mysql-test/suite/innodb/r/innodb_bug52745.result index 254c6525257..d746fb427b5 100644 --- a/mysql-test/suite/innodb/r/innodb_bug52745.result +++ b/mysql-test/suite/innodb/r/innodb_bug52745.result @@ -126,5 +126,5 @@ Warning 1265 Data truncated for column 'col79' at row 1 Warning 1264 Out of range value for column 'col84' at row 1 DROP TABLE bug52745; SET GLOBAL innodb_file_format=Antelope; -SET GLOBAL innodb_file_format_check=Antelope; +SET GLOBAL innodb_file_format_max=Antelope; SET GLOBAL innodb_file_per_table=0; diff --git a/mysql-test/suite/innodb/r/innodb_bug53591.result b/mysql-test/suite/innodb/r/innodb_bug53591.result index 1f05b6d2a57..d3f8dfeafc2 100644 --- a/mysql-test/suite/innodb/r/innodb_bug53591.result +++ b/mysql-test/suite/innodb/r/innodb_bug53591.result @@ -12,5 +12,5 @@ Error 1118 Row size too large. The maximum row size for the used table type, not Error 1030 Got error 139 from storage engine DROP TABLE bug53591; SET GLOBAL innodb_file_format=Antelope; -SET GLOBAL innodb_file_format_check=Antelope; +SET GLOBAL innodb_file_format_max=Antelope; SET GLOBAL innodb_file_per_table=0; diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result index 6a573d8658e..70cfc9e4f47 100644 --- a/mysql-test/suite/innodb/r/innodb_file_format.result +++ b/mysql-test/suite/innodb/r/innodb_file_format.result @@ -3,6 +3,9 @@ select @@innodb_file_format; Antelope select @@innodb_file_format_check; @@innodb_file_format_check +1 +select @@innodb_file_format_max; +@@innodb_file_format_max Antelope set global innodb_file_format=antelope; set global innodb_file_format=barracuda; @@ -22,22 +25,26 @@ ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off' select @@innodb_file_format; @@innodb_file_format Antelope -set global innodb_file_format_check=antelope; -set global innodb_file_format_check=barracuda; -set global innodb_file_format_check=cheetah; -ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'cheetah' -select @@innodb_file_format_check; -@@innodb_file_format_check -Barracuda -set global innodb_file_format_check=default; -select @@innodb_file_format_check; -@@innodb_file_format_check +set global innodb_file_format_max=antelope; +set global innodb_file_format_max=barracuda; +set global innodb_file_format_max=cheetah; +ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'cheetah' +select @@innodb_file_format_max; +@@innodb_file_format_max Barracuda +set global innodb_file_format_max=default; +select @@innodb_file_format_max; +@@innodb_file_format_max +Antelope set global innodb_file_format=on; ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON' set global innodb_file_format=off; ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off' -select @@innodb_file_format_check; -@@innodb_file_format_check -Barracuda -set global innodb_file_format_check=antelope; +select @@innodb_file_format_max; +@@innodb_file_format_max +Antelope +set global innodb_file_format_max=antelope; +set global innodb_file_format_check=off; +ERROR HY000: Variable 'innodb_file_format_check' is a read only variable +SET GLOBAL innodb_file_format=Antelope; +SET GLOBAL innodb_file_format_max=Antelope; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test index 17c836004a1..790646fe13b 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test @@ -2,7 +2,7 @@ # embedded server ignores 'delayed', so skip this -- source include/not_embedded.inc -let $innodb_file_format_check_orig=`select @@innodb_file_format_check`; +let $innodb_file_format_max_orig=`select @@innodb_file_format_max`; --disable_warnings drop table if exists t1; @@ -40,4 +40,4 @@ DROP TABLE t1; # -- disable_query_log -eval SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig; +eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test index c1cae16153e..a8e853baef7 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -2,7 +2,7 @@ # embedded server ignores 'delayed', so skip this -- source include/not_embedded.inc -let $innodb_file_format_check_orig=`select @@innodb_file_format_check`; +let $innodb_file_format_max_orig=`select @@innodb_file_format_max`; --disable_warnings drop table if exists t1; @@ -671,4 +671,4 @@ DROP TABLE t1; # -- disable_query_log -eval SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig; +eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig; diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index f7cf3050704..05d1d37c422 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -2,7 +2,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; -let $innodb_file_format_check_orig=`select @@innodb_file_format_check`; +let $innodb_file_format_max_orig=`select @@innodb_file_format_max`; create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb; insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak'); @@ -403,7 +403,7 @@ create index t1u on t1 (u(1)); drop table t1; eval set global innodb_file_per_table=$per_table; eval set global innodb_file_format=$format; -eval set global innodb_file_format_check=$format; +eval set global innodb_file_format_max=$format; # # Test to check whether CREATE INDEX handles implicit foreign key @@ -550,4 +550,4 @@ DROP TABLE t1; # -- disable_query_log -eval SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig; +eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig; diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test index 8ba83517b44..3acd7e42fa6 100644 --- a/mysql-test/suite/innodb/t/innodb-zip.test +++ b/mysql-test/suite/innodb/t/innodb-zip.test @@ -2,7 +2,7 @@ let $per_table=`select @@innodb_file_per_table`; let $format=`select @@innodb_file_format`; -let $innodb_file_format_check_orig=`select @@innodb_file_format_check`; +let $innodb_file_format_max_orig=`select @@innodb_file_format_max`; set global innodb_file_per_table=off; set global innodb_file_format=`0`; @@ -316,21 +316,21 @@ eval set global innodb_file_format=$format; -- disable_info set global innodb_file_per_table=on; set global innodb_file_format=`Barracuda`; -set global innodb_file_format_check=`Antelope`; +set global innodb_file_format_max=`Antelope`; create table normal_table ( c1 int ) engine = innodb; -select @@innodb_file_format_check; +select @@innodb_file_format_max; create table zip_table ( c1 int ) engine = innodb key_block_size = 8; -select @@innodb_file_format_check; -set global innodb_file_format_check=`Antelope`; -select @@innodb_file_format_check; +select @@innodb_file_format_max; +set global innodb_file_format_max=`Antelope`; +select @@innodb_file_format_max; -- disable_result_log show table status; -- enable_result_log -select @@innodb_file_format_check; +select @@innodb_file_format_max; drop table normal_table, zip_table; -- disable_result_log @@ -341,4 +341,4 @@ drop table normal_table, zip_table; -- disable_query_log eval set global innodb_file_format=$format; eval set global innodb_file_per_table=$per_table; -eval set global innodb_file_format_check=$innodb_file_format_check_orig; +eval set global innodb_file_format_max=$innodb_file_format_max_orig; diff --git a/mysql-test/suite/innodb/t/innodb_bug36172.test b/mysql-test/suite/innodb/t/innodb_bug36172.test index c6c4e6fae47..6f5dd7629ff 100644 --- a/mysql-test/suite/innodb/t/innodb_bug36172.test +++ b/mysql-test/suite/innodb/t/innodb_bug36172.test @@ -15,7 +15,7 @@ SET storage_engine=InnoDB; -- disable_result_log let $file_format=`select @@innodb_file_format`; -let $file_format_check=`select @@innodb_file_format_check`; +let $file_format_max=`select @@innodb_file_format_max`; let $file_per_table=`select @@innodb_file_per_table`; SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_file_per_table=on; @@ -28,5 +28,5 @@ INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.90 CHECK TABLE table0 EXTENDED; DROP TABLE table0; EVAL SET GLOBAL innodb_file_format=$file_format; -EVAL SET GLOBAL innodb_file_format_check=$file_format_check; +EVAL SET GLOBAL innodb_file_format_max=$file_format_max; EVAL SET GLOBAL innodb_file_per_table=$file_per_table; diff --git a/mysql-test/suite/innodb/t/innodb_bug47167.test b/mysql-test/suite/innodb/t/innodb_bug47167.test index 9b8bff0292f..622182acefa 100644 --- a/mysql-test/suite/innodb/t/innodb_bug47167.test +++ b/mysql-test/suite/innodb/t/innodb_bug47167.test @@ -1,45 +1,44 @@ -# This is the unit test for bug *47167. -# It tests setting the global variable -# "innodb_file_format_check" with a -# user-Defined Variable. +# This is the unit test for bug #47167. +# It tests setting the global variable "innodb_file_format_max" ( +# originally "innodb_file_format_check") with a user-Defined Variable. --source include/have_innodb.inc -# Save the value (Antelope) in 'innodb_file_format_check' to -# 'old_innodb_file_format_check' -set @old_innodb_file_format_check=@@innodb_file_format_check; +# Save the value (Antelope) in 'innodb_file_format_max' to +# 'old_innodb_file_format_max' +set @old_innodb_file_format_max=@@innodb_file_format_max; -# @old_innodb_file_format_check shall have the value of 'Antelope' -select @old_innodb_file_format_check; +# @old_innodb_file_format_max shall have the value of 'Antelope' +select @old_innodb_file_format_max; -# Reset the value in 'innodb_file_format_check' to 'Barracuda' -set global innodb_file_format_check = Barracuda; +# Reset the value in 'innodb_file_format_max' to 'Barracuda' +set global innodb_file_format_max = Barracuda; -select @@innodb_file_format_check; +select @@innodb_file_format_max; -# Set 'innodb_file_format_check' to its default value, which +# Set 'innodb_file_format_max' to its default value, which # is the latest file format supported in the current release. -set global innodb_file_format_check = DEFAULT; +set global innodb_file_format_max = DEFAULT; -select @@innodb_file_format_check; +select @@innodb_file_format_max; -# Put the saved value back to 'innodb_file_format_check' -set global innodb_file_format_check = @old_innodb_file_format_check; +# Put the saved value back to 'innodb_file_format_max' +set global innodb_file_format_max = @old_innodb_file_format_max; -# Check whether 'innodb_file_format_check' get its original value. -select @@innodb_file_format_check; +# Check whether 'innodb_file_format_max' get its original value. +select @@innodb_file_format_max; # Following are negative tests, all should fail. --disable_warnings --error ER_WRONG_VALUE_FOR_VAR -set global innodb_file_format_check = cheetah; +set global innodb_file_format_max = cheetah; --error ER_WRONG_VALUE_FOR_VAR -set global innodb_file_format_check = Bear; +set global innodb_file_format_max = Bear; --error ER_WRONG_VALUE_FOR_VAR -set global innodb_file_format_check = on; +set global innodb_file_format_max = on; --error ER_WRONG_VALUE_FOR_VAR -set global innodb_file_format_check = off; +set global innodb_file_format_max = off; --enable_warnings diff --git a/mysql-test/suite/innodb/t/innodb_bug52745.test b/mysql-test/suite/innodb/t/innodb_bug52745.test index d2de869648b..686ca705ab7 100644 --- a/mysql-test/suite/innodb/t/innodb_bug52745.test +++ b/mysql-test/suite/innodb/t/innodb_bug52745.test @@ -1,7 +1,7 @@ -- source include/have_innodb.inc let $file_format=`select @@innodb_file_format`; -let $file_format_check=`select @@innodb_file_format_check`; +let $file_format_max=`select @@innodb_file_format_max`; let $file_per_table=`select @@innodb_file_per_table`; SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_file_per_table=on; @@ -105,5 +105,5 @@ SHOW WARNINGS; DROP TABLE bug52745; EVAL SET GLOBAL innodb_file_format=$file_format; -EVAL SET GLOBAL innodb_file_format_check=$file_format_check; +EVAL SET GLOBAL innodb_file_format_max=$file_format_max; EVAL SET GLOBAL innodb_file_per_table=$file_per_table; diff --git a/mysql-test/suite/innodb/t/innodb_bug53591.test b/mysql-test/suite/innodb/t/innodb_bug53591.test index 58a7596dff9..e0e568034d8 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53591.test +++ b/mysql-test/suite/innodb/t/innodb_bug53591.test @@ -1,7 +1,7 @@ -- source include/have_innodb.inc let $file_format=`select @@innodb_file_format`; -let $file_format_check=`select @@innodb_file_format_check`; +let $file_format_max=`select @@innodb_file_format_max`; let $file_per_table=`select @@innodb_file_per_table`; SET GLOBAL innodb_file_format='Barracuda'; @@ -18,5 +18,5 @@ SHOW WARNINGS; DROP TABLE bug53591; EVAL SET GLOBAL innodb_file_format=$file_format; -EVAL SET GLOBAL innodb_file_format_check=$file_format_check; +EVAL SET GLOBAL innodb_file_format_max=$file_format_max; EVAL SET GLOBAL innodb_file_per_table=$file_per_table; diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test index 5d094cb9dba..26c3646c0dd 100644 --- a/mysql-test/suite/innodb/t/innodb_file_format.test +++ b/mysql-test/suite/innodb/t/innodb_file_format.test @@ -1,7 +1,11 @@ -- source include/have_innodb.inc +let $innodb_file_format_orig=`select @@innodb_file_format`; +let $innodb_file_format_max_orig=`select @@innodb_file_format_max`; + select @@innodb_file_format; select @@innodb_file_format_check; +select @@innodb_file_format_max; set global innodb_file_format=antelope; set global innodb_file_format=barracuda; --error ER_WRONG_VALUE_FOR_VAR @@ -14,16 +18,24 @@ set global innodb_file_format=on; --error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=off; select @@innodb_file_format; -set global innodb_file_format_check=antelope; -set global innodb_file_format_check=barracuda; +set global innodb_file_format_max=antelope; +set global innodb_file_format_max=barracuda; --error ER_WRONG_VALUE_FOR_VAR -set global innodb_file_format_check=cheetah; -select @@innodb_file_format_check; -set global innodb_file_format_check=default; -select @@innodb_file_format_check; +set global innodb_file_format_max=cheetah; +select @@innodb_file_format_max; +set global innodb_file_format_max=default; +select @@innodb_file_format_max; --error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=on; --error ER_WRONG_VALUE_FOR_VAR set global innodb_file_format=off; -select @@innodb_file_format_check; -set global innodb_file_format_check=antelope; +select @@innodb_file_format_max; +set global innodb_file_format_max=antelope; + +# innodb_file_format_check is read only variable, can be +# set as server startup parameter +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global innodb_file_format_check=off; + +eval SET GLOBAL innodb_file_format=$innodb_file_format_orig; +eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig; diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result index 0f741ff930a..7f6dca3eb7b 100644 --- a/mysql-test/suite/sys_vars/r/all_vars.result +++ b/mysql-test/suite/sys_vars/r/all_vars.result @@ -10,5 +10,7 @@ There should be *no* long test name listed below: select variable_name as `There should be *no* variables listed below:` from t2 left join t1 on variable_name=test_name where test_name is null; There should be *no* variables listed below: +INNODB_FILE_FORMAT_MAX +INNODB_FILE_FORMAT_MAX drop table t1; drop table t2; diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result index 29be30cf096..c59e1b802f4 100644 --- a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result @@ -1,59 +1,59 @@ -SET @start_global_value = @@global.innodb_file_format_check; +SET @start_global_value = @@global.innodb_file_format_max; SELECT @start_global_value; @start_global_value Antelope Valid values are 'Antelope' and 'Barracuda' -select @@global.innodb_file_format_check in ('Antelope', 'Barracuda'); -@@global.innodb_file_format_check in ('Antelope', 'Barracuda') +select @@global.innodb_file_format_max in ('Antelope', 'Barracuda'); +@@global.innodb_file_format_max in ('Antelope', 'Barracuda') 1 -select @@global.innodb_file_format_check; -@@global.innodb_file_format_check +select @@global.innodb_file_format_max; +@@global.innodb_file_format_max Antelope -select @@session.innodb_file_format_check; -ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable -show global variables like 'innodb_file_format_check'; +select @@session.innodb_file_format_max; +ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable +show global variables like 'innodb_file_format_max'; Variable_name Value -innodb_file_format_check Antelope -show session variables like 'innodb_file_format_check'; +innodb_file_format_max Antelope +show session variables like 'innodb_file_format_max'; Variable_name Value -innodb_file_format_check Antelope -select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +innodb_file_format_max Antelope +select * from information_schema.global_variables where variable_name='innodb_file_format_max'; VARIABLE_NAME VARIABLE_VALUE -INNODB_FILE_FORMAT_CHECK Antelope -select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +INNODB_FILE_FORMAT_MAX Antelope +select * from information_schema.session_variables where variable_name='innodb_file_format_max'; VARIABLE_NAME VARIABLE_VALUE -INNODB_FILE_FORMAT_CHECK Antelope -set global innodb_file_format_check='Antelope'; -select @@global.innodb_file_format_check; -@@global.innodb_file_format_check +INNODB_FILE_FORMAT_MAX Antelope +set global innodb_file_format_max='Antelope'; +select @@global.innodb_file_format_max; +@@global.innodb_file_format_max Antelope -select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +select * from information_schema.global_variables where variable_name='innodb_file_format_max'; VARIABLE_NAME VARIABLE_VALUE -INNODB_FILE_FORMAT_CHECK Antelope -select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +INNODB_FILE_FORMAT_MAX Antelope +select * from information_schema.session_variables where variable_name='innodb_file_format_max'; VARIABLE_NAME VARIABLE_VALUE -INNODB_FILE_FORMAT_CHECK Antelope -set @@global.innodb_file_format_check='Barracuda'; -select @@global.innodb_file_format_check; -@@global.innodb_file_format_check +INNODB_FILE_FORMAT_MAX Antelope +set @@global.innodb_file_format_max='Barracuda'; +select @@global.innodb_file_format_max; +@@global.innodb_file_format_max Barracuda -select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +select * from information_schema.global_variables where variable_name='innodb_file_format_max'; VARIABLE_NAME VARIABLE_VALUE -INNODB_FILE_FORMAT_CHECK Barracuda -select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +INNODB_FILE_FORMAT_MAX Barracuda +select * from information_schema.session_variables where variable_name='innodb_file_format_max'; VARIABLE_NAME VARIABLE_VALUE -INNODB_FILE_FORMAT_CHECK Barracuda -set session innodb_file_format_check='Salmon'; -ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable and should be set with SET GLOBAL -set @@session.innodb_file_format_check='Salmon'; -ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable and should be set with SET GLOBAL -set global innodb_file_format_check=1.1; -ERROR 42000: Incorrect argument type to variable 'innodb_file_format_check' -set global innodb_file_format_check=1e1; -ERROR 42000: Incorrect argument type to variable 'innodb_file_format_check' -set global innodb_file_format_check='Salmon'; -ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'Salmon' -SET @@global.innodb_file_format_check = @start_global_value; -SELECT @@global.innodb_file_format_check; -@@global.innodb_file_format_check +INNODB_FILE_FORMAT_MAX Barracuda +set session innodb_file_format_max='Salmon'; +ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_file_format_max='Salmon'; +ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_file_format_max=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max' +set global innodb_file_format_max=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max' +set global innodb_file_format_max='Salmon'; +ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon' +SET @@global.innodb_file_format_max = @start_global_value; +SELECT @@global.innodb_file_format_max; +@@global.innodb_file_format_max Antelope diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test index 4c60957561c..e087cc738b0 100644 --- a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test @@ -5,51 +5,51 @@ --source include/have_innodb.inc -SET @start_global_value = @@global.innodb_file_format_check; +SET @start_global_value = @@global.innodb_file_format_max; SELECT @start_global_value; # # exists as global only # --echo Valid values are 'Antelope' and 'Barracuda' -select @@global.innodb_file_format_check in ('Antelope', 'Barracuda'); -select @@global.innodb_file_format_check; +select @@global.innodb_file_format_max in ('Antelope', 'Barracuda'); +select @@global.innodb_file_format_max; --error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.innodb_file_format_check; -show global variables like 'innodb_file_format_check'; -show session variables like 'innodb_file_format_check'; -select * from information_schema.global_variables where variable_name='innodb_file_format_check'; -select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +select @@session.innodb_file_format_max; +show global variables like 'innodb_file_format_max'; +show session variables like 'innodb_file_format_max'; +select * from information_schema.global_variables where variable_name='innodb_file_format_max'; +select * from information_schema.session_variables where variable_name='innodb_file_format_max'; # # show that it's writable # -set global innodb_file_format_check='Antelope'; -select @@global.innodb_file_format_check; -select * from information_schema.global_variables where variable_name='innodb_file_format_check'; -select * from information_schema.session_variables where variable_name='innodb_file_format_check'; -set @@global.innodb_file_format_check='Barracuda'; -select @@global.innodb_file_format_check; -select * from information_schema.global_variables where variable_name='innodb_file_format_check'; -select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +set global innodb_file_format_max='Antelope'; +select @@global.innodb_file_format_max; +select * from information_schema.global_variables where variable_name='innodb_file_format_max'; +select * from information_schema.session_variables where variable_name='innodb_file_format_max'; +set @@global.innodb_file_format_max='Barracuda'; +select @@global.innodb_file_format_max; +select * from information_schema.global_variables where variable_name='innodb_file_format_max'; +select * from information_schema.session_variables where variable_name='innodb_file_format_max'; --error ER_GLOBAL_VARIABLE -set session innodb_file_format_check='Salmon'; +set session innodb_file_format_max='Salmon'; --error ER_GLOBAL_VARIABLE -set @@session.innodb_file_format_check='Salmon'; +set @@session.innodb_file_format_max='Salmon'; # # incorrect types # --error ER_WRONG_TYPE_FOR_VAR -set global innodb_file_format_check=1.1; +set global innodb_file_format_max=1.1; --error ER_WRONG_TYPE_FOR_VAR -set global innodb_file_format_check=1e1; +set global innodb_file_format_max=1e1; --error ER_WRONG_VALUE_FOR_VAR -set global innodb_file_format_check='Salmon'; +set global innodb_file_format_max='Salmon'; # # Cleanup # -SET @@global.innodb_file_format_check = @start_global_value; -SELECT @@global.innodb_file_format_check; +SET @@global.innodb_file_format_max = @start_global_value; +SELECT @@global.innodb_file_format_max; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 21d30dc4904..675edc61ac7 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -149,10 +149,10 @@ static char* innobase_log_group_home_dir = NULL; static char* innobase_file_format_name = NULL; static char* innobase_change_buffering = NULL; -/* Note: This variable can be set to on/off and any of the supported -file formats in the configuration file, but can only be set to any -of the supported file formats during runtime. */ -static char* innobase_file_format_check = NULL; +/* The highest file format being used in the database. The value can be +set by user, however, it will be adjusted to the newer file format if +a table of such format is created/opened. */ +static char* innobase_file_format_max = NULL; static char* innobase_file_flush_method = NULL; @@ -160,6 +160,7 @@ static char* innobase_file_flush_method = NULL; values */ static ulong innobase_fast_shutdown = 1; +static my_bool innobase_file_format_check = TRUE; #ifdef UNIV_LOG_ARCHIVE static my_bool innobase_log_archive = FALSE; static char* innobase_log_arch_dir = NULL; @@ -171,6 +172,7 @@ static my_bool innobase_rollback_on_timeout = FALSE; static my_bool innobase_create_status_file = FALSE; static my_bool innobase_stats_on_metadata = TRUE; + static char* internal_innobase_data_file_path = NULL; static char* innodb_version_str = (char*) INNODB_VERSION_STR; @@ -366,22 +368,13 @@ innobase_file_format_name_lookup( name */ /************************************************************//** Validate the file format check config parameters, as a side effect it -sets the srv_check_file_format_at_startup variable. -@return true if one of "on" or "off" */ -static -bool -innobase_file_format_check_on_off( -/*==============================*/ - const char* format_check); /*!< in: parameter value */ -/************************************************************//** -Validate the file format check config parameters, as a side effect it -sets the srv_check_file_format_at_startup variable. +sets the srv_max_file_format_at_startup variable. @return the format_id if valid config value, otherwise, return -1 */ static int innobase_file_format_validate_and_set( -/*================================*/ - const char* format_check); /*!< in: parameter value */ +/*==================================*/ + const char* format_max); /*!< in: parameter value */ /****************************************************************//** Return alter table flags supported in an InnoDB database. */ static @@ -2264,32 +2257,35 @@ mem_free_and_error: innobase_file_format_name is used in the MySQL set variable interface and so can't be const. */ - innobase_file_format_name = + innobase_file_format_name = (char*) trx_sys_file_format_id_to_name(format_id); - /* Process innobase_file_format_check variable */ - ut_a(innobase_file_format_check != NULL); + /* Check innobase_file_format_check variable */ + if (!innobase_file_format_check) { - /* As a side effect it will set srv_check_file_format_at_startup - on valid input. First we check for "on"/"off". */ - if (!innobase_file_format_check_on_off(innobase_file_format_check)) { + /* Set the value to disable checking. */ + srv_max_file_format_at_startup = DICT_TF_FORMAT_MAX + 1; - /* Did the user specify a format name that we support ? - As a side effect it will update the variable - srv_check_file_format_at_startup */ - if (innobase_file_format_validate_and_set( - innobase_file_format_check) < 0) { + } else { - sql_print_error("InnoDB: invalid " - "innodb_file_format_check value: " - "should be either 'on' or 'off' or " - "any value up to %s or its " - "equivalent numeric id", - trx_sys_file_format_id_to_name( - DICT_TF_FORMAT_MAX)); + /* Set the value to the lowest supported format. */ + srv_max_file_format_at_startup = DICT_TF_FORMAT_MIN; + } - goto mem_free_and_error; - } + /* Did the user specify a format name that we support? + As a side effect it will update the variable + srv_max_file_format_at_startup */ + if (innobase_file_format_validate_and_set( + innobase_file_format_max) < 0) { + + sql_print_error("InnoDB: invalid " + "innodb_file_format_max value: " + "should be any value up to %s or its " + "equivalent numeric id", + trx_sys_file_format_id_to_name( + DICT_TF_FORMAT_MAX)); + + goto mem_free_and_error; } if (innobase_change_buffering) { @@ -2451,7 +2447,7 @@ innobase_change_buffering_inited_ok: #endif /* MYSQL_DYNAMIC_PLUGIN */ /* Get the current high water mark format. */ - innobase_file_format_check = (char*) trx_sys_file_format_max_get(); + innobase_file_format_max = (char*) trx_sys_file_format_max_get(); DBUG_RETURN(FALSE); error: @@ -3836,7 +3832,7 @@ retry: space, if this table has higher file format setting. */ trx_sys_file_format_max_upgrade( - (const char**) &innobase_file_format_check, + (const char**) &innobase_file_format_max, dict_table_get_format(prebuilt->table)); } @@ -6959,7 +6955,7 @@ ha_innobase::create( space, if this table has higher file format setting. */ trx_sys_file_format_max_upgrade( - (const char**) &innobase_file_format_check, + (const char**) &innobase_file_format_max, dict_table_get_format(innobase_table)); } @@ -10347,50 +10343,22 @@ innobase_file_format_name_lookup( return(DICT_TF_FORMAT_MAX + 1); } -/************************************************************//** -Validate the file format check value, is it one of "on" or "off", -as a side effect it sets the srv_check_file_format_at_startup variable. -@return true if config value one of "on" or "off" */ -static -bool -innobase_file_format_check_on_off( -/*==============================*/ - const char* format_check) /*!< in: parameter value */ -{ - bool ret = true; - - if (!innobase_strcasecmp(format_check, "off")) { - - /* Set the value to disable checking. */ - srv_check_file_format_at_startup = DICT_TF_FORMAT_MAX + 1; - - } else if (!innobase_strcasecmp(format_check, "on")) { - - /* Set the value to the lowest supported format. */ - srv_check_file_format_at_startup = DICT_TF_FORMAT_51; - } else { - ret = FALSE; - } - - return(ret); -} - /************************************************************//** Validate the file format check config parameters, as a side effect it -sets the srv_check_file_format_at_startup variable. +sets the srv_max_file_format_at_startup variable. @return the format_id if valid config value, otherwise, return -1 */ static int innobase_file_format_validate_and_set( -/*================================*/ - const char* format_check) /*!< in: parameter value */ +/*==================================*/ + const char* format_max) /*!< in: parameter value */ { uint format_id; - format_id = innobase_file_format_name_lookup(format_check); + format_id = innobase_file_format_name_lookup(format_max); if (format_id < DICT_TF_FORMAT_MAX + 1) { - srv_check_file_format_at_startup = format_id; + srv_max_file_format_at_startup = format_id; return((int) format_id); } else { @@ -10478,15 +10446,14 @@ innodb_file_format_name_update( *static_cast(var_ptr) = trx_sys_file_format_id_to_name(srv_file_format); } - /*************************************************************//** -Check if valid argument to innodb_file_format_check. This -function is registered as a callback with MySQL. +Check if valid argument to innodb_file_format_max. This function +is registered as a callback with MySQL. @return 0 for valid file format */ static int -innodb_file_format_check_validate( -/*==============================*/ +innodb_file_format_max_validate( +/*============================*/ THD* thd, /*!< in: thread handle */ struct st_mysql_sys_var* var, /*!< in: pointer to system variable */ @@ -10506,39 +10473,27 @@ innodb_file_format_check_validate( if (file_format_input != NULL) { - /* Check if user set on/off, we want to print a suitable - message if they did so. */ + format_id = innobase_file_format_validate_and_set( + file_format_input); + + if (format_id >= 0) { + /* Save a pointer to the name in the + 'file_format_name_map' constant array. */ + *static_cast(save) = + trx_sys_file_format_id_to_name( + (uint)format_id); + + return(0); - if (innobase_file_format_check_on_off(file_format_input)) { - push_warning_printf(thd, - MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WRONG_ARGUMENTS, - "InnoDB: invalid innodb_file_format_check " - "value; on/off can only be set at startup or " - "in the configuration file"); } else { - format_id = innobase_file_format_validate_and_set( - file_format_input); - - if (format_id >= 0) { - /* Save a pointer to the name in the - 'file_format_name_map' constant array. */ - *static_cast(save) = - trx_sys_file_format_id_to_name( - (uint)format_id); - - return(0); - - } else { - push_warning_printf(thd, - MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WRONG_ARGUMENTS, - "InnoDB: invalid innodb_file_format_check " - "value; can be any format up to %s " - "or its equivalent numeric id", - trx_sys_file_format_id_to_name( - DICT_TF_FORMAT_MAX)); - } + push_warning_printf(thd, + MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + "InnoDB: invalid innodb_file_format_max " + "value; can be any format up to %s " + "or equivalent id of %d", + trx_sys_file_format_id_to_name(DICT_TF_FORMAT_MAX), + DICT_TF_FORMAT_MAX); } } @@ -10547,12 +10502,12 @@ innodb_file_format_check_validate( } /****************************************************************//** -Update the system variable innodb_file_format_check using the "saved" +Update the system variable innodb_file_format_max using the "saved" value. This function is registered as a callback with MySQL. */ static void -innodb_file_format_check_update( -/*============================*/ +innodb_file_format_max_update( +/*==========================*/ THD* thd, /*!< in: thread handle */ struct st_mysql_sys_var* var, /*!< in: pointer to system variable */ @@ -10862,15 +10817,26 @@ static MYSQL_SYSVAR_STR(file_format, innobase_file_format_name, innodb_file_format_name_validate, innodb_file_format_name_update, "Antelope"); +/* "innobase_file_format_check" decides whether we would continue +booting the server if the file format stamped on the system +table space exceeds the maximum file format supported +by the server. Can be set during server startup at command +line or configure file, and a read only variable after +server startup */ +static MYSQL_SYSVAR_BOOL(file_format_check, innobase_file_format_check, + PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, + "Whether to perform system file format check.", + NULL, NULL, TRUE); + /* If a new file format is introduced, the file format name needs to be updated accordingly. Please refer to file_format_name_map[] defined in trx0sys.c for the next file format name. */ -static MYSQL_SYSVAR_STR(file_format_check, innobase_file_format_check, +static MYSQL_SYSVAR_STR(file_format_max, innobase_file_format_max, PLUGIN_VAR_OPCMDARG, "The highest file format in the tablespace.", - innodb_file_format_check_validate, - innodb_file_format_check_update, "Barracuda"); + innodb_file_format_max_validate, + innodb_file_format_max_update, "Antelope"); static MYSQL_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit, PLUGIN_VAR_OPCMDARG, @@ -11118,6 +11084,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(file_per_table), MYSQL_SYSVAR(file_format), MYSQL_SYSVAR(file_format_check), + MYSQL_SYSVAR(file_format_max), MYSQL_SYSVAR(flush_log_at_trx_commit), MYSQL_SYSVAR(flush_method), MYSQL_SYSVAR(force_recovery), diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index f93b2f8c8a3..57e5b5394ee 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -88,6 +88,10 @@ combination of types */ new BLOB treatment */ /** Maximum supported file format */ #define DICT_TF_FORMAT_MAX DICT_TF_FORMAT_ZIP + +/** Minimum supported file format */ +#define DICT_TF_FORMAT_MIN DICT_TF_FORMAT_51 + /* @} */ #define DICT_TF_BITS 6 /*!< number of flag bits */ #if (1 << (DICT_TF_BITS - DICT_TF_FORMAT_SHIFT)) <= DICT_TF_FORMAT_MAX diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 98e127d41e2..18f7c07c3c6 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -101,7 +101,7 @@ extern ulint srv_file_format; /** Whether to check file format during startup. A value of DICT_TF_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to set it to the highest format we support. */ -extern ulint srv_check_file_format_at_startup; +extern ulint srv_max_file_format_at_startup; /** Place locks to records only i.e. do not use next-key locking except on duplicate key checking and foreign key checking */ extern ibool srv_locks_unsafe_for_binlog; diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 5bdeca7b01d..6354689105a 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -127,7 +127,7 @@ UNIV_INTERN ulint srv_file_format = 0; /** Whether to check file format during startup. A value of DICT_TF_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to set it to the highest format we support. */ -UNIV_INTERN ulint srv_check_file_format_at_startup = DICT_TF_FORMAT_MAX; +UNIV_INTERN ulint srv_max_file_format_at_startup = DICT_TF_FORMAT_MAX; #if DICT_TF_FORMAT_51 # error "DICT_TF_FORMAT_51 must be 0!" diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c index 1b96a2f4708..4a0ecc5154f 100644 --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -1590,7 +1590,7 @@ innobase_start_or_create_for_mysql(void) consistent state, this is REQUIRED for the recovery process to work. */ err = trx_sys_file_format_max_check( - srv_check_file_format_at_startup); + srv_max_file_format_at_startup); if (err != DB_SUCCESS) { return(err); diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c index 9c531e64662..e2f0ff6d532 100644 --- a/storage/innobase/trx/trx0sys.c +++ b/storage/innobase/trx/trx0sys.c @@ -135,7 +135,7 @@ UNIV_INTERN mysql_pfs_key_t file_format_max_mutex_key; #ifndef UNIV_HOTBACKUP /** This is used to track the maximum file format id known to InnoDB. It's -updated via SET GLOBAL innodb_file_format_check = 'x' or when we open +updated via SET GLOBAL innodb_file_format_max = 'x' or when we open or create a table. */ static file_format_t file_format_max; @@ -1160,7 +1160,7 @@ trx_sys_file_format_max_check( if (format_id == ULINT_UNDEFINED) { /* Format ID was not set. Set it to minimum possible value. */ - format_id = DICT_TF_FORMAT_51; + format_id = DICT_TF_FORMAT_MIN; } ut_print_timestamp(stderr); @@ -1240,7 +1240,7 @@ trx_sys_file_format_tag_init(void) /* If format_id is not set then set it to the minimum. */ if (format_id == ULINT_UNDEFINED) { - trx_sys_file_format_max_set(DICT_TF_FORMAT_51, NULL); + trx_sys_file_format_max_set(DICT_TF_FORMAT_MIN, NULL); } } @@ -1296,7 +1296,7 @@ trx_sys_file_format_init(void) /* We don't need a mutex here, as this function should only be called once at start up. */ - file_format_max.id = DICT_TF_FORMAT_51; + file_format_max.id = DICT_TF_FORMAT_MIN; file_format_max.name = trx_sys_file_format_id_to_name( file_format_max.id); From 028bb395b747a505d3c94f8c4c33f3d7ef0e17a8 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 17 Jun 2010 12:35:23 +0300 Subject: [PATCH 120/121] Decrement version number from 1.1.2 to 1.1.1, this latest tree is going to be 1.1.1. --- storage/innobase/include/univ.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 15acb81f0d8..11cec113fc8 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -46,7 +46,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 1 #define INNODB_VERSION_MINOR 1 -#define INNODB_VERSION_BUGFIX 2 +#define INNODB_VERSION_BUGFIX 1 /* The following is the InnoDB version as shown in SELECT plugin_version FROM information_schema.plugins; From e4b19dd475348504a9fda38193f03e8b28cd8145 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 17 Jun 2010 12:59:53 +0300 Subject: [PATCH 121/121] Adjust innodb_mysql.result after the resolved conflict from the merge --- mysql-test/suite/innodb/r/innodb_mysql.result | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 1624a9e64b7..124370fa630 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -2414,8 +2414,8 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where DROP TABLE t1,t2; # -# # Bug#38999 valgrind warnings for update statement in function compare_record() +# CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 values (1),(2),(3),(4),(5); @@ -2425,7 +2425,9 @@ a 2 UPDATE t1,t2 SET t1.a = t1.a + 100 WHERE t1.a = 1; DROP TABLE t1,t2; +# # Bug #53830: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index)) +# CREATE TABLE t1 (a INT, b INT, c INT, d INT, PRIMARY KEY(a,b,c), KEY(b,d)) ENGINE=InnoDB;