~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.h

  • Committer: Monty Taylor
  • Date: 2010-02-04 08:14:46 UTC
  • mfrom: (1277.2.1 build) (1280.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1283.
  • Revision ID: mordred@inaugust.com-20100204081446-ldh9m486va30uap6
Put everything in drizzled into drizzled namespace.
Put internal stuff into drizzled::internal namespace.
Removed some cruft.
Now every symbol that is shipped in a header is in the drizzled namespace
and everything in the server that's not shipped is labeled internal. woot. 
Removed a lot of the extra extern "C" stuff that was in there. Less ugliness for
internal callbacks now for Sun Studio.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#define DRIZZLED_JOIN_H
29
29
 
30
30
#include <drizzled/optimizer/position.h>
 
31
#include "drizzled/sql_select.h"
31
32
#include <bitset>
32
33
 
33
 
class JOIN :public drizzled::memory::SqlAlloc
 
34
namespace drizzled
 
35
{
 
36
 
 
37
class JOIN :public memory::SqlAlloc
34
38
{
35
39
  JOIN(const JOIN &rhs);                        /**< not implemented */
36
40
  JOIN& operator=(const JOIN &rhs);             /**< not implemented */
39
43
   * Contains a partial query execution plan which is extended during
40
44
   * cost-based optimization.
41
45
   */
42
 
  drizzled::optimizer::Position positions[MAX_TABLES+1];
 
46
  optimizer::Position positions[MAX_TABLES+1];
43
47
 
44
48
  /**
45
49
   * Contains the optimal query execution plan after cost-based optimization
46
50
   * has taken place. 
47
51
   */
48
 
  drizzled::optimizer::Position best_positions[MAX_TABLES+1];
 
52
  optimizer::Position best_positions[MAX_TABLES+1];
49
53
 
50
54
public:
51
55
  JoinTable *join_tab;
143
147
  Select_Lex_Unit *unit;
144
148
  /** select that processed */
145
149
  Select_Lex *select_lex;
146
 
  drizzled::optimizer::SqlSelect *select; /**< created in optimization phase */
 
150
  optimizer::SqlSelect *select; /**< created in optimization phase */
147
151
 
148
152
  /**
149
153
    Bitmap of nested joins embedding the position at the end of the current
467
471
  void copyPartialPlanIntoOptimalPlan(uint32_t size)
468
472
  {
469
473
    memcpy(best_positions, positions, 
470
 
           sizeof(drizzled::optimizer::Position) * size);
 
474
           sizeof(optimizer::Position) * size);
471
475
  }
472
476
 
473
477
  void cache_const_exprs();
477
481
   * @return a reference to the specified position in the optimal
478
482
   *         query plan
479
483
   */
480
 
  drizzled::optimizer::Position &getPosFromOptimalPlan(uint32_t index)
 
484
  optimizer::Position &getPosFromOptimalPlan(uint32_t index)
481
485
  {
482
486
    return best_positions[index];
483
487
  }
487
491
   * @return a reference to the specified position in the partial
488
492
   *         query plan
489
493
   */
490
 
  drizzled::optimizer::Position &getPosFromPartialPlan(uint32_t index)
 
494
  optimizer::Position &getPosFromPartialPlan(uint32_t index)
491
495
  {
492
496
    return positions[index];
493
497
  }
496
500
   * @param[in] index the index of the position to set
497
501
   * @param[in] in_pos the value to set the position to
498
502
   */
499
 
  void setPosInPartialPlan(uint32_t index, drizzled::optimizer::Position &in_pos)
 
503
  void setPosInPartialPlan(uint32_t index, optimizer::Position &in_pos)
500
504
  {
501
505
    positions[index]= in_pos;
502
506
  }
504
508
  /**
505
509
   * @return a pointer to the first position in the partial query plan
506
510
   */
507
 
  drizzled::optimizer::Position *getFirstPosInPartialPlan()
 
511
  optimizer::Position *getFirstPosInPartialPlan()
508
512
  {
509
513
    return positions;
510
514
  }
514
518
   *                  query plan
515
519
   * @return a pointer to the position in the partial query plan
516
520
   */
517
 
  drizzled::optimizer::Position *getSpecificPosInPartialPlan(int32_t index)
 
521
  optimizer::Position *getSpecificPosInPartialPlan(int32_t index)
518
522
  {
519
523
    return positions + index;
520
524
  }
529
533
enum_nested_loop_state end_update(JOIN *join, JoinTable *join_tab, bool end_of_records);
530
534
enum_nested_loop_state end_unique_update(JOIN *join, JoinTable *join_tab, bool end_of_records);
531
535
 
 
536
} /* namespace drizzled */
 
537
 
532
538
#endif /* DRIZZLED_JOIN_H */