Bug #320 | Crash with stored procedure and derived table | ||
---|---|---|---|
Submitted: | 23 Apr 2003 16:36 | Modified: | 23 Aug 2003 12:08 |
Reporter: | jocelyn fournier (Silver Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S1 (Critical) |
Version: | 5.0 | OS: | Any (all) |
Assigned to: | CPU Architecture: | Any |
[23 Apr 2003 16:36]
jocelyn fournier
[24 Apr 2003 10:14]
MySQL Verification Team
There are two ways of doing it. First one is to add this into sp.cc : ===== sql/sp.cc 1.8 vs edited ===== *** /tmp/sp.cc-1.8-17796 Sun Mar 2 20:17:39 2003 --- edited/sql/sp.cc Thu Apr 24 18:14:18 2003 *************** *** 105,111 **** } if (opened) { ! close_thread_tables(thd); table= NULL; } --- 105,111 ---- } if (opened) { ! close_thread_tables(thd,0,1); table= NULL; } But this is not enough. Then, more code has to be added to: // list creator bool st_select_lex_unit::create_total_list_n_last_return(THD *thd, st_lex *lex, TABLE_LIST ***result, in sql_lex.cc. Particularly here: if ((aux= (TABLE_LIST*) sl->table_list.first)) { It should be changed that if aux is 0, which is case with SP, that table_list is allocated and derived table linked in properly.. Second way: Ban derived tables from SP definitions.
[2 Jun 2003 11:09]
MySQL Verification Team
This is fixed in BK 5.0 tree.