~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/columns.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2010 Sun Microsystems
 
4
 *  Copyright (C) 2010 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
37
37
  add_field("COLUMN_DEFAULT", plugin::TableFunction::VARBINARY, 65535, true);
38
38
  add_field("COLUMN_DEFAULT_IS_NULL", plugin::TableFunction::BOOLEAN, 0, false);
39
39
  add_field("COLUMN_DEFAULT_UPDATE");
 
40
  add_field("IS_SIGNED", plugin::TableFunction::BOOLEAN, 0, true);
40
41
  add_field("IS_AUTO_INCREMENT", plugin::TableFunction::BOOLEAN, 0, false);
41
42
  add_field("IS_NULLABLE", plugin::TableFunction::BOOLEAN, 0, false);
42
43
  add_field("IS_INDEXED", plugin::TableFunction::BOOLEAN, 0, false);
46
47
  add_field("IS_FIRST_IN_MULTI", plugin::TableFunction::BOOLEAN, 0, false);
47
48
  add_field("INDEXES_FOUND_IN", plugin::TableFunction::NUMBER, 0, false);
48
49
  add_field("DATA_TYPE");
49
 
 
 
50
  add_field("DATA_ARCHETYPE");
50
51
  add_field("CHARACTER_MAXIMUM_LENGTH", plugin::TableFunction::NUMBER);
51
52
  add_field("CHARACTER_OCTET_LENGTH", plugin::TableFunction::NUMBER);
52
53
  add_field("NUMERIC_PRECISION", plugin::TableFunction::NUMBER);
115
116
    /* COLUMN_DEFAULT_UPDATE */
116
117
    push(column.options().update_expression());
117
118
 
 
119
    /* IS_SIGNED */
 
120
    if (drizzled::message::is_numeric(column))
 
121
    {
 
122
      push(true);
 
123
    }
 
124
    else 
 
125
    {
 
126
      push();
 
127
    }
 
128
 
118
129
    /* IS_AUTO_INCREMENT */
119
130
    push(column.numeric_options().is_autoincrement());
120
131
 
121
132
    /* IS_NULLABLE */
122
 
    push(column.constraints().is_nullable());
 
133
    push(not column.constraints().is_notnull());
123
134
 
124
135
    /* IS_INDEXED, IS_USED_IN_PRIMARY, IS_UNIQUE, IS_MULTI, IS_FIRST_IN_MULTI, INDEXES_FOUND_IN */
125
136
    bool is_indexed= false;
165
176
    push(is_multi_first);
166
177
    push(indexes_found_in);
167
178
 
168
 
    /* DATATYPE */
 
179
    /* DATA_TYPE <-- display the type that the user is going to expect, which is not the same as the type we store internally */
 
180
    push(drizzled::message::type(column));
 
181
 
 
182
    /* DATA_ARCHETYPE */
169
183
    push(drizzled::message::type(column.type()));
170
184
 
171
185
    /* "CHARACTER_MAXIMUM_LENGTH" */