~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to sql/sql_base.cc

  • Committer: sasha at sashanet
  • Date: 2001-04-11 02:56:54 UTC
  • mto: This revision was merged to the branch mainline in revision 671.
  • Revision ID: sp1r-sasha@mysql.sashanet.com-20010411025654-39177
do not log the drop internal temporary tables into the binary log
mark killed partially completed updates with an error code in binlog
stop replication if the master reports a possible partial/killed update
test partially killed update

Show diffs side-by-side

added added

removed removed

Lines of Context:
497
497
  TABLE *table,*next;
498
498
  uint init_query_buf_size = 11, query_buf_size; // "drop table "
499
499
  char* query, *p;
 
500
  bool found_user_tables = 0;
 
501
  
500
502
  LINT_INIT(p);
501
503
  query_buf_size = init_query_buf_size;
502
504
 
503
505
  for (table=thd->temporary_tables ; table ; table=table->next)
504
506
  {
505
507
    query_buf_size += table->key_length;
506
 
 
507
508
  }
508
509
 
509
510
  if(query_buf_size == init_query_buf_size)
519
520
  {
520
521
    if(query) // we might be out of memory, but this is not fatal
521
522
      {
522
 
        p = strxmov(p,table->table_cache_key,".",
 
523
        // skip temporary tables not created directly by the user
 
524
        if(table->table_name[0] != '#')
 
525
          {
 
526
            p = strxmov(p,table->table_cache_key,".",
523
527
                    table->table_name,",", NullS);
524
 
        // here we assume table_cache_key always starts
525
 
        // with \0 terminated db name
 
528
            // here we assume table_cache_key always starts
 
529
            // with \0 terminated db name
 
530
            found_user_tables = 1;
 
531
          }
526
532
      }
527
533
    next=table->next;
528
534
    close_temporary(table);
529
535
  }
530
 
  if (query && mysql_bin_log.is_open())
 
536
  if (query && found_user_tables && mysql_bin_log.is_open())
531
537
  {
532
538
    uint save_query_len = thd->query_length;
533
539
    *--p = 0;