~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/subselect.h

  • Committer: Brian Aker
  • Date: 2010-11-19 19:42:44 UTC
  • mto: (1945.2.1 quick)
  • mto: This revision was merged to the branch mainline in revision 1944.
  • Revision ID: brian@tangent.org-20101119194244-7vx6u5vwzvu9uvex
Remove dead getShare() call which should have been a call on the cache
directly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "drizzled/item/ref.h"
28
28
#include "drizzled/item/field.h"
29
29
#include "drizzled/item/bin_string.h"
 
30
#include "drizzled/util/test.h"
30
31
 
31
32
namespace drizzled
32
33
{
33
34
 
34
35
class Select_Lex;
35
36
class Select_Lex_Unit;
36
 
class JOIN;
 
37
class Join;
37
38
class select_result_interceptor;
38
39
class subselect_engine;
39
40
class subselect_hash_sj_engine;
103
104
  {
104
105
    null_value= 1;
105
106
  }
106
 
  virtual trans_res select_transformer(JOIN *join);
 
107
  virtual trans_res select_transformer(Join *join);
107
108
  bool assigned() { return value_assigned; }
108
109
  void assigned(bool a) { value_assigned= a; }
109
110
  enum Type type() const;
177
178
  subs_type substype() { return SINGLEROW_SUBS; }
178
179
 
179
180
  void reset();
180
 
  trans_res select_transformer(JOIN *join);
 
181
  trans_res select_transformer(Join *join);
181
182
  void store(uint32_t i, Item* item);
182
183
  double val_real();
183
184
  int64_t val_int ();
356
357
    null_value= 0;
357
358
    was_null= 0;
358
359
  }
359
 
  trans_res select_transformer(JOIN *join);
360
 
  trans_res select_in_like_transformer(JOIN *join, const Comp_creator *func);
361
 
  trans_res single_value_transformer(JOIN *join, const Comp_creator *func);
362
 
  trans_res row_value_transformer(JOIN * join);
363
 
  trans_res single_value_in_to_exists_transformer(JOIN * join,
 
360
  trans_res select_transformer(Join *join);
 
361
  trans_res select_in_like_transformer(Join *join, const Comp_creator *func);
 
362
  trans_res single_value_transformer(Join *join, const Comp_creator *func);
 
363
  trans_res row_value_transformer(Join * join);
 
364
  trans_res single_value_in_to_exists_transformer(Join * join,
364
365
                                                  const Comp_creator *func);
365
 
  trans_res row_value_in_to_exists_transformer(JOIN * join);
 
366
  trans_res row_value_in_to_exists_transformer(Join * join);
366
367
  virtual bool exec();
367
368
  int64_t val_int();
368
369
  double val_real();
400
401
 
401
402
  // only ALL subquery has upper not
402
403
  subs_type substype() { return all?ALL_SUBS:ANY_SUBS; }
403
 
  trans_res select_transformer(JOIN *join);
 
404
  trans_res select_transformer(Join *join);
404
405
  virtual void print(String *str, enum_query_type query_type);
405
406
};
406
407
 
429
430
    res_field_type= DRIZZLE_TYPE_VARCHAR;
430
431
    maybe_null= 0;
431
432
  }
432
 
  virtual ~subselect_engine() {}; // to satisfy compiler
 
433
  virtual ~subselect_engine() {} // to satisfy compiler
433
434
  virtual void cleanup()= 0;
434
435
 
435
436
  /*
462
463
  */
463
464
  virtual int exec()= 0;
464
465
  virtual uint32_t cols()= 0; /* return number of columns in select */
465
 
  virtual uint8_t uncacheable()= 0; /* query is uncacheable */
 
466
  virtual bool uncacheable()= 0; /* query is uncacheable */
 
467
  virtual bool uncacheable(uint32_t bit_pos)= 0; /* query is uncacheable */
466
468
  enum Item_result type() { return res_type; }
467
469
  enum_field_types field_type() { return res_field_type; }
468
470
  virtual void exclude()= 0;
469
 
  virtual bool may_be_null() { return maybe_null; };
 
471
  virtual bool may_be_null() { return maybe_null; }
470
472
  virtual table_map upper_select_const_tables()= 0;
471
473
  static table_map calc_const_tables(TableList *);
472
474
  virtual void print(String *str, enum_query_type query_type)= 0;
489
491
  bool optimized; /* simple subselect is optimized */
490
492
  bool executed; /* simple subselect is executed */
491
493
  Select_Lex *select_lex; /* corresponding select_lex */
492
 
  JOIN * join; /* corresponding JOIN structure */
 
494
  Join * join; /* corresponding JOIN structure */
493
495
public:
494
496
  subselect_single_select_engine(Select_Lex *select,
495
497
                                 select_result_interceptor *result,
499
501
  void fix_length_and_dec(Item_cache** row);
500
502
  int exec();
501
503
  uint32_t cols();
502
 
  uint8_t uncacheable();
 
504
  bool uncacheable();
 
505
  bool uncacheable(uint32_t bit_pos);
503
506
  void exclude();
504
507
  table_map upper_select_const_tables();
505
508
  virtual void print (String *str, enum_query_type query_type);
527
530
  void fix_length_and_dec(Item_cache** row);
528
531
  int exec();
529
532
  uint32_t cols();
530
 
  uint8_t uncacheable();
 
533
  bool uncacheable();
 
534
  bool uncacheable(uint32_t bit_pos);
531
535
  void exclude();
532
536
  table_map upper_select_const_tables();
533
537
  virtual void print (String *str, enum_query_type query_type);
572
576
  bool null_keypart; /* TRUE <=> constructed search tuple has a NULL */
573
577
public:
574
578
 
575
 
  // constructor can assign Session because it will be called after JOIN::prepare
 
579
  // constructor can assign Session because it will be called after Join::prepare
576
580
  subselect_uniquesubquery_engine(Session *session_arg, JoinTable *tab_arg,
577
581
                                  Item_subselect *subs, Item *where)
578
582
    :subselect_engine(subs, 0), tab(tab_arg), cond(where)
584
588
  void fix_length_and_dec(Item_cache** row);
585
589
  int exec();
586
590
  uint32_t cols() { return 1; }
587
 
  uint8_t uncacheable() { return UNCACHEABLE_DEPENDENT; }
 
591
  bool uncacheable() { return true; }
 
592
  bool uncacheable(uint32_t) { return true; }
588
593
  void exclude();
589
594
  table_map upper_select_const_tables() { return 0; }
590
595
  virtual void print (String *str, enum_query_type query_type);
633
638
  Item *having;
634
639
public:
635
640
 
636
 
  // constructor can assign Session because it will be called after JOIN::prepare
 
641
  // constructor can assign Session because it will be called after Join::prepare
637
642
  subselect_indexsubquery_engine(Session *session_arg, JoinTable *tab_arg,
638
643
                                 Item_subselect *subs, Item *where,
639
644
                                 Item *having_arg, bool chk_null)
681
686
    QEP to execute the subquery and materialize its result into a
682
687
    temporary table. Created during the first call to exec().
683
688
  */
684
 
  JOIN *materialize_join;
 
689
  Join *materialize_join;
685
690
  /* Temp table context of the outer select's JOIN. */
686
691
  Tmp_Table_Param *tmp_param;
687
692