Crash with subselect and HANDLER in MySQL-4.1

Crash with subselect and HANDLER in MySQL-4.1

am 01.01.2003 14:22:19 von Jocelyn Fournier

Hi,

How-to-repeat :

CREATE TABLE t1 (a int, KEY(a));
HANDLER t1 OPEN;
HANDLER t1 READ a=((SELECT 1));
ERROR 2013: Lost connection to MySQL server during query

Stack trace :

0x80a9a91 handle_segfault + 481
0x8296fd8 pthread_sighandler + 176
0x808a43e Item_singlerow_subselect::val_str(String*) + 30
0x804d13b Item::save_in_field(Field*, bool) + 91
0x804b1f9 mysql_ha_read(THD*, st_table_list*, enum_ha_read_modes, char*,
List*, ha_rkey_function, Item*, unsigned long, unsigned long) + 1561
0x80ba6e4 mysql_execute_command(THD*) + 15204
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-thread13387@lists.mysql.com
To unsubscribe, e-mail

Re: Crash with subselect and HANDLER in MySQL-4.1

am 10.01.2003 14:13:00 von Sinisa Milivojevic

Jocelyn Fournier writes:
> Hi,
>
> How-to-repeat :
>
> CREATE TABLE t1 (a int, KEY(a));
> HANDLER t1 OPEN;
> HANDLER t1 READ a=((SELECT 1));
> ERROR 2013: Lost connection to MySQL server during query
>
> Stack trace :
>

[skip]

>
> Regards,
> Jocelyn

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

This is a patch:

===== sql/sql_yacc.yy 1.218 vs 1.219 =====
*** /tmp/sql_yacc.yy-1.218-21816 Thu Jan 9 13:37:57 2003
--- 1.219/sql/sql_yacc.yy Thu Jan 9 22:17:11 2003
***************
*** 4578,4583 ****
--- 4584,4595 ----
subselect_start:
'(' SELECT_SYM
{
+ LEX *lex=Lex;
+ if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
+ lex->sql_command <= (int)SQLCOM_HA_READ) || lex->sql_command == (int)SQLCOM_KILL) {
+ send_error(lex->thd, ER_SYNTAX_ERROR);
+ YYABORT;
+ }
if (mysql_new_select(Lex, 1))
YYABORT;
};


--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / 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-thread13448@lists.mysql.com
To unsubscribe, e-mail