From 95c94b3758bb56457645eaafcd0cc7cb1515d374 Mon Sep 17 00:00:00 2001 From: manuel Date: Sat, 4 Jul 2015 23:19:20 +0200 Subject: Fix for mysql 5.6.25 and above --- src/table_sizes.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/table_sizes.cc') diff --git a/src/table_sizes.cc b/src/table_sizes.cc index 0dcee37..2b13b6f 100644 --- a/src/table_sizes.cc +++ b/src/table_sizes.cc @@ -33,7 +33,8 @@ bool calc_lookup_values_from_cond(THD *thd, Item *cond, TABLE_LIST *table, static int make_db_list(THD *thd, List *db_names, - LOOKUP_FIELD_VALUES *lookup_field_vals) + LOOKUP_FIELD_VALUES *lookup_field_vals, + MEM_ROOT *tmp_mem_root) { /* If we have db lookup vaule we just add it to list and @@ -50,7 +51,7 @@ make_db_list(THD *thd, List *db_names, } return (find_files(thd, db_names, NullS, - mysql_data_home, NullS, TRUE) != FIND_FILES_OK); + mysql_data_home, NullS, TRUE, tmp_mem_root) != FIND_FILES_OK); } /*----------------------------------------------------------------------------*/ @@ -234,6 +235,9 @@ static int fill_table(THD *thd, TABLE_LIST *tables, Item *cond) DBUG_ENTER("fill_table"); + MEM_ROOT tmp_mem_root; + init_sql_alloc(&tmp_mem_root, TABLE_ALLOC_BLOCK_SIZE, 0); + memset(&lookup_field_vals, 0, sizeof(LOOKUP_FIELD_VALUES)); if (calc_lookup_values_from_cond(thd, cond, tables, &lookup_field_vals)) { @@ -288,7 +292,7 @@ static int fill_table(THD *thd, TABLE_LIST *tables, Item *cond) goto err; } - if (make_db_list(thd, &db_names, &lookup_field_vals)) + if (make_db_list(thd, &db_names, &lookup_field_vals, &tmp_mem_root)) goto err; LEX_STRING *db_name; @@ -335,6 +339,7 @@ static int fill_table(THD *thd, TABLE_LIST *tables, Item *cond) error = 0; err: + free_root(&tmp_mem_root, MYF(0)); DBUG_RETURN(error); return 0; -- cgit v1.2.3