Bug #194 | Crash with UNION | ||
---|---|---|---|
Submitted: | 26 Mar 2003 12:04 | Modified: | 29 Mar 2003 6:50 |
Reporter: | jocelyn fournier (Silver Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S1 (Critical) |
Version: | 4.1 | OS: | Any (ALL) |
Assigned to: | CPU Architecture: | Any |
[26 Mar 2003 12:04]
jocelyn fournier
[28 Mar 2003 7:08]
MySQL Verification Team
A query ran for 13 hours and finished quite fine with returning all results as expected. It hampered my work today, due to high CPU usage. If you could send my your my.cnf, may be I could repeat a crash .
[28 Mar 2003 7:22]
jocelyn fournier
Hi, Sorry about this, I should have said it crashes for me nearly immediately. I'll send you my my.cnf ASAP.
[28 Mar 2003 11:46]
jocelyn fournier
Hi, I just want to add I'm unable to reproduce the crash in debug mode, but in production mode it crashes immediately.
[29 Mar 2003 6:50]
MySQL Verification Team
Repeated it, and it is truly a very hard bug. This is a fix: ===== /mnt/work/mysql-4.1/sql/sql_union.cc 1.69 vs edited ===== *** /tmp/sql_union.cc-1.69-14304 Thu Mar 27 16:10:57 2003 --- edited//mnt/work/mysql-4.1/sql/sql_union.cc Sat Mar 29 16:08:52 2003 *************** *** 118,124 **** prepared= 1; res= 0; found_rows_for_union= 0; ! TMP_TABLE_PARAM tmp_table_param; this->result= result; t_and_f= tables_and_fields_initied; SELECT_LEX_NODE *lex_select_save= thd->lex.current_select; --- 118,124 ---- prepared= 1; res= 0; found_rows_for_union= 0; ! TMP_TABLE_PARAM *tmp_table_param= (TMP_TABLE_PARAM *)sql_calloc(sizeof(TMP_TABLE_PARAM)); this->result= result; t_and_f= tables_and_fields_initied; SELECT_LEX_NODE *lex_select_save= thd->lex.current_select; *************** *** 162,170 **** t_and_f= 1; } ! bzero((char*) &tmp_table_param,sizeof(tmp_table_param)); ! tmp_table_param.field_count=item_list.elements; ! if (!(table= create_tmp_table(thd, &tmp_table_param, item_list, (ORDER*) 0, !union_option, 1, (select_cursor->options | thd->options | TMP_TABLE_ALL_COLUMNS), --- 162,169 ---- t_and_f= 1; } ! tmp_table_param->field_count=item_list.elements; ! if (!(table= create_tmp_table(thd, tmp_table_param, item_list, (ORDER*) 0, !union_option, 1, (select_cursor->options | thd->options | TMP_TABLE_ALL_COLUMNS), *************** *** 181,187 **** goto err; union_result->not_describe=1; ! union_result->tmp_table_param=&tmp_table_param; /* the following piece of code is placed here solely for the purpose of --- 180,186 ---- goto err; union_result->not_describe=1; ! union_result->tmp_table_param=tmp_table_param; /* the following piece of code is placed here solely for the purpose of