set names utf8; drop table if exists t1; create table t1(a year(4))engine=myisam; insert into t1 values (0000),(2001); (select max(`a`) from t1) union (select max(`a`) from t1) ; [sbester@levovo mysql-5.6.2-m5-linux-x86_64]$ valgrind -v --leak-check=full --show-reachable=yes --db-attach=yes --track-origins=yes --tool=memcheck --num-callers=50 ./bin/mysqld --no-defaults --basedir=. --datadir=./data --skip-gr --myisam-recover=force --open-files-limit=2000 --port=3306 --tmpdir=. --socket=sock --gdb --skip-na --innodb-flush-log-at-trx-commit=0 --innodb-checksums=0 --innodb-doublewrite=0 ==12630== Memcheck, a memory error detector ==12630== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==12630== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==12630== Command: ./bin/mysqld --no-defaults --basedir=. --datadir=./data --skip-gr --myisam-recover=force --open-files-limit=2000 --port=3306 --tmpdir=. --socket=sock --gdb --skip-na --innodb-flush-log-at-trx-commit=0 --innodb-checksums=0 --innodb-doublewrite=0 ==12630== --12630-- Valgrind options: --12630-- -v --12630-- --leak-check=full --12630-- --show-reachable=yes --12630-- --db-attach=yes --12630-- --track-origins=yes --12630-- --tool=memcheck --12630-- --num-callers=50 --12630-- Contents of /proc/version: --12630-- Linux version 2.6.33.3-85.fc13.x86_64 (mockbuild@x86-02.phx2.fedoraproject.org) (gcc version 4.4.4 20100503 (Red Hat 4.4.4-2) (GCC) ) #1 SMP Thu May 6 18:09:49 UTC 2010 --12630-- Arch and hwcaps: AMD64, amd64-sse3-cx16 --12630-- Page sizes: currently 4096, max supported 4096 --12630-- Valgrind library directory: /usr/lib64/valgrind --12630-- Reading syms from /home/sbester/mysql/5.6/mysql-5.6.2-m5-linux-x86_64/bin/mysqld (0x400000) --12630-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux (0x38000000) --12630-- object doesn't have a dynamic symbol table --12630-- Reading syms from /lib64/ld-2.12.so (0x30e1000000) --12630-- Reading debug info from /usr/lib/debug/lib64/ld-2.12.so.debug .. --12630-- Reading suppressions file: /usr/lib64/valgrind/default.supp --12630-- REDIR: 0x30e1017590 (strlen) redirected to 0x3803f6f7 (vgPlain_amd64_linux_REDIR_FOR_strlen) --12630-- Reading syms from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so (0x4801000) --12630-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so (0x4a02000) ==12630== WARNING: new redirection conflicts with existing -- ignoring it --12630-- new: 0x30e1017590 (strlen ) R-> 0x04a06340 strlen --12630-- REDIR: 0x30e1017400 (index) redirected to 0x4a05f80 (index) --12630-- REDIR: 0x30e1017480 (strcmp) redirected to 0x4a06900 (strcmp) --12630-- Reading syms from /lib64/libpthread-2.12.so (0x30e1800000) --12630-- Reading debug info from /usr/lib/debug/lib64/libpthread-2.12.so.debug .. --12630-- Reading syms from /lib64/libz.so.1.2.3 (0x30e2400000) --12630-- Reading debug info from /usr/lib/debug/lib64/libz.so.1.2.3.debug .. --12630-- Reading syms from /lib64/libm-2.12.so (0x30e1c00000) --12630-- Reading debug info from /usr/lib/debug/lib64/libm-2.12.so.debug .. --12630-- Reading syms from /lib64/librt-2.12.so (0x30e2800000) --12630-- Reading debug info from /usr/lib/debug/lib64/librt-2.12.so.debug .. --12630-- Reading syms from /lib64/libcrypt-2.12.so (0x33b8200000) --12630-- Reading debug info from /usr/lib/debug/lib64/libcrypt-2.12.so.debug .. --12630-- Reading syms from /lib64/libdl-2.12.so (0x30e2000000) --12630-- Reading debug info from /usr/lib/debug/lib64/libdl-2.12.so.debug .. --12630-- Reading syms from /lib64/libc-2.12.so (0x30e1400000) --12630-- Reading debug info from /usr/lib/debug/lib64/libc-2.12.so.debug .. --12630-- Reading syms from /lib64/libfreebl3.so (0x33b8600000) --12630-- Reading debug info from /usr/lib/debug/lib64/libfreebl3.so.debug .. --12630-- REDIR: 0x30e1481ad0 (__GI_strrchr) redirected to 0x4a05e00 (__GI_strrchr) --12630-- REDIR: 0x30e1482850 (memset) redirected to 0x4a07540 (memset) --12630-- REDIR: 0x30e147ffe0 (strlen) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==12630== WARNING: new redirection conflicts with existing -- ignoring it --12630-- new: 0x30e1480010 (__GI_strlen ) R-> 0x04a062e0 strlen --12630-- REDIR: 0x30e1480010 (__GI_strlen) redirected to 0x4a06300 (__GI_strlen) --12630-- REDIR: 0x30e1479610 (calloc) redirected to 0x4a043d3 (calloc) --12630-- REDIR: 0x30e147e5a0 (strcmp) redirected to 0x480155c (_vgnU_ifunc_wrapper) --12630-- REDIR: 0x30e1527820 (__strcmp_ssse3) redirected to 0x4a06860 (strcmp) --12630-- REDIR: 0x30e1480060 (strnlen) redirected to 0x4a06280 (strnlen) --12630-- REDIR: 0x30e1482690 (memmove) redirected to 0x4a075b0 (memmove) --12630-- REDIR: 0x30e1485260 (strchrnul) redirected to 0x4a07620 (strchrnul) --12630-- REDIR: 0x30e1483c60 (memcpy) redirected to 0x4a069d0 (memcpy) --12630-- REDIR: 0x30e14799d0 (malloc) redirected to 0x4a050db (malloc) --12630-- Reading syms from /lib64/libgcc_s-4.4.4-20100630.so.1 (0x30ec000000) --12630-- Reading debug info from /usr/lib/debug/lib64/libgcc_s-4.4.4-20100630.so.1.debug .. ==12630== WARNING: new redirection conflicts with existing -- ignoring it --12630-- new: 0x30e1480010 (__GI_strlen ) R-> 0x04a062e0 strlen --12630-- REDIR: 0x30e147a750 (free) redirected to 0x4a04ceb (free) --12630-- REDIR: 0x30e1480220 (__GI_strncmp) redirected to 0x4a06800 (__GI_strncmp) --12630-- REDIR: 0x30e147fa30 (strcpy) redirected to 0x480155c (_vgnU_ifunc_wrapper) --12630-- REDIR: 0x30e1524280 (???) redirected to 0x4a06360 (strcpy) --12630-- REDIR: 0x30e1482260 (bcmp) redirected to 0x480155c (_vgnU_ifunc_wrapper) --12630-- REDIR: 0x30e1482290 (__GI_memcmp) redirected to 0x4a07160 (bcmp) --12630-- REDIR: 0x30e147abd0 (realloc) redirected to 0x4a0518c (realloc) --12630-- REDIR: 0x30e147fa60 (__GI_strcpy) redirected to 0x4a06430 (__GI_strcpy) --12630-- REDIR: 0x30e147e5e0 (__GI_strcmp) redirected to 0x4a068b0 (__GI_strcmp) --12630-- REDIR: 0xffffffffff600400 (???) redirected to 0x3803f6ed (vgPlain_amd64_linux_REDIR_FOR_vtime) --12630-- REDIR: 0x30e1485210 (__GI___rawmemchr) redirected to 0x4a07670 (__GI___rawmemchr) --12630-- REDIR: 0x30e1481aa0 (rindex) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==12630== WARNING: new redirection conflicts with existing -- ignoring it --12630-- new: 0x30e1481ad0 (__GI_strrchr ) R-> 0x04a05dd0 rindex --12630-- REDIR: 0x30e147e4f0 (index) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==12630== WARNING: new redirection conflicts with existing -- ignoring it --12630-- new: 0x30e147e520 (__GI_strchr ) R-> 0x04a05e90 index --12630-- REDIR: 0x30e147e520 (__GI_strchr) redirected to 0x4a05ec0 (__GI_strchr) --12630-- REDIR: 0x30e1480140 (strncat) redirected to 0x4a06170 (strncat) --12630-- REDIR: 0x30e1483380 (mempcpy) redirected to 0x4a07690 (mempcpy) --12630-- REDIR: 0x30e14821e0 (memchr) redirected to 0x4a069a0 (memchr) --12630-- REDIR: 0x30e1483990 (stpcpy) redirected to 0x480155c (_vgnU_ifunc_wrapper) --12630-- REDIR: 0x30e1525c20 (???) redirected to 0x4a07200 (stpcpy) --12630-- REDIR: 0x30e14801e0 (strncmp) redirected to 0x480155c (_vgnU_ifunc_wrapper) --12630-- REDIR: 0x30e1528a80 (__strncmp_ssse3) redirected to 0x4a067a0 (strncmp) 110107 7:00:53 [Note] Plugin 'FEDERATED' is disabled. 110107 7:00:53 InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!! 110107 7:00:53 InnoDB: The InnoDB memory heap is disabled 110107 7:00:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins 110107 7:00:53 InnoDB: Compressed tables use zlib 1.2.3 --12630-- REDIR: 0xffffffffff600000 (???) redirected to 0x3803f6e3 (vgPlain_amd64_linux_REDIR_FOR_vgettimeofday) 110107 7:00:54 InnoDB: Initializing buffer pool, size = 128.0M 110107 7:00:59 InnoDB: Completed initialization of buffer pool 110107 7:01:00 InnoDB: highest supported file format is Barracuda. 110107 7:01:12 InnoDB: 1.2.1 started; log sequence number 144894334 110107 7:01:18 [Note] ./bin/mysqld: ready for connections. Version: '5.6.2-m5-valgrind-max-debug' socket: 'sock' port: 3306 Source distribution ==12630== Thread 18: ==12630== Conditional jump or move depends on uninitialised value(s) ==12630== at 0x675187: copy_and_convert(char*, unsigned int, charset_info_st*, char const*, unsigned int, charset_info_st*, unsigned int*) (sql_string.cc:836) ==12630== by 0x57B9BE: Protocol::net_store_data(unsigned char const*, unsigned long, charset_info_st*, charset_info_st*) (protocol.cc:114) ==12630== by 0x57D702: Protocol::store_string_aux(char const*, unsigned long, charset_info_st*, charset_info_st*) (protocol.cc:958) ==12630== by 0x57E1AC: Protocol_text::store(Field*) (protocol.cc:1120) ==12630== by 0x7778D2: Item_field::send(Protocol*, String*) (item.cc:6082) ==12630== by 0x57D37A: Protocol::send_result_set_row(List*) (protocol.cc:848) ==12630== by 0x5C75AD: select_send::send_data(List&) (sql_class.cc:1866) ==12630== by 0x64594A: end_send(JOIN*, st_join_table*, bool) (sql_select.cc:18449) ==12630== by 0x643D08: evaluate_join_record(JOIN*, st_join_table*, int) (sql_select.cc:17668) ==12630== by 0x6432A8: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:17364) ==12630== by 0x642799: do_select(JOIN*, List*, TABLE*, Procedure*) (sql_select.cc:16908) ==12630== by 0x62267D: JOIN::exec() (sql_select.cc:3331) ==12630== by 0x622F0F: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3554) ==12630== by 0x694E3A: st_select_lex_unit::exec() (sql_union.cc:618) ==12630== by 0x692EDE: mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long) (sql_union.cc:38) ==12630== by 0x619477: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:301) ==12630== by 0x5FBC9A: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4513) ==12630== by 0x5F48FD: mysql_execute_command(THD*) (sql_parse.cc:2096) ==12630== by 0x5FDDF6: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5550) ==12630== by 0x5F21BD: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1078) ==12630== by 0x5F14C5: do_command(THD*) (sql_parse.cc:815) ==12630== by 0x6D131C: do_handle_one_connection(THD*) (sql_connect.cc:748) ==12630== by 0x6D0EAD: handle_one_connection (sql_connect.cc:684) ==12630== by 0x30E1807760: start_thread (pthread_create.c:301) ==12630== by 0x1B07070F: ??? ==12630== Uninitialised value was created by a stack allocation ==12630== at 0x57E045: Protocol_text::store(Field*) (protocol.cc:1098) ==12630== ==12630== ==12630== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- c ==12630== Use of uninitialised value of size 8 ==12630== at 0xB16C83: my_mb_wc_latin1 (ctype-latin1.c:367) ==12630== by 0x67501A: copy_and_convert_extended(char*, unsigned int, charset_info_st*, char const*, unsigned int, charset_info_st*, unsigned int*) (sql_string.cc:756) ==12630== by 0x6751D1: copy_and_convert(char*, unsigned int, charset_info_st*, char const*, unsigned int, charset_info_st*, unsigned int*) (sql_string.cc:845) ==12630== by 0x57B9BE: Protocol::net_store_data(unsigned char const*, unsigned long, charset_info_st*, charset_info_st*) (protocol.cc:114) ==12630== by 0x57D702: Protocol::store_string_aux(char const*, unsigned long, charset_info_st*, charset_info_st*) (protocol.cc:958) ==12630== by 0x57E1AC: Protocol_text::store(Field*) (protocol.cc:1120) ==12630== by 0x7778D2: Item_field::send(Protocol*, String*) (item.cc:6082) ==12630== by 0x57D37A: Protocol::send_result_set_row(List*) (protocol.cc:848) ==12630== by 0x5C75AD: select_send::send_data(List&) (sql_class.cc:1866) ==12630== by 0x64594A: end_send(JOIN*, st_join_table*, bool) (sql_select.cc:18449) ==12630== by 0x643D08: evaluate_join_record(JOIN*, st_join_table*, int) (sql_select.cc:17668) ==12630== by 0x6432A8: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:17364) ==12630== by 0x642799: do_select(JOIN*, List*, TABLE*, Procedure*) (sql_select.cc:16908) ==12630== by 0x62267D: JOIN::exec() (sql_select.cc:3331) ==12630== by 0x622F0F: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3554) ==12630== by 0x694E3A: st_select_lex_unit::exec() (sql_union.cc:618) ==12630== by 0x692EDE: mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long) (sql_union.cc:38) ==12630== by 0x619477: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:301) ==12630== by 0x5FBC9A: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4513) ==12630== by 0x5F48FD: mysql_execute_command(THD*) (sql_parse.cc:2096) ==12630== by 0x5FDDF6: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5550) ==12630== by 0x5F21BD: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1078) ==12630== by 0x5F14C5: do_command(THD*) (sql_parse.cc:815) ==12630== by 0x6D131C: do_handle_one_connection(THD*) (sql_connect.cc:748) ==12630== by 0x6D0EAD: handle_one_connection (sql_connect.cc:684) ==12630== by 0x30E1807760: start_thread (pthread_create.c:301) ==12630== by 0x1B07070F: ??? ==12630== Uninitialised value was created by a stack allocation ==12630== at 0x57E045: Protocol_text::store(Field*) (protocol.cc:1098) ==12630== ==12630== Conditional jump or move depends on uninitialised value(s) ==12630== at 0xB16CA6: my_mb_wc_latin1 (ctype-latin1.c:368) ==12630== by 0x67501A: copy_and_convert_extended(char*, unsigned int, charset_info_st*, char const*, unsigned int, charset_info_st*, unsigned int*) (sql_string.cc:756) ==12630== by 0x6751D1: copy_and_convert(char*, unsigned int, charset_info_st*, char const*, unsigned int, charset_info_st*, unsigned int*) (sql_string.cc:845) ==12630== by 0x57B9BE: Protocol::net_store_data(unsigned char const*, unsigned long, charset_info_st*, charset_info_st*) (protocol.cc:114) ==12630== by 0x57D702: Protocol::store_string_aux(char const*, unsigned long, charset_info_st*, charset_info_st*) (protocol.cc:958) ==12630== by 0x57E1AC: Protocol_text::store(Field*) (protocol.cc:1120) ==12630== by 0x7778D2: Item_field::send(Protocol*, String*) (item.cc:6082) ==12630== by 0x57D37A: Protocol::send_result_set_row(List*) (protocol.cc:848) ==12630== by 0x5C75AD: select_send::send_data(List&) (sql_class.cc:1866) ==12630== by 0x64594A: end_send(JOIN*, st_join_table*, bool) (sql_select.cc:18449) ==12630== by 0x643D08: evaluate_join_record(JOIN*, st_join_table*, int) (sql_select.cc:17668) ==12630== by 0x6432A8: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:17364) ==12630== by 0x642799: do_select(JOIN*, List*, TABLE*, Procedure*) (sql_select.cc:16908) ==12630== by 0x62267D: JOIN::exec() (sql_select.cc:3331) ==12630== by 0x622F0F: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3554) ==12630== by 0x694E3A: st_select_lex_unit::exec() (sql_union.cc:618) ==12630== by 0x692EDE: mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long) (sql_union.cc:38) ==12630== by 0x619477: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:301) ==12630== by 0x5FBC9A: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4513) ==12630== by 0x5F48FD: mysql_execute_command(THD*) (sql_parse.cc:2096) ==12630== by 0x5FDDF6: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5550) ==12630== by 0x5F21BD: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1078) ==12630== by 0x5F14C5: do_command(THD*) (sql_parse.cc:815) ==12630== by 0x6D131C: do_handle_one_connection(THD*) (sql_connect.cc:748) ==12630== by 0x6D0EAD: handle_one_connection (sql_connect.cc:684) ==12630== by 0x30E1807760: start_thread (pthread_create.c:301) ==12630== by 0x1B07070F: ??? ==12630== Uninitialised value was created by a stack allocation ==12630== at 0x57E045: Protocol_text::store(Field*) (protocol.cc:1098) ==12630== ==12630== Syscall param write(buf) points to uninitialised byte(s) ==12630== at 0x30E180E42D: ??? (syscall-template.S:82) ==12630== by 0xB3E249: vio_write (viosocket.c:115) ==12630== by 0x575E23: net_real_write (net_serv.cc:642) ==12630== by 0x575522: net_flush (net_serv.cc:348) ==12630== by 0x57BF04: net_send_eof(THD*, unsigned int, unsigned int) (protocol.cc:297) ==12630== by 0x57C61D: Protocol::send_eof(unsigned int, unsigned int) (protocol.cc:562) ==12630== by 0x57C443: Protocol::end_statement() (protocol.cc:509) ==12630== by 0x5F3411: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1438) ==12630== by 0x5F14C5: do_command(THD*) (sql_parse.cc:815) ==12630== by 0x6D131C: do_handle_one_connection(THD*) (sql_connect.cc:748) ==12630== by 0x6D0EAD: handle_one_connection (sql_connect.cc:684) ==12630== by 0x30E1807760: start_thread (pthread_create.c:301) ==12630== by 0x1B07070F: ??? ==12630== Address 0x15790002 is 66 bytes inside a block of size 16,391 alloc'd ==12630== at 0x4A0515D: malloc (vg_replace_malloc.c:195) ==12630== by 0x90ABE5: my_malloc (my_malloc.c:38) ==12630== by 0x574F3A: my_net_init (net_serv.cc:116) ==12630== by 0x56FA25: handle_connections_sockets() (mysqld.cc:5500) ==12630== by 0x56EBA1: mysqld_main(int, char**) (mysqld.cc:4816) ==12630== by 0x566A03: main (main.cc:24) ==12630== Uninitialised value was created by a stack allocation ==12630== at 0x57E045: Protocol_text::store(Field*) (protocol.cc:1098) ==12630==