~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_schema.cc

merged with up to date trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems
 
4
 *  Copyright (C) 2009 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
45
45
 
46
46
  if (not check_db_name(session, schema_identifier))
47
47
  {
48
 
    std::string path;
49
 
    schema_identifier.getSQLPath(path);
50
 
    my_error(ER_WRONG_DB_NAME, MYF(0), path.c_str());
 
48
    my_error(ER_WRONG_DB_NAME, schema_identifier);
51
49
 
52
50
    return false;
53
51
  }
55
53
  SchemaIdentifier identifier(db->str);
56
54
  if (not plugin::StorageEngine::getSchemaDefinition(identifier, old_definition))
57
55
  {
58
 
    my_error(ER_SCHEMA_DOES_NOT_EXIST, MYF(0), db->str);
 
56
    my_error(ER_SCHEMA_DOES_NOT_EXIST, identifier); 
59
57
    return true;
60
58
  }
61
59
 
85
83
  
86
84
  drizzled::message::update(schema_message);
87
85
 
88
 
  bool res= mysql_alter_db(session, schema_message);
 
86
  bool res= alter_db(session, schema_message);
89
87
 
90
88
  return not res;
91
89
}