-
Praveenkumar Hulakund authored
Attempt to access TABLE instance when open table (to obtain statistics) fails because of KILL query or connection operation resulted in the issue reported. For the non-innodb tables, its statistics is obtained by opening the table. Current code assumes that when open table fails then Diagnostics_area is always set with an error. If Diagnostics_area is not set then open table success condition code is executed. This works well when table open fails because of the error. Open table fails even when query or connections is killed. In this case Diagnostics_area might not be set. In such scenario, attempt access TABLE instance from the pointer in TABLE_LIST resulted in the crash. To fix the issue, the failures from open_tables() is handled irrespective of whether the diagnostics area is set. If we find error being reported in diagnostics area, we write it to comment field as we do now. If we do not find a error reported, then we just make the UDF return failure. The query is later terminated by call to send_kill_message() when we check thd->killed flag.
Praveenkumar Hulakund authoredAttempt to access TABLE instance when open table (to obtain statistics) fails because of KILL query or connection operation resulted in the issue reported. For the non-innodb tables, its statistics is obtained by opening the table. Current code assumes that when open table fails then Diagnostics_area is always set with an error. If Diagnostics_area is not set then open table success condition code is executed. This works well when table open fails because of the error. Open table fails even when query or connections is killed. In this case Diagnostics_area might not be set. In such scenario, attempt access TABLE instance from the pointer in TABLE_LIST resulted in the crash. To fix the issue, the failures from open_tables() is handled irrespective of whether the diagnostics area is set. If we find error being reported in diagnostics area, we write it to comment field as we do now. If we do not find a error reported, then we just make the UDF return failure. The query is later terminated by call to send_kill_message() when we check thd->killed flag.
Loading