List:Commits« Previous MessageNext Message »
From:Martin Hansson Date:May 23 2011 6:31pm
Subject:bzr commit into mysql-trunk branch (martin.hansson:3368)
View as plain text  
#At file:///data0/martin/bzrroot/wl5855/mysql-trunk-prototype/ based on revid:azundris@stripped

 3368 Martin Hansson	2011-05-23
      Replaced the st_join_table typedef with a C++ class declaration.

    modified:
      sql/item_cmpfunc.h
      sql/item_subselect.h
      sql/records.h
      sql/sql_select.cc
      sql/sql_select.h
      sql/structs.h
      sql/table.h
=== modified file 'sql/item_cmpfunc.h'
--- a/sql/item_cmpfunc.h	2011-03-22 11:44:40 +0000
+++ b/sql/item_cmpfunc.h	2011-05-23 18:31:10 +0000
@@ -1628,7 +1628,7 @@ public:
   for them. We have to take care of restricting the predicate such an
   object represents f1=f2= ...=fn to the projection of known fields fi1=...=fik.
 */
-struct st_join_table;
+class JOIN_TAB;
 
 class Item_equal: public Item_bool_func
 {
@@ -1675,7 +1675,7 @@ public:
   virtual void print(String *str, enum_query_type query_type);
   const CHARSET_INFO *compare_collation() 
   { return fields.head()->collation.collation; }
-  friend bool setup_sj_materialization(struct st_join_table *tab);
+  friend bool setup_sj_materialization(JOIN_TAB *tab);
 }; 
 
 class COND_EQUAL: public Sql_alloc

=== modified file 'sql/item_subselect.h'
--- a/sql/item_subselect.h	2011-04-06 11:13:33 +0000
+++ b/sql/item_subselect.h	2011-05-23 18:31:10 +0000
@@ -573,7 +573,7 @@ private:
 };
 
 
-struct st_join_table;
+class JOIN_TAB;
 
 
 /*
@@ -596,7 +596,7 @@ struct st_join_table;
 class subselect_uniquesubquery_engine: public subselect_engine
 {
 protected:
-  st_join_table *tab;
+  JOIN_TAB *tab;
   Item *cond; /* The WHERE condition of subselect */
   /* 
     TRUE<=> last execution produced empty set. Valid only when left
@@ -607,7 +607,7 @@ protected:
 public:
 
   // constructor can assign THD because it will be called after JOIN::prepare
-  subselect_uniquesubquery_engine(THD *thd_arg, st_join_table *tab_arg,
+  subselect_uniquesubquery_engine(THD *thd_arg, JOIN_TAB *tab_arg,
 				  Item_subselect *subs, Item *where)
     :subselect_engine(subs, 0), tab(tab_arg), cond(where)
   {
@@ -670,7 +670,7 @@ private:
 public:
 
   // constructor can assign THD because it will be called after JOIN::prepare
-  subselect_indexsubquery_engine(THD *thd_arg, st_join_table *tab_arg,
+  subselect_indexsubquery_engine(THD *thd_arg, JOIN_TAB *tab_arg,
 				 Item_subselect *subs, Item *where,
                                  Item *having_arg, bool chk_null)
     :subselect_uniquesubquery_engine(thd_arg, tab_arg, subs, where),

=== modified file 'sql/records.h'
--- a/sql/records.h	2011-03-22 11:44:40 +0000
+++ b/sql/records.h	2011-05-23 18:31:10 +0000
@@ -17,7 +17,7 @@
 
 #include <my_global.h>                /* for uint typedefs */
 
-struct st_join_table;
+class JOIN_TAB;
 class handler;
 struct TABLE;
 class THD;
