Commit d7bc26c4 authored by Georgi Kodinov's avatar Georgi Kodinov

merge mysql-5.5->mysql-5.5-security

parents 7e63c8ac 7615cb08
......@@ -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()
......
......@@ -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
......
......@@ -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
......@@ -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;
......@@ -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. #
......
......@@ -17,6 +17,7 @@
# working when expected.
--source include/master-slave.inc
--source include/have_binlog_format_mixed.inc
connection slave;
STOP SLAVE;
......
......@@ -18,6 +18,7 @@
# executing events this time
source include/master-slave.inc;
source include/have_binlog_format_mixed.inc;
connection slave;
......
......@@ -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
......@@ -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(')');
}
......
......@@ -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.",
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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);
}
}
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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));
}
......
......@@ -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;
......
......@@ -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
......
......@@ -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 */
/***************************************************************//**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment