~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Stewart Smith
  • Date: 2009-02-02 04:55:56 UTC
  • mto: (859.1.1 nofrm)
  • mto: This revision was merged to the branch mainline in revision 822.
  • Revision ID: stewart@flamingspork.com-20090202045556-mwmdwi60el6a371r
re-introduce db.opt, but with parsing it from disk instead of in process cache with mutex.

Write db.opt safely (temp file, rename).

LOCK_drizzle_create_db can likely easily go now.

schema.proto: remove charset as it is standard, we only care about collation.

We don't change the epic fail that is the lack of error checking in show.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
                          HA_CREATE_INFO *create_info,
79
79
                          Alter_info *alter_info);
80
80
 
 
81
static void set_table_default_charset(Session *session,
 
82
                                      HA_CREATE_INFO *create_info, char *db)
 
83
{
 
84
  /*
 
85
    If the table character set was not given explicitly,
 
86
    let's fetch the database default character set and
 
87
    apply it to the table.
 
88
  */
 
89
  if (!create_info->default_table_charset)
 
90
  {
 
91
    HA_CREATE_INFO db_info;
 
92
 
 
93
    load_db_opt_by_name(session, db, &db_info);
 
94
 
 
95
    create_info->default_table_charset= db_info.default_table_charset;
 
96
  }
 
97
}
 
98
 
81
99
/*
82
100
  Translate a file name to a table name (WL #1324).
83
101
 
1746
1764
    return(true);
1747
1765
  }
1748
1766
 
1749
 
  if (!create_info->default_table_charset)
1750
 
  {
1751
 
    create_info->default_table_charset= system_charset_info;
1752
 
  }
 
1767
  set_table_default_charset(session, create_info, (char*) db);
1753
1768
 
1754
1769
  if (mysql_prepare_create_table(session, create_info, alter_info,
1755
1770
                                 internal_tmp_table,
4651
4666
  if (mysql_prepare_alter_table(session, table, create_info, alter_info))
4652
4667
      goto err;
4653
4668
 
4654
 
  if (!create_info->default_table_charset)
4655
 
  {
4656
 
    create_info->default_table_charset= system_charset_info;
4657
 
  }
 
4669
  set_table_default_charset(session, create_info, db);
4658
4670
 
4659
4671
  if (session->variables.old_alter_table
4660
4672
      || (table->s->db_type() != create_info->db_type)