Crash with Subselect in MySQL-4.1

Crash with Subselect in MySQL-4.1

am 24.11.2002 04:17:08 von Jocelyn Fournier

Hi,

How-to-repeat :

SELECT (SELECT a) as a;
ERROR 2013: Lost connection to MySQL server during query

Stack trace :

0x80a0551 handle_segfault + 481
0x828afd8 pthread_sighandler + 176
0x8051330 Item_ref::eq(Item const*, bool) const + 16
0x80c538d find_item_in_list(Item*, List&, find_item_error_report_type)
+ 285
0x804d54a Item_ref::fix_fields(THD*, st_table_list*, Item**) + 250
0x804c5d5 Item_field::fix_fields(THD*, st_table_list*, Item**) + 645
0x80c5505 setup_fields(THD*, st_table_list*, List&, bool, List*,
bool) + 117
0x80ca209 JOIN::prepare(st_table_list*, Item*, st_order*, st_order*, Item*,
st_order*, st_select_lex*, st_select_lex_unit*, bool) + 201
0x8084aed subselect_single_select_engine::prepare() + 157
0x8084209 Item_subselect::fix_fields(THD*, st_table_list*, Item**) + 25
0x80c5505 setup_fields(THD*, st_table_list*, List&, bool, List*,
bool) + 117
0x80ca209 JOIN::prepare(st_table_list*, Item*, st_order*, st_order*, Item*,
st_order*, st_select_lex*, st_select_lex_unit*, bool) + 201
0x80cc3f7 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*) + 439
0x80ca0f7 handle_select(THD*, st_lex*, select_result*) + 247
0x80acc5b mysql_execute_command(THD*) + 699
0x80b1ad2 mysql_parse(THD*, char*, unsigned) + 146
0x80abb17 dispatch_command(enum_server_command, THD*, char*, unsigned) + 855
0x80ab7a6 do_command(THD*) + 118
0x80ab07f handle_one_connection + 895
0x82889fa pthread_start_thread + 218
0x82bcd1a 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-thread13092@lists.mysql.com
To unsubscribe, e-mail

Re: Crash with Subselect in MySQL-4.1

am 24.11.2002 10:22:30 von Sanja Byelkin

Hi, Jocelyn!

On Mon, Nov 25, 2002 at 03:19:47AM -0000, Jocelyn Fournier wrote:
> Hi,
>
> How-to-repeat :
>
> SELECT (SELECT a) as a;
> ERROR 2013: Lost connection to MySQL server during query

Thank you for bugreport. Here is patch for this bug fixing:

diff -Nrc a/sql/item.h b/sql/item.h
*** a/sql/item.h Sun Nov 24 11:19:34 2002
--- b/sql/item.h Sun Nov 24 11:19:34 2002
***************
*** 403,410 ****
:Item_ident(NullS,table_name_par,field_name_par),ref(item) {}
enum Type type() const { return REF_ITEM; }
bool eq(const Item *item, bool binary_cmp) const
! { return (*ref)->eq(item, binary_cmp); }
! ~Item_ref() { if (ref) delete *ref; }
double val()
{
double tmp=(*ref)->val_result();
--- 403,410 ----
:Item_ident(NullS,table_name_par,field_name_par),ref(item) {}
enum Type type() const { return REF_ITEM; }
bool eq(const Item *item, bool binary_cmp) const
! { return ref && (*ref)->eq(item, binary_cmp); }
! ~Item_ref() { if (ref && (*ref) != this) delete *ref; }
double val()
{
double tmp=(*ref)->val_result();


[skip]

--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ 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-thread13093@lists.mysql.com
To unsubscribe, e-mail