MDEV-34054 Memory leak in Window_func_runner::exec after encountering "temporary space limit reached" error
This commit is contained in:
parent
178ab560ae
commit
7d1467e9e9
@ -192,4 +192,11 @@ DROP TABLE t1;
|
|||||||
connection default;
|
connection default;
|
||||||
disconnect c1;
|
disconnect c1;
|
||||||
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
|
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
|
||||||
|
#
|
||||||
|
# MDEV-34054
|
||||||
|
# Memory leak in Window_func_runner::exec after encountering
|
||||||
|
# "temporary space limit reached" error
|
||||||
|
SET max_tmp_session_space_usage= 64*1024;
|
||||||
|
SELECT MIN(VARIABLE_VALUE) OVER (), NTILE(1) OVER (), MAX(VARIABLE_NAME) OVER () FROM information_schema.SESSION_STATUS;
|
||||||
|
ERROR HY000: Local temporary space limit reached
|
||||||
# End of 11.5 tests
|
# End of 11.5 tests
|
||||||
|
@ -250,4 +250,13 @@ connection default;
|
|||||||
disconnect c1;
|
disconnect c1;
|
||||||
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
|
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-34054
|
||||||
|
--echo # Memory leak in Window_func_runner::exec after encountering
|
||||||
|
--echo # "temporary space limit reached" error
|
||||||
|
|
||||||
|
SET max_tmp_session_space_usage= 64*1024;
|
||||||
|
--error 200
|
||||||
|
SELECT MIN(VARIABLE_VALUE) OVER (), NTILE(1) OVER (), MAX(VARIABLE_NAME) OVER () FROM information_schema.SESSION_STATUS;
|
||||||
|
|
||||||
--echo # End of 11.5 tests
|
--echo # End of 11.5 tests
|
||||||
|
@ -2859,6 +2859,7 @@ bool compute_window_func(THD *thd,
|
|||||||
{
|
{
|
||||||
List_iterator_fast<Item_window_func> iter_win_funcs(window_functions);
|
List_iterator_fast<Item_window_func> iter_win_funcs(window_functions);
|
||||||
List_iterator_fast<Cursor_manager> iter_cursor_managers(cursor_managers);
|
List_iterator_fast<Cursor_manager> iter_cursor_managers(cursor_managers);
|
||||||
|
bool ret= false;
|
||||||
uint err;
|
uint err;
|
||||||
|
|
||||||
READ_RECORD info;
|
READ_RECORD info;
|
||||||
@ -2921,19 +2922,27 @@ bool compute_window_func(THD *thd,
|
|||||||
/* Check if we found any error in the window function while adding values
|
/* Check if we found any error in the window function while adding values
|
||||||
through cursors. */
|
through cursors. */
|
||||||
if (unlikely(thd->is_error() || thd->is_killed()))
|
if (unlikely(thd->is_error() || thd->is_killed()))
|
||||||
|
{
|
||||||
|
ret= true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return to current row after notifying cursors for each window
|
/* Return to current row after notifying cursors for each window
|
||||||
function. */
|
function. */
|
||||||
if (tbl->file->ha_rnd_pos(tbl->record[0], rowid_buf))
|
if (tbl->file->ha_rnd_pos(tbl->record[0], rowid_buf))
|
||||||
return true;
|
{
|
||||||
|
ret= true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We now have computed values for each window function. They can now
|
/* We now have computed values for each window function. They can now
|
||||||
be saved in the current row. */
|
be saved in the current row. */
|
||||||
if (save_window_function_values(window_functions, tbl, rowid_buf))
|
if (save_window_function_values(window_functions, tbl, rowid_buf))
|
||||||
return true;
|
{
|
||||||
|
ret= true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
rownum++;
|
rownum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2941,7 +2950,7 @@ bool compute_window_func(THD *thd,
|
|||||||
partition_trackers.delete_elements();
|
partition_trackers.delete_elements();
|
||||||
end_read_record(&info);
|
end_read_record(&info);
|
||||||
|
|
||||||
return false;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make a list that is a concation of two lists of ORDER elements */
|
/* Make a list that is a concation of two lists of ORDER elements */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user