~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_schema.cc

  • Committer: Lee Bieber
  • Date: 2010-01-30 23:42:02 UTC
  • mto: This revision was merged to the branch mainline in revision 1282.
  • Revision ID: lbieber@lee-biebers-macbook-pro.local-20100130234202-sxmqfteqwiq15ptg
add target to japanese tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
bool statement::CreateSchema::execute()
35
35
{
36
 
  if (not session->endActiveTransaction())
 
36
  if (! session->endActiveTransaction())
37
37
  {
38
38
    return true;
39
39
  }
40
 
 
41
 
  SchemaIdentifier schema_identifier(string(session->lex->name.str, session->lex->name.length));
42
 
  if (not check_db_name(schema_identifier))
 
40
  char *alias= session->strmake(session->lex->name.str,
 
41
                                session->lex->name.length);
 
42
  if (! alias ||
 
43
      check_db_name(&session->lex->name))
43
44
  {
44
 
    my_error(ER_WRONG_DB_NAME, MYF(0), schema_identifier.getSQLPath().c_str());
 
45
    my_error(ER_WRONG_DB_NAME, MYF(0), session->lex->name.str);
45
46
    return false;
46
47
  }
47
48
 
48
 
  schema_message.set_name(session->lex->name.str);
49
 
  if (not schema_message.has_collation())
50
 
  {
51
 
    schema_message.set_collation(default_charset_info->name);
52
 
  }
53
 
 
54
 
  bool res= mysql_create_db(session, schema_message, is_if_not_exists);
55
 
  return not res;
 
49
  bool res= mysql_create_db(session, session->lex->name.str, &schema_message, is_if_not_exists);
 
50
  return res;
56
51
}
57
52
 
58
53
} /* namespace drizzled */