-
Yuchen Pei authored
When spider_db_delete_all_rows() is called, the supplied spider->conns may have already been freed. The existing mechanism has spider_trx own the connections in trx_conn_hash and it may free a conn during the cleanup after a query. When running a delete query and if the table is in the table cache, ha_spider::open() would not be called which would recreate the conn. So we recreate the conn when necessary during delete by calling spider_check_trx_and_get_conn(). We also reduce code duplication as delete_all_rows() and truncate() has almost identical code, and there's no need to assign wide_handler->sql_command in these functions because it has already been correctly assigned.
2556fe1a