diff options
author | Jorgen Loland <jorgen.loland@sun.com> | 2009-11-13 12:22:39 +0100 |
---|---|---|
committer | Jorgen Loland <jorgen.loland@sun.com> | 2009-11-13 12:22:39 +0100 |
commit | 2a254a13efaa6e29d98da9d8f33d9228d4a62834 (patch) | |
tree | 647243c578e4358668d708f8fb7854fc8b3d9d76 /sql/sql_select.cc | |
parent | 6c2b7b241603402d87d27cf7aca6576e3d8025bb (diff) | |
download | mariadb-git-2a254a13efaa6e29d98da9d8f33d9228d4a62834.tar.gz |
Bug#48052: Valgrind warning - uninitialized value in
init_read_record() - (records.cc:274)
Item_cond::used_tables_cache was accessed in
records.cc#init_read_record() without being initialized. It had
not been initialized because it was wrongly assumed that the
Item's variables would not be accessed, and hence
quick_fix_field() was used instead of fix_fields() to save a few
CPU cycles at creation time.
The fix is to properly initilize the Item by replacing
quick_fix_field() with fix_fields().
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 7a4ab1c8365..00080b9b9d9 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2131,17 +2131,13 @@ JOIN::exec() DBUG_VOID_RETURN; if (!curr_table->select->cond) curr_table->select->cond= sort_table_cond; - else // This should never happen + else { if (!(curr_table->select->cond= new Item_cond_and(curr_table->select->cond, sort_table_cond))) DBUG_VOID_RETURN; - /* - Item_cond_and do not need fix_fields for execution, its parameters - are fixed or do not need fix_fields, too - */ - curr_table->select->cond->quick_fix_field(); + curr_table->select->cond->fix_fields(thd, 0); } curr_table->select_cond= curr_table->select->cond; curr_table->select_cond->top_level_item(); |