~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2009-05-14 08:35:31 UTC
  • mto: This revision was merged to the branch mainline in revision 1016.
  • Revision ID: brian@gaz-20090514083531-shers31p7s7zqldi
Simplify the calling stack for getting schema collation. We need to extend
this further by removing the schema collation from session (in order to
remove the need for a cache).

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
                          HA_CREATE_INFO *create_info,
80
80
                          Alter_info *alter_info);
81
81
 
82
 
static void set_table_default_charset(Session *session,
83
 
                                      HA_CREATE_INFO *create_info, char *db)
 
82
static void set_table_default_charset(HA_CREATE_INFO *create_info, char *db)
84
83
{
85
84
  /*
86
85
    If the table character set was not given explicitly,
87
86
    let's fetch the database default character set and
88
87
    apply it to the table.
89
88
  */
90
 
  if (!create_info->default_table_charset)
91
 
  {
92
 
    HA_CREATE_INFO db_info;
93
 
 
94
 
    load_db_opt_by_name(session, db, &db_info);
95
 
 
96
 
    create_info->default_table_charset= db_info.default_table_charset;
97
 
  }
 
89
  if (create_info->default_table_charset == NULL)
 
90
    create_info->default_table_charset= get_default_db_collation(db);
98
91
}
99
92
 
100
93
/*
1708
1701
    return(true);
1709
1702
  }
1710
1703
 
1711
 
  set_table_default_charset(session, create_info, (char*) db);
 
1704
  set_table_default_charset(create_info, (char*) db);
1712
1705
 
1713
1706
  if (mysql_prepare_create_table(session, create_info, alter_info,
1714
1707
                                 internal_tmp_table,
4007
4000
  if (mysql_prepare_alter_table(session, table, create_info, alter_info))
4008
4001
      goto err;
4009
4002
 
4010
 
  set_table_default_charset(session, create_info, db);
 
4003
  set_table_default_charset(create_info, db);
4011
4004
 
4012
4005
  alter_info->build_method= HA_BUILD_OFFLINE;
4013
4006