~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 16:47:01 UTC
  • mfrom: (1014.3.4 merge)
  • Revision ID: brian@gaz-20090514164701-l58qmp3mqo6et160
Merging Brian's work.

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,
3011
3004
        }
3012
3005
        pthread_mutex_unlock(&LOCK_open);
3013
3006
 
3014
 
        int result= store_create_info(session, table, &query,
3015
 
                                               create_info);
 
3007
        int result= store_create_info(table, &query, create_info);
3016
3008
 
3017
3009
        assert(result == 0); // store_create_info() always return 0
3018
3010
        write_bin_log(session, true, query.ptr(), query.length());
4008
4000
  if (mysql_prepare_alter_table(session, table, create_info, alter_info))
4009
4001
      goto err;
4010
4002
 
4011
 
  set_table_default_charset(session, create_info, db);
 
4003
  set_table_default_charset(create_info, db);
4012
4004
 
4013
4005
  alter_info->build_method= HA_BUILD_OFFLINE;
4014
4006