~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-187

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Stewart Smith
  • Date: 2012-07-11 14:06:00 UTC
  • mto: This revision was merged to the branch mainline in revision 2574.
  • Revision ID: stewart@flamingspork.com-20120711140600-oxrs1cjabjuqpd05
force a identifier::Schema to be constructed with a identifier::Catalog. This is close to the final 'big' part for CATALOG support. We also have to modify all around the server that creates identifier::Schema so it does so properly. Since a single Session cannot span schemas, we get off a wee bit easy :) The big limitation in this patch is that INFORMATION_SCHEMA and DATA_DICTIONARY only appear in the LOCAL catalog (and this really needs to be fixed before CATALOGs other than LOCAL are supported).

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include <drizzled/statement/show_warnings.h>
35
35
#include <drizzled/sql_lex.h>
36
36
#include <drizzled/table_ident.h>
 
37
#include <drizzled/catalog/instance.h>
37
38
 
38
39
#include <sys/stat.h>
39
40
 
116
117
  util::string::ptr schema(session->schema());
117
118
  if (ident)
118
119
  {
119
 
    identifier::Schema identifier= str_ref(ident);
 
120
    identifier::Schema identifier(session->catalog().identifier(),
 
121
                                  str_ref(ident));
120
122
    column_name.append(ident);
121
123
    session->lex().select_lex.db= ident;
122
124
    if (not plugin::StorageEngine::doesSchemaExist(identifier))
182
184
  {
183
185
    session->lex().select_lex.db= ident;
184
186
 
185
 
    identifier::Schema identifier= str_ref(ident);
 
187
    identifier::Schema identifier(session->catalog().identifier(),
 
188
                                  str_ref(ident));
186
189
    if (not plugin::StorageEngine::doesSchemaExist(identifier))
187
190
    {
188
191
      my_error(ER_BAD_DB_ERROR, identifier);
245
248
  }
246
249
 
247
250
  {
248
 
    drizzled::identifier::Table identifier(select->getShowSchema(), table_ident->table.data());
 
251
    drizzled::identifier::Table identifier(session->catalog().identifier(),
 
252
                                           select->getShowSchema(),
 
253
                                           table_ident->table.data());
249
254
    if (not plugin::StorageEngine::doesTableExist(*session, identifier))
250
255
    {
251
256
      my_error(ER_TABLE_UNKNOWN, identifier);
308
313
  }
309
314
 
310
315
  {
311
 
    drizzled::identifier::Table identifier(select->getShowSchema(), table_ident->table.data());
 
316
    drizzled::identifier::Table identifier(session->catalog().identifier(),
 
317
                                           select->getShowSchema(),
 
318
                                           table_ident->table.data());
312
319
    if (not plugin::StorageEngine::doesTableExist(*session, identifier))
313
320
    {
314
321
      my_error(ER_TABLE_UNKNOWN, identifier);
483
490
  }
484
491
 
485
492
  {
486
 
    drizzled::identifier::Table identifier(select->getShowSchema(), ident->table.data());
 
493
    drizzled::identifier::Table identifier(session->catalog().identifier(),
 
494
                                           select->getShowSchema(),
 
495
                                           ident->table.data());
487
496
    if (not plugin::StorageEngine::doesTableExist(*session, identifier))
488
497
    {
489
498
      my_error(ER_TABLE_UNKNOWN, identifier);