diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index a8a84e48455..3b732bfa3ba 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -78,7 +78,6 @@ FUNCTION(INSTALL_MANPAGE file) ELSE() SET(SECTION man8) ENDIF() - MESSAGE("huj!") INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}" COMPONENT ManPages) ENDIF() diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 38235e1a093..2ef52355f90 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -665,6 +665,10 @@ The following options may be given as the first argument: Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options + --slow-start-timeout=# + Maximum number of milliseconds that the service control + manager should wait before trying to kill the windows + service during startup(Default: 15000). --socket=name Socket file to use for connection --sort-buffer-size=# Each thread that needs to do a sort allocates a buffer of @@ -938,6 +942,7 @@ slave-transaction-retries 10 slave-type-conversions slow-launch-time 2 slow-query-log FALSE +slow-start-timeout 15000 sort-buffer-size 2097152 sporadic-binlog-dump-fail FALSE sql-mode diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index af0ef29bb53..57f650f4c56 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -4970,3 +4970,21 @@ avg(distinct(t1.a)) 0 DROP TABLE t1; # End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` latin1 latin1_swedish_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 54908961b1c..27b51ea8262 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -3191,3 +3191,14 @@ Handler_update 1 Variable_name Value Handler_delete 1 DROP TABLE bug58912; +create table t1 (f1 integer primary key) engine=innodb; +flush status; +show status like "handler_read_key"; +Variable_name Value +Handler_read_key 0 +select f1 from t1; +f1 +show status like "handler_read_key"; +Variable_name Value +Handler_read_key 1 +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index 0b0e746bf2f..3038bb0331e 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -2578,6 +2578,17 @@ SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig; # Clean up after the Bug#55284/Bug#58912 test case. DROP TABLE bug58912; +# +# Test fix for bug 13117023. InnoDB increments HA_READ_KEY_COUNT (aka +# HANDLER_READ_KEY) when it should not. +# +create table t1 (f1 integer primary key) engine=innodb; +flush status; +show status like "handler_read_key"; +select f1 from t1; +show status like "handler_read_key"; +drop table t1; + ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/mysql-test/suite/rpl/t/rpl_empty_master_host.test b/mysql-test/suite/rpl/t/rpl_empty_master_host.test index df0c85ad7ec..66d30375a59 100644 --- a/mysql-test/suite/rpl/t/rpl_empty_master_host.test +++ b/mysql-test/suite/rpl/t/rpl_empty_master_host.test @@ -17,6 +17,7 @@ # working when expected. --source include/master-slave.inc +--source include/have_binlog_format_mixed.inc connection slave; STOP SLAVE; diff --git a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test index 004f4daa19d..1e6d46c9d40 100644 --- a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test +++ b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test @@ -18,6 +18,7 @@ # executing events this time source include/master-slave.inc; +source include/have_binlog_format_mixed.inc; connection slave; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 043b03e4686..d9e9c27650f 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -4236,3 +4236,20 @@ GROUP BY t2.a ORDER BY t1.a; DROP TABLE t1; --echo # End of test BUG#57203 + +--echo # +--echo # Bug#63020: Function "format"'s 'locale' argument is not considered +--echo # when creating a "view' +--echo # + +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +SELECT * FROM view_t1; + +DROP TABLE t1; +DROP VIEW view_t1; + +--echo # End of test BUG#63020 + diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index a0fdb3cf811..86082f3d893 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2385,6 +2385,11 @@ void Item_func_format::print(String *str, enum_query_type query_type) args[0]->print(str, query_type); str->append(','); args[1]->print(str, query_type); + if(arg_count > 2) + { + str->append(','); + args[2]->print(str,query_type); + } str->append(')'); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7363128ec04..6afc20141e1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -368,6 +368,9 @@ my_bool locked_in_memory; bool opt_using_transactions; bool volatile abort_loop; bool volatile shutdown_in_progress; +#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY) +ulong slow_start_timeout; +#endif /* True if the bootstrap thread is running. Protected by LOCK_thread_count, just like thread_count. @@ -4369,6 +4372,14 @@ int mysqld_main(int argc, char **argv) #endif } + /* + The subsequent calls may take a long time : e.g. innodb log read. + Thus set the long running service control manager timeout + */ +#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY) + Service.SetSlowStarting(slow_start_timeout); +#endif + if (init_server_components()) unireg_abort(1); @@ -5883,6 +5894,13 @@ struct my_option my_long_options[]= "Don't give threads different priorities. This option is deprecated " "because it has no effect; the implied behavior is already the default.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY) + {"slow-start-timeout", 0, + "Maximum number of milliseconds that the service control manager should wait " + "before trying to kill the windows service during startup" + "(Default: 15000).", &slow_start_timeout, &slow_start_timeout, 0, + GET_ULONG, REQUIRED_ARG, 15000, 0, 0, 0, 0, 0}, +#endif #ifdef HAVE_REPLICATION {"sporadic-binlog-dump-fail", 0, "Option used by mysql-test for debugging and testing of replication.", diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc index 1f1b7f0c20f..d6a8eac7ed5 100644 --- a/sql/nt_servc.cc +++ b/sql/nt_servc.cc @@ -276,7 +276,13 @@ error: void NTService::SetRunning() { if (pService) - pService->SetStatus(SERVICE_RUNNING,NO_ERROR, 0, 0, 0); + pService->SetStatus(SERVICE_RUNNING, NO_ERROR, 0, 0, 0); +} + +void NTService::SetSlowStarting(unsigned long timeout) +{ + if (pService) + pService->SetStatus(SERVICE_START_PENDING,NO_ERROR, 0, 0, timeout); } diff --git a/sql/nt_servc.h b/sql/nt_servc.h index 5bee42dedf0..949499d8d7f 100644 --- a/sql/nt_servc.h +++ b/sql/nt_servc.h @@ -71,6 +71,16 @@ class NTService */ void SetRunning(void); + /** + Sets a timeout after which SCM will abort service startup if SetRunning() + was not called or the timeout was not extended with another call to + SetSlowStarting(). Should be called when static initialization completes, + and the variable initialization part begins + + @arg timeout the timeout to pass to the SCM (in milliseconds) + */ + void SetSlowStarting(unsigned long timeout); + /* Stop() is to be called by the application to stop the service diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 9b5772d3d07..a644729961c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1673,6 +1673,11 @@ void THD::cleanup_after_query() /* reset table map for multi-table update */ table_map_for_update= 0; m_binlog_invoker= FALSE; + /* reset replication info structure */ + if (lex && lex->mi.repl_ignore_server_ids.buffer) + { + delete_dynamic(&lex->mi.repl_ignore_server_ids); + } } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 869a5916339..0cabab9fae7 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2351,6 +2351,7 @@ LEX::LEX() plugins_static_buffer, INITIAL_LEX_PLUGIN_LIST_SIZE, INITIAL_LEX_PLUGIN_LIST_SIZE); + memset(&mi, 0, sizeof(LEX_MASTER_INFO)); reset_query_tables_list(TRUE); } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 542e8b42ae2..8aaead811a0 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -292,6 +292,7 @@ typedef struct st_lex_master_info char *relay_log_name; ulong relay_log_pos; DYNAMIC_ARRAY repl_ignore_server_ids; + ulong server_ids_buffer[2]; } LEX_MASTER_INFO; typedef struct st_lex_reset_slave diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 00c85d8eb43..5300a327029 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1689,7 +1689,6 @@ err: thd_proc_info(thd, 0); if (ret == FALSE) my_ok(thd); - delete_dynamic(&lex_mi->repl_ignore_server_ids); //freeing of parser-time alloc DBUG_RETURN(ret); } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 87c3ae5b129..8f3e6373666 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1863,12 +1863,9 @@ change: LEX *lex = Lex; lex->sql_command = SQLCOM_CHANGE_MASTER; bzero((char*) &lex->mi, sizeof(lex->mi)); - /* - resetting flags that can left from the previous CHANGE MASTER - */ lex->mi.repl_ignore_server_ids_opt= LEX_MASTER_INFO::LEX_MI_UNCHANGED; - my_init_dynamic_array(&Lex->mi.repl_ignore_server_ids, - sizeof(::server_id), 16, 16); + + DBUG_ASSERT(Lex->mi.repl_ignore_server_ids.elements == 0); } master_defs {} @@ -1979,6 +1976,14 @@ ignore_server_id_list: ignore_server_id: ulong_num { + if (Lex->mi.repl_ignore_server_ids.elements == 0) + { + my_init_dynamic_array2(&Lex->mi.repl_ignore_server_ids, + sizeof(::server_id), + Lex->mi.server_ids_buffer, + array_elements(Lex->mi.server_ids_buffer), + 16); + } insert_dynamic(&Lex->mi.repl_ignore_server_ids, (uchar*) &($1)); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 4e01f7e1cf4..371ef9787c1 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5792,7 +5792,6 @@ ha_innobase::innobase_get_index( dict_index_t* index = 0; DBUG_ENTER("innobase_get_index"); - ha_statistic_increment(&SSV::ha_read_key_count); if (keynr != MAX_KEY && table->s->keys > 0) { key = table->key_info + keynr; diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index 6a82e820312..540ec7855bc 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -893,6 +893,7 @@ page_parse_create( ulint comp, /*!< in: nonzero=compact page format */ buf_block_t* block, /*!< in: block or NULL */ mtr_t* mtr); /*!< in: mtr or NULL */ +#ifndef UNIV_HOTBACKUP /************************************************************//** Prints record contents including the data relevant only in the index page context. */ @@ -902,6 +903,7 @@ page_rec_print( /*===========*/ const rec_t* rec, /*!< in: physical record */ const ulint* offsets);/*!< in: record descriptor */ +# ifdef UNIV_BTR_PRINT /***************************************************************//** This is used to print the contents of the directory for debugging purposes. */ @@ -941,6 +943,8 @@ page_print( in directory */ ulint rn); /*!< in: print rn first and last records in directory */ +# endif /* UNIV_BTR_PRINT */ +#endif /* !UNIV_HOTBACKUP */ /***************************************************************//** The following is used to validate a record on a page. This function differs from rec_validate as it can also check the n_owned field and diff --git a/storage/innobase/page/page0page.c b/storage/innobase/page/page0page.c index 102274d66f3..4858929082a 100644 --- a/storage/innobase/page/page0page.c +++ b/storage/innobase/page/page0page.c @@ -1591,13 +1591,14 @@ page_rec_print( " n_owned: %lu; heap_no: %lu; next rec: %lu\n", (ulong) rec_get_n_owned_old(rec), (ulong) rec_get_heap_no_old(rec), - (ulong) rec_get_next_offs(rec, TRUE)); + (ulong) rec_get_next_offs(rec, FALSE)); } page_rec_check(rec); rec_validate(rec, offsets); } +# ifdef UNIV_BTR_PRINT /***************************************************************//** This is used to print the contents of the directory for debugging purposes. */ @@ -1758,6 +1759,7 @@ page_print( page_dir_print(page, dn); page_print_list(block, index, rn); } +# endif /* UNIV_BTR_PRINT */ #endif /* !UNIV_HOTBACKUP */ /***************************************************************//**