Crash with COUNT and PROCEDURE ANALYSE in MySQL-4.1

Crash with COUNT and PROCEDURE ANALYSE in MySQL-4.1

am 02.01.2003 23:22:15 von Jocelyn Fournier

Hi,

How-to-repeat :

CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=MyISAM CHARSET=latin1

SELECT COUNT(*) FROM `t1` PROCEDURE ANALYSE ( ) ;
ERROR 2013: Lost connection to MySQL server during query

Stack trace :

0x80a9a91 handle_segfault + 481
0x8296fd8 pthread_sighandler + 176
0x809d7b5 select_send::send_data(List&) + 21
0x80d4954 JOIN::exec() + 212
0x80d5bbd mysql_select(THD*, st_table_list*, List&, Item*, st_order*,
st_order*, Item*, st_order*, unsigned long, select_result*,
st_select_lex_unit*, st_select_lex*) + 253
0x80d3803 handle_select(THD*, st_lex*, select_result*) + 259
0x80b6dfc mysql_execute_command(THD*) + 636
0x80bba68 mysql_parse(THD*, char*, unsigned) + 248
0x80b5a8a dispatch_command(enum_server_command, THD*, char*, unsigned) + 842
0x80b5726 do_command(THD*) + 118
0x80b500e handle_one_connection + 910
0x82949fa pthread_start_thread + 218
0x82c8d1a thread_start + 4

Regards,
Jocelyn


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13391@lists.mysql.com
To unsubscribe, e-mail

Re: Crash with COUNT and PROCEDURE ANALYSE in MySQL-4.1

am 10.01.2003 14:59:56 von Sinisa Milivojevic

Jocelyn Fournier writes:
> Hi,
>
> How-to-repeat :
>
> CREATE TABLE `t1` (
> `a` int(11) NOT NULL default '0'
> ) TYPE=MyISAM CHARSET=latin1
>
> SELECT COUNT(*) FROM `t1` PROCEDURE ANALYSE ( ) ;
> ERROR 2013: Lost connection to MySQL server during query
>
> Stack trace :
>

[skip]

>
> Regards,
> Jocelyn

Thanks for your bug report which helped us fix a bug.

This is a patch:
===== sql/sql_select.cc 1.208 vs edited =====
*** /tmp/sql_select.cc-1.208-24961 Wed Jan 8 09:53:06 2003
--- edited/sql/sql_select.cc Fri Jan 10 15:56:35 2003
***************
*** 714,719 ****
--- 714,726 ----
int tmp_error;

DBUG_ENTER("JOIN::exec");
+
+ if (procedure)
+ {
+ if (procedure->change_columns(fields_list) ||
+ result->prepare(fields_list, unit))
+ DBUG_VOID_RETURN;
+ }

if (!tables_list)
{ // Only test of functions
***************
*** 768,775 ****
test_if_skip_sort_order(&join_tab[const_tables], order,
select_limit, 0))))
order=0;
- if (procedure)
- (void)result->prepare(fields_list, unit);
select_describe(this, need_tmp,
order != 0 && !skip_sort_order,
select_distinct);
--- 775,780 ----
***************
*** 989,997 ****
}
if (procedure)
{
- if (procedure->change_columns(fields_list) ||
- result->prepare(fields_list, unit))
- DBUG_VOID_RETURN;
count_field_types(&tmp_table_param, all_fields, 0);
}
if (group || tmp_table_param.sum_func_count ||
--- 994,999 ----



--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com

Join MySQL Users Conference and Expo:
http://www.mysql.com/events/uc2003/


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13450@lists.mysql.com
To unsubscribe, e-mail