mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-22504: Session tracking return incorrectly long traking data
When we move data we should fix buffer string length
This commit is contained in:
parent
1d1fb13e59
commit
e84c62d59b
3 changed files with 42 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
set @save_session_track_system_variables=@@session_track_system_variables;
|
||||
SELECT @@session.character_set_connection;
|
||||
@@session.character_set_connection
|
||||
latin1
|
||||
|
@ -28,4 +29,19 @@ SET NAMES 'utf8';
|
|||
|
||||
# tracking info off once
|
||||
SET NAMES 'big5';
|
||||
SET @@session.session_track_system_variables= default;
|
||||
SET @@session.session_track_system_variables= @save_session_track_system_variables;
|
||||
#
|
||||
# MDEV-22504: session tracking return incorrectly long traking data
|
||||
#
|
||||
set @save_optimizer_switch=@@optimizer_switch;
|
||||
SET @@session.session_track_system_variables='optimizer_switch';
|
||||
set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
|
||||
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
|
||||
-- optimizer_switch
|
||||
-- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
|
||||
|
||||
Warnings:
|
||||
Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
|
||||
set @@optimizer_switch=@save_optimizer_switch;
|
||||
SET @@session.session_track_system_variables= @save_session_track_system_variables;
|
||||
# End of 10.2 tests
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
--source include/no_protocol.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
|
||||
set @save_session_track_system_variables=@@session_track_system_variables;
|
||||
|
||||
SELECT @@session.character_set_connection;
|
||||
SET @@session.session_track_system_variables='character_set_connection';
|
||||
|
||||
|
@ -22,4 +25,23 @@ SET NAMES 'utf8';
|
|||
SET NAMES 'big5';
|
||||
--disable_session_track_info
|
||||
|
||||
SET @@session.session_track_system_variables= default;
|
||||
SET @@session.session_track_system_variables= @save_session_track_system_variables;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-22504: session tracking return incorrectly long traking data
|
||||
--echo #
|
||||
|
||||
set @save_optimizer_switch=@@optimizer_switch;
|
||||
|
||||
SET @@session.session_track_system_variables='optimizer_switch';
|
||||
|
||||
--enable_session_track_info
|
||||
set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
|
||||
--disable_session_track_info
|
||||
|
||||
set @@optimizer_switch=@save_optimizer_switch;
|
||||
|
||||
|
||||
SET @@session.session_track_system_variables= @save_session_track_system_variables;
|
||||
|
||||
--echo # End of 10.2 tests
|
||||
|
|
|
@ -1698,7 +1698,7 @@ void Session_tracker::store(THD *thd, String *buf)
|
|||
|
||||
if ((size= net_length_size(length)) != 1)
|
||||
{
|
||||
if (buf->reserve(size - 1, EXTRA_ALLOC))
|
||||
if (buf->reserve(size - 1, 0))
|
||||
{
|
||||
buf->length(start); // it is safer to have 0-length block in case of error
|
||||
return;
|
||||
|
@ -1708,6 +1708,7 @@ void Session_tracker::store(THD *thd, String *buf)
|
|||
The 'buf->reserve()' can change the buf->ptr() so we cannot
|
||||
calculate the 'data' earlier.
|
||||
*/
|
||||
buf->length(buf->length() + (size - 1));
|
||||
data= (uchar *)(buf->ptr() + start);
|
||||
memmove(data + (size - 1), data, length);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue