~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_subselect.h

  • Committer: Brian Aker
  • Date: 2008-10-20 04:28:21 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020042821-rqqdrccuu8195k3y
Second pass of thd cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
  bool value_assigned; /* value already assigned to subselect */
37
37
public:
38
38
  /* thread handler, will be assigned in fix_fields only */
39
 
  Session *thd;
 
39
  Session *session;
40
40
  /* substitution instead of subselect in case of optimization */
41
41
  Item *substitution;
42
42
  /* unit of subquery */
98
98
    update_null_value();
99
99
    return null_value;
100
100
  }
101
 
  bool fix_fields(Session *thd, Item **ref);
 
101
  bool fix_fields(Session *session, Item **ref);
102
102
  virtual bool exec();
103
103
  virtual void fix_length_and_dec();
104
104
  table_map used_tables() const;
106
106
  bool const_item() const;
107
107
  inline table_map get_used_tables_cache() { return used_tables_cache; }
108
108
  inline bool get_const_item_cache() { return const_item_cache; }
109
 
  Item *get_tmp_table_item(Session *thd);
 
109
  Item *get_tmp_table_item(Session *session);
110
110
  void update_used_tables();
111
111
  virtual void print(String *str, enum_query_type query_type);
112
112
  virtual bool have_guarded_conds() { return false; }
206
206
  bool max;
207
207
  bool was_values;  // Set if we have found at least one row
208
208
public:
209
 
  Item_maxmin_subselect(Session *thd, Item_subselect *parent,
 
209
  Item_maxmin_subselect(Session *session, Item_subselect *parent,
210
210
                        st_select_lex *select_lex, bool max);
211
211
  virtual void print(String *str, enum_query_type query_type);
212
212
  void cleanup();
351
351
  inline bool is_top_level_item() { return abort_on_null; }
352
352
  bool test_limit(st_select_lex_unit *unit);
353
353
  virtual void print(String *str, enum_query_type query_type);
354
 
  bool fix_fields(Session *thd, Item **ref);
 
354
  bool fix_fields(Session *session, Item **ref);
355
355
  bool setup_engine();
356
356
  bool init_left_expr_cache();
357
357
  bool is_expensive_processor(unsigned char *arg);
386
386
{
387
387
protected:
388
388
  select_result_interceptor *result; /* results storage class */
389
 
  Session *thd; /* pointer to current Session */
 
389
  Session *session; /* pointer to current Session */
390
390
  Item_subselect *item; /* item, that use this engine */
391
391
  enum Item_result res_type; /* type of results */
392
392
  enum_field_types res_field_type; /* column type of the results */
398
398
                         INDEXSUBQUERY_ENGINE, HASH_SJ_ENGINE};
399
399
 
400
400
  subselect_engine(Item_subselect *si, select_result_interceptor *res)
401
 
    :thd(0)
 
401
    :session(0)
402
402
  {
403
403
    result= res;
404
404
    item= si;
410
410
  virtual void cleanup()= 0;
411
411
 
412
412
  /*
413
 
    Also sets "thd" for subselect_engine::result.
 
413
    Also sets "session" for subselect_engine::result.
414
414
    Should be called before prepare().
415
415
  */
416
 
  void set_thd(Session *thd_arg);
417
 
  Session * get_thd() { return thd; }
 
416
  void set_session(Session *session_arg);
 
417
  Session * get_session() { return session; }
418
418
  virtual int prepare()= 0;
419
419
  virtual void fix_length_and_dec(Item_cache** row)= 0;
420
420
  /*
550
550
public:
551
551
 
552
552
  // constructor can assign Session because it will be called after JOIN::prepare
553
 
  subselect_uniquesubquery_engine(Session *thd_arg, st_join_table *tab_arg,
 
553
  subselect_uniquesubquery_engine(Session *session_arg, st_join_table *tab_arg,
554
554
                                  Item_subselect *subs, Item *where)
555
555
    :subselect_engine(subs, 0), tab(tab_arg), cond(where)
556
556
  {
557
 
    set_thd(thd_arg);
 
557
    set_session(session_arg);
558
558
  }
559
559
  void cleanup();
560
560
  int prepare();
611
611
public:
612
612
 
613
613
  // constructor can assign Session because it will be called after JOIN::prepare
614
 
  subselect_indexsubquery_engine(Session *thd_arg, st_join_table *tab_arg,
 
614
  subselect_indexsubquery_engine(Session *session_arg, st_join_table *tab_arg,
615
615
                                 Item_subselect *subs, Item *where,
616
616
                                 Item *having_arg, bool chk_null)
617
 
    :subselect_uniquesubquery_engine(thd_arg, tab_arg, subs, where),
 
617
    :subselect_uniquesubquery_engine(session_arg, tab_arg, subs, where),
618
618
     check_null(chk_null),
619
619
     having(having_arg)
620
620
  {}
663
663
  TMP_TABLE_PARAM *tmp_param;
664
664
 
665
665
public:
666
 
  subselect_hash_sj_engine(Session *thd, Item_subselect *in_predicate,
 
666
  subselect_hash_sj_engine(Session *session, Item_subselect *in_predicate,
667
667
                               subselect_single_select_engine *old_engine)
668
 
    :subselect_uniquesubquery_engine(thd, NULL, in_predicate, NULL),
 
668
    :subselect_uniquesubquery_engine(session, NULL, in_predicate, NULL),
669
669
    is_materialized(false), materialize_engine(old_engine),
670
670
    materialize_join(NULL), tmp_param(NULL)
671
671
  {}