Crash in derived table with MySQL-4.1

Crash in derived table with MySQL-4.1

am 20.11.2002 10:08:52 von Jocelyn Fournier

Hi,

How-to-repeat :

CREATE TABLE `threadhardwarefr7` (
`numeropost` mediumint(8) unsigned NOT NULL default '0',
`numreponse` int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (`numeropost`,`numreponse`),
UNIQUE KEY `numreponse` (`numreponse`)
) TYPE=MyISAM;

SELECT (SELECT numeropost FROM threadhardwarefr7 HAVING
numreponse=a),numreponse FROM (SELECT * FROM threadhardwarefr7) as a;
ERROR 2013: Lost connection to MySQL server during query

Stack trace :

0x80a1f21 handle_segfault(int) + 481
0x82880e8 pthread_sighandler + 176
0x804bc69 Item_field::used_tables() const + 9
0x8051446 Item_ref::used_tables() const + 22
0x8057533 Item_func::fix_fields(THD*, st_table_list*, Item**) + 211
0x80c9582 JOIN::prepare(st_table_list*, Item*, st_order*, st_order*, Item*,
st_order*, st_select_lex*, st_select_lex_unit*, bool) + 514
0x808452d subselect_single_select_engine::prepare() + 157
0x8083c49 Item_subselect::fix_fields(THD*, st_table_list*, Item**) + 25
0x80c47a5 setup_fields(THD*, st_table_list*, List&, bool, List*,
bool) + 117
0x80c9449 JOIN::prepare(st_table_list*, Item*, st_order*, st_order*, Item*,
st_order*, st_select_lex*, st_select_lex_unit*, bool) + 201
0x80cb624 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*) + 436
0x80c9337 handle_select(THD*, st_lex*, select_result*) + 247
0x80ac2a5 mysql_execute_command(THD*) + 709
0x80b11a2 mysql_parse(THD*, char*, unsigned) + 146
0x80ab167 dispatch_command(enum_server_command, THD*, char*, unsigned) + 855
0x80aadf6 do_command(THD*) + 118
0x80aa6cf handle_one_connection(void*) + 895
0x828597a pthread_start_thread + 218
0x82b9e2a 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-thread13042@lists.mysql.com
To unsubscribe, e-mail

Re: Crash in derived table with MySQL-4.1

am 20.11.2002 11:11:05 von Sanja Byelkin

Hi!

On Thu, Nov 21, 2002 at 09:11:17AM -0000, Jocelyn Fournier wrote:
> Hi,
>
> How-to-repeat :
>
> CREATE TABLE `threadhardwarefr7` (
> `numeropost` mediumint(8) unsigned NOT NULL default '0',
> `numreponse` int(10) unsigned NOT NULL auto_increment,
> PRIMARY KEY (`numeropost`,`numreponse`),
> UNIQUE KEY `numreponse` (`numreponse`)
> ) TYPE=MyISAM;
>
> SELECT (SELECT numeropost FROM threadhardwarefr7 HAVING
> numreponse=a),numreponse FROM (SELECT * FROM threadhardwarefr7) as a;
> ERROR 2013: Lost connection to MySQL server during query

Thank you for bugreport. I will take care about it.

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

Re: Crash in derived table with MySQL-4.1

am 21.11.2002 10:13:20 von Sanja Byelkin

On Thu, Nov 21, 2002 at 09:11:17AM -0000, Jocelyn Fournier wrote:
> Hi,
>
> How-to-repeat :
>
> CREATE TABLE `threadhardwarefr7` (
> `numeropost` mediumint(8) unsigned NOT NULL default '0',
> `numreponse` int(10) unsigned NOT NULL auto_increment,
> PRIMARY KEY (`numeropost`,`numreponse`),
> UNIQUE KEY `numreponse` (`numreponse`)
> ) TYPE=MyISAM;
>
> SELECT (SELECT numeropost FROM threadhardwarefr7 HAVING
> numreponse=a),numreponse FROM (SELECT * FROM threadhardwarefr7) as a;
> ERROR 2013: Lost connection to MySQL server during query

Thank you for bugreport.

Cause of this error was reference on 'numreponse' which is not processed
(fix_fields) at the moment of processing this reference. I just forbid such
references, also I forbid references on group functions except having of
current select.

Yes. Above are limitations, but it is possible that will be more strict
limitations involved: to forbid any reference on alias of outer select
to prevent performance lost and resolve it only as fields names of outer
query. (BTW according to crash-me test only MySQL allow reference from having
on alias).

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