Commit e21408b7 authored by Sergei Golubchik's avatar Sergei Golubchik

Decrease stack space usage of mysql_execute_command()

- WSREP_DEBUG called WSREP_LOG which allocated a 1K variable on stack
  for each macro usage (at least gcc can't reuse the stack space).
  Move this concatenation to happen compile-time, not run-time.
parent f8018a35
...@@ -46,12 +46,6 @@ ...@@ -46,12 +46,6 @@
if (WSREP(thd) && !thd->lex->no_write_to_binlog \ if (WSREP(thd) && !thd->lex->no_write_to_binlog \
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto wsrep_error_label; && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto wsrep_error_label;
#define WSREP_DEBUG(...) \
if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
#define WSREP_INFO(...) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
#define WSREP_WARN(...) WSREP_LOG(sql_print_warning, ##__VA_ARGS__)
#define WSREP_ERROR(...) WSREP_LOG(sql_print_error, ##__VA_ARGS__)
#define WSREP_SYNC_WAIT(thd_, before_) \ #define WSREP_SYNC_WAIT(thd_, before_) \
{ if (WSREP_CLIENT(thd_) && \ { if (WSREP_CLIENT(thd_) && \
wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; } wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; }
......
...@@ -251,14 +251,14 @@ extern wsrep_seqno_t wsrep_locked_seqno; ...@@ -251,14 +251,14 @@ extern wsrep_seqno_t wsrep_locked_seqno;
} while(0) } while(0)
#define WSREP_DEBUG(...) \ #define WSREP_DEBUG(...) \
if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__) if (wsrep_debug) sql_print_information( "WSREP: " __VA_ARGS__)
#define WSREP_INFO(...) WSREP_LOG(sql_print_information, ##__VA_ARGS__) #define WSREP_INFO(...) sql_print_information( "WSREP: " __VA_ARGS__)
#define WSREP_WARN(...) WSREP_LOG(sql_print_warning, ##__VA_ARGS__) #define WSREP_WARN(...) sql_print_warning( "WSREP: " __VA_ARGS__)
#define WSREP_ERROR(...) WSREP_LOG(sql_print_error, ##__VA_ARGS__) #define WSREP_ERROR(...) sql_print_error( "WSREP: " __VA_ARGS__)
#define WSREP_LOG_CONFLICT_THD(thd, role) \ #define WSREP_LOG_CONFLICT_THD(thd, role) \
WSREP_LOG(sql_print_information, \ sql_print_information( \
"%s: \n " \ "WSREP: %s: \n " \
" THD: %lu, mode: %s, state: %s, conflict: %s, seqno: %lld\n " \ " THD: %lu, mode: %s, state: %s, conflict: %s, seqno: %lld\n " \
" SQL: %s", \ " SQL: %s", \
role, \ role, \
...@@ -273,12 +273,12 @@ extern wsrep_seqno_t wsrep_locked_seqno; ...@@ -273,12 +273,12 @@ extern wsrep_seqno_t wsrep_locked_seqno;
#define WSREP_LOG_CONFLICT(bf_thd, victim_thd, bf_abort) \ #define WSREP_LOG_CONFLICT(bf_thd, victim_thd, bf_abort) \
if (wsrep_debug || wsrep_log_conflicts) \ if (wsrep_debug || wsrep_log_conflicts) \
{ \ { \
WSREP_LOG(sql_print_information, "cluster conflict due to %s for threads:", \ sql_print_information( "WSREP: cluster conflict due to %s for threads:", \
(bf_abort) ? "high priority abort" : "certification failure" \ (bf_abort) ? "high priority abort" : "certification failure" \
); \ ); \
if (bf_thd) WSREP_LOG_CONFLICT_THD(bf_thd, "Winning thread"); \ if (bf_thd) WSREP_LOG_CONFLICT_THD(bf_thd, "Winning thread"); \
if (victim_thd) WSREP_LOG_CONFLICT_THD(victim_thd, "Victim thread"); \ if (victim_thd) WSREP_LOG_CONFLICT_THD(victim_thd, "Victim thread"); \
WSREP_LOG(sql_print_information, "context: %s:%d", __FILE__, __LINE__); \ sql_print_information("WSREP: context: %s:%d", __FILE__, __LINE__); \
} }
#define WSREP_PROVIDER_EXISTS \ #define WSREP_PROVIDER_EXISTS \
......
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