Crash in 4.1 with set variable

Crash in 4.1 with set variable

am 04.01.2003 00:13:51 von Georg Richter

Hi,

how-to-repeat:

mysql> create table a (a int);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into a values (1);
Query OK, 1 row affected (0.02 sec)

mysql> set @a:=(select a from a);
ERROR 2013: Lost connection to MySQL server during query


Stack-Trace:

0x80f10eb handle_segfault + 447
0x40047bc4 _end + 935314604
0x8112b9c find_field_in_table__FP3THDP8st_tablePCcUibT4 + 72
0x8112f60
find_field_in_tables__FP3THDP10Item_identP13st_table_listPP1 3st_table_listb +
756
0x80be837 fix_fields__10Item_fieldP3THDP13st_table_listPP4Item + 71
0x811339d setup_fields__FP3THDP13st_table_listRt4List1Z4ItembPt4List1Z 4ItemT3
+ 281
0x811796c
prepare__4JOINP13st_table_listP4ItemP8st_orderT3T2T3P13st_se lect_lexP18st_select_lex_unitb
+ 224
0x80dd94b prepare__30subselect_single_select_engine + 115
0x80db9ac fix_fields__14Item_subselectP3THDP13st_table_listPP4Item + 112
0x80c30c4 fix_fields__9Item_funcP3THDP13st_table_listPP4Item + 140
0x80c7779 fix_fields__22Item_func_set_user_varP3THDP13st_table_listPP4 Item +
29
0x80f6fc5 check__12set_var_userP3THD + 29
0x80f6d8c sql_set_variables__FP3THDPt4List1Z12set_var_base + 76
0x80ff01c mysql_execute_command__FP3THD + 11200
0x8100c31 mysql_parse__FP3THDPcUi + 229
0x80fb8cc dispatch_command__F19enum_server_commandP3THDPcUi + 1732
0x80fb1fd do_command__FP3THD + 301
0x80fa907 handle_one_connection + 723
0x40044f37 _end + 935303199
0x401a0baa _end + 936727698

Regards

Georg

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

Re: Crash in 4.1 with set variable - new stack trace output

am 04.01.2003 00:44:47 von Georg Richter

Sorry,

forgot c++filt for the stack-trace:

0x80f10eb handle_segfault + 447
0x40047bc4 _end + 935314604
0x8112b9c find_field_in_table(THD *, st_table *, char const *, unsigned int,
bool, bool) + 72
0x8112f60 find_field_in_tables(THD *, Item_ident *, st_table_list *,
st_table_list **, bool) + 756
0x80be837 Item_field::fix_fields(THD *, st_table_list *, Item **) + 71
0x811339d setup_fields(THD *, st_table_list *, List &, bool, List
*, bool) + 281
0x811796c JOIN::prepare(st_table_list *, Item *, st_order *, st_order *, Item
*, st_order *, st_select_lex *, st_select_lex_unit *, bool) + 224
0x80dd94b subselect_single_select_engine::prepare(void) + 115
0x80db9ac Item_subselect::fix_fields(THD *, st_table_list *, Item **) + 112
0x80c30c4 Item_func::fix_fields(THD *, st_table_list *, Item **) + 140
0x80c7779 Item_func_set_user_var::fix_fields(THD *, st_table_list *, Item **)
+ 29
0x80f6fc5 set_var_user::check(THD *) + 29
0x80f6d8c sql_set_variables(THD *, List *) + 76
0x80ff01c mysql_execute_command(THD *) + 11200
0x8100c31 mysql_parse(THD *, char *, unsigned int) + 229
0x80fb8cc dispatch_command(enum_server_command, THD *, char *, unsigned int)
+ 1732
0x80fb1fd do_command(THD *) + 301
0x80fa907 handle_one_connection + 723
0x40044f37 _end + 935303199
0x401a0baa _end + 936727698

Regards

Georg


filter: how-to-repeat

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

Re: Crash in 4.1 with set variable

am 04.01.2003 15:31:33 von Sanja Byelkin

Hi!

On Sat, Jan 04, 2003 at 12:13:51AM +0100, Georg Richter wrote:
> Hi,
>
> how-to-repeat:
>
> mysql> create table a (a int);
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> insert into a values (1);
> Query OK, 1 row affected (0.02 sec)
>
> mysql> set @a:=(select a from a);
> ERROR 2013: Lost connection to MySQL server during query

Thank you for bugreport. Here is fix of this bug:

===== sql/sql_parse.cc 1.281 vs edited =====
*** /tmp/sql_parse.cc-1.281-8908 Fri Jan 3 19:35:12 2003
--- edited/sql/sql_parse.cc Sat Jan 4 16:00:47 2003
***************
*** 2470,2478 ****
break;
}
case SQLCOM_SET_OPTION:
! if (!(res=sql_set_variables(thd, &lex->var_list)))
send_ok(thd);
break;
case SQLCOM_UNLOCK_TABLES:
unlock_locked_tables(thd);
if (thd->options & OPTION_TABLE_LOCK)
--- 2470,2485 ----
break;
}
case SQLCOM_SET_OPTION:
! if (tables && ((res= check_table_access(thd, SELECT_ACL, tables)) ||
! (res= open_and_lock_tables(thd,tables))))
! break;
! fix_tables_pointers(lex->all_selects_list);
! if (!(res= sql_set_variables(thd, &lex->var_list)))
send_ok(thd);
+ if (thd->net.report_error)
+ res= -1;
break;
+
case SQLCOM_UNLOCK_TABLES:
unlock_locked_tables(thd);
if (thd->options & OPTION_TABLE_LOCK)


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