~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.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:
355
355
  bool some_tables_deleted=0, tmp_table_deleted=0, foreign_key_error=0;
356
356
  String built_query;
357
357
 
358
 
  if (session->current_stmt_binlog_row_based && !dont_log_query)
 
358
  if (!dont_log_query)
359
359
  {
360
360
    built_query.set_charset(system_charset_info);
361
361
    if (if_exists)
419
419
      being built.  The string always end in a comma and the comma
420
420
      will be chopped off before being written to the binary log.
421
421
      */
422
 
    if (session->current_stmt_binlog_row_based && !dont_log_query)
 
422
    if (!dont_log_query)
423
423
    {
424
424
      non_temp_tables_count++;
425
425
      /*
541
541
  {
542
542
    if (!dont_log_query)
543
543
    {
544
 
      if (!session->current_stmt_binlog_row_based ||
545
 
          (non_temp_tables_count > 0 && !tmp_table_deleted))
 
544
      if ((non_temp_tables_count > 0 && !tmp_table_deleted))
546
545
      {
547
546
        /*
548
547
          In this case, we are either using statement-based
553
552
         */
554
553
        write_bin_log(session, !error, session->query, session->query_length);
555
554
      }
556
 
      else if (session->current_stmt_binlog_row_based &&
557
 
               non_temp_tables_count > 0 &&
 
555
      else if (non_temp_tables_count > 0 &&
558
556
               tmp_table_deleted)
559
557
      {
560
558
        /*
1898
1896
    Otherwise, the statement shall be binlogged.
1899
1897
   */
1900
1898
  if (!internal_tmp_table &&
1901
 
      (!session->current_stmt_binlog_row_based ||
1902
 
       (session->current_stmt_binlog_row_based &&
1903
 
        !(create_info->options & HA_LEX_CREATE_TMP_TABLE))))
 
1899
      ((!(create_info->options & HA_LEX_CREATE_TMP_TABLE))))
1904
1900
    write_bin_log(session, true, session->query, session->query_length);
1905
1901
  error= false;
1906
1902
unlock_and_end:
3023
3019
  /*
3024
3020
    We have to write the query before we unlock the tables.
3025
3021
  */
3026
 
  if (session->current_stmt_binlog_row_based)
3027
3022
  {
3028
3023
    /*
3029
3024
       Since temporary tables are not replicated under row-based
3077
3072
      Case 3 and 4 does nothing under RBR
3078
3073
    */
3079
3074
  }
3080
 
  else
3081
 
    write_bin_log(session, true, session->query, session->query_length);
3082
3075
 
3083
3076
  res= false;
3084
3077
  goto err;
4885
4878
    /* Should pass the 'new_name' as we store table name in the cache */
4886
4879
    if (rename_temporary_table(session, new_table, new_db, new_name))
4887
4880
      goto err1;
4888
 
    /* We don't replicate alter table statement on temporary tables */
4889
 
    if (!session->current_stmt_binlog_row_based)
4890
 
      write_bin_log(session, true, session->query, session->query_length);
4891
4881
    goto end_temporary;
4892
4882
  }
4893
4883
 
4988
4978
  session->set_proc_info("end");
4989
4979
 
4990
4980
  assert(!(mysql_bin_log.is_open() &&
4991
 
                session->current_stmt_binlog_row_based &&
4992
4981
                (create_info->options & HA_LEX_CREATE_TMP_TABLE)));
4993
4982
  write_bin_log(session, true, session->query, session->query_length);
4994
4983