~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Brian Aker
  • Date: 2009-06-09 01:59:10 UTC
  • mfrom: (1054.1.11 merge)
  • Revision ID: brian@gaz-20090609015910-0sfsovp2x8wfbr2c
Merge Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
347
347
  String buffer(buff, sizeof(buff), system_charset_info);
348
348
 
349
349
  /* Only one table for now, but VIEW can involve several tables */
350
 
  if (open_normal_and_derived_tables(session, table_list, 0))
 
350
  if (session->open_normal_and_derived_tables(table_list, 0))
351
351
  {
352
352
    if (session->is_error())
353
353
      return true;
444
444
{
445
445
  Table *table;
446
446
 
447
 
  if (open_normal_and_derived_tables(session, table_list, 0))
 
447
  if (session->open_normal_and_derived_tables(table_list, 0))
448
448
    return;
449
449
  table= table_list->table;
450
450
 
2158
2158
    SQLCOM_SHOW_FIELDS is used because it satisfies 'only_view_structure()'
2159
2159
  */
2160
2160
  lex->sql_command= SQLCOM_SHOW_FIELDS;
2161
 
  res= open_normal_and_derived_tables(session, show_table_list,
2162
 
                                      DRIZZLE_LOCK_IGNORE_FLUSH);
 
2161
  res= session->open_normal_and_derived_tables(show_table_list, DRIZZLE_LOCK_IGNORE_FLUSH);
2163
2162
  lex->sql_command= save_sql_command;
2164
2163
  /*
2165
2164
    get_all_tables() returns 1 on failure and 0 on success thus
2309
2308
  table_list.table_name= table_name->str;
2310
2309
  table_list.db= db_name->str;
2311
2310
 
2312
 
  key_length= create_table_def_key(key, &table_list);
 
2311
  key_length= table_list.create_table_def_key(key);
2313
2312
  pthread_mutex_lock(&LOCK_open); /* Locking to get table share when filling schema table from FRM */
2314
2313
  share= get_table_share(session, &table_list, key,
2315
2314
                         key_length, 0, &error);
2517
2516
            lex->sql_command= SQLCOM_SHOW_FIELDS;
2518
2517
            show_table_list->i_s_requested_object=
2519
2518
              schema_table->i_s_requested_object;
2520
 
            res= open_normal_and_derived_tables(session, show_table_list,
2521
 
                                                DRIZZLE_LOCK_IGNORE_FLUSH);
 
2519
            res= session->open_normal_and_derived_tables(show_table_list, DRIZZLE_LOCK_IGNORE_FLUSH);
2522
2520
            lex->sql_command= save_sql_command;
2523
2521
            /*
2524
 
XXX:  show_table_list has a flag i_is_requested,
2525
 
and when it's set, open_normal_and_derived_tables()
2526
 
can return an error without setting an error message
2527
 
in Session, which is a hack. This is why we have to
2528
 
check for res, then for session->is_error() only then
2529
 
for session->main_da.sql_errno().
 
2522
              XXX->  show_table_list has a flag i_is_requested,
 
2523
              and when it's set, open_normal_and_derived_tables()
 
2524
              can return an error without setting an error message
 
2525
              in Session, which is a hack. This is why we have to
 
2526
              check for res, then for session->is_error() only then
 
2527
              for session->main_da.sql_errno().
2530
2528
            */
2531
2529
            if (res && session->is_error() &&
2532
2530
                session->main_da.sql_errno() == ER_NO_SUCH_TABLE)