Skip to content
Permalink
Browse files

Removed TABLE->sort to make it possible to have multiple active calls to

filesort and init_read_record() for the same table.
This will simplify code for WINDOW FUNCTIONS (MDEV-6115)

- Filesort_info renamed to SORT_INFO and moved to filesort.h
- filesort now returns SORT_INFO
- init_read_record() now takes a SORT_INFO parameter.
- unique declaration is moved to uniques.h
- subselect caching of buffers is now more explicit than before
- filesort_buffer is now reusable even if rec_length has changed.
- filsort_free_buffers() and free_io_cache() calls are removed
- Remove one malloc() when using get_addon_fields()

Other things:
- Added --debug-assert-on-not-freed-memory option to make it easier to
  debug some not-freed-memory issues.
  • Loading branch information...
montywi committed Mar 22, 2016
1 parent d0a4770 commit 260dd476b057b759af7973550b560dc2f56e18fd
@@ -112,7 +112,8 @@ SET (SQL_SOURCE
sql_statistics.cc sql_string.cc
sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc
sql_time.cc tztime.cc uniques.cc unireg.cc item_xmlfunc.cc
sql_time.cc tztime.cc unireg.cc item_xmlfunc.cc
uniques.cc uniques.h
rpl_tblmap.cc sql_binlog.cc event_scheduler.cc event_data_objects.cc
event_queue.cc event_db_repository.cc
sql_tablespace.cc events.cc ../sql-common/my_user.c
@@ -499,7 +499,8 @@ Event_db_repository::table_scan_all_for_i_s(THD *thd, TABLE *schema_table,
READ_RECORD read_record_info;
DBUG_ENTER("Event_db_repository::table_scan_all_for_i_s");

if (init_read_record(&read_record_info, thd, event_table, NULL, 1, 0, FALSE))
if (init_read_record(&read_record_info, thd, event_table, NULL, NULL, 1, 0,
FALSE))
DBUG_RETURN(TRUE);

/*
@@ -1015,7 +1016,7 @@ Event_db_repository::drop_schema_events(THD *thd, LEX_STRING schema)
DBUG_VOID_RETURN;

/* only enabled events are in memory, so we go now and delete the rest */
if (init_read_record(&read_record_info, thd, table, NULL, 1, 0, FALSE))
if (init_read_record(&read_record_info, thd, table, NULL, NULL, 1, 0, FALSE))
goto end;

while (!ret && !(read_record_info.read_record(&read_record_info)) )
@@ -1134,7 +1134,7 @@ Events::load_events_from_db(THD *thd)
DBUG_RETURN(TRUE);
}

if (init_read_record(&read_record_info, thd, table, NULL, 0, 1, FALSE))
if (init_read_record(&read_record_info, thd, table, NULL, NULL, 0, 1, FALSE))
{
close_thread_tables(thd);
DBUG_RETURN(TRUE);

0 comments on commit 260dd47

Please sign in to comment.
You can’t perform that action at this time.