From 1628a2ae27cfc8b96e4b50d85d430955625e2d88 Mon Sep 17 00:00:00 2001 From: Monty Date: Tue, 27 Dec 2016 01:30:20 +0200 Subject: [PATCH] Fixed issues found by buildbot - MDEV-11621 rpl.rpl_gtid_stop_start fails sporadically in buildbot - MDEV-11620 rpl.rpl_upgrade_master_info fails sporadically in buildbot The issue above was probably that the build machine was overworked and the shutdown took longer than 30 resp 10 seconds, which caused MyISAM tables to be marked as crashed. Fixed by flushing myisam tables before doing a forced shutdown/kill. I also increased timeout for forced shutdown from 10 seconds to 60 seconds to fix other possible issues on slow machines. Fixed also some compiler warnings --- client/mysqltest.cc | 1 + mysql-test/include/rpl_stop_server.inc | 4 ++-- mysql-test/suite/rpl/r/rpl_gtid_stop_start.result | 6 ++++++ mysql-test/suite/rpl/r/rpl_upgrade_master_info.result | 5 +++++ mysql-test/suite/rpl/t/rpl_gtid_stop_start.test | 6 ++++++ mysql-test/suite/rpl/t/rpl_upgrade_master_info.test | 5 +++++ sql/compat56.cc | 6 +++--- sql/item_jsonfunc.cc | 2 +- sql/log_event.cc | 8 ++++---- storage/innobase/row/row0ftsort.cc | 4 ---- storage/mroonga/vendor/groonga/lib/proc.c | 2 +- 11 files changed, 34 insertions(+), 15 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index f0c56bc639c..702098fc5bc 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5156,6 +5156,7 @@ uint get_errcode_from_name(const char *error_name, const char *error_end) handler_error_names))) return tmp; die("Unknown SQL error name '%s'", error_name); + return 0; // Keep compiler happy } const char *unknown_error= ""; diff --git a/mysql-test/include/rpl_stop_server.inc b/mysql-test/include/rpl_stop_server.inc index e1f8839dd69..978cfec1885 100644 --- a/mysql-test/include/rpl_stop_server.inc +++ b/mysql-test/include/rpl_stop_server.inc @@ -47,8 +47,8 @@ if ($rpl_debug) --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect # Send shutdown to the connected server and give -# it 10 seconds to die before zapping it -shutdown_server 10; +# it 60 seconds to die before zapping it +shutdown_server 60; --source include/wait_until_disconnected.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result index db2f40fd495..3ba17822319 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result @@ -55,6 +55,7 @@ INSERT INTO t1 VALUES(5); include/save_master_gtid.inc connection server_2; include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; a 1 @@ -87,6 +88,7 @@ a connection server_1; INSERT INTO t1 VALUES (7); connection server_2; +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; a 1 @@ -116,6 +118,7 @@ include/start_slave.inc connection server_1; INSERT INTO t1 VALUES (8); connection server_2; +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; a 1 @@ -142,6 +145,7 @@ Error 1286 Unknown storage engine 'InnoDB' connection server_1; INSERT INTO t1 VALUES (9); connection server_2; +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; a 1 @@ -171,6 +175,7 @@ domain_id COUNT(*) connection server_1; INSERT INTO t1 VALUES (11); connection server_2; +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id; domain_id COUNT(*) 0 2 @@ -180,6 +185,7 @@ connection server_1; INSERT INTO t1 VALUES (12); INSERT INTO t1 VALUES (13); connection server_2; +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id; domain_id COUNT(*) 0 2 diff --git a/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result index 3e737267fbd..ffa041efd27 100644 --- a/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result +++ b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result @@ -14,6 +14,7 @@ connection slave; CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; include/start_slave.inc include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1; a 1 @@ -27,6 +28,7 @@ connection slave; CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; include/start_slave.inc include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; a 1 @@ -41,6 +43,7 @@ connection slave; CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; include/start_slave.inc include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; a 1 @@ -56,6 +59,7 @@ connection slave; CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; include/start_slave.inc include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; a 1 @@ -72,6 +76,7 @@ connection slave; CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; include/start_slave.inc include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test index b57714aaa57..65b13b57f2d 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test @@ -92,6 +92,7 @@ INSERT INTO t1 VALUES(5); --connection server_2 --source include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; --echo *** Test that @@gtid_slave_pos and @@gtid_current_pos are correctly loaded even if slave threads have not started. *** @@ -136,6 +137,7 @@ INSERT INTO t1 VALUES (7); --connection server_2 --sync_with_master +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; # Now we restart the slave server. When it restarts, there is nothing new @@ -177,6 +179,7 @@ INSERT INTO t1 VALUES (8); --connection server_2 --sync_with_master +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; --source include/stop_slave.inc @@ -210,6 +213,7 @@ INSERT INTO t1 VALUES (9); --connection server_2 --sync_with_master +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; # Put things back as they were. @@ -248,6 +252,7 @@ INSERT INTO t1 VALUES (11); --connection server_2 --sync_with_master +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id; --write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect @@ -270,6 +275,7 @@ INSERT INTO t1 VALUES (13); --connection server_2 --sync_with_master +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id; diff --git a/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test index e81e7c0d714..42b375c4579 100644 --- a/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test +++ b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test @@ -29,6 +29,7 @@ INSERT INTO t1 VALUES (1); eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; --source include/start_slave.inc --source include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1; --source include/stop_slave.inc @@ -54,6 +55,7 @@ INSERT INTO t1 VALUES (2); eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; --source include/start_slave.inc --source include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; --source include/stop_slave.inc @@ -79,6 +81,7 @@ INSERT INTO t1 VALUES (3); eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; --source include/start_slave.inc --source include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; --source include/stop_slave.inc @@ -104,6 +107,7 @@ INSERT INTO t1 VALUES (4); eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; --source include/start_slave.inc --source include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; --source include/stop_slave.inc @@ -129,6 +133,7 @@ INSERT INTO t1 VALUES (5); eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; --source include/start_slave.inc --source include/sync_with_master_gtid.inc +FLUSH NO_WRITE_TO_BINLOG TABLES; SELECT * FROM t1 ORDER BY a; --source include/stop_slave.inc diff --git a/sql/compat56.cc b/sql/compat56.cc index 3bd6b21a154..704d1db9a98 100644 --- a/sql/compat56.cc +++ b/sql/compat56.cc @@ -65,7 +65,7 @@ void TIME_from_longlong_time_packed(MYSQL_TIME *ltime, longlong tmp) long hms; if ((ltime->neg= (tmp < 0))) tmp= -tmp; - hms= MY_PACKED_TIME_GET_INT_PART(tmp); + hms= (long) MY_PACKED_TIME_GET_INT_PART(tmp); ltime->year= (uint) 0; ltime->month= (uint) 0; ltime->day= (uint) 0; @@ -264,11 +264,11 @@ void TIME_from_longlong_datetime_packed(MYSQL_TIME *ltime, longlong tmp) ltime->day= ymd % (1 << 5); ltime->month= ym % 13; - ltime->year= ym / 13; + ltime->year= (uint) (ym / 13); ltime->second= hms % (1 << 6); ltime->minute= (hms >> 6) % (1 << 6); - ltime->hour= (hms >> 12); + ltime->hour= (uint) (hms >> 12); ltime->time_type= MYSQL_TIMESTAMP_DATETIME; } diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 9b9490a0cbc..a500170ead0 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -2307,7 +2307,7 @@ bool Item_func_json_search::fix_fields(THD *thd, Item **ref) } -static const uint SQR_MAX_BLOB_WIDTH= sqrt(MAX_BLOB_WIDTH); +static const uint SQR_MAX_BLOB_WIDTH= (uint) sqrt(MAX_BLOB_WIDTH); void Item_func_json_search::fix_length_and_dec() { diff --git a/sql/log_event.cc b/sql/log_event.cc index 85dce217743..0af348ab453 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1794,7 +1794,7 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet, if (fdle->crypto_data.scheme) { uchar iv[BINLOG_IV_LENGTH]; - fdle->crypto_data.set_iv(iv, my_b_tell(file) - data_len); + fdle->crypto_data.set_iv(iv, (uint32) (my_b_tell(file) - data_len)); char *newpkt= (char*)my_malloc(data_len + ev_offset + 1, MYF(MY_WME)); if (!newpkt) @@ -7058,7 +7058,7 @@ Binlog_checkpoint_log_event::Binlog_checkpoint_log_event( uint8 header_size= description_event->common_header_len; uint8 post_header_len= description_event->post_header_len[BINLOG_CHECKPOINT_EVENT-1]; - if (event_len < header_size + post_header_len || + if (event_len < (uint) header_size + (uint) post_header_len || post_header_len < BINLOG_CHECKPOINT_HEADER_LEN) return; buf+= header_size; @@ -7096,7 +7096,7 @@ Gtid_log_event::Gtid_log_event(const char *buf, uint event_len, { uint8 header_size= description_event->common_header_len; uint8 post_header_len= description_event->post_header_len[GTID_EVENT-1]; - if (event_len < header_size + post_header_len || + if (event_len < (uint) header_size + (uint) post_header_len || post_header_len < GTID_HEADER_LEN) return; @@ -7421,7 +7421,7 @@ Gtid_list_log_event::Gtid_list_log_event(const char *buf, uint event_len, uint32 val; uint8 header_size= description_event->common_header_len; uint8 post_header_len= description_event->post_header_len[GTID_LIST_EVENT-1]; - if (event_len < header_size + post_header_len || + if (event_len < (uint) header_size + (uint) post_header_len || post_header_len < GTID_LIST_HEADER_LEN) return; diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 0d216d584d7..3179c63f162 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -793,7 +793,6 @@ fts_parallel_tokenization( mem_heap_t* blob_heap = NULL; fts_doc_t doc; dict_table_t* table = psort_info->psort_common->new_table; - dict_field_t* idx_field; fts_tokenize_ctx_t t_ctx; ulint retried = 0; dberr_t error = DB_SUCCESS; @@ -822,9 +821,6 @@ fts_parallel_tokenization( doc.charset = fts_index_get_charset( psort_info->psort_common->dup->index); - idx_field = dict_index_get_nth_field( - psort_info->psort_common->dup->index, 0); - block = psort_info->merge_block; crypt_block = psort_info->crypt_block; crypt_data = psort_info->psort_common->crypt_data; diff --git a/storage/mroonga/vendor/groonga/lib/proc.c b/storage/mroonga/vendor/groonga/lib/proc.c index 86b0fd58c02..ba858de6f2a 100644 --- a/storage/mroonga/vendor/groonga/lib/proc.c +++ b/storage/mroonga/vendor/groonga/lib/proc.c @@ -713,7 +713,7 @@ grn_select_drilldown(grn_ctx *ctx, grn_obj *table, { uint32_t i; for (i = 0; i < n_keys; i++) { - grn_table_group_result g = {NULL, 0, 0, 1, GRN_TABLE_GROUP_CALC_COUNT, 0}; + grn_table_group_result g = {NULL, 0, 0, 1, GRN_TABLE_GROUP_CALC_COUNT, 0, 0 ,0}; uint32_t n_hits; int offset; int limit;