~posulliv/drizzle/memcached_applier

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Jay Pipes
  • Date: 2009-08-03 14:23:22 UTC
  • mfrom: (1039.2.68 staging)
  • mto: This revision was merged to the branch mainline in revision 1078.
  • Revision ID: jpipes@serialcoder-20090803142322-1g67h7su9mocg9ig
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1676
1676
    return (schema_tables_add(session, table_names,
1677
1677
                              lookup_field_vals->table_value.str));
1678
1678
 
1679
 
  find_files_result res= find_files(session, table_names, db_name->str, path,
1680
 
                                    lookup_field_vals->table_value.str, 0);
1681
 
  if (res != FIND_FILES_OK)
1682
 
  {
1683
 
    /*
1684
 
      Downgrade errors about problems with database directory to
1685
 
      warnings if this is not a 'SHOW' command.  Another thread
1686
 
      may have dropped database, and we may still have a name
1687
 
      for that directory.
1688
 
    */
1689
 
    if (res == FIND_FILES_DIR)
 
1679
  string db(db_name->str);
 
1680
 
 
1681
  TableNameIterator tniter(db);
 
1682
  int err= 0;
 
1683
  string table_name;
 
1684
 
 
1685
  do {
 
1686
    err= tniter.next(&table_name);
 
1687
 
 
1688
    if (err == 0)
1690
1689
    {
1691
 
      if (lex->sql_command != SQLCOM_SELECT)
1692
 
        return 1;
1693
 
      session->clear_error();
1694
 
      return 2;
 
1690
      LEX_STRING *file_name= NULL;
 
1691
      file_name= session->make_lex_string(file_name, table_name.c_str(),
 
1692
                                          table_name.length(), true);
 
1693
      const char* wild= lookup_field_vals->table_value.str;
 
1694
      if (wild && wild_compare(table_name.c_str(), wild, 0))
 
1695
        continue;
 
1696
      table_names.push_back(file_name);
1695
1697
    }
1696
 
    return 1;
 
1698
 
 
1699
  } while (err == 0);
 
1700
 
 
1701
  if (err > 0)
 
1702
  {
 
1703
    /* who knows what this error condition really does...
 
1704
       anyway, we're keeping behaviour from days of yore */
 
1705
    if (lex->sql_command != SQLCOM_SELECT)
 
1706
      return 1;
 
1707
    session->clear_error();
 
1708
    return 2;
1697
1709
  }
 
1710
 
1698
1711
  return 0;
1699
1712
}
1700
1713