~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/schema_engine.cc

  • Committer: Olaf van der Spek
  • Date: 2011-03-23 14:35:15 UTC
  • mto: (2247.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2248.
  • Revision ID: olafvdspek@gmail.com-20110323143515-p4tn90h1ipnr7rgx
Refactor Identifier::getSQLPath()

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
 
117
117
const CHARSET_INFO *StorageEngine::getSchemaCollation(const identifier::Schema &identifier)
118
118
{
119
 
  message::schema::shared_ptr schmema_proto;
120
 
 
121
 
  schmema_proto= StorageEngine::getSchemaDefinition(identifier);
122
 
 
123
 
  if (schmema_proto && schmema_proto->has_collation())
124
 
  {
125
 
    const std::string buffer= schmema_proto->collation();
126
 
    const CHARSET_INFO* cs= get_charset_by_name(buffer.c_str());
127
 
 
128
 
    if (not cs)
129
 
    {
130
 
      std::string path;
131
 
      identifier.getSQLPath(path);
132
 
 
133
 
      errmsg_printf(error::ERROR,
134
 
                    _("Error while loading database options: '%s':"), path.c_str());
135
 
      errmsg_printf(error::ERROR, ER(ER_UNKNOWN_COLLATION), buffer.c_str());
136
 
 
137
 
      return default_charset_info;
138
 
    }
139
 
 
140
 
    return cs;
141
 
  }
142
 
 
 
119
  message::schema::shared_ptr schmema_proto= StorageEngine::getSchemaDefinition(identifier);
 
120
  if (not schmema_proto || not schmema_proto->has_collation())
 
121
                return default_charset_info;
 
122
  const std::string buffer= schmema_proto->collation();
 
123
  if (const CHARSET_INFO* cs= get_charset_by_name(buffer.c_str()))
 
124
                return cs;
 
125
  errmsg_printf(error::ERROR, _("Error while loading database options: '%s':"), identifier.getSQLPath().c_str());
 
126
  errmsg_printf(error::ERROR, ER(ER_UNKNOWN_COLLATION), buffer.c_str());
143
127
  return default_charset_info;
144
128
}
145
129