Crash in Mysql-4.1 with Union

Crash in Mysql-4.1 with Union

am 15.10.2002 20:43:29 von Jocelyn Fournier

Hi,

A bug in UNION in mysql-4.1 which crashes mysql :

How-to-repeat :

mysql> SELECT * UNION SELECT 1;
ERROR 2013: Lost connection to MySQL server during query

Stack trace :

0x809f427 handle_segfault(int) + 487
0x828558a pthread_sighandler + 138
0x80c9c13 free_tmp_table(THD*, st_table*) + 35
0x81332df mysql_union(THD*, st_lex*, select_result*) + 95
0x80c5d5a handle_select(THD*, st_lex*, select_result*) + 58
0x80a99b6 mysql_execute_command(THD*) + 1222
0x80ae7bf mysql_parse(THD*, char*, unsigned) + 159
0x80a85a4 dispatch_command(enum_server_command, THD*, char*, unsigned) + 916
0x80a81fd do_command(THD*) + 109
0x80a7ac8 handle_one_connection(void*) + 904
0x8282b7e pthread_start_thread + 222
0x82b999a 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-thread12741@lists.mysql.com
To unsubscribe, e-mail

Re: Crash in Mysql-4.1 with Union

am 16.10.2002 21:15:49 von Sinisa Milivojevic

Jocelyn Fournier writes:
> Hi,
>
> A bug in UNION in mysql-4.1 which crashes mysql :
>
> How-to-repeat :
>
> mysql> SELECT * UNION SELECT 1;
> ERROR 2013: Lost connection to MySQL server during query
>
> Stack trace :
>
> 0x809f427 handle_segfault(int) + 487
> 0x828558a pthread_sighandler + 138
> 0x80c9c13 free_tmp_table(THD*, st_table*) + 35
> 0x81332df mysql_union(THD*, st_lex*, select_result*) + 95
> 0x80c5d5a handle_select(THD*, st_lex*, select_result*) + 58
> 0x80a99b6 mysql_execute_command(THD*) + 1222
> 0x80ae7bf mysql_parse(THD*, char*, unsigned) + 159
> 0x80a85a4 dispatch_command(enum_server_command, THD*, char*, unsigned) + 916
> 0x80a81fd do_command(THD*) + 109
> 0x80a7ac8 handle_one_connection(void*) + 904
> 0x8282b7e pthread_start_thread + 222
> 0x82b999a thread_start + 4
>
> Regards,
> Jocelyn
>

Hi!

Thank you for your test case that has helped us fix a bug.

A fix will come up in 4.0.5, and this is a patch that fixes it:

===== sql/sql_union.cc 1.41 vs edited =====
*** /tmp/sql_union.cc-1.41-15789 Mon Oct 14 11:54:03 2002
--- edited/sql/sql_union.cc Wed Oct 16 22:12:42 2002
***************
*** 109,115 ****
if (prepared)
DBUG_RETURN(0);
prepared= 1;
!
describe=(first_select()->options & SELECT_DESCRIBE) ? 1 : 0;
res= 0;
found_rows_for_union= false;
--- 109,115 ----
if (prepared)
DBUG_RETURN(0);
prepared= 1;
! union_result=0;
describe=(first_select()->options & SELECT_DESCRIBE) ? 1 : 0;
res= 0;
found_rows_for_union= false;
***************
*** 309,318 ****
int st_select_lex_unit::cleanup()
{
DBUG_ENTER("st_select_lex_unit::cleanup");
! delete union_result;
! free_tmp_table(thd,table);
! table= 0; // Safety
!
List_iterator j(joins);
JOIN** join;
while ((join= j++))
--- 309,320 ----
int st_select_lex_unit::cleanup()
{
DBUG_ENTER("st_select_lex_unit::cleanup");
! if (union_result)
! {
! delete union_result;
! free_tmp_table(thd,table);
! table= 0; // Safety
! }
List_iterator j(joins);
JOIN** join;
while ((join= j++))


--
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-thread12761@lists.mysql.com
To unsubscribe, e-mail