~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Brian Aker
  • Date: 2009-03-14 16:51:54 UTC
  • mfrom: (934.2.2 small-cleanups)
  • Revision ID: brian@tangent.org-20090314165154-qwuzmdlz35pyl6hq
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
  @defgroup Query_Optimizer  Query Optimizer
24
24
  @{
25
25
*/
26
 
#include <drizzled/server_includes.h>
27
 
#include <drizzled/sql_select.h>
28
 
#include <drizzled/sj_tmp_table.h>
29
 
#include <drizzled/table_map_iterator.h>
 
26
#include "drizzled/server_includes.h"
 
27
#include "drizzled/sql_select.h"
 
28
#include "drizzled/sj_tmp_table.h"
 
29
#include "drizzled/table_map_iterator.h"
30
30
 
31
 
#include <mysys/my_bit.h>
32
 
#include <drizzled/error.h>
33
 
#include <drizzled/gettext.h>
34
 
#include <drizzled/util/test.h>
35
 
#include <drizzled/name_resolution_context_state.h>
36
 
#include <drizzled/nested_join.h>
37
 
#include <drizzled/probes.h>
38
 
#include <drizzled/show.h>
39
 
#include <drizzled/item/cache.h>
40
 
#include <drizzled/item/cmpfunc.h>
41
 
#include <drizzled/item/copy_string.h>
42
 
#include <drizzled/item/uint.h>
43
 
#include <drizzled/cached_item.h>
44
 
#include <drizzled/sql_base.h>
45
 
#include <drizzled/field/blob.h>
46
 
#include <drizzled/check_stack_overrun.h>
47
 
#include <drizzled/lock.h>
48
 
#include <drizzled/item/outer_ref.h>
 
31
#include "mysys/my_bit.h"
 
32
#include "drizzled/error.h"
 
33
#include "drizzled/gettext.h"
 
34
#include "drizzled/util/test.h"
 
35
#include "drizzled/name_resolution_context_state.h"
 
36
#include "drizzled/nested_join.h"
 
37
#include "drizzled/probes.h"
 
38
#include "drizzled/show.h"
 
39
#include "drizzled/item/cache.h"
 
40
#include "drizzled/item/cmpfunc.h"
 
41
#include "drizzled/item/copy_string.h"
 
42
#include "drizzled/item/uint.h"
 
43
#include "drizzled/cached_item.h"
 
44
#include "drizzled/sql_base.h"
 
45
#include "drizzled/field/blob.h"
 
46
#include "drizzled/check_stack_overrun.h"
 
47
#include "drizzled/lock.h"
 
48
#include "drizzled/item/outer_ref.h"
 
49
#include "drizzled/index_hint.h"
49
50
 
50
51
#include <string>
51
52
 
16326
16327
  print_table_array(session, str, table, table + tables->elements);
16327
16328
}
16328
16329
 
16329
 
 
16330
 
/**
16331
 
  @brief Print an index hint
16332
 
 
16333
 
  @details Prints out the USE|FORCE|IGNORE index hint.
16334
 
 
16335
 
  @param      session         the current thread
16336
 
  @param[out] str         appends the index hint here
16337
 
  @param      hint        what the hint is (as string : "USE INDEX"|
16338
 
                          "FORCE INDEX"|"IGNORE INDEX")
16339
 
  @param      hint_length the length of the string in 'hint'
16340
 
  @param      indexes     a list of index names for the hint
16341
 
*/
16342
 
 
16343
 
void
16344
 
Index_hint::print(Session *session, String *str)
16345
 
{
16346
 
  switch (type)
16347
 
  {
16348
 
    case INDEX_HINT_IGNORE: str->append(STRING_WITH_LEN("IGNORE INDEX")); break;
16349
 
    case INDEX_HINT_USE:    str->append(STRING_WITH_LEN("USE INDEX")); break;
16350
 
    case INDEX_HINT_FORCE:  str->append(STRING_WITH_LEN("FORCE INDEX")); break;
16351
 
  }
16352
 
  str->append (STRING_WITH_LEN(" ("));
16353
 
  if (key_name.length)
16354
 
  {
16355
 
    if (session && is_primary_key_name(key_name.str))
16356
 
      str->append(is_primary_key_name(key_name.str));
16357
 
    else
16358
 
      str->append_identifier(key_name.str, key_name.length);
16359
 
  }
16360
 
  str->append(')');
16361
 
}
16362
 
 
16363
 
 
16364
16330
/**
16365
16331
  Print table as it should be in join list.
16366
16332
 
16367
16333
  @param str   string where table should be printed
16368
16334
*/
16369
 
 
16370
16335
void TableList::print(Session *session, String *str, enum_query_type query_type)
16371
16336
{
16372
16337
  if (nested_join)