Bug #44950 | Cast as char binary results in segmentation fault. | ||
---|---|---|---|
Submitted: | 19 May 2009 11:56 | Modified: | 8 Jul 2009 14:39 |
Reporter: | Øystein Grøvlen | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Charsets | Severity: | S3 (Non-critical) |
Version: | 6.0-bzr,5.4 | OS: | Solaris |
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
[19 May 2009 11:56]
Øystein Grøvlen
[19 May 2009 12:13]
MySQL Verification Team
Thank you for the bug report. Verified in Ubuntu 8.10 32-bit: 090519 9:10:39 [Note] dbs/6.0/libexec/mysqld: ready for connections. Version: '6.0.12-alpha-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution 090519 9:11:08 - mysqld got signal 11 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=8384512 read_buffer_size=131072 max_used_connections=1 max_threads=151 thread_count=1 connection_count=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 337822 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. thd: 0xb948218 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0xa8a6efb0 thread_stack 0x30c00 dbs/6.0/libexec/mysqld(my_print_stacktrace+0x32) [0x89bfbc5] dbs/6.0/libexec/mysqld(handle_segfault+0x2cd) [0x836752b] [0xb7f80400] dbs/6.0/libexec/mysqld(Item_func::fix_fields(THD*, Item**)+0x3da) [0x82cb3c6] dbs/6.0/libexec/mysqld(Item_str_func::fix_fields(THD*, Item**)+0x1f) [0x82e9cb3] dbs/6.0/libexec/mysqld(Item_func::fix_fields(THD*, Item**)+0x16f) [0x82cb15b] dbs/6.0/libexec/mysqld(Item_str_func::fix_fields(THD*, Item**)+0x1f) [0x82e9cb3] dbs/6.0/libexec/mysqld(setup_fields(THD*, Item**, List<Item>&, enum_mark_columns, List<Item>*, bool)+0x1c9) [0x83c9117] dbs/6.0/libexec/mysqld(JOIN::prepare(Item***, TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*)+0x2e8) [0x8411bc2] dbs/6.0/libexec/mysqld(mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*)+0x266) [0x8412eed] dbs/6.0/libexec/mysqld(handle_select(THD*, LEX*, select_result*, unsigned long)+0x1ec) [0x84188c3] dbs/6.0/libexec/mysqld [0x83792a2] dbs/6.0/libexec/mysqld(mysql_execute_command(THD*)+0xa67) [0x837ac42] dbs/6.0/libexec/mysqld(mysql_parse(THD*, char const*, unsigned int, char const**)+0x22f) [0x8383f0e] dbs/6.0/libexec/mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0x9f2) [0x8384a90] dbs/6.0/libexec/mysqld(do_command(THD*)+0x244) [0x8386036] dbs/6.0/libexec/mysqld(handle_one_connection+0x11d) [0x8371673] /lib/tls/i686/cmov/libpthread.so.0 [0xb7f1350f] /lib/tls/i686/cmov/libc.so.6(clone+0x5e) [0xb7d22a0e] Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0xb974df0 = select hex(cast('a' as char(2) binary)) thd->thread_id=1 thd->killed=NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. miguel@lara:~$
[3 Jul 2009 17:29]
Øystein Grøvlen
The following change fixes this problem: === modified file 'sql/sql_yacc.yy' --- sql/sql_yacc.yy 2009-06-12 02:01:08 +0000 +++ sql/sql_yacc.yy 2009-07-03 17:27:31 +0000 @@ -5626,7 +5626,11 @@ | unicode | BYTE_SYM { Lex->charset=&my_charset_bin; } | charset charset_name opt_bin_mod { Lex->charset=$2; } - | BINARY { Lex->type|= BINCMP_FLAG; } + | BINARY + { + Lex->charset= NULL; + Lex->type|= BINCMP_FLAG; + } | BINARY charset charset_name { Lex->charset= $3;
[8 Jul 2009 14:39]
Alexey Botchkov
As I see, the Oystein's patch was already put into Azalea, so the problem seems to be fixed with this.