summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-03-26 19:11:37 +0100
committerunknown <guilhem@mysql.com>2004-03-26 19:11:37 +0100
commitf2546fdbfc5dcc3c121d9674151ccde8aa10b199 (patch)
tree7c9553152622276a50ec1602cf9cb54bc42aa1be /sql/sql_class.cc
parentdfca0c046b6ab56a5c930187434e15f3bcf2677f (diff)
downloadmariadb-git-f2546fdbfc5dcc3c121d9674151ccde8aa10b199.tar.gz
To save 32KB memory per thread when --log-bin is not used, we do not
init the binlog_cache (THD::transaction.trans_log). I have checked all places where trans_log is used, because as now it may not be inited in some cases, we have to be cautious (will forward this commit mail to Heikki). sql/handler.cc: Do not use the transaction binlog cache if binlog is not open sql/sql_class.cc: We do not init the transaction binlog cache if binlog is not open. This saves 32 KB memory per thread, if --log-bin is not used. sql/sql_class.h: warning comment
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 945414f532b..1b4c8bec416 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -169,7 +169,11 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0),
tablespace_op=FALSE;
#ifdef USING_TRANSACTIONS
bzero((char*) &transaction,sizeof(transaction));
- if (opt_using_transactions)
+ /*
+ Binlog is always open (if needed) before a THD is created (including
+ bootstrap).
+ */
+ if (opt_using_transactions && mysql_bin_log.is_open())
{
if (open_cached_file(&transaction.trans_log,
mysql_tmpdir, LOG_PREFIX, binlog_cache_size,