~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/sql_table.cc

  • Committer: Brian Aker
  • Date: 2008-07-11 00:33:12 UTC
  • mfrom: (51.1.83 remove-dbug)
  • Revision ID: brian@tangent.org-20080711003312-f4sf5n2z3obor1u8
Comming Jay's merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
                          HA_CREATE_INFO *create_info,
49
49
                          Alter_info *alter_info);
50
50
 
51
 
#ifndef DBUG_OFF
52
 
 
53
 
/* Wait until we get a 'mysql_kill' signal */
54
 
 
55
 
static void wait_for_kill_signal(THD *thd)
56
 
{
57
 
  while (thd->killed == 0)
58
 
    sleep(1);
59
 
  // Reset signal and continue as if nothing happend
60
 
  thd->killed= THD::NOT_KILLED;
61
 
}
62
 
#endif
63
 
 
64
 
 
65
51
/*
66
52
  Translate a file name to a table name (WL #1324).
67
53
 
74
60
  RETURN
75
61
    Table name length.
76
62
*/
77
 
 
78
63
uint filename_to_tablename(const char *from, char *to, uint to_length)
79
64
{
80
65
  uint errors;
3505
3490
                              RTFC_WAIT_OTHER_THREAD_FLAG |
3506
3491
                              RTFC_CHECK_KILLED_FLAG);
3507
3492
      thd->exit_cond(old_message);
3508
 
      DBUG_EXECUTE_IF("wait_in_mysql_admin_table", wait_for_kill_signal(thd););
3509
3493
      if (thd->killed)
3510
3494
        goto err;
3511
3495
      open_for_modify= 0;
3947
3931
 
3948
3932
  strxmov(src_path, src_table->table->s->path.str, reg_ext, NullS);
3949
3933
 
3950
 
  DBUG_EXECUTE_IF("sleep_create_like_before_check_if_exists", my_sleep(6000000););
3951
 
 
3952
3934
  /* 
3953
3935
    Check that destination tables does not exist. Note that its name
3954
3936
    was already checked when it was added to the table list.
3972
3954
      goto table_exists;
3973
3955
  }
3974
3956
 
3975
 
  DBUG_EXECUTE_IF("sleep_create_like_before_copy", my_sleep(6000000););
3976
 
 
3977
3957
  /*
3978
3958
    Create a new table by copying from source table
3979
3959
 
4011
3991
    creation, instead create the table directly (for both normal
4012
3992
    and temporary tables).
4013
3993
  */
4014
 
  DBUG_EXECUTE_IF("sleep_create_like_before_ha_create", my_sleep(6000000););
4015
 
 
4016
3994
  dst_path[dst_path_length - reg_ext_length]= '\0';  // Remove .frm
4017
3995
  if (thd->variables.keep_files_on_create)
4018
3996
    create_info->options|= HA_CREATE_KEEP_FILES;
4036
4014
    goto err;       /* purecov: inspected */
4037
4015
  }
4038
4016
 
4039
 
  DBUG_EXECUTE_IF("sleep_create_like_before_binlogging", my_sleep(6000000););
4040
 
 
4041
4017
  /*
4042
4018
    We have to write the query before we unlock the tables.
4043
4019
  */
5564
5540
      VOID(pthread_mutex_lock(&LOCK_open));
5565
5541
      wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
5566
5542
      VOID(pthread_mutex_unlock(&LOCK_open));
5567
 
      DBUG_EXECUTE_IF("sleep_alter_enable_indexes", my_sleep(6000000););
5568
5543
      error= table->file->ha_enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
5569
5544
      /* COND_refresh will be signaled in close_thread_tables() */
5570
5545
      break;