Description:
The test case 'ndb_autodiscover' started to produce this warning in Valgrind:
VALGRIND: 'Conditional jump or move depends on uninitialised value(s)'
COUNT: 1
FUNCTION: compare_record(st_table*, FILES: master.err
TESTS: ndb_autodiscover
STACK: at 0x627780: compare_record(st_table*, unsigned long) (sql_update.cc:35)
by 0x6241FC: mysql_update(THD*, st_table_list*, List<Item>&, List<Item>&, Item*, unsigned, st_order*, unsigned long, enum_duplicates, bool) (sql_update.cc:448)
by 0x5C345A: mysql_execute_command(THD*) (sql_parse.cc:3255)
by 0x5C9871: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:5817)
by 0x5C0CB8: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1752)
by 0x5C06BC: do_command(THD*) (sql_parse.cc:1538)
by 0x5BFBDC: handle_one_connection (sql_parse.cc:1175)
by 0x4D51C63: start_thread (in /lib64/tls/libpthread-0.60.so)
by 0x540D242: clone (in /lib64/tls/libc-2.3.2.so)
It can also be repeated with the following minimal test case:
-- source include/have_ndb.inc
-- source include/not_embedded.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(
adress char(255),
id int not null primary key,
name char(200)
) engine=ndb;
insert into t1 values ("Adress for record 2", 2, "Carl-Gustav");
update t1 set name="Bertil" where id = 2;
drop table t1;
The Valgrind error disappears if the table is instead defined as
create table t1(
adress char(255),
id int not null primary key,
name char(200)
) engine=ndb;
so it might be related to columns that come before the primary key column.
The problem is that in mysql_update(), the char(255) field adress is not initialized in the table records table->record[0] and table->record[1]. This causes the Valgrind warning when compare_record() compares the two records to determine if the row has been actually changed in values.
Not sure if the bug is that the 'adress' field is not initialised, or if it is that compare_record() uses the field in the comparison (despite not being used in the update).
How to repeat:
perl mysql-test-run.pl --ps-protocol --valgrind-all ndb_autodiscover
Description: The test case 'ndb_autodiscover' started to produce this warning in Valgrind: VALGRIND: 'Conditional jump or move depends on uninitialised value(s)' COUNT: 1 FUNCTION: compare_record(st_table*, FILES: master.err TESTS: ndb_autodiscover STACK: at 0x627780: compare_record(st_table*, unsigned long) (sql_update.cc:35) by 0x6241FC: mysql_update(THD*, st_table_list*, List<Item>&, List<Item>&, Item*, unsigned, st_order*, unsigned long, enum_duplicates, bool) (sql_update.cc:448) by 0x5C345A: mysql_execute_command(THD*) (sql_parse.cc:3255) by 0x5C9871: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:5817) by 0x5C0CB8: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1752) by 0x5C06BC: do_command(THD*) (sql_parse.cc:1538) by 0x5BFBDC: handle_one_connection (sql_parse.cc:1175) by 0x4D51C63: start_thread (in /lib64/tls/libpthread-0.60.so) by 0x540D242: clone (in /lib64/tls/libc-2.3.2.so) It can also be repeated with the following minimal test case: -- source include/have_ndb.inc -- source include/not_embedded.inc --disable_warnings drop table if exists t1; --enable_warnings create table t1( adress char(255), id int not null primary key, name char(200) ) engine=ndb; insert into t1 values ("Adress for record 2", 2, "Carl-Gustav"); update t1 set name="Bertil" where id = 2; drop table t1; The Valgrind error disappears if the table is instead defined as create table t1( adress char(255), id int not null primary key, name char(200) ) engine=ndb; so it might be related to columns that come before the primary key column. The problem is that in mysql_update(), the char(255) field adress is not initialized in the table records table->record[0] and table->record[1]. This causes the Valgrind warning when compare_record() compares the two records to determine if the row has been actually changed in values. Not sure if the bug is that the 'adress' field is not initialised, or if it is that compare_record() uses the field in the comparison (despite not being used in the update). How to repeat: perl mysql-test-run.pl --ps-protocol --valgrind-all ndb_autodiscover