~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_schema.h

  • Committer: Brian Aker
  • Date: 2009-10-15 00:22:33 UTC
  • mto: (1183.1.11 merge)
  • mto: This revision was merged to the branch mainline in revision 1198.
  • Revision ID: brian@gaz-20091015002233-fa4ao2mbc67wls91
First pass of information engine. OMG, ponies... is it so much easier to
deal with creating and engine.

The list table iterator though... its ass, needs to go. We should also
abstract out share. Very few engines need a custom one. Just say'in

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#define DRIZZLED_STATEMENT_CREATE_SCHEMA_H
23
23
 
24
24
#include <drizzled/statement.h>
25
 
#include <drizzled/message/schema.pb.h>
26
 
#include <uuid/uuid.h>
 
25
 
 
26
class Session;
27
27
 
28
28
namespace drizzled
29
29
{
30
 
class Session;
31
 
 
32
30
namespace statement
33
31
{
34
32
 
35
33
class CreateSchema : public Statement
36
34
{
37
 
  bool check(const SchemaIdentifier &identifier);
38
 
 
39
35
public:
40
 
  CreateSchema(Session *in_session) :
41
 
    Statement(in_session),
42
 
    is_if_not_exists(false)
 
36
  CreateSchema(Session *in_session)
 
37
    :
 
38
      Statement(in_session)
43
39
  {
44
 
    schema_message.set_creation_timestamp(time(NULL));
45
 
    schema_message.set_update_timestamp(time(NULL));
46
 
 
47
 
    /* 36 characters for uuid string +1 for NULL */
48
 
    uuid_t uu;
49
 
    char uuid_string[37];
50
 
    uuid_generate_random(uu);
51
 
    uuid_unparse(uu, uuid_string);
52
 
    schema_message.set_uuid(uuid_string, 36);
53
 
 
54
 
    schema_message.set_version(1);
 
40
    memset(&create_info, 0, sizeof(create_info));
55
41
  }
56
42
 
57
43
  bool execute();
58
 
  bool is_if_not_exists;
59
 
  message::Schema schema_message;
60
 
 
61
 
  bool validateSchemaOptions();
 
44
  HA_CREATE_INFO create_info;
62
45
};
63
46
 
64
47
} /* end namespace statement */