diff options
author | Monty <monty@mariadb.org> | 2015-08-27 10:07:32 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-08-27 22:29:11 +0300 |
commit | 3bca8db4f90cd9a505b99009c44594c0fb1ec353 (patch) | |
tree | a96ef13450eeb6a9b420e592534044b44872f97e /sql/sql_join_cache.cc | |
parent | 3cb578c001b2feabd2410f281d20eb6566371453 (diff) | |
download | mariadb-git-3bca8db4f90cd9a505b99009c44594c0fb1ec353.tar.gz |
MDEV-6152: Remove calls to current_thd while creating Item
- Part 4: Removing calls to sql_alloc() and sql_calloc()
Other things:
- Added current_thd in some places to make it clear that it's called (easier to remove later)
- Move memory allocation from Item_func_case::fix_length_and_dec() to Item_func_case::fix_fields()
- Added mem_root to some new calls
- Fixed some wrong UNINIT_VAR() calls
- Fixed a bug in generate_partition_syntax() in case of errors
- Added mem_root to argument to new thread_info
- Simplified my_parse_error() call in sql_yacc.yy
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r-- | sql/sql_join_cache.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 46ef66bfd1b..731cc7267d5 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -328,8 +328,8 @@ int JOIN_CACHE::alloc_fields() { uint ptr_cnt= external_key_arg_fields+blobs+1; uint fields_size= sizeof(CACHE_FIELD)*fields; - field_descr= (CACHE_FIELD*) sql_alloc(fields_size + - sizeof(CACHE_FIELD*)*ptr_cnt); + field_descr= (CACHE_FIELD*) join->thd->alloc(fields_size + + sizeof(CACHE_FIELD*)*ptr_cnt); blob_ptr= (CACHE_FIELD **) ((uchar *) field_descr + fields_size); return (field_descr == NULL); } @@ -2679,7 +2679,7 @@ int JOIN_CACHE_HASHED::init(bool for_explain) if ((rc= JOIN_CACHE::init(for_explain)) || for_explain) DBUG_RETURN (rc); - if (!(key_buff= (uchar*) sql_alloc(key_length))) + if (!(key_buff= (uchar*) join->thd->alloc(key_length))) DBUG_RETURN(1); /* Take into account a reference to the next record in the key chain */ |