Skip to content

Commit

Permalink
valgrind failures
Browse files Browse the repository at this point in the history
and a couple of collaterals:
* debugging assert in my_valgrind.h
* trivial cleanup in sql_union.cc
  • Loading branch information
vuvova committed Sep 21, 2016
1 parent e4f7078 commit 4368efe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions include/my_valgrind.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@
#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F)
#define TRASH(A,B) TRASH_FREE(A,B)

# define DBUG_ASSERT_DEFINED(x) \
DBUG_ASSERT(!VALGRIND_CHECK_MEM_IS_DEFINED(&(x), sizeof(x)))
3 changes: 2 additions & 1 deletion plugin/file_key_management/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ char* Parser::read_and_decrypt_file(const char *secret)

// Check for file encryption
uchar *decrypted;
if (is_prefix((char*)buffer, OpenSSL_prefix))
if (file_size > OpenSSL_prefix_len &&
is_prefix((char*)buffer, OpenSSL_prefix))
{
uchar key[OpenSSL_key_len];
uchar iv[OpenSSL_iv_len];
Expand Down
2 changes: 1 addition & 1 deletion sql/item_strfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ String *Item_func_decode_histogram::val_str(String *str)
uint i;
str->length(0);
char numbuf[32];
const uchar *p= (uchar*)res->c_ptr();
const uchar *p= (uchar*)res->c_ptr_safe();
for (i= 0; i < res->length(); i++)
{
double val;
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2648,7 +2648,7 @@ bool JOIN::make_aggr_tables_info()
*/
DBUG_PRINT("info",("Sorting for order by/group by"));
ORDER *order_arg= group_list ? group_list : order;
if (join_tab &&
if (top_join_tab_count + aggr_tables > const_tables &&
ordered_index_usage !=
(group_list ? ordered_index_group_by : ordered_index_order_by) &&
curr_tab->type != JT_CONST &&
Expand Down
5 changes: 3 additions & 2 deletions sql/sql_union.cc
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,10 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
bool is_union_select;
bool instantiate_tmp_table= false;
DBUG_ENTER("st_select_lex_unit::prepare");
DBUG_ASSERT(thd == thd_arg && thd == current_thd);
DBUG_ASSERT(thd == thd_arg);
DBUG_ASSERT(thd == current_thd);

describe= MY_TEST(additional_options & SELECT_DESCRIBE);
describe= additional_options & SELECT_DESCRIBE;

/*
Save fake_select_lex in case we don't need it for anything but
Expand Down

0 comments on commit 4368efe

Please sign in to comment.