@Override
  public List<String> getAllTables(String dbName) throws MetaException {
    List<String> tableNames = super.getAllTables(dbName);

    // May need to merge with list of temp tables
    Map<String, Table> tables = getTempTablesForDatabase(dbName, "?");
    if (tables == null || tables.size() == 0) {
      return tableNames;
    }

    // Get list of temp table names
    Set<String> tempTableNames = tables.keySet();

    // Merge and sort result
    Set<String> allTableNames = new HashSet<String>(tableNames.size() + tempTableNames.size());
    allTableNames.addAll(tableNames);
    allTableNames.addAll(tempTableNames);
    tableNames = new ArrayList<String>(allTableNames);
    Collections.sort(tableNames);
    return tableNames;
  }
todo: This need review re: thread safety.  Various places (see callsers of
{@link SessionState#setCurrentSessionState(SessionState)}) pass SessionState to forked threads.
Currently it looks like those threads only read metadata but this is fragile.
Also, maps (in SessionState) where tempt table metadata is stored are concurrent and so
any put/get crosses a memory barrier and so does using most {@code java.util.concurrent.*}
so the readers of the objects in these maps should have the most recent view of the object.
But again, could be fragile.
ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java