~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/show_dictionary/show_columns.cc

  • Committer: patrick crews
  • Date: 2010-09-16 14:38:00 UTC
  • mfrom: (1768 staging)
  • mto: (1771.1.1 pcrews)
  • mto: This revision was merged to the branch mainline in revision 1772.
  • Revision ID: gleebix@gmail.com-20100916143800-hyu1tcfnjcowfnpb
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "config.h"
22
22
#include "plugin/show_dictionary/dictionary.h"
23
23
#include "drizzled/identifier.h"
24
 
 
 
24
#include <string>
25
25
 
26
26
using namespace std;
27
27
using namespace drizzled;
28
28
 
29
29
static const string VARCHAR("VARCHAR");
 
30
/* VARBINARY already defined elsewhere */
 
31
static const string VARBIN("VARBINARY");
30
32
static const string DOUBLE("DOUBLE");
31
33
static const string BLOB("BLOB");
 
34
static const string TEXT("TEXT");
32
35
static const string ENUM("ENUM");
33
36
static const string INTEGER("INTEGER");
34
37
static const string BIGINT("BIGINT");
112
115
  return true;
113
116
}
114
117
 
115
 
void ShowColumns::Generator::pushType(message::Table::Field::FieldType type)
 
118
void ShowColumns::Generator::pushType(message::Table::Field::FieldType type, const string collation)
116
119
{
117
120
  switch (type)
118
121
  {
119
122
  default:
120
123
  case message::Table::Field::VARCHAR:
121
 
    push(VARCHAR);
 
124
    push(collation.compare("binary") ? VARCHAR : VARBIN);
122
125
    break;
123
126
  case message::Table::Field::DOUBLE:
124
127
    push(DOUBLE);
125
128
    break;
126
129
  case message::Table::Field::BLOB:
127
 
    push(BLOB);
 
130
    push(collation.compare("binary") ? TEXT : BLOB);
128
131
    break;
129
132
  case message::Table::Field::ENUM:
130
133
    push(ENUM);
157
160
  push(column.name());
158
161
 
159
162
  /* Type */
160
 
  pushType(column.type());
 
163
  pushType(column.type(), column.string_options().collation());
161
164
 
162
165
  /* Null */
163
166
  push(column.constraints().is_nullable());