diff --git a/storage/tianchi/ha_tse.cc b/storage/tianchi/ha_tse.cc index 3c8989102fb6b89009838a14b611673b0499f4fb..837ed98ea1120f6a5f918a8f357b311ff2e737e4 100644 --- a/storage/tianchi/ha_tse.cc +++ b/storage/tianchi/ha_tse.cc @@ -3052,15 +3052,14 @@ int ha_tse::rnd_init(bool) { int ha_tse::rnd_next(uchar *buf) { DBUG_TRACE; - THD *thd = ha_thd(); - if (engine_ddl_passthru(thd) && (is_alter_table_copy(thd) || is_create_table_check(thd) || - is_alter_table_scan(m_error_if_not_empty))) { - return HA_ERR_END_OF_FILE; - } - ha_statistic_increment(&System_status_var::ha_read_rnd_next_count); if (!m_rec_buf || m_rec_buf->max_records() == 0) { + THD *thd = ha_thd(); + if (engine_ddl_passthru(thd) && (is_alter_table_copy(thd) || is_create_table_check(thd) || + is_alter_table_scan(m_error_if_not_empty))) { + return HA_ERR_END_OF_FILE; + } int ret = CT_SUCCESS; ct_errno_t ct_ret = CT_SUCCESS; uchar *tse_buf = m_tse_buf ? m_tse_buf : tse_alloc_buf(&m_tch, BIG_RECORD_SIZE_DYNAMIC);