Crash with UNION and derived table in MySQL-4.1

Crash with UNION and derived table in MySQL-4.1

am 17.12.2002 17:41:17 von Jocelyn Fournier

Hi,

How-to-repeat :

SELECT * FROM (SELECT 1 UNION SELECT a) b;
ERROR 2013: Lost connection to MySQL server during query

Stack trace :

0x80ae5c9 handle_segfault + 681
0x8295298 pthread_sighandler + 176
0x80d28ca find_field_in_table(THD*, st_table*, char const*, unsigned, bool,
bool) + 26
0x80d2d31 find_field_in_tables(THD*, Item_ident*, st_table_list*, bool) +
817
0x804cc2a Item_field::fix_fields(THD*, st_table_list*, Item**) + 458
0x80d3068 setup_fields(THD*, st_table_list*, List&, bool, List*,
bool) + 152
0x80d7b2a JOIN::prepare(st_table_list*, Item*, st_order*, st_order*, Item*,
st_order*, st_select_lex*, st_select_lex_unit*, bool) + 186
0x814611b st_select_lex_unit::prepare(THD*, select_result*) + 1115
0x81458e2 mysql_union(THD*, st_lex*, select_result*, st_select_lex_unit*) +
34
0x8146af1 mysql_derived(THD*, st_lex*, st_select_lex_unit*, st_table_list*)
+ 817
0x80bed25 mysql_execute_command(THD*) + 15973
0x80bf9e8 mysql_parse(THD*, char*, unsigned) + 248
0x80b9e7d dispatch_command(enum_server_command, THD*, char*, unsigned) + 925
0x80b9ac6 do_command(THD*) + 118
0x80b9397 handle_one_connection + 855
0x8292cba pthread_start_thread + 218
0x82c6b9a 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-thread13310@lists.mysql.com
To unsubscribe, e-mail

Re: Crash with UNION and derived table in MySQL-4.1

am 17.12.2002 18:53:55 von Sinisa Milivojevic

Jocelyn Fournier writes:
> Hi,
>
> How-to-repeat :
>
> SELECT * FROM (SELECT 1 UNION SELECT a) b;
> ERROR 2013: Lost connection to MySQL server during query
>
> Stack trace :
>

[skip]

>
> Regards,
> Jocelyn

Thank you for your bug report which helped us fix a bug.

This is a patch:

===== sql_base.cc 1.142 vs edited =====
*** /tmp/sql_base.cc-1.142-15184 Wed Dec 11 09:17:47 2002
--- edited/sql_base.cc Tue Dec 17 19:42:36 2002
***************
*** 1735,1740 ****
--- 1735,1748 ----
bool allow_rowid= tables && !tables->next; // Only one table
for (; tables ; tables=tables->next)
{
+ if (!tables->table)
+ {
+ if (report_error)
+ my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MY F(0),
+ item->full_name(),thd->where);
+ return (Field*) not_found_field;
+ }
+
Field *field=find_field_in_table(thd,tables->table,name,length,
grant_option &&
!thd->master_access, allow_rowid);


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