Bug #68705 Valgrind warnings (uninitialised value(s)) in Item_field::val on SELECT INTERVAL
Submitted: 18 Mar 2013 15:36 Modified: 11 Nov 2019 10:59
Reporter: Elena Stepanova Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.5.30, 5.6.10, 5.6.12, 5.7.2, 5.1.70, 5.0.97, 5.5.32 OS:Any
Assigned to: CPU Architecture:Any

[18 Mar 2013 15:36] Elena Stepanova
Description:
==32312== Conditional jump or move depends on uninitialised value(s)
==32312==    at 0x597224: Item_field::val_int() (item.cc:2681)
==32312==    by 0x5F016F: Item_func_set_user_var::check(bool) (item_func.cc:4951)
==32312==    by 0x5F7EF2: Item_func_set_user_var::val_int() (item_func.cc:5100)
==32312==    by 0x5C49E4: Item_func::is_null() (item_func.h:168)
==32312==    by 0x5B4EC8: Item_func_interval::fix_length_and_dec() (item_cmpfunc.cc:2312)
==32312==    by 0x5EF388: Item_func::fix_fields(THD*, Item**) (item_func.cc:231)
==32312==    by 0x6984B0: setup_fields(THD*, Bounds_checked_array<Item*>, List<Item>&, enum_mark_columns, List<Item>*, bool) (sql_base.cc:8190)
==32312==    by 0x6FFF07: JOIN::prepare(TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, st_order*, Item*, st_select_lex*, st_select_lex_unit*) (sql_resolver.cc:149)
==32312==    by 0x706703: mysql_prepare_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*, bool*) (sql_select.cc:1054)
==32312==    by 0x7067C0: mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, SQL_I_List<st_order>*, SQL_I_List<st_order>*, Item*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:1177)
==32312==    by 0x706A04: handle_select(THD*, select_result*, unsigned long) (sql_select.cc:110)
==32312==    by 0x6E3AC8: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5019)
==32312==    by 0x6E8898: mysql_execute_command(THD*) (sql_parse.cc:2589)
==32312==    by 0x6EBA57: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:6149)
==32312==    by 0x6EC376: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1334)
==32312==    by 0x6ED616: do_command(THD*) (sql_parse.cc:1036)
==32312== Conditional jump or move depends on uninitialised value(s)
==32312==    at 0x5F06CD: Item_func_set_user_var::update_hash(void*, unsigned int, Item_result, charset_info_st const*, Derivation, bool) (item_func.cc:4789)
==32312==    by 0x5F0873: Item_func_set_user_var::update() (item_func.cc:5053)
==32312==    by 0x5F7EFA: Item_func_set_user_var::val_int() (item_func.cc:5101)
==32312==    by 0x5C49E4: Item_func::is_null() (item_func.h:168)
==32312==    by 0x5B4EC8: Item_func_interval::fix_length_and_dec() (item_cmpfunc.cc:2312)
==32312==    by 0x5EF388: Item_func::fix_fields(THD*, Item**) (item_func.cc:231)
==32312==    by 0x6984B0: setup_fields(THD*, Bounds_checked_array<Item*>, List<Item>&, enum_mark_columns, List<Item>*, bool) (sql_base.cc:8190)
==32312==    by 0x6FFF07: JOIN::prepare(TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, st_order*, Item*, st_select_lex*, st_select_lex_unit*) (sql_resolver.cc:149)
==32312==    by 0x706703: mysql_prepare_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*, bool*) (sql_select.cc:1054)
==32312==    by 0x7067C0: mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, SQL_I_List<st_order>*, SQL_I_List<st_order>*, Item*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:1177)
==32312==    by 0x706A04: handle_select(THD*, select_result*, unsigned long) (sql_select.cc:110)
==32312==    by 0x6E3AC8: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5019)
==32312==    by 0x6E8898: mysql_execute_command(THD*) (sql_parse.cc:2589)
==32312==    by 0x6EBA57: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:6149)
==32312==    by 0x6EC376: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1334)
==32312==    by 0x6ED616: do_command(THD*) (sql_parse.cc:1036)

How to repeat:
CREATE TABLE t1 (a INT);
SELECT SQL_NO_CACHE INTERVAL( 1, @var := a, 2, 3, 4, 5, 6, 7, 8 ) FROM t1;
[18 Mar 2013 18:41] Elena Stepanova
Modified synopsis to make it a bit more searchable.
[18 Mar 2013 19:59] Sveta Smirnova
Thank you for the report.

Verified as described.
[11 Nov 2019 10:59] Roy Lyseng
Posted by developer:
 
Not reproducible in current 5.7