Crash using PROCEDURE ANALYSE with MySQL-4.1
Crash using PROCEDURE ANALYSE with MySQL-4.1
am 05.12.2002 12:35:55 von Jocelyn Fournier
Hi,
How-to-repeat :
Download
ftp://support.mysql.com/pub/mysql/secret/procedure_analyse_b ug.tar.gz
(sorry I have no small reproducible testcase)
Then :
mysql> SELECT * FROM searchconthardwarefr7 WHERE mot='joce' PROCEDURE
ANALYSE();
ERROR 2013: Lost connection to MySQL server during query
Stack trace :
0x80a3911 handle_segfault + 481
0x8290498 pthread_sighandler + 176
0x80a149a sortcmp(String const*, String const*) + 42
0x812bf5c field_str::add() + 476
0x812ca33 analyse::send_row(List- &) + 35
0x80da85e end_send(JOIN*, st_join_table*, bool) + 366
0x80d98f6 sub_select(JOIN*, st_join_table*, bool) + 246
0x80d4f61 do_select(JOIN*, List- *, st_table*, Procedure*) + 257
0x80cf196 JOIN::exec() + 3030
0x80cf87b 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*) + 123
0x80cd5fc handle_select(THD*, st_lex*, select_result*) + 252
0x80b09bf mysql_execute_command(THD*) + 639
0x80b57d8 mysql_parse(THD*, char*, unsigned) + 248
0x80af64a dispatch_command(enum_server_command, THD*, char*, unsigned) + 842
0x80af2e6 do_command(THD*) + 118
0x80aebce handle_one_connection + 910
0x828deba pthread_start_thread + 218
0x82c21da 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-thread13215@lists.mysql.com
To unsubscribe, e-mail
Re: Crash using PROCEDURE ANALYSE with MySQL-4.1
am 05.12.2002 15:44:32 von Sinisa Milivojevic
Jocelyn Fournier writes:
> Hi,
>
> How-to-repeat :
>
> Download
> ftp://support.mysql.com/pub/mysql/secret/procedure_analyse_b ug.tar.gz
> (sorry I have no small reproducible testcase)
>
> Then :
>
> mysql> SELECT * FROM searchconthardwarefr7 WHERE mot='joce' PROCEDURE
> ANALYSE();
> ERROR 2013: Lost connection to MySQL server during query
>
>
> Regards,
> Jocelyn
>
Thank you for your bug report, which helped us fix a bug.
This is a temporary patch:
===== /mnt/work/mysql-4.1/sql/sql_analyse.cc 1.21 vs edited =====
*** /tmp/sql_analyse.cc-1.21-9021 Thu Nov 21 04:21:04 2002
--- edited//mnt/work/mysql-4.1/sql/sql_analyse.cc Thu Dec 5 16:39:40 2002
***************
*** 324,330 ****
}
else
{
! bzero((char*) &s, sizeof(s)); // Let tree handle free of this
if ((treemem += length) > pc->max_treemem)
{
room_in_tree = 0; // Remove tree, too big tree
--- 324,330 ----
}
else
{
! // bzero((char*) &s, sizeof(s)); Let tree handle free of this
if ((treemem += length) > pc->max_treemem)
{
room_in_tree = 0; // Remove tree, too big tree
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com
------------------------------------------------------------ ---------
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-thread13223@lists.mysql.com
To unsubscribe, e-mail
Re: Crash using PROCEDURE ANALYSE with MySQL-4.1
am 11.12.2002 14:38:54 von Michael Widenius
Hi!
>>>>> "Sinisa" == Sinisa Milivojevic writes:
Sinisa> Jocelyn Fournier writes:
>> Hi,
>>
>> How-to-repeat :
>>
>> Download
>> ftp://support.mysql.com/pub/mysql/secret/procedure_analyse_b ug.tar.gz
>> (sorry I have no small reproducible testcase)
>>
>> Then :
>>
mysql> SELECT * FROM searchconthardwarefr7 WHERE mot='joce' PROCEDURE
>> ANALYSE();
>> ERROR 2013: Lost connection to MySQL server during query
Here is now a final patch regarding this:
===== sql_analyse.cc 1.24 vs edited =====
*** /tmp/sql_analyse.cc-1.24-13279 Mon Dec 9 15:57:15 2002
--- edited/sql_analyse.cc Wed Dec 11 15:13:00 2002
***************
*** 310,339 ****
was_maybe_zerofill = num_info.maybe_zerofill;
}
! if (room_in_tree)
! {
! if (res != &s)
! s.copy(*res);
! if (!tree_search(&tree, (void*) &s, tree.custom_arg)) // If not in tree
! {
! s.copy(); // slow, when SAFE_MALLOC is in use
! if (!tree_insert(&tree, (void*) &s, 0, tree.custom_arg))
! {
! room_in_tree = 0; // Remove tree, out of RAM ?
! delete_tree(&tree);
! }
! else
! {
! bzero((char*) &s, sizeof(s)); // Let tree handle free of this
! if ((treemem += length) > pc->max_treemem)
! {
! room_in_tree = 0; // Remove tree, too big tree
! delete_tree(&tree);
! }
! }
! }
! }
!
if (!found)
{
found = 1;
--- 310,316 ----
was_maybe_zerofill = num_info.maybe_zerofill;
}
! /* Update min and max arguments */
if (!found)
{
found = 1;
***************
*** 364,369 ****
--- 341,371 ----
max_arg.copy(*res);
}
}
+
+ if (room_in_tree)
+ {
+ if (res != &s)
+ s.copy(*res);
+ if (!tree_search(&tree, (void*) &s, tree.custom_arg)) // If not in tree
+ {
+ s.copy(); // slow, when SAFE_MALLOC is in use
+ if (!tree_insert(&tree, (void*) &s, 0, tree.custom_arg))
+ {
+ room_in_tree = 0; // Remove tree, out of RAM ?
+ delete_tree(&tree);
+ }
+ else
+ {
+ bzero((char*) &s, sizeof(s)); // Let tree handle free of this
+ if ((treemem += length) > pc->max_treemem)
+ {
+ room_in_tree = 0; // Remove tree, too big tree
+ delete_tree(&tree);
+ }
+ }
+ }
+ }
+
if ((num_info.zerofill && (max_length != min_length)) ||
(was_zero_fill && (max_length != min_length)))
can_be_still_num = 0; // zerofilled numbers must be of same length
Regards,
Monty
--
For technical support contracts, goto https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Michael Widenius
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, CTO
/_/ /_/\_, /___/\___\_\___/ Helsinki, Finland
<___/ www.mysql.com
------------------------------------------------------------ ---------
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-thread13256@lists.mysql.com
To unsubscribe, e-mail