Comment 0 for bug 1343209

Revision history for this message
Ben Mildren (ben-mildren) wrote :

pt-table-checksum uses REPLACE ... SELECT to create a checksum of chunks of data, I believe the wsrep_consistency_check was introduced to ensure the isolation would support this process, however it looks like the wsrep_consistency_check is only handled on SQLCOM_INSERT_SELECT and not SQLCOM_REPLACE_SELECT.

modified sql_parse.cc:
#ifdef WITH_WSREP
    if (lex->sql_command == SQLCOM_INSERT_SELECT &&
 thd->wsrep_consistency_check == CONSISTENCY_CHECK_DECLARED)
    {
      thd->wsrep_consistency_check = CONSISTENCY_CHECK_RUNNING;
      WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL);
    }

....

    if (lex->sql_command == SQLCOM_REPLACE_SELECT)
      lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_REPLACE_SELECT);

pt-table-checksum code

   my $checksum_dml = "REPLACE INTO $repl_table "
                    . "(db, tbl, chunk, chunk_index,"
                    . " lower_boundary, upper_boundary, this_cnt, this_crc) "
                    . "SELECT"
                    . ($cluster->is_cluster_node($master_cxn) ? ' /*!99997*/' : '')
                    . " ?, ?, ?, ?, ?, ?,";