~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/show_dictionary/show_indexes.cc

  • Committer: pcrews
  • Date: 2011-05-24 17:36:24 UTC
  • mfrom: (1099.4.232 drizzle)
  • Revision ID: pcrews@lucid32-20110524173624-mwr1bvq6fa1r01ao
Updated translations + 2011.05.18 tarball tag

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
 
25
25
 
26
26
using namespace std;
47
47
  if (not isShowQuery())
48
48
    return;
49
49
 
50
 
  statement::Show *select= static_cast<statement::Show *>(getSession().lex->statement);
 
50
  statement::Show& select= static_cast<statement::Show&>(statement());
51
51
 
52
 
  if (not select->getShowTable().empty() && not select->getShowSchema().empty())
 
52
  if (not select.getShowTable().empty() && not select.getShowSchema().empty())
53
53
  {
54
 
    table_name.append(select->getShowTable().c_str());
55
 
    identifier::Table identifier(select->getShowSchema().c_str(), select->getShowTable().c_str());
56
 
 
57
 
    is_tables_primed= plugin::StorageEngine::getTableDefinition(getSession(),
58
 
                                                                identifier,
59
 
                                                                table_proto);
 
54
    table_name.append(select.getShowTable().c_str());
 
55
    identifier::Table identifier(select.getShowSchema().c_str(), select.getShowTable().c_str());
 
56
 
 
57
    if (not plugin::Authorization::isAuthorized(*getSession().user(),
 
58
                                            identifier, false))
 
59
    {
 
60
      drizzled::error::access(*getSession().user(), identifier);
 
61
      return;
 
62
    }
 
63
 
 
64
    table_proto= plugin::StorageEngine::getTableMessage(getSession(), identifier);
 
65
 
 
66
    if (table_proto)
 
67
      is_tables_primed= true;
60
68
  }
61
69
}
62
70