~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

Add in new show work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
    1                 out of memory or SHOW commands are not allowed
354
354
                      in this version of the server.
355
355
*/
 
356
static bool _schema_select(Session *session, Select_Lex *sel,
 
357
                           const string& schema_table_name)
 
358
{
 
359
  LEX_STRING db, table;
 
360
  /*
 
361
     We have to make non const db_name & table_name
 
362
     because of lower_case_table_names
 
363
  */
 
364
  session->make_lex_string(&db, "data_dictionary", sizeof("data_dictionary"), false);
 
365
  session->make_lex_string(&table, schema_table_name, false);
 
366
 
 
367
  if (! sel->add_table_to_list(session, new Table_ident(db, table),
 
368
                               NULL, 0, TL_READ))
 
369
  {
 
370
    return true;
 
371
  }
 
372
  return false;
 
373
}
 
374
 
 
375
int prepare_new_schema_table(Session *session, LEX *lex,
 
376
                             const string& schema_table_name)
 
377
{
 
378
  Select_Lex *schema_select_lex= NULL;
 
379
 
 
380
  Select_Lex *select_lex= lex->current_select;
 
381
  assert(select_lex);
 
382
  if (_schema_select(session, select_lex, schema_table_name))
 
383
  {
 
384
    return(1);
 
385
  }
 
386
  TableList *table_list= (TableList*) select_lex->table_list.first;
 
387
  assert(table_list);
 
388
  table_list->schema_select_lex= schema_select_lex;
 
389
 
 
390
  return 0;
 
391
}
356
392
 
357
393
int prepare_schema_table(Session *session, LEX *lex, Table_ident *table_ident,
358
394
                         const string& schema_table_name)