List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:August 29 1999 12:07pm
Subject:Lost connection to MySQL server during query
View as plain text  
>>>>> "Nick" == Nick Pasich <npasich@stripped> writes:

Nick> I am running MySql 3.23.2-alpha and noticed that the following query causes:

Nick>     "ERROR 2013 at line 2: Lost connection to MySQL server during query"
Nick>     Number of processes running now: 2
Nick>     mysqld proces hanging, pid 13078 - killed

Nick> The same query using MySql 3.22.24 has no problems at all...............

Nick> If I remove either of the following, it runs fine:

Nick> 	"FROM_DAYS( TO_DAYS( CURDATE() ) - 30 )"

Nick> 	"ORDER BY hBPHONE" 

<cut>

Hi!

The problem was with optimization of constant items.

Here is a patch for this:

(/my/monty/sql) diff -c /tmp/sql_select.cc .
*** /tmp/sql_select.cc  Sun Aug 29 15:02:48 1999
--- ./sql_select.cc     Sun Aug 29 15:05:33 1999
***************
*** 5452,5459 ****
      }
      else if (item->with_sum_func)
        continue;
!     else if (item->type() == Item::FUNC_ITEM
!            || item->type() == Item::COND_ITEM)
      {                                         /* All funcs are stored */
  #ifdef DELETE_ITEMS
        delete it.replace(new Item_field(((Item_func*) item)->result_field));
--- 5452,5460 ----
      }
      else if (item->with_sum_func)
        continue;
!     else if ((item->type() == Item::FUNC_ITEM ||
!             item->type() == Item::COND_ITEM) &&
!            !item->const_item())
      {                                         /* All funcs are stored */
  #ifdef DELETE_ITEMS
        delete it.replace(new Item_field(((Item_func*) item)->result_field));

Regards,
Monty
Thread
Lost connection to MySQL server during queryNick Pasich12 Aug
  • Re: Lost connection to MySQL server during queryTonu Samuel12 Aug
  • Lost connection to MySQL server during queryMichael Widenius29 Aug