@@ -41,8 +41,8 @@ class Copy_field;
 struct READ_RECORD
 {
   typedef int (*Read_func)(READ_RECORD*);
-  typedef void (*Unlock_row_func)(st_join_table *);
-  typedef int (*Setup_func)(struct st_join_table*);
+  typedef void (*Unlock_row_func)(JOIN_TAB *);
+  typedef int (*Setup_func)(JOIN_TAB*);
 
   TABLE *table;                                 /* Head-form */
   handler *file;
@@ -78,6 +78,6 @@ void init_read_record_idx(READ_RECORD *i
                           bool print_error, uint idx, bool reverse);
 void end_read_record(READ_RECORD *info);
 
-void rr_unlock_row(st_join_table *tab);
+void rr_unlock_row(JOIN_TAB *tab);
 
 #endif /* SQL_RECORDS_H */

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-05-03 06:46:06 +0000
+++ b/sql/sql_select.cc	2011-05-23 18:31:10 +0000
@@ -149,7 +149,7 @@ static int join_read_system(JOIN_TAB *ta
 static int join_read_const(JOIN_TAB *tab);
 static int join_read_key(JOIN_TAB *tab);
 static int join_read_key2(JOIN_TAB *tab, TABLE *table, TABLE_REF *table_ref);
-static void join_read_key_unlock_row(st_join_table *tab);
+static void join_read_key_unlock_row(JOIN_TAB *tab);
 static int join_read_always_key(JOIN_TAB *tab);
 static int join_read_last_key(JOIN_TAB *tab);
 static int join_no_more_records(READ_RECORD *info);
@@ -10477,7 +10477,7 @@ static void push_index_cond(JOIN_TAB *ta
   used in all access methods.
 */
 
-void rr_unlock_row(st_join_table *tab)
+void rr_unlock_row(JOIN_TAB *tab)
 {
   READ_RECORD *info= &tab->read_record;
   info->file->unlock_row();
@@ -18365,7 +18365,7 @@ join_read_key2(JOIN_TAB *tab, TABLE *tab
 */
 
 static void
-join_read_key_unlock_row(st_join_table *tab)
+join_read_key_unlock_row(JOIN_TAB *tab)
 {
   DBUG_ASSERT(tab->ref.use_count);
   if (tab->ref.use_count)

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2011-05-02 11:51:41 +0000
+++ b/sql/sql_select.h	2011-05-23 18:31:10 +0000
@@ -228,9 +228,10 @@ enum enum_nested_loop_state
 
 class JOIN_CACHE;
 class SJ_TMP_TABLE;
+class JOIN_TAB;
 
 typedef enum_nested_loop_state
-(*Next_select_func)(JOIN *, struct st_join_table *, bool);
+(*Next_select_func)(JOIN *, JOIN_TAB *, bool);
 Next_select_func setup_end_select_func(JOIN *join);
 int rr_sequential(READ_RECORD *info);
 
@@ -251,10 +252,10 @@ inline bool sj_is_materialize_strategy(u
 */
 enum quick_type { QS_NONE, QS_RANGE, QS_DYNAMIC_RANGE};
 
-typedef struct st_join_table : public Sql_alloc
+class JOIN_TAB : public Sql_alloc
 {
-  st_join_table();
-
+public:
+  JOIN_TAB();
   TABLE		*table;
   Key_use	*keyuse;			/**< pointer to first used key */
   SQL_SELECT	*select;
@@ -264,12 +265,12 @@ public:
   QUICK_SELECT_I *quick;
   Item	       **on_expr_ref;   /**< pointer to the associated on expression   */
   COND_EQUAL    *cond_equal;    /**< multiple equalities for the on expression */
-  st_join_table *first_inner;   /**< first inner table for including outerjoin */
+  JOIN_TAB *first_inner;   /**< first inner table for including outerjoin */
   bool           found;         /**< true after all matches or null complement */
   bool           not_null_compl;/**< true before null complement is added      */
-  st_join_table *last_inner;    /**< last table table for embedding outer join */
-  st_join_table *first_upper;  /**< first inner table for embedding outer join */
-  st_join_table *first_unmatched; /**< used for optimization purposes only     */
+  JOIN_TAB *last_inner;    /**< last table table for embedding outer join */
+  JOIN_TAB *first_upper;  /**< first inner table for embedding outer join */
+  JOIN_TAB *first_unmatched; /**< used for optimization purposes only     */
   /* 
     The value of m_condition before we've attempted to do Index Condition
     Pushdown. We may need to restore everything back if we first choose one
@@ -367,8 +368,8 @@ public:
     interval (all tables inside are inner of a semijoin) or
     not. last_sj_inner_tab is not set for Duplicates Weedout.
   */
-  struct st_join_table *first_sj_inner_tab;
-  struct st_join_table *last_sj_inner_tab;
+  JOIN_TAB *first_sj_inner_tab;
+  JOIN_TAB *last_sj_inner_tab;
 
   /* Variables for semi-join duplicate elimination */
   SJ_TMP_TABLE  *flush_weedout_table;
@@ -380,7 +381,7 @@ public:
     join->join_tab[-1] which means stop join execution after the first
     match.
   */
-  struct st_join_table  *do_firstmatch;
+  JOIN_TAB  *do_firstmatch;
  
   /* 
      ptr  - We're doing a LooseScan, this join tab is the first (i.e. 
@@ -389,7 +390,7 @@ public:
             should be checked to see if the current value group had a match.
      NULL - Not doing a loose scan on this join tab.
   */
-  struct st_join_table *loosescan_match_tab;
+  JOIN_TAB *loosescan_match_tab;
 
   /* Buffer to save index tuple to be able to skip duplicates */
   uchar *loosescan_buf;
@@ -485,10 +486,10 @@ public:
   {
     return ref.has_guarded_conds();
   }
-} JOIN_TAB;
+};
 
 inline
-st_join_table::st_join_table()
+JOIN_TAB::JOIN_TAB()
   : table(NULL),
     keyuse(NULL),
     select(NULL),

=== modified file 'sql/structs.h'
--- a/sql/structs.h	2011-04-26 08:49:10 +0000
+++ b/sql/structs.h	2011-05-23 18:31:10 +0000
@@ -114,10 +114,10 @@ typedef struct st_key {
 } KEY;
 
 
-struct st_join_table;
+class JOIN_TAB;
 
 typedef struct st_reginfo {		/* Extra info about reg */
-  struct st_join_table *join_tab;	/* Used by SELECT() */
+  JOIN_TAB *join_tab;	/* Used by SELECT() */
   enum thr_lock_type lock_type;		/* How database is used */
   bool not_exists_optimize;
   /*

=== modified file 'sql/table.h'
--- a/sql/table.h	2011-05-04 07:51:15 +0000
+++ b/sql/table.h	2011-05-23 18:31:10 +0000
@@ -2039,7 +2039,7 @@ typedef struct st_nested_join
     Used for pointing out the first table in the plan being covered by this
     join nest. It is used exclusively within make_outerjoin_info().
    */
-  struct st_join_table *first_nested;
+  JOIN_TAB *first_nested;
   /* 
     Used to count tables in the nested join in 2 isolated places:
     1. In make_outerjoin_info(). 


Attachment: [text/bzr-bundle] bzr/martin.hansson@oracle.com-20110523183110-5qywmig0y4fpji9e.bundle
Thread
bzr commit into mysql-trunk branch (martin.hansson:3368) Martin Hansson23 May
Re: bzr commit into mysql-trunk branch (martin.hansson:3368)Jorgen Loland24 May
  • Re: bzr commit into mysql-trunk branch (martin.hansson:3368)Roy Lyseng24 May
    • Re: bzr commit into mysql-trunk branch (martin.hansson:3368)Martin Hansson24 May
      • Re: bzr commit into mysql-trunk branch (martin.hansson:3368)Roy Lyseng24 May
        • Re: bzr commit into mysql-trunk branch (martin.hansson:3368)Ole John Aske24 May