~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

Merged in slot -> service changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#include <drizzled/item/return_date_time.h>
41
41
#include <drizzled/item/empty_string.h>
42
42
#include "drizzled/plugin/registry.h"
43
 
#include <drizzled/plugin/info_schema.h>
 
43
#include <drizzled/plugin/info_schema_table.h>
44
44
#include <drizzled/message/schema.pb.h>
45
45
#include <drizzled/plugin/client.h>
46
46
#include <mysys/cached_directory.h>
1082
1082
                             TableList *table,
1083
1083
                             LOOKUP_FIELD_VALUES *lookup_field_vals)
1084
1084
{
1085
 
  plugin::InfoSchema *schema_table= table->schema_table;
 
1085
  plugin::InfoSchemaTable *schema_table= table->schema_table;
1086
1086
  const char *field_name1= schema_table->getFirstColumnIndex() >= 0 ?
1087
1087
    schema_table->getColumnName(schema_table->getFirstColumnIndex()).c_str() : "";
1088
1088
  const char *field_name2= schema_table->getSecondColumnIndex() >= 0 ?
1210
1210
  {
1211
1211
    Item_field *item_field= (Item_field*)item;
1212
1212
    const CHARSET_INFO * const cs= system_charset_info;
1213
 
    plugin::InfoSchema *schema_table= table->schema_table;
 
1213
    plugin::InfoSchemaTable *schema_table= table->schema_table;
1214
1214
    const char *field_name1= schema_table->getFirstColumnIndex() >= 0 ?
1215
1215
      schema_table->getColumnName(schema_table->getFirstColumnIndex()).c_str() : "";
1216
1216
    const char *field_name2= schema_table->getSecondColumnIndex() >= 0 ?
1507
1507
 
1508
1508
  string db(db_name->str);
1509
1509
 
1510
 
  slot::TableNameIterator tniter(db);
 
1510
  service::TableNameIterator tniter(db);
1511
1511
  int err= 0;
1512
1512
  string table_name;
1513
1513
 
1559
1559
 
1560
1560
static int
1561
1561
fill_schema_show_cols_or_idxs(Session *session, TableList *tables,
1562
 
                              plugin::InfoSchema *schema_table,
 
1562
                              plugin::InfoSchemaTable *schema_table,
1563
1563
                              Open_tables_state *open_tables_state_backup)
1564
1564
{
1565
1565
  LEX *lex= session->lex;
1676
1676
*/
1677
1677
 
1678
1678
static uint32_t get_table_open_method(TableList *tables,
1679
 
                                      plugin::InfoSchema *schema_table)
 
1679
                                      plugin::InfoSchemaTable *schema_table)
1680
1680
{
1681
1681
  /*
1682
1682
    determine which method will be used for table opening
1715
1715
*/
1716
1716
 
1717
1717
static int fill_schema_table_from_frm(Session *session,TableList *tables,
1718
 
                                      plugin::InfoSchema *schema_table,
 
1718
                                      plugin::InfoSchemaTable *schema_table,
1719
1719
                                      LEX_STRING *db_name,
1720
1720
                                      LEX_STRING *table_name)
1721
1721
{
1786
1786
  Select_Lex *old_all_select_lex= lex->all_selects_list;
1787
1787
  enum_sql_command save_sql_command= lex->sql_command;
1788
1788
  Select_Lex *lsel= tables->schema_select_lex;
1789
 
  plugin::InfoSchema *schema_table= tables->schema_table;
 
1789
  plugin::InfoSchemaTable *schema_table= tables->schema_table;
1790
1790
  Select_Lex sel;
1791
1791
  LOOKUP_FIELD_VALUES lookup_field_vals;
1792
1792
  bool with_i_schema;
2238
2238
    #   pointer to 'schema_tables' element
2239
2239
*/
2240
2240
 
2241
 
plugin::InfoSchema *find_schema_table(const char* table_name)
 
2241
plugin::InfoSchemaTable *find_schema_table(const char* table_name)
2242
2242
{
2243
2243
  
2244
2244
  plugin::Registry &plugins= plugin::Registry::singleton();
2254
2254
  Table *table;
2255
2255
  List<Item> field_list;
2256
2256
  const CHARSET_INFO * const cs= system_charset_info;
2257
 
  const plugin::InfoSchema::Columns &columns= table_list->schema_table->getColumns();
2258
 
  plugin::InfoSchema::Columns::const_iterator iter= columns.begin();
 
2257
  const plugin::InfoSchemaTable::Columns &columns= table_list->schema_table->getColumns();
 
2258
  plugin::InfoSchemaTable::Columns::const_iterator iter= columns.begin();
2259
2259
 
2260
2260
  while (iter != columns.end())
2261
2261
  {
2360
2360
   0    success
2361
2361
*/
2362
2362
 
2363
 
int plugin::InfoSchemaMethods::oldFormat(Session *session, plugin::InfoSchema *schema_table)
 
2363
int plugin::InfoSchemaMethods::oldFormat(Session *session, plugin::InfoSchemaTable *schema_table)
2364
2364
  const
2365
2365
{
2366
2366
  Name_resolution_context *context= &session->lex->select_lex.context;
2367
 
  const plugin::InfoSchema::Columns columns= schema_table->getColumns();
2368
 
  plugin::InfoSchema::Columns::const_iterator iter= columns.begin();
 
2367
  const plugin::InfoSchemaTable::Columns columns= schema_table->getColumns();
 
2368
  plugin::InfoSchemaTable::Columns::const_iterator iter= columns.begin();
2369
2369
 
2370
2370
  while (iter != columns.end())
2371
2371
  {
2447
2447
bool make_schema_select(Session *session, Select_Lex *sel,
2448
2448
                        const string& schema_table_name)
2449
2449
{
2450
 
  plugin::InfoSchema *schema_table= find_schema_table(schema_table_name.c_str());
 
2450
  plugin::InfoSchemaTable *schema_table= find_schema_table(schema_table_name.c_str());
2451
2451
  LEX_STRING db, table;
2452
2452
  /*
2453
2453
     We have to make non const db_name & table_name