summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorunknown <konstantin@oak.local>2003-12-21 22:26:45 +0300
committerunknown <konstantin@oak.local>2003-12-21 22:26:45 +0300
commit2fe005174f3fb867399f31a637c4c3967cf8a401 (patch)
tree7ebdb925398d586e1afa92a04d84a5bbe75d46a1 /sql/sql_class.cc
parentb4b8d1f67769932bc874a5ccc910095065e7be67 (diff)
downloadmariadb-git-2fe005174f3fb867399f31a637c4c3967cf8a401.tar.gz
THD::init_for_queries() pushed back:
see comments to the method why sql/sql_class.h: THD::init_for_queries() pushed back: see comments to the method why Cleanup
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 606ecdbecbb..12f0cc4ca72 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -144,9 +144,6 @@ THD::THD():user_time(0), is_fatal_error(0),
*scramble= '\0';
init();
- init_sql_alloc(&mem_root, // must be after init()
- variables.query_alloc_block_size,
- variables.query_prealloc_size);
/* Initialize sub structures */
bzero((char*) &transaction.mem_root,sizeof(transaction.mem_root));
bzero((char*) &warn_root,sizeof(warn_root));
@@ -182,9 +179,6 @@ THD::THD():user_time(0), is_fatal_error(0),
transaction.trans_log.end_of_file= max_binlog_cache_size;
}
#endif
- init_sql_alloc(&transaction.mem_root,
- variables.trans_alloc_block_size,
- variables.trans_prealloc_size);
/*
We need good random number initialization for new thread
Just coping global one will not work
@@ -228,6 +222,23 @@ void THD::init(void)
/*
+ Init THD for query processing.
+ This has to be called once before we call mysql_parse.
+ See also comments in sql_class.h.
+*/
+
+void THD::init_for_queries()
+{
+ init_sql_alloc(&mem_root,
+ variables.query_alloc_block_size,
+ variables.query_prealloc_size);
+ init_sql_alloc(&transaction.mem_root,
+ variables.trans_alloc_block_size,
+ variables.trans_prealloc_size);
+}
+
+
+/*
Do what's needed when one invokes change user
SYNOPSIS