~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/serialize/table_reader.cc

fix table_reader for virtual columns

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
void print_field(const ::drizzle::Table::Field &field)
24
24
{
25
25
  cout << "\t`" << field.name() << "`";
26
 
  switch (field.type())
 
26
 
 
27
  Table::Field::FieldType field_type= field.type();
 
28
 
 
29
  if(field_type==Table::Field::VIRTUAL)
 
30
  {
 
31
    cout << " VIRTUAL"; // FIXME
 
32
    field_type= field.virtual_options().type();
 
33
  }
 
34
 
 
35
  switch (field_type)
27
36
  {
28
37
    case Table::Field::DOUBLE:
29
38
    cout << " DOUBLE ";
77
86
    cout << " DATETIME ";
78
87
    break;
79
88
  case Table::Field::VIRTUAL:
80
 
    cout << " VIRTUAL"; // FIXME
81
 
    break;
 
89
    abort(); // handled above.
 
90
  }
 
91
 
 
92
  if(field.type()==Table::Field::VIRTUAL)
 
93
  {
 
94
    cout << " AS (" << field.virtual_options().expression() << ") ";
 
95
    if(field.virtual_options().physically_stored())
 
96
      cout << " STORED ";
82
97
  }
83
98
 
84
99
  if (field.type() == Table::Field::INTEGER