Switch EXPLAIN JSON from using subselect_engine::get_identifier()
to the number from Item_subselect::unit.
Remove subselect_union_engine::get_identifier() because it was added
only for EXPLAIN JSON code.
Join_plan_state performs out-of-API initialization of DYNAMIC_ARRAY. This is
done to postpone actual array initialization till first use, whilst retaining
the right to call delete_dynamic().
Since delete_dynamic() now checks DYNAMIC_ARRAY::malloc_flags it should be
initialized it as well.
- Changed 0x%lx -> %p
array.c:
- Static (preallocated) buffer can now be anywhere
my_sys.h
- Define MY_INIT_BUFFER_USED
sql_delete.cc & sql_lex.cc
- Use memroot when allocating classes (avoids call to current_thd)
sql_explain.h:
- Use preallocated buffers
sql_explain.cc:
- Use preallocated buffers and memroot
sql_select.cc:
- Use multi_alloc_root() instead of many alloc_root()
- Update calls to Explain
so that a simple query with one join would not have to call my_malloc.
- Allow lower limites for query_prealloc_size for testing.
- Fixed wrong initialization of trans_alloc_block_size
commit 85fd3d901311688e18ffce92ffc78129e5625791
Author: Monty <monty@mariadb.org>
Date: Fri Aug 29 14:07:43 2014 +0300
my_alloc.c
- Changed 0x%lx -> %p
array.c:
- Static (preallocated) buffer can now be anywhere
my_sys.h
- Define MY_INIT_BUFFER_USED
sql_delete.cc & sql_lex.cc
- Use memroot when allocating classes (avoids call to current_thd)
sql_explain.h:
- Use preallocated buffers
sql_explain.cc:
- Use preallocated buffers and memroot
sql_select.cc:
- Use multi_alloc_root() instead of many alloc_root()
- Update calls to Explain
All callers of open_cached_file() use 2 characters prefix. Allocating memory for
such short string is an overkill. Store it on IO_CACHE structure instead.
All callers of open_cached_file() use mysql_tmpdir as dir. No need to allocate
memory for it since it is constant and available till server shutdown.
This reduces number of allocations from 31 to 27 per OLTP RO transaction.
Remove call to deprecated set_thread_state. It is noop anyway, but generates
function call independently of performance schema state. According to perf
this saves ~0.2% of execution time.
The GEOMETRY field metadata is stored in the FRM file.
SRID for a spatial column now can be stored, it was added to the CREATE TABLE syntax,
so the AddGeometryData() stored procedure is now possible. Script adding the required Add/DropGeometryColumn sp-s added.
length/dec/charset are still in LEX, because they're also used
for CAST and dynamic columns.
also
1. fix "MDEV-7041 COLLATION(CAST('a' AS CHAR BINARY)) returns a wrong result"
2. allow BINARY modifier in stored function RETURN clause
3. allow "COLLATION without CHARSET" in SP/SF (parameters, RETURN, DECLARE)
4. print correct variable name in error messages for stored routine parameters
* indeed, "username IDENTIFIED BY PASSWORD hash" is the same
as "username IDENTIFIED VIA mysql_native_password USING hash"
* LEX_USER::password can now be used for plain-text passwords