~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_schema.h

  • Committer: Patrick Galbraith
  • Date: 2009-10-08 22:42:05 UTC
  • mto: (1166.5.3 memcached_functions)
  • mto: This revision was merged to the branch mainline in revision 1189.
  • Revision ID: patg@patrick-galbraiths-macbook-pro.local-20091008224205-gq1pehjsivvx0qo9
Starting over with a fresh tree, moved in memcached functions.

Memcached Functions for Drizzle. 

All tests pass.

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 */