Bug #2108 | Server crash when subquery uses 'limit' clause on InnoDB tables | ||
---|---|---|---|
Submitted: | 13 Dec 2003 12:39 | Modified: | 14 Dec 2003 12:52 |
Reporter: | Igor Blagodetelev | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.1.1 | OS: | Linux (Slackware 9.1/Suse 8.2/Windows X) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[13 Dec 2003 12:39]
Igor Blagodetelev
[13 Dec 2003 13:18]
MySQL Verification Team
Thank you for the bug report I was able to repeat: Local of the crash: /innobase/include/read0read.ic ~~39~~ /************************************************************************* Checks if a read view sees the specified transaction. */ UNIV_INLINE ibool read_view_sees_trx_id( /*==================*/ /* out: TRUE if sees */ read_view_t* view, /* in: read view */ dulint trx_id) /* in: trx id */ { ulint n_ids; int cmp; ulint i; if (ut_dulint_cmp(trx_id, view->up_limit_id) < 0) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ CRASH HAPPENS HERE return(TRUE); } Below call stack on Windows: mysqld.exe!read_view_sees_trx_id(read_view_struct * view=0x00000000, dulint_struct trx_id={...}) Line 53 + 0x3 C mysqld.exe!lock_clust_rec_cons_read_sees(unsigned char * rec=0x0256c1b3, dict_index_struct * index=0x024370a0, read_view_struct * view=0x00000000) Line 584 + 0x11 C mysqld.exe!row_search_for_mysql(unsigned char * buf=0x0163f740, unsigned long mode=1, row_prebuilt_struct * prebuilt=0x024350a0, unsigned long match_mode=0, unsigned long direction=1) Line 3298 + 0x23 C mysqld.exe!ha_innobase::general_fetch(unsigned char * buf=0x0163f740, unsigned int direction=1, unsigned int match_mode=0) Line 2918 + 0x17 C++ mysqld.exe!ha_innobase::rnd_next(unsigned char * buf=0x0163f740) Line 3117 + 0x10 C++ mysqld.exe!rr_sequential(st_read_record * info=0x036fba20) Line 173 + 0x18 C++ mysqld.exe!sub_select(JOIN * join=0x036fa2d0, st_join_table * join_tab=0x036fb9f8, int end_of_records=0) Line 5704 + 0xa C++ mysqld.exe!do_select(JOIN * join=0x036fa2d0, List<Item> * fields=0x036ef41c, st_table * table=0x00000000, Procedure * procedure=0x00000000) Line 5575 + 0xf C++ mysqld.exe!JOIN::exec() Line 1477 + 0x2d C++ mysqld.exe!mysql_select(THD * thd=0x036ef040, Item * * * rref_pointer_array= 0x036ef498, st_table_list * tables=0x036fa180, unsigned int wild_num=0, List<Item> & fields={...}, Item * conds=0x00000000, unsigned int og_num=0, st_order * order=0x00000000, st_order * group=0x00000000, Item * having=0x00000000, st_order * proc_param=0x00000000, unsigned long select_options=8669696, select_result * result=0x036fa2c0, st_select_lex_unit * unit=0x036ef2c4, st_select_lex * select_lex=0x036ef3b0) Line 1603 C++ mysqld.exe!handle_select(THD * thd=0x036ef040, st_lex * lex=0x036ef2b8, select_result * result=0x036fa2c0) Line 193 + 0x89 C++ mysqld.exe!mysql_execute_command(THD * thd=0x036ef040) Line 1916 + 0x11 C++ mysqld.exe!mysql_parse(THD * thd=0x036ef040, char * inBuf=0x036f9cf8, unsigned int length=49) Line 3927 + 0x9 C++ mysqld.exe!dispatch_command(enum_server_command command=COM_QUERY, THD * thd=0x036ef040, char * packet=0x036f5c81, unsigned int packet_length=50) Line 1387 + 0x1d C++ mysqld.exe!do_command(THD * thd=0x036ef040) Line 1217 + 0x31 C++ mysqld.exe!handle_one_connection(void * arg=0x036ef040) Line 979 + 0x9 C++ mysqld.exe!pthread_start(void * param=0x036f2758) Line 63 + 0x7 C mysqld.exe!_threadstart(void * ptd=0x036fced0) Line 173 + 0xd C kernel32.dll!77e6d33b()
[14 Dec 2003 10:02]
Heikki Tuuri
Hi! Looks like yet another bug where MySQL releases the table lock too early and the transaction gets committed inside InnoDB too early. Sanja knows how to fix these. Regards, Heikki
[14 Dec 2003 12:52]
Oleksandr Byelkin
Thank you for bug report! This bug has same cause as bug#2048, you can track progress of fixing of this bug loking on http://bugs.mysql.com/bug.php?id=2048. I have checked your test case, it work good with fix of bug#2048.