~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/function_engine/function.cc

  • Committer: Brian Aker
  • Date: 2010-10-09 01:10:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1834.
  • Revision ID: brian@tangent.org-20101009011007-5feic882vup40xur
This switches our schema system over to using a shared ptr. Lets see how
this harms performance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                                  HTON_ALTER_NOT_SUPPORTED |
37
37
                                  HTON_HAS_SCHEMA_DICTIONARY |
38
38
                                  HTON_SKIP_STORE_LOCK |
39
 
                                  HTON_TEMPORARY_NOT_SUPPORTED)
 
39
                                  HTON_TEMPORARY_NOT_SUPPORTED),
 
40
  information_message(new(message::Schema)),
 
41
  data_dictionary_message(new(message::Schema))
 
42
 
40
43
{
 
44
#if 0
 
45
  information_message.reset(new(message::Schema));
 
46
  data_dictionary_message.reset(new(message::Schema));
 
47
#endif
 
48
 
 
49
  information_message->set_name("information_schema");
 
50
  data_dictionary_message->set_collation("utf8_general_ci");
 
51
 
 
52
  data_dictionary_message->set_name("data_dictionary");
 
53
  data_dictionary_message->set_collation("utf8_general_ci");
41
54
}
42
55
 
43
56
 
68
81
  schemas.push_back(DATA_DICTIONARY_IDENTIFIER);
69
82
}
70
83
 
71
 
bool Function::doGetSchemaDefinition(const SchemaIdentifier &schema_identifier, message::Schema &schema_message)
 
84
bool Function::doGetSchemaDefinition(const SchemaIdentifier &schema_identifier, message::SchemaPtr &schema_message)
72
85
{
 
86
  schema_message.reset(new message::Schema); // This should be fixed, we could just be using ones we built on startup.
 
87
 
73
88
  if (schema_identifier == INFORMATION_SCHEMA_IDENTIFIER)
74
89
  {
75
 
    schema_message.set_name("information_schema");
76
 
    schema_message.set_collation("utf8_general_ci");
 
90
    schema_message= information_message;
77
91
  }
78
92
  else if (schema_identifier == DATA_DICTIONARY_IDENTIFIER)
79
93
  {
80
 
    schema_message.set_name("data_dictionary");
81
 
    schema_message.set_collation("utf8_general_ci");
 
94
    schema_message= data_dictionary_message;
82
95
  }
83
96
  else
84
97
  {