~drizzle-developers/drizzle/elliott-release

« back to all changes in this revision

Viewing changes to plugin/show_dictionary/show_schemas.cc

  • Committer: Patrick Crews
  • Date: 2011-02-01 20:33:06 UTC
  • mfrom: (1845.2.288 drizzle)
  • Revision ID: gleebix@gmail.com-20110201203306-mwq2rk0it81tlwxh
Merged Trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
ShowSchemas::Generator::Generator(Field **arg) :
34
34
  show_dictionary::Show::Generator(arg),
35
 
  is_schema_primed(false)
36
 
{
 
35
  schema_generator(getSession())
 
36
{
 
37
}
 
38
 
 
39
bool ShowSchemas::Generator::populate()
 
40
{
 
41
  drizzled::message::schema::shared_ptr schema_ptr;
 
42
 
37
43
  if (not isShowQuery())
38
 
   return;
39
 
}
40
 
 
41
 
/**
42
 
  @note return true if a match occurs.
43
 
*/
44
 
bool ShowSchemas::Generator::checkSchema()
45
 
{
46
 
  if (isWild((*schema_iterator).getSchemaName()))
47
 
    return true;
48
 
 
49
 
  return false;
50
 
}
51
 
 
52
 
bool ShowSchemas::Generator::nextSchemaCore()
53
 
{
54
 
  if (is_schema_primed)
55
 
  {
56
 
    schema_iterator++;
57
 
  }
58
 
  else
59
 
  {
60
 
    plugin::StorageEngine::getIdentifiers(getSession(), schema_names);
61
 
    schema_iterator= schema_names.begin();
62
 
    is_schema_primed= true;
63
 
  }
64
 
 
65
 
  if (schema_iterator == schema_names.end())
66
44
    return false;
67
45
 
68
 
  if (checkSchema())
69
 
      return false;
70
 
 
71
 
  return true;
72
 
}
73
 
  
74
 
bool ShowSchemas::Generator::nextSchema()
75
 
{
76
 
  while (not nextSchemaCore())
77
 
  {
78
 
    if (schema_iterator == schema_names.end())
79
 
      return false;
80
 
  }
81
 
 
82
 
  return true;
83
 
}
84
 
 
85
 
 
86
 
bool ShowSchemas::Generator::populate()
87
 
{
88
 
  if (nextSchema())
89
 
  {
90
 
    fill();
 
46
  while ((schema_ptr= schema_generator))
 
47
  {
 
48
    if (isWild(schema_ptr->name()))
 
49
      continue;
 
50
 
 
51
    /* Schema */
 
52
    push(schema_ptr->name());
 
53
 
91
54
    return true;
92
55
  }
93
56
 
94
57
  return false;
95
58
}
96
 
 
97
 
/**
98
 
  A lack of a parsed schema file means we are using defaults.
99
 
*/
100
 
void ShowSchemas::Generator::fill()
101
 
{
102
 
  /* Schema */
103
 
  push((*schema_iterator).getSchemaName());
104
 
}