5281 magnus.blaudd@stripped 2012-12-19 [merge]
Merge 5.6 -> trunk
modified:
include/mysql/plugin.h
include/mysql/plugin_audit.h.pp
include/mysql/plugin_auth.h.pp
include/mysql/plugin_ftparser.h.pp
sql/ha_ndbcluster.cc
sql/log_event.cc
sql/sql_class.cc
5280 Jimmy Yang 2012-12-19
Fix Bug #14834698 - FULLTEXT: TOO EASY TO CAUSE A MEMORY USAGE DENIAL OF
SERVICE
rb://1550 approved by Sunny Bains
added:
mysql-test/suite/sys_vars/r/innodb_ft_total_cache_size_basic.result
mysql-test/suite/sys_vars/t/innodb_ft_total_cache_size_basic.test
modified:
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0opt.cc
storage/innobase/handler/ha_innodb.cc
storage/innobase/include/fts0fts.h
=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h revid:jimmy.yang@stripped
+++ b/include/mysql/plugin.h revid:magnus.blaudd@stripped
@@ -551,6 +551,7 @@ char *thd_security_context(MYSQL_THD thd
unsigned int max_query_len);
/* Increments the row counter, see THD::row_count */
void thd_inc_row_count(MYSQL_THD thd);
+int thd_allow_batch(MYSQL_THD thd);
/**
Create a temporary file.
=== modified file 'include/mysql/plugin_audit.h.pp'
--- a/include/mysql/plugin_audit.h.pp revid:jimmy.yang@stripped
+++ b/include/mysql/plugin_audit.h.pp revid:magnus.blaudd@stripped
@@ -233,6 +233,7 @@ int thd_tx_is_read_only(const void* thd)
char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
+int thd_allow_batch(void* thd);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
void thd_binlog_pos(const void* thd,
=== modified file 'include/mysql/plugin_auth.h.pp'
--- a/include/mysql/plugin_auth.h.pp revid:jimmy.yang@stripped
+++ b/include/mysql/plugin_auth.h.pp revid:magnus.blaudd@stripped
@@ -233,6 +233,7 @@ int thd_tx_is_read_only(const void* thd)
char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
+int thd_allow_batch(void* thd);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
void thd_binlog_pos(const void* thd,
=== modified file 'include/mysql/plugin_ftparser.h.pp'
--- a/include/mysql/plugin_ftparser.h.pp revid:jimmy.yang@stripped
+++ b/include/mysql/plugin_ftparser.h.pp revid:magnus.blaudd@stripped
@@ -186,6 +186,7 @@ int thd_tx_is_read_only(const void* thd)
char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
+int thd_allow_batch(void* thd);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
void thd_binlog_pos(const void* thd,
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc revid:jimmy.yang@stripped
+++ b/sql/ha_ndbcluster.cc revid:magnus.blaudd@stripped
@@ -4392,13 +4392,6 @@ ha_ndbcluster::eventSetAnyValue(THD *thd
#endif
}
-static inline bool
-thd_allow_batch(const THD* thd)
-{
- return (thd_options(thd) & OPTION_ALLOW_BATCH);
-}
-
-
#ifdef HAVE_NDB_BINLOG
/**
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc revid:jimmy.yang@stripped
+++ b/sql/log_event.cc revid:magnus.blaudd@stripped
@@ -10885,15 +10885,6 @@ int Rows_log_event::do_apply_event(Relay
else
thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS;
- /*
- Note that unlike the other thd options set here, this one
- comes from a global, and not from the incoming event.
- */
- if (opt_slave_allow_batching)
- thd->variables.option_bits|= OPTION_ALLOW_BATCH;
- else
- thd->variables.option_bits&= ~OPTION_ALLOW_BATCH;
-
thd->binlog_row_event_extra_data = m_extra_row_data;
/* A small test to verify that objects have consistent types */
@@ -11202,9 +11193,6 @@ AFTER_MAIN_EXEC_ROW_LOOP:
}
} // if (table)
- /* reset OPTION_ALLOW_BATCH as not affect later events */
- thd->variables.option_bits&= ~OPTION_ALLOW_BATCH;
-
if (error)
{
slave_rows_error_report(ERROR_LEVEL, error, rli, thd, table,
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc revid:jimmy.yang@stripped
+++ b/sql/sql_class.cc revid:magnus.blaudd@stripped
@@ -4030,6 +4030,19 @@ extern "C" unsigned long thd_get_thread_
return((unsigned long)thd->thread_id);
}
+/**
+ Check if batching is allowed for the thread
+ @param thd user thread
+ @retval 1 batching allowed
+ @retval 0 batching not allowed
+*/
+extern "C" int thd_allow_batch(MYSQL_THD thd)
+{
+ if ((thd->variables.option_bits & OPTION_ALLOW_BATCH) ||
+ (thd->slave_thread && opt_slave_allow_batching))
+ return 1;
+ return 0;
+}
#ifdef INNODB_COMPATIBILITY_HOOKS
extern "C" const struct charset_info_st *thd_charset(MYSQL_THD thd)
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (magnus.blaudd:5280 to 5281) | magnus.blaudd | 19 Dec |