Bug #31152 virtual int Field_str::store(double): Assertion `local_char_length < 5 || length
Submitted: 23 Sep 2007 7:05 Modified: 2 Oct 2007 14:13
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Data Types Severity:S2 (Serious)
Version:5.1.23-debug, 5.0.48-debug OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: assert, crash

[23 Sep 2007 7:05] Shane Bester
Description:
Version: '5.1.23-beta-debug'  socket: '/tmp/mysql.sock'  port: 3306  yes
mysqld: field.cc:6288: virtual int Field_str::store(double): Assertion `local_char_length < 5 || length <= local_char_length+1' failed.
070923  4:01:12 - mysqld got signal 6;
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=8388572
read_buffer_size=131072
max_used_connections=2
max_threads=151
threads_connected=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 33215 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x8de7940
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...
Cannot determine thread, fp=0x42895a54, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x820111b handle_segfault + 541
0xffffe410 _end + -142173536
0x400edb75 _end + 932549125
0x400e5903 _end + 932515731
0x81de85c Field_str::store(double) + 404
0x81e8d14 Field_varstring::store(double) + 24
0x831a057 field_conv(Field*, Field*) + 1039
0x815a5fc Item_field::save_in_field(Field*, bool) + 118
0x8250b1c fill_record(THD*, List<Item>&, List<Item>&, bool) + 266
0x8250c24 fill_record_n_invoke_before_triggers(THD*, List<Item>&, List<Item>&, bool, Table_triggers_list*, trg_event_type) + 56
0x8286395 select_insert::store_values(List<Item>&) + 69
0x82861dc select_insert::send_data(List<Item>&) + 158
0x82743c4 end_send(JOIN*, st_join_table*, bool) + 212
0x8272ad3 evaluate_join_record(JOIN*, st_join_table*, int, char*) + 445
0x82728b9 sub_select(JOIN*, st_join_table*, bool) + 209
0x8272400 do_select(JOIN*, List<Item>*, st_table*, Procedure*) + 756
0x82612bf JOIN::exec() + 7053
0x826181e _Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select + 638
0x825c33d handle_select(THD*, st_lex*, select_result*, unsigned long) + 365
0x8210ba4 mysql_execute_command(THD*) + 10868
0x8217550 mysql_parse(THD*, char const*, unsigned int, char const**) + 372
0x820cc00 dispatch_command(enum_server_command, THD*, char*, unsigned int) + 2354
0x820c2c2 do_command(THD*) + 600
0x820acbd handle_one_connection + 255
0x40038aa7 _end + 931807543
0x4017ec2e _end + 933143230
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/refman/5.1/en/resolve-stack-dump.html
and follow instructions on how to resolve the stack trace.
Resolved stack trace is much more helpful in diagnosing the
problem, so please do resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x8de9030 = insert into t1(col000) select (rand(`t1`.`col001`)) from t1 where col000 <> (convert(`t1`.`col001` using latin1)) limit 1
thd->thread_id=2

How to repeat:
use debug build of mysqld and run this:

some testcase
-----------
drop table if exists t1;
create table `t1` (`col000` char(10) not null,`col001` smallint not null)engine=innodb;
insert into t1 values (),(),();
insert into t1(col000) select (rand(1)) from t1 where col000 <> (convert(`t1`.`col001` using latin1)) limit 1;

another testcase
----------------
drop table if exists t;
create table t (a char(10),b int)engine=innodb;
insert into t values (),(),();
insert into t(a) select rand() from t;
[23 Sep 2007 7:06] Valeriy Kravchuk
5.1.21-debug has the same assertion failure, so this is not a recent regression anyway.
[2 Oct 2007 14:13] Alexey Kopytov
This is a duplicate of bug #26788.