~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/show_dictionary/show_columns.cc

  • Committer: Brian Aker
  • Date: 2010-12-18 10:14:05 UTC
  • mfrom: (2008.1.3 clean)
  • Revision ID: brian@tangent.org-20101218101405-qjbse29shi9coklg
Merge of user identifier work

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
22
 
#include <plugin/show_dictionary/dictionary.h>
23
 
#include <drizzled/identifier.h>
 
21
#include "config.h"
 
22
#include "plugin/show_dictionary/dictionary.h"
 
23
#include "drizzled/identifier.h"
24
24
#include <string>
25
25
 
26
26
using namespace std;
57
57
  is_columns_primed(false),
58
58
  column_iterator(0)
59
59
{
60
 
  if (not isShowQuery())
61
 
   return;
62
 
 
63
 
  statement::Show *select= static_cast<statement::Show *>(getSession().getLex()->statement);
 
60
  statement::Show *select= static_cast<statement::Show *>(getSession().lex->statement);
64
61
 
65
62
  if (not select->getShowTable().empty() && not select->getShowSchema().empty())
66
63
  {
67
64
    table_name.append(select->getShowTable().c_str());
68
 
    identifier::Table identifier(select->getShowSchema().c_str(), select->getShowTable().c_str());
69
 
 
70
 
    table_proto= plugin::StorageEngine::getTableMessage(getSession(), identifier);
71
 
 
72
 
    if (table_proto)
73
 
      is_tables_primed= true;
 
65
    TableIdentifier identifier(select->getShowSchema().c_str(), select->getShowTable().c_str());
 
66
 
 
67
    is_tables_primed= plugin::StorageEngine::getTableDefinition(getSession(),
 
68
                                                                identifier,
 
69
                                                                table_proto);
74
70
  }
75
71
}
76
72
 
148
144
  case message::Table::Field::DATE:
149
145
    push(DATE);
150
146
    break;
151
 
  case message::Table::Field::EPOCH:
 
147
  case message::Table::Field::TIMESTAMP:
152
148
    push(TIMESTAMP);
153
149
    break;
154
150
  case message::Table::Field::DATETIME:
167
163
  pushType(column.type(), column.string_options().collation());
168
164
 
169
165
  /* Null */
170
 
  push(not column.constraints().is_notnull());
 
166
  push(column.constraints().is_nullable());
171
167
 
172
168
  /* Default */
173
169
  if (column.options().has_default_value())