~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Mark Atwood
  • Date: 2011-11-08 19:06:32 UTC
  • mfrom: (2445.1.22 rf)
  • Revision ID: me@mark.atwood.name-20111108190632-7pfvz4ggbolmlnnu
mergeĀ lp:~olafvdspek/drizzle/refactor10

Show diffs side-by-side

added added

removed removed

Lines of Context:
7846
7846
  mutex_enter(&(dict_sys->mutex));
7847
7847
  dict_foreign_t* foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
7848
7848
 
7849
 
  while (foreign != NULL) {
7850
 
 
 
7849
  while (foreign != NULL) 
 
7850
  {
7851
7851
    uint ulen;
7852
7852
    char uname[NAME_LEN + 1];           /* Unencoded name */
7853
7853
    char db_name[NAME_LEN + 1];
7890
7890
        break;
7891
7891
    }
7892
7892
 
7893
 
    ulong length;
7894
7893
    if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE)
7895
 
    {
7896
 
      length=7;
7897
7894
      tmp_buff= "CASCADE";
7898
 
    }
7899
7895
    else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
7900
 
    {
7901
 
      length=8;
7902
7896
      tmp_buff= "SET NULL";
7903
 
    }
7904
7897
    else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION)
7905
 
    {
7906
 
      length=9;
7907
7898
      tmp_buff= "NO ACTION";
7908
 
    }
7909
7899
    else
7910
 
    {
7911
 
      length=8;
7912
7900
      tmp_buff= "RESTRICT";
7913
 
    }
7914
 
    lex_string_t *tmp_delete_method = session->make_lex_string(NULL, str_ref(tmp_buff, length));
7915
 
 
 
7901
    lex_string_t *tmp_delete_method = session->make_lex_string(NULL, str_ref(tmp_buff));
7916
7902
 
7917
7903
    if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
7918
 
    {
7919
 
      length=7;
7920
7904
      tmp_buff= "CASCADE";
7921
 
    }
7922
7905
    else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)
7923
 
    {
7924
 
      length=8;
7925
7906
      tmp_buff= "SET NULL";
7926
 
    }
7927
7907
    else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION)
7928
 
    {
7929
 
      length=9;
7930
7908
      tmp_buff= "NO ACTION";
7931
 
    }
7932
7909
    else
7933
 
    {
7934
 
      length=8;
7935
7910
      tmp_buff= "RESTRICT";
7936
 
    }
7937
 
    lex_string_t *tmp_update_method = session->make_lex_string(NULL, str_ref(tmp_buff, length));
7938
 
 
7939
 
    lex_string_t *tmp_referenced_key_name = NULL;
7940
 
 
7941
 
    if (foreign->referenced_index && foreign->referenced_index->name)
7942
 
    {
7943
 
      tmp_referenced_key_name = session->make_lex_string(NULL, str_ref(foreign->referenced_index->name));
7944
 
    }
 
7911
    lex_string_t *tmp_update_method = session->make_lex_string(NULL, str_ref(tmp_buff));
 
7912
 
 
7913
    lex_string_t *tmp_referenced_key_name = foreign->referenced_index && foreign->referenced_index->name
 
7914
      ? session->make_lex_string(NULL, str_ref(foreign->referenced_index->name))
 
7915
      : NULL;
7945
7916
 
7946
7917
    ForeignKeyInfo f_key_info(
7947
 
                              tmp_foreign_id, tmp_referenced_db, tmp_referenced_table,
7948
 
                              tmp_update_method, tmp_delete_method, tmp_referenced_key_name,
7949
 
                              tmp_foreign_fields, tmp_referenced_fields);
 
7918
      tmp_foreign_id, tmp_referenced_db, tmp_referenced_table,
 
7919
      tmp_update_method, tmp_delete_method, tmp_referenced_key_name,
 
7920
      tmp_foreign_fields, tmp_referenced_fields);
7950
7921
 
7951
7922
    f_key_list->push_back((ForeignKeyInfo*)session->mem.memdup(&f_key_info, sizeof(ForeignKeyInfo)));
7952
7923
    foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
7954
7925
  mutex_exit(&(dict_sys->mutex));
7955
7926
  prebuilt->trx->op_info = "";
7956
7927
 
7957
 
  return(0);
 
7928
  return 0;
7958
7929
}
7959
7930
 
7960
7931
/*****************************************************************//**