~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_delete.cc

  • Committer: Brian Aker
  • Date: 2008-11-11 04:33:12 UTC
  • Revision ID: brian@gir-3.local-20081111043312-3ohwkryi7k10lr4z
Second pass through on replication row patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
      - We should not be binlogging this statement row-based, and
122
122
      - there should be no delete triggers associated with the table.
123
123
  */
124
 
  if (!using_limit && const_cond_result &&
125
 
      (session->lex->sql_command == SQLCOM_TRUNCATE ||
126
 
       (!session->current_stmt_binlog_row_based)))
 
124
  if (!using_limit && const_cond_result)
127
125
  {
128
126
    /* Update the table->file->stats.records number */
129
127
    table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
927
925
  session->options&= ~(OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT);
928
926
  ha_enable_transaction(session, false);
929
927
  mysql_init_select(session->lex);
930
 
  bool save_binlog_row_based= session->current_stmt_binlog_row_based;
931
 
  session->clear_current_stmt_binlog_row_based();
932
928
  error= mysql_delete(session, table_list, (COND*) 0, (SQL_LIST*) 0,
933
929
                      HA_POS_ERROR, 0L, true);
934
930
  ha_enable_transaction(session, true);
939
935
  error= ha_autocommit_or_rollback(session, error);
940
936
  ha_commit(session);
941
937
  session->options= save_options;
942
 
  session->current_stmt_binlog_row_based= save_binlog_row_based;
943
938
  return(error);
944
939
}