There are valgrind complains when running a failing one: --------------------------------------------- ==15026== Invalid write of size 8 ==15026== at 0x76B1E5: MYSQLparse(void*) (sql_yacc.cc:31933) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534658 is 2,344 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid write of size 8 ==15026== at 0x76B1EF: MYSQLparse(void*) (sql_yacc.cc:31933) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534660 is 2,352 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid write of size 8 ==15026== at 0x76B1FA: MYSQLparse(void*) (sql_yacc.cc:31933) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534668 is 2,360 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid read of size 2 ==15026== at 0x76B236: MYSQLparse(void*) (sql_yacc.cc:31942) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14539C36 is 230 bytes inside a block of size 2,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x6324FF: lex_end(st_lex*) (sql_lex.cc:386) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid write of size 2 ==15026== at 0x74BACE: MYSQLparse(void*) (sql_yacc.cc:15979) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14539C38 is 232 bytes inside a block of size 2,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x6324FF: lex_end(st_lex*) (sql_lex.cc:386) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid read of size 8 ==15026== at 0x74BF4D: MYSQLparse(void*) (sql_yacc.cc:16143) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534658 is 2,344 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid read of size 8 ==15026== at 0x74BF57: MYSQLparse(void*) (sql_yacc.cc:16143) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534660 is 2,352 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid read of size 8 ==15026== at 0x74BF62: MYSQLparse(void*) (sql_yacc.cc:16143) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534668 is 2,360 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid write of size 8 ==15026== at 0x74BECC: MYSQLparse(void*) (sql_yacc.cc:16113) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534670 is 2,368 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid write of size 8 ==15026== at 0x74BED6: MYSQLparse(void*) (sql_yacc.cc:16113) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534678 is 2,376 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid write of size 8 ==15026== at 0x74BEE1: MYSQLparse(void*) (sql_yacc.cc:16113) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14534680 is 2,384 bytes inside a block of size 24,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x63251E: lex_end(st_lex*) (sql_lex.cc:387) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== ==15026== Invalid read of size 2 ==15026== at 0x76B3DF: MYSQLparse(void*) (sql_yacc.cc:32070) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ==15026== Address 0x14539C38 is 232 bytes inside a block of size 2,044 free'd ==15026== at 0x4C2191B: free (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==15026== by 0xC8B070: _myfree (safemalloc.c:313) ==15026== by 0x6324FF: lex_end(st_lex*) (sql_lex.cc:386) ==15026== by 0x8EE5F3: sp_head::restore_lex(THD*) (sp_head.cc:2091) ==15026== by 0x74F130: MYSQLparse(void*) (sql_yacc.yy:2762) ==15026== by 0x728A84: parse_sql(THD*, Lex_input_stream*, Object_creation_ctx*) (sql_parse.cc:7616) ==15026== by 0x738878: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5721) ==15026== by 0x7395C3: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1045) ==15026== by 0x73AA0C: do_command(THD*) (sql_parse.cc:722) ==15026== by 0x72736F: handle_one_connection (sql_connect.cc:1134) ==15026== by 0x524D01F: start_thread (in /lib64/libpthread-2.6.1.so) ==15026== by 0x64F5F8C: clone (in /lib64/libc-2.6.1.so) ---------------------------------------------